Implements
Constructors
Constructor
Parameters
Returns
NamespacedStore
Properties
getUserData?
undefined when the entry is missing OR its
expiresAt is <= Date.now() (lazy expiry — expired rows may still exist
physically until purged).
Parameters
Returns
Promise<UserDataEntry | undefined>
Implementation of
IStore.getUserData
setUserData?
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.
Parameters
Returns
Promise<void>
Implementation of
IStore.setUserData
deleteUserData?
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.
Parameters
Returns
Promise<void>
Implementation of
IStore.deleteUserData
listUserData?
namespace. Order unspecified.
Parameters
Returns
Promise<UserDataEntry[]>
Implementation of
IStore.listUserData
purgeExpiredUserData?
expiresAt <= now (default Date.now())
across the whole store; resolves with how many were removed. Stores with
native expiry (Redis) resolve 0.
Parameters
Returns
Promise<number>
Implementation of
IStore.purgeExpiredUserData
setCheckpointIf?
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).
Parameters
Returns
Promise<boolean>
Implementation of
IStore.setCheckpointIf
clearCheckpointIf?
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.
Parameters
Returns
Promise<boolean>
Implementation of
IStore.clearCheckpointIf
innerStore
namespace
Methods
saveMessage()
Parameters
Returns
Promise<void>
Implementation of
IStore.saveMessage
getMessage()
Parameters
Returns
Promise<StoredMessage | undefined>
Implementation of
IStore.getMessage
getMessagesByChat()
Parameters
Returns
Promise<StoredMessage[]>
Implementation of
IStore.getMessagesByChat
deleteMessage()
Parameters
Returns
Promise<void>
Implementation of
IStore.deleteMessage
upsertChat()
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).
Parameters
Returns
Promise<void>
Implementation of
IStore.upsertChat
getChat()
Parameters
Returns
Promise<StoredChat | undefined>
Implementation of
IStore.getChat
listChats()
Returns
Promise<StoredChat[]>
Implementation of
IStore.listChats
deleteChat()
Parameters
Returns
Promise<void>
Implementation of
IStore.deleteChat
upsertContact()
contact onto the stored record; same undefined = unset rule as upsertChat.
Parameters
Returns
Promise<void>
Implementation of
IStore.upsertContact
getContact()
Parameters
Returns
Promise<StoredContact | undefined>
Implementation of
IStore.getContact
listContacts()
Returns
Promise<StoredContact[]>
Implementation of
IStore.listContacts
deleteContact()
Parameters
Returns
Promise<void>
Implementation of
IStore.deleteContact
getCursor()
Parameters
Returns
Promise<string | undefined>
Implementation of
IStore.getCursor
setCursor()
Parameters
Returns
Promise<void>
Implementation of
IStore.setCursor
getConversation()
Parameters
Returns
Promise<AIMessage[] | undefined>
Implementation of
IStore.getConversation
setConversation()
Parameters
Returns
Promise<void>
Implementation of
IStore.setConversation
clearConversation()
Parameters
Returns
Promise<void>
Implementation of
IStore.clearConversation
getCheckpoint()
Parameters
Returns
Promise<FlowCheckpoint | undefined>
Implementation of
IStore.getCheckpoint
setCheckpoint()
Parameters
Returns
Promise<void>
Implementation of
IStore.setCheckpoint
clearCheckpoint()
Parameters
Returns
Promise<void>
Implementation of
IStore.clearCheckpoint
listCheckpoints()
Returns
Promise<[string, FlowCheckpoint][]>
Implementation of
IStore.listCheckpoints
start()
Returns
Promise<void>
Implementation of
IStore.start
stop()
Returns
Promise<void>
Implementation of
IStore.stop