@balena/open-balena-api 28.0.12-build-improve-typings-state-get-v3-946356414e3360fe74acd833dd9a0e629d1e2a7a-1 → 29.0.0-build-reduce-service-install-usage-state-get-v3-427fd396ec055f8061204b216e28a5f9216da822-1
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/features/device-state/routes/fleet-state-get-v3.d.ts +14 -1
- package/dist/features/device-state/routes/state-get-v3.d.ts +167 -57
- package/dist/features/device-state/routes/state-get-v3.js +16 -15
- package/dist/features/device-state/routes/state-get-v3.js.map +1 -1
- package/dist/features/device-state/state-get-utils.d.ts +13 -32
- package/dist/features/device-state/state-get-utils.js +2 -9
- package/dist/features/device-state/state-get-utils.js.map +1 -1
- package/package.json +2 -2
@@ -15,7 +15,20 @@ declare const fleetExpand: {
|
|
15
15
|
readonly $select: "id";
|
16
16
|
readonly $expand: {
|
17
17
|
readonly image: {
|
18
|
-
readonly $select: readonly ["id", "is_stored_at__image_location", "content_hash", "
|
18
|
+
readonly $select: readonly ["id", "is_stored_at__image_location", "content_hash", "contract"];
|
19
|
+
readonly $expand: {
|
20
|
+
readonly is_a_build_of__service: {
|
21
|
+
readonly $select: readonly ["id", "service_name"];
|
22
|
+
readonly $expand: {
|
23
|
+
readonly service_environment_variable: {
|
24
|
+
readonly $select: readonly ["name", "value"];
|
25
|
+
};
|
26
|
+
readonly service_label: {
|
27
|
+
readonly $select: readonly ["label_name", "value"];
|
28
|
+
};
|
29
|
+
};
|
30
|
+
};
|
31
|
+
};
|
19
32
|
};
|
20
33
|
readonly image_label: {
|
21
34
|
readonly $select: readonly ["label_name", "value"];
|
@@ -4,8 +4,8 @@ import type { Application } from '../../../balena-model.js';
|
|
4
4
|
import type { ExpandedApplicationWithService } from './fleet-state-get-v3.js';
|
5
5
|
type LocalStateApp = StateV3[string]['apps'][string];
|
6
6
|
type ServiceComposition = AnyObject;
|
7
|
-
type ExpandedDevice = Awaited<ReturnType<typeof getDevice>>;
|
8
|
-
type ExpandedApplication = OptionsToResponse<Application['Read'], {
|
7
|
+
export type ExpandedDevice = Awaited<ReturnType<typeof getDevice>>;
|
8
|
+
export type ExpandedApplication = OptionsToResponse<Application['Read'], {
|
9
9
|
$select: typeof appSelect;
|
10
10
|
$expand: typeof appExpand;
|
11
11
|
}, undefined>[number];
|
@@ -74,7 +74,20 @@ export declare const releaseExpand: {
|
|
74
74
|
readonly $select: "id";
|
75
75
|
readonly $expand: {
|
76
76
|
readonly image: {
|
77
|
-
readonly $select: readonly ["id", "is_stored_at__image_location", "content_hash", "
|
77
|
+
readonly $select: readonly ["id", "is_stored_at__image_location", "content_hash", "contract"];
|
78
|
+
readonly $expand: {
|
79
|
+
readonly is_a_build_of__service: {
|
80
|
+
readonly $select: readonly ["id", "service_name"];
|
81
|
+
readonly $expand: {
|
82
|
+
readonly service_environment_variable: {
|
83
|
+
readonly $select: readonly ["name", "value"];
|
84
|
+
};
|
85
|
+
readonly service_label: {
|
86
|
+
readonly $select: readonly ["label_name", "value"];
|
87
|
+
};
|
88
|
+
};
|
89
|
+
};
|
90
|
+
};
|
78
91
|
};
|
79
92
|
readonly image_label: {
|
80
93
|
readonly $select: readonly ["label_name", "value"];
|
@@ -271,7 +284,7 @@ declare const getDevice: (req: import("@balena/pinejs/out/sbvr-api/permissions.j
|
|
271
284
|
__id: import("../../../balena-model.js").Image["Read"]["id"];
|
272
285
|
} | [import("../../../balena-model.js").Image["Read"]];
|
273
286
|
}, "id"> & {
|
274
|
-
readonly image: import("@balena/abstract-sql-to-typescript").PickDeferred<{
|
287
|
+
readonly image: (import("@balena/abstract-sql-to-typescript").PickDeferred<{
|
275
288
|
created_at: import("@balena/sbvr-types").Types["Date Time"]["Read"];
|
276
289
|
modified_at: import("@balena/sbvr-types").Types["Date Time"]["Read"];
|
277
290
|
id: import("@balena/sbvr-types").Types["Serial"]["Read"];
|
@@ -299,7 +312,55 @@ declare const getDevice: (req: import("@balena/pinejs/out/sbvr-api/permissions.j
|
|
299
312
|
is_a_build_of__application__has__service_name: {
|
300
313
|
__id: import("../../../balena-model.js").Service["Read"]["id"];
|
301
314
|
} | [import("../../../balena-model.js").Service["Read"]];
|
302
|
-
}, "id" | "contract" | "
|
315
|
+
}, "id" | "contract" | "is_stored_at__image_location" | "content_hash"> & {
|
316
|
+
readonly is_a_build_of__service: (import("@balena/abstract-sql-to-typescript").PickDeferred<{
|
317
|
+
created_at: import("@balena/sbvr-types").Types["Date Time"]["Read"];
|
318
|
+
modified_at: import("@balena/sbvr-types").Types["Date Time"]["Read"];
|
319
|
+
application: {
|
320
|
+
__id: Application["Read"]["id"];
|
321
|
+
} | [Application["Read"]];
|
322
|
+
service_name: import("@balena/sbvr-types").Types["Short Text"]["Read"];
|
323
|
+
id: import("@balena/sbvr-types").Types["Serial"]["Read"];
|
324
|
+
application__has__service_name__has__label_name?: Array<import("../../../balena-model.js").ServiceLabel["Read"]>;
|
325
|
+
service__has__label_name?: Array<import("../../../balena-model.js").ServiceLabel["Read"]>;
|
326
|
+
service_label?: Array<import("../../../balena-model.js").ServiceLabel["Read"]>;
|
327
|
+
application__has__service_name__has__name?: Array<import("../../../balena-model.js").ServiceEnvironmentVariable["Read"]>;
|
328
|
+
service__has__name?: Array<import("../../../balena-model.js").ServiceEnvironmentVariable["Read"]>;
|
329
|
+
service_environment_variable?: Array<import("../../../balena-model.js").ServiceEnvironmentVariable["Read"]>;
|
330
|
+
device__installs__application__has__service_name?: Array<import("../../../balena-model.js").ServiceInstall["Read"]>;
|
331
|
+
device__installs__service?: Array<import("../../../balena-model.js").ServiceInstall["Read"]>;
|
332
|
+
service_install?: Array<import("../../../balena-model.js").ServiceInstall["Read"]>;
|
333
|
+
is_installed_on__device?: Array<import("../../../balena-model.js").ServiceInstall["Read"]>;
|
334
|
+
is_built_by__image?: Array<import("../../../balena-model.js").Image["Read"]>;
|
335
|
+
}, "id" | "service_name"> & {
|
336
|
+
readonly service_environment_variable: import("@balena/abstract-sql-to-typescript").PickDeferred<{
|
337
|
+
created_at: import("@balena/sbvr-types").Types["Date Time"]["Read"];
|
338
|
+
modified_at: import("@balena/sbvr-types").Types["Date Time"]["Read"];
|
339
|
+
service: {
|
340
|
+
__id: import("../../../balena-model.js").Service["Read"]["id"];
|
341
|
+
} | [import("../../../balena-model.js").Service["Read"]];
|
342
|
+
name: import("@balena/sbvr-types").Types["Short Text"]["Read"];
|
343
|
+
id: import("@balena/sbvr-types").Types["Serial"]["Read"];
|
344
|
+
value: import("@balena/sbvr-types").Types["Text"]["Read"];
|
345
|
+
application__has__service_name: {
|
346
|
+
__id: import("../../../balena-model.js").Service["Read"]["id"];
|
347
|
+
} | [import("../../../balena-model.js").Service["Read"]];
|
348
|
+
}, "name" | "value">[];
|
349
|
+
readonly service_label: import("@balena/abstract-sql-to-typescript").PickDeferred<{
|
350
|
+
created_at: import("@balena/sbvr-types").Types["Date Time"]["Read"];
|
351
|
+
modified_at: import("@balena/sbvr-types").Types["Date Time"]["Read"];
|
352
|
+
service: {
|
353
|
+
__id: import("../../../balena-model.js").Service["Read"]["id"];
|
354
|
+
} | [import("../../../balena-model.js").Service["Read"]];
|
355
|
+
label_name: import("@balena/sbvr-types").Types["Short Text"]["Read"];
|
356
|
+
id: import("@balena/sbvr-types").Types["Serial"]["Read"];
|
357
|
+
value: import("@balena/sbvr-types").Types["Text"]["Read"];
|
358
|
+
application__has__service_name: {
|
359
|
+
__id: import("../../../balena-model.js").Service["Read"]["id"];
|
360
|
+
} | [import("../../../balena-model.js").Service["Read"]];
|
361
|
+
}, "value" | "label_name">[];
|
362
|
+
})[];
|
363
|
+
})[];
|
303
364
|
readonly image_label: import("@balena/abstract-sql-to-typescript").PickDeferred<{
|
304
365
|
created_at: import("@balena/sbvr-types").Types["Date Time"]["Read"];
|
305
366
|
modified_at: import("@balena/sbvr-types").Types["Date Time"]["Read"];
|
@@ -355,54 +416,7 @@ declare const getDevice: (req: import("@balena/pinejs/out/sbvr-api/permissions.j
|
|
355
416
|
is_installed_on__device: {
|
356
417
|
__id: import("../../../balena-model.js").Device["Read"]["id"];
|
357
418
|
} | [import("../../../balena-model.js").Device["Read"]];
|
358
|
-
}, "id"> & {
|
359
|
-
readonly service: (import("@balena/abstract-sql-to-typescript").PickDeferred<{
|
360
|
-
created_at: import("@balena/sbvr-types").Types["Date Time"]["Read"];
|
361
|
-
modified_at: import("@balena/sbvr-types").Types["Date Time"]["Read"];
|
362
|
-
application: {
|
363
|
-
__id: Application["Read"]["id"];
|
364
|
-
} | [Application["Read"]];
|
365
|
-
service_name: import("@balena/sbvr-types").Types["Short Text"]["Read"];
|
366
|
-
id: import("@balena/sbvr-types").Types["Serial"]["Read"];
|
367
|
-
application__has__service_name__has__label_name?: Array<import("../../../balena-model.js").ServiceLabel["Read"]>;
|
368
|
-
service__has__label_name?: Array<import("../../../balena-model.js").ServiceLabel["Read"]>;
|
369
|
-
service_label?: Array<import("../../../balena-model.js").ServiceLabel["Read"]>;
|
370
|
-
application__has__service_name__has__name?: Array<import("../../../balena-model.js").ServiceEnvironmentVariable["Read"]>;
|
371
|
-
service__has__name?: Array<import("../../../balena-model.js").ServiceEnvironmentVariable["Read"]>;
|
372
|
-
service_environment_variable?: Array<import("../../../balena-model.js").ServiceEnvironmentVariable["Read"]>;
|
373
|
-
device__installs__application__has__service_name?: Array<import("../../../balena-model.js").ServiceInstall["Read"]>;
|
374
|
-
device__installs__service?: Array<import("../../../balena-model.js").ServiceInstall["Read"]>;
|
375
|
-
service_install?: Array<import("../../../balena-model.js").ServiceInstall["Read"]>;
|
376
|
-
is_installed_on__device?: Array<import("../../../balena-model.js").ServiceInstall["Read"]>;
|
377
|
-
is_built_by__image?: Array<import("../../../balena-model.js").Image["Read"]>;
|
378
|
-
}, "id" | "service_name"> & {
|
379
|
-
readonly service_environment_variable: import("@balena/abstract-sql-to-typescript").PickDeferred<{
|
380
|
-
created_at: import("@balena/sbvr-types").Types["Date Time"]["Read"];
|
381
|
-
modified_at: import("@balena/sbvr-types").Types["Date Time"]["Read"];
|
382
|
-
service: {
|
383
|
-
__id: import("../../../balena-model.js").Service["Read"]["id"];
|
384
|
-
} | [import("../../../balena-model.js").Service["Read"]];
|
385
|
-
name: import("@balena/sbvr-types").Types["Short Text"]["Read"];
|
386
|
-
id: import("@balena/sbvr-types").Types["Serial"]["Read"];
|
387
|
-
value: import("@balena/sbvr-types").Types["Text"]["Read"];
|
388
|
-
application__has__service_name: {
|
389
|
-
__id: import("../../../balena-model.js").Service["Read"]["id"];
|
390
|
-
} | [import("../../../balena-model.js").Service["Read"]];
|
391
|
-
}, "name" | "value">[];
|
392
|
-
readonly service_label: import("@balena/abstract-sql-to-typescript").PickDeferred<{
|
393
|
-
created_at: import("@balena/sbvr-types").Types["Date Time"]["Read"];
|
394
|
-
modified_at: import("@balena/sbvr-types").Types["Date Time"]["Read"];
|
395
|
-
service: {
|
396
|
-
__id: import("../../../balena-model.js").Service["Read"]["id"];
|
397
|
-
} | [import("../../../balena-model.js").Service["Read"]];
|
398
|
-
label_name: import("@balena/sbvr-types").Types["Short Text"]["Read"];
|
399
|
-
id: import("@balena/sbvr-types").Types["Serial"]["Read"];
|
400
|
-
value: import("@balena/sbvr-types").Types["Text"]["Read"];
|
401
|
-
application__has__service_name: {
|
402
|
-
__id: import("../../../balena-model.js").Service["Read"]["id"];
|
403
|
-
} | [import("../../../balena-model.js").Service["Read"]];
|
404
|
-
}, "value" | "label_name">[];
|
405
|
-
})[];
|
419
|
+
}, "id" | "service"> & {
|
406
420
|
readonly device_service_environment_variable: import("@balena/abstract-sql-to-typescript").PickDeferred<{
|
407
421
|
created_at: import("@balena/sbvr-types").Types["Date Time"]["Read"];
|
408
422
|
modified_at: import("@balena/sbvr-types").Types["Date Time"]["Read"];
|
@@ -604,7 +618,7 @@ declare const getDevice: (req: import("@balena/pinejs/out/sbvr-api/permissions.j
|
|
604
618
|
__id: import("../../../balena-model.js").Image["Read"]["id"];
|
605
619
|
} | [import("../../../balena-model.js").Image["Read"]];
|
606
620
|
}, "id"> & {
|
607
|
-
readonly image: import("@balena/abstract-sql-to-typescript").PickDeferred<{
|
621
|
+
readonly image: (import("@balena/abstract-sql-to-typescript").PickDeferred<{
|
608
622
|
created_at: import("@balena/sbvr-types").Types["Date Time"]["Read"];
|
609
623
|
modified_at: import("@balena/sbvr-types").Types["Date Time"]["Read"];
|
610
624
|
id: import("@balena/sbvr-types").Types["Serial"]["Read"];
|
@@ -632,7 +646,55 @@ declare const getDevice: (req: import("@balena/pinejs/out/sbvr-api/permissions.j
|
|
632
646
|
is_a_build_of__application__has__service_name: {
|
633
647
|
__id: import("../../../balena-model.js").Service["Read"]["id"];
|
634
648
|
} | [import("../../../balena-model.js").Service["Read"]];
|
635
|
-
}, "id" | "contract" | "
|
649
|
+
}, "id" | "contract" | "is_stored_at__image_location" | "content_hash"> & {
|
650
|
+
readonly is_a_build_of__service: (import("@balena/abstract-sql-to-typescript").PickDeferred<{
|
651
|
+
created_at: import("@balena/sbvr-types").Types["Date Time"]["Read"];
|
652
|
+
modified_at: import("@balena/sbvr-types").Types["Date Time"]["Read"];
|
653
|
+
application: {
|
654
|
+
__id: Application["Read"]["id"];
|
655
|
+
} | [Application["Read"]];
|
656
|
+
service_name: import("@balena/sbvr-types").Types["Short Text"]["Read"];
|
657
|
+
id: import("@balena/sbvr-types").Types["Serial"]["Read"];
|
658
|
+
application__has__service_name__has__label_name?: Array<import("../../../balena-model.js").ServiceLabel["Read"]>;
|
659
|
+
service__has__label_name?: Array<import("../../../balena-model.js").ServiceLabel["Read"]>;
|
660
|
+
service_label?: Array<import("../../../balena-model.js").ServiceLabel["Read"]>;
|
661
|
+
application__has__service_name__has__name?: Array<import("../../../balena-model.js").ServiceEnvironmentVariable["Read"]>;
|
662
|
+
service__has__name?: Array<import("../../../balena-model.js").ServiceEnvironmentVariable["Read"]>;
|
663
|
+
service_environment_variable?: Array<import("../../../balena-model.js").ServiceEnvironmentVariable["Read"]>;
|
664
|
+
device__installs__application__has__service_name?: Array<import("../../../balena-model.js").ServiceInstall["Read"]>;
|
665
|
+
device__installs__service?: Array<import("../../../balena-model.js").ServiceInstall["Read"]>;
|
666
|
+
service_install?: Array<import("../../../balena-model.js").ServiceInstall["Read"]>;
|
667
|
+
is_installed_on__device?: Array<import("../../../balena-model.js").ServiceInstall["Read"]>;
|
668
|
+
is_built_by__image?: Array<import("../../../balena-model.js").Image["Read"]>;
|
669
|
+
}, "id" | "service_name"> & {
|
670
|
+
readonly service_environment_variable: import("@balena/abstract-sql-to-typescript").PickDeferred<{
|
671
|
+
created_at: import("@balena/sbvr-types").Types["Date Time"]["Read"];
|
672
|
+
modified_at: import("@balena/sbvr-types").Types["Date Time"]["Read"];
|
673
|
+
service: {
|
674
|
+
__id: import("../../../balena-model.js").Service["Read"]["id"];
|
675
|
+
} | [import("../../../balena-model.js").Service["Read"]];
|
676
|
+
name: import("@balena/sbvr-types").Types["Short Text"]["Read"];
|
677
|
+
id: import("@balena/sbvr-types").Types["Serial"]["Read"];
|
678
|
+
value: import("@balena/sbvr-types").Types["Text"]["Read"];
|
679
|
+
application__has__service_name: {
|
680
|
+
__id: import("../../../balena-model.js").Service["Read"]["id"];
|
681
|
+
} | [import("../../../balena-model.js").Service["Read"]];
|
682
|
+
}, "name" | "value">[];
|
683
|
+
readonly service_label: import("@balena/abstract-sql-to-typescript").PickDeferred<{
|
684
|
+
created_at: import("@balena/sbvr-types").Types["Date Time"]["Read"];
|
685
|
+
modified_at: import("@balena/sbvr-types").Types["Date Time"]["Read"];
|
686
|
+
service: {
|
687
|
+
__id: import("../../../balena-model.js").Service["Read"]["id"];
|
688
|
+
} | [import("../../../balena-model.js").Service["Read"]];
|
689
|
+
label_name: import("@balena/sbvr-types").Types["Short Text"]["Read"];
|
690
|
+
id: import("@balena/sbvr-types").Types["Serial"]["Read"];
|
691
|
+
value: import("@balena/sbvr-types").Types["Text"]["Read"];
|
692
|
+
application__has__service_name: {
|
693
|
+
__id: import("../../../balena-model.js").Service["Read"]["id"];
|
694
|
+
} | [import("../../../balena-model.js").Service["Read"]];
|
695
|
+
}, "value" | "label_name">[];
|
696
|
+
})[];
|
697
|
+
})[];
|
636
698
|
readonly image_label: import("@balena/abstract-sql-to-typescript").PickDeferred<{
|
637
699
|
created_at: import("@balena/sbvr-types").Types["Date Time"]["Read"];
|
638
700
|
modified_at: import("@balena/sbvr-types").Types["Date Time"]["Read"];
|
@@ -785,7 +847,7 @@ declare const getDevice: (req: import("@balena/pinejs/out/sbvr-api/permissions.j
|
|
785
847
|
__id: import("../../../balena-model.js").Image["Read"]["id"];
|
786
848
|
} | [import("../../../balena-model.js").Image["Read"]];
|
787
849
|
}, "id"> & {
|
788
|
-
readonly image: import("@balena/abstract-sql-to-typescript").PickDeferred<{
|
850
|
+
readonly image: (import("@balena/abstract-sql-to-typescript").PickDeferred<{
|
789
851
|
created_at: import("@balena/sbvr-types").Types["Date Time"]["Read"];
|
790
852
|
modified_at: import("@balena/sbvr-types").Types["Date Time"]["Read"];
|
791
853
|
id: import("@balena/sbvr-types").Types["Serial"]["Read"];
|
@@ -813,7 +875,55 @@ declare const getDevice: (req: import("@balena/pinejs/out/sbvr-api/permissions.j
|
|
813
875
|
is_a_build_of__application__has__service_name: {
|
814
876
|
__id: import("../../../balena-model.js").Service["Read"]["id"];
|
815
877
|
} | [import("../../../balena-model.js").Service["Read"]];
|
816
|
-
}, "id" | "contract" | "
|
878
|
+
}, "id" | "contract" | "is_stored_at__image_location" | "content_hash"> & {
|
879
|
+
readonly is_a_build_of__service: (import("@balena/abstract-sql-to-typescript").PickDeferred<{
|
880
|
+
created_at: import("@balena/sbvr-types").Types["Date Time"]["Read"];
|
881
|
+
modified_at: import("@balena/sbvr-types").Types["Date Time"]["Read"];
|
882
|
+
application: {
|
883
|
+
__id: Application["Read"]["id"];
|
884
|
+
} | [Application["Read"]];
|
885
|
+
service_name: import("@balena/sbvr-types").Types["Short Text"]["Read"];
|
886
|
+
id: import("@balena/sbvr-types").Types["Serial"]["Read"];
|
887
|
+
application__has__service_name__has__label_name?: Array<import("../../../balena-model.js").ServiceLabel["Read"]>;
|
888
|
+
service__has__label_name?: Array<import("../../../balena-model.js").ServiceLabel["Read"]>;
|
889
|
+
service_label?: Array<import("../../../balena-model.js").ServiceLabel["Read"]>;
|
890
|
+
application__has__service_name__has__name?: Array<import("../../../balena-model.js").ServiceEnvironmentVariable["Read"]>;
|
891
|
+
service__has__name?: Array<import("../../../balena-model.js").ServiceEnvironmentVariable["Read"]>;
|
892
|
+
service_environment_variable?: Array<import("../../../balena-model.js").ServiceEnvironmentVariable["Read"]>;
|
893
|
+
device__installs__application__has__service_name?: Array<import("../../../balena-model.js").ServiceInstall["Read"]>;
|
894
|
+
device__installs__service?: Array<import("../../../balena-model.js").ServiceInstall["Read"]>;
|
895
|
+
service_install?: Array<import("../../../balena-model.js").ServiceInstall["Read"]>;
|
896
|
+
is_installed_on__device?: Array<import("../../../balena-model.js").ServiceInstall["Read"]>;
|
897
|
+
is_built_by__image?: Array<import("../../../balena-model.js").Image["Read"]>;
|
898
|
+
}, "id" | "service_name"> & {
|
899
|
+
readonly service_environment_variable: import("@balena/abstract-sql-to-typescript").PickDeferred<{
|
900
|
+
created_at: import("@balena/sbvr-types").Types["Date Time"]["Read"];
|
901
|
+
modified_at: import("@balena/sbvr-types").Types["Date Time"]["Read"];
|
902
|
+
service: {
|
903
|
+
__id: import("../../../balena-model.js").Service["Read"]["id"];
|
904
|
+
} | [import("../../../balena-model.js").Service["Read"]];
|
905
|
+
name: import("@balena/sbvr-types").Types["Short Text"]["Read"];
|
906
|
+
id: import("@balena/sbvr-types").Types["Serial"]["Read"];
|
907
|
+
value: import("@balena/sbvr-types").Types["Text"]["Read"];
|
908
|
+
application__has__service_name: {
|
909
|
+
__id: import("../../../balena-model.js").Service["Read"]["id"];
|
910
|
+
} | [import("../../../balena-model.js").Service["Read"]];
|
911
|
+
}, "name" | "value">[];
|
912
|
+
readonly service_label: import("@balena/abstract-sql-to-typescript").PickDeferred<{
|
913
|
+
created_at: import("@balena/sbvr-types").Types["Date Time"]["Read"];
|
914
|
+
modified_at: import("@balena/sbvr-types").Types["Date Time"]["Read"];
|
915
|
+
service: {
|
916
|
+
__id: import("../../../balena-model.js").Service["Read"]["id"];
|
917
|
+
} | [import("../../../balena-model.js").Service["Read"]];
|
918
|
+
label_name: import("@balena/sbvr-types").Types["Short Text"]["Read"];
|
919
|
+
id: import("@balena/sbvr-types").Types["Serial"]["Read"];
|
920
|
+
value: import("@balena/sbvr-types").Types["Text"]["Read"];
|
921
|
+
application__has__service_name: {
|
922
|
+
__id: import("../../../balena-model.js").Service["Read"]["id"];
|
923
|
+
} | [import("../../../balena-model.js").Service["Read"]];
|
924
|
+
}, "value" | "label_name">[];
|
925
|
+
})[];
|
926
|
+
})[];
|
817
927
|
readonly image_label: import("@balena/abstract-sql-to-typescript").PickDeferred<{
|
818
928
|
created_at: import("@balena/sbvr-types").Types["Date Time"]["Read"];
|
819
929
|
modified_at: import("@balena/sbvr-types").Types["Date Time"]["Read"];
|
@@ -24,12 +24,12 @@ export function buildAppFromRelease(device, application, release, config, defaul
|
|
24
24
|
// extract the per-image information
|
25
25
|
const image = ipr.image[0];
|
26
26
|
const si = serviceInstallFromImage(device ?? application, image);
|
27
|
+
const svc = image.is_a_build_of__service[0];
|
27
28
|
if (si == null) {
|
28
|
-
throw new Error(`Could not find service install for device or application: '${application.uuid}', image: '${image?.id}', service: '${JSON.stringify(
|
29
|
+
throw new Error(`Could not find service install for device or application: '${application.uuid}', image: '${image?.id}', service: '${JSON.stringify(svc)}', service: '${device != null
|
29
30
|
? JSON.stringify(device.service_install)
|
30
31
|
: JSON.stringify(application.service)}'`);
|
31
32
|
}
|
32
|
-
const svc = 'service' in si ? si.service[0] : si;
|
33
33
|
const environment = {};
|
34
34
|
varListInsert(ipr.image_environment_variable, environment);
|
35
35
|
varListInsert(application.application_environment_variable, environment);
|
@@ -97,9 +97,21 @@ export const releaseExpand = {
|
|
97
97
|
'id',
|
98
98
|
'is_stored_at__image_location',
|
99
99
|
'content_hash',
|
100
|
-
'is_a_build_of__service',
|
101
100
|
'contract',
|
102
101
|
],
|
102
|
+
$expand: {
|
103
|
+
is_a_build_of__service: {
|
104
|
+
$select: ['id', 'service_name'],
|
105
|
+
$expand: {
|
106
|
+
service_environment_variable: {
|
107
|
+
$select: ['name', 'value'],
|
108
|
+
},
|
109
|
+
service_label: {
|
110
|
+
$select: ['label_name', 'value'],
|
111
|
+
},
|
112
|
+
},
|
113
|
+
},
|
114
|
+
},
|
103
115
|
},
|
104
116
|
image_label: {
|
105
117
|
$select: ['label_name', 'value'],
|
@@ -133,19 +145,8 @@ const deviceExpand = {
|
|
133
145
|
// `should_be_running__release` will automatically defer to the app release as necessary
|
134
146
|
should_be_running__release: releaseExpand,
|
135
147
|
service_install: {
|
136
|
-
$select: ['id'],
|
148
|
+
$select: ['id', 'service'],
|
137
149
|
$expand: {
|
138
|
-
service: {
|
139
|
-
$select: ['id', 'service_name'],
|
140
|
-
$expand: {
|
141
|
-
service_environment_variable: {
|
142
|
-
$select: ['name', 'value'],
|
143
|
-
},
|
144
|
-
service_label: {
|
145
|
-
$select: ['label_name', 'value'],
|
146
|
-
},
|
147
|
-
},
|
148
|
-
},
|
149
150
|
device_service_environment_variable: {
|
150
151
|
$select: ['name', 'value'],
|
151
152
|
},
|
@@ -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,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;AAK9C,MAAM,EAAE,GAAG,EAAE,GAAG,SAAS,CAAC;AA0F1B,MAAM,UAAU,mBAAmB,CAClC,MAAkC,EAClC,WAAiE,EACjE,OAAwB,EACxB,MAA0B,EAC1B,aAAkC;IAElC,IAAI,WAAW,GAAc,EAAE,CAAC;IAChC,MAAM,QAAQ,GACb,EAAE,CAAC;IAEJ,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,MAAM,GAAG,IAAI,OAAO,CAAC,eAAe,EAAE,CAAC;QAC3C,oCAAoC;QACpC,MAAM,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QAE3B,MAAM,EAAE,GAAG,uBAAuB,CACjC,MAAM,IAAK,WAA8C,EACzD,KAAK,CACL,CAAC;QACF,IAAI,EAAE,IAAI,IAAI,EAAE,CAAC;YAChB,MAAM,IAAI,KAAK,CACd,8DACC,WAAW,CAAC,IACb,cAAc,KAAK,EAAE,EAAE,gBAAgB,IAAI,CAAC,SAAS,CACpD,
|
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,u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,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"}
|
@@ -1,6 +1,8 @@
|
|
1
1
|
import type { ExpandableStringKeyOf } from 'pinejs-client-core';
|
2
2
|
import type { dbModule, permissions } from '@balena/pinejs';
|
3
|
-
import type { Device
|
3
|
+
import type { Device } from '../../balena-model.js';
|
4
|
+
import type { ExpandedDevice as ExpandedDeviceV3, ExpandedRelease as ExpandedReleaseV3 } from './routes/state-get-v3.js';
|
5
|
+
import type { ExpandedApplicationWithService } from './routes/fleet-state-get-v3.js';
|
4
6
|
export declare const getStateEventAdditionalFields: Array<Exclude<keyof Device['Read'], ExpandableStringKeyOf<Device['Read']>>>;
|
5
7
|
declare const defaultConfigVariableFns: Array<(config: Dictionary<string>) => void>;
|
6
8
|
export declare const addDefaultConfigVariableFn: (fn: (typeof defaultConfigVariableFns)[number]) => void;
|
@@ -13,41 +15,20 @@ export declare const getConfig: (device: {
|
|
13
15
|
} | undefined, application?: {
|
14
16
|
application_config_variable: EnvVarList;
|
15
17
|
} | undefined) => Dictionary<string>;
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
label_name: string;
|
20
|
-
value: string;
|
21
|
-
}>;
|
22
|
-
};
|
23
|
-
export type ExpandedServiceInstall = {
|
24
|
-
id: ServiceInstall['Read']['id'];
|
25
|
-
service: ExpandedService[];
|
26
|
-
device_service_environment_variable: EnvVarList;
|
27
|
-
};
|
18
|
+
type Image = ExpandedReleaseV3['contains__image'][number]['image'][number];
|
19
|
+
type ServiceInstall = ExpandedDeviceV3['service_install'][number];
|
20
|
+
type Service = ExpandedApplicationWithService['service'][number];
|
28
21
|
export declare function serviceInstallFromImage(deviceOrFleet: {
|
29
|
-
service_install:
|
30
|
-
}, image?:
|
31
|
-
is_a_build_of__service: number | {
|
32
|
-
__id: number;
|
33
|
-
};
|
34
|
-
}): ExpandedServiceInstall | undefined;
|
22
|
+
service_install: ServiceInstall[];
|
23
|
+
}, image?: Image): ServiceInstall | undefined;
|
35
24
|
export declare function serviceInstallFromImage(deviceOrFleet: {
|
36
|
-
service:
|
37
|
-
}, image?:
|
38
|
-
is_a_build_of__service: number | {
|
39
|
-
__id: number;
|
40
|
-
};
|
41
|
-
}): ExpandedService | undefined;
|
25
|
+
service: Service[];
|
26
|
+
}, image?: Image): Service | undefined;
|
42
27
|
export declare function serviceInstallFromImage(deviceOrFleet: {
|
43
|
-
service_install:
|
28
|
+
service_install: ServiceInstall[];
|
44
29
|
} | {
|
45
|
-
service:
|
46
|
-
}, image?:
|
47
|
-
is_a_build_of__service: number | {
|
48
|
-
__id: number;
|
49
|
-
};
|
50
|
-
}): ExpandedServiceInstall | ExpandedService | undefined;
|
30
|
+
service: Service[];
|
31
|
+
}, image?: Image): Service | ServiceInstall | undefined;
|
51
32
|
export declare const formatImageLocation: (imageLocation: string) => string;
|
52
33
|
export declare const filterDeviceConfig: (configVars: Dictionary<string>) => void;
|
53
34
|
export declare const setReadTransaction: (newReadTransaction: dbModule.Database["readTransaction"]) => void;
|
@@ -1,4 +1,3 @@
|
|
1
|
-
import _ from 'lodash';
|
2
1
|
import { sbvrUtils, errors } from '@balena/pinejs';
|
3
2
|
import { DEFAULT_SUPERVISOR_POLL_INTERVAL, EMPTY_DEVICE_STATE_GET_DELAY_SECONDS, } from '../../lib/config.js';
|
4
3
|
import { createMultiLevelStore, reqPermissionNormalizer, } from '../../infra/cache/index.js';
|
@@ -39,15 +38,9 @@ export function serviceInstallFromImage(deviceOrFleet, image) {
|
|
39
38
|
if (image == null) {
|
40
39
|
return;
|
41
40
|
}
|
42
|
-
|
43
|
-
if (typeof image.is_a_build_of__service === 'object') {
|
44
|
-
id = image.is_a_build_of__service.__id;
|
45
|
-
}
|
46
|
-
else {
|
47
|
-
id = image.is_a_build_of__service;
|
48
|
-
}
|
41
|
+
const id = image.is_a_build_of__service[0].id;
|
49
42
|
if ('service_install' in deviceOrFleet) {
|
50
|
-
return
|
43
|
+
return deviceOrFleet.service_install.find(({ service }) => service.__id === id);
|
51
44
|
}
|
52
45
|
else if ('service' in deviceOrFleet) {
|
53
46
|
return deviceOrFleet.service.find((fleetService) => fleetService.id === id);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"state-get-utils.js","sourceRoot":"","sources":["../../../src/features/device-state/state-get-utils.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"state-get-utils.js","sourceRoot":"","sources":["../../../src/features/device-state/state-get-utils.ts"],"names":[],"mappings":"AAEA,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;AAQpC,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,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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": "
|
4
|
+
"version": "29.0.0-build-reduce-service-install-usage-state-get-v3-427fd396ec055f8061204b216e28a5f9216da822-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-
|
171
|
+
"publishedAt": "2024-09-28T12:14:28.875Z"
|
172
172
|
}
|
173
173
|
}
|