Skip to content

@codesoul-co/hypha-core / modules/runtime/runtime-human-wait-service

模块用法

用于执行该边界的运行时行为。Runtime human wait service 模块公开 1 类、5 接口。

从包入口导入

ts
import {
  RuntimeHumanWaitService,
} from '@codesoul-co/hypha-core';

import type {
  RuntimeHumanWaitCreateCommand,
  RuntimeHumanWaitResolveCommand,
  RuntimeHumanWaitResult,
  RuntimeHumanWaitServiceOptions,
  RuntimeHumanWaitSupersedeCommand,
} from '@codesoul-co/hypha-core';

使用要点

  • 5 个类型/接口用于应用代码、Adapter 或测试中的静态契约;请使用 import type,运行时不应依赖它们。
  • 1 个类提供可实例化的运行时实现;构造参数与公开方法在各自条目中完整列出。

公共导出

Symbol种类签名说明
RuntimeHumanWaitServicenew RuntimeHumanWaitService(options: RuntimeHumanWaitServiceOptions): RuntimeHumanWaitServiceRuntime Human Wait Service 类,共公开 4 个构造函数或成员;精确签名见本条目的声明与成员表。
RuntimeHumanWaitCreateCommand接口interface RuntimeHumanWaitCreateCommandRuntime Human Wait Create Command 接口,共包含 10 个公开字段或方法。
RuntimeHumanWaitResolveCommand接口interface RuntimeHumanWaitResolveCommandRuntime Human Wait Resolve Command 接口,共包含 11 个公开字段或方法。
RuntimeHumanWaitResult接口interface RuntimeHumanWaitResultRuntime Human Wait Result 接口,共包含 5 个公开字段或方法。
RuntimeHumanWaitServiceOptions接口interface RuntimeHumanWaitServiceOptionsRuntime Human Wait Service Options 接口,共包含 6 个公开字段或方法。
RuntimeHumanWaitSupersedeCommand接口interface RuntimeHumanWaitSupersedeCommandRuntime Human Wait Supersede Command 接口,共包含 11 个公开字段或方法。

RuntimeHumanWaitService

Runtime Human Wait Service 类,共公开 4 个构造函数或成员;精确签名见本条目的声明与成员表。

声明

text
export declare class RuntimeHumanWaitService {
    constructor(options: RuntimeHumanWaitServiceOptions);
    create(input: RuntimeHumanWaitCreateCommand): Promise<RuntimeHumanWaitResult>;
    resolve(input: RuntimeHumanWaitResolveCommand): Promise<RuntimeHumanWaitResult>;
    supersede(input: RuntimeHumanWaitSupersedeCommand): Promise<RuntimeHumanWaitResult>;
}

公开成员

成员种类签名说明
constructor构造函数(options: RuntimeHumanWaitServiceOptions): RuntimeHumanWaitService创建该类的实例。
create方法create(input: RuntimeHumanWaitCreateCommand): Promise<RuntimeHumanWaitResult>公开方法;参数与返回类型以签名列为准。
resolve方法resolve(input: RuntimeHumanWaitResolveCommand): Promise<RuntimeHumanWaitResult>公开方法;参数与返回类型以签名列为准。
supersede方法supersede(input: RuntimeHumanWaitSupersedeCommand): Promise<RuntimeHumanWaitResult>公开方法;参数与返回类型以签名列为准。

RuntimeHumanWaitCreateCommand

Runtime Human Wait Create Command 接口,共包含 10 个公开字段或方法。

声明

text
export interface RuntimeHumanWaitCreateCommand {
    commandId: string;
    scope: RuntimeScope;
    ownerId: string;
    leaseTtlMs: number;
    waitId: string;
    pendingActionRef: string;
    reason: string;
    requestedAt: string;
    humanTasks?: RuntimeHumanTaskRequest[];
    idempotencyKey?: string;
}

契约成员

成员种类签名说明
commandId属性commandId: string公开属性;类型、只读和可选状态以签名列为准。
humanTasks属性humanTasks?: RuntimeHumanTaskRequest[]公开属性;类型、只读和可选状态以签名列为准。
idempotencyKey属性idempotencyKey?: string公开属性;类型、只读和可选状态以签名列为准。
leaseTtlMs属性leaseTtlMs: number公开属性;类型、只读和可选状态以签名列为准。
ownerId属性ownerId: string公开属性;类型、只读和可选状态以签名列为准。
pendingActionRef属性pendingActionRef: string公开属性;类型、只读和可选状态以签名列为准。
reason属性reason: string公开属性;类型、只读和可选状态以签名列为准。
requestedAt属性requestedAt: string公开属性;类型、只读和可选状态以签名列为准。
scope属性scope: RuntimeScope公开属性;类型、只读和可选状态以签名列为准。
waitId属性waitId: string公开属性;类型、只读和可选状态以签名列为准。

RuntimeHumanWaitResolveCommand

Runtime Human Wait Resolve Command 接口,共包含 11 个公开字段或方法。

声明

