Skip to content

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

Using this module

Use the Memory server migration rehearsal module for using the public contracts and operations for this capability boundary. It exports 1 class, 1 function, 7 interfaces.

Import from the package entrypoint

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

import type {
  MemoryServerMigrationFinishInput,
  MemoryServerMigrationInventoryPlan,
  MemoryServerMigrationInventoryRecord,
  MemoryServerMigrationPrepareInput,
  MemoryServerMigrationRehearsalCheckpoint,
  MemoryServerMigrationRehearsalCheckpointStore,
  MemoryServerMigrationRehearsalDataPort,
} from '@codesoul-co/hypha-memory';

Usage patterns

  • Use the 7 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 1 function as direct operation entrypoints. Every overload, required/optional parameter, and return type is documented below.

Public exports

SymbolKindSignatureDescription
MemoryServerMigrationRehearsalclassnew MemoryServerMigrationRehearsal(data: MemoryServerMigrationRehearsalDataPort, store: MemoryServerMigrationRehearsalCheckpointStore): MemoryServerMigrationRehearsalMemory Server Migration Rehearsal class with 5 public constructor or member entries; its exact declarations are listed below.
planMemoryServerMigrationInventoriesfunctionplanMemoryServerMigrationInventories(legacyInput: readonly MemoryServerMigrationInventoryRecord[], canonicalInput: readonly MemoryServerMigrationInventoryRecord[]): MemoryServerMigrationInventoryPlanPlan Memory Server Migration Inventories function with 1 public call signature; parameters and return types are listed below.
MemoryServerMigrationFinishInputinterfaceinterface MemoryServerMigrationFinishInputMemory Server Migration Finish Input interface with 3 public fields or methods.
MemoryServerMigrationInventoryPlaninterfaceinterface MemoryServerMigrationInventoryPlanMemory Server Migration Inventory Plan interface with 7 public fields or methods.
MemoryServerMigrationInventoryRecordinterfaceinterface MemoryServerMigrationInventoryRecordMemory Server Migration Inventory Record interface with 2 public fields or methods.
MemoryServerMigrationPrepareInputinterfaceinterface MemoryServerMigrationPrepareInputMemory Server Migration Prepare Input interface with 5 public fields or methods.
MemoryServerMigrationRehearsalCheckpointinterfaceinterface MemoryServerMigrationRehearsalCheckpointMemory Server Migration Rehearsal Checkpoint interface with 4 public fields or methods.
MemoryServerMigrationRehearsalCheckpointStoreinterfaceinterface MemoryServerMigrationRehearsalCheckpointStoreMemory Server Migration Rehearsal Checkpoint Store interface with 2 public fields or methods.
MemoryServerMigrationRehearsalDataPortinterfaceinterface MemoryServerMigrationRehearsalDataPortMemory Server Migration Rehearsal Data Port interface with 6 public fields or methods.

MemoryServerMigrationRehearsal

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

Declaration

text
export declare class MemoryServerMigrationRehearsal {
    constructor(data: MemoryServerMigrationRehearsalDataPort, store: MemoryServerMigrationRehearsalCheckpointStore);
    plan(): Promise<MemoryServerMigrationInventoryPlan>;
    prepare(input: MemoryServerMigrationPrepareInput): Promise<MemoryServerMigrationRehearsalCheckpoint>;
    rollback(input: MemoryServerMigrationFinishInput): Promise<MemoryServerMigrationRehearsalCheckpoint>;
    retire(input: MemoryServerMigrationFinishInput & {
            rollbackWindowEndsAt: string;
        }): Promise<MemoryServerMigrationRehearsalCheckpoint>;
}

Public members

MemberKindSignatureDescription
constructorconstructor(data: MemoryServerMigrationRehearsalDataPort, store: MemoryServerMigrationRehearsalCheckpointStore): MemoryServerMigrationRehearsalCreates an instance of this class.
planmethodplan(): Promise<MemoryServerMigrationInventoryPlan>Public method; parameters and return type are shown in the signature.
preparemethodprepare(input: MemoryServerMigrationPrepareInput): Promise<MemoryServerMigrationRehearsalCheckpoint>Public method; parameters and return type are shown in the signature.
retiremethodretire(input: MemoryServerMigrationFinishInput & { rollbackWindowEndsAt: string; }): Promise<MemoryServerMigrationRehearsalCheckpoint>Public method; parameters and return type are shown in the signature.
rollbackmethodrollback(input: MemoryServerMigrationFinishInput): Promise<MemoryServerMigrationRehearsalCheckpoint>Public method; parameters and return type are shown in the signature.

