balena-sdk 16.9.1 → 16.9.2

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.
@@ -776,7 +776,7 @@ const getAuth = function (deps, opts) {
776
776
  };
777
777
  exports.default = getAuth;
778
778
 
779
- },{"./2fa":1,"./util/callbacks":31,"balena-errors":58,"memoizee":332}],3:[function(require,module,exports){
779
+ },{"./2fa":1,"./util/callbacks":32,"balena-errors":59,"memoizee":332}],3:[function(require,module,exports){
780
780
  "use strict";
781
781
  /*
782
782
  Copyright 2016 Balena
@@ -863,7 +863,7 @@ const getSdk = function ($opts) {
863
863
  const { getRequest } = require('balena-request');
864
864
  const BalenaAuth = require('balena-auth')
865
865
  .default;
866
- const { BalenaPine } = require('balena-pine');
866
+ const { createPinejsClient } = require('./pine');
867
867
  const errors = require('balena-errors');
868
868
  const { PubSub } = require('./util/pubsub');
869
869
  /**
@@ -905,7 +905,7 @@ const getSdk = function ($opts) {
905
905
  }
906
906
  const auth = new BalenaAuth(opts);
907
907
  const request = getRequest({ ...opts, auth });
908
- const pine = new BalenaPine({}, { ...opts, auth, request });
908
+ const pine = createPinejsClient({}, { ...opts, auth, request });
909
909
  const pubsub = new PubSub();
910
910
  const sdk = {};
911
911
  const deps = {
@@ -1023,7 +1023,7 @@ const getSdk = function ($opts) {
1023
1023
  * @memberof balena
1024
1024
  *
1025
1025
  * @description
1026
- * The balena-pine instance used internally. This should not be necessary
1026
+ * The pinejs-client instance used internally. This should not be necessary
1027
1027
  * in normal usage, but can be useful if you want to directly make pine
1028
1028
  * queries to the api for some resource that isn't directly supported
1029
1029
  * in the SDK.
@@ -1124,7 +1124,7 @@ const fromSharedOptions = function () {
1124
1124
  };
1125
1125
  exports.fromSharedOptions = fromSharedOptions;
1126
1126
 
1127
- },{"./auth":2,"./logs":4,"./models":15,"./settings":23,"./types/contract":24,"./types/jwt":27,"./types/models":28,"./util":42,"./util/callbacks":31,"./util/global-env":41,"./util/pubsub":44,"./util/sdk-version":45,"balena-auth":55,"balena-errors":58,"balena-pine":62,"balena-request":65,"balena-settings-client":undefined,"tslib":470}],4:[function(require,module,exports){
1127
+ },{"./auth":2,"./logs":4,"./models":15,"./pine":23,"./settings":24,"./types/contract":25,"./types/jwt":28,"./types/models":29,"./util":43,"./util/callbacks":32,"./util/global-env":42,"./util/pubsub":45,"./util/sdk-version":46,"balena-auth":56,"balena-errors":59,"balena-request":65,"balena-settings-client":undefined,"tslib":470}],4:[function(require,module,exports){
1128
1128
  "use strict";
1129
1129
  /*
1130
1130
  Copyright 2016 Balena
@@ -1338,7 +1338,7 @@ const getLogs = function (deps, opts) {
1338
1338
  };
1339
1339
  exports.default = getLogs;
1340
1340
 
1341
- },{"./models/device":12,"./util/global-env":41,"abortcontroller-polyfill/dist/cjs-ponyfill":49,"events":76,"ndjson":345}],5:[function(require,module,exports){
1341
+ },{"./models/device":12,"./util/global-env":42,"abortcontroller-polyfill/dist/cjs-ponyfill":50,"events":76,"ndjson":345}],5:[function(require,module,exports){
1342
1342
  "use strict";
1343
1343
  Object.defineProperty(exports, "__esModule", { value: true });
1344
1344
  /*
@@ -1623,7 +1623,7 @@ const getApiKeysModel = function (deps, opts) {
1623
1623
  };
1624
1624
  exports.default = getApiKeysModel;
1625
1625
 
1626
- },{"../util":42,"./application":8,"./device":12,"balena-errors":58,"lodash/once":314}],6:[function(require,module,exports){
1626
+ },{"../util":43,"./application":8,"./device":12,"balena-errors":59,"lodash/once":314}],6:[function(require,module,exports){
1627
1627
  "use strict";
1628
1628
  /*
1629
1629
  Copyright 2020 Balena
@@ -1839,7 +1839,7 @@ const getApplicationInviteModel = function (deps, opts, getApplication) {
1839
1839
  };
1840
1840
  exports.default = getApplicationInviteModel;
1841
1841
 
1842
- },{"../util":42,"balena-errors":58}],7:[function(require,module,exports){
1842
+ },{"../util":43,"balena-errors":59}],7:[function(require,module,exports){
1843
1843
  "use strict";
1844
1844
  /*
1845
1845
  Copyright 2020 Balena
@@ -2104,7 +2104,7 @@ const getApplicationMembershipModel = function (deps, getApplication) {
2104
2104
  };
2105
2105
  exports.default = getApplicationMembershipModel;
2106
2106
 
2107
- },{"../util":42,"balena-errors":58}],8:[function(require,module,exports){
2107
+ },{"../util":43,"balena-errors":59}],8:[function(require,module,exports){
2108
2108
  "use strict";
2109
2109
  /*
2110
2110
  Copyright 2016 Balena
@@ -3886,7 +3886,7 @@ const getApplicationModel = function (deps, opts) {
3886
3886
  };
3887
3887
  exports.default = getApplicationModel;
3888
3888
 
3889
- },{"../util":42,"../util/callbacks":31,"../util/dependent-resource":33,"../util/device-os-version":37,"../util/device-service-details":38,"./application-invite":6,"./application-membership":7,"./device":12,"./release":21,"balena-errors":58,"lodash/once":314,"url":477}],9:[function(require,module,exports){
3889
+ },{"../util":43,"../util/callbacks":32,"../util/dependent-resource":34,"../util/device-os-version":38,"../util/device-service-details":39,"./application-invite":6,"./application-membership":7,"./device":12,"./release":21,"balena-errors":59,"lodash/once":314,"url":477}],9:[function(require,module,exports){
3890
3890
  "use strict";
3891
3891
  /*
3892
3892
  Copyright 2016 Balena
@@ -4581,7 +4581,7 @@ const getDeviceTypeModel = function (deps) {
4581
4581
  };
4582
4582
  exports.default = getDeviceTypeModel;
4583
4583
 
4584
- },{"../util":42,"balena-errors":58}],12:[function(require,module,exports){
4584
+ },{"../util":43,"balena-errors":59}],12:[function(require,module,exports){
4585
4585
  "use strict";
4586
4586
  /*
4587
4587
  Copyright 2016 Balena
@@ -7503,7 +7503,7 @@ const getDeviceModel = function (deps, opts) {
7503
7503
  };
7504
7504
  exports.default = getDeviceModel;
7505
7505
 
7506
- },{"../types/device-overall-status":25,"../types/device-state":26,"../util":42,"../util/callbacks":31,"../util/date":32,"../util/dependent-resource":33,"../util/device-actions/os-update":35,"../util/device-actions/os-update/utils":36,"../util/device-os-version":37,"../util/device-service-details":38,"../util/device-types":39,"../util/local-mode":43,"../util/types":46,"./application":8,"./config":10,"./device.supervisor-api.partial":13,"./os":20,"./release":21,"balena-errors":58,"balena-register-device":63,"balena-semver":67,"lodash/chunk":290,"lodash/flatten":294,"lodash/groupBy":296,"lodash/once":314,"memoizee":332,"url":477}],13:[function(require,module,exports){
7506
+ },{"../types/device-overall-status":26,"../types/device-state":27,"../util":43,"../util/callbacks":32,"../util/date":33,"../util/dependent-resource":34,"../util/device-actions/os-update":36,"../util/device-actions/os-update/utils":37,"../util/device-os-version":38,"../util/device-service-details":39,"../util/device-types":40,"../util/local-mode":44,"../util/types":47,"./application":8,"./config":10,"./device.supervisor-api.partial":13,"./os":20,"./release":21,"balena-errors":59,"balena-register-device":63,"balena-semver":67,"lodash/chunk":290,"lodash/flatten":294,"lodash/groupBy":296,"lodash/once":314,"memoizee":332,"url":477}],13:[function(require,module,exports){
7507
7507
  "use strict";
7508
7508
  /*
7509
7509
  Copyright 2016 Balena
@@ -8155,7 +8155,7 @@ const getSupervisorApiHelper = function (deps, opts) {
8155
8155
  };
8156
8156
  exports.getSupervisorApiHelper = getSupervisorApiHelper;
8157
8157
 
8158
- },{"../util":42,"../util/device-os-version":37,"../util/types":46}],14:[function(require,module,exports){
8158
+ },{"../util":43,"../util/device-os-version":38,"../util/types":47}],14:[function(require,module,exports){
8159
8159
  "use strict";
8160
8160
  /*
8161
8161
  Copyright 2017 Balena
@@ -8261,7 +8261,7 @@ const getImageModel = function (deps, _opts) {
8261
8261
  };
8262
8262
  exports.default = getImageModel;
8263
8263
 
8264
- },{"../util":42,"../util/types":46,"balena-errors":58}],15:[function(require,module,exports){
8264
+ },{"../util":43,"../util/types":47,"balena-errors":59}],15:[function(require,module,exports){
8265
8265
  "use strict";
8266
8266
  /*
8267
8267
  Copyright 2016 Balena
@@ -8360,7 +8360,7 @@ module.exports = (deps, opts) => {
8360
8360
  return models;
8361
8361
  };
8362
8362
 
8363
- },{"../util/callbacks":31,"./api-key":5,"./application":8,"./billing":9,"./config":10,"./device":12,"./device-type":11,"./image":14,"./key":16,"./organization":19,"./os":20,"./release":21,"./service":22}],16:[function(require,module,exports){
8363
+ },{"../util/callbacks":32,"./api-key":5,"./application":8,"./billing":9,"./config":10,"./device":12,"./device-type":11,"./image":14,"./key":16,"./organization":19,"./os":20,"./release":21,"./service":22}],16:[function(require,module,exports){
8364
8364
  "use strict";
8365
8365
  /*
8366
8366
  Copyright 2016 Balena
@@ -8514,7 +8514,7 @@ const getKeyModel = function (deps, _opts) {
8514
8514
  };
8515
8515
  exports.default = getKeyModel;
8516
8516
 
8517
- },{"../util":42,"balena-errors":58}],17:[function(require,module,exports){
8517
+ },{"../util":43,"balena-errors":59}],17:[function(require,module,exports){
8518
8518
  "use strict";
8519
8519
  /*
8520
8520
  Copyright 2020 Balena
@@ -8730,7 +8730,7 @@ const getOrganizationInviteModel = function (deps, opts, getOrganization) {
8730
8730
  };
8731
8731
  exports.default = getOrganizationInviteModel;
8732
8732
 
8733
- },{"../util":42,"balena-errors":58}],18:[function(require,module,exports){
8733
+ },{"../util":43,"balena-errors":59}],18:[function(require,module,exports){
8734
8734
  "use strict";
8735
8735
  /*
8736
8736
  Copyright 2020 Balena
@@ -9148,7 +9148,7 @@ const getOrganizationMembershipModel = function (deps, getOrganization) {
9148
9148
  };
9149
9149
  exports.default = getOrganizationMembershipModel;
9150
9150
 
9151
- },{"../util":42,"../util/callbacks":31,"../util/dependent-resource":33,"balena-errors":58}],19:[function(require,module,exports){
9151
+ },{"../util":43,"../util/callbacks":32,"../util/dependent-resource":34,"balena-errors":59}],19:[function(require,module,exports){
9152
9152
  "use strict";
9153
9153
  /*
9154
9154
  Copyright 2020 Balena
@@ -9334,7 +9334,7 @@ const getOrganizationModel = function (deps, opts) {
9334
9334
  };
9335
9335
  exports.default = getOrganizationModel;
9336
9336
 
9337
- },{"../util":42,"../util/callbacks":31,"./organization-invite":17,"./organization-membership":18,"balena-errors":58}],20:[function(require,module,exports){
9337
+ },{"../util":43,"../util/callbacks":32,"./organization-invite":17,"./organization-membership":18,"balena-errors":59}],20:[function(require,module,exports){
9338
9338
  "use strict";
9339
9339
  /*
9340
9340
  Copyright 2016 Balena
@@ -10093,7 +10093,7 @@ const getOsModel = function (deps, opts) {
10093
10093
  };
10094
10094
  exports.default = getOsModel;
10095
10095
 
10096
- },{"../util":42,"../util/cache":30,"../util/device-actions/os-update/utils":36,"../util/device-types":39,"../util/types":46,"./application":8,"./config":10,"balena-semver":67,"lodash/once":314}],21:[function(require,module,exports){
10096
+ },{"../util":43,"../util/cache":31,"../util/device-actions/os-update/utils":37,"../util/device-types":40,"../util/types":47,"./application":8,"./config":10,"balena-semver":67,"lodash/once":314}],21:[function(require,module,exports){
10097
10097
  "use strict";
10098
10098
  /*
10099
10099
  Copyright 2016 Balena
@@ -10671,7 +10671,7 @@ const getReleaseModel = function (deps, opts) {
10671
10671
  };
10672
10672
  exports.default = getReleaseModel;
10673
10673
 
10674
- },{"../util":42,"../util/builder":29,"../util/callbacks":31,"../util/dependent-resource":33,"../util/types":46,"./application":8,"balena-errors":58,"lodash/once":314}],22:[function(require,module,exports){
10674
+ },{"../util":43,"../util/builder":30,"../util/callbacks":32,"../util/dependent-resource":34,"../util/types":47,"./application":8,"balena-errors":59,"lodash/once":314}],22:[function(require,module,exports){
10675
10675
  "use strict";
10676
10676
  /*
10677
10677
  Copyright 2018 Balena
@@ -10908,7 +10908,82 @@ const getServiceModel = (deps, opts) => {
10908
10908
  };
10909
10909
  exports.default = getServiceModel;
10910
10910
 
10911
- },{"../util":42,"../util/callbacks":31,"../util/dependent-resource":33,"./application":8,"balena-errors":58,"lodash/once":314}],23:[function(require,module,exports){
10911
+ },{"../util":43,"../util/callbacks":32,"../util/dependent-resource":34,"./application":8,"balena-errors":59,"lodash/once":314}],23:[function(require,module,exports){
10912
+ "use strict";
10913
+ Object.defineProperty(exports, "__esModule", { value: true });
10914
+ exports.createPinejsClient = void 0;
10915
+ const url = require("url");
10916
+ const errors = require("balena-errors");
10917
+ const pinejs_client_core_1 = require("pinejs-client-core");
10918
+ /**
10919
+ * @class
10920
+ * @classdesc A PineJS Client subclass to communicate with balena.
10921
+ * @private
10922
+ *
10923
+ * @description
10924
+ * This subclass makes use of the [balena-request](https://github.com/balena-io-modules/balena-request) project.
10925
+ */
10926
+ class PinejsClient extends pinejs_client_core_1.PinejsClientCore {
10927
+ constructor(params, backendParams) {
10928
+ super({
10929
+ ...params,
10930
+ apiPrefix: url.resolve(backendParams.apiUrl, `/${backendParams.apiVersion}/`),
10931
+ });
10932
+ this.backendParams = backendParams;
10933
+ this.backendParams = backendParams;
10934
+ this.API_URL = backendParams.apiUrl;
10935
+ this.API_VERSION = backendParams.apiVersion;
10936
+ }
10937
+ /**
10938
+ * @summary Perform a network request to balena.
10939
+ * @method
10940
+ * @private
10941
+ *
10942
+ * @param {Object} options - request options
10943
+ * @returns {Promise<*>} response body
10944
+ *
10945
+ * @todo Implement caching support.
10946
+ */
10947
+ async _request(options) {
10948
+ const { apiKey, apiUrl, auth, request } = this.backendParams;
10949
+ const hasKey = await auth.hasKey();
10950
+ const authenticated = hasKey || (apiKey != null && apiKey.length > 0);
10951
+ options = {
10952
+ apiKey,
10953
+ baseUrl: apiUrl,
10954
+ sendToken: authenticated && !options.anonymous,
10955
+ ...options,
10956
+ };
10957
+ try {
10958
+ const { body } = await request.send(options);
10959
+ return body;
10960
+ }
10961
+ catch (err) {
10962
+ if (err.statusCode !== 401) {
10963
+ throw err;
10964
+ }
10965
+ // Always return the API error when the anonymous flag is used.
10966
+ if (options.anonymous) {
10967
+ throw err;
10968
+ }
10969
+ // We want to allow unauthenticated users to make requests
10970
+ // to public resources, but still reject with a NotLoggedIn
10971
+ // error if the response ends up being a 401.
10972
+ if (!authenticated) {
10973
+ throw new errors.BalenaNotLoggedIn();
10974
+ }
10975
+ throw err;
10976
+ }
10977
+ }
10978
+ }
10979
+ const createPinejsClient = (...args) => {
10980
+ const pine = new PinejsClient(...args);
10981
+ // @ts-expect-error
10982
+ return pine;
10983
+ };
10984
+ exports.createPinejsClient = createPinejsClient;
10985
+
10986
+ },{"balena-errors":59,"pinejs-client-core":377,"url":477}],24:[function(require,module,exports){
10912
10987
  "use strict";
10913
10988
  /*
10914
10989
  Copyright 2016 Balena
@@ -10978,11 +11053,11 @@ const getSettings = function ({ settings }) {
10978
11053
  };
10979
11054
  exports.default = getSettings;
10980
11055
 
10981
- },{}],24:[function(require,module,exports){
11056
+ },{}],25:[function(require,module,exports){
10982
11057
  "use strict";
10983
11058
  Object.defineProperty(exports, "__esModule", { value: true });
10984
11059
 
10985
- },{}],25:[function(require,module,exports){
11060
+ },{}],26:[function(require,module,exports){
10986
11061
  "use strict";
10987
11062
  Object.defineProperty(exports, "__esModule", { value: true });
10988
11063
  exports.DeviceOverallStatus = void 0;
@@ -10999,13 +11074,13 @@ var DeviceOverallStatus;
10999
11074
  DeviceOverallStatus["SHIPPED"] = "shipped";
11000
11075
  })(DeviceOverallStatus = exports.DeviceOverallStatus || (exports.DeviceOverallStatus = {}));
11001
11076
 
11002
- },{}],26:[function(require,module,exports){
11003
- arguments[4][24][0].apply(exports,arguments)
11004
- },{"dup":24}],27:[function(require,module,exports){
11005
- arguments[4][24][0].apply(exports,arguments)
11006
- },{"dup":24}],28:[function(require,module,exports){
11007
- arguments[4][24][0].apply(exports,arguments)
11008
- },{"dup":24}],29:[function(require,module,exports){
11077
+ },{}],27:[function(require,module,exports){
11078
+ arguments[4][25][0].apply(exports,arguments)
11079
+ },{"dup":25}],28:[function(require,module,exports){
11080
+ arguments[4][25][0].apply(exports,arguments)
11081
+ },{"dup":25}],29:[function(require,module,exports){
11082
+ arguments[4][25][0].apply(exports,arguments)
11083
+ },{"dup":25}],30:[function(require,module,exports){
11009
11084
  "use strict";
11010
11085
  Object.defineProperty(exports, "__esModule", { value: true });
11011
11086
  exports.BuilderHelper = void 0;
@@ -11044,7 +11119,7 @@ class BuilderHelper {
11044
11119
  }
11045
11120
  exports.BuilderHelper = BuilderHelper;
11046
11121
 
11047
- },{"balena-errors":58}],30:[function(require,module,exports){
11122
+ },{"balena-errors":59}],31:[function(require,module,exports){
11048
11123
  "use strict";
11049
11124
  Object.defineProperty(exports, "__esModule", { value: true });
11050
11125
  exports.getAuthDependentMemoize = void 0;
@@ -11063,7 +11138,7 @@ const getAuthDependentMemoize = (pubsub, cacheInterval = DEFAULT_CACHING_INTERVA
11063
11138
  };
11064
11139
  exports.getAuthDependentMemoize = getAuthDependentMemoize;
11065
11140
 
11066
- },{"memoizee":332}],31:[function(require,module,exports){
11141
+ },{"memoizee":332}],32:[function(require,module,exports){
11067
11142
  "use strict";
11068
11143
  Object.defineProperty(exports, "__esModule", { value: true });
11069
11144
  exports.addCallbackSupportToModuleFactory = exports.addCallbackSupportToModule = void 0;
@@ -11110,7 +11185,7 @@ const addCallbackSupportToModuleFactory = (moduleFactory) => {
11110
11185
  };
11111
11186
  exports.addCallbackSupportToModuleFactory = addCallbackSupportToModuleFactory;
11112
11187
 
11113
- },{}],32:[function(require,module,exports){
11188
+ },{}],33:[function(require,module,exports){
11114
11189
  "use strict";
11115
11190
  Object.defineProperty(exports, "__esModule", { value: true });
11116
11191
  exports.timeSince = void 0;
@@ -11137,7 +11212,7 @@ const timeSince = (input, suffix = true) => {
11137
11212
  };
11138
11213
  exports.timeSince = timeSince;
11139
11214
 
11140
- },{"lodash/throttle":318,"memoizee":332,"moment":344}],33:[function(require,module,exports){
11215
+ },{"lodash/throttle":318,"memoizee":332,"moment":344}],34:[function(require,module,exports){
11141
11216
  "use strict";
11142
11217
  /*
11143
11218
  Copyright 2017 Balena
@@ -11248,7 +11323,7 @@ function buildDependentResource({ pine }, { resourceName, resourceKeyField, pare
11248
11323
  }
11249
11324
  exports.buildDependentResource = buildDependentResource;
11250
11325
 
11251
- },{"../util":42}],34:[function(require,module,exports){
11326
+ },{"../util":43}],35:[function(require,module,exports){
11252
11327
  "use strict";
11253
11328
  Object.defineProperty(exports, "__esModule", { value: true });
11254
11329
  exports.DeviceActionsService = void 0;
@@ -11284,7 +11359,7 @@ class DeviceActionsService {
11284
11359
  }
11285
11360
  exports.DeviceActionsService = DeviceActionsService;
11286
11361
 
11287
- },{}],35:[function(require,module,exports){
11362
+ },{}],36:[function(require,module,exports){
11288
11363
  "use strict";
11289
11364
  Object.defineProperty(exports, "__esModule", { value: true });
11290
11365
  exports.getOsUpdateHelper = void 0;
@@ -11315,14 +11390,14 @@ const getOsUpdateHelper = function (deviceUrlsBase, request) {
11315
11390
  };
11316
11391
  exports.getOsUpdateHelper = getOsUpdateHelper;
11317
11392
 
11318
- },{"../device-actions-service":34}],36:[function(require,module,exports){
11393
+ },{"../device-actions-service":35}],37:[function(require,module,exports){
11319
11394
  "use strict";
11320
11395
  Object.defineProperty(exports, "__esModule", { value: true });
11321
11396
  exports.hupActionHelper = void 0;
11322
11397
  const balena_hup_action_utils_1 = require("balena-hup-action-utils");
11323
11398
  exports.hupActionHelper = new balena_hup_action_utils_1.HUPActionHelper();
11324
11399
 
11325
- },{"balena-hup-action-utils":60}],37:[function(require,module,exports){
11400
+ },{"balena-hup-action-utils":61}],38:[function(require,module,exports){
11326
11401
  "use strict";
11327
11402
  Object.defineProperty(exports, "__esModule", { value: true });
11328
11403
  exports.ensureVersionCompatibility = exports.getDeviceOsSemverWithVariant = exports.normalizeDeviceOsVersion = void 0;
@@ -11379,7 +11454,7 @@ const ensureVersionCompatibility = function (version, minVersion, versionType) {
11379
11454
  };
11380
11455
  exports.ensureVersionCompatibility = ensureVersionCompatibility;
11381
11456
 
11382
- },{"./device":40,"balena-semver":67}],38:[function(require,module,exports){
11457
+ },{"./device":41,"balena-semver":67}],39:[function(require,module,exports){
11383
11458
  "use strict";
11384
11459
  Object.defineProperty(exports, "__esModule", { value: true });
11385
11460
  exports.generateCurrentServiceDetails = exports.getCurrentServiceDetailsPineExpand = void 0;
@@ -11497,7 +11572,7 @@ const generateCurrentServiceDetails = (rawDevice) => {
11497
11572
  };
11498
11573
  exports.generateCurrentServiceDetails = generateCurrentServiceDetails;
11499
11574
 
11500
- },{}],39:[function(require,module,exports){
11575
+ },{}],40:[function(require,module,exports){
11501
11576
  "use strict";
11502
11577
  Object.defineProperty(exports, "__esModule", { value: true });
11503
11578
  exports.isDeviceTypeCompatibleWith = exports.isOsArchitectureCompatibleWith = exports.normalizeDeviceType = exports.getBySlug = exports.findBySlug = void 0;
@@ -11547,7 +11622,7 @@ const isDeviceTypeCompatibleWith = (osDeviceType, targetAppDeviceType) => (0, ex
11547
11622
  !!osDeviceType.isDependent === !!targetAppDeviceType.isDependent;
11548
11623
  exports.isDeviceTypeCompatibleWith = isDeviceTypeCompatibleWith;
11549
11624
 
11550
- },{"balena-errors":58}],40:[function(require,module,exports){
11625
+ },{"balena-errors":59}],41:[function(require,module,exports){
11551
11626
  "use strict";
11552
11627
  Object.defineProperty(exports, "__esModule", { value: true });
11553
11628
  exports.isProvisioned = void 0;
@@ -11558,7 +11633,7 @@ const isProvisioned = (device) => {
11558
11633
  };
11559
11634
  exports.isProvisioned = isProvisioned;
11560
11635
 
11561
- },{}],41:[function(require,module,exports){
11636
+ },{}],42:[function(require,module,exports){
11562
11637
  (function (global){(function (){
11563
11638
  "use strict";
11564
11639
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -11581,7 +11656,7 @@ else {
11581
11656
  }
11582
11657
 
11583
11658
  }).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
11584
- },{}],42:[function(require,module,exports){
11659
+ },{}],43:[function(require,module,exports){
11585
11660
  "use strict";
11586
11661
  Object.defineProperty(exports, "__esModule", { value: true });
11587
11662
  exports.mergePineOptions = exports.mergePineOptionsTyped = exports.treatAsMissingDevice = exports.treatAsMissingApplication = exports.treatAsMissingOrganization = exports.isNoApplicationForKeyResponse = exports.isNoDeviceForKeyResponse = exports.isNotFoundResponse = exports.isUnauthorizedResponse = exports.withSupervisorLockedError = exports.isId = exports.onlyIf = exports.notImplemented = void 0;
@@ -11755,7 +11830,7 @@ const convertExpandToObject = (expandOption, cloneIfNeeded = false) => {
11755
11830
  return expandOption;
11756
11831
  };
11757
11832
 
11758
- },{"balena-errors":58}],43:[function(require,module,exports){
11833
+ },{"balena-errors":59}],44:[function(require,module,exports){
11759
11834
  "use strict";
11760
11835
  Object.defineProperty(exports, "__esModule", { value: true });
11761
11836
  exports.getLocalModeSupport = exports.checkLocalModeSupported = exports.LOCAL_MODE_SUPPORT_PROPERTIES = exports.LOCAL_MODE_ENV_VAR = void 0;
@@ -11802,7 +11877,7 @@ const getLocalModeSupport = (device) => {
11802
11877
  };
11803
11878
  exports.getLocalModeSupport = getLocalModeSupport;
11804
11879
 
11805
- },{"./device":40,"balena-semver":67}],44:[function(require,module,exports){
11880
+ },{"./device":41,"balena-semver":67}],45:[function(require,module,exports){
11806
11881
  "use strict";
11807
11882
  Object.defineProperty(exports, "__esModule", { value: true });
11808
11883
  exports.PubSub = void 0;
@@ -11832,7 +11907,7 @@ class PubSub {
11832
11907
  }
11833
11908
  exports.PubSub = PubSub;
11834
11909
 
11835
- },{}],45:[function(require,module,exports){
11910
+ },{}],46:[function(require,module,exports){
11836
11911
  "use strict";
11837
11912
  Object.defineProperty(exports, "__esModule", { value: true });
11838
11913
  // This gets replaced on build time.
@@ -11841,17 +11916,17 @@ Object.defineProperty(exports, "__esModule", { value: true });
11841
11916
  // being embedded in the dist of the consumer project
11842
11917
  // which we want to avoid, both b/c of the dist size increase &
11843
11918
  // the security concerns of including the versions of the dependencies
11844
- const sdkVersion = '16.9.1';
11919
+ const sdkVersion = '16.9.2';
11845
11920
  exports.default = sdkVersion;
11846
11921
 
11847
- },{}],46:[function(require,module,exports){
11922
+ },{}],47:[function(require,module,exports){
11848
11923
  "use strict";
11849
11924
  Object.defineProperty(exports, "__esModule", { value: true });
11850
11925
  exports.toWritable = void 0;
11851
11926
  const toWritable = (obj) => obj;
11852
11927
  exports.toWritable = toWritable;
11853
11928
 
11854
- },{}],47:[function(require,module,exports){
11929
+ },{}],48:[function(require,module,exports){
11855
11930
  (function (Buffer){(function (){
11856
11931
  'use strict';
11857
11932
  const nodeStream = require('stream');
@@ -11897,7 +11972,7 @@ module.exports.toWebReadableStream = function(stream) {
11897
11972
  };
11898
11973
 
11899
11974
  }).call(this)}).call(this,{"isBuffer":require("../../is-buffer/index.js")})
11900
- },{"../../is-buffer/index.js":157,"./lib/conversions":48,"is-stream":159,"stream":465,"web-streams-polyfill":495}],48:[function(require,module,exports){
11975
+ },{"../../is-buffer/index.js":157,"./lib/conversions":49,"is-stream":159,"stream":465,"web-streams-polyfill":495}],49:[function(require,module,exports){
11901
11976
  'use strict';
11902
11977
 
11903
11978
  const Readable = require('stream').Readable;
@@ -11995,7 +12070,7 @@ module.exports = {
11995
12070
  // let roundTrippedReader = readableWebToNode(webReader);
11996
12071
  // roundTrippedReader.pipe(process.stdout);
11997
12072
 
11998
- },{"stream":465,"web-streams-polyfill":495}],49:[function(require,module,exports){
12073
+ },{"stream":465,"web-streams-polyfill":495}],50:[function(require,module,exports){
11999
12074
  'use strict';
12000
12075
 
12001
12076
  Object.defineProperty(exports, '__esModule', { value: true });
@@ -12480,7 +12555,7 @@ exports.AbortController = AbortController;
12480
12555
  exports.AbortSignal = AbortSignal;
12481
12556
  exports.abortableFetch = abortableFetchDecorator;
12482
12557
 
12483
- },{}],50:[function(require,module,exports){
12558
+ },{}],51:[function(require,module,exports){
12484
12559
  (function (global){(function (){
12485
12560
  'use strict';
12486
12561
 
@@ -12990,7 +13065,7 @@ var objectKeys = Object.keys || function (obj) {
12990
13065
  };
12991
13066
 
12992
13067
  }).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
12993
- },{"object-assign":363,"util/":53}],51:[function(require,module,exports){
13068
+ },{"object-assign":363,"util/":54}],52:[function(require,module,exports){
12994
13069
  if (typeof Object.create === 'function') {
12995
13070
  // implementation from standard node.js 'util' module
12996
13071
  module.exports = function inherits(ctor, superCtor) {
@@ -13015,14 +13090,14 @@ if (typeof Object.create === 'function') {
13015
13090
  }
13016
13091
  }
13017
13092
 
13018
- },{}],52:[function(require,module,exports){
13093
+ },{}],53:[function(require,module,exports){
13019
13094
  module.exports = function isBuffer(arg) {
13020
13095
  return arg && typeof arg === 'object'
13021
13096
  && typeof arg.copy === 'function'
13022
13097
  && typeof arg.fill === 'function'
13023
13098
  && typeof arg.readUInt8 === 'function';
13024
13099
  }
13025
- },{}],53:[function(require,module,exports){
13100
+ },{}],54:[function(require,module,exports){
13026
13101
  (function (process,global){(function (){
13027
13102
  // Copyright Joyent, Inc. and other Node contributors.
13028
13103
  //
@@ -13612,7 +13687,7 @@ function hasOwnProperty(obj, prop) {
13612
13687
  }
13613
13688
 
13614
13689
  }).call(this)}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
13615
- },{"./support/isBuffer":52,"_process":379,"inherits":51}],54:[function(require,module,exports){
13690
+ },{"./support/isBuffer":53,"_process":379,"inherits":52}],55:[function(require,module,exports){
13616
13691
  "use strict";
13617
13692
  /*
13618
13693
  Copyright 2016-17 Balena
@@ -13701,7 +13776,7 @@ class APIKey {
13701
13776
  }
13702
13777
  exports.APIKey = APIKey;
13703
13778
 
13704
- },{"./token":57}],55:[function(require,module,exports){
13779
+ },{"./token":58}],56:[function(require,module,exports){
13705
13780
  "use strict";
13706
13781
  /*
13707
13782
  Copyright 2016-17 Balena
@@ -13896,7 +13971,7 @@ class BalenaAuth {
13896
13971
  }
13897
13972
  exports.default = BalenaAuth;
13898
13973
 
13899
- },{"./api-key":54,"./jwt":56,"balena-errors":58,"balena-settings-storage":70,"tslib":470}],56:[function(require,module,exports){
13974
+ },{"./api-key":55,"./jwt":57,"balena-errors":59,"balena-settings-storage":70,"tslib":470}],57:[function(require,module,exports){
13900
13975
  "use strict";
13901
13976
  /*
13902
13977
  Copyright 2016-17 Balena
@@ -14004,7 +14079,7 @@ class JWT {
14004
14079
  }
14005
14080
  exports.JWT = JWT;
14006
14081
 
14007
- },{"./token":57,"jwt-decode":164}],57:[function(require,module,exports){
14082
+ },{"./token":58,"jwt-decode":164}],58:[function(require,module,exports){
14008
14083
  "use strict";
14009
14084
  /*
14010
14085
  Copyright 2016-17 Balena
@@ -14029,7 +14104,7 @@ var TokenType;
14029
14104
  TokenType[TokenType["APIKey"] = 1] = "APIKey";
14030
14105
  })(TokenType = exports.TokenType || (exports.TokenType = {}));
14031
14106
 
14032
- },{}],58:[function(require,module,exports){
14107
+ },{}],59:[function(require,module,exports){
14033
14108
  "use strict";
14034
14109
  /*
14035
14110
  Copyright 2016 Balena
@@ -14500,7 +14575,7 @@ class BalenaInvalidParameterError extends BalenaError {
14500
14575
  exports.BalenaInvalidParameterError = BalenaInvalidParameterError;
14501
14576
  BalenaInvalidParameterError.prototype.code = 'BalenaInvalidParameterError';
14502
14577
 
14503
- },{"typed-error":476}],59:[function(require,module,exports){
14578
+ },{"typed-error":476}],60:[function(require,module,exports){
14504
14579
  "use strict";
14505
14580
  /*
14506
14581
  Copyright 2017 Balena Ltd.
@@ -14608,7 +14683,7 @@ exports.actionsConfig = {
14608
14683
  },
14609
14684
  };
14610
14685
 
14611
- },{}],60:[function(require,module,exports){
14686
+ },{}],61:[function(require,module,exports){
14612
14687
  "use strict";
14613
14688
  /*
14614
14689
  Copyright 2017 Balena Ltd.
@@ -14769,7 +14844,7 @@ var HUPActionHelper = /** @class */ (function () {
14769
14844
  }());
14770
14845
  exports.HUPActionHelper = HUPActionHelper;
14771
14846
 
14772
- },{"./config":59,"./types":61,"balena-semver":67,"tslib":470}],61:[function(require,module,exports){
14847
+ },{"./config":60,"./types":62,"balena-semver":67,"tslib":470}],62:[function(require,module,exports){
14773
14848
  "use strict";
14774
14849
  /*
14775
14850
  Copyright 2017 Balena Ltd.
@@ -14788,50 +14863,7 @@ exports.HUPActionHelper = HUPActionHelper;
14788
14863
  */
14789
14864
  Object.defineProperty(exports, "__esModule", { value: true });
14790
14865
 
14791
- },{}],62:[function(require,module,exports){
14792
- "use strict";
14793
- Object.defineProperty(exports, "__esModule", { value: true });
14794
- exports.BalenaPine = void 0;
14795
- const tslib_1 = require("tslib");
14796
- const url = require("url");
14797
- const errors = require("balena-errors");
14798
- const pinejs_client_core_1 = require("pinejs-client-core");
14799
- class BalenaPine extends pinejs_client_core_1.PinejsClientCore {
14800
- constructor(params, backendParams) {
14801
- super(Object.assign(Object.assign({}, params), { apiPrefix: url.resolve(backendParams.apiUrl, `/${backendParams.apiVersion}/`) }));
14802
- this.backendParams = backendParams;
14803
- this.backendParams = backendParams;
14804
- this.API_URL = backendParams.apiUrl;
14805
- this.API_VERSION = backendParams.apiVersion;
14806
- }
14807
- _request(options) {
14808
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
14809
- const { apiKey, apiUrl, auth, request } = this.backendParams;
14810
- const hasKey = yield auth.hasKey();
14811
- const authenticated = hasKey || (apiKey != null && apiKey.length > 0);
14812
- options = Object.assign({ apiKey, baseUrl: apiUrl, sendToken: authenticated && !options.anonymous }, options);
14813
- try {
14814
- const { body } = yield request.send(options);
14815
- return body;
14816
- }
14817
- catch (err) {
14818
- if (err.statusCode !== 401) {
14819
- throw err;
14820
- }
14821
- if (options.anonymous) {
14822
- throw err;
14823
- }
14824
- if (!authenticated) {
14825
- throw new errors.BalenaNotLoggedIn();
14826
- }
14827
- throw err;
14828
- }
14829
- });
14830
- }
14831
- }
14832
- exports.BalenaPine = BalenaPine;
14833
-
14834
- },{"balena-errors":58,"pinejs-client-core":377,"tslib":470,"url":477}],63:[function(require,module,exports){
14866
+ },{}],63:[function(require,module,exports){
14835
14867
  "use strict";
14836
14868
  /*
14837
14869
  Copyright 2016-2020 Balena Ltd.
@@ -15119,7 +15151,7 @@ function estimate(requestAsync, isBrowser) {
15119
15151
  exports.estimate = estimate;
15120
15152
 
15121
15153
  }).call(this)}).call(this,require('_process'))
15122
- },{"./utils":66,"@balena/node-web-streams":47,"_process":379,"progress-stream":380,"stream":465,"tslib":470,"zlib":74}],65:[function(require,module,exports){
15154
+ },{"./utils":66,"@balena/node-web-streams":48,"_process":379,"progress-stream":380,"stream":465,"tslib":470,"zlib":74}],65:[function(require,module,exports){
15123
15155
  "use strict";
15124
15156
  /*
15125
15157
  Copyright 2016-2020 Balena Ltd.
@@ -15488,7 +15520,7 @@ function getRequest({ auth, debug = false, retries = 0, isBrowser = false, inter
15488
15520
  }
15489
15521
  exports.getRequest = getRequest;
15490
15522
 
15491
- },{"./progress":64,"./utils":66,"balena-errors":58,"fetch-readablestream":144,"tslib":470,"url":477}],66:[function(require,module,exports){
15523
+ },{"./progress":64,"./utils":66,"balena-errors":59,"fetch-readablestream":144,"tslib":470,"url":477}],66:[function(require,module,exports){
15492
15524
  "use strict";
15493
15525
  /*
15494
15526
  Copyright 2016-2020 Balena Ltd.
@@ -15897,7 +15929,7 @@ function getRequestAsync($fetch = normalFetch) {
15897
15929
  }
15898
15930
  exports.getRequestAsync = getRequestAsync;
15899
15931
 
15900
- },{"balena-auth/build/token":57,"balena-errors":58,"fetch-ponyfill":142,"qs":382,"tslib":470,"url":477}],67:[function(require,module,exports){
15932
+ },{"balena-auth/build/token":58,"balena-errors":59,"fetch-ponyfill":142,"qs":382,"tslib":470,"url":477}],67:[function(require,module,exports){
15901
15933
  "use strict";
15902
15934
  Object.defineProperty(exports, "__esModule", { value: true });
15903
15935
  var memoize = require("lodash/memoize");
@@ -16648,7 +16680,7 @@ const getStorage = ({ dataDirectory, } = {}) => {
16648
16680
  };
16649
16681
  module.exports = getStorage;
16650
16682
 
16651
- },{"./local-storage":68,"balena-errors":58,"tslib":470}],71:[function(require,module,exports){
16683
+ },{"./local-storage":68,"balena-errors":59,"tslib":470}],71:[function(require,module,exports){
16652
16684
  'use strict'
16653
16685
 
16654
16686
  exports.byteLength = byteLength
@@ -17214,7 +17246,7 @@ Zlib.prototype._reset = function () {
17214
17246
 
17215
17247
  exports.Zlib = Zlib;
17216
17248
  }).call(this)}).call(this,require('_process'),require("buffer").Buffer)
17217
- },{"_process":379,"assert":50,"buffer":75,"pako/lib/zlib/constants":368,"pako/lib/zlib/deflate.js":370,"pako/lib/zlib/inflate.js":372,"pako/lib/zlib/zstream":376}],74:[function(require,module,exports){
17249
+ },{"_process":379,"assert":51,"buffer":75,"pako/lib/zlib/constants":368,"pako/lib/zlib/deflate.js":370,"pako/lib/zlib/inflate.js":372,"pako/lib/zlib/zstream":376}],74:[function(require,module,exports){
17218
17250
  (function (process){(function (){
17219
17251
  'use strict';
17220
17252
 
@@ -17826,7 +17858,7 @@ util.inherits(DeflateRaw, Zlib);
17826
17858
  util.inherits(InflateRaw, Zlib);
17827
17859
  util.inherits(Unzip, Zlib);
17828
17860
  }).call(this)}).call(this,require('_process'))
17829
- },{"./binding":73,"_process":379,"assert":50,"buffer":75,"stream":465,"util":82}],75:[function(require,module,exports){
17861
+ },{"./binding":73,"_process":379,"assert":51,"buffer":75,"stream":465,"util":82}],75:[function(require,module,exports){
17830
17862
  (function (Buffer){(function (){
17831
17863
  /*!
17832
17864
  * The buffer module from node.js, for the browser.
@@ -20841,12 +20873,12 @@ exports.clearImmediate = typeof clearImmediate === "function" ? clearImmediate :
20841
20873
  };
20842
20874
  }).call(this)}).call(this,require("timers").setImmediate,require("timers").clearImmediate)
20843
20875
  },{"process/browser.js":379,"timers":79}],80:[function(require,module,exports){
20844
- arguments[4][51][0].apply(exports,arguments)
20845
- },{"dup":51}],81:[function(require,module,exports){
20846
20876
  arguments[4][52][0].apply(exports,arguments)
20847
- },{"dup":52}],82:[function(require,module,exports){
20877
+ },{"dup":52}],81:[function(require,module,exports){
20848
20878
  arguments[4][53][0].apply(exports,arguments)
20849
- },{"./support/isBuffer":81,"_process":379,"dup":53,"inherits":80}],83:[function(require,module,exports){
20879
+ },{"dup":53}],82:[function(require,module,exports){
20880
+ arguments[4][54][0].apply(exports,arguments)
20881
+ },{"./support/isBuffer":81,"_process":379,"dup":54,"inherits":80}],83:[function(require,module,exports){
20850
20882
  'use strict';
20851
20883
 
20852
20884
  var GetIntrinsic = require('get-intrinsic');