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
assertSupported | Refuses a body needing an operation this interpreter does not run, rather than skipping it and answering a different question. Called by evaluate; call it… |
bodyLimit | Effect HTTP middleware refusing a request body over maxBytes (default 1 MiB, serveFetch's) with a 413 and Remote's tooLarge answer, before the endpoint… |
checkAggregateRule | Verify 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… |
evaluate | The rows the body matches, in the order it asks for. Pure: it reads the rows it is given and nothing else. |
exprContext | What 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
DeleteOutcome | What 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… |
RowRequirement | What 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… |
supported | The 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
MutationRefused | A 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 | |
RemoteInvalid | A 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.… |
RemoteServerError | A 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… |
RemoteTaken | A 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… |
RemoteUnmet | A 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
AnswerUnread | A 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. |
CachedReadDiffers | A 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… |
CascadedRow | A row a delete removed with the row it was asked to delete (onDelete: 'cascade'). |
CascadeRequirement | What 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… |
ClockSkewed | A 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 | |
InternalFailure | What a caller is told of a failure on this side: that there was one, and the id it was reported under. |
LiveHub | The server-side "these fields changed" signal. A hub tracks each live subscriber's requirements (entity, id, fields) and principal; changed re-reads the… |
LiveQuery | A 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 | |
MemoryServed | A memory backend made without a principal: its rows and the server over them, answered as whoever its caller names per request (serveFetch,… |
MemoryStore | The rows a memory backend holds, which its mutations write through. A change is what the next read sees; nothing is pushed to a client. |
MemoryWriterOptions | What RemoteServer.memoryWriter is made with. |
MutationOutcome | |
MutationSource | |
PublishFailed | A mutation that committed, whose live publish failed: live subscribers do not hear it. |
QueryPage | |
QuerySource | |
ReadPlan | What EntitySource.filter decides for one read. |
ServerDefect | A 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 | |
StoreCapabilities | What a store or adapter declares it guarantees. |
StoreRequirement | One declared rule, the capability it needs and why. |
WriteRequirement | A row requirement, and the words a refusal of it gives, when its rule explains itself. |
WriteWhen | A write's precondition as a writer is handed it: the body, and the input encoded. |
Types
ConnectionChange | A connection change a mutation made, as the wire carries it. |
LinkRelation | A one relation: what a row links through, and what a delete may act through. |
MemoryAnswering | What a backend needs to give a layer: a principal to answer as, or one undefined can be. |
MemoryConfig | What RemoteServer.memory is made from. See memory. |
MemoryReadable | Whether a stored row of entity may be read, given its whole stored values. |
MemoryRows | One entity's rows in their wire shape: a relation is its ref key, 'User:u1'. |
RemoteServerDiagnostic | Every diagnostic a Remote server reports. |
Row | A row as a run reads one: values by field key, encoded. |