@camstack/system 1.2.423 → 1.2.425

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 (97) 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/autotrack/index.js +1 -1
  8. package/dist/builtins/autotrack/index.mjs +1 -1
  9. package/dist/builtins/backup-orchestrator/backup-databases.d.ts +51 -0
  10. package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.d.ts +13 -0
  11. package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +248 -17
  12. package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +248 -17
  13. package/dist/builtins/backup-orchestrator/manifest-store.d.ts +23 -3
  14. package/dist/builtins/backup-orchestrator/run-queue.d.ts +3 -0
  15. package/dist/builtins/backup-orchestrator/schedule-store.d.ts +7 -1
  16. package/dist/builtins/backup-orchestrator/seed-marker-store.d.ts +34 -0
  17. package/dist/builtins/calendars/calendars.addon.js +1 -1
  18. package/dist/builtins/calendars/calendars.addon.mjs +1 -1
  19. package/dist/builtins/camera-grid/index.js +1 -1
  20. package/dist/builtins/camera-grid/index.mjs +1 -1
  21. package/dist/builtins/composer/composer.addon.js +2 -2
  22. package/dist/builtins/composer/composer.addon.mjs +2 -2
  23. package/dist/builtins/console-logging/index.js +1 -1
  24. package/dist/builtins/console-logging/index.mjs +1 -1
  25. package/dist/builtins/core-blocks/core-blocks.addon.js +2 -2
  26. package/dist/builtins/core-blocks/core-blocks.addon.mjs +2 -2
  27. package/dist/builtins/device-manager/device-manager.addon.js +2 -2
  28. package/dist/builtins/device-manager/device-manager.addon.mjs +2 -2
  29. package/dist/builtins/hub-forwarder/index.js +1 -1
  30. package/dist/builtins/hub-forwarder/index.mjs +1 -1
  31. package/dist/builtins/keychain/index.js +3 -3
  32. package/dist/builtins/keychain/index.mjs +3 -3
  33. package/dist/builtins/liveness-monitor/liveness-monitor.addon.js +1 -1
  34. package/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +1 -1
  35. package/dist/builtins/local-auth/local-auth.addon.js +2 -2
  36. package/dist/builtins/local-auth/local-auth.addon.mjs +2 -2
  37. package/dist/builtins/local-network/local-network.addon.js +1 -1
  38. package/dist/builtins/local-network/local-network.addon.mjs +1 -1
  39. package/dist/builtins/loki-logging/index.js +1 -1
  40. package/dist/builtins/loki-logging/index.mjs +1 -1
  41. package/dist/builtins/native-metrics/native-metrics.addon.js +1 -1
  42. package/dist/builtins/native-metrics/native-metrics.addon.mjs +1 -1
  43. package/dist/builtins/platform-probe/index.js +1 -1
  44. package/dist/builtins/platform-probe/index.mjs +1 -1
  45. package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
  46. package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
  47. package/dist/builtins/snapshot/index.js +1 -1
  48. package/dist/builtins/snapshot/index.mjs +1 -1
  49. package/dist/builtins/sqlite-storage/database-snapshot-provider.d.ts +18 -0
  50. package/dist/builtins/sqlite-storage/file-host-client.d.ts +59 -0
  51. package/dist/builtins/sqlite-storage/file-host-handlers.d.ts +23 -0
  52. package/dist/builtins/sqlite-storage/file-host-protocol.d.ts +151 -0
  53. package/dist/builtins/sqlite-storage/file-host-worker.d.ts +1 -0
  54. package/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
  55. package/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +1 -1
  56. package/dist/builtins/sqlite-storage/index.js +21 -20
  57. package/dist/builtins/sqlite-storage/index.mjs +2 -1
  58. package/dist/builtins/sqlite-storage/owned-sqlite-file.d.ts +136 -0
  59. package/dist/builtins/sqlite-storage/placement-errors.d.ts +60 -0
  60. package/dist/builtins/sqlite-storage/placement-router.d.ts +80 -0
  61. package/dist/builtins/sqlite-storage/retired-collections.d.ts +7 -0
  62. package/dist/builtins/sqlite-storage/sqlite-settings-backend.d.ts +68 -8
  63. package/dist/builtins/sqlite-storage/sqlite-settings.addon.d.ts +23 -26
  64. package/dist/builtins/sqlite-storage/sqlite-settings.addon.js +0 -0
  65. package/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +0 -0
  66. package/dist/builtins/sqlite-storage/vector-provider.d.ts +24 -0
  67. package/dist/builtins/sqlite-storage/wal-maintenance.d.ts +17 -0
  68. package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +3 -1
  69. package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +3 -1
  70. package/dist/builtins/system-backup/system-backup.service.d.ts +48 -15
  71. package/dist/builtins/system-config/system-config.addon.js +2 -2
  72. package/dist/builtins/system-config/system-config.addon.mjs +2 -2
  73. package/dist/builtins/winston-logging/index.js +1 -1
  74. package/dist/builtins/winston-logging/index.mjs +1 -1
  75. package/dist/{composition-sources-CgiAeG-2.js → composition-sources-197keifF.js} +1 -1
  76. package/dist/{composition-sources-BXDchWFn.mjs → composition-sources-DmzTSy26.mjs} +1 -1
  77. package/dist/{constants-1_7QtPNo.js → constants-B5Jd8Zch.js} +1 -1
  78. package/dist/{constants-C2dhkIuF.mjs → constants-CkNLi-XW.mjs} +1 -1
  79. package/dist/{dist-DimotS8e.mjs → dist-DMWeqeTF.mjs} +863 -750
  80. package/dist/{dist-VIIxVsBW.js → dist-DnALrQF-.js} +866 -747
  81. package/dist/file-host-worker.js +144 -0
  82. package/dist/file-host-worker.mjs +144 -0
  83. package/dist/index.js +9 -8
  84. package/dist/index.mjs +6 -5
  85. package/dist/{jwt-signing-key-C8nMdNYW.mjs → jwt-signing-key-CCHXAtrs.mjs} +1 -1
  86. package/dist/{jwt-signing-key-C8s9syVg.js → jwt-signing-key-DeqG7LD9.js} +1 -1
  87. package/dist/{restore-archive-DjppfrIB.js → restore-archive-C4UhQOsg.js} +156 -65
  88. package/dist/{restore-archive-bOMZwY0D.mjs → restore-archive-GevpOHw8.mjs} +151 -66
  89. package/dist/{retired-settings-keys-_muTvNyh.js → retired-settings-keys-0FOsnzIE.js} +1 -1
  90. package/dist/{retired-settings-keys-BYnjMBE-.mjs → retired-settings-keys-CdVFl7m2.mjs} +1 -1
  91. package/dist/sqlite-snapshot-worker.js +1 -1
  92. package/dist/sqlite-snapshot-worker.mjs +1 -1
  93. package/dist/wal-checkpoint-worker.js +1 -1
  94. package/dist/wal-checkpoint-worker.mjs +1 -1
  95. package/dist/wal-maintenance-BtfyfuT5.mjs +0 -0
  96. package/dist/wal-maintenance-DJV1rde2.js +0 -0
  97. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- import { type ArchiveSqliteSnapshot, type DatabaseSnapshotResult, type IScopedLogger } from "@camstack/types";
