Skip to content

@codesoul-co/hypha-memory / memory-server-permanent-migration

Using this module

Use the Memory server permanent migration module for using the public contracts and operations for this capability boundary. It exports 1 class, 3 functions, 7 interfaces, 3 types.

Import from the package entrypoint

ts
import {
  PermanentMemoryMigrationAdapter,
  decidePermanentMemoryFailure,
  isExplicitPermanentMemoryNotFound,
  normalizePermanentMemoryProviderError,
} from '@codesoul-co/hypha-memory';

import type {
  PermanentMemoryFailureDecision,
  PermanentMemoryFailureEvent,
  PermanentMemoryFailureObserver,
  PermanentMemoryMigrationAdapterOptions,
  PermanentMemoryMigrationPort,
  PermanentMemoryMigrationProvider,
  PermanentMemoryMigrationRequest,
  PermanentMemoryFailureDisposition,
} from '@codesoul-co/hypha-memory';

// The complete export list is documented below.

Usage patterns

  • Use the 10 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 1 class as constructable runtime implementations. Each symbol entry lists its constructor and public methods.
  • The module exposes 3 functions as direct operation entrypoints. Every overload, required/optional parameter, and return type is documented below.

Public exports

SymbolKindSignatureDescription
PermanentMemoryMigrationAdapterclassnew PermanentMemoryMigrationAdapter(options: PermanentMemoryMigrationAdapterOptions): PermanentMemoryMigrationAdapterPermanent Memory Migration Adapter class with 5 public constructor or member entries; its exact declarations are listed below.
decidePermanentMemoryFailurefunctiondecidePermanentMemoryFailure(error: NormalizedMemoryError, request: PermanentMemoryMigrationRequest, operation: PermanentMemoryMigrationOperation): PermanentMemoryFailureDecisionDecide Permanent Memory Failure function with 1 public call signature; parameters and return types are listed below.
isExplicitPermanentMemoryNotFoundfunctionisExplicitPermanentMemoryNotFound(error: unknown): booleanIs Explicit Permanent Memory Not Found function with 1 public call signature; parameters and return types are listed below.
normalizePermanentMemoryProviderErrorfunctionnormalizePermanentMemoryProviderError(providerError: unknown, request: PermanentMemoryMigrationRequest, operation: PermanentMemoryMigrationOperation): NormalizedMemoryErrorNormalize Permanent Memory Provider Error function with 1 public call signature; parameters and return types are listed below.
PermanentMemoryFailureDecisioninterfaceinterface PermanentMemoryFailureDecisionPermanent Memory Failure Decision interface with 6 public fields or methods.
PermanentMemoryFailureEventinterfaceinterface PermanentMemoryFailureEventPermanent Memory Failure Event interface with 10 public fields or methods.
PermanentMemoryFailureObserverinterfaceinterface PermanentMemoryFailureObserverPermanent Memory Failure Observer interface with 1 public fields or methods.
PermanentMemoryMigrationAdapterOptionsinterfaceinterface PermanentMemoryMigrationAdapterOptionsPermanent Memory Migration Adapter Options interface with 2 public fields or methods.
PermanentMemoryMigrationPortinterfaceinterface PermanentMemoryMigrationPortPermanent Memory Migration Port interface with 4 public fields or methods.
PermanentMemoryMigrationProviderinterfaceinterface PermanentMemoryMigrationProviderPermanent Memory Migration Provider interface with 4 public fields or methods.
PermanentMemoryMigrationRequestinterfaceinterface PermanentMemoryMigrationRequestPermanent Memory Migration Request interface with 7 public fields or methods.
PermanentMemoryFailureDispositiontypetype PermanentMemoryFailureDisposition = 'retry' | 'reconcile' | 'quarantine' | 'dlq'Public type alias for Permanent Memory Failure Disposition; the declaration contains its complete type expression.
PermanentMemoryFailureFinalStatetypetype PermanentMemoryFailureFinalState = 'waiting' | 'reconciling' | 'quarantined' | 'dead_lettered'Public type alias for Permanent Memory Failure Final State; the declaration contains its complete type expression.
PermanentMemoryMigrationOperationtypetype PermanentMemoryMigrationOperation = 'get' | 'list' | 'delete' | 'write'Public type alias for Permanent Memory Migration Operation; the declaration contains its complete type expression.

