UNPKG

jovo-cli

Version:
32 lines 1.23 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const jovo_cli_core_1 = require("jovo-cli-core"); const jovo_cli_deploy_lambda_1 = require("jovo-cli-deploy-lambda"); const AVAILABLE_DEPLOY_TARGETS = [jovo_cli_deploy_lambda_1.JovoCliDeployLambda]; const instances = {}; function getAllPluginTargets() { return AVAILABLE_DEPLOY_TARGETS.map((platform) => platform.TARGET_KEY); } exports.getAllPluginTargets = getAllPluginTargets; function getAllAvailable() { const targetNames = [jovo_cli_core_1.TARGET_MODEL, jovo_cli_core_1.TARGET_INFO, jovo_cli_core_1.TARGET_ZIP]; targetNames.push(...getAllPluginTargets()); return targetNames; } exports.getAllAvailable = getAllAvailable; function get(target) { if (!instances.hasOwnProperty(target)) { instances[target] = createDeployInstance(target); } return instances[target]; } exports.get = get; function createDeployInstance(name) { for (const target of AVAILABLE_DEPLOY_TARGETS) { if (target.TARGET_KEY === name) { return new target(); } } throw new jovo_cli_core_1.JovoCliError(`The deploy target "${name}" is not supported!`, 'jovo-cli'); } //# sourceMappingURL=DeployTargets.js.map