@camstack/system 1.2.465 → 1.2.466
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/dist/addon-runner.js +1 -0
- package/dist/addon-runner.mjs +1 -0
- package/dist/{agent-https-CPJ7FTs0.mjs → agent-https-DDzIuZY_.mjs} +1 -1
- package/dist/{agent-https-CzA1AmyI.js → agent-https-OIvfjiTx.js} +1 -1
- 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/alerts.addon.js +1 -1
- package/dist/builtins/alerts/alerts.addon.mjs +1 -1
- package/dist/builtins/autotrack/index.js +1 -1
- package/dist/builtins/autotrack/index.mjs +1 -1
- package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +2 -2
- package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +2 -2
- package/dist/builtins/calendars/calendars.addon.js +1 -1
- package/dist/builtins/calendars/calendars.addon.mjs +1 -1
- package/dist/builtins/camera-grid/index.js +1 -1
- package/dist/builtins/camera-grid/index.mjs +1 -1
- 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/core-blocks.addon.js +2 -2
- package/dist/builtins/core-blocks/core-blocks.addon.mjs +2 -2
- package/dist/builtins/device-history/device-history.addon.js +1 -1
- package/dist/builtins/device-history/device-history.addon.mjs +1 -1
- package/dist/builtins/device-manager/device-manager.addon.js +1 -1
- package/dist/builtins/device-manager/device-manager.addon.mjs +1 -1
- package/dist/builtins/hub-forwarder/index.js +1 -1
- package/dist/builtins/hub-forwarder/index.mjs +1 -1
- package/dist/builtins/keychain/index.js +3 -3
- package/dist/builtins/keychain/index.mjs +3 -3
- 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 +0 -2
- package/dist/builtins/local-auth/local-auth.addon.d.ts +0 -1
- package/dist/builtins/local-auth/local-auth.addon.js +23 -178
- package/dist/builtins/local-auth/local-auth.addon.mjs +24 -178
- package/dist/builtins/local-auth/record-kinds.d.ts +1 -6
- 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/index.js +1 -1
- package/dist/builtins/record-entries/index.mjs +1 -1
- 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/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/records/records-engine.d.ts +11 -0
- package/dist/builtins/sqlite-storage/records/records-provider.d.ts +7 -2
- package/dist/builtins/sqlite-storage/sqlite-settings.addon.js +25 -15
- package/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +25 -15
- package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +1 -1
- package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +1 -1
- package/dist/builtins/system-config/system-config.addon.js +3 -3
- package/dist/builtins/system-config/system-config.addon.mjs +3 -3
- package/dist/builtins/winston-logging/index.js +1 -1
- package/dist/builtins/winston-logging/index.mjs +1 -1
- package/dist/{composition-sources-BG0E76VO.js → composition-sources-DqHwltDV.js} +1 -1
- package/dist/{composition-sources-CqRsEC0a.mjs → composition-sources-f74jlgRO.mjs} +1 -1
- package/dist/{constants-BYJ4ni7h.js → constants-CdgJF4V6.js} +1 -1
- package/dist/{constants-CmGw1liQ.mjs → constants-Dknv37yZ.mjs} +1 -1
- package/dist/{device-ca-CQcB6yfj.mjs → device-ca-B16Mr3EY.mjs} +1 -1
- package/dist/{device-ca-B-Txwl4W.js → device-ca-DpvQ5wrb.js} +1 -1
- package/dist/{dist-CR7idLer.mjs → dist-CfjkLTZV.mjs} +158 -66
- package/dist/{dist-Dwi4JA96.js → dist-QyW9hVO2.js} +175 -71
- package/dist/file-host-worker.js +1 -1
- package/dist/file-host-worker.mjs +1 -1
- package/dist/{hub-mdns-ciao-3qdHbtyp.js → hub-mdns-ciao-CWkX17zX.js} +2 -2
- package/dist/{hub-mdns-ciao-BlLwL65g.mjs → hub-mdns-ciao-CtHQEnb3.mjs} +2 -2
- package/dist/index.d.ts +0 -2
- package/dist/index.js +8 -8
- package/dist/index.mjs +10 -9
- package/dist/{restore-archive-BYL7E5af.mjs → restore-archive-BmHNBgte.mjs} +1 -1
- package/dist/{restore-archive-D1uxP8Eb.js → restore-archive-DMgpNgX5.js} +1 -1
- package/dist/{wal-maintenance-BQlvAduo.js → wal-maintenance-BIpPCYDi.js} +0 -0
- package/dist/{wal-maintenance-BDQT7TIi.mjs → wal-maintenance-Bs_X-di6.mjs} +0 -0
- package/package.json +1 -1
- package/dist/auth/api-key-manager.d.ts +0 -19
|
@@ -1,96 +1,15 @@
|
|
|
1
1
|
import { i as __require, o as __toESM, t as __commonJSMin } from "../../chunk-CNf5ZN-e.mjs";
|
|
2
|
-
import { $ as
|
|
3
|
-
import { t as require_read_all_rows } from "../../read-all-rows-TaPqdWNF.mjs";
|
|
2
|
+
import { $ as PreferenceNamespaceSchema, $r as BaseAddon, Ar as userManagementCapability, Ca as userError, Cn as isCredentialTokenPayload, Ct as authProviderCapability, E as DEVICE_ENROLLMENT_TTL_MS, Gi as defineRecordKinds, O as DEVICE_NONCE_TTL_MS, Ot as buildDeviceEnrollmentLink, Q as PreferenceDeviceIdSchema, Z as PREFERENCES_MAX_VALUE_BYTES, Zt as deviceCredentialsCapability, ct as SsoBridgeClaimsSchema, et as PreferenceValueSchema, h as CREDENTIAL_TOKEN_AUDIENCE, ht as UserRecordSchema, ia as makeSecretMarker, kt as buildDeviceSignatureMessage, mn as formatDeviceRevoker, ot as ScopedTokenSchema, pt as TokenScopeSchema, ta as isSecretMarker, y as CredentialTokenClaimsSchema } from "../../dist-CfjkLTZV.mjs";
|
|
4
3
|
import { t as require_safe_buffer } from "../../safe-buffer-B1OjL1I9.mjs";
|
|
5
4
|
import { t as require_ms } from "../../ms-CgH2OFlD.mjs";
|
|
6
|
-
import { _ as setProcessJwtSigningKey, a as importDevicePublicKey, c as rebuildDeviceCaCertificate, d as JWT_SIGNING_KEY_REF, g as processJwtSigningKey, h as loadJwtSigningKey, i as generateDeviceCa, l as verifyDeviceLeaf, m as getProcessJwtSigningKeyState, n as DEVICE_CA_KEY_REF, o as issueDeviceLeaf, r as DEVICE_CA_SETTINGS_SECTION, s as loadDeviceCa, t as DEVICE_CA_FIELD, u as verifyDeviceSignature } from "../../device-ca-
|
|
5
|
+
import { _ as setProcessJwtSigningKey, a as importDevicePublicKey, c as rebuildDeviceCaCertificate, d as JWT_SIGNING_KEY_REF, g as processJwtSigningKey, h as loadJwtSigningKey, i as generateDeviceCa, l as verifyDeviceLeaf, m as getProcessJwtSigningKeyState, n as DEVICE_CA_KEY_REF, o as issueDeviceLeaf, r as DEVICE_CA_SETTINGS_SECTION, s as loadDeviceCa, t as DEVICE_CA_FIELD, u as verifyDeviceSignature } from "../../device-ca-B16Mr3EY.mjs";
|
|
6
|
+
import { t as require_read_all_rows } from "../../read-all-rows-TaPqdWNF.mjs";
|
|
7
7
|
import { z } from "zod";
|
|
8
8
|
import * as crypto$1 from "node:crypto";
|
|
9
9
|
import { X509Certificate, createHash, randomUUID, timingSafeEqual } from "node:crypto";
|
|
10
10
|
import nodeCrypto from "crypto";
|
|
11
11
|
import * as path$1 from "node:path";
|
|
12
12
|
import * as fs$1 from "node:fs";
|
|
13
|
-
//#region src/auth/parse-record.ts
|
|
14
|
-
function parseRecord$2(kind, schema, data) {
|
|
15
|
-
try {
|
|
16
|
-
return schema.parse(data);
|
|
17
|
-
} catch (err) {
|
|
18
|
-
const topKeys = data && typeof data === "object" && !Array.isArray(data) ? Object.keys(data).join(", ") || "(empty)" : `(non-object: ${typeof data})`;
|
|
19
|
-
const detail = err instanceof Error ? err.message : String(err);
|
|
20
|
-
const hint = data && typeof data === "object" && !Array.isArray(data) && Object.keys(data).length === 1 && "data" in data ? " This shape is the legacy double-wrap from a stale settings-store query path. Restart the server with the latest @camstack/system build." : "";
|
|
21
|
-
throw new Error(`Failed to parse ${kind} from settings store. Top-level keys=[${topKeys}].${hint} Underlying: ${detail}`, { cause: err });
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
//#endregion
|
|
25
|
-
//#region src/auth/api-key-manager.ts
|
|
26
|
-
/**
|
|
27
|
-
* Legacy API keys — LIST and REVOKE only.
|
|
28
|
-
*
|
|
29
|
-
* No boundary accepts one (the tRPC context has no branch for them) and
|
|
30
|
-
* nothing creates them any more: what is left is the rows a hub may still
|
|
31
|
-
* hold, so an operator can see and delete them. Tokens (`auth.mintToken`) are
|
|
32
|
-
* the credential for scripts and integrations.
|
|
33
|
-
*/
|
|
34
|
-
var import_read_all_rows = require_read_all_rows();
|
|
35
|
-
var API_KEYS_COLLECTION$1 = "api_keys";
|
|
36
|
-
function parseApiKey(data) {
|
|
37
|
-
return parseRecord$2("api-key", ApiKeyRecordSchema, data);
|
|
38
|
-
}
|
|
39
|
-
function rowToApiKey(id, body) {
|
|
40
|
-
return parseApiKey({
|
|
41
|
-
id,
|
|
42
|
-
...body
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
var ApiKeyManager = class {
|
|
46
|
-
kind;
|
|
47
|
-
legacyStore;
|
|
48
|
-
constructor(deps) {
|
|
49
|
-
if ("apiKeysKind" in deps) {
|
|
50
|
-
this.kind = deps.apiKeysKind;
|
|
51
|
-
this.legacyStore = deps.legacyStore ?? null;
|
|
52
|
-
} else {
|
|
53
|
-
this.kind = null;
|
|
54
|
-
this.legacyStore = deps.getStore();
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
get store() {
|
|
58
|
-
if (this.legacyStore === null) throw new Error("ApiKeyManager: legacy store unavailable on records-only path");
|
|
59
|
-
return this.legacyStore;
|
|
60
|
-
}
|
|
61
|
-
async listAll() {
|
|
62
|
-
const kind = this.kind;
|
|
63
|
-
return (kind !== null ? (await (0, import_read_all_rows.readAllRows)(kind)).map((row) => rowToApiKey(row.id, row.data)) : (await this.store.query.query({ collection: API_KEYS_COLLECTION$1 })).map((r) => parseApiKey(r.data))).map((parsed) => {
|
|
64
|
-
const { tokenHash: _th, ...rest } = parsed;
|
|
65
|
-
return rest;
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
async revoke(id) {
|
|
69
|
-
const kind = this.kind;
|
|
70
|
-
if (kind !== null) {
|
|
71
|
-
await kind.delete(id);
|
|
72
|
-
return;
|
|
73
|
-
}
|
|
74
|
-
await this.store.delete.mutate({
|
|
75
|
-
collection: API_KEYS_COLLECTION$1,
|
|
76
|
-
key: id
|
|
77
|
-
});
|
|
78
|
-
}
|
|
79
|
-
async findById(id) {
|
|
80
|
-
const kind = this.kind;
|
|
81
|
-
if (kind !== null) {
|
|
82
|
-
const row = await kind.get(id);
|
|
83
|
-
return row === null ? null : rowToApiKey(row.id, row.data);
|
|
84
|
-
}
|
|
85
|
-
const results = await this.store.query.query({
|
|
86
|
-
collection: API_KEYS_COLLECTION$1,
|
|
87
|
-
filter: { where: { id } }
|
|
88
|
-
});
|
|
89
|
-
if (results.length === 0) return null;
|
|
90
|
-
return parseApiKey(results[0].data);
|
|
91
|
-
}
|
|
92
|
-
};
|
|
93
|
-
//#endregion
|
|
94
13
|
//#region ../../node_modules/bcryptjs/index.js
|
|
95
14
|
/**
|
|
96
15
|
* The random implementation to use as a fallback.
|
|
@@ -6335,6 +6254,7 @@ var AuthManager = class {
|
|
|
6335
6254
|
* cannot be stored is logged loudly instead, and never blocks the action
|
|
6336
6255
|
* (a login must not fail because the audit table is busy).
|
|
6337
6256
|
*/
|
|
6257
|
+
var import_read_all_rows = require_read_all_rows();
|
|
6338
6258
|
/**
|
|
6339
6259
|
* @durable class=ledger owner=local-auth
|
|
6340
6260
|
* write="one row per audited auth event: a second factor skipped from a trusted
|
|
@@ -6389,7 +6309,7 @@ var AUTH_AUDIT_ACTIONS = [
|
|
|
6389
6309
|
];
|
|
6390
6310
|
var RETENTION_MS = 90 * 864e5;
|
|
6391
6311
|
var MAX_LIST = 500;
|
|
6392
|
-
function parseRecord$
|
|
6312
|
+
function parseRecord$2(data) {
|
|
6393
6313
|
const id = data["id"];
|
|
6394
6314
|
const rawAt = data["at"];
|
|
6395
6315
|
const at = typeof rawAt === "number" ? rawAt : typeof rawAt === "string" && rawAt.trim() !== "" && Number.isFinite(Number(rawAt)) ? Number(rawAt) : null;
|
|
@@ -6482,7 +6402,7 @@ var AuthAuditLog = class {
|
|
|
6482
6402
|
order: "at",
|
|
6483
6403
|
desc: true,
|
|
6484
6404
|
limit
|
|
6485
|
-
})).records.map((row) => parseRecord$
|
|
6405
|
+
})).records.map((row) => parseRecord$2({
|
|
6486
6406
|
id: row.id,
|
|
6487
6407
|
at: row.at,
|
|
6488
6408
|
action: row.data.action,
|
|
@@ -6493,7 +6413,7 @@ var AuthAuditLog = class {
|
|
|
6493
6413
|
return (await this.store.query.query({
|
|
6494
6414
|
collection: AUTH_AUDIT_COLLECTION,
|
|
6495
6415
|
...input.userId !== void 0 ? { filter: { where: { userId: input.userId } } } : {}
|
|
6496
|
-
})).map((row) => parseRecord$
|
|
6416
|
+
})).map((row) => parseRecord$2(row.data)).filter((r) => r !== null).toSorted((a, b) => b.at - a.at).slice(0, limit);
|
|
6497
6417
|
}
|
|
6498
6418
|
/** Delete rows older than 90 days. Returns how many. */
|
|
6499
6419
|
async reap() {
|
|
@@ -6709,7 +6629,7 @@ var PLATFORMS = [
|
|
|
6709
6629
|
"web",
|
|
6710
6630
|
"other"
|
|
6711
6631
|
];
|
|
6712
|
-
function parseRecord(data) {
|
|
6632
|
+
function parseRecord$1(data) {
|
|
6713
6633
|
const id = str$1(data, "id");
|
|
6714
6634
|
const userId = str$1(data, "userId");
|
|
6715
6635
|
const deviceName = str$1(data, "deviceName");
|
|
@@ -6774,7 +6694,7 @@ var DeviceCredentialManager = class {
|
|
|
6774
6694
|
const kind = this.deps.deviceCredentialsKind ?? null;
|
|
6775
6695
|
if (kind !== null) {
|
|
6776
6696
|
for (const row of await (0, import_read_all_rows.readAllRows)(kind)) {
|
|
6777
|
-
const record = parseRecord({
|
|
6697
|
+
const record = parseRecord$1({
|
|
6778
6698
|
id: row.id,
|
|
6779
6699
|
...row.data
|
|
6780
6700
|
});
|
|
@@ -6784,7 +6704,7 @@ var DeviceCredentialManager = class {
|
|
|
6784
6704
|
}
|
|
6785
6705
|
const rows = await this.store.query.query({ collection: DEVICE_CREDENTIALS_COLLECTION });
|
|
6786
6706
|
for (const row of rows) {
|
|
6787
|
-
const record = parseRecord(row.data);
|
|
6707
|
+
const record = parseRecord$1(row.data);
|
|
6788
6708
|
if (record !== null) this.records.set(record.id, record);
|
|
6789
6709
|
}
|
|
6790
6710
|
}
|
|
@@ -7205,7 +7125,6 @@ var USERS_COLLECTION$1 = "users";
|
|
|
7205
7125
|
* expiry column and no sweep, so a key lives until someone removes it (or the
|
|
7206
7126
|
* destructive `declareCollection` rebuild takes the table)."
|
|
7207
7127
|
*/
|
|
7208
|
-
var API_KEYS_COLLECTION = "api_keys";
|
|
7209
7128
|
/**
|
|
7210
7129
|
* @durable class=config owner=local-auth
|
|
7211
7130
|
* write="none since D895 — the pre-D892 scoped-token rows are kept on disk,
|
|
@@ -7294,52 +7213,6 @@ var USERS_COLUMNS = [
|
|
|
7294
7213
|
notNull: true
|
|
7295
7214
|
}
|
|
7296
7215
|
];
|
|
7297
|
-
var API_KEYS_COLUMNS = [
|
|
7298
|
-
{
|
|
7299
|
-
name: "id",
|
|
7300
|
-
type: "TEXT",
|
|
7301
|
-
primaryKey: true,
|
|
7302
|
-
notNull: true
|
|
7303
|
-
},
|
|
7304
|
-
{
|
|
7305
|
-
name: "label",
|
|
7306
|
-
type: "TEXT",
|
|
7307
|
-
notNull: true
|
|
7308
|
-
},
|
|
7309
|
-
{
|
|
7310
|
-
name: "isAdmin",
|
|
7311
|
-
type: "BOOLEAN",
|
|
7312
|
-
notNull: true
|
|
7313
|
-
},
|
|
7314
|
-
{
|
|
7315
|
-
name: "tokenHash",
|
|
7316
|
-
type: "TEXT",
|
|
7317
|
-
notNull: true,
|
|
7318
|
-
unique: true
|
|
7319
|
-
},
|
|
7320
|
-
{
|
|
7321
|
-
name: "tokenPrefix",
|
|
7322
|
-
type: "TEXT",
|
|
7323
|
-
notNull: true
|
|
7324
|
-
},
|
|
7325
|
-
{
|
|
7326
|
-
name: "allowedProviders",
|
|
7327
|
-
type: "JSON"
|
|
7328
|
-
},
|
|
7329
|
-
{
|
|
7330
|
-
name: "allowedDevices",
|
|
7331
|
-
type: "JSON"
|
|
7332
|
-
},
|
|
7333
|
-
{
|
|
7334
|
-
name: "createdAt",
|
|
7335
|
-
type: "INTEGER",
|
|
7336
|
-
notNull: true
|
|
7337
|
-
},
|
|
7338
|
-
{
|
|
7339
|
-
name: "lastUsedAt",
|
|
7340
|
-
type: "INTEGER"
|
|
7341
|
-
}
|
|
7342
|
-
];
|
|
7343
7216
|
var USER_TOTP_COLUMNS = [
|
|
7344
7217
|
{
|
|
7345
7218
|
name: "userId",
|
|
@@ -7457,14 +7330,6 @@ async function declareAuthSchema(store, options) {
|
|
|
7457
7330
|
collection: USERS_COLLECTION$1,
|
|
7458
7331
|
columns: USERS_COLUMNS
|
|
7459
7332
|
});
|
|
7460
|
-
if (!skip.has("api_keys")) await store.declareCollection.mutate({
|
|
7461
|
-
collection: API_KEYS_COLLECTION,
|
|
7462
|
-
columns: API_KEYS_COLUMNS,
|
|
7463
|
-
indexes: [{
|
|
7464
|
-
name: "idx_api_keys_token_prefix",
|
|
7465
|
-
columns: ["tokenPrefix"]
|
|
7466
|
-
}]
|
|
7467
|
-
});
|
|
7468
7333
|
if (!skip.has("scoped_tokens")) await store.declareCollection.mutate({
|
|
7469
7334
|
collection: SCOPED_TOKENS_COLLECTION,
|
|
7470
7335
|
columns: SCOPED_TOKENS_COLUMNS,
|
|
@@ -7538,7 +7403,6 @@ async function declareAuthSchema(store, options) {
|
|
|
7538
7403
|
*/
|
|
7539
7404
|
var DAY_MS = 864e5;
|
|
7540
7405
|
var UserBodySchema = UserRecordSchema.omit({ id: true });
|
|
7541
|
-
var ApiKeyBodySchema = ApiKeyRecordSchema.omit({ id: true });
|
|
7542
7406
|
var ScopedTokenBodySchema = ScopedTokenSchema.omit({ id: true });
|
|
7543
7407
|
var AdminTokenBodySchema = z.object({
|
|
7544
7408
|
createdBy: z.string(),
|
|
@@ -7626,18 +7490,6 @@ var _localAuthRecordKinds = defineRecordKinds({
|
|
|
7626
7490
|
}],
|
|
7627
7491
|
retention: { none: "row goes only when an operator deletes the user; destructive declareCollection rebuild wipes all accounts" }
|
|
7628
7492
|
},
|
|
7629
|
-
"api-keys": {
|
|
7630
|
-
schema: ApiKeyBodySchema,
|
|
7631
|
-
class: "config",
|
|
7632
|
-
writeTrigger: "legacy list/revoke only — nothing creates new API keys",
|
|
7633
|
-
device: "none",
|
|
7634
|
-
at: "none",
|
|
7635
|
-
indexes: [{
|
|
7636
|
-
name: "prefix",
|
|
7637
|
-
fields: ["tokenPrefix"]
|
|
7638
|
-
}],
|
|
7639
|
-
retention: { none: "explicit revoke only" }
|
|
7640
|
-
},
|
|
7641
7493
|
"scoped-tokens": {
|
|
7642
7494
|
schema: ScopedTokenBodySchema,
|
|
7643
7495
|
class: "config",
|
|
@@ -7774,7 +7626,6 @@ var _localAuthRecordKinds = defineRecordKinds({
|
|
|
7774
7626
|
});
|
|
7775
7627
|
var localAuthRecordKinds = _localAuthRecordKinds;
|
|
7776
7628
|
var localAuthUsersRecordKind = _localAuthRecordKinds.users;
|
|
7777
|
-
var localAuthApiKeysRecordKind = _localAuthRecordKinds["api-keys"];
|
|
7778
7629
|
_localAuthRecordKinds["scoped-tokens"];
|
|
7779
7630
|
_localAuthRecordKinds["admin-tokens"];
|
|
7780
7631
|
var localAuthLoginSessionsRecordKind = _localAuthRecordKinds["login-sessions"];
|
|
@@ -7787,7 +7638,6 @@ var localAuthAuthAuditRecordKind = _localAuthRecordKinds["auth-audit"];
|
|
|
7787
7638
|
/** Legacy collections that must not be `declareCollection` once these kinds are live. */
|
|
7788
7639
|
var LOCAL_AUTH_RECORDS_LEGACY_COLLECTIONS = [
|
|
7789
7640
|
USERS_COLLECTION$1,
|
|
7790
|
-
API_KEYS_COLLECTION,
|
|
7791
7641
|
SCOPED_TOKENS_COLLECTION,
|
|
7792
7642
|
ADMIN_TOKENS_COLLECTION,
|
|
7793
7643
|
LOGIN_SESSIONS_COLLECTION,
|
|
@@ -7800,7 +7650,6 @@ var LOCAL_AUTH_RECORDS_LEGACY_COLLECTIONS = [
|
|
|
7800
7650
|
function localAuthRecordStoresOf(records) {
|
|
7801
7651
|
return {
|
|
7802
7652
|
users: records.kind(localAuthUsersRecordKind),
|
|
7803
|
-
apiKeys: records.kind(localAuthApiKeysRecordKind),
|
|
7804
7653
|
loginSessions: records.kind(localAuthLoginSessionsRecordKind),
|
|
7805
7654
|
loginSessionCutoffs: records.kind(localAuthLoginSessionCutoffsRecordKind),
|
|
7806
7655
|
oauthSessions: records.kind(localAuthOauthSessionsRecordKind),
|
|
@@ -8720,6 +8569,18 @@ function getUserManagementInternal(provider) {
|
|
|
8720
8569
|
return internal;
|
|
8721
8570
|
}
|
|
8722
8571
|
//#endregion
|
|
8572
|
+
//#region src/auth/parse-record.ts
|
|
8573
|
+
function parseRecord(kind, schema, data) {
|
|
8574
|
+
try {
|
|
8575
|
+
return schema.parse(data);
|
|
8576
|
+
} catch (err) {
|
|
8577
|
+
const topKeys = data && typeof data === "object" && !Array.isArray(data) ? Object.keys(data).join(", ") || "(empty)" : `(non-object: ${typeof data})`;
|
|
8578
|
+
const detail = err instanceof Error ? err.message : String(err);
|
|
8579
|
+
const hint = data && typeof data === "object" && !Array.isArray(data) && Object.keys(data).length === 1 && "data" in data ? " This shape is the legacy double-wrap from a stale settings-store query path. Restart the server with the latest @camstack/system build." : "";
|
|
8580
|
+
throw new Error(`Failed to parse ${kind} from settings store. Top-level keys=[${topKeys}].${hint} Underlying: ${detail}`, { cause: err });
|
|
8581
|
+
}
|
|
8582
|
+
}
|
|
8583
|
+
//#endregion
|
|
8723
8584
|
//#region src/auth/user-manager.ts
|
|
8724
8585
|
var USERS_COLLECTION = "users";
|
|
8725
8586
|
/**
|
|
@@ -8731,7 +8592,7 @@ var USERS_COLLECTION = "users";
|
|
|
8731
8592
|
var FIRST_BOOT_ADMIN_USERNAME = "admin";
|
|
8732
8593
|
var FIRST_BOOT_ADMIN_PASSWORD = "changeme";
|
|
8733
8594
|
function parseUser(data) {
|
|
8734
|
-
return parseRecord
|
|
8595
|
+
return parseRecord("user", UserRecordSchema, data);
|
|
8735
8596
|
}
|
|
8736
8597
|
function userToBody(user) {
|
|
8737
8598
|
const { id: _id, ...body } = user;
|
|
@@ -12121,7 +11982,6 @@ function toAuthResult(user) {
|
|
|
12121
11982
|
var LocalAuthAddon = class extends BaseAddon {
|
|
12122
11983
|
authManager = null;
|
|
12123
11984
|
userManager = null;
|
|
12124
|
-
apiKeyManager = null;
|
|
12125
11985
|
oauthSessionManager = null;
|
|
12126
11986
|
reapTimer = null;
|
|
12127
11987
|
totpManager = null;
|
|
@@ -12157,10 +12017,6 @@ var LocalAuthAddon = class extends BaseAddon {
|
|
|
12157
12017
|
usersKind: authStores.users,
|
|
12158
12018
|
legacyStore: store
|
|
12159
12019
|
}, this.authManager);
|
|
12160
|
-
this.apiKeyManager = new ApiKeyManager({
|
|
12161
|
-
apiKeysKind: authStores.apiKeys,
|
|
12162
|
-
legacyStore: store
|
|
12163
|
-
});
|
|
12164
12020
|
this.oauthSessionManager = new OauthSessionManager({ oauthSessionsKind: authStores.oauthSessions });
|
|
12165
12021
|
this.totpManager = new TotpManager({
|
|
12166
12022
|
userTotpKind: authStores.userTotp,
|
|
@@ -12325,15 +12181,6 @@ var LocalAuthAddon = class extends BaseAddon {
|
|
|
12325
12181
|
totpEnabled
|
|
12326
12182
|
};
|
|
12327
12183
|
},
|
|
12328
|
-
listApiKeys: async () => {
|
|
12329
|
-
if (!this.apiKeyManager) return [];
|
|
12330
|
-
return this.apiKeyManager.listAll();
|
|
12331
|
-
},
|
|
12332
|
-
revokeApiKey: async (input) => {
|
|
12333
|
-
if (!this.apiKeyManager) throw new Error("API key management not available");
|
|
12334
|
-
await this.apiKeyManager.revoke(input.id);
|
|
12335
|
-
return { success: true };
|
|
12336
|
-
},
|
|
12337
12184
|
oauthIssueCode: async (input) => {
|
|
12338
12185
|
return lazyOauthGrants().oauthIssueCode(input);
|
|
12339
12186
|
},
|
|
@@ -12694,7 +12541,6 @@ var LocalAuthAddon = class extends BaseAddon {
|
|
|
12694
12541
|
}
|
|
12695
12542
|
this.authManager = null;
|
|
12696
12543
|
this.userManager = null;
|
|
12697
|
-
this.apiKeyManager = null;
|
|
12698
12544
|
this.oauthSessionManager = null;
|
|
12699
12545
|
this.externalIdentities = null;
|
|
12700
12546
|
this.loginSessions = null;
|
|
@@ -12704,4 +12550,4 @@ var LocalAuthAddon = class extends BaseAddon {
|
|
|
12704
12550
|
}
|
|
12705
12551
|
};
|
|
12706
12552
|
//#endregion
|
|
12707
|
-
export { LocalAuthAddon, LocalAuthAddon as default, SettingsReadUnavailableError as _, attachUserManagementInternal as a, DeviceCaStore as c, onSessionsRevoked as d, DeviceCredentialManager as f, parseTokenExpiry as g, AuthManager as h, USER_MANAGEMENT_INTERNAL as i, LoginSessionManager as l, AuthAuditLog as m, FIRST_BOOT_ADMIN_USERNAME as n, getUserManagementInternal as o, PREVIOUS_LEAF_GRACE_MS as p, UserManager as r, preferencesLimitReasonOf as s, FIRST_BOOT_ADMIN_PASSWORD as t, REFRESH_TOKEN_PREFIX as u, isSettingsReadUnavailable as v
|
|
12553
|
+
export { LocalAuthAddon, LocalAuthAddon as default, SettingsReadUnavailableError as _, attachUserManagementInternal as a, DeviceCaStore as c, onSessionsRevoked as d, DeviceCredentialManager as f, parseTokenExpiry as g, AuthManager as h, USER_MANAGEMENT_INTERNAL as i, LoginSessionManager as l, AuthAuditLog as m, FIRST_BOOT_ADMIN_USERNAME as n, getUserManagementInternal as o, PREVIOUS_LEAF_GRACE_MS as p, UserManager as r, preferencesLimitReasonOf as s, FIRST_BOOT_ADMIN_PASSWORD as t, REFRESH_TOKEN_PREFIX as u, isSettingsReadUnavailable as v };
|
|
@@ -10,12 +10,10 @@
|
|
|
10
10
|
* `scoped-tokens` and `admin-tokens` hold pre-D892 rows read by nothing since
|
|
11
11
|
* D895; they stay declared so the layout is unchanged.
|
|
12
12
|
*/
|
|
13
|
-
import {
|
|
13
|
+
import { type DefinedRecordKind, type RecordKindHandle, type RecordsAccess, ScopedTokenSchema, TokenScopeSchema, UserRecordSchema } from "@camstack/types";
|
|
14
14
|
import { z } from "zod";
|
|
15
15
|
export type UserBody = Omit<z.infer<typeof UserRecordSchema>, "id">;
|
|
16
16
|
export declare const UserBodySchema: z.ZodType<UserBody>;
|
|
17
|
-
export type ApiKeyBody = Omit<z.infer<typeof ApiKeyRecordSchema>, "id">;
|
|
18
|
-
export declare const ApiKeyBodySchema: z.ZodType<ApiKeyBody>;
|
|
19
17
|
export type ScopedTokenBody = Omit<z.infer<typeof ScopedTokenSchema>, "id">;
|
|
20
18
|
export declare const ScopedTokenBodySchema: z.ZodType<ScopedTokenBody>;
|
|
21
19
|
export type AdminTokenBody = {
|
|
@@ -103,7 +101,6 @@ export type AuthAuditBody = {
|
|
|
103
101
|
export declare const AuthAuditBodySchema: z.ZodType<AuthAuditBody>;
|
|
104
102
|
export type LocalAuthRecordKindsMap = {
|
|
105
103
|
readonly users: DefinedRecordKind<z.ZodType<UserBody>>;
|
|
106
|
-
readonly "api-keys": DefinedRecordKind<z.ZodType<ApiKeyBody>>;
|
|
107
104
|
readonly "scoped-tokens": DefinedRecordKind<z.ZodType<ScopedTokenBody>>;
|
|
108
105
|
readonly "admin-tokens": DefinedRecordKind<z.ZodType<AdminTokenBody>>;
|
|
109
106
|
readonly "login-sessions": DefinedRecordKind<z.ZodType<LoginSessionBody>>;
|
|
@@ -116,7 +113,6 @@ export type LocalAuthRecordKindsMap = {
|
|
|
116
113
|
};
|
|
117
114
|
export declare const localAuthRecordKinds: LocalAuthRecordKindsMap;
|
|
118
115
|
export declare const localAuthUsersRecordKind: DefinedRecordKind<z.ZodType<UserBody>>;
|
|
119
|
-
export declare const localAuthApiKeysRecordKind: DefinedRecordKind<z.ZodType<ApiKeyBody>>;
|
|
120
116
|
export declare const localAuthScopedTokensRecordKind: DefinedRecordKind<z.ZodType<ScopedTokenBody>>;
|
|
121
117
|
export declare const localAuthAdminTokensRecordKind: DefinedRecordKind<z.ZodType<AdminTokenBody>>;
|
|
122
118
|
export declare const localAuthLoginSessionsRecordKind: DefinedRecordKind<z.ZodType<LoginSessionBody>>;
|
|
@@ -130,7 +126,6 @@ export declare const localAuthAuthAuditRecordKind: DefinedRecordKind<z.ZodType<A
|
|
|
130
126
|
export declare const LOCAL_AUTH_RECORDS_LEGACY_COLLECTIONS: readonly string[];
|
|
131
127
|
export interface LocalAuthRecordStores {
|
|
132
128
|
readonly users: RecordKindHandle<UserBody>;
|
|
133
|
-
readonly apiKeys: RecordKindHandle<ApiKeyBody>;
|
|
134
129
|
readonly loginSessions: RecordKindHandle<LoginSessionBody>;
|
|
135
130
|
readonly loginSessionCutoffs: RecordKindHandle<LoginSessionCutoffBody>;
|
|
136
131
|
readonly oauthSessions: RecordKindHandle<OauthSessionBody>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_chunk = require("../../chunk-Cek0wNdY.js");
|
|
3
|
-
const require_dist = require("../../dist-
|
|
4
|
-
const require_hub_mdns_ciao = require("../../hub-mdns-ciao-
|
|
3
|
+
const require_dist = require("../../dist-QyW9hVO2.js");
|
|
4
|
+
const require_hub_mdns_ciao = require("../../hub-mdns-ciao-CWkX17zX.js");
|
|
5
5
|
let zod = require("zod");
|
|
6
6
|
let node_net = require("node:net");
|
|
7
7
|
let node_os = require("node:os");
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { $r as
|
|
2
|
-
import { P as readLanHttpState, a as storeUploadedCertificate, d as servedHttpsLeafFingerprint, g as readTlsMode, h as readTlsAccessStatus, i as revertToGeneratedCertificate, j as applyLanHttp, k as DEFAULT_LAN_HTTP_PORT, m as readExtraSans, n as applyCertificateToListener, o as useStoredUploadedCertificate, r as regenerateCertificate, t as createCiaoPublisher, v as writeExtraSans, w as ensureTlsCert } from "../../hub-mdns-ciao-
|
|
1
|
+
import { $r as BaseAddon, B as HUB_MDNS_SERVICE_TYPE, Mr as validateCustomAddress, Pn as localNetworkCapability, Pt as checkRoleAddress, Qr as errMsg, Ta as EventCategory, V as HUB_MDNS_TXT_KEYS, X as NetworkTunnelStartedDataSchema, Xn as pickAppLinkHub, ar as resolveAppConnections, bn as isAppLinkBase, c as CAMSTACK_APP_LINK_ORIGIN, fr as resolveNotificationTapAddress, lr as resolveHubAddressRoles, vr as shortHostname, wn as isDefaultAppConnectionEndpoint } from "../../dist-CfjkLTZV.mjs";
|
|
2
|
+
import { P as readLanHttpState, a as storeUploadedCertificate, d as servedHttpsLeafFingerprint, g as readTlsMode, h as readTlsAccessStatus, i as revertToGeneratedCertificate, j as applyLanHttp, k as DEFAULT_LAN_HTTP_PORT, m as readExtraSans, n as applyCertificateToListener, o as useStoredUploadedCertificate, r as regenerateCertificate, t as createCiaoPublisher, v as writeExtraSans, w as ensureTlsCert } from "../../hub-mdns-ciao-CtHQEnb3.mjs";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
import { isIP } from "node:net";
|
|
5
5
|
import * as os$1 from "node:os";
|
|
@@ -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-
|
|
6
|
+
const require_dist = require("../../dist-QyW9hVO2.js");
|
|
7
7
|
const require_log_read_filter = require("../../log-read-filter-Bi066jwU.js");
|
|
8
8
|
let zod = require("zod");
|
|
9
9
|
//#region src/builtins/loki-logging/loki-payload.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { $r as BaseAddon, In as logDestinationCapability } from "../../dist-CfjkLTZV.mjs";
|
|
2
2
|
import { n as compileLogFilter, o as lineMatches } from "../../log-read-filter-D7Ev3zm-.mjs";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
//#region src/builtins/loki-logging/loki-payload.ts
|
|
@@ -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-
|
|
6
|
+
const require_dist = require("../../dist-QyW9hVO2.js");
|
|
7
7
|
let node_fs_promises = require("node:fs/promises");
|
|
8
8
|
let node_util = require("node:util");
|
|
9
9
|
let node_os = require("node:os");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $r as
|
|
1
|
+
import { $r as BaseAddon, Hi as createEvent, Hn as metricsProviderCapability, Qr as errMsg, Ta as EventCategory, mt as UNATTRIBUTED_BUCKET_KEY, nt as ROOT_BUCKET_KEY, or as resolveBucketMs, pn as foldSnapshotByFunction, rr as reducePoints } from "../../dist-CfjkLTZV.mjs";
|
|
2
2
|
import { access, readFile, readdir } from "node:fs/promises";
|
|
3
3
|
import { promisify } from "node:util";
|
|
4
4
|
import * as os$1 from "node:os";
|
|
@@ -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-
|
|
6
|
+
const require_dist = require("../../dist-QyW9hVO2.js");
|
|
7
7
|
const require_coral_accelerators = require("../../coral-accelerators-oUXmmbc2.js");
|
|
8
8
|
let node_util = require("node:util");
|
|
9
9
|
let node_os = require("node:os");
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { o as __toESM, r as __exportAll } from "../../chunk-CNf5ZN-e.mjs";
|
|
2
|
-
import { $
|
|
2
|
+
import { $r as BaseAddon, Qn as platformProbeCapability, Qr as errMsg, Ta as EventCategory, gr as scoreRuntimes, in as enumerateInferenceDevices, qi as emitReadiness } from "../../dist-CfjkLTZV.mjs";
|
|
3
3
|
import { n as nodeCoralFs, t as classifyCoralAccelerator } from "../../coral-accelerators-Qhn5TOYZ.mjs";
|
|
4
4
|
import { promisify } from "node:util";
|
|
5
5
|
import * as os$1 from "node:os";
|
|
@@ -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-
|
|
6
|
+
const require_dist = require("../../dist-QyW9hVO2.js");
|
|
7
7
|
let zod = require("zod");
|
|
8
8
|
let node_crypto = require("node:crypto");
|
|
9
9
|
//#region src/builtins/record-entries/entries-service.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { $r as BaseAddon, Ai as UnknownRecordKindError, aa as mapSecretLeaves, li as InvalidRecordError, pa as recordSecretRef, tr as recordEntriesCapability } from "../../dist-CfjkLTZV.mjs";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
import { randomUUID } from "node:crypto";
|
|
4
4
|
//#region src/builtins/record-entries/entries-service.ts
|
|
@@ -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-
|
|
6
|
+
const require_dist = require("../../dist-QyW9hVO2.js");
|
|
7
7
|
//#region src/builtins/remote-access-orchestrator/enabled-providers-reconcile.ts
|
|
8
8
|
/**
|
|
9
9
|
* Reconcile the durable `enabledProviders` set against authoritative
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { $r as BaseAddon, Ta as EventCategory } from "../../dist-CfjkLTZV.mjs";
|
|
2
2
|
//#region src/builtins/remote-access-orchestrator/enabled-providers-reconcile.ts
|
|
3
3
|
/**
|
|
4
4
|
* Reconcile the durable `enabledProviders` set against authoritative
|
|
@@ -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-
|
|
6
|
+
const require_dist = require("../../dist-QyW9hVO2.js");
|
|
7
7
|
const require_snapshot_courtesy = require("../../snapshot-courtesy-D_C5-nC0.js");
|
|
8
8
|
let zod = require("zod");
|
|
9
9
|
let node_crypto = require("node:crypto");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $r as
|
|
1
|
+
import { $r as BaseAddon, Et as batteryCapability, Or as streamQualityLabel, Qr as errMsg, Ta as EventCategory, Tt as bareAddonId, Vn as memoizePinnedFfmpeg, Yr as DeviceFeature, Yt as deriveBatteryPresence, Zr as DeviceType, br as snapshotCapability, o as BatteryStatusSchema, oa as nodePin } from "../../dist-CfjkLTZV.mjs";
|
|
2
2
|
import { i as renderCourtesyOverlayJpeg, n as courtesyCacheKey, r as renderCourtesyJpeg } from "../../snapshot-courtesy-CyFs1M3I.mjs";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
import { randomUUID } from "node:crypto";
|
|
@@ -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-
|
|
6
|
+
const require_dist = require("../../dist-QyW9hVO2.js");
|
|
7
7
|
let node_crypto = require("node:crypto");
|
|
8
8
|
let node_fs_promises = require("node:fs/promises");
|
|
9
9
|
let node_path = require("node:path");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { $r as BaseAddon, Er as storageProviderCapability, fn as filesystemBrowseCapability } from "../../dist-CfjkLTZV.mjs";
|
|
2
2
|
import { randomUUID } from "node:crypto";
|
|
3
3
|
import { mkdir, readdir, realpath, statfs } from "node:fs/promises";
|
|
4
4
|
import * as path$1 from "node:path";
|
|
@@ -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-BIpPCYDi.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 { A as SQLITE_MMAP_CEILING_BYTES, B as SQLITE_SLOW_CALL_MS, F as sqlitePageCacheKibFor, H as sqliteEngineStorm, I as SQLITE_ENGINE_STORM_WALL_SHARE, L as SQLITE_PROFILE_REPORT_FLOOR_MS, M as SQLITE_PAGE_CACHE_CEILING_KIB, N as SQLITE_PAGE_CACHE_FLOOR_KIB, P as sqliteMmapSizeFor, R as SQLITE_PROFILE_REPORT_INTERVAL_MS, V as SqliteOpProfiler, a as WalMaintenance, i as WAL_MAINTENANCE_INTERVAL_MS, j as SQLITE_MMAP_FLOOR_BYTES, k as SQLITE_JOURNAL_SIZE_LIMIT_BYTES, l as SqliteSettingsBackend, n as WAL_HIGH_WATER_BYTES, r as WAL_IDLE_QUIET_MS, t as WAL_CHECKPOINT_BUSY_TIMEOUT_MS, z as SQLITE_PROFILE_TOP_N } from "../../wal-maintenance-
|
|
2
|
+
import { A as SQLITE_MMAP_CEILING_BYTES, B as SQLITE_SLOW_CALL_MS, F as sqlitePageCacheKibFor, H as sqliteEngineStorm, I as SQLITE_ENGINE_STORM_WALL_SHARE, L as SQLITE_PROFILE_REPORT_FLOOR_MS, M as SQLITE_PAGE_CACHE_CEILING_KIB, N as SQLITE_PAGE_CACHE_FLOOR_KIB, P as sqliteMmapSizeFor, R as SQLITE_PROFILE_REPORT_INTERVAL_MS, V as SqliteOpProfiler, a as WalMaintenance, i as WAL_MAINTENANCE_INTERVAL_MS, j as SQLITE_MMAP_FLOOR_BYTES, k as SQLITE_JOURNAL_SIZE_LIMIT_BYTES, l as SqliteSettingsBackend, n as WAL_HIGH_WATER_BYTES, r as WAL_IDLE_QUIET_MS, t as WAL_CHECKPOINT_BUSY_TIMEOUT_MS, z as SQLITE_PROFILE_TOP_N } from "../../wal-maintenance-Bs_X-di6.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 {
|
|
@@ -60,8 +60,19 @@ export declare class RecordsEngine implements RecordsEngineOps {
|
|
|
60
60
|
put(input: OwnedInput<"put">): Promise<RecordsOutput<"put">>;
|
|
61
61
|
putMany(input: OwnedInput<"putMany">): Promise<RecordsOutput<"putMany">>;
|
|
62
62
|
patch(input: OwnedInput<"patch">): Promise<RecordsOutput<"patch">>;
|
|
63
|
+
/** One patch, inside the caller's transaction (shared with `transact`). */
|
|
64
|
+
private patchRecord;
|
|
63
65
|
private refsOfRows;
|
|
64
66
|
delete(input: OwnedInput<"delete">): Promise<RecordsOutput<"delete">>;
|
|
67
|
+
/** One delete (shared with `transact`). */
|
|
68
|
+
private deleteRecord;
|
|
69
|
+
/**
|
|
70
|
+
* Several put / patch / delete in ONE SQLite transaction. The scope rule
|
|
71
|
+
* (one file, one `transactFamily`) is checked before a row moves; each op then
|
|
72
|
+
* runs the very code of the single-row write, so secrets, indexes and size
|
|
73
|
+
* bounds behave exactly as there. Any op throwing rolls the whole call back.
|
|
74
|
+
*/
|
|
75
|
+
transact(input: OwnedInput<"transact">): Promise<RecordsOutput<"transact">>;
|
|
65
76
|
deleteMany(input: OwnedInput<"deleteMany">): Promise<RecordsOutput<"deleteMany">>;
|
|
66
77
|
/** Delete the rows `selectSql` names, in batches, yielding between them. */
|
|
67
78
|
private deleteBatched;
|
|
@@ -10,8 +10,7 @@
|
|
|
10
10
|
* declaration. A kind declared for another file than the one it lives in is
|
|
11
11
|
* refused (the engine never moves data, D853).
|
|
12
12
|
* - **No adoption** (D900): the records migration is closed. A declaration
|
|
13
|
-
* reads no legacy table
|
|
14
|
-
* sends is dropped before the catalog stores the declaration.
|
|
13
|
+
* reads no legacy table.
|
|
15
14
|
*/
|
|
16
15
|
import { type IRecordsProvider, type IScopedLogger, type IStorageAdminProvider, type StorageKind } from "@camstack/types";
|
|
17
16
|
import type { PlacementRouter } from "../placement-router.js";
|
|
@@ -46,6 +45,12 @@ export declare class RecordsProvider implements IRecordsProvider, AdminRecords {
|
|
|
46
45
|
histogram(input: Parameters<IRecordsProvider["histogram"]>[0]): ReturnType<IRecordsProvider["histogram"]>;
|
|
47
46
|
aggregate(input: Parameters<IRecordsProvider["aggregate"]>[0]): ReturnType<IRecordsProvider["aggregate"]>;
|
|
48
47
|
deleteWhere(input: Parameters<IRecordsProvider["deleteWhere"]>[0]): ReturnType<IRecordsProvider["deleteWhere"]>;
|
|
48
|
+
/**
|
|
49
|
+
* All ops must resolve to ONE file (`records/transact-refused` `cross-file`
|
|
50
|
+
* otherwise); that file's engine then checks the family and runs one SQLite
|
|
51
|
+
* transaction.
|
|
52
|
+
*/
|
|
53
|
+
transact(input: Parameters<IRecordsProvider["transact"]>[0]): ReturnType<IRecordsProvider["transact"]>;
|
|
49
54
|
allocateId(input: Parameters<IRecordsProvider["allocateId"]>[0]): ReturnType<IRecordsProvider["allocateId"]>;
|
|
50
55
|
/** The D865 hook body: every file that holds kinds of this owner. */
|
|
51
56
|
deleteDevice(input: Parameters<IRecordsProvider["deleteDevice"]>[0]): ReturnType<IRecordsProvider["deleteDevice"]>;
|