@balena/open-balena-api 26.5.0-build-644-last-api-heartbeat-state-change-event-9576f4a13430576123b476b301b319adf3e81351-1 → 27.0.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/balena-model.d.ts +0 -2
- package/dist/balena.sbvr +1 -4
- package/dist/features/device-heartbeat/index.js +3 -10
- package/dist/features/device-heartbeat/index.js.map +1 -1
- package/dist/features/device-state/index.d.ts +1 -1
- package/dist/features/device-state/index.js +1 -1
- package/dist/features/device-state/index.js.map +1 -1
- package/dist/features/device-state/middleware.d.ts +0 -1
- package/dist/features/device-state/routes/state-get-v2.js +28 -29
- package/dist/features/device-state/routes/state-get-v2.js.map +1 -1
- package/dist/features/device-state/routes/state-get-v3.js +6 -6
- package/dist/features/device-state/routes/state-get-v3.js.map +1 -1
- package/dist/features/device-state/state-get-utils.d.ts +0 -1
- package/dist/features/device-state/state-get-utils.js +0 -6
- package/dist/features/device-state/state-get-utils.js.map +1 -1
- package/dist/translations/v7/v7.sbvr +0 -3
- package/package.json +2 -2
- package/dist/migrations/00093-device-last-api-heartbeat-state-change-event.sql +0 -2
package/dist/balena-model.d.ts
CHANGED
@@ -682,7 +682,6 @@ export interface Device {
|
|
682
682
|
__id: Actor['Read']['id'];
|
683
683
|
} | [Actor['Read']];
|
684
684
|
api_heartbeat_state: 'online' | 'offline' | 'timeout' | 'unknown';
|
685
|
-
changed_api_heartbeat_state_on__date: Types['Date Time']['Read'] | null;
|
686
685
|
uuid: Types['Text']['Read'];
|
687
686
|
local_id: Types['Short Text']['Read'] | null;
|
688
687
|
device_name: Types['Short Text']['Read'] | null;
|
@@ -764,7 +763,6 @@ export interface Device {
|
|
764
763
|
id: Types['Serial']['Write'];
|
765
764
|
actor: Actor['Write']['id'];
|
766
765
|
api_heartbeat_state: 'online' | 'offline' | 'timeout' | 'unknown';
|
767
|
-
changed_api_heartbeat_state_on__date: Types['Date Time']['Write'] | null;
|
768
766
|
uuid: Types['Text']['Write'];
|
769
767
|
local_id: Types['Short Text']['Write'] | null;
|
770
768
|
device_name: Types['Short Text']['Write'] | null;
|
package/dist/balena.sbvr
CHANGED
@@ -374,9 +374,6 @@ Term: device
|
|
374
374
|
Necessity: each device has exactly one api heartbeat state
|
375
375
|
Definition: "online" or "offline" or "timeout" or "unknown"
|
376
376
|
|
377
|
-
Fact type: device [changed api heartbeat state on] date
|
378
|
-
Necessity: each device [changed api heartbeat state on] at most one date.
|
379
|
-
|
380
377
|
Fact type: device has env var name
|
381
378
|
Term Form: device environment variable
|
382
379
|
Database Table Name: device environment variable
|
@@ -454,7 +451,7 @@ Fact type: user (Auth) has public key
|
|
454
451
|
-- user public key
|
455
452
|
|
456
453
|
Fact type: user public key has title
|
457
|
-
|
454
|
+
Necessity: each user public key has exactly one title
|
458
455
|
|
459
456
|
|
460
457
|
-- application type
|
@@ -172,7 +172,7 @@ export class DeviceOnlineStateManager extends EventEmitter {
|
|
172
172
|
let err;
|
173
173
|
try {
|
174
174
|
// patch the api_heartbeat_state value to the new state...
|
175
|
-
const
|
175
|
+
const body = {
|
176
176
|
api_heartbeat_state: newState,
|
177
177
|
};
|
178
178
|
await api.resin.patch({
|
@@ -181,17 +181,10 @@ export class DeviceOnlineStateManager extends EventEmitter {
|
|
181
181
|
id: deviceId,
|
182
182
|
options: {
|
183
183
|
$filter: {
|
184
|
-
$not:
|
184
|
+
$not: body,
|
185
185
|
},
|
186
186
|
},
|
187
|
-
body
|
188
|
-
...baseBody,
|
189
|
-
// Since the heartbeat manager is the only place that we update the heartbeat state
|
190
|
-
// we are updating the heartbeat's change date in here rather than a hook, so that
|
191
|
-
// we can avoid the extra DB request that a generic hook would require for checking
|
192
|
-
// whether the value actually changed or not.
|
193
|
-
changed_api_heartbeat_state_on__date: Date.now(),
|
194
|
-
},
|
187
|
+
body,
|
195
188
|
});
|
196
189
|
}
|
197
190
|
catch ($err) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/features/device-heartbeat/index.ts"],"names":[],"mappings":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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"}
|
@@ -2,7 +2,7 @@ import type { Application, Request } from 'express';
|
|
2
2
|
import type { StrictEventEmitter } from 'strict-event-emitter-types';
|
3
3
|
import { EventEmitter } from 'events';
|
4
4
|
import type { Device } from '../../balena-model.js';
|
5
|
-
export { getStateEventAdditionalFields, getConfig, setReadTransaction, filterDeviceConfig, formatImageLocation, addDefaultConfigVariableFn, setDefaultConfigVariables,
|
5
|
+
export { getStateEventAdditionalFields, getConfig, setReadTransaction, filterDeviceConfig, formatImageLocation, addDefaultConfigVariableFn, setDefaultConfigVariables, serviceInstallFromImage, } from './state-get-utils.js';
|
6
6
|
export { metricsPatchFields, v2ValidPatchFields, v3ValidPatchFields, } from './state-patch-utils.js';
|
7
7
|
export declare const setup: (app: Application) => void;
|
8
8
|
export interface Events {
|
@@ -6,7 +6,7 @@ import { stateV3 } from './routes/state-get-v3.js';
|
|
6
6
|
import { statePatchV2 } from './routes/state-patch-v2.js';
|
7
7
|
import { resolveDeviceUuids, statePatchV3 } from './routes/state-patch-v3.js';
|
8
8
|
import { fleetStateV3 } from './routes/fleet-state-get-v3.js';
|
9
|
-
export { getStateEventAdditionalFields, getConfig, setReadTransaction, filterDeviceConfig, formatImageLocation, addDefaultConfigVariableFn, setDefaultConfigVariables,
|
9
|
+
export { getStateEventAdditionalFields, getConfig, setReadTransaction, filterDeviceConfig, formatImageLocation, addDefaultConfigVariableFn, setDefaultConfigVariables, serviceInstallFromImage, } from './state-get-utils.js';
|
10
10
|
export { metricsPatchFields, v2ValidPatchFields, v3ValidPatchFields, } from './state-patch-utils.js';
|
11
11
|
const gracefulGet = resolveOrDenyDevicesWithStatus(304);
|
12
12
|
export const setup = (app) => {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/features/device-state/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAEvD,OAAO,EAAE,8BAA8B,EAAE,MAAM,iBAAiB,CAAC;AACjE,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE1D,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC9E,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAG9D,OAAO,EACN,6BAA6B,EAC7B,SAAS,EACT,kBAAkB,EAClB,kBAAkB,EAClB,mBAAmB,EACnB,0BAA0B,EAC1B,yBAAyB,EACzB,
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/features/device-state/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAEvD,OAAO,EAAE,8BAA8B,EAAE,MAAM,iBAAiB,CAAC;AACjE,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE1D,OAAO,EAAE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-
|
|
9
9
|
__id: import("../../balena-model.js").Actor["Read"]["id"];
|
10
10
|
} | [import("../../balena-model.js").Actor["Read"]];
|
11
11
|
api_heartbeat_state: "online" | "offline" | "timeout" | "unknown";
|
12
|
-
changed_api_heartbeat_state_on__date: import("@balena/sbvr-types").Types["Date Time"]["Read"] | null;
|
13
12
|
uuid: import("@balena/sbvr-types").Types["Text"]["Read"];
|
14
13
|
local_id: import("@balena/sbvr-types").Types["Short Text"]["Read"] | null;
|
15
14
|
device_name: import("@balena/sbvr-types").Types["Short Text"]["Read"] | null;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import _ from 'lodash';
|
2
2
|
import { captureException, handleHttpErrors, } from '../../../infra/error-handling/index.js';
|
3
|
-
import { formatImageLocation, readTransaction,
|
3
|
+
import { formatImageLocation, readTransaction, serviceInstallFromImage, varListInsert, ConfigurationVarsToLabels, getStateDelayingEmpty, getConfig, getStateEventAdditionalFields, } from '../state-get-utils.js';
|
4
4
|
import { sbvrUtils } from '@balena/pinejs';
|
5
5
|
import { events } from '../index.js';
|
6
6
|
import { getIP } from '../../../lib/utils.js';
|
@@ -83,31 +83,6 @@ function buildAppFromRelease(device, application, release, config) {
|
|
83
83
|
volumes: composition?.volumes || {},
|
84
84
|
};
|
85
85
|
}
|
86
|
-
const releaseExpand = {
|
87
|
-
$select: ['id', 'commit', 'composition'],
|
88
|
-
$expand: {
|
89
|
-
contains__image: {
|
90
|
-
$select: 'id',
|
91
|
-
$expand: {
|
92
|
-
image: {
|
93
|
-
$select: [
|
94
|
-
'id',
|
95
|
-
'is_stored_at__image_location',
|
96
|
-
'content_hash',
|
97
|
-
'is_a_build_of__service',
|
98
|
-
'contract',
|
99
|
-
],
|
100
|
-
},
|
101
|
-
image_label: {
|
102
|
-
$select: ['label_name', 'value'],
|
103
|
-
},
|
104
|
-
image_environment_variable: {
|
105
|
-
$select: ['name', 'value'],
|
106
|
-
},
|
107
|
-
},
|
108
|
-
},
|
109
|
-
},
|
110
|
-
};
|
111
86
|
const stateQuery = _.once(() => api.resin.prepare({
|
112
87
|
resource: 'device',
|
113
88
|
id: { uuid: { '@': 'uuid' } },
|
@@ -120,7 +95,32 @@ const stateQuery = _.once(() => api.resin.prepare({
|
|
120
95
|
device_environment_variable: {
|
121
96
|
$select: ['name', 'value'],
|
122
97
|
},
|
123
|
-
|
98
|
+
// `should_be_running__release` will automatically defer to the app release as necessary
|
99
|
+
should_be_running__release: {
|
100
|
+
$select: ['id', 'commit', 'composition'],
|
101
|
+
$expand: {
|
102
|
+
contains__image: {
|
103
|
+
$select: 'id',
|
104
|
+
$expand: {
|
105
|
+
image: {
|
106
|
+
$select: [
|
107
|
+
'id',
|
108
|
+
'is_stored_at__image_location',
|
109
|
+
'content_hash',
|
110
|
+
'is_a_build_of__service',
|
111
|
+
'contract',
|
112
|
+
],
|
113
|
+
},
|
114
|
+
image_label: {
|
115
|
+
$select: ['label_name', 'value'],
|
116
|
+
},
|
117
|
+
image_environment_variable: {
|
118
|
+
$select: ['name', 'value'],
|
119
|
+
},
|
120
|
+
},
|
121
|
+
},
|
122
|
+
},
|
123
|
+
},
|
124
124
|
service_install: {
|
125
125
|
$select: ['id'],
|
126
126
|
$expand: {
|
@@ -149,7 +149,6 @@ const stateQuery = _.once(() => api.resin.prepare({
|
|
149
149
|
application_environment_variable: {
|
150
150
|
$select: ['name', 'value'],
|
151
151
|
},
|
152
|
-
should_be_running__release: releaseExpand,
|
153
152
|
},
|
154
153
|
},
|
155
154
|
},
|
@@ -204,7 +203,7 @@ const getDevice = getStateDelayingEmpty(async (req, uuid) => await readTransacti
|
|
204
203
|
const getUserAppForState = (device, config) => {
|
205
204
|
const userAppFromApi = device.belongs_to__application[0];
|
206
205
|
// get the release of the main app that this device should run...
|
207
|
-
const release =
|
206
|
+
const release = device.should_be_running__release[0];
|
208
207
|
// grab the main app for this device...
|
209
208
|
return release == null
|
210
209
|
? {
|
@@ -1 +1 @@
|
|
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,
|
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,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,uBAAuB,CAAC;AAE9C,MAAM,EAAE,GAAG,EAAE,GAAG,SAAS,CAAC;AA0C1B,SAAS,mBAAmB,CAC3B,MAAiB,EACjB,WAAsB,EACtB,OAAkB,EAClB,MAA0B;IAE1B,IAAI,WAAW,GAAc,EAAE,CAAC;IAChC,MAAM,QAAQ,GAA8B,EAAE,CAAC;IAE/C,wDAAwD;IACxD,IAAI,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE,CAAC;QACrC,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC;IACnC,CAAC;SAAM,CAAC;QACP,IAAI,CAAC;YACJ,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;QAC/C,CAAC;QAAC,MAAM,CAAC;YACR,WAAW,GAAG,EAAE,CAAC;QAClB,CAAC;IACF,CAAC;IAED,KAAK,M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CACF,CAAC;AAEF,MAAM,kBAAkB,GAAG,CAC1B,MAAiB,EACjB,MAA0B,EACV,EAAE;IAClB,MAAM,cAAc,GAAc,MAAM,CAAC,uBAAuB,CAAC,CAAC,CAAC,CAAC;IAEpE,iEAAiE;IACjE,MAAM,OAAO,GAAG,MAAM,CAAC,0BAA0B,CAAC,CAAC,CAAC,CAAC;IAErD,uCAAuC;IACvC,OAAO,OAAO,IAAI,IAAI;QACrB,CAAC,CAAC;YACA,IAAI,EAAE,cAAc,CAAC,QAAQ;YAC7B,QAAQ,EAAE,EAAE;YACZ,QAAQ,EAAE,EAAE;YACZ,OAAO,EAAE,EAAE;SACX;QACF,CAAC,CAAC,mBAAmB,CAAC,MAAM,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;AACjE,CAAC,CAAC"}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import _ from 'lodash';
|
2
2
|
import { captureException, handleHttpErrors, } from '../../../infra/error-handling/index.js';
|
3
|
-
import { ConfigurationVarsToLabels, formatImageLocation, getConfig,
|
3
|
+
import { ConfigurationVarsToLabels, formatImageLocation, getConfig, getStateDelayingEmpty, getStateEventAdditionalFields, readTransaction, serviceInstallFromImage, varListInsert, } from '../state-get-utils.js';
|
4
4
|
import { sbvrUtils } from '@balena/pinejs';
|
5
5
|
import { events } from '../index.js';
|
6
6
|
import { getIP } from '../../../lib/utils.js';
|
@@ -123,7 +123,8 @@ const deviceExpand = {
|
|
123
123
|
device_environment_variable: {
|
124
124
|
$select: ['name', 'value'],
|
125
125
|
},
|
126
|
-
|
126
|
+
// `should_be_running__release` will automatically defer to the app release as necessary
|
127
|
+
should_be_running__release: releaseExpand,
|
127
128
|
service_install: {
|
128
129
|
$select: ['id'],
|
129
130
|
$expand: {
|
@@ -150,7 +151,6 @@ const deviceExpand = {
|
|
150
151
|
application_config_variable: {
|
151
152
|
$select: ['name', 'value'],
|
152
153
|
},
|
153
|
-
should_be_running__release: releaseExpand,
|
154
154
|
},
|
155
155
|
},
|
156
156
|
should_be_managed_by__release: {
|
@@ -206,7 +206,7 @@ const getStateV3 = async (req, uuid) => {
|
|
206
206
|
// See: https://github.com/balena-os/balena-supervisor/blob/v15.2.0/src/compose/app.ts#L839
|
207
207
|
'io.balena.image.store': 'root',
|
208
208
|
}),
|
209
|
-
...getAppState(device, '
|
209
|
+
...getAppState(device, 'should_be_running__release', config),
|
210
210
|
};
|
211
211
|
const state = {
|
212
212
|
[uuid]: {
|
@@ -241,9 +241,9 @@ const getDevice = getStateDelayingEmpty(async (req, uuid) => await readTransacti
|
|
241
241
|
const getAppState = (device, targetReleaseField, config, defaultLabels) => {
|
242
242
|
let application;
|
243
243
|
let release;
|
244
|
-
if (targetReleaseField === '
|
244
|
+
if (targetReleaseField === 'should_be_running__release') {
|
245
245
|
application = device.belongs_to__application[0];
|
246
|
-
release =
|
246
|
+
release = device.should_be_running__release[0];
|
247
247
|
}
|
248
248
|
else {
|
249
249
|
release = device[targetReleaseField][0];
|
@@ -1 +1 @@
|
|
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,
|
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,qBAAqB,EACrB,6BAA6B,EAC7B,eAAe,EACf,uBAAuB,EACvB,aAAa,GACb,MAAM,uBAAuB,CAAC;AAC/B,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ClD,CAAC;IAED,OAAO;QACN,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE;YACnB,EAAE,EAAE,WAAW,CAAC,EAAE;YAClB,IAAI,EAAE,WAAW,CAAC,QAAQ;YAC1B,OAAO,EAAE,WAAW,CAAC,OAAO;YAC5B,KAAK,EAAE,WAAW,CAAC,YAAY;YAC/B,GAAG,CAAC,OAAO,IAAI,IAAI,IAAI;gBACtB,QAAQ,EAAE,mBAAmB,CAC5B,MAAM,EACN,WAAW,EACX,OAAO,EACP,MAAM,EACN,aAAa,CACb;aACD,CAAC;SACF;KACD,CAAC;AACH,CAAC,CAAC"}
|
@@ -6,7 +6,6 @@ declare const defaultConfigVariableFns: Array<(config: Dictionary<string>) => vo
|
|
6
6
|
export declare const addDefaultConfigVariableFn: (fn: (typeof defaultConfigVariableFns)[number]) => void;
|
7
7
|
export declare const setDefaultConfigVariables: (config: Dictionary<string>) => void;
|
8
8
|
export declare const getConfig: (device: AnyObject | undefined, application?: AnyObject) => Dictionary<string>;
|
9
|
-
export declare const getReleaseForDevice: (device: AnyObject) => AnyObject | undefined;
|
10
9
|
export declare const serviceInstallFromImage: (deviceOrFleet: AnyObject, image?: AnyObject) => undefined | AnyObject;
|
11
10
|
export declare const formatImageLocation: (imageLocation: string) => string;
|
12
11
|
export declare const filterDeviceConfig: (configVars: Dictionary<string>) => void;
|
@@ -35,12 +35,6 @@ export const getConfig = (device, application = device?.belongs_to__application[
|
|
35
35
|
setDefaultConfigVariables(config);
|
36
36
|
return config;
|
37
37
|
};
|
38
|
-
export const getReleaseForDevice = (device) => {
|
39
|
-
if (device.is_pinned_on__release[0] != null) {
|
40
|
-
return device.is_pinned_on__release[0];
|
41
|
-
}
|
42
|
-
return device.belongs_to__application[0]?.should_be_running__release[0];
|
43
|
-
};
|
44
38
|
export const serviceInstallFromImage = (deviceOrFleet, image) => {
|
45
39
|
if (image == null) {
|
46
40
|
return;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"state-get-utils.js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W,CAAC,2BAA2B,EACvC,MAAM,EACN,cAAc,CACd,CAAC;IACH,CAAC;IAED,0CAA0C;IAC1C,IAAI,MAAM,EAAE,CAAC;QACZ,aAAa,CAAC,MAAM,CAAC,sBAAsB,EAAE,MAAM,EAAE,cAAc,CAAC,CAAC;IACtE,CAAC;IAED,kBAAkB,CAAC,MAAM,CAAC,CAAC;IAC3B,yBAAyB,CAAC,MAAM,CAAC,CAAC;IAElC,OAAO,MAAM,CAAC;AACf,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,
|
1
|
+
{"version":3,"file":"state-get-utils.js","sourceRoot":"","sources":["../../../src/features/device-state/state-get-utils.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,QAAQ,CAAC;AAGvB,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EACN,gCAAgC,EAChC,oCAAoC,GACpC,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACN,qBAAqB,EACrB,uBAAuB,GACvB,MAAM,4BAA4B,CAAC;AAGpC,MAAM,CAAC,MAAM,6BAA6B,GAEtC,EAAE,CAAC;AAEP,MAAM,wBAAwB,GAAgD;IAC7E,SAAS,kBAAkB,CAAC,MAAM;QACjC,MAAM,YAAY,GACjB,MAAM,CAAC,8BAA8B,IAAI,IAAI;YAC5C,CAAC,CAAC,CAAC;YACH,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,8BAA8B,EAAE,EAAE,CAAC,CAAC;QACxD,sEAAsE;QACtE,MAAM,CAAC,8BAA8B;YACpC,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC,YAAY,EAAE,gCAAgC,CAAC,CAAC;IAChE,CAAC;CACD,CAAC;AACF,MAAM,CAAC,MAAM,0BAA0B,GAAG,CACzC,EAA6C,EAC5C,EAAE;IACH,wBAAwB,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACnC,CAAC,CAAC;AACF,MAAM,CAAC,MAAM,yBAAyB,GA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I,MAAM,CAAC,iBAAiB,EAAE,CAAC;IACtC,CAAC,CAAC;AACJ,CAAC,CAAC,EAAE,CAAC"}
|
@@ -379,9 +379,6 @@ Term: device
|
|
379
379
|
Necessity: each device has exactly one api heartbeat state
|
380
380
|
Definition: "online" or "offline" or "timeout" or "unknown"
|
381
381
|
|
382
|
-
Fact type: device [changed api heartbeat state on] date
|
383
|
-
Necessity: each device [changed api heartbeat state on] at most one date.
|
384
|
-
|
385
382
|
Fact type: device has env var name
|
386
383
|
Term Form: device environment variable
|
387
384
|
Database Table Name: device environment variable
|
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": "
|
4
|
+
"version": "27.0.0",
|
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-
|
171
|
+
"publishedAt": "2024-09-04T12:57:57.744Z"
|
172
172
|
}
|
173
173
|
}
|