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.
@@ -554,6 +554,7 @@ const getApplicationModel = function (deps, opts) {
554
554
  return;
555
555
  }
556
556
  await batchApplicationOperation()({
557
+ parameterName: 'slugOrUuidOrIdOrIds',
557
558
  uuidOrIdOrArray: slugOrUuidOrIdOrIds,
558
559
  fn: async (applications) => {
559
560
  await pine.delete({
@@ -392,6 +392,9 @@ const getDeviceModel = function (deps, opts) {
392
392
  if (uuidOrId == null) {
393
393
  throw new errors.BalenaDeviceNotFound(uuidOrId);
394
394
  }
395
+ if (uuidOrId === '') {
396
+ throw new errors.BalenaInvalidParameterError('uuidOrId', uuidOrId);
397
+ }
395
398
  let device;
396
399
  const isPotentiallyFullUuid = (0, util_1.isFullUuid)(uuidOrId);
397
400
  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;