@camstack/server 1.2.928 → 1.2.930

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.
Files changed (241) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/package.json +10 -10
  3. package/system/dist/addon-id-CVg1_r5E.mjs +39 -0
  4. package/system/dist/addon-id-Di0lNJ89.js +50 -0
  5. package/system/dist/addon-pages.cap-Df9FQwN1.js +49 -0
  6. package/system/dist/addon-pages.cap-DksUlE8j.mjs +44 -0
  7. package/system/dist/addon-settings.cap-3-TIIMq_.mjs +592 -0
  8. package/system/dist/addon-settings.cap-DAiE0Nb0.js +651 -0
  9. package/system/dist/addon-utils.mjs +1 -1
  10. package/system/dist/addon-widgets.cap-C4jxflbF.js +200 -0
  11. package/system/dist/addon-widgets.cap-D9m48X78.mjs +183 -0
  12. package/system/dist/base-addon-DD5dIfcZ.js +4624 -0
  13. package/system/dist/base-addon-Md14i7pe.mjs +4505 -0
  14. package/system/dist/base-device-2sL1DMm1.js +1103 -0
  15. package/system/dist/base-device-IuM1AwXZ.mjs +1098 -0
  16. package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +8 -6
  17. package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +6 -4
  18. package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +8 -6
  19. package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +7 -5
  20. package/system/dist/builtins/alerts/alerts.addon.js +113 -56
  21. package/system/dist/builtins/alerts/alerts.addon.mjs +60 -3
  22. package/system/dist/builtins/autotrack/index.js +21 -17
  23. package/system/dist/builtins/autotrack/index.mjs +5 -1
  24. package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +14 -11
  25. package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +8 -5
  26. package/system/dist/builtins/calendars/calendars.addon.js +8 -6
  27. package/system/dist/builtins/calendars/calendars.addon.mjs +3 -1
  28. package/system/dist/builtins/camera-grid/index.js +615 -58
  29. package/system/dist/builtins/camera-grid/index.mjs +558 -1
  30. package/system/dist/builtins/composer/composer.addon.js +788 -209
  31. package/system/dist/builtins/composer/composer.addon.mjs +583 -4
  32. package/system/dist/builtins/console-logging/index.js +4 -3
  33. package/system/dist/builtins/console-logging/index.mjs +2 -1
  34. package/system/dist/builtins/core-blocks/actions-service.d.ts +18 -1
  35. package/system/dist/builtins/core-blocks/core-blocks.addon.js +8670 -386
  36. package/system/dist/builtins/core-blocks/core-blocks.addon.mjs +8294 -11
  37. package/system/dist/builtins/core-blocks/tcp-connect.d.ts +3 -0
  38. package/system/dist/builtins/core-notifier/core-notifier.addon.js +250 -21
  39. package/system/dist/builtins/core-notifier/core-notifier.addon.mjs +230 -1
  40. package/system/dist/builtins/device-history/device-history.addon.js +110 -31
  41. package/system/dist/builtins/device-history/device-history.addon.mjs +81 -2
  42. package/system/dist/builtins/device-manager/device-manager.addon.js +12806 -227
  43. package/system/dist/builtins/device-manager/device-manager.addon.mjs +12583 -5
  44. package/system/dist/builtins/hub-forwarder/index.js +4 -3
  45. package/system/dist/builtins/hub-forwarder/index.mjs +2 -1
  46. package/system/dist/builtins/keychain/index.js +31 -28
  47. package/system/dist/builtins/keychain/index.mjs +7 -4
  48. package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.js +15 -12
  49. package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +4 -1
  50. package/system/dist/builtins/local-auth/local-auth.addon.js +140 -39
  51. package/system/dist/builtins/local-auth/local-auth.addon.mjs +106 -6
  52. package/system/dist/builtins/local-network/local-network.addon.js +43 -39
  53. package/system/dist/builtins/local-network/local-network.addon.mjs +7 -3
  54. package/system/dist/builtins/loki-logging/index.js +23 -17
  55. package/system/dist/builtins/loki-logging/index.mjs +7 -1
  56. package/system/dist/builtins/native-metrics/native-metrics.addon.js +156 -15
  57. package/system/dist/builtins/native-metrics/native-metrics.addon.mjs +151 -10
  58. package/system/dist/builtins/platform-probe/index.js +25 -23
  59. package/system/dist/builtins/platform-probe/index.mjs +12 -10
  60. package/system/dist/builtins/record-entries/index.js +9 -7
  61. package/system/dist/builtins/record-entries/index.mjs +3 -1
  62. package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +4 -4
  63. package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
  64. package/system/dist/builtins/snapshot/index.js +97 -44
  65. package/system/dist/builtins/snapshot/index.mjs +54 -1
  66. package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.js +5 -4
  67. package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +21 -20
  68. package/system/dist/builtins/sqlite-storage/index.js +1 -1
  69. package/system/dist/builtins/sqlite-storage/index.mjs +1 -1
  70. package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.js +87 -61
  71. package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +29 -3
  72. package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +81 -72
  73. package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +10 -1
  74. package/system/dist/builtins/system-config/system-config.addon.js +17 -14
  75. package/system/dist/builtins/system-config/system-config.addon.mjs +118 -115
  76. package/system/dist/builtins/winston-logging/index.js +7 -5
  77. package/system/dist/builtins/winston-logging/index.mjs +3 -1
  78. package/system/dist/calendars.cap-CaFlShS9.js +155 -0
  79. package/system/dist/calendars.cap-_C4eD4fi.mjs +138 -0
  80. package/system/dist/camstack-error-DJ-TUAi1.js +23 -0
  81. package/system/dist/camstack-error-viZYfcj9.mjs +18 -0
  82. package/system/dist/cap-call-context-Bd76CbOW.js +95 -0
  83. package/system/dist/cap-call-context-DNwdgGSQ.mjs +78 -0
  84. package/system/dist/capability-definition-C2rJdVeX.mjs +177 -0
  85. package/system/dist/capability-definition-HCmTem8c.js +242 -0
  86. package/system/dist/{capture-engine-BcuwOSXv.js → capture-engine-DZ0LIUqA.js} +5 -4
  87. package/system/dist/{capture-engine-Bz7eXFjT.mjs → capture-engine-DiwbjoWp.mjs} +2 -1
  88. package/system/dist/command-origin-claim-Cief660O.js +35 -0
  89. package/system/dist/command-origin-claim-D1Wy7Qld.mjs +24 -0
  90. package/system/dist/composition-sources-BEUWn2s_.mjs +391 -0
  91. package/system/dist/composition-sources-acfR4hDq.js +408 -0
  92. package/system/dist/{constants-D2etJ02O.js → constants-Ba3FTIHl.js} +1 -1
  93. package/system/dist/constants-C860Y6U4.js +26 -0
  94. package/system/dist/{constants-BcUTQd1M.mjs → constants-DB4piTD5.mjs} +1 -1
  95. package/system/dist/constants-DCLpoF4L.mjs +21 -0
  96. package/system/dist/coral-accelerators-7o8hqvcN.js +564 -0
  97. package/system/dist/coral-accelerators-BKcXP59c.mjs +521 -0
  98. package/system/dist/core-blocks.cap-BMeMCBrx.js +18733 -0
  99. package/system/dist/core-blocks.cap-BRPsLAij.mjs +18008 -0
  100. package/system/dist/{custom-action-registry-N7flBDwT.mjs → custom-action-registry-B9zFBNVa.mjs} +37 -37
  101. package/system/dist/custom-actions-BFUSalC9.mjs +25 -0
  102. package/system/dist/custom-actions-D92NRi2c.js +36 -0
  103. package/system/dist/database-snapshot.cap-DF38e-0P.js +162 -0
  104. package/system/dist/database-snapshot.cap-dhrc9xnY.mjs +133 -0
  105. package/system/dist/declared-device-BWphj9WE.js +303 -0
  106. package/system/dist/declared-device-CKERA1Hi.mjs +286 -0
  107. package/system/dist/{device-ca-ExMN3xW3.mjs → device-ca-BLM6fccc.mjs} +2 -1
  108. package/system/dist/{device-ca-CU8zh9Pi.js → device-ca-C5kJE6mL.js} +7 -6
  109. package/system/dist/device-certificate-Cddm4Idn.mjs +91 -0
  110. package/system/dist/device-certificate-CguVACQO.js +162 -0
  111. package/system/dist/device-identifiers-BQg9EQi1.js +600 -0
  112. package/system/dist/device-identifiers-iSuQCKmK.mjs +529 -0
  113. package/system/dist/device-kind-BJ2pfsjw.mjs +78 -0
  114. package/system/dist/device-kind-CsSiv_YF.js +101 -0
  115. package/system/dist/device-manager.cap-2abwVLCM.js +2874 -0
  116. package/system/dist/device-manager.cap-CFZSPfUh.mjs +2749 -0
  117. package/system/dist/device-provider.cap-3Uvk6f5-.mjs +331 -0
  118. package/system/dist/device-provider.cap-D7TV2kVH.js +366 -0
  119. package/system/dist/{device-row-store-CeW_GWh9.mjs → device-row-store-YF3jtmkk.mjs} +4 -1
  120. package/system/dist/{device-row-store-BMIR-n3m.js → device-row-store-doTfMOqn.js} +12 -9
  121. package/system/dist/device-transitions.cap-B5w5PYU_.js +860 -0
  122. package/system/dist/device-transitions.cap-DojcwEuX.mjs +819 -0
  123. package/system/dist/device-type-CbQsnFdC.js +477 -0
  124. package/system/dist/device-type-DgEvK3ch.mjs +454 -0
  125. package/system/dist/entry-kind-D9MuVJCK.mjs +44 -0
  126. package/system/dist/entry-kind-cq90c--V.js +55 -0
  127. package/system/dist/error.cap-CSM_SRfR.mjs +3423 -0
  128. package/system/dist/error.cap-DBhgPeWK.js +3848 -0
  129. package/system/dist/file-host-worker.js +1 -1
  130. package/system/dist/file-host-worker.mjs +1 -1
  131. package/system/dist/history-catalog-BKRarIL_.js +831 -0
  132. package/system/dist/history-catalog-BwTeQ4Mr.mjs +802 -0
  133. package/system/dist/{hub-identity-Csxx2Q8k.js → hub-identity-BMdR3Mw9.js} +2 -2
  134. package/system/dist/{hub-identity-CYC1820R.mjs → hub-identity-DjMN9Ac2.mjs} +10 -10
  135. package/system/dist/{hub-mdns-ciao-By5577HM.js → hub-mdns-ciao--0v1TKME.js} +5 -5
  136. package/system/dist/{hub-mdns-ciao-CCDxM5qz.mjs → hub-mdns-ciao-DBrtHOcc.mjs} +2 -2
  137. package/system/dist/index.js +763 -151
  138. package/system/dist/index.mjs +832 -220
  139. package/system/dist/integration-instances.cap-Cl9O-k4h.mjs +538 -0
  140. package/system/dist/integration-instances.cap-dJIxg2_s.js +549 -0
  141. package/system/dist/keychain-admin.cap-Db_oFX4H.js +425 -0
  142. package/system/dist/keychain-admin.cap-GtM7gVGG.mjs +396 -0
  143. package/system/dist/l10n-Bu6aUvSY.mjs +10 -0
  144. package/system/dist/l10n-CGMvp7NF.js +15 -0
  145. package/system/dist/labels-DX5S8deC.js +81 -0
  146. package/system/dist/labels-DsBcU7md.mjs +64 -0
  147. package/system/dist/{legacy-integration-rows-door-CVwOo5aq.js → legacy-integration-rows-door-B1nzxxr5.js} +2 -2
  148. package/system/dist/{legacy-integration-rows-door-D9tQOUzh.mjs → legacy-integration-rows-door-nTvo_6jQ.mjs} +1 -1
  149. package/system/dist/log-destination.cap-CxZzAVaR.mjs +143 -0
  150. package/system/dist/log-destination.cap-DELPJkZ0.js +148 -0
  151. package/system/dist/low-power-sleep.cap-7lfVU41N.js +103 -0
  152. package/system/dist/low-power-sleep.cap-tGPmaZ_V.mjs +92 -0
  153. package/system/dist/mask-shape-Ci8Co9w0.mjs +57 -0
  154. package/system/dist/mask-shape-CmPA2fst.js +92 -0
  155. package/system/dist/metrics-provider.cap-BNmcHDkQ.mjs +405 -0
  156. package/system/dist/metrics-provider.cap-BcmQUt6l.js +410 -0
  157. package/system/dist/migration-BMjgkyG2.js +380 -0
  158. package/system/dist/migration-DRJAtdy7.mjs +321 -0
  159. package/system/dist/network-access.cap-B5TWLDCC.js +1099 -0
  160. package/system/dist/network-access.cap-BJnGbE6n.mjs +1004 -0
  161. package/system/dist/notification-rules.cap-BDh0LDhV.js +3428 -0
  162. package/system/dist/notification-rules.cap-DUmiMBQB.mjs +3357 -0
  163. package/system/dist/notification-targets-CRH-9Dy5.js +509 -0
  164. package/system/dist/notification-targets-DaNE-pIt.mjs +486 -0
  165. package/system/dist/ops-log-CB4pIdqi.mjs +64 -0
  166. package/system/dist/ops-log-pxt9176Z.js +81 -0
  167. package/system/dist/pinned-binary-BOhOSNff.js +28 -0
  168. package/system/dist/pinned-binary-CrIRAi4G.mjs +23 -0
  169. package/system/dist/platform-probe.cap-1WrMhWHx.js +250 -0
  170. package/system/dist/platform-probe.cap-BFeqFLtQ.mjs +233 -0
  171. package/system/dist/prefix-walk-BkMxoXpL.js +843 -0
  172. package/system/dist/prefix-walk-ifwg_ukx.mjs +790 -0
  173. package/system/dist/ptz-autotrack.cap-BW7w0zHD.js +229 -0
  174. package/system/dist/ptz-autotrack.cap-DT2GypXw.mjs +224 -0
  175. package/system/dist/quantity-D3g5SxsZ.mjs +114 -0
  176. package/system/dist/quantity-lY1KiTSZ.js +143 -0
  177. package/system/dist/raw-secret-migration-DxuBFtvi.js +50 -0
  178. package/system/dist/raw-secret-migration-iv88mLoc.mjs +39 -0
  179. package/system/dist/record-entries.cap-sMUhTvTU.mjs +75 -0
  180. package/system/dist/record-entries.cap-ti1C046R.js +80 -0
  181. package/system/dist/record-kind-DoBfYHCs.js +203 -0
  182. package/system/dist/record-kind-ub6NXqfh.mjs +162 -0
  183. package/system/dist/recording-archive.cap-7OrIn9e5.mjs +1299 -0
  184. package/system/dist/recording-archive.cap-D7bo-QSM.js +1328 -0
  185. package/system/dist/records.cap-ClcWV64i.js +329 -0
  186. package/system/dist/records.cap-CwLT2ByG.mjs +294 -0
  187. package/system/dist/relocate-CdVQAk-w.js +804 -0
  188. package/system/dist/relocate-CoZZTui1.mjs +661 -0
  189. package/system/dist/rename-composition-block-BJsL58Ih.js +34798 -0
  190. package/system/dist/rename-composition-block-OAtErZgq.mjs +33631 -0
  191. package/system/dist/{restore-archive-BJfyu0sG.mjs → restore-archive-CjAyKpgX.mjs} +96 -94
  192. package/system/dist/{restore-archive-CIFvqOze.js → restore-archive-CkTkv3Ss.js} +6 -4
  193. package/system/dist/scoped-settings-CylSSq_8.js +955 -0
  194. package/system/dist/scoped-settings-DVWUIP7Z.mjs +650 -0
  195. package/system/dist/server-name-BIhLuHvX.mjs +35 -0
  196. package/system/dist/server-name-OALNvpqC.js +52 -0
  197. package/system/dist/settings-store.cap-Ci4F2zul.mjs +569 -0
  198. package/system/dist/settings-store.cap-wlJhCspr.js +640 -0
  199. package/system/dist/snapshot.cap-3suPdBHV.js +250 -0
  200. package/system/dist/snapshot.cap-Bs8Oyaqh.mjs +245 -0
  201. package/system/dist/source-info-DGB7SdB_.mjs +190 -0
  202. package/system/dist/source-info-DtWf4k2j.js +225 -0
  203. package/system/dist/storage-admin.cap-BSv1NjKJ.mjs +883 -0
  204. package/system/dist/storage-admin.cap-he0OqvVM.js +906 -0
  205. package/system/dist/storage-location-CBT8GCD6.mjs +163 -0
  206. package/system/dist/storage-location-CTweDMZf.js +198 -0
  207. package/system/dist/storage-location-mode-B21UVRRX.mjs +167 -0
  208. package/system/dist/storage-location-mode-CS4sMzo-.js +232 -0
  209. package/system/dist/storage-migration.cap-CyyATY_p.js +330 -0
  210. package/system/dist/storage-migration.cap-D7QqGobp.mjs +313 -0
  211. package/system/dist/storage-occupancy.cap-2rmnS58Z.js +622 -0
  212. package/system/dist/storage-occupancy.cap-CqBztTl9.mjs +611 -0
  213. package/system/dist/storage-provider.cap-Bw0CfxVc.js +213 -0
  214. package/system/dist/storage-provider.cap-CMeck2w4.mjs +202 -0
  215. package/system/dist/stream-catalog.cap-Bp7SkgIf.mjs +6560 -0
  216. package/system/dist/stream-catalog.cap-D3uwePiA.js +6763 -0
  217. package/system/dist/streaming-shared-B8cXatuU.mjs +431 -0
  218. package/system/dist/streaming-shared-DQwFZOSi.js +526 -0
  219. package/system/dist/system-reasons-Be_k1W8g.js +25 -0
  220. package/system/dist/system-reasons-CYj4qwyS.mjs +20 -0
  221. package/system/dist/tag-BxLazvVb.js +2138 -0
  222. package/system/dist/tag-uZBAq6ox.mjs +2073 -0
  223. package/system/dist/user-management.cap-B9QDu8NE.js +825 -0
  224. package/system/dist/user-management.cap-DBIi77sB.mjs +766 -0
  225. package/system/dist/vector-store.cap-DnyfrYDn.js +330 -0
  226. package/system/dist/vector-store.cap-h2GHWQ1t.mjs +319 -0
  227. package/system/dist/{wal-maintenance-CTrCPzds.mjs → wal-maintenance-BG01rOn9.mjs} +0 -0
  228. package/system/dist/{wal-maintenance-dq7T3quB.js → wal-maintenance-DyrebYKF.js} +0 -0
  229. package/system/dist/zod-secret-DS7mj1bk.js +78 -0
  230. package/system/dist/zod-secret-zY4nM61M.mjs +73 -0
  231. package/system/package.json +1 -1
  232. package/system/dist/composition-sources-BI614LJx.mjs +0 -141
  233. package/system/dist/composition-sources-v_kkb8A9.js +0 -152
  234. package/system/dist/coral-accelerators-BSVsBVzt.js +0 -250
  235. package/system/dist/coral-accelerators-BW3OcrLD.mjs +0 -231
  236. package/system/dist/dist-BCHMSqzc.mjs +0 -143467
  237. package/system/dist/dist-BZfvhfS1.js +0 -146970
  238. package/system/dist/prefix-walk-DAOBSyH1.mjs +0 -88
  239. package/system/dist/prefix-walk-Dv6MLZlM.js +0 -99
  240. package/system/dist/rename-composition-block-C9HuBrKS.js +0 -112
  241. package/system/dist/rename-composition-block-DtaYmYAR.mjs +0 -101
