arvo-core
    Preparing search index...

    Class ArvoOrchestratorEventTypeGen

    Utility class for generating standardized event type strings for the Arvo orchestrator. This class provides methods to create consistent event type identifiers with predefined prefixes and suffixes for different event states (init, complete, error).

    // Generate event types for a 'payment' event
    const initEvent = ArvoOrchestratorEventTypeGen.init('payment') // 'arvo.orc.payment'
    const doneEvent = ArvoOrchestratorEventTypeGen.complete('payment') // 'arvo.orc.payment.done'
    const errorEvent = ArvoOrchestratorEventTypeGen.systemError('payment') // 'sys.arvo.orc.payment.error'
    Index

    Constructors

    Properties

    prefix: "arvo.orc" = ...

    The standard prefix used for all Arvo orchestrator events. This prefix helps identify events that belong to the Arvo orchestrator system.

    Methods

    • Generates a completion event type string for a given event name. Appends '.done' to the initialization event type.

      Type Parameters

      • T extends string

        String literal type for the event name

      Parameters

      • name: T

        The base name of the event

      Returns `arvo.orc.${T}.done`

      A type-safe string for the completion event

      ArvoOrchestratorEventTypeGen.complete('userRegistration') // Returns: 'arvo.orc.userRegistration.done'
      
    • Generates an initialization event type string for a given event name.

      Type Parameters

      • T extends string

        String literal type for the event name

      Parameters

      • name: T

        The base name of the event

      Returns `arvo.orc.${T}`

      A type-safe string combining the standard prefix with the provided name

      ArvoOrchestratorEventTypeGen.init('userRegistration') // Returns: 'arvo.orc.userRegistration'
      
    • Checks if an event type belongs to the Arvo orchestrator.

      Parameters

      • eventType: string

        Event type string to check

      Returns boolean

      True if the event is an orchestrator event, false otherwise

      
      
    • Generates a system error event type string for a given event name. Prepends 'sys.' and appends '.error' to the initialization event type.

      Type Parameters

      • T extends string

        String literal type for the event name

      Parameters

      • name: T

        The base name of the event

      Returns `sys.arvo.orc.${T}.error`

      A type-safe string for the system error event

      ArvoOrchestratorEventTypeGen.systemError('userRegistration') // Returns: 'sys.arvo.orc.userRegistration.error'