Skip to content

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

模块用法

用于执行该边界的运行时行为。Legacy wait migration 模块公开 1 常量、2 函数、3 接口、1 类型。

从包入口导入

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';

使用要点

  • 4 个类型/接口用于应用代码、Adapter 或测试中的静态契约;请使用 import type,运行时不应依赖它们。
  • 2 个函数是该模块的直接操作入口;每个 overload 的必需/可选参数与返回类型均在下方列出。
  • 1 个常量/枚举提供稳定值、Schema、Definition 或默认配置;应复用这些导出,避免在应用中复制内部值。

公共导出

Symbol种类签名说明
LEGACY_HUMAN_WAIT_MIGRATION_VERSION常量const LEGACY_HUMAN_WAIT_MIGRATION_VERSION: "1.0.0"modules/runtime/legacy-wait-migration 模块导出的 LEGACY HUMAN WAIT MIGRATION VERSION 常量。
migrateLegacyHumanWaitEvent函数migrateLegacyHumanWaitEvent<TEvent extends FrameworkEvent>(event: TEvent, priorPendingActionRef?: string): { event: TEvent; entry: LegacyHumanWaitMigrationEntry; }Migrate Legacy Human Wait Event 函数,提供 1 个公开调用签名;参数与返回类型见下表。
migrateLegacyHumanWaitEvents函数migrateLegacyHumanWaitEvents<TEvent extends FrameworkEvent>(events: readonly TEvent[]): LegacyHumanWaitMigrationResult<TEvent>Migrate Legacy Human Wait Events 函数,提供 1 个公开调用签名;参数与返回类型见下表。
LegacyHumanWaitMigrationEntry接口interface LegacyHumanWaitMigrationEntryLegacy Human Wait Migration Entry 接口,共包含 6 个公开字段或方法。
LegacyHumanWaitMigrationReport接口interface LegacyHumanWaitMigrationReportLegacy Human Wait Migration Report 接口,共包含 8 个公开字段或方法。
LegacyHumanWaitMigrationResult接口interface LegacyHumanWaitMigrationResultLegacy Human Wait Migration Result 接口,共包含 2 个公开字段或方法。
MigratableRuntimeEvent类型type MigratableRuntimeEvent = FrameworkEvent | PersistedFrameworkEventMigratable Runtime Event 公共类型别名;完整类型表达式见声明。

LEGACY_HUMAN_WAIT_MIGRATION_VERSION

modules/runtime/legacy-wait-migration 模块导出的 LEGACY HUMAN WAIT MIGRATION VERSION 常量。

声明

text
export declare const LEGACY_HUMAN_WAIT_MIGRATION_VERSION: "1.0.0";

migrateLegacyHumanWaitEvent

Migrate Legacy Human Wait Event 函数,提供 1 个公开调用签名;参数与返回类型见下表。

声明

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

调用签名

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

参数

参数类型必需说明
eventTEvent必需参数;接受的值由类型列定义。
priorPendingActionRefstring可选参数;接受的值由类型列定义。

返回值

  • 类型: { event: TEvent; entry: LegacyHumanWaitMigrationEntry; }
  • 说明: 返回值契约由上述类型定义。

migrateLegacyHumanWaitEvents

Migrate Legacy Human Wait Events 函数,提供 1 个公开调用签名;参数与返回类型见下表。

声明

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

调用签名

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

参数

参数类型必需说明
eventsreadonly TEvent[]必需参数;接受的值由类型列定义。

返回值

  • 类型: LegacyHumanWaitMigrationResult<TEvent>
  • 说明: 返回值契约由上述类型定义。

LegacyHumanWaitMigrationEntry

Legacy Human Wait Migration Entry 接口,共包含 6 个公开字段或方法。

声明

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

契约成员

成员种类签名说明
eventId属性eventId: string公开属性;类型、只读和可选状态以签名列为准。
pendingActionRef属性pendingActionRef?: string公开属性;类型、只读和可选状态以签名列为准。
reason属性reason?: string公开属性;类型、只读和可选状态以签名列为准。
runId属性runId: string公开属性;类型、只读和可选状态以签名列为准。
status属性status: "quarantined" | "current" | "migrated"公开属性;类型、只读和可选状态以签名列为准。
waitId属性waitId?: string公开属性;类型、只读和可选状态以签名列为准。

LegacyHumanWaitMigrationReport

Legacy Human Wait Migration Report 接口,共包含 8 个公开字段或方法。

声明

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[];
}

契约成员

成员种类签名说明
currentEvents属性currentEvents: number公开属性;类型、只读和可选状态以签名列为准。
entries属性entries: LegacyHumanWaitMigrationEntry[]公开属性;类型、只读和可选状态以签名列为准。
formatVersion属性formatVersion: "1.0.0"公开属性;类型、只读和可选状态以签名列为准。
migratedEvents属性migratedEvents: number公开属性;类型、只读和可选状态以签名列为准。
quarantinedEvents属性quarantinedEvents: number公开属性;类型、只读和可选状态以签名列为准。
quarantinedRunIds属性quarantinedRunIds: string[]公开属性;类型、只读和可选状态以签名列为准。
scannedEvents属性scannedEvents: number公开属性;类型、只读和可选状态以签名列为准。
waitingEvents属性waitingEvents: number公开属性;类型、只读和可选状态以签名列为准。

LegacyHumanWaitMigrationResult

Legacy Human Wait Migration Result 接口,共包含 2 个公开字段或方法。

声明

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

契约成员

成员种类签名说明
events属性events: TEvent[]公开属性;类型、只读和可选状态以签名列为准。
report属性report: LegacyHumanWaitMigrationReport公开属性;类型、只读和可选状态以签名列为准。

MigratableRuntimeEvent

Migratable Runtime Event 公共类型别名;完整类型表达式见声明。

声明

text
export type MigratableRuntimeEvent = FrameworkEvent | PersistedFrameworkEvent;