← All packages

@searsuite/sear-domain-transaction

The correctly spelled public entry point for SearSuite transaction contracts.

functioncreateTransaction
createTransaction<OperationType>(pluginKey: TransactionPluginKey, operations?: readonly OperationType[], meta?: Readonly<Record<string, unknown>>): Transaction<OperationType>

Creates a transaction with copied operations and metadata.

classTransaction
class Transaction<OperationType>

Transaction public API.

propertyreadonly meta: Record<string, unknown>

Metadata attached to Transaction.

propertyreadonly operations: OperationType[]

Operations carried by Transaction.

propertyreadonly pluginKey: TransactionPluginKey

Stable plugin key for Transaction.

methodaddOperation(operations: OperationType[]): void

Adds the operation.

methodgetMeta<T>(key: string): T | undefined

Returns the meta.

methodsetMeta(key: string, value: unknown): this

Updates the meta.

variableTRANSACTION_ORIGIN_META_KEY
TRANSACTION_ORIGIN_META_KEY: "transaction:origin"

Metadata key describing where a transaction originated.

enumTransactionOrigin

Stable transaction origins observed by cross-cutting runtime features.

enum memberHistory: "history"
enum memberLocal: "local"
enum memberRemote: "remote"
interfaceTransactionPluginKey

Stable owner key accepted by a transaction.

propertyreadonly key: string

String identity for the plugin or state owner receiving this transaction.