@codesoul-co/hypha-memory / structured-memory-persistence
- Package index:
@codesoul-co/hypha-memory - Source:
packages/memory/src/structured-memory-persistence.ts - Exports: 4
Using this module
Use the Structured memory persistence module for persisting and reading data at this boundary. It exports 2 classes, 2 interfaces.
Import from the package entrypoint
ts
import {
StructuredMemoryIndexOutboxStore,
StructuredMemoryPersistenceUnitOfWork,
} from '@codesoul-co/hypha-memory';
import type {
StructuredMemoryIndexOutboxStoreOptions,
StructuredMemoryPersistenceUnitOfWorkOptions,
} from '@codesoul-co/hypha-memory';Usage patterns
- Use the 2 type/interface exports as static contracts in application code, adapters, or tests. Import them with
import type; they do not exist at runtime. - The module exposes 2 classes as constructable runtime implementations. Each symbol entry lists its constructor and public methods.
Public exports
| Symbol | Kind | Signature | Description |
|---|---|---|---|
StructuredMemoryIndexOutboxStore | class | new StructuredMemoryIndexOutboxStore(options: StructuredMemoryIndexOutboxStoreOptions): StructuredMemoryIndexOutboxStore | Structured Memory Index Outbox Store class with 8 public constructor or member entries; its exact declarations are listed below. |
StructuredMemoryPersistenceUnitOfWork | class | new StructuredMemoryPersistenceUnitOfWork(options: StructuredMemoryPersistenceUnitOfWorkOptions): StructuredMemoryPersistenceUnitOfWork | Structured Memory Persistence Unit Of Work class with 5 public constructor or member entries; its exact declarations are listed below. |
StructuredMemoryIndexOutboxStoreOptions | interface | interface StructuredMemoryIndexOutboxStoreOptions | Structured Memory Index Outbox Store Options interface with 3 public fields or methods. |
StructuredMemoryPersistenceUnitOfWorkOptions | interface | interface StructuredMemoryPersistenceUnitOfWorkOptions | Structured Memory Persistence Unit Of Work Options interface with 4 public fields or methods. |
StructuredMemoryIndexOutboxStore
Structured Memory Index Outbox Store class with 8 public constructor or member entries; its exact declarations are listed below.
- Kind: class
- Import:
import { StructuredMemoryIndexOutboxStore } from '@codesoul-co/hypha-memory'; - Source module:
structured-memory-persistence
Declaration
text
export declare class StructuredMemoryIndexOutboxStore implements MemoryIndexOutboxStore {
constructor(options: StructuredMemoryIndexOutboxStoreOptions);
enqueue(record: MemoryIndexOutboxRecord): Promise<void>;
lease(owner: string, now: string, leaseUntil: string, limit: number): Promise<MemoryIndexOutboxRecord[]>;
renew(id: string, owner: string, leaseToken: string, now: string, leaseUntil: string): Promise<boolean>;
complete(id: string, owner: string, leaseToken: string, now: string): Promise<boolean>;
fail(id: string, owner: string, leaseToken: string, now: string, error: NormalizedMemoryError, retryAt: string, deadLetter?: boolean): Promise<boolean>;
list(): Promise<MemoryIndexOutboxRecord[]>;
transaction<T>(fn: (store: MemoryIndexOutboxStore) => Promise<T>): Promise<T>;
}Public members
| Member | Kind | Signature | Description |
|---|---|---|---|
complete | method | complete(id: string, owner: string, leaseToken: string, now: string): Promise<boolean> | Public method; parameters and return type are shown in the signature. |
constructor | constructor | (options: StructuredMemoryIndexOutboxStoreOptions): StructuredMemoryIndexOutboxStore | Creates an instance of this class. |
enqueue | method | enqueue(record: MemoryIndexOutboxRecord): Promise<void> | Public method; parameters and return type are shown in the signature. |
fail | method | fail(id: string, owner: string, leaseToken: string, now: string, error: NormalizedMemoryError, retryAt: string, deadLetter?: boolean): Promise<boolean> | Public method; parameters and return type are shown in the signature. |
lease | method | lease(owner: string, now: string, leaseUntil: string, limit: number): Promise<MemoryIndexOutboxRecord[]> | Public method; parameters and return type are shown in the signature. |
list | method | list(): Promise<MemoryIndexOutboxRecord[]> | Public method; parameters and return type are shown in the signature. |
renew | method | renew(id: string, owner: string, leaseToken: string, now: string, leaseUntil: string): Promise<boolean> | Public method; parameters and return type are shown in the signature. |
transaction | method | transaction<T>(fn: (store: MemoryIndexOutboxStore) => Promise<T>): Promise<T> | Public method; parameters and return type are shown in the signature. |
StructuredMemoryPersistenceUnitOfWork
Structured Memory Persistence Unit Of Work class with 5 public constructor or member entries; its exact declarations are listed below.
- Kind: class
- Import:
import { StructuredMemoryPersistenceUnitOfWork } from '@codesoul-co/hypha-memory'; - Source module:
structured-memory-persistence
Declaration
text
export declare class StructuredMemoryPersistenceUnitOfWork implements MemoryPersistenceUnitOfWork {
readonly capabilities: MemoryPersistenceCapabilities;
readonly recordStore: StructuredManagedMemoryRecordStore;
readonly outboxStore: StructuredMemoryIndexOutboxStore;
constructor(options: StructuredMemoryPersistenceUnitOfWorkOptions);
transaction<T>(fn: (stores: MemoryPersistenceTransaction) => Promise<T>): Promise<T>;
}Public members
| Member | Kind | Signature | Description |
|---|---|---|---|
capabilities | property | readonly capabilities: MemoryPersistenceCapabilities | Public property; its type, readonly modifier and optionality are shown in the signature. |
constructor | constructor | (options: StructuredMemoryPersistenceUnitOfWorkOptions): StructuredMemoryPersistenceUnitOfWork | Creates an instance of this class. |
outboxStore | property | readonly outboxStore: StructuredMemoryIndexOutboxStore | Public property; its type, readonly modifier and optionality are shown in the signature. |
recordStore | property | readonly recordStore: StructuredManagedMemoryRecordStore | Public property; its type, readonly modifier and optionality are shown in the signature. |
transaction | method | transaction<T>(fn: (stores: MemoryPersistenceTransaction) => Promise<T>): Promise<T> | Public method; parameters and return type are shown in the signature. |
StructuredMemoryIndexOutboxStoreOptions
Structured Memory Index Outbox Store Options interface with 3 public fields or methods.
- Kind: interface
- Import:
import type { StructuredMemoryIndexOutboxStoreOptions } from '@codesoul-co/hypha-memory'; - Source module:
structured-memory-persistence
Declaration
text
export interface StructuredMemoryIndexOutboxStoreOptions {
provider: StructuredStoreProvider;
table?: string;
inTransaction?: boolean;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
inTransaction | property | inTransaction?: boolean | Public property; its type, readonly modifier and optionality are shown in the signature. |
provider | property | provider: StructuredStoreProvider | Public property; its type, readonly modifier and optionality are shown in the signature. |
table | property | table?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
StructuredMemoryPersistenceUnitOfWorkOptions
Structured Memory Persistence Unit Of Work Options interface with 4 public fields or methods.
- Kind: interface
- Import:
import type { StructuredMemoryPersistenceUnitOfWorkOptions } from '@codesoul-co/hypha-memory'; - Source module:
structured-memory-persistence
Declaration
text
export interface StructuredMemoryPersistenceUnitOfWorkOptions {
provider: StructuredStoreProvider;
currentTable?: string;
versionsTable?: string;
outboxTable?: string;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
currentTable | property | currentTable?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
outboxTable | property | outboxTable?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
provider | property | provider: StructuredStoreProvider | Public property; its type, readonly modifier and optionality are shown in the signature. |
versionsTable | property | versionsTable?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
