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

cli-router

Package Overview
Dependencies
Maintainers
5
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.1.0 to 0.1.1

npm-shrinkwrap.json

2

lib/spec/cli_controller_spec.js

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

});
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImNsaV9jb250cm9sbGVyX3NwZWMuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7MEJBQWMsZUFBZTs7OztpQ0FFQyx1QkFBdUI7O0FBRXJELFFBQVEsQ0FBQyxzQkFBc0IsRUFBRSxZQUFXO0FBQzFDLElBQUUsQ0FBQywrQ0FBK0MsRUFBRSxZQUFXO1FBQ3ZELHdCQUF3QjtlQUF4Qix3QkFBd0I7OEJBQXhCLHdCQUF3Qjs7Ozs7OztnQkFBeEIsd0JBQXdCOzttQkFBeEIsd0JBQXdCOztlQUN2QixlQUFDLElBQUksRUFBRTtBQUNWLGlCQUFPLElBQUksQ0FBQyxDQUFDLENBQUMsQ0FBQztTQUNoQjs7O2VBRVksdUJBQUMsTUFBTSxFQUFFLElBQUksRUFBRTtBQUMxQixjQUFJLENBQUMsT0FBTyxDQUFDLFFBQVEsQ0FBQyxDQUFDO0FBQ3ZCLDRDQVBFLHdCQUF3QiwrQ0FPQyxNQUFNLEVBQUUsSUFBSSxFQUFFO1NBQzFDOzs7ZUFFVyxzQkFBQyxNQUFNLEVBQUUsTUFBTSxFQUFFO0FBQzNCLDRDQVhFLHdCQUF3Qiw4Q0FXQSxNQUFNLE9BQUssTUFBTSxpQkFBYztTQUMxRDs7O2FBWkcsd0JBQXdCOzBCQUp6QixhQUFhOztBQW1CbEIsUUFBSSxVQUFVLEdBQUcsSUFBSSx3QkFBd0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tcbiAgICAgICAgcmV0dXJuIHN1cGVyLmFmdGVyX2FjdGlvbihhY3Rpb24sIGAke3Jlc3VsdH0gYW5kIGFmdGVyYCk7XG4gICAgICB9XG4gICAgfVxuXG4gICAgdmFyIGNvbnRyb2xsZXIgPSBuZXcgQmVmb3JlQW5kQWZ0ZXJDb250cm9sbGVyKCk7XG4gICAgdmFyIHJlc3VsdCAgICAgPSBjb250cm9sbGVyLnJ1bl9hY3Rpb24oJ2luZGV4JywgWydub3Qgc2hvdyB0aGlzJ10pO1xuICAgIGguZXhwZWN0KHJlc3VsdCkudG8uZXFsKCdiZWZvcmUgYW5kIGFmdGVyJyk7XG4gIH0pO1xufSk7XG4iXSwic291cmNlUm9vdCI6Ii9jbGktcm91dGVyOjAuMS4wL3NwZWMifQ==

@@ -11,3 +11,2 @@ 'use strict';

var R = require('ramda');
var path = require('path');

@@ -21,177 +20,167 @@