planMemoryServerMigrationInventories

Plan Memory Server Migration Inventories function with 1 public call signature; parameters and return types are listed below.

Declaration

text
export declare function planMemoryServerMigrationInventories(legacyInput: readonly MemoryServerMigrationInventoryRecord[], canonicalInput: readonly MemoryServerMigrationInventoryRecord[]): MemoryServerMigrationInventoryPlan;

Call signature

text
planMemoryServerMigrationInventories(legacyInput: readonly MemoryServerMigrationInventoryRecord[], canonicalInput: readonly MemoryServerMigrationInventoryRecord[]): MemoryServerMigrationInventoryPlan

Parameters

ParameterTypeRequiredDescription
legacyInputreadonly MemoryServerMigrationInventoryRecord[]YesRequired parameter; accepted values are defined by the type column.
canonicalInputreadonly MemoryServerMigrationInventoryRecord[]YesRequired parameter; accepted values are defined by the type column.

Returns

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

MemoryServerMigrationFinishInput

Memory Server Migration Finish Input interface with 3 public fields or methods.

Declaration

text
export interface MemoryServerMigrationFinishInput {
    migrationId: string;
    expectedRevision: string;
    occurredAt: string;
}

Contract members

MemberKindSignatureDescription
expectedRevisionpropertyexpectedRevision: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
migrationIdpropertymigrationId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
occurredAtpropertyoccurredAt: stringPublic property; its type, readonly modifier and optionality are shown in the signature.

MemoryServerMigrationInventoryPlan

Memory Server Migration Inventory Plan interface with 7 public fields or methods.

Declaration

text
export interface MemoryServerMigrationInventoryPlan {
    legacyRecords: number;
    canonicalRecords: number;
    matchingRecords: number;
    missingCanonicalKeys: string[];
    unexpectedCanonicalKeys: string[];
    digestMismatchKeys: string[];
    reconciliation: MemoryServerMigrationReconciliation;
}

Contract members

MemberKindSignatureDescription
canonicalRecordspropertycanonicalRecords: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
digestMismatchKeyspropertydigestMismatchKeys: string[]Public property; its type, readonly modifier and optionality are shown in the signature.
legacyRecordspropertylegacyRecords: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
matchingRecordspropertymatchingRecords: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
missingCanonicalKeyspropertymissingCanonicalKeys: string[]Public property; its type, readonly modifier and optionality are shown in the signature.
reconciliationpropertyreconciliation: MemoryServerMigrationReconciliationPublic property; its type, readonly modifier and optionality are shown in the signature.
unexpectedCanonicalKeyspropertyunexpectedCanonicalKeys: string[]Public property; its type, readonly modifier and optionality are shown in the signature.

MemoryServerMigrationInventoryRecord

Memory Server Migration Inventory Record interface with 2 public fields or methods.

Declaration

text
export interface MemoryServerMigrationInventoryRecord {
    key: string;
    digest: string;
}

Contract members

MemberKindSignatureDescription
digestpropertydigest: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
keypropertykey: stringPublic property; its type, readonly modifier and optionality are shown in the signature.

MemoryServerMigrationPrepareInput

Memory Server Migration Prepare Input interface with 5 public fields or methods.

Declaration

text
export interface MemoryServerMigrationPrepareInput {
    migrationId: string;
    revision: string;
    occurredAt: string;
    dualWriteDeadlineAt: string;
    checkpointRef: string;
}

Contract members

MemberKindSignatureDescription
checkpointRefpropertycheckpointRef: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
dualWriteDeadlineAtpropertydualWriteDeadlineAt: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
migrationIdpropertymigrationId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
occurredAtpropertyoccurredAt: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
revisionpropertyrevision: stringPublic property; its type, readonly modifier and optionality are shown in the signature.

