@camstack/server 1.2.890 → 1.2.892
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +22 -0
- package/dist/api/trpc/generated-cap-mounts.js +2 -1
- package/dist/api/trpc/generated-cap-routers.js +212 -39
- package/dist/core/addon/addon-registry.service.js +47 -0
- package/dist/core/addon/retire-undeclared-fixed-integrations.js +57 -0
- package/package.json +31 -19
- package/system/dist/addon-runner.js +25 -9
- package/system/dist/addon-runner.mjs +25 -9
- package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +1 -1
- package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +1 -1
- package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
- package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +1 -1
- package/system/dist/builtins/alerts/alerts.addon.js +1 -1
- package/system/dist/builtins/alerts/alerts.addon.mjs +1 -1
- package/system/dist/builtins/autotrack/index.js +1 -1
- package/system/dist/builtins/autotrack/index.mjs +1 -1
- package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +2 -2
- package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +2 -2
- package/system/dist/builtins/calendars/calendars.addon.js +1 -1
- package/system/dist/builtins/calendars/calendars.addon.mjs +1 -1
- package/system/dist/builtins/camera-grid/addon.d.ts +65 -41
- package/system/dist/builtins/camera-grid/grid-blocks.d.ts +51 -0
- package/system/dist/builtins/camera-grid/grid-camera-device.d.ts +4 -3
- package/system/dist/builtins/camera-grid/grid-layout-native-provider.d.ts +3 -1
- package/system/dist/builtins/camera-grid/grid-plan.d.ts +3 -3
- package/system/dist/builtins/camera-grid/index.d.ts +2 -6
- package/system/dist/builtins/camera-grid/index.js +431 -727
- package/system/dist/builtins/camera-grid/index.mjs +428 -719
- package/system/dist/builtins/composer/composed-device.d.ts +12 -2
- package/system/dist/builtins/composer/composer.addon.js +28 -10
- package/system/dist/builtins/composer/composer.addon.mjs +28 -10
- package/system/dist/builtins/composer/composition-declarations.d.ts +3 -1
- package/system/dist/builtins/console-logging/index.js +1 -1
- package/system/dist/builtins/console-logging/index.mjs +1 -1
- package/system/dist/builtins/core-blocks/core-blocks.addon.js +283 -51
- package/system/dist/builtins/core-blocks/core-blocks.addon.mjs +284 -52
- package/system/dist/builtins/core-blocks/hero-layout-service.d.ts +19 -1
- package/system/dist/builtins/core-blocks/power-source-devices.d.ts +9 -0
- package/system/dist/builtins/core-blocks/power-source-service.d.ts +39 -2
- package/system/dist/builtins/core-blocks/tags-service.d.ts +20 -3
- package/system/dist/builtins/core-blocks/tags-wiring.d.ts +15 -2
- package/system/dist/builtins/device-history/device-history.addon.js +2 -2
- package/system/dist/builtins/device-history/device-history.addon.mjs +2 -2
- package/system/dist/builtins/device-manager/device-identifiers-action.d.ts +9 -0
- package/system/dist/builtins/device-manager/device-manager.addon.js +172 -5
- package/system/dist/builtins/device-manager/device-manager.addon.mjs +172 -5
- package/system/dist/builtins/device-manager/device-meta-types.d.ts +5 -1
- package/system/dist/builtins/device-manager/device-row-store.d.ts +3 -2
- package/system/dist/builtins/device-manager/device-state-mirror.d.ts +7 -0
- package/system/dist/builtins/device-manager/workload-transition.d.ts +23 -0
- package/system/dist/builtins/hub-forwarder/index.js +1 -1
- package/system/dist/builtins/hub-forwarder/index.mjs +1 -1
- package/system/dist/builtins/keychain/index.js +4 -4
- package/system/dist/builtins/keychain/index.mjs +4 -4
- package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.js +1 -1
- package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +1 -1
- package/system/dist/builtins/local-auth/local-auth.addon.js +2 -2
- package/system/dist/builtins/local-auth/local-auth.addon.mjs +2 -2
- package/system/dist/builtins/local-network/local-network.addon.js +3 -3
- package/system/dist/builtins/local-network/local-network.addon.mjs +3 -3
- package/system/dist/builtins/loki-logging/index.js +1 -1
- package/system/dist/builtins/loki-logging/index.mjs +1 -1
- package/system/dist/builtins/native-metrics/native-metrics.addon.js +1 -1
- package/system/dist/builtins/native-metrics/native-metrics.addon.mjs +1 -1
- package/system/dist/builtins/platform-probe/index.js +1 -1
- package/system/dist/builtins/platform-probe/index.mjs +1 -1
- package/system/dist/builtins/record-entries/index.js +1 -1
- package/system/dist/builtins/record-entries/index.mjs +1 -1
- package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
- package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
- package/system/dist/builtins/snapshot/index.js +1 -1
- package/system/dist/builtins/snapshot/index.mjs +1 -1
- package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
- package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +1 -1
- package/system/dist/builtins/sqlite-storage/index.js +1 -1
- package/system/dist/builtins/sqlite-storage/index.mjs +1 -1
- package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.js +3 -3
- package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +3 -3
- package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +1 -1
- package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +1 -1
- package/system/dist/builtins/system-config/system-config.addon.js +3 -3
- package/system/dist/builtins/system-config/system-config.addon.mjs +284 -284
- package/system/dist/builtins/winston-logging/index.js +1 -1
- package/system/dist/builtins/winston-logging/index.mjs +1 -1
- package/system/dist/{capture-engine-C1vdBL88.js → capture-engine-DHmlkW_d.js} +1 -1
- package/system/dist/{capture-engine-B1bMuzVX.mjs → capture-engine-sl6e9f9S.mjs} +1 -1
- package/system/dist/{composition-sources-Dj6qn5PP.mjs → composition-sources-CznD85Ri.mjs} +1 -1
- package/system/dist/{composition-sources-BfLlyKRe.js → composition-sources-PqcZfe3j.js} +1 -1
- package/system/dist/{constants-Ba51ywI4.mjs → constants-CHwj_mIM.mjs} +1 -1
- package/system/dist/{constants-DuB_xXYx.js → constants-_2SOk0By.js} +1 -1
- package/system/dist/{device-ca-CkXjf3ms.mjs → device-ca-D2H1EMUY.mjs} +1 -1
- package/system/dist/{device-ca-CVjaotgX.js → device-ca-WIEO5ZcE.js} +1 -1
- package/system/dist/{dist-BKojK6Wf.mjs → dist-DbAhCrHy.mjs} +2468 -454
- package/system/dist/{dist-BjhII4Uq.js → dist-yx2KHo3b.js} +2575 -453
- package/system/dist/file-host-worker.js +1 -1
- package/system/dist/file-host-worker.mjs +1 -1
- package/system/dist/{hub-identity-C0qf888i.mjs → hub-identity-BcvZqT0L.mjs} +1 -1
- package/system/dist/{hub-identity-C0ehkt78.js → hub-identity-Buegac-w.js} +1 -1
- package/system/dist/{hub-mdns-ciao-BYe34S2Q.mjs → hub-mdns-ciao-B6K_dO2s.mjs} +2 -2
- package/system/dist/{hub-mdns-ciao-DJHjyjvT.js → hub-mdns-ciao-DcNPj7WJ.js} +2 -2
- package/system/dist/index.js +33 -19
- package/system/dist/index.mjs +33 -19
- package/system/dist/kernel/moleculer/child-cap-dispatch.d.ts +3 -6
- package/system/dist/kernel/moleculer/switch-toggle.d.ts +7 -2
- package/system/dist/{legacy-integration-rows-door-G6EceE_J.js → legacy-integration-rows-door-BsZyVNiR.js} +1 -1
- package/system/dist/{legacy-integration-rows-door-BEYgXSXr.mjs → legacy-integration-rows-door-DHOJeDPG.mjs} +1 -1
- package/system/dist/{rename-composition-block-D1mO51F9.js → rename-composition-block-BXMor7MR.js} +1 -1
- package/system/dist/{rename-composition-block-D6bq3Twf.mjs → rename-composition-block-DcVS1LuC.mjs} +1 -1
- package/system/dist/{restore-archive-FXsCWq_f.mjs → restore-archive-BG8VJ8Ar.mjs} +82 -82
- package/system/dist/{restore-archive-CJvMq13C.js → restore-archive-BURufVQd.js} +1 -1
- package/system/dist/{wal-maintenance-Ci9Dl-lB.mjs → wal-maintenance-B4wGD6QR.mjs} +0 -0
- package/system/dist/{wal-maintenance-COJ_JxrD.js → wal-maintenance-CeaJyKNT.js} +0 -0
- package/system/package.json +2 -5
- package/system/dist/builtins/camera-grid/grid-camera-declarations.d.ts +0 -59
- package/system/dist/builtins/camera-grid/grid-instances.d.ts +0 -40
- package/system/dist/builtins/camera-grid/grid-record-kinds.d.ts +0 -31
- package/system/dist/builtins/camera-grid/migrations/__fixtures__/seed.d.ts +0 -13
- package/system/dist/builtins/camera-grid/migrations/camera-grids-to-records.d.ts +0 -26
- package/system/dist/builtins/camera-grid/migrations/index.d.ts +0 -6
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,28 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [1.2.892] - 2026-11-17
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- API routes for the new workload capability
|
|
15
|
+
- API route for the siren's play choices
|
|
16
|
+
|
|
17
|
+
### Changed
|
|
18
|
+
|
|
19
|
+
- Camera grids and Terminal cameras are now Build-your-self blocks; existing grid and Terminal cameras are removed on upgrade and must be recreated as blocks.
|
|
20
|
+
- The empty "Camera Grids" integration left behind by the move to blocks is removed at the hub's next restart once none of its old cameras remain.
|
|
21
|
+
- Routes for switch getOptions and powerCycle.
|
|
22
|
+
- A workload restart is allowed to the same users as start and stop; force stop stays admin
|
|
23
|
+
- The API exposes deviceManager.setIdentifiers and returns each device's declared identifiers.
|
|
24
|
+
- Power source: a switch whose options read keeps failing warns once per device until a read succeeds, not on every status read
|
|
25
|
+
|
|
26
|
+
## [1.2.891] - 2026-11-16
|
|
27
|
+
|
|
28
|
+
### Added
|
|
29
|
+
|
|
30
|
+
- The notification rules API gains setRuleTags
|
|
31
|
+
|
|
10
32
|
## [1.2.890] - 2026-11-16
|
|
11
33
|
|
|
12
34
|
### Changed
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// AUTO-GENERATED by scripts/generate-cap-mounts.ts — DO NOT EDIT
|
|
3
3
|
// Re-run: npx tsx scripts/generate-cap-mounts.ts
|
|
4
4
|
//
|
|
5
|
-
// Mounted:
|
|
5
|
+
// Mounted: 208 Skipped (legacy): 3
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
7
|
exports.LEGACY_SHAPE_SKIP = void 0;
|
|
8
8
|
exports.mountAllCaps = mountAllCaps;
|
|
@@ -729,6 +729,7 @@ function mountAllCaps(services) {
|
|
|
729
729
|
weather: (0, generated_cap_routers_js_1.createCapRouter_weather)((_ctx) => (0, cap_mount_helpers_js_1.requireDeviceScoped)(reg, 'weather'), remoteCapProxy),
|
|
730
730
|
weatherStation: (0, generated_cap_routers_js_1.createCapRouter_weatherStation)((_ctx) => (0, cap_mount_helpers_js_1.requireDeviceScoped)(reg, 'weather-station'), remoteCapProxy),
|
|
731
731
|
webrtcSession: (0, generated_cap_routers_js_1.createCapRouter_webrtcSession)((_ctx) => reg?.getSingleton('webrtc-session') ?? null, remoteCapProxy),
|
|
732
|
+
workload: (0, generated_cap_routers_js_1.createCapRouter_workload)((_ctx) => (0, cap_mount_helpers_js_1.requireDeviceScoped)(reg, 'workload'), remoteCapProxy),
|
|
732
733
|
zoneAnalytics: (0, generated_cap_routers_js_1.createCapRouter_zoneAnalytics)((_ctx) => reg?.getSingleton('zone-analytics') ?? null, remoteCapProxy),
|
|
733
734
|
zoneRules: (0, generated_cap_routers_js_1.createCapRouter_zoneRules)((_ctx) => reg?.getSingleton('zone-rules') ?? null, remoteCapProxy),
|
|
734
735
|
zones: (0, generated_cap_routers_js_1.createCapRouter_zones)((_ctx) => reg?.getSingleton('zones') ?? null, remoteCapProxy),
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// AUTO-GENERATED by scripts/generate-cap-routers.ts — DO NOT EDIT
|
|
3
3
|
// Re-run: npx tsx scripts/generate-cap-routers.ts
|
|
4
4
|
//
|
|
5
|
-
// Capabilities:
|
|
5
|
+
// Capabilities: 211
|
|
6
6
|
/* eslint-disable */
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
8
|
exports.requireCapProvider = requireCapProvider;
|
|
@@ -213,6 +213,7 @@ exports.createCapRouter_waterHeater = createCapRouter_waterHeater;
|
|
|
213
213
|
exports.createCapRouter_weather = createCapRouter_weather;
|
|
214
214
|
exports.createCapRouter_weatherStation = createCapRouter_weatherStation;
|
|
215
215
|
exports.createCapRouter_webrtcSession = createCapRouter_webrtcSession;
|
|
216
|
+
exports.createCapRouter_workload = createCapRouter_workload;
|
|
216
217
|
exports.createCapRouter_zoneAnalytics = createCapRouter_zoneAnalytics;
|
|
217
218
|
exports.createCapRouter_zoneRules = createCapRouter_zoneRules;
|
|
218
219
|
exports.createCapRouter_zones = createCapRouter_zones;
|
|
@@ -395,6 +396,7 @@ const types_172 = require("@camstack/types");
|
|
|
395
396
|
const types_173 = require("@camstack/types");
|
|
396
397
|
const types_174 = require("@camstack/types");
|
|
397
398
|
const types_175 = require("@camstack/types");
|
|
399
|
+
const types_176 = require("@camstack/types");
|
|
398
400
|
// ── Provider Accessor ───────────────────────────────────────────────
|
|
399
401
|
function requireCapProvider(name, getProvider) {
|
|
400
402
|
const p = getProvider();
|
|
@@ -3701,6 +3703,16 @@ function createCapRouter_deviceManager(getProvider, createRemoteProxy) {
|
|
|
3701
3703
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
3702
3704
|
return p.setMetadata(methodInput);
|
|
3703
3705
|
}),
|
|
3706
|
+
setIdentifiers: trpc_middleware_js_1.adminProcedure
|
|
3707
|
+
.input(types_53.deviceManagerCapability.methods.setIdentifiers.input.loose())
|
|
3708
|
+
.output(types_53.deviceManagerCapability.methods.setIdentifiers.output)
|
|
3709
|
+
.mutation(async ({ input, ctx }) => {
|
|
3710
|
+
const parsedInput = ctx.req !== undefined ? (0, types_3.withoutCallerStamp)(input) : input;
|
|
3711
|
+
const { nodeId, ...methodInput } = parsedInput;
|
|
3712
|
+
const p = resolveProvider('device-manager', nodeId, () => getProvider(ctx), createRemoteProxy);
|
|
3713
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
3714
|
+
return p.setIdentifiers(methodInput);
|
|
3715
|
+
}),
|
|
3704
3716
|
listLocations: trpc_middleware_js_1.protectedProcedure
|
|
3705
3717
|
.input(zod_1.z.object({ nodeId: zod_1.z.string().optional() }).optional())
|
|
3706
3718
|
.output(types_53.deviceManagerCapability.methods.listLocations.output)
|
|
@@ -8221,6 +8233,24 @@ function createCapRouter_notificationRules(getProvider, createRemoteProxy) {
|
|
|
8221
8233
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
8222
8234
|
return p.setRuleEnabled(methodInput);
|
|
8223
8235
|
}),
|
|
8236
|
+
listRuleTags: trpc_middleware_js_1.adminProcedure
|
|
8237
|
+
.input(types_107.notificationRulesCapability.methods.listRuleTags.input.loose())
|
|
8238
|
+
.output(types_107.notificationRulesCapability.methods.listRuleTags.output)
|
|
8239
|
+
.query(async ({ input, ctx }) => {
|
|
8240
|
+
const { nodeId, ...methodInput } = input;
|
|
8241
|
+
const p = resolveProvider('notification-rules', nodeId, () => getProvider(ctx), createRemoteProxy);
|
|
8242
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
8243
|
+
return p.listRuleTags(methodInput);
|
|
8244
|
+
}),
|
|
8245
|
+
setRuleTags: trpc_middleware_js_1.adminProcedure
|
|
8246
|
+
.input(types_107.notificationRulesCapability.methods.setRuleTags.input.loose())
|
|
8247
|
+
.output(types_107.notificationRulesCapability.methods.setRuleTags.output)
|
|
8248
|
+
.mutation(async ({ input, ctx }) => {
|
|
8249
|
+
const { nodeId, ...methodInput } = input;
|
|
8250
|
+
const p = resolveProvider('notification-rules', nodeId, () => getProvider(ctx), createRemoteProxy);
|
|
8251
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
8252
|
+
return p.setRuleTags(methodInput);
|
|
8253
|
+
}),
|
|
8224
8254
|
getClipRetentionAsks: trpc_middleware_js_1.adminProcedure
|
|
8225
8255
|
.input(types_107.notificationRulesCapability.methods.getClipRetentionAsks.input.loose())
|
|
8226
8256
|
.output(types_107.notificationRulesCapability.methods.getClipRetentionAsks.output)
|
|
@@ -12265,6 +12295,15 @@ function createCapRouter_siren(getProvider, createRemoteProxy) {
|
|
|
12265
12295
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
12266
12296
|
return p.getOptions(methodInput);
|
|
12267
12297
|
}),
|
|
12298
|
+
getPlayChoices: trpc_middleware_js_1.protectedProcedure
|
|
12299
|
+
.input(types_139.sirenCapability.methods.getPlayChoices.input.loose())
|
|
12300
|
+
.output(types_139.sirenCapability.methods.getPlayChoices.output)
|
|
12301
|
+
.query(async ({ input, ctx }) => {
|
|
12302
|
+
const { nodeId, ...methodInput } = input;
|
|
12303
|
+
const p = resolveProvider('siren', nodeId, () => getProvider(ctx), createRemoteProxy);
|
|
12304
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
12305
|
+
return p.getPlayChoices(methodInput);
|
|
12306
|
+
}),
|
|
12268
12307
|
trigger: trpc_middleware_js_1.protectedProcedure
|
|
12269
12308
|
.input(types_139.sirenCapability.methods.trigger.input.loose())
|
|
12270
12309
|
.output(types_139.sirenCapability.methods.trigger.output)
|
|
@@ -13362,6 +13401,38 @@ function createCapRouter_switch(getProvider, createRemoteProxy) {
|
|
|
13362
13401
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
13363
13402
|
return p.setState(methodInput);
|
|
13364
13403
|
}),
|
|
13404
|
+
getOptions: trpc_middleware_js_1.protectedProcedure
|
|
13405
|
+
.input(types_153.switchCapability.methods.getOptions.input.loose())
|
|
13406
|
+
.output(types_153.switchCapability.methods.getOptions.output)
|
|
13407
|
+
.query(async ({ input, ctx }) => {
|
|
13408
|
+
const { nodeId, ...methodInput } = input;
|
|
13409
|
+
const p = resolveProvider('switch', nodeId, () => getProvider(ctx), createRemoteProxy);
|
|
13410
|
+
const fn = p.getOptions;
|
|
13411
|
+
if (typeof fn !== 'function') {
|
|
13412
|
+
throw new server_1.TRPCError({
|
|
13413
|
+
code: 'NOT_IMPLEMENTED',
|
|
13414
|
+
message: 'Capability "switch" provider does not implement "getOptions"',
|
|
13415
|
+
});
|
|
13416
|
+
}
|
|
13417
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
13418
|
+
return fn.call(p, methodInput);
|
|
13419
|
+
}),
|
|
13420
|
+
powerCycle: trpc_middleware_js_1.protectedProcedure
|
|
13421
|
+
.input(types_153.switchCapability.methods.powerCycle.input.loose())
|
|
13422
|
+
.output(types_153.switchCapability.methods.powerCycle.output)
|
|
13423
|
+
.mutation(async ({ input, ctx }) => {
|
|
13424
|
+
const { nodeId, ...methodInput } = input;
|
|
13425
|
+
const p = resolveProvider('switch', nodeId, () => getProvider(ctx), createRemoteProxy);
|
|
13426
|
+
const fn = p.powerCycle;
|
|
13427
|
+
if (typeof fn !== 'function') {
|
|
13428
|
+
throw new server_1.TRPCError({
|
|
13429
|
+
code: 'NOT_IMPLEMENTED',
|
|
13430
|
+
message: 'Capability "switch" provider does not implement "powerCycle"',
|
|
13431
|
+
});
|
|
13432
|
+
}
|
|
13433
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
13434
|
+
return fn.call(p, methodInput);
|
|
13435
|
+
}),
|
|
13365
13436
|
toggle: trpc_middleware_js_1.protectedProcedure
|
|
13366
13437
|
.input(types_153.switchCapability.methods.toggle.input.loose())
|
|
13367
13438
|
.output(types_153.switchCapability.methods.toggle.output)
|
|
@@ -13626,22 +13697,6 @@ function createCapRouter_terminalSession(getProvider, createRemoteProxy) {
|
|
|
13626
13697
|
const p = resolveProvider('terminal-session', input?.nodeId, () => getProvider(ctx), createRemoteProxy);
|
|
13627
13698
|
return p.listProfiles();
|
|
13628
13699
|
}),
|
|
13629
|
-
listLegacyCameras: trpc_middleware_js_1.adminProcedure
|
|
13630
|
-
.input(zod_1.z.object({ nodeId: zod_1.z.string().optional() }).optional())
|
|
13631
|
-
.output(types_157.terminalSessionCapability.methods.listLegacyCameras.output)
|
|
13632
|
-
.query(async ({ input, ctx }) => {
|
|
13633
|
-
const p = resolveProvider('terminal-session', input?.nodeId, () => getProvider(ctx), createRemoteProxy);
|
|
13634
|
-
return p.listLegacyCameras();
|
|
13635
|
-
}),
|
|
13636
|
-
adoptLegacyMonitor: trpc_middleware_js_1.adminProcedure
|
|
13637
|
-
.input(types_157.terminalSessionCapability.methods.adoptLegacyMonitor.input.loose())
|
|
13638
|
-
.output(types_157.terminalSessionCapability.methods.adoptLegacyMonitor.output)
|
|
13639
|
-
.mutation(async ({ input, ctx }) => {
|
|
13640
|
-
const { nodeId, ...methodInput } = input;
|
|
13641
|
-
const p = resolveProvider('terminal-session', nodeId, () => getProvider(ctx), createRemoteProxy);
|
|
13642
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
13643
|
-
return p.adoptLegacyMonitor(methodInput);
|
|
13644
|
-
}),
|
|
13645
13700
|
listSessions: trpc_middleware_js_1.adminProcedure
|
|
13646
13701
|
.input(zod_1.z.object({ nodeId: zod_1.z.string().optional() }).optional())
|
|
13647
13702
|
.output(types_157.terminalSessionCapability.methods.listSessions.output)
|
|
@@ -14837,11 +14892,129 @@ function createCapRouter_webrtcSession(getProvider, createRemoteProxy) {
|
|
|
14837
14892
|
}),
|
|
14838
14893
|
});
|
|
14839
14894
|
}
|
|
14895
|
+
function createCapRouter_workload(getProvider, createRemoteProxy) {
|
|
14896
|
+
return (0, trpc_middleware_js_1.trpcRouter)({
|
|
14897
|
+
getStatus: trpc_middleware_js_1.protectedProcedure
|
|
14898
|
+
.input(types_2.DEVICE_STATUS_METHOD.getStatus.input.loose())
|
|
14899
|
+
.output(types_2.DEVICE_STATUS_METHOD.getStatus.output)
|
|
14900
|
+
.query(async ({ input, ctx }) => {
|
|
14901
|
+
const { nodeId, ...methodInput } = input;
|
|
14902
|
+
const p = resolveProvider('workload', nodeId, () => getProvider(ctx), createRemoteProxy);
|
|
14903
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
14904
|
+
return p.getStatus(methodInput);
|
|
14905
|
+
}),
|
|
14906
|
+
start: trpc_middleware_js_1.protectedProcedure
|
|
14907
|
+
.input(types_173.workloadCapability.methods.start.input.loose())
|
|
14908
|
+
.output(types_173.workloadCapability.methods.start.output)
|
|
14909
|
+
.mutation(async ({ input, ctx }) => {
|
|
14910
|
+
const { nodeId, ...methodInput } = input;
|
|
14911
|
+
const p = resolveProvider('workload', nodeId, () => getProvider(ctx), createRemoteProxy);
|
|
14912
|
+
const fn = p.start;
|
|
14913
|
+
if (typeof fn !== 'function') {
|
|
14914
|
+
throw new server_1.TRPCError({
|
|
14915
|
+
code: 'NOT_IMPLEMENTED',
|
|
14916
|
+
message: 'Capability "workload" provider does not implement "start"',
|
|
14917
|
+
});
|
|
14918
|
+
}
|
|
14919
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
14920
|
+
return fn.call(p, methodInput);
|
|
14921
|
+
}),
|
|
14922
|
+
stop: trpc_middleware_js_1.protectedProcedure
|
|
14923
|
+
.input(types_173.workloadCapability.methods.stop.input.loose())
|
|
14924
|
+
.output(types_173.workloadCapability.methods.stop.output)
|
|
14925
|
+
.mutation(async ({ input, ctx }) => {
|
|
14926
|
+
const { nodeId, ...methodInput } = input;
|
|
14927
|
+
const p = resolveProvider('workload', nodeId, () => getProvider(ctx), createRemoteProxy);
|
|
14928
|
+
const fn = p.stop;
|
|
14929
|
+
if (typeof fn !== 'function') {
|
|
14930
|
+
throw new server_1.TRPCError({
|
|
14931
|
+
code: 'NOT_IMPLEMENTED',
|
|
14932
|
+
message: 'Capability "workload" provider does not implement "stop"',
|
|
14933
|
+
});
|
|
14934
|
+
}
|
|
14935
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
14936
|
+
return fn.call(p, methodInput);
|
|
14937
|
+
}),
|
|
14938
|
+
restart: trpc_middleware_js_1.protectedProcedure
|
|
14939
|
+
.input(types_173.workloadCapability.methods.restart.input.loose())
|
|
14940
|
+
.output(types_173.workloadCapability.methods.restart.output)
|
|
14941
|
+
.mutation(async ({ input, ctx }) => {
|
|
14942
|
+
const { nodeId, ...methodInput } = input;
|
|
14943
|
+
const p = resolveProvider('workload', nodeId, () => getProvider(ctx), createRemoteProxy);
|
|
14944
|
+
const fn = p.restart;
|
|
14945
|
+
if (typeof fn !== 'function') {
|
|
14946
|
+
throw new server_1.TRPCError({
|
|
14947
|
+
code: 'NOT_IMPLEMENTED',
|
|
14948
|
+
message: 'Capability "workload" provider does not implement "restart"',
|
|
14949
|
+
});
|
|
14950
|
+
}
|
|
14951
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
14952
|
+
return fn.call(p, methodInput);
|
|
14953
|
+
}),
|
|
14954
|
+
pause: trpc_middleware_js_1.protectedProcedure
|
|
14955
|
+
.input(types_173.workloadCapability.methods.pause.input.loose())
|
|
14956
|
+
.output(types_173.workloadCapability.methods.pause.output)
|
|
14957
|
+
.mutation(async ({ input, ctx }) => {
|
|
14958
|
+
const { nodeId, ...methodInput } = input;
|
|
14959
|
+
const p = resolveProvider('workload', nodeId, () => getProvider(ctx), createRemoteProxy);
|
|
14960
|
+
const fn = p.pause;
|
|
14961
|
+
if (typeof fn !== 'function') {
|
|
14962
|
+
throw new server_1.TRPCError({
|
|
14963
|
+
code: 'NOT_IMPLEMENTED',
|
|
14964
|
+
message: 'Capability "workload" provider does not implement "pause"',
|
|
14965
|
+
});
|
|
14966
|
+
}
|
|
14967
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
14968
|
+
return fn.call(p, methodInput);
|
|
14969
|
+
}),
|
|
14970
|
+
resume: trpc_middleware_js_1.protectedProcedure
|
|
14971
|
+
.input(types_173.workloadCapability.methods.resume.input.loose())
|
|
14972
|
+
.output(types_173.workloadCapability.methods.resume.output)
|
|
14973
|
+
.mutation(async ({ input, ctx }) => {
|
|
14974
|
+
const { nodeId, ...methodInput } = input;
|
|
14975
|
+
const p = resolveProvider('workload', nodeId, () => getProvider(ctx), createRemoteProxy);
|
|
14976
|
+
const fn = p.resume;
|
|
14977
|
+
if (typeof fn !== 'function') {
|
|
14978
|
+
throw new server_1.TRPCError({
|
|
14979
|
+
code: 'NOT_IMPLEMENTED',
|
|
14980
|
+
message: 'Capability "workload" provider does not implement "resume"',
|
|
14981
|
+
});
|
|
14982
|
+
}
|
|
14983
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
14984
|
+
return fn.call(p, methodInput);
|
|
14985
|
+
}),
|
|
14986
|
+
forceStop: trpc_middleware_js_1.adminProcedure
|
|
14987
|
+
.input(types_173.workloadCapability.methods.forceStop.input.loose())
|
|
14988
|
+
.output(types_173.workloadCapability.methods.forceStop.output)
|
|
14989
|
+
.mutation(async ({ input, ctx }) => {
|
|
14990
|
+
const { nodeId, ...methodInput } = input;
|
|
14991
|
+
const p = resolveProvider('workload', nodeId, () => getProvider(ctx), createRemoteProxy);
|
|
14992
|
+
const fn = p.forceStop;
|
|
14993
|
+
if (typeof fn !== 'function') {
|
|
14994
|
+
throw new server_1.TRPCError({
|
|
14995
|
+
code: 'NOT_IMPLEMENTED',
|
|
14996
|
+
message: 'Capability "workload" provider does not implement "forceStop"',
|
|
14997
|
+
});
|
|
14998
|
+
}
|
|
14999
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
15000
|
+
return fn.call(p, methodInput);
|
|
15001
|
+
}),
|
|
15002
|
+
getOptions: trpc_middleware_js_1.protectedProcedure
|
|
15003
|
+
.input(types_173.workloadCapability.methods.getOptions.input.loose())
|
|
15004
|
+
.output(types_173.workloadCapability.methods.getOptions.output)
|
|
15005
|
+
.query(async ({ input, ctx }) => {
|
|
15006
|
+
const { nodeId, ...methodInput } = input;
|
|
15007
|
+
const p = resolveProvider('workload', nodeId, () => getProvider(ctx), createRemoteProxy);
|
|
15008
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
15009
|
+
return p.getOptions(methodInput);
|
|
15010
|
+
}),
|
|
15011
|
+
});
|
|
15012
|
+
}
|
|
14840
15013
|
function createCapRouter_zoneAnalytics(getProvider, createRemoteProxy) {
|
|
14841
15014
|
return (0, trpc_middleware_js_1.trpcRouter)({
|
|
14842
15015
|
getCurrentSnapshot: trpc_middleware_js_1.protectedProcedure
|
|
14843
|
-
.input(
|
|
14844
|
-
.output(
|
|
15016
|
+
.input(types_174.zoneAnalyticsCapability.methods.getCurrentSnapshot.input.loose())
|
|
15017
|
+
.output(types_174.zoneAnalyticsCapability.methods.getCurrentSnapshot.output)
|
|
14845
15018
|
.query(async ({ input, ctx }) => {
|
|
14846
15019
|
const { nodeId, ...methodInput } = input;
|
|
14847
15020
|
const p = resolveProvider('zone-analytics', nodeId, () => getProvider(ctx), createRemoteProxy);
|
|
@@ -14849,8 +15022,8 @@ function createCapRouter_zoneAnalytics(getProvider, createRemoteProxy) {
|
|
|
14849
15022
|
return p.getCurrentSnapshot(methodInput);
|
|
14850
15023
|
}),
|
|
14851
15024
|
getCurrentSnapshotBatch: trpc_middleware_js_1.protectedProcedure
|
|
14852
|
-
.input(
|
|
14853
|
-
.output(
|
|
15025
|
+
.input(types_174.zoneAnalyticsCapability.methods.getCurrentSnapshotBatch.input.loose())
|
|
15026
|
+
.output(types_174.zoneAnalyticsCapability.methods.getCurrentSnapshotBatch.output)
|
|
14854
15027
|
.query(async ({ input, ctx }) => {
|
|
14855
15028
|
const { nodeId, ...methodInput } = input;
|
|
14856
15029
|
const p = resolveProvider('zone-analytics', nodeId, () => getProvider(ctx), createRemoteProxy);
|
|
@@ -14858,8 +15031,8 @@ function createCapRouter_zoneAnalytics(getProvider, createRemoteProxy) {
|
|
|
14858
15031
|
return p.getCurrentSnapshotBatch(methodInput);
|
|
14859
15032
|
}),
|
|
14860
15033
|
getZoneHistory: trpc_middleware_js_1.protectedProcedure
|
|
14861
|
-
.input(
|
|
14862
|
-
.output(
|
|
15034
|
+
.input(types_174.zoneAnalyticsCapability.methods.getZoneHistory.input.loose())
|
|
15035
|
+
.output(types_174.zoneAnalyticsCapability.methods.getZoneHistory.output)
|
|
14863
15036
|
.query(async ({ input, ctx }) => {
|
|
14864
15037
|
const { nodeId, ...methodInput } = input;
|
|
14865
15038
|
const p = resolveProvider('zone-analytics', nodeId, () => getProvider(ctx), createRemoteProxy);
|
|
@@ -14867,8 +15040,8 @@ function createCapRouter_zoneAnalytics(getProvider, createRemoteProxy) {
|
|
|
14867
15040
|
return p.getZoneHistory(methodInput);
|
|
14868
15041
|
}),
|
|
14869
15042
|
getCameraHistory: trpc_middleware_js_1.protectedProcedure
|
|
14870
|
-
.input(
|
|
14871
|
-
.output(
|
|
15043
|
+
.input(types_174.zoneAnalyticsCapability.methods.getCameraHistory.input.loose())
|
|
15044
|
+
.output(types_174.zoneAnalyticsCapability.methods.getCameraHistory.output)
|
|
14872
15045
|
.query(async ({ input, ctx }) => {
|
|
14873
15046
|
const { nodeId, ...methodInput } = input;
|
|
14874
15047
|
const p = resolveProvider('zone-analytics', nodeId, () => getProvider(ctx), createRemoteProxy);
|
|
@@ -14876,8 +15049,8 @@ function createCapRouter_zoneAnalytics(getProvider, createRemoteProxy) {
|
|
|
14876
15049
|
return p.getCameraHistory(methodInput);
|
|
14877
15050
|
}),
|
|
14878
15051
|
getUnzonedHistory: trpc_middleware_js_1.protectedProcedure
|
|
14879
|
-
.input(
|
|
14880
|
-
.output(
|
|
15052
|
+
.input(types_174.zoneAnalyticsCapability.methods.getUnzonedHistory.input.loose())
|
|
15053
|
+
.output(types_174.zoneAnalyticsCapability.methods.getUnzonedHistory.output)
|
|
14881
15054
|
.query(async ({ input, ctx }) => {
|
|
14882
15055
|
const { nodeId, ...methodInput } = input;
|
|
14883
15056
|
const p = resolveProvider('zone-analytics', nodeId, () => getProvider(ctx), createRemoteProxy);
|
|
@@ -14889,8 +15062,8 @@ function createCapRouter_zoneAnalytics(getProvider, createRemoteProxy) {
|
|
|
14889
15062
|
function createCapRouter_zoneRules(getProvider, createRemoteProxy) {
|
|
14890
15063
|
return (0, trpc_middleware_js_1.trpcRouter)({
|
|
14891
15064
|
listRules: trpc_middleware_js_1.protectedProcedure
|
|
14892
|
-
.input(
|
|
14893
|
-
.output(
|
|
15065
|
+
.input(types_175.zoneRulesCapability.methods.listRules.input.loose())
|
|
15066
|
+
.output(types_175.zoneRulesCapability.methods.listRules.output)
|
|
14894
15067
|
.query(async ({ input, ctx }) => {
|
|
14895
15068
|
const { nodeId, ...methodInput } = input;
|
|
14896
15069
|
const p = resolveProvider('zone-rules', nodeId, () => getProvider(ctx), createRemoteProxy);
|
|
@@ -14898,8 +15071,8 @@ function createCapRouter_zoneRules(getProvider, createRemoteProxy) {
|
|
|
14898
15071
|
return p.listRules(methodInput);
|
|
14899
15072
|
}),
|
|
14900
15073
|
setRules: trpc_middleware_js_1.adminProcedure
|
|
14901
|
-
.input(
|
|
14902
|
-
.output(
|
|
15074
|
+
.input(types_175.zoneRulesCapability.methods.setRules.input.loose())
|
|
15075
|
+
.output(types_175.zoneRulesCapability.methods.setRules.output)
|
|
14903
15076
|
.mutation(async ({ input, ctx }) => {
|
|
14904
15077
|
const { nodeId, ...methodInput } = input;
|
|
14905
15078
|
const p = resolveProvider('zone-rules', nodeId, () => getProvider(ctx), createRemoteProxy);
|
|
@@ -14911,8 +15084,8 @@ function createCapRouter_zoneRules(getProvider, createRemoteProxy) {
|
|
|
14911
15084
|
function createCapRouter_zones(getProvider, createRemoteProxy) {
|
|
14912
15085
|
return (0, trpc_middleware_js_1.trpcRouter)({
|
|
14913
15086
|
listZones: trpc_middleware_js_1.protectedProcedure
|
|
14914
|
-
.input(
|
|
14915
|
-
.output(
|
|
15087
|
+
.input(types_176.zonesCapability.methods.listZones.input.loose())
|
|
15088
|
+
.output(types_176.zonesCapability.methods.listZones.output)
|
|
14916
15089
|
.query(async ({ input, ctx }) => {
|
|
14917
15090
|
const { nodeId, ...methodInput } = input;
|
|
14918
15091
|
const p = resolveProvider('zones', nodeId, () => getProvider(ctx), createRemoteProxy);
|
|
@@ -14920,8 +15093,8 @@ function createCapRouter_zones(getProvider, createRemoteProxy) {
|
|
|
14920
15093
|
return p.listZones(methodInput);
|
|
14921
15094
|
}),
|
|
14922
15095
|
addZone: trpc_middleware_js_1.adminProcedure
|
|
14923
|
-
.input(
|
|
14924
|
-
.output(
|
|
15096
|
+
.input(types_176.zonesCapability.methods.addZone.input.loose())
|
|
15097
|
+
.output(types_176.zonesCapability.methods.addZone.output)
|
|
14925
15098
|
.mutation(async ({ input, ctx }) => {
|
|
14926
15099
|
const { nodeId, ...methodInput } = input;
|
|
14927
15100
|
const p = resolveProvider('zones', nodeId, () => getProvider(ctx), createRemoteProxy);
|
|
@@ -14929,8 +15102,8 @@ function createCapRouter_zones(getProvider, createRemoteProxy) {
|
|
|
14929
15102
|
return p.addZone(methodInput);
|
|
14930
15103
|
}),
|
|
14931
15104
|
removeZone: trpc_middleware_js_1.adminProcedure
|
|
14932
|
-
.input(
|
|
14933
|
-
.output(
|
|
15105
|
+
.input(types_176.zonesCapability.methods.removeZone.input.loose())
|
|
15106
|
+
.output(types_176.zonesCapability.methods.removeZone.output)
|
|
14934
15107
|
.mutation(async ({ input, ctx }) => {
|
|
14935
15108
|
const { nodeId, ...methodInput } = input;
|
|
14936
15109
|
const p = resolveProvider('zones', nodeId, () => getProvider(ctx), createRemoteProxy);
|
|
@@ -14938,8 +15111,8 @@ function createCapRouter_zones(getProvider, createRemoteProxy) {
|
|
|
14938
15111
|
return p.removeZone(methodInput);
|
|
14939
15112
|
}),
|
|
14940
15113
|
updateZone: trpc_middleware_js_1.adminProcedure
|
|
14941
|
-
.input(
|
|
14942
|
-
.output(
|
|
15114
|
+
.input(types_176.zonesCapability.methods.updateZone.input.loose())
|
|
15115
|
+
.output(types_176.zonesCapability.methods.updateZone.output)
|
|
14943
15116
|
.mutation(async ({ input, ctx }) => {
|
|
14944
15117
|
const { nodeId, ...methodInput } = input;
|
|
14945
15118
|
const p = resolveProvider('zones', nodeId, () => getProvider(ctx), createRemoteProxy);
|
|
@@ -70,6 +70,7 @@ const runner_spawn_fanout_js_1 = require("./runner-spawn-fanout.js");
|
|
|
70
70
|
const integration_instances_provider_js_1 = require("./integration-instances-provider.js");
|
|
71
71
|
const instance_links_service_js_1 = require("./instance-links.service.js");
|
|
72
72
|
const instance_lifecycle_js_1 = require("./instance-lifecycle.js");
|
|
73
|
+
const retire_undeclared_fixed_integrations_js_1 = require("./retire-undeclared-fixed-integrations.js");
|
|
73
74
|
const settings_door_wiring_js_1 = require("./settings-door-wiring.js");
|
|
74
75
|
/**
|
|
75
76
|
* Decide whether an in-memory addon entry should be evicted because it is no
|
|
@@ -1085,6 +1086,52 @@ class AddonRegistryService {
|
|
|
1085
1086
|
category: types_2.EventCategory.SystemAddonsReady,
|
|
1086
1087
|
data: { activeAddons: initializedIds },
|
|
1087
1088
|
});
|
|
1089
|
+
void this.retireUndeclaredFixedRows();
|
|
1090
|
+
}
|
|
1091
|
+
/**
|
|
1092
|
+
* The hub's seed door let a fixed integration row in; the hub retires it once its addon no
|
|
1093
|
+
* longer declares `integration-instances` and no live device hangs off it (planning#580).
|
|
1094
|
+
* Off the boot path, never throws: a registry not wired yet retires nothing this boot.
|
|
1095
|
+
*/
|
|
1096
|
+
async retireUndeclaredFixedRows() {
|
|
1097
|
+
const logger = this.loggingService.createLogger('integrations');
|
|
1098
|
+
const registry = this.integrationRegistry;
|
|
1099
|
+
if (registry === null) {
|
|
1100
|
+
logger.info('fixed-row retire skipped: the integration registry is not wired yet', {
|
|
1101
|
+
meta: { reason: this.integrationRegistryUnavailable ?? 'still wiring' },
|
|
1102
|
+
});
|
|
1103
|
+
return;
|
|
1104
|
+
}
|
|
1105
|
+
try {
|
|
1106
|
+
await (0, retire_undeclared_fixed_integrations_js_1.retireUndeclaredFixedIntegrations)({
|
|
1107
|
+
logger,
|
|
1108
|
+
listIntegrations: () => registry.listIntegrations(),
|
|
1109
|
+
declaredCapabilities: (addonId) => this.addonEntries.get(addonId)?.declaredCapabilities.map((c) => c.name),
|
|
1110
|
+
listDevices: async () => {
|
|
1111
|
+
const dm = this.capabilityRegistry.getSingleton('device-manager');
|
|
1112
|
+
if (dm?.listAll === undefined)
|
|
1113
|
+
return null;
|
|
1114
|
+
return dm.listAll({});
|
|
1115
|
+
},
|
|
1116
|
+
retire: async (integration) => {
|
|
1117
|
+
const { fixed: _fixed, ...info } = integration.info;
|
|
1118
|
+
await registry.updateIntegration(integration.id, { info });
|
|
1119
|
+
await registry.deleteIntegration(integration.id);
|
|
1120
|
+
this.eventBusService.emit({
|
|
1121
|
+
id: (0, node_crypto_1.randomUUID)(),
|
|
1122
|
+
timestamp: new Date(),
|
|
1123
|
+
source: { type: 'integration', id: integration.id },
|
|
1124
|
+
category: types_2.EventCategory.IntegrationDeleted,
|
|
1125
|
+
data: { integrationId: integration.id, addonId: integration.addonId },
|
|
1126
|
+
});
|
|
1127
|
+
},
|
|
1128
|
+
});
|
|
1129
|
+
}
|
|
1130
|
+
catch (err) {
|
|
1131
|
+
logger.warn('fixed-row retire failed: nothing retired this boot', {
|
|
1132
|
+
meta: { error: (0, types_2.errMsg)(err) },
|
|
1133
|
+
});
|
|
1134
|
+
}
|
|
1088
1135
|
}
|
|
1089
1136
|
/**
|
|
1090
1137
|
* Reload a single package — invoked by AddonHealthMonitor's retry
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.INTEGRATION_INSTANCES_CAP_NAME = void 0;
|
|
4
|
+
exports.retireUndeclaredFixedIntegrations = retireUndeclaredFixedIntegrations;
|
|
5
|
+
const types_1 = require("@camstack/types");
|
|
6
|
+
exports.INTEGRATION_INSTANCES_CAP_NAME = 'integration-instances';
|
|
7
|
+
function isFixed(integration) {
|
|
8
|
+
return integration.info?.['fixed'] === true;
|
|
9
|
+
}
|
|
10
|
+
function isUndeclared(ports, integration) {
|
|
11
|
+
const declared = ports.declaredCapabilities(integration.addonId);
|
|
12
|
+
return declared !== undefined && !declared.includes(exports.INTEGRATION_INSTANCES_CAP_NAME);
|
|
13
|
+
}
|
|
14
|
+
function devicesOf(integration, devices) {
|
|
15
|
+
return devices.filter((d) => d.integrationId === integration.id ||
|
|
16
|
+
(d.integrationId === undefined && d.addonId === integration.addonId)).length;
|
|
17
|
+
}
|
|
18
|
+
async function retireUndeclaredFixedIntegrations(ports) {
|
|
19
|
+
const { logger } = ports;
|
|
20
|
+
const candidates = (await ports.listIntegrations()).filter((i) => isFixed(i) && isUndeclared(ports, i));
|
|
21
|
+
if (candidates.length === 0)
|
|
22
|
+
return { retired: [], kept: [] };
|
|
23
|
+
const devices = await ports.listDevices();
|
|
24
|
+
if (devices === null) {
|
|
25
|
+
logger.warn('kept fixed integrations their addon no longer declares: device list unreadable', {
|
|
26
|
+
meta: { integrationIds: candidates.map((c) => c.id) },
|
|
27
|
+
});
|
|
28
|
+
return { retired: [], kept: candidates.map((c) => c.id) };
|
|
29
|
+
}
|
|
30
|
+
const retired = [];
|
|
31
|
+
const kept = [];
|
|
32
|
+
for (const integration of candidates) {
|
|
33
|
+
const tags = { integrationId: integration.id, addonId: integration.addonId };
|
|
34
|
+
const count = devicesOf(integration, devices);
|
|
35
|
+
if (count > 0) {
|
|
36
|
+
logger.info('kept a fixed integration its addon no longer declares: devices still hang off it', { tags, meta: { devices: count, name: integration.name } });
|
|
37
|
+
kept.push(integration.id);
|
|
38
|
+
continue;
|
|
39
|
+
}
|
|
40
|
+
try {
|
|
41
|
+
await ports.retire(integration);
|
|
42
|
+
logger.info('retired a fixed integration its addon no longer declares', {
|
|
43
|
+
tags,
|
|
44
|
+
meta: { name: integration.name },
|
|
45
|
+
});
|
|
46
|
+
retired.push(integration.id);
|
|
47
|
+
}
|
|
48
|
+
catch (err) {
|
|
49
|
+
logger.warn('could not retire a fixed integration its addon no longer declares', {
|
|
50
|
+
tags,
|
|
51
|
+
meta: { error: (0, types_1.errMsg)(err) },
|
|
52
|
+
});
|
|
53
|
+
kept.push(integration.id);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
return { retired, kept };
|
|
57
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@camstack/server",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.892",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -66,16 +66,28 @@
|
|
|
66
66
|
],
|
|
67
67
|
"requires": {
|
|
68
68
|
"addons": {
|
|
69
|
-
"@camstack/addon-admin-ui": ">=1.2.
|
|
70
|
-
"@camstack/addon-agent-ui": ">=1.2.
|
|
71
|
-
"@camstack/addon-export-alexa": ">=1.2.
|
|
72
|
-
"@camstack/addon-export-google": ">=0.1.
|
|
73
|
-
"@camstack/addon-export-hap": ">=1.2.
|
|
74
|
-
"@camstack/addon-
|
|
75
|
-
"@camstack/addon-pipeline-orchestrator": ">=1.2.
|
|
76
|
-
"@camstack/addon-
|
|
77
|
-
"@camstack/addon-provider-
|
|
78
|
-
"@camstack/addon-provider-
|
|
69
|
+
"@camstack/addon-admin-ui": ">=1.2.692",
|
|
70
|
+
"@camstack/addon-agent-ui": ">=1.2.403",
|
|
71
|
+
"@camstack/addon-export-alexa": ">=1.2.199",
|
|
72
|
+
"@camstack/addon-export-google": ">=0.1.136",
|
|
73
|
+
"@camstack/addon-export-hap": ">=1.2.204",
|
|
74
|
+
"@camstack/addon-pipeline": ">=1.2.657",
|
|
75
|
+
"@camstack/addon-pipeline-orchestrator": ">=1.2.697",
|
|
76
|
+
"@camstack/addon-post-analysis": ">=1.2.711",
|
|
77
|
+
"@camstack/addon-provider-bosch": ">=0.1.58",
|
|
78
|
+
"@camstack/addon-provider-ecowitt": ">=0.2.169",
|
|
79
|
+
"@camstack/addon-provider-enpal": ">=0.1.25",
|
|
80
|
+
"@camstack/addon-provider-esphome": ">=0.1.23",
|
|
81
|
+
"@camstack/addon-provider-hikvision": ">=1.2.189",
|
|
82
|
+
"@camstack/addon-provider-homeassistant": ">=1.2.691",
|
|
83
|
+
"@camstack/addon-provider-homematic": ">=1.2.205",
|
|
84
|
+
"@camstack/addon-provider-rademacher": ">=0.2.167",
|
|
85
|
+
"@camstack/addon-provider-reolink": ">=1.2.243",
|
|
86
|
+
"@camstack/addon-provider-unifi": ">=0.2.166",
|
|
87
|
+
"@camstack/addon-provider-unraid": ">=0.2.169",
|
|
88
|
+
"@camstack/addon-provider-velux": ">=0.2.171",
|
|
89
|
+
"@camstack/addon-provider-vesync": ">=0.2.160",
|
|
90
|
+
"@camstack/addon-terminal": ">=0.1.167"
|
|
79
91
|
},
|
|
80
92
|
"wrapper": {
|
|
81
93
|
"desktop": ">=0.0.1",
|
|
@@ -84,19 +96,19 @@
|
|
|
84
96
|
}
|
|
85
97
|
},
|
|
86
98
|
"dependencies": {
|
|
87
|
-
"@camstack/addon-admin-ui": "1.2.
|
|
88
|
-
"@camstack/addon-agent-ui": "1.2.
|
|
99
|
+
"@camstack/addon-admin-ui": "1.2.692",
|
|
100
|
+
"@camstack/addon-agent-ui": "1.2.403",
|
|
89
101
|
"@camstack/addon-auth": "1.2.182",
|
|
90
102
|
"@camstack/addon-benchmark": "1.2.313",
|
|
91
103
|
"@camstack/addon-decoder-nodeav": "1.2.149",
|
|
92
104
|
"@camstack/addon-notifiers": "1.2.639",
|
|
93
|
-
"@camstack/addon-pipeline": "1.2.
|
|
94
|
-
"@camstack/addon-pipeline-orchestrator": "1.2.
|
|
95
|
-
"@camstack/addon-post-analysis": "1.2.
|
|
105
|
+
"@camstack/addon-pipeline": "1.2.657",
|
|
106
|
+
"@camstack/addon-pipeline-orchestrator": "1.2.697",
|
|
107
|
+
"@camstack/addon-post-analysis": "1.2.711",
|
|
96
108
|
"@camstack/develop": "0.1.54",
|
|
97
|
-
"@camstack/sdk": "1.2.
|
|
98
|
-
"@camstack/types": "1.2.
|
|
99
|
-
"@camstack/ui-library": "1.2.
|
|
109
|
+
"@camstack/sdk": "1.2.159",
|
|
110
|
+
"@camstack/types": "1.2.587",
|
|
111
|
+
"@camstack/ui-library": "1.2.464",
|
|
100
112
|
"@fastify/compress": "^9.0.0",
|
|
101
113
|
"@fastify/cookie": "^11.0.2",
|
|
102
114
|
"@fastify/cors": "^11.2.0",
|