A pipeline is a collection of steps that are executed in a certain order. It is to be created createPipeline.

If you want to get the type of all steps in the pipeline (given they are created canonically using const step names), refer to PipelineStepNames.

interface Pipeline<T> {
    firstStepPerRequest: number;
    order: readonly T["name"][];
    steps: ReadonlyMap<PipelineStepName, {
        decorates?: PipelineStepName;
        dependencies: readonly PipelineStepName[];
        description: string;
        executed: PipelineStepStage;
        humanReadableName: string;
        name: PipelineStepName;
        printer: {
            0: ((input: any) => any) & InternalStepPrinter<((...args: any[]) => any)>;
            1: undefined | ((input: any, ...additional: never[]) => string | Promise<string>);
            2: undefined | ((input: any, ...additional: never[]) => string | Promise<string>);
            3: undefined | ((input: any, ...additional: never[]) => string | Promise<string>);
            4: undefined | ((input: any, ...additional: never[]) => string | Promise<string>);
            5: undefined | ((input: any, ...additional: never[]) => string | Promise<string>);
        };
        processor: ((...input: any[]) => any);
        requiredInput: object;
    }>;
}

Type Parameters

Properties

firstStepPerRequest: number

In the order, this is the index of the first step that is executed PipelineStepStage#OncePerRequest|once per request. If it is "out of bounds" (i.e., the number of steps), all steps are executed PipelineStepStage#OncePerFile|once per file.

order: readonly T["name"][]
steps: ReadonlyMap<PipelineStepName, {
    decorates?: PipelineStepName;
    dependencies: readonly PipelineStepName[];
    description: string;
    executed: PipelineStepStage;
    humanReadableName: string;
    name: PipelineStepName;
    printer: {
        0: ((input: any) => any) & InternalStepPrinter<((...args: any[]) => any)>;
        1: undefined | ((input: any, ...additional: never[]) => string | Promise<string>);
        2: undefined | ((input: any, ...additional: never[]) => string | Promise<string>);
        3: undefined | ((input: any, ...additional: never[]) => string | Promise<string>);
        4: undefined | ((input: any, ...additional: never[]) => string | Promise<string>);
        5: undefined | ((input: any, ...additional: never[]) => string | Promise<string>);
    };
    processor: ((...input: any[]) => any);
    requiredInput: object;
}>

Type declaration

  • Optional Readonlydecorates?: 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.

  • Readonlydependencies: 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.

  • Readonlydescription: string

    Human-readable description of this step

  • Readonlyexecuted: PipelineStepStage
  • ReadonlyhumanReadableName: string

    Human-readable name of this step

  • Readonlyname: PipelineStepName

    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.

  • Readonlyprinter: {
        0: ((input: any) => any) & InternalStepPrinter<((...args: any[]) => any)>;
        1: undefined | ((input: any, ...additional: never[]) => string | Promise<string>);
        2: undefined | ((input: any, ...additional: never[]) => string | Promise<string>);
        3: undefined | ((input: any, ...additional: never[]) => string | Promise<string>);
        4: undefined | ((input: any, ...additional: never[]) => string | Promise<string>);
        5: undefined | ((input: any, ...additional: never[]) => string | Promise<string>);
    }

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

    • Readonly0: ((input: any) => any) & InternalStepPrinter<((...args: any[]) => any)>
    • 1: undefined | ((input: any, ...additional: never[]) => string | Promise<string>)
    • 2: undefined | ((input: any, ...additional: never[]) => string | Promise<string>)
    • 3: undefined | ((input: any, ...additional: never[]) => string | Promise<string>)
    • 4: undefined | ((input: any, ...additional: never[]) => string | Promise<string>)
    • 5: undefined | ((input: any, ...additional: never[]) => string | Promise<string>)
  • Readonlyprocessor: ((...input: any[]) => any)

    The main processor that essentially performs the logic of this step

      • (...input): any
      • Parameters

        • Rest...input: any[]

        Returns any

  • ReadonlyrequiredInput: 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.