mirror of
https://github.com/certd/certd.git
synced 2026-07-16 18:57:32 +08:00
chore: 完善第三方依赖动态加载
This commit is contained in:
@@ -241,7 +241,7 @@ export class DeployCertToAliyunAckPlugin extends AbstractTaskPlugin {
|
||||
}
|
||||
|
||||
async getClient(aliyunProvider: any, regionId: string) {
|
||||
const client = new AliyunClient({ logger: this.logger, useROAClient: true });
|
||||
const client = new AliyunClient({ logger: this.logger, useROAClient: true, importRuntime: aliyunProvider.importRuntime.bind(aliyunProvider) });
|
||||
await client.init({
|
||||
accessKeyId: aliyunProvider.accessKeyId,
|
||||
accessKeySecret: aliyunProvider.accessKeySecret,
|
||||
|
||||
@@ -128,7 +128,7 @@ export class AliyunDeployCertToALB extends AbstractTaskPlugin {
|
||||
async onInstance() {}
|
||||
|
||||
async getLBClient(access: AliyunAccess, region: string) {
|
||||
const client = new AliyunClient({ logger: this.logger });
|
||||
const client = new AliyunClient({ logger: this.logger, importRuntime: access.importRuntime.bind(access) });
|
||||
|
||||
const version = "2020-06-16";
|
||||
await client.init({
|
||||
|
||||
@@ -231,7 +231,7 @@ export class DeployCertToAliyunApig extends AbstractTaskPlugin {
|
||||
return {
|
||||
list: records,
|
||||
total: res?.data?.totalSize || 0,
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
async onGetRegionList(data: any) {
|
||||
|
||||
+2
-2
@@ -134,7 +134,7 @@ export class DeployCertToAliyunApiGateway extends AbstractTaskPlugin {
|
||||
const access = await this.getAccess<AliyunAccess>(this.accessId);
|
||||
const client = access.getClient(this.regionEndpoint);
|
||||
|
||||
const pager = new Pager(data)
|
||||
const pager = new Pager(data);
|
||||
const res = await client.doRequest({
|
||||
// 接口名称
|
||||
action: "DescribeApiGroups",
|
||||
@@ -162,7 +162,7 @@ export class DeployCertToAliyunApiGateway extends AbstractTaskPlugin {
|
||||
return {
|
||||
list: records,
|
||||
total: res?.TotalCount || 0,
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
async onGetDomainList(data: any) {
|
||||
|
||||
@@ -209,7 +209,7 @@ export class DeployCertToAliyunCDN extends AbstractTaskPlugin {
|
||||
}
|
||||
|
||||
async getClient(access: AliyunAccess) {
|
||||
const client = new AliyunClient({ logger: this.logger });
|
||||
const client = new AliyunClient({ logger: this.logger, importRuntime: access.importRuntime.bind(access) });
|
||||
await client.init({
|
||||
accessKeyId: access.accessKeyId,
|
||||
accessKeySecret: access.accessKeySecret,
|
||||
|
||||
@@ -143,7 +143,7 @@ export class DeployCertToAliyunDCDN extends AbstractTaskPlugin {
|
||||
}
|
||||
|
||||
async getClient(access: AliyunAccess) {
|
||||
const client = new AliyunClient({ logger: this.logger });
|
||||
const client = new AliyunClient({ logger: this.logger, importRuntime: access.importRuntime.bind(access) });
|
||||
await client.init({
|
||||
accessKeyId: access.accessKeyId,
|
||||
accessKeySecret: access.accessKeySecret,
|
||||
|
||||
@@ -137,8 +137,8 @@ export class AliyunDeployCertToFC extends AbstractTaskPlugin {
|
||||
|
||||
const client = await this.getClient(access);
|
||||
|
||||
const $Util = await import("@alicloud/tea-util");
|
||||
const $OpenApi = await import("@alicloud/openapi-client");
|
||||
const $Util = await access.importRuntime("@alicloud/tea-util");
|
||||
const $OpenApi = await access.importRuntime("@alicloud/openapi-client");
|
||||
|
||||
let privateKey = this.cert.key;
|
||||
try {
|
||||
@@ -204,7 +204,7 @@ export class AliyunDeployCertToFC extends AbstractTaskPlugin {
|
||||
}
|
||||
|
||||
async getClient(access: AliyunAccess) {
|
||||
const $OpenApi = await import("@alicloud/openapi-client");
|
||||
const $OpenApi = await access.importRuntime("@alicloud/openapi-client");
|
||||
const config = new $OpenApi.Config({
|
||||
accessKeyId: access.accessKeyId,
|
||||
accessKeySecret: access.accessKeySecret,
|
||||
@@ -221,8 +221,8 @@ export class AliyunDeployCertToFC extends AbstractTaskPlugin {
|
||||
const access = await this.getAccess<AliyunAccess>(this.accessId);
|
||||
const client = await this.getClient(access);
|
||||
|
||||
const $OpenApi = await import("@alicloud/openapi-client");
|
||||
const $Util = await import("@alicloud/tea-util");
|
||||
const $OpenApi = await access.importRuntime("@alicloud/openapi-client");
|
||||
const $Util = await access.importRuntime("@alicloud/tea-util");
|
||||
const params = new $OpenApi.Params({
|
||||
// 接口名称
|
||||
action: "ListCustomDomains",
|
||||
|
||||
@@ -117,7 +117,7 @@ export class AliyunDeployCertToNLB extends AbstractTaskPlugin {
|
||||
async onInstance() {}
|
||||
|
||||
async getLBClient(access: AliyunAccess, region: string) {
|
||||
const client = new AliyunClient({ logger: this.logger });
|
||||
const client = new AliyunClient({ logger: this.logger, importRuntime: access.importRuntime.bind(access) });
|
||||
|
||||
const version = "2022-04-30";
|
||||
await client.init({
|
||||
|
||||
@@ -196,7 +196,7 @@ export class DeployCertToAliyunOSS extends AbstractTaskPlugin {
|
||||
|
||||
async getClient(access: AliyunAccess) {
|
||||
// @ts-ignore
|
||||
const OSS = await import("ali-oss");
|
||||
const OSS = await access.importRuntime("ali-oss");
|
||||
return new OSS.default({
|
||||
accessKeyId: access.accessKeyId,
|
||||
accessKeySecret: access.accessKeySecret,
|
||||
|
||||
@@ -130,7 +130,7 @@ export class AliyunDeployCertToSLB extends AbstractTaskPlugin {
|
||||
async onInstance() {}
|
||||
|
||||
async getLBClient(access: AliyunAccess, region: string) {
|
||||
const client = new AliyunClient({ logger: this.logger });
|
||||
const client = new AliyunClient({ logger: this.logger, importRuntime: access.importRuntime.bind(access) });
|
||||
const version = "2014-05-15";
|
||||
await client.init({
|
||||
accessKeyId: access.accessKeyId,
|
||||
|
||||
+1
-1
@@ -103,7 +103,7 @@ export class AliyunDeployCertToWafCloud extends AbstractTaskPlugin {
|
||||
async onInstance() {}
|
||||
|
||||
async getWafClient(access: AliyunAccess) {
|
||||
const client = new AliyunClient({ logger: this.logger });
|
||||
const client = new AliyunClient({ logger: this.logger, importRuntime: access.importRuntime.bind(access) });
|
||||
await client.init({
|
||||
accessKeyId: access.accessKeyId,
|
||||
accessKeySecret: access.accessKeySecret,
|
||||
|
||||
+1
-1
@@ -115,7 +115,7 @@ export class AliyunDeployCertToWaf extends AbstractTaskPlugin {
|
||||
async onInstance() {}
|
||||
|
||||
async getWafClient(access: AliyunAccess) {
|
||||
const client = new AliyunClient({ logger: this.logger });
|
||||
const client = new AliyunClient({ logger: this.logger, importRuntime: access.importRuntime.bind(access) });
|
||||
await client.init({
|
||||
accessKeyId: access.accessKeyId,
|
||||
accessKeySecret: access.accessKeySecret,
|
||||
|
||||
Reference in New Issue
Block a user