EntitySource.entity
property · packages/remote-server/src/index.ts:100
readonly entity: stringRemote / foldkit-remote-server
interface · packages/remote-server/src/index.ts:99
interface EntitySource<P, R = never> {
readonly entity: string
readonly fields?: ReadonlySet<string> | undefined
readonly read: (
context: EntitySourceContext<P>,
) => Effect.Effect<ReadonlyArray<EntityRecord>, RemoteServerError, R>
readonly authorize?: (
principal: P,
fields: readonly string[],
) => readonly string[]
readonly filter?: (
principal: P,
fields: readonly string[],
) => Effect.Effect<ReadPlan, RemoteServerError, R>
readonly visible?: unknown
readonly shared?: ReadonlySet<string> | undefined
}EntitySource.entityproperty · packages/remote-server/src/index.ts:100
readonly entity: stringEntitySource.fieldsproperty · packages/remote-server/src/index.ts:102
readonly fields?: ReadonlySet<string> | undefinedThe fields the entity declares; a request for any other never reaches read.
EntitySource.readproperty · packages/remote-server/src/index.ts:103
readonly read: (
context: EntitySourceContext<P>,
) => Effect.Effect<ReadonlyArray<EntityRecord>, RemoteServerError, R>EntitySource.authorizeproperty · packages/remote-server/src/index.ts:107
readonly authorize?: (
principal: P,
fields: readonly string[],
) => readonly string[]Returns the fields this principal may read; omitted means all requested.
EntitySource.filterproperty · packages/remote-server/src/index.ts:113
readonly filter?: (
principal: P,
fields: readonly string[],
) => Effect.Effect<ReadPlan, RemoteServerError, R>Decides, per record, what a principal sees of the fields authorize
allowed: run once per read, before read. A member it drops from a
record is settled unread, as one the source did not return.
EntitySource.visibleproperty · packages/remote-server/src/index.ts:124
readonly visible?: unknownThe rule that decides which rows this source returns, as it was given one
(a Drizzle binding's visible, RemoteServer.memory's readable). The
server never runs it: it is here so a check at startup, such as
GuardServer.validate, can confirm a source applies the rule its Entity
requires.
EntitySource.sharedproperty · packages/remote-server/src/index.ts:131
readonly shared?: ReadonlySet<string> | undefinedThe fields every principal reads alike, of every row: no rule about who is asking hides the row or the field, or changes its value. A promise the server keeps by trusting it: the live hub sends a declared write's value of one to every subscriber as it is, with no read per principal.