fix: 修复上传到cos报runtimeDepsService未初始化的问题

This commit is contained in:
xiaojunnuo
2026-07-15 01:09:57 +08:00
parent b91c9e4ea6
commit 167b303fae
53 changed files with 517 additions and 1533 deletions
@@ -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;
}
}