EntitySource.entity
property · packages/remote-server/src/index.ts:261
readonly entity: stringRemote / foldkit-remote-server
interface · packages/remote-server/src/index.ts:260
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
readonly perViewer?: ReadonlyArray<string> | undefined
readonly cache?: CachePolicy | undefined
}EntitySource.entityproperty · packages/remote-server/src/index.ts:261
readonly entity: stringEntitySource.fieldsproperty · packages/remote-server/src/index.ts:263
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:264
readonly read: (
context: EntitySourceContext<P>,
) => Effect.Effect<ReadonlyArray<EntityRecord>, RemoteServerError, R>EntitySource.authorizeproperty · packages/remote-server/src/index.ts:268
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:274
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:285
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:292
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.
EntitySource.perViewerproperty · packages/remote-server/src/index.ts:298
readonly perViewer?: ReadonlyArray<string> | undefinedThe members answered for whoever reads them (a Derived.exists): a
server mounting this source must have a viewer, and refuses to be made
without one.
EntitySource.cacheproperty · packages/remote-server/src/index.ts:304
readonly cache?: CachePolicy | undefinedHow long a read of these rows stays fresh, from the Entity's declaration
(EdgeCache.of). It never makes a read public: serveFetch caches one
only where nothing about it depends on who asks.