PermanentMemoryMigrationAdapter

Permanent Memory Migration Adapter class with 5 public constructor or member entries; its exact declarations are listed below.

Declaration

text
export declare class PermanentMemoryMigrationAdapter implements PermanentMemoryMigrationPort {
    constructor(options: PermanentMemoryMigrationAdapterOptions);
    get<TValue = unknown>(request: PermanentMemoryMigrationRequest): Promise<TValue | null>;
    list<TValue = unknown>(request: PermanentMemoryMigrationRequest): Promise<TValue[]>;
    delete(request: PermanentMemoryMigrationRequest): Promise<boolean>;
    write<TValue = unknown>(request: PermanentMemoryMigrationRequest, value: TValue): Promise<void>;
}

Public members

MemberKindSignatureDescription
constructorconstructor(options: PermanentMemoryMigrationAdapterOptions): PermanentMemoryMigrationAdapterCreates an instance of this class.
deletemethoddelete(request: PermanentMemoryMigrationRequest): Promise<boolean>Public method; parameters and return type are shown in the signature.
getmethodget<TValue = unknown>(request: PermanentMemoryMigrationRequest): Promise<TValue | null>Public method; parameters and return type are shown in the signature.
listmethodlist<TValue = unknown>(request: PermanentMemoryMigrationRequest): Promise<TValue[]>Public method; parameters and return type are shown in the signature.
writemethodwrite<TValue = unknown>(request: PermanentMemoryMigrationRequest, value: TValue): Promise<void>Public method; parameters and return type are shown in the signature.

decidePermanentMemoryFailure

Decide Permanent Memory Failure function with 1 public call signature; parameters and return types are listed below.

Declaration

text
export declare function decidePermanentMemoryFailure(error: NormalizedMemoryError, request: PermanentMemoryMigrationRequest, operation: PermanentMemoryMigrationOperation): PermanentMemoryFailureDecision;

Call signature

text
decidePermanentMemoryFailure(error: NormalizedMemoryError, request: PermanentMemoryMigrationRequest, operation: PermanentMemoryMigrationOperation): PermanentMemoryFailureDecision

Parameters

ParameterTypeRequiredDescription
errorNormalizedMemoryErrorYesRequired parameter; accepted values are defined by the type column.
requestPermanentMemoryMigrationRequestYesRequired parameter; accepted values are defined by the type column.
operationPermanentMemoryMigrationOperationYesRequired parameter; accepted values are defined by the type column.

Returns

  • Type: PermanentMemoryFailureDecision
  • Description: The return contract is defined by the type shown above.

isExplicitPermanentMemoryNotFound

Is Explicit Permanent Memory Not Found function with 1 public call signature; parameters and return types are listed below.

Declaration

text
export declare function isExplicitPermanentMemoryNotFound(error: unknown): boolean;

Call signature

text
isExplicitPermanentMemoryNotFound(error: unknown): boolean

Parameters

ParameterTypeRequiredDescription
errorunknownYesRequired parameter; accepted values are defined by the type column.

Returns

  • Type: boolean
  • Description: The return contract is defined by the type shown above.

normalizePermanentMemoryProviderError

Normalize Permanent Memory Provider Error function with 1 public call signature; parameters and return types are listed below.

Declaration

text
export declare function normalizePermanentMemoryProviderError(providerError: unknown, request: PermanentMemoryMigrationRequest, operation: PermanentMemoryMigrationOperation): NormalizedMemoryError;

Call signature

text
normalizePermanentMemoryProviderError(providerError: unknown, request: PermanentMemoryMigrationRequest, operation: PermanentMemoryMigrationOperation): NormalizedMemoryError