it('shoud ordered src of routes', function () {
var cli_router = new _srcCli_router.CliRouter(controllers_root).add('/agent', function () {}).add('/agent/stop', function () {}).add('/start', function () {}).add('/stop', function () {});
var cli_router = new _srcCli_router.CliRouter(controllers_root).add('help', function (p) {
return p.help || p['--help'];
}).add('agent_start', function (p, args) {
return p.agent && args[1] === 'start';
}, 'agent.start').add('agent').add('start', null, function () {
var params = arguments[0] === undefined ? {} : arguments[0];
return 'start ' + params.system;
}).add('vm');
_specHelper2['default'].expect(cli_router.routes[0].params).to.eql({ controller: 'agent', action: undefined });
_specHelper2['default'].expect(cli_router.routes[1].params).to.eql({ controller: 'agent', action: 'stop' });
_specHelper2['default'].expect(cli_router.routes[2].params).to.eql({ controller: 'start', action: undefined });
_specHelper2['default'].expect(cli_router.routes[3].params).to.eql({ controller: 'stop', action: undefined });
});
describe('should ordered routes and check', function () {
it('controller', function () {
_specHelper2['default'].expect(cli_router.routes[0]).to.have.property('controller', 'help');
_specHelper2['default'].expect(cli_router.routes[1]).to.have.property('controller', 'agent');
_specHelper2['default'].expect(cli_router.routes[2]).to.have.property('controller', 'agent');
_specHelper2['default'].expect(cli_router.routes[3]).to.have.property('controller', undefined);
});
it('should route with agent controller', function () {
var action = '/agent';
var cli_router = new _srcCli_router.CliRouter(controllers_root).add(action);
it('actions', function () {
_specHelper2['default'].expect(cli_router.routes[0].actions).to.deep.eql([]);
_specHelper2['default'].expect(cli_router.routes[1].actions).to.deep.eql(['start']);
_specHelper2['default'].expect(cli_router.routes[2].actions).to.deep.eql([]);
_specHelper2['default'].expect(cli_router.routes[3].actions).to.deep.eql([]);
});
var params = cli_router.match(action).params;
var route = cli_router.findRouteByParams(params);
_specHelper2['default'].expect(route).to.have.deep.property('Controller');
_specHelper2['default'].expect(route).to.have.deep.property('params.controller', 'agent');
_specHelper2['default'].expect(route).to.have.deep.property('params.action', undefined);
it('fn', function () {
_specHelper2['default'].expect(cli_router.routes[0].fn).to.deep.eql(undefined);
_specHelper2['default'].expect(cli_router.routes[1].fn).to.deep.eql(undefined);
_specHelper2['default'].expect(cli_router.routes[2].fn).to.deep.eql(undefined);
_specHelper2['default'].expect(cli_router.routes[3].fn()).to.deep.eql((function () {
return 'start undefined';
})());
});
});
it('should route with agent controller and start action', function () {
var action = '/agent/start';
var cli_router = new _srcCli_router.CliRouter(controllers_root).add(action);
describe('should find route', function () {
it('agent to `agent` command', function () {
var command = 'agent';
var args = [command];
var params = {};
params[command] = true;
var route = cli_router.find(args, params);
var params = cli_router.match(action).params;
var route = cli_router.findRouteByParams(params);
_specHelper2['default'].expect(route).to.have.deep.property('name', command);
_specHelper2['default'].expect(route).to.have.deep.property('controller', command);
_specHelper2['default'].expect(route.actions).to.have.deep.eql([]);
});
_specHelper2['default'].expect(route).to.have.deep.property('params.controller', 'agent');
_specHelper2['default'].expect(route).to.have.deep.property('params.action', 'start');
});
it('agent_start to `agent start` command', function () {
var command = 'agent';
var args = [command, 'start'];
var params = { start: true };
params[command] = true;
var route = cli_router.find(args, params);
it('should fn result of route /agent', function () {
var action = '/agent';
var cli_router = new _srcCli_router.CliRouter(controllers_root).add(action);
var args = {
agent: true };
_specHelper2['default'].expect(route).to.have.deep.property('name', 'agent_start');
_specHelper2['default'].expect(route).to.have.deep.property('controller', command);
_specHelper2['default'].expect(route.actions).to.have.deep.eql(['start']);
});
var Controller = require(path.join(controllers_root, action));
var obj = new Controller();
var data = cli_router.controller(args);
var result = cli_router.getFn(data)();
it('help to `help` command', function () {
var command = 'help';
var args = [command];
var params = {};
params[command] = true;
var route = cli_router.find(args, params);
_specHelper2['default'].expect(result).to.eql(obj.index());
});
_specHelper2['default'].expect(route).to.have.deep.property('name', command);
_specHelper2['default'].expect(route).to.have.deep.property('controller', command);
_specHelper2['default'].expect(route.actions).to.have.deep.eql([]);
});
describe('run with options', function () {
var should_options = {
'--': false,
'--help': false,
'--log': false,
'--no-daemon': false,
'--open': false,
'--quiet': false,
'--rebuild': false,
'--reload-vm': false,
'--reprovision': false,
'--verbose': 0,
'--version': false,
'<ssh-options>': [],
'<system>': null,
'<to>': null,
agent: false,
help: false,
remove: false,
scale: false,
ssh: false,
start: false,
status: false,
stop: false,
vm: false
};
it('help to `agent --help` command', function () {
var command = 'agent';
var args = [command, '--help'];
var params = { '--help': true };
params[command] = true;
var route = cli_router.find(args, params);
it('should run `agent start demo`', function () {
var options = R.merge(should_options, {
agent: true,
start: true,
'<system>': 'demo'
});
var cli_router = new _srcCli_router.CliRouter(controllers_root).add('/agent').add('/start', function () {
return 'start';
});
_specHelper2['default'].expect(route).to.have.deep.property('name', 'help');
_specHelper2['default'].expect(route).to.have.deep.property('controller', 'help');
_specHelper2['default'].expect(route.actions).to.have.deep.eql([]);
});
var result = cli_router.run(options, controller_opts);
it('agent and get fn to `agent` command', function () {
var command = 'agent';
var args = [command];
var params = {};
params[command] = true;
var route = cli_router.find(args, params);
_specHelper2['default'].expect(result).to.eql('agent start demo');
});
var Controller = require(path.join(controllers_root, command));
var obj = new Controller();
var result = cli_router.getFn(route, args, { params: params })();
it('should run `agent start` with function', function () {
var options = R.merge(should_options, {
agent: true,
start: true
});
var cli_router = new _srcCli_router.CliRouter(controllers_root).add('/agent').add('/agent/start', function () {
return 'agent no start';
}).add('/start', function () {
return 'start';
});
var result = cli_router.run(options, controller_opts);
_specHelper2['default'].expect(result).to.eql('agent no start');
_specHelper2['default'].expect(result).to.eql(obj.index());
});
it('should run `system start` with function', function () {
var options = R.merge(should_options, {
system: true,
start: true });
var cli_router = new _srcCli_router.CliRouter(controllers_root).add('/system').add('/system/start', function () {
return 'system start';
}).add('/start', function () {
return 'start';
});
it('agent and call sub fn to `agent subagent subcommand` command', function () {
var command = 'agent';
var args = [command, 'subagent', 'subcommand'];
var params = {
subagent: true,
subcommand: true
};
params[command] = true;
var route = cli_router.find(args, params);
var result = cli_router.run(options, controller_opts);
_specHelper2['default'].expect(result).to.eql('system start');
});
var Controller = require(path.join(controllers_root, command));
var obj = new Controller();
var result = cli_router.getFn(route, args, { params: params })();
it('should run `vm ssh -- echo terminal`', function () {
var options = R.merge(should_options, {
'<ssh-options>': ['echo', 'terminal'],
vm: true,
ssh: true });
var cli_router = new _srcCli_router.CliRouter(controllers_root).add('/vm');
var result = cli_router.run(options, controller_opts);
_specHelper2['default'].expect(result).to.eql('echo terminal');
_specHelper2['default'].expect(result).to.eql(obj.subagent.subcommand());
});
});
it('should run `vm echo -- echo test` with function', function () {
var options = R.merge(should_options, {
'<ssh-options>': ['echo', 'test'],
vm: true,
echo: true });
var cli_router = new _srcCli_router.CliRouter(controllers_root).add('/vm/echo', function (params) {
return params['ssh-options'].join(' ');
});
describe('should run', function () {
it('`agent stop demo`', function () {
var args = ['agent', 'stop', 'demo'];
var params = {
agent: true,
stop: true,
'<system>': 'demo'
};
var result = cli_router.run(options, controller_opts);
_specHelper2['default'].expect(result).to.eql('echo test');
var result = cli_router.run(args, params, controller_opts);
_specHelper2['default'].expect(result).to.eql('agent stop demo');
});
});
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,
it('`agent start demo -v`', function () {
var args = ['agent', 'start', 'demo', '-v'];
var params = {
agent: true,
ssh: false,
start: true,
vm: false
'<system>': 'demo',
'--verbose': true
};
_specHelper2['default'].expect(cli_router.extractCommands(args)).to.eql(['agent', 'start']);
var result = cli_router.run(args, params, controller_opts);
_specHelper2['default'].expect(result).to.eql('agent start demo');
});
it('from args with multiple options', function () {
var args = { '--': false,
'--no-daemon': true,
'--quiet': false,
'--verbose': 0,
'--version': true,
agent: true,
ssh: false,
it('`start old -f`', function () {
var args = ['start', 'old', '-f'];
var params = {
start: true,
vm: false
'<system>': 'old',
'--force': true
};
_specHelper2['default'].expect(cli_router.extractCommands(args)).to.eql(['agent', 'start']);
var result = cli_router.run(args, params, controller_opts);
_specHelper2['default'].expect(result).to.eql('start old');
});
it('`vm ssh -- echo terminal`', function () {
var args = ['vm', 'ssh', '--', 'echo', 'terminal'];
var params = {
vm: true,
ssh: true,
'<ssh-options>': ['echo', 'terminal'] };
var result = cli_router.run(args, params, controller_opts);
_specHelper2['default'].expect(result).to.eql('echo terminal');
});
});
});
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImNsaV9yb3V0ZXJfc3BlYy5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7OzBCQUFjLGVBQWU7Ozs7NkJBQ0gsbUJBQW1COztBQUU3QyxJQUFJLENBQUMsR0FBTSxPQUFPLENBQUMsT0FBTyxDQUFDLENBQUM7QUFDNUIsSUFBSSxJQUFJLEdBQUcsT0FBTyxDQUFDLE1BQU0sQ0FBQyxDQUFDOztBQUUzQixRQUFRLENBQUMsa0JBQWtCLEVBQUUsWUFBVztBQUN0QyxNQUFJLGdCQUFnQixHQUFHLHdCQUFFLG9CQUFvQixDQUFDLGFBQWEsQ0FBQyxDQUFDO0FBQzdELE1BQUksZUFBZSxHQUFHO0FBQ3BCLE9BQUcsRUFBR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cmVzdWx0ID0gY2xpX3JvdXRlci5ydW4oYXJncywgcGFyYW1zLCBjb250cm9sbGVyX29wdHMpO1xuICAgICAgaC5leHBlY3QocmVzdWx0KS50by5lcWwoJ3N0YXJ0IG9sZCcpO1xuICAgIH0pO1xuXG4gICAgaXQoJ2B2bSBzc2ggLS0gZWNobyB0ZXJtaW5hbGAnLCBmdW5jdGlvbigpIHtcbiAgICAgIHZhciBhcmdzID0gWyd2bScsICdzc2gnLCAnLS0nLCAnZWNobycsICd0ZXJtaW5hbCddO1xuICAgICAgdmFyIHBhcmFtcyA9IHtcbiAgICAgICAgdm06IHRydWUsXG4gICAgICAgIHNzaDogdHJ1ZSxcbiAgICAgICAgJzxzc2gtb3B0aW9ucz4nOiBbJ2VjaG8nLCAndGVybWluYWwnXSxcbiAgICAgIH07XG5cbiAgICAgIHZhciByZXN1bHQgPSBjbGlfcm91dGVyLnJ1bihhcmdzLCBwYXJhbXMsIGNvbnRyb2xsZXJfb3B0cyk7XG4gICAgICBoLmV4cGVjdChyZXN1bHQpLnRvLmVxbCgnZWNobyB0ZXJtaW5hbCcpO1xuICAgIH0pO1xuICB9KTtcbn0pO1xuIl0sInNvdXJjZVJvb3QiOiIvY2xpLXJvdXRlcjowLjEuMC9zcGVjIn0=
'use strict';
var _get = function get(_x3, _x4, _x5) { var _again = true; _function: while (_again) { desc = parent = getter = undefined; _again = false; var object = _x3,
property = _x4,
receiver = _x5; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x3 = parent; _x4 = property; _x5 = 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); } } };
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; }; })();

@@ -11,5 +15,5 @@

var Agent = (function (_CliController) {
function Agent() {
_classCallCheck(this, Agent);
var SubAgent = (function (_CliController) {
function SubAgent() {
_classCallCheck(this, SubAgent);

@@ -21,4 +25,28 @@ if (_CliController != null) {

_inherits(Agent, _CliController);
_inherits(SubAgent, _CliController);
_createClass(SubAgent, [{
key: 'subcommand',
value: function subcommand() {
return 'subcommand';
}
}]);
return SubAgent;
})(_srcCli_controller.CliController);
var Agent = (function (_CliController2) {
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);
this.subagent = new SubAgent();
}
_inherits(Agent, _CliController2);
_createClass(Agent, [{

@@ -39,3 +67,5 @@ key: 'index',

value: function stop() {
return 'agent stop';
var params = arguments[0] === undefined ? {} : arguments[0];
return 'agent stop ' + params.system;
}

@@ -48,2 +78,2 @@ }]);

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

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

module.exports = VM;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImZpeHR1cmVzL2NvbnRyb2xsZXJzL3ZtLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7O2lDQUE4Qiw2QkFBNkI7O0lBRXJELEVBQUU7V0FBRixFQUFFOzBCQUFGLEVBQUU7Ozs7Ozs7WUFBRixFQUFFOztlQUFGLEVBQUU7O1dBQ0gsZUFBWTtVQUFYLE1BQU0sZ0NBQUMsRUFBRTs7QUFDWCxhQUFPLE1BQU0sQ0FBQyxhQUFhLENBQUMsQ0FBQyxJQUFJLENBQUMsR0FBRyxDQUFDLENBQUM7S0FDeEM7OztTQUhHLEVBQUU7c0JBRkMsYUFBYTs7QUFRdEIsTUFBTSxDQUFDLE9BQU8sR0FBRyxFQUFFLENBQUMiLCJmaWxlIjoiZml4dHVyZXMvY29udHJvbGxlcnMvdm0uanMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBDbGlDb250cm9sbGVyIH0gZnJvbSAnLi4vLi4vLi4vc3JjL2NsaV9jb250cm9sbGVyJztcblxuY2xhc3MgVk0gZXh0ZW5kcyBDbGlDb250cm9sbGVyIHtcbiAgc3NoKHBhcmFtcz17fSkge1xuICAgIHJldHVybiBwYXJhbXNbJ3NzaC1vcHRpb25zJ10uam9pbignICcpO1xuICB9XG59XG5cbm1vZHVsZS5leHBvcnRzID0gVk07XG4iXSwic291cmNlUm9vdCI6Ii9jbGktcm91dGVyOjAuMC4xMC9zcGVjIn0=
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImZpeHR1cmVzL2NvbnRyb2xsZXJzL3ZtLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7O2lDQUE4Qiw2QkFBNkI7O0lBRXJELEVBQUU7V0FBRixFQUFFOzBCQUFGLEVBQUU7Ozs7Ozs7WUFBRixFQUFFOztlQUFGLEVBQUU7O1dBQ0gsZUFBWTtVQUFYLE1BQU0sZ0NBQUMsRUFBRTs7QUFDWCxhQUFPLE1BQU0sQ0FBQyxhQUFhLENBQUMsQ0FBQyxJQUFJLENBQUMsR0FBRyxDQUFDLENBQUM7S0FDeEM7OztTQUhHLEVBQUU7c0JBRkMsYUFBYTs7QUFRdEIsTUFBTSxDQUFDLE9BQU8sR0FBRyxFQUFFLENBQUMiLCJmaWxlIjoiZml4dHVyZXMvY29udHJvbGxlcnMvdm0uanMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBDbGlDb250cm9sbGVyIH0gZnJvbSAnLi4vLi4vLi4vc3JjL2NsaV9jb250cm9sbGVyJztcblxuY2xhc3MgVk0gZXh0ZW5kcyBDbGlDb250cm9sbGVyIHtcbiAgc3NoKHBhcmFtcz17fSkge1xuICAgIHJldHVybiBwYXJhbXNbJ3NzaC1vcHRpb25zJ10uam9pbignICcpO1xuICB9XG59XG5cbm1vZHVsZS5leHBvcnRzID0gVk07XG4iXSwic291cmNlUm9vdCI6Ii9jbGktcm91dGVyOjAuMS4wL3NwZWMifQ==

@@ -60,7 +60,6 @@ 'use strict';

cli_options.path = _specHelper2['default'].fixture_path('usage.txt');
var cli = new TestCli(cli_options);
var doc_opts = { exit: false };
describe('without version', function () {
var cli = new TestCli(cli_options);
it('show options', function () {

@@ -70,6 +69,8 @@ doc_opts.argv = '--version';

var options = cli.docopt(doc_opts);
var result = cli.run(doc_opts);
var result = function result() {
return cli.run(doc_opts);
};
_specHelper2['default'].expect(options).to.have.property('--version', true);
_specHelper2['default'].expect(result).to.eql(undefined);
_specHelper2['default'].expect(result).to['throw'](Error, /Invalid route/);
});

@@ -95,3 +96,5 @@ });

var options = cli.docopt(doc_opts);
var result = cli.run(doc_opts);
var result = function result() {
return cli.run(doc_opts);
};

@@ -102,3 +105,3 @@ _specHelper2['default'].expect(options).to.eql({

help: false });
_specHelper2['default'].expect(result).to.eql(undefined);
_specHelper2['default'].expect(result).to['throw'](Error, /Invalid route/);
});

@@ -124,12 +127,13 @@

cli_options.path = _specHelper2['default'].fixture_path('usage_full.txt');
var cli = new TestCli(cli_options).route('agent');
var doc_opts = { exit: false };
it('should route /agent', function () {
var cli = new TestCli(cli_options).route('/agent');
it('should route agent', function () {
doc_opts.argv = ['agent', 'start'];
var result = cli.run(doc_opts, controller_opts);
_specHelper2['default'].expect(cli.routes[0].params).to.eql({ controller: 'agent', action: undefined });
_specHelper2['default'].expect(cli.routes[0]).to.have.property('controller', 'agent');
_specHelper2['default'].expect(cli.routes[0].actions).to.deep.eql([]);
_specHelper2['default'].expect(cli.routes[0].fn).to.deep.eql(undefined);
_specHelper2['default'].expect(result).to.eql('agent start null');

@@ -139,2 +143,2 @@ });

});
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImluZGV4X3NwZWMuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7MEJBQWMsZUFBZTs7OzttQkFFVCxRQUFROztJQUV0QixPQUFPO1dBQVAsT0FBTzswQkFBUCxPQUFPOzs7Ozs7O1lBQVAsT0FBTzs7ZUFBUCxPQUFPOztXQUNMLGtCQUFVO3dDQUFOLElBQUk7QUFBSixZQUFJOzs7QUFDWixVQUFJO0FBQ0YsMENBSEEsT0FBTyx5Q0FHZ0IsSUFBSSxFQUFFO09BQzlCLENBQUMsT0FBTyxDQUFDLEVBQUU7QUFDVixlQUFPLENBQUMsQ0FBQyxPQUFPLENBQUM7T0FDbEI7S0FDRjs7O1NBUEcsT0FBTztRQUZKLE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AgICB2YXIgZG9jX29wdHMgPSB7IGV4aXQ6IGZhbHNlIH07XG5cbiAgICBpdCgnc2hvdWxkIHJvdXRlIGFnZW50JywgZnVuY3Rpb24oKSB7XG4gICAgICBkb2Nfb3B0cy5hcmd2ID0gWydhZ2VudCcsICdzdGFydCddO1xuICAgICAgdmFyIHJlc3VsdCAgPSBjbGkucnVuKGRvY19vcHRzLCBjb250cm9sbGVyX29wdHMpO1xuXG4gICAgICBoLmV4cGVjdChjbGkucm91dGVzWzBdKS50by5oYXZlLnByb3BlcnR5KCdjb250cm9sbGVyJywgJ2FnZW50Jyk7XG4gICAgICBoLmV4cGVjdChjbGkucm91dGVzWzBdLmFjdGlvbnMpLnRvLmRlZXAuZXFsKFtdKTtcbiAgICAgIGguZXhwZWN0KGNsaS5yb3V0ZXNbMF0uZm4pLnRvLmRlZXAuZXFsKHVuZGVmaW5lZCk7XG4gICAgICBoLmV4cGVjdChyZXN1bHQpLnRvLmVxbCgnYWdlbnQgc3RhcnQgbnVsbCcpO1xuICAgIH0pO1xuICB9KTtcbn0pO1xuIl0sInNvdXJjZVJvb3QiOiIvY2xpLXJvdXRlcjowLjEuMC9zcGVjIn0=

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

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

@@ -11,2 +11,4 @@ 'use strict';

function _slicedToArray(arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i['return']) _i['return'](); } finally { if (_d) throw _e; } } return _arr; } else { throw new TypeError('Invalid attempt to destructure non-iterable instance'); } }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }

@@ -31,6 +33,7 @@

this.route_rules = [rule];
this.commands_limit = rule.keys.length;
this.routes = [];
this.controller_names = [];
// https://regex101.com/r/fM4pO5/2
this.param_regex = /^(?:[-_]{2})|^<|>$/gm;
// https://regex101.com/r/fM4pO5/3
this.param_regex = /^(?:[-_]{1,2})|^<|>$/gm;
}

@@ -40,32 +43,47 @@

key: 'add',
value: function add(pathname, controller, startAt) {
var route = _i402['default'].match(this.route_rules, pathname, startAt);
value: function add(name, filter, controller) {
if (R.isNil(name)) {
throw new Error('Route name not defined');
}
controller = controller || name;
var actions = [];
var fn;
if (R.is(Function, controller)) {
fn = controller;
controller = undefined;
} else if (/\./.test(controller)) {
actions = controller.split('.');
controller = actions.shift(0, 1);
}
filter = filter || controller || name;
if (route) {
var controller_name = route.params.controller;
if (!R.isNil(controller_name) && !R.contains(controller_name)(this.controller_names)) {
this.controller_names.push(controller_name);
var route = { name: name, controller: controller, actions: actions, filter: filter, fn: fn };
this.routes.push(route);
return this;
}
}, {
key: 'find',
value: function find(args, params) {
if (!R.is(Object, params)) {
throw new Error('Invalid type \'' + typeof params + '\' of arguments to filter: ' + params);
}
var route;
for (var i = 0; i < this.routes.length; i++) {
route = this.routes[i];
if (this.applyFilter(route, args, params)) {
break;
}
controller = controller || pathname;
if (typeof controller === 'string') {
route.Controller = controller;
} else if (typeof controller === 'function') {
route.fn = controller;
} else {
throw new Error(' route ' + pathname.toString() + ' requires a `controller`');
}
this.routes.push(route);
} else {
throw new Error(' invalid route ' + pathname.toString());
}
return this;
return route;
}
}, {
key: 'match',
value: function match(pathname, startAt) {
var params = _i402['default'].match(this.route_rules, pathname, startAt);
return params;
key: 'applyFilter',
value: function applyFilter(route, args, params) {
var filter = route.filter;
if (!R.is(Function, filter)) {
filter = function (p) {
return p[route.filter];
};
}
return !!filter(params, args);
}

@@ -78,49 +96,41 @@ }, {

}, {
key: 'findRoute',
value: function findRoute(controller, action) {
var routes = [];
for (var i = 0; i < this.routes.length; i++) {
if (this.routes[i].params.controller == controller && this.routes[i].params.action == action) {
routes.push(this.routes[i]);
}
}
return R.last(routes);
}
}, {
key: 'findRouteByParams',
value: function findRouteByParams(params) {
var route = this.findRoute(params.controller, params.action);
if (!route) {
route = this.findRoute(params.controller);
}
return route;
}
}, {
key: 'getFn',
value: function getFn(controller) {
var opts = arguments[1] === undefined ? {} : arguments[1];
value: function getFn(route, args) {
var _this = this;
controller = controller || {};
var route = controller.route;
var params = arguments[2] === undefined ? {} : arguments[2];
if (!R.is(Object, route) || !R.is(Object, route.params)) {
return;
if (!R.is(Object, route) || R.is(Object, route) && R.isNil(route.controller) && R.isNil(route.fn)) {
throw new Error('Invalid route or not contain controller or fn methods: ' + route);
}
route = R.clone(route);
var fn;
var params = route.params;
// Force camelcase actions
params.action = this._camelCase(params.action);
if (!R.isNil(route.controller)) {
// Force camelcase actions
var camelCases = function camelCases(arr) {
return R.map(function (action) {
return _this._camelCase(action);
}, arr || []);
};
var actions = R.unionWith(function (a, b) {
return a === b;
}, camelCases(route.actions), camelCases(args.slice(1)));
actions = !R.isEmpty(actions) ? actions : ['index'];
route.actions = R.clone(actions);
if (route.hasOwnProperty('Controller')) {
if (R.is(String, route.Controller)) {
route.Controller = this.loadController(route.Controller);
if (!route.hasOwnProperty('Controller')) {
route.Controller = this.loadController(route.controller);
}
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);
params = R.merge(params, {
name: route.name,
route: route });
var obj_to_call = new route.Controller(params);
var action = actions.pop();
var methods = actions.slice(0);
var method;
while (!R.isEmpty(methods)) {
method = methods.shift();
obj_to_call = obj_to_call[method];
}
fn = function () {

@@ -131,5 +141,5 @@ for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {

return obj.run_action.apply(obj, [params.action].concat(args));
return obj_to_call.run_action.apply(obj_to_call, [action].concat(args));
};
} else if (route.hasOwnProperty('fn')) {
} else if (!R.isNil(route.fn)) {
fn = route.fn;

@@ -140,27 +150,29 @@ }

}, {
key: 'extractCommands',
value: function extractCommands(args) {
var _this = this;
key: 'cleanArgs',
value: function cleanArgs(args, default_params) {
var _this2 = this;
var cmds = [];
for (var i = 0; i < this.controller_names.length; i++) {
var controller_name = this.controller_names[i];
if (args.hasOwnProperty(controller_name) && !!args[controller_name]) {
cmds.push(controller_name);
var inverted = R.invert(default_params);
var remove_arguments = function remove_arguments(arg) {
var value = R.head(inverted[arg] || []) || '';
if (!(arg.match(_this2.param_regex) || value.match(_this2.param_regex))) {
return arg;
}
};
var end_index = args.indexOf('--');
if (end_index === -1) {
end_index = args.length;
}
// 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);
var no_doubledash_args = args.slice(0, end_index);
args = R.filter(function (arg) {
return !R.isNil(arg);
}, R.map(remove_arguments, no_doubledash_args));
return [args, this.cleanParams(default_params)];
}
}, {
key: 'cleanArgs',
value: function cleanArgs(full_args) {
var args = {};
for (var key in full_args) {
var value = full_args[key];
key: 'cleanParams',
value: function cleanParams(default_params) {
var params = {};
for (var key in default_params) {
var value = default_params[key];
if (key === '--') {

@@ -171,24 +183,7 @@ key = '__doubledash';

}
args[key] = value;
params[key] = value;
}
return args;
return params;
}
}, {
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('/') + '/');
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: '_camelCase',

@@ -207,7 +202,15 @@

key: 'run',
value: function run(args, opts, obj) {
var controller = this.controller(args);
var fn = this.getFn(controller, opts);
value: function run(args, default_params, obj) {
var _cleanArgs = this.cleanArgs(args, default_params);
var _cleanArgs2 = _slicedToArray(_cleanArgs, 2);
var cargs = _cleanArgs2[0];
var params = _cleanArgs2[1];
var route = this.find(args, default_params);
var fn = this.getFn(route, cargs, { args: args, params: params, default_params: default_params });
if (R.is(Function, fn)) {
return fn(controller.args, obj || this);
return fn(params, obj || this);
}

@@ -221,2 +224,2 @@ }

exports.CliRouter = CliRouter;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImNsaV9yb3V0ZXIuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7O21CQUFtQixLQUFLOzs7O0FBRXhCLElBQUksQ0FBQyxHQUFNLE9BQU8sQ0FBQyxPQUFPLENBQUMsQ0FBQztBQUM1QixJQUFJLElBQUksR0FBRyxPQUFPLENBQUMsTUFBTSxDQUFDLENBQUM7O0lBRWQsU0FBUztBQUNULFdBREEsU0FBUyxDQUNSLGdCQUFnQixFQUFFLFdBQVcsRUFBRTswQkFEaEMsU0FBUzs7QUFFbEIsZUFBVyxHQUFHLFdBQVcsSUFBSSx1QkFBdUIsQ0FBQztBQUNyRCxRQUFJLENBQUMsZ0JBQWdCLEdBQUcsZ0JBQWdCLElBQUksSUFBSSxDQUFDOztBQUVqRCxRQUFJLElBQUksR0FBRyxpQkFBTyxLQUFLLENBQUMsV0FBVyxFQUFFLENBQUMsQ0FBQyxDQUFDOztBQUV4QyxRQUFJLENBQUMsV0FBVyxHQUFRLENBQUUsSUFBSSxDQUFFLENBQUM7QUFDakMsUUFBSSxDQUFD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HViLmNvbS9zdWJzdGFjay9jYW1lbGl6ZS9ibG9iL21hc3Rlci9pbmRleC5qcyNMMTctTDIxXG4gIF9jYW1lbENhc2Uoc3RyKSB7XG4gICAgaWYgKCFSLmlzTmlsKHN0cikpIHtcbiAgICAgIHN0ciA9IHN0ci5yZXBsYWNlKC9bXy4tXShcXHd8JCkvZywgZnVuY3Rpb24gKF8sIHgpIHtcbiAgICAgICAgcmV0dXJuIHgudG9VcHBlckNhc2UoKTtcbiAgICAgIH0pO1xuICAgIH1cbiAgICByZXR1cm4gc3RyO1xuICB9XG5cbiAgcnVuKGFyZ3MsIGRlZmF1bHRfcGFyYW1zLCBvYmopIHtcbiAgICB2YXIgW2NhcmdzLCBwYXJhbXNdID0gdGhpcy5jbGVhbkFyZ3MoYXJncywgZGVmYXVsdF9wYXJhbXMpO1xuICAgIHZhciByb3V0ZSA9IHRoaXMuZmluZChhcmdzLCBkZWZhdWx0X3BhcmFtcyk7XG4gICAgdmFyIGZuICAgID0gdGhpcy5nZXRGbihyb3V0ZSwgY2FyZ3MsIHsgYXJncywgcGFyYW1zLCBkZWZhdWx0X3BhcmFtcyB9KTtcblxuICAgIGlmIChSLmlzKEZ1bmN0aW9uLCBmbikpIHtcbiAgICAgIHJldHVybiBmbihwYXJhbXMsIChvYmogfHwgdGhpcykpO1xuICAgIH1cbiAgfVxufVxuIl0sInNvdXJjZVJvb3QiOiIvY2xpLXJvdXRlcjowLjEuMC9zcmMifQ==

@@ -79,5 +79,4 @@ 'use strict';

var result = this.docopt(args);
if (typeof result !== 'string') {
result = this.router.run(result, opts, obj || this);
result = this.router.run(args.argv, result, obj || this);
}

@@ -93,2 +92,2 @@

exports.Cli = Cli;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImluZGV4LmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7MEJBQTBCLGNBQWM7O0FBRXhDLElBQUksRUFBRSxHQU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iaikge1xuICAgIGlmIChBcnJheS5pc0FycmF5KGFyZ3MpIHx8IHR5cGVvZiBhcmdzID09PSAnc3RyaW5nJykge1xuICAgICAgYXJncyA9IHsgYXJndjogYXJncyB9O1xuICAgIH1cbiAgICB2YXIgcmVzdWx0ID0gdGhpcy5kb2NvcHQoYXJncyk7XG4gICAgaWYgKHR5cGVvZiByZXN1bHQgIT09ICdzdHJpbmcnKSB7XG4gICAgICByZXN1bHQgPSB0aGlzLnJvdXRlci5ydW4oYXJncy5hcmd2LCByZXN1bHQsIChvYmogfHwgdGhpcykpO1xuICAgIH1cblxuICAgIHJldHVybiByZXN1bHQ7XG4gIH1cbn1cbiJdLCJzb3VyY2VSb290IjoiL2NsaS1yb3V0ZXI6MC4xLjAvc3JjIn0=
{
"name": "cli-router",
"version": "0.1.0",
"version": "0.1.1",
"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