@camstack/system 1.2.443 → 1.2.445
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/record-entries/icon.svg +8 -0
- package/dist/addon-runner.js +81 -42
- package/dist/addon-runner.mjs +82 -43
- package/dist/{agent-https-DlpTMDqA.js → agent-https-CiOW0-sj.js} +810 -12
- package/dist/{agent-https-U0d4uvn2.mjs → agent-https-D4Q8iFNd.mjs} +697 -13
- package/dist/auth/admin-token-manager.d.ts +9 -3
- package/dist/auth/api-key-manager.d.ts +9 -3
- package/dist/auth/auth-audit-log.d.ts +9 -3
- package/dist/auth/device-credential-manager.d.ts +5 -1
- package/dist/auth/external-identity-manager.d.ts +8 -21
- package/dist/auth/login-session-manager.d.ts +11 -3
- package/dist/auth/scoped-token-manager.d.ts +8 -52
- package/dist/auth/totp-manager.d.ts +11 -3
- package/dist/auth/user-manager.d.ts +10 -17
- package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +1 -1
- package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +1 -1
- package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
- package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +1 -1
- package/dist/builtins/alerts/alert-store.d.ts +32 -0
- package/dist/builtins/alerts/alerts.addon.d.ts +19 -4
- package/dist/builtins/alerts/alerts.addon.js +331 -159
- package/dist/builtins/alerts/alerts.addon.mjs +330 -159
- package/dist/builtins/alerts/record-kinds.d.ts +15 -0
- package/dist/builtins/autotrack/index.js +1 -1
- package/dist/builtins/autotrack/index.mjs +1 -1
- package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.d.ts +1 -0
- package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +134 -193
- package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +134 -193
- package/dist/builtins/backup-orchestrator/destination-policy.d.ts +4 -2
- package/dist/builtins/backup-orchestrator/encryption-key-store.d.ts +4 -2
- package/dist/builtins/backup-orchestrator/record-kinds.d.ts +58 -0
- package/dist/builtins/backup-orchestrator/schedule-store.d.ts +4 -2
- package/dist/builtins/backup-orchestrator/seed-marker-store.d.ts +4 -2
- package/dist/builtins/calendars/calendar-prefs-store.d.ts +13 -5
- package/dist/builtins/calendars/calendars.addon.d.ts +2 -2
- package/dist/builtins/calendars/calendars.addon.js +67 -64
- package/dist/builtins/calendars/calendars.addon.mjs +59 -64
- package/dist/builtins/calendars/record-kinds.d.ts +18 -0
- package/dist/builtins/camera-grid/index.js +1 -1
- package/dist/builtins/camera-grid/index.mjs +1 -1
- package/dist/builtins/cluster-agent/record-kinds.d.ts +36 -0
- package/dist/builtins/composer/composer.addon.js +2 -2
- package/dist/builtins/composer/composer.addon.mjs +2 -2
- package/dist/builtins/console-logging/index.js +1 -1
- package/dist/builtins/console-logging/index.mjs +1 -1
- package/dist/builtins/core-blocks/block-settings-store.d.ts +8 -4
- package/dist/builtins/core-blocks/core-block-store.d.ts +8 -16
- package/dist/builtins/core-blocks/core-blocks.addon.js +85 -112
- package/dist/builtins/core-blocks/core-blocks.addon.mjs +86 -113
- package/dist/builtins/core-blocks/index.mjs +1 -1
- package/dist/builtins/core-blocks/record-kinds.d.ts +26 -0
- package/dist/builtins/device-manager/device-manager.addon.js +111 -187
- package/dist/builtins/device-manager/device-manager.addon.mjs +110 -187
- package/dist/builtins/device-manager/device-tombstone-store.d.ts +9 -48
- package/dist/builtins/device-manager/record-kinds.d.ts +14 -0
- package/dist/builtins/hub-forwarder/index.js +1 -1
- package/dist/builtins/hub-forwarder/index.mjs +1 -1
- package/dist/builtins/keychain/index.js +152 -22
- package/dist/builtins/keychain/index.mjs +152 -22
- package/dist/builtins/keychain/keychain-service.d.ts +3 -2
- package/dist/builtins/keychain/keychain-store.d.ts +13 -2
- package/dist/builtins/keychain/record-kinds.d.ts +16 -0
- package/dist/builtins/liveness-monitor/liveness-monitor.addon.js +1 -1
- package/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +1 -1
- package/dist/builtins/local-auth/auth-schema.d.ts +3 -1
- package/dist/builtins/local-auth/local-auth.addon.js +2903 -2123
- package/dist/builtins/local-auth/local-auth.addon.mjs +2904 -2124
- package/dist/builtins/local-auth/oauth-session-manager.d.ts +8 -48
- package/dist/builtins/local-auth/record-kinds.d.ts +141 -0
- package/dist/builtins/local-network/local-network.addon.js +2 -2
- package/dist/builtins/local-network/local-network.addon.mjs +2 -2
- package/dist/builtins/loki-logging/index.js +1 -1
- package/dist/builtins/loki-logging/index.mjs +1 -1
- package/dist/builtins/native-metrics/native-metrics.addon.js +1 -1
- package/dist/builtins/native-metrics/native-metrics.addon.mjs +1 -1
- package/dist/builtins/platform-probe/index.js +1 -1
- package/dist/builtins/platform-probe/index.mjs +1 -1
- package/dist/builtins/record-entries/entries-service.d.ts +42 -0
- package/dist/builtins/record-entries/index.d.ts +1 -0
- package/dist/builtins/record-entries/index.js +142 -0
- package/dist/builtins/record-entries/index.mjs +136 -0
- package/dist/builtins/record-entries/record-entries.addon.d.ts +13 -0
- package/dist/builtins/records/legacy-table-row-count.d.ts +5 -0
- package/dist/builtins/records/phase6-declare-gate.d.ts +28 -0
- package/dist/builtins/records-isolated.d.ts +10 -0
- package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
- package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
- package/dist/builtins/snapshot/index.js +1 -1
- package/dist/builtins/snapshot/index.mjs +1 -1
- package/dist/builtins/sqlite-storage/file-host-client.d.ts +2 -0
- package/dist/builtins/sqlite-storage/file-host-handlers.d.ts +4 -0
- package/dist/builtins/sqlite-storage/file-host-protocol.d.ts +7 -1
- package/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
- package/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +1 -1
- package/dist/builtins/sqlite-storage/index.js +1 -1
- package/dist/builtins/sqlite-storage/index.mjs +1 -1
- package/dist/builtins/sqlite-storage/integration-record-kinds.d.ts +30 -0
- package/dist/builtins/sqlite-storage/integration-registry.d.ts +10 -16
- package/dist/builtins/sqlite-storage/owned-sqlite-file.d.ts +7 -0
- package/dist/builtins/sqlite-storage/placement-router.d.ts +5 -0
- package/dist/builtins/sqlite-storage/records/count-settings-array-legacy.d.ts +5 -0
- package/dist/builtins/sqlite-storage/records/count-settings-brokers-legacy.d.ts +6 -0
- package/dist/builtins/sqlite-storage/records/records-catalog.d.ts +29 -0
- package/dist/builtins/sqlite-storage/records/records-engine-types.d.ts +51 -0
- package/dist/builtins/sqlite-storage/records/records-engine.d.ts +94 -0
- package/dist/builtins/sqlite-storage/records/records-explain.d.ts +18 -0
- package/dist/builtins/sqlite-storage/records/records-plan.d.ts +90 -0
- package/dist/builtins/sqlite-storage/records/records-probe.d.ts +33 -0
- package/dist/builtins/sqlite-storage/records/records-provider.d.ts +63 -0
- package/dist/builtins/sqlite-storage/records/records-rows.d.ts +46 -0
- package/dist/builtins/sqlite-storage/records/records-sql.d.ts +41 -0
- package/dist/builtins/sqlite-storage/sqlite-settings-backend.d.ts +17 -10
- package/dist/builtins/sqlite-storage/sqlite-settings.addon.d.ts +8 -0
- package/dist/builtins/sqlite-storage/sqlite-settings.addon.js +446 -5
- package/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +446 -5
- package/dist/builtins/sqlite-storage/storage-admin-provider.d.ts +15 -1
- package/dist/builtins/storage-orchestrator/drain-state-store.d.ts +5 -2
- package/dist/builtins/storage-orchestrator/location-store.d.ts +7 -2
- package/dist/builtins/storage-orchestrator/record-kinds.d.ts +38 -0
- package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.d.ts +2 -0
- package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +196 -5
- package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +195 -6
- package/dist/builtins/system-config/record-kinds.d.ts +32 -0
- package/dist/builtins/system-config/system-config.addon.js +53 -618
- package/dist/builtins/system-config/system-config.addon.mjs +29 -577
- package/dist/builtins/winston-logging/index.js +1 -1
- package/dist/builtins/winston-logging/index.mjs +1 -1
- package/dist/{composition-sources-C8tUG2uL.mjs → composition-sources-BMt5cFYb.mjs} +1 -1
- package/dist/{composition-sources-BUXX1e8j.js → composition-sources-D3fi9Xns.js} +1 -1
- package/dist/{constants-CGwVaAV3.mjs → constants-BMHCxRzb.mjs} +1 -1
- package/dist/{constants-DWmm7_of.js → constants-Br879Axi.js} +1 -1
- package/dist/{device-ca-DGayRmC0.js → device-ca-CnJ_va7i.js} +1 -1
- package/dist/{device-ca-DBfiJ_SB.mjs → device-ca-T8osSMos.mjs} +1 -1
- package/dist/{dist-Bxt_S-9a.mjs → dist-BNunRyXT.mjs} +1133 -93
- package/dist/{dist-D9qT3jHr.js → dist-DgOG8flk.js} +1354 -92
- package/dist/file-host-worker.js +11 -1
- package/dist/file-host-worker.mjs +11 -1
- package/dist/{hub-mdns-ciao-B-wk9nzx.js → hub-mdns-ciao-BIkTHq-n.js} +2 -2
- package/dist/{hub-mdns-ciao-DpPcQDg-.mjs → hub-mdns-ciao-D16oRQ9K.mjs} +2 -2
- package/dist/index.d.ts +7 -0
- package/dist/index.js +3111 -2806
- package/dist/index.mjs +3083 -2795
- package/dist/kernel/index.d.ts +2 -0
- package/dist/kernel/moleculer/event-bus.d.ts +3 -1
- package/dist/kernel/moleculer/mesh-mtls/mesh-certificate-registry.d.ts +5 -1
- package/dist/kernel/moleculer/records-api-transport.d.ts +9 -0
- package/dist/kernel/moleculer/remote-logger.d.ts +2 -2
- package/dist/kernel/settings-view-types.d.ts +0 -7
- package/dist/kernel/transport/cap-route-resolver.d.ts +9 -38
- package/dist/phase6-declare-gate-Ci1-8uUn.js +98 -0
- package/dist/phase6-declare-gate-tkKOEitw.mjs +93 -0
- package/dist/read-all-rows-CVoO1ONM.js +29 -0
- package/dist/read-all-rows-TaPqdWNF.mjs +25 -0
- package/dist/records/read-all-rows.d.ts +6 -0
- package/dist/{restore-archive-9CGgeBzD.mjs → restore-archive-DR9MtO7J.mjs} +339 -9
- package/dist/{restore-archive-BMNXwWWD.js → restore-archive-DjJnCgap.js} +353 -5
- package/dist/tls/agent-https-names.d.ts +9 -13
- package/dist/{wal-maintenance-cRHR4rUY.js → wal-maintenance-CODGqhKY.js} +0 -0
- package/dist/{wal-maintenance-sIB32ONp.mjs → wal-maintenance-CfvgtQ7C.mjs} +0 -0
- package/package.json +22 -1
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
const require_chunk = require("./chunk-Cek0wNdY.js");
|
|
2
|
-
const require_dist = require("./dist-
|
|
2
|
+
const require_dist = require("./dist-DgOG8flk.js");
|
|
3
|
+
const require_read_all_rows$1 = require("./read-all-rows-CVoO1ONM.js");
|
|
4
|
+
let zod = require("zod");
|
|
3
5
|
let node_crypto = require("node:crypto");
|
|
4
6
|
let buffer = require("buffer");
|
|
5
7
|
let node_fs_promises = require("node:fs/promises");
|
|
@@ -394,6 +396,334 @@ async function decryptBackupFile(input, output, secretKey) {
|
|
|
394
396
|
}
|
|
395
397
|
}
|
|
396
398
|
//#endregion
|
|
399
|
+
//#region src/builtins/backup-orchestrator/encryption-key-store.ts
|
|
400
|
+
var import_read_all_rows = require_read_all_rows$1.require_read_all_rows();
|
|
401
|
+
/**
|
|
402
|
+
* @durable class=config owner=backup-orchestrator
|
|
403
|
+
* write="`setupEncryption` inserts one row per generated key and retires the
|
|
404
|
+
* previous active row; `disableEncryption` retires the active row"
|
|
405
|
+
* retention="none — one small row per key ever generated; a retired row
|
|
406
|
+
* names the key older archives need"
|
|
407
|
+
*/
|
|
408
|
+
var BACKUP_ENCRYPTION_KEYS_COLLECTION = "backup_encryption_keys";
|
|
409
|
+
var COLUMNS$1 = [
|
|
410
|
+
{
|
|
411
|
+
name: "key_id",
|
|
412
|
+
type: "TEXT",
|
|
413
|
+
primaryKey: true
|
|
414
|
+
},
|
|
415
|
+
{
|
|
416
|
+
name: "public_key",
|
|
417
|
+
type: "TEXT",
|
|
418
|
+
notNull: true
|
|
419
|
+
},
|
|
420
|
+
{
|
|
421
|
+
name: "created_at",
|
|
422
|
+
type: "INTEGER",
|
|
423
|
+
notNull: true
|
|
424
|
+
},
|
|
425
|
+
{
|
|
426
|
+
name: "retired_at",
|
|
427
|
+
type: "INTEGER"
|
|
428
|
+
}
|
|
429
|
+
];
|
|
430
|
+
var BackupEncryptionKeyStore = class {
|
|
431
|
+
store;
|
|
432
|
+
now;
|
|
433
|
+
declared = false;
|
|
434
|
+
keysKind;
|
|
435
|
+
constructor(store, now = Date.now, keysKind = null) {
|
|
436
|
+
this.store = store;
|
|
437
|
+
this.now = now;
|
|
438
|
+
this.keysKind = keysKind;
|
|
439
|
+
}
|
|
440
|
+
async ensureDeclared() {
|
|
441
|
+
if (this.keysKind !== null) return;
|
|
442
|
+
if (this.declared) return;
|
|
443
|
+
await this.store.declareCollection({
|
|
444
|
+
collection: BACKUP_ENCRYPTION_KEYS_COLLECTION,
|
|
445
|
+
columns: COLUMNS$1
|
|
446
|
+
});
|
|
447
|
+
this.declared = true;
|
|
448
|
+
}
|
|
449
|
+
/** Every key, newest first. */
|
|
450
|
+
async list() {
|
|
451
|
+
await this.ensureDeclared();
|
|
452
|
+
const kind = this.keysKind;
|
|
453
|
+
if (kind !== null) {
|
|
454
|
+
const rows = await (0, import_read_all_rows.readAllRows)(kind);
|
|
455
|
+
rows.sort((a, b) => b.data.createdAt - a.data.createdAt);
|
|
456
|
+
const out = [];
|
|
457
|
+
for (const row of rows) {
|
|
458
|
+
const record = bodyToRecord(row.id, row.data);
|
|
459
|
+
if (record !== null) out.push(record);
|
|
460
|
+
}
|
|
461
|
+
return out;
|
|
462
|
+
}
|
|
463
|
+
const rows = await this.store.query({
|
|
464
|
+
collection: BACKUP_ENCRYPTION_KEYS_COLLECTION,
|
|
465
|
+
filter: { orderBy: {
|
|
466
|
+
field: "created_at",
|
|
467
|
+
direction: "desc"
|
|
468
|
+
} }
|
|
469
|
+
});
|
|
470
|
+
const out = [];
|
|
471
|
+
for (const row of rows) {
|
|
472
|
+
const record = toRecord(row.data);
|
|
473
|
+
if (record !== null) out.push(record);
|
|
474
|
+
}
|
|
475
|
+
return out;
|
|
476
|
+
}
|
|
477
|
+
/** The key new archives are encrypted to; `null` = encryption off. */
|
|
478
|
+
async active() {
|
|
479
|
+
return (await this.list()).find((k) => k.retiredAt === null) ?? null;
|
|
480
|
+
}
|
|
481
|
+
/** Make `publicKey` the active key; the previous one is retired, kept listed. */
|
|
482
|
+
async activate(input) {
|
|
483
|
+
const parsed = parseBackupPublicKey(input.publicKey);
|
|
484
|
+
const t = this.now();
|
|
485
|
+
await this.retireActive(t);
|
|
486
|
+
const record = {
|
|
487
|
+
keyId: parsed.keyId,
|
|
488
|
+
publicKey: input.publicKey.trim(),
|
|
489
|
+
createdAt: t,
|
|
490
|
+
retiredAt: null
|
|
491
|
+
};
|
|
492
|
+
await this.write(record);
|
|
493
|
+
return record;
|
|
494
|
+
}
|
|
495
|
+
/** Encryption off: the active key is retired. Archives already made keep needing it. */
|
|
496
|
+
async disable() {
|
|
497
|
+
await this.retireActive(this.now());
|
|
498
|
+
}
|
|
499
|
+
async retireActive(at) {
|
|
500
|
+
for (const key of await this.list()) if (key.retiredAt === null) await this.write({
|
|
501
|
+
...key,
|
|
502
|
+
retiredAt: at
|
|
503
|
+
});
|
|
504
|
+
}
|
|
505
|
+
async write(record) {
|
|
506
|
+
await this.ensureDeclared();
|
|
507
|
+
const kind = this.keysKind;
|
|
508
|
+
if (kind !== null) {
|
|
509
|
+
const body = {
|
|
510
|
+
keyId: record.keyId,
|
|
511
|
+
publicKey: record.publicKey,
|
|
512
|
+
createdAt: record.createdAt,
|
|
513
|
+
retiredAt: record.retiredAt
|
|
514
|
+
};
|
|
515
|
+
const data = backupOrchestratorRecordKinds["encryption-keys"].schema.parse(body);
|
|
516
|
+
await kind.put({
|
|
517
|
+
id: record.keyId,
|
|
518
|
+
data
|
|
519
|
+
});
|
|
520
|
+
return;
|
|
521
|
+
}
|
|
522
|
+
await this.store.deleteWhere({
|
|
523
|
+
collection: BACKUP_ENCRYPTION_KEYS_COLLECTION,
|
|
524
|
+
filter: { where: { key_id: record.keyId } }
|
|
525
|
+
});
|
|
526
|
+
await this.store.insert({
|
|
527
|
+
collection: BACKUP_ENCRYPTION_KEYS_COLLECTION,
|
|
528
|
+
record: {
|
|
529
|
+
id: record.keyId,
|
|
530
|
+
data: {
|
|
531
|
+
key_id: record.keyId,
|
|
532
|
+
public_key: record.publicKey,
|
|
533
|
+
created_at: record.createdAt,
|
|
534
|
+
retired_at: record.retiredAt
|
|
535
|
+
}
|
|
536
|
+
}
|
|
537
|
+
});
|
|
538
|
+
}
|
|
539
|
+
};
|
|
540
|
+
function bodyToRecord(keyId, body) {
|
|
541
|
+
if (!keyId) return null;
|
|
542
|
+
return {
|
|
543
|
+
keyId: body.keyId,
|
|
544
|
+
publicKey: body.publicKey,
|
|
545
|
+
createdAt: body.createdAt,
|
|
546
|
+
retiredAt: body.retiredAt
|
|
547
|
+
};
|
|
548
|
+
}
|
|
549
|
+
function toRecord(row) {
|
|
550
|
+
const keyId = row["key_id"];
|
|
551
|
+
const publicKey = row["public_key"];
|
|
552
|
+
const createdAt = row["created_at"];
|
|
553
|
+
if (typeof keyId !== "string" || typeof publicKey !== "string") return null;
|
|
554
|
+
const retired = row["retired_at"];
|
|
555
|
+
return {
|
|
556
|
+
keyId,
|
|
557
|
+
publicKey,
|
|
558
|
+
createdAt: typeof createdAt === "number" ? createdAt : Number(createdAt ?? 0),
|
|
559
|
+
retiredAt: typeof retired === "number" ? retired : null
|
|
560
|
+
};
|
|
561
|
+
}
|
|
562
|
+
//#endregion
|
|
563
|
+
//#region src/builtins/backup-orchestrator/seed-marker-store.ts
|
|
564
|
+
/**
|
|
565
|
+
* @durable class=config owner=backup-orchestrator
|
|
566
|
+
* write="the orchestrator inserts one row per seed id the first time that
|
|
567
|
+
* seed is created (or found already created); never updated"
|
|
568
|
+
* retention="none — one tiny row per seed ever made; deleting it lets the
|
|
569
|
+
* seed be re-created once more on the next boot"
|
|
570
|
+
*/
|
|
571
|
+
var BACKUP_SEED_MARKERS_COLLECTION = "backup_seed_markers";
|
|
572
|
+
var COLUMNS = [{
|
|
573
|
+
name: "seed_id",
|
|
574
|
+
type: "TEXT",
|
|
575
|
+
primaryKey: true
|
|
576
|
+
}, {
|
|
577
|
+
name: "seeded_at",
|
|
578
|
+
type: "INTEGER",
|
|
579
|
+
notNull: true
|
|
580
|
+
}];
|
|
581
|
+
var BackupSeedMarkerStore = class {
|
|
582
|
+
store;
|
|
583
|
+
now;
|
|
584
|
+
declared = false;
|
|
585
|
+
markersKind;
|
|
586
|
+
constructor(store, now = Date.now, markersKind = null) {
|
|
587
|
+
this.store = store;
|
|
588
|
+
this.now = now;
|
|
589
|
+
this.markersKind = markersKind;
|
|
590
|
+
}
|
|
591
|
+
async ensureDeclared() {
|
|
592
|
+
if (this.markersKind !== null) return;
|
|
593
|
+
if (this.declared) return;
|
|
594
|
+
await this.store.declareCollection({
|
|
595
|
+
collection: BACKUP_SEED_MARKERS_COLLECTION,
|
|
596
|
+
columns: COLUMNS
|
|
597
|
+
});
|
|
598
|
+
this.declared = true;
|
|
599
|
+
}
|
|
600
|
+
async has(seedId) {
|
|
601
|
+
await this.ensureDeclared();
|
|
602
|
+
const kind = this.markersKind;
|
|
603
|
+
if (kind !== null) return await kind.get(seedId) !== null;
|
|
604
|
+
return (await this.store.query({
|
|
605
|
+
collection: BACKUP_SEED_MARKERS_COLLECTION,
|
|
606
|
+
filter: {
|
|
607
|
+
where: { seed_id: seedId },
|
|
608
|
+
limit: 1
|
|
609
|
+
}
|
|
610
|
+
})).length > 0;
|
|
611
|
+
}
|
|
612
|
+
async mark(seedId) {
|
|
613
|
+
await this.ensureDeclared();
|
|
614
|
+
if (await this.has(seedId)) return;
|
|
615
|
+
const kind = this.markersKind;
|
|
616
|
+
if (kind !== null) {
|
|
617
|
+
const body = { seededAt: this.now() };
|
|
618
|
+
const data = backupOrchestratorRecordKinds["seed-markers"].schema.parse(body);
|
|
619
|
+
await kind.put({
|
|
620
|
+
id: seedId,
|
|
621
|
+
data
|
|
622
|
+
});
|
|
623
|
+
return;
|
|
624
|
+
}
|
|
625
|
+
await this.store.insert({
|
|
626
|
+
collection: BACKUP_SEED_MARKERS_COLLECTION,
|
|
627
|
+
record: {
|
|
628
|
+
id: seedId,
|
|
629
|
+
data: {
|
|
630
|
+
seed_id: seedId,
|
|
631
|
+
seeded_at: this.now()
|
|
632
|
+
}
|
|
633
|
+
}
|
|
634
|
+
});
|
|
635
|
+
}
|
|
636
|
+
};
|
|
637
|
+
//#endregion
|
|
638
|
+
//#region src/builtins/backup-orchestrator/record-kinds.ts
|
|
639
|
+
var BACKUP_SCHEDULES_LEGACY = "backup_schedules";
|
|
640
|
+
var BACKUP_DESTINATION_POLICIES_LEGACY = "backup_destination_policies";
|
|
641
|
+
var BackupScheduleBodySchema = zod.z.object({
|
|
642
|
+
label: zod.z.string(),
|
|
643
|
+
cron: zod.z.string(),
|
|
644
|
+
enabled: zod.z.boolean(),
|
|
645
|
+
locationIds: zod.z.array(zod.z.string()).readonly(),
|
|
646
|
+
retentionCount: zod.z.number(),
|
|
647
|
+
dataSources: zod.z.array(zod.z.string()).readonly().optional(),
|
|
648
|
+
databases: zod.z.array(require_dist.DataStoreDatabaseSchema).readonly().optional(),
|
|
649
|
+
lastAttemptAt: zod.z.number().optional(),
|
|
650
|
+
lastSuccessAt: zod.z.number().optional(),
|
|
651
|
+
lastError: zod.z.string().optional()
|
|
652
|
+
});
|
|
653
|
+
var BackupDestinationPolicyBodySchema = zod.z.object({
|
|
654
|
+
enabled: zod.z.boolean(),
|
|
655
|
+
retentionCount: zod.z.number(),
|
|
656
|
+
label: zod.z.string().optional(),
|
|
657
|
+
lastAttemptAt: zod.z.number().optional(),
|
|
658
|
+
lastError: zod.z.string().optional()
|
|
659
|
+
});
|
|
660
|
+
var BackupEncryptionKeyBodySchema = zod.z.object({
|
|
661
|
+
keyId: zod.z.string(),
|
|
662
|
+
publicKey: zod.z.string(),
|
|
663
|
+
createdAt: zod.z.number(),
|
|
664
|
+
retiredAt: zod.z.number().nullable()
|
|
665
|
+
});
|
|
666
|
+
var BackupSeedMarkerBodySchema = zod.z.object({ seededAt: zod.z.number() });
|
|
667
|
+
var _backupOrchestratorRecordKinds = require_dist.defineRecordKinds({
|
|
668
|
+
schedules: {
|
|
669
|
+
schema: BackupScheduleBodySchema,
|
|
670
|
+
class: "config",
|
|
671
|
+
writeTrigger: "operator upsert/delete; orchestrator stamps lastAttempt/success/error",
|
|
672
|
+
device: "none",
|
|
673
|
+
at: "none",
|
|
674
|
+
indexes: [{
|
|
675
|
+
name: "enabled",
|
|
676
|
+
fields: ["enabled"]
|
|
677
|
+
}],
|
|
678
|
+
retention: { none: "operator delete only" },
|
|
679
|
+
adoptsFrom: BACKUP_SCHEDULES_LEGACY,
|
|
680
|
+
entry: {
|
|
681
|
+
title: "Backup schedules",
|
|
682
|
+
nameField: "label"
|
|
683
|
+
}
|
|
684
|
+
},
|
|
685
|
+
"destination-policies": {
|
|
686
|
+
schema: BackupDestinationPolicyBodySchema,
|
|
687
|
+
class: "config",
|
|
688
|
+
writeTrigger: "ensureDefault, operator upsert, recordAttempt after each archive write",
|
|
689
|
+
device: "none",
|
|
690
|
+
at: "none",
|
|
691
|
+
retention: { none: "row outlives location; ensureDefault recreates" },
|
|
692
|
+
adoptsFrom: BACKUP_DESTINATION_POLICIES_LEGACY
|
|
693
|
+
},
|
|
694
|
+
"encryption-keys": {
|
|
695
|
+
schema: BackupEncryptionKeyBodySchema,
|
|
696
|
+
class: "config",
|
|
697
|
+
writeTrigger: "setupEncryption activate; disableEncryption retires active row",
|
|
698
|
+
device: "none",
|
|
699
|
+
at: "none",
|
|
700
|
+
retention: { none: "retired keys kept for archive decryption hints" },
|
|
701
|
+
adoptsFrom: BACKUP_ENCRYPTION_KEYS_COLLECTION
|
|
702
|
+
},
|
|
703
|
+
"seed-markers": {
|
|
704
|
+
schema: BackupSeedMarkerBodySchema,
|
|
705
|
+
class: "config",
|
|
706
|
+
writeTrigger: "mark() once per seed id after seed landed",
|
|
707
|
+
device: "none",
|
|
708
|
+
at: "none",
|
|
709
|
+
retention: { none: "one row per seed id ever" },
|
|
710
|
+
adoptsFrom: BACKUP_SEED_MARKERS_COLLECTION
|
|
711
|
+
}
|
|
712
|
+
});
|
|
713
|
+
var backupOrchestratorRecordKinds = _backupOrchestratorRecordKinds;
|
|
714
|
+
var backupSchedulesRecordKind = _backupOrchestratorRecordKinds.schedules;
|
|
715
|
+
var backupDestinationPoliciesRecordKind = _backupOrchestratorRecordKinds["destination-policies"];
|
|
716
|
+
var backupEncryptionKeysRecordKind = _backupOrchestratorRecordKinds["encryption-keys"];
|
|
717
|
+
var backupSeedMarkersRecordKind = _backupOrchestratorRecordKinds["seed-markers"];
|
|
718
|
+
function backupRecordStoresOf(records) {
|
|
719
|
+
return {
|
|
720
|
+
schedules: records.kind(backupSchedulesRecordKind),
|
|
721
|
+
destinationPolicies: records.kind(backupDestinationPoliciesRecordKind),
|
|
722
|
+
encryptionKeys: records.kind(backupEncryptionKeysRecordKind),
|
|
723
|
+
seedMarkers: records.kind(backupSeedMarkersRecordKind)
|
|
724
|
+
};
|
|
725
|
+
}
|
|
726
|
+
//#endregion
|
|
397
727
|
//#region node_modules/tar/dist/esm/index.min.js
|
|
398
728
|
var Mr = Object.defineProperty;
|
|
399
729
|
var Br = (s, t) => {
|
|
@@ -4150,6 +4480,12 @@ Object.defineProperty(exports, "BackupDecryptError", {
|
|
|
4150
4480
|
return BackupDecryptError;
|
|
4151
4481
|
}
|
|
4152
4482
|
});
|
|
4483
|
+
Object.defineProperty(exports, "BackupEncryptionKeyStore", {
|
|
4484
|
+
enumerable: true,
|
|
4485
|
+
get: function() {
|
|
4486
|
+
return BackupEncryptionKeyStore;
|
|
4487
|
+
}
|
|
4488
|
+
});
|
|
4153
4489
|
Object.defineProperty(exports, "BackupKeyFormatError", {
|
|
4154
4490
|
enumerable: true,
|
|
4155
4491
|
get: function() {
|
|
@@ -4168,6 +4504,12 @@ Object.defineProperty(exports, "BackupKeyRequiredError", {
|
|
|
4168
4504
|
return BackupKeyRequiredError;
|
|
4169
4505
|
}
|
|
4170
4506
|
});
|
|
4507
|
+
Object.defineProperty(exports, "BackupSeedMarkerStore", {
|
|
4508
|
+
enumerable: true,
|
|
4509
|
+
get: function() {
|
|
4510
|
+
return BackupSeedMarkerStore;
|
|
4511
|
+
}
|
|
4512
|
+
});
|
|
4171
4513
|
Object.defineProperty(exports, "BackupSnapshotRefusedError", {
|
|
4172
4514
|
enumerable: true,
|
|
4173
4515
|
get: function() {
|
|
@@ -4192,16 +4534,22 @@ Object.defineProperty(exports, "SystemBackupService", {
|
|
|
4192
4534
|
return SystemBackupService;
|
|
4193
4535
|
}
|
|
4194
4536
|
});
|
|
4195
|
-
Object.defineProperty(exports, "
|
|
4537
|
+
Object.defineProperty(exports, "backupOrchestratorRecordKinds", {
|
|
4196
4538
|
enumerable: true,
|
|
4197
4539
|
get: function() {
|
|
4198
|
-
return
|
|
4540
|
+
return backupOrchestratorRecordKinds;
|
|
4199
4541
|
}
|
|
4200
4542
|
});
|
|
4201
|
-
Object.defineProperty(exports, "
|
|
4543
|
+
Object.defineProperty(exports, "backupRecordStoresOf", {
|
|
4202
4544
|
enumerable: true,
|
|
4203
4545
|
get: function() {
|
|
4204
|
-
return
|
|
4546
|
+
return backupRecordStoresOf;
|
|
4547
|
+
}
|
|
4548
|
+
});
|
|
4549
|
+
Object.defineProperty(exports, "generateBackupKeyPair", {
|
|
4550
|
+
enumerable: true,
|
|
4551
|
+
get: function() {
|
|
4552
|
+
return generateBackupKeyPair;
|
|
4205
4553
|
}
|
|
4206
4554
|
});
|
|
4207
4555
|
Object.defineProperty(exports, "parseBackupSecretKey", {
|
|
@@ -2,26 +2,22 @@
|
|
|
2
2
|
* Which names the hub has certified to which agent (D856): the memory behind "a name
|
|
3
3
|
* already certified to another node is never signed again". Hub only.
|
|
4
4
|
*/
|
|
5
|
-
import type { CollectionColumn, SettingsStoreClient } from "@camstack/types";
|
|
6
|
-
|
|
7
|
-
* @durable class=config owner=system-config
|
|
8
|
-
* write="the hub records the names it signed into an agent's HTTPS leaf, replacing that
|
|
9
|
-
* node's previous row"
|
|
10
|
-
* retention="one row per node, replaced on every issue; a forgotten node's row stays until
|
|
11
|
-
* the node is issued again or an operator clears it (it only blocks reuse of its names)"
|
|
12
|
-
*/
|
|
5
|
+
import type { CollectionColumn, RecordKindHandle, SettingsStoreClient } from "@camstack/types";
|
|
6
|
+
import type { AgentHttpsNameBody } from "../builtins/system-config/record-kinds.js";
|
|
13
7
|
export declare const AGENT_HTTPS_NAMES_COLLECTION = "agent_https_names";
|
|
14
8
|
export declare const AGENT_HTTPS_NAMES_COLUMNS: readonly CollectionColumn[];
|
|
9
|
+
export interface AgentHttpsNamesDeps {
|
|
10
|
+
readonly agentHttpsNamesKind: RecordKindHandle<AgentHttpsNameBody>;
|
|
11
|
+
readonly legacyStore?: SettingsStoreClient;
|
|
12
|
+
}
|
|
15
13
|
export declare class AgentHttpsNames {
|
|
16
|
-
private readonly store;
|
|
17
14
|
private readonly byNode;
|
|
18
|
-
|
|
15
|
+
private readonly kind;
|
|
16
|
+
private readonly store;
|
|
17
|
+
constructor(deps: SettingsStoreClient | AgentHttpsNamesDeps);
|
|
19
18
|
load(): Promise<void>;
|
|
20
|
-
/** The names certified to `nodeId` (its id and the address of its live mesh socket), or `null`. */
|
|
21
19
|
namesOf(nodeId: string): readonly string[] | null;
|
|
22
|
-
/** Every name certified to a node other than `nodeId`. */
|
|
23
20
|
takenByOthers(nodeId: string): ReadonlySet<string>;
|
|
24
|
-
/** Free every name certified to a node that was forgotten. */
|
|
25
21
|
release(nodeId: string): Promise<boolean>;
|
|
26
22
|
record(nodeId: string, names: readonly string[]): Promise<void>;
|
|
27
23
|
}
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@camstack/system",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.445",
|
|
4
4
|
"description": "Core addon for CamStack — builtins, pipeline, process management, auth, logging, events",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"camstack",
|
|
@@ -75,6 +75,9 @@
|
|
|
75
75
|
},
|
|
76
76
|
{
|
|
77
77
|
"name": "storage-admin"
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"name": "records"
|
|
78
81
|
}
|
|
79
82
|
]
|
|
80
83
|
},
|
|
@@ -199,6 +202,24 @@
|
|
|
199
202
|
}
|
|
200
203
|
]
|
|
201
204
|
},
|
|
205
|
+
{
|
|
206
|
+
"id": "record-entries",
|
|
207
|
+
"category": "system",
|
|
208
|
+
"name": "Record Entries",
|
|
209
|
+
"icon": "assets/record-entries/icon.svg",
|
|
210
|
+
"color": "#0d9488",
|
|
211
|
+
"description": "The ONE admin surface for every list of user-created entries (notification targets, brokers, LLM profiles): any addon declares an entry kind with `defineEntryKind` and the entries UI lists, adds, edits and deletes it, with password fields derived from the schema (`.meta({ secret: true })`). Holds no data of its own: it acts for each entry's owner on the records door and the keychain, in-process on the hub.",
|
|
212
|
+
"entry": "./dist/builtins/record-entries/index.js",
|
|
213
|
+
"protected": true,
|
|
214
|
+
"execution": {
|
|
215
|
+
"placement": "hub-only"
|
|
216
|
+
},
|
|
217
|
+
"capabilities": [
|
|
218
|
+
{
|
|
219
|
+
"name": "record-entries"
|
|
220
|
+
}
|
|
221
|
+
]
|
|
222
|
+
},
|
|
202
223
|
{
|
|
203
224
|
"id": "metrics-native",
|
|
204
225
|
"category": "system",
|