Type Alias PolicyName

PolicyName: string & { "[policyName]": true }

The name of a policy: a string that is never empty, checked when the workflow is declared, 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[policyName]: true

    Marks the string as a policy name made by itinera.