Skip to content

@codesoul-co/hypha-core / modules/runtime/legacy-wait-migration

Using this module

Use the Legacy wait migration module for executing runtime behavior at this boundary. It exports 1 constant, 2 functions, 3 interfaces, 1 type.

Import from the package entrypoint

ts
import {
  LEGACY_HUMAN_WAIT_MIGRATION_VERSION,
  migrateLegacyHumanWaitEvent,
  migrateLegacyHumanWaitEvents,
} from '@codesoul-co/hypha-core';

import type {
  LegacyHumanWaitMigrationEntry,
  LegacyHumanWaitMigrationReport,
  LegacyHumanWaitMigrationResult,
  MigratableRuntimeEvent,
} from '@codesoul-co/hypha-core';

Usage patterns

  • Use the 4 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 functions as direct operation entrypoints. Every overload, required/optional parameter, and return type is documented below.
  • The 1 constant/enum export provides stable values, schemas, definitions, or defaults. Reuse these exports instead of copying internal values into an application.

Public exports

SymbolKindSignatureDescription
LEGACY_HUMAN_WAIT_MIGRATION_VERSIONconstantconst LEGACY_HUMAN_WAIT_MIGRATION_VERSION: "1.0.0"LEGACY HUMAN WAIT MIGRATION VERSION constant exported by the modules/runtime/legacy-wait-migration module.
migrateLegacyHumanWaitEventfunctionmigrateLegacyHumanWaitEvent<TEvent extends FrameworkEvent>(event: TEvent, priorPendingActionRef?: string): { event: TEvent; entry: LegacyHumanWaitMigrationEntry; }Migrate Legacy Human Wait Event function with 1 public call signature; parameters and return types are listed below.
migrateLegacyHumanWaitEventsfunctionmigrateLegacyHumanWaitEvents<TEvent extends FrameworkEvent>(events: readonly TEvent[]): LegacyHumanWaitMigrationResult<TEvent>Migrate Legacy Human Wait Events function with 1 public call signature; parameters and return types are listed below.
LegacyHumanWaitMigrationEntryinterfaceinterface LegacyHumanWaitMigrationEntryLegacy Human Wait Migration Entry interface with 6 public fields or methods.
LegacyHumanWaitMigrationReportinterfaceinterface LegacyHumanWaitMigrationReportLegacy Human Wait Migration Report interface with 8 public fields or methods.
LegacyHumanWaitMigrationResultinterfaceinterface LegacyHumanWaitMigrationResultLegacy Human Wait Migration Result interface with 2 public fields or methods.
MigratableRuntimeEventtypetype MigratableRuntimeEvent = FrameworkEvent | PersistedFrameworkEventPublic type alias for Migratable Runtime Event; the declaration contains its complete type expression.

LEGACY_HUMAN_WAIT_MIGRATION_VERSION

LEGACY HUMAN WAIT MIGRATION VERSION constant exported by the modules/runtime/legacy-wait-migration module.

Declaration

text
export declare const LEGACY_HUMAN_WAIT_MIGRATION_VERSION: "1.0.0";

migrateLegacyHumanWaitEvent

Migrate Legacy Human Wait Event function with 1 public call signature; parameters and return types are listed below.

Declaration

text
export declare function migrateLegacyHumanWaitEvent<TEvent extends FrameworkEvent>(event: TEvent, priorPendingActionRef?: string): {
    event: TEvent;
    entry: LegacyHumanWaitMigrationEntry;
};

Call signature

text
migrateLegacyHumanWaitEvent<TEvent extends FrameworkEvent>(event: TEvent, priorPendingActionRef?: string): { event: TEvent; entry: LegacyHumanWaitMigrationEntry; }

Parameters

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

Returns

  • Type: { event: TEvent; entry: LegacyHumanWaitMigrationEntry; }
  • Description: The return contract is defined by the type shown above.

migrateLegacyHumanWaitEvents

Migrate Legacy Human Wait Events function with 1 public call signature; parameters and return types are listed below.

Declaration

text
export declare function migrateLegacyHumanWaitEvents<TEvent extends FrameworkEvent>(events: readonly TEvent[]): LegacyHumanWaitMigrationResult<TEvent>;

Call signature

text
migrateLegacyHumanWaitEvents<TEvent extends FrameworkEvent>(events: readonly TEvent[]): LegacyHumanWaitMigrationResult<TEvent>

Parameters

ParameterTypeRequiredDescription
eventsreadonly TEvent[]YesRequired parameter; accepted values are defined by the type column.

Returns

  • Type: LegacyHumanWaitMigrationResult<TEvent>
  • Description: The return contract is defined by the type shown above.

LegacyHumanWaitMigrationEntry

Legacy Human Wait Migration Entry interface with 6 public fields or methods.

Declaration

text
export interface LegacyHumanWaitMigrationEntry {
    eventId: string;
    runId: string;
    status: 'current' | 'migrated' | 'quarantined';
    waitId?: string;
    pendingActionRef?: string;
    reason?: string;
}

Contract members

MemberKindSignatureDescription
eventIdpropertyeventId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
pendingActionRefpropertypendingActionRef?: stringPublic 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.
runIdpropertyrunId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
statuspropertystatus: "quarantined" | "current" | "migrated"Public property; its type, readonly modifier and optionality are shown in the signature.
waitIdpropertywaitId?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.

LegacyHumanWaitMigrationReport

Legacy Human Wait Migration Report interface with 8 public fields or methods.

Declaration

text
export interface LegacyHumanWaitMigrationReport {
    formatVersion: typeof LEGACY_HUMAN_WAIT_MIGRATION_VERSION;
    scannedEvents: number;
    waitingEvents: number;
    migratedEvents: number;
    currentEvents: number;
    quarantinedEvents: number;
    quarantinedRunIds: string[];
    entries: LegacyHumanWaitMigrationEntry[];
}

Contract members

MemberKindSignatureDescription
currentEventspropertycurrentEvents: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
entriespropertyentries: LegacyHumanWaitMigrationEntry[]Public property; its type, readonly modifier and optionality are shown in the signature.
formatVersionpropertyformatVersion: "1.0.0"Public property; its type, readonly modifier and optionality are shown in the signature.
migratedEventspropertymigratedEvents: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
quarantinedEventspropertyquarantinedEvents: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
quarantinedRunIdspropertyquarantinedRunIds: string[]Public property; its type, readonly modifier and optionality are shown in the signature.
scannedEventspropertyscannedEvents: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
waitingEventspropertywaitingEvents: numberPublic property; its type, readonly modifier and optionality are shown in the signature.

LegacyHumanWaitMigrationResult

Legacy Human Wait Migration Result interface with 2 public fields or methods.

Declaration

text
export interface LegacyHumanWaitMigrationResult<TEvent extends FrameworkEvent> {
    events: TEvent[];
    report: LegacyHumanWaitMigrationReport;
}

Contract members

MemberKindSignatureDescription
eventspropertyevents: TEvent[]Public property; its type, readonly modifier and optionality are shown in the signature.
reportpropertyreport: LegacyHumanWaitMigrationReportPublic property; its type, readonly modifier and optionality are shown in the signature.

MigratableRuntimeEvent

Public type alias for Migratable Runtime Event; the declaration contains its complete type expression.

Declaration

text
export type MigratableRuntimeEvent = FrameworkEvent | PersistedFrameworkEvent;