@camstack/server 1.2.891 → 1.2.893
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 +204 -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 +14 -15
- 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 +174 -39
- package/system/dist/builtins/core-blocks/core-blocks.addon.mjs +175 -40
- 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/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-identity-index.d.ts +73 -0
- package/system/dist/builtins/device-manager/device-manager.addon.js +401 -14
- package/system/dist/builtins/device-manager/device-manager.addon.mjs +401 -14
- package/system/dist/builtins/device-manager/device-meta-types.d.ts +5 -1
- package/system/dist/builtins/device-manager/device-row-store.d.ts +7 -3
- 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 +3 -3
- 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-nmelnj-Y.mjs → capture-engine-CIVKm_jN.mjs} +1 -1
- package/system/dist/{capture-engine-DXz37Mjg.js → capture-engine-mZ2J-GD6.js} +1 -1
- package/system/dist/{composition-sources-BLn3cU74.js → composition-sources-CGP5ZUYo.js} +1 -1
- package/system/dist/{composition-sources-uphZtYtN.mjs → composition-sources-bJP8_Z2o.mjs} +1 -1
- package/system/dist/{constants-BAaGwvKn.js → constants-BD8oSQro.js} +1 -1
- package/system/dist/{constants-DWU46D02.mjs → constants-w-6vvTPp.mjs} +1 -1
- package/system/dist/{device-ca-jbH_rqZh.js → device-ca-CXxnQaff.js} +1 -1
- package/system/dist/{device-ca-CK6mLB2w.mjs → device-ca-DE_oetBE.mjs} +1 -1
- package/system/dist/{dist-m5beNMze.js → dist-B2-Uflhy.js} +2573 -443
- package/system/dist/{dist-Dgq9nuvh.mjs → dist-Be8yFd71.mjs} +2460 -444
- package/system/dist/file-host-worker.js +1 -1
- package/system/dist/file-host-worker.mjs +1 -1
- package/system/dist/{hub-identity-CKCA89XP.js → hub-identity-BjYvJU_v.js} +1 -1
- package/system/dist/{hub-identity-DlBBoHJC.mjs → hub-identity-C3g7b58L.mjs} +1 -1
- package/system/dist/{hub-mdns-ciao-CqcCGPdi.js → hub-mdns-ciao-BRfv9GfW.js} +2 -2
- package/system/dist/{hub-mdns-ciao-B8uFW-RG.mjs → hub-mdns-ciao-v6X_SbWl.mjs} +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-Co0gj1Lm.js → legacy-integration-rows-door-B0q34gh3.js} +1 -1
- package/system/dist/{legacy-integration-rows-door-HI4nmSe_.mjs → legacy-integration-rows-door-DG35DG06.mjs} +1 -1
- package/system/dist/{rename-composition-block-UeVUYCwx.js → rename-composition-block-DNte3Cs9.js} +1 -1
- package/system/dist/{rename-composition-block-BthBMrXA.mjs → rename-composition-block-LEbZ4oZE.mjs} +1 -1
- package/system/dist/{restore-archive-P-ICnU58.mjs → restore-archive--4ENkU5f.mjs} +1 -1
- package/system/dist/{restore-archive-CJLsfBwK.js → restore-archive-DpFPheMK.js} +1 -1
- package/system/dist/{wal-maintenance-CUtwx-2Z.js → wal-maintenance-BWUJktqT.js} +0 -0
- package/system/dist/{wal-maintenance-qWjb7_f2.mjs → wal-maintenance-DQVDhuVJ.mjs} +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.893] - 2026-11-17
|
|
11
|
+
|
|
12
|
+
### Changed
|
|
13
|
+
|
|
14
|
+
- device-manager.listIdentityCandidates lists devices of different integrations that share hardware identifiers (auto / proposal confidence); read-only, no links yet
|
|
15
|
+
|
|
16
|
+
## [1.2.892] - 2026-11-17
|
|
17
|
+
|
|
18
|
+
### Added
|
|
19
|
+
|
|
20
|
+
- API routes for the new workload capability
|
|
21
|
+
- API route for the siren's play choices
|
|
22
|
+
|
|
23
|
+
### Changed
|
|
24
|
+
|
|
25
|
+
- 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.
|
|
26
|
+
- 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.
|
|
27
|
+
- Routes for switch getOptions and powerCycle.
|
|
28
|
+
- A workload restart is allowed to the same users as start and stop; force stop stays admin
|
|
29
|
+
- The API exposes deviceManager.setIdentifiers and returns each device's declared identifiers.
|
|
30
|
+
- Power source: a switch whose options read keeps failing warns once per device until a read succeeds, not on every status read
|
|
31
|
+
|
|
10
32
|
## [1.2.891] - 2026-11-16
|
|
11
33
|
|
|
12
34
|
### Added
|
|
@@ -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,26 @@ 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
|
+
}),
|
|
3716
|
+
listIdentityCandidates: trpc_middleware_js_1.adminProcedure
|
|
3717
|
+
.input(types_53.deviceManagerCapability.methods.listIdentityCandidates.input.loose())
|
|
3718
|
+
.output(types_53.deviceManagerCapability.methods.listIdentityCandidates.output)
|
|
3719
|
+
.query(async ({ input, ctx }) => {
|
|
3720
|
+
const parsedInput = ctx.req !== undefined ? (0, types_3.withoutCallerStamp)(input) : input;
|
|
3721
|
+
const { nodeId, ...methodInput } = parsedInput;
|
|
3722
|
+
const p = resolveProvider('device-manager', nodeId, () => getProvider(ctx), createRemoteProxy);
|
|
3723
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
3724
|
+
return p.listIdentityCandidates(methodInput);
|
|
3725
|
+
}),
|
|
3704
3726
|
listLocations: trpc_middleware_js_1.protectedProcedure
|
|
3705
3727
|
.input(zod_1.z.object({ nodeId: zod_1.z.string().optional() }).optional())
|
|
3706
3728
|
.output(types_53.deviceManagerCapability.methods.listLocations.output)
|
|
@@ -12283,6 +12305,15 @@ function createCapRouter_siren(getProvider, createRemoteProxy) {
|
|
|
12283
12305
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
12284
12306
|
return p.getOptions(methodInput);
|
|
12285
12307
|
}),
|
|
12308
|
+
getPlayChoices: trpc_middleware_js_1.protectedProcedure
|
|
12309
|
+
.input(types_139.sirenCapability.methods.getPlayChoices.input.loose())
|
|
12310
|
+
.output(types_139.sirenCapability.methods.getPlayChoices.output)
|
|
12311
|
+
.query(async ({ input, ctx }) => {
|
|
12312
|
+
const { nodeId, ...methodInput } = input;
|
|
12313
|
+
const p = resolveProvider('siren', nodeId, () => getProvider(ctx), createRemoteProxy);
|
|
12314
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
12315
|
+
return p.getPlayChoices(methodInput);
|
|
12316
|
+
}),
|
|
12286
12317
|
trigger: trpc_middleware_js_1.protectedProcedure
|
|
12287
12318
|
.input(types_139.sirenCapability.methods.trigger.input.loose())
|
|
12288
12319
|
.output(types_139.sirenCapability.methods.trigger.output)
|
|
@@ -13380,6 +13411,38 @@ function createCapRouter_switch(getProvider, createRemoteProxy) {
|
|
|
13380
13411
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
13381
13412
|
return p.setState(methodInput);
|
|
13382
13413
|
}),
|
|
13414
|
+
getOptions: trpc_middleware_js_1.protectedProcedure
|
|
13415
|
+
.input(types_153.switchCapability.methods.getOptions.input.loose())
|
|
13416
|
+
.output(types_153.switchCapability.methods.getOptions.output)
|
|
13417
|
+
.query(async ({ input, ctx }) => {
|
|
13418
|
+
const { nodeId, ...methodInput } = input;
|
|
13419
|
+
const p = resolveProvider('switch', nodeId, () => getProvider(ctx), createRemoteProxy);
|
|
13420
|
+
const fn = p.getOptions;
|
|
13421
|
+
if (typeof fn !== 'function') {
|
|
13422
|
+
throw new server_1.TRPCError({
|
|
13423
|
+
code: 'NOT_IMPLEMENTED',
|
|
13424
|
+
message: 'Capability "switch" provider does not implement "getOptions"',
|
|
13425
|
+
});
|
|
13426
|
+
}
|
|
13427
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
13428
|
+
return fn.call(p, methodInput);
|
|
13429
|
+
}),
|
|
13430
|
+
powerCycle: trpc_middleware_js_1.protectedProcedure
|
|
13431
|
+
.input(types_153.switchCapability.methods.powerCycle.input.loose())
|
|
13432
|
+
.output(types_153.switchCapability.methods.powerCycle.output)
|
|
13433
|
+
.mutation(async ({ input, ctx }) => {
|
|
13434
|
+
const { nodeId, ...methodInput } = input;
|
|
13435
|
+
const p = resolveProvider('switch', nodeId, () => getProvider(ctx), createRemoteProxy);
|
|
13436
|
+
const fn = p.powerCycle;
|
|
13437
|
+
if (typeof fn !== 'function') {
|
|
13438
|
+
throw new server_1.TRPCError({
|
|
13439
|
+
code: 'NOT_IMPLEMENTED',
|
|
13440
|
+
message: 'Capability "switch" provider does not implement "powerCycle"',
|
|
13441
|
+
});
|
|
13442
|
+
}
|
|
13443
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
13444
|
+
return fn.call(p, methodInput);
|
|
13445
|
+
}),
|
|
13383
13446
|
toggle: trpc_middleware_js_1.protectedProcedure
|
|
13384
13447
|
.input(types_153.switchCapability.methods.toggle.input.loose())
|
|
13385
13448
|
.output(types_153.switchCapability.methods.toggle.output)
|
|
@@ -13644,22 +13707,6 @@ function createCapRouter_terminalSession(getProvider, createRemoteProxy) {
|
|
|
13644
13707
|
const p = resolveProvider('terminal-session', input?.nodeId, () => getProvider(ctx), createRemoteProxy);
|
|
13645
13708
|
return p.listProfiles();
|
|
13646
13709
|
}),
|
|
13647
|
-
listLegacyCameras: trpc_middleware_js_1.adminProcedure
|
|
13648
|
-
.input(zod_1.z.object({ nodeId: zod_1.z.string().optional() }).optional())
|
|
13649
|
-
.output(types_157.terminalSessionCapability.methods.listLegacyCameras.output)
|
|
13650
|
-
.query(async ({ input, ctx }) => {
|
|
13651
|
-
const p = resolveProvider('terminal-session', input?.nodeId, () => getProvider(ctx), createRemoteProxy);
|
|
13652
|
-
return p.listLegacyCameras();
|
|
13653
|
-
}),
|
|
13654
|
-
adoptLegacyMonitor: trpc_middleware_js_1.adminProcedure
|
|
13655
|
-
.input(types_157.terminalSessionCapability.methods.adoptLegacyMonitor.input.loose())
|
|
13656
|
-
.output(types_157.terminalSessionCapability.methods.adoptLegacyMonitor.output)
|
|
13657
|
-
.mutation(async ({ input, ctx }) => {
|
|
13658
|
-
const { nodeId, ...methodInput } = input;
|
|
13659
|
-
const p = resolveProvider('terminal-session', nodeId, () => getProvider(ctx), createRemoteProxy);
|
|
13660
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
13661
|
-
return p.adoptLegacyMonitor(methodInput);
|
|
13662
|
-
}),
|
|
13663
13710
|
listSessions: trpc_middleware_js_1.adminProcedure
|
|
13664
13711
|
.input(zod_1.z.object({ nodeId: zod_1.z.string().optional() }).optional())
|
|
13665
13712
|
.output(types_157.terminalSessionCapability.methods.listSessions.output)
|
|
@@ -14855,11 +14902,129 @@ function createCapRouter_webrtcSession(getProvider, createRemoteProxy) {
|
|
|
14855
14902
|
}),
|
|
14856
14903
|
});
|
|
14857
14904
|
}
|
|
14905
|
+
function createCapRouter_workload(getProvider, createRemoteProxy) {
|
|
14906
|
+
return (0, trpc_middleware_js_1.trpcRouter)({
|
|
14907
|
+
getStatus: trpc_middleware_js_1.protectedProcedure
|
|
14908
|
+
.input(types_2.DEVICE_STATUS_METHOD.getStatus.input.loose())
|
|
14909
|
+
.output(types_2.DEVICE_STATUS_METHOD.getStatus.output)
|
|
14910
|
+
.query(async ({ input, ctx }) => {
|
|
14911
|
+
const { nodeId, ...methodInput } = input;
|
|
14912
|
+
const p = resolveProvider('workload', nodeId, () => getProvider(ctx), createRemoteProxy);
|
|
14913
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
14914
|
+
return p.getStatus(methodInput);
|
|
14915
|
+
}),
|
|
14916
|
+
start: trpc_middleware_js_1.protectedProcedure
|
|
14917
|
+
.input(types_173.workloadCapability.methods.start.input.loose())
|
|
14918
|
+
.output(types_173.workloadCapability.methods.start.output)
|
|
14919
|
+
.mutation(async ({ input, ctx }) => {
|
|
14920
|
+
const { nodeId, ...methodInput } = input;
|
|
14921
|
+
const p = resolveProvider('workload', nodeId, () => getProvider(ctx), createRemoteProxy);
|
|
14922
|
+
const fn = p.start;
|
|
14923
|
+
if (typeof fn !== 'function') {
|
|
14924
|
+
throw new server_1.TRPCError({
|
|
14925
|
+
code: 'NOT_IMPLEMENTED',
|
|
14926
|
+
message: 'Capability "workload" provider does not implement "start"',
|
|
14927
|
+
});
|
|
14928
|
+
}
|
|
14929
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
14930
|
+
return fn.call(p, methodInput);
|
|
14931
|
+
}),
|
|
14932
|
+
stop: trpc_middleware_js_1.protectedProcedure
|
|
14933
|
+
.input(types_173.workloadCapability.methods.stop.input.loose())
|
|
14934
|
+
.output(types_173.workloadCapability.methods.stop.output)
|
|
14935
|
+
.mutation(async ({ input, ctx }) => {
|
|
14936
|
+
const { nodeId, ...methodInput } = input;
|
|
14937
|
+
const p = resolveProvider('workload', nodeId, () => getProvider(ctx), createRemoteProxy);
|
|
14938
|
+
const fn = p.stop;
|
|
14939
|
+
if (typeof fn !== 'function') {
|
|
14940
|
+
throw new server_1.TRPCError({
|
|
14941
|
+
code: 'NOT_IMPLEMENTED',
|
|
14942
|
+
message: 'Capability "workload" provider does not implement "stop"',
|
|
14943
|
+
});
|
|
14944
|
+
}
|
|
14945
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
14946
|
+
return fn.call(p, methodInput);
|
|
14947
|
+
}),
|
|
14948
|
+
restart: trpc_middleware_js_1.protectedProcedure
|
|
14949
|
+
.input(types_173.workloadCapability.methods.restart.input.loose())
|
|
14950
|
+
.output(types_173.workloadCapability.methods.restart.output)
|
|
14951
|
+
.mutation(async ({ input, ctx }) => {
|
|
14952
|
+
const { nodeId, ...methodInput } = input;
|
|
14953
|
+
const p = resolveProvider('workload', nodeId, () => getProvider(ctx), createRemoteProxy);
|
|
14954
|
+
const fn = p.restart;
|
|
14955
|
+
if (typeof fn !== 'function') {
|
|
14956
|
+
throw new server_1.TRPCError({
|
|
14957
|
+
code: 'NOT_IMPLEMENTED',
|
|
14958
|
+
message: 'Capability "workload" provider does not implement "restart"',
|
|
14959
|
+
});
|
|
14960
|
+
}
|
|
14961
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
14962
|
+
return fn.call(p, methodInput);
|
|
14963
|
+
}),
|
|
14964
|
+
pause: trpc_middleware_js_1.protectedProcedure
|
|
14965
|
+
.input(types_173.workloadCapability.methods.pause.input.loose())
|
|
14966
|
+
.output(types_173.workloadCapability.methods.pause.output)
|
|
14967
|
+
.mutation(async ({ input, ctx }) => {
|
|
14968
|
+
const { nodeId, ...methodInput } = input;
|
|
14969
|
+
const p = resolveProvider('workload', nodeId, () => getProvider(ctx), createRemoteProxy);
|
|
14970
|
+
const fn = p.pause;
|
|
14971
|
+
if (typeof fn !== 'function') {
|
|
14972
|
+
throw new server_1.TRPCError({
|
|
14973
|
+
code: 'NOT_IMPLEMENTED',
|
|
14974
|
+
message: 'Capability "workload" provider does not implement "pause"',
|
|
14975
|
+
});
|
|
14976
|
+
}
|
|
14977
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
14978
|
+
return fn.call(p, methodInput);
|
|
14979
|
+
}),
|
|
14980
|
+
resume: trpc_middleware_js_1.protectedProcedure
|
|
14981
|
+
.input(types_173.workloadCapability.methods.resume.input.loose())
|
|
14982
|
+
.output(types_173.workloadCapability.methods.resume.output)
|
|
14983
|
+
.mutation(async ({ input, ctx }) => {
|
|
14984
|
+
const { nodeId, ...methodInput } = input;
|
|
14985
|
+
const p = resolveProvider('workload', nodeId, () => getProvider(ctx), createRemoteProxy);
|
|
14986
|
+
const fn = p.resume;
|
|
14987
|
+
if (typeof fn !== 'function') {
|
|
14988
|
+
throw new server_1.TRPCError({
|
|
14989
|
+
code: 'NOT_IMPLEMENTED',
|
|
14990
|
+
message: 'Capability "workload" provider does not implement "resume"',
|
|
14991
|
+
});
|
|
14992
|
+
}
|
|
14993
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
14994
|
+
return fn.call(p, methodInput);
|
|
14995
|
+
}),
|
|
14996
|
+
forceStop: trpc_middleware_js_1.adminProcedure
|
|
14997
|
+
.input(types_173.workloadCapability.methods.forceStop.input.loose())
|
|
14998
|
+
.output(types_173.workloadCapability.methods.forceStop.output)
|
|
14999
|
+
.mutation(async ({ input, ctx }) => {
|
|
15000
|
+
const { nodeId, ...methodInput } = input;
|
|
15001
|
+
const p = resolveProvider('workload', nodeId, () => getProvider(ctx), createRemoteProxy);
|
|
15002
|
+
const fn = p.forceStop;
|
|
15003
|
+
if (typeof fn !== 'function') {
|
|
15004
|
+
throw new server_1.TRPCError({
|
|
15005
|
+
code: 'NOT_IMPLEMENTED',
|
|
15006
|
+
message: 'Capability "workload" provider does not implement "forceStop"',
|
|
15007
|
+
});
|
|
15008
|
+
}
|
|
15009
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
15010
|
+
return fn.call(p, methodInput);
|
|
15011
|
+
}),
|
|
15012
|
+
getOptions: trpc_middleware_js_1.protectedProcedure
|
|
15013
|
+
.input(types_173.workloadCapability.methods.getOptions.input.loose())
|
|
15014
|
+
.output(types_173.workloadCapability.methods.getOptions.output)
|
|
15015
|
+
.query(async ({ input, ctx }) => {
|
|
15016
|
+
const { nodeId, ...methodInput } = input;
|
|
15017
|
+
const p = resolveProvider('workload', nodeId, () => getProvider(ctx), createRemoteProxy);
|
|
15018
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
|
|
15019
|
+
return p.getOptions(methodInput);
|
|
15020
|
+
}),
|
|
15021
|
+
});
|
|
15022
|
+
}
|
|
14858
15023
|
function createCapRouter_zoneAnalytics(getProvider, createRemoteProxy) {
|
|
14859
15024
|
return (0, trpc_middleware_js_1.trpcRouter)({
|
|
14860
15025
|
getCurrentSnapshot: trpc_middleware_js_1.protectedProcedure
|
|
14861
|
-
.input(
|
|
14862
|
-
.output(
|
|
15026
|
+
.input(types_174.zoneAnalyticsCapability.methods.getCurrentSnapshot.input.loose())
|
|
15027
|
+
.output(types_174.zoneAnalyticsCapability.methods.getCurrentSnapshot.output)
|
|
14863
15028
|
.query(async ({ input, ctx }) => {
|
|
14864
15029
|
const { nodeId, ...methodInput } = input;
|
|
14865
15030
|
const p = resolveProvider('zone-analytics', nodeId, () => getProvider(ctx), createRemoteProxy);
|
|
@@ -14867,8 +15032,8 @@ function createCapRouter_zoneAnalytics(getProvider, createRemoteProxy) {
|
|
|
14867
15032
|
return p.getCurrentSnapshot(methodInput);
|
|
14868
15033
|
}),
|
|
14869
15034
|
getCurrentSnapshotBatch: trpc_middleware_js_1.protectedProcedure
|
|
14870
|
-
.input(
|
|
14871
|
-
.output(
|
|
15035
|
+
.input(types_174.zoneAnalyticsCapability.methods.getCurrentSnapshotBatch.input.loose())
|
|
15036
|
+
.output(types_174.zoneAnalyticsCapability.methods.getCurrentSnapshotBatch.output)
|
|
14872
15037
|
.query(async ({ input, ctx }) => {
|
|
14873
15038
|
const { nodeId, ...methodInput } = input;
|
|
14874
15039
|
const p = resolveProvider('zone-analytics', nodeId, () => getProvider(ctx), createRemoteProxy);
|
|
@@ -14876,8 +15041,8 @@ function createCapRouter_zoneAnalytics(getProvider, createRemoteProxy) {
|
|
|
14876
15041
|
return p.getCurrentSnapshotBatch(methodInput);
|
|
14877
15042
|
}),
|
|
14878
15043
|
getZoneHistory: trpc_middleware_js_1.protectedProcedure
|
|
14879
|
-
.input(
|
|
14880
|
-
.output(
|
|
15044
|
+
.input(types_174.zoneAnalyticsCapability.methods.getZoneHistory.input.loose())
|
|
15045
|
+
.output(types_174.zoneAnalyticsCapability.methods.getZoneHistory.output)
|
|
14881
15046
|
.query(async ({ input, ctx }) => {
|
|
14882
15047
|
const { nodeId, ...methodInput } = input;
|
|
14883
15048
|
const p = resolveProvider('zone-analytics', nodeId, () => getProvider(ctx), createRemoteProxy);
|
|
@@ -14885,8 +15050,8 @@ function createCapRouter_zoneAnalytics(getProvider, createRemoteProxy) {
|
|
|
14885
15050
|
return p.getZoneHistory(methodInput);
|
|
14886
15051
|
}),
|
|
14887
15052
|
getCameraHistory: trpc_middleware_js_1.protectedProcedure
|
|
14888
|
-
.input(
|
|
14889
|
-
.output(
|
|
15053
|
+
.input(types_174.zoneAnalyticsCapability.methods.getCameraHistory.input.loose())
|
|
15054
|
+
.output(types_174.zoneAnalyticsCapability.methods.getCameraHistory.output)
|
|
14890
15055
|
.query(async ({ input, ctx }) => {
|
|
14891
15056
|
const { nodeId, ...methodInput } = input;
|
|
14892
15057
|
const p = resolveProvider('zone-analytics', nodeId, () => getProvider(ctx), createRemoteProxy);
|
|
@@ -14894,8 +15059,8 @@ function createCapRouter_zoneAnalytics(getProvider, createRemoteProxy) {
|
|
|
14894
15059
|
return p.getCameraHistory(methodInput);
|
|
14895
15060
|
}),
|
|
14896
15061
|
getUnzonedHistory: trpc_middleware_js_1.protectedProcedure
|
|
14897
|
-
.input(
|
|
14898
|
-
.output(
|
|
15062
|
+
.input(types_174.zoneAnalyticsCapability.methods.getUnzonedHistory.input.loose())
|
|
15063
|
+
.output(types_174.zoneAnalyticsCapability.methods.getUnzonedHistory.output)
|
|
14899
15064
|
.query(async ({ input, ctx }) => {
|
|
14900
15065
|
const { nodeId, ...methodInput } = input;
|
|
14901
15066
|
const p = resolveProvider('zone-analytics', nodeId, () => getProvider(ctx), createRemoteProxy);
|
|
@@ -14907,8 +15072,8 @@ function createCapRouter_zoneAnalytics(getProvider, createRemoteProxy) {
|
|
|
14907
15072
|
function createCapRouter_zoneRules(getProvider, createRemoteProxy) {
|
|
14908
15073
|
return (0, trpc_middleware_js_1.trpcRouter)({
|
|
14909
15074
|
listRules: trpc_middleware_js_1.protectedProcedure
|
|
14910
|
-
.input(
|
|
14911
|
-
.output(
|
|
15075
|
+
.input(types_175.zoneRulesCapability.methods.listRules.input.loose())
|
|
15076
|
+
.output(types_175.zoneRulesCapability.methods.listRules.output)
|
|
14912
15077
|
.query(async ({ input, ctx }) => {
|
|
14913
15078
|
const { nodeId, ...methodInput } = input;
|
|
14914
15079
|
const p = resolveProvider('zone-rules', nodeId, () => getProvider(ctx), createRemoteProxy);
|
|
@@ -14916,8 +15081,8 @@ function createCapRouter_zoneRules(getProvider, createRemoteProxy) {
|
|
|
14916
15081
|
return p.listRules(methodInput);
|
|
14917
15082
|
}),
|
|
14918
15083
|
setRules: trpc_middleware_js_1.adminProcedure
|
|
14919
|
-
.input(
|
|
14920
|
-
.output(
|
|
15084
|
+
.input(types_175.zoneRulesCapability.methods.setRules.input.loose())
|
|
15085
|
+
.output(types_175.zoneRulesCapability.methods.setRules.output)
|
|
14921
15086
|
.mutation(async ({ input, ctx }) => {
|
|
14922
15087
|
const { nodeId, ...methodInput } = input;
|
|
14923
15088
|
const p = resolveProvider('zone-rules', nodeId, () => getProvider(ctx), createRemoteProxy);
|
|
@@ -14929,8 +15094,8 @@ function createCapRouter_zoneRules(getProvider, createRemoteProxy) {
|
|
|
14929
15094
|
function createCapRouter_zones(getProvider, createRemoteProxy) {
|
|
14930
15095
|
return (0, trpc_middleware_js_1.trpcRouter)({
|
|
14931
15096
|
listZones: trpc_middleware_js_1.protectedProcedure
|
|
14932
|
-
.input(
|
|
14933
|
-
.output(
|
|
15097
|
+
.input(types_176.zonesCapability.methods.listZones.input.loose())
|
|
15098
|
+
.output(types_176.zonesCapability.methods.listZones.output)
|
|
14934
15099
|
.query(async ({ input, ctx }) => {
|
|
14935
15100
|
const { nodeId, ...methodInput } = input;
|
|
14936
15101
|
const p = resolveProvider('zones', nodeId, () => getProvider(ctx), createRemoteProxy);
|
|
@@ -14938,8 +15103,8 @@ function createCapRouter_zones(getProvider, createRemoteProxy) {
|
|
|
14938
15103
|
return p.listZones(methodInput);
|
|
14939
15104
|
}),
|
|
14940
15105
|
addZone: trpc_middleware_js_1.adminProcedure
|
|
14941
|
-
.input(
|
|
14942
|
-
.output(
|
|
15106
|
+
.input(types_176.zonesCapability.methods.addZone.input.loose())
|
|
15107
|
+
.output(types_176.zonesCapability.methods.addZone.output)
|
|
14943
15108
|
.mutation(async ({ input, ctx }) => {
|
|
14944
15109
|
const { nodeId, ...methodInput } = input;
|
|
14945
15110
|
const p = resolveProvider('zones', nodeId, () => getProvider(ctx), createRemoteProxy);
|
|
@@ -14947,8 +15112,8 @@ function createCapRouter_zones(getProvider, createRemoteProxy) {
|
|
|
14947
15112
|
return p.addZone(methodInput);
|
|
14948
15113
|
}),
|
|
14949
15114
|
removeZone: trpc_middleware_js_1.adminProcedure
|
|
14950
|
-
.input(
|
|
14951
|
-
.output(
|
|
15115
|
+
.input(types_176.zonesCapability.methods.removeZone.input.loose())
|
|
15116
|
+
.output(types_176.zonesCapability.methods.removeZone.output)
|
|
14952
15117
|
.mutation(async ({ input, ctx }) => {
|
|
14953
15118
|
const { nodeId, ...methodInput } = input;
|
|
14954
15119
|
const p = resolveProvider('zones', nodeId, () => getProvider(ctx), createRemoteProxy);
|
|
@@ -14956,8 +15121,8 @@ function createCapRouter_zones(getProvider, createRemoteProxy) {
|
|
|
14956
15121
|
return p.removeZone(methodInput);
|
|
14957
15122
|
}),
|
|
14958
15123
|
updateZone: trpc_middleware_js_1.adminProcedure
|
|
14959
|
-
.input(
|
|
14960
|
-
.output(
|
|
15124
|
+
.input(types_176.zonesCapability.methods.updateZone.input.loose())
|
|
15125
|
+
.output(types_176.zonesCapability.methods.updateZone.output)
|
|
14961
15126
|
.mutation(async ({ input, ctx }) => {
|
|
14962
15127
|
const { nodeId, ...methodInput } = input;
|
|
14963
15128
|
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.893",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -66,12 +66,11 @@
|
|
|
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-
|
|
72
|
-
"@camstack/addon-
|
|
73
|
-
"@camstack/addon-provider-
|
|
74
|
-
"@camstack/addon-terminal": ">=0.1.166"
|
|
69
|
+
"@camstack/addon-admin-ui": ">=1.2.693",
|
|
70
|
+
"@camstack/addon-agent-ui": ">=1.2.404",
|
|
71
|
+
"@camstack/addon-export-hap": ">=1.2.205",
|
|
72
|
+
"@camstack/addon-pipeline-orchestrator": ">=1.2.698",
|
|
73
|
+
"@camstack/addon-provider-vesync": ">=0.2.161"
|
|
75
74
|
},
|
|
76
75
|
"wrapper": {
|
|
77
76
|
"desktop": ">=0.0.1",
|
|
@@ -80,19 +79,19 @@
|
|
|
80
79
|
}
|
|
81
80
|
},
|
|
82
81
|
"dependencies": {
|
|
83
|
-
"@camstack/addon-admin-ui": "1.2.
|
|
84
|
-
"@camstack/addon-agent-ui": "1.2.
|
|
82
|
+
"@camstack/addon-admin-ui": "1.2.693",
|
|
83
|
+
"@camstack/addon-agent-ui": "1.2.404",
|
|
85
84
|
"@camstack/addon-auth": "1.2.182",
|
|
86
85
|
"@camstack/addon-benchmark": "1.2.313",
|
|
87
86
|
"@camstack/addon-decoder-nodeav": "1.2.149",
|
|
88
87
|
"@camstack/addon-notifiers": "1.2.639",
|
|
89
|
-
"@camstack/addon-pipeline": "1.2.
|
|
90
|
-
"@camstack/addon-pipeline-orchestrator": "1.2.
|
|
91
|
-
"@camstack/addon-post-analysis": "1.2.
|
|
88
|
+
"@camstack/addon-pipeline": "1.2.657",
|
|
89
|
+
"@camstack/addon-pipeline-orchestrator": "1.2.698",
|
|
90
|
+
"@camstack/addon-post-analysis": "1.2.711",
|
|
92
91
|
"@camstack/develop": "0.1.54",
|
|
93
|
-
"@camstack/sdk": "1.2.
|
|
94
|
-
"@camstack/types": "1.2.
|
|
95
|
-
"@camstack/ui-library": "1.2.
|
|
92
|
+
"@camstack/sdk": "1.2.159",
|
|
93
|
+
"@camstack/types": "1.2.588",
|
|
94
|
+
"@camstack/ui-library": "1.2.465",
|
|
96
95
|
"@fastify/compress": "^9.0.0",
|
|
97
96
|
"@fastify/cookie": "^11.0.2",
|
|
98
97
|
"@fastify/cors": "^11.2.0",
|