@balena/open-balena-api 26.4.5-build-renovate-lock-file-maintenance-533bf1e0929eacbc302f6b29c160f247413cf59c-1 → 26.4.6-build-pinejs-prepare-api-97539ac059285e3599f4e6574e2d146e88c05c7b-1
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/features/api-keys/lib.js +22 -25
- package/dist/features/api-keys/lib.js.map +1 -1
- package/dist/features/device-heartbeat/index.js +52 -56
- package/dist/features/device-heartbeat/index.js.map +1 -1
- package/dist/features/device-provisioning/gracefully-deny-conflicting-registrations.js +10 -13
- package/dist/features/device-provisioning/gracefully-deny-conflicting-registrations.js.map +1 -1
- package/dist/features/device-state/middleware.js +10 -13
- package/dist/features/device-state/middleware.js.map +1 -1
- package/dist/features/device-state/routes/fleet-state-get-v3.js +17 -23
- package/dist/features/device-state/routes/fleet-state-get-v3.js.map +1 -1
- package/dist/features/device-state/routes/state-get-v2.js +39 -42
- package/dist/features/device-state/routes/state-get-v2.js.map +1 -1
- package/dist/features/device-state/routes/state-get-v3.js +8 -11
- package/dist/features/device-state/routes/state-get-v3.js.map +1 -1
- package/dist/features/device-state/routes/state-patch-v2.js +27 -29
- package/dist/features/device-state/routes/state-patch-v2.js.map +1 -1
- package/dist/infra/auth/auth.js +19 -22
- package/dist/infra/auth/auth.js.map +1 -1
- package/package.json +16 -16
@@ -157,28 +157,26 @@ export const createGenericApiKey = async (req, { actorType, actorTypeId, roles,
|
|
157
157
|
});
|
158
158
|
};
|
159
159
|
export const isApiKeyWithRole = (() => {
|
160
|
-
const authQuery = _.once(() => {
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
$
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
$
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
key: { '@': 'key' },
|
181
|
-
},
|
160
|
+
const authQuery = _.once(() => api.Auth.prepare({
|
161
|
+
resource: 'role',
|
162
|
+
passthrough: { req: permissions.root },
|
163
|
+
id: {
|
164
|
+
name: { '@': 'roleName' },
|
165
|
+
},
|
166
|
+
options: {
|
167
|
+
$select: 'id',
|
168
|
+
$filter: {
|
169
|
+
is_of__api_key: {
|
170
|
+
$any: {
|
171
|
+
$alias: 'khr',
|
172
|
+
$expr: {
|
173
|
+
khr: {
|
174
|
+
api_key: {
|
175
|
+
$any: {
|
176
|
+
$alias: 'k',
|
177
|
+
$expr: {
|
178
|
+
k: {
|
179
|
+
key: { '@': 'key' },
|
182
180
|
},
|
183
181
|
},
|
184
182
|
},
|
@@ -188,9 +186,8 @@ export const isApiKeyWithRole = (() => {
|
|
188
186
|
},
|
189
187
|
},
|
190
188
|
},
|
191
|
-
}
|
192
|
-
|
193
|
-
});
|
189
|
+
},
|
190
|
+
}, { key: ['string'], roleName: ['string'] }));
|
194
191
|
return multiCacheMemoizee(async (key, roleName, tx) => {
|
195
192
|
const role = await authQuery()({ key, roleName }, undefined, {
|
196
193
|
tx,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"lib.js","sourceRoot":"","sources":["../../../src/features/api-keys/lib.ts"],"names":[],"mappings":"AACA,OAAO,YAAY,MAAM,cAAc,CAAC;AACxC,OAAO,CAAC,MAAM,QAAQ,CAAC;
|
1
|
+
{"version":3,"file":"lib.js","sourceRoot":"","sources":["../../../src/features/api-keys/lib.ts"],"names":[],"mappings":"AACA,OAAO,YAAY,MAAM,cAAc,CAAC;AACxC,OAAO,CAAC,MAAM,QAAQ,CAAC;AAEvB,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,0BAA0B,EAAE,MAAM,qBAAqB,CAAC;AACjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AAE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;;;;;GAKG;AACH,mBAAmB,GAAG,KAAK,EACvB,EAAE;IACN,IAAI,YAAY,GAAG,GAAG,CAAC;IAEvB,IAAI,CAAC,mBAAmB,EAAE,CAAC;QAC1B,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAC5B,YAAY,CAAC,MAAM,GAAG,CAAC,CAAC,SAAS,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;IACxD,CAAC;SAAM,IAAI,YAAY,CAAC,MAAM,EAAE,WAAW,EAAE,CAAC;QAC7C,2DAA2D;QAC3D,0DAA0D;QAC1D,4DAA4D;QAC5D,YAAY,CAAC,MAAM,CAAC,WAAW,GAAG,CAAC,GAAG,YAAY,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;IACxE,CAAC;IAED,YAAY,CAAC,MAAM,EAAE,WAAW,EAAE,IAAI,CAAC,GAAG,gBAAgB,CAAC,CAAC;IAC5D,OAAO,YAAY,CAAC;AACrB,CAAC,CAAC"}
|
@@ -9,51 +9,46 @@ import { API_HEARTBEAT_STATE_ENABLED, API_HEARTBEAT_STATE_TIMEOUT_SECONDS, API_H
|
|
9
9
|
import { redis, redisRO } from '../../infra/redis/index.js';
|
10
10
|
import { setTimeout } from 'timers/promises';
|
11
11
|
const { api } = sbvrUtils;
|
12
|
-
const getPollIntervalForDevice = _.once(() => {
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
],
|
26
|
-
},
|
27
|
-
},
|
28
|
-
$orderby: {
|
29
|
-
// we want the last value that would have been passed
|
30
|
-
// to the supervisor, as that is the one it would have used.
|
31
|
-
name: 'desc',
|
12
|
+
const getPollIntervalForDevice = _.once(() => api.resin.prepare({
|
13
|
+
resource: 'device_config_variable',
|
14
|
+
passthrough: { req: permissions.root },
|
15
|
+
options: {
|
16
|
+
$select: ['value'],
|
17
|
+
$top: 1,
|
18
|
+
$filter: {
|
19
|
+
device: { '@': 'deviceId' },
|
20
|
+
name: {
|
21
|
+
$in: [
|
22
|
+
'BALENA_SUPERVISOR_POLL_INTERVAL',
|
23
|
+
'RESIN_SUPERVISOR_POLL_INTERVAL',
|
24
|
+
],
|
32
25
|
},
|
33
26
|
},
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
27
|
+
$orderby: {
|
28
|
+
// we want the last value that would have been passed
|
29
|
+
// to the supervisor, as that is the one it would have used.
|
30
|
+
name: 'desc',
|
31
|
+
},
|
32
|
+
},
|
33
|
+
}, { deviceId: ['number'] }));
|
34
|
+
const getPollIntervalForParentApplication = _.once(() => api.resin.prepare({
|
35
|
+
resource: 'application_config_variable',
|
36
|
+
passthrough: { req: permissions.root },
|
37
|
+
options: {
|
38
|
+
$select: ['value'],
|
39
|
+
$top: 1,
|
40
|
+
$filter: {
|
41
|
+
application: {
|
42
|
+
$any: {
|
43
|
+
$alias: 'a',
|
44
|
+
$expr: {
|
45
|
+
a: {
|
46
|
+
owns__device: {
|
47
|
+
$any: {
|
48
|
+
$alias: 'd',
|
49
|
+
$expr: {
|
50
|
+
d: {
|
51
|
+
id: { '@': 'deviceId' },
|
57
52
|
},
|
58
53
|
},
|
59
54
|
},
|
@@ -61,22 +56,23 @@ const getPollIntervalForParentApplication = _.once(() => {
|
|
61
56
|
},
|
62
57
|
},
|
63
58
|
},
|
64
|
-
name: {
|
65
|
-
$in: [
|
66
|
-
'BALENA_SUPERVISOR_POLL_INTERVAL',
|
67
|
-
'RESIN_SUPERVISOR_POLL_INTERVAL',
|
68
|
-
],
|
69
|
-
},
|
70
59
|
},
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
60
|
+
name: {
|
61
|
+
$in: [
|
62
|
+
'BALENA_SUPERVISOR_POLL_INTERVAL',
|
63
|
+
'RESIN_SUPERVISOR_POLL_INTERVAL',
|
64
|
+
],
|
75
65
|
},
|
76
66
|
},
|
77
|
-
|
78
|
-
|
79
|
-
|
67
|
+
$orderby: {
|
68
|
+
// we want the last value that would have been passed
|
69
|
+
// to the supervisor, as that is the one it would have used.
|
70
|
+
name: 'desc',
|
71
|
+
},
|
72
|
+
},
|
73
|
+
}, {
|
74
|
+
deviceId: ['number'],
|
75
|
+
}));
|
80
76
|
export const getPollInterval = async (deviceId, config) => {
|
81
77
|
let pollIntervalString;
|
82
78
|
if (config != null) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/features/device-heartbeat/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,CAAC,MAAM,QAAQ,CAAC;AACvB,OAAO,QAAQ,MAAM,MAAM,CAAC;
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/features/device-heartbeat/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,CAAC,MAAM,QAAQ,CAAC;AACvB,OAAO,QAAQ,MAAM,MAAM,CAAC;AAE5B,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAExD,OAAO,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAC;AACvE,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD,OAAO,EAAE,MAAM,IAAI,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAEvE,OAAO,EACN,2BAA2B,EAC3B,mCAAmC,EACnC,+CAA+C,EAC/C,gCAAgC,EAChC,KAAK,GACL,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EA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KAAK,kBAAkB,CAAC,MAAM;YACpE,CAAC,+CAA+C,IAAI,IAAI;gBACvD,CAAC,yBAAyB,CAAC,SAAS,IAAI,IAAI;oBAC3C,IAAI,CAAC,GAAG,EAAE;wBACT,yBAAyB,CAAC,SAAS;4BAClC,+CAA+C,CAAC,CAAC,EACpD,CAAC;YACF,uCAAuC;YACvC,MAAM,IAAI,CAAC,iBAAiB,CAAC,QAAQ,EAAE,kBAAkB,CAAC,MAAM,CAAC,CAAC;YAClE,IAAI,+CAA+C,IAAI,IAAI,EAAE,CAAC;gBAC7D,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;YACxB,CAAC;QACF,CAAC;QAED,yBAAyB;QACzB,MAAM,IAAI,CAAC,8BAA8B,CACxC,QAAQ,EACR,yBAAyB,EACzB,kBAAkB,CAAC,MAAM,EACzB,kBAAkB,CAAC,OAAO,EAC1B,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,EAAE,mGAAmG;QAC9H,SAAS,CACT,CAAC;IACH,CAAC;;AAGF,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,IAAI,wBAAwB,EAAE,CAAC,CAAC"}
|
@@ -6,19 +6,16 @@ import { createMultiLevelStore } from '../../infra/cache/index.js';
|
|
6
6
|
import { checkDeviceExistsIsFrozen } from '../device-state/middleware.js';
|
7
7
|
const { ConflictError } = errors;
|
8
8
|
const { api } = sbvrUtils;
|
9
|
-
const checkApiKeyExistsQuery = _.once(() => {
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
};
|
20
|
-
return api.resin.prepare(pineQuery);
|
21
|
-
});
|
9
|
+
const checkApiKeyExistsQuery = _.once(() => api.resin.prepare({
|
10
|
+
resource: 'api_key',
|
11
|
+
passthrough: { req: permissions.root },
|
12
|
+
id: {
|
13
|
+
key: { '@': 'key' },
|
14
|
+
},
|
15
|
+
options: {
|
16
|
+
$select: 'id',
|
17
|
+
},
|
18
|
+
}, { key: ['string'] }));
|
22
19
|
export const checkApiKeyExistsStore = createMultiLevelStore('checkApiKeyExists', {
|
23
20
|
default: {
|
24
21
|
// We only care to cache the api keys that already exist,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"gracefully-deny-conflicting-registrations.js","sourceRoot":"","sources":["../../../src/features/device-provisioning/gracefully-deny-conflicting-registrations.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,QAAQ,CAAC;
|
1
|
+
{"version":3,"file":"gracefully-deny-conflicting-registrations.js","sourceRoot":"","sources":["../../../src/features/device-provisioning/gracefully-deny-conflicting-registrations.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,QAAQ,CAAC;AACvB,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAChE,OAAO,EAAE,4BAA4B,EAAE,MAAM,qBAAqB,CAAC;AACnE,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AAE1E,MAAM,EAAE,aAAa,EAAE,GAAG,MAAM,CAAC;AACjC,MAAM,EAAE,GAAG,EAAE,GAAG,SAAS,CAAC;AAE1B,MAAM,sBAAsB,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CAC1C,GAAG,CAAC,KAAK,CAAC,OAAO,CAChB;IACC,QAAQ,EAAE,SAAS;IACnB,WAAW,EAAE,EAAE,GAAG,EAAE,WAAW,CAAC,IAAI,EAAE;IACtC,EAAE,EAAE;QACH,GAAG,EAAE,EAAE,GAAG,EAAE,KAAK,EAAE;KACnB;IACD,OAAO,EAAE;QACR,OAAO,EAAE,IAAI;KACb;CACQ,EACV,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC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index.js';
|
|
3
3
|
import { sbvrUtils, permissions } from '@balena/pinejs';
|
4
4
|
import { DEVICE_EXISTS_CACHE_TIMEOUT } from '../../lib/config.js';
|
5
5
|
const { api } = sbvrUtils;
|
6
|
-
const checkDeviceExistsIsFrozenQuery = _.once(() => {
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
};
|
17
|
-
return api.resin.prepare(pineQuery);
|
18
|
-
});
|
6
|
+
const checkDeviceExistsIsFrozenQuery = _.once(() => api.resin.prepare({
|
7
|
+
resource: 'device',
|
8
|
+
passthrough: { req: permissions.root },
|
9
|
+
id: {
|
10
|
+
uuid: { '@': 'uuid' },
|
11
|
+
},
|
12
|
+
options: {
|
13
|
+
$select: ['id', 'is_frozen'],
|
14
|
+
},
|
15
|
+
}, { uuid: ['string'] }));
|
19
16
|
export const checkDeviceExistsIsFrozen = multiCacheMemoizee(async (uuid) => {
|
20
17
|
return await checkDeviceExistsIsFrozenQuery()({ uuid });
|
21
18
|
}, {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"middleware.js","sourceRoot":"","sources":["../../../src/features/device-state/middleware.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"middleware.js","sourceRoot":"","sources":["../../../src/features/device-state/middleware.ts"],"names":[],"mappings":"AACA,OAAO,CAAC,MAAM,QAAQ,CAAC;AACvB,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAGhE,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,EAAE,2BAA2B,EAAE,MAAM,qBAAqB,CAAC;AAGlE,MAAM,EAAE,GAAG,EAAE,GAAG,SAAS,CAAC;AAE1B,MAAM,8BAA8B,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CAClD,GAAG,CAAC,KAAK,CAAC,OAAO,CAChB;IACC,QAAQ,EAAE,QA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B,CAAC,CAAC,GAAG,EAAE,CAAC;YACpC,OAAO;QACR,CAAC;QACD,MAAM,SAAS,GAAa,EAAE,CAAC;QAC/B,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;YAC1B,MAAM,MAAM,GAAG,MAAM,yBAAyB,CAAC,IAAI,CAAC,CAAC;YACrD,6DAA6D;YAC7D,6DAA6D;YAC7D,8DAA8D;YAC9D,eAAe;YACf,IAAI,MAAM,IAAI,IAAI,EAAE,CAAC;gBACpB,kCAAkC;gBAClC,GAAG,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC,GAAG,EAAE,CAAC;gBACpC,OAAO;YACR,CAAC;YACD,IAAI,MAAM,CAAC,SAAS,EAAE,CAAC;gBACtB,iCAAiC;gBACjC,GAAG,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC,GAAG,EAAE,CAAC;gBACnC,OAAO;YACR,CAAC;YACD,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QAC3B,CAAC;QACD,GAAG,CAAC,MAAM,KAAK,EAAE,CAAC;QACjB,GAAG,CAAC,MAAwC,CAAC,iBAAiB,GAAG,SAAS,CAAC;QAC5E,IAAI,EAAE,CAAC;IACR,CAAC,CAAC;AACH,CAAC,CAAC"}
|
@@ -28,30 +28,24 @@ const fleetExpand = {
|
|
28
28
|
},
|
29
29
|
},
|
30
30
|
};
|
31
|
-
const stateQuery = _.once(() => {
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
$filter: {
|
46
|
-
commit: { '@': 'commit' },
|
47
|
-
belongs_to__application: { '@': 'fleetId' },
|
48
|
-
status: 'success',
|
49
|
-
},
|
50
|
-
...releaseExpand,
|
31
|
+
const stateQuery = _.once(() => api.resin.prepare({
|
32
|
+
resource: 'application',
|
33
|
+
id: { uuid: { '@': 'uuid' } },
|
34
|
+
options: {
|
35
|
+
$expand: fleetExpand,
|
36
|
+
},
|
37
|
+
}, { uuid: ['string'] }));
|
38
|
+
const releaseQuery = _.once(() => api.resin.prepare({
|
39
|
+
resource: 'release',
|
40
|
+
options: {
|
41
|
+
$filter: {
|
42
|
+
commit: { '@': 'commit' },
|
43
|
+
belongs_to__application: { '@': 'fleetId' },
|
44
|
+
status: 'success',
|
51
45
|
},
|
52
|
-
|
53
|
-
|
54
|
-
});
|
46
|
+
...releaseExpand,
|
47
|
+
},
|
48
|
+
}, { commit: ['string'], fleetId: ['number'] }));
|
55
49
|
const getFleet = async (req, uuid) => {
|
56
50
|
const fleet = await readTransaction((tx) => stateQuery()({ uuid }, undefined, { req, tx }));
|
57
51
|
if (fleet == null) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"fleet-state-get-v3.js","sourceRoot":"","sources":["../../../../src/features/device-state/routes/fleet-state-get-v3.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"fleet-state-get-v3.js","sourceRoot":"","sources":["../../../../src/features/device-state/routes/fleet-state-get-v3.ts"],"names":[],"mappings":"AAGA,OAAO,CAAC,MAAM,QAAQ,CAAC;AACvB,OAAO,EACN,gBAAgB,EAChB,gBAAgB,GAChB,MAAM,wCAAwC,CAAC;AAEhD,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAEnE,OAAO,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACvE,MAAM,EAAE,GAAG,EAAE,GAAG,SAAS,CAAC;AAC1B,MAAM,EAAE,iBAAiB,EAAE,GAAG,MAAM,CAAC;AAUrC,MAAM,WAAW,GAAG;IACnB,2BAA2B,EAAE;QAC5B,OAAO,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC;KAC1B;IACD,gCAAgC,EAAE;QACjC,OAAO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AAC,OAAO,GAAG,EAAE,CAAC;QACd,IAAI,gBAAgB,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC;YACrC,OAAO;QACR,CAAC;QACD,gBAAgB,CAAC,GAAG,EAAE,kCAAkC,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC;QACnE,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC;IACvB,CAAC;AACF,CAAC,CAAC"}
|
@@ -108,56 +108,53 @@ const releaseExpand = {
|
|
108
108
|
},
|
109
109
|
},
|
110
110
|
};
|
111
|
-
const stateQuery = _.once(() => {
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
$select: ['label_name', 'value'],
|
136
|
-
},
|
111
|
+
const stateQuery = _.once(() => api.resin.prepare({
|
112
|
+
resource: 'device',
|
113
|
+
id: { uuid: { '@': 'uuid' } },
|
114
|
+
options: {
|
115
|
+
$select: ['device_name', ...getStateEventAdditionalFields],
|
116
|
+
$expand: {
|
117
|
+
device_config_variable: {
|
118
|
+
$select: ['name', 'value'],
|
119
|
+
},
|
120
|
+
device_environment_variable: {
|
121
|
+
$select: ['name', 'value'],
|
122
|
+
},
|
123
|
+
is_pinned_on__release: releaseExpand,
|
124
|
+
service_install: {
|
125
|
+
$select: ['id'],
|
126
|
+
$expand: {
|
127
|
+
service: {
|
128
|
+
$select: ['id', 'service_name'],
|
129
|
+
$expand: {
|
130
|
+
service_environment_variable: {
|
131
|
+
$select: ['name', 'value'],
|
132
|
+
},
|
133
|
+
service_label: {
|
134
|
+
$select: ['label_name', 'value'],
|
137
135
|
},
|
138
136
|
},
|
139
|
-
|
140
|
-
|
141
|
-
|
137
|
+
},
|
138
|
+
device_service_environment_variable: {
|
139
|
+
$select: ['name', 'value'],
|
142
140
|
},
|
143
141
|
},
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
should_be_running__release: releaseExpand,
|
142
|
+
},
|
143
|
+
belongs_to__application: {
|
144
|
+
$select: ['id', 'app_name'],
|
145
|
+
$expand: {
|
146
|
+
application_config_variable: {
|
147
|
+
$select: ['name', 'value'],
|
148
|
+
},
|
149
|
+
application_environment_variable: {
|
150
|
+
$select: ['name', 'value'],
|
154
151
|
},
|
152
|
+
should_be_running__release: releaseExpand,
|
155
153
|
},
|
156
154
|
},
|
157
155
|
},
|
158
|
-
}
|
159
|
-
|
160
|
-
});
|
156
|
+
},
|
157
|
+
}, { uuid: ['string'] }));
|
161
158
|
const getStateV2 = async (req, uuid) => {
|
162
159
|
const [deviceId] = req.custom
|
163
160
|
.resolvedDeviceIds;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"state-get-v2.js","sourceRoot":"","sources":["../../../../src/features/device-state/routes/state-get-v2.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"state-get-v2.js","sourceRoot":"","sources":["../../../../src/features/device-state/routes/state-get-v2.ts"],"names":[],"mappings":"AAEA,OAAO,CAAC,MAAM,QAAQ,CAAC;AACvB,OAAO,EACN,gBAAgB,EAChB,gBAAgB,GAChB,MAAM,wCAAwC,CAAC;AAChD,OAAO,EACN,mBAAmB,EACnB,eAAe,EACf,mBAAmB,EACnB,uBAAuB,EACvB,aAAa,EACb,yBAAyB,EACzB,qBAAqB,EACrB,SAAS,EACT,6BAA6B,GAC7B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,OAAO,EAAE,KAAK,EAAE,MAAM,uBAA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
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
};
|
186
|
-
return api.resin.prepare(pineQuery);
|
187
|
-
});
|
177
|
+
const stateQuery = _.once(() => api.resin.prepare({
|
178
|
+
resource: 'device',
|
179
|
+
id: { uuid: { '@': 'uuid' } },
|
180
|
+
options: {
|
181
|
+
$select: ['device_name', ...getStateEventAdditionalFields],
|
182
|
+
$expand: deviceExpand,
|
183
|
+
},
|
184
|
+
}, { uuid: ['string'] }));
|
188
185
|
const getStateV3 = async (req, uuid) => {
|
189
186
|
const [deviceId] = req.custom
|
190
187
|
.resolvedDeviceIds;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"state-get-v3.js","sourceRoot":"","sources":["../../../../src/features/device-state/routes/state-get-v3.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"state-get-v3.js","sourceRoot":"","sources":["../../../../src/features/device-state/routes/state-get-v3.ts"],"names":[],"mappings":"AAEA,OAAO,CAAC,MAAM,QAAQ,CAAC;AACvB,OAAO,EACN,gBAAgB,EAChB,gBAAgB,GAChB,MAAM,wCAAwC,CAAC;AAChD,OAAO,EACN,yBAAyB,EACzB,mBAAmB,EACnB,SAAS,EACT,mBAAmB,EACnB,qBAAqB,EACrB,6BAA6B,EAC7B,eAAe,EACf,uBAAuB,EACvB,aAAa,GACb,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAE9C,MAAM,EAAE,GAAG,EAAE,GAAG,SAAS,CAAC;AA2D1B,MAAM,UAAU,mBAAmB,CAClC,MAA6B,EAC7B,WAAsB,EACtB,OAAkB,EAClB,MAA0B,EAC1B,aAAkC;IAElC,IAAI,WAAW,GAAc,EAAE,CAAC;IAChC,MAAM,QAAQ,GACb,EAAE,CAAC;IAEJ,wDAAwD;IACx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C"}
|
@@ -5,41 +5,39 @@ import { getIP } from '../../../lib/utils.js';
|
|
5
5
|
import { shouldUpdateMetrics, metricsPatchFields, v2ValidPatchFields, upsertImageInstall, deleteOldImageInstalls, truncateShortTextFields, limitMetricNumbers, } from '../state-patch-utils.js';
|
6
6
|
const { BadRequestError, UnauthorizedError } = errors;
|
7
7
|
const { api } = sbvrUtils;
|
8
|
-
const appAndReleaseOfDeviceQuery = _.once(() =>
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
},
|
8
|
+
const appAndReleaseOfDeviceQuery = _.once(() =>
|
9
|
+
// This is a performance optimization impactful when using device API key permissions,
|
10
|
+
// in which case emitting the OR checks for the public device access
|
11
|
+
// in a nested subquery didn't perform as well.
|
12
|
+
// TODO: Should be converted back to a simple GET to the release resource once
|
13
|
+
// the performance of that query improves.
|
14
|
+
api.resin.prepare({
|
15
|
+
resource: 'application',
|
16
|
+
options: {
|
17
|
+
$top: 1,
|
18
|
+
$select: 'id',
|
19
|
+
$expand: {
|
20
|
+
owns__release: {
|
21
|
+
$top: 1,
|
22
|
+
$select: 'id',
|
23
|
+
$filter: {
|
24
|
+
commit: { '@': 'commit' },
|
25
|
+
status: 'success',
|
27
26
|
},
|
28
27
|
},
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
},
|
28
|
+
},
|
29
|
+
$filter: {
|
30
|
+
owns__device: {
|
31
|
+
$any: {
|
32
|
+
$alias: 'd',
|
33
|
+
$expr: {
|
34
|
+
d: { id: { '@': 'deviceId' } },
|
36
35
|
},
|
37
36
|
},
|
38
37
|
},
|
39
38
|
},
|
40
|
-
}
|
41
|
-
|
42
|
-
});
|
39
|
+
},
|
40
|
+
}, { deviceId: ['number'], commit: ['string'] }));
|
43
41
|
const resolveReleaseId = async (...args) => {
|
44
42
|
const [app] = await appAndReleaseOfDeviceQuery()(...args);
|
45
43
|
return app?.owns__release[0]?.id;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"state-patch-v2.js","sourceRoot":"","sources":["../../../../src/features/device-state/routes/state-patch-v2.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"state-patch-v2.js","sourceRoot":"","sources":["../../../../src/features/device-state/routes/state-patch-v2.ts"],"names":[],"mappings":"AAEA,OAAO,CAAC,MAAM,QAAQ,CAAC;AACvB,OAAO,EACN,gBAAgB,EAChB,gBAAgB,GAChB,MAAM,wCAAwC,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAE9C,OAAO,EACN,mBAAmB,EACnB,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAClB,sBAAsB,EACtB,uBAAuB,EACvB,kBAAkB,GAClB,MAAM,yBAAyB,CAAC;AAGjC,MAAM,EAAE,eAAe,EAAE,iBAAiB,EAAE,GAAG,MAAM,CAAC;AACtD,MAAM,EAAE,GAAG,EAAE,GAAG,SAAS,CAAC;AAiD1B,MAAM,0BAA0B,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE;AAC9C,sFAAsF;AACtF,oEAAoE;AACpE,+CAA+C;AAC/C,8EAA8E;AAC9E,0CAA0C;AAC1C,GAAG,CAAC,KAAK,CAAC,OAAO,CAChB;IACC,QAAQ,EAAE,aAAa;IACvB,OAAO,EAAE;QACR,IAAI,EAAE,CAAC;QACP,OAAO,EAAE,IAAI;QACb,OAAO,EAAE;YACR,aAAa,EAAE;gBACd,IAAI,EAAE,CAAC;gBACP,OAAO,EAAE,IAAI;gBACb,OAAO,EAAE;oBACR,MAAM,EAAE,EAAE,GAAG,EAAE,QAAQ,EAAE;oBACzB,MAAM,EAAE,SAAS;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AG,CAAC,CAAC,GAAG,EAAE,CAAC;IACvB,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACd,IAAI,gBAAgB,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC;YACrC,OAAO;QACR,CAAC;QACD,gBAAgB,CAAC,GAAG,EAAE,4BAA4B,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC;QAC7D,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC;IACvB,CAAC;AACF,CAAC,CAAC"}
|
package/dist/infra/auth/auth.js
CHANGED
@@ -96,24 +96,22 @@ export const reqHasPermission = (req, permission) => userHasPermission(req.apiKe
|
|
96
96
|
// If adding/removing fields, please also update `User`
|
97
97
|
// in "typings/common.d.ts".
|
98
98
|
export const userFields = ['id', 'actor', 'jwt_secret'];
|
99
|
-
const getUserQuery = _.once(() => {
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
$
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
$
|
113
|
-
|
114
|
-
|
115
|
-
k: { key: { '@': 'key' } },
|
116
|
-
},
|
99
|
+
const getUserQuery = _.once(() => api.resin.prepare({
|
100
|
+
resource: 'user',
|
101
|
+
passthrough: { req: permissions.root },
|
102
|
+
options: {
|
103
|
+
$select: userFields,
|
104
|
+
$filter: {
|
105
|
+
actor: {
|
106
|
+
$any: {
|
107
|
+
$alias: 'a',
|
108
|
+
$expr: {
|
109
|
+
a: {
|
110
|
+
api_key: {
|
111
|
+
$any: {
|
112
|
+
$alias: 'k',
|
113
|
+
$expr: {
|
114
|
+
k: { key: { '@': 'key' } },
|
117
115
|
},
|
118
116
|
},
|
119
117
|
},
|
@@ -121,11 +119,10 @@ const getUserQuery = _.once(() => {
|
|
121
119
|
},
|
122
120
|
},
|
123
121
|
},
|
124
|
-
$top: 1,
|
125
122
|
},
|
126
|
-
|
127
|
-
|
128
|
-
});
|
123
|
+
$top: 1,
|
124
|
+
},
|
125
|
+
}, { key: ['string'] }));
|
129
126
|
export async function getUser(req,
|
130
127
|
/** You should always be passing a Tx, unless you are using this in a middleware. */
|
131
128
|
txParam, required = true) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../../../src/infra/auth/auth.ts"],"names":[],"mappings":"AACA,OAAO,CAAC,MAAM,QAAQ,CAAC;AAGvB,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAEhE,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAG/C,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;
|
1
|
+
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../../../src/infra/auth/auth.ts"],"names":[],"mappings":"AACA,OAAO,CAAC,MAAM,QAAQ,CAAC;AAGvB,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAEhE,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAG/C,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAO3C,MAAM,EAAE,eAAe,EAAE,iBAAiB,EAAE,aAAa,EAAE,GAAG,MAAM,CAAC;AACrE,MAAM,EAAE,GAAG,EAAE,GAAG,SAAS,CAAC;AAE1B,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAChC,IAAiC,EACjC,UAAkB,EACR,EAAE;IACZ,IAAI,IAAI,EAAE,WAAW,IAAI,IAAI,EAAE,CAAC;QAC/B,OAAO,KAAK,CAAC;IACd,CAAC;IACD,OAAO,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC;AAC9C,CAAC,CAAC;AAIF,IAAI,cAAc,GAA2B,GAAG,EAAE,CAAC,cAAc,CAAC;AAElE,MAAM,CAAC,MAAM,uBAAuB,GAAG,CACtC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AQ,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC;IACvB,CAAC;IAED,kCAAkC;IAClC,MAAM,IAAI,GAAG,MAAM,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC;QACjC,QAAQ,EAAE,MAAM;QAChB,IAAI,EAAE;YACL,GAAG,QAAQ;SACX;QACD,WAAW,EAAE;YACZ,EAAE;YACF,GAAG,EAAE,WAAW,CAAC,IAAI;YACrB,MAAM,EAAE;gBACP,QAAQ;aACR;SACD;KACD,CAAC,CAAC;IAEH,IAAI,IAAI,CAAC,EAAE,IAAI,IAAI,EAAE,CAAC;QACrB,MAAM,IAAI,KAAK,CAAC,qCAAqC,CAAC,CAAC;IACxD,CAAC;IACD,OAAO,IAAI,CAAC;AACb,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.6-build-pinejs-prepare-api-97539ac059285e3599f4e6574e2d146e88c05c7b-1",
|
5
5
|
"license": "AGPL-3.0",
|
6
6
|
"repository": {
|
7
7
|
"type": "git",
|
@@ -51,7 +51,7 @@
|
|
51
51
|
"@balena/node-metrics-gatherer": "^6.0.3",
|
52
52
|
"@balena/pinejs": "^18.2.1",
|
53
53
|
"@balena/pinejs-webresource-cloudfront": "^0.2.0",
|
54
|
-
"@sentry/node": "^8.
|
54
|
+
"@sentry/node": "^8.27.0",
|
55
55
|
"@types/basic-auth": "^1.1.8",
|
56
56
|
"@types/bluebird": "^3.5.42",
|
57
57
|
"@types/cache-manager": "^4.0.6",
|
@@ -69,7 +69,7 @@
|
|
69
69
|
"@types/memoizee": "^0.4.11",
|
70
70
|
"@types/morgan": "^1.9.9",
|
71
71
|
"@types/ndjson": "^2.0.4",
|
72
|
-
"@types/node": "^20.
|
72
|
+
"@types/node": "^20.16.3",
|
73
73
|
"@types/node-schedule": "^2.1.7",
|
74
74
|
"@types/on-finished": "^2.3.4",
|
75
75
|
"@types/passport-jwt": "^4.0.1",
|
@@ -80,9 +80,9 @@
|
|
80
80
|
"@types/semver": "^7.5.8",
|
81
81
|
"@types/statuses": "^2.0.5",
|
82
82
|
"@types/uuid": "^10.0.0",
|
83
|
-
"@types/validator": "^13.12.
|
83
|
+
"@types/validator": "^13.12.1",
|
84
84
|
"avsc": "^5.7.7",
|
85
|
-
"aws-sdk": "^2.
|
85
|
+
"aws-sdk": "^2.1687.0",
|
86
86
|
"balena-device-config": "^6.3.0",
|
87
87
|
"balena-semver": "^2.3.5",
|
88
88
|
"basic-auth": "^2.0.1",
|
@@ -113,11 +113,11 @@
|
|
113
113
|
"on-finished": "^2.4.1",
|
114
114
|
"passport": "^0.7.0",
|
115
115
|
"passport-jwt": "^4.0.1",
|
116
|
-
"pinejs-client-core": "^7.
|
116
|
+
"pinejs-client-core": "^7.1.0",
|
117
117
|
"proxy-addr": "^2.0.7",
|
118
118
|
"randomstring": "^1.3.0",
|
119
119
|
"rate-limiter-flexible": "^5.0.3",
|
120
|
-
"redis": "^4.
|
120
|
+
"redis": "^4.7.0",
|
121
121
|
"redlock": "^4.2.0",
|
122
122
|
"request": "^2.88.2",
|
123
123
|
"rsmq": "^0.12.4",
|
@@ -126,17 +126,17 @@
|
|
126
126
|
"statuses": "^2.0.1",
|
127
127
|
"strict-event-emitter-types": "^2.0.0",
|
128
128
|
"supervisor": "^0.12.0",
|
129
|
-
"tar": "^7.4.
|
129
|
+
"tar": "^7.4.3",
|
130
130
|
"thirty-two": "^1.0.2",
|
131
131
|
"ts-node": "^10.9.2",
|
132
132
|
"typed-error": "^3.2.2",
|
133
|
-
"typescript": "^5.5.
|
133
|
+
"typescript": "^5.5.4",
|
134
134
|
"uuid": "^10.0.0",
|
135
135
|
"validator": "^13.12.0"
|
136
136
|
},
|
137
137
|
"devDependencies": {
|
138
138
|
"@balena/lint": "^8.2.7",
|
139
|
-
"@types/chai": "^4.3.
|
139
|
+
"@types/chai": "^4.3.19",
|
140
140
|
"@types/mocha": "^10.0.7",
|
141
141
|
"@types/mockery": "^1.4.33",
|
142
142
|
"@types/sinon": "^17.0.3",
|
@@ -144,12 +144,12 @@
|
|
144
144
|
"@types/temp": "^0.9.4",
|
145
145
|
"chai": "^5.1.1",
|
146
146
|
"copyfiles": "^2.4.1",
|
147
|
-
"husky": "^9.1.
|
148
|
-
"lint-staged": "^15.2.
|
149
|
-
"mocha": "^10.
|
147
|
+
"husky": "^9.1.5",
|
148
|
+
"lint-staged": "^15.2.10",
|
149
|
+
"mocha": "^10.7.3",
|
150
150
|
"mockery": "^2.1.0",
|
151
|
-
"nock": "^13.5.
|
152
|
-
"pinejs-client-supertest": "^2.1.
|
151
|
+
"nock": "^13.5.5",
|
152
|
+
"pinejs-client-supertest": "^2.1.2",
|
153
153
|
"rimraf": "^6.0.1",
|
154
154
|
"sinon": "^18.0.0",
|
155
155
|
"supertest": "^7.0.0"
|
@@ -168,6 +168,6 @@
|
|
168
168
|
"loader": "ts-node/esm/transpile-only"
|
169
169
|
},
|
170
170
|
"versionist": {
|
171
|
-
"publishedAt": "2024-09-
|
171
|
+
"publishedAt": "2024-09-03T10:14:11.397Z"
|
172
172
|
}
|
173
173
|
}
|