UNPKG

@apistudio/apim-cli

Version:

CLI for API Management Products

19 lines (16 loc) 657 B
import { IRuntimeTransformer } from "@apic/smith-transformer"; export class LWGWRuntimeTransformer implements IRuntimeTransformer { private orchestratorPromise: Promise<any> | null = null; private async loadOrchestrator() { if (!this.orchestratorPromise) { this.orchestratorPromise = import("@apic/lwgw-smith-transformer").then( async (module) => await module.createLwgwOrchestrator() ); } return this.orchestratorPromise; } public async transform(zip: Buffer) { const orchestrator = await this.loadOrchestrator(); return orchestrator.transform(zip); } }