@certd/pipeline 1.28.1 → 1.28.3
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 +11 -0
- package/dist/core/executor.js +22 -43
- package/dist/core/file-store.d.ts +2 -0
- package/dist/notification/api.d.ts +9 -0
- package/dist/notification/api.js +1 -1
- package/dist/notification/decorator.js +3 -8
- package/dist/plugin/api.d.ts +2 -0
- package/dist/plugin/group.d.ts +1 -0
- package/dist/plugin/group.js +6 -5
- package/dist/registry/registry.d.ts +3 -3
- package/package.json +4 -4
- package/test/cert.fake.test.js +4 -0
- package/test/dist/index.test.js +17 -0
- package/test/dist/ts/index.test.js +17 -0
- package/test/dist/ts/index.test.js.map +1 -0
- package/test/pipeline/access-service-test.js +65 -65
- package/test/pipeline/init.test.js +16 -0
- package/test/pipeline/pipeline.define.js +68 -0
- package/test/{echo-plugin.js → pipeline/pipeline.test.js} +28 -44
- package/stats.html +0 -6177
- package/test/user.secret.ts +0 -4
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
exports.__esModule = true;
|
|
3
|
+
exports.pipeline = void 0;
|
|
4
|
+
var src_1 = require("../../src");
|
|
5
|
+
var idIndex = 0;
|
|
6
|
+
function generateId() {
|
|
7
|
+
idIndex++;
|
|
8
|
+
return idIndex + "";
|
|
9
|
+
}
|
|
10
|
+
exports.pipeline = {
|
|
11
|
+
version: 1,
|
|
12
|
+
id: generateId(),
|
|
13
|
+
title: "测试管道",
|
|
14
|
+
userId: 1,
|
|
15
|
+
triggers: [],
|
|
16
|
+
stages: [
|
|
17
|
+
{
|
|
18
|
+
id: generateId(),
|
|
19
|
+
title: "证书申请阶段",
|
|
20
|
+
concurrency: src_1.ConcurrencyStrategy.Serial,
|
|
21
|
+
next: src_1.NextStrategy.AllSuccess,
|
|
22
|
+
tasks: [
|
|
23
|
+
{
|
|
24
|
+
id: generateId(),
|
|
25
|
+
title: "申请证书任务",
|
|
26
|
+
steps: [
|
|
27
|
+
{
|
|
28
|
+
id: generateId(),
|
|
29
|
+
title: "申请证书",
|
|
30
|
+
type: "CertApply",
|
|
31
|
+
input: {
|
|
32
|
+
domains: ["*.docmirror.cn"],
|
|
33
|
+
email: "xiaojunnuo@qq.com",
|
|
34
|
+
dnsProviderType: "aliyun",
|
|
35
|
+
accessId: "111"
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
]
|
|
39
|
+
},
|
|
40
|
+
]
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
id: generateId(),
|
|
44
|
+
title: "证书部署阶段",
|
|
45
|
+
concurrency: src_1.ConcurrencyStrategy.Serial,
|
|
46
|
+
next: src_1.NextStrategy.AllSuccess,
|
|
47
|
+
tasks: [
|
|
48
|
+
{
|
|
49
|
+
id: generateId(),
|
|
50
|
+
title: "测试输出参数任务",
|
|
51
|
+
steps: [
|
|
52
|
+
{
|
|
53
|
+
id: generateId(),
|
|
54
|
+
title: "输出参数(echo插件)",
|
|
55
|
+
type: "EchoPlugin",
|
|
56
|
+
input: {
|
|
57
|
+
cert: "cert"
|
|
58
|
+
},
|
|
59
|
+
strategy: {
|
|
60
|
+
runStrategy: src_1.RunStrategy.SkipWhenSucceed
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
]
|
|
64
|
+
},
|
|
65
|
+
]
|
|
66
|
+
},
|
|
67
|
+
]
|
|
68
|
+
};
|
|
@@ -1,10 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
2
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
9
3
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
10
4
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -42,45 +36,35 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
42
36
|
}
|
|
43
37
|
};
|
|
44
38
|
exports.__esModule = true;
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
var
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
return [2 /*return*/];
|
|
54
|
-
}); });
|
|
55
|
-
};
|
|
56
|
-
EchoPlugin.prototype.execute = function () {
|
|
39
|
+
//import { expect } from "chai";
|
|
40
|
+
require("mocha");
|
|
41
|
+
var src_1 = require("../../src");
|
|
42
|
+
var pipeline_define_1 = require("./pipeline.define");
|
|
43
|
+
var access_service_test_1 = require("./access-service-test");
|
|
44
|
+
var storage_1 = require("../../src/core/storage");
|
|
45
|
+
describe("pipeline", function () {
|
|
46
|
+
it("#pipeline", function () {
|
|
57
47
|
return __awaiter(this, void 0, void 0, function () {
|
|
48
|
+
function onChanged(history) {
|
|
49
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
50
|
+
return __generator(this, function (_a) {
|
|
51
|
+
console.log("changed:");
|
|
52
|
+
return [2 /*return*/];
|
|
53
|
+
});
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
var executor;
|
|
58
57
|
return __generator(this, function (_a) {
|
|
59
|
-
|
|
60
|
-
|
|
58
|
+
switch (_a.label) {
|
|
59
|
+
case 0:
|
|
60
|
+
this.timeout(120000);
|
|
61
|
+
executor = new src_1.Executor({ userId: "test", pipeline: pipeline_define_1.pipeline, onChanged: onChanged, accessService: new access_service_test_1.AccessServiceTest(), storage: new storage_1.FileStorage() });
|
|
62
|
+
return [4 /*yield*/, executor.run(1, "user")];
|
|
63
|
+
case 1:
|
|
64
|
+
_a.sent();
|
|
65
|
+
return [2 /*return*/];
|
|
66
|
+
}
|
|
61
67
|
});
|
|
62
68
|
});
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
(0, src_1.TaskInput)({
|
|
66
|
-
title: "cert",
|
|
67
|
-
component: {
|
|
68
|
-
name: "output-selector"
|
|
69
|
-
},
|
|
70
|
-
helper: "输出选择"
|
|
71
|
-
})
|
|
72
|
-
], EchoPlugin.prototype, "cert");
|
|
73
|
-
__decorate([
|
|
74
|
-
(0, src_1.TaskOutput)({
|
|
75
|
-
title: "cert info"
|
|
76
|
-
})
|
|
77
|
-
], EchoPlugin.prototype, "certInfo");
|
|
78
|
-
EchoPlugin = __decorate([
|
|
79
|
-
(0, src_1.IsTaskPlugin)({
|
|
80
|
-
name: "EchoPlugin",
|
|
81
|
-
title: "测试插件【echo】"
|
|
82
|
-
})
|
|
83
|
-
], EchoPlugin);
|
|
84
|
-
return EchoPlugin;
|
|
85
|
-
}());
|
|
86
|
-
exports.EchoPlugin = EchoPlugin;
|
|
69
|
+
});
|
|
70
|
+
});
|