logical.Routedtypeno test imports ittype Routed = { readonly kind: "apply"; readonly patch: Patch } | { readonly kind: "outbox"; readonly entry: OutboxEntry };What a patch comes to for a source.
The outbox (0037-planning FR-014, FR-033): a patch is applied only to a source that declares the capability it needs; for any other it is an outbox entry that names the capability, or the reason the place cannot say it, and is offered again when a source that can apply it is given. Pure.
import { route } from "./outbox.ts";
// route(patch, { name: "markdown", capabilities }, now).kind // "apply" or "outbox"logical.Routedtypeno test imports ittype Routed = { readonly kind: "apply"; readonly patch: Patch } | { readonly kind: "outbox"; readonly entry: OutboxEntry };What a patch comes to for a source.
logical.routefunctionno test imports itfunction route(patch: Patch, source: { readonly name: string; readonly capabilities: ReadonlySet<"append-event" | "assign" | "close" | "create" | "delete" | "edit" | "read">; }, at: Instant): RoutedWhether a patch is applied to a source with these capabilities or waits in the outbox, naming the capability the source lacks.
logical.redeliverfunctionno test imports itfunction redeliver(entries: readonly OutboxEntry[], source: { readonly name: string; readonly capabilities: ReadonlySet<"append-event" | "assign" | "close" | "create" | "delete" | "edit" | "read">; }, place: string): { readonly patches: readonly Patch[]; readonly waiting: readonly OutboxEntry[]; }The entries a source can now apply, as patches for that source and place, and the entries that still wait.
Routedtypeno test imports ittype Routed = { readonly kind: "apply"; readonly patch: Patch } | { readonly kind: "outbox"; readonly entry: OutboxEntry };What a patch comes to for a source.
routefunctionno test imports itfunction route(patch: Patch, source: { readonly name: string; readonly capabilities: ReadonlySet<"append-event" | "assign" | "close" | "create" | "delete" | "edit" | "read">; }, at: Instant): RoutedWhether a patch is applied to a source with these capabilities or waits in the outbox, naming the capability the source lacks.
redeliverfunctionno test imports itfunction redeliver(entries: readonly OutboxEntry[], source: { readonly name: string; readonly capabilities: ReadonlySet<"append-event" | "assign" | "close" | "create" | "delete" | "edit" | "read">; }, place: string): { readonly patches: readonly Patch[]; readonly waiting: readonly OutboxEntry[]; }The entries a source can now apply, as patches for that source and place, and the entries that still wait.