Optional ReadonlygetRead one entry. MUST return undefined when the entry is missing OR its
expiresAt is <= Date.now() (lazy expiry — expired rows may still exist
physically until purged).
Optional ReadonlysetUpsert one entry as a SINGLE atomic write that replaces both value and
expiresAt (no read-modify-write inside the store). An entry whose
expiresAt is already in the past may be dropped instead of written.
Optional ReadonlydeleteDelete one key (namespace + key), one whole namespace (key omitted)
or every namespace of the user (namespace omitted; key is then ignored).
Deleting missing data is a no-op.
Optional ReadonlylistLive (non-expired) entries of a user — all namespaces, or just namespace. Order unspecified.
Optional ReadonlypurgePhysically remove entries whose expiresAt <= now (default Date.now())
across the whole store; resolves with how many were removed. Stores with
native expiry (Redis) resolve 0.
Optional ReadonlysetCompare-and-set checkpoint write (multi-replica coordination). Succeeds (resolves
true) only when the stored row's FlowCheckpoint.revision equals
expectedRevision, where 0 means "no row, or a row without revision"; otherwise
the row is left untouched and it resolves false. ONE atomic statement per store
(never a read-modify-write), so two replicas racing on one key see exactly one winner.
expectedRevision is a non-negative integer (RangeError otherwise). Optional: a
store without it keeps the local-fence behaviour; all six built-in stores implement it
and pass the shared conformance block (test-utils/store-conformance.ts).
Optional ReadonlyclearConditional delete: true when the row is absent, or its revision (0 without one)
matched expectedRevision and it was deleted; false when a different revision is
stored (the row is left untouched). Same atomicity rule as setCheckpointIf.
ReadonlyinnerReadonlynamespaceOptionallimit: numberShallow-merge chat onto the stored record. An own field set to undefined UNSETS
that field, so a partial upsert must omit what it does not know (the Bot does).
Shallow-merge contact onto the stored record; same undefined = unset rule as upsertChat.
Delivery cursor for long-poll/webhook transports (Telegram update_id).
Isolates every opaque store key by tenant/bot/provider connection while preserving the public, unprefixed ids seen by callers.