UNPKG

cloudcms-cli

Version:
52 lines (48 loc) 1.61 kB
var helper = require("../../../helper"); var AbstractCommand = require("../../abstract"); class IngestCommand extends AbstractCommand { constructor() { super({ "group": "branch", "name": "ingest", "description": "Ingests one or more streams", "schema": { "properties": [{ "name": "repositoryId", "type": "string", "description": "Enter the repository ID", "required": true, "args": ["repository", "r"] }, { "name": "branchId", "type": "string", "description": "Enter the branch ID", "required": true, "args": ["branch", "b"] }, { "name": "file", "type": "string", "description": "Path to the source file", "required": true, "args": ["file", "f"] }, { "name": "config", "type": "string", "description": "Enter the object JSON", "required": false, "args": ["config", "c"] }, ] } }); } handle(options, callback) { // call workhorse function helper.ingest(options.repositoryId, options.branchId, options.file, options.config, function(err) { callback(err); }); } } module.exports = IngestCommand;