@balena/open-balena-api 26.4.6 → 26.4.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -8,11 +8,11 @@ const toUuid = (strippedUuid) => {
8
8
  return '';
9
9
  }
10
10
  return [
11
- strippedUuid.substr(0, 8),
12
- strippedUuid.substr(8, 4),
13
- strippedUuid.substr(12, 4),
14
- strippedUuid.substr(16, 4),
15
- strippedUuid.substr(20, 12),
11
+ strippedUuid.substring(0, 8),
12
+ strippedUuid.substring(8, 12),
13
+ strippedUuid.substring(12, 16),
14
+ strippedUuid.substring(16, 20),
15
+ strippedUuid.substring(20, 32),
16
16
  ].join('-');
17
17
  };
18
18
  hooks.addPureHook('POST', 'resin', 'application', {
@@ -1 +1 @@
1
- {"version":3,"file":"defaults.js","sourceRoot":"","sources":["../../../../src/features/applications/hooks/defaults.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,sBAAsB,EAAE,MAAM,8CAA8C,CAAC;AAEtF,2DAA2D;AAC3D,MAAM,MAAM,GAAG,CAAC,YAAoB,EAAU,EAAE;IAC/C,IAAI,YAAY,CAAC,MAAM,KAAK,EAAE,EAAE,CAAC;QAChC,OAAO,EAAE,CAAC;IACX,CAAC;IAED,OAAO;QACN,YAAY,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC;QACzB,YAAY,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC;QACzB,YAAY,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC,CAAC;QAC1B,YAAY,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC,CAAC;QAC1B,YAAY,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,CAAC;KAC3B,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACb,CAAC,CAAC;AAEF,KAAK,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,IAAI,CAAC;IACnD,CAAC;CACD,CAAC,CAAC"}
@@ -9,6 +9,7 @@ import { createProvisioningApiKey, createUserApiKey } from '../api-keys/lib.js';
9
9
  const { BadRequestError } = errors;
10
10
  // FIXME(refactor): many of the following are resin-specific
11
11
  import { API_HOST, DELTA_HOST, MIXPANEL_TOKEN, NODE_EXTRA_CA_CERTS, REGISTRY2_HOST, VPN_HOST, VPN_PORT, LOGS_HOST, } from '../../lib/config.js';
12
+ import { getBodyOrQueryParam } from '../../lib/utils.js';
12
13
  // `osVersion == null` means assume "latest"
13
14
  export const generateConfig = async (req, app, deviceType, osVersion) => {
14
15
  // Devices running ResinOS >=1.2.1 are capable of using Registry v2, while earlier ones must use v1
@@ -28,18 +29,9 @@ export const generateConfig = async (req, app, deviceType, osVersion) => {
28
29
  }
29
30
  // Checking both req.body and req.query given both GET and POST support
30
31
  // Ref: https://github.com/balena-io/balena-api/blob/master/src/routes/applications.ts#L95
31
- apiKeyOptions.name =
32
- req.body.provisioningKeyName ??
33
- req.query.provisioningKeyName ??
34
- 'Automatically generated provisioning key';
35
- apiKeyOptions.description =
36
- req.body.provisioningKeyDescription ??
37
- req.query.provisioningKeyDescription ??
38
- 'Automatically generated for an image download or config file generation';
39
- apiKeyOptions.expiryDate =
40
- req.body.provisioningKeyExpiryDate ??
41
- req.query.provisioningKeyExpiryDate ??
42
- undefined;
32
+ apiKeyOptions.name = getBodyOrQueryParam(req, 'provisioningKeyName', 'Automatically generated provisioning key');
33
+ apiKeyOptions.description = getBodyOrQueryParam(req, 'provisioningKeyDescription', 'Automatically generated for an image download or config file generation');
34
+ apiKeyOptions.expiryDate = getBodyOrQueryParam(req, 'provisioningKeyExpiryDate');
43
35
  return await createProvisioningApiKey(req, app.id, apiKeyOptions);
44
36
  })(),
45
37
  ]);
