UNPKG

@veecode-platform/safira-cli

Version:

Generate a microservice project from your spec.

32 lines (31 loc) 1.42 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.VkprMockServerOperations = void 0; const tslib_1 = require("tslib"); const child_process_1 = require("child_process"); const command_execute_1 = require("../command/command-execute"); const properties = tslib_1.__importStar(require("../properties.json")); const install_vkpr_1 = require("./install-vkpr"); class VkprMockServerOperations { async install(params) { const flags = ["--dry_run=false"]; if (params.domain) flags.push(`--domain=${params.domain}`); if (params.secure) flags.push("--secure=true"); if (params.ssl) flags.push("--ssl=true"); if (params.crtFile) flags.push(`--crt_file=${params.crtFile}`); if (params.keyFile) flags.push(`--key_file=${params.keyFile}`); process.env.VKPR_ENV_MOCKSERVER_INGRESS_CLASS_NAME = "kong"; await install_vkpr_1.InstallVkpr.instance.install(); await command_execute_1.CommandExecute.instance.runInteractive(`${properties.vkpr.command} mockserver install ${flags.join(" ")}`); } remove() { const mockserverRemove = (0, child_process_1.exec)(`${properties.vkpr.command} mockserver remove`); mockserverRemove.stdout?.on("data", result => console.log(result)); } } exports.VkprMockServerOperations = VkprMockServerOperations;