Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cli-router

Package Overview
Dependencies
Maintainers
1
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cli-router - npm Package Compare versions

Comparing version 0.0.6 to 0.0.7

46

lib/spec/cli_router_spec.js

@@ -55,10 +55,11 @@ 'use strict';

var cli_router = new _srcCli_router.CliRouter(controllers_root).add(action);
var args = {
agent: true };
var Controller = require(path.join(controllers_root, action));
var controller = new Controller();
var params = cli_router.match(action).params;
var route = cli_router.findRouteByParams(params);
var result = cli_router.getFn(route, params)();
var obj = new Controller();
var data = cli_router.controller(args);
var result = cli_router.getFn(data)();
_specHelper2['default'].expect(result).to.eql(controller.index());
_specHelper2['default'].expect(result).to.eql(obj.index());
});

@@ -137,3 +138,36 @@

});
describe('should extracted cmds', function () {
var action = '/agent';
var cli_router = new _srcCli_router.CliRouter(controllers_root).add(action);
it('from args without options', function () {
var args = { '--': false,
'--no-daemon': false,
'--quiet': false,
'--verbose': 0,
'--version': false,
agent: true,
ssh: false,
start: true,
vm: false
};
_specHelper2['default'].expect(cli_router.extractCommands(args)).to.eql(['agent', 'start']);
});
it('from args with multiple options', function () {
var args = { '--': false,
'--no-daemon': true,
'--quiet': false,
'--verbose': 0,
'--version': true,
agent: true,
ssh: false,
start: true,
vm: false
};
_specHelper2['default'].expect(cli_router.extractCommands(args)).to.eql(['agent', 'start']);
});
});
});
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImNsaV9yb3V0ZXJfc3BlYy5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7OzBCQUFjLGVBQWU7Ozs7NkJBQ0gsbUJBQW1COztBQUU3QyxJQUFJLENBQUMsR0FBTSxPQUFPLENBQUMsT0FBTyxDQUFDLENBQUM7QUFDNUIsSUFBSSxJQUFJLEdBQUcsT0FBTyxDQUFDLE1BQU0s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gIGFnZW50OiB0cnVlLFxuICAgICAgICBzc2g6IGZhbHNlLFxuICAgICAgICBzdGFydDogdHJ1ZSxcbiAgICAgICAgdm06IGZhbHNlXG4gICAgICB9O1xuICAgICAgaC5leHBlY3QoY2xpX3JvdXRlci5leHRyYWN0Q29tbWFuZHMoYXJncykpLnRvLmVxbChbJ2FnZW50JywgJ3N0YXJ0J10pO1xuICAgIH0pO1xuICB9KTtcbn0pO1xuIl0sInNvdXJjZVJvb3QiOiIvY2xpLXJvdXRlcjowLjAuNi9zcGVjIn0=

14

lib/spec/fixtures/controllers/agent.js

@@ -5,6 +5,2 @@ 'use strict';

var _get = function get(_x2, _x3, _x4) { var _again = true; _function: while (_again) { desc = parent = getter = undefined; _again = false; var object = _x2,
property = _x3,
receiver = _x4; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x2 = parent; _x3 = property; _x4 = receiver; _again = true; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } };
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }

@@ -18,9 +14,7 @@

function Agent() {
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
_classCallCheck(this, Agent);
_get(Object.getPrototypeOf(Agent.prototype), 'constructor', this).apply(this, args);
if (_CliController != null) {
_CliController.apply(this, arguments);
}
}

@@ -53,2 +47,2 @@

