From 643148d2835e5d75718dcfc2631be4e416dba429 Mon Sep 17 00:00:00 2001 From: xiaojunnuo Date: Wed, 24 May 2023 17:30:42 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E5=87=86=E5=A4=87=E6=89=93=E5=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lerna.json | 2 +- packages/core/acme-client/package.json | 1 + packages/core/pipeline/package.json | 2 +- packages/core/pipeline/src/midway/install.ts | 0 .../pipeline/src/plugin/test/echo-plugin.ts | 3 +- packages/core/pipeline/test/echo-plugin.ts | 2 +- .../test/pipeline/access-service-test.ts | 1 + .../pipeline/test/pipeline/pipeline.test.ts | 2 +- packages/plugins/plugin-aliyun/package.json | 2 +- .../plugin-aliyun/test/cert.fake.test.ts | 58 ---------------- .../plugins/plugin-aliyun/test/index.test.ts | 11 ---- .../test/pipeline/access-service-test.ts | 10 --- .../plugin-aliyun/test/pipeline/init.test.ts | 15 ----- .../test/pipeline/pipeline.define.ts | 66 ------------------- .../test/pipeline/pipeline.test.ts | 18 ----- .../test/pipeline/plugins/cert-apply.test.ts | 23 ------- .../pipeline/plugins/deploy-to-cdn.test.ts | 23 ------- packages/plugins/plugin-all/package.json | 2 +- .../test/pipeline/access-service-test.ts | 9 --- .../plugin-cert/test/pipeline/init.test.ts | 17 ----- .../test/pipeline/plugins/cert-apply.test.ts | 23 ------- packages/plugins/plugin-host/package.json | 2 +- .../plugin-host/test/cert.fake.test.ts | 58 ---------------- .../plugins/plugin-host/test/index.test.ts | 11 ---- .../test/pipeline/access-service-test.ts | 10 --- .../plugin-host/test/pipeline/init.test.ts | 15 ----- .../test/pipeline/pipeline.define.ts | 66 ------------------- .../test/pipeline/pipeline.test.ts | 18 ----- .../test/pipeline/plugins/cert-apply.test.ts | 23 ------- .../pipeline/plugins/deploy-to-cdn.test.ts | 23 ------- packages/plugins/plugin-host/vite.config.ts | 1 - packages/plugins/plugin-huawei/package.json | 8 +-- packages/plugins/plugin-tencent/package.json | 2 +- .../plugin-tencent/test/cert.fake.test.ts | 58 ---------------- .../plugins/plugin-tencent/test/index.test.ts | 11 ---- .../test/pipeline/access-service-test.ts | 10 --- .../plugin-tencent/test/pipeline/init.test.ts | 15 ----- .../test/pipeline/pipeline.define.ts | 66 ------------------- .../test/pipeline/pipeline.test.ts | 18 ----- .../test/pipeline/plugins/cert-apply.test.ts | 23 ------- .../pipeline/plugins/deploy-to-cdn.test.ts | 23 ------- .../plugins/plugin-tencent/vite.config.ts | 1 - packages/plugins/plugin-util/package.json | 3 +- .../plugin-util/test/cert.fake.test.ts | 58 ---------------- .../plugins/plugin-util/test/index.test.ts | 11 ---- .../test/pipeline/access-service-test.ts | 10 --- .../plugin-util/test/pipeline/init.test.ts | 15 ----- .../test/pipeline/pipeline.define.ts | 66 ------------------- .../test/pipeline/pipeline.test.ts | 18 ----- .../test/pipeline/plugins/cert-apply.test.ts | 23 ------- .../pipeline/plugins/deploy-to-cdn.test.ts | 23 ------- packages/plugins/plugin-util/vite.config.ts | 2 +- packages/ui/certd-server/bootstrap.js | 7 +- packages/ui/certd-server/package.json | 4 +- 54 files changed, 21 insertions(+), 971 deletions(-) delete mode 100644 packages/core/pipeline/src/midway/install.ts delete mode 100644 packages/plugins/plugin-aliyun/test/cert.fake.test.ts delete mode 100644 packages/plugins/plugin-aliyun/test/index.test.ts delete mode 100644 packages/plugins/plugin-aliyun/test/pipeline/access-service-test.ts delete mode 100644 packages/plugins/plugin-aliyun/test/pipeline/init.test.ts delete mode 100644 packages/plugins/plugin-aliyun/test/pipeline/pipeline.define.ts delete mode 100644 packages/plugins/plugin-aliyun/test/pipeline/pipeline.test.ts delete mode 100644 packages/plugins/plugin-aliyun/test/pipeline/plugins/cert-apply.test.ts delete mode 100644 packages/plugins/plugin-aliyun/test/pipeline/plugins/deploy-to-cdn.test.ts delete mode 100644 packages/plugins/plugin-cert/test/pipeline/access-service-test.ts delete mode 100644 packages/plugins/plugin-cert/test/pipeline/init.test.ts delete mode 100644 packages/plugins/plugin-cert/test/pipeline/plugins/cert-apply.test.ts delete mode 100644 packages/plugins/plugin-host/test/cert.fake.test.ts delete mode 100644 packages/plugins/plugin-host/test/index.test.ts delete mode 100644 packages/plugins/plugin-host/test/pipeline/access-service-test.ts delete mode 100644 packages/plugins/plugin-host/test/pipeline/init.test.ts delete mode 100644 packages/plugins/plugin-host/test/pipeline/pipeline.define.ts delete mode 100644 packages/plugins/plugin-host/test/pipeline/pipeline.test.ts delete mode 100644 packages/plugins/plugin-host/test/pipeline/plugins/cert-apply.test.ts delete mode 100644 packages/plugins/plugin-host/test/pipeline/plugins/deploy-to-cdn.test.ts delete mode 100644 packages/plugins/plugin-tencent/test/cert.fake.test.ts delete mode 100644 packages/plugins/plugin-tencent/test/index.test.ts delete mode 100644 packages/plugins/plugin-tencent/test/pipeline/access-service-test.ts delete mode 100644 packages/plugins/plugin-tencent/test/pipeline/init.test.ts delete mode 100644 packages/plugins/plugin-tencent/test/pipeline/pipeline.define.ts delete mode 100644 packages/plugins/plugin-tencent/test/pipeline/pipeline.test.ts delete mode 100644 packages/plugins/plugin-tencent/test/pipeline/plugins/cert-apply.test.ts delete mode 100644 packages/plugins/plugin-tencent/test/pipeline/plugins/deploy-to-cdn.test.ts delete mode 100644 packages/plugins/plugin-util/test/cert.fake.test.ts delete mode 100644 packages/plugins/plugin-util/test/index.test.ts delete mode 100644 packages/plugins/plugin-util/test/pipeline/access-service-test.ts delete mode 100644 packages/plugins/plugin-util/test/pipeline/init.test.ts delete mode 100644 packages/plugins/plugin-util/test/pipeline/pipeline.define.ts delete mode 100644 packages/plugins/plugin-util/test/pipeline/pipeline.test.ts delete mode 100644 packages/plugins/plugin-util/test/pipeline/plugins/cert-apply.test.ts delete mode 100644 packages/plugins/plugin-util/test/pipeline/plugins/deploy-to-cdn.test.ts diff --git a/lerna.json b/lerna.json index 1d7ce7a0..9633b94f 100644 --- a/lerna.json +++ b/lerna.json @@ -9,5 +9,5 @@ } }, "npmClient": "pnpm", - "version": "1.0.0" + "version": "0.3.0" } diff --git a/packages/core/acme-client/package.json b/packages/core/acme-client/package.json index ca401fe1..946ac28b 100644 --- a/packages/core/acme-client/package.json +++ b/packages/core/acme-client/package.json @@ -1,6 +1,7 @@ { "name": "@certd/acme-client", "description": "Simple and unopinionated ACME client", + "private": false, "author": "nmorsman", "version": "0.3.0", "main": "src/index.js", diff --git a/packages/core/pipeline/package.json b/packages/core/pipeline/package.json index 1c76b83b..92f52642 100644 --- a/packages/core/pipeline/package.json +++ b/packages/core/pipeline/package.json @@ -1,6 +1,6 @@ { "name": "@certd/pipeline", - "private": true, + "private": false, "version": "0.3.0", "main": "./src/index.ts", "module": "./src/index.ts", diff --git a/packages/core/pipeline/src/midway/install.ts b/packages/core/pipeline/src/midway/install.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/packages/core/pipeline/src/plugin/test/echo-plugin.ts b/packages/core/pipeline/src/plugin/test/echo-plugin.ts index 924d85c3..a9eb0ab9 100644 --- a/packages/core/pipeline/src/plugin/test/echo-plugin.ts +++ b/packages/core/pipeline/src/plugin/test/echo-plugin.ts @@ -1,6 +1,7 @@ import { ILogger } from "@midwayjs/logger"; import { ITaskPlugin } from "../api"; -import { Autowire, IsTaskPlugin, TaskInput } from "../decorator"; +import { IsTaskPlugin, TaskInput } from "../decorator"; +import { Autowire } from "../../decorator"; @IsTaskPlugin({ name: "EchoPlugin", diff --git a/packages/core/pipeline/test/echo-plugin.ts b/packages/core/pipeline/test/echo-plugin.ts index 73f17d2d..1361048c 100644 --- a/packages/core/pipeline/test/echo-plugin.ts +++ b/packages/core/pipeline/test/echo-plugin.ts @@ -1,4 +1,4 @@ -import { IsTaskPlugin, TaskInput, ITaskPlugin, ILogger, Autowire, TaskOutput } from "../src"; +import { Autowire, ILogger, IsTaskPlugin, ITaskPlugin, TaskInput, TaskOutput } from "../src"; @IsTaskPlugin({ name: "EchoPlugin", diff --git a/packages/core/pipeline/test/pipeline/access-service-test.ts b/packages/core/pipeline/test/pipeline/access-service-test.ts index 8a293e30..7ee23ac2 100644 --- a/packages/core/pipeline/test/pipeline/access-service-test.ts +++ b/packages/core/pipeline/test/pipeline/access-service-test.ts @@ -1,4 +1,5 @@ import { IAccess, IAccessService } from "../../src"; +// @ts-ignore import { aliyunSecret } from "../user.secret"; export class AccessServiceTest implements IAccessService { async getById(id: any): Promise { diff --git a/packages/core/pipeline/test/pipeline/pipeline.test.ts b/packages/core/pipeline/test/pipeline/pipeline.test.ts index 494746e0..26b1b98f 100644 --- a/packages/core/pipeline/test/pipeline/pipeline.test.ts +++ b/packages/core/pipeline/test/pipeline/pipeline.test.ts @@ -7,7 +7,7 @@ import { FileStorage } from "../../src/core/storage"; describe("pipeline", function () { it("#pipeline", async function () { this.timeout(120000); - function onChanged(history: RunHistory) { + async function onChanged(history: RunHistory) { console.log("changed:"); } diff --git a/packages/plugins/plugin-aliyun/package.json b/packages/plugins/plugin-aliyun/package.json index d254b762..544cffec 100644 --- a/packages/plugins/plugin-aliyun/package.json +++ b/packages/plugins/plugin-aliyun/package.json @@ -1,6 +1,6 @@ { "name": "@certd/plugin-aliyun", - "private": true, + "private": false, "version": "0.3.0", "main": "./src/index.ts", "module": "./src/index.ts", diff --git a/packages/plugins/plugin-aliyun/test/cert.fake.test.ts b/packages/plugins/plugin-aliyun/test/cert.fake.test.ts deleted file mode 100644 index f6a0fb0a..00000000 --- a/packages/plugins/plugin-aliyun/test/cert.fake.test.ts +++ /dev/null @@ -1,58 +0,0 @@ -export const fakeCrt = `-----BEGIN CERTIFICATE----- -MIIFSTCCBDGgAwIBAgITAPoZZk/LhVIyXoic2NnJyxubezANBgkqhkiG9w0BAQsF -ADAiMSAwHgYDVQQDDBdGYWtlIExFIEludGVybWVkaWF0ZSBYMTAeFw0yMDEyMTQx -NjA1NTFaFw0yMTAzMTQxNjA1NTFaMBsxGTAXBgNVBAMMECouZG9jbWlycm9yLmNs -dWIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAo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n5Z5MqkYhlMI3J1tPRTp1nEt9fyGspBOO05gi148Qasp+3N+svqKomoQglNoAxU= ------END CERTIFICATE-----`; diff --git a/packages/plugins/plugin-aliyun/test/index.test.ts b/packages/plugins/plugin-aliyun/test/index.test.ts deleted file mode 100644 index 1498b2ba..00000000 --- a/packages/plugins/plugin-aliyun/test/index.test.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { expect } from "chai"; -import "mocha"; -import { EchoPlugin } from "../src/plugin"; -describe("task_plugin", function () { - it("#taskplugin", function () { - const echoPlugin = new EchoPlugin(); - const define = echoPlugin.define; - echoPlugin.execute({ context: {}, props: { test: 111 } }); - expect(define.name).eq("EchoPlugin"); - }); -}); diff --git a/packages/plugins/plugin-aliyun/test/pipeline/access-service-test.ts b/packages/plugins/plugin-aliyun/test/pipeline/access-service-test.ts deleted file mode 100644 index 2b8c2915..00000000 --- a/packages/plugins/plugin-aliyun/test/pipeline/access-service-test.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { IAccessService } from "../../src/access/access-service"; -import { AbstractAccess, AliyunAccess } from "../../src"; -import { aliyunSecret } from "../user.secret"; -export class AccessServiceTest implements IAccessService { - async getById(id: any): Promise { - return { - ...aliyunSecret, - } as AliyunAccess; - } -} diff --git a/packages/plugins/plugin-aliyun/test/pipeline/init.test.ts b/packages/plugins/plugin-aliyun/test/pipeline/init.test.ts deleted file mode 100644 index d1e28763..00000000 --- a/packages/plugins/plugin-aliyun/test/pipeline/init.test.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { ContextFactory } from "../../src/core/context"; -import { FileStorage } from "../../src/core/storage"; -import { AccessServiceTest } from "./access-service-test"; -import { logger } from "../../src/utils/util.log"; - -const contextFactory = new ContextFactory(new FileStorage()); - -const userContext = contextFactory.getContext("user", "test"); -const pipelineContext = contextFactory.getContext("pipeline", "test"); -export const pluginInitProps = { - accessService: new AccessServiceTest(), - pipelineContext: pipelineContext, - userContext: userContext, - logger: logger, -}; diff --git a/packages/plugins/plugin-aliyun/test/pipeline/pipeline.define.ts b/packages/plugins/plugin-aliyun/test/pipeline/pipeline.define.ts deleted file mode 100644 index 1369d482..00000000 --- a/packages/plugins/plugin-aliyun/test/pipeline/pipeline.define.ts +++ /dev/null @@ -1,66 +0,0 @@ -import { ConcurrencyStrategy, NextStrategy, Pipeline, RunStrategy } from "../../src"; - -let idIndex = 0; -function generateId() { - idIndex++; - return idIndex + ""; -} -export const pipeline: Pipeline = { - version: 1, - id: generateId(), - title: "测试管道", - userId: 1, - triggers: [], - stages: [ - { - id: generateId(), - title: "证书申请阶段", - concurrency: ConcurrencyStrategy.Serial, - next: NextStrategy.AllSuccess, - tasks: [ - { - id: generateId(), - title: "申请证书任务", - steps: [ - { - id: generateId(), - title: "申请证书", - type: "CertApply", - input: { - domains: ["*.docmirror.cn"], - email: "xiaojunnuo@qq.com", - dnsProviderType: "aliyun", - accessId: "111", - }, - }, - ], - }, - ], - }, - { - id: generateId(), - title: "证书部署阶段", - concurrency: ConcurrencyStrategy.Serial, - next: NextStrategy.AllSuccess, - tasks: [ - { - id: generateId(), - title: "测试输出参数任务", - steps: [ - { - id: generateId(), - title: "输出参数(echo插件)", - type: "EchoPlugin", - input: { - cert: "cert", - }, - strategy: { - runStrategy: RunStrategy.SkipWhenSucceed, - }, - }, - ], - }, - ], - }, - ], -}; diff --git a/packages/plugins/plugin-aliyun/test/pipeline/pipeline.test.ts b/packages/plugins/plugin-aliyun/test/pipeline/pipeline.test.ts deleted file mode 100644 index 494746e0..00000000 --- a/packages/plugins/plugin-aliyun/test/pipeline/pipeline.test.ts +++ /dev/null @@ -1,18 +0,0 @@ -//import { expect } from "chai"; -import "mocha"; -import { Executor, RunHistory } from "../../src"; -import { pipeline } from "./pipeline.define"; -import { AccessServiceTest } from "./access-service-test"; -import { FileStorage } from "../../src/core/storage"; -describe("pipeline", function () { - it("#pipeline", async function () { - this.timeout(120000); - function onChanged(history: RunHistory) { - console.log("changed:"); - } - - const executor = new Executor({ userId: "test", pipeline, onChanged, accessService: new AccessServiceTest(), storage: new FileStorage() }); - await executor.run(1, "user"); - // expect(define.name).eq("EchoPlugin"); - }); -}); diff --git a/packages/plugins/plugin-aliyun/test/pipeline/plugins/cert-apply.test.ts b/packages/plugins/plugin-aliyun/test/pipeline/plugins/cert-apply.test.ts deleted file mode 100644 index fa75e3a2..00000000 --- a/packages/plugins/plugin-aliyun/test/pipeline/plugins/cert-apply.test.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { expect } from "chai"; -import "mocha"; -import { CertApplyPlugin } from "../../../src/plugin"; -import { pluginInitProps } from "../init.test"; -describe("CertApply", function () { - it("#execute", async function () { - this.timeout(120000); - const plugin = new CertApplyPlugin(); - // @ts-ignore - delete plugin.define; - await plugin.doInit(pluginInitProps); - const output = await plugin.execute({ - domains: ["*.docmirror.cn", "docmirror.cn"], - email: "xiaojunnuo@qq.com", - dnsProviderType: "aliyun", - accessId: "111", - forceUpdate: true, - }); - const cert = output.cert; - expect(plugin.getDefine().name).eq("CertApply"); - expect(cert.crt != null).eq(true); - }); -}); diff --git a/packages/plugins/plugin-aliyun/test/pipeline/plugins/deploy-to-cdn.test.ts b/packages/plugins/plugin-aliyun/test/pipeline/plugins/deploy-to-cdn.test.ts deleted file mode 100644 index c90b169b..00000000 --- a/packages/plugins/plugin-aliyun/test/pipeline/plugins/deploy-to-cdn.test.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { expect } from "chai"; -import "mocha"; -import { DeployCertToAliyunCDN } from "../../../src/plugin"; -import { pluginInitProps } from "../init.test"; - -describe("DeployToAliyunCDN", function () { - it("#execute", async function () { - this.timeout(120000); - const plugin = new DeployCertToAliyunCDN(); - // @ts-ignore - delete plugin.define; - - await plugin.doInit(pluginInitProps); - - const cert = await pluginInitProps.pipelineContext.get("cert"); - - await plugin.execute({ - cert, - domainName: "certd-cdn-upload.docmirror.cn", - }); - expect(plugin.getDefine().name).eq("DeployCertToAliyunCDN"); - }); -}); diff --git a/packages/plugins/plugin-all/package.json b/packages/plugins/plugin-all/package.json index 61dc8413..b2b87daf 100644 --- a/packages/plugins/plugin-all/package.json +++ b/packages/plugins/plugin-all/package.json @@ -1,6 +1,6 @@ { "name": "@certd/plugin-all", - "private": true, + "private": false, "version": "0.3.0", "main": "./src/index.ts", "module": "./src/index.ts", diff --git a/packages/plugins/plugin-cert/test/pipeline/access-service-test.ts b/packages/plugins/plugin-cert/test/pipeline/access-service-test.ts deleted file mode 100644 index 86f0daad..00000000 --- a/packages/plugins/plugin-cert/test/pipeline/access-service-test.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { AbstractAccess, IAccessService } from "@certd/pipeline"; -import { aliyunSecret } from "../user.secret"; -export class AccessServiceTest implements IAccessService { - async getById(id: any): Promise { - return { - ...aliyunSecret, - } as any; - } -} diff --git a/packages/plugins/plugin-cert/test/pipeline/init.test.ts b/packages/plugins/plugin-cert/test/pipeline/init.test.ts deleted file mode 100644 index 02bf3299..00000000 --- a/packages/plugins/plugin-cert/test/pipeline/init.test.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { FileStorage } from "@certd/pipeline/src/core/storage"; -import { ContextFactory } from "@certd/pipeline/src/core/context"; -import { AccessServiceTest } from "@certd/pipeline/test/pipeline/access-service-test"; -import { logger } from "@certd/pipeline"; -import { request } from "@certd/pipeline/src/utils/util.request"; - -const contextFactory = new ContextFactory(new FileStorage()); - -const userContext = contextFactory.getContext("user", "test"); -const pipelineContext = contextFactory.getContext("pipeline", "test"); -export const pluginInitProps = { - accessService: new AccessServiceTest(), - pipelineContext: pipelineContext, - userContext: userContext, - logger: logger, - http: request, -}; diff --git a/packages/plugins/plugin-cert/test/pipeline/plugins/cert-apply.test.ts b/packages/plugins/plugin-cert/test/pipeline/plugins/cert-apply.test.ts deleted file mode 100644 index 8a81dbb5..00000000 --- a/packages/plugins/plugin-cert/test/pipeline/plugins/cert-apply.test.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { expect } from "chai"; -import "mocha"; -import { pluginInitProps } from "../init.test"; -import { CertApplyPlugin } from "../../../src"; -describe("CertApply", function () { - it("#execute", async function () { - this.timeout(120000); - const plugin = new CertApplyPlugin(); - // @ts-ignore - delete plugin.define; - await plugin.doInit(pluginInitProps); - const output = await plugin.execute({ - domains: ["*.docmirror.cn", "docmirror.cn"], - email: "xiaojunnuo@qq.com", - dnsProviderType: "aliyun", - accessId: "111", - forceUpdate: true, - }); - const cert = output.cert; - expect(plugin.getDefine().name).eq("CertApply"); - expect(cert.crt != null).eq(true); - }); -}); diff --git a/packages/plugins/plugin-host/package.json b/packages/plugins/plugin-host/package.json index 9c52bd98..671de160 100644 --- a/packages/plugins/plugin-host/package.json +++ b/packages/plugins/plugin-host/package.json @@ -1,6 +1,6 @@ { "name": "@certd/plugin-host", - "private": true, + "private": false, "version": "0.3.0", "main": "./src/index.ts", "module": "./src/index.ts", diff --git a/packages/plugins/plugin-host/test/cert.fake.test.ts b/packages/plugins/plugin-host/test/cert.fake.test.ts deleted file mode 100644 index f6a0fb0a..00000000 --- a/packages/plugins/plugin-host/test/cert.fake.test.ts +++ /dev/null @@ -1,58 +0,0 @@ -export const fakeCrt = `-----BEGIN CERTIFICATE----- -MIIFSTCCBDGgAwIBAgITAPoZZk/LhVIyXoic2NnJyxubezANBgkqhkiG9w0BAQsF -ADAiMSAwHgYDVQQDDBdGYWtlIExFIEludGVybWVkaWF0ZSBYMTAeFw0yMDEyMTQx -NjA1NTFaFw0yMTAzMTQxNjA1NTFaMBsxGTAXBgNVBAMMECouZG9jbWlycm9yLmNs -dWIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC75tGrYjly+RpcZehQ -my1EpaXElT4L60pINKV2YDKnBrcSSo1c6rO7nFh12eC/ju4WwYUep0RVmBDF8xD0 -I1Sd1uuDTQWP0UT1X9yqdXtjvxpUqoCHAzG633f3sJRFul7mDLuC9tRCuae9o7qP -EZ827XOmjBR35dso9I2GEE4828J3YE3tSKtobZlM+30jozLEcsO0PTyM5mq5PPjP -VI3fGLcEa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-BggrBgEFBQcwAYYoaHR0cDovL29jc3Auc3RnLXJvb3QteDEubGV0c2VuY3J5cHQu -b3JnLzA0BggrBgEFBQcwAoYoaHR0cDovL2NlcnQuc3RnLXJvb3QteDEubGV0c2Vu -Y3J5cHQub3JnLzAfBgNVHSMEGDAWgBTBJnSkikSg5vogKNhcI5pFiBh54DANBgkq -hkiG9w0BAQsFAAOCAgEABYSu4Il+fI0MYU42OTmEj+1HqQ5DvyAeyCA6sGuZdwjF -UGeVOv3NnLyfofuUOjEbY5irFCDtnv+0ckukUZN9lz4Q2YjWGUpW4TTu3ieTsaC9 -AFvCSgNHJyWSVtWvB5XDxsqawl1KzHzzwr132bF2rtGtazSqVqK9E07sGHMCf+zp -DQVDVVGtqZPHwX3KqUtefE621b8RI6VCl4oD30Olf8pjuzG4JKBFRFclzLRjo/h7 -IkkfjZ8wDa7faOjVXx6n+eUQ29cIMCzr8/rNWHS9pYGGQKJiY2xmVC9h12H99Xyf -zWE9vb5zKP3MVG6neX1hSdo7PEAb9fqRhHkqVsqUvJlIRmvXvVKTwNCP3eCjRCCI -PTAvjV+4ni786iXwwFYNz8l3PmPLCyQXWGohnJ8iBm+5nk7O2ynaPVW0U2W+pt2w -SVuvdDM5zGv2f9ltNWUiYZHJ1mmO97jSY/6YfdOUH66iRtQtDkHBRdkNBsMbD+Em -2TgBldtHNSJBfB3pm9FblgOcJ0FSWcUDWJ7vO0+NTXlgrRofRT6pVywzxVo6dND0 -WzYlTWeUVsO40xJqhgUQRER9YLOLxJ0O6C8i0xFxAMKOtSdodMB3RIwt7RFQ0uyt -n5Z5MqkYhlMI3J1tPRTp1nEt9fyGspBOO05gi148Qasp+3N+svqKomoQglNoAxU= ------END CERTIFICATE-----`; diff --git a/packages/plugins/plugin-host/test/index.test.ts b/packages/plugins/plugin-host/test/index.test.ts deleted file mode 100644 index 1498b2ba..00000000 --- a/packages/plugins/plugin-host/test/index.test.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { expect } from "chai"; -import "mocha"; -import { EchoPlugin } from "../src/plugin"; -describe("task_plugin", function () { - it("#taskplugin", function () { - const echoPlugin = new EchoPlugin(); - const define = echoPlugin.define; - echoPlugin.execute({ context: {}, props: { test: 111 } }); - expect(define.name).eq("EchoPlugin"); - }); -}); diff --git a/packages/plugins/plugin-host/test/pipeline/access-service-test.ts b/packages/plugins/plugin-host/test/pipeline/access-service-test.ts deleted file mode 100644 index e68b60d3..00000000 --- a/packages/plugins/plugin-host/test/pipeline/access-service-test.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { IAccessService } from "../../src/access/access-service"; -import { AbstractAccess, HostAccess } from "../../src"; -import { aliyunSecret } from "../user.secret"; -export class AccessServiceTest implements IAccessService { - async getById(id: any): Promise { - return { - ...aliyunSecret, - } as HostAccess; - } -} diff --git a/packages/plugins/plugin-host/test/pipeline/init.test.ts b/packages/plugins/plugin-host/test/pipeline/init.test.ts deleted file mode 100644 index d1e28763..00000000 --- a/packages/plugins/plugin-host/test/pipeline/init.test.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { ContextFactory } from "../../src/core/context"; -import { FileStorage } from "../../src/core/storage"; -import { AccessServiceTest } from "./access-service-test"; -import { logger } from "../../src/utils/util.log"; - -const contextFactory = new ContextFactory(new FileStorage()); - -const userContext = contextFactory.getContext("user", "test"); -const pipelineContext = contextFactory.getContext("pipeline", "test"); -export const pluginInitProps = { - accessService: new AccessServiceTest(), - pipelineContext: pipelineContext, - userContext: userContext, - logger: logger, -}; diff --git a/packages/plugins/plugin-host/test/pipeline/pipeline.define.ts b/packages/plugins/plugin-host/test/pipeline/pipeline.define.ts deleted file mode 100644 index 1369d482..00000000 --- a/packages/plugins/plugin-host/test/pipeline/pipeline.define.ts +++ /dev/null @@ -1,66 +0,0 @@ -import { ConcurrencyStrategy, NextStrategy, Pipeline, RunStrategy } from "../../src"; - -let idIndex = 0; -function generateId() { - idIndex++; - return idIndex + ""; -} -export const pipeline: Pipeline = { - version: 1, - id: generateId(), - title: "测试管道", - userId: 1, - triggers: [], - stages: [ - { - id: generateId(), - title: "证书申请阶段", - concurrency: ConcurrencyStrategy.Serial, - next: NextStrategy.AllSuccess, - tasks: [ - { - id: generateId(), - title: "申请证书任务", - steps: [ - { - id: generateId(), - title: "申请证书", - type: "CertApply", - input: { - domains: ["*.docmirror.cn"], - email: "xiaojunnuo@qq.com", - dnsProviderType: "aliyun", - accessId: "111", - }, - }, - ], - }, - ], - }, - { - id: generateId(), - title: "证书部署阶段", - concurrency: ConcurrencyStrategy.Serial, - next: NextStrategy.AllSuccess, - tasks: [ - { - id: generateId(), - title: "测试输出参数任务", - steps: [ - { - id: generateId(), - title: "输出参数(echo插件)", - type: "EchoPlugin", - input: { - cert: "cert", - }, - strategy: { - runStrategy: RunStrategy.SkipWhenSucceed, - }, - }, - ], - }, - ], - }, - ], -}; diff --git a/packages/plugins/plugin-host/test/pipeline/pipeline.test.ts b/packages/plugins/plugin-host/test/pipeline/pipeline.test.ts deleted file mode 100644 index 494746e0..00000000 --- a/packages/plugins/plugin-host/test/pipeline/pipeline.test.ts +++ /dev/null @@ -1,18 +0,0 @@ -//import { expect } from "chai"; -import "mocha"; -import { Executor, RunHistory } from "../../src"; -import { pipeline } from "./pipeline.define"; -import { AccessServiceTest } from "./access-service-test"; -import { FileStorage } from "../../src/core/storage"; -describe("pipeline", function () { - it("#pipeline", async function () { - this.timeout(120000); - function onChanged(history: RunHistory) { - console.log("changed:"); - } - - const executor = new Executor({ userId: "test", pipeline, onChanged, accessService: new AccessServiceTest(), storage: new FileStorage() }); - await executor.run(1, "user"); - // expect(define.name).eq("EchoPlugin"); - }); -}); diff --git a/packages/plugins/plugin-host/test/pipeline/plugins/cert-apply.test.ts b/packages/plugins/plugin-host/test/pipeline/plugins/cert-apply.test.ts deleted file mode 100644 index fa75e3a2..00000000 --- a/packages/plugins/plugin-host/test/pipeline/plugins/cert-apply.test.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { expect } from "chai"; -import "mocha"; -import { CertApplyPlugin } from "../../../src/plugin"; -import { pluginInitProps } from "../init.test"; -describe("CertApply", function () { - it("#execute", async function () { - this.timeout(120000); - const plugin = new CertApplyPlugin(); - // @ts-ignore - delete plugin.define; - await plugin.doInit(pluginInitProps); - const output = await plugin.execute({ - domains: ["*.docmirror.cn", "docmirror.cn"], - email: "xiaojunnuo@qq.com", - dnsProviderType: "aliyun", - accessId: "111", - forceUpdate: true, - }); - const cert = output.cert; - expect(plugin.getDefine().name).eq("CertApply"); - expect(cert.crt != null).eq(true); - }); -}); diff --git a/packages/plugins/plugin-host/test/pipeline/plugins/deploy-to-cdn.test.ts b/packages/plugins/plugin-host/test/pipeline/plugins/deploy-to-cdn.test.ts deleted file mode 100644 index c90b169b..00000000 --- a/packages/plugins/plugin-host/test/pipeline/plugins/deploy-to-cdn.test.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { expect } from "chai"; -import "mocha"; -import { DeployCertToAliyunCDN } from "../../../src/plugin"; -import { pluginInitProps } from "../init.test"; - -describe("DeployToAliyunCDN", function () { - it("#execute", async function () { - this.timeout(120000); - const plugin = new DeployCertToAliyunCDN(); - // @ts-ignore - delete plugin.define; - - await plugin.doInit(pluginInitProps); - - const cert = await pluginInitProps.pipelineContext.get("cert"); - - await plugin.execute({ - cert, - domainName: "certd-cdn-upload.docmirror.cn", - }); - expect(plugin.getDefine().name).eq("DeployCertToAliyunCDN"); - }); -}); diff --git a/packages/plugins/plugin-host/vite.config.ts b/packages/plugins/plugin-host/vite.config.ts index e8bc4db1..de9ccbb6 100644 --- a/packages/plugins/plugin-host/vite.config.ts +++ b/packages/plugins/plugin-host/vite.config.ts @@ -14,7 +14,6 @@ export default defineConfig({ // for externalized deps globals: { vue: "Vue", - "lodash": "_", lodash: "_", dayjs: "dayjs", "@fast-crud/fast-crud": "FastCrud", diff --git a/packages/plugins/plugin-huawei/package.json b/packages/plugins/plugin-huawei/package.json index ec397b7a..190cbd80 100644 --- a/packages/plugins/plugin-huawei/package.json +++ b/packages/plugins/plugin-huawei/package.json @@ -1,14 +1,14 @@ { "name": "@certd/plugin-huawei", - "private": true, + "private": false, "version": "0.3.0", "main": "./src/index.ts", "module": "./src/index.ts", "types": "./src/index.ts", "publishConfig": { - "main": "./dist/plugin-aliyun.umd.js", - "module": "./dist/plugin-aliyun.mjs", - "types": "./dist/es/plugin-aliyun.d.ts" + "main": "./dist/plugin-huawei.umd.js", + "module": "./dist/plugin-huawei.mjs", + "types": "./dist/es/plugin-huawei.d.ts" }, "scripts": { "dev": "vite", diff --git a/packages/plugins/plugin-tencent/package.json b/packages/plugins/plugin-tencent/package.json index cc08976a..32c0d010 100644 --- a/packages/plugins/plugin-tencent/package.json +++ b/packages/plugins/plugin-tencent/package.json @@ -1,6 +1,6 @@ { "name": "@certd/plugin-tencent", - "private": true, + "private": false, "version": "0.3.0", "main": "./src/index.ts", "module": "./src/index.ts", diff --git a/packages/plugins/plugin-tencent/test/cert.fake.test.ts b/packages/plugins/plugin-tencent/test/cert.fake.test.ts deleted file mode 100644 index f6a0fb0a..00000000 --- a/packages/plugins/plugin-tencent/test/cert.fake.test.ts +++ /dev/null @@ -1,58 +0,0 @@ -export const fakeCrt = `-----BEGIN CERTIFICATE----- -MIIFSTCCBDGgAwIBAgITAPoZZk/LhVIyXoic2NnJyxubezANBgkqhkiG9w0BAQsF -ADAiMSAwHgYDVQQDDBdGYWtlIExFIEludGVybWVkaWF0ZSBYMTAeFw0yMDEyMTQx -NjA1NTFaFw0yMTAzMTQxNjA1NTFaMBsxGTAXBgNVBAMMECouZG9jbWlycm9yLmNs -dWIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC75tGrYjly+RpcZehQ -my1EpaXElT4L60pINKV2YDKnBrcSSo1c6rO7nFh12eC/ju4WwYUep0RVmBDF8xD0 -I1Sd1uuDTQWP0UT1X9yqdXtjvxpUqoCHAzG633f3sJRFul7mDLuC9tRCuae9o7qP -EZ827XOmjBR35dso9I2GEE4828J3YE3tSKtobZlM+30jozLEcs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HoGCCsGAQUFBwEBBG4wbDA0 -BggrBgEFBQcwAYYoaHR0cDovL29jc3Auc3RnLXJvb3QteDEubGV0c2VuY3J5cHQu -b3JnLzA0BggrBgEFBQcwAoYoaHR0cDovL2NlcnQuc3RnLXJvb3QteDEubGV0c2Vu -Y3J5cHQub3JnLzAfBgNVHSMEGDAWgBTBJnSkikSg5vogKNhcI5pFiBh54DANBgkq -hkiG9w0BAQsFAAOCAgEABYSu4Il+fI0MYU42OTmEj+1HqQ5DvyAeyCA6sGuZdwjF -UGeVOv3NnLyfofuUOjEbY5irFCDtnv+0ckukUZN9lz4Q2YjWGUpW4TTu3ieTsaC9 -AFvCSgNHJyWSVtWvB5XDxsqawl1KzHzzwr132bF2rtGtazSqVqK9E07sGHMCf+zp -DQVDVVGtqZPHwX3KqUtefE621b8RI6VCl4oD30Olf8pjuzG4JKBFRFclzLRjo/h7 -IkkfjZ8wDa7faOjVXx6n+eUQ29cIMCzr8/rNWHS9pYGGQKJiY2xmVC9h12H99Xyf -zWE9vb5zKP3MVG6neX1hSdo7PEAb9fqRhHkqVsqUvJlIRmvXvVKTwNCP3eCjRCCI -PTAvjV+4ni786iXwwFYNz8l3PmPLCyQXWGohnJ8iBm+5nk7O2ynaPVW0U2W+pt2w -SVuvdDM5zGv2f9ltNWUiYZHJ1mmO97jSY/6YfdOUH66iRtQtDkHBRdkNBsMbD+Em -2TgBldtHNSJBfB3pm9FblgOcJ0FSWcUDWJ7vO0+NTXlgrRofRT6pVywzxVo6dND0 -WzYlTWeUVsO40xJqhgUQRER9YLOLxJ0O6C8i0xFxAMKOtSdodMB3RIwt7RFQ0uyt -n5Z5MqkYhlMI3J1tPRTp1nEt9fyGspBOO05gi148Qasp+3N+svqKomoQglNoAxU= ------END CERTIFICATE-----`; diff --git a/packages/plugins/plugin-tencent/test/index.test.ts b/packages/plugins/plugin-tencent/test/index.test.ts deleted file mode 100644 index 1498b2ba..00000000 --- a/packages/plugins/plugin-tencent/test/index.test.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { expect } from "chai"; -import "mocha"; -import { EchoPlugin } from "../src/plugin"; -describe("task_plugin", function () { - it("#taskplugin", function () { - const echoPlugin = new EchoPlugin(); - const define = echoPlugin.define; - echoPlugin.execute({ context: {}, props: { test: 111 } }); - expect(define.name).eq("EchoPlugin"); - }); -}); diff --git a/packages/plugins/plugin-tencent/test/pipeline/access-service-test.ts b/packages/plugins/plugin-tencent/test/pipeline/access-service-test.ts deleted file mode 100644 index e68b60d3..00000000 --- a/packages/plugins/plugin-tencent/test/pipeline/access-service-test.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { IAccessService } from "../../src/access/access-service"; -import { AbstractAccess, HostAccess } from "../../src"; -import { aliyunSecret } from "../user.secret"; -export class AccessServiceTest implements IAccessService { - async getById(id: any): Promise { - return { - ...aliyunSecret, - } as HostAccess; - } -} diff --git a/packages/plugins/plugin-tencent/test/pipeline/init.test.ts b/packages/plugins/plugin-tencent/test/pipeline/init.test.ts deleted file mode 100644 index d1e28763..00000000 --- a/packages/plugins/plugin-tencent/test/pipeline/init.test.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { ContextFactory } from "../../src/core/context"; -import { FileStorage } from "../../src/core/storage"; -import { AccessServiceTest } from "./access-service-test"; -import { logger } from "../../src/utils/util.log"; - -const contextFactory = new ContextFactory(new FileStorage()); - -const userContext = contextFactory.getContext("user", "test"); -const pipelineContext = contextFactory.getContext("pipeline", "test"); -export const pluginInitProps = { - accessService: new AccessServiceTest(), - pipelineContext: pipelineContext, - userContext: userContext, - logger: logger, -}; diff --git a/packages/plugins/plugin-tencent/test/pipeline/pipeline.define.ts b/packages/plugins/plugin-tencent/test/pipeline/pipeline.define.ts deleted file mode 100644 index 1369d482..00000000 --- a/packages/plugins/plugin-tencent/test/pipeline/pipeline.define.ts +++ /dev/null @@ -1,66 +0,0 @@ -import { ConcurrencyStrategy, NextStrategy, Pipeline, RunStrategy } from "../../src"; - -let idIndex = 0; -function generateId() { - idIndex++; - return idIndex + ""; -} -export const pipeline: Pipeline = { - version: 1, - id: generateId(), - title: "测试管道", - userId: 1, - triggers: [], - stages: [ - { - id: generateId(), - title: "证书申请阶段", - concurrency: ConcurrencyStrategy.Serial, - next: NextStrategy.AllSuccess, - tasks: [ - { - id: generateId(), - title: "申请证书任务", - steps: [ - { - id: generateId(), - title: "申请证书", - type: "CertApply", - input: { - domains: ["*.docmirror.cn"], - email: "xiaojunnuo@qq.com", - dnsProviderType: "aliyun", - accessId: "111", - }, - }, - ], - }, - ], - }, - { - id: generateId(), - title: "证书部署阶段", - concurrency: ConcurrencyStrategy.Serial, - next: NextStrategy.AllSuccess, - tasks: [ - { - id: generateId(), - title: "测试输出参数任务", - steps: [ - { - id: generateId(), - title: "输出参数(echo插件)", - type: "EchoPlugin", - input: { - cert: "cert", - }, - strategy: { - runStrategy: RunStrategy.SkipWhenSucceed, - }, - }, - ], - }, - ], - }, - ], -}; diff --git a/packages/plugins/plugin-tencent/test/pipeline/pipeline.test.ts b/packages/plugins/plugin-tencent/test/pipeline/pipeline.test.ts deleted file mode 100644 index 494746e0..00000000 --- a/packages/plugins/plugin-tencent/test/pipeline/pipeline.test.ts +++ /dev/null @@ -1,18 +0,0 @@ -//import { expect } from "chai"; -import "mocha"; -import { Executor, RunHistory } from "../../src"; -import { pipeline } from "./pipeline.define"; -import { AccessServiceTest } from "./access-service-test"; -import { FileStorage } from "../../src/core/storage"; -describe("pipeline", function () { - it("#pipeline", async function () { - this.timeout(120000); - function onChanged(history: RunHistory) { - console.log("changed:"); - } - - const executor = new Executor({ userId: "test", pipeline, onChanged, accessService: new AccessServiceTest(), storage: new FileStorage() }); - await executor.run(1, "user"); - // expect(define.name).eq("EchoPlugin"); - }); -}); diff --git a/packages/plugins/plugin-tencent/test/pipeline/plugins/cert-apply.test.ts b/packages/plugins/plugin-tencent/test/pipeline/plugins/cert-apply.test.ts deleted file mode 100644 index fa75e3a2..00000000 --- a/packages/plugins/plugin-tencent/test/pipeline/plugins/cert-apply.test.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { expect } from "chai"; -import "mocha"; -import { CertApplyPlugin } from "../../../src/plugin"; -import { pluginInitProps } from "../init.test"; -describe("CertApply", function () { - it("#execute", async function () { - this.timeout(120000); - const plugin = new CertApplyPlugin(); - // @ts-ignore - delete plugin.define; - await plugin.doInit(pluginInitProps); - const output = await plugin.execute({ - domains: ["*.docmirror.cn", "docmirror.cn"], - email: "xiaojunnuo@qq.com", - dnsProviderType: "aliyun", - accessId: "111", - forceUpdate: true, - }); - const cert = output.cert; - expect(plugin.getDefine().name).eq("CertApply"); - expect(cert.crt != null).eq(true); - }); -}); diff --git a/packages/plugins/plugin-tencent/test/pipeline/plugins/deploy-to-cdn.test.ts b/packages/plugins/plugin-tencent/test/pipeline/plugins/deploy-to-cdn.test.ts deleted file mode 100644 index c90b169b..00000000 --- a/packages/plugins/plugin-tencent/test/pipeline/plugins/deploy-to-cdn.test.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { expect } from "chai"; -import "mocha"; -import { DeployCertToAliyunCDN } from "../../../src/plugin"; -import { pluginInitProps } from "../init.test"; - -describe("DeployToAliyunCDN", function () { - it("#execute", async function () { - this.timeout(120000); - const plugin = new DeployCertToAliyunCDN(); - // @ts-ignore - delete plugin.define; - - await plugin.doInit(pluginInitProps); - - const cert = await pluginInitProps.pipelineContext.get("cert"); - - await plugin.execute({ - cert, - domainName: "certd-cdn-upload.docmirror.cn", - }); - expect(plugin.getDefine().name).eq("DeployCertToAliyunCDN"); - }); -}); diff --git a/packages/plugins/plugin-tencent/vite.config.ts b/packages/plugins/plugin-tencent/vite.config.ts index 22fe6fb3..28c56254 100644 --- a/packages/plugins/plugin-tencent/vite.config.ts +++ b/packages/plugins/plugin-tencent/vite.config.ts @@ -14,7 +14,6 @@ export default defineConfig({ // for externalized deps globals: { vue: "Vue", - "lodash": "_", lodash: "_", dayjs: "dayjs", "@fast-crud/fast-crud": "FastCrud", diff --git a/packages/plugins/plugin-util/package.json b/packages/plugins/plugin-util/package.json index 4187cd65..da91284b 100644 --- a/packages/plugins/plugin-util/package.json +++ b/packages/plugins/plugin-util/package.json @@ -1,6 +1,6 @@ { "name": "@certd/plugin-util", - "private": true, + "private": false, "version": "0.3.0", "main": "./src/index.ts", "module": "./src/index.ts", @@ -39,7 +39,6 @@ "eslint-plugin-import": "^2.26.0", "eslint-plugin-node": "^11.1.0", "eslint-plugin-prettier": "^4.2.1", - "log4js": "^6.3.0", "mocha": "^10.1.0", "ts-node": "^10.9.1", "typescript": "^4.8.4", diff --git a/packages/plugins/plugin-util/test/cert.fake.test.ts b/packages/plugins/plugin-util/test/cert.fake.test.ts deleted file mode 100644 index f6a0fb0a..00000000 --- a/packages/plugins/plugin-util/test/cert.fake.test.ts +++ /dev/null @@ -1,58 +0,0 @@ -export const fakeCrt = `-----BEGIN CERTIFICATE----- -MIIFSTCCBDGgAwIBAgITAPoZZk/LhVIyXoic2NnJyxubezANBgkqhkiG9w0BAQsF -ADAiMSAwHgYDVQQDDBdGYWtlIExFIEludGVybWVkaWF0ZSBYMTAeFw0yMDEyMTQx -NjA1NTFaFw0yMTAzMTQxNjA1NTFaMBsxGTAXBgNVBAMMECouZG9jbWlycm9yLmNs -dWIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC75tGrYjly+RpcZehQ -my1EpaXElT4L60pINKV2YDKnBrcSSo1c6rO7nFh12eC/ju4WwYUep0RVmBDF8xD0 -I1Sd1uuDTQWP0UT1X9yqdXtjvxpUqoCHAzG633f3sJRFul7mDLuC9tRCuae9o7qP -EZ827XOmjBR35dso9I2GEE4828J3YE3tSKtobZlM+30jozLEcsO0PTyM5mq5PPjP -VI3fGLcEaBmLZf5ixz4XkcY9IAhyAMYf03cT2wRoYPBaDdXblgCYL6sFtIMbzl3M -Di94PB8NyoNSsC2nmBdWi54wFOgBvY/4ljsX/q7X3EqlSvcA0/M6/c/J9kJ3eupv -jV8nAgMBAAGjggJ9MIICeTAOBgNVHQ8B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AWgBTBJnSkikSg5vogKNhcI5pFiBh54DANBgkq -hkiG9w0BAQsFAAOCAgEABYSu4Il+fI0MYU42OTmEj+1HqQ5DvyAeyCA6sGuZdwjF -UGeVOv3NnLyfofuUOjEbY5irFCDtnv+0ckukUZN9lz4Q2YjWGUpW4TTu3ieTsaC9 -AFvCSgNHJyWSVtWvB5XDxsqawl1KzHzzwr132bF2rtGtazSqVqK9E07sGHMCf+zp -DQVDVVGtqZPHwX3KqUtefE621b8RI6VCl4oD30Olf8pjuzG4JKBFRFclzLRjo/h7 -IkkfjZ8wDa7faOjVXx6n+eUQ29cIMCzr8/rNWHS9pYGGQKJiY2xmVC9h12H99Xyf -zWE9vb5zKP3MVG6neX1hSdo7PEAb9fqRhHkqVsqUvJlIRmvXvVKTwNCP3eCjRCCI -PTAvjV+4ni786iXwwFYNz8l3PmPLCyQXWGohnJ8iBm+5nk7O2ynaPVW0U2W+pt2w -SVuvdDM5zGv2f9ltNWUiYZHJ1mmO97jSY/6YfdOUH66iRtQtDkHBRdkNBsMbD+Em -2TgBldtHNSJBfB3pm9FblgOcJ0FSWcUDWJ7vO0+NTXlgrRofRT6pVywzxVo6dND0 -WzYlTWeUVsO40xJqhgUQRER9YLOLxJ0O6C8i0xFxAMKOtSdodMB3RIwt7RFQ0uyt -n5Z5MqkYhlMI3J1tPRTp1nEt9fyGspBOO05gi148Qasp+3N+svqKomoQglNoAxU= ------END CERTIFICATE-----`; diff --git a/packages/plugins/plugin-util/test/index.test.ts b/packages/plugins/plugin-util/test/index.test.ts deleted file mode 100644 index 1498b2ba..00000000 --- a/packages/plugins/plugin-util/test/index.test.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { expect } from "chai"; -import "mocha"; -import { EchoPlugin } from "../src/plugin"; -describe("task_plugin", function () { - it("#taskplugin", function () { - const echoPlugin = new EchoPlugin(); - const define = echoPlugin.define; - echoPlugin.execute({ context: {}, props: { test: 111 } }); - expect(define.name).eq("EchoPlugin"); - }); -}); diff --git a/packages/plugins/plugin-util/test/pipeline/access-service-test.ts b/packages/plugins/plugin-util/test/pipeline/access-service-test.ts deleted file mode 100644 index 2b8c2915..00000000 --- a/packages/plugins/plugin-util/test/pipeline/access-service-test.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { IAccessService } from "../../src/access/access-service"; -import { AbstractAccess, AliyunAccess } from "../../src"; -import { aliyunSecret } from "../user.secret"; -export class AccessServiceTest implements IAccessService { - async getById(id: any): Promise { - return { - ...aliyunSecret, - } as AliyunAccess; - } -} diff --git a/packages/plugins/plugin-util/test/pipeline/init.test.ts b/packages/plugins/plugin-util/test/pipeline/init.test.ts deleted file mode 100644 index d1e28763..00000000 --- a/packages/plugins/plugin-util/test/pipeline/init.test.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { ContextFactory } from "../../src/core/context"; -import { FileStorage } from "../../src/core/storage"; -import { AccessServiceTest } from "./access-service-test"; -import { logger } from "../../src/utils/util.log"; - -const contextFactory = new ContextFactory(new FileStorage()); - -const userContext = contextFactory.getContext("user", "test"); -const pipelineContext = contextFactory.getContext("pipeline", "test"); -export const pluginInitProps = { - accessService: new AccessServiceTest(), - pipelineContext: pipelineContext, - userContext: userContext, - logger: logger, -}; diff --git a/packages/plugins/plugin-util/test/pipeline/pipeline.define.ts b/packages/plugins/plugin-util/test/pipeline/pipeline.define.ts deleted file mode 100644 index 1369d482..00000000 --- a/packages/plugins/plugin-util/test/pipeline/pipeline.define.ts +++ /dev/null @@ -1,66 +0,0 @@ -import { ConcurrencyStrategy, NextStrategy, Pipeline, RunStrategy } from "../../src"; - -let idIndex = 0; -function generateId() { - idIndex++; - return idIndex + ""; -} -export const pipeline: Pipeline = { - version: 1, - id: generateId(), - title: "测试管道", - userId: 1, - triggers: [], - stages: [ - { - id: generateId(), - title: "证书申请阶段", - concurrency: ConcurrencyStrategy.Serial, - next: NextStrategy.AllSuccess, - tasks: [ - { - id: generateId(), - title: "申请证书任务", - steps: [ - { - id: generateId(), - title: "申请证书", - type: "CertApply", - input: { - domains: ["*.docmirror.cn"], - email: "xiaojunnuo@qq.com", - dnsProviderType: "aliyun", - accessId: "111", - }, - }, - ], - }, - ], - }, - { - id: generateId(), - title: "证书部署阶段", - concurrency: ConcurrencyStrategy.Serial, - next: NextStrategy.AllSuccess, - tasks: [ - { - id: generateId(), - title: "测试输出参数任务", - steps: [ - { - id: generateId(), - title: "输出参数(echo插件)", - type: "EchoPlugin", - input: { - cert: "cert", - }, - strategy: { - runStrategy: RunStrategy.SkipWhenSucceed, - }, - }, - ], - }, - ], - }, - ], -}; diff --git a/packages/plugins/plugin-util/test/pipeline/pipeline.test.ts b/packages/plugins/plugin-util/test/pipeline/pipeline.test.ts deleted file mode 100644 index 494746e0..00000000 --- a/packages/plugins/plugin-util/test/pipeline/pipeline.test.ts +++ /dev/null @@ -1,18 +0,0 @@ -//import { expect } from "chai"; -import "mocha"; -import { Executor, RunHistory } from "../../src"; -import { pipeline } from "./pipeline.define"; -import { AccessServiceTest } from "./access-service-test"; -import { FileStorage } from "../../src/core/storage"; -describe("pipeline", function () { - it("#pipeline", async function () { - this.timeout(120000); - function onChanged(history: RunHistory) { - console.log("changed:"); - } - - const executor = new Executor({ userId: "test", pipeline, onChanged, accessService: new AccessServiceTest(), storage: new FileStorage() }); - await executor.run(1, "user"); - // expect(define.name).eq("EchoPlugin"); - }); -}); diff --git a/packages/plugins/plugin-util/test/pipeline/plugins/cert-apply.test.ts b/packages/plugins/plugin-util/test/pipeline/plugins/cert-apply.test.ts deleted file mode 100644 index fa75e3a2..00000000 --- a/packages/plugins/plugin-util/test/pipeline/plugins/cert-apply.test.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { expect } from "chai"; -import "mocha"; -import { CertApplyPlugin } from "../../../src/plugin"; -import { pluginInitProps } from "../init.test"; -describe("CertApply", function () { - it("#execute", async function () { - this.timeout(120000); - const plugin = new CertApplyPlugin(); - // @ts-ignore - delete plugin.define; - await plugin.doInit(pluginInitProps); - const output = await plugin.execute({ - domains: ["*.docmirror.cn", "docmirror.cn"], - email: "xiaojunnuo@qq.com", - dnsProviderType: "aliyun", - accessId: "111", - forceUpdate: true, - }); - const cert = output.cert; - expect(plugin.getDefine().name).eq("CertApply"); - expect(cert.crt != null).eq(true); - }); -}); diff --git a/packages/plugins/plugin-util/test/pipeline/plugins/deploy-to-cdn.test.ts b/packages/plugins/plugin-util/test/pipeline/plugins/deploy-to-cdn.test.ts deleted file mode 100644 index c90b169b..00000000 --- a/packages/plugins/plugin-util/test/pipeline/plugins/deploy-to-cdn.test.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { expect } from "chai"; -import "mocha"; -import { DeployCertToAliyunCDN } from "../../../src/plugin"; -import { pluginInitProps } from "../init.test"; - -describe("DeployToAliyunCDN", function () { - it("#execute", async function () { - this.timeout(120000); - const plugin = new DeployCertToAliyunCDN(); - // @ts-ignore - delete plugin.define; - - await plugin.doInit(pluginInitProps); - - const cert = await pluginInitProps.pipelineContext.get("cert"); - - await plugin.execute({ - cert, - domainName: "certd-cdn-upload.docmirror.cn", - }); - expect(plugin.getDefine().name).eq("DeployCertToAliyunCDN"); - }); -}); diff --git a/packages/plugins/plugin-util/vite.config.ts b/packages/plugins/plugin-util/vite.config.ts index a3f2fd3c..8a7e0d19 100644 --- a/packages/plugins/plugin-util/vite.config.ts +++ b/packages/plugins/plugin-util/vite.config.ts @@ -14,7 +14,7 @@ export default defineConfig({ // for externalized deps globals: { vue: "Vue", - "lodash": "_", + lodash: "_", dayjs: "dayjs", "@fast-crud/fast-crud": "FastCrud", }, diff --git a/packages/ui/certd-server/bootstrap.js b/packages/ui/certd-server/bootstrap.js index d0421214..9c096c2a 100644 --- a/packages/ui/certd-server/bootstrap.js +++ b/packages/ui/certd-server/bootstrap.js @@ -1,7 +1,2 @@ -const WebFramework = require('@midwayjs/koa').Framework; -const web = new WebFramework().configure({ - port: 7001, -}); - const { Bootstrap } = require('@midwayjs/bootstrap'); -Bootstrap.load(web).run(); +Bootstrap.run(); diff --git a/packages/ui/certd-server/package.json b/packages/ui/certd-server/package.json index 4d08ed23..17c45ac9 100644 --- a/packages/ui/certd-server/package.json +++ b/packages/ui/certd-server/package.json @@ -4,8 +4,8 @@ "description": "fast-server base midway", "private": true, "scripts": { - "start": "NODE_ENV=production node ./bootstrap.js", - "online": "NODE_ENV=production node ./bootstrap.js", + "start": "cross-env NODE_ENV=production node ./bootstrap.js", + "online": "cross-env NODE_ENV=production node ./bootstrap.js", "online:preview": "NODE_ENV=preview node ./bootstrap.js", "dev": "cross-env NODE_ENV=local midway-bin dev --ts --watchFile='../../core/pipeline/src,../../plugins/'", "dev:preview": "cross-env NODE_ENV=preview midway-bin dev --ts",