@@ -82,13 +74,15 @@ export const generateConfig = async (req, app, deviceType, osVersion) => {
82
74
  },
83
75
  version: osVersion,
84
76
  }, {
85
- appUpdatePollInterval: parseInt(req.param('appUpdatePollInterval'), 10) * 60 * 1000,
86
- network: req.body.network ?? req.query.network,
87
- wifiSsid: req.param('wifiSsid'),
88
- wifiKey: req.param('wifiKey'),
89
- ip: req.param('ip'),
90
- gateway: req.param('gateway'),
91
- netmask: req.param('netmask'),
77
+ appUpdatePollInterval: parseInt(getBodyOrQueryParam(req, 'appUpdatePollInterval'), 10) *
78
+ 60 *
79
+ 1000,
80
+ network: getBodyOrQueryParam(req, 'network'),
81
+ wifiSsid: getBodyOrQueryParam(req, 'wifiSsid'),
82
+ wifiKey: getBodyOrQueryParam(req, 'wifiKey'),
83
+ ip: getBodyOrQueryParam(req, 'ip'),
84
+ gateway: getBodyOrQueryParam(req, 'gateway'),
85
+ netmask: getBodyOrQueryParam(req, 'netmask'),
92
86
  });
93
87
  _(deviceType.options)
94
88
  .flatMap((opt) => {
@@ -111,7 +105,7 @@ export const generateConfig = async (req, app, deviceType, osVersion) => {
111
105
  if (rootCA != null) {
112
106
  config.balenaRootCA = rootCA;
113
107
  }
114
- const developmentMode = (req.param('developmentMode') ?? osVersion?.endsWith('.dev'))?.toString();
108
+ const developmentMode = (getBodyOrQueryParam(req, 'developmentMode') ?? osVersion?.endsWith('.dev'))?.toString();
115
109
  if (['true', 'on', '1'].includes(developmentMode || '')) {
116
110
  config.developmentMode = true;
117
111
  }
@@ -1 +1 @@
1
- {"version":3,"file":"device-config.js","sourceRoot":"","sources":["../../../src/features/device-config/device-config.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,CAAC,MAAM,QAAQ,CAAC;AAEvB,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,YAAY,MAAM,sBAAsB,CAAC;AAEhD,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAC;AAGvE,OA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,CAAC,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,EAAE,EAAE;QAC9B,MAAM,CAAC,UAAU,CAAC,GAAG,GAAG,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;IAC5C,CAAC,CAAC,CAAC;IACJ,IAAI,MAAM,IAAI,IAAI,EAAE,CAAC;QACpB,MAAM,CAAC,YAAY,GAAG,MAAM,CAAC;IAC9B,CAAC;IAED,MAAM,eAAe,GAAG,CACvB,mBAAmB,CAAC,GAAG,EAAE,iBAAiB,CAAC,IAAI,SAAS,EAAE,QAAQ,CAAC,MAAM,CAAC,CAC1E,EAAE,QAAQ,EAAE,CAAC;IACd,IAAI,CAAC,MAAM,EAAE,IAAI,EAAE,GAAG,CAAC,CAAC,QAAQ,CAAC,eAAe,IAAI,EAAE,CAAC,EAAE,CAAC;QACzD,MAAM,CAAC,eAAe,GAAG,IAAI,CAAC;IAC/B,CAAC;IAED,OAAO,MAAM,CAAC;AACf,CAAC,CAAC"}
@@ -2,7 +2,7 @@ import { sbvrUtils, errors } from '@balena/pinejs';
2
2
  import { captureException, handleHttpErrors, translateError, } from '../../infra/error-handling/index.js';
3
3
  import { generateConfig } from './device-config.js';
4
4
  import { findBySlug } from '../device-types/device-types.js';
5
- import { checkInt } from '../../lib/utils.js';
5
+ import { checkInt, getBodyOrQueryParam } from '../../lib/utils.js';
6
6
  const { UnauthorizedError, NotFoundError } = errors;
7
7
  const { api } = sbvrUtils;
8
8
  const getApp = async (appId, req) => {
@@ -26,13 +26,13 @@ const getApp = async (appId, req) => {
26
26
  return app;
27
27
  };
28
28
  export const downloadImageConfig = async (req, res) => {
29
- const appId = checkInt(req.body.appId ?? req.query.appId);
29
+ const appId = checkInt(getBodyOrQueryParam(req, 'appId'));
30
30
  if (!appId) {
31
31
  res.status(400).send('An appId is required.');
32
32
  return;
33
33
  }
34
- const deviceTypeSlug = req.body.deviceType ?? req.query.deviceType;
35
- const osVersion = req.body.version ?? req.query.version;
34
+ const deviceTypeSlug = getBodyOrQueryParam(req, 'deviceType');
35
+ const osVersion = getBodyOrQueryParam(req, 'version');
36
36
  if (!osVersion) {
37
37
  res.status(400).send('A version is required.');
38
38
  return;
@@ -1 +1 @@
1
- {"version":3,"file":"download.js","sourceRoot":"","sources":["../../../src/features/device-config/download.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAEnD,OAAO,EACN,gBAAgB,EAChB,gBAAgB,EAChB,cAAc,GACd,MAAM,qCAAqC,CAAC;AAE7C,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAC7D,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C,MAAM,EAAE,iBAAiB,EAAE,aAAa,EAAE,GAAG,MAAM,CAAC;AACpD,MAAM,EAAE,GAAG,EAAE,GAAG,SAAS,CAAC;AAE1B,MAAM,MAAM,GAAG,KAAK,EAAE,KAAa,EAAE,GAAY,EAAE,EAAE;IACpD,MAAM,GAAG,GAAG,MAAM,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC;QAC/B,QAAQ,EAAE,aAAa;QACvB,EAAE,EAAE,KAAK;QACT,WAAW,EAAE,EAAE,GAAG,EAAE;QACpB,OAAO,EAAE;YACR,OAAO,EAAE,IAAI;YACb,OAAO,EAAE;gBACR,mBAAmB,EAAE;oBACpB,OAAO,EAAE,CAAC,MAAM,CAAC;iBACjB;aACD;SACD;KACQ,CAAC,CAAC;IAEZ,8DAA8D;IAC9D,IAAI,GAAG,IAAI,IAAI,EAAE,CAAC;QACjB,MAAM,IAAI,iBAAiB,CAC1B,uDAAuD,CACvD,CAAC;IACH,CAAC;IACD,OAAO,GAAG,CAAC;AACZ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,mBAAmB,GAAmB,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE;IACrE,MAAM,K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Aa,GAAG,GAAG,CAAC;QACxB,IAAI,aAAa,YAAY,iBAAiB,EAAE,CAAC;YAChD,aAAa,GAAG,IAAI,aAAa,CAAC,aAAa,CAAC,CAAC;QAClD,CAAC;QACD,IAAI,gBAAgB,CAAC,GAAG,EAAE,GAAG,EAAE,aAAa,CAAC,EAAE,CAAC;YAC/C,OAAO;QACR,CAAC;QACD,gBAAgB,CAAC,aAAa,EAAE,yBAAyB,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC;QACpE,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,aAAa,CAAC,CAAC,CAAC;IACrD,CAAC;AACF,CAAC,CAAC"}
@@ -136,7 +136,7 @@ export class LokiBackend {
136
136
  incrementPublishLogMessagesDropped(countLogs);
137
137
  let message = `Failed to publish logs to ${LOKI_HOST}:${LOKI_PORT} for device ${ctx.uuid}`;
138
138
  if (VERBOSE_ERROR_MESSAGE) {
139
- message += JSON.stringify(logs, (key, value) => (key === 'nanoTimestamp' ? undefined : value), '\t').substr(0, 1000);
139
+ message += JSON.stringify(logs, (key, value) => (key === 'nanoTimestamp' ? undefined : value), '\t').substring(0, 1000);
140
140
  }
141
141
  captureException(err, message);
142
142
  throw new BadRequestError(`Failed to publish logs for device ${ctx.uuid}`);
@@ -1 +1 @@
1
- {"version":3,"file":"loki.js","sourceRoot":"","sources":["../../../../../src/features/device-logs/lib/backends/loki.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,QAAQ,CAAC;AACvB,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAEtC,OAAO,IAAI,MAAM,kBAAkB,CAAC;AAEpC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAChE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAQjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,2CAA2C,CAAC;AAC7E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,CAAC;YACnC,yBAAyB;YACzB,IAAI,MAAM,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC;YACjC,IAAI,CAAC,MAAM,EAAE,CAAC;gBACb,sCAAsC;gBACtC,MAAM,GAAG,IAAI,IAAI,CAAC,aAAa,EAAE,CAAC;gBAClC,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;gBACzB,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;gBACrB,WAAW,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC;YAC9B,CAAC;YACD,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;QAC1B,CAAC;QACD,OAAO,OAAO,CAAC;IAChB,CAAC;CACD"}
package/dist/index.d.ts CHANGED
@@ -138,6 +138,7 @@ export declare const utils: {
138
138
  isValidInteger: (num: any) => num is number;
139
139
  varListInsert: (varList: import("./features/device-state/state-get-utils.js").EnvVarList, obj: Dictionary<string>, filterFn?: (name: string) => boolean) => void;
140
140
  throttledForEach: <T, U>(array: T[], delayMS: number, fn: (item: T) => PromiseLike<U> | U) => Promise<U[]>;
141
+ getBodyOrQueryParam: (req: Request, paramName: string, defaultValue?: string) => any;
141
142
  };
142
143
  export declare const apiKeys: {
143
144
  augmentReqApiKeyPermissions: <T extends pine.permissions.PermissionReq>(req: T, extraPermissions: string[], mutateRequestObject?: boolean) => T;
package/dist/index.js CHANGED
@@ -34,7 +34,7 @@ import { augmentReqApiKeyPermissions, isApiKeyWithRole, } from './features/api-k
34
34
  import { setupDeleteCascade as addDeleteHookForDependents } from './features/cascade-delete/setup-delete-cascade.js';
35
35
  import { updateOrInsertModel, getOrInsertModelId, } from './infra/pinejs-client-helpers/index.js';
36
36
  import { normalizeHandle, refreshToken } from './features/auth/index.js';
37
- import { getIP, getIPv4, isValidInteger, throttledForEach, } from './lib/utils.js';
37
+ import { getIP, getIPv4, isValidInteger, throttledForEach, getBodyOrQueryParam, } from './lib/utils.js';
38
38
  import { createRateLimitMiddleware, createRateLimiter, getUserIDFromCreds, } from './infra/rate-limiting/index.js';
39
39
  import { getAccessibleDeviceTypes, findBySlug, getDeviceTypeBySlug, } from './features/device-types/device-types.js';
40
40
  import { proxy as supervisorProxy } from './features/device-proxy/device-proxy.js';
@@ -119,6 +119,7 @@ export const utils = {
119
119
  isValidInteger,
120
120
  varListInsert,
121
121
  throttledForEach,
122
+ getBodyOrQueryParam,
122
123
  };
123
124
  export const apiKeys = {
124
125
  augmentReqApiKeyPermissions,
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,2CAA2C;AAE3C,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,UAAU,MAAM,aAAa,CAAC;AACrC,OAAO,WAAW,MAAM,kBAAkB,CAAC;AAC3C,OAAO,YAAY,MAAM,cAAc,CAAC;AACxC,OAAO,YAAY,MAAM,eAAe,CAAC;AACzC,OAAO,aAAa,MAAM,gBAAgB,CAAC;AAG3C,OAAO,CAAC,MAAM,QAAQ,CAAC;AACvB,OAAO,cAAc,MAAM,iBAAiB,CAAC;AAC7C,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,KAAK,MAAM,MAAM,cAAc,CAAC;AACvC,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAElC,OAAO,KAAK,IAAI,MAAM,gBAAgB,CAAC;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAO3C,OAAO,KAAK,GAAG,MAAM,8BAA8B,CAAC;AAEpD,MAAM,EAAE,GAAG,EAAE,GAAG,SAAS,CAAC;AAE1B,iCAAiC;AACjC,QAAQ,CAAC,GAAG,CACX,GAAG,CAAC,cAAc,CACjB,KAAK,EAAE,EAAU,EAAE,EAAE,CACpB,MAAM,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC;IACnB,QAAQ,EAAE,MAAM;IAChB,EAAE;IACF,WAAW,EAAE,EAAE,G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C,KAAK,CAAC,iBAAiB,IAAI,EAAE,CAAC,CAAC;IAC1E,OAAO,MAAO,CAAC;AAChB,CAAC"}
@@ -14,3 +14,4 @@ export declare const withRetries: <T>(func: () => Promise<T>, delayDuration?: nu
14
14
  * or when need order guarantees while iterating the keys.
15
15
  */
16
16
  export declare const groupByMap: <K, V>(entries: V[], iteratee: (item: V) => K) => Map<K, V[]>;
17
+ export declare const getBodyOrQueryParam: (req: Request, paramName: string, defaultValue?: string) => any;
package/dist/lib/utils.js CHANGED
@@ -94,4 +94,5 @@ export const groupByMap = (entries, iteratee) => {
94
94
  }
95
95
  return result;
96
96
  };
97
+ export const getBodyOrQueryParam = (req, paramName, defaultValue) => req.body[paramName] ?? req.query[paramName] ?? defaultValue;
97
98
  //# sourceMappingURL=utils.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/lib/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C,OAAO,MAAM,MAAM,WAAW,CAAC;AAC/B,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AACjC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,wFAAwF;AACxF,iFAAiF;AACjF,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,GAAG,QAAQ,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;AAEvE,MAAM,UAAU,gBAAgB;IAC/B,OAAO,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;AACzC,CAAC;AAED,MAAM,CAAC,MAAM,gBAAgB,GAAG,SAAS,CAAC,WAAW,CAAC,CAAC;AAEvD,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,GAAQ,EAAiB,EAAE;IACzD,MAAM,CAAC,GAAG,QAAQ,CAAC,GA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ACd,IAAI,OAAO,IAAI,CAAC,EAAE,CAAC;YAClB,MAAM,GAAG,CAAC;QACX,CAAC;QAED,MAAM,UAAU,CAAC,aAAa,CAAC,CAAC;QAChC,OAAO,MAAM,WAAW,CAAC,IAAI,EAAE,aAAa,EAAE,OAAO,GAAG,CAAC,CAAC,CAAC;IAC5D,CAAC;AACF,CAAC,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,CAAO,OAAY,EAAE,QAAwB,EAAE,EAAE;IAC1E,MAAM,MAAM,GAAG,IAAI,GAAG,EAAU,CAAC;IACjC,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE,CAAC;QAC7B,MAAM,GAAG,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;QAC5B,IAAI,QAAQ,GAAG,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAC/B,IAAI,QAAQ,IAAI,IAAI,EAAE,CAAC;YACtB,QAAQ,GAAG,EAAE,CAAC;YACd,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;QAC3B,CAAC;QACD,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACtB,CAAC;IACD,OAAO,MAAM,CAAC;AACf,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAClC,GAAY,EACZ,SAAiB,EACjB,YAAqB,EACpB,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,GAAG,CAAC,KAAK,CAAC,SAAS,CAAC,IAAI,YAAY,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@balena/open-balena-api",
3
3
  "description": "Internet of things, Made Simple",
4
- "version": "26.4.6",
4
+ "version": "26.4.7",
5
5
  "license": "AGPL-3.0",
6
6
  "repository": {
7
7
  "type": "git",
@@ -168,6 +168,6 @@
168
168
  "loader": "ts-node/esm/transpile-only"
169
169
  },
170
170
  "versionist": {
171
- "publishedAt": "2024-09-03T10:14:11.397Z"
171
+ "publishedAt": "2024-09-03T11:07:11.007Z"
172
172
  }
173
173
  }