HttpReadModelStore
API reference for HttpReadModelStore
Class: HttpReadModelStore
Section titled “Class: HttpReadModelStore”HTTP-based external store (for APIs, databases, etc.)
Implements
Section titled “Implements”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new HttpReadModelStore(
baseUrl,headers):HttpReadModelStore
Parameters
Section titled “Parameters”baseUrl
Section titled “baseUrl”string
headers
Section titled “headers”Record<string, string> = {}
Returns
Section titled “Returns”HttpReadModelStore
Methods
Section titled “Methods”delete()
Section titled “delete()”delete(
key,options?):Promise<boolean>
Deletes a value by its key.
Parameters
Section titled “Parameters”string
The key of the value to delete
options?
Section titled “options?”Optional settings for the delete operation
Returns
Section titled “Returns”Promise<boolean>
A promise that resolves to true if the key existed and was deleted, false otherwise
Implementation of
Section titled “Implementation of”get<
T>(key,options?):Promise<null|T>
Retrieves a value by its key.
Type Parameters
Section titled “Type Parameters”T = unknown
Parameters
Section titled “Parameters”string
The key of the value to retrieve
options?
Section titled “options?”Optional settings for the retrieval operation
Returns
Section titled “Returns”Promise<null | T>
A promise that resolves with the value, or null if not found
Implementation of
Section titled “Implementation of”getAll()
Section titled “getAll()”getAll<
T>(options?):Promise<object[]>
Retrieves all values, optionally filtered by a key prefix.
Type Parameters
Section titled “Type Parameters”T = unknown
Parameters
Section titled “Parameters”options?
Section titled “options?”Optional settings for retrieving all values
Returns
Section titled “Returns”Promise<object[]>
A promise that resolves with an array of key-value pairs
Implementation of
Section titled “Implementation of”getCapabilities()
Section titled “getCapabilities()”getCapabilities():
StoreCapabilities
Returns the capabilities of this store implementation
Returns
Section titled “Returns”Store capabilities object
Implementation of
Section titled “Implementation of”IReadModelStore.getCapabilities
getNativeClient()
Section titled “getNativeClient()”getNativeClient<
C>():C
Gets access to the native database client Allows for direct operations using the underlying database API
Type Parameters
Section titled “Type Parameters”C = {(input, init?): Promise<Response>; (input, init?): Promise<Response>; }
Returns
Section titled “Returns”C
The native client instance
Implementation of
Section titled “Implementation of”IReadModelStore.getNativeClient
put<
T>(key,value,options?):Promise<void>
Stores a value with the given key. If the key already exists, the value will be overwritten.
Type Parameters
Section titled “Type Parameters”T = unknown
Parameters
Section titled “Parameters”string
The key under which to store the value
T
The value to store (string, ArrayBuffer, or any type that can be serialized to JSON)
options?
Section titled “options?”WriteOptions & ExpirationOptions & MetadataOptions
Optional settings for the storage operation
Returns
Section titled “Returns”Promise<void>
A promise that resolves when the value has been stored