mirror of
https://github.com/certd/certd.git
synced 2026-07-16 02:37:34 +08:00
fix: 修复上传到cos报runtimeDepsService未初始化的问题
This commit is contained in:
@@ -1,21 +1,25 @@
|
||||
import { getGlobalAgents, ILogger } from "@certd/basic";
|
||||
import { ImportRuntime } from "@certd/pipeline";
|
||||
import { getGlobalAgents, ILogger } from "@certd/basic";
|
||||
import { importRuntime as importRuntimeDirect } from "@certd/pipeline";
|
||||
|
||||
export class AliyunClient {
|
||||
client: any;
|
||||
logger: ILogger;
|
||||
agent: any;
|
||||
useROAClient: boolean;
|
||||
importRuntime: ImportRuntime;
|
||||
|
||||
constructor(opts: { logger: ILogger; useROAClient?: boolean; importRuntime?: ImportRuntime }) {
|
||||
|
||||
constructor(opts: { logger: ILogger; useROAClient?: boolean }) {
|
||||
this.logger = opts.logger;
|
||||
this.useROAClient = opts.useROAClient || false;
|
||||
this.importRuntime = opts.importRuntime || (async (specifier: string) => await import(specifier));
|
||||
|
||||
const agents = getGlobalAgents();
|
||||
this.agent = agents.httpsAgent;
|
||||
}
|
||||
|
||||
async importRuntime(specifier: string) {
|
||||
return await importRuntimeDirect(specifier, this.logger);
|
||||
}
|
||||
|
||||
async getSdk() {
|
||||
if (this.useROAClient) {
|
||||
return await this.getROAClient();
|
||||
@@ -78,3 +82,4 @@ export class AliyunClient {
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user