@certd/plugin-cert 1.20.9 → 1.20.12

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.
@@ -1,4 +1,4 @@
1
- import { Registrable } from "@certd/pipeline";
1
+ import { HttpClient, IAccess, ILogger, Registrable } from "@certd/pipeline";
2
2
  export type DnsProviderDefine = Registrable & {
3
3
  accessType: string;
4
4
  autowire?: {
@@ -9,12 +9,19 @@ export type CreateRecordOptions = {
9
9
  fullRecord: string;
10
10
  type: string;
11
11
  value: any;
12
+ domain: string;
12
13
  };
13
- export type RemoveRecordOptions = CreateRecordOptions & {
14
- record: any;
14
+ export type RemoveRecordOptions<T> = CreateRecordOptions & {
15
+ record: T;
15
16
  };
16
- export interface IDnsProvider {
17
+ export type DnsProviderContext = {
18
+ access: IAccess;
19
+ logger: ILogger;
20
+ http: HttpClient;
21
+ };
22
+ export interface IDnsProvider<T = any> {
17
23
  onInstance(): Promise<void>;
18
- createRecord(options: CreateRecordOptions): Promise<any>;
19
- removeRecord(options: RemoveRecordOptions): Promise<any>;
24
+ createRecord(options: CreateRecordOptions): Promise<T>;
25
+ removeRecord(options: RemoveRecordOptions<T>): Promise<void>;
26
+ setCtx(ctx: DnsProviderContext): void;
20
27
  }
@@ -0,0 +1,8 @@
1
+ import { CreateRecordOptions, DnsProviderContext, IDnsProvider, RemoveRecordOptions } from "./api";
2
+ export declare abstract class AbstractDnsProvider<T = any> implements IDnsProvider<T> {
3
+ ctx: DnsProviderContext;
4
+ setCtx(ctx: DnsProviderContext): void;
5
+ abstract createRecord(options: CreateRecordOptions): Promise<T>;
6
+ abstract onInstance(): Promise<void>;
7
+ abstract removeRecord(options: RemoveRecordOptions<T>): Promise<void>;
8
+ }
@@ -1,3 +1,4 @@
1
1
  export * from "./api";
2
2
  export * from "./registry";
3
3
  export * from "./decorator";
4
+ export * from "./base";
@@ -1,6 +1,6 @@
1
1
  import * as acme from "@certd/acme-client";
2
2
  import { Logger } from "log4js";
3
- import { IContext } from "@certd/pipeline/src/core/context";
3
+ import { IContext } from "@certd/pipeline";
4
4
  import { IDnsProvider } from "../../dns-provider";
5
5
  export type CertInfo = {
6
6
  crt: string;
@@ -19,6 +19,7 @@ export declare class AcmeService {
19
19
  saveAccountConfig(email: string, conf: any): Promise<void>;
20
20
  getAcmeClient(email: string, isTest?: boolean): Promise<acme.Client>;
21
21
  createNewKey(): Promise<string>;
22
+ parseDomain(fullDomain: string): string;
22
23
  challengeCreateFn(authz: any, challenge: any, keyAuthorization: string, dnsProvider: IDnsProvider): Promise<any>;
23
24
  /**
24
25
  * Function used to remove an ACME challenge response
@@ -11,7 +11,7 @@ export declare class CertApplyPlugin extends AbstractTaskPlugin {
11
11
  dnsProviderAccess: string;
12
12
  renewDays: number;
13
13
  forceUpdate: string;
14
- csrInfo: any;
14
+ csrInfo: string;
15
15
  acme: AcmeService;
16
16
  logger: Logger;
17
17
  userContext: IContext;
@@ -21,11 +21,10 @@ export declare class CertApplyPlugin extends AbstractTaskPlugin {
21
21
  cert?: CertInfo;
22
22
  onInstance(): Promise<void>;
23
23
  execute(): Promise<void>;
24
- output(cert: CertInfo): Promise<void>;
25
- zipCert(cert: CertInfo): Promise<void>;
24
+ output(certReader: CertReader): Promise<void>;
25
+ zipCert(cert: CertInfo, applyTime: string): Promise<void>;
26
26
  /**
27
27
  * 是否更新证书
28
- * @param input
29
28
  */
30
29
  condition(): Promise<CertReader | null>;
31
30
  doCertApply(): Promise<CertReader>;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@certd/plugin-cert",
3
3
  "private": false,
4
- "version": "1.20.9",
4
+ "version": "1.20.12",
5
5
  "main": "./dist/bundle.js",
6
6
  "module": "./dist/bundle.mjs",
7
7
  "types": "./dist/d/index.d.ts",
@@ -12,10 +12,11 @@
12
12
  "preview": "vite preview"
13
13
  },
14
14
  "dependencies": {
15
- "@certd/acme-client": "^1.20.9",
16
- "@certd/pipeline": "^1.20.9",
15
+ "@certd/acme-client": "^1.20.12",
16
+ "@certd/pipeline": "^1.20.12",
17
17
  "jszip": "^3.10.1",
18
- "node-forge": "^0.10.0"
18
+ "node-forge": "^0.10.0",
19
+ "psl": "^1.9.0"
19
20
  },
20
21
  "devDependencies": {
21
22
  "@alicloud/cs20151215": "^3.0.3",
@@ -30,6 +31,7 @@
30
31
  "@types/lodash": "^4.14.186",
31
32
  "@types/mocha": "^10.0.0",
32
33
  "@types/node-forge": "^1.3.0",
34
+ "@types/psl": "^1.1.3",
33
35
  "@typescript-eslint/eslint-plugin": "^5.38.1",
34
36
  "@typescript-eslint/parser": "^5.38.1",
35
37
  "chai": "^4.3.6",
@@ -51,5 +53,5 @@
51
53
  "vite": "^3.1.0",
52
54
  "vue-tsc": "^0.38.9"
53
55
  },
54
- "gitHead": "adf569eb62540ce74e091b0d7a55706d959a5e0d"
56
+ "gitHead": "eed265faf11b72c19fd71a3084aa4d623693002c"
55
57
  }