Move to preconfigured resin sdk

This commit is contained in:
Tim Perry 2017-01-25 19:32:07 +01:00
parent 7a4de5357e
commit b629ee6164
No known key found for this signature in database
GPG Key ID: 0DDE38AFD3AF94F0
37 changed files with 94 additions and 103 deletions

View File

@ -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

View File

@ -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);

View File

@ -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(),

View File

@ -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');

View File

@ -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,7 +98,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 resin.models.application.get(params.application).then(function(application) {
return Promise["try"](function() {
return options.uuid || resin.models.device.generateUniqueKey();
@ -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() {

View File

@ -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);

View File

@ -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, {

View File

@ -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;

View File

@ -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');

View File

@ -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');

View File

@ -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);
}

View File

@ -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) {

View File

@ -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');

View File

@ -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) {

View File

@ -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');

View File

@ -8,7 +8,7 @@
Promise = require('bluebird');
resin = require('./resin-sdk');
resin = require('resin-sdk-preconfigured');
capitanoState = Promise.promisifyAll(require('capitano').state);

View File

@ -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');

View File

@ -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');

View File

@ -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 ->

View File

@ -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

View File

@ -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')

View File

@ -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,7 +138,7 @@ 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) ->
@ -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')

View File

@ -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

View File

@ -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?

View File

@ -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) ->

View File

@ -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)

View File

@ -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')

View File

@ -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()

View File

@ -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')

View File

@ -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')

View File

@ -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) ->

View File

@ -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')

View File

@ -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')

View File

@ -1,13 +0,0 @@
# This is a singleton Resin SDK instance builder
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)

View File

@ -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')

View File

@ -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')

View File

@ -53,7 +53,7 @@
"resin-device-init": "^2.1.0",
"resin-image-fs": "^2.1.2",
"resin-image-manager": "^4.0.0",
"resin-sdk": "6.0.0-beta1",
"resin-sdk-preconfigured": "^0.1.0",
"resin-settings-client": "^3.5.0",
"resin-sync": "^2.0.2",
"rimraf": "^2.4.3",
@ -65,4 +65,4 @@
"update-notifier": "^0.6.1",
"valid-email": "0.0.2"
}
}
}