balena-sdk 16.26.6 → 16.26.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es2015/balena-browser.js +46 -48
- package/es2015/balena-browser.min.js +1 -1
- package/es2015/index.d.ts +1 -1
- package/es2015/models/device.d.ts +20 -20
- package/es2015/models/device.js +41 -41
- package/es2015/models/index.d.ts +1 -1
- package/es2015/util/request-batching.js +4 -6
- package/es2015/util/sdk-version.js +1 -1
- package/es2018/balena-browser.js +46 -48
- package/es2018/balena-browser.min.js +1 -1
- package/es2018/index.d.ts +1 -1
- package/es2018/models/device.d.ts +20 -20
- package/es2018/models/device.js +41 -41
- package/es2018/models/index.d.ts +1 -1
- package/es2018/util/request-batching.js +4 -6
- package/es2018/util/sdk-version.js +1 -1
- package/package.json +2 -2
package/es2015/balena-browser.js
CHANGED
|
@@ -6642,6 +6642,47 @@ const getDeviceModel = function (deps, opts) {
|
|
|
6642
6642
|
}),
|
|
6643
6643
|
});
|
|
6644
6644
|
}),
|
|
6645
|
+
/**
|
|
6646
|
+
* @summary Configure a specific device to track the current application release
|
|
6647
|
+
* @name trackApplicationRelease
|
|
6648
|
+
* @public
|
|
6649
|
+
* @function
|
|
6650
|
+
* @memberof balena.models.device
|
|
6651
|
+
*
|
|
6652
|
+
* @description The device's current release will be updated with each new successfully built release.
|
|
6653
|
+
*
|
|
6654
|
+
* @param {String|Number|Number[]} uuidOrIdOrIds - device uuid (string) or id (number) or ids
|
|
6655
|
+
* @returns {Promise}
|
|
6656
|
+
*
|
|
6657
|
+
* @example
|
|
6658
|
+
* balena.models.device.trackApplicationRelease('7cf02a6').then(function() {
|
|
6659
|
+
* ...
|
|
6660
|
+
* });
|
|
6661
|
+
*
|
|
6662
|
+
* @example
|
|
6663
|
+
* balena.models.device.trackApplicationRelease('7cf02a6', function(error) {
|
|
6664
|
+
* if (error) throw error;
|
|
6665
|
+
* ...
|
|
6666
|
+
* });
|
|
6667
|
+
*/
|
|
6668
|
+
trackApplicationRelease: (uuidOrIdOrIds) => tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
6669
|
+
yield batchDeviceOperation()({
|
|
6670
|
+
uuidOrIdOrIds,
|
|
6671
|
+
fn: (devices) => tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
6672
|
+
yield pine.patch({
|
|
6673
|
+
resource: 'device',
|
|
6674
|
+
options: {
|
|
6675
|
+
$filter: {
|
|
6676
|
+
id: { $in: devices.map((d) => d.id) },
|
|
6677
|
+
},
|
|
6678
|
+
},
|
|
6679
|
+
body: {
|
|
6680
|
+
should_be_running__release: null,
|
|
6681
|
+
},
|
|
6682
|
+
});
|
|
6683
|
+
}),
|
|
6684
|
+
});
|
|
6685
|
+
}),
|
|
6645
6686
|
/**
|
|
6646
6687
|
* @summary Set a specific device to run a particular supervisor release
|
|
6647
6688
|
* @name setSupervisorRelease
|
|
@@ -6730,47 +6771,6 @@ const getDeviceModel = function (deps, opts) {
|
|
|
6730
6771
|
}),
|
|
6731
6772
|
});
|
|
6732
6773
|
}),
|
|
6733
|
-
/**
|
|
6734
|
-
* @summary Configure a specific device to track the current application release
|
|
6735
|
-
* @name trackApplicationRelease
|
|
6736
|
-
* @public
|
|
6737
|
-
* @function
|
|
6738
|
-
* @memberof balena.models.device
|
|
6739
|
-
*
|
|
6740
|
-
* @description The device's current release will be updated with each new successfully built release.
|
|
6741
|
-
*
|
|
6742
|
-
* @param {String|Number|Number[]} uuidOrIdOrIds - device uuid (string) or id (number) or ids
|
|
6743
|
-
* @returns {Promise}
|
|
6744
|
-
*
|
|
6745
|
-
* @example
|
|
6746
|
-
* balena.models.device.trackApplicationRelease('7cf02a6').then(function() {
|
|
6747
|
-
* ...
|
|
6748
|
-
* });
|
|
6749
|
-
*
|
|
6750
|
-
* @example
|
|
6751
|
-
* balena.models.device.trackApplicationRelease('7cf02a6', function(error) {
|
|
6752
|
-
* if (error) throw error;
|
|
6753
|
-
* ...
|
|
6754
|
-
* });
|
|
6755
|
-
*/
|
|
6756
|
-
trackApplicationRelease: (uuidOrIdOrIds) => tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
6757
|
-
yield batchDeviceOperation()({
|
|
6758
|
-
uuidOrIdOrIds,
|
|
6759
|
-
fn: (devices) => tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
6760
|
-
yield pine.patch({
|
|
6761
|
-
resource: 'device',
|
|
6762
|
-
options: {
|
|
6763
|
-
$filter: {
|
|
6764
|
-
id: { $in: devices.map((d) => d.id) },
|
|
6765
|
-
},
|
|
6766
|
-
},
|
|
6767
|
-
body: {
|
|
6768
|
-
should_be_running__release: null,
|
|
6769
|
-
},
|
|
6770
|
-
});
|
|
6771
|
-
}),
|
|
6772
|
-
});
|
|
6773
|
-
}),
|
|
6774
6774
|
/**
|
|
6775
6775
|
* @summary Check whether the provided device can update to the target os version
|
|
6776
6776
|
* @name _checkOsUpdateTarget
|
|
@@ -12187,7 +12187,7 @@ const tslib_1 = require("tslib");
|
|
|
12187
12187
|
const errors = require("balena-errors");
|
|
12188
12188
|
const chunk = require("lodash/chunk");
|
|
12189
12189
|
const _1 = require(".");
|
|
12190
|
-
const CHUNK_SIZE =
|
|
12190
|
+
const CHUNK_SIZE = 200;
|
|
12191
12191
|
function batchResourceOperationFactory({ getAll, NotFoundError, AmbiguousResourceError, }) {
|
|
12192
12192
|
function batchResourceOperation({ uuidOrIdOrIds, options, groupByNavigationPoperty, fn, }) {
|
|
12193
12193
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
@@ -12222,11 +12222,9 @@ function batchResourceOperationFactory({ getAll, NotFoundError, AmbiguousResourc
|
|
|
12222
12222
|
if (!resourceIds.length) {
|
|
12223
12223
|
throw new NotFoundError(uuidOrIdOrIds.toString());
|
|
12224
12224
|
}
|
|
12225
|
-
|
|
12226
|
-
|
|
12227
|
-
|
|
12228
|
-
}
|
|
12229
|
-
const itemsByAccosiactedResource = (0, _1.groupByMap)(items, (item) => item[groupByNavigationPoperty].__id);
|
|
12225
|
+
const itemsByAccosiactedResource = groupByNavigationPoperty
|
|
12226
|
+
? (0, _1.groupByMap)(items, (item) => item[groupByNavigationPoperty].__id)
|
|
12227
|
+
: new Map([[undefined, items]]);
|
|
12230
12228
|
if (typeof uuidOrIdOrIds === 'string' && resourceIds.length > 1) {
|
|
12231
12229
|
throw new AmbiguousResourceError(uuidOrIdOrIds);
|
|
12232
12230
|
}
|
|
@@ -12258,7 +12256,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12258
12256
|
// being embedded in the dist of the consumer project
|
|
12259
12257
|
// which we want to avoid, both b/c of the dist size increase &
|
|
12260
12258
|
// the security concerns of including the versions of the dependencies
|
|
12261
|
-
const sdkVersion = '16.26.
|
|
12259
|
+
const sdkVersion = '16.26.7';
|
|
12262
12260
|
exports.default = sdkVersion;
|
|
12263
12261
|
|
|
12264
12262
|
},{}],48:[function(require,module,exports){
|