@@ -0,0 +1,955 @@
1
+ //#region ../types/dist/esm/utils/err-msg.mjs
2
+ /**
3
+ import { errMsg } from '@camstack/types'
4
+ * Extract a human-readable message from an unknown error value.
5
+ * Replaces the ubiquitous `errMsg(err)` pattern.
6
+ */
7
+ function errMsg(err) {
8
+ if (err instanceof Error) return err.message;
9
+ if (typeof err === "string") return err;
10
+ return String(err);
11
+ }
12
+ //#endregion
13
+ //#region ../types/dist/esm/interfaces/config-ui-secrets.mjs
14
+ /**
15
+ * The value a redacted secret is replaced with on every read surface.
16
+ *
17
+ * It is also the WRITE-BACK token: a save that sends this value
18
+ * back for a key means "keep what is stored", which is what lets an operator
19
+ * rename a location without retyping its password. A literal an operator could
20
+ * plausibly choose as a real password would turn that convenience into a way
21
+ * to lock yourself out, hence the sentinel shape.
22
+ */
23
+ var REDACTED_SECRET = "__camstack_redacted__";
24
+ /** Is this field's stored value a credential? */
25
+ function isSecretConfigField(field) {
26
+ if (field.type === "password") return true;
27
+ return "secret" in field && field.secret === true;
28
+ }
29
+ /**
30
+ * Is this field's value stored in the KEYCHAIN (D787)? Every secret field is,
31
+ * by its TYPE, unless it opts out with `storage: 'inline'` — never by its name.
32
+ */
33
+ function isKeychainStoredField(field) {
34
+ if (!isSecretConfigField(field)) return false;
35
+ if (field.type === "textarea" && field.isJson === true) return false;
36
+ return !("storage" in field && field.storage === "inline");
37
+ }
38
+ /**
39
+ * Every config key in `schema` whose value is a secret, including keys nested
40
+ * inside `group` / `sub-tabs` containers.
41
+ */
42
+ function collectSecretConfigKeys(schema) {
43
+ const keys = /* @__PURE__ */ new Set();
44
+ for (const section of sectionsOf(schema)) for (const field of fieldsOf(section)) walkField(field, keys);
45
+ return keys;
46
+ }
47
+ function isRecord$2(value) {
48
+ return typeof value === "object" && value !== null && !Array.isArray(value);
49
+ }
50
+ function sectionsOf(schema) {
51
+ if (!isRecord$2(schema)) return [];
52
+ const sections = schema["sections"];
53
+ return Array.isArray(sections) ? sections : [];
54
+ }
55
+ function fieldsOf(node) {
56
+ if (!isRecord$2(node)) return [];
57
+ const fields = node["fields"];
58
+ return Array.isArray(fields) ? fields : [];
59
+ }
60
+ function walkField(field, out) {
61
+ if (!isRecord$2(field)) return;
62
+ const type = field["type"];
63
+ const key = field["key"];
64
+ if ((type === "password" || field["secret"] === true) && typeof key === "string" && key.length > 0) out.add(key);
65
+ if (type === "group") {
66
+ for (const child of fieldsOf(field)) walkField(child, out);
67
+ return;
68
+ }
69
+ if (type === "sub-tabs") {
70
+ const tabs = field["tabs"];
71
+ if (!Array.isArray(tabs)) return;
72
+ for (const tab of tabs) for (const child of fieldsOf(tab)) walkField(child, out);
73
+ }
74
+ }
75
+ //#endregion
76
+ //#region ../types/dist/esm/keychain/secret-marker.mjs
77
+ /**
78
+ * What a settings blob holds where a secret used to be.
79
+ *
80
+ * A keychain-stored field never holds its value. It holds a self-describing
81
+ * MARKER, `{"$secret":"secret://…","v":1}` — an object, never a string, so no
82
+ * code can mistake it for a credential and no form can send it to a camera as
83
+ * a password. The empty state is `null` / absent, never `''`.
84
+ *
85
+ * The same shapes travel to and from the admin UI:
86
+ *
87
+ * - read: `hydrateSchema` hands a secret field a {@link SecretFieldView}
88
+ * (`{ $secret, v, set: true }`) or `null` — the browser learns whether a
89
+ * value is set, never the value.
90
+ * - write: an untouched field submits the view back unchanged (KEEP); a typed
91
+ * value is a plain non-empty string (CHANGE); the Clear button submits
92
+ * {@link SECRET_CLEAR} (CLEAR). `''`, `null` and the legacy redaction tokens
93
+ * are KEEP — an empty string is what a defaults-fallback pushes back, and
94
+ * treating it as "clear" is how a save destroyed a stored credential before.
95
+ *
96
+ * Pure and browser-safe.
97
+ */
98
+ var SECRET_CLEAR = { $secretClear: true };
99
+ /** The `'***'` token D634 redaction writes for non-admins. */
100
+ var LEGACY_DEVICE_REDACTION = "***";
101
+ function isRecord$1(value) {
102
+ return typeof value === "object" && value !== null && !Array.isArray(value);
103
+ }
104
+ function makeSecretMarker(ref) {
105
+ return {
106
+ $secret: ref,
107
+ v: 1
108
+ };
109
+ }
110
+ /** A stored marker: an object whose `$secret` is a non-empty string. */
111
+ function isSecretMarker(value) {
112
+ if (!isRecord$1(value)) return false;
113
+ const ref = value["$secret"];
114
+ return typeof ref === "string" && ref.length > 0;
115
+ }
116
+ /** Anything carrying a `$secret` key — a stored marker or a UI view of one. */
117
+ function isSecretMarkerLike(value) {
118
+ return isRecord$1(value) && Object.prototype.hasOwnProperty.call(value, "$secret");
119
+ }
120
+ function isSecretClear(value) {
121
+ return isRecord$1(value) && value["$secretClear"] === true;
122
+ }
123
+ function isSecretFieldView(value) {
124
+ return isRecord$1(value) && value["set"] === true && isSecretMarkerLike(value);
125
+ }
126
+ /**
127
+ * The UI view of a stored secret field value: a marker becomes "set", inline
128
+ * plaintext becomes "set (inline)", nothing becomes `null`. A value never
129
+ * survives this function.
130
+ */
131
+ function toSecretFieldView(stored) {
132
+ if (isSecretMarker(stored)) return {
133
+ $secret: stored.$secret,
134
+ v: 1,
135
+ set: true
136
+ };
137
+ if (typeof stored === "string" && stored.length > 0) return {
138
+ $secret: null,
139
+ v: 1,
140
+ set: true,
141
+ inline: true
142
+ };
143
+ return null;
144
+ }
145
+ /**
146
+ * Classify an incoming value for a secret path. Only a non-empty string that is
147
+ * not a redaction token sets a value; only {@link SECRET_CLEAR} clears.
148
+ * Everything else — a marker (ours or anyone's), a UI view, `''`, `null`,
149
+ * `undefined`, a redaction token, a non-string — keeps what is stored.
150
+ */
151
+ function classifySecretWrite(incoming) {
152
+ if (isSecretClear(incoming)) return { kind: "clear" };
153
+ if (typeof incoming !== "string") return { kind: "keep" };
154
+ if (incoming.length === 0) return { kind: "keep" };
155
+ if (incoming === "__camstack_redacted__" || incoming === LEGACY_DEVICE_REDACTION) return { kind: "keep" };
156
+ return {
157
+ kind: "set",
158
+ value: incoming
159
+ };
160
+ }
161
+ //#endregion
162
+ //#region ../types/dist/esm/records/errors.mjs
163
+ var PREFIX = "records/";
164
+ /**
165
+ * Cross-realm brand. An addon bundles its own copy of this module (D15) while
166
+ * `ctx.records` is the HOST's door, so an error thrown by the host is an
167
+ * instance of the host's classes, not of the addon's. The brand plus the code
168
+ * make `instanceof` answer by identity of the failure, not of the copy.
169
+ */
170
+ var RECORDS_ERROR_BRAND = /* @__PURE__ */ Symbol.for("camstack.records-error");
171
+ function carriesBrand(value) {
172
+ return typeof value === "object" && value !== null && Reflect.get(value, RECORDS_ERROR_BRAND) === true;
173
+ }
174
+ /** The base of every records failure. `detail` is the human part of the message. */
175
+ var RecordsError = class extends Error {
176
+ /** The code a subclass stands for; the base stands for every code. */
177
+ static code = void 0;
178
+ /**
179
+ * `instanceof` across copies of this module: any branded error is a
180
+ * `RecordsError`, and is an instance of a subclass only when its code is the
181
+ * subclass's code. Same-copy answers are unchanged.
182
+ */
183
+ static [Symbol.hasInstance](value) {
184
+ if (Function.prototype[Symbol.hasInstance].call(this, value)) return true;
185
+ if (!carriesBrand(value)) return false;
186
+ return this.code === void 0 || value.code === this.code;
187
+ }
188
+ code;
189
+ detail;
190
+ [RECORDS_ERROR_BRAND] = true;
191
+ constructor(code, detail) {
192
+ super(`${PREFIX}${code}: ${detail}`);
193
+ this.name = "RecordsError";
194
+ this.code = code;
195
+ this.detail = detail;
196
+ }
197
+ };
198
+ /** A write guarded by `ifRev` found another revision (or an existing row for `ifRev: 0`). */
199
+ var RevConflictError = class RevConflictError extends RecordsError {
200
+ static code = "rev-conflict";
201
+ constructor(detail) {
202
+ super(RevConflictError.code, detail);
203
+ this.name = "RevConflictError";
204
+ }
205
+ };
206
+ /** `data` exceeds the kind's `maxDataBytes`. Bytes are never record fields (D613). */
207
+ var RecordTooLargeError = class RecordTooLargeError extends RecordsError {
208
+ static code = "too-large";
209
+ constructor(detail) {
210
+ super(RecordTooLargeError.code, detail);
211
+ this.name = "RecordTooLargeError";
212
+ }
213
+ };
214
+ /** A filter, order or aggregate names a field no declared index serves. */
215
+ var UnindexedFilterError = class UnindexedFilterError extends RecordsError {
216
+ static code = "unindexed-filter";
217
+ constructor(detail) {
218
+ super(UnindexedFilterError.code, detail);
219
+ this.name = "UnindexedFilterError";
220
+ }
221
+ };
222
+ /** A bulk delete with no predicate at all. */
223
+ var FilterRequiredError = class FilterRequiredError extends RecordsError {
224
+ static code = "filter-required";
225
+ constructor(detail) {
226
+ super(FilterRequiredError.code, detail);
227
+ this.name = "FilterRequiredError";
228
+ }
229
+ };
230
+ /** The caller declared no such kind (another addon's kind is indistinguishable from none). */
231
+ var UnknownRecordKindError = class UnknownRecordKindError extends RecordsError {
232
+ static code = "unknown-kind";
233
+ constructor(detail) {
234
+ super(UnknownRecordKindError.code, detail);
235
+ this.name = "UnknownRecordKindError";
236
+ }
237
+ };
238
+ var RecordNotFoundError = class RecordNotFoundError extends RecordsError {
239
+ static code = "not-found";
240
+ constructor(detail) {
241
+ super(RecordNotFoundError.code, detail);
242
+ this.name = "RecordNotFoundError";
243
+ }
244
+ };
245
+ /** A unique index refused the write. */
246
+ var RecordUniqueViolationError = class RecordUniqueViolationError extends RecordsError {
247
+ static code = "unique-violation";
248
+ constructor(detail) {
249
+ super(RecordUniqueViolationError.code, detail);
250
+ this.name = "RecordUniqueViolationError";
251
+ }
252
+ };
253
+ /** A secret field held a plain string where only a keychain marker may be stored. */
254
+ var PlaintextSecretError = class PlaintextSecretError extends RecordsError {
255
+ static code = "plaintext-secret";
256
+ constructor(detail) {
257
+ super(PlaintextSecretError.code, detail);
258
+ this.name = "PlaintextSecretError";
259
+ }
260
+ };
261
+ /** A marker whose ref is not the row's own (the D878 rule). */
262
+ var ForeignSecretMarkerError = class ForeignSecretMarkerError extends RecordsError {
263
+ static code = "foreign-marker";
264
+ constructor(detail) {
265
+ super(ForeignSecretMarkerError.code, detail);
266
+ this.name = "ForeignSecretMarkerError";
267
+ }
268
+ };
269
+ /** The keychain could not store or serve a value: explicit, never an empty string. */
270
+ var RecordSecretUnavailableError = class RecordSecretUnavailableError extends RecordsError {
271
+ static code = "secret-unavailable";
272
+ constructor(detail) {
273
+ super(RecordSecretUnavailableError.code, detail);
274
+ this.name = "RecordSecretUnavailableError";
275
+ }
276
+ };
277
+ var InvalidRecordError = class InvalidRecordError extends RecordsError {
278
+ static code = "invalid-record";
279
+ constructor(detail) {
280
+ super(InvalidRecordError.code, detail);
281
+ this.name = "InvalidRecordError";
282
+ }
283
+ };
284
+ /** A kind declaration the engine refuses (non-additive change, bad shape, wrong file). */
285
+ var DeclarationRefusedError = class DeclarationRefusedError extends RecordsError {
286
+ static code = "declaration-refused";
287
+ constructor(detail) {
288
+ super(DeclarationRefusedError.code, detail);
289
+ this.name = "DeclarationRefusedError";
290
+ }
291
+ };
292
+ var NoCallerError = class NoCallerError extends RecordsError {
293
+ static code = "no-caller";
294
+ constructor(detail) {
295
+ super(NoCallerError.code, detail);
296
+ this.name = "NoCallerError";
297
+ }
298
+ };
299
+ var BatchTooLargeError = class BatchTooLargeError extends RecordsError {
300
+ static code = "batch-too-large";
301
+ constructor(detail) {
302
+ super(BatchTooLargeError.code, detail);
303
+ this.name = "BatchTooLargeError";
304
+ }
305
+ };
306
+ /**
307
+ * A `transact` the engine refuses before touching a row: an op on a kind the
308
+ * caller did not declare in ONE file and ONE `transactFamily`. The detail names
309
+ * which rule (`cross-file`, `cross-family`, `no-family`); it is never a silent split.
310
+ */
311
+ var TransactRefusedError = class TransactRefusedError extends RecordsError {
312
+ static code = "transact-refused";
313
+ constructor(detail) {
314
+ super(TransactRefusedError.code, detail);
315
+ this.name = "TransactRefusedError";
316
+ }
317
+ };
318
+ //#endregion
319
+ //#region ../types/dist/esm/keychain/secret-ref.mjs
320
+ /**
321
+ * The address of one keychain value: `secret://<owner>/<scope>/<fieldPath>`.
322
+ *
323
+ * A ref is DETERMINISTIC from where the value lives — the owner addon, the
324
+ * scope (global, one node, one device, one integration, one row of a business
325
+ * collection) and the field path inside that scope — so saving the same field
326
+ * twice updates the same ref, and the ref itself says which settings blob
327
+ * points at it. It is also the AAD of the value's ciphertext: a ciphertext
328
+ * copied onto another ref does not decrypt.
329
+ *
330
+ * Array items are addressed by ITEM ID, never by index
331
+ * (`providers[authentik].clientSecret`), so reordering a list keeps every ref.
332
+ *
333
+ * Pure and browser-safe: no node builtins, no I/O.
334
+ */
335
+ /** The URI scheme of every keychain ref. */
336
+ var SECRET_REF_SCHEME = "secret://";
337
+ var GLOBAL_SCOPE = { kind: "global" };
338
+ /** The scope every addon-wide (not per-node, not per-device) setting lives in. */
339
+ function globalSecretScope() {
340
+ return GLOBAL_SCOPE;
341
+ }
342
+ /**
343
+ * An addon id as a ref owner. A hub in-process builtin's context id is
344
+ * `addon:<id>`; the owner of its secrets is `<id>`, exactly as for the same
345
+ * addon running forked.
346
+ */
347
+ function normalizeSecretOwner(addonId) {
348
+ return addonId.startsWith("addon:") ? addonId.slice(6) : addonId;
349
+ }
350
+ function encodeSegment(value) {
351
+ return encodeURIComponent(value);
352
+ }
353
+ function decodeSegment(value) {
354
+ try {
355
+ return decodeURIComponent(value);
356
+ } catch {
357
+ return null;
358
+ }
359
+ }
360
+ /** The scope as it appears inside a ref (`global`, `node/<id>`, …). */
361
+ function formatSecretScope(scope) {
362
+ switch (scope.kind) {
363
+ case "global": return "global";
364
+ case "node": return `node/${encodeSegment(scope.nodeId)}`;
365
+ case "device": return `device/${scope.deviceId}`;
366
+ case "integration": return `integration/${encodeSegment(scope.integrationId)}`;
367
+ case "row": return `row/${encodeSegment(scope.collection)}/${encodeSegment(scope.rowId)}`;
368
+ }
369
+ }
370
+ /**
371
+ * The field path of a value inside an array item, addressed by the item's id:
372
+ * `arrayItemFieldPath('providers', 'authentik', 'clientSecret')` →
373
+ * `providers[authentik].clientSecret`.
374
+ */
375
+ function arrayItemFieldPath(arrayKey, itemId, fieldKey) {
376
+ return `${arrayKey}[${encodeSegment(itemId)}].${fieldKey}`;
377
+ }
378
+ /** Build a ref. Throws on an empty owner or field path — both are bugs. */
379
+ function buildSecretRef(parts) {
380
+ const owner = normalizeSecretOwner(parts.owner);
381
+ if (owner.length === 0) throw new Error("buildSecretRef: owner is empty");
382
+ if (parts.fieldPath.length === 0) throw new Error("buildSecretRef: fieldPath is empty");
383
+ return `${SECRET_REF_SCHEME}${encodeSegment(owner)}/${formatSecretScope(parts.scope)}/${parts.fieldPath}`;
384
+ }
385
+ function parseScope(segments) {
386
+ switch (segments[0]) {
387
+ case "global": return {
388
+ scope: GLOBAL_SCOPE,
389
+ used: 1
390
+ };
391
+ case "node": {
392
+ const nodeId = segments[1] !== void 0 ? decodeSegment(segments[1]) : null;
393
+ return nodeId === null || nodeId.length === 0 ? null : {
394
+ scope: {
395
+ kind: "node",
396
+ nodeId
397
+ },
398
+ used: 2
399
+ };
400
+ }
401
+ case "device": {
402
+ const raw = segments[1];
403
+ if (raw === void 0 || !/^\d+$/.test(raw)) return null;
404
+ return {
405
+ scope: {
406
+ kind: "device",
407
+ deviceId: Number(raw)
408
+ },
409
+ used: 2
410
+ };
411
+ }
412
+ case "integration": {
413
+ const id = segments[1] !== void 0 ? decodeSegment(segments[1]) : null;
414
+ return id === null || id.length === 0 ? null : {
415
+ scope: {
416
+ kind: "integration",
417
+ integrationId: id
418
+ },
419
+ used: 2
420
+ };
421
+ }
422
+ case "row": {
423
+ const collection = segments[1] !== void 0 ? decodeSegment(segments[1]) : null;
424
+ const rowId = segments[2] !== void 0 ? decodeSegment(segments[2]) : null;
425
+ if (collection === null || rowId === null || collection.length === 0 || rowId.length === 0) return null;
426
+ return {
427
+ scope: {
428
+ kind: "row",
429
+ collection,
430
+ rowId
431
+ },
432
+ used: 3
433
+ };
434
+ }
435
+ default: return null;
436
+ }
437
+ }
438
+ /** Take a ref apart; `null` when it is not a well-formed ref. */
439
+ function parseSecretRef(ref) {
440
+ if (!ref.startsWith("secret://")) return null;
441
+ const segments = ref.slice(9).split("/");
442
+ const owner = segments[0] !== void 0 ? decodeSegment(segments[0]) : null;
443
+ if (owner === null || owner.length === 0) return null;
444
+ const parsed = parseScope(segments.slice(1));
445
+ if (parsed === null) return null;
446
+ const fieldPath = segments.slice(1 + parsed.used).join("/");
447
+ if (fieldPath.length === 0) return null;
448
+ return {
449
+ owner,
450
+ scope: parsed.scope,
451
+ fieldPath
452
+ };
453
+ }
454
+ //#endregion
455
+ //#region ../types/dist/esm/records/constants.mjs
456
+ /** Limits and names of `ctx.records` (D881). One authority; the engine and the facade read it. */
457
+ /** The files a kind may live in. `history` is device-history's (D850), never records. */
458
+ var RECORD_DATABASES = ["settings", "events"];
459
+ /** The classes of a kind: the `@durable` vocabulary, one authority (replaces the annotation). */
460
+ var RECORD_CLASSES = [
461
+ "config",
462
+ "ledger",
463
+ "audit",
464
+ "mirror",
465
+ "ephemeral"
466
+ ];
467
+ var RECORD_DEFAULT_MAX_DATA_BYTES = 64 * 1024;
468
+ var RECORD_MAX_DATA_BYTES = 1024 * 1024;
469
+ var RECORD_BATCH_MAX = 1e3;
470
+ var RECORD_BATCH_MAX_BYTES = 4 * 1024 * 1024;
471
+ var RECORD_QUERY_MAX = 1e3;
472
+ /** Rows one DELETE statement removes before the serving thread yields. */
473
+ var RECORD_DELETE_BATCH = 5e3;
474
+ /** A kind in the `settings` file may not bound itself above this (D447: high volume is `events`). */
475
+ var RECORD_SETTINGS_MAX_ROWS = 5e4;
476
+ /** The engine's TTL sweep cadence. */
477
+ var RECORD_SWEEP_INTERVAL_MS = 10 * 6e4;
478
+ /** The `Column`-free proof prefix: a ref collection for a kind's secret fields. */
479
+ var RECORD_SECRET_COLLECTION_PREFIX = "records:";
480
+ //#endregion
481
+ //#region ../types/dist/esm/records/secret-paths.mjs
482
+ /**
483
+ * Secret fields of a record, addressed the way a Zod schema declares them
484
+ * (`collectZodSecretPaths`): dotted keys, `[]` for "each element of this array"
485
+ * (`auth.accessToken`, `headers[].value`).
486
+ *
487
+ * `{}` after a key means "each value of this map" (`applianceSecrets{}`): the map's own key
488
+ * names the value (`applianceSecrets{fridge}`), so no id key is declared and a body that drops a
489
+ * key releases exactly that key's secret.
490
+ *
491
+ * Array elements are matched by a DECLARED id key (`secretArrayKeys`:
492
+ * `{ headers: 'name' }`), never by index, so reordering a list keeps every
493
+ * keychain ref (the same rule as `arrayItemFieldPath`). The concrete path of a
494
+ * leaf names its element: `headers[X-Api].value`.
495
+ *
496
+ * Pure and browser-safe. Nothing here mutates: every transform returns a new value.
497
+ */
498
+ /** The array prefixes (declared form, e.g. `headers` or `a.headers`) of a path. */
499
+ function parseSecretPath(path) {
500
+ if (path.length === 0) throw new InvalidRecordError("an empty secret path");
501
+ return path.split(".").map((raw) => {
502
+ const each = raw.endsWith("[]");
503
+ const map = raw.endsWith("{}");
504
+ const key = each || map ? raw.slice(0, -2) : raw;
505
+ if (key.length === 0) throw new InvalidRecordError(`secret path "${path}" has an empty segment`);
506
+ return {
507
+ key,
508
+ each,
509
+ map
510
+ };
511
+ });
512
+ }
513
+ /** The declared array prefixes of `path` that need an id key (`headers`, `a.rows`). */
514
+ function secretArrayPrefixes(path) {
515
+ const segments = parseSecretPath(path);
516
+ const prefixes = [];
517
+ const walked = [];
518
+ for (const segment of segments) {
519
+ walked.push(segment.key);
520
+ if (segment.each) prefixes.push(walked.join("."));
521
+ }
522
+ return prefixes;
523
+ }
524
+ function isRecord(value) {
525
+ return typeof value === "object" && value !== null && !Array.isArray(value);
526
+ }
527
+ function elementId(element, idKey, declared, prefix) {
528
+ const id = isRecord(element) ? element[idKey] : void 0;
529
+ if (typeof id !== "string" || id.length === 0) throw new InvalidRecordError(`"${declared}": every element of "${prefix}" needs a non-empty string "${idKey}" to carry a secret`);
530
+ return id;
531
+ }
532
+ /**
533
+ * Visit every secret leaf PRESENT in `data` (an absent branch has nothing to
534
+ * visit). `replace` returns the new leaf value, or {@link REMOVE_LEAF}; the
535
+ * result is a new body, `data` is untouched.
536
+ */
537
+ var REMOVE_LEAF = /* @__PURE__ */ Symbol("remove-leaf");
538
+ function mapAt(node, segments, index, walkedKeys, concretePrefix, declared, arrayKeys, visit) {
539
+ if (!isRecord(node)) return node;
540
+ const segment = segments[index];
541
+ if (segment === void 0) return node;
542
+ if (!Object.prototype.hasOwnProperty.call(node, segment.key)) return node;
543
+ const child = node[segment.key];
544
+ const keys = [...walkedKeys, segment.key];
545
+ const last = index === segments.length - 1;
546
+ if (segment.each) {
547
+ if (!Array.isArray(child)) return node;
548
+ const prefix = keys.join(".");
549
+ const idKey = arrayKeys[prefix];
550
+ if (idKey === void 0) throw new InvalidRecordError(`"${declared}": no id key declared for the array "${prefix}"`);
551
+ const mapped = child.map((element) => {
552
+ const id = elementId(element, idKey, declared, prefix);
553
+ const concrete = `${concretePrefix}${concretePrefix.length > 0 ? "." : ""}${segment.key}[${encodeURIComponent(id)}]`;
554
+ return last ? element : mapAt(element, segments, index + 1, keys, concrete, declared, arrayKeys, visit);
555
+ });
556
+ return {
557
+ ...node,
558
+ [segment.key]: mapped
559
+ };
560
+ }
561
+ if (segment.map) {
562
+ if (!isRecord(child)) return node;
563
+ const kept = Object.entries(child).map(([mapKey, value]) => {
564
+ const concrete = `${concretePrefix}${concretePrefix.length > 0 ? "." : ""}${segment.key}{${encodeURIComponent(mapKey)}}`;
565
+ if (!last) return [mapKey, mapAt(value, segments, index + 1, keys, concrete, declared, arrayKeys, visit)];
566
+ return [mapKey, visit({
567
+ declared,
568
+ concrete,
569
+ value
570
+ })];
571
+ }).filter(([, value]) => value !== REMOVE_LEAF);
572
+ return {
573
+ ...node,
574
+ [segment.key]: Object.fromEntries(kept)
575
+ };
576
+ }
577
+ const concrete = `${concretePrefix}${concretePrefix.length > 0 ? "." : ""}${segment.key}`;
578
+ if (last) {
579
+ const replacement = visit({
580
+ declared,
581
+ concrete,
582
+ value: child
583
+ });
584
+ if (replacement === REMOVE_LEAF) return Object.fromEntries(Object.entries(node).filter(([key]) => key !== segment.key));
585
+ return {
586
+ ...node,
587
+ [segment.key]: replacement
588
+ };
589
+ }
590
+ return {
591
+ ...node,
592
+ [segment.key]: mapAt(child, segments, index + 1, keys, concrete, declared, arrayKeys, visit)
593
+ };
594
+ }
595
+ /** Replace/remove every present secret leaf; returns a NEW body. */
596
+ function mapSecretLeaves(data, paths, arrayKeys, visit) {
597
+ let current = data;
598
+ for (const declared of paths) current = mapAt(current, parseSecretPath(declared), 0, [], "", declared, arrayKeys, visit);
599
+ return current;
600
+ }
601
+ /** Every present secret leaf, read-only. */
602
+ function collectSecretLeaves(data, paths, arrayKeys) {
603
+ const found = [];
604
+ mapSecretLeaves(data, paths, arrayKeys, (leaf) => {
605
+ found.push(leaf);
606
+ return leaf.value;
607
+ });
608
+ return found;
609
+ }
610
+ /**
611
+ * The keychain collection name a kind's secrets live under. Prefixed so a
612
+ * record's refs never collide with the refs a legacy collection of the same name
613
+ * already holds during an adoption.
614
+ */
615
+ function recordSecretCollection(kind) {
616
+ return `${RECORD_SECRET_COLLECTION_PREFIX}${kind}`;
617
+ }
618
+ /** The ONE ref a row's secret field may carry: the engine and the facade both build it here. */
619
+ function recordSecretRef(owner, kind, rowId, concretePath) {
620
+ return buildSecretRef({
621
+ owner,
622
+ scope: {
623
+ kind: "row",
624
+ collection: recordSecretCollection(kind),
625
+ rowId
626
+ },
627
+ fieldPath: concretePath
628
+ });
629
+ }
630
+ //#endregion
631
+ //#region ../types/dist/esm/addon/scoped-settings.mjs
632
+ /** Every scope, in the order the guard and the docs list them. */
633
+ var SCOPED_SETTINGS_SCOPES = [
634
+ "cluster",
635
+ "device-defaults",
636
+ "node"
637
+ ];
638
+ /**
639
+ * The node id a node-scoped KEY carries: the part after the `@`. `null` for a key with no `@`
640
+ * (a cluster or fleet-default key) or an empty node id. A schema key never contains `@`
641
+ * (guard `check-scoped-settings-declared`), so the first `@` is the separator.
642
+ */
643
+ function nodeIdOfScopedKey(key) {
644
+ const at = key.indexOf("@");
645
+ if (at <= 0) return null;
646
+ const nodeId = key.slice(at + 1);
647
+ return nodeId === "" ? null : nodeId;
648
+ }
649
+ //#endregion
650
+ Object.defineProperty(exports, "BatchTooLargeError", {
651
+ enumerable: true,
652
+ get: function() {
653
+ return BatchTooLargeError;
654
+ }
655
+ });
656
+ Object.defineProperty(exports, "DeclarationRefusedError", {
657
+ enumerable: true,
658
+ get: function() {
659
+ return DeclarationRefusedError;
660
+ }
661
+ });
662
+ Object.defineProperty(exports, "FilterRequiredError", {
663
+ enumerable: true,
664
+ get: function() {
665
+ return FilterRequiredError;
666
+ }
667
+ });
668
+ Object.defineProperty(exports, "ForeignSecretMarkerError", {
669
+ enumerable: true,
670
+ get: function() {
671
+ return ForeignSecretMarkerError;
672
+ }
673
+ });
674
+ Object.defineProperty(exports, "InvalidRecordError", {
675
+ enumerable: true,
676
+ get: function() {
677
+ return InvalidRecordError;
678
+ }
679
+ });
680
+ Object.defineProperty(exports, "NoCallerError", {
681
+ enumerable: true,
682
+ get: function() {
683
+ return NoCallerError;
684
+ }
685
+ });
686
+ Object.defineProperty(exports, "PlaintextSecretError", {
687
+ enumerable: true,
688
+ get: function() {
689
+ return PlaintextSecretError;
690
+ }
691
+ });
692
+ Object.defineProperty(exports, "RECORD_BATCH_MAX", {
693
+ enumerable: true,
694
+ get: function() {
695
+ return RECORD_BATCH_MAX;
696
+ }
697
+ });
698
+ Object.defineProperty(exports, "RECORD_BATCH_MAX_BYTES", {
699
+ enumerable: true,
700
+ get: function() {
701
+ return RECORD_BATCH_MAX_BYTES;
702
+ }
703
+ });
704
+ Object.defineProperty(exports, "RECORD_CLASSES", {
705
+ enumerable: true,
706
+ get: function() {
707
+ return RECORD_CLASSES;
708
+ }
709
+ });
710
+ Object.defineProperty(exports, "RECORD_DATABASES", {
711
+ enumerable: true,
712
+ get: function() {
713
+ return RECORD_DATABASES;
714
+ }
715
+ });
716
+ Object.defineProperty(exports, "RECORD_DEFAULT_MAX_DATA_BYTES", {
717
+ enumerable: true,
718
+ get: function() {
719
+ return RECORD_DEFAULT_MAX_DATA_BYTES;
720
+ }
721
+ });
722
+ Object.defineProperty(exports, "RECORD_DELETE_BATCH", {
723
+ enumerable: true,
724
+ get: function() {
725
+ return RECORD_DELETE_BATCH;
726
+ }
727
+ });
728
+ Object.defineProperty(exports, "RECORD_MAX_DATA_BYTES", {
729
+ enumerable: true,
730
+ get: function() {
731
+ return RECORD_MAX_DATA_BYTES;
732
+ }
733
+ });
734
+ Object.defineProperty(exports, "RECORD_QUERY_MAX", {
735
+ enumerable: true,
736
+ get: function() {
737
+ return RECORD_QUERY_MAX;
738
+ }
739
+ });
740
+ Object.defineProperty(exports, "RECORD_SECRET_COLLECTION_PREFIX", {
741
+ enumerable: true,
742
+ get: function() {
743
+ return RECORD_SECRET_COLLECTION_PREFIX;
744
+ }
745
+ });
746
+ Object.defineProperty(exports, "RECORD_SETTINGS_MAX_ROWS", {
747
+ enumerable: true,
748
+ get: function() {
749
+ return RECORD_SETTINGS_MAX_ROWS;
750
+ }
751
+ });
752
+ Object.defineProperty(exports, "RECORD_SWEEP_INTERVAL_MS", {
753
+ enumerable: true,
754
+ get: function() {
755
+ return RECORD_SWEEP_INTERVAL_MS;
756
+ }
757
+ });
758
+ Object.defineProperty(exports, "REDACTED_SECRET", {
759
+ enumerable: true,
760
+ get: function() {
761
+ return REDACTED_SECRET;
762
+ }
763
+ });
764
+ Object.defineProperty(exports, "REMOVE_LEAF", {
765
+ enumerable: true,
766
+ get: function() {
767
+ return REMOVE_LEAF;
768
+ }
769
+ });
770
+ Object.defineProperty(exports, "RecordNotFoundError", {
771
+ enumerable: true,
772
+ get: function() {
773
+ return RecordNotFoundError;
774
+ }
775
+ });
776
+ Object.defineProperty(exports, "RecordSecretUnavailableError", {
777
+ enumerable: true,
778
+ get: function() {
779
+ return RecordSecretUnavailableError;
780
+ }
781
+ });
782
+ Object.defineProperty(exports, "RecordTooLargeError", {
783
+ enumerable: true,
784
+ get: function() {
785
+ return RecordTooLargeError;
786
+ }
787
+ });
788
+ Object.defineProperty(exports, "RecordUniqueViolationError", {
789
+ enumerable: true,
790
+ get: function() {
791
+ return RecordUniqueViolationError;
792
+ }
793
+ });
794
+ Object.defineProperty(exports, "RevConflictError", {
795
+ enumerable: true,
796
+ get: function() {
797
+ return RevConflictError;
798
+ }
799
+ });
800
+ Object.defineProperty(exports, "SCOPED_SETTINGS_SCOPES", {
801
+ enumerable: true,
802
+ get: function() {
803
+ return SCOPED_SETTINGS_SCOPES;
804
+ }
805
+ });
806
+ Object.defineProperty(exports, "SECRET_CLEAR", {
807
+ enumerable: true,
808
+ get: function() {
809
+ return SECRET_CLEAR;
810
+ }
811
+ });
812
+ Object.defineProperty(exports, "TransactRefusedError", {
813
+ enumerable: true,
814
+ get: function() {
815
+ return TransactRefusedError;
816
+ }
817
+ });
818
+ Object.defineProperty(exports, "UnindexedFilterError", {
819
+ enumerable: true,
820
+ get: function() {
821
+ return UnindexedFilterError;
822
+ }
823
+ });
824
+ Object.defineProperty(exports, "UnknownRecordKindError", {
825
+ enumerable: true,
826
+ get: function() {
827
+ return UnknownRecordKindError;
828
+ }
829
+ });
830
+ Object.defineProperty(exports, "arrayItemFieldPath", {
831
+ enumerable: true,
832
+ get: function() {
833
+ return arrayItemFieldPath;
834
+ }
835
+ });
836
+ Object.defineProperty(exports, "buildSecretRef", {
837
+ enumerable: true,
838
+ get: function() {
839
+ return buildSecretRef;
840
+ }
841
+ });
842
+ Object.defineProperty(exports, "classifySecretWrite", {
843
+ enumerable: true,
844
+ get: function() {
845
+ return classifySecretWrite;
846
+ }
847
+ });
848
+ Object.defineProperty(exports, "collectSecretConfigKeys", {
849
+ enumerable: true,
850
+ get: function() {
851
+ return collectSecretConfigKeys;
852
+ }
853
+ });
854
+ Object.defineProperty(exports, "collectSecretLeaves", {
855
+ enumerable: true,
856
+ get: function() {
857
+ return collectSecretLeaves;
858
+ }
859
+ });
860
+ Object.defineProperty(exports, "errMsg", {
861
+ enumerable: true,
862
+ get: function() {
863
+ return errMsg;
864
+ }
865
+ });
866
+ Object.defineProperty(exports, "formatSecretScope", {
867
+ enumerable: true,
868
+ get: function() {
869
+ return formatSecretScope;
870
+ }
871
+ });
872
+ Object.defineProperty(exports, "globalSecretScope", {
873
+ enumerable: true,
874
+ get: function() {
875
+ return globalSecretScope;
876
+ }
877
+ });
878
+ Object.defineProperty(exports, "isKeychainStoredField", {
879
+ enumerable: true,
880
+ get: function() {
881
+ return isKeychainStoredField;
882
+ }
883
+ });
884
+ Object.defineProperty(exports, "isSecretClear", {
885
+ enumerable: true,
886
+ get: function() {
887
+ return isSecretClear;
888
+ }
889
+ });
890
+ Object.defineProperty(exports, "isSecretFieldView", {
891
+ enumerable: true,
892
+ get: function() {
893
+ return isSecretFieldView;
894
+ }
895
+ });
896
+ Object.defineProperty(exports, "isSecretMarker", {
897
+ enumerable: true,
898
+ get: function() {
899
+ return isSecretMarker;
900
+ }
901
+ });
902
+ Object.defineProperty(exports, "isSecretMarkerLike", {
903
+ enumerable: true,
904
+ get: function() {
905
+ return isSecretMarkerLike;
906
+ }
907
+ });
908
+ Object.defineProperty(exports, "makeSecretMarker", {
909
+ enumerable: true,
910
+ get: function() {
911
+ return makeSecretMarker;
912
+ }
913
+ });
914
+ Object.defineProperty(exports, "mapSecretLeaves", {
915
+ enumerable: true,
916
+ get: function() {
917
+ return mapSecretLeaves;
918
+ }
919
+ });
920
+ Object.defineProperty(exports, "nodeIdOfScopedKey", {
921
+ enumerable: true,
922
+ get: function() {
923
+ return nodeIdOfScopedKey;
924
+ }
925
+ });
926
+ Object.defineProperty(exports, "normalizeSecretOwner", {
927
+ enumerable: true,
928
+ get: function() {
929
+ return normalizeSecretOwner;
930
+ }
931
+ });
932
+ Object.defineProperty(exports, "parseSecretRef", {
933
+ enumerable: true,
934
+ get: function() {
935
+ return parseSecretRef;
936
+ }
937
+ });
938
+ Object.defineProperty(exports, "recordSecretRef", {
939
+ enumerable: true,
940
+ get: function() {
941
+ return recordSecretRef;
942
+ }
943
+ });
944
+ Object.defineProperty(exports, "secretArrayPrefixes", {
945
+ enumerable: true,
946
+ get: function() {
947
+ return secretArrayPrefixes;
948
+ }
949
+ });
950
+ Object.defineProperty(exports, "toSecretFieldView", {
951
+ enumerable: true,
952
+ get: function() {
953
+ return toSecretFieldView;
954
+ }
955
+ });