@gentrace/core
Version:
Core Gentrace Node.JS library
42 lines (41 loc) • 1.4 kB
TypeScript
import { Configuration } from "../configuration";
import { PluginContext } from "./context";
import { PipelineRun } from "./pipeline-run";
import { GentracePlugin } from "./plugin";
export declare class Pipeline<T extends {
[key: string]: GentracePlugin<any, any>;
}> {
id: string;
slug: string;
config: Configuration;
plugins: T;
constructor({ slug, id, apiKey, basePath, logger, plugins, }: {
slug?: string;
/**
* @deprecated Use the "slug" parameter instead
*/
id?: string;
/**
* @deprecated Declare the API key in the init() call instead.
*/
apiKey?: string | Promise<string> | ((name: string) => string) | ((name: string) => Promise<string>);
/**
* @deprecated Declare the base path in the init() call instead.
*/
basePath?: string;
logger?: {
info: (message: string, context?: any) => void;
warn: (message: string | Error, context?: any) => void;
};
plugins?: T;
});
getLogger(): {
info: (message: string, context?: any) => void;
warn: (message: string | Error, context?: any) => void;
};
logInfo(message: string): void;
logWarn(e: Error | string): void;
start(context?: PluginContext): PipelineRun & {
[key in keyof T]: ReturnType<T[key]["advanced"]>;
};
}