Files
certd/packages/core/pipeline/src/plugin/api.ts

44 lines
706 B
TypeScript
Raw Normal View History

2022-10-26 09:02:47 +08:00
import { Registrable } from "../registry";
2022-10-31 21:27:32 +08:00
import { FormItemProps } from "../d.ts";
2022-10-26 09:02:47 +08:00
export enum ContextScope {
global,
pipeline,
runtime,
}
export type Storage = {
scope: ContextScope;
path: string;
};
export type TaskOutputDefine = {
title: string;
value?: any;
storage?: Storage;
};
export type TaskInputDefine = FormItemProps;
export type PluginDefine = Registrable & {
2022-12-27 12:32:09 +08:00
default?: any;
inputs?: {
2022-10-26 09:02:47 +08:00
[key: string]: TaskInputDefine;
};
2022-12-27 12:32:09 +08:00
outputs?: {
2022-10-26 09:02:47 +08:00
[key: string]: TaskOutputDefine;
};
2022-12-27 12:32:09 +08:00
autowire?: any;
2022-10-26 09:02:47 +08:00
};
2022-12-27 12:32:09 +08:00
export interface ITaskPlugin {
2022-12-29 23:52:51 +08:00
onInit(): Promise<void>;
2022-12-27 12:32:09 +08:00
execute(): Promise<void>;
2022-10-26 09:02:47 +08:00
}
export type OutputVO = {
key: string;
title: string;
value: any;
};