Parameters

ParameterTypeRequiredDescription
providerErrorunknownYesRequired parameter; accepted values are defined by the type column.
requestPermanentMemoryMigrationRequestYesRequired parameter; accepted values are defined by the type column.
operationPermanentMemoryMigrationOperationYesRequired parameter; accepted values are defined by the type column.

Returns

  • Type: NormalizedMemoryError
  • Description: The return contract is defined by the type shown above.

PermanentMemoryFailureDecision

Permanent Memory Failure Decision interface with 6 public fields or methods.

Declaration

text
export interface PermanentMemoryFailureDecision {
    disposition: PermanentMemoryFailureDisposition;
    finalState: PermanentMemoryFailureFinalState;
    retryable: boolean;
    attempt: number;
    maxAttempts: number;
    reason: string;
}

Contract members

MemberKindSignatureDescription
attemptpropertyattempt: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
dispositionpropertydisposition: PermanentMemoryFailureDispositionPublic property; its type, readonly modifier and optionality are shown in the signature.
finalStatepropertyfinalState: PermanentMemoryFailureFinalStatePublic property; its type, readonly modifier and optionality are shown in the signature.
maxAttemptspropertymaxAttempts: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
reasonpropertyreason: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
retryablepropertyretryable: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.

PermanentMemoryFailureEvent

Permanent Memory Failure Event interface with 10 public fields or methods.

Declaration

text
export interface PermanentMemoryFailureEvent {
    type: 'permanent_memory.operation_failed';
    operationId: string;
    operation: PermanentMemoryMigrationOperation;
    providerRef: string;
    profileRef: string;
    scopeHash: string;
    attempt: number;
    error: NormalizedMemoryError;
    disposition: PermanentMemoryFailureDisposition;
    finalState: PermanentMemoryFailureFinalState;
}

Contract members

MemberKindSignatureDescription
attemptpropertyattempt: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
dispositionpropertydisposition: PermanentMemoryFailureDispositionPublic property; its type, readonly modifier and optionality are shown in the signature.
errorpropertyerror: NormalizedMemoryErrorPublic property; its type, readonly modifier and optionality are shown in the signature.
finalStatepropertyfinalState: PermanentMemoryFailureFinalStatePublic property; its type, readonly modifier and optionality are shown in the signature.
operationpropertyoperation: PermanentMemoryMigrationOperationPublic property; its type, readonly modifier and optionality are shown in the signature.
operationIdpropertyoperationId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
profileRefpropertyprofileRef: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
providerRefpropertyproviderRef: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
scopeHashpropertyscopeHash: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
typepropertytype: "permanent_memory.operation_failed"Public property; its type, readonly modifier and optionality are shown in the signature.

PermanentMemoryFailureObserver

Permanent Memory Failure Observer interface with 1 public fields or methods.

Declaration

text
export interface PermanentMemoryFailureObserver {
    record(event: PermanentMemoryFailureEvent): void | Promise<void>;
}

Contract members

MemberKindSignatureDescription
recordmethodrecord(event: PermanentMemoryFailureEvent): void | Promise<void>Public method; parameters and return type are shown in the signature.

PermanentMemoryMigrationAdapterOptions

Permanent Memory Migration Adapter Options interface with 2 public fields or methods.

Declaration

text
export interface PermanentMemoryMigrationAdapterOptions {
    provider: PermanentMemoryMigrationProvider;
    observer?: PermanentMemoryFailureObserver;
}

Contract members

MemberKindSignatureDescription
observerpropertyobserver?: PermanentMemoryFailureObserverPublic property; its type, readonly modifier and optionality are shown in the signature.
providerpropertyprovider: PermanentMemoryMigrationProviderPublic property; its type, readonly modifier and optionality are shown in the signature.

PermanentMemoryMigrationPort

Permanent Memory Migration Port interface with 4 public fields or methods.

