@camstack/system 1.2.200 → 1.2.201

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 (54) hide show
  1. package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +1 -1
  2. package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +1 -1
  3. package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
  4. package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +1 -1
  5. package/dist/builtins/alerts/alerts.addon.js +1 -1
  6. package/dist/builtins/alerts/alerts.addon.mjs +1 -1
  7. package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.d.ts +38 -9
  8. package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +234 -81
  9. package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +234 -81
  10. package/dist/builtins/backup-orchestrator/destination-policy.d.ts +32 -14
  11. package/dist/builtins/backup-orchestrator/schedule-store.d.ts +12 -2
  12. package/dist/builtins/console-logging/index.js +1 -1
  13. package/dist/builtins/console-logging/index.mjs +1 -1
  14. package/dist/builtins/core-blocks/core-blocks.addon.js +1 -1
  15. package/dist/builtins/core-blocks/core-blocks.addon.mjs +1 -1
  16. package/dist/builtins/device-manager/device-manager.addon.js +2 -2
  17. package/dist/builtins/device-manager/device-manager.addon.mjs +2 -2
  18. package/dist/builtins/doorbell/virtual-doorbell.addon.js +1 -1
  19. package/dist/builtins/doorbell/virtual-doorbell.addon.mjs +1 -1
  20. package/dist/builtins/hub-forwarder/index.js +1 -1
  21. package/dist/builtins/hub-forwarder/index.mjs +1 -1
  22. package/dist/builtins/liveness-monitor/liveness-monitor.addon.js +1 -1
  23. package/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +1 -1
  24. package/dist/builtins/local-auth/local-auth.addon.js +1 -1
  25. package/dist/builtins/local-auth/local-auth.addon.mjs +1 -1
  26. package/dist/builtins/local-network/local-network.addon.js +1 -1
  27. package/dist/builtins/local-network/local-network.addon.mjs +1 -1
  28. package/dist/builtins/loki-logging/index.js +1 -1
  29. package/dist/builtins/loki-logging/index.mjs +1 -1
  30. package/dist/builtins/native-metrics/native-metrics.addon.js +1 -1
  31. package/dist/builtins/native-metrics/native-metrics.addon.mjs +1 -1
  32. package/dist/builtins/platform-probe/index.js +1 -1
  33. package/dist/builtins/platform-probe/index.mjs +1 -1
  34. package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
  35. package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
  36. package/dist/builtins/snapshot/index.js +1 -1
  37. package/dist/builtins/snapshot/index.mjs +1 -1
  38. package/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
  39. package/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +1 -1
  40. package/dist/builtins/sqlite-storage/sqlite-settings.addon.js +0 -0
  41. package/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +0 -0
  42. package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +1 -1
  43. package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +1 -1
  44. package/dist/builtins/system-config/system-config.addon.js +1 -1
  45. package/dist/builtins/system-config/system-config.addon.mjs +1 -1
  46. package/dist/builtins/winston-logging/index.js +1 -1
  47. package/dist/builtins/winston-logging/index.mjs +1 -1
  48. package/dist/{dist-CCp74QLJ.mjs → dist-BmJNnb_s.mjs} +33 -14
  49. package/dist/{dist-KQ5D2wqr.js → dist-CcV3k-hD.js} +33 -14
  50. package/dist/index.js +1 -1
  51. package/dist/index.mjs +1 -1
  52. package/dist/{retired-settings-keys-2lWk7OeU.js → retired-settings-keys-Bd8fuwO1.js} +1 -1
  53. package/dist/{retired-settings-keys-7P9XwNdl.mjs → retired-settings-keys-nLVKlhe-.mjs} +1 -1
  54. package/package.json +1 -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-KQ5D2wqr.js");
6
+ const require_dist = require("../../dist-CcV3k-hD.js");
7
7
  const require_settle_sources = require("../../settle-sources-Bhsy57y-.js");
8
8
  let node_crypto = require("node:crypto");
9
9
  let node_path = require("node:path");
@@ -1,4 +1,4 @@
1
- import { D as addonPagesCapability, Ft as errMsg, It as BaseAddon, cn as EventCategory } from "../../dist-CCp74QLJ.mjs";
1
+ import { D as addonPagesCapability, Ft as errMsg, It as BaseAddon, cn as EventCategory } from "../../dist-BmJNnb_s.mjs";
2
2
  import { t as settleSourcesWithTimeout } from "../../settle-sources-CDtNC8ub.mjs";
3
3
  import { createHash, randomUUID } from "node:crypto";
4
4
  import * as path$1 from "node:path";
@@ -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-KQ5D2wqr.js");
6
+ const require_dist = require("../../dist-CcV3k-hD.js");
7
7
  const require_settle_sources = require("../../settle-sources-Bhsy57y-.js");
8
8
  let node_crypto = require("node:crypto");
9
9
  let node_path = require("node:path");
@@ -1,4 +1,4 @@
1
- import { Ft as errMsg, It as BaseAddon, cn as EventCategory, k as addonWidgetsCapability } from "../../dist-CCp74QLJ.mjs";
1
+ import { Ft as errMsg, It as BaseAddon, cn as EventCategory, k as addonWidgetsCapability } from "../../dist-BmJNnb_s.mjs";
2
2
  import { t as settleSourcesWithTimeout } from "../../settle-sources-CDtNC8ub.mjs";
3
3
  import { createHash, randomUUID } from "node:crypto";
4
4
  import * as path$1 from "node:path";
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  require("../../chunk-Cek0wNdY.js");
6
- const require_dist = require("../../dist-KQ5D2wqr.js");
6
+ const require_dist = require("../../dist-CcV3k-hD.js");
7
7
  //#region src/builtins/alerts/prune-policy.ts
