@camstack/server 1.2.877 → 1.2.879

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 (105) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/api/trpc/generated-cap-mounts.js +2 -1
  3. package/dist/api/trpc/generated-cap-routers.js +308 -256
  4. package/package.json +8 -9
  5. package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +1 -1
  6. package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +1 -1
  7. package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
  8. package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +1 -1
  9. package/system/dist/builtins/alerts/alerts.addon.js +1 -1
  10. package/system/dist/builtins/alerts/alerts.addon.mjs +1 -1
  11. package/system/dist/builtins/autotrack/index.js +1 -1
  12. package/system/dist/builtins/autotrack/index.mjs +1 -1
  13. package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +2 -2
  14. package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +2 -2
  15. package/system/dist/builtins/calendars/calendars.addon.js +1 -1
  16. package/system/dist/builtins/calendars/calendars.addon.mjs +1 -1
  17. package/system/dist/builtins/camera-grid/index.js +1 -1
  18. package/system/dist/builtins/camera-grid/index.mjs +1 -1
  19. package/system/dist/builtins/composer/composer.addon.js +4 -4
  20. package/system/dist/builtins/composer/composer.addon.mjs +4 -4
  21. package/system/dist/builtins/console-logging/index.js +1 -1
  22. package/system/dist/builtins/console-logging/index.mjs +1 -1
  23. package/system/dist/builtins/core-blocks/actions-store.d.ts +2 -0
  24. package/system/dist/builtins/core-blocks/core-block-store.d.ts +6 -0
  25. package/system/dist/builtins/core-blocks/core-blocks.addon.d.ts +3 -0
  26. package/system/dist/builtins/core-blocks/core-blocks.addon.js +410 -9
  27. package/system/dist/builtins/core-blocks/core-blocks.addon.mjs +410 -9
  28. package/system/dist/builtins/core-blocks/record-kinds.d.ts +11 -1
  29. package/system/dist/builtins/core-blocks/scheduler/scheduler-store.d.ts +6 -0
  30. package/system/dist/builtins/core-blocks/tags-service.d.ts +50 -0
  31. package/system/dist/builtins/core-blocks/tags-wiring.d.ts +16 -0
  32. package/system/dist/builtins/device-history/device-history.addon.js +2 -2
  33. package/system/dist/builtins/device-history/device-history.addon.mjs +2 -2
  34. package/system/dist/builtins/device-manager/device-manager.addon.js +59 -5
  35. package/system/dist/builtins/device-manager/device-manager.addon.mjs +59 -5
  36. package/system/dist/builtins/device-manager/device-meta-actions.d.ts +6 -0
  37. package/system/dist/builtins/device-manager/device-meta-types.d.ts +2 -0
  38. package/system/dist/builtins/device-manager/device-row-store.d.ts +1 -0
  39. package/system/dist/builtins/device-manager/device-template/template-grammar.d.ts +15 -1
  40. package/system/dist/builtins/device-manager/device-template/template-protocol.d.ts +8 -0
  41. package/system/dist/builtins/hub-forwarder/index.js +1 -1
  42. package/system/dist/builtins/hub-forwarder/index.mjs +1 -1
  43. package/system/dist/builtins/keychain/index.js +4 -4
  44. package/system/dist/builtins/keychain/index.mjs +4 -4
  45. package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.js +1 -1
  46. package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +1 -1
  47. package/system/dist/builtins/local-auth/local-auth.addon.js +2 -2
  48. package/system/dist/builtins/local-auth/local-auth.addon.mjs +2 -2
  49. package/system/dist/builtins/local-network/local-network.addon.js +3 -3
  50. package/system/dist/builtins/local-network/local-network.addon.mjs +3 -3
  51. package/system/dist/builtins/loki-logging/index.js +1 -1
  52. package/system/dist/builtins/loki-logging/index.mjs +1 -1
  53. package/system/dist/builtins/native-metrics/native-metrics.addon.js +1 -1
  54. package/system/dist/builtins/native-metrics/native-metrics.addon.mjs +1 -1
  55. package/system/dist/builtins/platform-probe/index.js +1 -1
  56. package/system/dist/builtins/platform-probe/index.mjs +1 -1
  57. package/system/dist/builtins/record-entries/index.js +1 -1
  58. package/system/dist/builtins/record-entries/index.mjs +1 -1
  59. package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
  60. package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
  61. package/system/dist/builtins/snapshot/index.js +1 -1
  62. package/system/dist/builtins/snapshot/index.mjs +1 -1
  63. package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
  64. package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +1 -1
  65. package/system/dist/builtins/sqlite-storage/index.js +1 -1
  66. package/system/dist/builtins/sqlite-storage/index.mjs +1 -1
  67. package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.js +3 -3
  68. package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +3 -3
  69. package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +1 -1
  70. package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +1 -1
  71. package/system/dist/builtins/system-config/system-config.addon.js +3 -3
  72. package/system/dist/builtins/system-config/system-config.addon.mjs +284 -284
  73. package/system/dist/builtins/winston-logging/index.js +1 -1
  74. package/system/dist/builtins/winston-logging/index.mjs +1 -1
  75. package/system/dist/{capture-engine-2V8c4s3c.js → capture-engine-DAGmlBmJ.js} +1 -1
  76. package/system/dist/{capture-engine-DQTpQ2x7.mjs → capture-engine-vlouhBCY.mjs} +1 -1
  77. package/system/dist/{composition-sources-De2-fnz1.js → composition-sources-Rm8xDXjA.js} +1 -1
  78. package/system/dist/{composition-sources-DjQfZJXB.mjs → composition-sources-TeHa4THk.mjs} +1 -1
  79. package/system/dist/{constants-CXQ72oX8.mjs → constants-Bq1Xl_Ku.mjs} +1 -1
  80. package/system/dist/{constants-BpNC8zLo.js → constants-DnUpXvIY.js} +1 -1
  81. package/system/dist/{device-ca-pvid0fx9.js → device-ca-DMudhY-2.js} +1 -1
  82. package/system/dist/{device-ca-DnZEQKUX.mjs → device-ca-yHLgyutP.mjs} +1 -1
  83. package/system/dist/device-template-worker.js +26 -3
  84. package/system/dist/device-template-worker.mjs +26 -3
  85. package/system/dist/{dist-BghIT0F5.js → dist-Bh5JIimH.js} +1700 -1178
  86. package/system/dist/{dist-CcfanEqn.mjs → dist-DemZNuSJ.mjs} +1647 -1179
  87. package/system/dist/file-host-worker.js +1 -1
  88. package/system/dist/file-host-worker.mjs +1 -1
  89. package/system/dist/{hub-identity-B5pg6urK.mjs → hub-identity-BxaJKDQk.mjs} +1 -1
  90. package/system/dist/{hub-identity-B74cag6Q.js → hub-identity-YfGdAaBm.js} +1 -1
  91. package/system/dist/{hub-mdns-ciao-8bwCOLeJ.js → hub-mdns-ciao-BkWOmG6H.js} +2 -2
  92. package/system/dist/{hub-mdns-ciao-Db9RuUVf.mjs → hub-mdns-ciao-aIsTpo0F.mjs} +2 -2
  93. package/system/dist/index.js +8 -8
  94. package/system/dist/index.mjs +8 -8
  95. package/system/dist/{legacy-integration-rows-door-DlZ8ad2x.js → legacy-integration-rows-door-C9PZZiKH.js} +1 -1
  96. package/system/dist/{legacy-integration-rows-door-XBECnCQb.mjs → legacy-integration-rows-door-DrfZZHWq.mjs} +1 -1
  97. package/system/dist/{rename-composition-block-BWGfsb6q.mjs → rename-composition-block-C2KFIOMP.mjs} +1 -1
  98. package/system/dist/{rename-composition-block-CQnWc7-b.js → rename-composition-block-Qp1dW4FP.js} +1 -1
  99. package/system/dist/{restore-archive-CI7Ejrq9.js → restore-archive-DGgj7aqA.js} +1 -1
  100. package/system/dist/{restore-archive-DsfZbucU.mjs → restore-archive-waz532L0.mjs} +82 -82
  101. package/system/dist/{template-protocol-DRZ4cm95.js → template-protocol-D5ogm1rj.js} +8 -44
  102. package/system/dist/{template-protocol-D_6uVHKs.mjs → template-protocol-SgPDx3Hw.mjs} +8 -44
  103. package/system/dist/{wal-maintenance-Dl4QOdNz.mjs → wal-maintenance-BuiSFfF2.mjs} +0 -0
  104. package/system/dist/{wal-maintenance-WAuRngNc.js → wal-maintenance-DD8mfRDn.js} +0 -0
  105. package/system/package.json +4 -1
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  const require_chunk = require("../../chunk-Cek0wNdY.js");
6
- const require_dist = require("../../dist-BghIT0F5.js");
6
+ const require_dist = require("../../dist-Bh5JIimH.js");
7
7
  const require_formatter = require("../../formatter-xbxeV4GD.js");
