@balena/open-balena-api 26.4.8 → 26.4.9-build-v6-number-image-image-size--43d566a1b0933a3a8cae254ec3ea1eb34e3a0242-1
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/translations/v6/numeric-big-integer-hack.d.ts +1 -0
- package/dist/translations/v6/numeric-big-integer-hack.js +16 -0
- package/dist/translations/v6/numeric-big-integer-hack.js.map +1 -0
- package/dist/translations/v6/v6.d.ts +1 -0
- package/dist/translations/v6/v6.js +13 -0
- package/dist/translations/v6/v6.js.map +1 -1
- package/dist/translations/v6/v6.sbvr +1 -1
- package/package.json +2 -2
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1,16 @@
|
|
1
|
+
import SbvrTypes from '@balena/sbvr-types';
|
2
|
+
// @ts-expect-error we are augmenting SbvrTypes w/ Numeric Big Integer
|
3
|
+
SbvrTypes.default['Numeric Big Integer'] = {
|
4
|
+
...SbvrTypes.default['Big Integer'],
|
5
|
+
fetchProcessing(data) {
|
6
|
+
if (data == null || typeof data === 'number') {
|
7
|
+
return data;
|
8
|
+
}
|
9
|
+
if (typeof data === 'string') {
|
10
|
+
return parseInt(data, 10);
|
11
|
+
}
|
12
|
+
throw new Error('Fetched Numeric Big Integer value is not valid: ' + typeof data);
|
13
|
+
},
|
14
|
+
validate: SbvrTypes.default.Integer.validate,
|
15
|
+
};
|
16
|
+
//# sourceMappingURL=numeric-big-integer-hack.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"numeric-big-integer-hack.js","sourceRoot":"","sources":["../../../src/translations/v6/numeric-big-integer-hack.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,oBAAoB,CAAC;AAM3C,sEAAsE;AACtE,SAAS,CAAC,OAAO,CAAC,qBAAqB,CAAC,GAAG;IAC1C,GAAG,SAAS,CAAC,OAAO,CAAC,aAAa,CAAC;IAEnC,eAAe,CAAC,IAAI;QACnB,IAAI,IAAI,IAAI,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;YAC9C,OAAO,IAAI,CAAC;QACb,CAAC;QACD,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;YAC9B,OAAO,QAAQ,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;QAC3B,CAAC;QACD,MAAM,IAAI,KAAK,CACd,kDAAkD,GAAG,OAAO,IAAI,CAChE,CAAC;IACH,CAAC;IAED,QAAQ,EAAE,SAAS,CAAC,OAAO,CAAC,OAAO,CAAC,QAAQ;CAC6B,CAAC"}
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import './numeric-big-integer-hack.js';
|
1
2
|
export declare const toVersion = "v7";
|
2
3
|
export declare const v6AbstractSqlModel: import("@balena/abstract-sql-compiler").AbstractSqlModel;
|
3
4
|
export declare const getV6Translations: (abstractSqlModel?: import("@balena/abstract-sql-compiler").AbstractSqlModel) => {
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import './numeric-big-integer-hack.js';
|
1
2
|
import { aliasFields, aliasTable, generateAbstractSqlModel, overrideFieldType, renameResourceField, } from '../../abstract-sql-utils.js';
|
2
3
|
import * as userHasDirectAccessToApplication from '../../features/applications/models/user__has_direct_access_to__application.js';
|
3
4
|
import * as DeviceAdditions from '../../features/devices/models/device-additions.js';
|
@@ -13,6 +14,7 @@ overrideFieldType(v6AbstractSqlModel, 'application', 'actor', 'Integer');
|
|
13
14
|
for (const resource of ['device', 'application']) {
|
14
15
|
renameResourceField(v6AbstractSqlModel, resource, 'env var name', 'name');
|
15
16
|
}
|
17
|
+
overrideFieldType(v6AbstractSqlModel, 'image', 'image size', 'Numeric Big Integer');
|
16
18
|
export const getV6Translations = (abstractSqlModel = v6AbstractSqlModel) => {
|
17
19
|
const deviceFieldSet = new Set(abstractSqlModel.tables['device'].fields.map((f) => f.fieldName));
|
18
20
|
return {
|
@@ -192,6 +194,17 @@ export const getV6Translations = (abstractSqlModel = v6AbstractSqlModel) => {
|
|
192
194
|
['From', ['Alias', ['Resource', `release$${toVersion}`], 'release']],
|
193
195
|
],
|
194
196
|
},
|
197
|
+
// image: {
|
198
|
+
// 'image size': [
|
199
|
+
// // Ideally we would cast this to an Integer, so that `pg` returns a JS number instead of a string,
|
200
|
+
// // but we can't do that since Posgtresql would fail on runtime while doing the case if it detects
|
201
|
+
// // that the value is above Int4.
|
202
|
+
// // As a hack we cast it to Real, so that `pg` parses it as a JS number.
|
203
|
+
// 'Cast',
|
204
|
+
// ['ReferencedField', 'image', 'image size'],
|
205
|
+
// 'Real',
|
206
|
+
// ],
|
207
|
+
// },
|
195
208
|
'image-is downloaded by-device': {
|
196
209
|
// TODO-HACK: This redirects to the device resource as a hack because we can't redirect to no resource,
|
197
210
|
// but the redirect is only used for modification events and we have no allowlist entries for gateway_download
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"v6.js","sourceRoot":"","sources":["../../../src/translations/v6/v6.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"v6.js","sourceRoot":"","sources":["../../../src/translations/v6/v6.ts"],"names":[],"mappings":"AAAA,OAAO,+BAA+B,CAAC;AAGvC,OAAO,EACN,WAAW,EACX,UAAU,EACV,wBAAwB,EACxB,iBAAiB,EACjB,mBAAmB,GACnB,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,gCAAgC,MAAM,+EAA+E,CAAC;AAClI,OAAO,KAAK,eAAe,MAAM,mDAAmD,CAAC;AAErF,MAAM,CAAC,MAAM,SAAS,GAAG,IAAI,CAAC;AAE9B,MAAM,CAAC,MAAM,kBAAkB,GAAG,wBAAwB,CACzD,IAAI,GAAG,CAAC,SAAS,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CACnC,CAAC;AAEF,UAAU,CAAC,kBAAkB,EAAE,aAAa,EAAE,gBAAgB,CAAC,CAAC;AAChE,gCAAgC,CAAC,UAAU,CAAC,kBAAkB,CAAC,CAAC;AAEhE,iBAAiB,CAAC,kBAAkB,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC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,MAAM,CAAC,EAAE,YAAY,CAAC,EAAE,QAAQ,CAAC;wBACrD,CAAC,OAAO,EAAE,CAAC,MAAM,EAAE,CAAC,MAAM,CAAC,EAAE,SAAS,CAAC,EAAE,mBAAmB,CAAC;wBAC7D,CAAC,OAAO,EAAE,CAAC,MAAM,EAAE,CAAC,MAAM,CAAC,EAAE,SAAS,CAAC,EAAE,OAAO,CAAC;qBACjD;iBACD;gBACD,CAAC,OAAO,EAAE,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;aAC7B;SACD;KAC4C,CAAC;AAChD,CAAC,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.
|
4
|
+
"version": "26.4.9-build-v6-number-image-image-size--43d566a1b0933a3a8cae254ec3ea1eb34e3a0242-1",
|
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-03T15:
|
171
|
+
"publishedAt": "2024-09-03T15:49:21.817Z"
|
172
172
|
}
|
173
173
|
}
|