8
8
  /**
9
9
  * Ids older than `cutoffMs`, oldest first.
@@ -1,4 +1,4 @@
1
- import { A as alertsCapability, Ft as errMsg, It as BaseAddon, Yt as createEvent, cn as EventCategory, n as AlertSchema } from "../../dist-CCp74QLJ.mjs";
1
+ import { A as alertsCapability, Ft as errMsg, It as BaseAddon, Yt as createEvent, cn as EventCategory, n as AlertSchema } from "../../dist-BmJNnb_s.mjs";
2
2
  //#region src/builtins/alerts/prune-policy.ts
3
3
  /**
4
4
  * Ids older than `cutoffMs`, oldest first.
@@ -16,9 +16,11 @@ export declare class BackupOrchestratorAddon extends BaseAddon<Record<string, ne
16
16
  */
17
17
  private stagingDir;
18
18
  private scheduleTimer;
19
+ /** Guards the disarmed-scheduler complaint to once per process. */
20
+ private warnedSchedulerDisarmed;
19
21
  /**
20
- * Baseline used as the "after" anchor when a policy has a cron but
21
- * has never run yet (no `lastRunAt`). Set on orchestrator boot so a
22
+ * Baseline used as the "after" anchor when a schedule has a cron but
23
+ * has never fired yet (no `lastAttemptAt`). Set on orchestrator boot so a
22
24
  * pattern that fires every minute doesn't immediately replay every
23
25
  * historical "missed" run from epoch 0.
24
26
  */
@@ -44,6 +46,13 @@ export declare class BackupOrchestratorAddon extends BaseAddon<Record<string, ne
44
46
  * policies are preserved by the `ensureDefault` idempotency.
45
47
  */
46
48
  private listDestinations;
49
+ /**
50
+ * Join the enabled schedules by the locations they fan out to.
51
+ * Comma-joined crons (a location can be targeted by several schedules),
52
+ * earliest next firing. Computed from `Date.now()` — an operator asking
53
+ * "when next" means from now, never from a stale run cursor.
54
+ */
55
+ private cadenceByLocation;
47
56
  private fetchBackupLocations;
48
57
  /**
49
58
  * Load every persisted policy and key it by `locationId`, while
@@ -134,14 +143,15 @@ export declare class BackupOrchestratorAddon extends BaseAddon<Record<string, ne
134
143
  /**
135
144
  * Upsert the per-destination policy row. Used by the admin-UI
136
145
  * destinations table — toggle enabled / change retention / set
137
- * label / set cron schedule. No-ops with a logged warning if the
146
+ * label. No-ops with a logged warning if the
138
147
  * settings backend lacks structured-table support (no persistence
139
148
  * available).
140
149
  *
141
- * Validates `cron` server-side: a malformed expression rejects the
142
- * upsert with an actionable error so the operator sees the problem
143
- * at save time instead of at scheduler-tick time. Empty / undefined
144
- * `cron` clears any prior schedule (manual-only).
150
+ * There is deliberately NO cadence here. A destination does not run on
151
+ * its own timer — a schedule fans out to it — and the `cron` this method
152
+ * used to accept had scheduled nothing since 2026-07-28 while still being
153
+ * rendered as "daily at 03:00" (D384, and D62's "a switch that writes a
154
+ * store nobody reads").
145
155
  */
146
156
  private upsertDestinationPolicy;
147
157
  /**
@@ -178,23 +188,42 @@ export declare class BackupOrchestratorAddon extends BaseAddon<Record<string, ne
178
188
  * use for and which cost one round-trip per destination on every trigger.
179
189
  */
180
190
  private resolveTargets;
191
+ /**
192
+ * Persist the outcome of one attempted write to one destination.
193
+ *
194
+ * Best-effort by design: an unavailable settings backend must not turn a
195
+ * successful backup into a failed one. But it is LOGGED when it cannot be
196
+ * written — a status field that silently stops being updated is the whole
197
+ * defect this method exists to close.
198
+ */
199
+ private recordDestinationOutcome;
181
200
  private startScheduleTimer;
182
201
  private stopScheduleTimer;
183
202
  /**
184
203
  * Schedule-driven backup scheduling. Walks every enabled backup
185
204
  * SCHEDULE (the N:M entry), computes the next due time after
186
- * `lastRunAt` (or the orchestrator's first-tick baseline if never
205
+ * `lastAttemptAt` (or the orchestrator's first-tick baseline if never
187
206
  * run), and fires a SINGLE archive fanned out to ALL of the
188
207
  * schedule's `locationIds` when due — with the schedule's per-entry
189
208
  * retention applied to each. Each schedule keeps its own cadence.
190
209
  *
191
210
  * Errors per schedule are isolated; one misconfigured cron doesn't
192
- * block the others. The schedule's `lastRunAt` is updated BEFORE the
211
+ * block the others. The schedule's `lastAttemptAt` is updated BEFORE the
193
212
  * trigger to dedupe (the tick runs every SCHEDULE_TICK_MS — without
194
213
  * the up-front update a long-running upload could overlap with the
195
214
  * next tick's same-due check).
196
215
  */
197
216
  private onScheduleTick;
217
+ /**
218
+ * Fire one schedule and RECORD what happened to it, naming every
219
+ * destination. Three outcomes, three different persisted states —
220
+ * because "fired" and "backed up" were the same field until D384:
221
+ *
222
+ * - archive landed somewhere → `lastSuccessAt`, `lastError` cleared;
223
+ * - the run threw, or landed nowhere → `lastError`, no success stamp;
224
+ * - the stamp could not be written → logged, named, not swallowed.
225
+ */
226
+ private runScheduledBackup;
198
227
  private listSchedules;
199
228
  private upsertSchedule;
200
229
  private deleteSchedule;