8
8
  const require_log_file_read_protocol = require("../../log-file-read-protocol-DSV_vQRb.js");
9
9
  let node_path = require("node:path");
@@ -1,4 +1,4 @@
1
- import { Ic as defineAddonMigrations, Ls as BaseAddon, Vi as logDestinationCapability, xa as preconditionOf } from "../../dist-CcfanEqn.mjs";
1
+ import { Ea as preconditionOf, Gc as defineAddonMigrations, Gi as logDestinationCapability, Ks as BaseAddon } from "../../dist-DemZNuSJ.mjs";
2
2
  import { t as formatLogLine } from "../../formatter-DkYZ4LXp.mjs";
3
3
  import { a as LogFileIndexStore, i as serveRead, n as isFromReader, t as CancelBook } from "../../log-file-read-protocol-hTaAsYlX.mjs";
4
4
  import { createRequire } from "node:module";
@@ -1,4 +1,4 @@
1
- const require_dist = require("./dist-BghIT0F5.js");
1
+ const require_dist = require("./dist-Bh5JIimH.js");
2
2
  //#region src/builtins/device-history/store/series-registry.ts
3
3
  function subjectIdOf(subject) {
4
4
  return subject.kind === "device" ? `d:${subject.deviceId}` : `n:${subject.nodeId}`;
@@ -1,4 +1,4 @@
1
- import { Il as DeviceType, Kc as historyItemFieldPath, qs as HISTORY_DEFAULT_MIN_INTERVAL_MS } from "./dist-CcfanEqn.mjs";
1
+ import { Gl as DeviceType, nc as HISTORY_DEFAULT_MIN_INTERVAL_MS, tl as historyItemFieldPath } from "./dist-DemZNuSJ.mjs";
2
2
  //#region src/builtins/device-history/store/series-registry.ts
3
3
  function subjectIdOf(subject) {
4
4
  return subject.kind === "device" ? `d:${subject.deviceId}` : `n:${subject.nodeId}`;
@@ -1,4 +1,4 @@
1
- const require_dist = require("./dist-BghIT0F5.js");
1
+ const require_dist = require("./dist-Bh5JIimH.js");
2
2
  //#region src/builtins/shared/device-state-changed.ts
3
3
  /** Structural narrowing helper for untrusted bus payloads. */
4
4
  function isRecord(value) {
@@ -1,4 +1,4 @@
1
- import { Ll as errMsg, vs as compositionSourceKey } from "./dist-CcfanEqn.mjs";
1
+ import { Ds as compositionSourceKey, Kl as errMsg } from "./dist-DemZNuSJ.mjs";
2
2
  //#region src/builtins/shared/device-state-changed.ts
3
3
  /** Structural narrowing helper for untrusted bus payloads. */
4
4
  function isRecord(value) {
@@ -1,4 +1,4 @@
1
- import { Dc as buildSecretRef } from "./dist-CcfanEqn.mjs";
1
+ import { Ic as buildSecretRef } from "./dist-DemZNuSJ.mjs";
2
2
  /** `secret://system/global/meshCaKey` — EC P-256 PKCS#8 PEM of the hub mesh CA. */
3
3
  var MESH_CA_KEY_REF = buildSecretRef({
4
4
  owner: "system",
@@ -1,5 +1,5 @@
1
1
  /** `secret://system/global/meshCaKey` — EC P-256 PKCS#8 PEM of the hub mesh CA. */
2
- var MESH_CA_KEY_REF = require("./dist-BghIT0F5.js").buildSecretRef({
2
+ var MESH_CA_KEY_REF = require("./dist-Bh5JIimH.js").buildSecretRef({
3
3
  owner: "system",
4
4
  scope: { kind: "global" },
5
5
  fieldPath: "meshCaKey"
@@ -1,4 +1,4 @@
1
- const require_dist = require("./dist-BghIT0F5.js");
1
+ const require_dist = require("./dist-Bh5JIimH.js");
2
2
  const require_x509_es = require("./x509.es-WtnRNyYS.js");
3
3
  let node_crypto = require("node:crypto");
4
4
  //#region src/auth/jwt-signing-key.ts
@@ -1,4 +1,4 @@
1
- import { Dc as buildSecretRef, K as DEVICE_SAN_CREDENTIAL_PREFIX, q as DEVICE_SAN_USER_PREFIX } from "./dist-CcfanEqn.mjs";
1
+ import { Ic as buildSecretRef, K as DEVICE_SAN_CREDENTIAL_PREFIX, q as DEVICE_SAN_USER_PREFIX } from "./dist-DemZNuSJ.mjs";
2
2
  import { C as backdatedNotBefore, S as withUtcTimeEncoding, a as KeyUsageFlags, d as SubjectKeyIdentifierExtension, f as X509Certificate$1, m as cryptoProvider, n as BasicConstraintsExtension, o as KeyUsagesExtension, p as X509CertificateGenerator, r as ExtendedKeyUsageExtension, s as PemConverter, t as AuthorityKeyIdentifierExtension, u as SubjectAlternativeNameExtension } from "./x509.es-BRiJgOvu.mjs";
3
3
  import { X509Certificate, createPublicKey, randomBytes, verify, webcrypto } from "node:crypto";
4
4
  //#region src/auth/jwt-signing-key.ts
@@ -1,5 +1,5 @@
1
1
  require("./chunk-Cek0wNdY.js");
2
- const require_template_protocol = require("./template-protocol-DRZ4cm95.js");
2
+ const require_template_protocol = require("./template-protocol-D5ogm1rj.js");
3
3
  let node_worker_threads = require("node:worker_threads");
4
4
  let _camstack_types_units_lean = require("@camstack/types/units-lean");
5
5
  //#region src/builtins/device-manager/device-template/template-filters.ts
@@ -208,9 +208,27 @@ function makePrinter(unavailable) {
208
208
  * Lean by design (D453): no value import from `@camstack/types`'s barrel; the
209
209
  * limits arrive in `workerData`.
210
210
  */
211
+ function isRecord(value) {
212
+ return typeof value === "object" && value !== null && !Array.isArray(value);
213
+ }
211
214
  function isWorkerData(value) {
212
215
  if (typeof value !== "object" || value === null) return false;
213
- return Array.isArray(Reflect.get(value, "allowedFilters")) && typeof Reflect.get(value, "maxSourceLength") === "number" && typeof Reflect.get(value, "maxOutput") === "number" && typeof Reflect.get(value, "unavailable") === "string";
216
+ return Array.isArray(Reflect.get(value, "allowedFilters")) && isRecord(Reflect.get(value, "filterMaxParams")) && Array.isArray(Reflect.get(value, "callableBounds")) && typeof Reflect.get(value, "maxSourceLength") === "number" && typeof Reflect.get(value, "maxOutput") === "number" && typeof Reflect.get(value, "unavailable") === "string";
217
+ }
218
+ function boundsOf(value) {
219
+ const out = [];
220
+ for (const item of value) {
221
+ if (!isRecord(item)) continue;
222
+ const name = item["name"];
223
+ const min = item["min"];
224
+ const max = item["max"];
225
+ if (typeof name === "string" && typeof min === "number" && typeof max === "number") out.push({
226
+ name,
227
+ min,
228
+ max
229
+ });
230
+ }
231
+ return out;
214
232
  }
215
233
  function stringsOf(value) {
216
234
  return value.filter((item) => typeof item === "string");
@@ -274,7 +292,10 @@ function environmentFor(nowMs, printer) {
274
292
  });
275
293
  }
276
294
  function renderInWorker(request, limits) {
277
- const analysis = require_template_protocol.analyzeTemplate(request.source, limits.allowedFilters, limits.maxSourceLength);
295
+ const analysis = require_template_protocol.analyzeTemplate(request.source, limits.allowedFilters, limits.maxSourceLength, {
296
+ filterMaxParams: limits.filterMaxParams,
297
+ callableBounds: boundsOf(limits.callableBounds)
298
+ });
278
299
  if (!analysis.ok) return {
279
300
  id: request.id,
280
301
  ok: false,
@@ -309,6 +330,8 @@ if (node_worker_threads.parentPort !== null && isWorkerData(node_worker_threads.
309
330
  const port = node_worker_threads.parentPort;
310
331
  const limits = {
311
332
  allowedFilters: stringsOf(node_worker_threads.workerData.allowedFilters),
333
+ filterMaxParams: node_worker_threads.workerData.filterMaxParams,
334
+ callableBounds: boundsOf(node_worker_threads.workerData.callableBounds),
312
335
  maxSourceLength: node_worker_threads.workerData.maxSourceLength,
313
336
  maxOutput: node_worker_threads.workerData.maxOutput,
314
337
  unavailable: node_worker_threads.workerData.unavailable
@@ -1,4 +1,4 @@
1
- import { i as createTemplateEnvironment, r as analyzeTemplate, t as isRenderRequest } from "./template-protocol-D_6uVHKs.mjs";
1
+ import { i as createTemplateEnvironment, r as analyzeTemplate, t as isRenderRequest } from "./template-protocol-SgPDx3Hw.mjs";
2
2
  import { parentPort, workerData } from "node:worker_threads";
3
3
  import { tryConvertUnit } from "@camstack/types/units-lean";
4
4
  //#region src/builtins/device-manager/device-template/template-filters.ts
@@ -207,9 +207,27 @@ function makePrinter(unavailable) {
207
207
  * Lean by design (D453): no value import from `@camstack/types`'s barrel; the
208
208
  * limits arrive in `workerData`.
209
209
  */
210
+ function isRecord(value) {
211
+ return typeof value === "object" && value !== null && !Array.isArray(value);
212
+ }
210
213
  function isWorkerData(value) {
211
214
  if (typeof value !== "object" || value === null) return false;
212
- return Array.isArray(Reflect.get(value, "allowedFilters")) && typeof Reflect.get(value, "maxSourceLength") === "number" && typeof Reflect.get(value, "maxOutput") === "number" && typeof Reflect.get(value, "unavailable") === "string";
215
+ return Array.isArray(Reflect.get(value, "allowedFilters")) && isRecord(Reflect.get(value, "filterMaxParams")) && Array.isArray(Reflect.get(value, "callableBounds")) && typeof Reflect.get(value, "maxSourceLength") === "number" && typeof Reflect.get(value, "maxOutput") === "number" && typeof Reflect.get(value, "unavailable") === "string";
216
+ }
217
+ function boundsOf(value) {
218
+ const out = [];
219
+ for (const item of value) {
220
+ if (!isRecord(item)) continue;
221
+ const name = item["name"];
222
+ const min = item["min"];
223
+ const max = item["max"];
224
+ if (typeof name === "string" && typeof min === "number" && typeof max === "number") out.push({
225
+ name,
226
+ min,
227
+ max
228
+ });
229
+ }
230
+ return out;
213
231
  }
214
232
  function stringsOf(value) {
215
233
  return value.filter((item) => typeof item === "string");
@@ -273,7 +291,10 @@ function environmentFor(nowMs, printer) {
273
291
  });
274
292
  }
275
293
  function renderInWorker(request, limits) {
276
- const analysis = analyzeTemplate(request.source, limits.allowedFilters, limits.maxSourceLength);
294
+ const analysis = analyzeTemplate(request.source, limits.allowedFilters, limits.maxSourceLength, {
295
+ filterMaxParams: limits.filterMaxParams,
296
+ callableBounds: boundsOf(limits.callableBounds)
297
+ });
277
298
  if (!analysis.ok) return {
278
299
  id: request.id,
279
300
  ok: false,
@@ -308,6 +329,8 @@ if (parentPort !== null && isWorkerData(workerData)) {
308
329
  const port = parentPort;
309
330
  const limits = {
310
331
  allowedFilters: stringsOf(workerData.allowedFilters),
332
+ filterMaxParams: workerData.filterMaxParams,
333
+ callableBounds: boundsOf(workerData.callableBounds),
311
334
  maxSourceLength: workerData.maxSourceLength,
312
335
  maxOutput: workerData.maxOutput,
313
336
  unavailable: workerData.unavailable