@noy-db/hub 0.1.0-pre.9 → 0.2.0-pre.2
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/aggregate/index.cjs +91 -36
- package/dist/aggregate/index.cjs.map +1 -1
- package/dist/aggregate/index.d.cts +2 -2
- package/dist/aggregate/index.d.ts +2 -2
- package/dist/aggregate/index.js +16 -9
- package/dist/aggregate/index.js.map +1 -1
- package/dist/attestation/index.cjs +305 -0
- package/dist/attestation/index.cjs.map +1 -0
- package/dist/attestation/index.d.cts +52 -0
- package/dist/attestation/index.d.ts +52 -0
- package/dist/attestation/index.js +36 -0
- package/dist/attestation/index.js.map +1 -0
- package/dist/blobs/index.cjs.map +1 -1
- package/dist/blobs/index.d.cts +7 -6
- package/dist/blobs/index.d.ts +7 -6
- package/dist/blobs/index.js +10 -8
- package/dist/blobs/index.js.map +1 -1
- package/dist/bundle/index.cjs +16923 -60
- package/dist/bundle/index.cjs.map +1 -1
- package/dist/bundle/index.d.cts +175 -6
- package/dist/bundle/index.d.ts +175 -6
- package/dist/bundle/index.js +543 -4
- package/dist/bundle/index.js.map +1 -1
- package/dist/{chunk-PTVMYYON.js → chunk-243PNUA6.js} +3 -3
- package/dist/{chunk-MR4424N3.js → chunk-2PAQNPE3.js} +2 -2
- package/dist/chunk-3QAKZ37R.js +83 -0
- package/dist/chunk-3QAKZ37R.js.map +1 -0
- package/dist/chunk-3S4BJX25.js +36 -0
- package/dist/chunk-3S4BJX25.js.map +1 -0
- package/dist/chunk-3XHOCQK4.js +118 -0
- package/dist/chunk-3XHOCQK4.js.map +1 -0
- package/dist/{chunk-AVVPZ4BC.js → chunk-3Y53S2SA.js} +4 -4
- package/dist/chunk-3Z2TPHC4.js +291 -0
- package/dist/chunk-3Z2TPHC4.js.map +1 -0
- package/dist/chunk-4HIL6AHQ.js +57 -0
- package/dist/chunk-4HIL6AHQ.js.map +1 -0
- package/dist/chunk-5ZGZ6HIZ.js +100 -0
- package/dist/chunk-5ZGZ6HIZ.js.map +1 -0
- package/dist/{chunk-ZFKD4QMV.js → chunk-7BRE6EUA.js} +3 -3
- package/dist/chunk-7BUTTVMR.js +34 -0
- package/dist/chunk-7BUTTVMR.js.map +1 -0
- package/dist/{chunk-VQBTTTUN.js → chunk-7Q5PLD5C.js} +4 -4
- package/dist/{chunk-VQBTTTUN.js.map → chunk-7Q5PLD5C.js.map} +1 -1
- package/dist/{chunk-QAVUREFT.js → chunk-7Z23ZFLV.js} +12 -6
- package/dist/chunk-7Z23ZFLV.js.map +1 -0
- package/dist/chunk-AHPFONIL.js +59 -0
- package/dist/chunk-AHPFONIL.js.map +1 -0
- package/dist/chunk-CXSCDO5T.js +51 -0
- package/dist/chunk-CXSCDO5T.js.map +1 -0
- package/dist/chunk-E535SAN4.js +8834 -0
- package/dist/chunk-E535SAN4.js.map +1 -0
- package/dist/chunk-EUYOGYGV.js +830 -0
- package/dist/chunk-EUYOGYGV.js.map +1 -0
- package/dist/chunk-FAQVNJD4.js +61 -0
- package/dist/chunk-FAQVNJD4.js.map +1 -0
- package/dist/{chunk-SCZXXXU4.js → chunk-G6FRSBKK.js} +7 -32
- package/dist/chunk-G6FRSBKK.js.map +1 -0
- package/dist/chunk-GIV6DWBG.js +79 -0
- package/dist/chunk-GIV6DWBG.js.map +1 -0
- package/dist/chunk-HXJXPZRE.js +73 -0
- package/dist/chunk-HXJXPZRE.js.map +1 -0
- package/dist/{chunk-GOUT6DND.js → chunk-J4KLMEUL.js} +173 -91
- package/dist/chunk-J4KLMEUL.js.map +1 -0
- package/dist/{chunk-2CSJGFCB.js → chunk-JYQTXEIO.js} +6 -229
- package/dist/chunk-JYQTXEIO.js.map +1 -0
- package/dist/{chunk-MDDTIZUO.js → chunk-LRAZDV5X.js} +7 -119
- package/dist/chunk-LRAZDV5X.js.map +1 -0
- package/dist/{chunk-M5INGEFC.js → chunk-MRIBLZL3.js} +3 -1
- package/dist/chunk-MRIBLZL3.js.map +1 -0
- package/dist/{chunk-USKYUS74.js → chunk-MUWOSVEP.js} +2 -2
- package/dist/{chunk-4PWAI7Q4.js → chunk-NWZ3I6R6.js} +5 -5
- package/dist/chunk-OVZDFEOR.js +124 -0
- package/dist/chunk-OVZDFEOR.js.map +1 -0
- package/dist/chunk-PEULZC6M.js +118 -0
- package/dist/chunk-PEULZC6M.js.map +1 -0
- package/dist/chunk-PFSNOPBQ.js +233 -0
- package/dist/chunk-PFSNOPBQ.js.map +1 -0
- package/dist/chunk-PLI5TV7N.js +53 -0
- package/dist/chunk-PLI5TV7N.js.map +1 -0
- package/dist/{chunk-WDM5XGGS.js → chunk-Q6W2CMEJ.js} +181 -11
- package/dist/chunk-Q6W2CMEJ.js.map +1 -0
- package/dist/{chunk-QGZRWRSL.js → chunk-QPEXPHJR.js} +4 -4
- package/dist/{chunk-R36SIKES.js → chunk-QXQRKXCU.js} +2 -2
- package/dist/chunk-RTZVQAJ7.js +82 -0
- package/dist/chunk-RTZVQAJ7.js.map +1 -0
- package/dist/chunk-TBKOGSYR.js +296 -0
- package/dist/chunk-TBKOGSYR.js.map +1 -0
- package/dist/chunk-UMLVJTYV.js +20 -0
- package/dist/chunk-UMLVJTYV.js.map +1 -0
- package/dist/chunk-UND4XIB6.js +251 -0
- package/dist/chunk-UND4XIB6.js.map +1 -0
- package/dist/chunk-VCGTOS2A.js +795 -0
- package/dist/chunk-VCGTOS2A.js.map +1 -0
- package/dist/chunk-VE6YVP32.js +19 -0
- package/dist/chunk-VE6YVP32.js.map +1 -0
- package/dist/{chunk-M62XNWRA.js → chunk-VK5EER6C.js} +2 -2
- package/dist/{chunk-NXFEYLVG.js → chunk-VPSUZLOJ.js} +4 -3
- package/dist/{chunk-NXFEYLVG.js.map → chunk-VPSUZLOJ.js.map} +1 -1
- package/dist/{chunk-TDR6T5CJ.js → chunk-VRBCTEKQ.js} +91 -132
- package/dist/chunk-VRBCTEKQ.js.map +1 -0
- package/dist/{chunk-ACLDOTNQ.js → chunk-W3XXT26A.js} +303 -3
- package/dist/chunk-W3XXT26A.js.map +1 -0
- package/dist/{chunk-CIMZBAZB.js → chunk-XG3PTSCD.js} +1 -1
- package/dist/chunk-XG3PTSCD.js.map +1 -0
- package/dist/chunk-Y2RKOPNC.js +145 -0
- package/dist/chunk-Y2RKOPNC.js.map +1 -0
- package/dist/{chunk-NPC4LFV5.js → chunk-YMYK7US4.js} +2 -2
- package/dist/{chunk-RKJ6OL7K.js → chunk-YS3POABP.js} +1 -1
- package/dist/chunk-YS3POABP.js.map +1 -0
- package/dist/chunk-YTXSFG3C.js +179 -0
- package/dist/chunk-YTXSFG3C.js.map +1 -0
- package/dist/consent/index.cjs.map +1 -1
- package/dist/consent/index.d.cts +7 -6
- package/dist/consent/index.d.ts +7 -6
- package/dist/consent/index.js +3 -3
- package/dist/{crypto-IVKU7YTT.js → crypto-5ZDIY3NG.js} +3 -3
- package/dist/{delegation-2DBS2EOH.js → delegation-QYXZW25W.js} +5 -4
- package/dist/derivations/index.cjs +351 -0
- package/dist/derivations/index.cjs.map +1 -0
- package/dist/derivations/index.d.cts +72 -0
- package/dist/derivations/index.d.ts +72 -0
- package/dist/derivations/index.js +27 -0
- package/dist/{dev-unlock-Da1B0TIK.d.cts → dev-unlock-DQCNDfFp.d.cts} +1 -1
- package/dist/{dev-unlock-BdPp68qn.d.ts → dev-unlock-utkybTKb.d.ts} +1 -1
- package/dist/executor-AS2IDHKZ.js +11 -0
- package/dist/executor-HLXFXNFM.js +8 -0
- package/dist/executor-HLXFXNFM.js.map +1 -0
- package/dist/executor-HN6YBHZ5.js +8 -0
- package/dist/executor-HN6YBHZ5.js.map +1 -0
- package/dist/fanout-sidecar-VJ52RIEY.js +51 -0
- package/dist/fanout-sidecar-VJ52RIEY.js.map +1 -0
- package/dist/guards/index.cjs +315 -0
- package/dist/guards/index.cjs.map +1 -0
- package/dist/guards/index.d.cts +31 -0
- package/dist/guards/index.d.ts +31 -0
- package/dist/guards/index.js +29 -0
- package/dist/guards/index.js.map +1 -0
- package/dist/{hash-lsoL3eEW.d.ts → hash-DcoYWfJ_.d.ts} +1 -1
- package/dist/{hash-BEfzPKwo.d.cts → hash-jDowCrK2.d.cts} +1 -1
- package/dist/history/index.cjs +8 -1
- package/dist/history/index.cjs.map +1 -1
- package/dist/history/index.d.cts +8 -7
- package/dist/history/index.d.ts +8 -7
- package/dist/history/index.js +6 -6
- package/dist/i18n/index.cjs +81 -0
- package/dist/i18n/index.cjs.map +1 -1
- package/dist/i18n/index.d.cts +7 -6
- package/dist/i18n/index.d.ts +7 -6
- package/dist/i18n/index.js +27 -12
- package/dist/i18n/index.js.map +1 -1
- package/dist/{index-6xNpPsxR.d.cts → index-BCKdioeh.d.ts} +331 -5
- package/dist/{index-DJTf9yxn.d.ts → index-BMjrzNZr.d.cts} +331 -5
- package/dist/index.cjs +6065 -959
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +208 -16
- package/dist/index.d.ts +208 -16
- package/dist/index.js +242 -7392
- package/dist/index.js.map +1 -1
- package/dist/indexing/index.cjs +2 -0
- package/dist/indexing/index.cjs.map +1 -1
- package/dist/indexing/index.d.cts +3 -3
- package/dist/indexing/index.d.ts +3 -3
- package/dist/indexing/index.js +4 -4
- package/dist/issue-ORP37MVW.js +12 -0
- package/dist/issue-ORP37MVW.js.map +1 -0
- package/dist/{lazy-builder-CZVLKh0Z.d.cts → lazy-builder-C-rPfWG0.d.cts} +1 -1
- package/dist/{lazy-builder-BwEoBQZ9.d.ts → lazy-builder-Rpd-V3jP.d.ts} +1 -1
- package/dist/{ledger-QZTTHQAQ.js → ledger-3IU5GMXA.js} +6 -6
- package/dist/ledger-3IU5GMXA.js.map +1 -0
- package/dist/materialized-views/index.cjs +837 -0
- package/dist/materialized-views/index.cjs.map +1 -0
- package/dist/materialized-views/index.d.cts +184 -0
- package/dist/materialized-views/index.d.ts +184 -0
- package/dist/materialized-views/index.js +45 -0
- package/dist/materialized-views/index.js.map +1 -0
- package/dist/noydb-5H3C24GG.js +34 -0
- package/dist/noydb-5H3C24GG.js.map +1 -0
- package/dist/overlay-views/index.cjs +359 -0
- package/dist/overlay-views/index.cjs.map +1 -0
- package/dist/overlay-views/index.d.cts +82 -0
- package/dist/overlay-views/index.d.ts +82 -0
- package/dist/overlay-views/index.js +25 -0
- package/dist/overlay-views/index.js.map +1 -0
- package/dist/periods/index.cjs +7 -1
- package/dist/periods/index.cjs.map +1 -1
- package/dist/periods/index.d.cts +7 -6
- package/dist/periods/index.d.ts +7 -6
- package/dist/periods/index.js +6 -6
- package/dist/{predicate-SBHmi6D0.d.cts → predicate-Dnu81tsS.d.cts} +25 -1
- package/dist/{predicate-SBHmi6D0.d.ts → predicate-Dnu81tsS.d.ts} +25 -1
- package/dist/{public-envelope-6JTACYJV.js → public-envelope-U3CMEOMV.js} +4 -4
- package/dist/public-envelope-U3CMEOMV.js.map +1 -0
- package/dist/query/index.cjs +302 -124
- package/dist/query/index.cjs.map +1 -1
- package/dist/query/index.d.cts +3 -3
- package/dist/query/index.d.ts +3 -3
- package/dist/query/index.js +26 -11
- package/dist/read-only-facade-ITU6L7BL.js +7 -0
- package/dist/read-only-facade-ITU6L7BL.js.map +1 -0
- package/dist/registry-3ALP62P6.js +10 -0
- package/dist/registry-3ALP62P6.js.map +1 -0
- package/dist/registry-7HE6VJGC.js +8 -0
- package/dist/registry-7HE6VJGC.js.map +1 -0
- package/dist/registry-PSIPG2QR.js +8 -0
- package/dist/registry-PSIPG2QR.js.map +1 -0
- package/dist/registry-RFGGMVNJ.js +7 -0
- package/dist/registry-RFGGMVNJ.js.map +1 -0
- package/dist/revoke-KY2GB4KP.js +17 -0
- package/dist/revoke-KY2GB4KP.js.map +1 -0
- package/dist/session/index.cjs +7 -1
- package/dist/session/index.cjs.map +1 -1
- package/dist/session/index.d.cts +8 -7
- package/dist/session/index.d.ts +8 -7
- package/dist/session/index.js +10 -3
- package/dist/session/index.js.map +1 -1
- package/dist/shadow/index.cjs.map +1 -1
- package/dist/shadow/index.d.cts +7 -6
- package/dist/shadow/index.d.ts +7 -6
- package/dist/shadow/index.js +2 -2
- package/dist/signer-GRI5TZKH.js +18 -0
- package/dist/signer-GRI5TZKH.js.map +1 -0
- package/dist/stale-OTOF3FH7.js +13 -0
- package/dist/stale-OTOF3FH7.js.map +1 -0
- package/dist/store/index.cjs +14 -0
- package/dist/store/index.cjs.map +1 -1
- package/dist/store/index.d.cts +7 -6
- package/dist/store/index.d.ts +7 -6
- package/dist/store/index.js +5 -2
- package/dist/{strategy-D-SrOLCl.d.cts → strategy-DSTrsZ8t.d.cts} +72 -19
- package/dist/{strategy-D-SrOLCl.d.ts → strategy-DSTrsZ8t.d.ts} +72 -19
- package/dist/sync/index.cjs.map +1 -1
- package/dist/sync/index.d.cts +6 -5
- package/dist/sync/index.d.ts +6 -5
- package/dist/sync/index.js +4 -4
- package/dist/team/index.cjs +1554 -2
- package/dist/team/index.cjs.map +1 -1
- package/dist/team/index.d.cts +7 -6
- package/dist/team/index.d.ts +7 -6
- package/dist/team/index.js +77 -8
- package/dist/tx/index.cjs +296 -44
- package/dist/tx/index.cjs.map +1 -1
- package/dist/tx/index.d.cts +7 -6
- package/dist/tx/index.d.ts +7 -6
- package/dist/tx/index.js +2 -2
- package/dist/{types-Bo7NSXJr.d.ts → types-BoFFiskX.d.ts} +2714 -321
- package/dist/{types-Bnb82f5R.d.cts → types-DJG8HG6F.d.cts} +2714 -321
- package/dist/{index-CywCC1qZ.d.cts → ulid-BmBgooGm.d.ts} +215 -26
- package/dist/{index-8QDuznDr.d.ts → ulid-C7ms9oli.d.cts} +215 -26
- package/dist/util/index.cjs.map +1 -1
- package/dist/util/index.js +1 -1
- package/dist/with-derivation-BKXXa8Vt.d.ts +13 -0
- package/dist/with-derivation-BjQ7q4NE.d.cts +13 -0
- package/dist/with-guard-C25yNjzd.d.ts +18 -0
- package/dist/with-guard-DQme5DKE.d.cts +18 -0
- package/dist/with-materialized-view-BbEPFIIJ.d.cts +27 -0
- package/dist/with-materialized-view-CqnRwI2S.d.ts +27 -0
- package/dist/with-overlayed-view-Ct1fSJt-.d.ts +13 -0
- package/dist/with-overlayed-view-bwlmmFjx.d.cts +13 -0
- package/package.json +65 -2
- package/dist/chunk-2CSJGFCB.js.map +0 -1
- package/dist/chunk-ACLDOTNQ.js.map +0 -1
- package/dist/chunk-BTDCBVJW.js +0 -160
- package/dist/chunk-BTDCBVJW.js.map +0 -1
- package/dist/chunk-CIMZBAZB.js.map +0 -1
- package/dist/chunk-EXHNQEV4.js +0 -392
- package/dist/chunk-EXHNQEV4.js.map +0 -1
- package/dist/chunk-GOUT6DND.js.map +0 -1
- package/dist/chunk-M5INGEFC.js.map +0 -1
- package/dist/chunk-MDDTIZUO.js.map +0 -1
- package/dist/chunk-QAVUREFT.js.map +0 -1
- package/dist/chunk-RKJ6OL7K.js.map +0 -1
- package/dist/chunk-SCZXXXU4.js.map +0 -1
- package/dist/chunk-TDR6T5CJ.js.map +0 -1
- package/dist/chunk-WDM5XGGS.js.map +0 -1
- /package/dist/{chunk-PTVMYYON.js.map → chunk-243PNUA6.js.map} +0 -0
- /package/dist/{chunk-MR4424N3.js.map → chunk-2PAQNPE3.js.map} +0 -0
- /package/dist/{chunk-AVVPZ4BC.js.map → chunk-3Y53S2SA.js.map} +0 -0
- /package/dist/{chunk-ZFKD4QMV.js.map → chunk-7BRE6EUA.js.map} +0 -0
- /package/dist/{chunk-USKYUS74.js.map → chunk-MUWOSVEP.js.map} +0 -0
- /package/dist/{chunk-4PWAI7Q4.js.map → chunk-NWZ3I6R6.js.map} +0 -0
- /package/dist/{chunk-QGZRWRSL.js.map → chunk-QPEXPHJR.js.map} +0 -0
- /package/dist/{chunk-R36SIKES.js.map → chunk-QXQRKXCU.js.map} +0 -0
- /package/dist/{chunk-M62XNWRA.js.map → chunk-VK5EER6C.js.map} +0 -0
- /package/dist/{chunk-NPC4LFV5.js.map → chunk-YMYK7US4.js.map} +0 -0
- /package/dist/{crypto-IVKU7YTT.js.map → crypto-5ZDIY3NG.js.map} +0 -0
- /package/dist/{delegation-2DBS2EOH.js.map → delegation-QYXZW25W.js.map} +0 -0
- /package/dist/{ledger-QZTTHQAQ.js.map → derivations/index.js.map} +0 -0
- /package/dist/{public-envelope-6JTACYJV.js.map → executor-AS2IDHKZ.js.map} +0 -0
package/dist/bundle/index.d.cts
CHANGED
|
@@ -1,7 +1,176 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import '../
|
|
4
|
-
|
|
5
|
-
import '../
|
|
1
|
+
import { T as TransferSealPayload } from '../ulid-C7ms9oli.cjs';
|
|
2
|
+
export { C as COMPRESSION_BROTLI, a as COMPRESSION_GZIP, b as COMPRESSION_NONE, c as CompressionAlgo, F as FLAG_COMPRESSED, d as FLAG_HAS_INTEGRITY_HASH, N as NOYDB_BUNDLE_FORMAT_VERSION, e as NOYDB_BUNDLE_MAGIC, f as NOYDB_BUNDLE_PREFIX_BYTES, g as NoydbBundleHeader, h as NoydbBundleReadResult, R as ReadNoydbBundleOptions, W as WriteNoydbBundleOptions, i as encodeBundleHeader, j as generateULID, k as isULID, r as readNoydbBundle, l as readNoydbBundleHeader, m as resetBrotliSupportCache, v as validateBundleHeader, w as writeNoydbBundle } from '../ulid-C7ms9oli.cjs';
|
|
3
|
+
import { bf as Vault, aO as NoydbStore, bb as SealingKeyProvider, bg as RecoveryEnrollmentInput, bh as ShamirRecoveryProvider } from '../types-DJG8HG6F.cjs';
|
|
4
|
+
export { n as AdoptionStateError, B as BackupCorruptedError, o as BackupLedgerError, p as BundleIntegrityError, q as BundleSealMismatchError, r as BundleVersionConflictError, P as PartitionExtractionError, s as TransferSealError } from '../index-BMjrzNZr.cjs';
|
|
5
|
+
import '../lazy-builder-C-rPfWG0.cjs';
|
|
6
|
+
import '../predicate-Dnu81tsS.cjs';
|
|
7
|
+
import '../strategy-DSTrsZ8t.cjs';
|
|
6
8
|
import '../strategy-BSxFXGzb.cjs';
|
|
7
|
-
import '
|
|
9
|
+
import '@noy-db/attestation';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Transitive-closure FK walker (#201). Computes the set of
|
|
13
|
+
* (collection, id) tuples reachable from seed predicates, so a
|
|
14
|
+
* partition extraction ships a referentially-complete subset.
|
|
15
|
+
*
|
|
16
|
+
* Two-phase, plaintext, read-only (runs inside the unlocked vault
|
|
17
|
+
* session — see foundation §13.4 / spec invariant 7):
|
|
18
|
+
* 1. INBOUND expansion: from selected records, pull every record
|
|
19
|
+
* that references them (children travel with parents), to a
|
|
20
|
+
* fixed point.
|
|
21
|
+
* 2. OUTBOUND completion: pull every parent the selected set
|
|
22
|
+
* references (no dangling FKs), transitively, WITHOUT
|
|
23
|
+
* re-expanding inbound from those parents (bounds the closure).
|
|
24
|
+
*
|
|
25
|
+
* The FK graph is auto-derived from the vault's existing RefRegistry
|
|
26
|
+
* (the `ref('target')` declarations on collections) — no hand-written
|
|
27
|
+
* edge list. See the design spec §4.1.
|
|
28
|
+
*
|
|
29
|
+
* @module
|
|
30
|
+
*/
|
|
31
|
+
|
|
32
|
+
/** Seed predicate per collection. Records that return true become roots. */
|
|
33
|
+
interface WalkClosureOptions {
|
|
34
|
+
readonly seeds: Record<string, (record: Record<string, unknown>) => boolean | Promise<boolean>>;
|
|
35
|
+
/** Max fixed-point iterations before throwing. Default 16. */
|
|
36
|
+
readonly maxDepth?: number;
|
|
37
|
+
}
|
|
38
|
+
interface ClosureResult {
|
|
39
|
+
/** collection → set of record ids that travel together. */
|
|
40
|
+
readonly closure: Map<string, Set<string>>;
|
|
41
|
+
readonly graph: {
|
|
42
|
+
/** Fixed-point iterations the walk needed to converge. */
|
|
43
|
+
readonly depth: number;
|
|
44
|
+
/** True if an edge pointed back to an already-selected node. */
|
|
45
|
+
readonly cyclesDetected: boolean;
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
declare function walkClosure(vault: Vault, opts: WalkClosureOptions): Promise<ClosureResult>;
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Partition-extraction dry-run (#202). Read-only preview of what an
|
|
52
|
+
* `extractPartition` would move: record counts, byte totals, and the
|
|
53
|
+
* timestamp span per collection — computed from raw encrypted
|
|
54
|
+
* envelopes WITHOUT decrypting them. Writes nothing, mutates nothing.
|
|
55
|
+
*
|
|
56
|
+
* @module
|
|
57
|
+
*/
|
|
58
|
+
|
|
59
|
+
interface ExtractionPreview {
|
|
60
|
+
readonly totalRecords: number;
|
|
61
|
+
/** Sum of serialized encrypted-envelope sizes (bytes). */
|
|
62
|
+
readonly totalBytes: number;
|
|
63
|
+
readonly byCollection: ReadonlyArray<{
|
|
64
|
+
readonly name: string;
|
|
65
|
+
readonly recordCount: number;
|
|
66
|
+
readonly bytes: number;
|
|
67
|
+
/** Earliest envelope `_ts` in this collection (lexicographic). */
|
|
68
|
+
readonly oldestTs?: string;
|
|
69
|
+
readonly newestTs?: string;
|
|
70
|
+
}>;
|
|
71
|
+
readonly graph: {
|
|
72
|
+
readonly depth: number;
|
|
73
|
+
readonly cyclesDetected: boolean;
|
|
74
|
+
};
|
|
75
|
+
/** Records the walk reached but whose envelope couldn't be read. */
|
|
76
|
+
readonly inaccessible: ReadonlyArray<{
|
|
77
|
+
readonly collection: string;
|
|
78
|
+
readonly id: string;
|
|
79
|
+
}>;
|
|
80
|
+
}
|
|
81
|
+
declare function describeExtraction(vault: Vault, opts: WalkClosureOptions): Promise<ExtractionPreview>;
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Partition extraction (#203 + #206). Walks the FK closure, re-encrypts
|
|
85
|
+
* the selected records under fresh per-collection DEKs, seals those DEKs
|
|
86
|
+
* under a one-time transfer key, and serializes an unowned
|
|
87
|
+
* `extracted-partition` bundle.
|
|
88
|
+
*
|
|
89
|
+
* @module
|
|
90
|
+
*/
|
|
91
|
+
|
|
92
|
+
interface ExtractPartitionResult {
|
|
93
|
+
readonly bundleBytes: Uint8Array;
|
|
94
|
+
/** Raw 32-byte transfer key — deliver out-of-band; required to adopt. */
|
|
95
|
+
readonly transferKey: Uint8Array;
|
|
96
|
+
readonly sealId: string;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Extract a re-keyed, transfer-sealed partition (#203 + #206). Owner-only
|
|
100
|
+
* (#198 invariant 5): producing a standalone re-keyed vault is an
|
|
101
|
+
* ownership operation. Non-destructive on the source.
|
|
102
|
+
*/
|
|
103
|
+
declare function extractPartition(vault: Vault, opts: WalkClosureOptions & {
|
|
104
|
+
readonly compression?: 'auto' | 'brotli' | 'gzip' | 'none';
|
|
105
|
+
readonly carrySchemas?: boolean;
|
|
106
|
+
readonly carryLedger?: boolean;
|
|
107
|
+
}): Promise<ExtractPartitionResult>;
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Reverse of `sealDeks` (#206). Imports the transfer key, decrypts the
|
|
111
|
+
* sealed `{ collection: base64(rawDEK) }` map (layout iv(12)‖ct‖tag), and
|
|
112
|
+
* re-imports each DEK as an AES-GCM key. Throws `TransferSealError` on a
|
|
113
|
+
* wrong key (AES-GCM auth-tag failure) or malformed payload.
|
|
114
|
+
*/
|
|
115
|
+
declare function unsealDeks(seal: TransferSealPayload, transferKey: Uint8Array): Promise<Map<string, CryptoKey>>;
|
|
116
|
+
interface AdoptPartitionOptions {
|
|
117
|
+
readonly transferKey: Uint8Array;
|
|
118
|
+
readonly destinationStore: NoydbStore;
|
|
119
|
+
readonly vaultName: string;
|
|
120
|
+
}
|
|
121
|
+
interface AdoptPartitionResult {
|
|
122
|
+
readonly vaultName: string;
|
|
123
|
+
readonly needsOwner: true;
|
|
124
|
+
readonly sealId: string;
|
|
125
|
+
}
|
|
126
|
+
declare function adoptPartition(bundleBytes: Uint8Array, opts: AdoptPartitionOptions): Promise<AdoptPartitionResult>;
|
|
127
|
+
interface CreateOwnerResult {
|
|
128
|
+
readonly vaultName: string;
|
|
129
|
+
readonly userId: string;
|
|
130
|
+
}
|
|
131
|
+
/** Standard-mode owner: recipient supplies the passphrase. */
|
|
132
|
+
interface CreateOwnerStandardOptions {
|
|
133
|
+
readonly userId: string;
|
|
134
|
+
readonly passphrase: string;
|
|
135
|
+
readonly transferKey: Uint8Array;
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Managed-mode owner (#208 follow-up): the passphrase is minted + sealed under
|
|
139
|
+
* a `SealingKeyProvider` (e.g. an `at-*` OS keychain) so the partition
|
|
140
|
+
* auto-unlocks on the recipient's device. Managed mode mandates a strong
|
|
141
|
+
* (Shamir) recovery profile at creation (#195), which needs the
|
|
142
|
+
* `shamirRecovery` provider injected.
|
|
143
|
+
*/
|
|
144
|
+
interface CreateOwnerManagedOptions {
|
|
145
|
+
readonly userId: string;
|
|
146
|
+
readonly passphraseMode: 'managed';
|
|
147
|
+
readonly sealingKey: SealingKeyProvider;
|
|
148
|
+
readonly recovery: ReadonlyArray<RecoveryEnrollmentInput>;
|
|
149
|
+
readonly shamirRecovery: ShamirRecoveryProvider;
|
|
150
|
+
readonly transferKey: Uint8Array;
|
|
151
|
+
}
|
|
152
|
+
type CreateOwnerOptions = CreateOwnerStandardOptions | CreateOwnerManagedOptions;
|
|
153
|
+
/**
|
|
154
|
+
* Mint the first owner keyring on an adopted-but-unowned partition (#208),
|
|
155
|
+
* then destroy the transfer seal (#209).
|
|
156
|
+
*
|
|
157
|
+
* Standard mode: the recipient supplies a passphrase. Managed mode: the
|
|
158
|
+
* passphrase is minted + sealed under a `SealingKeyProvider` and a strong
|
|
159
|
+
* (Shamir) recovery profile is enrolled (#195) — orchestrated via the existing
|
|
160
|
+
* `openVaultAndEnrollRecovery` ceremony.
|
|
161
|
+
*
|
|
162
|
+
* Either way, reuses `createOwnerKeyring` to derive the KEK + write the base
|
|
163
|
+
* keyring, then wraps the partition's DEKs (recovered from the seal) under that
|
|
164
|
+
* KEK and re-persists the merged keyring file.
|
|
165
|
+
*
|
|
166
|
+
* Idempotent under retry: the seal is destroyed LAST (Stage D), after the
|
|
167
|
+
* keyring (Stage A), the ledger transition (Stage B), and — in managed mode —
|
|
168
|
+
* strong-recovery enrollment (Stage C). A failure in the fallible enrollment
|
|
169
|
+
* step leaves the seal intact, and re-running with the same `userId` +
|
|
170
|
+
* `transferKey` resumes from the first incomplete stage. (Multi-profile recovery
|
|
171
|
+
* arrays may re-enroll an already-enrolled profile on retry; managed mode's
|
|
172
|
+
* mandated single Shamir profile does not.)
|
|
173
|
+
*/
|
|
174
|
+
declare function createOwnerOnAdoptedPartition(store: NoydbStore, vaultName: string, opts: CreateOwnerOptions): Promise<CreateOwnerResult>;
|
|
175
|
+
|
|
176
|
+
export { type AdoptPartitionOptions, type AdoptPartitionResult, type ClosureResult, type CreateOwnerManagedOptions, type CreateOwnerOptions, type CreateOwnerResult, type CreateOwnerStandardOptions, type ExtractPartitionResult, type ExtractionPreview, type WalkClosureOptions, adoptPartition, createOwnerOnAdoptedPartition, describeExtraction, extractPartition, unsealDeks, walkClosure };
|
package/dist/bundle/index.d.ts
CHANGED
|
@@ -1,7 +1,176 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import '../
|
|
4
|
-
|
|
5
|
-
import '../
|
|
1
|
+
import { T as TransferSealPayload } from '../ulid-BmBgooGm.js';
|
|
2
|
+
export { C as COMPRESSION_BROTLI, a as COMPRESSION_GZIP, b as COMPRESSION_NONE, c as CompressionAlgo, F as FLAG_COMPRESSED, d as FLAG_HAS_INTEGRITY_HASH, N as NOYDB_BUNDLE_FORMAT_VERSION, e as NOYDB_BUNDLE_MAGIC, f as NOYDB_BUNDLE_PREFIX_BYTES, g as NoydbBundleHeader, h as NoydbBundleReadResult, R as ReadNoydbBundleOptions, W as WriteNoydbBundleOptions, i as encodeBundleHeader, j as generateULID, k as isULID, r as readNoydbBundle, l as readNoydbBundleHeader, m as resetBrotliSupportCache, v as validateBundleHeader, w as writeNoydbBundle } from '../ulid-BmBgooGm.js';
|
|
3
|
+
import { bf as Vault, aO as NoydbStore, bb as SealingKeyProvider, bg as RecoveryEnrollmentInput, bh as ShamirRecoveryProvider } from '../types-BoFFiskX.js';
|
|
4
|
+
export { n as AdoptionStateError, B as BackupCorruptedError, o as BackupLedgerError, p as BundleIntegrityError, q as BundleSealMismatchError, r as BundleVersionConflictError, P as PartitionExtractionError, s as TransferSealError } from '../index-BCKdioeh.js';
|
|
5
|
+
import '../lazy-builder-Rpd-V3jP.js';
|
|
6
|
+
import '../predicate-Dnu81tsS.js';
|
|
7
|
+
import '../strategy-DSTrsZ8t.js';
|
|
6
8
|
import '../strategy-BSxFXGzb.js';
|
|
7
|
-
import '
|
|
9
|
+
import '@noy-db/attestation';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Transitive-closure FK walker (#201). Computes the set of
|
|
13
|
+
* (collection, id) tuples reachable from seed predicates, so a
|
|
14
|
+
* partition extraction ships a referentially-complete subset.
|
|
15
|
+
*
|
|
16
|
+
* Two-phase, plaintext, read-only (runs inside the unlocked vault
|
|
17
|
+
* session — see foundation §13.4 / spec invariant 7):
|
|
18
|
+
* 1. INBOUND expansion: from selected records, pull every record
|
|
19
|
+
* that references them (children travel with parents), to a
|
|
20
|
+
* fixed point.
|
|
21
|
+
* 2. OUTBOUND completion: pull every parent the selected set
|
|
22
|
+
* references (no dangling FKs), transitively, WITHOUT
|
|
23
|
+
* re-expanding inbound from those parents (bounds the closure).
|
|
24
|
+
*
|
|
25
|
+
* The FK graph is auto-derived from the vault's existing RefRegistry
|
|
26
|
+
* (the `ref('target')` declarations on collections) — no hand-written
|
|
27
|
+
* edge list. See the design spec §4.1.
|
|
28
|
+
*
|
|
29
|
+
* @module
|
|
30
|
+
*/
|
|
31
|
+
|
|
32
|
+
/** Seed predicate per collection. Records that return true become roots. */
|
|
33
|
+
interface WalkClosureOptions {
|
|
34
|
+
readonly seeds: Record<string, (record: Record<string, unknown>) => boolean | Promise<boolean>>;
|
|
35
|
+
/** Max fixed-point iterations before throwing. Default 16. */
|
|
36
|
+
readonly maxDepth?: number;
|
|
37
|
+
}
|
|
38
|
+
interface ClosureResult {
|
|
39
|
+
/** collection → set of record ids that travel together. */
|
|
40
|
+
readonly closure: Map<string, Set<string>>;
|
|
41
|
+
readonly graph: {
|
|
42
|
+
/** Fixed-point iterations the walk needed to converge. */
|
|
43
|
+
readonly depth: number;
|
|
44
|
+
/** True if an edge pointed back to an already-selected node. */
|
|
45
|
+
readonly cyclesDetected: boolean;
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
declare function walkClosure(vault: Vault, opts: WalkClosureOptions): Promise<ClosureResult>;
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Partition-extraction dry-run (#202). Read-only preview of what an
|
|
52
|
+
* `extractPartition` would move: record counts, byte totals, and the
|
|
53
|
+
* timestamp span per collection — computed from raw encrypted
|
|
54
|
+
* envelopes WITHOUT decrypting them. Writes nothing, mutates nothing.
|
|
55
|
+
*
|
|
56
|
+
* @module
|
|
57
|
+
*/
|
|
58
|
+
|
|
59
|
+
interface ExtractionPreview {
|
|
60
|
+
readonly totalRecords: number;
|
|
61
|
+
/** Sum of serialized encrypted-envelope sizes (bytes). */
|
|
62
|
+
readonly totalBytes: number;
|
|
63
|
+
readonly byCollection: ReadonlyArray<{
|
|
64
|
+
readonly name: string;
|
|
65
|
+
readonly recordCount: number;
|
|
66
|
+
readonly bytes: number;
|
|
67
|
+
/** Earliest envelope `_ts` in this collection (lexicographic). */
|
|
68
|
+
readonly oldestTs?: string;
|
|
69
|
+
readonly newestTs?: string;
|
|
70
|
+
}>;
|
|
71
|
+
readonly graph: {
|
|
72
|
+
readonly depth: number;
|
|
73
|
+
readonly cyclesDetected: boolean;
|
|
74
|
+
};
|
|
75
|
+
/** Records the walk reached but whose envelope couldn't be read. */
|
|
76
|
+
readonly inaccessible: ReadonlyArray<{
|
|
77
|
+
readonly collection: string;
|
|
78
|
+
readonly id: string;
|
|
79
|
+
}>;
|
|
80
|
+
}
|
|
81
|
+
declare function describeExtraction(vault: Vault, opts: WalkClosureOptions): Promise<ExtractionPreview>;
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Partition extraction (#203 + #206). Walks the FK closure, re-encrypts
|
|
85
|
+
* the selected records under fresh per-collection DEKs, seals those DEKs
|
|
86
|
+
* under a one-time transfer key, and serializes an unowned
|
|
87
|
+
* `extracted-partition` bundle.
|
|
88
|
+
*
|
|
89
|
+
* @module
|
|
90
|
+
*/
|
|
91
|
+
|
|
92
|
+
interface ExtractPartitionResult {
|
|
93
|
+
readonly bundleBytes: Uint8Array;
|
|
94
|
+
/** Raw 32-byte transfer key — deliver out-of-band; required to adopt. */
|
|
95
|
+
readonly transferKey: Uint8Array;
|
|
96
|
+
readonly sealId: string;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Extract a re-keyed, transfer-sealed partition (#203 + #206). Owner-only
|
|
100
|
+
* (#198 invariant 5): producing a standalone re-keyed vault is an
|
|
101
|
+
* ownership operation. Non-destructive on the source.
|
|
102
|
+
*/
|
|
103
|
+
declare function extractPartition(vault: Vault, opts: WalkClosureOptions & {
|
|
104
|
+
readonly compression?: 'auto' | 'brotli' | 'gzip' | 'none';
|
|
105
|
+
readonly carrySchemas?: boolean;
|
|
106
|
+
readonly carryLedger?: boolean;
|
|
107
|
+
}): Promise<ExtractPartitionResult>;
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Reverse of `sealDeks` (#206). Imports the transfer key, decrypts the
|
|
111
|
+
* sealed `{ collection: base64(rawDEK) }` map (layout iv(12)‖ct‖tag), and
|
|
112
|
+
* re-imports each DEK as an AES-GCM key. Throws `TransferSealError` on a
|
|
113
|
+
* wrong key (AES-GCM auth-tag failure) or malformed payload.
|
|
114
|
+
*/
|
|
115
|
+
declare function unsealDeks(seal: TransferSealPayload, transferKey: Uint8Array): Promise<Map<string, CryptoKey>>;
|
|
116
|
+
interface AdoptPartitionOptions {
|
|
117
|
+
readonly transferKey: Uint8Array;
|
|
118
|
+
readonly destinationStore: NoydbStore;
|
|
119
|
+
readonly vaultName: string;
|
|
120
|
+
}
|
|
121
|
+
interface AdoptPartitionResult {
|
|
122
|
+
readonly vaultName: string;
|
|
123
|
+
readonly needsOwner: true;
|
|
124
|
+
readonly sealId: string;
|
|
125
|
+
}
|
|
126
|
+
declare function adoptPartition(bundleBytes: Uint8Array, opts: AdoptPartitionOptions): Promise<AdoptPartitionResult>;
|
|
127
|
+
interface CreateOwnerResult {
|
|
128
|
+
readonly vaultName: string;
|
|
129
|
+
readonly userId: string;
|
|
130
|
+
}
|
|
131
|
+
/** Standard-mode owner: recipient supplies the passphrase. */
|
|
132
|
+
interface CreateOwnerStandardOptions {
|
|
133
|
+
readonly userId: string;
|
|
134
|
+
readonly passphrase: string;
|
|
135
|
+
readonly transferKey: Uint8Array;
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Managed-mode owner (#208 follow-up): the passphrase is minted + sealed under
|
|
139
|
+
* a `SealingKeyProvider` (e.g. an `at-*` OS keychain) so the partition
|
|
140
|
+
* auto-unlocks on the recipient's device. Managed mode mandates a strong
|
|
141
|
+
* (Shamir) recovery profile at creation (#195), which needs the
|
|
142
|
+
* `shamirRecovery` provider injected.
|
|
143
|
+
*/
|
|
144
|
+
interface CreateOwnerManagedOptions {
|
|
145
|
+
readonly userId: string;
|
|
146
|
+
readonly passphraseMode: 'managed';
|
|
147
|
+
readonly sealingKey: SealingKeyProvider;
|
|
148
|
+
readonly recovery: ReadonlyArray<RecoveryEnrollmentInput>;
|
|
149
|
+
readonly shamirRecovery: ShamirRecoveryProvider;
|
|
150
|
+
readonly transferKey: Uint8Array;
|
|
151
|
+
}
|
|
152
|
+
type CreateOwnerOptions = CreateOwnerStandardOptions | CreateOwnerManagedOptions;
|
|
153
|
+
/**
|
|
154
|
+
* Mint the first owner keyring on an adopted-but-unowned partition (#208),
|
|
155
|
+
* then destroy the transfer seal (#209).
|
|
156
|
+
*
|
|
157
|
+
* Standard mode: the recipient supplies a passphrase. Managed mode: the
|
|
158
|
+
* passphrase is minted + sealed under a `SealingKeyProvider` and a strong
|
|
159
|
+
* (Shamir) recovery profile is enrolled (#195) — orchestrated via the existing
|
|
160
|
+
* `openVaultAndEnrollRecovery` ceremony.
|
|
161
|
+
*
|
|
162
|
+
* Either way, reuses `createOwnerKeyring` to derive the KEK + write the base
|
|
163
|
+
* keyring, then wraps the partition's DEKs (recovered from the seal) under that
|
|
164
|
+
* KEK and re-persists the merged keyring file.
|
|
165
|
+
*
|
|
166
|
+
* Idempotent under retry: the seal is destroyed LAST (Stage D), after the
|
|
167
|
+
* keyring (Stage A), the ledger transition (Stage B), and — in managed mode —
|
|
168
|
+
* strong-recovery enrollment (Stage C). A failure in the fallible enrollment
|
|
169
|
+
* step leaves the seal intact, and re-running with the same `userId` +
|
|
170
|
+
* `transferKey` resumes from the first incomplete stage. (Multi-profile recovery
|
|
171
|
+
* arrays may re-enroll an already-enrolled profile on retry; managed mode's
|
|
172
|
+
* mandated single Shamir profile does not.)
|
|
173
|
+
*/
|
|
174
|
+
declare function createOwnerOnAdoptedPartition(store: NoydbStore, vaultName: string, opts: CreateOwnerOptions): Promise<CreateOwnerResult>;
|
|
175
|
+
|
|
176
|
+
export { type AdoptPartitionOptions, type AdoptPartitionResult, type ClosureResult, type CreateOwnerManagedOptions, type CreateOwnerOptions, type CreateOwnerResult, type CreateOwnerStandardOptions, type ExtractPartitionResult, type ExtractionPreview, type WalkClosureOptions, adoptPartition, createOwnerOnAdoptedPartition, describeExtraction, extractPartition, unsealDeks, walkClosure };
|