Type Alias ArvoOrchestratorContract<TUri, TName, TVersions, TMetaData>

ArvoOrchestratorContract<TUri, TName, TVersions, TMetaData>: ArvoContract<TUri, ReturnType<typeof init>, {
    [V in ArvoSemanticVersion & keyof TVersions]: {
        accepts: ReturnType<typeof OrchestrationInitEventBaseSchema.merge>;
        emits: {
            [K in ReturnType<typeof complete>]: TVersions[V]["complete"]
        };
    }
}, TMetaData & {
    completeEventType: ReturnType<typeof complete>;
    contractType: "ArvoOrchestratorContract";
    initEventType: ReturnType<typeof init>;
    rootType: TName;
}>

A specialized ArvoContract type for orchestrating complex event flows. Automatically generates appropriately typed init and complete events.

Type Parameters

  • TUri extends string = string

    Unique contract identifier URI

  • TName extends string = string

    Base name for generating orchestrator event types

  • TVersions extends Record<ArvoSemanticVersion, {
        complete: z.ZodObject<any, any, any>;
        init: z.ZodObject<any, any, any>;
    }> = Record<ArvoSemanticVersion, {
        complete: z.ZodObject<any, any, any>;
        init: z.ZodObject<any, any, any>;
    }>

    Version-specific schemas for init and complete events

  • TMetaData extends Record<string, any> = Record<string, any>

    Additional metadata type (optional)

Key characteristics:

  • Automatically generates init and complete event types using ArvoOrchestratorEventTypeGen
  • Enforces schema definitions for both initialization and completion events
  • Maintains version compatibility with ArvoSemanticVersion
  • Includes metadata about contract type and event types
  • Merges initialization schemas with base orchestration schema