Type Alias JourneyId

JourneyId: string & { "[journeyId]": true }

The ID of a journey, which every event of the journey carries. itinera gives one to every workflow instance, from the workflow's ID generator or a random UUID, so a plain string is not mistaken for one.

import type { JourneyId } from "itinera/journey";
import type { PolicyName } from "itinera/policy";
import type { ProviderName } from "itinera/service";
import type { StepName } from "itinera/step";
import type { AdapterName, WorkflowName } from "itinera/workflow";

export function origin(
journeyId: JourneyId,
workflow: WorkflowName,
step: StepName,
by?: PolicyName | AdapterName | ProviderName,
): string {
return by === undefined
? `${workflow} ${journeyId}, step ${step}`
: `${workflow} ${journeyId}, step ${step}, by ${by}`;
}

Type Declaration

  • Readonly[journeyId]: true

    Marks the string as a journey ID made by itinera.