@certd/plugin-lib 1.38.1 → 1.38.2

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 CHANGED
@@ -3,6 +3,14 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [1.38.2](https://github.com/certd/certd/compare/v1.38.1...v1.38.2) (2026-01-22)
7
+
8
+ ### Performance Improvements
9
+
10
+ * 域名导入 ([ad64384](https://github.com/certd/certd/commit/ad64384891c13342980b7559924666dcfb2796c2))
11
+ * 支持从提供商导入域名列表 ([f442363](https://github.com/certd/certd/commit/f4423638a2ee779d48fc17b3819ce3bee55b0361))
12
+ * 支持同步域名过期时间 ([a97cee8](https://github.com/certd/certd/commit/a97cee84f3bfdeeb2083d91f748cac5405fed6ae))
13
+
6
14
  ## [1.38.1](https://github.com/certd/certd/compare/v1.38.0...v1.38.1) (2026-01-15)
7
15
 
8
16
  ### Bug Fixes
@@ -1,5 +1,5 @@
1
1
  import { HttpClient, ILogger, utils } from "@certd/basic";
2
- import { IAccess, IServiceGetter, Registrable } from "@certd/pipeline";
2
+ import { IAccess, IServiceGetter, Pager, PageRes, Registrable } from "@certd/pipeline";
3
3
  export type DnsProviderDefine = Registrable & {
4
4
  accessType: string;
5
5
  icon?: string;
@@ -23,6 +23,10 @@ export type DnsProviderContext = {
23
23
  domainParser: IDomainParser;
24
24
  serviceGetter: IServiceGetter;
25
25
  };
26
+ export type DomainRecord = {
27
+ id: string;
28
+ domain: string;
29
+ };
26
30
  export interface IDnsProvider<T = any> {
27
31
  onInstance(): Promise<void>;
28
32
  /**
@@ -39,6 +43,7 @@ export interface IDnsProvider<T = any> {
39
43
  removeRecord(options: RemoveRecordOptions<T>): Promise<void>;
40
44
  setCtx(ctx: DnsProviderContext): void;
41
45
  usePunyCode(): boolean;
46
+ getDomainListPage(pager: Pager): Promise<PageRes<DomainRecord>>;
42
47
  }
43
48
  export interface ISubDomainsGetter {
44
49
  getSubDomains(): Promise<string[]>;
@@ -1,4 +1,5 @@
1
- import { CreateRecordOptions, DnsProviderContext, IDnsProvider, RemoveRecordOptions } from "./api.js";
1
+ import { Pager, PageRes } from "@certd/pipeline";
2
+ import { CreateRecordOptions, DnsProviderContext, DomainRecord, IDnsProvider, RemoveRecordOptions } from "./api.js";
2
3
  import { HttpClient, ILogger } from "@certd/basic";
3
4
  export declare abstract class AbstractDnsProvider<T = any> implements IDnsProvider<T> {
4
5
  ctx: DnsProviderContext;
@@ -20,6 +21,7 @@ export declare abstract class AbstractDnsProvider<T = any> implements IDnsProvid
20
21
  abstract createRecord(options: CreateRecordOptions): Promise<T>;
21
22
  abstract onInstance(): Promise<void>;
22
23
  abstract removeRecord(options: RemoveRecordOptions<T>): Promise<void>;
24
+ getDomainListPage(pager: Pager): Promise<PageRes<DomainRecord>>;
23
25
  }
24
26
  export declare function createDnsProvider(opts: {
25
27
  dnsProviderType: string;
@@ -31,6 +31,9 @@ export class AbstractDnsProvider {
31
31
  async parseDomain(fullDomain) {
32
32
  return await this.ctx.domainParser.parse(fullDomain);
33
33
  }
34
+ async getDomainListPage(pager) {
35
+ throw new Error("Method not implemented.");
36
+ }
34
37
  }
35
38
  export async function createDnsProvider(opts) {
36
39
  const { dnsProviderType, context } = opts;
@@ -1,5 +1,6 @@
1
1
  import { IDomainParser, ISubDomainsGetter } from "./api";
2
2
  import { ILogger } from "@certd/basic";
3
+ export declare function parseDomainByPsl(fullDomain: string): psl.ParsedDomain;
3
4
  export declare class DomainParser implements IDomainParser {
4
5
  subDomainsGetter: ISubDomainsGetter;
5
6
  logger: ILogger;
@@ -2,6 +2,13 @@
2
2
  import psl from "psl";
3
3
  import { utils, logger as globalLogger } from "@certd/basic";
4
4
  import { resolveDomainBySoaRecord } from "@certd/acme-client";
5
+ export function parseDomainByPsl(fullDomain) {
6
+ const parsed = psl.parse(fullDomain);
7
+ if (parsed.error) {
8
+ throw new Error(`解析${fullDomain}域名失败:` + JSON.stringify(parsed.error));
9
+ }
10
+ return parsed;
11
+ }
5
12
  export class DomainParser {
6
13
  subDomainsGetter;
7
14
  logger;
@@ -10,11 +17,7 @@ export class DomainParser {
10
17
  this.logger = logger || globalLogger;
11
18
  }
12
19
  parseDomainByPsl(fullDomain) {
13
- const parsed = psl.parse(fullDomain);
14
- if (parsed.error) {
15
- throw new Error(`解析${fullDomain}域名失败:` + JSON.stringify(parsed.error));
16
- }
17
- return parsed.domain;
20
+ return parseDomainByPsl(fullDomain).domain;
18
21
  }
19
22
  async parse(fullDomain) {
20
23
  //如果是ip
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@certd/plugin-lib",
3
3
  "private": false,
4
- "version": "1.38.1",
4
+ "version": "1.38.2",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
7
7
  "types": "./dist/index.d.ts",
@@ -22,10 +22,10 @@
22
22
  "@alicloud/pop-core": "^1.7.10",
23
23
  "@alicloud/tea-util": "^1.4.11",
24
24
  "@aws-sdk/client-s3": "^3.964.0",
25
- "@certd/acme-client": "^1.38.1",
26
- "@certd/basic": "^1.38.1",
27
- "@certd/pipeline": "^1.38.1",
28
- "@certd/plus-core": "^1.38.1",
25
+ "@certd/acme-client": "^1.38.2",
26
+ "@certd/basic": "^1.38.2",
27
+ "@certd/pipeline": "^1.38.2",
28
+ "@certd/plus-core": "^1.38.2",
29
29
  "@kubernetes/client-node": "0.21.0",
30
30
  "ali-oss": "^6.22.0",
31
31
  "basic-ftp": "^5.0.5",
@@ -57,5 +57,5 @@
57
57
  "tslib": "^2.8.1",
58
58
  "typescript": "^5.4.2"
59
59
  },
60
- "gitHead": "2c80c35b21b3f435e835167fca13db510bbc38a2"
60
+ "gitHead": "f92dc6a1ad103de9cc184da3b84096943906cb59"
61
61
  }