1
+ import { type ArchiveSqliteSnapshot, type DatabaseSnapshotWritten, type DataStoreDatabase, type IScopedLogger } from "@camstack/types";
2
2
  import { BACKUP_ENCRYPTION_SCHEME } from "./backup-encryption.js";
3
3
  /**
4
4
  * Thrown when an archive build (or a backup run driving one) is
@@ -58,10 +58,21 @@ export declare function isExcludedFromBackup(relPath: string): boolean;
58
58
  * the `database-snapshot` capability, pinned to its own node.
59
59
  */
60
60
  export interface DatabaseOwner {
61
- /** Absolute paths of the databases the owner snapshots. */
62
- listDatabases(): Promise<readonly string[]>;
63
- writeSnapshot(): Promise<DatabaseSnapshotResult>;
61
+ /** EVERY database the owner has open: its id, and its absolute path. */
62
+ listDatabases(): Promise<readonly OwnedDatabase[]>;
63
+ /** One verified snapshot of ONE database. */
64
+ writeSnapshot(databaseId: DataStoreDatabase): Promise<DatabaseSnapshotWritten>;
64
65
  }
66
+ /** One database file the owner serves. */
67
+ export interface OwnedDatabase {
68
+ readonly databaseId: DataStoreDatabase;
69
+ readonly livePath: string;
70
+ }
71
+ /**
72
+ * The databases a run carries when it states none: the minimum (D382). A
73
+ * schedule, a manual run and `createArchive` all fall back to this one value.
74
+ */
75
+ export declare const DEFAULT_BACKUP_DATABASES: readonly DataStoreDatabase[];
65
76
  /** Path of the manifest file embedded inside every archive. */
