Skip to content

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

Using this module

Use the Runtime human wait service module for executing runtime behavior at this boundary. It exports 1 class, 5 interfaces.

Import from the package entrypoint

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

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

Usage patterns

  • Use the 5 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.

Public exports

SymbolKindSignatureDescription
RuntimeHumanWaitServiceclassnew RuntimeHumanWaitService(options: RuntimeHumanWaitServiceOptions): RuntimeHumanWaitServiceRuntime Human Wait Service class with 4 public constructor or member entries; its exact declarations are listed below.
RuntimeHumanWaitCreateCommandinterfaceinterface RuntimeHumanWaitCreateCommandRuntime Human Wait Create Command interface with 10 public fields or methods.
RuntimeHumanWaitResolveCommandinterfaceinterface RuntimeHumanWaitResolveCommandRuntime Human Wait Resolve Command interface with 11 public fields or methods.
RuntimeHumanWaitResultinterfaceinterface RuntimeHumanWaitResultRuntime Human Wait Result interface with 5 public fields or methods.
RuntimeHumanWaitServiceOptionsinterfaceinterface RuntimeHumanWaitServiceOptionsRuntime Human Wait Service Options interface with 6 public fields or methods.
RuntimeHumanWaitSupersedeCommandinterfaceinterface RuntimeHumanWaitSupersedeCommandRuntime Human Wait Supersede Command interface with 11 public fields or methods.

RuntimeHumanWaitService

Runtime Human Wait Service class with 4 public constructor or member entries; its exact declarations are listed below.

Declaration

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

Public members

MemberKindSignatureDescription
constructorconstructor(options: RuntimeHumanWaitServiceOptions): RuntimeHumanWaitServiceCreates an instance of this class.
createmethodcreate(input: RuntimeHumanWaitCreateCommand): Promise<RuntimeHumanWaitResult>Public method; parameters and return type are shown in the signature.
resolvemethodresolve(input: RuntimeHumanWaitResolveCommand): Promise<RuntimeHumanWaitResult>Public method; parameters and return type are shown in the signature.
supersedemethodsupersede(input: RuntimeHumanWaitSupersedeCommand): Promise<RuntimeHumanWaitResult>Public method; parameters and return type are shown in the signature.

RuntimeHumanWaitCreateCommand

Runtime Human Wait Create Command interface with 10 public fields or methods.

Declaration

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

Contract members

MemberKindSignatureDescription
commandIdpropertycommandId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
humanTaskspropertyhumanTasks?: RuntimeHumanTaskRequest[]Public property; its type, readonly modifier and optionality are shown in the signature.
idempotencyKeypropertyidempotencyKey?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
leaseTtlMspropertyleaseTtlMs: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
ownerIdpropertyownerId: 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.
requestedAtpropertyrequestedAt: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
scopepropertyscope: RuntimeScopePublic 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.

RuntimeHumanWaitResolveCommand

Runtime Human Wait Resolve Command interface with 11 public fields or methods.

Declaration

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

Contract members

MemberKindSignatureDescription
commandIdpropertycommandId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
decisionpropertydecision: "rejected" | "cancelled" | "expired" | "approved"Public property; its type, readonly modifier and optionality are shown in the signature.
humanTaskDecisionpropertyhumanTaskDecision?: RuntimeHumanTaskDecisionCommandPublic property; its type, readonly modifier and optionality are shown in the signature.
idempotencyKeypropertyidempotencyKey?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
leaseTtlMspropertyleaseTtlMs: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
ownerIdpropertyownerId: 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.
principalIdpropertyprincipalId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
resolvedAtpropertyresolvedAt: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
scopepropertyscope: RuntimeScopePublic 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.

RuntimeHumanWaitResult

Runtime Human Wait Result interface with 5 public fields or methods.

Declaration

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

Contract members

MemberKindSignatureDescription
commandIdpropertycommandId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
dispositionpropertydisposition: "applied" | "reused" | "lease_unavailable"Public property; its type, readonly modifier and optionality are shown in the signature.
eventIdspropertyeventIds: string[]Public property; its type, readonly modifier and optionality are shown in the signature.
projectionpropertyprojection: RuntimeOrchestrationProjectionPublic property; its type, readonly modifier and optionality are shown in the signature.
runRevisionpropertyrunRevision: numberPublic property; its type, readonly modifier and optionality are shown in the signature.

RuntimeHumanWaitServiceOptions

Runtime Human Wait Service Options interface with 6 public fields or methods.

Declaration

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

Contract members

MemberKindSignatureDescription
eventspropertyevents: EventRuntimePublic property; its type, readonly modifier and optionality are shown in the signature.
nextIdmethodnextId?(namespace: string): stringPublic method; parameters and return type are shown in the signature.
nowmethodnow?(): stringPublic method; parameters and return type are shown in the signature.
projectionspropertyprojections: ProjectionEnginePublic property; its type, readonly modifier and optionality are shown in the signature.
projectionStorepropertyprojectionStore: ProjectionStore<RuntimeOrchestrationProjection>Public property; its type, readonly modifier and optionality are shown in the signature.
runLeasespropertyrunLeases: RunLeaseStorePublic property; its type, readonly modifier and optionality are shown in the signature.

RuntimeHumanWaitSupersedeCommand

Runtime Human Wait Supersede Command interface with 11 public fields or methods.

Declaration

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

Contract members

MemberKindSignatureDescription
commandIdpropertycommandId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
humanTaskDecisionpropertyhumanTaskDecision: RuntimeHumanTaskDecisionCommandPublic property; its type, readonly modifier and optionality are shown in the signature.
idempotencyKeypropertyidempotencyKey?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
leaseTtlMspropertyleaseTtlMs: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
ownerIdpropertyownerId: 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.
principalIdpropertyprincipalId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
replacementTaskpropertyreplacementTask: RuntimeHumanTaskRequestPublic property; its type, readonly modifier and optionality are shown in the signature.
scopepropertyscope: RuntimeScopePublic property; its type, readonly modifier and optionality are shown in the signature.
supersededAtpropertysupersededAt: stringPublic 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.