@noy-db/hub 0.3.0-pre.8 → 0.3.0
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.js +9 -8
- package/dist/aggregate/index.js.map +1 -1
- package/dist/api-ZGS6LCOF.js +20 -0
- package/dist/as/index.js +11 -11
- package/dist/attestation/index.js +18 -18
- package/dist/backup-BJ57IKAO.js +242 -0
- package/dist/backup-BJ57IKAO.js.map +1 -0
- package/dist/blobs/index.js +13 -11
- package/dist/blobs/index.js.map +1 -1
- package/dist/broker/index.js +92 -0
- package/dist/broker/index.js.map +1 -0
- package/dist/bundle/index.js +25 -22
- package/dist/bundle/index.js.map +1 -1
- package/dist/by/index.js +2 -2
- package/dist/cargo/index.js +31 -31
- package/dist/chunk-2NVOWNI3.js +167 -0
- package/dist/chunk-2NVOWNI3.js.map +1 -0
- package/dist/chunk-3B5VVCNY.js +71 -0
- package/dist/chunk-3LQ2YKO4.js +230 -0
- package/dist/chunk-3QCRBHCY.js +54 -0
- package/dist/chunk-454JXE57.js +1697 -0
- package/dist/chunk-454JXE57.js.map +1 -0
- package/dist/chunk-4CTHCN4J.js +480 -0
- package/dist/chunk-4CTHCN4J.js.map +1 -0
- package/dist/chunk-4GPE63GU.js +111 -0
- package/dist/chunk-4GPE63GU.js.map +1 -0
- package/dist/chunk-4JBYV75E.js +150 -0
- package/dist/chunk-4NXKCLLQ.js +97 -0
- package/dist/chunk-4VNQOLML.js +29 -0
- package/dist/chunk-4VNQOLML.js.map +1 -0
- package/dist/chunk-5M5DVGV7.js +69 -0
- package/dist/chunk-5O3XF4DV.js +150 -0
- package/dist/chunk-5O3XF4DV.js.map +1 -0
- package/dist/chunk-5YOLBEQ6.js +30 -0
- package/dist/chunk-6CRIV7DE.js +129 -0
- package/dist/chunk-6JTIAGHD.js +621 -0
- package/dist/chunk-6JTIAGHD.js.map +1 -0
- package/dist/chunk-6QTNZJBS.js +255 -0
- package/dist/chunk-6T2SCQRU.js +86 -0
- package/dist/chunk-7DSTRQIJ.js +45 -0
- package/dist/chunk-AUSTCW2X.js +589 -0
- package/dist/chunk-B3HJYUOF.js +209 -0
- package/dist/chunk-BDVFPG6Y.js +164 -0
- package/dist/chunk-BIOUI4HL.js +1554 -0
- package/dist/chunk-BIOUI4HL.js.map +1 -0
- package/dist/chunk-CAF6WOK7.js +36 -0
- package/dist/chunk-CDUQTA3Z.js +381 -0
- package/dist/chunk-CDUQTA3Z.js.map +1 -0
- package/dist/chunk-CIE2BASH.js +404 -0
- package/dist/chunk-CRI4OUV4.js +42 -0
- package/dist/chunk-DLG74CNB.js +91 -0
- package/dist/chunk-E5ZQT5KX.js +30 -0
- package/dist/chunk-E5ZQT5KX.js.map +1 -0
- package/dist/chunk-EQO2UVP4.js +247 -0
- package/dist/chunk-EQO2UVP4.js.map +1 -0
- package/dist/chunk-ERJ7FU55.js +367 -0
- package/dist/chunk-EVVGJDRQ.js +205 -0
- package/dist/chunk-EVX47VBM.js +74 -0
- package/dist/chunk-EVX47VBM.js.map +1 -0
- package/dist/chunk-EXK7QRWF.js +59 -0
- package/dist/chunk-EYZ6IQ6X.js +202 -0
- package/dist/chunk-F64IRYG3.js +45 -0
- package/dist/chunk-FHS2HQSH.js +823 -0
- package/dist/chunk-FM3G3NOY.js +206 -0
- package/dist/chunk-FM3G3NOY.js.map +1 -0
- package/dist/chunk-FUG4SFN3.js +36 -0
- package/dist/chunk-FUG4SFN3.js.map +1 -0
- package/dist/chunk-GKEWXIV5.js +80 -0
- package/dist/chunk-GTGPO5KW.js +59 -0
- package/dist/chunk-HB3RFQSC.js +95 -0
- package/dist/chunk-HDMEGAQE.js +957 -0
- package/dist/chunk-HDMEGAQE.js.map +1 -0
- package/dist/chunk-HDQIIUPH.js +135 -0
- package/dist/chunk-HDQIIUPH.js.map +1 -0
- package/dist/chunk-HTJQYHZP.js +344 -0
- package/dist/chunk-HTJQYHZP.js.map +1 -0
- package/dist/chunk-I6GALP6E.js +99 -0
- package/dist/chunk-IGJCYUT5.js +99 -0
- package/dist/chunk-IGJCYUT5.js.map +1 -0
- package/dist/chunk-IL6POWCW.js +130 -0
- package/dist/chunk-IU6SNYX6.js +117 -0
- package/dist/chunk-J2ZX2XUV.js +778 -0
- package/dist/chunk-JIF24JPM.js +495 -0
- package/dist/chunk-JIF24JPM.js.map +1 -0
- package/dist/chunk-JK733I5V.js +23 -0
- package/dist/chunk-JK733I5V.js.map +1 -0
- package/dist/chunk-JKJOGPZN.js +29 -0
- package/dist/chunk-JNAI2HN2.js +32 -0
- package/dist/chunk-JNAI2HN2.js.map +1 -0
- package/dist/chunk-JZUV47FZ.js +41 -0
- package/dist/chunk-K5IMOGHB.js +30 -0
- package/dist/chunk-KPZS5QAQ.js +151 -0
- package/dist/chunk-KPZS5QAQ.js.map +1 -0
- package/dist/chunk-KSKBRKGJ.js +291 -0
- package/dist/chunk-KSKBRKGJ.js.map +1 -0
- package/dist/chunk-LASZKVMO.js +382 -0
- package/dist/chunk-LXEXBTKL.js +515 -0
- package/dist/chunk-LXEXBTKL.js.map +1 -0
- package/dist/chunk-M4CV6BRT.js +524 -0
- package/dist/chunk-M4CV6BRT.js.map +1 -0
- package/dist/chunk-MEFJPTZ4.js +371 -0
- package/dist/chunk-MEFJPTZ4.js.map +1 -0
- package/dist/chunk-MV43JSJF.js +265 -0
- package/dist/chunk-MV43JSJF.js.map +1 -0
- package/dist/chunk-NJ4EOKMB.js +392 -0
- package/dist/chunk-NJ4EOKMB.js.map +1 -0
- package/dist/chunk-NR5LT5RY.js +135 -0
- package/dist/chunk-NWSGI5C7.js +261 -0
- package/dist/chunk-NWSGI5C7.js.map +1 -0
- package/dist/chunk-OSDB5WW3.js +739 -0
- package/dist/chunk-OSDB5WW3.js.map +1 -0
- package/dist/chunk-PN2XMATY.js +37 -0
- package/dist/chunk-PN2XMATY.js.map +1 -0
- package/dist/chunk-Q5VNKNE5.js +70 -0
- package/dist/chunk-QLWMEXCT.js +21 -0
- package/dist/chunk-QRB7NAOJ.js +123 -0
- package/dist/chunk-R4ROFEYC.js +74 -0
- package/dist/chunk-RCVJZMFE.js +164 -0
- package/dist/chunk-RCVJZMFE.js.map +1 -0
- package/dist/chunk-RIX4V2TB.js +367 -0
- package/dist/chunk-RYCTDFUX.js +40 -0
- package/dist/chunk-RZ5SVOYR.js +155 -0
- package/dist/chunk-SLFHQTTW.js +99 -0
- package/dist/chunk-SNZ6URZZ.js +2782 -0
- package/dist/chunk-SNZ6URZZ.js.map +1 -0
- package/dist/chunk-T2FFWNPK.js +75 -0
- package/dist/chunk-T2FFWNPK.js.map +1 -0
- package/dist/chunk-UNFPPVNI.js +23 -0
- package/dist/chunk-VFUPHI2Z.js +333 -0
- package/dist/chunk-VFUPHI2Z.js.map +1 -0
- package/dist/chunk-VLFCJYTL.js +235 -0
- package/dist/chunk-VN3DBQAU.js +124 -0
- package/dist/chunk-VYYM3MEN.js +98 -0
- package/dist/chunk-VYYM3MEN.js.map +1 -0
- package/dist/chunk-VZRODIM3.js +49 -0
- package/dist/chunk-W22IKJE2.js +94 -0
- package/dist/chunk-X3YYQWOQ.js +155 -0
- package/dist/chunk-X7QBD67R.js +14405 -0
- package/dist/chunk-X7QBD67R.js.map +1 -0
- package/dist/chunk-XDYREZWE.js +1128 -0
- package/dist/chunk-XDYREZWE.js.map +1 -0
- package/dist/chunk-XWZVFISC.js +720 -0
- package/dist/chunk-XWZVFISC.js.map +1 -0
- package/dist/chunk-YFXZEAYK.js +85 -0
- package/dist/chunk-ZAJAVEXY.js +50 -0
- package/dist/chunk-ZICD77GM.js +34 -0
- package/dist/chunk-ZJ2AK4V7.js +38 -0
- package/dist/chunk-ZJ2AK4V7.js.map +1 -0
- package/dist/chunk-ZUODRVHY.js +14 -0
- package/dist/classified/index.js +5 -3
- package/dist/classified-marker-CZKA6ITE.js +28 -0
- package/dist/classified-marker-CZKA6ITE.js.map +1 -0
- package/dist/collection-facade-TLWIPI76.js +44 -0
- package/dist/computed-ZIQTYTDI.js +11 -0
- package/dist/consent/index.js +9 -9
- package/dist/crdt/index.js +1 -1
- package/dist/dead-filter-ESOBZZP5.js +28 -0
- package/dist/delegation-W7ZV2322.js +25 -0
- package/dist/derivations/index.js +12 -11
- package/dist/derive-H2BJTLUI.js +21 -0
- package/dist/enclave-AP3I5W7O.js +141 -0
- package/dist/executor-KGWTNEQD.js +9 -0
- package/dist/executor-OVEXR6RT.js +9 -0
- package/dist/executor-UNEH5ZYH.js +25 -0
- package/dist/export-accessible-PCMXSUZS.js +23 -0
- package/dist/extract-partition-SWHFSYJO.js +38 -0
- package/dist/fanout-sidecar-A765THMX.js +74 -0
- package/dist/find-N6345CNT.js +11 -0
- package/dist/forget/index.js +10 -10
- package/dist/forget/index.js.map +1 -1
- package/dist/guards/index.js +6 -6
- package/dist/history/index.js +14 -11
- package/dist/history/index.js.map +1 -1
- package/dist/i18n/index.js +50 -37
- package/dist/i18n/index.js.map +1 -1
- package/dist/index.d.ts +307 -1459
- package/dist/index.js +595 -198
- package/dist/index.js.map +1 -1
- package/dist/indexing/index.js +7 -7
- package/dist/indexing/index.js.map +1 -1
- package/dist/issue-5OKB6I2R.js +19 -0
- package/dist/kernel/best-effort-revert.d.ts +52 -0
- package/dist/kernel/cache/index.d.ts +10 -0
- package/dist/kernel/cache/lru.d.ts +97 -0
- package/dist/kernel/cache/policy.d.ts +32 -0
- package/dist/kernel/collection-config.d.ts +809 -0
- package/dist/kernel/collection.d.ts +1522 -0
- package/dist/kernel/constants.d.ts +18 -0
- package/dist/kernel/debug.d.ts +25 -0
- package/dist/kernel/enclave/broker/proof.d.ts +154 -0
- package/dist/kernel/enclave/classify/bidx.d.ts +77 -0
- package/dist/kernel/enclave/classify/compare.d.ts +10 -0
- package/dist/kernel/enclave/classify/digest.d.ts +8 -0
- package/dist/kernel/enclave/classify/find.d.ts +36 -0
- package/dist/kernel/enclave/classify/kofn.d.ts +7 -0
- package/dist/kernel/enclave/classify/normalize.d.ts +7 -0
- package/dist/kernel/enclave/classify/reveal.d.ts +10 -0
- package/dist/kernel/enclave/classify/vdig.d.ts +39 -0
- package/dist/kernel/enclave/classify/verify.d.ts +36 -0
- package/dist/kernel/enclave/classify/write.d.ts +8 -0
- package/dist/kernel/enclave/crypto.d.ts +263 -0
- package/dist/kernel/enclave/index.d.ts +79 -0
- package/dist/kernel/enclave/record-keys/deterministic.d.ts +55 -0
- package/dist/kernel/enclave/record-keys/envelope-body.d.ts +79 -0
- package/dist/kernel/enclave/record-keys/lifecycle.d.ts +107 -0
- package/dist/kernel/enclave/record-keys/record-codec.d.ts +328 -0
- package/dist/kernel/enclave/record-keys/sealed-slot.d.ts +14 -0
- package/dist/kernel/enclave/record-keys/sealed-slots.d.ts +123 -0
- package/dist/kernel/enclave/record-keys/sealing.d.ts +70 -0
- package/dist/kernel/enclave/record-keys/tombstone.d.ts +57 -0
- package/dist/kernel/env-check.d.ts +1 -0
- package/dist/kernel/errors.d.ts +1922 -0
- package/dist/kernel/events.d.ts +11 -0
- package/dist/kernel/lazy-count.d.ts +13 -0
- package/dist/kernel/memory-store.d.ts +17 -0
- package/dist/kernel/mutation.d.ts +14 -0
- package/dist/kernel/noydb.d.ts +826 -0
- package/dist/kernel/paths.d.ts +25 -0
- package/dist/kernel/query/builder.d.ts +520 -0
- package/dist/kernel/query/index.d.ts +31 -0
- package/dist/kernel/query/join.d.ts +205 -0
- package/dist/kernel/query/live.d.ts +111 -0
- package/dist/kernel/query/predicate.d.ts +139 -0
- package/dist/kernel/query/scan-builder.d.ts +334 -0
- package/dist/kernel/refs.d.ts +205 -0
- package/dist/kernel/schema.d.ts +134 -0
- package/dist/kernel/sync-policy.d.ts +188 -0
- package/dist/kernel/tier-visibility.d.ts +54 -0
- package/dist/kernel/types.d.ts +3239 -0
- package/dist/kernel/util/discriminant.d.ts +58 -0
- package/dist/kernel/util/index.d.ts +14 -0
- package/dist/kernel/util/sanitize-filename.d.ts +75 -0
- package/dist/kernel/validation.d.ts +130 -0
- package/dist/kernel/vault.d.ts +1740 -0
- package/dist/kernel/via/compose.d.ts +144 -0
- package/dist/kernel/via/dispatch.d.ts +195 -0
- package/dist/kernel/via/graph-wiring.d.ts +145 -0
- package/dist/kernel/via/graph.d.ts +166 -0
- package/dist/kernel/via/index.d.ts +200 -0
- package/dist/kernel/via/pipeline.d.ts +266 -0
- package/dist/kernel/via/reconcile.d.ts +153 -0
- package/dist/kernel/via/taint-binding.d.ts +66 -0
- package/dist/kernel/write-queue.d.ts +46 -0
- package/dist/ledger-GFBKVPV4.js +42 -0
- package/dist/legacy/bundle.d.ts +30 -0
- package/dist/legacy/kernel.d.ts +33 -0
- package/dist/liberate-3VDOT4KO.js +24 -0
- package/dist/link-set-Z7Q2ASFX.js +31 -0
- package/dist/materialized-views/index.js +19 -15
- package/dist/noydb-ZCJOYBDI.js +68 -0
- package/dist/on/index.js +9 -9
- package/dist/overlay-views/index.js +4 -4
- package/dist/periods/index.js +12 -12
- package/dist/pod/index.js +11 -11
- package/dist/policy-Z3RUAIY2.js +41 -0
- package/dist/port/as/index.d.ts +26 -0
- package/dist/port/at/index.d.ts +18 -0
- package/dist/port/by/default-provider.d.ts +9 -0
- package/dist/port/by/index.d.ts +17 -0
- package/dist/port/by/types.d.ts +86 -0
- package/dist/port/in/index.d.ts +21 -0
- package/dist/port/on/index.d.ts +27 -0
- package/dist/port/to/index.d.ts +19 -0
- package/dist/port/ui/index.d.ts +21 -0
- package/dist/port/with/blob-strategy.d.ts +98 -0
- package/dist/port/with/broker-strategy.d.ts +84 -0
- package/dist/port/with/capabilities.d.ts +31 -0
- package/dist/port/with/classified-marker.d.ts +9 -0
- package/dist/port/with/classified-strategy.d.ts +62 -0
- package/dist/port/with/computed-strategy.d.ts +19 -0
- package/dist/port/with/i18n-strategy.d.ts +175 -0
- package/dist/port/with/index.d.ts +18 -0
- package/dist/port/with/lazy-strategy.d.ts +48 -0
- package/dist/port/with/lookup-strategy.d.ts +129 -0
- package/dist/port/with/service-bus.d.ts +156 -0
- package/dist/port/with/team-strategy.d.ts +36 -0
- package/dist/port/with/write-hooks.d.ts +34 -0
- package/dist/portability/index.js +8 -8
- package/dist/post-register-JTH76BLY.js +60 -0
- package/dist/post-register-JTH76BLY.js.map +1 -0
- package/dist/public-envelope-B4KNWVUA.js +32 -0
- package/dist/purge-scope-FGNNLWHD.js +24 -0
- package/dist/purge-scope-FGNNLWHD.js.map +1 -0
- package/dist/query/index.js +9 -6
- package/dist/read-only-facade-CHCKSEPD.js +8 -0
- package/dist/register-VAHONCID.js +23 -0
- package/dist/registry-7MLVD3VO.js +19 -0
- package/dist/registry-EPKPD5SM.js +18 -0
- package/dist/registry-P5T7PS2U.js +9 -0
- package/dist/request-withdrawal-TI3A5WPS.js +31 -0
- package/dist/reveal-DIBHLUZX.js +38 -0
- package/dist/reveal-DIBHLUZX.js.map +1 -0
- package/dist/revoke-FDRD6GRW.js +24 -0
- package/dist/satellites/index.js +1 -1
- package/dist/sealed-record/index.js +12 -12
- package/dist/seed-Q6M2IZFL.js +231 -0
- package/dist/seed-Q6M2IZFL.js.map +1 -0
- package/dist/session/index.js +9 -9
- package/dist/shadow/index.js +2 -2
- package/dist/signer-MUWEIUI6.js +25 -0
- package/dist/snapshots/index.js +10 -10
- package/dist/stale-OSQ7J3AA.js +29 -0
- package/dist/storage-MVFCGEQE.js +23 -0
- package/dist/store-coordination-provider-64OEZFGS.js +142 -0
- package/dist/sync/index.js +9 -9
- package/dist/team/index.js +15 -15
- package/dist/tiers/index.js +14 -10
- package/dist/to/index.js +1 -2
- package/dist/tx/index.js +3 -3
- package/dist/util/index.js +1 -1
- package/dist/verify-ZASTRNPR.js +140 -0
- package/dist/verify-ZASTRNPR.js.map +1 -0
- package/dist/via/blob/active.d.ts +34 -0
- package/dist/via/blob/binding.d.ts +86 -0
- package/dist/via/blob/index.d.ts +34 -0
- package/dist/via/classified/active.d.ts +3 -0
- package/dist/via/classified/binding.d.ts +83 -0
- package/dist/via/classified/config-drift.d.ts +34 -0
- package/dist/via/classified/descriptor.d.ts +66 -0
- package/dist/via/classified/errors.d.ts +19 -0
- package/dist/via/classified/guards.d.ts +23 -0
- package/dist/via/classified/index.d.ts +11 -0
- package/dist/via/classified/presets.d.ts +65 -0
- package/dist/via/classified/resolve.d.ts +9 -0
- package/dist/via/classified/strategy.d.ts +11 -0
- package/dist/via/classified/validators.d.ts +3 -0
- package/dist/via/classified/write.d.ts +4 -0
- package/dist/via/computed/binding.d.ts +34 -0
- package/dist/via/computed/descriptor.d.ts +35 -0
- package/dist/via/i18n/active.d.ts +28 -0
- package/dist/via/i18n/binding.d.ts +36 -0
- package/dist/via/i18n/core.d.ts +267 -0
- package/dist/via/i18n/densify.d.ts +24 -0
- package/dist/via/i18n/dictionary.d.ts +200 -0
- package/dist/via/i18n/index.d.ts +21 -0
- package/dist/via/i18n/policy.d.ts +44 -0
- package/dist/via/i18n/script.d.ts +26 -0
- package/dist/via/i18n/strategy.d.ts +13 -0
- package/dist/via/lookup/active.d.ts +19 -0
- package/dist/via/lookup/binding.d.ts +99 -0
- package/dist/via/lookup/descriptor.d.ts +123 -0
- package/dist/via/lookup/handle.d.ts +220 -0
- package/dist/via/lookup/index.d.ts +17 -0
- package/dist/via/lookup/registry.d.ts +228 -0
- package/dist/via/lookup/snapshot.d.ts +67 -0
- package/dist/via/money/arith.d.ts +68 -0
- package/dist/via/money/binding.d.ts +21 -0
- package/dist/via/money/branded.d.ts +61 -0
- package/dist/via/money/descriptor.d.ts +73 -0
- package/dist/via/money/fixed-point.d.ts +51 -0
- package/dist/via/money/index.d.ts +15 -0
- package/dist/via/money/iso4217.d.ts +6 -0
- package/dist/via/money/money-reducer.d.ts +33 -0
- package/dist/via/money/normalize.d.ts +105 -0
- package/dist/via/money/paths.d.ts +61 -0
- package/dist/via/money/where.d.ts +127 -0
- package/dist/walk-SVNDIZ62.js +241 -0
- package/dist/with/index.js +11 -11
- package/dist/with-audit/attestation/active.d.ts +10 -0
- package/dist/with-audit/attestation/index.d.ts +16 -0
- package/dist/with-audit/attestation/issue.d.ts +29 -0
- package/dist/with-audit/attestation/revoke.d.ts +15 -0
- package/dist/with-audit/attestation/signer.d.ts +33 -0
- package/dist/with-audit/attestation/strategy.d.ts +44 -0
- package/dist/with-audit/attestation/vault-facade.d.ts +62 -0
- package/dist/with-audit/consent/active.d.ts +14 -0
- package/dist/with-audit/consent/consent.d.ts +114 -0
- package/dist/with-audit/consent/index.d.ts +14 -0
- package/dist/with-audit/consent/strategy.d.ts +36 -0
- package/dist/with-audit/forget/active.d.ts +31 -0
- package/dist/with-audit/forget/index.d.ts +28 -0
- package/dist/with-audit/forget/purge-scope.d.ts +54 -0
- package/dist/with-audit/forget/strategy.d.ts +199 -0
- package/dist/with-audit/forget/subject-index.d.ts +83 -0
- package/dist/with-audit/guards/executor.d.ts +26 -0
- package/dist/with-audit/guards/immutable-guard.d.ts +63 -0
- package/dist/with-audit/guards/index.d.ts +10 -0
- package/dist/with-audit/guards/read-only-facade.d.ts +31 -0
- package/dist/with-audit/guards/registry.d.ts +83 -0
- package/dist/with-audit/guards/transition-guard.d.ts +82 -0
- package/dist/with-audit/guards/types.d.ts +134 -0
- package/dist/with-audit/guards/with-guard.d.ts +15 -0
- package/dist/with-audit/periods/active.d.ts +11 -0
- package/dist/with-audit/periods/index.d.ts +18 -0
- package/dist/with-audit/periods/periods.d.ts +417 -0
- package/dist/with-audit/periods/strategy.d.ts +32 -0
- package/dist/with-audit/periods/vault-facade.d.ts +95 -0
- package/dist/with-audit/portability/active.d.ts +11 -0
- package/dist/with-audit/portability/export-accessible.d.ts +46 -0
- package/dist/with-audit/portability/index.d.ts +18 -0
- package/dist/with-audit/portability/request-withdrawal.d.ts +85 -0
- package/dist/with-audit/portability/strategy.d.ts +31 -0
- package/dist/with-audit/portability/withdraw-accessible.d.ts +82 -0
- package/dist/with-audit/sealed-record/active.d.ts +9 -0
- package/dist/with-audit/sealed-record/index.d.ts +55 -0
- package/dist/with-audit/sealed-record/strategy.d.ts +34 -0
- package/dist/with-audit/sealed-record/types.d.ts +27 -0
- package/dist/with-audit/tiers/active.d.ts +9 -0
- package/dist/with-audit/tiers/index.d.ts +394 -0
- package/dist/with-audit/tiers/strategy.d.ts +36 -0
- package/dist/with-cargo/active.d.ts +11 -0
- package/dist/with-cargo/adopt-partition.d.ts +81 -0
- package/dist/with-cargo/decrypt-partition.d.ts +19 -0
- package/dist/with-cargo/describe-extraction.d.ts +41 -0
- package/dist/with-cargo/extract-partition.d.ts +155 -0
- package/dist/with-cargo/index.d.ts +33 -0
- package/dist/with-cargo/strategy.d.ts +30 -0
- package/dist/with-cargo/vault-diff.d.ts +144 -0
- package/dist/with-cargo/walk-closure.d.ts +67 -0
- package/dist/with-commit/crdt/active.d.ts +25 -0
- package/dist/with-commit/crdt/crdt.d.ts +42 -0
- package/dist/with-commit/crdt/index.d.ts +16 -0
- package/dist/with-commit/crdt/strategy.d.ts +25 -0
- package/dist/with-commit/history/active.d.ts +40 -0
- package/dist/with-commit/history/diff.d.ts +23 -0
- package/dist/with-commit/history/history.d.ts +73 -0
- package/dist/with-commit/history/index.d.ts +30 -0
- package/dist/with-commit/history/ledger/constants.d.ts +37 -0
- package/dist/with-commit/history/ledger/entry.d.ts +195 -0
- package/dist/with-commit/history/ledger/hash.d.ts +30 -0
- package/dist/with-commit/history/ledger/index.d.ts +19 -0
- package/dist/with-commit/history/ledger/patch.d.ts +99 -0
- package/dist/with-commit/history/ledger/store.d.ts +356 -0
- package/dist/with-commit/history/strategy.d.ts +136 -0
- package/dist/with-commit/history/time-machine.d.ts +202 -0
- package/dist/with-commit/numbering/descriptor.d.ts +27 -0
- package/dist/with-commit/numbering/index.d.ts +69 -0
- package/dist/with-commit/sequence/active.d.ts +10 -0
- package/dist/with-commit/sequence/index.d.ts +150 -0
- package/dist/with-commit/sequence/strategy.d.ts +26 -0
- package/dist/with-commit/tx/active.d.ts +27 -0
- package/dist/with-commit/tx/dry-run.d.ts +29 -0
- package/dist/with-commit/tx/elevated-handle.d.ts +59 -0
- package/dist/with-commit/tx/index.d.ts +13 -0
- package/dist/with-commit/tx/invariants.d.ts +68 -0
- package/dist/with-commit/tx/strategy.d.ts +23 -0
- package/dist/with-commit/tx/transaction.d.ts +212 -0
- package/dist/with-fork/archive/engine.d.ts +71 -0
- package/dist/with-fork/archive/index.d.ts +23 -0
- package/dist/with-fork/shadow/active.d.ts +6 -0
- package/dist/with-fork/shadow/index.d.ts +14 -0
- package/dist/with-fork/shadow/strategy.d.ts +28 -0
- package/dist/with-fork/shadow/vault-frame.d.ts +93 -0
- package/dist/with-fork/snapshots/active.d.ts +20 -0
- package/dist/with-fork/snapshots/engine.d.ts +36 -0
- package/dist/with-fork/snapshots/index.d.ts +5 -0
- package/dist/with-fork/snapshots/noydb-facade.d.ts +64 -0
- package/dist/with-fork/snapshots/policy.d.ts +23 -0
- package/dist/with-fork/snapshots/scheduler.d.ts +34 -0
- package/dist/with-fork/snapshots/strategy.d.ts +48 -0
- package/dist/with-formula/computed/index.d.ts +48 -0
- package/dist/with-formula/computed/lazy.d.ts +13 -0
- package/dist/with-formula/derivations/executor.d.ts +61 -0
- package/dist/with-formula/derivations/fanout-sidecar.d.ts +75 -0
- package/dist/with-formula/derivations/index.d.ts +6 -0
- package/dist/with-formula/derivations/registry.d.ts +67 -0
- package/dist/with-formula/derivations/stale.d.ts +39 -0
- package/dist/with-formula/derivations/strategy-hash.d.ts +1 -0
- package/dist/with-formula/derivations/types.d.ts +248 -0
- package/dist/with-formula/derivations/with-derivation.d.ts +10 -0
- package/dist/with-formula/derivations/with-rollup.d.ts +34 -0
- package/dist/with-formula/materialized-views/dependency-analyzer.d.ts +58 -0
- package/dist/with-formula/materialized-views/executor.d.ts +80 -0
- package/dist/with-formula/materialized-views/index.d.ts +11 -0
- package/dist/with-formula/materialized-views/query-hash.d.ts +23 -0
- package/dist/with-formula/materialized-views/registry.d.ts +99 -0
- package/dist/with-formula/materialized-views/stale.d.ts +113 -0
- package/dist/with-formula/materialized-views/types.d.ts +318 -0
- package/dist/with-formula/materialized-views/with-materialized-view.d.ts +24 -0
- package/dist/with-formula/overlay-views/index.d.ts +5 -0
- package/dist/with-formula/overlay-views/registry.d.ts +42 -0
- package/dist/with-formula/overlay-views/types.d.ts +97 -0
- package/dist/with-formula/overlay-views/virtual-collection.d.ts +90 -0
- package/dist/with-formula/overlay-views/with-overlayed-view.d.ts +9 -0
- package/dist/with-lookup/aggregate/active.d.ts +33 -0
- package/dist/with-lookup/aggregate/aggregation.d.ts +166 -0
- package/dist/with-lookup/aggregate/canonical-key.d.ts +16 -0
- package/dist/with-lookup/aggregate/groupby.d.ts +280 -0
- package/dist/with-lookup/aggregate/index.d.ts +23 -0
- package/dist/with-lookup/aggregate/reducers.d.ts +257 -0
- package/dist/with-lookup/aggregate/strategy.d.ts +59 -0
- package/dist/with-lookup/embeddings/cosine.d.ts +2 -0
- package/dist/with-lookup/embeddings/descriptor.d.ts +8 -0
- package/dist/with-lookup/embeddings/index.d.ts +4 -0
- package/dist/with-lookup/embeddings/vec-id.d.ts +47 -0
- package/dist/with-lookup/embeddings/vector-set.d.ts +19 -0
- package/dist/with-lookup/indexing/active.d.ts +30 -0
- package/dist/with-lookup/indexing/collection-facade.d.ts +157 -0
- package/dist/with-lookup/indexing/eager-indexes.d.ts +122 -0
- package/dist/with-lookup/indexing/index.d.ts +27 -0
- package/dist/with-lookup/indexing/lazy-builder.d.ts +102 -0
- package/dist/with-lookup/indexing/persisted-indexes.d.ts +229 -0
- package/dist/with-lookup/indexing/strategy.d.ts +56 -0
- package/dist/with-lookup/indexing/unique-constraints.d.ts +74 -0
- package/dist/with-lookup/search/active.d.ts +10 -0
- package/dist/with-lookup/search/build-docs.d.ts +15 -0
- package/dist/with-lookup/search/collection-facade.d.ts +163 -0
- package/dist/with-lookup/search/fuse.d.ts +22 -0
- package/dist/with-lookup/search/index-store.d.ts +19 -0
- package/dist/with-lookup/search/index.d.ts +19 -0
- package/dist/with-lookup/search/inverted-index.d.ts +47 -0
- package/dist/with-lookup/search/persisted-index-store.d.ts +121 -0
- package/dist/with-lookup/search/retrieve-types.d.ts +29 -0
- package/dist/with-lookup/search/scan.d.ts +28 -0
- package/dist/with-lookup/search/segment.d.ts +15 -0
- package/dist/with-lookup/search/serialize.d.ts +4 -0
- package/dist/with-lookup/search/snippet.d.ts +5 -0
- package/dist/with-lookup/search/strategy.d.ts +41 -0
- package/dist/with-lookup/search/tokenize.d.ts +12 -0
- package/dist/with-party/auth-introspection/index.d.ts +44 -0
- package/dist/with-party/broker/active.d.ts +23 -0
- package/dist/with-party/broker/index.d.ts +28 -0
- package/dist/with-party/broker/seed.d.ts +77 -0
- package/dist/with-party/custody/active.d.ts +10 -0
- package/dist/with-party/custody/index.d.ts +69 -0
- package/dist/with-party/custody/liberate.d.ts +64 -0
- package/dist/with-party/custody/strategy.d.ts +48 -0
- package/dist/with-party/directory/index.d.ts +11 -0
- package/dist/with-party/directory/public-envelope/index.d.ts +12 -0
- package/dist/with-party/directory/public-envelope/schema.d.ts +24 -0
- package/dist/with-party/directory/public-envelope/storage.d.ts +59 -0
- package/dist/with-party/directory/public-envelope/types.d.ts +80 -0
- package/dist/with-party/directory/storage.d.ts +33 -0
- package/dist/with-party/directory/types.d.ts +43 -0
- package/dist/with-party/directory/user-envelope/api.d.ts +201 -0
- package/dist/with-party/directory/user-envelope/index.d.ts +12 -0
- package/dist/with-party/directory/user-envelope/storage.d.ts +54 -0
- package/dist/with-party/directory/visibility.d.ts +47 -0
- package/dist/with-party/policy/engine.d.ts +60 -0
- package/dist/with-party/policy/index.d.ts +15 -0
- package/dist/with-party/policy/noydb-facade.d.ts +39 -0
- package/dist/with-party/policy/presets.d.ts +38 -0
- package/dist/with-party/policy/storage.d.ts +31 -0
- package/dist/with-party/session/active.d.ts +34 -0
- package/dist/with-party/session/dev-unlock.d.ts +128 -0
- package/dist/with-party/session/index.d.ts +23 -0
- package/dist/with-party/session/session-policy.d.ts +92 -0
- package/dist/with-party/session/session.d.ts +131 -0
- package/dist/with-party/session/strategy.d.ts +42 -0
- package/dist/with-party/session/unlock-state.d.ts +47 -0
- package/dist/with-party/sync/index.d.ts +31 -0
- package/dist/with-party/tab-coordination.d.ts +73 -0
- package/dist/with-party/tab-write-relay.d.ts +39 -0
- package/dist/with-party/team/active.d.ts +13 -0
- package/dist/with-party/team/authenticators.d.ts +95 -0
- package/dist/with-party/team/deed.d.ts +97 -0
- package/dist/with-party/team/delegation.d.ts +88 -0
- package/dist/with-party/team/index.d.ts +38 -0
- package/dist/with-party/team/keyring.d.ts +318 -0
- package/dist/with-party/team/magic-link-grant.d.ts +152 -0
- package/dist/with-party/team/managed-passphrase.d.ts +280 -0
- package/dist/with-party/team/noydb-facade.d.ts +484 -0
- package/dist/with-party/team/peer-recover.d.ts +81 -0
- package/dist/with-party/team/presence.d.ts +81 -0
- package/dist/with-party/team/recovery.d.ts +191 -0
- package/dist/with-party/team/reserved-secret-collections.d.ts +41 -0
- package/dist/with-party/team/rotate-recover.d.ts +275 -0
- package/dist/with-party/team/shamir-recovery-provider.d.ts +15 -0
- package/dist/with-party/team/strategy.d.ts +9 -0
- package/dist/with-party/team/sync-active.d.ts +33 -0
- package/dist/with-party/team/sync-credentials.d.ts +113 -0
- package/dist/with-party/team/sync-strategy.d.ts +67 -0
- package/dist/with-party/team/sync-transaction.d.ts +39 -0
- package/dist/with-party/team/sync.d.ts +174 -0
- package/dist/with-party/team/tiers.d.ts +39 -0
- package/dist/with-party/team/wrapped-deks.d.ts +86 -0
- package/dist/with-pod/backup.d.ts +74 -0
- package/dist/with-pod/bundle.d.ts +414 -0
- package/dist/with-pod/format.d.ts +203 -0
- package/dist/with-pod/index.d.ts +20 -0
- package/dist/with-pod/pod-store.d.ts +54 -0
- package/dist/with-pod/ulid.d.ts +64 -0
- package/dist/with-shape/blobs/blob-compaction.d.ts +170 -0
- package/dist/with-shape/blobs/blob-intent.d.ts +153 -0
- package/dist/with-shape/blobs/blob-set.d.ts +1286 -0
- package/dist/with-shape/blobs/export-blobs.d.ts +110 -0
- package/dist/with-shape/blobs/import-external.d.ts +50 -0
- package/dist/with-shape/blobs/mime-magic.d.ts +48 -0
- package/dist/with-shape/blobs/object-projection.d.ts +70 -0
- package/dist/with-shape/introspection/describe.d.ts +237 -0
- package/dist/with-shape/introspection/field-meta.d.ts +61 -0
- package/dist/with-shape/introspection/fields.d.ts +14 -0
- package/dist/with-shape/introspection/index.d.ts +12 -0
- package/dist/with-shape/introspection/json-schema.d.ts +13 -0
- package/dist/with-shape/introspection/meta.d.ts +22 -0
- package/dist/with-shape/introspection/projection.d.ts +13 -0
- package/dist/with-shape/introspection/types.d.ts +154 -0
- package/dist/with-shape/introspection/walk.d.ts +50 -0
- package/dist/with-shape/links/lazy-handle.d.ts +36 -0
- package/dist/with-shape/links/link-set.d.ts +67 -0
- package/dist/with-shape/links/names.d.ts +65 -0
- package/dist/with-shape/links/vault-facade.d.ts +211 -0
- package/dist/with-shape/persisted-schemas/canonicalize.d.ts +11 -0
- package/dist/with-shape/persisted-schemas/derive.d.ts +29 -0
- package/dist/with-shape/persisted-schemas/index.d.ts +21 -0
- package/dist/with-shape/persisted-schemas/register.d.ts +66 -0
- package/dist/with-shape/persisted-schemas/storage.d.ts +61 -0
- package/dist/with-shape/persisted-schemas/types.d.ts +54 -0
- package/dist/with-shape/satellites/dead-filter.d.ts +21 -0
- package/dist/with-shape/satellites/declare.d.ts +60 -0
- package/dist/with-shape/satellites/existence.d.ts +5 -0
- package/dist/with-shape/satellites/fanout.d.ts +38 -0
- package/dist/with-shape/satellites/forget.d.ts +47 -0
- package/dist/with-shape/satellites/index.d.ts +3 -0
- package/dist/with-shape/satellites/joined.d.ts +19 -0
- package/dist/with-shape/satellites/marker.d.ts +10 -0
- package/dist/with-shape/satellites/migrate-cek.d.ts +26 -0
- package/dist/with-shape/satellites/post-register.d.ts +6 -0
- package/dist/with-shape/satellites/proxy.d.ts +37 -0
- package/dist/with-shape/satellites/raw-target.d.ts +14 -0
- package/dist/with-shape/satellites/registry.d.ts +19 -0
- package/dist/with-shape/satellites/types.d.ts +37 -0
- package/dist/with-shape/satellites/validate.d.ts +17 -0
- package/dist/with-shape/schema-update/client-registry.d.ts +35 -0
- package/dist/with-shape/schema-update/cutover.d.ts +5 -0
- package/dist/with-shape/schema-update/delta.d.ts +2 -0
- package/dist/with-shape/schema-update/dispatch.d.ts +3 -0
- package/dist/with-shape/schema-update/fence-controller.d.ts +62 -0
- package/dist/with-shape/schema-update/fence-watcher.d.ts +37 -0
- package/dist/with-shape/schema-update/fence.d.ts +15 -0
- package/dist/with-shape/schema-update/gate.d.ts +16 -0
- package/dist/with-shape/schema-update/index.d.ts +6 -0
- package/dist/with-shape/schema-update/store-coordination-provider.d.ts +29 -0
- package/dist/with-shape/schema-update/strategies.d.ts +12 -0
- package/dist/with-shape/schema-update/types.d.ts +53 -0
- package/dist/with-store/index.d.ts +15 -0
- package/dist/with-store/lazy/active.d.ts +12 -0
- package/dist/with-store/lazy/index.d.ts +14 -0
- package/dist/with-store/lazy/strategy.d.ts +9 -0
- package/dist/with-store/route-store.d.ts +259 -0
- package/dist/with-store/store-middleware.d.ts +189 -0
- package/dist/withdraw-accessible-WZIEVWSR.js +28 -0
- package/package.json +47 -55
- package/dist/adapter/index.d.ts +0 -5
- package/dist/adapter/index.js +0 -15
- package/dist/aggregate/index.d.ts +0 -42
- package/dist/api-JDWL67WL.js +0 -20
- package/dist/as/index.d.ts +0 -7
- package/dist/at/index.d.ts +0 -5
- package/dist/attestation/index.d.ts +0 -20
- package/dist/backup-WRGNTGJF.js +0 -225
- package/dist/backup-WRGNTGJF.js.map +0 -1
- package/dist/blobs/index.d.ts +0 -44
- package/dist/bundle/index.d.ts +0 -122
- package/dist/bundle-DzWtVw7w.d.ts +0 -548
- package/dist/by/index.d.ts +0 -1
- package/dist/cargo/index.d.ts +0 -9
- package/dist/chunk-25G7PUTA.js +0 -235
- package/dist/chunk-26FSVNBL.js +0 -34
- package/dist/chunk-2PJB6H3H.js +0 -167
- package/dist/chunk-2PJB6H3H.js.map +0 -1
- package/dist/chunk-37JZR7CY.js +0 -91
- package/dist/chunk-3KBK5LU4.js +0 -117
- package/dist/chunk-3YKBGS3I.js +0 -686
- package/dist/chunk-3YKBGS3I.js.map +0 -1
- package/dist/chunk-44DV37ZV.js +0 -75
- package/dist/chunk-44DV37ZV.js.map +0 -1
- package/dist/chunk-47C4CI7R.js +0 -108
- package/dist/chunk-47C4CI7R.js.map +0 -1
- package/dist/chunk-4VDFUBTS.js +0 -275
- package/dist/chunk-4VDFUBTS.js.map +0 -1
- package/dist/chunk-55LSDABW.js +0 -94
- package/dist/chunk-56JB2BGI.js +0 -13003
- package/dist/chunk-56JB2BGI.js.map +0 -1
- package/dist/chunk-5GQE5IDB.js +0 -513
- package/dist/chunk-5GQE5IDB.js.map +0 -1
- package/dist/chunk-5HRJQSKN.js +0 -202
- package/dist/chunk-5HZULLHE.js +0 -404
- package/dist/chunk-5JQMX2EH.js +0 -50
- package/dist/chunk-5UOPIPZC.js +0 -95
- package/dist/chunk-5YBUFCFF.js +0 -135
- package/dist/chunk-62APEMF3.js +0 -280
- package/dist/chunk-62APEMF3.js.map +0 -1
- package/dist/chunk-6P5AJ2ZS.js +0 -120
- package/dist/chunk-6P5AJ2ZS.js.map +0 -1
- package/dist/chunk-6PALJTC2.js +0 -430
- package/dist/chunk-6PALJTC2.js.map +0 -1
- package/dist/chunk-6S7T6WC4.js +0 -111
- package/dist/chunk-6S7T6WC4.js.map +0 -1
- package/dist/chunk-6Z435B6N.js +0 -1656
- package/dist/chunk-6Z435B6N.js.map +0 -1
- package/dist/chunk-723XB5NX.js +0 -86
- package/dist/chunk-7CZ6YXMO.js +0 -124
- package/dist/chunk-7KTL4RHZ.js +0 -120
- package/dist/chunk-7KTL4RHZ.js.map +0 -1
- package/dist/chunk-7TAV3BFQ.js +0 -766
- package/dist/chunk-7TAV3BFQ.js.map +0 -1
- package/dist/chunk-BASCPHNM.js +0 -380
- package/dist/chunk-BASCPHNM.js.map +0 -1
- package/dist/chunk-BGIZAFY7.js +0 -1
- package/dist/chunk-BJ2XF2RC.js +0 -823
- package/dist/chunk-BM6E4MUT.js +0 -881
- package/dist/chunk-BM6E4MUT.js.map +0 -1
- package/dist/chunk-BTFTHF6Q.js +0 -42
- package/dist/chunk-C4NOLA5X.js +0 -132
- package/dist/chunk-C4NOLA5X.js.map +0 -1
- package/dist/chunk-CHK5VVMI.js +0 -155
- package/dist/chunk-DCVVCJVB.js +0 -45
- package/dist/chunk-EU7HDMT3.js +0 -54
- package/dist/chunk-F3EKFGUS.js +0 -99
- package/dist/chunk-FCOZ7DEC.js +0 -355
- package/dist/chunk-FCOZ7DEC.js.map +0 -1
- package/dist/chunk-FWART3VA.js +0 -205
- package/dist/chunk-FZK3JJJK.js +0 -150
- package/dist/chunk-GDOOG5YQ.js +0 -382
- package/dist/chunk-GLVXQU3E.js +0 -155
- package/dist/chunk-HU55NPHZ.js +0 -80
- package/dist/chunk-I6JJ6VJS.js +0 -97
- package/dist/chunk-I6URUNTD.js +0 -59
- package/dist/chunk-IARAK3PK.js +0 -14
- package/dist/chunk-II6DLDZM.js +0 -30
- package/dist/chunk-J5YUA6JB.js +0 -23
- package/dist/chunk-J7OH6R4K.js +0 -49
- package/dist/chunk-K2WCO3NX.js +0 -1
- package/dist/chunk-L6Q5NA22.js +0 -40
- package/dist/chunk-LFGJG4XZ.js +0 -30
- package/dist/chunk-M3OYTM5Z.js +0 -85
- package/dist/chunk-MOQ5M46U.js +0 -209
- package/dist/chunk-NTPWQH4S.js +0 -589
- package/dist/chunk-OJ64XMPJ.js +0 -1434
- package/dist/chunk-OJ64XMPJ.js.map +0 -1
- package/dist/chunk-OWGAXPRE.js +0 -129
- package/dist/chunk-P2PEPSPK.js +0 -230
- package/dist/chunk-P6TZ3IVN.js +0 -453
- package/dist/chunk-P6TZ3IVN.js.map +0 -1
- package/dist/chunk-PAJCRV7O.js +0 -123
- package/dist/chunk-PMMV5SQC.js +0 -416
- package/dist/chunk-PMMV5SQC.js.map +0 -1
- package/dist/chunk-PPPZIBKY.js +0 -261
- package/dist/chunk-PPPZIBKY.js.map +0 -1
- package/dist/chunk-PVC2FBCQ.js +0 -45
- package/dist/chunk-PYIUDUGS.js +0 -36
- package/dist/chunk-QABECTNN.js +0 -255
- package/dist/chunk-QYMMMKOO.js +0 -164
- package/dist/chunk-R4IVPJHN.js +0 -130
- package/dist/chunk-REWTMYSF.js +0 -32
- package/dist/chunk-REWTMYSF.js.map +0 -1
- package/dist/chunk-RNYDHIQL.js +0 -367
- package/dist/chunk-RUIMKQTA.js +0 -23
- package/dist/chunk-RUIMKQTA.js.map +0 -1
- package/dist/chunk-TCGVRKOS.js +0 -367
- package/dist/chunk-TIAYXOEI.js +0 -99
- package/dist/chunk-TQ3REHVF.js +0 -95
- package/dist/chunk-TQ3REHVF.js.map +0 -1
- package/dist/chunk-TUL5YQWF.js +0 -777
- package/dist/chunk-U7LV2DUN.js +0 -74
- package/dist/chunk-UB3XHGFG.js +0 -181
- package/dist/chunk-UB3XHGFG.js.map +0 -1
- package/dist/chunk-UMH35AQV.js +0 -70
- package/dist/chunk-UWZ7O4NR.js +0 -29
- package/dist/chunk-V76PHWLE.js +0 -41
- package/dist/chunk-VFQOE76I.js +0 -69
- package/dist/chunk-VIWOGJ2O.js +0 -71
- package/dist/chunk-VK6OC22R.js +0 -37
- package/dist/chunk-VK6OC22R.js.map +0 -1
- package/dist/chunk-VVLOWY74.js +0 -150
- package/dist/chunk-VVLOWY74.js.map +0 -1
- package/dist/chunk-W3JABOVB.js +0 -53
- package/dist/chunk-W3JABOVB.js.map +0 -1
- package/dist/chunk-WPNP3NF5.js +0 -1221
- package/dist/chunk-WPNP3NF5.js.map +0 -1
- package/dist/chunk-X5QZAJDB.js +0 -59
- package/dist/chunk-X6VNIRHS.js +0 -239
- package/dist/chunk-X6VNIRHS.js.map +0 -1
- package/dist/chunk-XBPUVQDO.js +0 -664
- package/dist/chunk-XBPUVQDO.js.map +0 -1
- package/dist/chunk-XW5LZYV4.js +0 -21
- package/dist/chunk-YTCCC6NG.js +0 -320
- package/dist/chunk-YTCCC6NG.js.map +0 -1
- package/dist/classified/index.d.ts +0 -17
- package/dist/collection-facade-EJVIN2BY.js +0 -39
- package/dist/computed-6FOFXQPE.js +0 -11
- package/dist/config-drift-RFEVGBKR.js +0 -24
- package/dist/config-drift-RFEVGBKR.js.map +0 -1
- package/dist/consent/index.d.ts +0 -23
- package/dist/crdt/index.d.ts +0 -34
- package/dist/dead-filter-RHMNYOXP.js +0 -28
- package/dist/decrypt-partition-IHtxEnTi.d.ts +0 -21
- package/dist/delegation-IHXOASHV.js +0 -25
- package/dist/derivations/index.d.ts +0 -70
- package/dist/derive-CD3ZVIXK.js +0 -21
- package/dist/describe/index.d.ts +0 -1
- package/dist/describe/index.js +0 -1
- package/dist/describe-C6iHNlqJ.d.ts +0 -162
- package/dist/dev-unlock-wgQ7Ci5I.d.ts +0 -263
- package/dist/discriminant-BN9REW3o.d.ts +0 -60
- package/dist/enclave-KGEUW2GL.js +0 -123
- package/dist/executor-EUPYHCLU.js +0 -9
- package/dist/executor-KZ4B3PRT.js +0 -9
- package/dist/executor-MHUM2VZK.js +0 -21
- package/dist/export-accessible-Z3NSZZHN.js +0 -23
- package/dist/extract-partition-VSKT35JG.js +0 -36
- package/dist/fanout-sidecar-NBDKKCHT.js +0 -74
- package/dist/find-OH4BEULF.js +0 -11
- package/dist/forget/index.d.ts +0 -36
- package/dist/guards/index.d.ts +0 -35
- package/dist/hash-CwHnoKyW.d.ts +0 -72
- package/dist/history/index.d.ts +0 -61
- package/dist/i18n/index.d.ts +0 -37
- package/dist/in/index.d.ts +0 -5
- package/dist/index-B9QdHytu.d.ts +0 -123
- package/dist/index-CTvUp94-.d.ts +0 -123
- package/dist/index-Dn5GzPg_.d.ts +0 -22138
- package/dist/indexing/index.d.ts +0 -39
- package/dist/issue-AEOL6RXA.js +0 -19
- package/dist/kernel/index.d.ts +0 -32
- package/dist/kernel/index.js +0 -59
- package/dist/lazy/index.d.ts +0 -21
- package/dist/ledger-3LR3YO2W.js +0 -42
- package/dist/liberate-XSEPRWEA.js +0 -24
- package/dist/link-set-NSUIX6BR.js +0 -31
- package/dist/materialized-views/index.d.ts +0 -173
- package/dist/mime-magic-CYbFNQ4h.d.ts +0 -103
- package/dist/noydb-POVTIVQ6.js +0 -62
- package/dist/on/index.d.ts +0 -5
- package/dist/overlay-views/index.d.ts +0 -98
- package/dist/periods/index.d.ts +0 -20
- package/dist/pod/index.d.ts +0 -63
- package/dist/policy-Y7HL2KGA.js +0 -41
- package/dist/portability/index.d.ts +0 -20
- package/dist/post-register-KOFRTCDD.js +0 -55
- package/dist/post-register-KOFRTCDD.js.map +0 -1
- package/dist/public-envelope-NC7SPNMV.js +0 -32
- package/dist/query/index.d.ts +0 -5
- package/dist/read-only-facade-5ADRJVTM.js +0 -8
- package/dist/register-3D6R2MKN.js +0 -23
- package/dist/registry-AI4E46PD.js +0 -19
- package/dist/registry-HSNQ4NBP.js +0 -9
- package/dist/registry-WIX6QCV5.js +0 -17
- package/dist/request-withdrawal-GU4XS2R5.js +0 -31
- package/dist/reveal-5Y777N5Q.js +0 -38
- package/dist/reveal-5Y777N5Q.js.map +0 -1
- package/dist/revoke-ZFETCLYV.js +0 -24
- package/dist/revoke-ZFETCLYV.js.map +0 -1
- package/dist/satellites/index.d.ts +0 -5
- package/dist/sealed-record/index.d.ts +0 -69
- package/dist/session/index.d.ts +0 -44
- package/dist/shadow/index.d.ts +0 -15
- package/dist/signer-GAIMQQ2J.js +0 -25
- package/dist/signer-GAIMQQ2J.js.map +0 -1
- package/dist/snapshots/index.d.ts +0 -26
- package/dist/stale-77LP2EEF.js +0 -14
- package/dist/stale-77LP2EEF.js.map +0 -1
- package/dist/storage-KEXIXLGM.js +0 -23
- package/dist/storage-KEXIXLGM.js.map +0 -1
- package/dist/store-coordination-provider-NJDDZ264.js +0 -142
- package/dist/subject-index-O75wKshW.d.ts +0 -362
- package/dist/sync/index.d.ts +0 -41
- package/dist/team/index.d.ts +0 -155
- package/dist/tiers/index.d.ts +0 -5
- package/dist/to/index.d.ts +0 -5
- package/dist/transition-guard-D5RLJv8S.d.ts +0 -165
- package/dist/tx/index.d.ts +0 -35
- package/dist/ui/index.d.ts +0 -1
- package/dist/ulid-DRH25k3y.d.ts +0 -66
- package/dist/util/index.d.ts +0 -79
- package/dist/validators-C3lrVF-c.d.ts +0 -101
- package/dist/vault-diff-_LSIcOMv.d.ts +0 -147
- package/dist/verify-CAYGXYNO.js +0 -139
- package/dist/verify-CAYGXYNO.js.map +0 -1
- package/dist/walk-SMAE4IEI.js +0 -241
- package/dist/with/index.d.ts +0 -38
- package/dist/with-materialized-view-Xv1-9Bh0.d.ts +0 -27
- package/dist/with-overlayed-view-CuWhq_-C.d.ts +0 -12
- package/dist/with-rollup-K_iwal4b.d.ts +0 -47
- package/dist/withdraw-accessible-Q7BULAN5.js +0 -28
- package/dist/withdraw-accessible-Q7BULAN5.js.map +0 -1
- /package/dist/{adapter/index.js.map → api-ZGS6LCOF.js.map} +0 -0
- /package/dist/{chunk-VIWOGJ2O.js.map → chunk-3B5VVCNY.js.map} +0 -0
- /package/dist/{chunk-P2PEPSPK.js.map → chunk-3LQ2YKO4.js.map} +0 -0
- /package/dist/{chunk-EU7HDMT3.js.map → chunk-3QCRBHCY.js.map} +0 -0
- /package/dist/{chunk-FZK3JJJK.js.map → chunk-4JBYV75E.js.map} +0 -0
- /package/dist/{chunk-I6JJ6VJS.js.map → chunk-4NXKCLLQ.js.map} +0 -0
- /package/dist/{chunk-VFQOE76I.js.map → chunk-5M5DVGV7.js.map} +0 -0
- /package/dist/{chunk-LFGJG4XZ.js.map → chunk-5YOLBEQ6.js.map} +0 -0
- /package/dist/{chunk-OWGAXPRE.js.map → chunk-6CRIV7DE.js.map} +0 -0
- /package/dist/{chunk-QABECTNN.js.map → chunk-6QTNZJBS.js.map} +0 -0
- /package/dist/{chunk-723XB5NX.js.map → chunk-6T2SCQRU.js.map} +0 -0
- /package/dist/{chunk-PVC2FBCQ.js.map → chunk-7DSTRQIJ.js.map} +0 -0
- /package/dist/{chunk-NTPWQH4S.js.map → chunk-AUSTCW2X.js.map} +0 -0
- /package/dist/{chunk-MOQ5M46U.js.map → chunk-B3HJYUOF.js.map} +0 -0
- /package/dist/{chunk-QYMMMKOO.js.map → chunk-BDVFPG6Y.js.map} +0 -0
- /package/dist/{chunk-PYIUDUGS.js.map → chunk-CAF6WOK7.js.map} +0 -0
- /package/dist/{chunk-5HZULLHE.js.map → chunk-CIE2BASH.js.map} +0 -0
- /package/dist/{chunk-BTFTHF6Q.js.map → chunk-CRI4OUV4.js.map} +0 -0
- /package/dist/{chunk-37JZR7CY.js.map → chunk-DLG74CNB.js.map} +0 -0
- /package/dist/{chunk-TCGVRKOS.js.map → chunk-ERJ7FU55.js.map} +0 -0
- /package/dist/{chunk-FWART3VA.js.map → chunk-EVVGJDRQ.js.map} +0 -0
- /package/dist/{chunk-X5QZAJDB.js.map → chunk-EXK7QRWF.js.map} +0 -0
- /package/dist/{chunk-5HRJQSKN.js.map → chunk-EYZ6IQ6X.js.map} +0 -0
- /package/dist/{chunk-DCVVCJVB.js.map → chunk-F64IRYG3.js.map} +0 -0
- /package/dist/{chunk-BJ2XF2RC.js.map → chunk-FHS2HQSH.js.map} +0 -0
- /package/dist/{chunk-HU55NPHZ.js.map → chunk-GKEWXIV5.js.map} +0 -0
- /package/dist/{chunk-I6URUNTD.js.map → chunk-GTGPO5KW.js.map} +0 -0
- /package/dist/{chunk-5UOPIPZC.js.map → chunk-HB3RFQSC.js.map} +0 -0
- /package/dist/{chunk-F3EKFGUS.js.map → chunk-I6GALP6E.js.map} +0 -0
- /package/dist/{chunk-R4IVPJHN.js.map → chunk-IL6POWCW.js.map} +0 -0
- /package/dist/{chunk-3KBK5LU4.js.map → chunk-IU6SNYX6.js.map} +0 -0
- /package/dist/{chunk-TUL5YQWF.js.map → chunk-J2ZX2XUV.js.map} +0 -0
- /package/dist/{chunk-UWZ7O4NR.js.map → chunk-JKJOGPZN.js.map} +0 -0
- /package/dist/{chunk-V76PHWLE.js.map → chunk-JZUV47FZ.js.map} +0 -0
- /package/dist/{chunk-II6DLDZM.js.map → chunk-K5IMOGHB.js.map} +0 -0
- /package/dist/{chunk-GDOOG5YQ.js.map → chunk-LASZKVMO.js.map} +0 -0
- /package/dist/{chunk-5YBUFCFF.js.map → chunk-NR5LT5RY.js.map} +0 -0
- /package/dist/{chunk-UMH35AQV.js.map → chunk-Q5VNKNE5.js.map} +0 -0
- /package/dist/{chunk-XW5LZYV4.js.map → chunk-QLWMEXCT.js.map} +0 -0
- /package/dist/{chunk-PAJCRV7O.js.map → chunk-QRB7NAOJ.js.map} +0 -0
- /package/dist/{chunk-U7LV2DUN.js.map → chunk-R4ROFEYC.js.map} +0 -0
- /package/dist/{chunk-RNYDHIQL.js.map → chunk-RIX4V2TB.js.map} +0 -0
- /package/dist/{chunk-L6Q5NA22.js.map → chunk-RYCTDFUX.js.map} +0 -0
- /package/dist/{chunk-CHK5VVMI.js.map → chunk-RZ5SVOYR.js.map} +0 -0
- /package/dist/{chunk-TIAYXOEI.js.map → chunk-SLFHQTTW.js.map} +0 -0
- /package/dist/{chunk-J5YUA6JB.js.map → chunk-UNFPPVNI.js.map} +0 -0
- /package/dist/{chunk-25G7PUTA.js.map → chunk-VLFCJYTL.js.map} +0 -0
- /package/dist/{chunk-7CZ6YXMO.js.map → chunk-VN3DBQAU.js.map} +0 -0
- /package/dist/{chunk-J7OH6R4K.js.map → chunk-VZRODIM3.js.map} +0 -0
- /package/dist/{chunk-55LSDABW.js.map → chunk-W22IKJE2.js.map} +0 -0
- /package/dist/{chunk-GLVXQU3E.js.map → chunk-X3YYQWOQ.js.map} +0 -0
- /package/dist/{chunk-M3OYTM5Z.js.map → chunk-YFXZEAYK.js.map} +0 -0
- /package/dist/{chunk-5JQMX2EH.js.map → chunk-ZAJAVEXY.js.map} +0 -0
- /package/dist/{chunk-26FSVNBL.js.map → chunk-ZICD77GM.js.map} +0 -0
- /package/dist/{chunk-IARAK3PK.js.map → chunk-ZUODRVHY.js.map} +0 -0
- /package/dist/{api-JDWL67WL.js.map → collection-facade-TLWIPI76.js.map} +0 -0
- /package/dist/{chunk-BGIZAFY7.js.map → computed-ZIQTYTDI.js.map} +0 -0
- /package/dist/{dead-filter-RHMNYOXP.js.map → dead-filter-ESOBZZP5.js.map} +0 -0
- /package/dist/{chunk-K2WCO3NX.js.map → delegation-W7ZV2322.js.map} +0 -0
- /package/dist/{collection-facade-EJVIN2BY.js.map → derive-H2BJTLUI.js.map} +0 -0
- /package/dist/{computed-6FOFXQPE.js.map → enclave-AP3I5W7O.js.map} +0 -0
- /package/dist/{delegation-IHXOASHV.js.map → executor-KGWTNEQD.js.map} +0 -0
- /package/dist/{derive-CD3ZVIXK.js.map → executor-OVEXR6RT.js.map} +0 -0
- /package/dist/{describe/index.js.map → executor-UNEH5ZYH.js.map} +0 -0
- /package/dist/{enclave-KGEUW2GL.js.map → export-accessible-PCMXSUZS.js.map} +0 -0
- /package/dist/{executor-EUPYHCLU.js.map → extract-partition-SWHFSYJO.js.map} +0 -0
- /package/dist/{fanout-sidecar-NBDKKCHT.js.map → fanout-sidecar-A765THMX.js.map} +0 -0
- /package/dist/{executor-KZ4B3PRT.js.map → find-N6345CNT.js.map} +0 -0
- /package/dist/{executor-MHUM2VZK.js.map → issue-5OKB6I2R.js.map} +0 -0
- /package/dist/{export-accessible-Z3NSZZHN.js.map → ledger-GFBKVPV4.js.map} +0 -0
- /package/dist/{extract-partition-VSKT35JG.js.map → liberate-3VDOT4KO.js.map} +0 -0
- /package/dist/{find-OH4BEULF.js.map → link-set-Z7Q2ASFX.js.map} +0 -0
- /package/dist/{issue-AEOL6RXA.js.map → noydb-ZCJOYBDI.js.map} +0 -0
- /package/dist/{kernel/index.js.map → policy-Z3RUAIY2.js.map} +0 -0
- /package/dist/{ledger-3LR3YO2W.js.map → public-envelope-B4KNWVUA.js.map} +0 -0
- /package/dist/{liberate-XSEPRWEA.js.map → read-only-facade-CHCKSEPD.js.map} +0 -0
- /package/dist/{link-set-NSUIX6BR.js.map → register-VAHONCID.js.map} +0 -0
- /package/dist/{noydb-POVTIVQ6.js.map → registry-7MLVD3VO.js.map} +0 -0
- /package/dist/{policy-Y7HL2KGA.js.map → registry-EPKPD5SM.js.map} +0 -0
- /package/dist/{public-envelope-NC7SPNMV.js.map → registry-P5T7PS2U.js.map} +0 -0
- /package/dist/{read-only-facade-5ADRJVTM.js.map → request-withdrawal-TI3A5WPS.js.map} +0 -0
- /package/dist/{register-3D6R2MKN.js.map → revoke-FDRD6GRW.js.map} +0 -0
- /package/dist/{registry-AI4E46PD.js.map → signer-MUWEIUI6.js.map} +0 -0
- /package/dist/{registry-HSNQ4NBP.js.map → stale-OSQ7J3AA.js.map} +0 -0
- /package/dist/{registry-WIX6QCV5.js.map → storage-MVFCGEQE.js.map} +0 -0
- /package/dist/{store-coordination-provider-NJDDZ264.js.map → store-coordination-provider-64OEZFGS.js.map} +0 -0
- /package/dist/{walk-SMAE4IEI.js.map → walk-SVNDIZ62.js.map} +0 -0
- /package/dist/{request-withdrawal-GU4XS2R5.js.map → withdraw-accessible-WZIEVWSR.js.map} +0 -0
|
@@ -0,0 +1,1740 @@
|
|
|
1
|
+
import type { NoydbStore, EncryptedEnvelope, HistoryConfig, ExportStreamOptions, ExportChunk, CollectionConflictResolver, CrossTierAccessEvent, TierMode, Role, VaultUserApi } from './types.js';
|
|
2
|
+
import type { Noydb } from './noydb.js';
|
|
3
|
+
import type { IssueDelegationOptions, DelegationToken } from '../with-party/team/delegation.js';
|
|
4
|
+
import { Collection } from './collection.js';
|
|
5
|
+
import type { CacheOptions } from './collection.js';
|
|
6
|
+
import type { JoinableSource } from './query/index.js';
|
|
7
|
+
import type { OnDirtyCallback } from './collection.js';
|
|
8
|
+
import type { UnlockedKeyring, BundleRecipient } from '../with-party/team/keyring.js';
|
|
9
|
+
import { type PortabilityStrategy } from '../with-audit/portability/strategy.js';
|
|
10
|
+
import type { MaterializedViewRegistry } from '../with-formula/materialized-views/registry.js';
|
|
11
|
+
import type { MaterializedViewStrategyHandle } from '../with-formula/materialized-views/types.js';
|
|
12
|
+
import type { OverlayedViewRegistry } from '../with-formula/overlay-views/registry.js';
|
|
13
|
+
import type { OverlayedViewStrategyHandle } from '../with-formula/overlay-views/types.js';
|
|
14
|
+
import type { PublicEnvelope } from '../with-party/directory/public-envelope/types.js';
|
|
15
|
+
import type { ExportFormat, KeyringFile, SensitiveOpt, IndexFieldName, IndexDefFor, MoneyFieldsOpt } from './types.js';
|
|
16
|
+
import { ElevatedHandle } from '../with-commit/tx/elevated-handle.js';
|
|
17
|
+
import type { NoydbEventEmitter } from './events.js';
|
|
18
|
+
import type { StandardSchemaV1 } from './schema.js';
|
|
19
|
+
import type { BlobStrategy } from '../port/with/blob-strategy.js';
|
|
20
|
+
import type { ObjectProjection } from '../with-shape/blobs/object-projection.js';
|
|
21
|
+
import type { ArchiveStrategy } from '../with-fork/archive/index.js';
|
|
22
|
+
import type { ArchivePolicy, ArchiveResult, ArchiveRunOptions } from '../with-fork/archive/index.js';
|
|
23
|
+
import { type SequenceHandle, type FormattedSequenceHandle, type SequenceOptions } from '../with-commit/sequence/index.js';
|
|
24
|
+
import { type SequenceStrategy } from '../with-commit/sequence/strategy.js';
|
|
25
|
+
import { type Assignment } from '../with-commit/numbering/index.js';
|
|
26
|
+
import type { DeferredNumberingConfig } from '../with-commit/numbering/descriptor.js';
|
|
27
|
+
import type { IndexStrategy } from '../with-lookup/indexing/strategy.js';
|
|
28
|
+
import type { LazyStrategy } from '../port/with/lazy-strategy.js';
|
|
29
|
+
import type { AggregateStrategy } from '../with-lookup/aggregate/strategy.js';
|
|
30
|
+
import type { CrdtStrategy } from './types.js';
|
|
31
|
+
import type { TiersStrategy, TierMoveResult } from '../with-audit/tiers/strategy.js';
|
|
32
|
+
import type { SearchStrategy } from '../with-lookup/search/strategy.js';
|
|
33
|
+
import { type CargoStrategy } from '../with-cargo/strategy.js';
|
|
34
|
+
import { type BrokerStrategy, type CredentialBrokerHandle } from '../port/with/broker-strategy.js';
|
|
35
|
+
import type { LedgerStore } from '../with-commit/history/ledger/store.js';
|
|
36
|
+
import type { VaultInstant } from '../with-commit/history/time-machine.js';
|
|
37
|
+
import { type HistoryStrategy } from '../with-commit/history/strategy.js';
|
|
38
|
+
import { type ForgetStrategy, type ForgetResult } from '../with-audit/forget/strategy.js';
|
|
39
|
+
import { type SubjectRef } from '../with-audit/forget/subject-index.js';
|
|
40
|
+
import type { VaultFrame } from '../with-fork/shadow/vault-frame.js';
|
|
41
|
+
import { type ShadowStrategy } from '../with-fork/shadow/strategy.js';
|
|
42
|
+
import type { ConsentContext, ConsentAuditEntry, ConsentAuditFilter, ConsentOp } from '../with-audit/consent/consent.js';
|
|
43
|
+
import { type ConsentStrategy } from '../with-audit/consent/strategy.js';
|
|
44
|
+
import { type PeriodsStrategy } from '../with-audit/periods/strategy.js';
|
|
45
|
+
import { type RefDescriptor, type RefViolation } from './refs.js';
|
|
46
|
+
import type { DictionaryHandle, DictionaryOptions, DictKeyDescriptor, StaticDictDescriptor } from '../port/with/i18n-strategy.js';
|
|
47
|
+
import { // #653
|
|
48
|
+
type LookupDescriptor } from '../port/with/lookup-strategy.js';
|
|
49
|
+
import { type LinkSpec, type LinkSetHandle } from '../with-shape/links/names.js';
|
|
50
|
+
import type { EmbeddingDescriptor } from '../with-lookup/embeddings/index.js';
|
|
51
|
+
import type { ComputedFields } from '../with-formula/computed/index.js';
|
|
52
|
+
import { type I18nStrategy, type I18nTextDescriptor } from '../port/with/i18n-strategy.js';
|
|
53
|
+
import { type ViaFieldSpec } from './via/compose.js';
|
|
54
|
+
import { ViaGraph } from './via/graph.js';
|
|
55
|
+
import { type RollupDeleteIntent } from './via/dispatch.js';
|
|
56
|
+
import { type SyncStrategy } from '../with-party/team/sync-strategy.js';
|
|
57
|
+
import type { GuardRegistry } from '../with-audit/guards/registry.js';
|
|
58
|
+
import type { GuardStrategyHandleAny } from '../with-audit/guards/types.js';
|
|
59
|
+
import type { ReadOnlyVaultFacade } from '../with-audit/guards/read-only-facade.js';
|
|
60
|
+
import type { DerivationRegistry } from '../with-formula/derivations/registry.js';
|
|
61
|
+
import type { DerivationStrategyHandle } from '../with-formula/derivations/types.js';
|
|
62
|
+
import type { ConflictPolicy } from './types.js';
|
|
63
|
+
import type { CrdtMode } from '../with-commit/crdt/crdt.js';
|
|
64
|
+
import type { JoinedHandle } from '../with-shape/satellites/types.js';
|
|
65
|
+
import { type PeriodRecord, type ClosePeriodOptions, type OpenPeriodOptions } from '../with-audit/periods/index.js';
|
|
66
|
+
import { type EnclaveKey } from './enclave/index.js';
|
|
67
|
+
import type { RecipientSealer } from '../with-party/team/managed-passphrase.js';
|
|
68
|
+
import { type ExportBlobsOptions, type ExportBlobsHandle } from '../with-shape/blobs/export-blobs.js';
|
|
69
|
+
import { type BlobFieldsConfig, type CompactRunOptions, type CompactionResult } from '../with-shape/blobs/blob-compaction.js';
|
|
70
|
+
import { type IssueMagicLinkGrantOptions, type MagicLinkGrantRecord } from '../with-party/team/magic-link-grant.js';
|
|
71
|
+
import { CustodyApi } from '../with-party/custody/index.js';
|
|
72
|
+
import { SchemaFenceController } from '../with-shape/schema-update/fence-controller.js';
|
|
73
|
+
import { type FenceDoc } from '../with-shape/schema-update/fence.js';
|
|
74
|
+
import type { SchemaUpdateStrategy } from '../with-shape/schema-update/types.js';
|
|
75
|
+
import type { AttestationFieldSchema, RevocationList } from '@noy-db/attestation';
|
|
76
|
+
import { type AttestationStrategy } from '../with-audit/attestation/vault-facade.js';
|
|
77
|
+
import { type SealedRecordStrategy } from '../with-audit/sealed-record/strategy.js';
|
|
78
|
+
import type { DumpSchemaOptions, VaultSchemaSnapshot, SchemaIntrospection } from '../with-shape/introspection/types.js';
|
|
79
|
+
import type { VaultIntrospectState } from '../with-shape/introspection/walk.js';
|
|
80
|
+
import type { FieldMeta } from '../with-shape/introspection/field-meta.js';
|
|
81
|
+
import type { CollectionMeta, VaultMeta } from '../with-shape/introspection/meta.js';
|
|
82
|
+
import { type ClassifiedEntry, type ClassifiedStrategy } from '../port/with/classified-strategy.js';
|
|
83
|
+
/** A vault (tenant namespace) containing collections. */
|
|
84
|
+
export declare class Vault {
|
|
85
|
+
#private;
|
|
86
|
+
private readonly adapter;
|
|
87
|
+
/** The vault's name as passed to `openVault()`. Stable for the instance lifetime. */
|
|
88
|
+
readonly name: string;
|
|
89
|
+
/** Backreference to the parent `Noydb` — lets vault-scoped services reach the strategy seam
|
|
90
|
+
* without threading `db` through every API (type-only import keeps the module graph acyclic). */
|
|
91
|
+
readonly noydb: Noydb;
|
|
92
|
+
/** The active in-memory keyring. NOT readonly — `load()` refreshes it after restoring a
|
|
93
|
+
* different keyring file, or in-memory/on-disk DEKs drift apart and decrypt fails with TamperedError. */
|
|
94
|
+
private keyring;
|
|
95
|
+
private readonly encrypted;
|
|
96
|
+
private readonly emitter;
|
|
97
|
+
private readonly onDirty;
|
|
98
|
+
private readonly onRegisterConflictResolver;
|
|
99
|
+
private readonly syncAdapter;
|
|
100
|
+
private readonly getPurgeableTargets;
|
|
101
|
+
private readonly historyConfig;
|
|
102
|
+
/** tree-shake seam for the optional blob service; `undefined` means "blobs are off for this
|
|
103
|
+
* vault" — every `collection.blob(id)` call throws with a pointer at `@noy-db/hub/blobs`. */
|
|
104
|
+
private readonly blobStrategy;
|
|
105
|
+
private readonly objectStore;
|
|
106
|
+
/** Cold-storage archival strategy (the archive target store). */
|
|
107
|
+
private readonly archiveStrategy;
|
|
108
|
+
/** Per-collection record archival policies. Indexed by collection name. */
|
|
109
|
+
private readonly archiveRegistry;
|
|
110
|
+
private readonly indexStrategy;
|
|
111
|
+
private readonly lazyStrategy;
|
|
112
|
+
private readonly aggregateStrategy;
|
|
113
|
+
private readonly crdtStrategy;
|
|
114
|
+
private readonly tiersStrategy;
|
|
115
|
+
private readonly searchStrategy;
|
|
116
|
+
/** Cargo (partition extraction) strategy — `NO_CARGO` (throwing) unless `withCargo()` was passed.
|
|
117
|
+
* Public so the `extractPartition` free function (which takes a `Vault`) routes through it. */
|
|
118
|
+
readonly cargoStrategy: CargoStrategy;
|
|
119
|
+
private readonly brokerStrategy;
|
|
120
|
+
private readonly sealedRecordStrategy;
|
|
121
|
+
private readonly portabilityStrategy;
|
|
122
|
+
private readonly sequenceStrategy;
|
|
123
|
+
private readonly consentStrategy;
|
|
124
|
+
private readonly periods;
|
|
125
|
+
private readonly linksEnforcer;
|
|
126
|
+
private readonly shadowStrategy;
|
|
127
|
+
private readonly historyStrategy;
|
|
128
|
+
private readonly forgetStrategy;
|
|
129
|
+
private readonly i18nStrategy;
|
|
130
|
+
private readonly syncStrategy;
|
|
131
|
+
private readonly classifiedStrategy;
|
|
132
|
+
/** Per-vault guard registry; `null` until `_initGuards()` runs (or for vaults that never register
|
|
133
|
+
* one) — the runtime class is dynamic-imported on demand to keep it out of the floor bundle. */
|
|
134
|
+
private guardRegistry;
|
|
135
|
+
/** Per-vault derivation/MV/overlay registries — same lazy-load contract as
|
|
136
|
+
* `guardRegistry`: each stays `null` until its `_init*()` runs with at
|
|
137
|
+
* least one strategy/MV/overlay handle. */
|
|
138
|
+
private derivationRegistry;
|
|
139
|
+
private materializedViewRegistry;
|
|
140
|
+
private overlayedViewRegistry;
|
|
141
|
+
/** Per-vault dependency graph (#638) — field postures + derivation/MV/overlay/
|
|
142
|
+
* computed/via-deps edges. Metadata-only (field names, postures, grains —
|
|
143
|
+
* never values or key material); always present, unlike the registries above. */
|
|
144
|
+
readonly graph: ViaGraph;
|
|
145
|
+
/** #638 Task 4 — open sync/cutover/restore touch collector, or `undefined` between batches. */
|
|
146
|
+
private _graphBatch;
|
|
147
|
+
/** Cached read-only facades for guard/derivation callbacks — split by
|
|
148
|
+
* resolution layer (`layer:'guard'` vs `'derivation'`, each field's
|
|
149
|
+
* `onMissing` policy differs). Allocated eagerly inside `_initGuards()`/
|
|
150
|
+
* `_initDerivations()` so read accessors stay synchronous; `null` for
|
|
151
|
+
* vaults without that service. */
|
|
152
|
+
private guardFacade;
|
|
153
|
+
private derivationFacade;
|
|
154
|
+
private getDEK;
|
|
155
|
+
/**
|
|
156
|
+
* Per-principal user envelope API.
|
|
157
|
+
*
|
|
158
|
+
* - Write-self: `me()`, `updateMe(patch)`, `setMe(payload)` — always
|
|
159
|
+
* target this vault session's keyringId. There is no method to write
|
|
160
|
+
* another principal's envelope (own-only write rule, structural).
|
|
161
|
+
* - Read-anyone: `get(keyringId)`, `list()` — read other principals'
|
|
162
|
+
* envelopes, subject to the `view-team-profiles` policy gate.
|
|
163
|
+
* - Reactive: `subscribe(id, cb)`, `live(id)` — fire on local writes.
|
|
164
|
+
*
|
|
165
|
+
* @see docs/superpowers/specs/2026-05-05-user-envelope-design.md
|
|
166
|
+
*/
|
|
167
|
+
readonly user: VaultUserApi;
|
|
168
|
+
/**
|
|
169
|
+
* FR-6 custody API — the sovereign-custody surface, mirroring `vault.user.*`.
|
|
170
|
+
*
|
|
171
|
+
* - `grantCustodian(opts)` / `revokeCustodian(opts)` — owner-only: mint /
|
|
172
|
+
* remove a `custodian` who operates the vault fully but can never grant /
|
|
173
|
+
* rotate / sever / extract.
|
|
174
|
+
* - `liberate(opts)` — custodian-only: the audited claim of ownership over a
|
|
175
|
+
* sealed-owner (Deed) vault (mints a DISTINCT new owner; ledger-audited).
|
|
176
|
+
*
|
|
177
|
+
* @see docs/superpowers/specs/2026-06-17-fr6-deed-custodian-liberate-design.md
|
|
178
|
+
*/
|
|
179
|
+
readonly custody: CustodyApi;
|
|
180
|
+
/** Re-derives an UnlockedKeyring from the adapter using the active user's passphrase; called by
|
|
181
|
+
* `load()` after the on-disk keyring file has been replaced. Provided by Noydb at openVault()
|
|
182
|
+
* time; `undefined` in tests that construct Vault directly (load() then skips the refresh). */
|
|
183
|
+
private readonly reloadKeyring;
|
|
184
|
+
private readonly collectionCache;
|
|
185
|
+
private satelliteRegistry;
|
|
186
|
+
/** Vault-level schema cutover fence/controller. */
|
|
187
|
+
readonly schemaFence: SchemaFenceController;
|
|
188
|
+
/**
|
|
189
|
+
* per-collection `blobFields` retention/TTL config.
|
|
190
|
+
* Populated on `collection({ blobFields })` and read by
|
|
191
|
+
* `vault.compact()`. Indexed by collection name.
|
|
192
|
+
*/
|
|
193
|
+
private readonly blobFieldsRegistry;
|
|
194
|
+
/**
|
|
195
|
+
* Attestation facade (issue/revoke + the per-collection field-schema
|
|
196
|
+
* registry). Built in the constructor.
|
|
197
|
+
*/
|
|
198
|
+
private readonly attestation;
|
|
199
|
+
/**
|
|
200
|
+
* Per-vault ledger store. Lazy-initialized on first
|
|
201
|
+
* `collection()` call (which passes it through to the Collection)
|
|
202
|
+
* or on first `ledger()` call from user code.
|
|
203
|
+
*
|
|
204
|
+
* One LedgerStore is shared across all collections in a vault
|
|
205
|
+
* because the hash chain is vault-scoped: the chain head is a
|
|
206
|
+
* single "what did this vault do last" identifier, not a
|
|
207
|
+
* per-collection one. Two collections appending concurrently is the
|
|
208
|
+
* single-writer concurrency concern documented in the LedgerStore
|
|
209
|
+
* docstring.
|
|
210
|
+
*/
|
|
211
|
+
private ledgerStore;
|
|
212
|
+
/** Lazily-built atomic-sequence store. See {@link sequence}. */
|
|
213
|
+
private sequenceStore;
|
|
214
|
+
/** Lazily-built deferred-numbering engine. See {@link runNumberingPass}. */
|
|
215
|
+
private deferredNumbering;
|
|
216
|
+
/** Registered deferred-numbering series, keyed by series name. */
|
|
217
|
+
private readonly numberingConfigs;
|
|
218
|
+
/**
|
|
219
|
+
* Background writes for persisted-schema envelopes (#schema-dump v0
|
|
220
|
+
* slice 1). One promise per `collection({ persistJsonSchema: true })`
|
|
221
|
+
* registration that actually fired a derive call. Fire-and-forget
|
|
222
|
+
* from the collection factory; tests await
|
|
223
|
+
* {@link _drainPendingSchemaWrites} before asserting on storage.
|
|
224
|
+
* Production code does not need to drain — the writes are
|
|
225
|
+
* idempotent fingerprints, not correctness invariants.
|
|
226
|
+
*/
|
|
227
|
+
private _pendingSchemaWrites;
|
|
228
|
+
/**
|
|
229
|
+
* Per-vault foreign-key reference registry. Collections
|
|
230
|
+
* register their `refs` option here on construction; the
|
|
231
|
+
* vault uses the registry on every put/delete/checkIntegrity
|
|
232
|
+
* call. One instance lives for the compartment's lifetime.
|
|
233
|
+
*/
|
|
234
|
+
private readonly refRegistry;
|
|
235
|
+
/**
|
|
236
|
+
* Vault-default locale. Set via
|
|
237
|
+
* `openVault(name, { locale })`. Used as the fallback locale
|
|
238
|
+
* when per-call `{ locale }` options are not specified on individual
|
|
239
|
+
* `get()`/`list()` calls.
|
|
240
|
+
*/
|
|
241
|
+
private locale;
|
|
242
|
+
/**
|
|
243
|
+
* Vault-level descriptive metadata. Set once at construction via
|
|
244
|
+
* `openVault(name, { meta })`. First-wins: re-opening a cached vault
|
|
245
|
+
* with different meta leaves the original untouched.
|
|
246
|
+
*/
|
|
247
|
+
private readonly vaultMeta;
|
|
248
|
+
/**
|
|
249
|
+
* Current consent scope. Set by `withConsent()` and
|
|
250
|
+
* restored in its finally block. When non-null, every collection
|
|
251
|
+
* access inside the scope writes one entry to `_consent_audit`.
|
|
252
|
+
*
|
|
253
|
+
* Single-slot by design — two concurrent withConsent calls on the
|
|
254
|
+
* same Vault stomp each other. Adopters needing per-flight scoping
|
|
255
|
+
* should use separate Vault instances.
|
|
256
|
+
*/
|
|
257
|
+
private consentContext;
|
|
258
|
+
/** dictKeyField registry: collection name → field name → dictionary name — `DictionaryHandle.rename()`'s reference-update source; populated by `collection()` from `dictKeyFields`. */
|
|
259
|
+
private readonly dictKeyFieldRegistry;
|
|
260
|
+
/** Names of `staticDict()`-backed dictionaries (skip rename tracking; `vault.dictionary(name)` refuses mutation on these via `StaticDictReadonlyError`). Populated at `collection()` config time. */
|
|
261
|
+
private readonly staticDictNames;
|
|
262
|
+
/** Static-dict descriptors by dictionary name — backs the read-path label resolver and the `resolveDictSource` snapshot. Last writer wins across collections (tables match by construction). */
|
|
263
|
+
private readonly staticByName;
|
|
264
|
+
/** Per-collection field name → StaticDictDescriptor, validated by `enforceStaticDictOnPut`. */
|
|
265
|
+
private readonly staticDescriptorByField;
|
|
266
|
+
/** i18nText fields: collection name → field name → descriptor. Used by `applyI18nLocale`/`validateI18nTextValue`; populated by `collection()` from `i18nFields`. Private — the #664 `via/reconcile.ts` dispatch reads these through {@link _viaReconcileCtx}'s structural bag, not `this` directly (a plain structural bag, never a `Vault` import — S5 port-layering forbids the kernel spine from reaching a with-* service, and this file's own reconcile-ladder logic moved OUT into that unguarded module). */
|
|
267
|
+
private readonly i18nFieldRegistry;
|
|
268
|
+
/** Cache of DictionaryHandle instances, one per dictionary name. */
|
|
269
|
+
private readonly dictionaryCache;
|
|
270
|
+
/** #650 Task 4 (#647) — declared reserved-lookup collection name → dimension name, for dimensions
|
|
271
|
+
* with `backing:'reserved'` (dict()/dictKey()). The explicit sync-pull registry: NOT a blanket
|
|
272
|
+
* underscore-glob — populated at `collection()`-declare time and at `dictionary()`-call time. */
|
|
273
|
+
private readonly reservedLookupCollections;
|
|
274
|
+
/** Registered link specs, keyed by link name; set by `vault.link()`. */
|
|
275
|
+
private readonly linkRegistry;
|
|
276
|
+
/** Cache of link-set handles, one per link name (lazy -- see links()). */
|
|
277
|
+
private readonly linkSetCache;
|
|
278
|
+
/** — subscribers for cross-tier access events. */
|
|
279
|
+
private readonly crossTierSubs;
|
|
280
|
+
/** — currently-active elevation, or null. One per vault. */
|
|
281
|
+
private activeElevation;
|
|
282
|
+
/**
|
|
283
|
+
* Optional translator callback threaded from `Noydb.invokeTranslator`.
|
|
284
|
+
* Present only when `plaintextTranslator` was configured on `createNoydb()`.
|
|
285
|
+
*/
|
|
286
|
+
private readonly translateText;
|
|
287
|
+
constructor(opts: {
|
|
288
|
+
adapter: NoydbStore;
|
|
289
|
+
name: string;
|
|
290
|
+
noydb: Noydb;
|
|
291
|
+
keyring: UnlockedKeyring;
|
|
292
|
+
encrypted: boolean;
|
|
293
|
+
emitter: NoydbEventEmitter;
|
|
294
|
+
onDirty?: OnDirtyCallback | undefined;
|
|
295
|
+
historyConfig?: HistoryConfig | undefined;
|
|
296
|
+
reloadKeyring?: (() => Promise<UnlockedKeyring>) | undefined;
|
|
297
|
+
/** Vault-default locale. */
|
|
298
|
+
locale?: string | undefined;
|
|
299
|
+
/** Translator callback from Noydb. */
|
|
300
|
+
plaintextTranslator?: ((text: string, from: string, to: string, field: string, collection: string) => Promise<string>) | undefined;
|
|
301
|
+
/**
|
|
302
|
+
* callback to register a per-collection envelope-level
|
|
303
|
+
* conflict resolver with the SyncEngine. Present when sync is configured.
|
|
304
|
+
*/
|
|
305
|
+
onRegisterConflictResolver?: ((name: string, resolver: CollectionConflictResolver) => void) | undefined;
|
|
306
|
+
/** — optional remote/sync adapter for presence broadcasting. */
|
|
307
|
+
syncAdapter?: NoydbStore | undefined;
|
|
308
|
+
/** #615 — push-only sync targets (backup/archive) this vault may target-purge. Default: none. */
|
|
309
|
+
getPurgeableTargets?: () => readonly {
|
|
310
|
+
store: NoydbStore;
|
|
311
|
+
role: 'backup' | 'archive';
|
|
312
|
+
label?: string;
|
|
313
|
+
}[];
|
|
314
|
+
/**
|
|
315
|
+
* tree-shake seam — strategy for optional blob storage.
|
|
316
|
+
* Passed through to every `Collection` built by `vault.collection()`.
|
|
317
|
+
* `undefined` => every `collection.blob(id)` throws with a pointer
|
|
318
|
+
* at `@noy-db/hub/blobs`.
|
|
319
|
+
*/
|
|
320
|
+
blobStrategy?: BlobStrategy | undefined;
|
|
321
|
+
objectStore?: ObjectProjection | undefined;
|
|
322
|
+
archiveStrategy?: ArchiveStrategy | undefined;
|
|
323
|
+
indexStrategy?: IndexStrategy | undefined;
|
|
324
|
+
lazyStrategy?: LazyStrategy | undefined;
|
|
325
|
+
aggregateStrategy?: AggregateStrategy | undefined;
|
|
326
|
+
crdtStrategy?: CrdtStrategy | undefined;
|
|
327
|
+
tiersStrategy?: TiersStrategy | undefined;
|
|
328
|
+
searchStrategy?: SearchStrategy | undefined;
|
|
329
|
+
cargoStrategy?: CargoStrategy | undefined;
|
|
330
|
+
brokerStrategy?: BrokerStrategy | undefined;
|
|
331
|
+
consentStrategy?: ConsentStrategy | undefined;
|
|
332
|
+
periodsStrategy?: PeriodsStrategy | undefined;
|
|
333
|
+
shadowStrategy?: ShadowStrategy | undefined;
|
|
334
|
+
historyStrategy?: HistoryStrategy | undefined;
|
|
335
|
+
i18nStrategy?: I18nStrategy | undefined;
|
|
336
|
+
syncStrategy?: SyncStrategy | undefined;
|
|
337
|
+
guardStrategies?: ReadonlyArray<GuardStrategyHandleAny> | undefined;
|
|
338
|
+
numberingConfigs?: ReadonlyArray<DeferredNumberingConfig> | undefined;
|
|
339
|
+
forgetStrategy?: ForgetStrategy | undefined;
|
|
340
|
+
attestationStrategy?: AttestationStrategy | undefined;
|
|
341
|
+
classifiedStrategy?: ClassifiedStrategy | undefined;
|
|
342
|
+
sealedRecordStrategy?: SealedRecordStrategy | undefined;
|
|
343
|
+
portabilityStrategy?: PortabilityStrategy | undefined;
|
|
344
|
+
sequenceStrategy?: SequenceStrategy | undefined;
|
|
345
|
+
/** Vault-level descriptive metadata — set once at construction (first-wins). */
|
|
346
|
+
meta?: VaultMeta | undefined;
|
|
347
|
+
});
|
|
348
|
+
/**
|
|
349
|
+
* Construct (or reconstruct) the lazy DEK resolver. Captures the
|
|
350
|
+
* CURRENT value of `this.keyring` and `this.adapter` in a closure,
|
|
351
|
+
* memoizing the inner getDEKFn after first use so subsequent
|
|
352
|
+
* lookups are O(1).
|
|
353
|
+
*
|
|
354
|
+
* `load()` calls this after refreshing `this.keyring` to discard
|
|
355
|
+
* the prior session's cached DEKs.
|
|
356
|
+
*/
|
|
357
|
+
private makeGetDEK;
|
|
358
|
+
/**
|
|
359
|
+
* Open a typed collection within this vault.
|
|
360
|
+
*
|
|
361
|
+
* - `options.indexes` declares secondary indexes for the query DSL.
|
|
362
|
+
* Indexes are computed in memory after decryption; adapters never
|
|
363
|
+
* see plaintext index data.
|
|
364
|
+
* - `options.prefetch` (default `true`) controls hydration. Eager mode
|
|
365
|
+
* loads everything on first access; lazy mode (`prefetch: false`)
|
|
366
|
+
* loads records on demand and bounds memory via the LRU cache.
|
|
367
|
+
* - `options.cache` configures the LRU bounds. Required in lazy mode.
|
|
368
|
+
* Accepts `{ maxRecords, maxBytes: '50MB' | 1024 }`.
|
|
369
|
+
* - `options.schema` attaches a Standard Schema v1 validator (Zod,
|
|
370
|
+
* Valibot, ArkType, Effect Schema, etc.). Every `put()` is validated
|
|
371
|
+
* before encryption; every read is validated after decryption.
|
|
372
|
+
* Failing records throw `SchemaValidationError`.
|
|
373
|
+
* - `options.i18nFields` declares per-field `i18nText()` descriptors
|
|
374
|
+
*. Validated on `put()` and locale-resolved on reads.
|
|
375
|
+
* - `options.dictKeyFields` declares per-field `dictKey()` descriptors
|
|
376
|
+
*. `put()` validates keys against the declared set; reads
|
|
377
|
+
* with `{ locale }` add `<field>Label` virtual fields.
|
|
378
|
+
*
|
|
379
|
+
* Throws `ReservedCollectionNameError` for names starting with `_dict_` or
|
|
380
|
+
* equal to `_sequences`. Use `vault.dictionary(name)` for dict collections
|
|
381
|
+
* and `vault.sequence(name)` for sequence counters.
|
|
382
|
+
*
|
|
383
|
+
* Lazy mode + indexes is rejected at construction time — see the
|
|
384
|
+
* Collection constructor for the rationale.
|
|
385
|
+
*/
|
|
386
|
+
/** Assembles {@link ViaReconcileVaultCtx} — the plain structural bag the #664 `via/reconcile.ts`
|
|
387
|
+
* dispatch reads/writes — from this vault's OWN privates, rather than passing `this` itself. */
|
|
388
|
+
private _viaReconcileCtx;
|
|
389
|
+
collection<T, S extends keyof T & string = never, Q extends keyof T & string = never, M extends keyof T & string = never>(collectionName: string, options?: {
|
|
390
|
+
indexes?: readonly IndexDefFor<IndexFieldName<T, S, Q>>[];
|
|
391
|
+
/** — auto-reconcile policy for persisted-index drift. */
|
|
392
|
+
reconcileOnOpen?: 'off' | 'dry-run' | 'auto';
|
|
393
|
+
prefetch?: boolean;
|
|
394
|
+
cache?: CacheOptions;
|
|
395
|
+
schema?: StandardSchemaV1<unknown, T>;
|
|
396
|
+
refs?: Record<string, RefDescriptor>;
|
|
397
|
+
/** — declare i18nText fields for locale-aware reads. */
|
|
398
|
+
i18nFields?: Record<string, I18nTextDescriptor>;
|
|
399
|
+
/** — embedding config for write-time vector derivation + semantic retrieval. */
|
|
400
|
+
embeddings?: EmbeddingDescriptor;
|
|
401
|
+
/** — string fields exposed to client-side `retrieve()`. */
|
|
402
|
+
textIndexes?: readonly IndexFieldName<T, S>[];
|
|
403
|
+
/** — pre-build the lexical index on open (eager-only). */
|
|
404
|
+
warmIndexOnOpen?: boolean;
|
|
405
|
+
/** — persist the lexical index as an opaque encrypted blob at `_ftindex/<name>`. */
|
|
406
|
+
textIndexPersist?: boolean;
|
|
407
|
+
/** — declare dictKey / staticDict fields for label resolution on reads. */
|
|
408
|
+
dictKeyFields?: Record<string, DictKeyDescriptor | StaticDictDescriptor>;
|
|
409
|
+
/** — declare lookup() / enumOf() / dict() fields (#650 Task 2 — the 'lookup' via binding's three tiers). */
|
|
410
|
+
lookupFields?: Record<string, LookupDescriptor>;
|
|
411
|
+
/** Consumer-neutral per-field descriptors (label/unit/semanticType/sensitivity…). See collection.describe(). */
|
|
412
|
+
fieldMeta?: Record<string, FieldMeta>;
|
|
413
|
+
/** The collection's own descriptive metadata (label/description/icon). See collection.describe(). */
|
|
414
|
+
meta?: CollectionMeta;
|
|
415
|
+
/** — declare money() fields for currency-safe decimal storage/formatting. */
|
|
416
|
+
moneyFields?: MoneyFieldsOpt<T, M>;
|
|
417
|
+
viaFields?: Record<string, ViaFieldSpec>;
|
|
418
|
+
/** — declare computed scalar fields, evaluated on write (schema-owned). Each entry may be
|
|
419
|
+
* a plain `(record) => value` function, OR `{ fn, deps }` to declare source fields for
|
|
420
|
+
* taint propagation (#638 Task 7 — supersedes the retired `computedDeps` option). */
|
|
421
|
+
computed?: ComputedFields<T>;
|
|
422
|
+
/** — declare classified() sensitive-field descriptors. See the classified-fields spec. */
|
|
423
|
+
classifiedFields?: Record<string, ClassifiedEntry>;
|
|
424
|
+
/** — per-collection conflict resolution policy. */
|
|
425
|
+
conflictPolicy?: ConflictPolicy<T>;
|
|
426
|
+
/** — CRDT mode for collaborative editing without conflicts. */
|
|
427
|
+
crdt?: CrdtMode;
|
|
428
|
+
/**
|
|
429
|
+
* declare deterministic-encryption fields for blind
|
|
430
|
+
* equality search. See `Collection` constructor docs for the full
|
|
431
|
+
* trade-off. Requires `acknowledgeDeterministicRisk: true`.
|
|
432
|
+
*/
|
|
433
|
+
deterministicFields?: readonly IndexFieldName<T, S>[];
|
|
434
|
+
/** — explicit ack that deterministic encryption leaks equality. */
|
|
435
|
+
acknowledgeDeterministicRisk?: boolean;
|
|
436
|
+
/** — explicit ack for the classified `equatable` knob (R8 door). Required
|
|
437
|
+
* when any classified field declares `equatable: true`. */
|
|
438
|
+
acknowledgeEquatableRisk?: boolean;
|
|
439
|
+
/**
|
|
440
|
+
* — structural group-encryption. Fields sealed into their own
|
|
441
|
+
* `_sealed[field]` envelope slot (per-field key), kept out of the open
|
|
442
|
+
* `_data` blob. Default-off; byte-identical output when absent.
|
|
443
|
+
*/
|
|
444
|
+
sensitive?: SensitiveOpt<T, S>;
|
|
445
|
+
/**
|
|
446
|
+
* — per-record content-encryption keys. When `true`, every record
|
|
447
|
+
* body is encrypted under a fresh per-record CEK wrapped under the
|
|
448
|
+
* collection DEK (`_cek`), stable across versions. Foundation for
|
|
449
|
+
* per-record erasure / record-scoped sealing. Off by
|
|
450
|
+
* default; non-adopting collections take the legacy path unchanged.
|
|
451
|
+
*/
|
|
452
|
+
perRecordKeys?: boolean;
|
|
453
|
+
satelliteOf?: string;
|
|
454
|
+
fields?: readonly string[];
|
|
455
|
+
joined?: string;
|
|
456
|
+
/**
|
|
457
|
+
* Per-record provenance tracking. When `true`, `put()` calls that
|
|
458
|
+
* supply a `source` option stamp `_source` / `_sourceTs` onto the
|
|
459
|
+
* unencrypted envelope metadata. Off by default.
|
|
460
|
+
*/
|
|
461
|
+
provenance?: boolean;
|
|
462
|
+
/**
|
|
463
|
+
* declarative blob retention / TTL policy per slot
|
|
464
|
+
* name. Values are `{ retainDays?, evictWhen? }`. Evaluated only
|
|
465
|
+
* when `vault.compact()` runs.
|
|
466
|
+
*/
|
|
467
|
+
blobFields?: BlobFieldsConfig<T>;
|
|
468
|
+
blobTierPolicy?: 'isolate' | 'dedup';
|
|
469
|
+
/** — declarative record archival policy: `{ archiveWhen, legalHold? }`. Evaluated when `vault.archive()` runs. */
|
|
470
|
+
archive?: ArchivePolicy<T>;
|
|
471
|
+
/** — declared tiers for this collection. */
|
|
472
|
+
tiers?: readonly number[];
|
|
473
|
+
/** — how lower-tier reads see above-tier records. */
|
|
474
|
+
tierMode?: TierMode;
|
|
475
|
+
/**
|
|
476
|
+
* Opt-in persisted JSON Schema. When `true` AND a Zod `schema` is
|
|
477
|
+
* provided, hub derives a JSON Schema via `zod-to-json-schema`
|
|
478
|
+
* (optional peer-dep) and writes an encrypted snapshot to
|
|
479
|
+
* `_schemas/<collectionName>`. Re-runs on every open; hash-skip
|
|
480
|
+
* avoids write churn when the schema is unchanged.
|
|
481
|
+
*
|
|
482
|
+
* Default: `false`. Non-Zod Standard Schema validators receive a
|
|
483
|
+
* stub envelope flagging the kind without a JSON Schema body.
|
|
484
|
+
*
|
|
485
|
+
* @see docs/superpowers/specs/2026-05-22-schema-dump-design.md
|
|
486
|
+
*/
|
|
487
|
+
persistJsonSchema?: boolean;
|
|
488
|
+
/**
|
|
489
|
+
* Ordered schema-update strategies. On a detected schema
|
|
490
|
+
* change, evaluated in order; the first non-`allow` decision wins.
|
|
491
|
+
* A `reject` is enforced at the write path (`put`/`delete` throw).
|
|
492
|
+
* Requires `persistJsonSchema: true` (detection needs the baseline).
|
|
493
|
+
*/
|
|
494
|
+
schemaUpdate?: readonly SchemaUpdateStrategy[];
|
|
495
|
+
/** — declare the per-field schema for document attestation (issue side). */
|
|
496
|
+
attestation?: AttestationFieldSchema;
|
|
497
|
+
/**
|
|
498
|
+
* Per-collection history & tamper-ledger scoping. Overrides the
|
|
499
|
+
* vault-wide `history` config for THIS collection only (wholesale, not
|
|
500
|
+
* merged). `enabled: false` suppresses per-record snapshots for this
|
|
501
|
+
* collection; `ledger: false` excludes its writes from the vault-wide
|
|
502
|
+
* hash-chained tamper ledger. Lets you confine version snapshots +
|
|
503
|
+
* tamper-evidence to the few collections where they carry legal weight,
|
|
504
|
+
* without paying snapshot + ledger-entry-per-write across operational /
|
|
505
|
+
* derived collections. Defaults to the vault-wide `history` config.
|
|
506
|
+
*/
|
|
507
|
+
historyConfig?: HistoryConfig;
|
|
508
|
+
/**
|
|
509
|
+
* Opt-in: keep the working set encrypted in RAM, decrypting on read (future phase).
|
|
510
|
+
* Default false — the working set is plaintext.
|
|
511
|
+
*/
|
|
512
|
+
ramCiphertext?: boolean;
|
|
513
|
+
}): Collection<T, S, Q, M>;
|
|
514
|
+
/** Full-record handle for a satellite pair registered with `joined:` (spec #591). Narrow type — not a Collection. */
|
|
515
|
+
joined<T extends Record<string, unknown>>(name: string): JoinedHandle<T>;
|
|
516
|
+
/**
|
|
517
|
+
* Migrate an existing satellite's records onto per-record CEKs (#599) —
|
|
518
|
+
* unblocks R-S7 when a base gains forget coverage after its satellite was
|
|
519
|
+
* already declared without `perRecordKeys`. Call BEFORE re-declaring with
|
|
520
|
+
* `{ satelliteOf, perRecordKeys: true }` AND before this collection serves
|
|
521
|
+
* writes (unfenced walk — see {@link migrateSatelliteCek}); resumable.
|
|
522
|
+
*/
|
|
523
|
+
migrateSatellitePerRecordKeys(satelliteName: string): Promise<{
|
|
524
|
+
migrated: number;
|
|
525
|
+
}>;
|
|
526
|
+
/**
|
|
527
|
+
* Await all background persisted-schema writes triggered by
|
|
528
|
+
* `collection({ persistJsonSchema: true })` calls on this vault.
|
|
529
|
+
* Used in tests; production code does not need to call this.
|
|
530
|
+
*/
|
|
531
|
+
_drainPendingSchemaWrites(): Promise<void>;
|
|
532
|
+
/**
|
|
533
|
+
* Run a coordinated schema cutover. Drains pending writes, waits
|
|
534
|
+
* for the active client set to quiesce (the ack-barrier), applies every
|
|
535
|
+
* pending collection transform in bulk, bumps the vault schema generation,
|
|
536
|
+
* and clears the fence. Returns the count of collections migrated.
|
|
537
|
+
* `opts.onPoll` (tests) advances other clients between barrier checks.
|
|
538
|
+
*/
|
|
539
|
+
runSchemaCutover(opts?: {
|
|
540
|
+
onPoll?: () => Promise<void>;
|
|
541
|
+
}): Promise<{
|
|
542
|
+
migrated: number;
|
|
543
|
+
}>;
|
|
544
|
+
/**
|
|
545
|
+
* Refresh a loaded collection's view of one document from a peer
|
|
546
|
+
* tab's broadcast. No-op when the collection isn't loaded in this tab
|
|
547
|
+
* (it will read fresh on next open). Mirrors `#runCutoverTransform`'s guard.
|
|
548
|
+
*/
|
|
549
|
+
_applyRemoteWrite(collectionName: string, docId: string, action: 'put' | 'delete'): Promise<void>;
|
|
550
|
+
/** @internal #598: refresh cache entries a sync-applied write rewrote underneath us. No-op if not loaded this session.
|
|
551
|
+
* #650 Task 4 (#647): a reserved-lookup collection has no `Collection` instance — instead, refresh
|
|
552
|
+
* its already-warmed `LookupHandle._syncCache` (membership/altIndex/snapshot reads never see a
|
|
553
|
+
* stale verdict for a pulled vocabulary edit) and collect the touch into any open graph batch
|
|
554
|
+
* (the sync-apply wave-reachability seam Task 5's ref edges will use). No-op if never warmed. */
|
|
555
|
+
_invalidateSyncApplied(collection: string, id: string, action: 'put' | 'delete'): Promise<void>;
|
|
556
|
+
/** @internal #650 Task 4 (#647) — declared reserved-lookup collection names, for `SyncEngine.pull()`'s explicit prefix registry. */
|
|
557
|
+
_reservedLookupCollectionNames(): readonly string[];
|
|
558
|
+
/** @internal #653 — one-hop reserved-dict deps of `names`, for `SyncEngine`'s partial-sync
|
|
559
|
+
* filter expansion. Provably complete at one hop: `vault.collection()` refuses `_dict_*`
|
|
560
|
+
* names, so a dict can never itself declare lookup fields (no dict-of-dict chain). */
|
|
561
|
+
_reservedDictDepsOf(names: readonly string[]): readonly string[];
|
|
562
|
+
/** @internal #638 Task 4 — open a graph-dispatch touch batch (sync pull()/push()/cutover). */
|
|
563
|
+
_beginGraphBatch(): void;
|
|
564
|
+
/** @internal #638 Task 4 — `Collection._onRecordMutated`'s sync-apply/cutover/restore hook; a
|
|
565
|
+
* no-op when no batch is open (`_beginGraphBatch()` was never called for this call chain). */
|
|
566
|
+
_collectGraphTouch(collection: string, id: string): void;
|
|
567
|
+
/** @internal #640 — the sync-apply delete socket: `id`'s resolved rollup-parent intents. */
|
|
568
|
+
_collectGraphDelete(collection: string, id: string, intents: readonly RollupDeleteIntent[]): void;
|
|
569
|
+
/** @internal #638 Task 4 — close the open batch and run ONE dispatch wave over it. */
|
|
570
|
+
_flushGraphBatch(): Promise<void>;
|
|
571
|
+
/** @internal #638 Task 4 — cached-collection lookup for `runGraphDispatchWave` (`VaultLike`); never constructs. */
|
|
572
|
+
_getCollection(name: string): Collection<Record<string, unknown>> | undefined;
|
|
573
|
+
/** @internal #640 (#644 item 3) — `VaultLike._emit`: the wave's structured error surfacing. */
|
|
574
|
+
_emit(event: string, payload: unknown): void;
|
|
575
|
+
/**
|
|
576
|
+
* @internal #589 → #604. Physically remove delete markers with `_ts` strictly
|
|
577
|
+
* older than `before` (ISO timestamp), across `collections` (or all data
|
|
578
|
+
* collections). Returns the count removed.
|
|
579
|
+
*
|
|
580
|
+
* SAFETY: purging a marker RE-OPENS the #589 resurrection window for any peer
|
|
581
|
+
* offline since before the cutoff — never-GC is safe precisely because the marker
|
|
582
|
+
* is always present to win convergence. This is an operator-asserted safe-point
|
|
583
|
+
* ONLY; #604's period-close lifecycle is what earns that assertion. Do not call
|
|
584
|
+
* it on live/unsettled data.
|
|
585
|
+
*
|
|
586
|
+
* Emits no ledger/event itself — its callers (#604's `freezePeriod`, #615's
|
|
587
|
+
* `purgePeriodTargets`) own the audit record. The sweep body is shared via
|
|
588
|
+
* {@link _purgeMarkersOn}, which #615 also aims at push-only sync targets.
|
|
589
|
+
*
|
|
590
|
+
* Purges the local adapter only. Markers already pushed to the vault's
|
|
591
|
+
* push-only (`backup`/`archive`) sync targets are reclaimed by #615's
|
|
592
|
+
* `vault.purgePeriodTargets`; `sync-peer` targets are left untouched (purging
|
|
593
|
+
* them would re-open the resurrection window — the deferred half of #611).
|
|
594
|
+
*/
|
|
595
|
+
_purgeDeleteMarkers(before: string, collections?: string[]): Promise<number>;
|
|
596
|
+
/**
|
|
597
|
+
* @internal #615. Sweep delete markers with `_ts < before` off ANY store
|
|
598
|
+
* (local adapter or a push-only sync target). Returns the count removed.
|
|
599
|
+
*/
|
|
600
|
+
private _purgeMarkersOn;
|
|
601
|
+
/**
|
|
602
|
+
* @internal #613. Relocate this closed period's in-window records (those
|
|
603
|
+
* with `_ts < before`) from the hot store to the configured cold tier,
|
|
604
|
+
* via the routeStore's `compact({ before })`. Returns the count moved.
|
|
605
|
+
* Requires a `routeStore` with a cold route (the `coldArchival`
|
|
606
|
+
* capability); throws a clear error otherwise. Non-destructive — reads
|
|
607
|
+
* fall through to cold, so this does NOT re-open the #589 window.
|
|
608
|
+
*/
|
|
609
|
+
_archiveClosedPeriod(before: string): Promise<number>;
|
|
610
|
+
/**
|
|
611
|
+
* @internal #615. Sweep delete markers with `_ts < before` off each of the
|
|
612
|
+
* vault's push-only sync targets, returning a per-target count. Skips
|
|
613
|
+
* `sync-peer` targets by construction (getPurgeableTargets yields only
|
|
614
|
+
* backup/archive). Never touches the local adapter.
|
|
615
|
+
*/
|
|
616
|
+
_purgePeriodTargets(before: string): Promise<readonly {
|
|
617
|
+
label?: string;
|
|
618
|
+
role: 'backup' | 'archive';
|
|
619
|
+
purgedCount: number;
|
|
620
|
+
}[]>;
|
|
621
|
+
/**
|
|
622
|
+
* For a detected conflict: capture this tab's clobbered record,
|
|
623
|
+
* read the common ancestor from history, converge the cache to the store's
|
|
624
|
+
* authoritative value (the re-read), and return all three for the
|
|
625
|
+
* WriteConflict payload. Returns null when the collection isn't loaded.
|
|
626
|
+
*/
|
|
627
|
+
_captureAndConverge(collectionName: string, docId: string, action: 'put' | 'delete', baseV: number): Promise<{
|
|
628
|
+
local: unknown;
|
|
629
|
+
remote: unknown;
|
|
630
|
+
base: unknown;
|
|
631
|
+
} | null>;
|
|
632
|
+
/** Recover a stuck cutover fence — reset to normal without bumping. */
|
|
633
|
+
abortSchemaCutover(): Promise<void>;
|
|
634
|
+
/** Current schema-cutover fence state for this vault. Thin live read. */
|
|
635
|
+
schemaFenceState(): Promise<FenceDoc>;
|
|
636
|
+
/** @internal Start heartbeat + fence watcher once a cutover is registered. Async since #553: FenceWatcher dynamic-imports on demand. */
|
|
637
|
+
_ensureFenceCoordination(): Promise<void>;
|
|
638
|
+
/** @internal Stop the heartbeat/watcher (vault lock/close). */
|
|
639
|
+
_stopFenceCoordination(): void;
|
|
640
|
+
/** @internal Best-effort flush of all open collections' persisted
|
|
641
|
+
* lexical indexes on close(). Called fire-and-forget from noydb.close().
|
|
642
|
+
* Correctness is backstopped by the fingerprint: a missed flush → rebuild on
|
|
643
|
+
* next load. Only collections with textIndexPersist have a flush(); others no-op. */
|
|
644
|
+
_flushSearchIndexes(): Promise<void>;
|
|
645
|
+
/** @internal Drive one heartbeat + watch cycle deterministically (tests). */
|
|
646
|
+
_fenceTick(): Promise<void>;
|
|
647
|
+
/**
|
|
648
|
+
* Validate i18nText fields on a `put()`. Called by Collection just
|
|
649
|
+
* before the adapter write, after schema validation. Throws
|
|
650
|
+
* `MissingTranslationError` when a required translation is absent.
|
|
651
|
+
*
|
|
652
|
+
* Delegates through the Via registry (#623) — a no-op only when i18n was
|
|
653
|
+
* never declared (mirrors the registry check below).
|
|
654
|
+
*/
|
|
655
|
+
enforceI18nOnPut(collectionName: string, record: unknown): void;
|
|
656
|
+
/**
|
|
657
|
+
* Validate staticDict codes on a `put()`. For each `staticDict()`
|
|
658
|
+
* field, every stored code must be a declared key of the descriptor's
|
|
659
|
+
* table, else `UnknownDictCodeError`. Opt out per descriptor with
|
|
660
|
+
* `{ validateCodes: false }`.
|
|
661
|
+
*
|
|
662
|
+
* Delegates through the Via registry — see {@link enforceI18nOnPut}. The
|
|
663
|
+
* per-field validation itself lives in `via/lookup/registry.ts`
|
|
664
|
+
* (#650 Task 1 extraction), reached via `port/with/lookup-strategy.ts`.
|
|
665
|
+
*/
|
|
666
|
+
enforceStaticDictOnPut(collectionName: string, record: unknown): void;
|
|
667
|
+
/**
|
|
668
|
+
* Open a dictionary by name. Returns a `DictionaryHandle` for CRUD
|
|
669
|
+
* operations on the `_dict_<name>/` reserved collection.
|
|
670
|
+
*
|
|
671
|
+
* The handle is cached — multiple calls with the same name return the
|
|
672
|
+
* same instance.
|
|
673
|
+
*
|
|
674
|
+
* @param name The dictionary name (e.g. `'status'` → `_dict_status/`).
|
|
675
|
+
* @param options Optional ACL overrides (default `writableBy: 'admin'`).
|
|
676
|
+
*
|
|
677
|
+
* @example
|
|
678
|
+
* ```ts
|
|
679
|
+
* await company.dictionary('status').putAll({
|
|
680
|
+
* draft: { en: 'Draft', th: 'ฉบับร่าง' },
|
|
681
|
+
* paid: { en: 'Paid', th: 'ชำระแล้ว' },
|
|
682
|
+
* })
|
|
683
|
+
* ```
|
|
684
|
+
*/
|
|
685
|
+
dictionary<Keys extends string = string>(name: string, options?: DictionaryOptions): DictionaryHandle<Keys>;
|
|
686
|
+
/**
|
|
687
|
+
* Declare a managed many-to-many link set. Registers a
|
|
688
|
+
* `_links_<name>` junction between two endpoint collections; access its
|
|
689
|
+
* rows via `vault.links(name)`. Idempotent for an identical re-declaration;
|
|
690
|
+
* a conflicting one throws. See {@link links}.
|
|
691
|
+
*
|
|
692
|
+
* ```ts
|
|
693
|
+
* vault.link('saleLineLinks', { a: ref('saleLines'), b: ref('purchaseLines'), onDelete: 'cascade' })
|
|
694
|
+
* ```
|
|
695
|
+
*
|
|
696
|
+
* `a` / `b` accept either a collection name or a `ref(target)` descriptor
|
|
697
|
+
* (only its `target` is used — links manage their own integrity). `onDelete`
|
|
698
|
+
* governs what happens to link rows when an endpoint record is deleted
|
|
699
|
+
* (`'cascade'` default, `'strict'`, `'warn'`).
|
|
700
|
+
*/
|
|
701
|
+
link(name: string, spec: {
|
|
702
|
+
a: string | RefDescriptor;
|
|
703
|
+
b: string | RefDescriptor;
|
|
704
|
+
onDelete?: LinkSpec['onDelete'];
|
|
705
|
+
}): void;
|
|
706
|
+
/**
|
|
707
|
+
* Access a declared link set. Throws if `name` was not first
|
|
708
|
+
* declared via {@link link}. Returns a cached {@link LinkSetHandle}:
|
|
709
|
+
* `connect(a, b, meta?)`, `disconnect(a, b)`, `has(a, b)`, `of(id)`, `list()`.
|
|
710
|
+
*/
|
|
711
|
+
links(name: string): LinkSetHandle;
|
|
712
|
+
/**
|
|
713
|
+
* Build a `JoinableSource` for a dictKey field, for use in dict joins.
|
|
714
|
+
* Returns a source whose snapshot contains `{ key, labels, ...labels }`
|
|
715
|
+
* records — one per dictionary entry — keyed by the stable key. Returns
|
|
716
|
+
* `null` when `field` is not a dictKey in `leftCollection`.
|
|
717
|
+
*
|
|
718
|
+
* Body extracted to `via/lookup/registry.ts` (#650 Task 1) —
|
|
719
|
+
* reached via the `port/with/lookup-strategy.ts` seam. See that
|
|
720
|
+
* function's doc comment for the static-vs-dynamic-dict split and the
|
|
721
|
+
* cache-warming caveat.
|
|
722
|
+
*/
|
|
723
|
+
resolveDictSource(leftCollection: string, field: string): JoinableSource | null;
|
|
724
|
+
/**
|
|
725
|
+
* Set or update the vault-default locale at runtime.
|
|
726
|
+
* Useful when the user switches their preferred language after opening
|
|
727
|
+
* the vault.
|
|
728
|
+
*/
|
|
729
|
+
setLocale(locale: string | undefined): void;
|
|
730
|
+
/** Return the current vault-default locale. */
|
|
731
|
+
getLocale(): string | undefined;
|
|
732
|
+
/** Return the vault-level descriptive metadata (set-once at construction). */
|
|
733
|
+
getMeta(): VaultMeta | undefined;
|
|
734
|
+
/**
|
|
735
|
+
* The user id of the keyring backing this vault session. Useful for
|
|
736
|
+
* UI affordances ("you are alice"), audit trails, and orchestration
|
|
737
|
+
* composables that need to stamp records with the current actor.
|
|
738
|
+
*/
|
|
739
|
+
get userId(): string;
|
|
740
|
+
/**
|
|
741
|
+
* The role of the keyring backing this vault session — one of
|
|
742
|
+
* `owner | admin | operator | viewer | client`. Useful for UI
|
|
743
|
+
* affordance gates and approval workflows that need to confirm
|
|
744
|
+
* the caller can perform a given action before attempting it.
|
|
745
|
+
*/
|
|
746
|
+
get role(): Role;
|
|
747
|
+
/**
|
|
748
|
+
* Build keyring files for bundle recipients without persisting them
|
|
749
|
+
* to the source vault. Used by `writePod()` when the bundle
|
|
750
|
+
* is re-keyed for distinct recipients.
|
|
751
|
+
*
|
|
752
|
+
* Each recipient becomes its own `KeyringFile` sealed with that
|
|
753
|
+
* recipient's passphrase. The DEKs wrapped into each slot are
|
|
754
|
+
* exactly those the recipient's role + permissions justify, and
|
|
755
|
+
* never wider than the source keyring's own DEK set
|
|
756
|
+
* (privilege-escalation check).
|
|
757
|
+
*
|
|
758
|
+
* Returns a `Record<userId, KeyringFile>` ready to substitute for
|
|
759
|
+
* the `keyrings` field of a `vault.dump()` JSON. Adapter is never
|
|
760
|
+
* touched; the produced files exist only in the bundle bytes.
|
|
761
|
+
*
|
|
762
|
+
* @public
|
|
763
|
+
*/
|
|
764
|
+
buildBundleRecipientKeyrings(recipients: readonly BundleRecipient[]): Promise<Record<string, KeyringFile>>;
|
|
765
|
+
/**
|
|
766
|
+
* Authorize an `@noy-db/as-*` export against the current keyring's
|
|
767
|
+
* `exportCapability`. Throws `ExportCapabilityError` if
|
|
768
|
+
* the invoking keyring is not authorised.
|
|
769
|
+
*
|
|
770
|
+
* `as-*` packages MUST call this before invoking the underlying
|
|
771
|
+
* export primitive (`exportStream()` / `writePod()` / …).
|
|
772
|
+
*
|
|
773
|
+
* - `assertCanExport('plaintext', 'xlsx')` — check plaintext tier
|
|
774
|
+
* for a specific format. Defaults to empty for every role; owner
|
|
775
|
+
* must positively grant.
|
|
776
|
+
* - `assertCanExport('bundle')` — check encrypted-bundle tier.
|
|
777
|
+
* Defaults to on for owner/admin, off for others.
|
|
778
|
+
*
|
|
779
|
+
* See `docs/patterns/as-exports.md` for the full policy.
|
|
780
|
+
*/
|
|
781
|
+
assertCanExport(tier: 'plaintext', format: ExportFormat): void;
|
|
782
|
+
assertCanExport(tier: 'bundle'): void;
|
|
783
|
+
/**
|
|
784
|
+
* Authorize an `@noy-db/as-*` import against the current keyring's
|
|
785
|
+
* `importCapability` (issue ). Throws `ImportCapabilityError` if
|
|
786
|
+
* the invoking keyring is not authorised.
|
|
787
|
+
*
|
|
788
|
+
* `as-*` reader entry-points (`fromString` / `fromBytes`) MUST call
|
|
789
|
+
* this before parsing or building an `ImportPlan`.
|
|
790
|
+
*
|
|
791
|
+
* - `assertCanImport('plaintext', 'csv')` — check plaintext-tier
|
|
792
|
+
* import for a specific format. Default-closed for every role.
|
|
793
|
+
* - `assertCanImport('bundle')` — check `.noydb` bundle-import gate.
|
|
794
|
+
* Default-closed for every role, including owner — import is more
|
|
795
|
+
* dangerous than export (corrupts vs leaks).
|
|
796
|
+
*
|
|
797
|
+
* Owner who wants to import re-grants own keyring with
|
|
798
|
+
* `importCapability` set explicitly.
|
|
799
|
+
*/
|
|
800
|
+
assertCanImport(tier: 'plaintext', format: ExportFormat): void;
|
|
801
|
+
assertCanImport(tier: 'bundle'): void;
|
|
802
|
+
/**
|
|
803
|
+
* Bulk blob extraction primitive.
|
|
804
|
+
*
|
|
805
|
+
* Returns an async-iterable handle over every blob attached to
|
|
806
|
+
* records in the vault. Single capability check (`plaintext/blob`)
|
|
807
|
+
* at handle creation; single audit entry to `_export_audit` before
|
|
808
|
+
* the first yield. Per-blob decryption happens lazily as the
|
|
809
|
+
* consumer pulls tuples.
|
|
810
|
+
*
|
|
811
|
+
* ```ts
|
|
812
|
+
* const handle = vault.exportBlobs({
|
|
813
|
+
* collections: ['invoiceScans'],
|
|
814
|
+
* where: (rec) => (rec as { clientId?: string }).clientId === 'c-123',
|
|
815
|
+
* })
|
|
816
|
+
* for await (const { bytes, meta, recordRef } of handle) {
|
|
817
|
+
* await uploadToColdStorage(bytes, recordRef)
|
|
818
|
+
* }
|
|
819
|
+
* ```
|
|
820
|
+
*
|
|
821
|
+
* @see `@noy-db/hub/store/export-blobs` for the full option surface.
|
|
822
|
+
*/
|
|
823
|
+
/**
|
|
824
|
+
* Evict blob slots per the per-collection `blobFields` retention
|
|
825
|
+
* policy.
|
|
826
|
+
*
|
|
827
|
+
* Iterates every collection declared with `{ blobFields: {...} }`.
|
|
828
|
+
* For each record, checks every configured slot against its
|
|
829
|
+
* policy — `retainDays` (age-based TTL) and/or `evictWhen(record)`
|
|
830
|
+
* (predicate) — and evicts matching slots. Every eviction writes
|
|
831
|
+
* one entry to `_blob_eviction_audit` (actor + eTag + reason +
|
|
832
|
+
* timestamp, no plaintext). Consumer-scheduled; noy-db never runs
|
|
833
|
+
* this on its own.
|
|
834
|
+
*
|
|
835
|
+
* ```ts
|
|
836
|
+
* await vault.compact() // run full pass
|
|
837
|
+
* await vault.compact({ dryRun: true }) // preview counts
|
|
838
|
+
* await vault.compact({ maxEvictions: 1000 }) // cap batch
|
|
839
|
+
* ```
|
|
840
|
+
*/
|
|
841
|
+
/**
|
|
842
|
+
* Atomic, gap-free numbering. `vault.sequence('invoice-2026').next()`
|
|
843
|
+
* returns 1, 2, 3, … with no gaps or duplicates under concurrency, via
|
|
844
|
+
* an optimistic-CAS counter at `_sequences/<name>`. Each name is an
|
|
845
|
+
* independent sequence.
|
|
846
|
+
*
|
|
847
|
+
* **Online-only:** `next()` throws `SequenceOfflineError` unless the
|
|
848
|
+
* store advertises `capabilities.casAtomic` — gap-free numbering cannot
|
|
849
|
+
* be serialized by an offline / non-CAS writer.
|
|
850
|
+
*
|
|
851
|
+
* ```ts
|
|
852
|
+
* const n = await vault.sequence('invoice-2026').next() // 1, then 2, …
|
|
853
|
+
* const cur = await vault.sequence('invoice-2026').peek() // current value, no allocation
|
|
854
|
+
* ```
|
|
855
|
+
*
|
|
856
|
+
* Pass a `format` to emit a serial string instead of a bare
|
|
857
|
+
* integer — `next()` then returns `{ serial, formatted }`. Per-partition
|
|
858
|
+
* reset is inherent (a new partition tuple starts at 1):
|
|
859
|
+
*
|
|
860
|
+
* ```ts
|
|
861
|
+
* const seq = vault.sequence('fatture', { partition: [2026], format: '{partition.0}/{seq:04}' })
|
|
862
|
+
* await seq.next() // { serial: 1, formatted: '2026/0001' }
|
|
863
|
+
* ```
|
|
864
|
+
*/
|
|
865
|
+
sequence(series: string, opts: SequenceOptions & {
|
|
866
|
+
format: string;
|
|
867
|
+
}): FormattedSequenceHandle;
|
|
868
|
+
sequence(series: string, opts?: SequenceOptions): SequenceHandle;
|
|
869
|
+
/** @internal — lazily build the deferred-numbering engine with a cache-coherent stamp. */
|
|
870
|
+
private deferred;
|
|
871
|
+
/**
|
|
872
|
+
* Run a deferred-numbering pass for `series`: assign gap-free serials to all
|
|
873
|
+
* records whose store-commit-time interval has settled, in store-time order.
|
|
874
|
+
* Returns the assignments made. See {@link sequence} / `withDeferredNumbering`.
|
|
875
|
+
*/
|
|
876
|
+
runNumberingPass(series: string): Promise<Assignment[]>;
|
|
877
|
+
compact(options?: CompactRunOptions): Promise<CompactionResult>;
|
|
878
|
+
/**
|
|
879
|
+
* Sweep records eligible by their collection's `archive` policy into the
|
|
880
|
+
* cold archive store. Relocation is envelope-level (no re-encryption) and
|
|
881
|
+
* bypasses guards + materialized-view dispatch, so issued/immutable
|
|
882
|
+
* records over a sealed period can be archived without recomputing
|
|
883
|
+
* finalized aggregates. A `legalHold` predicate blocks archival.
|
|
884
|
+
* Requires `archiveStrategy: withArchive({ store })` in `createNoydb`.
|
|
885
|
+
*/
|
|
886
|
+
archive(options?: ArchiveRunOptions): Promise<ArchiveResult>;
|
|
887
|
+
/** Relocate one archived record back to the primary store. Returns false if it was not archived. */
|
|
888
|
+
restore(collection: string, id: string): Promise<boolean>;
|
|
889
|
+
/** List archived record ids for a collection (or all collections with an archive policy). */
|
|
890
|
+
listArchived(collection?: string): Promise<Array<{
|
|
891
|
+
collection: string;
|
|
892
|
+
id: string;
|
|
893
|
+
}>>;
|
|
894
|
+
private _archiveContext;
|
|
895
|
+
exportBlobs(options?: ExportBlobsOptions): ExportBlobsHandle;
|
|
896
|
+
issueAttestation(collectionName: string, id: string): Promise<{
|
|
897
|
+
docId: string;
|
|
898
|
+
qr: string;
|
|
899
|
+
keyId: string;
|
|
900
|
+
publicKeyB64: string;
|
|
901
|
+
}>;
|
|
902
|
+
getDocumentSigningPublicKey(): Promise<{
|
|
903
|
+
keyId: string;
|
|
904
|
+
publicKeyB64: string;
|
|
905
|
+
}>;
|
|
906
|
+
revokeAttestation(docId: string): Promise<void>;
|
|
907
|
+
unrevokeAttestation(docId: string): Promise<void>;
|
|
908
|
+
getRevokedDocIds(): Promise<string[]>;
|
|
909
|
+
publishRevocationList(): Promise<RevocationList>;
|
|
910
|
+
private writeExportAudit;
|
|
911
|
+
/**
|
|
912
|
+
* Read-only accessor for the invoking keyring's export capability,
|
|
913
|
+
* with role-based defaults resolved. Useful for UI affordances
|
|
914
|
+
* (grey out the export button if no capability) without throwing.
|
|
915
|
+
*/
|
|
916
|
+
canExport(tier: 'plaintext', format: ExportFormat): boolean;
|
|
917
|
+
canExport(tier: 'bundle'): boolean;
|
|
918
|
+
/**
|
|
919
|
+
* Decrypt a single envelope using the per-collection DEK, returning
|
|
920
|
+
* the parsed plaintext record. Internal helper for bundle-pipeline
|
|
921
|
+
* plaintext filters — keeps DEK access encapsulated
|
|
922
|
+
* inside Vault so callers don't reach into private state.
|
|
923
|
+
*
|
|
924
|
+
* @internal
|
|
925
|
+
*/
|
|
926
|
+
_decryptEnvelopeForBundleFilter(env: EncryptedEnvelope, collectionName: string): Promise<unknown>;
|
|
927
|
+
/**
|
|
928
|
+
* Read-only accessor for the invoking keyring's import capability
|
|
929
|
+
* (issue ). UI affordance — returns false in every default-closed
|
|
930
|
+
* case (every role with no explicit `importCapability` grant).
|
|
931
|
+
*/
|
|
932
|
+
canImport(tier: 'plaintext', format: ExportFormat): boolean;
|
|
933
|
+
canImport(tier: 'bundle'): boolean;
|
|
934
|
+
/**
|
|
935
|
+
* Enforce strict outbound refs on a `put()`. Called by Collection
|
|
936
|
+
* just before it writes to the adapter. For every strict ref
|
|
937
|
+
* declared on the collection, check that the target id exists in
|
|
938
|
+
* the target collection; throw `RefIntegrityError` if not.
|
|
939
|
+
*
|
|
940
|
+
* `warn` and `cascade` modes don't affect put semantics — they're
|
|
941
|
+
* enforced at delete time or via `checkIntegrity()`.
|
|
942
|
+
*/
|
|
943
|
+
enforceRefsOnPut(collectionName: string, record: unknown): Promise<void>;
|
|
944
|
+
/**
|
|
945
|
+
* Enforce inbound ref modes on a `delete()`. Called by Collection
|
|
946
|
+
* just before it deletes from the adapter. Walks every inbound
|
|
947
|
+
* ref that targets this (collection, id) and applies its mode
|
|
948
|
+
* (`strict` throws, `cascade` deletes referencing records, `warn`
|
|
949
|
+
* no-ops). Managed-link `onDelete` policy is applied in the same
|
|
950
|
+
* cascade guard. See `with-shape/links/vault-facade.ts`.
|
|
951
|
+
*/
|
|
952
|
+
enforceRefsOnDelete(collectionName: string, id: string): Promise<void>;
|
|
953
|
+
/**
|
|
954
|
+
* Look up the `RefDescriptor` the left collection declared for a
|
|
955
|
+
* given field name. Returns `null` when the field has no ref
|
|
956
|
+
* declaration. Implements the `joinResolver.resolveRef` half of the
|
|
957
|
+
* structural interface that `Collection.query()` consumes.
|
|
958
|
+
*/
|
|
959
|
+
resolveRef(leftCollection: string, field: string): RefDescriptor | null;
|
|
960
|
+
/**
|
|
961
|
+
* Resolve a right-side join source by target collection name.
|
|
962
|
+
* Returns `null` for unknown collections. Implements the
|
|
963
|
+
* `joinResolver.resolveSource` half of the structural interface.
|
|
964
|
+
* Only same-vault targets are resolvable — cross-vault joins are
|
|
965
|
+
* explicitly forbidden by the architecture.
|
|
966
|
+
*/
|
|
967
|
+
resolveSource(collectionName: string): JoinableSource | null;
|
|
968
|
+
/**
|
|
969
|
+
* Walk every collection that has declared refs, load its records,
|
|
970
|
+
* and report any reference whose target id is missing (modes
|
|
971
|
+
* reported alongside each violation). Returns `{ violations: [...] }`
|
|
972
|
+
* instead of throwing — the point is to surface a list for display
|
|
973
|
+
* or repair, not to fail noisily.
|
|
974
|
+
*/
|
|
975
|
+
checkIntegrity(): Promise<{
|
|
976
|
+
violations: RefViolation[];
|
|
977
|
+
}>;
|
|
978
|
+
/**
|
|
979
|
+
* Return this compartment's hash-chained audit log.
|
|
980
|
+
*
|
|
981
|
+
* The ledger is lazy-initialized on first access and cached for the
|
|
982
|
+
* lifetime of the Vault instance. Every LedgerStore instance
|
|
983
|
+
* shares the same adapter and DEK resolver, so `vault.ledger()`
|
|
984
|
+
* can be called repeatedly without performance cost.
|
|
985
|
+
*
|
|
986
|
+
* The LedgerStore itself is the public API: consumers call
|
|
987
|
+
* `.append()` (via Collection internals), `.head()`, `.verify()`,
|
|
988
|
+
* and `.entries({ from, to })`. See the LedgerStore docstring for
|
|
989
|
+
* the full surface and the concurrency caveats.
|
|
990
|
+
*/
|
|
991
|
+
ledger(): LedgerStore;
|
|
992
|
+
/**
|
|
993
|
+
* Internal accessor — returns the LedgerStore if the history
|
|
994
|
+
* strategy is opted in, or `null` otherwise. Used by dump/restore/
|
|
995
|
+
* verifyBackupIntegrity and by Collection write paths that already
|
|
996
|
+
* gate on `if (this.ledger)`. The public `ledger()` accessor above
|
|
997
|
+
* throws on null; this one stays silent so the off-path no-ops.
|
|
998
|
+
*/
|
|
999
|
+
private getLedgerOrNull;
|
|
1000
|
+
/** @internal — add a subject→record ref to the encrypted subject index. */
|
|
1001
|
+
_addSubjectRef(subjectId: string, ref: SubjectRef): Promise<void>;
|
|
1002
|
+
/** @internal — drop a subject→record ref from the encrypted subject index. */
|
|
1003
|
+
_removeSubjectRef(subjectId: string, ref: SubjectRef): Promise<void>;
|
|
1004
|
+
/**
|
|
1005
|
+
* Rebuild the encrypted subject index from canonical records. The recovery
|
|
1006
|
+
* path for the documented read-modify-write race (RISK #3). Returns the
|
|
1007
|
+
* number of distinct subjects re-indexed.
|
|
1008
|
+
*/
|
|
1009
|
+
rebuildSubjectIndex(): Promise<number>;
|
|
1010
|
+
/**
|
|
1011
|
+
* GDPR crypto-shred of a data subject. Consults the encrypted subject index and, per matching
|
|
1012
|
+
* record: rewrites the LIVE envelope to a tombstone (drops `_iv`/`_data`/`_cek`/`_det`), tombstones
|
|
1013
|
+
* every `_history` version, and fans out to derived residue via the graph (#622) — record-grain
|
|
1014
|
+
* artifacts (MV rows, derivation copies) ERASED, aggregate-grain rollups RECOMPUTED without the
|
|
1015
|
+
* forgotten contribution (skip+audit in a frozen period). The body/history become permanently
|
|
1016
|
+
* undecryptable while the collection DEK and every OTHER record stay intact. Then appends ONE
|
|
1017
|
+
* `op:'forget'` ledger entry whose `payloadHash` is `sha256Hex(subjectId)` — the chain still
|
|
1018
|
+
* `verify()`s, PROVING the subject existed and was erased without retaining any plaintext.
|
|
1019
|
+
*
|
|
1020
|
+
* Reports — but does not silently swallow — two completeness gaps: `unmigratedRecords` (a record
|
|
1021
|
+
* whose body was NOT yet migrated to a per-record CEK — still tombstoned, but pre-shred backups
|
|
1022
|
+
* stay decryptable; migrate, then re-forget) and `blobResidueCollections` (blob attachments, keyed
|
|
1023
|
+
* off a separate `_blob` DEK, out of scope here).
|
|
1024
|
+
*
|
|
1025
|
+
* @throws ForgetStrategyNotConfiguredError when no `withForgetCascade` was set.
|
|
1026
|
+
*/
|
|
1027
|
+
forget(subjectId: string): Promise<ForgetResult>;
|
|
1028
|
+
/**
|
|
1029
|
+
* Seal ONE record's content-encryption key (CEK) to an `at-*` host so that
|
|
1030
|
+
* host — and only that host — can decrypt exactly that record, with no
|
|
1031
|
+
* access to the vault DEK and no ability to read any other record.
|
|
1032
|
+
*
|
|
1033
|
+
* The grantor (this caller, who holds the collection DEK) reads the record's
|
|
1034
|
+
* live `_cek`, unwraps it under the collection DEK, exports the raw CEK
|
|
1035
|
+
* bytes, builds a {@link SealedCekBinding} `{collection, id, cek, expiresAt}`,
|
|
1036
|
+
* seals that binding for the recipient host via the host's published hint,
|
|
1037
|
+
* and persists a thin {@link SealedCekDeliveryEnvelope} at
|
|
1038
|
+
* `_sealed_cek/<collection>/<id>/<pid>`. The binding (not the delivery
|
|
1039
|
+
* envelope) is the security boundary: the host re-verifies `{collection, id}`
|
|
1040
|
+
* and `expiresAt` from inside the sealed payload.
|
|
1041
|
+
*
|
|
1042
|
+
* Only works on a `perRecordKeys` record — a legacy record has no `_cek` to
|
|
1043
|
+
* seal (its body is under the shared collection DEK, which is never exposed
|
|
1044
|
+
* by sealing) → {@link RecordCekNotFoundError}.
|
|
1045
|
+
*
|
|
1046
|
+
* @param collection Collection holding the record.
|
|
1047
|
+
* @param id Record id.
|
|
1048
|
+
* @param hostSealer The recipient host's {@link RecipientSealer}.
|
|
1049
|
+
* @param opts.expiresAt REQUIRED authoritative expiry (ISO 8601), sealed into
|
|
1050
|
+
* the binding the host verifies.
|
|
1051
|
+
* @returns `{ pid, envelopeKey }` — the host provider id and the
|
|
1052
|
+
* `<collection>/<id>/<pid>` key the delivery envelope was written under.
|
|
1053
|
+
*/
|
|
1054
|
+
sealRecordToHost(collection: string, id: string, hostSealer: RecipientSealer, opts: {
|
|
1055
|
+
expiresAt: string;
|
|
1056
|
+
}): Promise<{
|
|
1057
|
+
pid: string;
|
|
1058
|
+
envelopeKey: string;
|
|
1059
|
+
}>;
|
|
1060
|
+
/**
|
|
1061
|
+
* Revoke a sealed-CEK grant. **Default is SOFT**: deletes the `pid` delivery
|
|
1062
|
+
* envelope, but a host that already fetched it KEEPS decrypt capability (stops
|
|
1063
|
+
* new fetches, not a cryptographic cutoff). Pass **`{ hard: true }`** to rotate
|
|
1064
|
+
* the record CEK ({@link rotateRecordCek}) so any prior sealed CEK can no
|
|
1065
|
+
* longer open the record. See `revokeSealedRecord` in `record-keys/sealing.ts`.
|
|
1066
|
+
*/
|
|
1067
|
+
revokeSealedRecord(collection: string, id: string, pid: string, opts?: {
|
|
1068
|
+
hard?: boolean;
|
|
1069
|
+
}): Promise<void>;
|
|
1070
|
+
/**
|
|
1071
|
+
* HARD-rotate a record's CEK: decrypt the live body under the old CEK,
|
|
1072
|
+
* re-encrypt it under a freshly-minted CEK, write the new live envelope, evict
|
|
1073
|
+
* the in-memory caches, and delete EVERY sealed-CEK delivery envelope for the
|
|
1074
|
+
* record. After this, any host holding a previously-sealed CEK can still
|
|
1075
|
+
* decrypt PRE-rotation history versions (they keep their old `_cek`) but NOT
|
|
1076
|
+
* the rotated live record (its body is under the new CEK → the old CEK fails
|
|
1077
|
+
* the AES-GCM auth tag → `TamperedError`). That asymmetry IS the revocation:
|
|
1078
|
+
* old grants lose the live record.
|
|
1079
|
+
*
|
|
1080
|
+
* Administrative path — bypasses `Collection.put` deliberately (no guards, no
|
|
1081
|
+
* history snapshot, no materialized-view refresh): rotation is a key-rotation
|
|
1082
|
+
* operation, not a business write, and must not version-bump history (which
|
|
1083
|
+
* would re-encrypt the prior version under the NEW CEK and defeat the point).
|
|
1084
|
+
*
|
|
1085
|
+
* @throws {@link RecordCekNotFoundError} if the record is missing or has no `_cek`.
|
|
1086
|
+
*/
|
|
1087
|
+
rotateRecordCek(collection: string, id: string): Promise<void>;
|
|
1088
|
+
/**
|
|
1089
|
+
* Build the {@link SealingContext} the record-keys grantor functions need:
|
|
1090
|
+
* the vault-bound adapter, DEK resolver, actor, and the dual-cache eviction
|
|
1091
|
+
* `rotateRecordCek` performs (per-record CEK cache + decrypted-record cache).
|
|
1092
|
+
*/
|
|
1093
|
+
private _sealingContext;
|
|
1094
|
+
/**
|
|
1095
|
+
* @internal — called by `Noydb.openVault` after construction.
|
|
1096
|
+
* Dynamic-imports `GuardRegistry` + `ReadOnlyVaultFacade` and seeds
|
|
1097
|
+
* the registry with the supplied strategy handles. No-op when the
|
|
1098
|
+
* handles array is empty — keeps the guard service out of the
|
|
1099
|
+
* floor bundle for consumers that don't use guards.
|
|
1100
|
+
*
|
|
1101
|
+
* The read-only facade is eagerly instantiated here so the sync
|
|
1102
|
+
* accessor `_getReadOnlyFacade()` (called from the tx amendment
|
|
1103
|
+
* runner) stays synchronous.
|
|
1104
|
+
*/
|
|
1105
|
+
_initGuards(handles: ReadonlyArray<GuardStrategyHandleAny>): Promise<void>;
|
|
1106
|
+
/**
|
|
1107
|
+
* @internal — The gate handler in Noydb.#registerGuardGate calls into
|
|
1108
|
+
* this. Returns `null` for vaults that never registered any guard
|
|
1109
|
+
* strategy. Callers MUST gate on null.
|
|
1110
|
+
*/
|
|
1111
|
+
_getGuardRegistry(): GuardRegistry | null;
|
|
1112
|
+
/**
|
|
1113
|
+
* @internal — called by `Noydb.openVault` after construction.
|
|
1114
|
+
* Dynamic-imports `DerivationRegistry` and registers the supplied
|
|
1115
|
+
* derivation strategies (async because `strategyHash` computation
|
|
1116
|
+
* goes through `crypto.subtle.digest`). No-op when the handles
|
|
1117
|
+
* array is empty — keeps the derivation service out of the floor
|
|
1118
|
+
* bundle for consumers that don't use derivations. Throws
|
|
1119
|
+
* `DerivationCycleError` if a cycle is detected after registration.
|
|
1120
|
+
*/
|
|
1121
|
+
_initDerivations(handles: ReadonlyArray<DerivationStrategyHandle>): Promise<void>;
|
|
1122
|
+
/**
|
|
1123
|
+
* @internal — consumed by `Collection.put` at write-time. Returns
|
|
1124
|
+
* `null` for vaults that never registered any derivation strategy.
|
|
1125
|
+
*/
|
|
1126
|
+
_getDerivationRegistry(): DerivationRegistry | null;
|
|
1127
|
+
/**
|
|
1128
|
+
* @internal — called by `Noydb.openVault` after collections are
|
|
1129
|
+
* wired. Dynamic-imports `MaterializedViewRegistry`, registers each
|
|
1130
|
+
* MV spec (which invokes its `query()` once for dependency
|
|
1131
|
+
* analysis), then runs the unified cycle detection across the MV +
|
|
1132
|
+
* derivation graphs. No-op when the handles array is empty — keeps
|
|
1133
|
+
* the MV service out of the floor bundle (mirrors the derivation lazy-import pattern).
|
|
1134
|
+
* Throws `MaterializedViewCycleError` if a cycle is detected.
|
|
1135
|
+
*/
|
|
1136
|
+
_initMaterializedViews(handles: ReadonlyArray<MaterializedViewStrategyHandle>): Promise<void>;
|
|
1137
|
+
/**
|
|
1138
|
+
* @internal — consumed by `Collection.put` at write-time. Returns
|
|
1139
|
+
* `null` for vaults that never registered any MV strategy.
|
|
1140
|
+
*/
|
|
1141
|
+
_getMaterializedViewRegistry(): MaterializedViewRegistry | null;
|
|
1142
|
+
/**
|
|
1143
|
+
* @internal — called by `Noydb.openVault` after MVs are wired.
|
|
1144
|
+
* Dynamic-imports `OverlayedViewRegistry`, registers each spec,
|
|
1145
|
+
* validates against the MV registry for name/base/overlay collisions.
|
|
1146
|
+
* Throws on validation failure.
|
|
1147
|
+
*/
|
|
1148
|
+
_initOverlayedViews(handles: ReadonlyArray<OverlayedViewStrategyHandle>): Promise<void>;
|
|
1149
|
+
/**
|
|
1150
|
+
* @internal — consumed by `Vault.collection()`. Returns `null` for
|
|
1151
|
+
* vaults with no overlays registered.
|
|
1152
|
+
*/
|
|
1153
|
+
_getOverlayedViewRegistry(): OverlayedViewRegistry | null;
|
|
1154
|
+
/** @internal — ctx for `putDerivedOutput`'s frozen-period skip+audit (#638 Task 5). */
|
|
1155
|
+
private _dispatchCtx;
|
|
1156
|
+
/**
|
|
1157
|
+
* Manual re-materialize for a single registered MV (`refresh: 'manual'` consumers,
|
|
1158
|
+
* stale-bit recovery on vault reopen, bulk-recompute escape hatch after a strategy
|
|
1159
|
+
* change). Returns `{ written, deleted, failed, residueUndecodable, residueDeclined }` (`deleted`
|
|
1160
|
+
* always 0 without tombstoning; #785 splits the #782 leftovers — undecodable vs #718-declined). Throws if not registered.
|
|
1161
|
+
*/
|
|
1162
|
+
refreshView(name: string): Promise<{
|
|
1163
|
+
written: number;
|
|
1164
|
+
deleted: number;
|
|
1165
|
+
failed: number;
|
|
1166
|
+
residueUndecodable: string[];
|
|
1167
|
+
residueDeclined: string[];
|
|
1168
|
+
}>;
|
|
1169
|
+
/**
|
|
1170
|
+
* Re-derive every record in the named source collection (useful after a strategy
|
|
1171
|
+
* change to bring previously-derived records up-to-date). Sequential in v1.
|
|
1172
|
+
*/
|
|
1173
|
+
deriveAll(sourceCollection: string): Promise<{
|
|
1174
|
+
derived: number;
|
|
1175
|
+
failed: number;
|
|
1176
|
+
skippedFrozen: number;
|
|
1177
|
+
}>;
|
|
1178
|
+
/**
|
|
1179
|
+
* @internal — exposed for `runTransaction({ amendment: true })` so
|
|
1180
|
+
* the amendment invariant runner can pass the SAME read-only vault
|
|
1181
|
+
* facade that the gate handler in Noydb.#registerGuardGate uses.
|
|
1182
|
+
* Eagerly instantiated by `_initGuards()` so this accessor stays
|
|
1183
|
+
* synchronous; returns `null` for vaults that never registered any
|
|
1184
|
+
* guard (amendments require at least one guard, so the caller should
|
|
1185
|
+
* never see null).
|
|
1186
|
+
*/
|
|
1187
|
+
_getReadOnlyFacade(): ReadOnlyVaultFacade | null;
|
|
1188
|
+
/**
|
|
1189
|
+
* Internal lazy-allocator for the derivation read-only facade
|
|
1190
|
+
* (`layer:'derivation'`). Used as a defensive fallback; in practice
|
|
1191
|
+
* `_initDerivations()` eagerly instantiates this, so the lazy path is
|
|
1192
|
+
* a no-op.
|
|
1193
|
+
*/
|
|
1194
|
+
private _ensureReadOnlyFacade;
|
|
1195
|
+
/**
|
|
1196
|
+
* @internal — exposed for `runTransaction({ amendment: true })`
|
|
1197
|
+
* to append the structured `op: 'amendment'` audit entry without
|
|
1198
|
+
* dragging this private accessor onto the public surface or
|
|
1199
|
+
* forcing the tx executor to depend on the history-strategy
|
|
1200
|
+
* shape directly. Returns `null` when no history strategy is
|
|
1201
|
+
* configured, in which case the amendment commits silently
|
|
1202
|
+
* (the records still write through; only the multi-record
|
|
1203
|
+
* audit summary is skipped).
|
|
1204
|
+
*/
|
|
1205
|
+
_getLedgerOrNull(): LedgerStore | null;
|
|
1206
|
+
/**
|
|
1207
|
+
* Return a read-only view of this vault as it existed at
|
|
1208
|
+
* `timestamp`. Time-machine queries are reconstructed from the
|
|
1209
|
+
* per-version history snapshots persisted by every `put()`, then
|
|
1210
|
+
* cross-checked against the ledger for deletes that happened
|
|
1211
|
+
* between the snapshot and the target timestamp.
|
|
1212
|
+
*
|
|
1213
|
+
* ```ts
|
|
1214
|
+
* const q1End = vault.at('2026-03-31T23:59:59Z')
|
|
1215
|
+
* const invoice = await q1End.collection<Invoice>('invoices').get('inv-001')
|
|
1216
|
+
* // → the record as it stood at the close of Q1 2026
|
|
1217
|
+
* ```
|
|
1218
|
+
*
|
|
1219
|
+
* `timestamp` accepts an ISO-8601 string or a `Date`. Time-machine
|
|
1220
|
+
* views are read-only — writes throw {@link ReadOnlyAtInstantError}.
|
|
1221
|
+
* Accuracy bounded by history retention: if `historyConfig.maxVersions`
|
|
1222
|
+
* pruned earlier versions, queries before the oldest retained
|
|
1223
|
+
* snapshot return null even for records that existed.
|
|
1224
|
+
*
|
|
1225
|
+
*.
|
|
1226
|
+
*/
|
|
1227
|
+
at(timestamp: string | Date): VaultInstant;
|
|
1228
|
+
/**
|
|
1229
|
+
* Return a read-only "shadow" view of this vault. Every read method
|
|
1230
|
+
* on the returned {@link VaultFrame} delegates to the underlying
|
|
1231
|
+
* live collection; every write method throws
|
|
1232
|
+
* {@link ReadOnlyFrameError}.
|
|
1233
|
+
*
|
|
1234
|
+
* ```ts
|
|
1235
|
+
* const presentation = vault.frame()
|
|
1236
|
+
* const invoices = await presentation.collection<Invoice>('invoices').list()
|
|
1237
|
+
* ```
|
|
1238
|
+
*
|
|
1239
|
+
* Use for screen-sharing a live vault, demo mode, or compliance
|
|
1240
|
+
* review where the reviewer should not be able to edit. Writes are
|
|
1241
|
+
* blocked at the JavaScript layer — the keyring DEKs are unchanged,
|
|
1242
|
+
* so this is **not** a cryptographic security boundary against a
|
|
1243
|
+
* hostile caller in the same process. See {@link VaultFrame} for
|
|
1244
|
+
* the full caveat.
|
|
1245
|
+
*
|
|
1246
|
+
*.
|
|
1247
|
+
*/
|
|
1248
|
+
frame(): VaultFrame;
|
|
1249
|
+
/** Credential-broker handle (#479); `NO_BROKER` throws unless `brokerStrategy: withBroker(config)` was passed to createNoydb(). */
|
|
1250
|
+
broker(): CredentialBrokerHandle;
|
|
1251
|
+
/**
|
|
1252
|
+
* Run `fn` under a consent scope. Every `get` / `put` / `delete`
|
|
1253
|
+
* that happens inside `fn` writes one entry to `_consent_audit`
|
|
1254
|
+
* with the supplied `purpose` and `consentHash`. Outside a scope,
|
|
1255
|
+
* no entries are written — consent logging is opt-in by design.
|
|
1256
|
+
*
|
|
1257
|
+
* ```ts
|
|
1258
|
+
* await vault.withConsent(
|
|
1259
|
+
* { purpose: 'quarterly-review', consentHash: '7f3a...' },
|
|
1260
|
+
* async () => {
|
|
1261
|
+
* const invoices = await vault.collection<Invoice>('invoices').list()
|
|
1262
|
+
* return invoices
|
|
1263
|
+
* },
|
|
1264
|
+
* )
|
|
1265
|
+
* ```
|
|
1266
|
+
*
|
|
1267
|
+
* The scope is a single slot on this Vault instance — two
|
|
1268
|
+
* concurrent `withConsent` calls stomp each other. Use separate
|
|
1269
|
+
* Vault instances (or an external `AsyncLocalStorage` shim) for
|
|
1270
|
+
* per-flight scoping.
|
|
1271
|
+
*
|
|
1272
|
+
*.
|
|
1273
|
+
*/
|
|
1274
|
+
withConsent<T>(ctx: ConsentContext, fn: () => Promise<T>): Promise<T>;
|
|
1275
|
+
/**
|
|
1276
|
+
* Query the consent-audit log. Returns every entry matching the
|
|
1277
|
+
* filter, newest-first isn't enforced — entries carry ULID ids so
|
|
1278
|
+
* sorting by id is insertion-order stable. Caller may sort further.
|
|
1279
|
+
*
|
|
1280
|
+
*.
|
|
1281
|
+
*/
|
|
1282
|
+
consentAudit(filter?: ConsentAuditFilter): Promise<ConsentAuditEntry[]>;
|
|
1283
|
+
/**
|
|
1284
|
+
* Called by Collection after every access when a consent scope is
|
|
1285
|
+
* active. Internal — not part of the public API.
|
|
1286
|
+
*
|
|
1287
|
+
* @internal
|
|
1288
|
+
*/
|
|
1289
|
+
_logConsent(op: ConsentOp, collection: string, recordId: string): Promise<void>;
|
|
1290
|
+
/**
|
|
1291
|
+
* Subscribe to cross-tier access events. The callback fires every
|
|
1292
|
+
* time a record at a tier above the caller's inherent clearance is
|
|
1293
|
+
* read, written, elevated, or demoted successfully via this vault.
|
|
1294
|
+
* Returns an unsubscribe function.
|
|
1295
|
+
*/
|
|
1296
|
+
onCrossTierAccess(listener: (event: CrossTierAccessEvent) => void): () => void;
|
|
1297
|
+
private emitCrossTier;
|
|
1298
|
+
/**
|
|
1299
|
+
* issue a time-boxed cross-tier delegation. Writes an
|
|
1300
|
+
* encrypted envelope to the reserved `_delegations` collection that
|
|
1301
|
+
* the target user's runtime will pick up next time they open the
|
|
1302
|
+
* vault.
|
|
1303
|
+
*
|
|
1304
|
+
* Caller must hold the tier DEK for the requested tier and
|
|
1305
|
+
* collection.
|
|
1306
|
+
*/
|
|
1307
|
+
delegate(opts: IssueDelegationOptions): Promise<DelegationToken>;
|
|
1308
|
+
/**
|
|
1309
|
+
* revoke an issued delegation by id. Safe to call even
|
|
1310
|
+
* if the id does not exist.
|
|
1311
|
+
*/
|
|
1312
|
+
revokeDelegation(id: string): Promise<void>;
|
|
1313
|
+
/**
|
|
1314
|
+
* Briefly elevate this vault to a higher tier and return a scoped
|
|
1315
|
+
* handle whose writes land at that tier. Reads on the original
|
|
1316
|
+
* vault continue at the caller's inherent tier; only the returned
|
|
1317
|
+
* handle is privileged. Auto-reverts when `release()` is called or
|
|
1318
|
+
* `ttlMs` elapses, whichever comes first.
|
|
1319
|
+
*
|
|
1320
|
+
* Capability semantics:
|
|
1321
|
+
* - The keyring must already carry a wrap for the target tier on
|
|
1322
|
+
* at least one collection (or be `owner` / `admin`, who can
|
|
1323
|
+
* auto-mint). Otherwise throws {@link TierNotGrantedError}.
|
|
1324
|
+
* - Per-collection capability gates (`canExportPlaintext`,
|
|
1325
|
+
* `canExportBundle`) are NOT bypassed — elevation is a tier
|
|
1326
|
+
* projection, not a privilege escalation path.
|
|
1327
|
+
* - Only one elevation can be active per vault at a time.
|
|
1328
|
+
* Calling `elevate(...)` while another is live throws
|
|
1329
|
+
* {@link AlreadyElevatedError}.
|
|
1330
|
+
*
|
|
1331
|
+
* Audit:
|
|
1332
|
+
* - One `_elevation_audit` envelope is written at start with
|
|
1333
|
+
* `{ id, actor, tier, reason, ttlMs, startedAt, expiresAt }`.
|
|
1334
|
+
* - Each write through the elevated handle additionally fires a
|
|
1335
|
+
* {@link CrossTierAccessEvent} with `authorization: 'elevation'`,
|
|
1336
|
+
* stamped with `reason` and `elevatedFrom`.
|
|
1337
|
+
*/
|
|
1338
|
+
elevate(tier: number, options: {
|
|
1339
|
+
ttlMs: number;
|
|
1340
|
+
reason: string;
|
|
1341
|
+
}): Promise<ElevatedHandle>;
|
|
1342
|
+
/**
|
|
1343
|
+
* Internal — invoked by an `ElevatedHandle.collection().put()` call.
|
|
1344
|
+
* Routes through the existing `Collection.putAtTier` code path with
|
|
1345
|
+
* the elevation context attached so the cross-tier event reflects
|
|
1346
|
+
* the right authorization class. Returns `putAtTier`'s `TierMoveResult` (#779).
|
|
1347
|
+
*/
|
|
1348
|
+
_elevatedPut<T>(collectionName: string, id: string, record: T, tier: number, reason: string): Promise<TierMoveResult>;
|
|
1349
|
+
private writeElevationAudit;
|
|
1350
|
+
/**
|
|
1351
|
+
* low-level escape hatch used by `@noy-db/on-magic-link`
|
|
1352
|
+
* to persist a magic-link-bound grant after the auth package has
|
|
1353
|
+
* derived the content key + KEK from `(serverSecret, token, vault)`.
|
|
1354
|
+
*
|
|
1355
|
+
* Callers outside of `@noy-db/on-magic-link` should use
|
|
1356
|
+
* `issueMagicLinkDelegation()` from that package instead — it handles
|
|
1357
|
+
* the HKDF derivation, record-id composition, and batch logic so the
|
|
1358
|
+
* grantor doesn't touch this method directly.
|
|
1359
|
+
*/
|
|
1360
|
+
writeMagicLinkGrant(contentKey: EnclaveKey, grantKek: EnclaveKey, recordId: string, opts: IssueMagicLinkGrantOptions): Promise<MagicLinkGrantRecord>;
|
|
1361
|
+
/**
|
|
1362
|
+
* Close an accounting period. After this call every record whose
|
|
1363
|
+
* envelope `_ts` is at or before `endDate` is write-locked: further
|
|
1364
|
+
* `put` or `delete` calls against such records throw
|
|
1365
|
+
* {@link PeriodClosedError}. New records (with fresh timestamps)
|
|
1366
|
+
* remain freely writable, and records last written AFTER `endDate`
|
|
1367
|
+
* are unaffected.
|
|
1368
|
+
*
|
|
1369
|
+
* Each closure writes a `PeriodRecord` to the reserved `_periods`
|
|
1370
|
+
* collection. The record carries the hash of the prior period's
|
|
1371
|
+
* record, so a tamper with any closure breaks the chain visible to
|
|
1372
|
+
* {@link listPeriods} + `vault.ledger().verify()`.
|
|
1373
|
+
*
|
|
1374
|
+
* Correctness is tied to the `_ts` field the hub assigns on every
|
|
1375
|
+
* write. Backdating records by editing the envelope directly is
|
|
1376
|
+
* outside the threat model — see SPEC § zero-knowledge envelopes.
|
|
1377
|
+
*
|
|
1378
|
+
*.
|
|
1379
|
+
*/
|
|
1380
|
+
closePeriod(options: ClosePeriodOptions): Promise<PeriodRecord>;
|
|
1381
|
+
/**
|
|
1382
|
+
* Open a new period that carries forward from a prior closed one
|
|
1383
|
+
*. The `carryForward` callback receives a read-only
|
|
1384
|
+
* {@link VaultInstant} view anchored at the prior period's
|
|
1385
|
+
* `endDate` — use it to compute opening balances, closing-trial
|
|
1386
|
+
* snapshots, or any aggregate the new period should inherit. The
|
|
1387
|
+
* returned `{ [collection]: { [id]: record } }` map is written
|
|
1388
|
+
* before the new `PeriodRecord` lands, so the opening entries
|
|
1389
|
+
* materialise with fresh `_ts` values that fall outside every
|
|
1390
|
+
* closed period (the guard lets them through).
|
|
1391
|
+
*
|
|
1392
|
+
* The new period is stored with `kind: 'opened'` and hash-chained
|
|
1393
|
+
* to the same chain the close calls build — `listPeriods()` sees
|
|
1394
|
+
* both closed and opened entries in `closedAt` order.
|
|
1395
|
+
*/
|
|
1396
|
+
openPeriod<TCollections extends Record<string, Record<string, unknown>>>(options: OpenPeriodOptions<TCollections>): Promise<PeriodRecord>;
|
|
1397
|
+
/** Return every closed / opened period in `closedAt` order. */
|
|
1398
|
+
listPeriods(): Promise<readonly PeriodRecord[]>;
|
|
1399
|
+
/** Look up a single period by name. Returns `null` if not found. */
|
|
1400
|
+
getPeriod(name: string): Promise<PeriodRecord | null>;
|
|
1401
|
+
/**
|
|
1402
|
+
* Freeze a closed period (#604): purges in-window delete markers and
|
|
1403
|
+
* records a `_period_freezes` companion, never mutating the chained
|
|
1404
|
+
* `_periods` record. Idempotent. Purges the LOCAL adapter only — a
|
|
1405
|
+
* synced target's markers survive there and re-import on pull (benign),
|
|
1406
|
+
* and purging re-opens the #589 resurrection window for a peer offline
|
|
1407
|
+
* since before the cutoff (see periods.ts's "Freeze" section).
|
|
1408
|
+
*/
|
|
1409
|
+
freezePeriod(name: string): Promise<PeriodRecord>;
|
|
1410
|
+
/**
|
|
1411
|
+
* Archive a closed period (#613): relocates its in-window records from the
|
|
1412
|
+
* hot store to the configured cold tier (via the routeStore's cold route),
|
|
1413
|
+
* recording a `_period_archives` companion + ledger entry, never mutating
|
|
1414
|
+
* the chained `_periods` record. Non-destructive (reads fall through to
|
|
1415
|
+
* cold) and idempotent. Requires a routeStore with a cold route.
|
|
1416
|
+
*/
|
|
1417
|
+
archivePeriod(name: string): Promise<PeriodRecord>;
|
|
1418
|
+
/**
|
|
1419
|
+
* Target-purge a closed+frozen period (#615): sweeps delete markers off the
|
|
1420
|
+
* vault's push-only sync targets (`backup`/`archive`), recording a
|
|
1421
|
+
* `_period_target_purges` companion + ledger entry, never mutating the chained
|
|
1422
|
+
* `_periods` record. `sync-peer` targets are skipped. Requires the period be
|
|
1423
|
+
* frozen first. Idempotent; a vault with no push-only targets writes no
|
|
1424
|
+
* companion and is re-runnable.
|
|
1425
|
+
*/
|
|
1426
|
+
purgePeriodTargets(name: string): Promise<PeriodRecord>;
|
|
1427
|
+
/** @internal — called by the gate bus before put/delete. */
|
|
1428
|
+
_assertTsWritable(existing: {
|
|
1429
|
+
ts: string | null;
|
|
1430
|
+
record: Record<string, unknown> | null;
|
|
1431
|
+
} | null, incoming: Record<string, unknown> | null): Promise<void>;
|
|
1432
|
+
/** List all collection names in this vault. */
|
|
1433
|
+
collections(): Promise<string[]>;
|
|
1434
|
+
/**
|
|
1435
|
+
* Emit a structured introspection snapshot of this vault — vault name,
|
|
1436
|
+
* service opt-in matrix, collections + their fields, materialized
|
|
1437
|
+
* views, overlay views, derivations. With `withStats: true`, walks
|
|
1438
|
+
* every collection's envelopes to compute record counts, byte totals,
|
|
1439
|
+
* and oldest/newest timestamps.
|
|
1440
|
+
*
|
|
1441
|
+
* Consumed by the `noydb describe` CLI to produce human-readable
|
|
1442
|
+
* audit YAML/JSON from a `.noydb` bundle.
|
|
1443
|
+
*
|
|
1444
|
+
* Field provenance:
|
|
1445
|
+
* - `persisted`: read from `_schemas/<col>` envelope (Route B opt-in)
|
|
1446
|
+
* - `live-validator`: derived in-process from a Zod schema attached
|
|
1447
|
+
* to the live `Collection`
|
|
1448
|
+
* - `sampled`: inferred from decrypted records (deferred to a follow-up)
|
|
1449
|
+
* - `unknown`: no schema info available
|
|
1450
|
+
*
|
|
1451
|
+
* @see docs/superpowers/specs/2026-05-22-schema-dump-design.md
|
|
1452
|
+
*/
|
|
1453
|
+
dumpSchema(opts?: DumpSchemaOptions): Promise<VaultSchemaSnapshot>;
|
|
1454
|
+
/**
|
|
1455
|
+
* Lightweight read of the vault's registered schema: collections
|
|
1456
|
+
* (+ doc counts), guards, materialized views, schema-update strategies,
|
|
1457
|
+
* and the unlocked user's grants. Cheap — one `adapter.list` per
|
|
1458
|
+
* collection, no decryption. For a full snapshot + stats use dumpSchema().
|
|
1459
|
+
* Post-unlock by construction (a Vault only exists with an unlocked keyring).
|
|
1460
|
+
*/
|
|
1461
|
+
introspect(): Promise<SchemaIntrospection>;
|
|
1462
|
+
/**
|
|
1463
|
+
* Internal accessor for {@link dumpVaultSchema}. Exposes the structural
|
|
1464
|
+
* state the walker needs (collection cache, registries, ref registry,
|
|
1465
|
+
* adapter) without widening the public Vault surface.
|
|
1466
|
+
*
|
|
1467
|
+
* @internal
|
|
1468
|
+
*/
|
|
1469
|
+
_introspectState(): VaultIntrospectState;
|
|
1470
|
+
/**
|
|
1471
|
+
* Return the stable opaque bundle handle for this vault,
|
|
1472
|
+
* generating and persisting a fresh ULID on first call.
|
|
1473
|
+
*
|
|
1474
|
+
* used by `writePod()` to identify the
|
|
1475
|
+
* vault in the unencrypted bundle header without
|
|
1476
|
+
* exposing the vault name. The handle is persisted in
|
|
1477
|
+
* the reserved `_meta` internal collection so subsequent
|
|
1478
|
+
* exports of the same vault produce the same handle —
|
|
1479
|
+
* bundle adapters (Drive, Dropbox, iCloud) will use it
|
|
1480
|
+
* as their primary key.
|
|
1481
|
+
*
|
|
1482
|
+
* **Storage path:** the handle is written via the adapter
|
|
1483
|
+
* directly with collection name `_meta` and id `handle`. The
|
|
1484
|
+
* envelope's `_data` field contains a plain JSON
|
|
1485
|
+
* `{ handle: '...' }` payload — the handle is opaque, doesn't
|
|
1486
|
+
* need encryption, and the bundle header exposes the same
|
|
1487
|
+
* value anyway. This mirrors the storage approach `_keyring`
|
|
1488
|
+
* uses for its plain-JSON wrapped-DEK envelopes (also bypasses
|
|
1489
|
+
* the AES-GCM layer; the `_iv` field is left empty).
|
|
1490
|
+
*
|
|
1491
|
+
* **Cross-process stability:** the handle survives process
|
|
1492
|
+
* restarts because it's persisted on the adapter, not just
|
|
1493
|
+
* cached in memory. A new Vault instance opened on the
|
|
1494
|
+
* same adapter sees the same `_meta/handle` envelope and
|
|
1495
|
+
* returns the same ULID.
|
|
1496
|
+
*
|
|
1497
|
+
* **Round-trip after restore:** the receiving vault of a
|
|
1498
|
+
* `load()` call generates its OWN handle on first export. The
|
|
1499
|
+
* dump body does not include `_meta`, because handle stability
|
|
1500
|
+
* is per-vault-instance, not per-vault-content. Two
|
|
1501
|
+
* separate restorations of the same backup produce two
|
|
1502
|
+
* distinct handles, which is the right behavior — they're
|
|
1503
|
+
* separate vault instances now.
|
|
1504
|
+
*/
|
|
1505
|
+
getBundleHandle(): Promise<string>;
|
|
1506
|
+
/**
|
|
1507
|
+
* Read the owner-curated public envelope for this vault (or
|
|
1508
|
+
* `undefined` if none is persisted). The envelope lives in
|
|
1509
|
+
* `_meta/public-envelope` as plaintext — readable without any KEK
|
|
1510
|
+
* — so `getBundleHandle`-style callers can label a vault before
|
|
1511
|
+
* unlock.
|
|
1512
|
+
*
|
|
1513
|
+
* Mirrors `Noydb.getPublicEnvelope(vault, opts)` but scoped to a
|
|
1514
|
+
* single, already-opened `Vault` instance so the
|
|
1515
|
+
* bundle writer can snapshot it without holding a `Noydb` reference.
|
|
1516
|
+
*
|
|
1517
|
+
* @see https://github.com/vLannaAi/noy-db-docs/blob/main/content/docs/services/public-envelope.md
|
|
1518
|
+
*/
|
|
1519
|
+
getPublicEnvelope(opts?: {
|
|
1520
|
+
readonly locale?: string;
|
|
1521
|
+
}): Promise<PublicEnvelope | undefined>;
|
|
1522
|
+
/**
|
|
1523
|
+
* Dump vault as a verifiable encrypted JSON backup string.
|
|
1524
|
+
*
|
|
1525
|
+
* backups embed the current ledger head and the full
|
|
1526
|
+
* `_ledger` + `_ledger_deltas` internal collections so the
|
|
1527
|
+
* receiver can run `verifyBackupIntegrity()` after `load()` and
|
|
1528
|
+
* detect any tampering between dump and restore. Backups produced
|
|
1529
|
+
* without a ledger (older formats or hub instances built without
|
|
1530
|
+
* the history strategy) skip the integrity check with a warning —
|
|
1531
|
+
* both modes round-trip cleanly.
|
|
1532
|
+
*/
|
|
1533
|
+
dump(): Promise<string>;
|
|
1534
|
+
/**
|
|
1535
|
+
* Build the `BackupContext` the extracted backup module (`with-pod/backup.ts`)
|
|
1536
|
+
* binds to: the read paths + the post-load mutation seams (`reloadKeyring`,
|
|
1537
|
+
* collection-cache clear, ledger-store reset) that `load()` performs on this
|
|
1538
|
+
* Vault's private state.
|
|
1539
|
+
*/
|
|
1540
|
+
private backupContext;
|
|
1541
|
+
/**
|
|
1542
|
+
* Restore a vault from a verifiable backup.
|
|
1543
|
+
*
|
|
1544
|
+
* After loading, runs `verifyBackupIntegrity()` to confirm:
|
|
1545
|
+
* 1. The hash chain is intact (no `prevHash` mismatches)
|
|
1546
|
+
* 2. The chain head matches the embedded `ledgerHead.hash`
|
|
1547
|
+
* from the backup
|
|
1548
|
+
* 3. Every data envelope's `payloadHash` matches the
|
|
1549
|
+
* corresponding ledger entry — i.e. nobody swapped
|
|
1550
|
+
* ciphertext between dump and restore
|
|
1551
|
+
*
|
|
1552
|
+
* On any failure, throws `BackupLedgerError` (chain or head
|
|
1553
|
+
* mismatch) or `BackupCorruptedError` (data envelope mismatch).
|
|
1554
|
+
* The vault state on the adapter has already been written
|
|
1555
|
+
* by the time we throw, so the caller is responsible for either
|
|
1556
|
+
* accepting the suspect state or wiping it and trying a different
|
|
1557
|
+
* backup.
|
|
1558
|
+
*
|
|
1559
|
+
* Legacy backups (no `ledgerHead` field, no `_internal`) load
|
|
1560
|
+
* with a console warning and skip the integrity check entirely
|
|
1561
|
+
* — there's no chain to verify against.
|
|
1562
|
+
*/
|
|
1563
|
+
load(backupJson: string): Promise<void>;
|
|
1564
|
+
/**
|
|
1565
|
+
* End-to-end backup integrity check. Runs both:
|
|
1566
|
+
*
|
|
1567
|
+
* 1. `ledger.verify()` — walks the hash chain and confirms
|
|
1568
|
+
* every `prevHash` matches the recomputed hash of its
|
|
1569
|
+
* predecessor.
|
|
1570
|
+
*
|
|
1571
|
+
* 2. **Data envelope cross-check** — for every (collection, id)
|
|
1572
|
+
* that has a current value, find the most recent ledger
|
|
1573
|
+
* entry recording a `put` for that pair, recompute the
|
|
1574
|
+
* sha256 of the stored envelope's `_data`, and compare to
|
|
1575
|
+
* the entry's `payloadHash`. Any mismatch means an
|
|
1576
|
+
* out-of-band write modified the data without updating the
|
|
1577
|
+
* ledger.
|
|
1578
|
+
*
|
|
1579
|
+
* Returns a discriminated union so callers can handle the two
|
|
1580
|
+
* failure modes differently:
|
|
1581
|
+
* - `{ ok: true, head, length }` — chain verified and all
|
|
1582
|
+
* data matches; safe to use.
|
|
1583
|
+
* - `{ ok: false, kind: 'chain', divergedAt, message }` — the
|
|
1584
|
+
* chain itself is broken at the given index.
|
|
1585
|
+
* - `{ ok: false, kind: 'data', collection, id, message }` —
|
|
1586
|
+
* a specific data envelope doesn't match its ledger entry.
|
|
1587
|
+
*
|
|
1588
|
+
* This method is exposed so users can call it any time, not just
|
|
1589
|
+
* during `load()`. A scheduled background check is the simplest
|
|
1590
|
+
* way to detect tampering of an in-place vault.
|
|
1591
|
+
*/
|
|
1592
|
+
verifyBackupIntegrity(): Promise<import("../with-pod/backup.js").VerifyBackupResult>;
|
|
1593
|
+
/**
|
|
1594
|
+
* Stream every collection in this vault as decrypted, ACL-scoped
|
|
1595
|
+
* chunks.
|
|
1596
|
+
*
|
|
1597
|
+
* ⚠ **This method decrypts your records.** noy-db's threat model assumes
|
|
1598
|
+
* that records on disk are encrypted; the values yielded here are
|
|
1599
|
+
* plaintext. The consumer is responsible for ensuring the yielded data
|
|
1600
|
+
* is handled in a way that matches the data's sensitivity. If your goal
|
|
1601
|
+
* is encrypted backup or transport between noy-db instances, use
|
|
1602
|
+
* `dump()` instead — it produces a tamper-evident encrypted envelope and
|
|
1603
|
+
* never exposes plaintext.
|
|
1604
|
+
*
|
|
1605
|
+
* ## Behavior
|
|
1606
|
+
*
|
|
1607
|
+
* - **ACL-scoped.** Collections the calling principal cannot read are
|
|
1608
|
+
* silently skipped (same rule as `Collection.list()`). An operator
|
|
1609
|
+
* with `{ invoices: 'rw', clients: 'ro' }` permissions on a
|
|
1610
|
+
* five-collection vault exports only `invoices` and `clients`,
|
|
1611
|
+
* with no error on the others.
|
|
1612
|
+
* - **Streaming.** Returns an `AsyncIterableIterator` so consumers can
|
|
1613
|
+
* process chunks as they arrive without holding the full export in
|
|
1614
|
+
* memory. Note: the underlying adapter call (`loadAll`) is still a
|
|
1615
|
+
* single bulk read — the streaming benefit is on the *output* side.
|
|
1616
|
+
* True per-record adapter streaming arrives with the query DSL.
|
|
1617
|
+
* - **Schema + refs surfaced** as metadata on every chunk so downstream
|
|
1618
|
+
* serializers (`@noy-db/as-csv`, `@noy-db/as-xlsx`, custom
|
|
1619
|
+
* exporters) can produce schema-aware output without reaching into
|
|
1620
|
+
* collection internals.
|
|
1621
|
+
* - **Internal collections filtered.** `_ledger`, `_keyring`, etc. are
|
|
1622
|
+
* never yielded — they're noy-db's own bookkeeping and have no value
|
|
1623
|
+
* in a plaintext export. Use `dump()` for full backup including
|
|
1624
|
+
* internal collections.
|
|
1625
|
+
*
|
|
1626
|
+
* ## Composition
|
|
1627
|
+
*
|
|
1628
|
+
* Once cross-vault queries land, fanning this out across
|
|
1629
|
+
* every vault the caller can unlock is `queryAcross(ids, c =>
|
|
1630
|
+
* c.exportStream())` — no new primitive needed. That's part of why this
|
|
1631
|
+
* method belongs in core: it's the single decrypt+ACL+metadata path
|
|
1632
|
+
* that every export-format package will build on, and pushing it into
|
|
1633
|
+
* a `@noy-db/as-*` package would force every format to re-solve
|
|
1634
|
+
* the same problems independently.
|
|
1635
|
+
*
|
|
1636
|
+
* @example
|
|
1637
|
+
* ```ts
|
|
1638
|
+
* for await (const chunk of company.exportStream()) {
|
|
1639
|
+
* // chunk.collection: 'invoices'
|
|
1640
|
+
* // chunk.schema: ZodObject | null
|
|
1641
|
+
* // chunk.refs: { clientId: { target: 'clients', mode: 'strict' } }
|
|
1642
|
+
* // chunk.records: Invoice[]
|
|
1643
|
+
* }
|
|
1644
|
+
* ```
|
|
1645
|
+
*
|
|
1646
|
+
* @example
|
|
1647
|
+
* ```ts
|
|
1648
|
+
* // Per-record streaming for arbitrarily large collections.
|
|
1649
|
+
* for await (const chunk of company.exportStream({ granularity: 'record' })) {
|
|
1650
|
+
* // chunk.records is always length 1
|
|
1651
|
+
* await writer.write(serialize(chunk.records[0]))
|
|
1652
|
+
* }
|
|
1653
|
+
* ```
|
|
1654
|
+
*/
|
|
1655
|
+
exportStream(opts?: ExportStreamOptions): AsyncIterableIterator<ExportChunk>;
|
|
1656
|
+
/**
|
|
1657
|
+
* Convenience wrapper that consumes `exportStream()` and serializes the
|
|
1658
|
+
* result to a single JSON string.
|
|
1659
|
+
*
|
|
1660
|
+
* ⚠ **`exportJSON()` decrypts your records and produces plaintext.**
|
|
1661
|
+
*
|
|
1662
|
+
* noy-db's threat model assumes that records on disk are encrypted.
|
|
1663
|
+
* This function deliberately violates that assumption: it produces a
|
|
1664
|
+
* JSON string in plaintext, which the consumer is then responsible for
|
|
1665
|
+
* protecting (filesystem permissions, full-disk encryption, secure
|
|
1666
|
+
* transfer, secure deletion).
|
|
1667
|
+
*
|
|
1668
|
+
* Use this function only when:
|
|
1669
|
+
* - You are the authorized owner of the data, **and**
|
|
1670
|
+
* - You have a legitimate downstream tool that requires plaintext
|
|
1671
|
+
* JSON, **and**
|
|
1672
|
+
* - You have a documented plan for how the resulting plaintext will be
|
|
1673
|
+
* protected and eventually destroyed.
|
|
1674
|
+
*
|
|
1675
|
+
* If your goal is encrypted backup or transport between noy-db
|
|
1676
|
+
* instances, use `dump()` instead — it produces a tamper-evident
|
|
1677
|
+
* encrypted envelope, never plaintext.
|
|
1678
|
+
*
|
|
1679
|
+
* ## Why `Promise<string>` instead of writing to a file path
|
|
1680
|
+
*
|
|
1681
|
+
* Core has zero `node:` imports — it runs unchanged in browsers, Node,
|
|
1682
|
+
* Bun, Deno, and edge runtimes. Accepting a file path would force a
|
|
1683
|
+
* `node:fs` import (breaks browsers) or a runtime dynamic import
|
|
1684
|
+
* (doesn't tree-shake, inflates bundles). Returning a string lets the
|
|
1685
|
+
* consumer choose any sink and forces the destination decision to be
|
|
1686
|
+
* explicit at the call site — which is also better for the security
|
|
1687
|
+
* warning.
|
|
1688
|
+
*
|
|
1689
|
+
* @example
|
|
1690
|
+
* ```ts
|
|
1691
|
+
* // Node: write to a file
|
|
1692
|
+
* import { writeFile } from 'node:fs/promises'
|
|
1693
|
+
* await writeFile('./backup.json', await company.exportJSON())
|
|
1694
|
+
* ```
|
|
1695
|
+
*
|
|
1696
|
+
* @example
|
|
1697
|
+
* ```ts
|
|
1698
|
+
* // Browser: download as a file
|
|
1699
|
+
* const json = await company.exportJSON()
|
|
1700
|
+
* const blob = new Blob([json], { type: 'application/json' })
|
|
1701
|
+
* const url = URL.createObjectURL(blob)
|
|
1702
|
+
* // ... attach to an <a download> and click
|
|
1703
|
+
* ```
|
|
1704
|
+
*
|
|
1705
|
+
* @example
|
|
1706
|
+
* ```ts
|
|
1707
|
+
* // Stream upload to a server
|
|
1708
|
+
* await fetch('/upload', {
|
|
1709
|
+
* method: 'POST',
|
|
1710
|
+
* body: await company.exportJSON(),
|
|
1711
|
+
* })
|
|
1712
|
+
* ```
|
|
1713
|
+
*
|
|
1714
|
+
* ## On-disk shape
|
|
1715
|
+
*
|
|
1716
|
+
* ```json
|
|
1717
|
+
* {
|
|
1718
|
+
* "_noydb_export": 1,
|
|
1719
|
+
* "_compartment": "acme",
|
|
1720
|
+
* "_exported_at": "2026-04-07T12:00:00.000Z",
|
|
1721
|
+
* "_exported_by": "alice@acme.example",
|
|
1722
|
+
* "collections": {
|
|
1723
|
+
* "invoices": {
|
|
1724
|
+
* "schema": null,
|
|
1725
|
+
* "refs": { "clientId": { "target": "clients", "mode": "strict" } },
|
|
1726
|
+
* "records": [ ... ]
|
|
1727
|
+
* }
|
|
1728
|
+
* },
|
|
1729
|
+
* "ledgerHead": { "hash": "...", "index": 42, "ts": "..." }
|
|
1730
|
+
* }
|
|
1731
|
+
* ```
|
|
1732
|
+
*
|
|
1733
|
+
* `schema` is included for forward compatibility but is currently
|
|
1734
|
+
* always `null` because Standard Schema validators are not JSON-
|
|
1735
|
+
* serializable. Format-package serializers that need the schema
|
|
1736
|
+
* should use `exportStream()` directly and read `chunk.schema` (which
|
|
1737
|
+
* is the live validator object, not a serialization of it).
|
|
1738
|
+
*/
|
|
1739
|
+
exportJSON(opts?: ExportStreamOptions): Promise<string>;
|
|
1740
|
+
}
|