Remote / API

foldkit-remote-server

foldkit-remote-server — server-side Sources and handler compilation.

Owns entity/query Sources, selection authorization, normalization, and turning them into Effect RPC handlers. It does not own HTTP, serialization, or auth protocol; principal is resolved outside, and passed in or provided.

Namespaces

Functions

assertSupportedRefuses a body needing an operation this interpreter does not run, rather than skipping it and answering a different question. Called by evaluate; call it…
bodyLimitEffect HTTP middleware refusing a request body over maxBytes (default 1 MiB, serveFetch's) with a 413 and Remote's tooLarge answer, before the endpoint…
checkAggregateRuleVerify that store can enforce a row-aggregate data rule (such as a parent entity summing its children). On stores that only isolate a single statement (like…
evaluateThe rows the body matches, in the order it asks for. Pure: it reads the rows it is given and nothing else.
exprContextWhat a body's Expr.viewer and Expr.now read on this server: the viewer the request was given, and the server's clock. A body that reads the viewer in a run…

Values

DeleteOutcomeWhat a writer's delete did. Deleted: the row is gone, with cascaded, the rows declared to go with it (Relation.one(…, { onDelete: 'cascade' })) that the…
RowRequirementWhat the row an update or a delete finds must hold for it to land, judged in the statement that writes it: a guard's rule that reads another row (a path, an…
supportedThe operations this interpreter runs. It is the reference, so this is the whole kernel — but it is declared rather than assumed, because an interpreter that…

Classes

MutationRefusedA mutation Source's refusal, as the value its descriptor's Refusal declares: made with RemoteServer.refuse, which checks the value's type against the…
QueryEvaluateError
RemoteInvalidA writer's word that the row a write would leave breaks one of its Entity's invariants: RemoteServer.write answers it as the mutation's Invalid refusal.…
RemoteServerErrorA Source's failure. Its message and cause stay on this side: the server reports them as a ServerDefect and answers "Internal error" with the id it reported…
RemoteTakenA writer's word that a row already holds the id an insert names, and its ledger records no insert of this operation that made it: RemoteServer.write answers…
RemoteUnmetA writer's word that the row does not hold what the write's when asks of it, where the write would commit: RemoteServer.write answers it as the mutation's…

Interfaces

AnswerUnreadA mutation that committed, answered without the read of the rows it names or of a list it was asked for: the client reads them again.
CachedReadDiffersA read the server judged public answered otherwise for who asked than for the visitor (serveFetch's cache.check): its declaration or a source's read depends…
CascadedRowA row a delete removed with the row it was asked to delete (onDelete: 'cascade').
CascadeRequirementWhat each row of entity a cascading delete would take must hold (#348): that Entity's Delete rule for the person deleting. A writer with cascades refuses…
ClockSkewedA write sent at a time further from this server's clock than its clockSkew: the server wrote its own time instead, so what the client predicted of it is off…
EntityRecord
EntitySource
EntitySourceContext
EntityWriter
HandlerOptions
InternalFailureWhat a caller is told of a failure on this side: that there was one, and the id it was reported under.
LiveHubThe server-side "these fields changed" signal. A hub tracks each live subscriber's requirements (entity, id, fields) and principal; changed re-reads the…
LiveQueryA list a subscriber reads live (liveQuery(Data, …)), admitted and resolved by handlers: what a live source diffs to tell a row that joins, changes or leaves it.
LiveSource
MemoryBackend
MemoryServedA memory backend made without a principal: its rows and the server over them, answered as whoever its caller names per request (serveFetch,…
MemoryStoreThe rows a memory backend holds, which its mutations write through. A change is what the next read sees; nothing is pushed to a client.
MemoryWriterOptionsWhat RemoteServer.memoryWriter is made with.
MutationOutcome
MutationSource
PublishFailedA mutation that committed, whose live publish failed: live subscribers do not hear it.
QueryPage
QuerySource
ReadPlanWhat EntitySource.filter decides for one read.
ServerDefectA failure on this side, answered "Internal error": a defect, or a Source's failure it did not write for its caller (RemoteServer.tell). The caller is told…
ServerDefinition
StoreCapabilitiesWhat a store or adapter declares it guarantees.
StoreRequirementOne declared rule, the capability it needs and why.
WriteRequirementA row requirement, and the words a refusal of it gives, when its rule explains itself.
WriteWhenA write's precondition as a writer is handed it: the body, and the input encoded.

Types

ConnectionChangeA connection change a mutation made, as the wire carries it.
LinkRelationA one relation: what a row links through, and what a delete may act through.
MemoryAnsweringWhat a backend needs to give a layer: a principal to answer as, or one undefined can be.
MemoryConfigWhat RemoteServer.memory is made from. See memory.
MemoryReadableWhether a stored row of entity may be read, given its whole stored values.
MemoryRowsOne entity's rows in their wire shape: a relation is its ref key, 'User:u1'.
RemoteServerDiagnosticEvery diagnostic a Remote server reports.
RowA row as a run reads one: values by field key, encoded.