Files
certd/packages/plugins/plugin-cert/src/dns-provider/api.ts

33 lines
801 B
TypeScript
Raw Normal View History

import { HttpClient, IAccess, ILogger, Registrable } from "@certd/pipeline";
2022-10-26 09:02:47 +08:00
export type DnsProviderDefine = Registrable & {
accessType: string;
2023-01-11 20:39:48 +08:00
autowire?: {
[key: string]: any;
};
2022-10-26 09:02:47 +08:00
};
export type CreateRecordOptions = {
fullRecord: string;
type: string;
value: any;
domain: string;
2022-10-26 09:02:47 +08:00
};
2024-06-15 02:17:34 +08:00
export type RemoveRecordOptions<T> = CreateRecordOptions & {
// 本次创建的dns解析记录实际上就是createRecord接口的返回值
record: T;
2022-10-26 09:02:47 +08:00
};
export type DnsProviderContext = {
access: IAccess;
logger: ILogger;
http: HttpClient;
};
2024-06-15 02:17:34 +08:00
export interface IDnsProvider<T = any> {
2023-05-09 10:16:49 +08:00
onInstance(): Promise<void>;
2024-06-15 02:17:34 +08:00
createRecord(options: CreateRecordOptions): Promise<T>;
removeRecord(options: RemoveRecordOptions<T>): Promise<void>;
setCtx(ctx: DnsProviderContext): void;
2022-10-26 09:02:47 +08:00
}