A Domain Api as Remote's authority: layer answers RemoteClient from the
Api's client, through Views bound to Entities (view) and commands bound
to mutations (command), and lists bound to paged Queries (query), each
Rejection answered as refuse, forbid, unauthenticated or fail says.
view<E extends AnyEntity, A extends AnyApi,const Name extends ViewNameOf<A>>( entity: E, api: A, name: Name, config: ViewConfig<E>,): ViewBinding<E, A>
Binds a View to the Entity whose rows it serves. Throws, naming it, for a
View the Api does not serve, an Entity field its state lacks, or a
revision the Entity does not store as a number.
command< M extends AnyMutation, A extends AnyApi,const Name extends CommandNameOf<A>, Given extends AnyEntity = never,>( mutation: M, api: A, name: Name, config: CommandConfig<M, CommandOf<A, Name>, EntityOfMutation<M, Given>>,): CommandBinding<M, A>
Binds a command to the mutation it lands. Throws, naming it, for a command
the Api does not serve, and for written on an Entity whose reader may not
be every writer.
query< D extends AnyListQuery, A extends AnyApi,const Name extends PagedQueryNameOf<A>,>( descriptor: D, api: A, name: Name, config: QueryConfig<D, DomainQueryOf<A, Name>>,): QueryBinding<D, A>
Binds a Remote query to the paged Domain Query that answers it. Throws,
naming it, for a Query the Api does not serve or one that is not paged.
layer<A extends AnyApi>( api: A, config: LayerConfig<A>,): Layer.Layer<RemoteClient, never, ClientIdentifier<A>>
A RemoteClient answered from the Api's client. Reads and live reads go to
the bound Views; writes to the bound commands, each under a commandId
derived from who asks and what, so a retry is the same command and nothing
else is.