Skip to content

@codesoul-co/hypha-memory / structured-managed-store

Using this module

Use the Structured managed store module for persisting and reading data at this boundary. It exports 1 class, 1 interface.

Import from the package entrypoint

ts
import {
  StructuredManagedMemoryRecordStore,
} from '@codesoul-co/hypha-memory';

import type {
  StructuredManagedMemoryRecordStoreOptions,
} from '@codesoul-co/hypha-memory';

Usage patterns

  • Use the 1 type/interface export as static contracts in application code, adapters, or tests. Import them with import type; they do not exist at runtime.
  • The module exposes 1 class as constructable runtime implementations. Each symbol entry lists its constructor and public methods.

Public exports

SymbolKindSignatureDescription
StructuredManagedMemoryRecordStoreclassnew StructuredManagedMemoryRecordStore(options: StructuredManagedMemoryRecordStoreOptions): StructuredManagedMemoryRecordStoreStructured Managed Memory Record Store class with 11 public constructor or member entries; its exact declarations are listed below.
StructuredManagedMemoryRecordStoreOptionsinterfaceinterface StructuredManagedMemoryRecordStoreOptionsStructured Managed Memory Record Store Options interface with 5 public fields or methods.

StructuredManagedMemoryRecordStore

Structured Managed Memory Record Store class with 11 public constructor or member entries; its exact declarations are listed below.

  • Kind: class
  • Import: import { StructuredManagedMemoryRecordStore } from '@codesoul-co/hypha-memory';
  • Source module: structured-managed-store

Declaration

text
export declare class StructuredManagedMemoryRecordStore implements ManagedMemoryRecordStore {
    constructor(options: StructuredManagedMemoryRecordStoreOptions);
    create(record: ManagedMemoryRecord): Promise<ManagedMemoryRecord>;
    get(id: string, scope: ManagedMemoryScope): Promise<ManagedMemoryRecord | null>;
    getVersionByScopeHash(id: string, versionId: string, scopeHash: string): Promise<ManagedMemoryRecord | null>;
    list(request: ManagedMemoryRecordQuery): Promise<ManagedMemoryRecord[]>;
    createVersion(record: ManagedMemoryRecord, expectedRevision: number): Promise<ManagedMemoryRecord>;
    updateStatus(id: string, scope: ManagedMemoryScope, expectedRevision: number, status: MemoryStatus, updatedAt: string): Promise<ManagedMemoryRecord>;
    delete(id: string, scope: ManagedMemoryScope): Promise<void>;
    history(id: string, scope: ManagedMemoryScope): Promise<ManagedMemoryRecord[]>;
    transaction<T>(fn: (store: ManagedMemoryRecordStore) => Promise<T>): Promise<T>;
    health(): Promise<ProviderHealth>;
}

Public members

MemberKindSignatureDescription
constructorconstructor(options: StructuredManagedMemoryRecordStoreOptions): StructuredManagedMemoryRecordStoreCreates an instance of this class.
createmethodcreate(record: ManagedMemoryRecord): Promise<ManagedMemoryRecord>Public method; parameters and return type are shown in the signature.
createVersionmethodcreateVersion(record: ManagedMemoryRecord, expectedRevision: number): Promise<ManagedMemoryRecord>Public method; parameters and return type are shown in the signature.
deletemethoddelete(id: string, scope: ManagedMemoryScope): Promise<void>Public method; parameters and return type are shown in the signature.
getmethodget(id: string, scope: ManagedMemoryScope): Promise<ManagedMemoryRecord | null>Public method; parameters and return type are shown in the signature.
getVersionByScopeHashmethodgetVersionByScopeHash(id: string, versionId: string, scopeHash: string): Promise<ManagedMemoryRecord | null>Public method; parameters and return type are shown in the signature.
healthmethodhealth(): Promise<ProviderHealth>Public method; parameters and return type are shown in the signature.
historymethodhistory(id: string, scope: ManagedMemoryScope): Promise<ManagedMemoryRecord[]>Public method; parameters and return type are shown in the signature.
listmethodlist(request: ManagedMemoryRecordQuery): Promise<ManagedMemoryRecord[]>Public method; parameters and return type are shown in the signature.
transactionmethodtransaction<T>(fn: (store: ManagedMemoryRecordStore) => Promise<T>): Promise<T>Public method; parameters and return type are shown in the signature.
updateStatusmethodupdateStatus(id: string, scope: ManagedMemoryScope, expectedRevision: number, status: MemoryStatus, updatedAt: string): Promise<ManagedMemoryRecord>Public method; parameters and return type are shown in the signature.

StructuredManagedMemoryRecordStoreOptions

Structured Managed Memory Record Store Options interface with 5 public fields or methods.

  • Kind: interface
  • Import: import type { StructuredManagedMemoryRecordStoreOptions } from '@codesoul-co/hypha-memory';
  • Source module: structured-managed-store

Declaration

text
export interface StructuredManagedMemoryRecordStoreOptions {
    provider: StructuredStoreProvider;
    currentTable?: string;
    versionsTable?: string;
    inTransaction?: boolean;
    now?: () => Date;
}

Contract members

MemberKindSignatureDescription
currentTablepropertycurrentTable?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
inTransactionpropertyinTransaction?: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
nowmethodnow?(): DatePublic method; parameters and return type are shown in the signature.
providerpropertyprovider: StructuredStoreProviderPublic property; its type, readonly modifier and optionality are shown in the signature.
versionsTablepropertyversionsTable?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.