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