UNPKG

lambdaorm-cli

Version:
67 lines 2.56 kB
"use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.IncorporateCommand = void 0; const path_1 = __importDefault(require("path")); const usesCases_1 = require("../builders/usesCases"); class IncorporateCommand { constructor() { this.command = 'incorporate'; this.describe = 'Update schema and push source and import data.'; } builder(args) { return args .option('w', { alias: 'workspace', describe: 'project path' }) .option('u', { alias: 'url', describe: 'Url of service' }) .option('s', { alias: 'stage', describe: 'Name of stage' }) .option('e', { alias: 'envfile', describe: 'Read in a file of environment variables' }) .option('d', { alias: 'data', describe: 'Data file to incorporate' }) .option('n', { alias: 'name', describe: 'Name of root entity' }); } handler(args) { return __awaiter(this, void 0, void 0, function* () { const workspace = path_1.default.resolve(process.cwd(), args.workspace || '.'); const url = args.url; const stage = args.stage; const data = args.data || {}; const name = args.name; try { yield usesCases_1.incorporate.execute(workspace, data, name, stage, url); } catch (error) { console.error(`error: ${error}`); } }); } } exports.IncorporateCommand = IncorporateCommand; //# sourceMappingURL=incorporate.js.map