Remote / foldkit-remote-domain

LayerConfig

interface · packages/remote-domain/src/adapter/layer.ts:60

interface LayerConfig<A extends AnyApi> {
  readonly views: ReadonlyArray<ViewBinding<any, A>>
  readonly commands: ReadonlyArray<CommandBinding<any, A>>
  readonly queries?: ReadonlyArray<QueryBinding<any, A>>
  readonly principal: Effect.Effect<Option.Option<string>>
  readonly denied: (error: DeniedOf<A>) => 'Unauthenticated' | 'Forbidden'
  readonly confirmWithin?: Duration.Input
}

How DomainRemote.layer answers Remote.

Members

LayerConfig.views

property · packages/remote-domain/src/adapter/layer.ts:61

readonly views: ReadonlyArray<ViewBinding<any, A>>

LayerConfig.commands

property · packages/remote-domain/src/adapter/layer.ts:62

readonly commands: ReadonlyArray<CommandBinding<any, A>>

LayerConfig.queries

property · packages/remote-domain/src/adapter/layer.ts:64

readonly queries?: ReadonlyArray<QueryBinding<any, A>>

The lists, each a Remote query answered by a paged Domain Query (DomainRemote.query).

LayerConfig.principal

property · packages/remote-domain/src/adapter/layer.ts:66

readonly principal: Effect.Effect<Option.Option<string>>

The key of who the Domain session is: what results name as their principal.

LayerConfig.denied

property · packages/remote-domain/src/adapter/layer.ts:68

readonly denied: (error: DeniedOf<A>) => 'Unauthenticated' | 'Forbidden'

What a middleware's refusal of a write means to Remote; a read's is always Unauthenticated.

LayerConfig.confirmWithin

property · packages/remote-domain/src/adapter/layer.ts:70

readonly confirmWithin?: Duration.Input

How long a read waits for its View, the Api's client giving no deadline. 2 seconds by default.