@camstack/server 1.2.928 → 1.2.929
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 +6 -0
- package/package.json +10 -8
- package/system/dist/addon-id-CVg1_r5E.mjs +39 -0
- package/system/dist/addon-id-Di0lNJ89.js +50 -0
- package/system/dist/addon-pages.cap-Df9FQwN1.js +49 -0
- package/system/dist/addon-pages.cap-DksUlE8j.mjs +44 -0
- package/system/dist/addon-settings.cap-3-TIIMq_.mjs +592 -0
- package/system/dist/addon-settings.cap-DAiE0Nb0.js +651 -0
- package/system/dist/addon-utils.mjs +1 -1
- package/system/dist/addon-widgets.cap-C4jxflbF.js +200 -0
- package/system/dist/addon-widgets.cap-D9m48X78.mjs +183 -0
- package/system/dist/base-addon-DD5dIfcZ.js +4624 -0
- package/system/dist/base-addon-Md14i7pe.mjs +4505 -0
- package/system/dist/base-device-2sL1DMm1.js +1103 -0
- package/system/dist/base-device-IuM1AwXZ.mjs +1098 -0
- package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +8 -6
- package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +6 -4
- package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +8 -6
- package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +7 -5
- package/system/dist/builtins/alerts/alerts.addon.js +113 -56
- package/system/dist/builtins/alerts/alerts.addon.mjs +60 -3
- package/system/dist/builtins/autotrack/index.js +21 -17
- package/system/dist/builtins/autotrack/index.mjs +5 -1
- package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +14 -11
- package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +8 -5
- package/system/dist/builtins/calendars/calendars.addon.js +8 -6
- package/system/dist/builtins/calendars/calendars.addon.mjs +3 -1
- package/system/dist/builtins/camera-grid/index.js +615 -58
- package/system/dist/builtins/camera-grid/index.mjs +558 -1
- package/system/dist/builtins/composer/composer.addon.js +788 -209
- package/system/dist/builtins/composer/composer.addon.mjs +583 -4
- package/system/dist/builtins/console-logging/index.js +4 -3
- package/system/dist/builtins/console-logging/index.mjs +2 -1
- package/system/dist/builtins/core-blocks/core-blocks.addon.js +7887 -381
- package/system/dist/builtins/core-blocks/core-blocks.addon.mjs +7511 -5
- package/system/dist/builtins/core-notifier/core-notifier.addon.js +731 -21
- package/system/dist/builtins/core-notifier/core-notifier.addon.mjs +711 -1
- package/system/dist/builtins/device-history/device-history.addon.js +110 -31
- package/system/dist/builtins/device-history/device-history.addon.mjs +81 -2
- package/system/dist/builtins/device-manager/device-manager.addon.js +12806 -227
- package/system/dist/builtins/device-manager/device-manager.addon.mjs +12583 -5
- package/system/dist/builtins/hub-forwarder/index.js +4 -3
- package/system/dist/builtins/hub-forwarder/index.mjs +2 -1
- package/system/dist/builtins/keychain/index.js +31 -28
- package/system/dist/builtins/keychain/index.mjs +7 -4
- package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.js +15 -12
- package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +4 -1
- package/system/dist/builtins/local-auth/local-auth.addon.js +140 -39
- package/system/dist/builtins/local-auth/local-auth.addon.mjs +106 -6
- package/system/dist/builtins/local-network/local-network.addon.js +43 -39
- package/system/dist/builtins/local-network/local-network.addon.mjs +7 -3
- package/system/dist/builtins/loki-logging/index.js +23 -17
- package/system/dist/builtins/loki-logging/index.mjs +7 -1
- package/system/dist/builtins/native-metrics/native-metrics.addon.js +156 -15
- package/system/dist/builtins/native-metrics/native-metrics.addon.mjs +151 -10
- package/system/dist/builtins/platform-probe/index.js +25 -23
- package/system/dist/builtins/platform-probe/index.mjs +12 -10
- package/system/dist/builtins/record-entries/index.js +9 -7
- package/system/dist/builtins/record-entries/index.mjs +3 -1
- package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +4 -4
- package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
- package/system/dist/builtins/snapshot/index.js +97 -44
- package/system/dist/builtins/snapshot/index.mjs +54 -1
- package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.js +5 -4
- package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +21 -20
- 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 +87 -61
- package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +29 -3
- package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +81 -72
- package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +10 -1
- package/system/dist/builtins/system-config/system-config.addon.js +17 -14
- package/system/dist/builtins/system-config/system-config.addon.mjs +118 -115
- package/system/dist/builtins/winston-logging/index.js +7 -5
- package/system/dist/builtins/winston-logging/index.mjs +3 -1
- package/system/dist/calendars.cap-CaFlShS9.js +155 -0
- package/system/dist/calendars.cap-_C4eD4fi.mjs +138 -0
- package/system/dist/camstack-error-DJ-TUAi1.js +23 -0
- package/system/dist/camstack-error-viZYfcj9.mjs +18 -0
- package/system/dist/cap-call-context-Bd76CbOW.js +95 -0
- package/system/dist/cap-call-context-DNwdgGSQ.mjs +78 -0
- package/system/dist/capability-definition-C2rJdVeX.mjs +177 -0
- package/system/dist/capability-definition-HCmTem8c.js +242 -0
- package/system/dist/{capture-engine-BcuwOSXv.js → capture-engine-DZ0LIUqA.js} +5 -4
- package/system/dist/{capture-engine-Bz7eXFjT.mjs → capture-engine-DiwbjoWp.mjs} +2 -1
- package/system/dist/command-origin-claim-Cief660O.js +35 -0
- package/system/dist/command-origin-claim-D1Wy7Qld.mjs +24 -0
- package/system/dist/composition-sources-Caqv7O7z.mjs +391 -0
- package/system/dist/composition-sources-CgnHjm8Q.js +408 -0
- package/system/dist/{constants-D2etJ02O.js → constants-Ba3FTIHl.js} +1 -1
- package/system/dist/constants-C860Y6U4.js +26 -0
- package/system/dist/{constants-BcUTQd1M.mjs → constants-DB4piTD5.mjs} +1 -1
- package/system/dist/constants-DCLpoF4L.mjs +21 -0
- package/system/dist/coral-accelerators-7o8hqvcN.js +564 -0
- package/system/dist/coral-accelerators-BKcXP59c.mjs +521 -0
- package/system/dist/core-blocks.cap-C6iKAZ-x.mjs +17986 -0
- package/system/dist/core-blocks.cap-LEMqVwxO.js +18705 -0
- package/system/dist/{custom-action-registry-N7flBDwT.mjs → custom-action-registry-B9zFBNVa.mjs} +37 -37
- package/system/dist/custom-actions-BFUSalC9.mjs +25 -0
- package/system/dist/custom-actions-D92NRi2c.js +36 -0
- package/system/dist/database-snapshot.cap-DF38e-0P.js +162 -0
- package/system/dist/database-snapshot.cap-dhrc9xnY.mjs +133 -0
- package/system/dist/declared-device-BWphj9WE.js +303 -0
- package/system/dist/declared-device-CKERA1Hi.mjs +286 -0
- package/system/dist/{device-ca-ExMN3xW3.mjs → device-ca-BLM6fccc.mjs} +2 -1
- package/system/dist/{device-ca-CU8zh9Pi.js → device-ca-C5kJE6mL.js} +7 -6
- package/system/dist/device-certificate-Cddm4Idn.mjs +91 -0
- package/system/dist/device-certificate-CguVACQO.js +162 -0
- package/system/dist/device-identifiers-BQg9EQi1.js +600 -0
- package/system/dist/device-identifiers-iSuQCKmK.mjs +529 -0
- package/system/dist/device-kind-BJ2pfsjw.mjs +78 -0
- package/system/dist/device-kind-CsSiv_YF.js +101 -0
- package/system/dist/device-manager.cap-2abwVLCM.js +2874 -0
- package/system/dist/device-manager.cap-CFZSPfUh.mjs +2749 -0
- package/system/dist/device-provider.cap-3Uvk6f5-.mjs +331 -0
- package/system/dist/device-provider.cap-D7TV2kVH.js +366 -0
- package/system/dist/{device-row-store-CeW_GWh9.mjs → device-row-store-YF3jtmkk.mjs} +4 -1
- package/system/dist/{device-row-store-BMIR-n3m.js → device-row-store-doTfMOqn.js} +12 -9
- package/system/dist/device-transitions.cap-B5w5PYU_.js +860 -0
- package/system/dist/device-transitions.cap-DojcwEuX.mjs +819 -0
- package/system/dist/device-type-CbQsnFdC.js +477 -0
- package/system/dist/device-type-DgEvK3ch.mjs +454 -0
- package/system/dist/entry-kind-D9MuVJCK.mjs +44 -0
- package/system/dist/entry-kind-cq90c--V.js +55 -0
- package/system/dist/error.cap-CSM_SRfR.mjs +3423 -0
- package/system/dist/error.cap-DBhgPeWK.js +3848 -0
- package/system/dist/file-host-worker.js +1 -1
- package/system/dist/file-host-worker.mjs +1 -1
- package/system/dist/history-catalog-BKRarIL_.js +831 -0
- package/system/dist/history-catalog-BwTeQ4Mr.mjs +802 -0
- package/system/dist/{hub-identity-Csxx2Q8k.js → hub-identity-BMdR3Mw9.js} +2 -2
- package/system/dist/{hub-identity-CYC1820R.mjs → hub-identity-DjMN9Ac2.mjs} +10 -10
- package/system/dist/{hub-mdns-ciao-By5577HM.js → hub-mdns-ciao--0v1TKME.js} +5 -5
- package/system/dist/{hub-mdns-ciao-CCDxM5qz.mjs → hub-mdns-ciao-DBrtHOcc.mjs} +2 -2
- package/system/dist/index.js +763 -151
- package/system/dist/index.mjs +832 -220
- package/system/dist/integration-instances.cap-Cl9O-k4h.mjs +538 -0
- package/system/dist/integration-instances.cap-dJIxg2_s.js +549 -0
- package/system/dist/keychain-admin.cap-Db_oFX4H.js +425 -0
- package/system/dist/keychain-admin.cap-GtM7gVGG.mjs +396 -0
- package/system/dist/l10n-Bu6aUvSY.mjs +10 -0
- package/system/dist/l10n-CGMvp7NF.js +15 -0
- package/system/dist/labels-DX5S8deC.js +81 -0
- package/system/dist/labels-DsBcU7md.mjs +64 -0
- package/system/dist/{legacy-integration-rows-door-CVwOo5aq.js → legacy-integration-rows-door-B1nzxxr5.js} +2 -2
- package/system/dist/{legacy-integration-rows-door-D9tQOUzh.mjs → legacy-integration-rows-door-nTvo_6jQ.mjs} +1 -1
- package/system/dist/log-destination.cap-CxZzAVaR.mjs +143 -0
- package/system/dist/log-destination.cap-DELPJkZ0.js +148 -0
- package/system/dist/low-power-sleep.cap-7lfVU41N.js +103 -0
- package/system/dist/low-power-sleep.cap-tGPmaZ_V.mjs +92 -0
- package/system/dist/mask-shape-Ci8Co9w0.mjs +57 -0
- package/system/dist/mask-shape-CmPA2fst.js +92 -0
- package/system/dist/metrics-provider.cap-BNmcHDkQ.mjs +405 -0
- package/system/dist/metrics-provider.cap-BcmQUt6l.js +410 -0
- package/system/dist/migration-BMjgkyG2.js +380 -0
- package/system/dist/migration-DRJAtdy7.mjs +321 -0
- package/system/dist/network-access.cap-B5TWLDCC.js +1099 -0
- package/system/dist/network-access.cap-BJnGbE6n.mjs +1004 -0
- package/system/dist/notification-rules.cap-B__YBgnG.js +3422 -0
- package/system/dist/notification-rules.cap-D9ArZlwx.mjs +3357 -0
- package/system/dist/ops-log-CB4pIdqi.mjs +64 -0
- package/system/dist/ops-log-pxt9176Z.js +81 -0
- package/system/dist/pinned-binary-BOhOSNff.js +28 -0
- package/system/dist/pinned-binary-CrIRAi4G.mjs +23 -0
- package/system/dist/platform-probe.cap-1WrMhWHx.js +250 -0
- package/system/dist/platform-probe.cap-BFeqFLtQ.mjs +233 -0
- package/system/dist/prefix-walk-B4b2-9aK.mjs +790 -0
- package/system/dist/prefix-walk-DC0ljmbB.js +843 -0
- package/system/dist/ptz-autotrack.cap-BW7w0zHD.js +229 -0
- package/system/dist/ptz-autotrack.cap-DT2GypXw.mjs +224 -0
- package/system/dist/quantity-D3g5SxsZ.mjs +114 -0
- package/system/dist/quantity-lY1KiTSZ.js +143 -0
- package/system/dist/raw-secret-migration-DxuBFtvi.js +50 -0
- package/system/dist/raw-secret-migration-iv88mLoc.mjs +39 -0
- package/system/dist/record-entries.cap-sMUhTvTU.mjs +75 -0
- package/system/dist/record-entries.cap-ti1C046R.js +80 -0
- package/system/dist/record-kind-DoBfYHCs.js +203 -0
- package/system/dist/record-kind-ub6NXqfh.mjs +162 -0
- package/system/dist/recording-archive.cap-7OrIn9e5.mjs +1299 -0
- package/system/dist/recording-archive.cap-D7bo-QSM.js +1328 -0
- package/system/dist/records.cap-ClcWV64i.js +329 -0
- package/system/dist/records.cap-CwLT2ByG.mjs +294 -0
- package/system/dist/relocate-CdVQAk-w.js +804 -0
- package/system/dist/relocate-CoZZTui1.mjs +661 -0
- package/system/dist/rename-composition-block-7WIICIDq.mjs +33525 -0
- package/system/dist/rename-composition-block-CcWLwVhG.js +34692 -0
- package/system/dist/{restore-archive-BJfyu0sG.mjs → restore-archive-CjAyKpgX.mjs} +96 -94
- package/system/dist/{restore-archive-CIFvqOze.js → restore-archive-CkTkv3Ss.js} +6 -4
- package/system/dist/scoped-settings-CylSSq_8.js +955 -0
- package/system/dist/scoped-settings-DVWUIP7Z.mjs +650 -0
- package/system/dist/server-name-BIhLuHvX.mjs +35 -0
- package/system/dist/server-name-OALNvpqC.js +52 -0
- package/system/dist/settings-store.cap-Ci4F2zul.mjs +569 -0
- package/system/dist/settings-store.cap-wlJhCspr.js +640 -0
- package/system/dist/snapshot.cap-3suPdBHV.js +250 -0
- package/system/dist/snapshot.cap-Bs8Oyaqh.mjs +245 -0
- package/system/dist/source-info-DGB7SdB_.mjs +190 -0
- package/system/dist/source-info-DtWf4k2j.js +225 -0
- package/system/dist/storage-admin.cap-BSv1NjKJ.mjs +883 -0
- package/system/dist/storage-admin.cap-he0OqvVM.js +906 -0
- package/system/dist/storage-location-CBT8GCD6.mjs +163 -0
- package/system/dist/storage-location-CTweDMZf.js +198 -0
- package/system/dist/storage-location-mode-B21UVRRX.mjs +167 -0
- package/system/dist/storage-location-mode-CS4sMzo-.js +232 -0
- package/system/dist/storage-migration.cap-CyyATY_p.js +330 -0
- package/system/dist/storage-migration.cap-D7QqGobp.mjs +313 -0
- package/system/dist/storage-occupancy.cap-2rmnS58Z.js +622 -0
- package/system/dist/storage-occupancy.cap-CqBztTl9.mjs +611 -0
- package/system/dist/storage-provider.cap-Bw0CfxVc.js +213 -0
- package/system/dist/storage-provider.cap-CMeck2w4.mjs +202 -0
- package/system/dist/stream-catalog.cap-Bp7SkgIf.mjs +6560 -0
- package/system/dist/stream-catalog.cap-D3uwePiA.js +6763 -0
- package/system/dist/streaming-shared-B8cXatuU.mjs +431 -0
- package/system/dist/streaming-shared-DQwFZOSi.js +526 -0
- package/system/dist/system-reasons-Be_k1W8g.js +25 -0
- package/system/dist/system-reasons-CYj4qwyS.mjs +20 -0
- package/system/dist/tag-BxLazvVb.js +2138 -0
- package/system/dist/tag-uZBAq6ox.mjs +2073 -0
- package/system/dist/user-management.cap-B9QDu8NE.js +825 -0
- package/system/dist/user-management.cap-DBIi77sB.mjs +766 -0
- package/system/dist/vector-store.cap-DnyfrYDn.js +330 -0
- package/system/dist/vector-store.cap-h2GHWQ1t.mjs +319 -0
- package/system/dist/{wal-maintenance-CTrCPzds.mjs → wal-maintenance-BG01rOn9.mjs} +0 -0
- package/system/dist/{wal-maintenance-dq7T3quB.js → wal-maintenance-DyrebYKF.js} +0 -0
- package/system/dist/zod-secret-DS7mj1bk.js +78 -0
- package/system/dist/zod-secret-zY4nM61M.mjs +73 -0
- package/system/package.json +1 -1
- package/system/dist/composition-sources-BI614LJx.mjs +0 -141
- package/system/dist/composition-sources-v_kkb8A9.js +0 -152
- package/system/dist/coral-accelerators-BSVsBVzt.js +0 -250
- package/system/dist/coral-accelerators-BW3OcrLD.mjs +0 -231
- package/system/dist/dist-BCHMSqzc.mjs +0 -143467
- package/system/dist/dist-BZfvhfS1.js +0 -146970
- package/system/dist/prefix-walk-DAOBSyH1.mjs +0 -88
- package/system/dist/prefix-walk-Dv6MLZlM.js +0 -99
- package/system/dist/rename-composition-block-C9HuBrKS.js +0 -112
- package/system/dist/rename-composition-block-DtaYmYAR.mjs +0 -101
|
@@ -0,0 +1,331 @@
|
|
|
1
|
+
import { c as method } from "./capability-definition-C2rJdVeX.mjs";
|
|
2
|
+
import { t as NOT_A_DEVICE } from "./system-reasons-CYj4qwyS.mjs";
|
|
3
|
+
import { r as DeviceType } from "./device-type-DgEvK3ch.mjs";
|
|
4
|
+
import { n as SourceInfoSchema } from "./source-info-DGB7SdB_.mjs";
|
|
5
|
+
import { z } from "zod";
|
|
6
|
+
//#region ../types/dist/esm/capabilities/device-provider.cap.mjs
|
|
7
|
+
var ProviderStatusSchema = /* @__PURE__ */ z.object({
|
|
8
|
+
connected: /* @__PURE__ */ z.boolean(),
|
|
9
|
+
deviceCount: /* @__PURE__ */ z.number(),
|
|
10
|
+
error: /* @__PURE__ */ z.string().optional(),
|
|
11
|
+
/**
|
|
12
|
+
* `'orchestrator'`: this provider writes NO camera's `motion` runtime slice
|
|
13
|
+
* — the orchestrator is its only writer (D696). Set by `BaseDeviceProvider`,
|
|
14
|
+
* which every provider bundles, so only a provider BUILT from D696-amended
|
|
15
|
+
* code says it. ABSENT means an older provider that may still write it (raw
|
|
16
|
+
* VMD writes, a boot seed), and the orchestrator's provider gate keeps that
|
|
17
|
+
* provider's cameras unwritten (`camera-sensors/motion-slice-provider-gate.ts`)
|
|
18
|
+
* — the provider twin of the runner's `getLocalLoad().motionSliceWriter`.
|
|
19
|
+
*/
|
|
20
|
+
motionSliceWriter: /* @__PURE__ */ z.literal("orchestrator").optional()
|
|
21
|
+
});
|
|
22
|
+
/**
|
|
23
|
+
* HOW a provider can be found on the network. The provider only DECLARES the
|
|
24
|
+
* mode; the `local-network` scan engine runs it once for every provider that
|
|
25
|
+
* asked (one multicast browse, one host sweep) and hands the raw hits back to
|
|
26
|
+
* `classifyDiscoveryHits`. A provider never opens a discovery socket itself,
|
|
27
|
+
* except through a `custom` mode.
|
|
28
|
+
*/
|
|
29
|
+
var DiscoveryModeSchema = /* @__PURE__ */ z.discriminatedUnion("kind", [
|
|
30
|
+
/* @__PURE__ */ z.object({
|
|
31
|
+
kind: /* @__PURE__ */ z.literal("mdns"),
|
|
32
|
+
/** DNS-SD service type, e.g. `_esphomelib._tcp`. */
|
|
33
|
+
serviceType: /* @__PURE__ */ z.string().min(1),
|
|
34
|
+
/** Regular expression an instance name must match (case-insensitive). */
|
|
35
|
+
instancePattern: /* @__PURE__ */ z.string().optional()
|
|
36
|
+
}),
|
|
37
|
+
/* @__PURE__ */ z.object({
|
|
38
|
+
kind: /* @__PURE__ */ z.literal("ws-discovery"),
|
|
39
|
+
/** Probe types (e.g. `dn:NetworkVideoTransmitter`); omitted = any device. */
|
|
40
|
+
types: /* @__PURE__ */ z.array(/* @__PURE__ */ z.string()).optional()
|
|
41
|
+
}),
|
|
42
|
+
/* @__PURE__ */ z.object({
|
|
43
|
+
kind: /* @__PURE__ */ z.literal("ssdp"),
|
|
44
|
+
searchTarget: /* @__PURE__ */ z.string().min(1)
|
|
45
|
+
}),
|
|
46
|
+
/* @__PURE__ */ z.object({
|
|
47
|
+
kind: /* @__PURE__ */ z.literal("udp-broadcast"),
|
|
48
|
+
port: /* @__PURE__ */ z.number().int().min(1).max(65535),
|
|
49
|
+
payloadHex: /* @__PURE__ */ z.string().regex(/^([0-9a-fA-F]{2})*$/),
|
|
50
|
+
/** Port replies arrive on, when the device answers somewhere other than the source port. */
|
|
51
|
+
listenPort: /* @__PURE__ */ z.number().int().min(1).max(65535).optional()
|
|
52
|
+
}),
|
|
53
|
+
/* @__PURE__ */ z.object({
|
|
54
|
+
kind: /* @__PURE__ */ z.literal("http-probe"),
|
|
55
|
+
port: /* @__PURE__ */ z.number().int().min(1).max(65535),
|
|
56
|
+
path: /* @__PURE__ */ z.string().startsWith("/"),
|
|
57
|
+
method: /* @__PURE__ */ z.enum(["GET", "POST"]).default("GET"),
|
|
58
|
+
bodyText: /* @__PURE__ */ z.string().optional(),
|
|
59
|
+
contentType: /* @__PURE__ */ z.string().optional(),
|
|
60
|
+
tls: /* @__PURE__ */ z.boolean().default(false),
|
|
61
|
+
/** Status codes that count as a hit. Omitted = any HTTP answer. */
|
|
62
|
+
acceptStatus: /* @__PURE__ */ z.array(/* @__PURE__ */ z.number().int()).optional()
|
|
63
|
+
}),
|
|
64
|
+
/* @__PURE__ */ z.object({
|
|
65
|
+
kind: /* @__PURE__ */ z.literal("custom"),
|
|
66
|
+
/** Why the engine cannot do it (an allowlisted exception, e.g. a vendor UDP protocol). */
|
|
67
|
+
reason: /* @__PURE__ */ z.string().min(1)
|
|
68
|
+
})
|
|
69
|
+
]);
|
|
70
|
+
/** What the engine saw on the wire for ONE declared mode; the provider classifies it. */
|
|
71
|
+
var DiscoveryHitSchema = /* @__PURE__ */ z.object({
|
|
72
|
+
/** Index into the provider's own `getDiscoveryModes()` array. */
|
|
73
|
+
modeIndex: /* @__PURE__ */ z.number().int().min(0),
|
|
74
|
+
host: /* @__PURE__ */ z.string(),
|
|
75
|
+
port: /* @__PURE__ */ z.number().int(),
|
|
76
|
+
http: /* @__PURE__ */ z.object({
|
|
77
|
+
status: /* @__PURE__ */ z.number().int(),
|
|
78
|
+
headers: /* @__PURE__ */ z.record(/* @__PURE__ */ z.string(), /* @__PURE__ */ z.string()),
|
|
79
|
+
/** At most 16 KiB. */
|
|
80
|
+
bodyText: /* @__PURE__ */ z.string()
|
|
81
|
+
}).optional(),
|
|
82
|
+
mdns: /* @__PURE__ */ z.object({
|
|
83
|
+
instance: /* @__PURE__ */ z.string(),
|
|
84
|
+
host: /* @__PURE__ */ z.string(),
|
|
85
|
+
port: /* @__PURE__ */ z.number().int(),
|
|
86
|
+
txt: /* @__PURE__ */ z.record(/* @__PURE__ */ z.string(), /* @__PURE__ */ z.string())
|
|
87
|
+
}).optional(),
|
|
88
|
+
udp: /* @__PURE__ */ z.object({ payloadHex: /* @__PURE__ */ z.string() }).optional(),
|
|
89
|
+
wsd: /* @__PURE__ */ z.object({
|
|
90
|
+
xaddrs: /* @__PURE__ */ z.array(/* @__PURE__ */ z.string()),
|
|
91
|
+
types: /* @__PURE__ */ z.array(/* @__PURE__ */ z.string()),
|
|
92
|
+
scopes: /* @__PURE__ */ z.array(/* @__PURE__ */ z.string())
|
|
93
|
+
}).optional()
|
|
94
|
+
});
|
|
95
|
+
/**
|
|
96
|
+
* Candidate handed back from discovery and accepted by
|
|
97
|
+
* `adoptDiscoveredDevice`. Shape mirrors the in-process
|
|
98
|
+
* `DiscoveredDevice` interface used by `DeviceDiscovery`.
|
|
99
|
+
*/
|
|
100
|
+
var DiscoveryCandidateSchema = /* @__PURE__ */ z.object({
|
|
101
|
+
stableId: /* @__PURE__ */ z.string(),
|
|
102
|
+
type: /* @__PURE__ */ z.enum(DeviceType),
|
|
103
|
+
suggestedName: /* @__PURE__ */ z.string(),
|
|
104
|
+
prefilledConfig: /* @__PURE__ */ z.record(/* @__PURE__ */ z.string(), /* @__PURE__ */ z.unknown()),
|
|
105
|
+
/**
|
|
106
|
+
* Optional upstream-system identity (HA entity_id, vendor MAC, …).
|
|
107
|
+
* Discovery pre-populates this for systems that know the upstream
|
|
108
|
+
* identity ahead of adoption. Rendering metadata (unit, precision)
|
|
109
|
+
* flows live through the cap STATUS SLICE after adoption.
|
|
110
|
+
*/
|
|
111
|
+
sourceInfo: /* @__PURE__ */ SourceInfoSchema.optional(),
|
|
112
|
+
/**
|
|
113
|
+
* Set when this candidate is a device the provider ALREADY owns.
|
|
114
|
+
*
|
|
115
|
+
* A scan cannot generally produce the identity a device was onboarded under
|
|
116
|
+
* (Reolink keys on `mac-<mac>`, learned at adopt time), so a stableId
|
|
117
|
+
* comparison never matches and an owned device looks addable. Re-adopting one
|
|
118
|
+
* overwrites its config with scan-derived values — that is how a Home Hub's
|
|
119
|
+
* Baichuan port was overwritten with its ONVIF port, taking the hub and its
|
|
120
|
+
* three child cameras offline for four hours.
|
|
121
|
+
*
|
|
122
|
+
* A provider that can recognise its own devices says so here. Absent means
|
|
123
|
+
* "not recognised", which is not the same as "known to be new" — a provider
|
|
124
|
+
* that cannot tell simply never sets it.
|
|
125
|
+
*/
|
|
126
|
+
alreadyOnboarded: /* @__PURE__ */ z.boolean().optional(),
|
|
127
|
+
/** Numeric id of the device this candidate was matched to. Set with `alreadyOnboarded`. */
|
|
128
|
+
onboardedDeviceId: /* @__PURE__ */ z.number().optional(),
|
|
129
|
+
/** Operator-facing name of the matched device, so the UI can say WHICH one it is. */
|
|
130
|
+
onboardedName: /* @__PURE__ */ z.string().optional(),
|
|
131
|
+
/**
|
|
132
|
+
* This candidate is an INTEGRATION to set up (a gateway, a hub, a controller),
|
|
133
|
+
* not a device to adopt. Replaces the `prefilledConfig.setupIntegration` marker,
|
|
134
|
+
* which is still read for one release.
|
|
135
|
+
*/
|
|
136
|
+
setupIntegration: /* @__PURE__ */ z.boolean().optional(),
|
|
137
|
+
/** `stableId` of the gateway candidate this device was found BEHIND. */
|
|
138
|
+
parentStableId: /* @__PURE__ */ z.string().optional(),
|
|
139
|
+
/** `false` = shown for context but not pickable. Default true. */
|
|
140
|
+
selectable: /* @__PURE__ */ z.boolean().optional(),
|
|
141
|
+
/**
|
|
142
|
+
* Keys of the provider's creation form (`getChildCreationSchema`) this candidate
|
|
143
|
+
* cannot be adopted without — a key for an encrypted board, a pairing code. The
|
|
144
|
+
* admin asks for exactly these, on the creation form prefilled with
|
|
145
|
+
* `prefilledConfig`, before it adopts. Absent or empty = adopt as it is.
|
|
146
|
+
*/
|
|
147
|
+
needsParams: /* @__PURE__ */ z.array(/* @__PURE__ */ z.string()).optional()
|
|
148
|
+
});
|
|
149
|
+
/**
|
|
150
|
+
* Flat device summary returned by `createDevice` / `adoptDiscoveredDevice`.
|
|
151
|
+
* Mirrors `toDeviceShape()` output in `device-management.router.ts` so the
|
|
152
|
+
* tRPC layer can pass it through without reshaping.
|
|
153
|
+
*/
|
|
154
|
+
var DeviceSummarySchema = /* @__PURE__ */ z.object({
|
|
155
|
+
id: /* @__PURE__ */ z.number(),
|
|
156
|
+
stableId: /* @__PURE__ */ z.string(),
|
|
157
|
+
addonId: /* @__PURE__ */ z.string(),
|
|
158
|
+
type: /* @__PURE__ */ z.string(),
|
|
159
|
+
name: /* @__PURE__ */ z.string(),
|
|
160
|
+
parentDeviceId: /* @__PURE__ */ z.number().nullable(),
|
|
161
|
+
online: /* @__PURE__ */ z.boolean(),
|
|
162
|
+
features: /* @__PURE__ */ z.array(/* @__PURE__ */ z.string()),
|
|
163
|
+
config: /* @__PURE__ */ z.record(/* @__PURE__ */ z.string(), /* @__PURE__ */ z.unknown()),
|
|
164
|
+
/** Optional upstream-system identity (dispatch key + system tag).
|
|
165
|
+
* See `SourceInfo`. Present when the device has a non-synthetic
|
|
166
|
+
* source identifier (HA entities, vendor MAC, …); omitted when the
|
|
167
|
+
* synthetic backfill is in effect. */
|
|
168
|
+
sourceInfo: /* @__PURE__ */ SourceInfoSchema.optional()
|
|
169
|
+
});
|
|
170
|
+
/**
|
|
171
|
+
* Result of a live field test (e.g. probing an RTSP URL during device
|
|
172
|
+
* creation). Matches the UI-side `FieldProbeResult` in
|
|
173
|
+
* `interfaces/config-ui.ts` — the admin `FormBuilder` renders the
|
|
174
|
+
* returned `labels` as chips next to the input.
|
|
175
|
+
*/
|
|
176
|
+
var FieldProbeResultSchema = /* @__PURE__ */ z.object({
|
|
177
|
+
status: /* @__PURE__ */ z.enum(["ok", "error"]),
|
|
178
|
+
labels: /* @__PURE__ */ z.array(/* @__PURE__ */ z.string()).optional(),
|
|
179
|
+
error: /* @__PURE__ */ z.string().optional()
|
|
180
|
+
});
|
|
181
|
+
/**
|
|
182
|
+
* The output of `getChildCreationSchema` is a UI schema tree. We store
|
|
183
|
+
* it as `unknown` at the capability layer — the router just passes it
|
|
184
|
+
* through and the admin UI renders it via `FormBuilder`. The actual
|
|
185
|
+
* type is `ConfigUISchema` (see `packages/types/src/interfaces/config-ui.ts`),
|
|
186
|
+
* but we deliberately avoid a Zod mirror because the union is large and
|
|
187
|
+
* not meant for runtime validation at this seam.
|
|
188
|
+
*/
|
|
189
|
+
var CreationSchemaOutputSchema = /* @__PURE__ */ z.unknown();
|
|
190
|
+
var deviceProviderCapability = {
|
|
191
|
+
name: "device-provider",
|
|
192
|
+
scope: "system",
|
|
193
|
+
mode: "collection",
|
|
194
|
+
methods: {
|
|
195
|
+
start: /* @__PURE__ */ method(/* @__PURE__ */ z.void(), /* @__PURE__ */ z.void(), { kind: "mutation" }),
|
|
196
|
+
stop: /* @__PURE__ */ method(/* @__PURE__ */ z.void(), /* @__PURE__ */ z.void(), { kind: "mutation" }),
|
|
197
|
+
getStatus: /* @__PURE__ */ method(/* @__PURE__ */ z.void(), ProviderStatusSchema),
|
|
198
|
+
getDevices: /* @__PURE__ */ method(/* @__PURE__ */ z.void(), /* @__PURE__ */ z.array(/* @__PURE__ */ z.object({
|
|
199
|
+
id: /* @__PURE__ */ z.string(),
|
|
200
|
+
name: /* @__PURE__ */ z.string(),
|
|
201
|
+
type: /* @__PURE__ */ z.string()
|
|
202
|
+
}))),
|
|
203
|
+
/**
|
|
204
|
+
* Tear down and reconstruct ONE device in place from its persisted rows —
|
|
205
|
+
* touching no other device this provider owns.
|
|
206
|
+
*
|
|
207
|
+
* The primitive `deviceManager.migrateDevice` uses to flush the two
|
|
208
|
+
* migrated numbers: after `swapIds` the runner's live instance still
|
|
209
|
+
* carries the PRE-swap numeric id (baked into the object, its native-cap
|
|
210
|
+
* registrations and its log tags), and a live object cannot be renumbered.
|
|
211
|
+
* Before this method the only flush was restarting the whole owning addon
|
|
212
|
+
* — which took every camera the provider owns down with it (28 devices
|
|
213
|
+
* for one migrated camera, measured 2026-09-04, and the morning of the
|
|
214
|
+
* same day ~27 devices' native caps did not come back on their own).
|
|
215
|
+
*
|
|
216
|
+
* Keyed by `stableId`, deliberately: the numeric id is exactly the thing
|
|
217
|
+
* that changes. The reply carries the id the device answers on NOW.
|
|
218
|
+
* Implemented once in `BaseDeviceProvider` — decommission the live
|
|
219
|
+
* instance (if any), then re-create from the persisted row: the same
|
|
220
|
+
* teardown/rehydrate pair every graceful shutdown + boot already uses.
|
|
221
|
+
* An RPC, never an event: a dropped event would leave the runner writing
|
|
222
|
+
* against the wrong camera (D8).
|
|
223
|
+
*
|
|
224
|
+
* Construction can dial hardware, and the migrated source is
|
|
225
|
+
* characteristically dead — the timeout covers a full activate window
|
|
226
|
+
* rather than the 60 s default.
|
|
227
|
+
*/
|
|
228
|
+
reloadDevice: /* @__PURE__ */ method(/* @__PURE__ */ z.object({ stableId: /* @__PURE__ */ z.string() }), /* @__PURE__ */ z.object({ deviceId: /* @__PURE__ */ z.number() }), {
|
|
229
|
+
kind: "mutation",
|
|
230
|
+
timeoutMs: 3 * 6e4
|
|
231
|
+
}),
|
|
232
|
+
supportsDiscovery: /* @__PURE__ */ method(/* @__PURE__ */ z.object({}), /* @__PURE__ */ z.boolean()),
|
|
233
|
+
/**
|
|
234
|
+
* Run a network scan. `params` carries optional provider-specific scan
|
|
235
|
+
* inputs (e.g. a broadcast address / subnet for cross-subnet discovery),
|
|
236
|
+
* shaped by `getDiscoveryParamsSchema`. Omitted for the generic scan
|
|
237
|
+
* (provider uses its local-network default).
|
|
238
|
+
*/
|
|
239
|
+
discoverDevices: /* @__PURE__ */ method(/* @__PURE__ */ z.object({ params: /* @__PURE__ */ z.record(/* @__PURE__ */ z.string(), /* @__PURE__ */ z.unknown()).optional() }), /* @__PURE__ */ z.array(DiscoveryCandidateSchema), {
|
|
240
|
+
kind: "mutation",
|
|
241
|
+
auth: "admin"
|
|
242
|
+
}),
|
|
243
|
+
/**
|
|
244
|
+
* How this provider is found on the network. `[]` = the provider has no
|
|
245
|
+
* declarative mode and keeps answering `discoverDevices` itself.
|
|
246
|
+
*/
|
|
247
|
+
getDiscoveryModes: /* @__PURE__ */ method(/* @__PURE__ */ z.object({}), /* @__PURE__ */ z.array(DiscoveryModeSchema)),
|
|
248
|
+
/**
|
|
249
|
+
* Turn the engine's raw hits into candidates. The provider may make
|
|
250
|
+
* follow-up UNICAST requests to a hit host (an authenticated call, an
|
|
251
|
+
* identity check) and never sweeps a subnet. `params` is the per-scan form
|
|
252
|
+
* from `getDiscoveryParamsSchema`.
|
|
253
|
+
*/
|
|
254
|
+
classifyDiscoveryHits: /* @__PURE__ */ method(/* @__PURE__ */ z.object({
|
|
255
|
+
hits: /* @__PURE__ */ z.array(DiscoveryHitSchema),
|
|
256
|
+
params: /* @__PURE__ */ z.record(/* @__PURE__ */ z.string(), /* @__PURE__ */ z.unknown()).optional()
|
|
257
|
+
}), /* @__PURE__ */ z.array(DiscoveryCandidateSchema), {
|
|
258
|
+
kind: "mutation",
|
|
259
|
+
auth: "admin"
|
|
260
|
+
}),
|
|
261
|
+
/**
|
|
262
|
+
* Optional form schema (`ConfigUISchema`) for the EXTRA per-scan inputs a
|
|
263
|
+
* provider accepts (e.g. Gree's broadcast address for a different subnet).
|
|
264
|
+
* `null` when the provider takes no extra scan params — the generic
|
|
265
|
+
* aggregated scan never renders this; the per-integration scan does.
|
|
266
|
+
*/
|
|
267
|
+
getDiscoveryParamsSchema: /* @__PURE__ */ method(/* @__PURE__ */ z.object({}), CreationSchemaOutputSchema),
|
|
268
|
+
/**
|
|
269
|
+
* The DeviceType this provider creates via manual add (Camera for
|
|
270
|
+
* Reolink/ONVIF, Container for Gree, Hub for Ecowitt). `null` when the
|
|
271
|
+
* provider does not support manual creation. Lets the Add-Device dialog
|
|
272
|
+
* pick the right type instead of assuming Camera.
|
|
273
|
+
*/
|
|
274
|
+
getManualCreationType: /* @__PURE__ */ method(/* @__PURE__ */ z.object({
|
|
275
|
+
/** The integration asked about; a provider whose integrations differ answers per one. */
|
|
276
|
+
integrationId: /* @__PURE__ */ z.string().optional() }), /* @__PURE__ */ z.object({ deviceType: /* @__PURE__ */ z.enum(DeviceType).nullable() })),
|
|
277
|
+
adoptDiscoveredDevice: /* @__PURE__ */ method(/* @__PURE__ */ z.object({
|
|
278
|
+
candidate: DiscoveryCandidateSchema,
|
|
279
|
+
/** The integration the operator adopts into; a provider with several instances needs it. */
|
|
280
|
+
integrationId: /* @__PURE__ */ z.string().optional()
|
|
281
|
+
}), DeviceSummarySchema, {
|
|
282
|
+
kind: "mutation",
|
|
283
|
+
auth: "admin"
|
|
284
|
+
}),
|
|
285
|
+
supportsManualCreation: /* @__PURE__ */ method(/* @__PURE__ */ z.object({}), /* @__PURE__ */ z.boolean()),
|
|
286
|
+
/**
|
|
287
|
+
* Fetch the creation form schema for a given DeviceType. Returns
|
|
288
|
+
* `null` when the provider does not support manually creating
|
|
289
|
+
* devices of that type. The output is a `ConfigUISchema` — the
|
|
290
|
+
* router type-asserts it at the boundary.
|
|
291
|
+
*/
|
|
292
|
+
getChildCreationSchema: /* @__PURE__ */ method(/* @__PURE__ */ z.object({
|
|
293
|
+
type: /* @__PURE__ */ z.enum(DeviceType),
|
|
294
|
+
/** The integration asked about; a provider whose integrations differ answers per one. */
|
|
295
|
+
integrationId: /* @__PURE__ */ z.string().optional()
|
|
296
|
+
}), CreationSchemaOutputSchema),
|
|
297
|
+
createDevice: /* @__PURE__ */ method(/* @__PURE__ */ z.object({
|
|
298
|
+
type: /* @__PURE__ */ z.enum(DeviceType),
|
|
299
|
+
config: /* @__PURE__ */ z.record(/* @__PURE__ */ z.string(), /* @__PURE__ */ z.unknown()),
|
|
300
|
+
/** The integration the operator adds the device to; a provider with several instances needs it. */
|
|
301
|
+
integrationId: /* @__PURE__ */ z.string().optional()
|
|
302
|
+
}), DeviceSummarySchema, {
|
|
303
|
+
kind: "mutation",
|
|
304
|
+
auth: "admin"
|
|
305
|
+
}),
|
|
306
|
+
/**
|
|
307
|
+
* Test a single field in the creation form before the device has
|
|
308
|
+
* been persisted. Typical use: probing an RTSP URL entered by the
|
|
309
|
+
* user. Providers that don't support field probing return
|
|
310
|
+
* `{ success: true, message: 'Field test not supported' }`.
|
|
311
|
+
*
|
|
312
|
+
* `formValues` is the live snapshot of every field in the form at
|
|
313
|
+
* the moment the user clicked Test — useful for probes that depend
|
|
314
|
+
* on multiple fields together (e.g. Reolink autodetect needs host
|
|
315
|
+
* + credentials + UID + transport mode in a single call). Optional
|
|
316
|
+
* for backwards compatibility; providers free to ignore it.
|
|
317
|
+
*/
|
|
318
|
+
testCreationField: /* @__PURE__ */ method(/* @__PURE__ */ z.object({
|
|
319
|
+
type: /* @__PURE__ */ z.enum(DeviceType),
|
|
320
|
+
key: /* @__PURE__ */ z.string(),
|
|
321
|
+
value: /* @__PURE__ */ z.unknown(),
|
|
322
|
+
formValues: /* @__PURE__ */ z.record(/* @__PURE__ */ z.string(), /* @__PURE__ */ z.unknown()).optional()
|
|
323
|
+
}), FieldProbeResultSchema, {
|
|
324
|
+
kind: "mutation",
|
|
325
|
+
auth: "admin"
|
|
326
|
+
})
|
|
327
|
+
},
|
|
328
|
+
vocabulary: { notOperatorFacing: NOT_A_DEVICE.INTERNAL }
|
|
329
|
+
};
|
|
330
|
+
//#endregion
|
|
331
|
+
export { FieldProbeResultSchema as a, DiscoveryModeSchema as i, DiscoveryCandidateSchema as n, deviceProviderCapability as o, DiscoveryHitSchema as r, DeviceSummarySchema as t };
|