module.exports = Agent;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImZpeHR1cmVzL2NvbnRyb2xsZXJzL2FnZW50LmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7OztpQ0FBOEIsNkJBQTZCOztJQUVyRCxLQUFLO0FBQ0UsV0FEUCxLQUFLLEdBQ1k7c0NBQU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ShjbGlfb3B0aW9ucylcbiAgICAgICAgLnJvdXRlKCcvYWdlbnQnKTtcblxuICAgICAgZG9jX29wdHMuYXJndiA9IFsnYWdlbnQnLCAnc3RhcnQnXTtcbiAgICAgIHZhciByZXN1bHQgID0gY2xpLnJ1bihkb2Nfb3B0cywgY29udHJvbGxlcl9vcHRzKTtcblxuICAgICAgaC5leHBlY3QoY2xpLnJvdXRlc1swXS5wYXJhbXMpLnRvLmVxbCh7IGNvbnRyb2xsZXI6ICdhZ2VudCcsIGFjdGlvbjogdW5kZWZpbmVkIH0pO1xuICAgICAgaC5leHBlY3QocmVzdWx0KS50by5lcWwoJ2FnZW50IHN0YXJ0IG51bGwnKTtcbiAgICB9KTtcbiAgfSk7XG59KTtcbiJdLCJzb3VyY2VSb290IjoiL2NsaS1yb3V0ZXI6MC4wLjYvc3BlYyJ9

@@ -29,2 +29,2 @@ 'use strict';

module.exports = exports['default'];
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNwZWMtaGVscGVyLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7O0FBQUEsSUFBSSxJQUFJLEdBQUcsT0FBTyxDQUFDLE1BQU0sQ0FBQyxDQUFDOztBQUUzQixJQUFJLE9BQU8sR0FBRztBQUNaLFFBQU0sRUFBRyxPQUFPLENBQUMsY0FBYyxDQUFDLENBQUMsTUFBTTs7QUFFdkMsY0FBWSxFQUFBLHdCQUFhO3NDQUFULE9BQU87QUFBUCxhQUFPOzs7QUFDckIsV0FBTyxJQUFJLENBQUMsT0FBTyxNQUFBLENBQVosSUFBSSxHQUNULEdBQUcsRUFBRSxNQUFNLEVBQUUsVUFBVSxTQUFLLE9BQU8sRUFDcEMsQ0FBQztHQUNIOztBQUVELHNCQUFvQixFQUFBLGdDQUFhO3VDQUFULE9BQU87QUFBUCxhQUFPOzs7QUFDN0IsV0FBTyxJQUFJLENBQUMsT0FBTyxNQUFBLENBQVosSUFBSS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BTyxNQUFBLENBQVosSUFBSSxHQUNULEdBQUcsRUFBRSxNQUFNLEVBQUUsVUFBVSxTQUFLLE9BQU8sRUFDcEMsQ0FBQztHQUNIOztBQUVELHNCQUFvQixFQUFBLGdDQUFhO3VDQUFULE9BQU87QUFBUCxhQUFPOzs7QUFDN0IsV0FBTyxJQUFJLENBQUMsT0FBTyxNQUFBLENBQVosSUFBSSxHQUNULEdBQUcsRUFBRSxLQUFLLEVBQUUsTUFBTSxFQUFFLFVBQVUsU0FBSyxPQUFPLEVBQzNDLENBQUM7R0FDSCxFQUNGLENBQUM7O3FCQUVhLE9BQU8iLCJmaWxlIjoic3BlYy1oZWxwZXIuanMiLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgcGF0aCA9IHJlcXVpcmUoJ3BhdGgnKTtcblxudmFyIEhlbHBlcnMgPSB7XG4gIGV4cGVjdCA6IHJlcXVpcmUoJ2F6ay1kZXYvY2hhaScpLmV4cGVjdCxcblxuICBmaXh0dXJlX3BhdGgoLi4uZml4dHVyZSkge1xuICAgIHJldHVybiBwYXRoLnJlc29sdmUoXG4gICAgICAnLicsICdzcGVjJywgJ2ZpeHR1cmVzJywgLi4uZml4dHVyZVxuICAgICk7XG4gIH0sXG5cbiAgZml4dHVyZV9yZXF1aXJlX3BhdGgoLi4uZml4dHVyZSkge1xuICAgIHJldHVybiBwYXRoLnJlc29sdmUoXG4gICAgICAnLicsICdsaWInLCAnc3BlYycsICdmaXh0dXJlcycsIC4uLmZpeHR1cmVcbiAgICApO1xuICB9LFxufTtcblxuZXhwb3J0IGRlZmF1bHQgSGVscGVycztcbiJdLCJzb3VyY2VSb290IjoiL2NsaS1yb3V0ZXI6MC4wLjYvc3BlYyJ9