text
export interface RuntimeHumanWaitResolveCommand {
    commandId: string;
    scope: RuntimeScope;
    ownerId: string;
    leaseTtlMs: number;
    waitId?: string;
    pendingActionRef: string;
    principalId: string;
    decision: 'approved' | 'rejected' | 'expired' | 'cancelled';
    resolvedAt: string;
    humanTaskDecision?: RuntimeHumanTaskDecisionCommand;
    idempotencyKey?: string;
}

契约成员

成员种类签名说明
commandId属性commandId: string公开属性;类型、只读和可选状态以签名列为准。
decision属性decision: "rejected" | "cancelled" | "expired" | "approved"公开属性;类型、只读和可选状态以签名列为准。
humanTaskDecision属性humanTaskDecision?: RuntimeHumanTaskDecisionCommand公开属性;类型、只读和可选状态以签名列为准。
idempotencyKey属性idempotencyKey?: string公开属性;类型、只读和可选状态以签名列为准。
leaseTtlMs属性leaseTtlMs: number公开属性;类型、只读和可选状态以签名列为准。
ownerId属性ownerId: string公开属性;类型、只读和可选状态以签名列为准。
pendingActionRef属性pendingActionRef: string公开属性;类型、只读和可选状态以签名列为准。
principalId属性principalId: string公开属性;类型、只读和可选状态以签名列为准。
resolvedAt属性resolvedAt: string公开属性;类型、只读和可选状态以签名列为准。
scope属性scope: RuntimeScope公开属性;类型、只读和可选状态以签名列为准。
waitId属性waitId?: string公开属性;类型、只读和可选状态以签名列为准。

RuntimeHumanWaitResult

Runtime Human Wait Result 接口,共包含 5 个公开字段或方法。

声明

text
export interface RuntimeHumanWaitResult {
    commandId: string;
    disposition: 'applied' | 'reused' | 'lease_unavailable';
    eventIds: string[];
    runRevision: number;
    projection: RuntimeOrchestrationProjection;
}

契约成员

成员种类签名说明
commandId属性commandId: string公开属性;类型、只读和可选状态以签名列为准。
disposition属性disposition: "applied" | "reused" | "lease_unavailable"公开属性;类型、只读和可选状态以签名列为准。
eventIds属性eventIds: string[]公开属性;类型、只读和可选状态以签名列为准。
projection属性projection: RuntimeOrchestrationProjection公开属性;类型、只读和可选状态以签名列为准。
runRevision属性runRevision: number公开属性;类型、只读和可选状态以签名列为准。

RuntimeHumanWaitServiceOptions

Runtime Human Wait Service Options 接口,共包含 6 个公开字段或方法。

声明

text
export interface RuntimeHumanWaitServiceOptions {
    events: EventRuntime;
    projections: ProjectionEngine;
    projectionStore: ProjectionStore<RuntimeOrchestrationProjection>;
    runLeases: RunLeaseStore;
    now?: () => string;
    nextId?: (namespace: string) => string;
}

契约成员

成员种类签名说明
events属性events: EventRuntime公开属性;类型、只读和可选状态以签名列为准。
nextId方法nextId?(namespace: string): string公开方法;参数与返回类型以签名列为准。
now方法now?(): string公开方法;参数与返回类型以签名列为准。
projections属性projections: ProjectionEngine公开属性;类型、只读和可选状态以签名列为准。
projectionStore属性projectionStore: ProjectionStore<RuntimeOrchestrationProjection>公开属性;类型、只读和可选状态以签名列为准。
runLeases属性runLeases: RunLeaseStore公开属性;类型、只读和可选状态以签名列为准。

RuntimeHumanWaitSupersedeCommand

Runtime Human Wait Supersede Command 接口,共包含 11 个公开字段或方法。

声明

text
export interface RuntimeHumanWaitSupersedeCommand {
    commandId: string;
    scope: RuntimeScope;
    ownerId: string;
    leaseTtlMs: number;
    waitId?: string;
    pendingActionRef: string;
    principalId: string;
    supersededAt: string;
    humanTaskDecision: RuntimeHumanTaskDecisionCommand;
    replacementTask: RuntimeHumanTaskRequest;
    idempotencyKey?: string;
}

契约成员

成员种类签名说明
commandId属性commandId: string公开属性;类型、只读和可选状态以签名列为准。
humanTaskDecision属性humanTaskDecision: RuntimeHumanTaskDecisionCommand公开属性;类型、只读和可选状态以签名列为准。
idempotencyKey属性idempotencyKey?: string公开属性;类型、只读和可选状态以签名列为准。
leaseTtlMs属性leaseTtlMs: number公开属性;类型、只读和可选状态以签名列为准。
ownerId属性ownerId: string公开属性;类型、只读和可选状态以签名列为准。
pendingActionRef属性pendingActionRef: string公开属性;类型、只读和可选状态以签名列为准。
principalId属性principalId: string公开属性;类型、只读和可选状态以签名列为准。
replacementTask属性replacementTask: RuntimeHumanTaskRequest公开属性;类型、只读和可选状态以签名列为准。
scope属性scope: RuntimeScope公开属性;类型、只读和可选状态以签名列为准。
supersededAt属性supersededAt: string公开属性;类型、只读和可选状态以签名列为准。
waitId属性waitId?: string公开属性;类型、只读和可选状态以签名列为准。