MemoryServerMigrationRehearsalCheckpoint

Memory Server Migration Rehearsal Checkpoint interface with 4 public fields or methods.

Declaration

text
export interface MemoryServerMigrationRehearsalCheckpoint {
    state: MemoryServerCanonicalMigrationState;
    events: readonly MemoryServerMigrationTransitionEvent[];
    importedCanonicalIds: readonly string[];
    reconciliation: MemoryServerMigrationReconciliation;
}

Contract members

MemberKindSignatureDescription
eventspropertyevents: readonly MemoryServerMigrationTransitionEvent[]Public property; its type, readonly modifier and optionality are shown in the signature.
importedCanonicalIdspropertyimportedCanonicalIds: readonly string[]Public property; its type, readonly modifier and optionality are shown in the signature.
reconciliationpropertyreconciliation: MemoryServerMigrationReconciliationPublic property; its type, readonly modifier and optionality are shown in the signature.
statepropertystate: MemoryServerCanonicalMigrationStatePublic property; its type, readonly modifier and optionality are shown in the signature.

MemoryServerMigrationRehearsalCheckpointStore

Memory Server Migration Rehearsal Checkpoint Store interface with 2 public fields or methods.

  • Kind: interface
  • Import: import type { MemoryServerMigrationRehearsalCheckpointStore } from '@codesoul-co/hypha-memory';
  • Source module: memory-server-migration-rehearsal

Declaration

text
export interface MemoryServerMigrationRehearsalCheckpointStore {
    load(migrationId: string): Promise<MemoryServerMigrationRehearsalCheckpoint | null>;
    save(migrationId: string, checkpoint: MemoryServerMigrationRehearsalCheckpoint): Promise<void>;
}

Contract members

MemberKindSignatureDescription
loadmethodload(migrationId: string): Promise<MemoryServerMigrationRehearsalCheckpoint | null>Public method; parameters and return type are shown in the signature.
savemethodsave(migrationId: string, checkpoint: MemoryServerMigrationRehearsalCheckpoint): Promise<void>Public method; parameters and return type are shown in the signature.

MemoryServerMigrationRehearsalDataPort

Memory Server Migration Rehearsal Data Port interface with 6 public fields or methods.

Declaration

text
export interface MemoryServerMigrationRehearsalDataPort {
    listLegacy(): Promise<readonly MemoryServerMigrationInventoryRecord[]>;
    listCanonical(): Promise<readonly MemoryServerMigrationInventoryRecord[]>;
    importCanonical(record: MemoryServerMigrationInventoryRecord, idempotencyKey: string): Promise<{
        canonicalId: string;
    }>;
    writeDualProbe(idempotencyKey: string): Promise<{
        record: MemoryServerMigrationInventoryRecord;
        canonicalId: string;
    }>;
    removeCanonical(canonicalIds: readonly string[]): Promise<void>;
    observeRetirement(): Promise<Omit<MemoryServerMigrationRetirementEvidence, 'rollbackWindowEndsAt'>>;
}

Contract members

MemberKindSignatureDescription
importCanonicalmethodimportCanonical(record: MemoryServerMigrationInventoryRecord, idempotencyKey: string): Promise<{ canonicalId: string; }>Public method; parameters and return type are shown in the signature.
listCanonicalmethodlistCanonical(): Promise<readonly MemoryServerMigrationInventoryRecord[]>Public method; parameters and return type are shown in the signature.
listLegacymethodlistLegacy(): Promise<readonly MemoryServerMigrationInventoryRecord[]>Public method; parameters and return type are shown in the signature.
observeRetirementmethodobserveRetirement(): Promise<Omit<MemoryServerMigrationRetirementEvidence, "rollbackWindowEndsAt">>Public method; parameters and return type are shown in the signature.
removeCanonicalmethodremoveCanonical(canonicalIds: readonly string[]): Promise<void>Public method; parameters and return type are shown in the signature.
writeDualProbemethodwriteDualProbe(idempotencyKey: string): Promise<{ record: MemoryServerMigrationInventoryRecord; canonicalId: string; }>Public method; parameters and return type are shown in the signature.