balena-sdk 20.2.2 → 20.2.3

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.
@@ -563,6 +563,7 @@ const getApplicationModel = function (deps, opts) {
563
563
  return;
564
564
  }
565
565
  await batchApplicationOperation()({
566
+ parameterName: 'slugOrUuidOrIdOrIds',
566
567
  uuidOrIdOrArray: slugOrUuidOrIdOrIds,
567
568
  fn: async (applications) => {
568
569
  await pine.delete({
@@ -397,6 +397,9 @@ const getDeviceModel = function (deps, opts) {
397
397
  if (uuidOrId == null) {
398
398
  throw new errors.BalenaDeviceNotFound(uuidOrId);
399
399
  }
400
+ if (uuidOrId === '') {
401
+ throw new errors.BalenaInvalidParameterError('uuidOrId', uuidOrId);
402
+ }
400
403
  let device;
401
404
  const isPotentiallyFullUuid = (0, util_1.isFullUuid)(uuidOrId);
402
405
  if (isPotentiallyFullUuid || (0, util_1.isId)(uuidOrId)) {
@@ -72,6 +72,9 @@ const getReleaseModel = function (deps, opts) {
72
72
  if (commitOrIdOrRawVersion == null) {
73
73
  throw new errors.BalenaReleaseNotFound(commitOrIdOrRawVersion);
74
74
  }
75
+ if (commitOrIdOrRawVersion === '') {
76
+ throw new errors.BalenaInvalidParameterError('commitOrIdOrRawVersion', commitOrIdOrRawVersion);
77
+ }
75
78
  if ((0, util_1.isId)(commitOrIdOrRawVersion)) {
76
79
  const release = await pine.get({
77
80
  resource: 'release',
@@ -14,6 +14,7 @@ export declare function batchResourceOperationFactory<T extends {
14
14
  }): {
15
15
  <TOpts extends PineOptionsStrict<T>>(options: {
16
16
  uuidOrIdOrArray: number | number[] | string | string[];
17
+ parameterName?: string;
17
18
  options?: TOpts;
18
19
  groupByNavigationPoperty?: undefined;
19
20
  fn: (items: Array<{
@@ -23,6 +24,7 @@ export declare function batchResourceOperationFactory<T extends {
23
24
  }): Promise<void>;
24
25
  <TOpts extends PineOptionsStrict<T>>(options: {
25
26
  uuidOrIdOrArray: number | number[] | string | string[];
27
+ parameterName?: string;
26
28
  options?: TOpts;
27
29
  groupByNavigationPoperty: PineSelectableProps<T>;
28
30
  fn: (items: Array<{
@@ -18,10 +18,13 @@ function batchResourceOperationFactory({ getAll, NotFoundError, AmbiguousResourc
18
18
  numericId: (_a = chunkSizeParam === null || chunkSizeParam === void 0 ? void 0 : chunkSizeParam.numericId) !== null && _a !== void 0 ? _a : NUMERIC_ID_CHUNK_SIZE,
19
19
  stringId: (_b = chunkSizeParam === null || chunkSizeParam === void 0 ? void 0 : chunkSizeParam.stringId) !== null && _b !== void 0 ? _b : STRING_ID_CHUNK_SIZE,
20
20
  };
21
- async function batchResourceOperation({ uuidOrIdOrArray, options, groupByNavigationPoperty, fn, }) {
21
+ async function batchResourceOperation({ uuidOrIdOrArray, parameterName = 'uuidOrIdOrArray', options, groupByNavigationPoperty, fn, }) {
22
+ if (uuidOrIdOrArray === '') {
23
+ throw new errors.BalenaInvalidParameterError(parameterName, uuidOrIdOrArray);
24
+ }
22
25
  if (Array.isArray(uuidOrIdOrArray)) {
23
26
  if (!uuidOrIdOrArray.length) {
24
- throw new errors.BalenaInvalidParameterError('uuidOrIdOrArray', uuidOrIdOrArray);
27
+ throw new errors.BalenaInvalidParameterError(parameterName, uuidOrIdOrArray);
25
28
  }
26
29
  let lastType = typeof uuidOrIdOrArray[0];
27
30
  for (const param of uuidOrIdOrArray) {
@@ -6,5 +6,5 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  // being embedded in the dist of the consumer project
7
7
  // which we want to avoid, both b/c of the dist size increase &
8
8
  // the security concerns of including the versions of the dependencies
9
- const sdkVersion = '20.2.2';
9
+ const sdkVersion = '20.2.3';
10
10
  exports.default = sdkVersion;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "balena-sdk",
3
- "version": "20.2.2",
3
+ "version": "20.2.3",
4
4
  "description": "The Balena JavaScript SDK",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -139,6 +139,6 @@
139
139
  "tslib": "^2.1.0"
140
140
  },
141
141
  "versionist": {
142
- "publishedAt": "2024-10-01T19:10:52.999Z"
142
+ "publishedAt": "2024-10-14T20:42:16.619Z"
143
143
  }
144
144
  }