Defines what is to be known of a single step in a pipeline. It wraps around a single processor function, providing additional information. Steps will be executed synchronously, in-sequence, based on their dependencies.

interface IPipelineStep<Name, Fn> {
    decorates?: PipelineStepName;
    dependencies: readonly PipelineStepName[];
    description: string;
    executed: PipelineStepStage;
    humanReadableName: string;
    name: Name;
    printer: {
        0: undefined | ((input: Awaited<ReturnType<Fn>>) => Awaited<ReturnType<Fn>>);
        1: undefined | ((input: Awaited<ReturnType<Fn>>, ...additional: never[]) => string | Promise<string>);
        2: undefined | ((input: Awaited<ReturnType<Fn>>, ...additional: never[]) => string | Promise<string>);
        3: undefined | ((input: Awaited<ReturnType<Fn>>, ...additional: never[]) => string | Promise<string>);
        4: undefined | ((input: Awaited<ReturnType<Fn>>, ...additional: never[]) => string | Promise<string>);
        5: undefined | ((input: Awaited<ReturnType<Fn>>, ...additional: never[]) => string | Promise<string>);
    } & {
        0: InternalStepPrinter<Fn>;
    };
    processor: ((...input: Parameters<Fn>) => ReturnType<Fn>);
    requiredInput: object;
}

Type Parameters

Hierarchy (view full)

Hierarchy-Diagram

UML class diagram of IPipelineStep

Properties

decorates?: PipelineStepName

This is similar to dependencies, but is used to say that a given step decorates another one. This imbues two requirements: The step must take the output of the decorated step as input, and produce the same output as the decorated step.

If so, it is ensured that this step is executed after the step it decorates, but before any step that depends on it.

dependencies: readonly PipelineStepName[]

Give the names of other steps this one requires to be completed as a prerequisite (e.g., to gain access to their input). Does not have to be transitive, this will be checked by the scheduler of the pipeline.

description: string

Human-readable description of this step

humanReadableName: string

Human-readable name of this step

name: Name

Name of the respective step, it does not have to be unique in general but only unique per-pipeline. In other words, you can have multiple steps with a name like parse as long as you use only one of them in a given pipeline. This is, because these names are required in the IPipelineStep#dependencies field to refer to other steps this one relies on.

printer: {
    0: undefined | ((input: Awaited<ReturnType<Fn>>) => Awaited<ReturnType<Fn>>);
    1: undefined | ((input: Awaited<ReturnType<Fn>>, ...additional: never[]) => string | Promise<string>);
    2: undefined | ((input: Awaited<ReturnType<Fn>>, ...additional: never[]) => string | Promise<string>);
    3: undefined | ((input: Awaited<ReturnType<Fn>>, ...additional: never[]) => string | Promise<string>);
    4: undefined | ((input: Awaited<ReturnType<Fn>>, ...additional: never[]) => string | Promise<string>);
    5: undefined | ((input: Awaited<ReturnType<Fn>>, ...additional: never[]) => string | Promise<string>);
} & {
    0: InternalStepPrinter<Fn>;
}

How to visualize the results of the respective step to the user?

processor: ((...input: Parameters<Fn>) => ReturnType<Fn>)

The main processor that essentially performs the logic of this step

requiredInput: object

Input configuration required to perform the respective steps. Required inputs of dependencies do not have to, but can be repeated.

Use the pattern `undefined as unknown as T` to indicate that the value is required but not provided.