@apistudio/apim-cli
Version:
CLI for API Management Products
19 lines (16 loc) • 636 B
text/typescript
import { IRuntimeTransformer } from "@apic/smith-transformer";
export class RuntimeTransformer implements IRuntimeTransformer {
private orchestratorPromise: Promise<any> | null = null;
private async loadOrchestrator() {
if (!this.orchestratorPromise) {
this.orchestratorPromise = import("@apic/smith-transformer").then(
(module) => module.createCoreOrchestrator()
);
}
return this.orchestratorPromise;
}
public async transform(zip: Buffer) {
const orchestrator = await this.loadOrchestrator();
return orchestrator.transform(zip);
}
}