mirror of
https://github.com/certd/certd.git
synced 2026-06-27 05:47:34 +08:00
refactor(plugins): 部分插件改用运行时导入依赖替代静态导入
将所有插件内的静态依赖导入改为通过access.importRuntime动态导入,并调整package.json依赖顺序
This commit is contained in:
@@ -14,7 +14,7 @@ export class VolcengineCdnClient {
|
||||
if (this.service) {
|
||||
return this.service;
|
||||
}
|
||||
const { cdn } = await import("@volcengine/openapi");
|
||||
const { cdn } = await this.opts.access.importRuntime("@volcengine/openapi");
|
||||
const service = new cdn.CdnService();
|
||||
// 设置ak、sk
|
||||
service.setAccessKeyId(this.opts.access.accessKeyId);
|
||||
|
||||
@@ -21,7 +21,7 @@ export class VolcengineDnsClient {
|
||||
}
|
||||
|
||||
async doRequest(req: VolcengineReq) {
|
||||
const { Signer } = await import("@volcengine/openapi");
|
||||
const { Signer } = await this.opts.access.importRuntime("@volcengine/openapi");
|
||||
|
||||
// http request data
|
||||
const openApiRequestData: any = {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { VolcengineAccess } from "./access.js";
|
||||
import { VolcengineAccess } from "./access.js";
|
||||
import { HttpClient, ILogger } from "@certd/basic";
|
||||
|
||||
export type VolcengineOpts = {
|
||||
@@ -140,7 +140,7 @@ export class VolcengineClient {
|
||||
}
|
||||
|
||||
async getTOSService(opts: { region?: string }) {
|
||||
const { TosClient } = await import("@volcengine/tos-sdk");
|
||||
const { TosClient } = await this.opts.access.importRuntime("@volcengine/tos-sdk");
|
||||
|
||||
const client = new TosClient({
|
||||
accessKeyId: this.opts.access.accessKeyId,
|
||||
@@ -169,7 +169,7 @@ export class VolcengineClient {
|
||||
if (this.CommonService) {
|
||||
return this.CommonService;
|
||||
}
|
||||
const { Service } = await import("@volcengine/openapi");
|
||||
const { Service } = await this.opts.access.importRuntime("@volcengine/openapi");
|
||||
|
||||
class CommonService extends Service {
|
||||
Generic: any;
|
||||
|
||||
Reference in New Issue
Block a user