UNPKG

@stoked-cenv/cli

Version:

A well considered cli and Node.js library for helping manage application, infrastructure, and configuration management.

86 lines 3.74 kB
"use strict"; var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var __metadata = (this && this.__metadata) || function (k, v) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); }; Object.defineProperty(exports, "__esModule", { value: true }); exports.ParamsPullCommand = void 0; const nest_commander_1 = require("nest-commander"); const lib_1 = require("@stoked-cenv/lib"); const base_command_1 = require("./base.command"); let ParamsPullCommand = class ParamsPullCommand extends base_command_1.BaseCommand { constructor() { super(); } parseLogLevel(val) { return val; } parseDeployed(val) { return val; } parseDecrypted(val) { return val; } parseEnvironment(val) { return val; } async runCommand(passedParam, options, packages) { try { await Promise.allSettled(packages.map(async (p) => { if (p.params) { await p.params.pull(options === null || options === void 0 ? void 0 : options.deployed, options === null || options === void 0 ? void 0 : options.decrypted); } })); } catch (e) { console.log(lib_1.CenvLog.colors.error(e)); } } }; exports.ParamsPullCommand = ParamsPullCommand; __decorate([ (0, nest_commander_1.Option)({ flags: '-ll, --log-level, <logLevel>', description: `Logging mode`, }), __metadata("design:type", Function), __metadata("design:paramtypes", [String]), __metadata("design:returntype", String) ], ParamsPullCommand.prototype, "parseLogLevel", null); __decorate([ (0, nest_commander_1.Option)({ name: 'deployed', flags: '-d, --deployed', description: 'Pull the most up to date variables that have been deployed.', }), __metadata("design:type", Function), __metadata("design:paramtypes", [Boolean]), __metadata("design:returntype", Boolean) ], ParamsPullCommand.prototype, "parseDeployed", null); __decorate([ (0, nest_commander_1.Option)({ name: 'decrypted', flags: '-D, --decrypted', description: 'Decrypt the variables before pulling them.', }), __metadata("design:type", Function), __metadata("design:paramtypes", [Boolean]), __metadata("design:returntype", Boolean) ], ParamsPullCommand.prototype, "parseDecrypted", null); __decorate([ (0, nest_commander_1.Option)({ name: 'environment', flags: '-e, --environment <string>', description: 'Supply a different environment than your current environment to update your local stack\'s config to use that environments app config variables.', }), __metadata("design:type", Function), __metadata("design:paramtypes", [String]), __metadata("design:returntype", String) ], ParamsPullCommand.prototype, "parseEnvironment", null); exports.ParamsPullCommand = ParamsPullCommand = __decorate([ (0, nest_commander_1.SubCommand)({ name: 'pull', description: 'Pull the latest application configuration', arguments: '[options]', }), __metadata("design:paramtypes", []) ], ParamsPullCommand); //# sourceMappingURL=params.pull.command.js.map