cloudcms-cli
Version:
Cloud CMS Command-Line client
63 lines (59 loc) • 2.1 kB
JavaScript
var helper = require("../../../helper");
var AbstractCommand = require("../../abstract");
class QueryNodesCommand extends AbstractCommand
{
constructor()
{
super({
"group": "branch",
"name": "query-nodes",
"description": "Queries for Nodes",
"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": "query",
"type": "string",
"description": "Enter the query JSON",
"required": false,
"args": ["query", "q"]
}, {
"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.queryNodes(options.repositoryId, options.branchId, options.query, options.skip, options.limit, options.sort, function(err) {
callback(err);
});
}
}
module.exports = QueryNodesCommand;