UNPKG

cloudcms-cli

Version:
79 lines (74 loc) 2.85 kB
var helper = require("../../../helper"); var AbstractCommand = require("../../abstract"); class ListDefinitionsCommand extends AbstractCommand { constructor() { super({ "group": "branch", "name": "list-definitions", "description": "Lists the definitions on the branch", "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:", "helper": "The ID of the branch", "required": false, "default": "master", "args": ["branch", "b"] }, { "name": "filter", "type": "string", "description": "Enter the filter:", "helper": "Either 'type', 'association' or 'feature'", "required": false, "args": ["filter"] }, { "name": "system", "type": "boolean", "description": "Should system definitions be included?", "required": false, "args": ["system"] }, { "name": "custom", "type": "boolean", "description": "Should custom definitions be included?", "required": false, "args": ["custom"] },{ "name": "skip", "type": "number", "description": "Enter the pagination skip", "required": false, "args": ["skip", "s"] }, { "name": "limit", "type": "number", "description": "Enter the pagination limit", "required": false, "args": ["limit", "l"] }, { "name": "sort", "type": "string", "description": "Enter the pagination sort JSON", "required": false, "args": ["sort", "x"] }] } }); } handle(options, callback) { helper.listBranchDefinitions(options.repositoryId, options.branchId, options.filter, options.system, options.custom, options.skip, options.limit, options.sort, function(err) { callback(err); }); } } module.exports = ListDefinitionsCommand;