mirror of
https://github.com/balena-io/balena-cli.git
synced 2024-12-20 22:23:07 +00:00
commit
ffa645f85c
@ -3,6 +3,10 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
This project adheres to [Semantic Versioning](http://semver.org/).
|
||||
|
||||
### Changed
|
||||
|
||||
- Moved to the new version of `resin-sdk` (via `resin-sdk-preconfigured`)
|
||||
|
||||
## [5.2.4] - 2017-01-18
|
||||
|
||||
### Changed
|
||||
|
@ -37,7 +37,7 @@ limitations under the License.
|
||||
primary: true,
|
||||
action: function(params, options, done) {
|
||||
var patterns, resin;
|
||||
resin = require('resin-sdk');
|
||||
resin = require('resin-sdk-preconfigured');
|
||||
patterns = require('../utils/patterns');
|
||||
return resin.models.application.has(params.name).then(function(hasApplication) {
|
||||
if (hasApplication) {
|
||||
@ -61,7 +61,7 @@ limitations under the License.
|
||||
primary: true,
|
||||
action: function(params, options, done) {
|
||||
var resin, visuals;
|
||||
resin = require('resin-sdk');
|
||||
resin = require('resin-sdk-preconfigured');
|
||||
visuals = require('resin-cli-visuals');
|
||||
return resin.models.application.getAll().then(function(applications) {
|
||||
return console.log(visuals.table.horizontal(applications, ['id', 'app_name', 'device_type', 'online_devices', 'devices_length']));
|
||||
@ -77,7 +77,7 @@ limitations under the License.
|
||||
primary: true,
|
||||
action: function(params, options, done) {
|
||||
var resin, visuals;
|
||||
resin = require('resin-sdk');
|
||||
resin = require('resin-sdk-preconfigured');
|
||||
visuals = require('resin-cli-visuals');
|
||||
return resin.models.application.get(params.name).then(function(application) {
|
||||
return console.log(visuals.table.vertical(application, ["$" + application.app_name + "$", 'id', 'device_type', 'git_repository', 'commit']));
|
||||
@ -92,7 +92,7 @@ limitations under the License.
|
||||
permission: 'user',
|
||||
action: function(params, options, done) {
|
||||
var resin;
|
||||
resin = require('resin-sdk');
|
||||
resin = require('resin-sdk-preconfigured');
|
||||
return resin.models.application.restart(params.name).nodeify(done);
|
||||
}
|
||||
};
|
||||
@ -105,7 +105,7 @@ limitations under the License.
|
||||
permission: 'user',
|
||||
action: function(params, options, done) {
|
||||
var patterns, resin;
|
||||
resin = require('resin-sdk');
|
||||
resin = require('resin-sdk-preconfigured');
|
||||
patterns = require('../utils/patterns');
|
||||
return patterns.confirm(options.yes, 'Are you sure you want to delete the application?').then(function() {
|
||||
return resin.models.application.remove(params.name);
|
||||
|
@ -55,7 +55,7 @@ limitations under the License.
|
||||
_ = require('lodash');
|
||||
Promise = require('bluebird');
|
||||
capitano = Promise.promisifyAll(require('capitano'));
|
||||
resin = require('resin-sdk');
|
||||
resin = require('resin-sdk-preconfigured');
|
||||
auth = require('resin-cli-auth');
|
||||
form = require('resin-cli-form');
|
||||
patterns = require('../utils/patterns');
|
||||
@ -104,7 +104,7 @@ limitations under the License.
|
||||
permission: 'user',
|
||||
action: function(params, options, done) {
|
||||
var resin;
|
||||
resin = require('resin-sdk');
|
||||
resin = require('resin-sdk-preconfigured');
|
||||
return resin.auth.logout().nodeify(done);
|
||||
}
|
||||
};
|
||||
@ -115,7 +115,7 @@ limitations under the License.
|
||||
help: 'Use this command to signup for a resin.io account.\n\nIf signup is successful, you\'ll be logged in to your new user automatically.\n\nExamples:\n\n $ resin signup\n Email: me@mycompany.com\n Username: johndoe\n Password: ***********\n\n $ resin whoami\n johndoe',
|
||||
action: function(params, options, done) {
|
||||
var form, resin, validation;
|
||||
resin = require('resin-sdk');
|
||||
resin = require('resin-sdk-preconfigured');
|
||||
form = require('resin-cli-form');
|
||||
validation = require('../utils/validation');
|
||||
return resin.settings.get('resinUrl').then(function(resinUrl) {
|
||||
@ -149,7 +149,7 @@ limitations under the License.
|
||||
action: function(params, options, done) {
|
||||
var Promise, resin, visuals;
|
||||
Promise = require('bluebird');
|
||||
resin = require('resin-sdk');
|
||||
resin = require('resin-sdk-preconfigured');
|
||||
visuals = require('resin-cli-visuals');
|
||||
return Promise.props({
|
||||
username: resin.auth.whoami(),
|
||||
|
@ -210,7 +210,7 @@ limitations under the License.
|
||||
var Promise, _, deviceConfig, form, fs, prettyjson, resin;
|
||||
Promise = require('bluebird');
|
||||
fs = Promise.promisifyAll(require('fs'));
|
||||
resin = require('resin-sdk');
|
||||
resin = require('resin-sdk-preconfigured');
|
||||
_ = require('lodash');
|
||||
form = require('resin-cli-form');
|
||||
deviceConfig = require('resin-device-config');
|
||||
|
@ -32,7 +32,7 @@ limitations under the License.
|
||||
var Promise, _, resin, visuals;
|
||||
Promise = require('bluebird');
|
||||
_ = require('lodash');
|
||||
resin = require('resin-sdk');
|
||||
resin = require('resin-sdk-preconfigured');
|
||||
visuals = require('resin-cli-visuals');
|
||||
return Promise["try"](function() {
|
||||
if (options.application != null) {
|
||||
@ -57,7 +57,7 @@ limitations under the License.
|
||||
primary: true,
|
||||
action: function(params, options, done) {
|
||||
var resin, visuals;
|
||||
resin = require('resin-sdk');
|
||||
resin = require('resin-sdk-preconfigured');
|
||||
visuals = require('resin-cli-visuals');
|
||||
return resin.models.device.get(params.uuid).then(function(device) {
|
||||
return resin.models.device.getStatus(device).then(function(status) {
|
||||
@ -75,7 +75,7 @@ limitations under the License.
|
||||
permission: 'user',
|
||||
action: function(params, options, done) {
|
||||
var resin;
|
||||
resin = require('resin-sdk');
|
||||
resin = require('resin-sdk-preconfigured');
|
||||
return resin.models.config.getDeviceTypes().each(function(deviceType) {
|
||||
return console.log(deviceType.slug);
|
||||
}).nodeify(done);
|
||||
@ -98,10 +98,10 @@ limitations under the License.
|
||||
action: function(params, options, done) {
|
||||
var Promise, resin;
|
||||
Promise = require('bluebird');
|
||||
resin = require('resin-sdk');
|
||||
resin = require('resin-sdk-preconfigured');
|
||||
return resin.models.application.get(params.application).then(function(application) {
|
||||
return Promise["try"](function() {
|
||||
return options.uuid || resin.models.device.generateUUID();
|
||||
return options.uuid || resin.models.device.generateUniqueKey();
|
||||
}).then(function(uuid) {
|
||||
console.info("Registering to " + application.app_name + ": " + uuid);
|
||||
return resin.models.device.register(application.app_name, uuid);
|
||||
@ -118,7 +118,7 @@ limitations under the License.
|
||||
permission: 'user',
|
||||
action: function(params, options, done) {
|
||||
var patterns, resin;
|
||||
resin = require('resin-sdk');
|
||||
resin = require('resin-sdk-preconfigured');
|
||||
patterns = require('../utils/patterns');
|
||||
return patterns.confirm(options.yes, 'Are you sure you want to delete the device?').then(function() {
|
||||
return resin.models.device.remove(params.uuid);
|
||||
@ -133,7 +133,7 @@ limitations under the License.
|
||||
permission: 'user',
|
||||
action: function(params, options, done) {
|
||||
var resin;
|
||||
resin = require('resin-sdk');
|
||||
resin = require('resin-sdk-preconfigured');
|
||||
return resin.models.device.identify(params.uuid).nodeify(done);
|
||||
}
|
||||
};
|
||||
@ -146,7 +146,7 @@ limitations under the License.
|
||||
permission: 'user',
|
||||
action: function(params, options, done) {
|
||||
var resin;
|
||||
resin = require('resin-sdk');
|
||||
resin = require('resin-sdk-preconfigured');
|
||||
return resin.models.device.reboot(params.uuid, options).nodeify(done);
|
||||
}
|
||||
};
|
||||
@ -159,7 +159,7 @@ limitations under the License.
|
||||
permission: 'user',
|
||||
action: function(params, options, done) {
|
||||
var resin;
|
||||
resin = require('resin-sdk');
|
||||
resin = require('resin-sdk-preconfigured');
|
||||
return resin.models.device.shutdown(params.uuid, options).nodeify(done);
|
||||
}
|
||||
};
|
||||
@ -171,7 +171,7 @@ limitations under the License.
|
||||
permission: 'user',
|
||||
action: function(params, options, done) {
|
||||
var resin;
|
||||
resin = require('resin-sdk');
|
||||
resin = require('resin-sdk-preconfigured');
|
||||
return resin.models.device.enableDeviceUrl(params.uuid).nodeify(done);
|
||||
}
|
||||
};
|
||||
@ -183,7 +183,7 @@ limitations under the License.
|
||||
permission: 'user',
|
||||
action: function(params, options, done) {
|
||||
var resin;
|
||||
resin = require('resin-sdk');
|
||||
resin = require('resin-sdk-preconfigured');
|
||||
return resin.models.device.disableDeviceUrl(params.uuid).nodeify(done);
|
||||
}
|
||||
};
|
||||
@ -195,7 +195,7 @@ limitations under the License.
|
||||
permission: 'user',
|
||||
action: function(params, options, done) {
|
||||
var resin;
|
||||
resin = require('resin-sdk');
|
||||
resin = require('resin-sdk-preconfigured');
|
||||
return resin.models.device.getDeviceUrl(params.uuid).then(function(url) {
|
||||
return console.log(url);
|
||||
}).nodeify(done);
|
||||
@ -209,7 +209,7 @@ limitations under the License.
|
||||
permission: 'user',
|
||||
action: function(params, options, done) {
|
||||
var resin;
|
||||
resin = require('resin-sdk');
|
||||
resin = require('resin-sdk-preconfigured');
|
||||
return resin.models.device.hasDeviceUrl(params.uuid).then(function(hasDeviceUrl) {
|
||||
return console.log(hasDeviceUrl);
|
||||
}).nodeify(done);
|
||||
@ -225,7 +225,7 @@ limitations under the License.
|
||||
var Promise, _, form, resin;
|
||||
Promise = require('bluebird');
|
||||
_ = require('lodash');
|
||||
resin = require('resin-sdk');
|
||||
resin = require('resin-sdk-preconfigured');
|
||||
form = require('resin-cli-form');
|
||||
return Promise["try"](function() {
|
||||
if (!_.isEmpty(params.newName)) {
|
||||
@ -247,7 +247,7 @@ limitations under the License.
|
||||
options: [commandOptions.optionalApplication],
|
||||
action: function(params, options, done) {
|
||||
var _, patterns, resin;
|
||||
resin = require('resin-sdk');
|
||||
resin = require('resin-sdk-preconfigured');
|
||||
_ = require('lodash');
|
||||
patterns = require('../utils/patterns');
|
||||
return resin.models.device.get(params.uuid).then(function(device) {
|
||||
@ -282,7 +282,7 @@ limitations under the License.
|
||||
rimraf = Promise.promisify(require('rimraf'));
|
||||
tmp = Promise.promisifyAll(require('tmp'));
|
||||
tmp.setGracefulCleanup();
|
||||
resin = require('resin-sdk');
|
||||
resin = require('resin-sdk-preconfigured');
|
||||
helpers = require('../utils/helpers');
|
||||
patterns = require('../utils/patterns');
|
||||
return Promise["try"](function() {
|
||||
|
@ -1,87 +0,0 @@
|
||||
|
||||
/*
|
||||
Copyright 2016 Resin.io
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
(function() {
|
||||
var getSubShellCommand;
|
||||
|
||||
getSubShellCommand = function(command) {
|
||||
var os;
|
||||
os = require('os');
|
||||
if (os.platform() === 'win32') {
|
||||
return {
|
||||
program: 'sh',
|
||||
args: ['-c', command]
|
||||
};
|
||||
} else {
|
||||
return {
|
||||
program: '/bin/sh',
|
||||
args: ['-c', command]
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
signature: 'enter <uuid>',
|
||||
description: '(beta) get a shell into the running app container of a device',
|
||||
help: 'Use this command to get a shell into the running application container of\nyour device.\n\nExamples:\n\n $ resin enter 7cf02a6\n $ resin enter 7cf02a6 --port 8080',
|
||||
permission: 'user',
|
||||
primary: true,
|
||||
options: [
|
||||
{
|
||||
signature: 'port',
|
||||
parameter: 'port',
|
||||
description: 'ssh port',
|
||||
alias: 't'
|
||||
}
|
||||
],
|
||||
action: function(params, options, done) {
|
||||
var Promise, child_process, resin, settings;
|
||||
child_process = require('child_process');
|
||||
Promise = require('bluebird');
|
||||
resin = require('resin-sdk');
|
||||
settings = require('resin-settings-client');
|
||||
if (options.port == null) {
|
||||
options.port = 22;
|
||||
}
|
||||
console.info("Connecting with: " + params.uuid);
|
||||
return Promise.props({
|
||||
isOnline: resin.models.device.isOnline(params.uuid),
|
||||
username: resin.auth.whoami(),
|
||||
uuid: resin.models.device.get(params.uuid).get('uuid'),
|
||||
containerId: resin.models.device.getApplicationInfo(params.uuid).get('containerId')
|
||||
}).then(function(arg) {
|
||||
var containerId, isOnline, username, uuid;
|
||||
isOnline = arg.isOnline, username = arg.username, uuid = arg.uuid, containerId = arg.containerId;
|
||||
if (!isOnline) {
|
||||
throw new Error('Device is not online');
|
||||
}
|
||||
if (containerId == null) {
|
||||
throw new Error('Did not find running application container');
|
||||
}
|
||||
return Promise["try"](function() {
|
||||
var command, spawn, subShellCommand;
|
||||
command = "ssh -t -p " + options.port + " " + username + "@" + (settings.get('proxyUrl')) + " enter " + uuid + " " + containerId;
|
||||
subShellCommand = getSubShellCommand(command);
|
||||
return spawn = child_process.spawn(subShellCommand.program, subShellCommand.args, {
|
||||
stdio: 'inherit'
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
}).call(this);
|
@ -38,7 +38,7 @@ limitations under the License.
|
||||
var Promise, _, resin, visuals;
|
||||
Promise = require('bluebird');
|
||||
_ = require('lodash');
|
||||
resin = require('resin-sdk');
|
||||
resin = require('resin-sdk-preconfigured');
|
||||
visuals = require('resin-cli-visuals');
|
||||
return Promise["try"](function() {
|
||||
if (options.application != null) {
|
||||
@ -70,7 +70,7 @@ limitations under the License.
|
||||
permission: 'user',
|
||||
action: function(params, options, done) {
|
||||
var patterns, resin;
|
||||
resin = require('resin-sdk');
|
||||
resin = require('resin-sdk-preconfigured');
|
||||
patterns = require('../utils/patterns');
|
||||
return patterns.confirm(options.yes, 'Are you sure you want to delete the environment variable?').then(function() {
|
||||
if (options.device) {
|
||||
@ -91,7 +91,7 @@ limitations under the License.
|
||||
action: function(params, options, done) {
|
||||
var Promise, resin;
|
||||
Promise = require('bluebird');
|
||||
resin = require('resin-sdk');
|
||||
resin = require('resin-sdk-preconfigured');
|
||||
return Promise["try"](function() {
|
||||
if (params.value == null) {
|
||||
params.value = process.env[params.key];
|
||||
@ -121,7 +121,7 @@ limitations under the License.
|
||||
action: function(params, options, done) {
|
||||
var Promise, resin;
|
||||
Promise = require('bluebird');
|
||||
resin = require('resin-sdk');
|
||||
resin = require('resin-sdk-preconfigured');
|
||||
return Promise["try"](function() {
|
||||
if (options.device) {
|
||||
return resin.models.environmentVariables.device.update(params.id, params.value);
|
||||
|
@ -28,7 +28,7 @@ limitations under the License.
|
||||
permission: 'user',
|
||||
action: function(params, options, done) {
|
||||
var resin, visuals;
|
||||
resin = require('resin-sdk');
|
||||
resin = require('resin-sdk-preconfigured');
|
||||
visuals = require('resin-cli-visuals');
|
||||
return resin.models.key.getAll().then(function(keys) {
|
||||
return console.log(visuals.table.horizontal(keys, ['id', 'title']));
|
||||
@ -43,7 +43,7 @@ limitations under the License.
|
||||
permission: 'user',
|
||||
action: function(params, options, done) {
|
||||
var resin, visuals;
|
||||
resin = require('resin-sdk');
|
||||
resin = require('resin-sdk-preconfigured');
|
||||
visuals = require('resin-cli-visuals');
|
||||
return resin.models.key.get(params.id).then(function(key) {
|
||||
console.log(visuals.table.vertical(key, ['id', 'title']));
|
||||
@ -60,7 +60,7 @@ limitations under the License.
|
||||
permission: 'user',
|
||||
action: function(params, options, done) {
|
||||
var patterns, resin;
|
||||
resin = require('resin-sdk');
|
||||
resin = require('resin-sdk-preconfigured');
|
||||
patterns = require('../utils/patterns');
|
||||
return patterns.confirm(options.yes, 'Are you sure you want to delete the key?').then(function() {
|
||||
return resin.models.key.remove(params.id);
|
||||
@ -79,7 +79,7 @@ limitations under the License.
|
||||
Promise = require('bluebird');
|
||||
fs = Promise.promisifyAll(require('fs'));
|
||||
capitano = require('capitano');
|
||||
resin = require('resin-sdk');
|
||||
resin = require('resin-sdk-preconfigured');
|
||||
return Promise["try"](function() {
|
||||
if (params.path != null) {
|
||||
return fs.readFileAsync(params.path, {
|
||||
|
@ -34,7 +34,7 @@ limitations under the License.
|
||||
action: function(params, options, done) {
|
||||
var _, moment, printLine, promise, resin;
|
||||
_ = require('lodash');
|
||||
resin = require('resin-sdk');
|
||||
resin = require('resin-sdk-preconfigured');
|
||||
moment = require('moment');
|
||||
printLine = function(line) {
|
||||
var timestamp;
|
||||
|
@ -35,7 +35,7 @@ limitations under the License.
|
||||
var Promise, _, resin;
|
||||
Promise = require('bluebird');
|
||||
_ = require('lodash');
|
||||
resin = require('resin-sdk');
|
||||
resin = require('resin-sdk-preconfigured');
|
||||
return Promise["try"](function() {
|
||||
if (_.isEmpty(params.note)) {
|
||||
throw new Error('Missing note content');
|
||||
|
@ -106,7 +106,7 @@ limitations under the License.
|
||||
action: function(params, options, done) {
|
||||
var _, form, helpers, init, resin;
|
||||
_ = require('lodash');
|
||||
resin = require('resin-sdk');
|
||||
resin = require('resin-sdk-preconfigured');
|
||||
form = require('resin-cli-form');
|
||||
init = require('resin-device-init');
|
||||
helpers = require('../utils/helpers');
|
||||
|
@ -23,7 +23,7 @@ limitations under the License.
|
||||
help: 'Use this command to display detected settings\n\nExamples:\n\n $ resin settings',
|
||||
action: function(params, options, done) {
|
||||
var prettyjson, resin;
|
||||
resin = require('resin-sdk');
|
||||
resin = require('resin-sdk-preconfigured');
|
||||
prettyjson = require('prettyjson');
|
||||
return resin.settings.getAll().then(prettyjson.render).then(console.log).nodeify(done);
|
||||
}
|
||||
|
@ -58,7 +58,7 @@ limitations under the License.
|
||||
var Promise, child_process, patterns, resin, settings, verbose;
|
||||
child_process = require('child_process');
|
||||
Promise = require('bluebird');
|
||||
resin = require('resin-sdk');
|
||||
resin = require('resin-sdk-preconfigured');
|
||||
settings = require('resin-settings-client');
|
||||
patterns = require('../utils/patterns');
|
||||
if (options.port == null) {
|
||||
|
@ -101,7 +101,7 @@ limitations under the License.
|
||||
var Promise, fs, path, patterns, resin, resinSync;
|
||||
fs = require('fs');
|
||||
path = require('path');
|
||||
resin = require('resin-sdk');
|
||||
resin = require('resin-sdk-preconfigured');
|
||||
Promise = require('bluebird');
|
||||
resinSync = require('resin-sync');
|
||||
patterns = require('../utils/patterns');
|
||||
|
@ -26,7 +26,7 @@ limitations under the License.
|
||||
var Promise, capitano, patterns, resin;
|
||||
Promise = require('bluebird');
|
||||
capitano = Promise.promisifyAll(require('capitano'));
|
||||
resin = require('resin-sdk');
|
||||
resin = require('resin-sdk-preconfigured');
|
||||
patterns = require('../utils/patterns');
|
||||
return resin.auth.isLoggedIn().then(function(isLoggedIn) {
|
||||
if (isLoggedIn) {
|
||||
|
@ -25,7 +25,7 @@ limitations under the License.
|
||||
|
||||
capitano = Promise.promisifyAll(require('capitano'));
|
||||
|
||||
resin = require('resin-sdk');
|
||||
resin = require('resin-sdk-preconfigured');
|
||||
|
||||
actions = require('./actions');
|
||||
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
Promise = require('bluebird');
|
||||
|
||||
resin = require('resin-sdk');
|
||||
resin = require('resin-sdk-preconfigured');
|
||||
|
||||
capitanoState = Promise.promisifyAll(require('capitano').state);
|
||||
|
||||
|
19
build/resin-sdk.js
Normal file
19
build/resin-sdk.js
Normal file
@ -0,0 +1,19 @@
|
||||
// Generated by CoffeeScript 1.12.2
|
||||
(function() {
|
||||
var getSdk, opts, settings;
|
||||
|
||||
getSdk = require('resin-sdk');
|
||||
|
||||
settings = require('resin-settings-client');
|
||||
|
||||
opts = {
|
||||
apiUrl: settings.get('apiUrl'),
|
||||
imageMakerUrl: settings.get('imageMakerUrl'),
|
||||
dataDirectory: settings.get('dataDirectory'),
|
||||
apiVersion: 'v2',
|
||||
retries: 2
|
||||
};
|
||||
|
||||
module.exports = getSdk(opts);
|
||||
|
||||
}).call(this);
|
@ -29,7 +29,7 @@ limitations under the License.
|
||||
|
||||
president = Promise.promisifyAll(require('president'));
|
||||
|
||||
resin = require('resin-sdk');
|
||||
resin = require('resin-sdk-preconfigured');
|
||||
|
||||
imagefs = require('resin-image-fs');
|
||||
|
||||
|
@ -28,7 +28,7 @@ limitations under the License.
|
||||
|
||||
visuals = require('resin-cli-visuals');
|
||||
|
||||
resin = require('resin-sdk');
|
||||
resin = require('resin-sdk-preconfigured');
|
||||
|
||||
chalk = require('chalk');
|
||||
|
||||
|
@ -45,7 +45,7 @@ exports.create =
|
||||
permission: 'user'
|
||||
primary: true
|
||||
action: (params, options, done) ->
|
||||
resin = require('resin-sdk')
|
||||
resin = require('resin-sdk-preconfigured')
|
||||
patterns = require('../utils/patterns')
|
||||
|
||||
# Validate the the application name is available
|
||||
@ -79,7 +79,7 @@ exports.list =
|
||||
permission: 'user'
|
||||
primary: true
|
||||
action: (params, options, done) ->
|
||||
resin = require('resin-sdk')
|
||||
resin = require('resin-sdk-preconfigured')
|
||||
visuals = require('resin-cli-visuals')
|
||||
|
||||
resin.models.application.getAll().then (applications) ->
|
||||
@ -105,7 +105,7 @@ exports.info =
|
||||
permission: 'user'
|
||||
primary: true
|
||||
action: (params, options, done) ->
|
||||
resin = require('resin-sdk')
|
||||
resin = require('resin-sdk-preconfigured')
|
||||
visuals = require('resin-cli-visuals')
|
||||
|
||||
resin.models.application.get(params.name).then (application) ->
|
||||
@ -130,7 +130,7 @@ exports.restart =
|
||||
'''
|
||||
permission: 'user'
|
||||
action: (params, options, done) ->
|
||||
resin = require('resin-sdk')
|
||||
resin = require('resin-sdk-preconfigured')
|
||||
resin.models.application.restart(params.name).nodeify(done)
|
||||
|
||||
exports.remove =
|
||||
@ -150,7 +150,7 @@ exports.remove =
|
||||
options: [ commandOptions.yes ]
|
||||
permission: 'user'
|
||||
action: (params, options, done) ->
|
||||
resin = require('resin-sdk')
|
||||
resin = require('resin-sdk-preconfigured')
|
||||
patterns = require('../utils/patterns')
|
||||
|
||||
patterns.confirm(options.yes, 'Are you sure you want to delete the application?').then ->
|
||||
|
@ -74,7 +74,7 @@ exports.login =
|
||||
_ = require('lodash')
|
||||
Promise = require('bluebird')
|
||||
capitano = Promise.promisifyAll(require('capitano'))
|
||||
resin = require('resin-sdk')
|
||||
resin = require('resin-sdk-preconfigured')
|
||||
auth = require('resin-cli-auth')
|
||||
form = require('resin-cli-form')
|
||||
patterns = require('../utils/patterns')
|
||||
@ -136,7 +136,7 @@ exports.logout =
|
||||
'''
|
||||
permission: 'user'
|
||||
action: (params, options, done) ->
|
||||
resin = require('resin-sdk')
|
||||
resin = require('resin-sdk-preconfigured')
|
||||
resin.auth.logout().nodeify(done)
|
||||
|
||||
exports.signup =
|
||||
@ -158,7 +158,7 @@ exports.signup =
|
||||
johndoe
|
||||
'''
|
||||
action: (params, options, done) ->
|
||||
resin = require('resin-sdk')
|
||||
resin = require('resin-sdk-preconfigured')
|
||||
form = require('resin-cli-form')
|
||||
validation = require('../utils/validation')
|
||||
|
||||
@ -198,7 +198,7 @@ exports.whoami =
|
||||
permission: 'user'
|
||||
action: (params, options, done) ->
|
||||
Promise = require('bluebird')
|
||||
resin = require('resin-sdk')
|
||||
resin = require('resin-sdk-preconfigured')
|
||||
visuals = require('resin-cli-visuals')
|
||||
|
||||
Promise.props
|
||||
|
@ -242,7 +242,7 @@ exports.generate =
|
||||
action: (params, options, done) ->
|
||||
Promise = require('bluebird')
|
||||
fs = Promise.promisifyAll(require('fs'))
|
||||
resin = require('resin-sdk')
|
||||
resin = require('resin-sdk-preconfigured')
|
||||
_ = require('lodash')
|
||||
form = require('resin-cli-form')
|
||||
deviceConfig = require('resin-device-config')
|
||||
|
@ -37,7 +37,7 @@ exports.list =
|
||||
action: (params, options, done) ->
|
||||
Promise = require('bluebird')
|
||||
_ = require('lodash')
|
||||
resin = require('resin-sdk')
|
||||
resin = require('resin-sdk-preconfigured')
|
||||
visuals = require('resin-cli-visuals')
|
||||
|
||||
Promise.try ->
|
||||
@ -76,7 +76,7 @@ exports.info =
|
||||
permission: 'user'
|
||||
primary: true
|
||||
action: (params, options, done) ->
|
||||
resin = require('resin-sdk')
|
||||
resin = require('resin-sdk-preconfigured')
|
||||
visuals = require('resin-cli-visuals')
|
||||
|
||||
resin.models.device.get(params.uuid).then (device) ->
|
||||
@ -114,7 +114,7 @@ exports.supported =
|
||||
'''
|
||||
permission: 'user'
|
||||
action: (params, options, done) ->
|
||||
resin = require('resin-sdk')
|
||||
resin = require('resin-sdk-preconfigured')
|
||||
resin.models.config.getDeviceTypes().each (deviceType) ->
|
||||
console.log(deviceType.slug)
|
||||
.nodeify(done)
|
||||
@ -138,12 +138,12 @@ exports.register =
|
||||
]
|
||||
action: (params, options, done) ->
|
||||
Promise = require('bluebird')
|
||||
resin = require('resin-sdk')
|
||||
resin = require('resin-sdk-preconfigured')
|
||||
|
||||
resin.models.application.get(params.application).then (application) ->
|
||||
|
||||
Promise.try ->
|
||||
return options.uuid or resin.models.device.generateUUID()
|
||||
return options.uuid or resin.models.device.generateUniqueKey()
|
||||
.then (uuid) ->
|
||||
console.info("Registering to #{application.app_name}: #{uuid}")
|
||||
return resin.models.device.register(application.app_name, uuid)
|
||||
@ -167,7 +167,7 @@ exports.remove =
|
||||
options: [ commandOptions.yes ]
|
||||
permission: 'user'
|
||||
action: (params, options, done) ->
|
||||
resin = require('resin-sdk')
|
||||
resin = require('resin-sdk-preconfigured')
|
||||
patterns = require('../utils/patterns')
|
||||
|
||||
patterns.confirm(options.yes, 'Are you sure you want to delete the device?').then ->
|
||||
@ -188,7 +188,7 @@ exports.identify =
|
||||
'''
|
||||
permission: 'user'
|
||||
action: (params, options, done) ->
|
||||
resin = require('resin-sdk')
|
||||
resin = require('resin-sdk-preconfigured')
|
||||
resin.models.device.identify(params.uuid).nodeify(done)
|
||||
|
||||
exports.reboot =
|
||||
@ -204,7 +204,7 @@ exports.reboot =
|
||||
options: [ commandOptions.forceUpdateLock ]
|
||||
permission: 'user'
|
||||
action: (params, options, done) ->
|
||||
resin = require('resin-sdk')
|
||||
resin = require('resin-sdk-preconfigured')
|
||||
resin.models.device.reboot(params.uuid, options).nodeify(done)
|
||||
|
||||
exports.shutdown =
|
||||
@ -220,7 +220,7 @@ exports.shutdown =
|
||||
options: [ commandOptions.forceUpdateLock ]
|
||||
permission: 'user'
|
||||
action: (params, options, done) ->
|
||||
resin = require('resin-sdk')
|
||||
resin = require('resin-sdk-preconfigured')
|
||||
resin.models.device.shutdown(params.uuid, options).nodeify(done)
|
||||
|
||||
exports.enableDeviceUrl =
|
||||
@ -235,7 +235,7 @@ exports.enableDeviceUrl =
|
||||
'''
|
||||
permission: 'user'
|
||||
action: (params, options, done) ->
|
||||
resin = require('resin-sdk')
|
||||
resin = require('resin-sdk-preconfigured')
|
||||
resin.models.device.enableDeviceUrl(params.uuid).nodeify(done)
|
||||
|
||||
exports.disableDeviceUrl =
|
||||
@ -250,7 +250,7 @@ exports.disableDeviceUrl =
|
||||
'''
|
||||
permission: 'user'
|
||||
action: (params, options, done) ->
|
||||
resin = require('resin-sdk')
|
||||
resin = require('resin-sdk-preconfigured')
|
||||
resin.models.device.disableDeviceUrl(params.uuid).nodeify(done)
|
||||
|
||||
exports.getDeviceUrl =
|
||||
@ -265,7 +265,7 @@ exports.getDeviceUrl =
|
||||
'''
|
||||
permission: 'user'
|
||||
action: (params, options, done) ->
|
||||
resin = require('resin-sdk')
|
||||
resin = require('resin-sdk-preconfigured')
|
||||
resin.models.device.getDeviceUrl(params.uuid).then (url) ->
|
||||
console.log(url)
|
||||
.nodeify(done)
|
||||
@ -282,7 +282,7 @@ exports.hasDeviceUrl =
|
||||
'''
|
||||
permission: 'user'
|
||||
action: (params, options, done) ->
|
||||
resin = require('resin-sdk')
|
||||
resin = require('resin-sdk-preconfigured')
|
||||
resin.models.device.hasDeviceUrl(params.uuid).then (hasDeviceUrl) ->
|
||||
console.log(hasDeviceUrl)
|
||||
.nodeify(done)
|
||||
@ -304,7 +304,7 @@ exports.rename =
|
||||
action: (params, options, done) ->
|
||||
Promise = require('bluebird')
|
||||
_ = require('lodash')
|
||||
resin = require('resin-sdk')
|
||||
resin = require('resin-sdk-preconfigured')
|
||||
form = require('resin-cli-form')
|
||||
|
||||
Promise.try ->
|
||||
@ -333,7 +333,7 @@ exports.move =
|
||||
permission: 'user'
|
||||
options: [ commandOptions.optionalApplication ]
|
||||
action: (params, options, done) ->
|
||||
resin = require('resin-sdk')
|
||||
resin = require('resin-sdk-preconfigured')
|
||||
_ = require('lodash')
|
||||
patterns = require('../utils/patterns')
|
||||
|
||||
@ -381,7 +381,7 @@ exports.init =
|
||||
tmp = Promise.promisifyAll(require('tmp'))
|
||||
tmp.setGracefulCleanup()
|
||||
|
||||
resin = require('resin-sdk')
|
||||
resin = require('resin-sdk-preconfigured')
|
||||
helpers = require('../utils/helpers')
|
||||
patterns = require('../utils/patterns')
|
||||
|
||||
|
@ -48,7 +48,7 @@ exports.list =
|
||||
action: (params, options, done) ->
|
||||
Promise = require('bluebird')
|
||||
_ = require('lodash')
|
||||
resin = require('resin-sdk')
|
||||
resin = require('resin-sdk-preconfigured')
|
||||
visuals = require('resin-cli-visuals')
|
||||
|
||||
Promise.try ->
|
||||
@ -98,7 +98,7 @@ exports.remove =
|
||||
]
|
||||
permission: 'user'
|
||||
action: (params, options, done) ->
|
||||
resin = require('resin-sdk')
|
||||
resin = require('resin-sdk-preconfigured')
|
||||
patterns = require('../utils/patterns')
|
||||
|
||||
patterns.confirm(options.yes, 'Are you sure you want to delete the environment variable?').then ->
|
||||
@ -136,7 +136,7 @@ exports.add =
|
||||
permission: 'user'
|
||||
action: (params, options, done) ->
|
||||
Promise = require('bluebird')
|
||||
resin = require('resin-sdk')
|
||||
resin = require('resin-sdk-preconfigured')
|
||||
|
||||
Promise.try ->
|
||||
if not params.value?
|
||||
@ -172,7 +172,7 @@ exports.rename =
|
||||
options: [ commandOptions.booleanDevice ]
|
||||
action: (params, options, done) ->
|
||||
Promise = require('bluebird')
|
||||
resin = require('resin-sdk')
|
||||
resin = require('resin-sdk-preconfigured')
|
||||
|
||||
Promise.try ->
|
||||
if options.device
|
||||
|
@ -28,7 +28,7 @@ exports.list =
|
||||
'''
|
||||
permission: 'user'
|
||||
action: (params, options, done) ->
|
||||
resin = require('resin-sdk')
|
||||
resin = require('resin-sdk-preconfigured')
|
||||
visuals = require('resin-cli-visuals')
|
||||
|
||||
resin.models.key.getAll().then (keys) ->
|
||||
@ -50,7 +50,7 @@ exports.info =
|
||||
'''
|
||||
permission: 'user'
|
||||
action: (params, options, done) ->
|
||||
resin = require('resin-sdk')
|
||||
resin = require('resin-sdk-preconfigured')
|
||||
visuals = require('resin-cli-visuals')
|
||||
|
||||
resin.models.key.get(params.id).then (key) ->
|
||||
@ -82,7 +82,7 @@ exports.remove =
|
||||
options: [ commandOptions.yes ]
|
||||
permission: 'user'
|
||||
action: (params, options, done) ->
|
||||
resin = require('resin-sdk')
|
||||
resin = require('resin-sdk-preconfigured')
|
||||
patterns = require('../utils/patterns')
|
||||
|
||||
patterns.confirm(options.yes, 'Are you sure you want to delete the key?').then ->
|
||||
@ -109,7 +109,7 @@ exports.add =
|
||||
Promise = require('bluebird')
|
||||
fs = Promise.promisifyAll(require('fs'))
|
||||
capitano = require('capitano')
|
||||
resin = require('resin-sdk')
|
||||
resin = require('resin-sdk-preconfigured')
|
||||
|
||||
Promise.try ->
|
||||
return fs.readFileAsync(params.path, encoding: 'utf8') if params.path?
|
||||
|
@ -45,7 +45,7 @@ module.exports =
|
||||
primary: true
|
||||
action: (params, options, done) ->
|
||||
_ = require('lodash')
|
||||
resin = require('resin-sdk')
|
||||
resin = require('resin-sdk-preconfigured')
|
||||
moment = require('moment')
|
||||
|
||||
printLine = (line) ->
|
||||
|
@ -40,7 +40,7 @@ exports.set =
|
||||
action: (params, options, done) ->
|
||||
Promise = require('bluebird')
|
||||
_ = require('lodash')
|
||||
resin = require('resin-sdk')
|
||||
resin = require('resin-sdk-preconfigured')
|
||||
|
||||
Promise.try ->
|
||||
if _.isEmpty(params.note)
|
||||
|
@ -107,7 +107,7 @@ exports.configure =
|
||||
]
|
||||
action: (params, options, done) ->
|
||||
_ = require('lodash')
|
||||
resin = require('resin-sdk')
|
||||
resin = require('resin-sdk-preconfigured')
|
||||
form = require('resin-cli-form')
|
||||
init = require('resin-device-init')
|
||||
helpers = require('../utils/helpers')
|
||||
|
@ -25,7 +25,7 @@ exports.list =
|
||||
$ resin settings
|
||||
'''
|
||||
action: (params, options, done) ->
|
||||
resin = require('resin-sdk')
|
||||
resin = require('resin-sdk-preconfigured')
|
||||
prettyjson = require('prettyjson')
|
||||
|
||||
resin.settings.getAll()
|
||||
|
@ -69,7 +69,7 @@ module.exports =
|
||||
action: (params, options, done) ->
|
||||
child_process = require('child_process')
|
||||
Promise = require 'bluebird'
|
||||
resin = require('resin-sdk')
|
||||
resin = require('resin-sdk-preconfigured')
|
||||
settings = require('resin-settings-client')
|
||||
patterns = require('../utils/patterns')
|
||||
|
||||
|
@ -130,7 +130,7 @@ module.exports =
|
||||
action: (params, options, done) ->
|
||||
fs = require('fs')
|
||||
path = require('path')
|
||||
resin = require('resin-sdk')
|
||||
resin = require('resin-sdk-preconfigured')
|
||||
Promise = require('bluebird')
|
||||
resinSync = require('resin-sync')
|
||||
patterns = require('../utils/patterns')
|
||||
|
@ -36,7 +36,7 @@ exports.wizard =
|
||||
action: (params, options, done) ->
|
||||
Promise = require('bluebird')
|
||||
capitano = Promise.promisifyAll(require('capitano'))
|
||||
resin = require('resin-sdk')
|
||||
resin = require('resin-sdk-preconfigured')
|
||||
patterns = require('../utils/patterns')
|
||||
|
||||
resin.auth.isLoggedIn().then (isLoggedIn) ->
|
||||
|
@ -17,7 +17,7 @@ limitations under the License.
|
||||
_ = require('lodash')
|
||||
Promise = require('bluebird')
|
||||
capitano = Promise.promisifyAll(require('capitano'))
|
||||
resin = require('resin-sdk')
|
||||
resin = require('resin-sdk-preconfigured')
|
||||
actions = require('./actions')
|
||||
errors = require('./errors')
|
||||
events = require('./events')
|
||||
|
@ -1,7 +1,7 @@
|
||||
_ = require('lodash')
|
||||
Mixpanel = require('mixpanel')
|
||||
Promise = require('bluebird')
|
||||
resin = require('resin-sdk')
|
||||
resin = require('resin-sdk-preconfigured')
|
||||
capitanoState = Promise.promisifyAll(require('capitano').state)
|
||||
packageJSON = require('../package.json')
|
||||
|
||||
|
@ -19,7 +19,7 @@ capitano = Promise.promisifyAll(require('capitano'))
|
||||
_ = require('lodash')
|
||||
_.str = require('underscore.string')
|
||||
president = Promise.promisifyAll(require('president'))
|
||||
resin = require('resin-sdk')
|
||||
resin = require('resin-sdk-preconfigured')
|
||||
imagefs = require('resin-image-fs')
|
||||
rindle = require('rindle')
|
||||
os = require('os')
|
||||
|
@ -18,7 +18,7 @@ _ = require('lodash')
|
||||
Promise = require('bluebird')
|
||||
form = require('resin-cli-form')
|
||||
visuals = require('resin-cli-visuals')
|
||||
resin = require('resin-sdk')
|
||||
resin = require('resin-sdk-preconfigured')
|
||||
chalk = require('chalk')
|
||||
validation = require('./validation')
|
||||
messages = require('./messages')
|
||||
|
16
package.json
16
package.json
@ -13,7 +13,8 @@
|
||||
"resin": "./bin/resin"
|
||||
},
|
||||
"scripts": {
|
||||
"prepublish": "gulp build",
|
||||
"build": "gulp build",
|
||||
"prepublish": "npm run build",
|
||||
"doc": "mkdir -p doc/ && coffee extras/capitanodoc/index.coffee > doc/cli.markdown"
|
||||
},
|
||||
"keywords": [
|
||||
@ -27,14 +28,13 @@
|
||||
"gulp": "^3.9.0",
|
||||
"gulp-coffee": "^2.2.0",
|
||||
"gulp-coffeelint": "^0.6.0",
|
||||
"gulp-shell": "^0.5.2",
|
||||
"gulp-util": "^3.0.6"
|
||||
"gulp-shell": "^0.5.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"bluebird": "^3.3.3",
|
||||
"capitano": "~1.7.0",
|
||||
"chalk": "^1.1.1",
|
||||
"coffee-script": "^1.11.1",
|
||||
"coffee-script": "~1.12.2",
|
||||
"columnify": "^1.5.2",
|
||||
"is-root": "^1.0.0",
|
||||
"js-yaml": "^3.7.0",
|
||||
@ -53,14 +53,12 @@
|
||||
"resin-device-init": "^2.1.0",
|
||||
"resin-image-fs": "^2.1.2",
|
||||
"resin-image-manager": "^4.0.0",
|
||||
"resin-pine": "^1.3.0",
|
||||
"resin-sdk": "^5.4.0",
|
||||
"resin-sdk-preconfigured": "^0.1.0",
|
||||
"resin-settings-client": "^3.5.0",
|
||||
"resin-sync": "^3.0.0",
|
||||
"resin-vcs": "^2.0.0",
|
||||
"resin-sync": "^2.0.2",
|
||||
"rimraf": "^2.4.3",
|
||||
"rindle": "^1.0.0",
|
||||
"tmp": "0.0.28",
|
||||
"tmp": "^0.0.31",
|
||||
"umount": "^1.1.1",
|
||||
"underscore.string": "^3.1.1",
|
||||
"unzip2": "^0.2.5",
|
||||
|
Loading…
Reference in New Issue
Block a user