UNPKG

@o3r/amaterasu-api-spec

Version:

Commands relative to the Digital Apis

42 lines 1.62 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const core_1 = require("@ama-terasu/core"); const create_extension_command_1 = require("./create-extension.command"); const name = 'api-spec'; module.exports = { name, description: 'Commands relative to the Digital Apis', init: (yargs, baseContext) => { return yargs .demandCommand() .command('create', 'Generate new Digital Api package', (yargsInstance) => yargsInstance .demandCommand() .option(core_1.EXTRA_COMMON_OPTIONS.path, { ...core_1.MODULE_OPTIONS.path, type: 'string', default: '.', description: 'Path to the generated package' }) .command('extension <name>', 'Generate a package of spec extension', (yargsInstanceExt) => yargsInstanceExt .positional('name', { type: 'string', description: 'Name of the extension specification', demandOption: 'Specification name is mandatory' }) .option('type', { type: 'string', description: 'Digital Api type', choices: [ 'core-private', 'core-public' ], default: 'core-private' }) .option('spec-version', { type: 'string', description: 'Version of the spec to extend', default: '*' }), (options) => (0, create_extension_command_1.createExtension)(baseContext.getContext(options), options))); } }; //# sourceMappingURL=index.js.map