@noy-db/hub 0.4.0-pre.11 → 0.4.0-pre.12

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.
@@ -6,7 +6,7 @@ import {
6
6
  diffVault,
7
7
  unsealDeks,
8
8
  withCargo
9
- } from "../chunk-YZJSJOUI.js";
9
+ } from "../chunk-DSJG26FE.js";
10
10
  import {
11
11
  NO_CARGO,
12
12
  isQuorum,
@@ -26,12 +26,12 @@ import "../chunk-FQZ6XTQ7.js";
26
26
  import "../chunk-I5GEJX3R.js";
27
27
  import "../chunk-X45JYIAY.js";
28
28
  import "../chunk-DMH3VZU5.js";
29
- import {
30
- fuseRetrieval
31
- } from "../chunk-AURFOK3D.js";
32
29
  import {
33
30
  CustodyApi
34
31
  } from "../chunk-YWWQM7KP.js";
32
+ import {
33
+ fuseRetrieval
34
+ } from "../chunk-AURFOK3D.js";
35
35
  import "../chunk-GWWOGNBK.js";
36
36
  import {
37
37
  groupAndReduce,
@@ -399,7 +399,7 @@ async function createOwnerOnAdoptedPartition(store, vaultName, opts) {
399
399
  }
400
400
  }
401
401
  if (isManaged(opts)) {
402
- const { createNoydb } = await import("./noydb-FZZIMLCI.js");
402
+ const { createNoydb } = await import("./noydb-LPUMSDBR.js");
403
403
  const db = await createNoydb({
404
404
  store,
405
405
  user: userId,
@@ -455,4 +455,4 @@ export {
455
455
  withCargo,
456
456
  describeExtraction
457
457
  };
458
- //# sourceMappingURL=chunk-YZJSJOUI.js.map
458
+ //# sourceMappingURL=chunk-DSJG26FE.js.map
@@ -1,3 +1,7 @@
1
+ import {
2
+ hashFields,
3
+ validateSatelliteDeclaration
4
+ } from "./chunk-SHEEBRZ4.js";
1
5
  import {
2
6
  resolveStaleOnRead
3
7
  } from "./chunk-NJ4DYYO5.js";
@@ -8,9 +12,9 @@ import {
8
12
  linkRowKey
9
13
  } from "./chunk-4JQK3L4V.js";
10
14
  import {
11
- hashFields,
12
- validateSatelliteDeclaration
13
- } from "./chunk-SHEEBRZ4.js";
15
+ isBaseLive,
16
+ liveBaseIdSet
17
+ } from "./chunk-GYGLAVCX.js";
14
18
  import {
15
19
  loadFence
16
20
  } from "./chunk-LNZKOUJR.js";
@@ -24,9 +28,10 @@ import {
24
28
  SchemaUpdateGate
25
29
  } from "./chunk-6LJY7X5A.js";
26
30
  import {
27
- isBaseLive,
28
- liveBaseIdSet
29
- } from "./chunk-GYGLAVCX.js";
31
+ NO_CLASSIFIED,
32
+ guardClassifiedCompat,
33
+ resolveClassifiedFields
34
+ } from "./chunk-EE7UHLKH.js";
30
35
  import {
31
36
  NO_TIERS,
32
37
  classifySealedShred,
@@ -50,6 +55,10 @@ import {
50
55
  derivePersistedSchema,
51
56
  isZod4Schema
52
57
  } from "./chunk-6ZNSB3H6.js";
58
+ import {
59
+ CustodyApi,
60
+ NO_CUSTODY
61
+ } from "./chunk-YWWQM7KP.js";
53
62
  import {
54
63
  DEFAULT_POSTURE,
55
64
  ViaGraph
@@ -89,10 +98,8 @@ import {
89
98
  NO_ATTESTATION
90
99
  } from "./chunk-5GQEU4DN.js";
91
100
  import {
92
- NO_CLASSIFIED,
93
- guardClassifiedCompat,
94
- resolveClassifiedFields
95
- } from "./chunk-EE7UHLKH.js";
101
+ NO_CONSENT
102
+ } from "./chunk-PEOZ34EM.js";
96
103
  import {
97
104
  NO_PERIODS
98
105
  } from "./chunk-UDHBXYGG.js";
@@ -128,10 +135,6 @@ import {
128
135
  compileSequenceFormat,
129
136
  resolveSequenceKey
130
137
  } from "./chunk-L2DGWBCT.js";
131
- import {
132
- CustodyApi,
133
- NO_CUSTODY
134
- } from "./chunk-YWWQM7KP.js";
135
138
  import {
136
139
  Query,
137
140
  ScanBuilder
@@ -165,9 +168,6 @@ import {
165
168
  import {
166
169
  NO_CRDT
167
170
  } from "./chunk-PVEWA2DU.js";
168
- import {
169
- NO_CONSENT
170
- } from "./chunk-PEOZ34EM.js";
171
171
  import {
172
172
  dictCollectionName
173
173
  } from "./chunk-FRMPM7WG.js";
@@ -13923,4 +13923,4 @@ export {
13923
13923
  Noydb,
13924
13924
  createNoydb
13925
13925
  };
13926
- //# sourceMappingURL=chunk-NFIBXF4V.js.map
13926
+ //# sourceMappingURL=chunk-Q54PXSQL.js.map
@@ -0,0 +1,29 @@
1
+ import {
2
+ DebugPlaintextError,
3
+ DebugReservedFieldError
4
+ } from "../chunk-QZWTRENR.js";
5
+ import "../chunk-PZ5AY32C.js";
6
+
7
+ // src/kernel/debug.ts
8
+ function readPlaintextRecord(envelope) {
9
+ if (envelope._iv !== "") {
10
+ throw new Error(
11
+ "readPlaintextRecord: envelope is encrypted (non-empty _iv) \u2014 decrypt via the vault, not this helper"
12
+ );
13
+ }
14
+ if (envelope._debug !== void 0) {
15
+ const record = {};
16
+ for (const [key, value] of Object.entries(envelope)) {
17
+ if (!key.startsWith("_")) record[key] = value;
18
+ }
19
+ return record;
20
+ }
21
+ if (!envelope._data) return null;
22
+ return JSON.parse(envelope._data);
23
+ }
24
+ export {
25
+ DebugPlaintextError,
26
+ DebugReservedFieldError,
27
+ readPlaintextRecord
28
+ };
29
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/kernel/debug.ts"],"sourcesContent":["/**\n * Helpers for reading records out of a *plaintext* store (`encrypt: false`)\n * with native tooling — the programmatic core of a `noydb cat`-style unwrap.\n * See the plaintext/debug-store-mode design.\n */\nimport type { EncryptedEnvelope } from './types.js'\n\n/**\n * The option's two failure modes, re-exported here so a consumer can `catch`\n * them by identity (#914). Both are thrown from the kernel — `createNoydb`\n * raises `DebugPlaintextError` when `debugPlaintext` is combined with\n * encryption, and the record codec raises `DebugReservedFieldError` for a\n * field colliding with the `_`-prefixed metadata. This entry is the only one\n * that publishes them.\n */\nexport { DebugPlaintextError, DebugReservedFieldError } from './errors.js'\n\n/** Re-exported so `readPlaintextRecord`'s parameter is nameable from this entry. */\nexport type { EncryptedEnvelope } from './types.js'\n\n/**\n * Extract the record from a plaintext stored envelope, handling both layouts:\n *\n * - **classic plaintext** (`encrypt: false`): the record is JSON in `_data`.\n * - **debugPlaintext**: the record's fields are inlined beside the\n * `_`-prefixed metadata (marked by `_debug`).\n *\n * Returns `null` for an empty/absent body. Throws if handed an **encrypted**\n * envelope (non-empty `_iv`) — there is no key here; decrypt through the vault\n * instead. Intended for record envelopes, not blob chunks.\n *\n * @example\n * ```ts\n * // node script over a to-file store, no vault needed:\n * const env = JSON.parse(readFileSync('data/acme/invoices/inv-1.json', 'utf8'))\n * console.log(readPlaintextRecord(env)) // → { id: 'inv-1', total: '120.00', … }\n * ```\n */\nexport function readPlaintextRecord<T = Record<string, unknown>>(\n envelope: EncryptedEnvelope,\n): T | null {\n if (envelope._iv !== '') {\n throw new Error(\n 'readPlaintextRecord: envelope is encrypted (non-empty _iv) — decrypt via the vault, not this helper',\n )\n }\n if (envelope._debug !== undefined) {\n const record: Record<string, unknown> = {}\n for (const [key, value] of Object.entries(envelope)) {\n if (!key.startsWith('_')) record[key] = value\n }\n return record as T\n }\n if (!envelope._data) return null\n return JSON.parse(envelope._data) as T\n}\n"],"mappings":";;;;;;;AAsCO,SAAS,oBACd,UACU;AACV,MAAI,SAAS,QAAQ,IAAI;AACvB,UAAM,IAAI;AAAA,MACR;AAAA,IACF;AAAA,EACF;AACA,MAAI,SAAS,WAAW,QAAW;AACjC,UAAM,SAAkC,CAAC;AACzC,eAAW,CAAC,KAAK,KAAK,KAAK,OAAO,QAAQ,QAAQ,GAAG;AACnD,UAAI,CAAC,IAAI,WAAW,GAAG,EAAG,QAAO,GAAG,IAAI;AAAA,IAC1C;AACA,WAAO;AAAA,EACT;AACA,MAAI,CAAC,SAAS,MAAO,QAAO;AAC5B,SAAO,KAAK,MAAM,SAAS,KAAK;AAClC;","names":[]}
package/dist/index.js CHANGED
@@ -16,7 +16,8 @@ import {
16
16
  refArray,
17
17
  via,
18
18
  withArchive
19
- } from "./chunk-NFIBXF4V.js";
19
+ } from "./chunk-Q54PXSQL.js";
20
+ import "./chunk-SHEEBRZ4.js";
20
21
  import "./chunk-NJ4DYYO5.js";
21
22
  import {
22
23
  persistSchemaIfNeeded
@@ -28,11 +29,11 @@ import {
28
29
  LinkIntegrityError,
29
30
  isLinkCollectionName
30
31
  } from "./chunk-4JQK3L4V.js";
31
- import "./chunk-SHEEBRZ4.js";
32
32
  import {
33
33
  ComputedFieldError,
34
34
  evalComputedFields
35
35
  } from "./chunk-5DRROK5W.js";
36
+ import "./chunk-GYGLAVCX.js";
36
37
  import {
37
38
  WithdrawalRequestError,
38
39
  approveWithdrawal,
@@ -42,6 +43,19 @@ import {
42
43
  } from "./chunk-HMU5P6RL.js";
43
44
  import "./chunk-LNZKOUJR.js";
44
45
  import "./chunk-7YVBQJ7K.js";
46
+ import {
47
+ MoneyCurrencyError,
48
+ MoneyPrecisionError,
49
+ MoneyUnsupportedError,
50
+ allocate,
51
+ asMoney,
52
+ isMoneyDescriptor,
53
+ isMoneyString,
54
+ money,
55
+ moneyNumber,
56
+ mulRate,
57
+ scaleForCurrency
58
+ } from "./chunk-SGDPRCC4.js";
45
59
  import {
46
60
  COVER_FIELDS,
47
61
  DEFAULT_COVER_SCHEMA,
@@ -67,14 +81,24 @@ import "./chunk-GJW4HX2O.js";
67
81
  import {
68
82
  UserApi
69
83
  } from "./chunk-DABACXEF.js";
70
- import "./chunk-GYGLAVCX.js";
84
+ import {
85
+ classified,
86
+ luhnCheck
87
+ } from "./chunk-GU3IP74F.js";
88
+ import {
89
+ ClassifiedNeverStoredError,
90
+ ClassifiedValidationError,
91
+ isClassifiedFieldSpec,
92
+ isClassifiedGroup,
93
+ resolveClassifiedFields
94
+ } from "./chunk-EE7UHLKH.js";
71
95
  import "./chunk-Y2NJBNX3.js";
72
96
  import "./chunk-BLBAQRBM.js";
73
97
  import {
74
98
  decryptExtractedPartition,
75
99
  diffVault,
76
100
  withCargo
77
- } from "./chunk-YZJSJOUI.js";
101
+ } from "./chunk-DSJG26FE.js";
78
102
  import {
79
103
  NO_CARGO
80
104
  } from "./chunk-TG634KCO.js";
@@ -123,18 +147,10 @@ import {
123
147
  savePersistedSchema
124
148
  } from "./chunk-DMH3VZU5.js";
125
149
  import {
126
- MoneyCurrencyError,
127
- MoneyPrecisionError,
128
- MoneyUnsupportedError,
129
- allocate,
130
- asMoney,
131
- isMoneyDescriptor,
132
- isMoneyString,
133
- money,
134
- moneyNumber,
135
- mulRate,
136
- scaleForCurrency
137
- } from "./chunk-SGDPRCC4.js";
150
+ CustodyApi,
151
+ NO_CUSTODY,
152
+ withCustody
153
+ } from "./chunk-YWWQM7KP.js";
138
154
  import {
139
155
  withDerivation,
140
156
  withRollup
@@ -145,12 +161,12 @@ import "./chunk-MHMLXJ3I.js";
145
161
  import {
146
162
  withMaterializedView
147
163
  } from "./chunk-MXUT7FTE.js";
164
+ import "./chunk-IYZISPGD.js";
148
165
  import "./chunk-N4BBNYIB.js";
149
166
  import {
150
167
  buildLookupSnapshot
151
168
  } from "./chunk-IPUG56GJ.js";
152
169
  import "./chunk-3HUYRN24.js";
153
- import "./chunk-IYZISPGD.js";
154
170
  import {
155
171
  withOverlayedView
156
172
  } from "./chunk-MSMJJB4J.js";
@@ -172,16 +188,9 @@ import {
172
188
  } from "./chunk-PY4KJPYU.js";
173
189
  import "./chunk-5GQEU4DN.js";
174
190
  import {
175
- classified,
176
- luhnCheck
177
- } from "./chunk-GU3IP74F.js";
178
- import {
179
- ClassifiedNeverStoredError,
180
- ClassifiedValidationError,
181
- isClassifiedFieldSpec,
182
- isClassifiedGroup,
183
- resolveClassifiedFields
184
- } from "./chunk-EE7UHLKH.js";
191
+ CONSENT_AUDIT_COLLECTION
192
+ } from "./chunk-EKRSCRNM.js";
193
+ import "./chunk-PEOZ34EM.js";
185
194
  import "./chunk-QDIH2744.js";
186
195
  import "./chunk-UDHBXYGG.js";
187
196
  import "./chunk-GHVIKOHT.js";
@@ -224,11 +233,6 @@ import {
224
233
  resolveSequenceKey,
225
234
  withSequence
226
235
  } from "./chunk-L2DGWBCT.js";
227
- import {
228
- CustodyApi,
229
- NO_CUSTODY,
230
- withCustody
231
- } from "./chunk-YWWQM7KP.js";
232
236
  import {
233
237
  DEFAULT_CROSS_JOIN_MAX_ROWS,
234
238
  Query,
@@ -315,10 +319,6 @@ import {
315
319
  saveCover,
316
320
  validateCoverInput
317
321
  } from "./chunk-TUXQSFHZ.js";
318
- import {
319
- CONSENT_AUDIT_COLLECTION
320
- } from "./chunk-EKRSCRNM.js";
321
- import "./chunk-PEOZ34EM.js";
322
322
  import "./chunk-X3F5YJG2.js";
323
323
  import {
324
324
  dictKey,
@@ -4,6 +4,17 @@
4
4
  * See the plaintext/debug-store-mode design.
5
5
  */
6
6
  import type { EncryptedEnvelope } from './types.js';
7
+ /**
8
+ * The option's two failure modes, re-exported here so a consumer can `catch`
9
+ * them by identity (#914). Both are thrown from the kernel — `createNoydb`
10
+ * raises `DebugPlaintextError` when `debugPlaintext` is combined with
11
+ * encryption, and the record codec raises `DebugReservedFieldError` for a
12
+ * field colliding with the `_`-prefixed metadata. This entry is the only one
13
+ * that publishes them.
14
+ */
15
+ export { DebugPlaintextError, DebugReservedFieldError } from './errors.js';
16
+ /** Re-exported so `readPlaintextRecord`'s parameter is nameable from this entry. */
17
+ export type { EncryptedEnvelope } from './types.js';
7
18
  /**
8
19
  * Extract the record from a plaintext stored envelope, handling both layouts:
9
20
  *
@@ -1,6 +1,12 @@
1
1
  import {
2
2
  withMaterializedView
3
3
  } from "../chunk-MXUT7FTE.js";
4
+ import {
5
+ clearMVStale,
6
+ isMVStale,
7
+ markMVStale,
8
+ resolveStaleMVOnRead
9
+ } from "../chunk-IYZISPGD.js";
4
10
  import {
5
11
  MaterializedViewExecutor
6
12
  } from "../chunk-N4BBNYIB.js";
@@ -12,12 +18,6 @@ import {
12
18
  computeQueryHash,
13
19
  summarizeQueryPlan
14
20
  } from "../chunk-3HUYRN24.js";
15
- import {
16
- clearMVStale,
17
- isMVStale,
18
- markMVStale,
19
- resolveStaleMVOnRead
20
- } from "../chunk-IYZISPGD.js";
21
21
  import "../chunk-5D2ALSM5.js";
22
22
  import "../chunk-V6UQZA2H.js";
23
23
  import "../chunk-KRCBZYTZ.js";
@@ -1,14 +1,15 @@
1
1
  import {
2
2
  Noydb,
3
3
  createNoydb
4
- } from "./chunk-NFIBXF4V.js";
4
+ } from "./chunk-Q54PXSQL.js";
5
+ import "./chunk-SHEEBRZ4.js";
5
6
  import "./chunk-NJ4DYYO5.js";
6
7
  import "./chunk-4JQK3L4V.js";
7
- import "./chunk-SHEEBRZ4.js";
8
+ import "./chunk-GYGLAVCX.js";
8
9
  import "./chunk-LNZKOUJR.js";
9
10
  import "./chunk-7YVBQJ7K.js";
10
11
  import "./chunk-6LJY7X5A.js";
11
- import "./chunk-GYGLAVCX.js";
12
+ import "./chunk-EE7UHLKH.js";
12
13
  import "./chunk-Y2NJBNX3.js";
13
14
  import "./chunk-BLBAQRBM.js";
14
15
  import "./chunk-TG634KCO.js";
@@ -16,12 +17,13 @@ import "./chunk-FQZ6XTQ7.js";
16
17
  import "./chunk-VYYM3MEN.js";
17
18
  import "./chunk-6ZNSB3H6.js";
18
19
  import "./chunk-Y2NBBT6K.js";
20
+ import "./chunk-YWWQM7KP.js";
19
21
  import "./chunk-4ZKNC6A6.js";
20
22
  import "./chunk-IPUG56GJ.js";
21
23
  import "./chunk-ZTLOXFPB.js";
22
24
  import "./chunk-55LKVALY.js";
23
25
  import "./chunk-5GQEU4DN.js";
24
- import "./chunk-EE7UHLKH.js";
26
+ import "./chunk-PEOZ34EM.js";
25
27
  import "./chunk-UDHBXYGG.js";
26
28
  import "./chunk-GHVIKOHT.js";
27
29
  import "./chunk-NM5UYF6Q.js";
@@ -32,7 +34,6 @@ import "./chunk-5D2ALSM5.js";
32
34
  import "./chunk-MCHBCNCE.js";
33
35
  import "./chunk-AURFOK3D.js";
34
36
  import "./chunk-L2DGWBCT.js";
35
- import "./chunk-YWWQM7KP.js";
36
37
  import "./chunk-WBKZUO5V.js";
37
38
  import "./chunk-V6UQZA2H.js";
38
39
  import "./chunk-CXQW2NWO.js";
@@ -44,7 +45,6 @@ import "./chunk-YMUFFJCO.js";
44
45
  import "./chunk-CADUYBQD.js";
45
46
  import "./chunk-IGJCYUT5.js";
46
47
  import "./chunk-PVEWA2DU.js";
47
- import "./chunk-PEOZ34EM.js";
48
48
  import "./chunk-W3G5REIU.js";
49
49
  import "./chunk-FRMPM7WG.js";
50
50
  import "./chunk-UADPR6F4.js";
@@ -78,4 +78,4 @@ export {
78
78
  Noydb,
79
79
  createNoydb
80
80
  };
81
- //# sourceMappingURL=noydb-FZZIMLCI.js.map
81
+ //# sourceMappingURL=noydb-LPUMSDBR.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@noy-db/hub",
3
- "version": "0.4.0-pre.11",
3
+ "version": "0.4.0-pre.12",
4
4
  "description": "Zero-knowledge, offline-first, encrypted document store — core library with AES-256-GCM, PBKDF2, multi-user keyring, and sync engine",
5
5
  "license": "MIT",
6
6
  "author": "vLannaAi <vicio@lanna.ai>",
@@ -52,6 +52,10 @@
52
52
  "types": "./dist/kernel/query/index.d.ts",
53
53
  "default": "./dist/query/index.js"
54
54
  },
55
+ "./debug": {
56
+ "types": "./dist/kernel/debug.d.ts",
57
+ "default": "./dist/debug/index.js"
58
+ },
55
59
  "./blobs": {
56
60
  "types": "./dist/via/blob/index.d.ts",
57
61
  "default": "./dist/blobs/index.js"
@@ -204,14 +208,14 @@
204
208
  "node": ">=22.0.0"
205
209
  },
206
210
  "dependencies": {
207
- "@noy-db/attestation": "0.4.0-pre.11"
211
+ "@noy-db/attestation": "0.4.0-pre.12"
208
212
  },
209
213
  "devDependencies": {
210
214
  "@types/node": "^22.0.0",
211
215
  "esbuild": "^0.25.0",
212
216
  "zod": "^4.0.0",
213
217
  "zod-to-json-schema": "^3.25.2",
214
- "@noy-db/on-shamir": "0.4.0-pre.11"
218
+ "@noy-db/on-shamir": "0.4.0-pre.12"
215
219
  },
216
220
  "peerDependencies": {
217
221
  "zod-to-json-schema": "^3.25.0"