Interface AdapterSource

An input adapter, resolving an input of a step for one of its attempts.

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;
}
interface AdapterSource {
    adapter: AdapterName;
    attempt: Attempt;
    kind: "adapter";
    step: StepName;
}

Hierarchy (View Summary)

Index

adapter: AdapterName

The adapter's name.

attempt: Attempt

The attempt.

kind: "adapter"

Who it is.

step: StepName

The step's name.