@noy-db/hub 0.6.0-pre.12 → 0.6.0-pre.14
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/api-6IBOZN6F.js +20 -0
- package/dist/attestation/index.js +19 -19
- package/dist/{backup-AWHG6ODK.js → backup-FNAYQMLF.js} +15 -14
- package/dist/backup-FNAYQMLF.js.map +1 -0
- package/dist/blobs/index.js +13 -13
- package/dist/broker/index.js +12 -12
- package/dist/cargo/index.js +30 -30
- package/dist/{chunk-DG27IUVI.js → chunk-42IDLU5V.js} +2 -2
- package/dist/{chunk-35EBKWQU.js → chunk-4444HN72.js} +4 -4
- package/dist/{chunk-N35NC4JH.js → chunk-466KGOQB.js} +2 -2
- package/dist/{chunk-ZJADGNYF.js → chunk-4AOERLTV.js} +1 -1
- package/dist/chunk-4AOERLTV.js.map +1 -0
- package/dist/{chunk-SPA5WX3T.js → chunk-4LNFXGNW.js} +64 -70
- package/dist/chunk-4LNFXGNW.js.map +1 -0
- package/dist/{chunk-6OC6YASM.js → chunk-4NI5PR5S.js} +2 -2
- package/dist/{chunk-OUST5WDV.js → chunk-4YUIVHII.js} +5 -5
- package/dist/{chunk-6HFM7EIT.js → chunk-5NKSNW25.js} +2 -2
- package/dist/{chunk-FDX7OWWI.js → chunk-5SK5AFYH.js} +2 -2
- package/dist/{chunk-DMQCLZ4Z.js → chunk-6U7M7AX6.js} +2 -2
- package/dist/{chunk-NSRITINN.js → chunk-6ZFTVY3O.js} +1 -1
- package/dist/chunk-6ZFTVY3O.js.map +1 -0
- package/dist/{chunk-FNSMZQS4.js → chunk-7EIPPOEL.js} +2 -2
- package/dist/{chunk-OXCU7G5I.js → chunk-7J6YERYT.js} +10 -10
- package/dist/{chunk-P2PLXMHO.js → chunk-7VIIEXQ2.js} +15 -12
- package/dist/chunk-7VIIEXQ2.js.map +1 -0
- package/dist/{chunk-AZQVFXJF.js → chunk-A4JJUWSV.js} +3 -3
- package/dist/{chunk-BGQ63MCT.js → chunk-AFSMT3WI.js} +3 -3
- package/dist/{chunk-3FSX6LDG.js → chunk-AMKCY454.js} +2 -2
- package/dist/{chunk-K6TQEDVJ.js → chunk-BVYRPAB2.js} +7 -7
- package/dist/{chunk-7F4DBNSP.js → chunk-C66T4W5P.js} +3 -3
- package/dist/{chunk-UFM3WVIF.js → chunk-C6MI5OCF.js} +6 -6
- package/dist/{chunk-PK3URBVU.js → chunk-CAJ7QAPC.js} +3 -3
- package/dist/{chunk-P2Y2F6EB.js → chunk-CK6Z5DJQ.js} +4 -4
- package/dist/{chunk-G4VQSGXL.js → chunk-CK7IRIRY.js} +5 -5
- package/dist/{chunk-44JENXEG.js → chunk-CNA3QRLM.js} +2 -2
- package/dist/chunk-CNA3QRLM.js.map +1 -0
- package/dist/{chunk-UAHHWR4P.js → chunk-CWX6YIX5.js} +7 -7
- package/dist/{chunk-5XFTL73S.js → chunk-D763JZRO.js} +3 -3
- package/dist/{chunk-ZSKB5BDK.js → chunk-DZWRTWN2.js} +82 -82
- package/dist/{chunk-ZSKB5BDK.js.map → chunk-DZWRTWN2.js.map} +1 -1
- package/dist/{chunk-CCZJJ4I2.js → chunk-ESABIXMQ.js} +4 -4
- package/dist/{chunk-5GMMIDJX.js → chunk-FMZV43QY.js} +4 -4
- package/dist/{chunk-HXGUIPQB.js → chunk-FSZPQCDR.js} +3 -3
- package/dist/{chunk-SYFEJFIO.js → chunk-GBTLOHJM.js} +9 -6
- package/dist/chunk-GBTLOHJM.js.map +1 -0
- package/dist/{chunk-Z7SMBVNM.js → chunk-GE2AGI67.js} +3 -3
- package/dist/{chunk-7VPWXVKU.js → chunk-GJX6DOGD.js} +5 -5
- package/dist/{chunk-VBCDVWRU.js → chunk-GLS7OSZT.js} +7 -7
- package/dist/{chunk-W3TVWF6N.js → chunk-H545OIWE.js} +2 -2
- package/dist/{chunk-VA3PPYTQ.js → chunk-HJAFOPTN.js} +6 -6
- package/dist/{chunk-Z45YRGFO.js → chunk-HNOBRU24.js} +2 -2
- package/dist/{chunk-OI7ZJUYT.js → chunk-HVPQ5QIZ.js} +8 -8
- package/dist/{chunk-AR2JDFAE.js → chunk-HVR74IBG.js} +2 -2
- package/dist/{chunk-HNGSV2YC.js → chunk-I64WQSN3.js} +7 -9
- package/dist/chunk-I64WQSN3.js.map +1 -0
- package/dist/{chunk-2APC6HS6.js → chunk-IMYGJ5HU.js} +2 -2
- package/dist/{chunk-25FGCLYS.js → chunk-IYYGLI2K.js} +6 -6
- package/dist/{chunk-E2TN45ZD.js → chunk-JBMSNYOS.js} +5 -5
- package/dist/{chunk-55LKVALY.js → chunk-JN64WH3U.js} +1 -3
- package/dist/chunk-JN64WH3U.js.map +1 -0
- package/dist/{chunk-RXYYFSBB.js → chunk-JU3JKOY5.js} +3 -3
- package/dist/{chunk-CEJWMBXO.js → chunk-K2MR7ROB.js} +2 -2
- package/dist/{chunk-PGWXE5CR.js → chunk-KCLNKE4W.js} +6 -6
- package/dist/{chunk-LRNODVQX.js → chunk-KPD6HNQD.js} +12 -12
- package/dist/chunk-KPD6HNQD.js.map +1 -0
- package/dist/{chunk-K525AZ5C.js → chunk-KTCQKXHW.js} +3 -3
- package/dist/{chunk-7HF4J7Z5.js → chunk-LBQIKMBH.js} +2 -2
- package/dist/{chunk-EBEKSNKS.js → chunk-LWOSNMHE.js} +11 -11
- package/dist/chunk-LWOSNMHE.js.map +1 -0
- package/dist/{chunk-4HDYQL3J.js → chunk-MVG67SMN.js} +2 -2
- package/dist/{chunk-7MT56F4U.js → chunk-N6OJLR2M.js} +3 -3
- package/dist/{chunk-DIICZPWS.js → chunk-P2UFDX2F.js} +5 -5
- package/dist/{chunk-HVQGCKY4.js → chunk-PCXAUC65.js} +2 -2
- package/dist/{chunk-MSWYQLMQ.js → chunk-PJ5TGJ7U.js} +2 -2
- package/dist/{chunk-CCZ5DEJ7.js → chunk-QEYXKICE.js} +2 -2
- package/dist/{chunk-H4YQSDOI.js → chunk-QI2KXQOM.js} +2 -2
- package/dist/{chunk-UANGJ2YB.js → chunk-QJYTGH5V.js} +11 -10
- package/dist/{chunk-UANGJ2YB.js.map → chunk-QJYTGH5V.js.map} +1 -1
- package/dist/{chunk-FAXZQ5UF.js → chunk-QLMUW7OC.js} +2 -2
- package/dist/{chunk-XXVIHJZY.js → chunk-QQP5KJMS.js} +4 -4
- package/dist/{chunk-VCETL77O.js → chunk-QTDAPDDV.js} +14 -6
- package/dist/chunk-QTDAPDDV.js.map +1 -0
- package/dist/{chunk-RTAMLDWP.js → chunk-QWNYUTI2.js} +2 -2
- package/dist/{chunk-NT432TE6.js → chunk-R7E7X4CQ.js} +3 -3
- package/dist/{chunk-747LRSOO.js → chunk-RBTZLXZJ.js} +2 -2
- package/dist/{chunk-OF3L2SD6.js → chunk-RDPZMUCX.js} +2 -2
- package/dist/{chunk-JIUVJ4M7.js → chunk-RJTGXZT6.js} +2 -2
- package/dist/{chunk-XJIGOFN6.js → chunk-ROFEKKMI.js} +4 -4
- package/dist/{chunk-UHXCLPGC.js → chunk-RVTOCAHQ.js} +2 -2
- package/dist/{chunk-WLYIROCJ.js → chunk-RWPNRCK2.js} +2 -2
- package/dist/{chunk-HNHCQ556.js → chunk-S6CP5FWF.js} +2 -2
- package/dist/{chunk-YY3PEDBR.js → chunk-S77LTWCZ.js} +7 -7
- package/dist/{chunk-JRCYZEHU.js → chunk-SGEI3IJK.js} +2 -2
- package/dist/{chunk-7G6VDWXB.js → chunk-SZZEDEIU.js} +3 -3
- package/dist/{chunk-4UVDI4XE.js → chunk-T7AEAFEE.js} +4 -4
- package/dist/{chunk-B2P7M2D2.js → chunk-THYGVKZB.js} +7 -11
- package/dist/chunk-THYGVKZB.js.map +1 -0
- package/dist/{chunk-FUHKW252.js → chunk-TQ7IRULX.js} +2 -2
- package/dist/{chunk-VJFMXYKP.js → chunk-TQLYMYOK.js} +2 -2
- package/dist/{chunk-QS2PUZC7.js → chunk-UTQLKPBS.js} +6 -6
- package/dist/{chunk-T227WEHE.js → chunk-V2BEYLNR.js} +6 -6
- package/dist/{chunk-HPLWFNG4.js → chunk-V4M4BZNW.js} +2 -2
- package/dist/{chunk-KUDZVJKQ.js → chunk-VTTRWLOR.js} +2 -2
- package/dist/{chunk-L2UHRVB4.js → chunk-VVMSDWRG.js} +5 -5
- package/dist/{chunk-SV4BNALS.js → chunk-WLZKVY33.js} +6 -6
- package/dist/{chunk-TJCRCCPT.js → chunk-XHX3NTRP.js} +4 -4
- package/dist/{chunk-7BEHYALK.js → chunk-Y7MJSOZ7.js} +7 -7
- package/dist/{chunk-7BEHYALK.js.map → chunk-Y7MJSOZ7.js.map} +1 -1
- package/dist/{chunk-YAWK6AWF.js → chunk-YDJXGYYA.js} +2 -2
- package/dist/{chunk-VMCCGUQB.js → chunk-YGJZLOSR.js} +2 -2
- package/dist/{chunk-7TSYBD3E.js → chunk-YH65A6WM.js} +2 -2
- package/dist/{chunk-Y3H4WOP3.js → chunk-YKEJ5P3H.js} +5 -5
- package/dist/{chunk-GV2EFYNV.js → chunk-YODIXNV4.js} +4 -4
- package/dist/{chunk-AHLJSVRL.js → chunk-YVOW35HH.js} +2 -2
- package/dist/{chunk-DEFCPAXD.js → chunk-YZ7BRD26.js} +2 -2
- package/dist/{chunk-NJDQ4YSV.js → chunk-Z3U2YVNM.js} +4 -4
- package/dist/{chunk-RSHNUOSJ.js → chunk-ZHDMT2MJ.js} +6 -6
- package/dist/{chunk-4X5Z5SRV.js → chunk-ZWPUYBNK.js} +35 -8
- package/dist/chunk-ZWPUYBNK.js.map +1 -0
- package/dist/classified/index.js +5 -5
- package/dist/{classified-marker-EHRSGBM7.js → classified-marker-3STDEUFT.js} +3 -3
- package/dist/collection-facade-SGTS3TRS.js +45 -0
- package/dist/{computed-6G5M3UPH.js → computed-5E2OM6EN.js} +3 -3
- package/dist/consent/index.js +10 -10
- package/dist/cover/index.js +3 -3
- package/dist/custody/index.js +11 -11
- package/dist/{dead-filter-ANPRM2LD.js → dead-filter-ZNWVGV5U.js} +2 -2
- package/dist/debug/index.js +1 -1
- package/dist/{delegation-6NUQCURX.js → delegation-LZWFOST7.js} +14 -12
- package/dist/delegation-LZWFOST7.js.map +1 -0
- package/dist/derivations/index.js +12 -12
- package/dist/derive-BWXA2L7D.js +22 -0
- package/dist/directory/index.js +10 -10
- package/dist/{dispatch-EO2QHEXK.js → dispatch-S34AUC43.js} +18 -18
- package/dist/{dispatch-UGU775MV.js → dispatch-TIYW3UDN.js} +5 -5
- package/dist/{enclave-3Z7VTJAW.js → enclave-Y6GMYQMS.js} +11 -9
- package/dist/executor-JDMH2IGK.js +29 -0
- package/dist/executor-PCZN2LTY.js +9 -0
- package/dist/executor-WFTHIDT7.js +9 -0
- package/dist/export-accessible-U6GXZZMQ.js +23 -0
- package/dist/extract-partition-IDI6NDUR.js +38 -0
- package/dist/{fanout-sidecar-3Q6BWNSS.js → fanout-sidecar-BVFOEJTP.js} +9 -9
- package/dist/find-VBNMB42N.js +11 -0
- package/dist/forget/index.js +9 -9
- package/dist/guards/index.js +4 -4
- package/dist/history/index.js +12 -12
- package/dist/i18n/index.js +14 -14
- package/dist/index.d.ts +12 -12
- package/dist/index.js +104 -118
- package/dist/index.js.map +1 -1
- package/dist/indexing/index.js +2 -2
- package/dist/introspection/index.js +11 -11
- package/dist/issue-TEGTAN7N.js +19 -0
- package/dist/kernel/enclave/crypto.d.ts +24 -4
- package/dist/kernel/enclave/index.d.ts +2 -0
- package/dist/kernel/enclave/record-aad.d.ts +59 -0
- package/dist/kernel/errors.d.ts +6 -10
- package/dist/kernel/sync-policy.d.ts +0 -2
- package/dist/kernel/types.d.ts +3 -6
- package/dist/kernel/vault.d.ts +4 -4
- package/dist/{ledger-ZO5OKKGR.js → ledger-NFLBQASD.js} +11 -11
- package/dist/liberate-SG2PPGAJ.js +24 -0
- package/dist/{link-set-ZZYDZPL4.js → link-set-IPS57KDM.js} +11 -11
- package/dist/{managed-secret-6FITSKDO.js → managed-secret-GFYGPLNI.js} +3 -3
- package/dist/materialized-views/index.js +20 -20
- package/dist/money/index.js +4 -4
- package/dist/noydb-TN2VIJJO.js +83 -0
- package/dist/overlay-views/index.js +4 -4
- package/dist/periods/index.js +12 -12
- package/dist/pod/index.js +72 -84
- package/dist/{bundle-handle-G4R37BQV.js → pod-handle-I4ZME246.js} +6 -6
- package/dist/pod-handle-I4ZME246.js.map +1 -0
- package/dist/policy/index.js +4 -4
- package/dist/port/to/index.d.ts +2 -2
- package/dist/port/with/service-bus.d.ts +0 -4
- package/dist/portability/index.js +8 -8
- package/dist/{post-register-577X4FAU.js → post-register-JUSV3X4E.js} +6 -6
- package/dist/query/index.js +3 -3
- package/dist/reduce/index.js +4 -4
- package/dist/register-UTMPUAQW.js +32 -0
- package/dist/registry-B2S4UNUI.js +19 -0
- package/dist/registry-E4FM32KD.js +9 -0
- package/dist/registry-HACMULJJ.js +9 -0
- package/dist/registry-NDLBGQLJ.js +18 -0
- package/dist/request-withdrawal-Q5G43PR7.js +31 -0
- package/dist/{reveal-PCQYK4NO.js → reveal-YJU7GUYJ.js} +6 -6
- package/dist/revoke-NXOUPYS3.js +24 -0
- package/dist/satellites/index.js +1 -1
- package/dist/schema-update/index.js +2 -2
- package/dist/sealed-record/index.js +12 -12
- package/dist/search/index.js +4 -4
- package/dist/{seed-BVO6SSKH.js → seed-XXLR4KXU.js} +11 -11
- package/dist/sequence/index.js +9 -9
- package/dist/session/index.js +10 -10
- package/dist/shadow/index.js +2 -2
- package/dist/share-link/index.js +1 -1
- package/dist/signer-FCGAUB6E.js +25 -0
- package/dist/snapshots/index.js +10 -10
- package/dist/snapshots/index.js.map +1 -1
- package/dist/{stale-3FW6U4OU.js → stale-OT5NMBXU.js} +10 -10
- package/dist/storage-EWWIFB43.js +23 -0
- package/dist/{store-coordination-provider-3QGSXG3P.js → store-coordination-provider-PPLVM2I2.js} +3 -3
- package/dist/sync/index.js +11 -11
- package/dist/team/index.js +14 -14
- package/dist/tiers/index.js +10 -10
- package/dist/to/index.js +1 -3
- package/dist/to/index.js.map +1 -1
- package/dist/transactions/index.js +4 -4
- package/dist/{ulid-PTAIMDG4.js → ulid-VQW6ERQN.js} +2 -2
- package/dist/util/index.js +1 -1
- package/dist/{verify-RO5RTZOJ.js → verify-SHJXGZGM.js} +5 -5
- package/dist/walk-4NIT2ZBH.js +21 -0
- package/dist/with-cargo/adopt-partition.d.ts +1 -1
- package/dist/with-cargo/extract-partition.d.ts +1 -1
- package/dist/with-cargo/index.d.ts +1 -1
- package/dist/with-party/team/index.d.ts +1 -1
- package/dist/with-party/team/keyring.d.ts +2 -2
- package/dist/with-pod/format.d.ts +10 -12
- package/dist/with-pod/index.d.ts +10 -10
- package/dist/with-pod/open.d.ts +2 -2
- package/dist/with-pod/{bundle-handle.d.ts → pod-handle.d.ts} +2 -2
- package/dist/with-pod/pod-store.d.ts +0 -8
- package/dist/with-pod/{bundle.d.ts → pod.d.ts} +11 -19
- package/dist/with-pod/ulid.d.ts +1 -1
- package/dist/withdraw-accessible-LJG66PZQ.js +28 -0
- package/package.json +3 -3
- package/dist/api-XDMGLURJ.js +0 -20
- package/dist/backup-AWHG6ODK.js.map +0 -1
- package/dist/bundle-handle-G4R37BQV.js.map +0 -1
- package/dist/chunk-44JENXEG.js.map +0 -1
- package/dist/chunk-4X5Z5SRV.js.map +0 -1
- package/dist/chunk-55LKVALY.js.map +0 -1
- package/dist/chunk-B2P7M2D2.js.map +0 -1
- package/dist/chunk-EBEKSNKS.js.map +0 -1
- package/dist/chunk-HNGSV2YC.js.map +0 -1
- package/dist/chunk-LRNODVQX.js.map +0 -1
- package/dist/chunk-NSRITINN.js.map +0 -1
- package/dist/chunk-P2PLXMHO.js.map +0 -1
- package/dist/chunk-SPA5WX3T.js.map +0 -1
- package/dist/chunk-SYFEJFIO.js.map +0 -1
- package/dist/chunk-VCETL77O.js.map +0 -1
- package/dist/chunk-ZJADGNYF.js.map +0 -1
- package/dist/collection-facade-5UJW6QRB.js +0 -45
- package/dist/delegation-6NUQCURX.js.map +0 -1
- package/dist/derive-5PFJNNNU.js +0 -22
- package/dist/executor-AB4BCJO4.js +0 -29
- package/dist/executor-CYJQLKKI.js +0 -9
- package/dist/executor-S4QIKEHW.js +0 -9
- package/dist/export-accessible-JXCJGHCF.js +0 -23
- package/dist/extract-partition-2WDL4FJ5.js +0 -38
- package/dist/find-RBBYKXI7.js +0 -11
- package/dist/issue-EABYJWX5.js +0 -19
- package/dist/liberate-S3JR4TQT.js +0 -24
- package/dist/noydb-SPEVD5JA.js +0 -83
- package/dist/register-OXUXXIWT.js +0 -32
- package/dist/registry-CZVINVQH.js +0 -9
- package/dist/registry-IKUR2MXD.js +0 -9
- package/dist/registry-L3CO5ZAY.js +0 -18
- package/dist/registry-QFIVGS2W.js +0 -19
- package/dist/request-withdrawal-UV42CNR5.js +0 -31
- package/dist/revoke-26DFO36Z.js +0 -24
- package/dist/signer-DDO7QEID.js +0 -25
- package/dist/storage-M7L2EK3F.js +0 -23
- package/dist/walk-OFXQN5US.js +0 -21
- package/dist/withdraw-accessible-7XKYVTMP.js +0 -28
- /package/dist/{api-XDMGLURJ.js.map → api-6IBOZN6F.js.map} +0 -0
- /package/dist/{chunk-DG27IUVI.js.map → chunk-42IDLU5V.js.map} +0 -0
- /package/dist/{chunk-35EBKWQU.js.map → chunk-4444HN72.js.map} +0 -0
- /package/dist/{chunk-N35NC4JH.js.map → chunk-466KGOQB.js.map} +0 -0
- /package/dist/{chunk-6OC6YASM.js.map → chunk-4NI5PR5S.js.map} +0 -0
- /package/dist/{chunk-OUST5WDV.js.map → chunk-4YUIVHII.js.map} +0 -0
- /package/dist/{chunk-6HFM7EIT.js.map → chunk-5NKSNW25.js.map} +0 -0
- /package/dist/{chunk-FDX7OWWI.js.map → chunk-5SK5AFYH.js.map} +0 -0
- /package/dist/{chunk-DMQCLZ4Z.js.map → chunk-6U7M7AX6.js.map} +0 -0
- /package/dist/{chunk-FNSMZQS4.js.map → chunk-7EIPPOEL.js.map} +0 -0
- /package/dist/{chunk-OXCU7G5I.js.map → chunk-7J6YERYT.js.map} +0 -0
- /package/dist/{chunk-AZQVFXJF.js.map → chunk-A4JJUWSV.js.map} +0 -0
- /package/dist/{chunk-BGQ63MCT.js.map → chunk-AFSMT3WI.js.map} +0 -0
- /package/dist/{chunk-3FSX6LDG.js.map → chunk-AMKCY454.js.map} +0 -0
- /package/dist/{chunk-K6TQEDVJ.js.map → chunk-BVYRPAB2.js.map} +0 -0
- /package/dist/{chunk-7F4DBNSP.js.map → chunk-C66T4W5P.js.map} +0 -0
- /package/dist/{chunk-UFM3WVIF.js.map → chunk-C6MI5OCF.js.map} +0 -0
- /package/dist/{chunk-PK3URBVU.js.map → chunk-CAJ7QAPC.js.map} +0 -0
- /package/dist/{chunk-P2Y2F6EB.js.map → chunk-CK6Z5DJQ.js.map} +0 -0
- /package/dist/{chunk-G4VQSGXL.js.map → chunk-CK7IRIRY.js.map} +0 -0
- /package/dist/{chunk-UAHHWR4P.js.map → chunk-CWX6YIX5.js.map} +0 -0
- /package/dist/{chunk-5XFTL73S.js.map → chunk-D763JZRO.js.map} +0 -0
- /package/dist/{chunk-CCZJJ4I2.js.map → chunk-ESABIXMQ.js.map} +0 -0
- /package/dist/{chunk-5GMMIDJX.js.map → chunk-FMZV43QY.js.map} +0 -0
- /package/dist/{chunk-HXGUIPQB.js.map → chunk-FSZPQCDR.js.map} +0 -0
- /package/dist/{chunk-Z7SMBVNM.js.map → chunk-GE2AGI67.js.map} +0 -0
- /package/dist/{chunk-7VPWXVKU.js.map → chunk-GJX6DOGD.js.map} +0 -0
- /package/dist/{chunk-VBCDVWRU.js.map → chunk-GLS7OSZT.js.map} +0 -0
- /package/dist/{chunk-W3TVWF6N.js.map → chunk-H545OIWE.js.map} +0 -0
- /package/dist/{chunk-VA3PPYTQ.js.map → chunk-HJAFOPTN.js.map} +0 -0
- /package/dist/{chunk-Z45YRGFO.js.map → chunk-HNOBRU24.js.map} +0 -0
- /package/dist/{chunk-OI7ZJUYT.js.map → chunk-HVPQ5QIZ.js.map} +0 -0
- /package/dist/{chunk-AR2JDFAE.js.map → chunk-HVR74IBG.js.map} +0 -0
- /package/dist/{chunk-2APC6HS6.js.map → chunk-IMYGJ5HU.js.map} +0 -0
- /package/dist/{chunk-25FGCLYS.js.map → chunk-IYYGLI2K.js.map} +0 -0
- /package/dist/{chunk-E2TN45ZD.js.map → chunk-JBMSNYOS.js.map} +0 -0
- /package/dist/{chunk-RXYYFSBB.js.map → chunk-JU3JKOY5.js.map} +0 -0
- /package/dist/{chunk-CEJWMBXO.js.map → chunk-K2MR7ROB.js.map} +0 -0
- /package/dist/{chunk-PGWXE5CR.js.map → chunk-KCLNKE4W.js.map} +0 -0
- /package/dist/{chunk-K525AZ5C.js.map → chunk-KTCQKXHW.js.map} +0 -0
- /package/dist/{chunk-7HF4J7Z5.js.map → chunk-LBQIKMBH.js.map} +0 -0
- /package/dist/{chunk-4HDYQL3J.js.map → chunk-MVG67SMN.js.map} +0 -0
- /package/dist/{chunk-7MT56F4U.js.map → chunk-N6OJLR2M.js.map} +0 -0
- /package/dist/{chunk-DIICZPWS.js.map → chunk-P2UFDX2F.js.map} +0 -0
- /package/dist/{chunk-HVQGCKY4.js.map → chunk-PCXAUC65.js.map} +0 -0
- /package/dist/{chunk-MSWYQLMQ.js.map → chunk-PJ5TGJ7U.js.map} +0 -0
- /package/dist/{chunk-CCZ5DEJ7.js.map → chunk-QEYXKICE.js.map} +0 -0
- /package/dist/{chunk-H4YQSDOI.js.map → chunk-QI2KXQOM.js.map} +0 -0
- /package/dist/{chunk-FAXZQ5UF.js.map → chunk-QLMUW7OC.js.map} +0 -0
- /package/dist/{chunk-XXVIHJZY.js.map → chunk-QQP5KJMS.js.map} +0 -0
- /package/dist/{chunk-RTAMLDWP.js.map → chunk-QWNYUTI2.js.map} +0 -0
- /package/dist/{chunk-NT432TE6.js.map → chunk-R7E7X4CQ.js.map} +0 -0
- /package/dist/{chunk-747LRSOO.js.map → chunk-RBTZLXZJ.js.map} +0 -0
- /package/dist/{chunk-OF3L2SD6.js.map → chunk-RDPZMUCX.js.map} +0 -0
- /package/dist/{chunk-JIUVJ4M7.js.map → chunk-RJTGXZT6.js.map} +0 -0
- /package/dist/{chunk-XJIGOFN6.js.map → chunk-ROFEKKMI.js.map} +0 -0
- /package/dist/{chunk-UHXCLPGC.js.map → chunk-RVTOCAHQ.js.map} +0 -0
- /package/dist/{chunk-WLYIROCJ.js.map → chunk-RWPNRCK2.js.map} +0 -0
- /package/dist/{chunk-HNHCQ556.js.map → chunk-S6CP5FWF.js.map} +0 -0
- /package/dist/{chunk-YY3PEDBR.js.map → chunk-S77LTWCZ.js.map} +0 -0
- /package/dist/{chunk-JRCYZEHU.js.map → chunk-SGEI3IJK.js.map} +0 -0
- /package/dist/{chunk-7G6VDWXB.js.map → chunk-SZZEDEIU.js.map} +0 -0
- /package/dist/{chunk-4UVDI4XE.js.map → chunk-T7AEAFEE.js.map} +0 -0
- /package/dist/{chunk-FUHKW252.js.map → chunk-TQ7IRULX.js.map} +0 -0
- /package/dist/{chunk-VJFMXYKP.js.map → chunk-TQLYMYOK.js.map} +0 -0
- /package/dist/{chunk-QS2PUZC7.js.map → chunk-UTQLKPBS.js.map} +0 -0
- /package/dist/{chunk-T227WEHE.js.map → chunk-V2BEYLNR.js.map} +0 -0
- /package/dist/{chunk-HPLWFNG4.js.map → chunk-V4M4BZNW.js.map} +0 -0
- /package/dist/{chunk-KUDZVJKQ.js.map → chunk-VTTRWLOR.js.map} +0 -0
- /package/dist/{chunk-L2UHRVB4.js.map → chunk-VVMSDWRG.js.map} +0 -0
- /package/dist/{chunk-SV4BNALS.js.map → chunk-WLZKVY33.js.map} +0 -0
- /package/dist/{chunk-TJCRCCPT.js.map → chunk-XHX3NTRP.js.map} +0 -0
- /package/dist/{chunk-YAWK6AWF.js.map → chunk-YDJXGYYA.js.map} +0 -0
- /package/dist/{chunk-VMCCGUQB.js.map → chunk-YGJZLOSR.js.map} +0 -0
- /package/dist/{chunk-7TSYBD3E.js.map → chunk-YH65A6WM.js.map} +0 -0
- /package/dist/{chunk-Y3H4WOP3.js.map → chunk-YKEJ5P3H.js.map} +0 -0
- /package/dist/{chunk-GV2EFYNV.js.map → chunk-YODIXNV4.js.map} +0 -0
- /package/dist/{chunk-AHLJSVRL.js.map → chunk-YVOW35HH.js.map} +0 -0
- /package/dist/{chunk-DEFCPAXD.js.map → chunk-YZ7BRD26.js.map} +0 -0
- /package/dist/{chunk-NJDQ4YSV.js.map → chunk-Z3U2YVNM.js.map} +0 -0
- /package/dist/{chunk-RSHNUOSJ.js.map → chunk-ZHDMT2MJ.js.map} +0 -0
- /package/dist/{classified-marker-EHRSGBM7.js.map → classified-marker-3STDEUFT.js.map} +0 -0
- /package/dist/{collection-facade-5UJW6QRB.js.map → collection-facade-SGTS3TRS.js.map} +0 -0
- /package/dist/{computed-6G5M3UPH.js.map → computed-5E2OM6EN.js.map} +0 -0
- /package/dist/{dead-filter-ANPRM2LD.js.map → dead-filter-ZNWVGV5U.js.map} +0 -0
- /package/dist/{derive-5PFJNNNU.js.map → derive-BWXA2L7D.js.map} +0 -0
- /package/dist/{dispatch-EO2QHEXK.js.map → dispatch-S34AUC43.js.map} +0 -0
- /package/dist/{dispatch-UGU775MV.js.map → dispatch-TIYW3UDN.js.map} +0 -0
- /package/dist/{enclave-3Z7VTJAW.js.map → enclave-Y6GMYQMS.js.map} +0 -0
- /package/dist/{executor-AB4BCJO4.js.map → executor-JDMH2IGK.js.map} +0 -0
- /package/dist/{executor-CYJQLKKI.js.map → executor-PCZN2LTY.js.map} +0 -0
- /package/dist/{executor-S4QIKEHW.js.map → executor-WFTHIDT7.js.map} +0 -0
- /package/dist/{export-accessible-JXCJGHCF.js.map → export-accessible-U6GXZZMQ.js.map} +0 -0
- /package/dist/{extract-partition-2WDL4FJ5.js.map → extract-partition-IDI6NDUR.js.map} +0 -0
- /package/dist/{fanout-sidecar-3Q6BWNSS.js.map → fanout-sidecar-BVFOEJTP.js.map} +0 -0
- /package/dist/{find-RBBYKXI7.js.map → find-VBNMB42N.js.map} +0 -0
- /package/dist/{issue-EABYJWX5.js.map → issue-TEGTAN7N.js.map} +0 -0
- /package/dist/{ledger-ZO5OKKGR.js.map → ledger-NFLBQASD.js.map} +0 -0
- /package/dist/{liberate-S3JR4TQT.js.map → liberate-SG2PPGAJ.js.map} +0 -0
- /package/dist/{link-set-ZZYDZPL4.js.map → link-set-IPS57KDM.js.map} +0 -0
- /package/dist/{managed-secret-6FITSKDO.js.map → managed-secret-GFYGPLNI.js.map} +0 -0
- /package/dist/{noydb-SPEVD5JA.js.map → noydb-TN2VIJJO.js.map} +0 -0
- /package/dist/{post-register-577X4FAU.js.map → post-register-JUSV3X4E.js.map} +0 -0
- /package/dist/{register-OXUXXIWT.js.map → register-UTMPUAQW.js.map} +0 -0
- /package/dist/{registry-CZVINVQH.js.map → registry-B2S4UNUI.js.map} +0 -0
- /package/dist/{registry-IKUR2MXD.js.map → registry-E4FM32KD.js.map} +0 -0
- /package/dist/{registry-L3CO5ZAY.js.map → registry-HACMULJJ.js.map} +0 -0
- /package/dist/{registry-QFIVGS2W.js.map → registry-NDLBGQLJ.js.map} +0 -0
- /package/dist/{request-withdrawal-UV42CNR5.js.map → request-withdrawal-Q5G43PR7.js.map} +0 -0
- /package/dist/{reveal-PCQYK4NO.js.map → reveal-YJU7GUYJ.js.map} +0 -0
- /package/dist/{revoke-26DFO36Z.js.map → revoke-NXOUPYS3.js.map} +0 -0
- /package/dist/{seed-BVO6SSKH.js.map → seed-XXLR4KXU.js.map} +0 -0
- /package/dist/{signer-DDO7QEID.js.map → signer-FCGAUB6E.js.map} +0 -0
- /package/dist/{stale-3FW6U4OU.js.map → stale-OT5NMBXU.js.map} +0 -0
- /package/dist/{storage-M7L2EK3F.js.map → storage-EWWIFB43.js.map} +0 -0
- /package/dist/{store-coordination-provider-3QGSXG3P.js.map → store-coordination-provider-PPLVM2I2.js.map} +0 -0
- /package/dist/{ulid-PTAIMDG4.js.map → ulid-VQW6ERQN.js.map} +0 -0
- /package/dist/{verify-RO5RTZOJ.js.map → verify-SHJXGZGM.js.map} +0 -0
- /package/dist/{walk-OFXQN5US.js.map → walk-4NIT2ZBH.js.map} +0 -0
- /package/dist/{withdraw-accessible-7XKYVTMP.js.map → withdraw-accessible-LJG66PZQ.js.map} +0 -0
package/dist/with-pod/open.d.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* reachable through published seams). Composes, in order:
|
|
7
7
|
*
|
|
8
8
|
* 1. `readPod` — parse + integrity-check the container (throws
|
|
9
|
-
* `
|
|
9
|
+
* `PodIntegrityError` on a corrupted/truncated pod).
|
|
10
10
|
* 2. `verifyPodHeader` — only when `opts.trustedKeys` is supplied.
|
|
11
11
|
* `'unsigned'` is benign (legacy pod, or `writePod({ sign: false })`)
|
|
12
12
|
* and open() proceeds; `'untrusted'` / `'tampered'` are fail-closed —
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
* @module
|
|
64
64
|
*/
|
|
65
65
|
import type { NoydbPodHeader } from './format.js';
|
|
66
|
-
import type { PodVerifyResult } from './
|
|
66
|
+
import type { PodVerifyResult } from './pod.js';
|
|
67
67
|
import type { Noydb } from '../kernel/noydb.js';
|
|
68
68
|
import type { Vault } from '../kernel/vault.js';
|
|
69
69
|
import type { NoydbOptions, NoydbStore, EchoSecretParts } from '../kernel/types.js';
|
|
@@ -3,7 +3,7 @@ import type { NoydbStore } from '../kernel/types.js';
|
|
|
3
3
|
* Return the stable opaque bundle handle for the given vault adapter,
|
|
4
4
|
* generating and persisting a fresh ULID on first call.
|
|
5
5
|
*
|
|
6
|
-
* See {@link import('../kernel/vault.js').Vault.
|
|
6
|
+
* See {@link import('../kernel/vault.js').Vault.getPodHandle} for
|
|
7
7
|
* the full rationale and storage-path documentation.
|
|
8
8
|
*/
|
|
9
|
-
export declare function
|
|
9
|
+
export declare function buildPodHandle(adapter: NoydbStore, name: string): Promise<string>;
|
|
@@ -44,11 +44,3 @@ export declare function wrapPodStore(bundle: NoydbPodStore, options?: WrapPodSto
|
|
|
44
44
|
* analogous to `createStore` for KV stores.
|
|
45
45
|
*/
|
|
46
46
|
export declare function createPodStore<TOptions>(factory: (options: TOptions) => NoydbPodStore): (options: TOptions) => NoydbPodStore;
|
|
47
|
-
/** @deprecated Use wrapPodStore. */
|
|
48
|
-
export declare const wrapBundleStore: typeof wrapPodStore;
|
|
49
|
-
/** @deprecated Use createPodStore. */
|
|
50
|
-
export declare const createBundleStore: typeof createPodStore;
|
|
51
|
-
/** @deprecated Use WrappedPodNoydbStore. */
|
|
52
|
-
export type WrappedBundleNoydbStore = WrappedPodNoydbStore;
|
|
53
|
-
/** @deprecated Use WrapPodStoreOptions. */
|
|
54
|
-
export type WrapBundleStoreOptions = WrapPodStoreOptions;
|
|
@@ -36,7 +36,7 @@ import { type NoydbPodHeader, type UnlockMethod } from './format.js';
|
|
|
36
36
|
import type { Redirect } from './redirect.js';
|
|
37
37
|
import type { DocSigner } from '../with-audit/attestation/signer.js';
|
|
38
38
|
import type { Vault } from '../kernel/vault.js';
|
|
39
|
-
import type {
|
|
39
|
+
import type { PodRecipient } from '../with-party/team/keyring.js';
|
|
40
40
|
import type { Cover } from '../with-party/directory/cover/types.js';
|
|
41
41
|
import type { SealingKeyProvider, RecipientSealer, RecipientHint } from '../with-party/team/managed-secret.js';
|
|
42
42
|
/**
|
|
@@ -128,7 +128,7 @@ export interface WritePodOptions {
|
|
|
128
128
|
* the bundle inherits the source keyring as-is (today's behaviour,
|
|
129
129
|
* suited to personal backup-and-restore).
|
|
130
130
|
*/
|
|
131
|
-
readonly recipients?: readonly
|
|
131
|
+
readonly recipients?: readonly PodRecipient[];
|
|
132
132
|
/**
|
|
133
133
|
* Auto-unlock — unsealed per-user credentials.
|
|
134
134
|
*
|
|
@@ -266,8 +266,6 @@ export interface WritePodOptions {
|
|
|
266
266
|
*/
|
|
267
267
|
readonly redirect?: Redirect;
|
|
268
268
|
}
|
|
269
|
-
/** @deprecated Use `WritePodOptions`. */
|
|
270
|
-
export type WriteNoydbBundleOptions = WritePodOptions;
|
|
271
269
|
/**
|
|
272
270
|
* Every key `writePod` reads, in declaration order (#991).
|
|
273
271
|
*
|
|
@@ -289,7 +287,7 @@ export declare const WRITE_POD_OPTION_KEYS: readonly ["compression", "collection
|
|
|
289
287
|
* actually restore a vault. Splitting the layers keeps the
|
|
290
288
|
* bundle module free of crypto concerns — see file-level docs.
|
|
291
289
|
*/
|
|
292
|
-
export interface
|
|
290
|
+
export interface PodReadResult {
|
|
293
291
|
readonly header: NoydbPodHeader;
|
|
294
292
|
readonly dumpJson: string;
|
|
295
293
|
/**
|
|
@@ -317,7 +315,7 @@ export interface NoydbBundleReadResult {
|
|
|
317
315
|
* auto-unlock paths. Without these the reader behaves exactly as before
|
|
318
316
|
* (header parsed; body returned as `dumpJson`).
|
|
319
317
|
*/
|
|
320
|
-
export interface
|
|
318
|
+
export interface ReadPodOptions {
|
|
321
319
|
/**
|
|
322
320
|
* Recipient-side sealing providers used to unseal entries from
|
|
323
321
|
* `sealedSecrets`. The reader picks the one whose `.id`
|
|
@@ -373,7 +371,7 @@ export declare function resetBrotliSupportCache(): void;
|
|
|
373
371
|
*
|
|
374
372
|
* Pipeline:
|
|
375
373
|
* 1. Resolve or create the compartment's stable bundle handle
|
|
376
|
-
* via `vault.
|
|
374
|
+
* via `vault.getPodHandle()` — same handle on
|
|
377
375
|
* every export from the same vault instance, so cloud
|
|
378
376
|
* adapters can use it as a primary key.
|
|
379
377
|
* 2. `vault.dump()` → JSON string with encrypted records
|
|
@@ -398,7 +396,7 @@ export declare function resetBrotliSupportCache(): void;
|
|
|
398
396
|
*
|
|
399
397
|
* @internal
|
|
400
398
|
*/
|
|
401
|
-
export declare function
|
|
399
|
+
export declare function assemblePodContainer(opts: {
|
|
402
400
|
handle: string;
|
|
403
401
|
bodyJsonStr: string;
|
|
404
402
|
compression: WritePodOptions['compression'];
|
|
@@ -413,8 +411,6 @@ export declare function assembleBundleContainer(opts: {
|
|
|
413
411
|
signer?: DocSigner;
|
|
414
412
|
}): Promise<Uint8Array>;
|
|
415
413
|
export declare function writePod(vault: Vault, opts?: WritePodOptions): Promise<Uint8Array>;
|
|
416
|
-
/** @deprecated Use `writePod`. */
|
|
417
|
-
export declare const writeNoydbBundle: typeof writePod;
|
|
418
414
|
/**
|
|
419
415
|
* Read just the bundle header — no body decompression, no
|
|
420
416
|
* integrity verification. Intended for cloud-listing UIs that want
|
|
@@ -430,8 +426,6 @@ export declare const writeNoydbBundle: typeof writePod;
|
|
|
430
426
|
* range requests against bundles that may carry icons.
|
|
431
427
|
*/
|
|
432
428
|
export declare function readPodHeader(bytes: Uint8Array): NoydbPodHeader;
|
|
433
|
-
/** @deprecated Use `readPodHeader`. */
|
|
434
|
-
export declare const readNoydbBundleHeader: typeof readPodHeader;
|
|
435
429
|
/**
|
|
436
430
|
* Outcome of {@link verifyPodHeader}.
|
|
437
431
|
*
|
|
@@ -457,7 +451,7 @@ export interface PodVerifyResult {
|
|
|
457
451
|
* (`keyId → publicKeyB64` the caller already trusts), it reports whether the
|
|
458
452
|
* header was signed by a trusted document signer.
|
|
459
453
|
*
|
|
460
|
-
* Pairs with the signing half in `
|
|
454
|
+
* Pairs with the signing half in `assemblePodContainer`/`writePod`: the
|
|
461
455
|
* signed payload is the final wire header with `sig` removed, so verification
|
|
462
456
|
* reconstructs it by stripping EXACTLY the `sig` field — `keyId`, `sigAlg`,
|
|
463
457
|
* and every other header field stay in the verified payload.
|
|
@@ -469,7 +463,7 @@ export interface PodVerifyResult {
|
|
|
469
463
|
* header (which includes the *claimed* `bodySha256`) is signed by a trusted
|
|
470
464
|
* key; it does NOT prove the body matches that hash. To trust the pod's
|
|
471
465
|
* BODY you MUST also confirm the body hashes to `header.bodySha256` — call
|
|
472
|
-
* `readPod`, which throws `
|
|
466
|
+
* `readPod`, which throws `PodIntegrityError` on mismatch. A `verified`
|
|
473
467
|
* header paired with a swapped body is caught only by that integrity check.
|
|
474
468
|
* This function stays body-free by design so a static page can authenticate a
|
|
475
469
|
* header without decompressing the body; composing the two checks is the
|
|
@@ -498,7 +492,7 @@ export declare function readPodCover(bytes: Uint8Array, opts?: {
|
|
|
498
492
|
* the header's `redirect` field or `undefined` if the bundle was written
|
|
499
493
|
* without one.
|
|
500
494
|
*
|
|
501
|
-
* The record is returned UNVERIFIED: `
|
|
495
|
+
* The record is returned UNVERIFIED: `validatePodHeaderFields` only checks
|
|
502
496
|
* its shape at parse time (a parser has no `trustedKeys`). Callers that
|
|
503
497
|
* intend to follow the redirect MUST separately call `verifyRedirect`
|
|
504
498
|
* (`redirect.js`) before trusting `target`.
|
|
@@ -510,7 +504,7 @@ export declare function readPodRedirect(bytes: Uint8Array): Redirect | undefined
|
|
|
510
504
|
* original `vault.dump()` JSON string ready to pass to
|
|
511
505
|
* `vault.load()`.
|
|
512
506
|
*
|
|
513
|
-
* Throws `
|
|
507
|
+
* Throws `PodIntegrityError` if the body's actual SHA-256 does
|
|
514
508
|
* not match the value declared in the header. Distinct from a
|
|
515
509
|
* format error so consumers can pattern-match in catch blocks
|
|
516
510
|
* (corrupted-in-transit vs malformed-by-producer).
|
|
@@ -522,6 +516,4 @@ export declare function readPodRedirect(bytes: Uint8Array): Redirect | undefined
|
|
|
522
516
|
* free of crypto concerns and lets the same code feed format
|
|
523
517
|
* inspectors that never decrypt anything.
|
|
524
518
|
*/
|
|
525
|
-
export declare function readPod(bytes: Uint8Array, opts?:
|
|
526
|
-
/** @deprecated Use `readPod`. */
|
|
527
|
-
export declare const readNoydbBundle: typeof readPod;
|
|
519
|
+
export declare function readPod(bytes: Uint8Array, opts?: ReadPodOptions): Promise<PodReadResult>;
|
package/dist/with-pod/ulid.d.ts
CHANGED
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
*
|
|
40
40
|
* If a future use case needs timestamp-free handles, a v2 of the
|
|
41
41
|
* format could specify "use the random portion only" without a
|
|
42
|
-
* format break — `
|
|
42
|
+
* format break — `validatePodHeaderFields` only checks the regex
|
|
43
43
|
* shape, not the encoded timestamp.
|
|
44
44
|
*/
|
|
45
45
|
/**
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import {
|
|
2
|
+
FROZEN_SNAPSHOTS_COLLECTION,
|
|
3
|
+
freezeAndDeleteClosure,
|
|
4
|
+
freezeSnapshotOnly,
|
|
5
|
+
randomId,
|
|
6
|
+
withdrawAccessibleData
|
|
7
|
+
} from "./chunk-4YUIVHII.js";
|
|
8
|
+
import "./chunk-CNA3QRLM.js";
|
|
9
|
+
import "./chunk-4LNFXGNW.js";
|
|
10
|
+
import "./chunk-GE2AGI67.js";
|
|
11
|
+
import "./chunk-ZWPUYBNK.js";
|
|
12
|
+
import "./chunk-IMYGJ5HU.js";
|
|
13
|
+
import "./chunk-FSZPQCDR.js";
|
|
14
|
+
import "./chunk-HVR74IBG.js";
|
|
15
|
+
import "./chunk-RBTZLXZJ.js";
|
|
16
|
+
import "./chunk-LP7BEXCT.js";
|
|
17
|
+
import "./chunk-QTDAPDDV.js";
|
|
18
|
+
import "./chunk-6ZFTVY3O.js";
|
|
19
|
+
import "./chunk-I64WQSN3.js";
|
|
20
|
+
import "./chunk-PZ5AY32C.js";
|
|
21
|
+
export {
|
|
22
|
+
FROZEN_SNAPSHOTS_COLLECTION,
|
|
23
|
+
freezeAndDeleteClosure,
|
|
24
|
+
freezeSnapshotOnly,
|
|
25
|
+
randomId,
|
|
26
|
+
withdrawAccessibleData
|
|
27
|
+
};
|
|
28
|
+
//# sourceMappingURL=withdraw-accessible-LJG66PZQ.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@noy-db/hub",
|
|
3
|
-
"version": "0.6.0-pre.
|
|
3
|
+
"version": "0.6.0-pre.14",
|
|
4
4
|
"description": "Zero-knowledge, offline-first, encrypted document store — core library with AES-256-GCM, PBKDF2, multi-user keyring, and sync engine",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "vLannaAi <vicio@lanna.ai>",
|
|
@@ -210,14 +210,14 @@
|
|
|
210
210
|
"node": ">=22.0.0"
|
|
211
211
|
},
|
|
212
212
|
"dependencies": {
|
|
213
|
-
"@noy-db/attestation": "0.6.0-pre.
|
|
213
|
+
"@noy-db/attestation": "0.6.0-pre.14"
|
|
214
214
|
},
|
|
215
215
|
"devDependencies": {
|
|
216
216
|
"@types/node": "^22.0.0",
|
|
217
217
|
"esbuild": "^0.25.0",
|
|
218
218
|
"zod": "^4.0.0",
|
|
219
219
|
"zod-to-json-schema": "^3.25.2",
|
|
220
|
-
"@noy-db/on-shamir": "0.6.0-pre.
|
|
220
|
+
"@noy-db/on-shamir": "0.6.0-pre.14"
|
|
221
221
|
},
|
|
222
222
|
"peerDependencies": {
|
|
223
223
|
"zod-to-json-schema": "^3.25.0"
|
package/dist/api-XDMGLURJ.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
UserApi,
|
|
3
|
-
createUserApi
|
|
4
|
-
} from "./chunk-PK3URBVU.js";
|
|
5
|
-
import "./chunk-G4VQSGXL.js";
|
|
6
|
-
import "./chunk-4X5Z5SRV.js";
|
|
7
|
-
import "./chunk-2APC6HS6.js";
|
|
8
|
-
import "./chunk-HXGUIPQB.js";
|
|
9
|
-
import "./chunk-AR2JDFAE.js";
|
|
10
|
-
import "./chunk-747LRSOO.js";
|
|
11
|
-
import "./chunk-LP7BEXCT.js";
|
|
12
|
-
import "./chunk-VCETL77O.js";
|
|
13
|
-
import "./chunk-NSRITINN.js";
|
|
14
|
-
import "./chunk-HNGSV2YC.js";
|
|
15
|
-
import "./chunk-PZ5AY32C.js";
|
|
16
|
-
export {
|
|
17
|
-
UserApi,
|
|
18
|
-
createUserApi
|
|
19
|
-
};
|
|
20
|
-
//# sourceMappingURL=api-XDMGLURJ.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/with-pod/backup.ts"],"sourcesContent":["/**\n * Vault backup / restore / integrity.\n *\n * Holds `dump()` (verifiable encrypted JSON backup, including the blob\n * collections so blob \"covers\" travel in the bundle), `load()` (restore +\n * post-load integrity gate), `verifyBackupIntegrity()` (chain + data-envelope\n * cross-check), and `exportJSON()` (plaintext per-collection export, built on\n * the vault's `exportStream`). Behaviour is byte-identical to the inline\n * `Vault` methods these functions replaced — every dependency the moving code\n * touched on `this.*` arrives via {@link BackupContext}. `Vault` keeps the\n * public methods as thin delegators.\n *\n * Internal — reached through `vault.dump()` / `vault.load()` / etc.\n */\nimport { NOYDB_BACKUP_VERSION } from '../kernel/types.js'\nimport { BackupLedgerError, BackupCorruptedError } from '../kernel/errors.js'\nimport { LEDGER_COLLECTION, LEDGER_DELTAS_COLLECTION } from '../with-commit/history/ledger/constants.js'\nimport { SCHEMAS_COLLECTION } from '../with-shape/persisted-schemas/storage.js'\nimport { SEQUENCE_COLLECTION } from '../with-commit/sequence/index.js'\nimport { MANIFEST_COLLECTION } from '../with-shape/manifest/reserved-collections.js'\n// #1025 — imported from the dependency-light `window.ts`, not `periods.ts`: that\n// module exists precisely so a consumer can name the period collections without\n// dragging the ledger hash-chain machinery (`sha256Hex`/`canonicalJson`) into a\n// bundle that opted out of the periods service. Same reason the sync engine's\n// period-scoped pull imports it.\nimport {\n PERIODS_COLLECTION,\n PERIOD_FREEZES_COLLECTION,\n PERIOD_ARCHIVES_COLLECTION,\n PERIOD_TARGET_PURGES_COLLECTION,\n PERIOD_REOPENS_COLLECTION,\n} from '../with-audit/periods/window.js'\nimport type {\n NoydbStore,\n EncryptedEnvelope,\n VaultBackup,\n VaultSnapshot,\n ExportStreamOptions,\n ExportChunk,\n} from '../kernel/types.js'\nimport type { LedgerStore } from '../with-commit/history/ledger/store.js'\n\n/** Everything the moving backup methods touched on the vault's `this.*`. */\nexport interface BackupContext {\n /** The ciphertext store. */\n readonly adapter: NoydbStore\n /** Vault namespace name. */\n readonly vault: string\n /** The invoking keyring's user id (read fresh per call). */\n userId(): string\n /** The vault's ledger store, or null when history is off. */\n getLedgerOrNull(): LedgerStore | null\n /** Recompute an envelope's `payloadHash` (bound `historyStrategy.envelopePayloadHash`). */\n envelopePayloadHash(envelope: EncryptedEnvelope): Promise<string>\n /**\n * Refresh the in-memory keyring from the freshly-loaded keyring file and\n * rebuild the DEK resolver. No-op when the vault has no `reloadKeyring`\n * callback (plaintext vaults / test constructions).\n */\n reloadKeyringAndRebuildDEK(): Promise<void>\n /** Clear the vault's collection cache (post-load). */\n clearCollectionCache(): void\n /** Reset the ledger store so the next `ledger()` rebuilds its head cache. */\n resetLedgerStore(): void\n /** The vault's decrypt+ACL export stream (used by `exportJSON`). */\n exportStream(opts: ExportStreamOptions): AsyncIterableIterator<ExportChunk>\n}\n\n/** Result of {@link verifyBackupIntegrity}. */\nexport type VerifyBackupResult =\n | { readonly ok: true; readonly head: string; readonly length: number }\n | {\n readonly ok: false\n readonly kind: 'chain'\n readonly divergedAt: number\n readonly message: string\n }\n | {\n readonly ok: false\n readonly kind: 'data'\n readonly collection: string\n readonly id: string\n readonly message: string\n }\n\n/**\n * Dump vault as a verifiable encrypted JSON backup string.\n *\n * backups embed the current ledger head and the full `_ledger` +\n * `_ledger_deltas` internal collections so the receiver can run\n * `verifyBackupIntegrity()` after `load()` and detect any tampering between\n * dump and restore. Backups produced without a ledger skip the integrity check\n * with a warning — both modes round-trip cleanly.\n */\nexport async function dumpVault(ctx: BackupContext): Promise<string> {\n const snapshot = await ctx.adapter.loadAll(ctx.vault)\n\n // Load keyrings (separate path because loadAll filters them out\n // along with all other underscore-prefixed internal collections).\n const keyringIds = await ctx.adapter.list(ctx.vault, '_keyring')\n const keyrings: Record<string, unknown> = {}\n for (const keyringId of keyringIds) {\n const envelope = await ctx.adapter.get(ctx.vault, '_keyring', keyringId)\n if (envelope) {\n keyrings[keyringId] = JSON.parse(envelope._data)\n }\n }\n\n // Load the ledger entries + deltas so the receiver can replay\n // the chain after restore. Without this, `load()` would have an\n // empty ledger and `verifyBackupIntegrity()` would have nothing\n // to compare against.\n //\n // Also enumerate the blob collections so blob content (\"covers\")\n // travels in the bundle (the blob DEK already travels in `_keyring`).\n // Literals are inlined (not imported from blobs/blob-set.ts) to keep\n // the blob runtime out of this kernel hot path — they mirror\n // BLOB_INDEX/CHUNKS/EVICTION_AUDIT_COLLECTION and SLOTS/VERSIONS_PREFIX.\n // The collect-loop skips empty ids, so this no-ops without blobs.\n const internalSnapshot: VaultSnapshot = {}\n const internalNames = [\n LEDGER_COLLECTION, LEDGER_DELTAS_COLLECTION, SCHEMAS_COLLECTION, SEQUENCE_COLLECTION,\n MANIFEST_COLLECTION, // #941: the pod's manifest-set record(s) travel in the bundle too\n // #1025: the accounting-period close state + its companions. The bundle is\n // the backup/restore path, so without these a restore discarded the\n // hash-chained evidence that a month was ever closed — the artifact\n // `closePeriod` exists to produce — and dropped the write gate with it, so\n // the restored vault silently accepted back-dated writes into a sealed\n // month. The companions matter as much as the close: a bounded reopen\n // window (`reopenPeriod({ until })`) is state a restore must not lose.\n PERIODS_COLLECTION,\n PERIOD_REOPENS_COLLECTION,\n PERIOD_FREEZES_COLLECTION,\n PERIOD_ARCHIVES_COLLECTION,\n PERIOD_TARGET_PURGES_COLLECTION,\n '_history', // full-snapshot version history — so history()/getVersion()/diff() survive the bundle\n '_blob_index', '_blob_chunks', '_blob_eviction_audit',\n // #753 spec §7 Q3: `_blob_intent` markers travel too — restoring mid-op\n // state (a blob row without its marker) would reproduce the ambiguity\n // the journal exists to prevent. Note: `_mv_stale` does NOT travel\n // today (a pre-existing, separate gap) — observed here, tracked on\n // #761, not fixed in this pass.\n '_blob_intent',\n // #769: `_blob_slots_<c>` envelopes travel verbatim (raw ciphertext,\n // same DEK, same vault) — including any `SlotRecord.pendingRelease`\n // resume breadcrumb they carry. This is INTENTIONALLY the opposite of\n // `extract-partition`'s `reKeyBlobs`, which STRIPS `pendingRelease`:\n // a full-vault backup restores into the SAME vault it was taken from,\n // so a breadcrumb taken mid-rehome (together with its `_blob_intent`\n // marker, carried above) is resumable on restore — carry-and-resume is\n // correct here. A partition extraction crosses vaults: the breadcrumb's\n // old eTag may not exist in the destination, so it must be stripped\n // there instead. Asymmetry: backup = same-vault-resumable = carry;\n // partition = cross-vault = strip-breadcrumb-carry-marker.\n ...Object.keys(snapshot).flatMap((c) => [`_blob_slots_${c}`, `_blob_versions_${c}`]),\n ]\n for (const internalName of internalNames) {\n const ids = await ctx.adapter.list(ctx.vault, internalName)\n if (ids.length === 0) continue\n const records: Record<string, EncryptedEnvelope> = {}\n for (const id of ids) {\n const envelope = await ctx.adapter.get(ctx.vault, internalName, id)\n if (envelope) records[id] = envelope\n }\n internalSnapshot[internalName] = records\n }\n\n // Embed the ledger head if there's a chain. An empty ledger\n // (fresh vault) leaves `ledgerHead` undefined, which\n // load() treats the same as a legacy backup (no integrity\n // check, console warning). If history is not opted in,\n // `getLedgerOrNull` returns null and we skip embedding entirely\n // — the backup is still valid, just without the integrity head.\n const ledgerForHead = ctx.getLedgerOrNull()\n const head = ledgerForHead ? await ledgerForHead.head() : null\n const backup: VaultBackup = {\n _noydb_backup: NOYDB_BACKUP_VERSION,\n _compartment: ctx.vault,\n _exported_at: new Date().toISOString(),\n _exported_by: ctx.userId(),\n keyrings: keyrings as VaultBackup['keyrings'],\n collections: snapshot,\n ...(Object.keys(internalSnapshot).length > 0\n ? { _internal: internalSnapshot }\n : {}),\n ...(head\n ? {\n ledgerHead: {\n hash: head.hash,\n index: head.entry.index,\n ts: head.entry.ts,\n },\n }\n : {}),\n }\n\n return JSON.stringify(backup)\n}\n\n/**\n * Restore a vault from a verifiable backup. After loading, runs\n * `verifyBackupIntegrity()` to confirm the hash chain, the embedded head, and\n * every data envelope's payload hash. Legacy backups (no `ledgerHead`) load\n * with a console warning and skip the integrity check.\n */\nexport async function loadVault(ctx: BackupContext, backupJson: string): Promise<void> {\n const backup = JSON.parse(backupJson) as VaultBackup\n\n // 1. Restore data collections.\n await ctx.adapter.saveAll(ctx.vault, backup.collections)\n\n // 2. Restore keyrings.\n for (const [userId, keyringFile] of Object.entries(backup.keyrings)) {\n const envelope = {\n _noydb: 1 as const,\n _v: 1,\n _ts: new Date().toISOString(),\n _iv: '',\n _data: JSON.stringify(keyringFile),\n }\n await ctx.adapter.put(ctx.vault, '_keyring', userId, envelope)\n }\n\n // 3. Restore internal collections (`_ledger`, `_ledger_deltas`).\n // Required so verifyBackupIntegrity has the chain to walk.\n if (backup._internal) {\n for (const [internalName, records] of Object.entries(backup._internal)) {\n for (const [id, envelope] of Object.entries(records)) {\n await ctx.adapter.put(ctx.vault, internalName, id, envelope)\n }\n }\n }\n\n // 4. Refresh the in-memory keyring from the freshly-loaded\n // keyring file. Without this, the Vault's getDEK\n // closure still holds the OLD session's DEKs, and every\n // decrypt of a loaded ledger entry / data envelope fails\n // with TamperedError because the DEK doesn't match the\n // ciphertext that was encrypted with the SOURCE user's DEK.\n // Skipped for plaintext vaults and for tests that\n // construct Vault without a reloadKeyring callback.\n await ctx.reloadKeyringAndRebuildDEK()\n\n // 5. Clear collection cache + reset the ledger store so the\n // next ledger() call rebuilds its head cache from the\n // freshly-loaded entries.\n ctx.clearCollectionCache()\n ctx.resetLedgerStore()\n\n // 5. Run the verification gate. Legacy backups (no ledgerHead)\n // skip this with a one-line warning so existing consumers can\n // still read them while migrating.\n if (!backup.ledgerHead) {\n console.warn(\n `[noy-db] Loaded a legacy backup with no ledgerHead — ` +\n `verifiable-backup integrity check skipped. ` +\n `Re-export with a ledger-aware build to get tamper detection.`,\n )\n return\n }\n\n const result = await verifyBackupIntegrity(ctx)\n if (!result.ok) {\n // Surface the most specific error class we can. The result\n // shape carries enough info for callers to inspect.\n if (result.kind === 'data') {\n throw new BackupCorruptedError(\n result.collection,\n result.id,\n result.message,\n )\n }\n throw new BackupLedgerError(result.message, result.divergedAt)\n }\n\n // 6. Cross-check: the freshly-verified head must match the\n // value embedded at dump time. A mismatch means someone\n // truncated or extended the chain after dump.\n if (result.head !== backup.ledgerHead.hash) {\n throw new BackupLedgerError(\n `Backup ledger head mismatch: embedded \"${backup.ledgerHead.hash}\" ` +\n `but reconstructed \"${result.head}\".`,\n )\n }\n}\n\n/**\n * End-to-end backup integrity check: `ledger.verify()` (hash chain) plus a data\n * envelope cross-check (every current record's `_data` hash must match the\n * latest `put` entry's `payloadHash`). Returns a discriminated union so callers\n * can distinguish chain vs data failures.\n */\nexport async function verifyBackupIntegrity(ctx: BackupContext): Promise<VerifyBackupResult> {\n // Step 1: chain verification. Without the history strategy there\n // is no ledger; an unaudited backup verifies trivially as `ok`\n // because there's nothing to diverge from.\n const ledgerForVerify = ctx.getLedgerOrNull()\n if (!ledgerForVerify) {\n return { ok: true, head: '', length: 0 }\n }\n const chainResult = await ledgerForVerify.verify()\n if (!chainResult.ok) {\n return {\n ok: false,\n kind: 'chain',\n divergedAt: chainResult.divergedAt,\n message:\n `Ledger chain diverged at index ${chainResult.divergedAt}: ` +\n `expected prevHash \"${chainResult.expected}\" but found \"${chainResult.actual}\".`,\n }\n }\n\n // Step 2: data envelope cross-check. Walk every entry in the\n // ledger and, for the LATEST `put` per (collection, id), recompute\n // the data envelope's payloadHash and compare. Earlier puts of the\n // same id are skipped because the data collection only holds the\n // current version — historical envelopes live in the deltas\n // collection (which is itself protected by the chain).\n // Reuse the ledger we already resolved in step 1.\n const allEntries = await ledgerForVerify.loadAllEntries()\n\n // Find the latest non-delete entry per (collection, id). Walk\n // the entries in reverse so we hit the latest first; mark each\n // (collection, id) as seen and skip subsequent entries.\n const seen = new Set<string>()\n const latest = new Map<\n string,\n { collection: string; id: string; expectedHash: string }\n >()\n for (let i = allEntries.length - 1; i >= 0; i--) {\n const entry = allEntries[i]\n if (!entry) continue\n // Amendment entries are multi-record audit entries whose\n // `collection` and `id` are empty strings — building a `\"/\"`\n // key here would mark that synthetic slot as seen and falsely\n // trip the data check on a record that never existed. Skip\n // them BEFORE the key/seen bookkeeping so they neither\n // tombstone real entries nor enter the latest map.\n if (entry.op === 'amendment' || entry.op === 'lifecycle') continue\n const key = `${entry.collection}/${entry.id}`\n if (seen.has(key)) continue\n seen.add(key)\n // For deletes the data collection should NOT have the record,\n // so we skip — there's nothing to cross-check. Marking the key\n // as seen above ensures any earlier `put` of the same id is\n // also skipped (the record was subsequently deleted).\n if (entry.op === 'delete') continue\n latest.set(key, {\n collection: entry.collection,\n id: entry.id,\n expectedHash: entry.payloadHash,\n })\n }\n\n for (const { collection, id, expectedHash } of latest.values()) {\n const envelope = await ctx.adapter.get(ctx.vault, collection, id)\n if (!envelope) {\n return {\n ok: false,\n kind: 'data',\n collection,\n id,\n message:\n `Ledger expects data record \"${collection}/${id}\" to exist, ` +\n `but the adapter has no envelope for it.`,\n }\n }\n const actualHash = await ctx.envelopePayloadHash(envelope)\n if (actualHash !== expectedHash) {\n return {\n ok: false,\n kind: 'data',\n collection,\n id,\n message:\n `Data envelope \"${collection}/${id}\" has been tampered with: ` +\n `expected payloadHash \"${expectedHash}\", got \"${actualHash}\".`,\n }\n }\n }\n\n return {\n ok: true,\n head: chainResult.head,\n length: chainResult.length,\n }\n}\n\n/**\n * Plaintext per-collection export, built on the vault's `exportStream`. Forces\n * collection granularity (record-by-record output makes no sense in a single\n * string) and merges dictionary snapshots across collections.\n */\nexport async function exportVaultJSON(ctx: BackupContext, opts: ExportStreamOptions = {}): Promise<string> {\n // Force per-collection granularity regardless of caller setting:\n // record-by-record output doesn't make sense in a single string.\n const collections: Record<\n string,\n {\n schema: null\n refs: Record<string, { target: string; mode: 'strict' | 'warn' | 'cascade' }>\n records: unknown[]\n }\n > = {}\n let ledgerHead: ExportChunk['ledgerHead'] | undefined\n // Merged dictionary snapshot across all collections.\n // Only populated when `resolveLabels` is not set.\n const allDictionaries: Record<\n string, // collection name\n Record<string, Record<string, Record<string, string>>>\n > = {}\n\n for await (const chunk of ctx.exportStream({\n granularity: 'collection',\n withLedgerHead: opts.withLedgerHead === true,\n // Thread the export locale so records are read at the\n // `export` layer (i18nText collapsed + dictKey/staticDict labels resolved).\n ...(opts.resolveLabels !== undefined ? { resolveLabels: opts.resolveLabels } : {}),\n })) {\n collections[chunk.collection] = {\n schema: null, // Standard Schema validators are not JSON-serializable\n refs: chunk.refs,\n records: chunk.records,\n }\n if (chunk.ledgerHead) ledgerHead = chunk.ledgerHead\n // Collect dictionary snapshots unless resolveLabels is set\n if (!opts.resolveLabels && chunk.dictionaries) {\n allDictionaries[chunk.collection] = chunk.dictionaries\n }\n }\n\n const hasDictionaries = Object.keys(allDictionaries).length > 0\n return JSON.stringify({\n _noydb_export: 1,\n _compartment: ctx.vault,\n _exported_at: new Date().toISOString(),\n _exported_by: ctx.userId(),\n collections,\n ...(hasDictionaries ? { _dictionaries: allDictionaries } : {}),\n ...(ledgerHead ? { ledgerHead } : {}),\n })\n}\n"],"mappings":"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","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/with-pod/bundle-handle.ts"],"sourcesContent":["/**\n * Vault bundle handle — the stable opaque ULID identifying a vault\n * across `.noydb` exports.\n *\n * Behaviour is byte-identical to the inline `Vault.getBundleHandle`\n * method this function replaced. `Vault` keeps the public method as\n * a thin delegator.\n *\n * Internal — reached through `vault.getBundleHandle()`.\n */\nimport { NOYDB_FORMAT_VERSION } from '../kernel/types.js'\nimport type { NoydbStore, EncryptedEnvelope } from '../kernel/types.js'\n\n/**\n * Return the stable opaque bundle handle for the given vault adapter,\n * generating and persisting a fresh ULID on first call.\n *\n * See {@link import('../kernel/vault.js').Vault.getBundleHandle} for\n * the full rationale and storage-path documentation.\n */\nexport async function buildBundleHandle(adapter: NoydbStore, name: string): Promise<string> {\n const existing = await adapter.get(name, '_meta', 'handle')\n if (existing) {\n try {\n const parsed = JSON.parse(existing._data) as unknown\n if (parsed !== null && typeof parsed === 'object' && 'handle' in parsed) {\n const handle = (parsed as { handle: unknown }).handle\n if (typeof handle === 'string' && /^[0-9A-HJKMNP-TV-Z]{26}$/.test(handle)) {\n return handle\n }\n }\n } catch {\n // Fall through to regenerate — corrupted handle envelope\n // is treated as missing, not as an error. The new handle\n // overwrites the bad one.\n }\n }\n const { generateULID } = await import('./ulid.js')\n const handle = generateULID()\n const envelope: EncryptedEnvelope = {\n _noydb: NOYDB_FORMAT_VERSION,\n _v: 1,\n _ts: new Date().toISOString(),\n _iv: '',\n _data: JSON.stringify({ handle }),\n }\n await adapter.put(name, '_meta', 'handle', envelope)\n return handle\n}\n"],"mappings":";;;;;;AAoBA,eAAsB,kBAAkB,SAAqB,MAA+B;AAC1F,QAAM,WAAW,MAAM,QAAQ,IAAI,MAAM,SAAS,QAAQ;AAC1D,MAAI,UAAU;AACZ,QAAI;AACF,YAAM,SAAS,KAAK,MAAM,SAAS,KAAK;AACxC,UAAI,WAAW,QAAQ,OAAO,WAAW,YAAY,YAAY,QAAQ;AACvE,cAAMA,UAAU,OAA+B;AAC/C,YAAI,OAAOA,YAAW,YAAY,2BAA2B,KAAKA,OAAM,GAAG;AACzE,iBAAOA;AAAA,QACT;AAAA,MACF;AAAA,IACF,QAAQ;AAAA,IAIR;AAAA,EACF;AACA,QAAM,EAAE,aAAa,IAAI,MAAM,OAAO,oBAAW;AACjD,QAAM,SAAS,aAAa;AAC5B,QAAM,WAA8B;AAAA,IAClC,QAAQ;AAAA,IACR,IAAI;AAAA,IACJ,MAAK,oBAAI,KAAK,GAAE,YAAY;AAAA,IAC5B,KAAK;AAAA,IACL,OAAO,KAAK,UAAU,EAAE,OAAO,CAAC;AAAA,EAClC;AACA,QAAM,QAAQ,IAAI,MAAM,SAAS,UAAU,QAAQ;AACnD,SAAO;AACT;","names":["handle"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/with-audit/portability/export-accessible.ts"],"sourcesContent":["/**\n * `exportMyAccessibleData`: a non-owner user exports the scope they\n * can decrypt as a portable, re-keyed `.noydb` bundle. Non-destructive and\n * **always allowed** (the \"data sovereignty by construction\" property of\n * sealing-at-dimension — the firm cannot deny it) but **audited**.\n *\n * Reuses the existing bundle machinery: the access boundary is the caller's DEK\n * set (operator/client → `keyring.permissions`; owner/admin/viewer → all), so a\n * record outside the caller's keys can never enter the bundle. Re-keying to a\n * new owner reuses `writePod`'s `exportSecret` shorthand.\n */\nimport type { Vault } from '../../kernel/vault.js'\nimport type { UnlockedKeyring } from '../../with-party/team/keyring.js'\nimport { writePod } from '../../with-pod/bundle.js'\n\n/**\n * Resolve the collections a caller may export/withdraw: operator/client are\n * scoped to their granted collections; owner/admin/viewer see everything\n * (`undefined` = no allowlist). A `scope.collections` sub-scope intersects the\n * granted set. `writableOnly` keeps only `rw` grants (for destructive ops).\n */\nexport function resolveAccessibleCollections(\n keyring: UnlockedKeyring,\n scope: { collections?: readonly string[] } | undefined,\n writableOnly = false,\n): string[] | undefined {\n let collections: string[] | undefined\n if (keyring.role === 'operator' || keyring.role === 'client') {\n collections = Object.entries(keyring.permissions)\n .filter(([, mode]) => !writableOnly || mode === 'rw')\n .map(([c]) => c)\n }\n if (scope?.collections) {\n const allow = new Set(scope.collections)\n collections = (collections ?? [...scope.collections]).filter((c) => allow.has(c))\n }\n return collections\n}\n\n/** Produce a (optionally re-keyed, scoped) `.noydb` bundle — no audit. */\nexport async function buildAccessibleBundle(\n vault: Vault,\n collections: string[] | undefined,\n reKey: { secret: string } | undefined,\n compression: 'auto' | 'brotli' | 'gzip' | 'none' = 'auto',\n): Promise<Uint8Array> {\n return writePod(vault, {\n compression,\n ...(collections !== undefined ? { collections } : {}),\n ...(reKey ? { exportSecret: reKey.secret } : {}),\n })\n}\n\nexport interface ExportAccessibleOptions {\n /**\n * Re-key the bundle so it is independently openable by a new owner with this\n * secret (the receiving firm / the client themselves). Omit to inherit\n * the source keyring (personal backup).\n */\n readonly reKey?: { readonly secret: string }\n /** Narrow the export to a subset of the caller's accessible collections. */\n readonly scope?: { readonly collections?: readonly string[] }\n readonly compression?: 'auto' | 'brotli' | 'gzip' | 'none'\n}\n\n/**\n * Produce a re-keyed, access-scoped `.noydb` bundle of the caller's accessible\n * data. Appends a tamper-evident audit entry (`reason: 'user-export:<userId>'`).\n */\nexport async function exportAccessibleData(\n vault: Vault,\n opts: ExportAccessibleOptions = {},\n): Promise<Uint8Array> {\n const { keyring } = vault._introspectState()\n const collections = resolveAccessibleCollections(keyring, opts.scope)\n const bytes = await buildAccessibleBundle(vault, collections, opts.reKey, opts.compression ?? 'auto')\n\n // §11.11 audit — non-destructive, always-allowed export. No-op when the vault\n // has no history/ledger strategy (avoids minting a phantom _ledger DEK).\n await vault._getLedgerOrNull()?.append({\n op: 'lifecycle',\n collection: '',\n id: '',\n version: 0,\n actor: keyring.userId,\n payloadHash: '',\n reason: `user-export:${keyring.userId}`,\n })\n\n return bytes\n}\n"],"mappings":";;;;;AAqBO,SAAS,6BACd,SACA,OACA,eAAe,OACO;AACtB,MAAI;AACJ,MAAI,QAAQ,SAAS,cAAc,QAAQ,SAAS,UAAU;AAC5D,kBAAc,OAAO,QAAQ,QAAQ,WAAW,EAC7C,OAAO,CAAC,CAAC,EAAE,IAAI,MAAM,CAAC,gBAAgB,SAAS,IAAI,EACnD,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC;AAAA,EACnB;AACA,MAAI,OAAO,aAAa;AACtB,UAAM,QAAQ,IAAI,IAAI,MAAM,WAAW;AACvC,mBAAe,eAAe,CAAC,GAAG,MAAM,WAAW,GAAG,OAAO,CAAC,MAAM,MAAM,IAAI,CAAC,CAAC;AAAA,EAClF;AACA,SAAO;AACT;AAGA,eAAsB,sBACpB,OACA,aACA,OACA,cAAmD,QAC9B;AACrB,SAAO,SAAS,OAAO;AAAA,IACrB;AAAA,IACA,GAAI,gBAAgB,SAAY,EAAE,YAAY,IAAI,CAAC;AAAA,IACnD,GAAI,QAAQ,EAAE,cAAc,MAAM,OAAO,IAAI,CAAC;AAAA,EAChD,CAAC;AACH;AAkBA,eAAsB,qBACpB,OACA,OAAgC,CAAC,GACZ;AACrB,QAAM,EAAE,QAAQ,IAAI,MAAM,iBAAiB;AAC3C,QAAM,cAAc,6BAA6B,SAAS,KAAK,KAAK;AACpE,QAAM,QAAQ,MAAM,sBAAsB,OAAO,aAAa,KAAK,OAAO,KAAK,eAAe,MAAM;AAIpG,QAAM,MAAM,iBAAiB,GAAG,OAAO;AAAA,IACrC,IAAI;AAAA,IACJ,YAAY;AAAA,IACZ,IAAI;AAAA,IACJ,SAAS;AAAA,IACT,OAAO,QAAQ;AAAA,IACf,aAAa;AAAA,IACb,QAAQ,eAAe,QAAQ,MAAM;AAAA,EACvC,CAAC;AAED,SAAO;AACT;","names":[]}
|