@@ -1,11 +0,13 @@

"use strict";
'use strict';
Object.defineProperty(exports, "__esModule", {
Object.defineProperty(exports, '__esModule', {
value: true
});
var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
var R = require('ramda');
var CliController = (function () {

@@ -27,6 +29,27 @@ function CliController() {

_createClass(CliController, [{
key: "index",
key: 'index',
value: function index() {
throw new Error("Don't use CliController directly, implemente the index action.");
throw new Error('Don\'t use CliController directly, implemente the index action.');
}
}, {
key: 'run_action',
value: function run_action(action_name) {
for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
args[_key - 1] = arguments[_key];
}
if (R.isNil(action_name) || !R.is(Function, this[action_name])) {
action_name = 'index';
}
this.before_action.apply(this, [action_name].concat(args));
var result = this[action_name].apply(this, args);
this.after_action.apply(this, [action_name].concat(args));
return result;
}
}, {
key: 'before_action',
value: function before_action() {}
}, {
key: 'after_action',
value: function after_action() {}
}]);

@@ -38,2 +61,3 @@

exports.CliController = CliController;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImNsaV9jb250cm9sbGVyLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7SUFBYSxhQUFhO0FBQ2IsV0FEQSxhQUFhLEdBQ0Q7OztRQUFYLElBQUksZ0NBQUcsRUFBRTs7MEJBRFYsYUFBYTs7QUFFdEIsVUFBTSxDQUFDLElBQUksQ0FBQyxJQUFJLENBQUMsQ0FBQyxPQUFPLENBQUMsVUFBQyxHQUFHLEVBQUs7QUFDakMsVUFBSSxJQUFJLENBQUMsY0FBYyxDQUFDLEdBQUcsQ0FBQyxFQUFFO0FBQzVCLGNBQUssR0FBRyxDQUFDLEdBQUcsSUFBSSxDQUFDLEdBQUcsQ0FBQyxDQUFDO09BQ3ZCO0tBQ0YsQ0FBQyxDQUFDO0dBQ0o7O2VBUFUsYUFBYTs7V0FTbkIsaUJBQUc7QUFDTixZQUFNLElBQUksS0FBSyxDQUFDLGdFQUFnRSxDQUFDLENBQUM7S0FDbkY7OztTQVhVLGFBQWE7OztRQUFiLGFBQWEsR0FBYixhQUFhIiwiZmlsZSI6ImNsaV9jb250cm9sbGVyLmpzIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IGNsYXNzIENsaUNvbnRyb2xsZXIge1xuICBjb25zdHJ1Y3RvcihvcHRzID0ge30pIHtcbiAgICBPYmplY3Qua2V5cyhvcHRzKS5mb3JFYWNoKChrZXkpID0+IHtcbiAgICAgIGlmIChvcHRzLmhhc093blByb3BlcnR5KGtleSkpIHtcbiAgICAgICAgdGhpc1trZXldID0gb3B0c1trZXldO1xuICAgICAgfVxuICAgIH0pO1xuICB9XG5cbiAgaW5kZXgoKSB7XG4gICAgdGhyb3cgbmV3IEVycm9yKFwiRG9uJ3QgdXNlIENsaUNvbnRyb2xsZXIgZGlyZWN0bHksIGltcGxlbWVudGUgdGhlIGluZGV4IGFjdGlvbi5cIik7XG4gIH1cbn1cbiJdLCJzb3VyY2VSb290IjoiL2NsaS1yb3V0ZXI6MC4wLjUvc3JjIn0=
/* action_name, ...args */ /* action_name, ...args */
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImNsa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1xuICAgIHJldHVybiByZXN1bHQ7XG4gIH1cbiAgYmVmb3JlX2FjdGlvbigvKiBhY3Rpb25fbmFtZSwgLi4uYXJncyAqLykge31cbiAgYWZ0ZXJfYWN0aW9uKC8qIGFjdGlvbl9uYW1lLCAuLi5hcmdzICovKSB7fVxufVxuIl0sInNvdXJjZVJvb3QiOiIvY2xpLXJvdXRlcjowLjAuNi9zcmMifQ==

@@ -97,7 +97,13 @@ 'use strict';

key: 'getFn',
value: function getFn(route, params, opts) {
if (!R.is(Object, route) || !R.is(Object, params)) {
value: function getFn(controller) {
var opts = arguments[1] === undefined ? {} : arguments[1];
controller = controller || {};
var route = controller.route;
if (!R.is(Object, route) || !R.is(Object, route.params)) {
return;
}
var fn;
var params = route.params;

@@ -108,4 +114,9 @@ if (route.hasOwnProperty('Controller')) {

}
opts = R.merge(opts, { name: params.controller });
var controller = new route.Controller(opts);
opts = R.merge(opts, {
name: params.controller,
route: route,
params: params,
args: controller.args,
full_args: controller.full_args });
var obj = new route.Controller(opts);
fn = function () {

@@ -116,4 +127,3 @@ for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {

var fn = !R.isNil(params.action) ? controller[params.action] : controller.index;
return fn.apply(controller, args);
return obj.run_action.apply(obj, [params.action].concat(args));
};

@@ -137,17 +147,16 @@ } else if (route.hasOwnProperty('fn')) {

}
// Remove the options (starting with "-" or are between "<>")
var isNoOptions = function isNoOptions(arg) {
return !_this.param_regex.test(arg);
};
var inverted_args = R.filter(isNoOptions, R.invert(args)['true'] || []);
cmds = R.uniq(R.concat(cmds, inverted_args));
return cmds;
// Filter commands and actions (do not start with "-" or between "<>")
R.mapObjIndexed(function (v, k) {
if (R.isNil(k.match(_this.param_regex)) && !!v) {
cmds.push(k);
}
}, args);
return R.uniq(cmds);
}
}, {
key: 'cleanArgs',
value: function cleanArgs(old_args) {
value: function cleanArgs(full_args) {
var args = {};
for (var key in old_args) {
var value = old_args[key];
for (var key in full_args) {
var value = full_args[key];
key = key.replace(this.param_regex, '$1');

@@ -159,19 +168,27 @@ args[key] = value;

}, {
key: 'run',
value: function run(args, opts, obj) {
var cmds = this.extractCommands(args);
key: 'controller',
value: function controller(full_args) {
var route = {};
var cmds = this.extractCommands(full_args);
if (!R.isNil(cmds) && !R.isEmpty(cmds)) {
var match = this.match('/' + cmds.join('/') + '/').params;
var route = this.findRouteByParams(match);
var fn = this.getFn(route, match, opts);
if (R.is(Function, fn)) {
args = this.cleanArgs(args);
obj = obj || this;
return fn(args, obj);
var match = this.match('/' + cmds.join('/') + '/');
if (R.is(Object, match)) {
route = this.findRouteByParams(match.params);
route = R.merge(route, match);
}
}
var args = this.cleanArgs(full_args);
return { route: route, params: route.params, args: args, full_args: full_args };
}
}, {
key: 'run',
value: function run(args, opts, obj) {
var controller = this.controller(args);
var fn = this.getFn(controller, opts);
if (R.is(Function, fn)) {
return fn(controller.args, obj || this);
}
}
}]);

@@ -183,2 +200,2 @@

exports.CliRouter = CliRouter;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImNsaV9yb3V0ZXIuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7O21CQUFtQixLQUFLOzs7O0FBRXhCLElBQUksQ0FBQyxHQUFNLE9BQU8sQ0FBQyxPQUFPLENBQUMsQ0FBQztBQUM1QixJQUFJLElBQUksR0FBRyxPQUFPLENBQUMsTUFBTSxDQUFDLENBQUM7O0lBRWQsU0FBUztBQUNULFdBREEsU0FBUyxDQUNSLGdCQUFnQixFQUFFLFdBQVcsRUFBRTswQkFEaEMsU0FBUzs7QUFFbEIsZUFBVyxHQUFHLFdBQVcsSUFBSSx1QkFBdUIsQ0FBQztBQUNyRCxRQUFJLENBQUMsZ0JBQWdCLEdBQUcsZ0JBQWdCLElBQUksSUFBSSxDQUFDOztBQUVqRCxRQUFJLElBQUksR0FBRyxpQkFBTyxLQUFLLENBQUMsV0FBVyxFQUFFLENBQUM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xsZXJzX3Jvb3QgfHwgJy4vJztcblxuICAgIHZhciBydWxlID0gUm91dGVyLlJvdXRlKHJvdXRlX3JlZ2V4LCAwKTtcblxuICAgIHRoaXMucm91dGVfcnVsZXMgICAgICA9IFsgcnVsZSBdO1xuICAgIHRoaXMucm91dGVzICAgICAgICAgICA9IFtdO1xuICAgIHRoaXMuY29udHJvbGxlcl9uYW1lcyA9IFtdO1xuICAgIC8vIGh0dHBzOi8vcmVnZXgxMDEuY29tL3IvZk00cE81LzFcbiAgICB0aGlzLnBhcmFtX3JlZ2V4ID0gL14oPzpbLS1dezJ9KC4pKXxePHw+JC9nbTtcbiAgfVxuXG4gIGFkZChwYXRobmFtZSwgY29udHJvbGxlciwgc3RhcnRBdCkge1xuICAgIHZhciByb3V0ZSA9IFJvdXRlci5tYXRjaCh0aGlzLnJvdXRlX3J1bGVzLCBwYXRobmFtZSwgc3RhcnRBdCk7XG5cbiAgICBpZiAocm91dGUpIHtcbiAgICAgIHZhciBjb250cm9sbGVyX25hbWUgPSByb3V0ZS5wYXJhbXMuY29udHJvbGxlcjtcbiAgICAgIGlmICghUi5pc05pbChjb250cm9sbGVyX25hbWUpICYmICFSLmNvbnRhaW5zKGNvbnRyb2xsZXJfbmFtZSkodGhpcy5jb250cm9sbGVyX25hbWVzKSkge1xuICAgICAgICB0aGlzLmNvbnRyb2xsZXJfbmFtZXMucHVzaChjb250cm9sbGVyX25hbWUpO1xuICAgICAgfVxuXG4gICAgICBjb250cm9sbGVyID0gY29udHJvbGxlciB8fCBwYXRobmFtZTtcblxuICAgICAgaWYgKHR5cGVvZiBjb250cm9sbGVyID09PSAnc3RyaW5nJykge1xuICAgICAgICByb3V0ZS5Db250cm9sbGVyID0gY29udHJvbGxlcjtcbiAgICAgIH0gZWxzZSBpZiAodHlwZW9mIGNvbnRyb2xsZXIgPT09ICdmdW5jdGlvbicpIHtcbiAgICAgICAgcm91dGUuZm4gPSBjb250cm9sbGVyO1xuICAgICAgfSBlbHNlIHtcbiA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gICAgIHJlc3VsdCA9IHRoaXMucm91dGVyLnJ1bihyZXN1bHQsIG9wdHMsIChvYmogfHwgdGhpcykpO1xuICAgIH1cblxuICAgIHJldHVybiByZXN1bHQ7XG4gIH1cbn1cbiJdLCJzb3VyY2VSb290IjoiL2NsaS1yb3V0ZXI6MC4wLjYvc3JjIn0=
{
"name": "cli-router",
"version": "0.0.6",
"version": "0.0.7",
"description": "cli-router",

@@ -5,0 +5,0 @@ "main": "index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc