@camstack/server 1.2.786 → 1.2.788
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/CHANGELOG.md +13 -0
- package/dist/api/core/cap-providers.js +62 -96
- package/dist/api/trpc/generated-cap-mounts.js +1 -10
- package/dist/api/trpc/generated-cap-routers.js +2289 -2366
- package/dist/core/addon/addon-registry.service.js +29 -28
- package/dist/core/addon/boot-health-snapshot.js +42 -0
- package/dist/core/addon/hub-spawn-gate.js +1 -0
- package/dist/core/addon/instances-of-cap.js +35 -0
- package/package.json +64 -46
- package/system/dist/addon-utils.mjs +1 -1
- package/system/dist/{agent-https-snFEmSqQ.js → agent-https-jJDe-XNl.js} +1 -1
- package/system/dist/{agent-https-D779EYj3.mjs → agent-https-szf2FU49.mjs} +1 -1
- package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +1 -1
- package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +4 -4
- package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
- package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +5 -5
- package/system/dist/builtins/alerts/alerts.addon.js +1 -1
- package/system/dist/builtins/alerts/alerts.addon.mjs +3 -3
- package/system/dist/builtins/autotrack/index.js +1 -1
- package/system/dist/builtins/autotrack/index.mjs +1 -1
- package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +2 -2
- package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +5 -5
- package/system/dist/builtins/calendars/calendars.addon.js +1 -1
- package/system/dist/builtins/calendars/calendars.addon.mjs +1 -1
- package/system/dist/builtins/camera-grid/index.js +1 -1
- package/system/dist/builtins/camera-grid/index.mjs +1 -1
- package/system/dist/builtins/composer/composer.addon.js +3 -3
- package/system/dist/builtins/composer/composer.addon.mjs +3 -3
- package/system/dist/builtins/console-logging/index.js +1 -1
- package/system/dist/builtins/console-logging/index.mjs +1 -1
- package/system/dist/builtins/core-blocks/core-blocks.addon.js +3 -3
- package/system/dist/builtins/core-blocks/core-blocks.addon.mjs +3 -3
- package/system/dist/builtins/device-history/device-history.addon.js +2 -2
- package/system/dist/builtins/device-history/device-history.addon.mjs +2 -2
- package/system/dist/builtins/device-manager/device-manager.addon.js +1 -1
- package/system/dist/builtins/device-manager/device-manager.addon.mjs +1 -1
- package/system/dist/builtins/hub-forwarder/index.js +1 -1
- package/system/dist/builtins/hub-forwarder/index.mjs +1 -1
- package/system/dist/builtins/keychain/index.js +4 -4
- package/system/dist/builtins/keychain/index.mjs +4 -4
- package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.js +1 -1
- package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +1 -1
- package/system/dist/builtins/local-auth/local-auth.addon.js +2 -2
- package/system/dist/builtins/local-auth/local-auth.addon.mjs +5 -5
- package/system/dist/builtins/local-network/local-network.addon.js +2 -2
- package/system/dist/builtins/local-network/local-network.addon.mjs +2 -2
- package/system/dist/builtins/loki-logging/index.js +1 -1
- package/system/dist/builtins/loki-logging/index.mjs +1 -1
- package/system/dist/builtins/native-metrics/native-metrics.addon.js +1 -1
- package/system/dist/builtins/native-metrics/native-metrics.addon.mjs +10 -10
- package/system/dist/builtins/platform-probe/index.js +1 -1
- package/system/dist/builtins/platform-probe/index.mjs +10 -10
- package/system/dist/builtins/record-entries/index.js +1 -1
- package/system/dist/builtins/record-entries/index.mjs +1 -1
- package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
- package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
- package/system/dist/builtins/snapshot/index.js +1 -1
- package/system/dist/builtins/snapshot/index.mjs +1 -1
- package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
- package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +20 -20
- package/system/dist/builtins/sqlite-storage/index.js +1 -1
- package/system/dist/builtins/sqlite-storage/index.mjs +1 -1
- package/system/dist/builtins/sqlite-storage/integration-record-kinds.d.ts +0 -1
- package/system/dist/builtins/sqlite-storage/integration-registry.d.ts +2 -4
- package/system/dist/builtins/sqlite-storage/migrations/migration-types.d.ts +6 -1
- package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.js +7 -4
- package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +7 -4
- package/system/dist/builtins/storage-orchestrator/drain-state-store.d.ts +4 -8
- package/system/dist/builtins/storage-orchestrator/location-store.d.ts +9 -26
- package/system/dist/builtins/storage-orchestrator/record-kinds.d.ts +0 -1
- package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +35 -407
- package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +36 -407
- package/system/dist/builtins/system-config/system-config.addon.js +3 -3
- package/system/dist/builtins/system-config/system-config.addon.mjs +115 -115
- package/system/dist/builtins/winston-logging/index.js +1 -1
- package/system/dist/builtins/winston-logging/index.mjs +1 -1
- package/system/dist/{capture-engine-DkTEWrRe.mjs → capture-engine-BsKY_3xa.mjs} +1 -1
- package/system/dist/{capture-engine-NZ11ORZS.js → capture-engine-DNHgjQot.js} +1 -1
- package/system/dist/{composition-sources-B9-lkIvO.mjs → composition-sources-BRdGsbVT.mjs} +1 -1
- package/system/dist/{composition-sources-B6GYTy_7.js → composition-sources-BgO0GQYW.js} +1 -1
- package/system/dist/{constants-DR8hdi45.js → constants-C3jGKQSQ.js} +1 -1
- package/system/dist/{constants--9ui1LK0.mjs → constants-CQeMrR4f.mjs} +1 -1
- package/system/dist/{coral-accelerators-DBlgWB8k.mjs → coral-accelerators-BW3OcrLD.mjs} +6 -6
- package/system/dist/{custom-action-registry-B9zFBNVa.mjs → custom-action-registry-N7flBDwT.mjs} +37 -37
- package/system/dist/{device-ca-D-7tAHJ_.mjs → device-ca-ByVi5eUC.mjs} +1 -1
- package/system/dist/{device-ca-sIFmKkGM.js → device-ca-D3y6wGmn.js} +1 -1
- package/system/dist/{dist-h3Yla8gE.js → dist-BRI-Mwx0.js} +824 -957
- package/system/dist/{dist-D-iGSnX_.mjs → dist-BsQA6-0i.mjs} +824 -957
- package/system/dist/file-host-worker.js +1 -1
- package/system/dist/file-host-worker.mjs +1 -1
- package/system/dist/{hub-mdns-ciao-DuEfM0fI.mjs → hub-mdns-ciao-8dJTW2LI.mjs} +2 -2
- package/system/dist/{hub-mdns-ciao-C5DkUEZF.js → hub-mdns-ciao-Ry_Jpljx.js} +2 -2
- package/system/dist/index.d.ts +2 -2
- package/system/dist/index.js +85 -223
- package/system/dist/index.mjs +298 -434
- package/system/dist/kernel/addon-health-monitor.d.ts +21 -0
- package/system/dist/{legacy-integration-rows-door-BTdhD-Yp.mjs → legacy-integration-rows-door-CjXTbmvH.mjs} +1 -1
- package/system/dist/{legacy-integration-rows-door-DTDD5wwC.js → legacy-integration-rows-door-D5BdSNla.js} +1 -1
- package/system/dist/migrations/hub/2026-11-06-drop-legacy-integrations-and-storage-locations.d.ts +12 -0
- package/system/dist/{restore-archive-DQWz5Wp-.mjs → restore-archive-Co2lk3OU.mjs} +94 -94
- package/system/dist/{restore-archive-CkAD_-E9.js → restore-archive-GoWJMdHy.js} +1 -1
- package/system/dist/{wal-maintenance-CB-O-GPP.js → wal-maintenance-C1Haue74.js} +0 -0
- package/system/dist/{wal-maintenance-DouX1XsY.mjs → wal-maintenance-DRnV6QYu.mjs} +0 -0
- package/system/package.json +1 -1
|
@@ -4,7 +4,7 @@ Object.defineProperties(exports, {
|
|
|
4
4
|
});
|
|
5
5
|
require("../../chunk-Cek0wNdY.js");
|
|
6
6
|
const require_builtins_sqlite_storage_filesystem_storage_addon = require("./filesystem-storage.addon.js");
|
|
7
|
-
const require_wal_maintenance = require("../../wal-maintenance-
|
|
7
|
+
const require_wal_maintenance = require("../../wal-maintenance-C1Haue74.js");
|
|
8
8
|
const require_builtins_sqlite_storage_sqlite_settings_addon = require("./sqlite-settings.addon.js");
|
|
9
9
|
//#region src/builtins/sqlite-storage/config-store.ts
|
|
10
10
|
var ConfigStore = class {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FilesystemStorageAddon, t as FilesystemStorageProvider } from "./filesystem-storage.addon.mjs";
|
|
2
|
-
import { B as SQLITE_ENGINE_STORM_WALL_SHARE, F as SQLITE_MMAP_FLOOR_BYTES, G as SqliteOpProfiler, H as SQLITE_PROFILE_REPORT_INTERVAL_MS, I as SQLITE_PAGE_CACHE_CEILING_KIB, K as sqliteEngineStorm, L as SQLITE_PAGE_CACHE_FLOOR_KIB, N as SQLITE_JOURNAL_SIZE_LIMIT_BYTES, P as SQLITE_MMAP_CEILING_BYTES, R as sqliteMmapSizeFor, U as SQLITE_PROFILE_TOP_N, V as SQLITE_PROFILE_REPORT_FLOOR_MS, W as SQLITE_SLOW_CALL_MS, a as WalMaintenance, i as WAL_MAINTENANCE_INTERVAL_MS, l as SqliteSettingsBackend, n as WAL_HIGH_WATER_BYTES, r as WAL_IDLE_QUIET_MS, t as WAL_CHECKPOINT_BUSY_TIMEOUT_MS, z as sqlitePageCacheKibFor } from "../../wal-maintenance-
|
|
2
|
+
import { B as SQLITE_ENGINE_STORM_WALL_SHARE, F as SQLITE_MMAP_FLOOR_BYTES, G as SqliteOpProfiler, H as SQLITE_PROFILE_REPORT_INTERVAL_MS, I as SQLITE_PAGE_CACHE_CEILING_KIB, K as sqliteEngineStorm, L as SQLITE_PAGE_CACHE_FLOOR_KIB, N as SQLITE_JOURNAL_SIZE_LIMIT_BYTES, P as SQLITE_MMAP_CEILING_BYTES, R as sqliteMmapSizeFor, U as SQLITE_PROFILE_TOP_N, V as SQLITE_PROFILE_REPORT_FLOOR_MS, W as SQLITE_SLOW_CALL_MS, a as WalMaintenance, i as WAL_MAINTENANCE_INTERVAL_MS, l as SqliteSettingsBackend, n as WAL_HIGH_WATER_BYTES, r as WAL_IDLE_QUIET_MS, t as WAL_CHECKPOINT_BUSY_TIMEOUT_MS, z as sqlitePageCacheKibFor } from "../../wal-maintenance-DRnV6QYu.mjs";
|
|
3
3
|
import { SqliteSettingsAddon } from "./sqlite-settings.addon.mjs";
|
|
4
4
|
//#region src/builtins/sqlite-storage/config-store.ts
|
|
5
5
|
var ConfigStore = class {
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import type { CreateIntegrationInput, IIntegrationRegistry, Integration,
|
|
1
|
+
import type { CreateIntegrationInput, IIntegrationRegistry, Integration, RecordKindHandle, RecordsAccess } from "@camstack/types";
|
|
2
2
|
import { type IntegrationBody } from "./integration-record-kinds.js";
|
|
3
3
|
export interface IntegrationRecordStores {
|
|
4
4
|
readonly integrations: RecordKindHandle<IntegrationBody>;
|
|
5
5
|
}
|
|
6
6
|
export declare class IntegrationRegistry implements IIntegrationRegistry {
|
|
7
|
-
private readonly store;
|
|
8
7
|
private readonly recordStores;
|
|
9
|
-
constructor(
|
|
8
|
+
constructor(recordStores: IntegrationRecordStores);
|
|
10
9
|
static recordStoresOf(records: Pick<RecordsAccess, "kind">): IntegrationRecordStores;
|
|
11
10
|
initialize(): Promise<void>;
|
|
12
11
|
private resumeCounter;
|
|
@@ -26,5 +25,4 @@ export declare class IntegrationRegistry implements IIntegrationRegistry {
|
|
|
26
25
|
readonly info: Readonly<Record<string, unknown>> | null;
|
|
27
26
|
}): boolean;
|
|
28
27
|
deleteIntegration(id: string): Promise<boolean>;
|
|
29
|
-
private mapIntegration;
|
|
30
28
|
}
|
|
@@ -25,8 +25,11 @@ export declare const HUB_OWNER = "hub";
|
|
|
25
25
|
/** A hub-store `sql` migration: its identity plus the synchronous body that runs in its transaction. */
|
|
26
26
|
export interface HubSqlMigration {
|
|
27
27
|
readonly meta: MigrationMeta;
|
|
28
|
-
|
|
28
|
+
/** May answer a note (what it dropped or copied by name): kept in the ledger and logged at info. */
|
|
29
|
+
run(db: MigrationDatabase): MigrationNote | undefined;
|
|
29
30
|
}
|
|
31
|
+
/** A `sql` body's account of what it did beyond a row count. */
|
|
32
|
+
export type MigrationNote = Readonly<Record<string, unknown>>;
|
|
30
33
|
/**
|
|
31
34
|
* A hub-store `plan` migration: the body READS through the connection and returns the
|
|
32
35
|
* edits the engine applies, in the same transaction as the `applied` row. It must not
|
|
@@ -48,6 +51,8 @@ export interface PassOutcome {
|
|
|
48
51
|
readonly rowsChanged: number;
|
|
49
52
|
readonly error: string | null;
|
|
50
53
|
readonly reason: string | null;
|
|
54
|
+
/** The `sql` body's own note, when it left one. */
|
|
55
|
+
readonly note?: MigrationNote;
|
|
51
56
|
}
|
|
52
57
|
export interface PreparedPass {
|
|
53
58
|
/** Every catalogued migration of this file, as the ledger has it now. */
|
|
@@ -3,12 +3,12 @@ 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-
|
|
6
|
+
const require_dist = require("../../dist-BRI-Mwx0.js");
|
|
7
7
|
const require_retired_settings_keys = require("../../retired-settings-keys-C8nOOr5H.js");
|
|
8
|
-
const require_wal_maintenance = require("../../wal-maintenance-
|
|
8
|
+
const require_wal_maintenance = require("../../wal-maintenance-C1Haue74.js");
|
|
9
9
|
const require_sqlite_snapshot_protocol = require("../../sqlite-snapshot-protocol-B9OndqZv.js");
|
|
10
10
|
const require_wal_checkpoint_policy = require("../../wal-checkpoint-policy-d2z2qPqx.js");
|
|
11
|
-
const require_legacy_integration_rows_door = require("../../legacy-integration-rows-door-
|
|
11
|
+
const require_legacy_integration_rows_door = require("../../legacy-integration-rows-door-D5BdSNla.js");
|
|
12
12
|
let zod = require("zod");
|
|
13
13
|
let node_crypto = require("node:crypto");
|
|
14
14
|
let node_fs = require("node:fs");
|
|
@@ -1432,7 +1432,10 @@ var MigrationEngine = class {
|
|
|
1432
1432
|
};
|
|
1433
1433
|
if (outcome.outcome === "applied") log.info("migration applied", {
|
|
1434
1434
|
tags,
|
|
1435
|
-
meta: {
|
|
1435
|
+
meta: {
|
|
1436
|
+
rowsChanged: outcome.rowsChanged,
|
|
1437
|
+
...outcome.note
|
|
1438
|
+
}
|
|
1436
1439
|
});
|
|
1437
1440
|
else if (outcome.outcome === "failed") log.error("migration failed", {
|
|
1438
1441
|
tags,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Ct as MIGRATION_API_V1_METHODS, Ec as EventCategory, Es as collectSecretMarkerRefs, F as DATABASE_SNAPSHOT_TIMEOUT_MS, I as DATA_STORE_DATABASES, In as catalogueIssues, Jo as NoCallerError, Lo as BaseAddon, N as DATABASE_SNAPSHOT_PARTIAL_SUFFIX, Ot as MigrationMetaSchema, P as DATABASE_SNAPSHOT_SUFFIX, Pi as orderMigrations, Qa as vectorStoreCapability, Qi as recordsCapability, Si as migrationsCapability, Tc as errMsg$1, Uo as DeclarationRefusedError, es as RECORD_SWEEP_INTERVAL_MS, gs as UnknownRecordKindError, ic as normalizeSecretOwner, ir as databaseSnapshotCapability, ja as storageAdminCapability, js as defineCustomActions, ks as customAction, ms as TransactRefusedError, pa as resolveRunnerId, qo as InvalidRecordError, rr as dataStoreProviderCapability, rs as RUNTIME_DEFAULTS, ss as RecordKindDeclarationSchema, wn as bareAddonId } from "../../dist-
|
|
1
|
+
import { Ct as MIGRATION_API_V1_METHODS, Ec as EventCategory, Es as collectSecretMarkerRefs, F as DATABASE_SNAPSHOT_TIMEOUT_MS, I as DATA_STORE_DATABASES, In as catalogueIssues, Jo as NoCallerError, Lo as BaseAddon, N as DATABASE_SNAPSHOT_PARTIAL_SUFFIX, Ot as MigrationMetaSchema, P as DATABASE_SNAPSHOT_SUFFIX, Pi as orderMigrations, Qa as vectorStoreCapability, Qi as recordsCapability, Si as migrationsCapability, Tc as errMsg$1, Uo as DeclarationRefusedError, es as RECORD_SWEEP_INTERVAL_MS, gs as UnknownRecordKindError, ic as normalizeSecretOwner, ir as databaseSnapshotCapability, ja as storageAdminCapability, js as defineCustomActions, ks as customAction, ms as TransactRefusedError, pa as resolveRunnerId, qo as InvalidRecordError, rr as dataStoreProviderCapability, rs as RUNTIME_DEFAULTS, ss as RecordKindDeclarationSchema, wn as bareAddonId } from "../../dist-BsQA6-0i.mjs";
|
|
2
2
|
import { r as retiredKeyStoreOf, t as purgeRetiredSettingsKeys } from "../../retired-settings-keys-u6xQA6r7.mjs";
|
|
3
|
-
import { A as callRecords, D as RecordsEngine, E as databaseOfStore, M as controlTargetOf, O as callControl, T as trustResult, _ as rehydrateError, a as WalMaintenance, b as collectTransferables, c as vectorProviderOfOwnedFile, d as callMigrate, f as migrateTargetOf, g as DuplicatePlacementError, h as DatabaseBusyError, j as callVector, k as callData, l as SqliteSettingsBackend, m as CrossDatabaseTransactError, o as createVectorIndex, p as CollectionPlacementError, s as vectorProviderOf, u as HUB_MIGRATIONS, x as isFileHostMessage } from "../../wal-maintenance-
|
|
3
|
+
import { A as callRecords, D as RecordsEngine, E as databaseOfStore, M as controlTargetOf, O as callControl, T as trustResult, _ as rehydrateError, a as WalMaintenance, b as collectTransferables, c as vectorProviderOfOwnedFile, d as callMigrate, f as migrateTargetOf, g as DuplicatePlacementError, h as DatabaseBusyError, j as callVector, k as callData, l as SqliteSettingsBackend, m as CrossDatabaseTransactError, o as createVectorIndex, p as CollectionPlacementError, s as vectorProviderOf, u as HUB_MIGRATIONS, x as isFileHostMessage } from "../../wal-maintenance-DRnV6QYu.mjs";
|
|
4
4
|
import { r as isSnapshotWorkerMessage } from "../../sqlite-snapshot-protocol-2QaTouWV.mjs";
|
|
5
5
|
import { a as isWorkerMessage, t as WAL_CHECKPOINT_LARGE_PASS_FRAMES } from "../../wal-checkpoint-policy-BahrTtyD.mjs";
|
|
6
|
-
import { a as patchLegacyIntegrationRows, i as legacyIntegrationAddonId, n as clearLegacyIntegrationRows, o as readLegacyIntegrationRows, r as deleteLegacyIntegrationRowKeys } from "../../legacy-integration-rows-door-
|
|
6
|
+
import { a as patchLegacyIntegrationRows, i as legacyIntegrationAddonId, n as clearLegacyIntegrationRows, o as readLegacyIntegrationRows, r as deleteLegacyIntegrationRowKeys } from "../../legacy-integration-rows-door-CjXTbmvH.mjs";
|
|
7
7
|
import { createRequire } from "node:module";
|
|
8
8
|
import { z } from "zod";
|
|
9
9
|
import { randomUUID } from "node:crypto";
|
|
@@ -1426,7 +1426,10 @@ var MigrationEngine = class {
|
|
|
1426
1426
|
};
|
|
1427
1427
|
if (outcome.outcome === "applied") log.info("migration applied", {
|
|
1428
1428
|
tags,
|
|
1429
|
-
meta: {
|
|
1429
|
+
meta: {
|
|
1430
|
+
rowsChanged: outcome.rowsChanged,
|
|
1431
|
+
...outcome.note
|
|
1432
|
+
}
|
|
1430
1433
|
});
|
|
1431
1434
|
else if (outcome.outcome === "failed") log.error("migration failed", {
|
|
1432
1435
|
tags,
|
|
@@ -5,21 +5,17 @@
|
|
|
5
5
|
* restart the ratchet at the top of the disk and silently undo every byte of
|
|
6
6
|
* progress — the operator would see a drain that never finishes and no line
|
|
7
7
|
* saying why. So the cap, the drain start and the observed growth are persisted
|
|
8
|
-
* on every sweep,
|
|
9
|
-
* uses.
|
|
8
|
+
* on every sweep, as `drain-state` records.
|
|
10
9
|
*/
|
|
11
|
-
import type {
|
|
10
|
+
import type { RecordKindHandle, RecordsAccess } from "@camstack/types";
|
|
12
11
|
import type { DrainState } from "./drain-ratchet.js";
|
|
13
12
|
import { type StorageDrainStateBody } from "./record-kinds.js";
|
|
14
13
|
import type { DrainStateStore } from "./storage-pressure-manager.js";
|
|
15
|
-
/** {@link DrainStateStore}
|
|
14
|
+
/** {@link DrainStateStore} over the `drain-state` record kind. */
|
|
16
15
|
export declare class SqliteDrainStateStore implements DrainStateStore {
|
|
17
|
-
private readonly store;
|
|
18
|
-
private declared;
|
|
19
16
|
private readonly drainKind;
|
|
20
|
-
constructor(
|
|
17
|
+
constructor(drainKind: RecordKindHandle<StorageDrainStateBody>);
|
|
21
18
|
static recordStoresOf(records: Pick<RecordsAccess, "kind">): RecordKindHandle<StorageDrainStateBody>;
|
|
22
|
-
private ensureDeclared;
|
|
23
19
|
load(): Promise<readonly DrainState[]>;
|
|
24
20
|
save(state: DrainState): Promise<void>;
|
|
25
21
|
clear(locationId: string): Promise<void>;
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* tests pass a fake (in-memory `Map`-backed) implementation. Same
|
|
8
8
|
* pattern as `IntegrationRegistry` in `sqlite-storage/`.
|
|
9
9
|
*/
|
|
10
|
-
import type {
|
|
10
|
+
import type { LegacyStorageLocationDefault, RecordKindHandle, RecordsAccess, StorageLocation } from "@camstack/types";
|
|
11
11
|
import { type StorageLocationBody, type StorageSeedMarkerBody } from "./record-kinds.js";
|
|
12
12
|
/**
|
|
13
13
|
* A location as it comes back OFF DISK: the live record plus the retired
|
|
@@ -47,42 +47,25 @@ export interface ILocationStore {
|
|
|
47
47
|
unmarkTypeSeeded?(type: string): Promise<void>;
|
|
48
48
|
}
|
|
49
49
|
/**
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
50
|
+
* The keychain scope collection a storage location's secret fields are filed
|
|
51
|
+
* under (`row/storage_locations/<id>`). The table it was named for is gone; the
|
|
52
|
+
* string stays because existing secret markers point at it.
|
|
53
53
|
*/
|
|
54
|
-
export declare const
|
|
54
|
+
export declare const STORAGE_LOCATIONS_SECRET_SCOPE = "storage_locations";
|
|
55
55
|
/**
|
|
56
|
-
* `ILocationStore` on the
|
|
57
|
-
*
|
|
58
|
-
* directly (not the `settings-store` singleton) because since D44 the
|
|
59
|
-
* storage-orchestrator IS that singleton, and asking the registry for it would
|
|
60
|
-
* route this table back through the orchestrator itself.
|
|
56
|
+
* `ILocationStore` on the storage-orchestrator's own record kinds (`locations`
|
|
57
|
+
* and `seed-markers`).
|
|
61
58
|
*/
|
|
62
59
|
export declare class SqliteLocationStore implements ILocationStore {
|
|
63
|
-
private readonly store;
|
|
64
|
-
private declared;
|
|
65
60
|
private readonly locationsKind;
|
|
66
|
-
constructor(store: ISettingsStoreProvider, locationsKind?: RecordKindHandle<StorageLocationBody> | null, seedMarkersKind?: RecordKindHandle<StorageSeedMarkerBody> | null);
|
|
67
61
|
private readonly seedMarkersKind;
|
|
62
|
+
constructor(locationsKind: RecordKindHandle<StorageLocationBody>, seedMarkersKind: RecordKindHandle<StorageSeedMarkerBody>);
|
|
68
63
|
static seedMarkersOf(records: Pick<RecordsAccess, "kind">): RecordKindHandle<StorageSeedMarkerBody>;
|
|
69
64
|
loadSeededTypes(): Promise<readonly string[]>;
|
|
70
65
|
markTypeSeeded(type: string): Promise<void>;
|
|
71
66
|
unmarkTypeSeeded(type: string): Promise<void>;
|
|
72
67
|
static recordStoresOf(records: Pick<RecordsAccess, "kind">): RecordKindHandle<StorageLocationBody>;
|
|
73
|
-
|
|
74
|
-
* Lazy `declareCollection` — keeps the constructor cheap and async-free.
|
|
75
|
-
* Called from every mutation/read path; `declareCollection` is idempotent
|
|
76
|
-
* (and additive on shape changes), so repeated calls collapse to a no-op.
|
|
77
|
-
*/
|
|
78
|
-
private ensureDeclared;
|
|
79
|
-
loadAll(): Promise<readonly StorageLocation[]>;
|
|
80
|
-
/**
|
|
81
|
-
* Replace-or-insert. Implemented as delete + insert rather than a
|
|
82
|
-
* conditional update because the orchestrator serializes every mutation
|
|
83
|
-
* through the in-memory map before dispatching to the store — there's no
|
|
84
|
-
* contention to lose, and delete-then-insert is unconditionally simpler.
|
|
85
|
-
*/
|
|
68
|
+
loadAll(): Promise<readonly PersistedStorageLocation[]>;
|
|
86
69
|
upsert(loc: StorageLocation): Promise<void>;
|
|
87
70
|
delete(id: string): Promise<void>;
|
|
88
71
|
}
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { StorageLocationModeSchema, StorageLocationTypeSchema, type DefinedRecordKind } from "@camstack/types";
|
|
5
5
|
import { z } from "zod";
|
|
6
|
-
export declare const STORAGE_DRAIN_STATE_LEGACY = "storage_drain_state";
|
|
7
6
|
export type StorageLocationBody = {
|
|
8
7
|
readonly type: z.infer<typeof StorageLocationTypeSchema>;
|
|
9
8
|
readonly displayName: string;
|