66
77
  export declare const ARCHIVE_MANIFEST_NAME = ".camstack-backup-manifest.json";
67
78
  export type ArchiveEntryKind = "file" | "dir" | "symlink";
@@ -94,6 +105,12 @@ export interface ArchiveManifest {
94
105
  * files (D693). Paths are archive-relative.
95
106
  */
96
107
  sqliteSnapshots?: ArchiveSqliteSnapshot[];
108
+ /**
109
+ * Owned databases this run did NOT select: left out of the tar and of
110
+ * `entries` alike (a live file is never carried anyway). Absent when the
111
+ * run carried every owned database it found.
112
+ */
113
+ omittedDatabases?: DataStoreDatabase[];
97
114
  }
98
115
  /** How an archive was encrypted — absent on a plain `.tar.gz`. */
99
116
  export interface ArchiveEncryption {
@@ -207,6 +224,12 @@ export declare class SystemBackupService {
207
224
  */
208
225
  owner?: DatabaseOwner;
209
226
  /**
227
+ * Which owned databases this run carries as snapshots; the others are left
228
+ * out and listed in `manifest.omittedDatabases`. Absent = `['settings']`
229
+ * ({@link DEFAULT_BACKUP_DATABASES}): an unstated ask is the minimum.
230
+ */
231
+ databases?: readonly DataStoreDatabase[];
232
+ /**
210
233
  * A backup PUBLIC key: the gzip stream is encrypted to it as it is
211
234
  * written, so no plaintext archive ever touches the staging disk. Parsed
212
235
  * before any work — a bad key builds nothing.
@@ -214,6 +237,13 @@ export declare class SystemBackupService {
214
237
  encryptTo?: string;
215
238
  }): Promise<CreateArchiveResult>;
216
239
  /**
240
+ * An archive of the selected databases' owner snapshots and the manifest —
241
+ * no data-root walk, no location, no settings (D852). Refused when the owner
242
+ * has none of the selected files: an archive of nothing must reach no
243
+ * destination, because its upload prunes an older archive that has them.
244
+ */
245
+ private createSnapshotsOnlyArchive;
246
+ /**
217
247
  * Tar `present` (filtered by `excluded`) plus the staged manifest into
218
248
  * `archivePath`.
219
249
  */
@@ -240,20 +270,22 @@ export declare class SystemBackupService {
240
270
  /** Drop the marker after a successful boot-time restore. */
241
271
  clearPendingMarker(): void;
242
272
  /**
243
- * The databases the owner declares, archive-relative, that this walk found.
244
- * One outside this data root is not in scope. An owner that cannot answer
245
- * stops the archive: without the answer, nothing says which file is live.
273
+ * The databases the owner declares, archive-relative, that this walk found,
274
+ * with the id of each. One outside this data root is not in scope. An owner
275
+ * that cannot answer stops the archive: without the answer, nothing says
276
+ * which file is live.
246
277
  */
247
278
  private ownedDatabasesInScope;
248
279
  /**
249
- * Ask the owner for its snapshot, and place it in this archive. The snapshot
250
- * must sit on THIS data root — the call is pinned to this node, so a path
251
- * elsewhere means it reached another host, and that file is not ours to
252
- * read — beside an owned database in scope, and it must cover EVERY owned
253
- * database in scope. Anything else is refused.
280
+ * Ask the owner for one verified snapshot per SELECTED database, one after
281
+ * the other, and place each in this archive. A snapshot must sit on THIS data
282
+ * root — the call is pinned to this node, so a path elsewhere means it
283
+ * reached another host, and that file is not ours to read — beside the very
284
+ * database it was asked for. Anything else is refused, and the run builds
285
+ * nothing: the copies already taken are removed.
254
286
  *
255
- * Only ever DELETED here: `<owned db>.backup-snapshot` under this data root,
256
- * a name this process derives itself. A path the owner ANSWERS is never
287
+ * Only ever DELETED here: `<selected db>.backup-snapshot` under this data
288
+ * root, a name this process derives itself. A path the owner ANSWERS is never
257
289
  * deleted on its word — answering the live database as the snapshot would
258
290
  * otherwise delete the live database. A file at any other path is left to
259
291
  * the owner's own sweep.
@@ -261,7 +293,8 @@ export declare class SystemBackupService {
261
293
  * A cancel is honoured while the owner is still copying; the copy it may
262
294
  * finish afterwards is removed when that call settles.
263
295
  */
264
- private takeOwnerSnapshot;
296
+ private takeOwnerSnapshots;
297
+ private takeOneSnapshot;
265
298
  private removeSnapshot;
266
299
  /** `abs` relative to the data root, or null when it lies outside it. */
267
300
  private archiveRelative;
@@ -3,9 +3,9 @@ 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-VIIxVsBW.js");
6
+ const require_dist = require("../../dist-DnALrQF-.js");
7
7
  const require_safe_buffer$1 = require("../../safe-buffer-D3aoa-7X.js");
8
- const require_constants$8 = require("../../constants-1_7QtPNo.js");
8
+ const require_constants$8 = require("../../constants-B5Jd8Zch.js");
9
9
  const require_x509_es = require("../../x509.es-Dzl0BbmG.js");
10
10
  const require_src$1 = require("../../src-CnAqG6EF.js");
11
11
  let zod = require("zod");
@@ -1,7 +1,7 @@
1
1
  import { a as __toCommonJS, i as __require, n as __esmMin, o as __toESM, r as __exportAll, t as __commonJSMin } from "../../chunk-CNf5ZN-e.mjs";
2
- import { $r as transformSecretWrite, Er as defineCustomActions, Fr as isSecretClear, Ir as isSecretMarker, Rr as makeSecretMarker, Tr as customAction, Yr as secretTreeFromSchema, cr as BaseAddon, jr as hydrateSchema, sr as errMsg } from "../../dist-DimotS8e.mjs";
2
+ import { Dr as defineCustomActions, Er as customAction, Ir as isSecretClear, Lr as isSecretMarker, Mr as hydrateSchema, Xr as secretTreeFromSchema, cr as errMsg, ei as transformSecretWrite, lr as BaseAddon, zr as makeSecretMarker } from "../../dist-DMWeqeTF.mjs";
3
3
  import { t as require_safe_buffer } from "../../safe-buffer-B1OjL1I9.mjs";
4
- import { a as MESH_CA_KEY_REF, b as setProcessClusterSecretGate, c as MESH_JOIN_TOKEN_MAX_TTL_SEC, d as CLUSTER_SECRET_REF, i as MESH_CA_FIELD, l as SERVER_AUTH_OID, n as DEFAULT_HUB_TLS_TCP_PORT, o as MESH_CA_SETTINGS_KEY, r as MESH_CA_COMMON_NAME, s as MESH_CA_VALIDITY_DAYS, t as CLIENT_AUTH_OID, v as hashClusterSecret } from "../../constants-C2dhkIuF.mjs";
4
+ import { a as MESH_CA_KEY_REF, b as setProcessClusterSecretGate, c as MESH_JOIN_TOKEN_MAX_TTL_SEC, d as CLUSTER_SECRET_REF, i as MESH_CA_FIELD, l as SERVER_AUTH_OID, n as DEFAULT_HUB_TLS_TCP_PORT, o as MESH_CA_SETTINGS_KEY, r as MESH_CA_COMMON_NAME, s as MESH_CA_VALIDITY_DAYS, t as CLIENT_AUTH_OID, v as hashClusterSecret } from "../../constants-CkNLi-XW.mjs";
5
5
  import { a as KeyUsagesExtension, c as Pkcs10CertificateRequestGenerator, d as X509Certificate$1, f as X509CertificateGenerator, i as KeyUsageFlags, n as BasicConstraintsExtension, o as PemConverter, p as cryptoProvider, r as ExtendedKeyUsageExtension, s as Pkcs10CertificateRequest, t as AuthorityKeyIdentifierExtension, u as SubjectKeyIdentifierExtension } from "../../x509.es-CAjSsrkk.mjs";
6
6
  import { t as require_src } from "../../src-hG4grMU4.mjs";
7
7
  import { z } from "zod";
@@ -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-VIIxVsBW.js");
6
+ const require_dist = require("../../dist-DnALrQF-.js");
7
7
  const require_formatter = require("../../formatter-DqAKDlvN.js");
8
8
  let node_path = require("node:path");
9
9
  node_path = require_chunk.__toESM(node_path);
@@ -1,4 +1,4 @@
1
- import { Xt as logDestinationCapability, cr as BaseAddon } from "../../dist-DimotS8e.mjs";
1
+ import { Zt as logDestinationCapability, lr as BaseAddon } from "../../dist-DMWeqeTF.mjs";
2
2
  import { t as formatLogLine } from "../../formatter-B7qW8bPJ.mjs";
3
3
  import * as path$1 from "node:path";
4
4
  import path from "node:path";
@@ -1,4 +1,4 @@
1
- const require_dist = require("./dist-VIIxVsBW.js");
1
+ const require_dist = require("./dist-DnALrQF-.js");
2
2
  //#region src/builtins/core-blocks/composition-sources.ts
3
3
  /**
4
4
  * Describe what a composition reads and writes for SAVE-time validation
@@ -1,4 +1,4 @@
1
- import { er as compositionSourceKey, sr as errMsg } from "./dist-DimotS8e.mjs";
1
+ import { cr as errMsg, tr as compositionSourceKey } from "./dist-DMWeqeTF.mjs";
2
2
  //#region src/builtins/core-blocks/composition-sources.ts
3
3
  /**
4
4
  * Describe what a composition reads and writes for SAVE-time validation
@@ -1,4 +1,4 @@
1
- const require_dist = require("./dist-VIIxVsBW.js");
1
+ const require_dist = require("./dist-DnALrQF-.js");
2
2
  let node_crypto = require("node:crypto");
3
3
  //#region src/kernel/moleculer/cluster-secret.ts
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { xr as buildSecretRef } from "./dist-DimotS8e.mjs";
1
+ import { Sr as buildSecretRef } from "./dist-DMWeqeTF.mjs";
2
2
  import { createHash, timingSafeEqual } from "node:crypto";
3
3
  //#region src/kernel/moleculer/cluster-secret.ts
4
4
  /**