@certd/pipeline 1.22.7 → 1.22.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/build.md +1 -1
- package/dist/core/file-store.js +3 -1
- package/dist/core/license.spec.d.ts +1 -0
- package/dist/core/license.spec.js +16 -0
- package/dist/plugin/test/echo-plugin.js +1 -1
- package/package.json +2 -2
- package/test/cert.fake.test.js +4 -0
- package/test/pipeline/access-service-test.js +65 -0
- package/test/pipeline/init.test.js +16 -0
- package/test/pipeline/license.test.spec.js +63 -0
- package/test/pipeline/license.test.spec.ts +16 -0
- package/test/pipeline/pipeline.define.js +68 -0
- package/test/pipeline/pipeline.test.js +70 -0
- package/tsconfig.tsbuildinfo +1 -1
- package/dist/bundle.js +0 -25
- package/dist/d/access/api.d.ts +0 -16
- package/dist/d/access/decorator.d.ts +0 -5
- package/dist/d/access/index.d.ts +0 -3
- package/dist/d/access/registry.d.ts +0 -2
- package/dist/d/context/index.d.ts +0 -5
- package/dist/d/core/context.d.ts +0 -32
- package/dist/d/core/executor.d.ts +0 -39
- package/dist/d/core/file-store.d.ts +0 -16
- package/dist/d/core/index.d.ts +0 -5
- package/dist/d/core/run-history.d.ts +0 -40
- package/dist/d/core/storage.d.ts +0 -30
- package/dist/d/d.ts/fast-crud.d.ts +0 -107
- package/dist/d/d.ts/index.d.ts +0 -2
- package/dist/d/d.ts/pipeline.d.ts +0 -122
- package/dist/d/decorator/common.d.ts +0 -6
- package/dist/d/decorator/index.d.ts +0 -2
- package/dist/d/decorator/utils.d.ts +0 -11
- package/dist/d/index.d.ts +0 -10
- package/dist/d/midway/configuration.d.ts +0 -6
- package/dist/d/midway/index.d.ts +0 -1
- package/dist/d/plugin/api.d.ts +0 -76
- package/dist/d/plugin/decorator.d.ts +0 -10
- package/dist/d/plugin/index.d.ts +0 -3
- package/dist/d/plugin/registry.d.ts +0 -3
- package/dist/d/plugin/test/echo-plugin.d.ts +0 -6
- package/dist/d/registry/index.d.ts +0 -1
- package/dist/d/registry/registry.d.ts +0 -28
- package/dist/d/service/email.d.ts +0 -9
- package/dist/d/service/index.d.ts +0 -1
- package/dist/d/utils/index.d.ts +0 -7
- package/dist/d/utils/util.file.d.ts +0 -5
- package/dist/d/utils/util.log.d.ts +0 -4
- package/dist/d/utils/util.promise.d.ts +0 -1
- package/dist/d/utils/util.request.d.ts +0 -8
- package/dist/d/utils/util.sleep.d.ts +0 -1
- package/stats.html +0 -6177
- package/test/user.secret.ts +0 -4
package/dist/d/access/api.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { Registrable } from "../registry";
|
|
2
|
-
import { FormItemProps } from "../d.ts";
|
|
3
|
-
export type AccessInputDefine = FormItemProps & {
|
|
4
|
-
title: string;
|
|
5
|
-
required?: boolean;
|
|
6
|
-
};
|
|
7
|
-
export type AccessDefine = Registrable & {
|
|
8
|
-
input?: {
|
|
9
|
-
[key: string]: AccessInputDefine;
|
|
10
|
-
};
|
|
11
|
-
};
|
|
12
|
-
export interface IAccessService {
|
|
13
|
-
getById(id: any): Promise<any>;
|
|
14
|
-
}
|
|
15
|
-
export interface IAccess {
|
|
16
|
-
}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { AccessDefine, AccessInputDefine } from "./api";
|
|
2
|
-
export declare const ACCESS_CLASS_KEY = "pipeline:access";
|
|
3
|
-
export declare const ACCESS_INPUT_KEY = "pipeline:access:input";
|
|
4
|
-
export declare function IsAccess(define: AccessDefine): ClassDecorator;
|
|
5
|
-
export declare function AccessInput(input?: AccessInputDefine): PropertyDecorator;
|
package/dist/d/access/index.d.ts
DELETED
package/dist/d/core/context.d.ts
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { IStorage } from "./storage";
|
|
2
|
-
export interface IContext {
|
|
3
|
-
getInt(key: string): Promise<number>;
|
|
4
|
-
get(key: string): Promise<string | null>;
|
|
5
|
-
set(key: string, value: string): Promise<void>;
|
|
6
|
-
getObj<T = any>(key: string): Promise<T | null>;
|
|
7
|
-
setObj<T = any>(key: string, value: T): Promise<void>;
|
|
8
|
-
updateVersion(): Promise<void>;
|
|
9
|
-
initVersion(): Promise<void>;
|
|
10
|
-
}
|
|
11
|
-
export declare class ContextFactory {
|
|
12
|
-
storage: IStorage;
|
|
13
|
-
memoryStorage: IStorage;
|
|
14
|
-
constructor(storage: IStorage);
|
|
15
|
-
getContext(scope: string, namespace: string): IContext;
|
|
16
|
-
getMemoryContext(scope: string, namespace: string): IContext;
|
|
17
|
-
}
|
|
18
|
-
export declare class StorageContext implements IContext {
|
|
19
|
-
storage: IStorage;
|
|
20
|
-
namespace: string;
|
|
21
|
-
scope: string;
|
|
22
|
-
_version: number;
|
|
23
|
-
_initialVersion: number;
|
|
24
|
-
constructor(scope: string, namespace: string, storage: IStorage);
|
|
25
|
-
initVersion(): Promise<void>;
|
|
26
|
-
updateVersion(): Promise<void>;
|
|
27
|
-
get(key: string): Promise<string | null>;
|
|
28
|
-
set(key: string, value: string): Promise<void>;
|
|
29
|
-
getInt(key: string): Promise<number>;
|
|
30
|
-
getObj<T = any>(key: string): Promise<T | null>;
|
|
31
|
-
setObj<T = any>(key: string, value: T): Promise<void>;
|
|
32
|
-
}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { NotificationWhen, Pipeline, ResultType, Runnable, Stage } from "../d.ts";
|
|
2
|
-
import { RunHistory, RunnableCollection } from "./run-history";
|
|
3
|
-
import { ContextFactory, IContext } from "./context";
|
|
4
|
-
import { IStorage } from "./storage";
|
|
5
|
-
import { Logger } from "log4js";
|
|
6
|
-
import { IAccessService } from "../access";
|
|
7
|
-
import { IEmailService } from "../service";
|
|
8
|
-
export type ExecutorOptions = {
|
|
9
|
-
userId: any;
|
|
10
|
-
pipeline: Pipeline;
|
|
11
|
-
storage: IStorage;
|
|
12
|
-
onChanged: (history: RunHistory) => Promise<void>;
|
|
13
|
-
accessService: IAccessService;
|
|
14
|
-
emailService: IEmailService;
|
|
15
|
-
fileRootDir?: string;
|
|
16
|
-
};
|
|
17
|
-
export declare class Executor {
|
|
18
|
-
pipeline: Pipeline;
|
|
19
|
-
runtime: RunHistory;
|
|
20
|
-
contextFactory: ContextFactory;
|
|
21
|
-
logger: Logger;
|
|
22
|
-
pipelineContext: IContext;
|
|
23
|
-
lastStatusMap: RunnableCollection;
|
|
24
|
-
lastRuntime: RunHistory;
|
|
25
|
-
options: ExecutorOptions;
|
|
26
|
-
canceled: boolean;
|
|
27
|
-
onChanged: (history: RunHistory) => void;
|
|
28
|
-
constructor(options: ExecutorOptions);
|
|
29
|
-
init(): Promise<void>;
|
|
30
|
-
cancel(): Promise<void>;
|
|
31
|
-
run(runtimeId: any, triggerType: string): Promise<void>;
|
|
32
|
-
runWithHistory(runnable: Runnable, runnableType: string, run: () => Promise<void>): Promise<ResultType.success | ResultType.skip>;
|
|
33
|
-
private runStages;
|
|
34
|
-
runStage(stage: Stage): Promise<ResultType.success | ResultType.error>;
|
|
35
|
-
compositionResultType(resList: ResultType[]): ResultType.success | ResultType.error;
|
|
36
|
-
private runTask;
|
|
37
|
-
private runStep;
|
|
38
|
-
notification(when: NotificationWhen, error?: any): Promise<void>;
|
|
39
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
export type FileStoreOptions = {
|
|
3
|
-
rootDir?: string;
|
|
4
|
-
scope: string;
|
|
5
|
-
parent: string;
|
|
6
|
-
};
|
|
7
|
-
export declare class FileStore {
|
|
8
|
-
rootDir: string;
|
|
9
|
-
scope: string;
|
|
10
|
-
parent: string;
|
|
11
|
-
constructor(options?: FileStoreOptions);
|
|
12
|
-
readFile(filePath: string): Buffer | null;
|
|
13
|
-
writeFile(filename: string, file: Buffer): string;
|
|
14
|
-
private buildFilePath;
|
|
15
|
-
deleteByParent(scope: string, parent: string): void;
|
|
16
|
-
}
|
package/dist/d/core/index.d.ts
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { Context, HistoryResult, Pipeline, Runnable, RunnableMap } from "../d.ts";
|
|
2
|
-
import { Logger } from "log4js";
|
|
3
|
-
export type HistoryStatus = {
|
|
4
|
-
result: HistoryResult;
|
|
5
|
-
logs: string[];
|
|
6
|
-
};
|
|
7
|
-
export type RunTrigger = {
|
|
8
|
-
type: string;
|
|
9
|
-
};
|
|
10
|
-
export declare function NewRunHistory(obj: any): RunHistory;
|
|
11
|
-
export declare class RunHistory {
|
|
12
|
-
id: string;
|
|
13
|
-
context: Context;
|
|
14
|
-
pipeline: Pipeline;
|
|
15
|
-
logs: {
|
|
16
|
-
[runnableId: string]: string[];
|
|
17
|
-
};
|
|
18
|
-
_loggers: {
|
|
19
|
-
[runnableId: string]: Logger;
|
|
20
|
-
};
|
|
21
|
-
trigger: RunTrigger;
|
|
22
|
-
constructor(runtimeId: any, trigger: RunTrigger, pipeline: Pipeline);
|
|
23
|
-
start(runnable: Runnable): HistoryResult;
|
|
24
|
-
success(runnable: Runnable): void;
|
|
25
|
-
skip(runnable: Runnable): void;
|
|
26
|
-
error(runnable: Runnable, e: Error): void;
|
|
27
|
-
cancel(runnable: Runnable): void;
|
|
28
|
-
log(runnable: Runnable, text: string): void;
|
|
29
|
-
logError(runnable: Runnable, e: Error): void;
|
|
30
|
-
finally(runnable: Runnable): void;
|
|
31
|
-
}
|
|
32
|
-
export declare class RunnableCollection {
|
|
33
|
-
private collection;
|
|
34
|
-
private pipeline;
|
|
35
|
-
constructor(pipeline?: Pipeline);
|
|
36
|
-
static each<T extends Runnable>(list: T[], exec: (item: Runnable) => void): void;
|
|
37
|
-
toMap(pipeline: Pipeline): RunnableMap;
|
|
38
|
-
get(id: string): Runnable | undefined;
|
|
39
|
-
clear(): void;
|
|
40
|
-
}
|
package/dist/d/core/storage.d.ts
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
export interface IStorage {
|
|
2
|
-
get(scope: string, namespace: string, version: string, key: string): Promise<string | null>;
|
|
3
|
-
set(scope: string, namespace: string, version: string, key: string, value: string): Promise<void>;
|
|
4
|
-
remove(scope: string, namespace: string, version: string, key: string): Promise<void>;
|
|
5
|
-
}
|
|
6
|
-
export declare class FileStorage implements IStorage {
|
|
7
|
-
root: string;
|
|
8
|
-
constructor(rootDir?: string);
|
|
9
|
-
remove(scope: string, namespace: string, version: string, key: string): Promise<void>;
|
|
10
|
-
writeFile(filePath: string, value: string): string;
|
|
11
|
-
readFile(filePath: string): string | null;
|
|
12
|
-
get(scope: string, namespace: string, version: string, key: string): Promise<string | null>;
|
|
13
|
-
set(scope: string, namespace: string, version: string, key: string, value: string): Promise<void>;
|
|
14
|
-
private buildPath;
|
|
15
|
-
}
|
|
16
|
-
export declare class MemoryStorage implements IStorage {
|
|
17
|
-
/**
|
|
18
|
-
* 范围: user / pipeline / runtime / task
|
|
19
|
-
*/
|
|
20
|
-
scope: any;
|
|
21
|
-
namespace: any;
|
|
22
|
-
context: {
|
|
23
|
-
[scope: string]: {
|
|
24
|
-
[key: string]: any;
|
|
25
|
-
};
|
|
26
|
-
};
|
|
27
|
-
get(scope: string, namespace: string, version: string, key: string): Promise<string | null>;
|
|
28
|
-
set(scope: string, namespace: string, version: string, key: string, value: string): Promise<void>;
|
|
29
|
-
remove(scope: string, namespace?: string, version?: string, key?: string): Promise<void>;
|
|
30
|
-
}
|
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* [x]-col的配置
|
|
3
|
-
*/
|
|
4
|
-
export type ColProps = {
|
|
5
|
-
span?: number;
|
|
6
|
-
[props: string]: any;
|
|
7
|
-
};
|
|
8
|
-
export type FormItemProps = {
|
|
9
|
-
/**
|
|
10
|
-
* 字段label
|
|
11
|
-
*/
|
|
12
|
-
title?: string;
|
|
13
|
-
/**
|
|
14
|
-
* 表单字段组件配置
|
|
15
|
-
*/
|
|
16
|
-
component?: ComponentProps;
|
|
17
|
-
/**
|
|
18
|
-
* 表单字段 [a|el|n]-col的配置
|
|
19
|
-
* 一般用来配置跨列:{span:24} 占满一行
|
|
20
|
-
*/
|
|
21
|
-
col?: ColProps;
|
|
22
|
-
/**
|
|
23
|
-
* 默认值
|
|
24
|
-
*/
|
|
25
|
-
value?: any;
|
|
26
|
-
/**
|
|
27
|
-
* 帮助提示配置
|
|
28
|
-
*/
|
|
29
|
-
helper?: string | FormItemHelperProps;
|
|
30
|
-
/**
|
|
31
|
-
* 排序号
|
|
32
|
-
*/
|
|
33
|
-
order?: number;
|
|
34
|
-
/**
|
|
35
|
-
* 是否显示此字段
|
|
36
|
-
*/
|
|
37
|
-
show?: boolean;
|
|
38
|
-
/**
|
|
39
|
-
* 是否是空白占位栏
|
|
40
|
-
*/
|
|
41
|
-
blank?: boolean;
|
|
42
|
-
[key: string]: any;
|
|
43
|
-
};
|
|
44
|
-
/**
|
|
45
|
-
* 表单字段帮助说明配置
|
|
46
|
-
*/
|
|
47
|
-
export type FormItemHelperProps = {
|
|
48
|
-
/**
|
|
49
|
-
* 自定义渲染帮助说明
|
|
50
|
-
* @param scope
|
|
51
|
-
*/
|
|
52
|
-
render?: (scope: any) => any;
|
|
53
|
-
/**
|
|
54
|
-
* 帮助文本
|
|
55
|
-
*/
|
|
56
|
-
text?: string;
|
|
57
|
-
/**
|
|
58
|
-
* 帮助说明所在的位置,[ undefined | label]
|
|
59
|
-
*/
|
|
60
|
-
position?: string;
|
|
61
|
-
/**
|
|
62
|
-
* [a|el|n]-tooltip配置
|
|
63
|
-
*/
|
|
64
|
-
tooltip?: object;
|
|
65
|
-
[key: string]: any;
|
|
66
|
-
};
|
|
67
|
-
/**
|
|
68
|
-
* 组件配置
|
|
69
|
-
*/
|
|
70
|
-
export type ComponentProps = {
|
|
71
|
-
/**
|
|
72
|
-
* 组件的名称
|
|
73
|
-
*/
|
|
74
|
-
name?: string | object;
|
|
75
|
-
/**
|
|
76
|
-
* vmodel绑定的目标属性名
|
|
77
|
-
*/
|
|
78
|
-
vModel?: string;
|
|
79
|
-
/**
|
|
80
|
-
* 当原始组件名的参数被以上属性名占用时,可以配置在这里
|
|
81
|
-
* 例如:原始组件有一个叫name的属性,你想要配置它,则可以按如下配置
|
|
82
|
-
* ```
|
|
83
|
-
* component:{
|
|
84
|
-
* name:"组件的名称"
|
|
85
|
-
* props:{
|
|
86
|
-
* name:"组件的name属性" <-----------
|
|
87
|
-
* }
|
|
88
|
-
* }
|
|
89
|
-
* ```
|
|
90
|
-
*/
|
|
91
|
-
props?: {
|
|
92
|
-
[key: string]: any;
|
|
93
|
-
};
|
|
94
|
-
/**
|
|
95
|
-
* 组件事件监听
|
|
96
|
-
*/
|
|
97
|
-
on?: {
|
|
98
|
-
[key: string]: (context?: any) => void;
|
|
99
|
-
};
|
|
100
|
-
/**
|
|
101
|
-
* 组件其他参数
|
|
102
|
-
* 事件:onXxx:(event)=>void 组件原始事件监听
|
|
103
|
-
* on.onXxx:(context)=>void 组件事件监听(对原始事件包装)
|
|
104
|
-
* 样式:style、class等
|
|
105
|
-
*/
|
|
106
|
-
[key: string]: any;
|
|
107
|
-
};
|
package/dist/d/d.ts/index.d.ts
DELETED
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
export declare enum RunStrategy {
|
|
2
|
-
AlwaysRun = 0,
|
|
3
|
-
SkipWhenSucceed = 1
|
|
4
|
-
}
|
|
5
|
-
export declare enum ConcurrencyStrategy {
|
|
6
|
-
Serial = 0,
|
|
7
|
-
Parallel = 1
|
|
8
|
-
}
|
|
9
|
-
export declare enum NextStrategy {
|
|
10
|
-
AllSuccess = 0,
|
|
11
|
-
OneSuccess = 1
|
|
12
|
-
}
|
|
13
|
-
export declare enum HandlerType {
|
|
14
|
-
ClearFollowStatus = 0,
|
|
15
|
-
SendEmail = 1
|
|
16
|
-
}
|
|
17
|
-
export type EventHandler = {
|
|
18
|
-
type: HandlerType;
|
|
19
|
-
params: {
|
|
20
|
-
[key: string]: any;
|
|
21
|
-
};
|
|
22
|
-
};
|
|
23
|
-
export type RunnableStrategy = {
|
|
24
|
-
runStrategy?: RunStrategy;
|
|
25
|
-
onSuccess?: EventHandler[];
|
|
26
|
-
onError?: EventHandler[];
|
|
27
|
-
};
|
|
28
|
-
export type Step = Runnable & {
|
|
29
|
-
type: string;
|
|
30
|
-
input: {
|
|
31
|
-
[key: string]: any;
|
|
32
|
-
};
|
|
33
|
-
};
|
|
34
|
-
export type Task = Runnable & {
|
|
35
|
-
steps: Step[];
|
|
36
|
-
};
|
|
37
|
-
export type Stage = Runnable & {
|
|
38
|
-
tasks: Task[];
|
|
39
|
-
concurrency: ConcurrencyStrategy;
|
|
40
|
-
next: NextStrategy;
|
|
41
|
-
};
|
|
42
|
-
export type Trigger = {
|
|
43
|
-
id: string;
|
|
44
|
-
title: string;
|
|
45
|
-
cron: string;
|
|
46
|
-
type: string;
|
|
47
|
-
};
|
|
48
|
-
export type FileItem = {
|
|
49
|
-
id: string;
|
|
50
|
-
filename: string;
|
|
51
|
-
path: string;
|
|
52
|
-
};
|
|
53
|
-
export type Runnable = {
|
|
54
|
-
id: string;
|
|
55
|
-
title: string;
|
|
56
|
-
strategy?: RunnableStrategy;
|
|
57
|
-
runnableType?: string;
|
|
58
|
-
status?: HistoryResult;
|
|
59
|
-
timeout?: number;
|
|
60
|
-
default?: {
|
|
61
|
-
[key: string]: any;
|
|
62
|
-
};
|
|
63
|
-
};
|
|
64
|
-
export type EmailOptions = {
|
|
65
|
-
receivers: string[];
|
|
66
|
-
};
|
|
67
|
-
export type NotificationWhen = "error" | "success" | "turnToSuccess" | "start";
|
|
68
|
-
export type NotificationType = "email" | "url";
|
|
69
|
-
export type Notification = {
|
|
70
|
-
type: NotificationType;
|
|
71
|
-
when: NotificationWhen[];
|
|
72
|
-
options: EmailOptions;
|
|
73
|
-
};
|
|
74
|
-
export type Pipeline = Runnable & {
|
|
75
|
-
version?: number;
|
|
76
|
-
userId: any;
|
|
77
|
-
stages: Stage[];
|
|
78
|
-
triggers: Trigger[];
|
|
79
|
-
notifications?: Notification[];
|
|
80
|
-
};
|
|
81
|
-
export type Context = {
|
|
82
|
-
[key: string]: any;
|
|
83
|
-
};
|
|
84
|
-
export type Log = {
|
|
85
|
-
title: string;
|
|
86
|
-
time: number;
|
|
87
|
-
level: string;
|
|
88
|
-
text: string;
|
|
89
|
-
};
|
|
90
|
-
export declare enum ResultType {
|
|
91
|
-
start = "start",
|
|
92
|
-
success = "success",
|
|
93
|
-
error = "error",
|
|
94
|
-
canceled = "canceled",
|
|
95
|
-
skip = "skip",
|
|
96
|
-
none = "none"
|
|
97
|
-
}
|
|
98
|
-
export type HistoryResultGroup = {
|
|
99
|
-
[key: string]: {
|
|
100
|
-
runnable: Runnable;
|
|
101
|
-
res: HistoryResult;
|
|
102
|
-
};
|
|
103
|
-
};
|
|
104
|
-
export type HistoryResult = {
|
|
105
|
-
input: any;
|
|
106
|
-
output: any;
|
|
107
|
-
files?: FileItem[];
|
|
108
|
-
/**
|
|
109
|
-
* 任务状态
|
|
110
|
-
*/
|
|
111
|
-
status: ResultType;
|
|
112
|
-
startTime: number;
|
|
113
|
-
endTime?: number;
|
|
114
|
-
/**
|
|
115
|
-
* 处理结果
|
|
116
|
-
*/
|
|
117
|
-
result?: ResultType;
|
|
118
|
-
message?: string;
|
|
119
|
-
};
|
|
120
|
-
export type RunnableMap = {
|
|
121
|
-
[id: string]: Runnable;
|
|
122
|
-
};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
declare function attachProperty(target: any, propertyKey: string | symbol): void;
|
|
2
|
-
declare function getClassProperties(target: any): any;
|
|
3
|
-
declare function target(target: any, propertyKey?: string | symbol): any;
|
|
4
|
-
declare function inject(define: any, instance: any, context: any, preHandler?: (item: any, key: string, instance: any, context: any) => void): void;
|
|
5
|
-
export declare const Decorator: {
|
|
6
|
-
target: typeof target;
|
|
7
|
-
attachProperty: typeof attachProperty;
|
|
8
|
-
getClassProperties: typeof getClassProperties;
|
|
9
|
-
inject: typeof inject;
|
|
10
|
-
};
|
|
11
|
-
export {};
|
package/dist/d/index.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import "util";
|
|
2
|
-
export * from "./core";
|
|
3
|
-
export * from "./d.ts";
|
|
4
|
-
export * from "./access";
|
|
5
|
-
export * from "./registry";
|
|
6
|
-
export * from "./plugin";
|
|
7
|
-
export * from "./utils";
|
|
8
|
-
export * from "./context";
|
|
9
|
-
export * from "./decorator";
|
|
10
|
-
export * from "./service";
|
package/dist/d/midway/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { PipelineConfiguration } from "./configuration";
|
package/dist/d/plugin/api.d.ts
DELETED
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import { Registrable } from "../registry";
|
|
3
|
-
import { FileItem, FormItemProps, Pipeline, Runnable, Step } from "../d.ts";
|
|
4
|
-
import { FileStore } from "../core/file-store";
|
|
5
|
-
import { Logger } from "log4js";
|
|
6
|
-
import { IAccessService } from "../access";
|
|
7
|
-
import { IEmailService } from "../service";
|
|
8
|
-
import { IContext } from "../core";
|
|
9
|
-
import { AxiosInstance } from "axios";
|
|
10
|
-
export declare enum ContextScope {
|
|
11
|
-
global = 0,
|
|
12
|
-
pipeline = 1,
|
|
13
|
-
runtime = 2
|
|
14
|
-
}
|
|
15
|
-
export type TaskOutputDefine = {
|
|
16
|
-
title: string;
|
|
17
|
-
value?: any;
|
|
18
|
-
};
|
|
19
|
-
export type TaskInputDefine = FormItemProps;
|
|
20
|
-
export type PluginDefine = Registrable & {
|
|
21
|
-
default?: any;
|
|
22
|
-
input?: {
|
|
23
|
-
[key: string]: TaskInputDefine;
|
|
24
|
-
};
|
|
25
|
-
output?: {
|
|
26
|
-
[key: string]: TaskOutputDefine;
|
|
27
|
-
};
|
|
28
|
-
autowire?: {
|
|
29
|
-
[key: string]: any;
|
|
30
|
-
};
|
|
31
|
-
reference?: {
|
|
32
|
-
src: string;
|
|
33
|
-
dest: string;
|
|
34
|
-
type: "computed";
|
|
35
|
-
}[];
|
|
36
|
-
};
|
|
37
|
-
export type ITaskPlugin = {
|
|
38
|
-
onInstance(): Promise<void>;
|
|
39
|
-
execute(): Promise<void>;
|
|
40
|
-
[key: string]: any;
|
|
41
|
-
};
|
|
42
|
-
export type TaskResult = {
|
|
43
|
-
clearLastStatus?: boolean;
|
|
44
|
-
files?: FileItem[];
|
|
45
|
-
};
|
|
46
|
-
export type TaskInstanceContext = {
|
|
47
|
-
pipeline: Pipeline;
|
|
48
|
-
step: Step;
|
|
49
|
-
logger: Logger;
|
|
50
|
-
accessService: IAccessService;
|
|
51
|
-
emailService: IEmailService;
|
|
52
|
-
pipelineContext: IContext;
|
|
53
|
-
userContext: IContext;
|
|
54
|
-
http: AxiosInstance;
|
|
55
|
-
fileStore: FileStore;
|
|
56
|
-
lastStatus?: Runnable;
|
|
57
|
-
};
|
|
58
|
-
export declare abstract class AbstractTaskPlugin implements ITaskPlugin {
|
|
59
|
-
_result: TaskResult;
|
|
60
|
-
ctx: TaskInstanceContext;
|
|
61
|
-
clearLastStatus(): void;
|
|
62
|
-
getFiles(): FileItem[] | undefined;
|
|
63
|
-
setCtx(ctx: TaskInstanceContext): void;
|
|
64
|
-
randomFileId(): string;
|
|
65
|
-
linkFile(file: FileItem): void;
|
|
66
|
-
saveFile(filename: string, file: Buffer): void;
|
|
67
|
-
get pipeline(): Pipeline;
|
|
68
|
-
get step(): Step;
|
|
69
|
-
onInstance(): Promise<void>;
|
|
70
|
-
abstract execute(): Promise<void>;
|
|
71
|
-
}
|
|
72
|
-
export type OutputVO = {
|
|
73
|
-
key: string;
|
|
74
|
-
title: string;
|
|
75
|
-
value: any;
|
|
76
|
-
};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { PluginDefine, TaskInputDefine, TaskOutputDefine } from "./api";
|
|
2
|
-
import "reflect-metadata";
|
|
3
|
-
export declare const PLUGIN_CLASS_KEY = "pipeline:plugin";
|
|
4
|
-
export declare function IsTaskPlugin(define: PluginDefine): ClassDecorator;
|
|
5
|
-
export declare const PLUGIN_INPUT_KEY = "pipeline:plugin:input";
|
|
6
|
-
export declare function TaskInput(input?: TaskInputDefine): PropertyDecorator;
|
|
7
|
-
export declare const PLUGIN_OUTPUT_KEY = "pipeline:plugin:output";
|
|
8
|
-
export declare function TaskOutput(output?: TaskOutputDefine): PropertyDecorator;
|
|
9
|
-
export declare const PLUGIN_DOWNLOAD_KEY = "pipeline:plugin:download";
|
|
10
|
-
export declare function TaskDownload(output?: TaskOutputDefine): PropertyDecorator;
|
package/dist/d/plugin/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./registry";
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
export type Registrable = {
|
|
2
|
-
name: string;
|
|
3
|
-
title: string;
|
|
4
|
-
desc?: string;
|
|
5
|
-
};
|
|
6
|
-
export type RegistryItem<T> = {
|
|
7
|
-
define: Registrable;
|
|
8
|
-
target: T;
|
|
9
|
-
};
|
|
10
|
-
export declare class Registry<T> {
|
|
11
|
-
type: string;
|
|
12
|
-
storage: {
|
|
13
|
-
[key: string]: RegistryItem<T>;
|
|
14
|
-
};
|
|
15
|
-
constructor(type: string);
|
|
16
|
-
register(key: string, value: RegistryItem<T>): void;
|
|
17
|
-
get(name: string): RegistryItem<T>;
|
|
18
|
-
getStorage(): {
|
|
19
|
-
[key: string]: RegistryItem<T>;
|
|
20
|
-
};
|
|
21
|
-
getDefineList(): {
|
|
22
|
-
key: string;
|
|
23
|
-
name: string;
|
|
24
|
-
title: string;
|
|
25
|
-
desc?: string | undefined;
|
|
26
|
-
}[];
|
|
27
|
-
getDefine(key: string): Registrable | undefined;
|
|
28
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./email";
|
package/dist/d/utils/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function TimeoutPromise(callback: () => Promise<void>, ms?: number): Promise<unknown>;
|