UNPKG

cloudcms-cli

Version:
46 lines (42 loc) 1.37 kB
var helper = require("../../../helper"); var AbstractCommand = require("../../abstract"); class CreateNodeCommand extends AbstractCommand { constructor() { super({ "group": "branch", "name": "create-node", "description": "Creates a node", "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": "object", "type": "string", "description": "Enter the object JSON", "required": false, "args": ["object", "o", "node"] }, ] } }); } handle(options, callback) { // call workhorse function helper.createNode(options.repositoryId, options.branchId, options.object, function(err) { callback(err); }); } } module.exports = CreateNodeCommand;