Declaration

text
export interface PermanentMemoryMigrationPort {
    get<TValue = unknown>(request: PermanentMemoryMigrationRequest): Promise<TValue | null>;
    list<TValue = unknown>(request: PermanentMemoryMigrationRequest): Promise<TValue[]>;
    delete(request: PermanentMemoryMigrationRequest): Promise<boolean>;
    write<TValue = unknown>(request: PermanentMemoryMigrationRequest, value: TValue): Promise<void>;
}

Contract members

MemberKindSignatureDescription
deletemethoddelete(request: PermanentMemoryMigrationRequest): Promise<boolean>Public method; parameters and return type are shown in the signature.
getmethodget<TValue = unknown>(request: PermanentMemoryMigrationRequest): Promise<TValue | null>Public method; parameters and return type are shown in the signature.
listmethodlist<TValue = unknown>(request: PermanentMemoryMigrationRequest): Promise<TValue[]>Public method; parameters and return type are shown in the signature.
writemethodwrite<TValue = unknown>(request: PermanentMemoryMigrationRequest, value: TValue): Promise<void>Public method; parameters and return type are shown in the signature.

PermanentMemoryMigrationProvider

Permanent Memory Migration Provider interface with 4 public fields or methods.

Declaration

text
export interface PermanentMemoryMigrationProvider {
    get<TValue = unknown>(scope: ManagedMemoryScope, recordId: string): Promise<TValue | null>;
    list<TValue = unknown>(scope: ManagedMemoryScope): Promise<TValue[]>;
    delete(scope: ManagedMemoryScope, recordId: string): Promise<boolean>;
    write<TValue = unknown>(scope: ManagedMemoryScope, recordId: string, value: TValue): Promise<void>;
}

Contract members

MemberKindSignatureDescription
deletemethoddelete(scope: ManagedMemoryScope, recordId: string): Promise<boolean>Public method; parameters and return type are shown in the signature.
getmethodget<TValue = unknown>(scope: ManagedMemoryScope, recordId: string): Promise<TValue | null>Public method; parameters and return type are shown in the signature.
listmethodlist<TValue = unknown>(scope: ManagedMemoryScope): Promise<TValue[]>Public method; parameters and return type are shown in the signature.
writemethodwrite<TValue = unknown>(scope: ManagedMemoryScope, recordId: string, value: TValue): Promise<void>Public method; parameters and return type are shown in the signature.

PermanentMemoryMigrationRequest

Permanent Memory Migration Request interface with 7 public fields or methods.

Declaration

text
export interface PermanentMemoryMigrationRequest {
    operationId: string;
    scope: ManagedMemoryScope;
    providerRef: string;
    profileRef: string;
    recordId?: string;
    attempt?: number;
    maxAttempts?: number;
}

Contract members

MemberKindSignatureDescription
attemptpropertyattempt?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
maxAttemptspropertymaxAttempts?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
operationIdpropertyoperationId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
profileRefpropertyprofileRef: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
providerRefpropertyproviderRef: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
recordIdpropertyrecordId?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
scopepropertyscope: ManagedMemoryScopePublic property; its type, readonly modifier and optionality are shown in the signature.

PermanentMemoryFailureDisposition

Public type alias for Permanent Memory Failure Disposition; the declaration contains its complete type expression.

Declaration

text
export type PermanentMemoryFailureDisposition = 'retry' | 'reconcile' | 'quarantine' | 'dlq';

PermanentMemoryFailureFinalState

Public type alias for Permanent Memory Failure Final State; the declaration contains its complete type expression.

Declaration

text
export type PermanentMemoryFailureFinalState = 'waiting' | 'reconciling' | 'quarantined' | 'dead_lettered';

PermanentMemoryMigrationOperation

Public type alias for Permanent Memory Migration Operation; the declaration contains its complete type expression.

Declaration

text
export type PermanentMemoryMigrationOperation = 'get' | 'list' | 'delete' | 'write';