Who emitted a journey_info, journey_warning or journey_error event: a hook, or a service provider.
journey_info
journey_warning
journey_error
import type { ContributionSource, Event } from "itinera/event";function author(source: ContributionSource): string { switch (source.kind) { case "step": return `${source.step}, attempt ${source.attempt.toString()}`; case "step hook": return `${source.policy}, ${source.hook}, for ${source.step}`; case "workflow hook": return `${source.policy}, ${source.hook}`; }}export function committed(event: Event): string | undefined { return event.kind === "contribution_committed" ? `${event.key} from ${author(event.source)}` : undefined;} Copy
import type { ContributionSource, Event } from "itinera/event";function author(source: ContributionSource): string { switch (source.kind) { case "step": return `${source.step}, attempt ${source.attempt.toString()}`; case "step hook": return `${source.policy}, ${source.hook}, for ${source.step}`; case "workflow hook": return `${source.policy}, ${source.hook}`; }}export function committed(event: Event): string | undefined { return event.kind === "contribution_committed" ? `${event.key} from ${author(event.source)}` : undefined;}
Who emitted a
journey_info,journey_warningorjourney_errorevent: a hook, or a service provider.