@noy-db/hub 0.8.0-pre.0 → 0.8.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/CHANGELOG.md +50 -0
- package/dist/api-OS747DS4.js +18 -0
- package/dist/as/index.js +11 -12
- package/dist/as/index.js.map +1 -1
- package/dist/at/index.js +9 -10
- package/dist/attestation/index.js +39 -28
- package/dist/attestation/index.js.map +1 -1
- package/dist/{backup-7TFRVFLH.js → backup-YE2VQ26S.js} +15 -16
- package/dist/backup-YE2VQ26S.js.map +1 -0
- package/dist/blobs/index.js +13 -14
- package/dist/blobs/index.js.map +1 -1
- package/dist/broker/index.js +12 -13
- package/dist/broker/index.js.map +1 -1
- package/dist/by/index.js +2 -2
- package/dist/capsule/contract.d.ts +159 -0
- package/dist/capsule/contract.js +95 -0
- package/dist/capsule/enclave-aes/bound.d.ts +52 -0
- package/dist/capsule/enclave-aes/capabilities.d.ts +2 -0
- package/dist/capsule/enclave-aes/classify/compare.d.ts +20 -0
- package/dist/{kernel/enclave → capsule/enclave-aes}/classify/find.d.ts +1 -1
- package/dist/{kernel/enclave → capsule/enclave-aes}/classify/reveal.d.ts +1 -1
- package/dist/{kernel/enclave → capsule/enclave-aes}/classify/verify.d.ts +2 -2
- package/dist/{kernel/enclave → capsule/enclave-aes}/classify/write.d.ts +1 -1
- package/dist/{kernel/enclave → capsule/enclave-aes}/crypto.d.ts +33 -129
- package/dist/capsule/enclave-aes/index.d.ts +113 -0
- package/dist/capsule/enclave-aes/index.js +335 -0
- package/dist/capsule/enclave-aes/index.js.map +1 -0
- package/dist/capsule/enclave-aes/primitives.d.ts +29 -0
- package/dist/capsule/index.d.ts +27 -0
- package/dist/capsule/plumbing/ct-equal.d.ts +11 -0
- package/dist/{kernel/enclave/record-keys → capsule/plumbing}/deterministic.d.ts +8 -21
- package/dist/capsule/plumbing/digest.d.ts +122 -0
- package/dist/{kernel/enclave/record-keys → capsule/plumbing}/envelope-body.d.ts +44 -48
- package/dist/capsule/plumbing/index.d.ts +100 -0
- package/dist/capsule/plumbing/lifecycle.d.ts +50 -0
- package/dist/{kernel/enclave/record-keys → capsule/plumbing}/record-codec.d.ts +55 -20
- package/dist/{kernel/enclave → capsule/plumbing}/record-envelope.d.ts +1 -1
- package/dist/capsule/plumbing/rekey-blob.d.ts +33 -0
- package/dist/capsule/plumbing/rekey.d.ts +44 -0
- package/dist/capsule/plumbing/sealed-slot.d.ts +22 -0
- package/dist/capsule/plumbing/sealed-slots.d.ts +37 -0
- package/dist/capsule/plumbing/sealing.d.ts +29 -0
- package/dist/capsule/plumbing/sign.d.ts +9 -0
- package/dist/{kernel/enclave/record-keys → capsule/plumbing}/tombstone.d.ts +2 -2
- package/dist/capsule-VOLX3QRQ.js +209 -0
- package/dist/cargo/index.js +36 -36
- package/dist/{chunk-DF73H4UN.js → chunk-23D6M6VM.js} +5 -5
- package/dist/chunk-23D6M6VM.js.map +1 -0
- package/dist/{chunk-FH2L2E34.js → chunk-244QBK7Z.js} +4 -4
- package/dist/{chunk-FH2L2E34.js.map → chunk-244QBK7Z.js.map} +1 -1
- package/dist/{chunk-YSK2CU2Q.js → chunk-2AFX33YA.js} +2 -2
- package/dist/{chunk-TKUOEU2F.js → chunk-2GHDLTPE.js} +2 -2
- package/dist/{chunk-GYGLAVCX.js → chunk-2MG3SW7Q.js} +6 -2
- package/dist/chunk-2MG3SW7Q.js.map +1 -0
- package/dist/{chunk-6OWXYZK2.js → chunk-2ODVB6LZ.js} +2 -2
- package/dist/{chunk-X25NWUZB.js → chunk-2PVXF5CS.js} +3 -3
- package/dist/{chunk-IEX7NK2K.js → chunk-2RH777HH.js} +21 -20
- package/dist/{chunk-IEX7NK2K.js.map → chunk-2RH777HH.js.map} +1 -1
- package/dist/{chunk-244VXYPG.js → chunk-37EPTBBR.js} +14 -1
- package/dist/chunk-37EPTBBR.js.map +1 -0
- package/dist/{chunk-NRT6QZQB.js → chunk-3A5DUZ56.js} +6 -6
- package/dist/chunk-3A5DUZ56.js.map +1 -0
- package/dist/{chunk-ORDURZBU.js → chunk-3EWS67C7.js} +2 -2
- package/dist/{chunk-3H5KLDZN.js → chunk-3L2NBKDR.js} +4 -8
- package/dist/chunk-3L2NBKDR.js.map +1 -0
- package/dist/{chunk-ENAG3IY7.js → chunk-3XJQBBZD.js} +26 -28
- package/dist/chunk-3XJQBBZD.js.map +1 -0
- package/dist/{chunk-KJFW62P4.js → chunk-42ALPZ2B.js} +652 -662
- package/dist/chunk-42ALPZ2B.js.map +1 -0
- package/dist/{chunk-FXQBGFOX.js → chunk-4CIQDWRB.js} +8 -8
- package/dist/{chunk-HT2AHGQI.js → chunk-4JPMZTJY.js} +2 -2
- package/dist/{chunk-FQ5VRHIB.js → chunk-4T3SE27M.js} +5 -9
- package/dist/chunk-4T3SE27M.js.map +1 -0
- package/dist/{chunk-MKXXMNJH.js → chunk-4V3Q35WG.js} +2 -2
- package/dist/{chunk-A6IJU4TK.js → chunk-52MGURXO.js} +2 -2
- package/dist/{chunk-IUWCVHQ7.js → chunk-5A4345TG.js} +4 -4
- package/dist/{chunk-IUWCVHQ7.js.map → chunk-5A4345TG.js.map} +1 -1
- package/dist/{chunk-ISZQJBML.js → chunk-5FE75J4S.js} +6 -6
- package/dist/chunk-5FE75J4S.js.map +1 -0
- package/dist/chunk-5KC7QYEC.js +565 -0
- package/dist/chunk-5KC7QYEC.js.map +1 -0
- package/dist/{chunk-NNARWO72.js → chunk-5UMK7GRI.js} +13 -12
- package/dist/chunk-5UMK7GRI.js.map +1 -0
- package/dist/{chunk-HLEK5VAN.js → chunk-5WWDGFOS.js} +2 -2
- package/dist/{chunk-CKNGS5MH.js → chunk-6QVKPHBF.js} +3 -5
- package/dist/chunk-6QVKPHBF.js.map +1 -0
- package/dist/{chunk-PSIV7CJV.js → chunk-747G6CT3.js} +2 -2
- package/dist/chunk-747G6CT3.js.map +1 -0
- package/dist/{chunk-LGRLME4M.js → chunk-7R2Q7CPL.js} +16 -16
- package/dist/chunk-7R2Q7CPL.js.map +1 -0
- package/dist/{chunk-SOIQ4MM4.js → chunk-7XMHMVTS.js} +3 -3
- package/dist/{chunk-BUDAGWL5.js → chunk-A4XMIZT3.js} +6 -6
- package/dist/{chunk-BUDAGWL5.js.map → chunk-A4XMIZT3.js.map} +1 -1
- package/dist/{chunk-4MXI3ODD.js → chunk-AEQGFRU4.js} +3 -3
- package/dist/{chunk-7JE7BDYJ.js → chunk-AL6ML4LA.js} +5 -5
- package/dist/{chunk-ZUVBC32X.js → chunk-AUKKUPVB.js} +2 -2
- package/dist/chunk-BNWA3WG5.js +22 -0
- package/dist/chunk-BNWA3WG5.js.map +1 -0
- package/dist/{chunk-WY2XXTET.js → chunk-BPWYQ25R.js} +4 -4
- package/dist/{chunk-EOVMT6TB.js → chunk-BVCUTXE3.js} +2 -2
- package/dist/{chunk-UPD5NWI5.js → chunk-DHHGL42E.js} +13 -16
- package/dist/chunk-DHHGL42E.js.map +1 -0
- package/dist/{chunk-3JWHAR6E.js → chunk-DIZLQVAA.js} +2 -2
- package/dist/{chunk-QWFHIOD2.js → chunk-DLD5LGDS.js} +11 -12
- package/dist/chunk-DLD5LGDS.js.map +1 -0
- package/dist/{chunk-ZE4CHIED.js → chunk-DQESF6RP.js} +17 -28
- package/dist/chunk-DQESF6RP.js.map +1 -0
- package/dist/{chunk-IT22PWKV.js → chunk-E2N2T5ZO.js} +2 -2
- package/dist/{chunk-3ELRMVJK.js → chunk-EGVJ7TM4.js} +31 -34
- package/dist/chunk-EGVJ7TM4.js.map +1 -0
- package/dist/{chunk-WNJ4AVGE.js → chunk-EJLV62NI.js} +2 -2
- package/dist/{chunk-QBBUZ3I3.js → chunk-EYG2CY2X.js} +11 -11
- package/dist/{enclave-27SMF6GF.js → chunk-EZGV6F47.js} +83 -56
- package/dist/chunk-EZGV6F47.js.map +1 -0
- package/dist/{chunk-LQ4ZHOKP.js → chunk-EZOAKKTB.js} +36 -27
- package/dist/chunk-EZOAKKTB.js.map +1 -0
- package/dist/{chunk-BJ2IXQ5Q.js → chunk-FFJFE4T7.js} +2 -2
- package/dist/{chunk-JCN44NCY.js → chunk-FLPCETP6.js} +2 -2
- package/dist/{chunk-5O7D6ZTW.js → chunk-FOEDQATO.js} +2 -2
- package/dist/{chunk-VNNRUGMM.js → chunk-FVH5QYY2.js} +2 -2
- package/dist/{chunk-ANWPSTZU.js → chunk-G2MVBDFP.js} +23 -26
- package/dist/chunk-G2MVBDFP.js.map +1 -0
- package/dist/chunk-GMKGGY7V.js +234 -0
- package/dist/chunk-GMKGGY7V.js.map +1 -0
- package/dist/{chunk-EIPVYUEP.js → chunk-GQ4MF3CM.js} +3 -3
- package/dist/chunk-GQ4MF3CM.js.map +1 -0
- package/dist/{chunk-PEOZ34EM.js → chunk-GSAK56VF.js} +1 -1
- package/dist/chunk-GSAK56VF.js.map +1 -0
- package/dist/{chunk-QOOUUR4A.js → chunk-GUZET4SG.js} +10 -4
- package/dist/chunk-GUZET4SG.js.map +1 -0
- package/dist/{chunk-4AF3TUMP.js → chunk-GZT3NQRA.js} +2 -2
- package/dist/{chunk-N5DNADLQ.js → chunk-H23XHRTT.js} +19 -34
- package/dist/chunk-H23XHRTT.js.map +1 -0
- package/dist/{chunk-MVZ2TPVP.js → chunk-H427H63K.js} +2 -2
- package/dist/{chunk-6B3VNR4P.js → chunk-H7JBY4P7.js} +23 -32
- package/dist/chunk-H7JBY4P7.js.map +1 -0
- package/dist/{chunk-MLPHLJIQ.js → chunk-HS554XAF.js} +2 -2
- package/dist/{chunk-HK67PX4J.js → chunk-HW7CMKUG.js} +1 -1
- package/dist/chunk-HW7CMKUG.js.map +1 -0
- package/dist/{chunk-S57HTZ6X.js → chunk-IMQKWR46.js} +5 -7
- package/dist/chunk-IMQKWR46.js.map +1 -0
- package/dist/{chunk-FCKWQE2H.js → chunk-IUBMZPHM.js} +7 -7
- package/dist/chunk-IUBMZPHM.js.map +1 -0
- package/dist/{chunk-UD5EVGZ7.js → chunk-IUT3GWP3.js} +49 -13
- package/dist/chunk-IUT3GWP3.js.map +1 -0
- package/dist/{chunk-J6UOHJY5.js → chunk-JDEYF3PJ.js} +4 -8
- package/dist/{chunk-J6UOHJY5.js.map → chunk-JDEYF3PJ.js.map} +1 -1
- package/dist/{chunk-NWHBJQAL.js → chunk-JIBUPZHA.js} +4 -4
- package/dist/chunk-JIBUPZHA.js.map +1 -0
- package/dist/{chunk-TROR3ALR.js → chunk-JOSPH3E5.js} +2 -2
- package/dist/{chunk-F24ZZTHQ.js → chunk-JQYKPKG6.js} +4 -4
- package/dist/{chunk-GF5BZ7D4.js → chunk-JSMTXZR3.js} +8 -12
- package/dist/chunk-JSMTXZR3.js.map +1 -0
- package/dist/chunk-JWWYRR4Q.js +12 -0
- package/dist/chunk-JWWYRR4Q.js.map +1 -0
- package/dist/{chunk-HBPPGWUM.js → chunk-KZXDLBY6.js} +14 -9
- package/dist/chunk-KZXDLBY6.js.map +1 -0
- package/dist/{chunk-7VCXZDA4.js → chunk-LIOVX5TJ.js} +7 -11
- package/dist/chunk-LIOVX5TJ.js.map +1 -0
- package/dist/{chunk-QWGU66MP.js → chunk-LNSVGRHO.js} +5 -7
- package/dist/chunk-LNSVGRHO.js.map +1 -0
- package/dist/{chunk-MDWKM2XC.js → chunk-M5B2W6YY.js} +3 -3
- package/dist/{chunk-F2TDU7MQ.js → chunk-MBMTND6D.js} +2 -2
- package/dist/{chunk-K6W7BVZ6.js → chunk-MILI22XQ.js} +3 -3
- package/dist/{chunk-YNIUIERI.js → chunk-MXKI4ABF.js} +18 -59
- package/dist/chunk-MXKI4ABF.js.map +1 -0
- package/dist/{chunk-T2LBQ5DV.js → chunk-MXOQ5JCG.js} +252 -214
- package/dist/chunk-MXOQ5JCG.js.map +1 -0
- package/dist/{chunk-ZXABPVM6.js → chunk-N7EVQD5S.js} +9 -13
- package/dist/chunk-N7EVQD5S.js.map +1 -0
- package/dist/{chunk-CF5UU4S7.js → chunk-N7UDP5VU.js} +7 -7
- package/dist/{chunk-FQ54DWUQ.js → chunk-NBQ3KK6X.js} +4 -4
- package/dist/{chunk-4I522ERM.js → chunk-NCO25JZO.js} +4 -4
- package/dist/chunk-NH2UOV3B.js +18 -0
- package/dist/chunk-NH2UOV3B.js.map +1 -0
- package/dist/{chunk-SI3V7D4G.js → chunk-O2IMQSNA.js} +2 -2
- package/dist/{chunk-T52GX4SA.js → chunk-O46CHQT7.js} +4 -4
- package/dist/chunk-OIEO4WDL.js +27 -0
- package/dist/chunk-OIEO4WDL.js.map +1 -0
- package/dist/{chunk-GHLTDZRS.js → chunk-OKSTSITU.js} +25 -4
- package/dist/chunk-OKSTSITU.js.map +1 -0
- package/dist/{chunk-TOPYQ6GA.js → chunk-OYW3I5M4.js} +6 -6
- package/dist/{chunk-X4773RBR.js → chunk-PD64727P.js} +2 -2
- package/dist/chunk-PD64727P.js.map +1 -0
- package/dist/{chunk-BP6DARYA.js → chunk-PP3K67AJ.js} +4 -4
- package/dist/chunk-PP3K67AJ.js.map +1 -0
- package/dist/chunk-Q2XRFWOI.js +40 -0
- package/dist/chunk-Q2XRFWOI.js.map +1 -0
- package/dist/{chunk-AOWGXU6D.js → chunk-Q4UHJ5SN.js} +2 -2
- package/dist/{chunk-FW22ZCXT.js → chunk-QBLT6POL.js} +2 -2
- package/dist/chunk-QMWY2FDS.js +157 -0
- package/dist/chunk-QMWY2FDS.js.map +1 -0
- package/dist/{chunk-I3JDRCMW.js → chunk-RB4DOPGZ.js} +10 -10
- package/dist/{chunk-32YV3TJT.js → chunk-SMV2HRDU.js} +2 -2
- package/dist/{chunk-ODVPTDPK.js → chunk-SV2PM2OY.js} +1 -1
- package/dist/chunk-SV2PM2OY.js.map +1 -0
- package/dist/{chunk-Z5HTYMMQ.js → chunk-SYNY3VB5.js} +2 -2
- package/dist/{chunk-SYVZW77S.js → chunk-TEHHROZL.js} +6 -8
- package/dist/chunk-TEHHROZL.js.map +1 -0
- package/dist/{chunk-ZSX4S5XB.js → chunk-TKVUE4JF.js} +9 -9
- package/dist/{chunk-B57AFBY2.js → chunk-TZZBXPZK.js} +2 -2
- package/dist/{chunk-VNPEWFPD.js → chunk-U2FZNEWJ.js} +4 -4
- package/dist/chunk-U2FZNEWJ.js.map +1 -0
- package/dist/{chunk-5FDLC6G7.js → chunk-UA372JHH.js} +3 -3
- package/dist/{chunk-PDCG6PR5.js → chunk-UEFOQH74.js} +2 -2
- package/dist/chunk-UEFOQH74.js.map +1 -0
- package/dist/{chunk-HVSCEIYL.js → chunk-UIYESRD6.js} +9 -11
- package/dist/chunk-UIYESRD6.js.map +1 -0
- package/dist/{chunk-B6SJIBQK.js → chunk-V3RWOOSO.js} +4 -4
- package/dist/{chunk-HBRLNOHL.js → chunk-V7ADQF5O.js} +4 -4
- package/dist/{chunk-L7DOS3TE.js → chunk-VAORSCSU.js} +3 -3
- package/dist/chunk-VAORSCSU.js.map +1 -0
- package/dist/{chunk-M522UYZ2.js → chunk-VFHCKG5M.js} +6 -10
- package/dist/chunk-VFHCKG5M.js.map +1 -0
- package/dist/{chunk-DC5QVPV7.js → chunk-VHBKYN2J.js} +3 -3
- package/dist/chunk-VHBKYN2J.js.map +1 -0
- package/dist/{chunk-WX5ADGTZ.js → chunk-VKI2EB3N.js} +3 -3
- package/dist/chunk-VKI2EB3N.js.map +1 -0
- package/dist/{chunk-MTL7MXGR.js → chunk-VMV5SBE4.js} +16 -17
- package/dist/chunk-VMV5SBE4.js.map +1 -0
- package/dist/{chunk-F7XGHL5O.js → chunk-VQDZYB2B.js} +3 -3
- package/dist/{chunk-BK2HHQGN.js → chunk-VVOLDVIR.js} +2 -2
- package/dist/{chunk-6LMQ5R26.js → chunk-WPOYWFSE.js} +7 -7
- package/dist/{chunk-6LMQ5R26.js.map → chunk-WPOYWFSE.js.map} +1 -1
- package/dist/{chunk-3F7GLNAE.js → chunk-WXE4W2U6.js} +7 -11
- package/dist/chunk-WXE4W2U6.js.map +1 -0
- package/dist/{chunk-6K7DPM7D.js → chunk-XQRFSKYM.js} +2 -2
- package/dist/{chunk-M7NI3IWE.js → chunk-XSPFDUDG.js} +22 -50
- package/dist/chunk-XSPFDUDG.js.map +1 -0
- package/dist/{chunk-ID6Z6E66.js → chunk-Y2RKVFKR.js} +2 -2
- package/dist/{chunk-6LNL42F5.js → chunk-Y3LPTBG7.js} +12 -12
- package/dist/chunk-Y3LPTBG7.js.map +1 -0
- package/dist/{chunk-FN5EBVTQ.js → chunk-YRXFFWG4.js} +2 -2
- package/dist/classified/index.js +5 -5
- package/dist/{classified-marker-W3USLL5M.js → classified-marker-SIYKUU5L.js} +3 -3
- package/dist/classified-marker-SIYKUU5L.js.map +1 -0
- package/dist/collection-facade-CS7CA2XO.js +47 -0
- package/dist/{computed-TPFBX7U4.js → computed-FAD7SED4.js} +3 -3
- package/dist/consent/index.js +10 -11
- package/dist/consent/index.js.map +1 -1
- package/dist/cover/index.js +9 -10
- package/dist/custody/index.js +12 -13
- package/dist/{dead-filter-U2UYKSZL.js → dead-filter-4F3LWYKH.js} +11 -3
- package/dist/dead-filter-4F3LWYKH.js.map +1 -0
- package/dist/debug/index.js +11 -2
- package/dist/debug/index.js.map +1 -1
- package/dist/{delegation-S3AEPW2T.js → delegation-NANZDG4N.js} +13 -16
- package/dist/delegation-NANZDG4N.js.map +1 -0
- package/dist/derivations/index.js +23 -24
- package/dist/derive-XLOJVXPU.js +20 -0
- package/dist/directory/index.js +10 -11
- package/dist/{dispatch-3CQDJV5Q.js → dispatch-H4HV32AM.js} +5 -5
- package/dist/{dispatch-RH4LHKBH.js → dispatch-JDZNGEB3.js} +21 -22
- package/dist/dispatch-JDZNGEB3.js.map +1 -0
- package/dist/executor-FMPVN6DT.js +35 -0
- package/dist/executor-LBBBRTN5.js +8 -0
- package/dist/executor-OSRZST2U.js +8 -0
- package/dist/export-accessible-RAOJAAU5.js +22 -0
- package/dist/extract-partition-JD5CUSTG.js +37 -0
- package/dist/{fanout-sidecar-OT6RYLOL.js → fanout-sidecar-L7NHPIOC.js} +13 -15
- package/dist/fanout-sidecar-L7NHPIOC.js.map +1 -0
- package/dist/find-JRN4RNQ5.js +10 -0
- package/dist/forget/index.js +9 -10
- package/dist/forget/index.js.map +1 -1
- package/dist/guards/index.js +4 -4
- package/dist/history/index.js +13 -14
- package/dist/history/index.js.map +1 -1
- package/dist/i18n/index.js +14 -15
- package/dist/i18n/index.js.map +1 -1
- package/dist/index.d.ts +8 -8
- package/dist/index.js +183 -184
- package/dist/index.js.map +1 -1
- package/dist/indexing/index.js +5 -5
- package/dist/introspection/index.js +11 -12
- package/dist/issue-YIVBZUTH.js +19 -0
- package/dist/kernel/attestation-types.d.ts +62 -0
- package/dist/kernel/collection-config.d.ts +1 -48
- package/dist/kernel/collection.d.ts +1 -1
- package/dist/kernel/cutover-transform.d.ts +1 -1
- package/dist/kernel/errors.d.ts +30 -2
- package/dist/kernel/merge-authority.d.ts +1 -1
- package/dist/kernel/paths.d.ts +29 -5
- package/dist/kernel/prepared-write.d.ts +1 -1
- package/dist/kernel/secret-mode.d.ts +1 -1
- package/dist/kernel/types.d.ts +42 -5
- package/dist/kernel/vault.d.ts +2 -2
- package/dist/kernel/write-queue.d.ts +17 -0
- package/dist/{ledger-KZPCMVZY.js → ledger-5ZMGE44K.js} +11 -12
- package/dist/liberate-WZSZM2W6.js +24 -0
- package/dist/link-set-MFXC24VK.js +29 -0
- package/dist/{managed-secret-S3MQ6SH6.js → managed-secret-MFTFT22X.js} +10 -11
- package/dist/materialized-views/index.js +26 -27
- package/dist/{migrate-cek-V7GKJZ7O.js → migrate-cek-DZRFFOHW.js} +2 -2
- package/dist/money/index.js +5 -5
- package/dist/noydb-ITIGNKUF.js +96 -0
- package/dist/overlay-views/index.js +4 -4
- package/dist/periods/index.js +12 -13
- package/dist/pod/index.js +72 -72
- package/dist/{pod-handle-WGDFB4C2.js → pod-handle-A3LET7NO.js} +10 -11
- package/dist/pod-handle-A3LET7NO.js.map +1 -0
- package/dist/policy/index.js +10 -11
- package/dist/port/on/index.d.ts +1 -1
- package/dist/port/to/index.d.ts +1 -1
- package/dist/port/with/blob-strategy.d.ts +1 -1
- package/dist/port/with/classified-strategy.d.ts +1 -1
- package/dist/port/with/collection-options.d.ts +1 -1
- package/dist/port/with/collection-registries.d.ts +1 -1
- package/dist/port/with/lookup-strategy.d.ts +2 -2
- package/dist/portability/index.js +8 -8
- package/dist/{post-register-SLSXIPBV.js → post-register-7ND27CF2.js} +6 -6
- package/dist/post-register-7ND27CF2.js.map +1 -0
- package/dist/query/all/index.js +15 -15
- package/dist/query/index.js +7 -7
- package/dist/query/live/index.js +7 -7
- package/dist/query/reduce/index.js +10 -10
- package/dist/query/relate/index.js +9 -9
- package/dist/reduce/index.js +8 -8
- package/dist/register-DT5HZ2LZ.js +30 -0
- package/dist/registry-BHRZGZHF.js +8 -0
- package/dist/registry-ET6ZFFWA.js +34 -0
- package/dist/registry-HXFGLGTG.js +8 -0
- package/dist/registry-THCPDEOD.js +23 -0
- package/dist/request-withdrawal-AV2MJJKY.js +30 -0
- package/dist/{reveal-4BCKPEC2.js → reveal-B2TLP4JQ.js} +10 -9
- package/dist/reveal-B2TLP4JQ.js.map +1 -0
- package/dist/revoke-6DWIEOCV.js +24 -0
- package/dist/satellites/index.js +1 -1
- package/dist/schema-update/index.js +2 -2
- package/dist/sealed-record/index.js +16 -18
- package/dist/sealed-record/index.js.map +1 -1
- package/dist/search/index.js +4 -4
- package/dist/{seed-4JS2RJ4A.js → seed-XNSE4U3S.js} +15 -18
- package/dist/seed-XNSE4U3S.js.map +1 -0
- package/dist/sequence/index.js +9 -10
- package/dist/session/index.js +9 -10
- package/dist/session/index.js.map +1 -1
- package/dist/shadow/index.js +2 -2
- package/dist/signer-MHGW3OIL.js +23 -0
- package/dist/snapshots/index.js +11 -11
- package/dist/stale-6GCFMOOR.js +28 -0
- package/dist/storage-BYN5LO6Z.js +21 -0
- package/dist/store/index.js +1 -1
- package/dist/{store-coordination-provider-2O2VUHKW.js → store-coordination-provider-C4BPT5XF.js} +11 -12
- package/dist/store-coordination-provider-C4BPT5XF.js.map +1 -0
- package/dist/sync/index.js +10 -11
- package/dist/sync/index.js.map +1 -1
- package/dist/team/index.js +15 -16
- package/dist/tiers/index.js +11 -12
- package/dist/to/index.js +2 -2
- package/dist/transactions/index.js +3 -3
- package/dist/util/index.js +1 -1
- package/dist/vault-head/index.js +11 -14
- package/dist/vault-head/index.js.map +1 -1
- package/dist/{verify-RVT67IMH.js → verify-UKALW7C2.js} +14 -12
- package/dist/verify-UKALW7C2.js.map +1 -0
- package/dist/via/classified/binding.d.ts +2 -2
- package/dist/via/classified/config-drift.d.ts +2 -2
- package/dist/via/classified/errors.d.ts +1 -1
- package/dist/via/lookup/handle.d.ts +4 -4
- package/dist/walk-4VPK7AS4.js +20 -0
- package/dist/with-audit/attestation/index.d.ts +2 -1
- package/dist/with-audit/attestation/issue.d.ts +2 -2
- package/dist/with-audit/attestation/revoke.d.ts +2 -2
- package/dist/with-audit/attestation/scheme.d.ts +7 -0
- package/dist/with-audit/attestation/signer.d.ts +1 -1
- package/dist/with-audit/attestation/strategy.d.ts +2 -2
- package/dist/with-audit/attestation/types.d.ts +10 -0
- package/dist/with-audit/attestation/vault-facade.d.ts +2 -2
- package/dist/with-audit/attestation/verifier.d.ts +6 -0
- package/dist/with-audit/consent/consent.d.ts +1 -1
- package/dist/with-audit/consent/strategy.d.ts +1 -1
- package/dist/with-audit/forget/subject-index.d.ts +1 -1
- package/dist/with-audit/periods/vault-facade.d.ts +1 -1
- package/dist/with-audit/sealed-record/index.d.ts +2 -2
- package/dist/with-audit/sealed-record/strategy.d.ts +1 -1
- package/dist/with-audit/tiers/index.d.ts +2 -2
- package/dist/with-cargo/adopt-partition.d.ts +1 -1
- package/dist/with-cargo/extract-partition.d.ts +1 -1
- package/dist/with-cargo/floor.d.ts +1 -1
- package/dist/with-commit/history/history.d.ts +2 -2
- package/dist/with-commit/history/index.d.ts +1 -1
- package/dist/with-commit/history/ledger/store.d.ts +1 -1
- package/dist/with-commit/history/strategy.d.ts +1 -1
- package/dist/with-commit/history/time-machine.d.ts +1 -1
- package/dist/with-commit/numbering/index.d.ts +1 -1
- package/dist/with-commit/sequence/index.d.ts +1 -1
- package/dist/with-commit/vault-head/head.d.ts +1 -1
- package/dist/with-commit/vault-head/index.d.ts +1 -1
- package/dist/with-commit/vault-head/strategy.d.ts +1 -1
- package/dist/with-commit/vault-head/verify.d.ts +1 -1
- package/dist/with-formula/derivations/dispatch.d.ts +1 -1
- package/dist/with-formula/derivations/fanout-sidecar.d.ts +1 -1
- package/dist/with-lookup/indexing/collection-facade.d.ts +1 -1
- package/dist/with-lookup/search/collection-facade.d.ts +1 -1
- package/dist/with-party/broker/index.d.ts +3 -3
- package/dist/with-party/directory/user-envelope/storage.d.ts +1 -1
- package/dist/with-party/team/delegation.d.ts +1 -1
- package/dist/with-party/team/echo-secret.d.ts +2 -2
- package/dist/with-party/team/index.d.ts +1 -1
- package/dist/with-party/team/keyring.d.ts +1 -1
- package/dist/with-party/team/magic-link-grant.d.ts +1 -1
- package/dist/with-party/team/recovery.d.ts +1 -1
- package/dist/with-party/team/roster-tag.d.ts +1 -1
- package/dist/with-party/team/rotate-recover.d.ts +1 -1
- package/dist/with-party/team/wrapped-deks.d.ts +1 -1
- package/dist/with-pod/index.d.ts +1 -1
- package/dist/with-shape/blobs/blob-compaction.d.ts +1 -1
- package/dist/with-shape/blobs/blob-intent.d.ts +1 -1
- package/dist/with-shape/blobs/blob-set.d.ts +2 -2
- package/dist/with-shape/blobs/legacy-sweep.d.ts +1 -1
- package/dist/with-shape/introspection/describe.d.ts +1 -1
- package/dist/with-shape/introspection/walk.d.ts +1 -1
- package/dist/with-shape/links/lazy-handle.d.ts +1 -1
- package/dist/with-shape/links/link-set.d.ts +1 -1
- package/dist/with-shape/manifest/derive.d.ts +1 -1
- package/dist/with-shape/manifest/storage.d.ts +1 -1
- package/dist/with-shape/persisted-schemas/register.d.ts +1 -1
- package/dist/with-shape/persisted-schemas/storage.d.ts +1 -1
- package/dist/with-shape/satellites/dead-filter.d.ts +1 -1
- package/dist/with-shape/satellites/declare.d.ts +1 -1
- package/dist/with-shape/satellites/marker.d.ts +1 -1
- package/dist/with-shape/satellites/post-register.d.ts +1 -1
- package/dist/with-sync/presence.d.ts +5 -10
- package/dist/withdraw-accessible-HL7GACUE.js +27 -0
- package/dist/withdraw-accessible-HL7GACUE.js.map +1 -0
- package/package.json +14 -5
- package/dist/api-GVYEKSJE.js +0 -19
- package/dist/backup-7TFRVFLH.js.map +0 -1
- package/dist/chunk-244VXYPG.js.map +0 -1
- package/dist/chunk-3ELRMVJK.js.map +0 -1
- package/dist/chunk-3F7GLNAE.js.map +0 -1
- package/dist/chunk-3H5KLDZN.js.map +0 -1
- package/dist/chunk-6B3VNR4P.js.map +0 -1
- package/dist/chunk-6LNL42F5.js.map +0 -1
- package/dist/chunk-6QSQQLSE.js +0 -95
- package/dist/chunk-6QSQQLSE.js.map +0 -1
- package/dist/chunk-7VCXZDA4.js.map +0 -1
- package/dist/chunk-ANWPSTZU.js.map +0 -1
- package/dist/chunk-BP6DARYA.js.map +0 -1
- package/dist/chunk-CKNGS5MH.js.map +0 -1
- package/dist/chunk-DC5QVPV7.js.map +0 -1
- package/dist/chunk-DE4DH2RZ.js +0 -29
- package/dist/chunk-DE4DH2RZ.js.map +0 -1
- package/dist/chunk-DF73H4UN.js.map +0 -1
- package/dist/chunk-EIPVYUEP.js.map +0 -1
- package/dist/chunk-ENAG3IY7.js.map +0 -1
- package/dist/chunk-FCKWQE2H.js.map +0 -1
- package/dist/chunk-FQ5VRHIB.js.map +0 -1
- package/dist/chunk-GF5BZ7D4.js.map +0 -1
- package/dist/chunk-GHLTDZRS.js.map +0 -1
- package/dist/chunk-GYGLAVCX.js.map +0 -1
- package/dist/chunk-HBPPGWUM.js.map +0 -1
- package/dist/chunk-HK67PX4J.js.map +0 -1
- package/dist/chunk-HVSCEIYL.js.map +0 -1
- package/dist/chunk-ISZQJBML.js.map +0 -1
- package/dist/chunk-KJFW62P4.js.map +0 -1
- package/dist/chunk-L7DOS3TE.js.map +0 -1
- package/dist/chunk-LGRLME4M.js.map +0 -1
- package/dist/chunk-LP7BEXCT.js +0 -32
- package/dist/chunk-LP7BEXCT.js.map +0 -1
- package/dist/chunk-LQ4ZHOKP.js.map +0 -1
- package/dist/chunk-M522UYZ2.js.map +0 -1
- package/dist/chunk-M7NI3IWE.js.map +0 -1
- package/dist/chunk-MTL7MXGR.js.map +0 -1
- package/dist/chunk-N5DNADLQ.js.map +0 -1
- package/dist/chunk-NNARWO72.js.map +0 -1
- package/dist/chunk-NRT6QZQB.js.map +0 -1
- package/dist/chunk-NWHBJQAL.js.map +0 -1
- package/dist/chunk-ODVPTDPK.js.map +0 -1
- package/dist/chunk-PDCG6PR5.js.map +0 -1
- package/dist/chunk-PEOZ34EM.js.map +0 -1
- package/dist/chunk-PSIV7CJV.js.map +0 -1
- package/dist/chunk-QOOUUR4A.js.map +0 -1
- package/dist/chunk-QWFHIOD2.js.map +0 -1
- package/dist/chunk-QWGU66MP.js.map +0 -1
- package/dist/chunk-S57HTZ6X.js.map +0 -1
- package/dist/chunk-SEE332EV.js +0 -66
- package/dist/chunk-SEE332EV.js.map +0 -1
- package/dist/chunk-SYVZW77S.js.map +0 -1
- package/dist/chunk-T2LBQ5DV.js.map +0 -1
- package/dist/chunk-UD5EVGZ7.js.map +0 -1
- package/dist/chunk-UPD5NWI5.js.map +0 -1
- package/dist/chunk-UYB234ZR.js +0 -479
- package/dist/chunk-UYB234ZR.js.map +0 -1
- package/dist/chunk-VNPEWFPD.js.map +0 -1
- package/dist/chunk-WX5ADGTZ.js.map +0 -1
- package/dist/chunk-X4773RBR.js.map +0 -1
- package/dist/chunk-YNIUIERI.js.map +0 -1
- package/dist/chunk-ZE4CHIED.js.map +0 -1
- package/dist/chunk-ZXABPVM6.js.map +0 -1
- package/dist/classified-marker-W3USLL5M.js.map +0 -1
- package/dist/collection-facade-QU6IJBN3.js +0 -48
- package/dist/dead-filter-U2UYKSZL.js.map +0 -1
- package/dist/delegation-S3AEPW2T.js.map +0 -1
- package/dist/derive-OX7F6TGG.js +0 -21
- package/dist/dispatch-RH4LHKBH.js.map +0 -1
- package/dist/executor-B6SRO2QS.js +0 -36
- package/dist/executor-BI5CHWRY.js +0 -8
- package/dist/executor-RBKM5W5K.js +0 -8
- package/dist/export-accessible-VMA3YM5V.js +0 -22
- package/dist/extract-partition-NF7PXGPP.js +0 -37
- package/dist/fanout-sidecar-OT6RYLOL.js.map +0 -1
- package/dist/find-LZMP26KF.js +0 -10
- package/dist/issue-IHARXWW5.js +0 -18
- package/dist/kernel/enclave/classify/compare.d.ts +0 -10
- package/dist/kernel/enclave/index.d.ts +0 -87
- package/dist/kernel/enclave/record-keys/lifecycle.d.ts +0 -124
- package/dist/kernel/enclave/record-keys/rekey-blob.d.ts +0 -88
- package/dist/kernel/enclave/record-keys/rekey.d.ts +0 -91
- package/dist/kernel/enclave/record-keys/sealed-slot.d.ts +0 -14
- package/dist/kernel/enclave/record-keys/sealed-slots.d.ts +0 -123
- package/dist/kernel/enclave/record-keys/sealing.d.ts +0 -70
- package/dist/liberate-GRLCZMW4.js +0 -24
- package/dist/link-set-JCMJ7ULP.js +0 -30
- package/dist/noydb-SWQJ3MZS.js +0 -97
- package/dist/pod-handle-WGDFB4C2.js.map +0 -1
- package/dist/post-register-SLSXIPBV.js.map +0 -1
- package/dist/register-F3OYE7MJ.js +0 -31
- package/dist/registry-CILQFXFK.js +0 -8
- package/dist/registry-XNNYQVKV.js +0 -8
- package/dist/registry-YCDZV3VW.js +0 -35
- package/dist/registry-ZGYS33TE.js +0 -24
- package/dist/request-withdrawal-Z5NC6TXT.js +0 -30
- package/dist/reveal-4BCKPEC2.js.map +0 -1
- package/dist/revoke-ZL62WC2D.js +0 -23
- package/dist/seed-4JS2RJ4A.js.map +0 -1
- package/dist/signer-MBZZMXTC.js +0 -24
- package/dist/stale-TJ3DYZMQ.js +0 -29
- package/dist/storage-SVMKRGCW.js +0 -22
- package/dist/store-coordination-provider-2O2VUHKW.js.map +0 -1
- package/dist/verify-RVT67IMH.js.map +0 -1
- package/dist/walk-HJ42EISE.js +0 -21
- package/dist/withdraw-accessible-5NZUPAVA.js +0 -27
- /package/dist/{api-GVYEKSJE.js.map → api-OS747DS4.js.map} +0 -0
- /package/dist/{computed-TPFBX7U4.js.map → capsule/contract.js.map} +0 -0
- /package/dist/{kernel/enclave → capsule/enclave-aes}/broker/proof.d.ts +0 -0
- /package/dist/{kernel/enclave → capsule/enclave-aes}/classify/bidx.d.ts +0 -0
- /package/dist/{kernel/enclave → capsule/enclave-aes}/classify/digest.d.ts +0 -0
- /package/dist/{kernel/enclave → capsule/enclave-aes}/classify/vdig.d.ts +0 -0
- /package/dist/{kernel/enclave/classify → capsule/plumbing}/kofn.d.ts +0 -0
- /package/dist/{kernel/enclave/classify → capsule/plumbing}/normalize.d.ts +0 -0
- /package/dist/{kernel/enclave → capsule/plumbing}/record-aad.d.ts +0 -0
- /package/dist/{collection-facade-QU6IJBN3.js.map → capsule-VOLX3QRQ.js.map} +0 -0
- /package/dist/{chunk-YSK2CU2Q.js.map → chunk-2AFX33YA.js.map} +0 -0
- /package/dist/{chunk-TKUOEU2F.js.map → chunk-2GHDLTPE.js.map} +0 -0
- /package/dist/{chunk-6OWXYZK2.js.map → chunk-2ODVB6LZ.js.map} +0 -0
- /package/dist/{chunk-X25NWUZB.js.map → chunk-2PVXF5CS.js.map} +0 -0
- /package/dist/{chunk-ORDURZBU.js.map → chunk-3EWS67C7.js.map} +0 -0
- /package/dist/{chunk-FXQBGFOX.js.map → chunk-4CIQDWRB.js.map} +0 -0
- /package/dist/{chunk-HT2AHGQI.js.map → chunk-4JPMZTJY.js.map} +0 -0
- /package/dist/{chunk-MKXXMNJH.js.map → chunk-4V3Q35WG.js.map} +0 -0
- /package/dist/{chunk-A6IJU4TK.js.map → chunk-52MGURXO.js.map} +0 -0
- /package/dist/{chunk-HLEK5VAN.js.map → chunk-5WWDGFOS.js.map} +0 -0
- /package/dist/{chunk-SOIQ4MM4.js.map → chunk-7XMHMVTS.js.map} +0 -0
- /package/dist/{chunk-4MXI3ODD.js.map → chunk-AEQGFRU4.js.map} +0 -0
- /package/dist/{chunk-7JE7BDYJ.js.map → chunk-AL6ML4LA.js.map} +0 -0
- /package/dist/{chunk-ZUVBC32X.js.map → chunk-AUKKUPVB.js.map} +0 -0
- /package/dist/{chunk-WY2XXTET.js.map → chunk-BPWYQ25R.js.map} +0 -0
- /package/dist/{chunk-EOVMT6TB.js.map → chunk-BVCUTXE3.js.map} +0 -0
- /package/dist/{chunk-3JWHAR6E.js.map → chunk-DIZLQVAA.js.map} +0 -0
- /package/dist/{chunk-IT22PWKV.js.map → chunk-E2N2T5ZO.js.map} +0 -0
- /package/dist/{chunk-WNJ4AVGE.js.map → chunk-EJLV62NI.js.map} +0 -0
- /package/dist/{chunk-QBBUZ3I3.js.map → chunk-EYG2CY2X.js.map} +0 -0
- /package/dist/{chunk-BJ2IXQ5Q.js.map → chunk-FFJFE4T7.js.map} +0 -0
- /package/dist/{chunk-JCN44NCY.js.map → chunk-FLPCETP6.js.map} +0 -0
- /package/dist/{chunk-5O7D6ZTW.js.map → chunk-FOEDQATO.js.map} +0 -0
- /package/dist/{chunk-VNNRUGMM.js.map → chunk-FVH5QYY2.js.map} +0 -0
- /package/dist/{chunk-4AF3TUMP.js.map → chunk-GZT3NQRA.js.map} +0 -0
- /package/dist/{chunk-MVZ2TPVP.js.map → chunk-H427H63K.js.map} +0 -0
- /package/dist/{chunk-MLPHLJIQ.js.map → chunk-HS554XAF.js.map} +0 -0
- /package/dist/{chunk-TROR3ALR.js.map → chunk-JOSPH3E5.js.map} +0 -0
- /package/dist/{chunk-F24ZZTHQ.js.map → chunk-JQYKPKG6.js.map} +0 -0
- /package/dist/{chunk-MDWKM2XC.js.map → chunk-M5B2W6YY.js.map} +0 -0
- /package/dist/{chunk-F2TDU7MQ.js.map → chunk-MBMTND6D.js.map} +0 -0
- /package/dist/{chunk-K6W7BVZ6.js.map → chunk-MILI22XQ.js.map} +0 -0
- /package/dist/{chunk-CF5UU4S7.js.map → chunk-N7UDP5VU.js.map} +0 -0
- /package/dist/{chunk-FQ54DWUQ.js.map → chunk-NBQ3KK6X.js.map} +0 -0
- /package/dist/{chunk-4I522ERM.js.map → chunk-NCO25JZO.js.map} +0 -0
- /package/dist/{chunk-SI3V7D4G.js.map → chunk-O2IMQSNA.js.map} +0 -0
- /package/dist/{chunk-T52GX4SA.js.map → chunk-O46CHQT7.js.map} +0 -0
- /package/dist/{chunk-TOPYQ6GA.js.map → chunk-OYW3I5M4.js.map} +0 -0
- /package/dist/{chunk-AOWGXU6D.js.map → chunk-Q4UHJ5SN.js.map} +0 -0
- /package/dist/{chunk-FW22ZCXT.js.map → chunk-QBLT6POL.js.map} +0 -0
- /package/dist/{chunk-I3JDRCMW.js.map → chunk-RB4DOPGZ.js.map} +0 -0
- /package/dist/{chunk-32YV3TJT.js.map → chunk-SMV2HRDU.js.map} +0 -0
- /package/dist/{chunk-Z5HTYMMQ.js.map → chunk-SYNY3VB5.js.map} +0 -0
- /package/dist/{chunk-ZSX4S5XB.js.map → chunk-TKVUE4JF.js.map} +0 -0
- /package/dist/{chunk-B57AFBY2.js.map → chunk-TZZBXPZK.js.map} +0 -0
- /package/dist/{chunk-5FDLC6G7.js.map → chunk-UA372JHH.js.map} +0 -0
- /package/dist/{chunk-B6SJIBQK.js.map → chunk-V3RWOOSO.js.map} +0 -0
- /package/dist/{chunk-HBRLNOHL.js.map → chunk-V7ADQF5O.js.map} +0 -0
- /package/dist/{chunk-F7XGHL5O.js.map → chunk-VQDZYB2B.js.map} +0 -0
- /package/dist/{chunk-BK2HHQGN.js.map → chunk-VVOLDVIR.js.map} +0 -0
- /package/dist/{chunk-6K7DPM7D.js.map → chunk-XQRFSKYM.js.map} +0 -0
- /package/dist/{chunk-ID6Z6E66.js.map → chunk-Y2RKVFKR.js.map} +0 -0
- /package/dist/{chunk-FN5EBVTQ.js.map → chunk-YRXFFWG4.js.map} +0 -0
- /package/dist/{derive-OX7F6TGG.js.map → collection-facade-CS7CA2XO.js.map} +0 -0
- /package/dist/{enclave-27SMF6GF.js.map → computed-FAD7SED4.js.map} +0 -0
- /package/dist/{executor-B6SRO2QS.js.map → derive-XLOJVXPU.js.map} +0 -0
- /package/dist/{dispatch-3CQDJV5Q.js.map → dispatch-H4HV32AM.js.map} +0 -0
- /package/dist/{executor-BI5CHWRY.js.map → executor-FMPVN6DT.js.map} +0 -0
- /package/dist/{executor-RBKM5W5K.js.map → executor-LBBBRTN5.js.map} +0 -0
- /package/dist/{export-accessible-VMA3YM5V.js.map → executor-OSRZST2U.js.map} +0 -0
- /package/dist/{extract-partition-NF7PXGPP.js.map → export-accessible-RAOJAAU5.js.map} +0 -0
- /package/dist/{find-LZMP26KF.js.map → extract-partition-JD5CUSTG.js.map} +0 -0
- /package/dist/{issue-IHARXWW5.js.map → find-JRN4RNQ5.js.map} +0 -0
- /package/dist/{ledger-KZPCMVZY.js.map → issue-YIVBZUTH.js.map} +0 -0
- /package/dist/{liberate-GRLCZMW4.js.map → ledger-5ZMGE44K.js.map} +0 -0
- /package/dist/{link-set-JCMJ7ULP.js.map → liberate-WZSZM2W6.js.map} +0 -0
- /package/dist/{managed-secret-S3MQ6SH6.js.map → link-set-MFXC24VK.js.map} +0 -0
- /package/dist/{noydb-SWQJ3MZS.js.map → managed-secret-MFTFT22X.js.map} +0 -0
- /package/dist/{migrate-cek-V7GKJZ7O.js.map → migrate-cek-DZRFFOHW.js.map} +0 -0
- /package/dist/{register-F3OYE7MJ.js.map → noydb-ITIGNKUF.js.map} +0 -0
- /package/dist/{registry-CILQFXFK.js.map → register-DT5HZ2LZ.js.map} +0 -0
- /package/dist/{registry-XNNYQVKV.js.map → registry-BHRZGZHF.js.map} +0 -0
- /package/dist/{registry-YCDZV3VW.js.map → registry-ET6ZFFWA.js.map} +0 -0
- /package/dist/{registry-ZGYS33TE.js.map → registry-HXFGLGTG.js.map} +0 -0
- /package/dist/{request-withdrawal-Z5NC6TXT.js.map → registry-THCPDEOD.js.map} +0 -0
- /package/dist/{revoke-ZL62WC2D.js.map → request-withdrawal-AV2MJJKY.js.map} +0 -0
- /package/dist/{signer-MBZZMXTC.js.map → revoke-6DWIEOCV.js.map} +0 -0
- /package/dist/{stale-TJ3DYZMQ.js.map → signer-MHGW3OIL.js.map} +0 -0
- /package/dist/{storage-SVMKRGCW.js.map → stale-6GCFMOOR.js.map} +0 -0
- /package/dist/{walk-HJ42EISE.js.map → storage-BYN5LO6Z.js.map} +0 -0
- /package/dist/{withdraw-accessible-5NZUPAVA.js.map → walk-4VPK7AS4.js.map} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,55 @@
|
|
|
1
1
|
# Changelog — hub
|
|
2
2
|
|
|
3
|
+
## 0.8.0
|
|
4
|
+
|
|
5
|
+
**The capsule seam** (#4). Hub's crypto interior is now one contract behind one door, and an application can replace it at build time without forking hub.
|
|
6
|
+
|
|
7
|
+
`enclave-aes` — PBKDF2 → AES-KW → AES-256-GCM, exactly what shipped before — stays inside hub and remains the default, so `npm install @noy-db/hub` is unchanged and needs no configuration. An alternative binds through hub's `imports` map with a build condition (`resolve.conditions` in Vite/esbuild/webpack, `--conditions` for Node). Deliberately not a runtime option: a `createNoydb({ capsule })` switch would be a hot-swap surface, whereas a build condition lives in build config and `npm ls` tells an auditor which capsule a build actually contains.
|
|
8
|
+
|
|
9
|
+
`@noy-db/hub/capsule` is the published contract — `CapsuleKey`, `CapsuleGroup`, `CapsulePrimitives`, `capabilities()`, `makeCapsule()`, and `CapsuleNotSupportedError`. A service that needs a capability asserts it at `createNoydb()` and refuses there by name, never on first write: a capability discovered mid-write is a half-built vault.
|
|
10
|
+
|
|
11
|
+
Three things made this real rather than nominal. Every `crypto.subtle` call outside the capsule is gone — 38 of them across 10 files — and the ratchet that tracked them is now a flat ban, so hub ships with no runtime dependencies at all. The shared envelope machinery (~3,000 lines of AAD construction, tombstones, sealed slots, the record codec, rekeying) lives once and is bound to a capsule's 15 primitives by `makeCapsule()`, so two capsules cannot drift into writing rows the other cannot read. And `@noy-db/test-capsule-conformance` is the suite both implementations run, asserting the `enclave-`/`exclave-` prefix rule **from the package name** — which is what makes the prefix a trust posture rather than a naming convention.
|
|
12
|
+
|
|
13
|
+
`@noy-db/exclave-plain` is the first alternative: a plaintext capsule for the case the seam was built for — a table whose rows other tools read and write, where access control already lives in IAM.
|
|
14
|
+
|
|
15
|
+
⛔ **It turns off encryption.** Rows are stored readable; noy-db stops being zero-knowledge and the security boundary moves out of the library and into your store. Its `_mac` integrity stamp detects corruption, foreign writes, and rows moved between collections — it is **not** a defence against a malicious store, because there is no secret in exclave mode and anyone who can write a row can compute a valid stamp for it. Read its README before installing it.
|
|
16
|
+
|
|
17
|
+
**`EncryptedEnvelope` is now `Envelope`, with `_iv`/`_data` optional** (#15). The old name remains an exact alias for the whole 0.8 line, and both are exported from the root barrel and from `@noy-db/hub/to`.
|
|
18
|
+
|
|
19
|
+
⚠️ **If you are already on `0.8.0-pre.0`, this reaches you as a breaking change.** That release declared `readonly _data: string` and exported no `Envelope`. Code that reads `envelope._data` as a `string` now sees `string | undefined` and stops compiling. There is no runtime behaviour change and no wire-format change — `NOYDB_FORMAT_VERSION` does not move and every envelope already written reads back identically — but the type genuinely narrowed under you, and a type error with no explanation is a poor way to learn that.
|
|
20
|
+
|
|
21
|
+
The fields are optional because an **exclave** capsule stores a plaintext row and has no ciphertext body at all. Absence and `''` mean the same thing: no sealed body. That equivalence is not new — a tombstone, a `_del` marker and a plaintext collection have carried `_iv: ''` since the format's first version, and `hasSealedBody()` has always been the question to ask. Widening only lets a capsule omit the keys instead of emptying them.
|
|
22
|
+
|
|
23
|
+
`EncryptedEnvelope` is an **alias, not a narrower subtype**. Declaring it as body-required was considered and rejected: every existing reader would have kept compiling untouched, which is precisely the bug — a store handing back an exclave row would then fail at runtime in code the compiler had just declared safe.
|
|
24
|
+
|
|
25
|
+
If you implement `NoydbStore`, nothing is required of you: a store that honours "dumb ciphertext store" never reads these fields for meaning. If you *do* read them, treat absent exactly as empty.
|
|
26
|
+
|
|
27
|
+
**A declaration that cannot resolve is now refused at registration, instead of silently doing nothing** (#19, #25).
|
|
28
|
+
|
|
29
|
+
⛔ **The security fix first.** `classifiedFields` accepted a **dotted path** — `classifiedFields: { 'account.password': spec }` — and sealed nothing. Registration succeeded, the write succeeded, and the secret came back **in full plaintext** from `get()` and `list()`. The only signal was `reveal()` throwing, which a developer who believes the field is sealed has no reason to call, because they can already read the value.
|
|
30
|
+
|
|
31
|
+
So "misconfigured" and "not classified at all" were observationally identical while the developer's belief was that the secret was protected. Nested paths are not supported by `classifiedFields` and a dotted key is now a `ClassifiedConfigError` naming the workaround (promote the field to the top level). **If you declared a nested classified field, values written under it are plaintext at rest and this fix does not reach them** — treat them as exposed and rotate.
|
|
32
|
+
|
|
33
|
+
Found and reported by a consumer while validating a design, before shipping.
|
|
34
|
+
|
|
35
|
+
Two further guards close the same class:
|
|
36
|
+
|
|
37
|
+
- **A malformed field path is refused.** `i18nFields` and `lookupFields` resolve nested paths through a helper that validates nothing — by design, since "nothing is at this path" is a legitimate answer for an optional field. The consequence was that `'contacts[.name'` was indistinguishable from an absent value: the declaration did nothing, forever. Measured: an `i18nFields` declaration with `required: 'all'` and a malformed path accepted a record missing every required language, while the same spec on a well-formed path refused it. The guarantee was not weakened — it was never installed.
|
|
38
|
+
- **An `i18nFields` declaration naming a field the collection does not have is refused** when the schema is readable. `titel` for `title` is valid syntax and equally inert.
|
|
39
|
+
|
|
40
|
+
Both stay **silent when they cannot know**: a schema-less or TS-generic collection has real fields that simply are not enumerable, and refusing them would break working collections to fix a silent one. `lookupFields` is deliberately exempt from the existence check — its keys *declare* fields rather than referencing them.
|
|
41
|
+
|
|
42
|
+
`moneyFields` already guarded its own grammar and explained why in its header. These are the same lesson reaching the families next door.
|
|
43
|
+
|
|
44
|
+
**Two correctness fixes on the write path.**
|
|
45
|
+
|
|
46
|
+
`writeQueue.pending` now covers the **pre-write gate phase** (#11). A write waits on the schema-update gate and the schema fence before it reaches the store, and that window was outside the queue's accounting — so `pending` read `0` and `onFlush()` resolved while a write was still in flight, gated but not yet committed. A caller using `onFlush()` to know "everything is written" could act on a vault that was not yet consistent. The queue now brackets the gate phase too, and a write refused by a gate — before it commits — still settles the queue without reporting a spurious error, because a refusal at the gate is a legitimate outcome rather than a failure to flush.
|
|
47
|
+
|
|
48
|
+
**Pod flush retries now re-encode at the version they observed** (#12). On a conflict, the retry loop re-fetched the remote pod and merged, but the encoded bytes and the expected version were computed **once, before the loop** — so every retry re-sent the *original* bytes against the *original* version. The merge was performed and then discarded, and the retry could only fail the same way or, worse, overwrite the concurrent write it had just merged with. Encoding now happens inside the loop, so a retry sends the merged bytes at the version it actually read.
|
|
49
|
+
|
|
50
|
+
The regression test records that the interleaving is load-bearing: it requires the remote to move between the read and the write, because a naively ordered test passes against the broken code.
|
|
51
|
+
|
|
52
|
+
|
|
3
53
|
## 0.8.0-pre.0
|
|
4
54
|
|
|
5
55
|
Relicensed from MIT to Apache-2.0 from this version on. Earlier versions remain MIT.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import {
|
|
2
|
+
UserApi,
|
|
3
|
+
createUserApi
|
|
4
|
+
} from "./chunk-AEQGFRU4.js";
|
|
5
|
+
import "./chunk-LIOVX5TJ.js";
|
|
6
|
+
import "./chunk-EZGV6F47.js";
|
|
7
|
+
import "./chunk-OIEO4WDL.js";
|
|
8
|
+
import "./chunk-Q2XRFWOI.js";
|
|
9
|
+
import "./chunk-NH2UOV3B.js";
|
|
10
|
+
import "./chunk-42ALPZ2B.js";
|
|
11
|
+
import "./chunk-QMWY2FDS.js";
|
|
12
|
+
import "./chunk-SV2PM2OY.js";
|
|
13
|
+
import "./chunk-37EPTBBR.js";
|
|
14
|
+
export {
|
|
15
|
+
UserApi,
|
|
16
|
+
createUserApi
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=api-OS747DS4.js.map
|
package/dist/as/index.js
CHANGED
|
@@ -1,24 +1,23 @@
|
|
|
1
1
|
import "../chunk-UBSFPGVJ.js";
|
|
2
|
-
import "../chunk-
|
|
2
|
+
import "../chunk-PP3K67AJ.js";
|
|
3
3
|
import {
|
|
4
4
|
applyListProjection
|
|
5
5
|
} from "../chunk-VG2ZSFYD.js";
|
|
6
6
|
import "../chunk-RXLYKVTF.js";
|
|
7
7
|
import "../chunk-VYYM3MEN.js";
|
|
8
|
-
import "../chunk-
|
|
8
|
+
import "../chunk-747G6CT3.js";
|
|
9
9
|
import "../chunk-Y2NBBT6K.js";
|
|
10
|
-
import "../chunk-
|
|
11
|
-
import "../chunk-
|
|
12
|
-
import "../chunk-
|
|
13
|
-
import "../chunk-
|
|
14
|
-
import "../chunk-
|
|
15
|
-
import "../chunk-
|
|
16
|
-
import "../chunk-
|
|
17
|
-
import "../chunk-
|
|
18
|
-
import "../chunk-ODVPTDPK.js";
|
|
10
|
+
import "../chunk-3L2NBKDR.js";
|
|
11
|
+
import "../chunk-EZGV6F47.js";
|
|
12
|
+
import "../chunk-OIEO4WDL.js";
|
|
13
|
+
import "../chunk-Q2XRFWOI.js";
|
|
14
|
+
import "../chunk-NH2UOV3B.js";
|
|
15
|
+
import "../chunk-42ALPZ2B.js";
|
|
16
|
+
import "../chunk-QMWY2FDS.js";
|
|
17
|
+
import "../chunk-SV2PM2OY.js";
|
|
19
18
|
import {
|
|
20
19
|
ValidationError
|
|
21
|
-
} from "../chunk-
|
|
20
|
+
} from "../chunk-37EPTBBR.js";
|
|
22
21
|
|
|
23
22
|
// src/port/as/active.ts
|
|
24
23
|
function redactChunk(chunk, ctx, redact) {
|
package/dist/as/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/port/as/active.ts"],"sourcesContent":["/**\n * `withFormats()` — the service that consumes the `as-*` port.\n *\n * Everything with a correctness or security consequence lives here rather\n * than in each format: the capability gate, the vault read, and redaction.\n * A {@link NoydbFormat} receives records and returns bytes.\n *\n * That is the whole point of the inversion (ADR 0004). The conformance kit it\n * replaces could only check implementors who ran it; a format that cannot\n * reach a vault is gated whether its author cooperated or not.\n *\n * @module\n */\nimport type { NoydbFormat, ImportPlan } from './types.js'\nimport type {\n FormatsStrategy,\n FormatsContext,\n FormatExportOptions,\n FormatImportOptions,\n} from '../with/formats-strategy.js'\nimport type { ExportChunk } from '../../kernel/types.js'\nimport type { Vault } from '../../kernel/vault.js'\nimport type { ImportPolicy } from './types.js'\nimport { applyListProjection } from '../../with-shape/introspection/index.js'\nimport type { CollectionDescription, ListProjectionOptions } from '../../with-shape/introspection/index.js'\nimport { ValidationError } from '../../kernel/errors.js'\n\n/** Apply the redaction projection hub owns, so a format never asks for it. */\nfunction redactChunk(\n chunk: ExportChunk,\n ctx: FormatsContext,\n redact: FormatExportOptions['redact'],\n): ExportChunk {\n if (redact === undefined) return chunk\n const described = ctx.describe(chunk.collection) as CollectionDescription | undefined\n if (!described) {\n throw new Error(\n `vault.export: redaction was requested but '${chunk.collection}' has no description to redact against. ` +\n 'Open the collection with its classifiedFields / fieldMeta options first.',\n )\n }\n const opts: ListProjectionOptions | undefined =\n redact === true ? undefined : { sensitivity: redact.sensitivity as never }\n const records = chunk.records.map((r) =>\n applyListProjection(described, r as Record<string, unknown>, opts),\n )\n return { ...chunk, records: records as typeof chunk.records }\n}\n\n/**\n * Derive the narrow, format-facing capability from the vault.\n *\n * Lives here rather than on `Vault` because `kernel-surface` said so, and it\n * was right: this is service capability, not spine. The spine keeps two\n * delegating methods and nothing else.\n */\nfunction contextFor(vault: Vault): FormatsContext {\n return {\n // The empty-id guards are NOT defensive padding. The\n // plaintext tier is gated per-format, so a missing id means the calling\n // binding is broken — and without this it would reach the gate, miss the\n // allowlist, and surface as `ExportCapabilityError`: \"the owner did not\n // grant this\", which sends the reader to the keyring instead of to the\n // format. A loud TypeError names the real fault.\n assertCanExport: (tier, format) => {\n if (tier === 'bundle') return vault.assertCanExport('bundle')\n if (!format) throw new TypeError(\"assertCanExport('plaintext') requires a non-empty format id\")\n vault.assertCanExport('plaintext', format)\n },\n assertCanImport: (tier, format) => {\n if (tier === 'bundle') return vault.assertCanImport('bundle')\n if (!format) throw new TypeError(\"assertCanImport('plaintext') requires a non-empty format id\")\n vault.assertCanImport('plaintext', format)\n },\n // ⚠️ Filtered HERE, not passed to exportStream — `ExportStreamOptions`\n // has no `collections` field, so the option I first passed was silently\n // dropped and hub read every collection. Caught by an as-json test\n // expecting ['invoices'] and getting ['invoices','payments'].\n //\n // Post-read filtering is correct but not free: hub still DECRYPTS the\n // collections the caller excluded. Pushing the filter down into\n // exportStream is the real fix and is a hub change beyond this port.\n chunks: async function* (collections) {\n const wanted = collections ? new Set(collections) : null\n for await (const chunk of vault.exportStream({ granularity: 'collection' })) {\n if (wanted && !wanted.has(chunk.collection)) continue\n yield chunk\n }\n },\n // NOT swallowed. A caller who asked for redaction and silently got\n // unredacted output is the exact failure this port exists to remove — a\n // security duty that fails quiet. If the description cannot be read, the\n // export fails instead.\n describe: (collection) => vault.collection(collection).describe() as never,\n plan: async (records, policy: ImportPolicy, formatId: string, idKey?: string) => {\n const { diffVault } = await import('../../with-cargo/vault-diff.js')\n const plan = await diffVault(vault, records as never, idKey ? { idKey } : {})\n return {\n plan,\n policy,\n // The apply walk every as-* package had independently: added always,\n // modified unless insert-only, deleted only on replace — in one\n // transaction so a partial failure rolls back. Owned once, here.\n apply: async () => {\n await vault.noydb.transaction((tx) => {\n const txVault = tx.vault(vault.name)\n const reason = `import:${formatId}`\n for (const e of plan.added) {\n txVault.collection(e.collection).put(e.id, e.record as never, { reason })\n }\n if (policy !== 'insert-only') {\n for (const e of plan.modified) {\n txVault.collection(e.collection).put(e.id, e.record as never, { reason })\n }\n }\n if (policy === 'replace') {\n for (const e of plan.deleted) txVault.collection(e.collection).delete(e.id)\n }\n })\n },\n }\n },\n }\n}\n\n/**\n * Enable `vault.export()` / `vault.import()`.\n *\n * ```ts\n * const db = await createNoydb({ store, user, secret, formatsStrategy: withFormats() })\n * const csv = await vault.export(asCsv(), { collections: ['invoices'] })\n * ```\n */\nexport function withFormats(): FormatsStrategy {\n return {\n enabled: true,\n\n async exportWith<Out extends string | Uint8Array>(\n vault: Vault,\n format: NoydbFormat<Out>,\n options: FormatExportOptions = {},\n ): Promise<Out> {\n const ctx = contextFor(vault)\n // FIRST, and before a single record is read. The format is not in scope\n // yet and could not reach the vault if it were.\n if (format.tier === 'bundle') ctx.assertCanExport('bundle')\n else ctx.assertCanExport('plaintext', format.id)\n\n const chunks: ExportChunk[] = []\n for await (const chunk of ctx.chunks(options.collections)) {\n chunks.push(redactChunk(chunk, ctx, options.redact))\n }\n return format.encode(chunks)\n },\n\n async importWith<Out extends string | Uint8Array>(\n vault: Vault,\n format: NoydbFormat<Out>,\n input: Out,\n options: FormatImportOptions = {},\n ): Promise<ImportPlan> {\n const ctx = contextFor(vault)\n // Mirrors the export side: the import gate is two-tier as well, and a\n // bundle format importing under the plaintext tier would be a silent\n // downgrade in the other direction.\n if (format.tier === 'bundle') ctx.assertCanImport('bundle')\n else ctx.assertCanImport('plaintext', format.id)\n if (!format.decode) {\n throw new ValidationError(\n `vault.import: the '${format.id}' format is export-only — it declares no decode(). ` +\n 'Pick a format that round-trips, or write the records directly.',\n )\n }\n const decoded = await format.decode(input)\n const candidate: Record<string, readonly unknown[]> = {}\n for (const chunk of decoded) {\n const target = chunk.collection || options.collection\n if (!target) {\n throw new ValidationError(\n `vault.import: the '${format.id}' input names no collection and none was supplied. ` +\n 'Pass { collection } for formats whose payload is collection-less.',\n )\n }\n candidate[target] = [...(candidate[target] ?? []), ...chunk.records]\n }\n return ctx.plan(candidate, options.policy ?? 'merge', format.id, options.idKey)\n },\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AA4BA,SAAS,YACP,OACA,KACA,QACa;AACb,MAAI,WAAW,OAAW,QAAO;AACjC,QAAM,YAAY,IAAI,SAAS,MAAM,UAAU;AAC/C,MAAI,CAAC,WAAW;AACd,UAAM,I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,SAAS,SAAU,KAAI,gBAAgB,QAAQ;AAAA,UACrD,KAAI,gBAAgB,aAAa,OAAO,EAAE;AAC/C,UAAI,CAAC,OAAO,QAAQ;AAClB,cAAM,IAAI;AAAA,UACR,sBAAsB,OAAO,EAAE;AAAA,QAEjC;AAAA,MACF;AACA,YAAM,UAAU,MAAM,OAAO,OAAO,KAAK;AACzC,YAAM,YAAgD,CAAC;AACvD,iBAAW,SAAS,SAAS;AAC3B,cAAM,SAAS,MAAM,cAAc,QAAQ;AAC3C,YAAI,CAAC,QAAQ;AACX,gBAAM,IAAI;AAAA,YACR,sBAAsB,OAAO,EAAE;AAAA,UAEjC;AAAA,QACF;AACA,kBAAU,MAAM,IAAI,CAAC,GAAI,UAAU,MAAM,KAAK,CAAC,GAAI,GAAG,MAAM,OAAO;AAAA,MACrE;AACA,aAAO,IAAI,KAAK,WAAW,QAAQ,UAAU,SAAS,OAAO,IAAI,QAAQ,KAAK;AAAA,IAChF;AAAA,EACF;AACF;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/port/as/active.ts"],"sourcesContent":["/**\n * `withFormats()` — the service that consumes the `as-*` port.\n *\n * Everything with a correctness or security consequence lives here rather\n * than in each format: the capability gate, the vault read, and redaction.\n * A {@link NoydbFormat} receives records and returns bytes.\n *\n * That is the whole point of the inversion (ADR 0004). The conformance kit it\n * replaces could only check implementors who ran it; a format that cannot\n * reach a vault is gated whether its author cooperated or not.\n *\n * @module\n */\nimport type { NoydbFormat, ImportPlan } from './types.js'\nimport type {\n FormatsStrategy,\n FormatsContext,\n FormatExportOptions,\n FormatImportOptions,\n} from '../with/formats-strategy.js'\nimport type { ExportChunk } from '../../kernel/types.js'\nimport type { Vault } from '../../kernel/vault.js'\nimport type { ImportPolicy } from './types.js'\nimport { applyListProjection } from '../../with-shape/introspection/index.js'\nimport type { CollectionDescription, ListProjectionOptions } from '../../with-shape/introspection/index.js'\nimport { ValidationError } from '../../kernel/errors.js'\n\n/** Apply the redaction projection hub owns, so a format never asks for it. */\nfunction redactChunk(\n chunk: ExportChunk,\n ctx: FormatsContext,\n redact: FormatExportOptions['redact'],\n): ExportChunk {\n if (redact === undefined) return chunk\n const described = ctx.describe(chunk.collection) as CollectionDescription | undefined\n if (!described) {\n throw new Error(\n `vault.export: redaction was requested but '${chunk.collection}' has no description to redact against. ` +\n 'Open the collection with its classifiedFields / fieldMeta options first.',\n )\n }\n const opts: ListProjectionOptions | undefined =\n redact === true ? undefined : { sensitivity: redact.sensitivity as never }\n const records = chunk.records.map((r) =>\n applyListProjection(described, r as Record<string, unknown>, opts),\n )\n return { ...chunk, records: records as typeof chunk.records }\n}\n\n/**\n * Derive the narrow, format-facing capability from the vault.\n *\n * Lives here rather than on `Vault` because `kernel-surface` said so, and it\n * was right: this is service capability, not spine. The spine keeps two\n * delegating methods and nothing else.\n */\nfunction contextFor(vault: Vault): FormatsContext {\n return {\n // The empty-id guards are NOT defensive padding. The\n // plaintext tier is gated per-format, so a missing id means the calling\n // binding is broken — and without this it would reach the gate, miss the\n // allowlist, and surface as `ExportCapabilityError`: \"the owner did not\n // grant this\", which sends the reader to the keyring instead of to the\n // format. A loud TypeError names the real fault.\n assertCanExport: (tier, format) => {\n if (tier === 'bundle') return vault.assertCanExport('bundle')\n if (!format) throw new TypeError(\"assertCanExport('plaintext') requires a non-empty format id\")\n vault.assertCanExport('plaintext', format)\n },\n assertCanImport: (tier, format) => {\n if (tier === 'bundle') return vault.assertCanImport('bundle')\n if (!format) throw new TypeError(\"assertCanImport('plaintext') requires a non-empty format id\")\n vault.assertCanImport('plaintext', format)\n },\n // ⚠️ Filtered HERE, not passed to exportStream — `ExportStreamOptions`\n // has no `collections` field, so the option I first passed was silently\n // dropped and hub read every collection. Caught by an as-json test\n // expecting ['invoices'] and getting ['invoices','payments'].\n //\n // Post-read filtering is correct but not free: hub still DECRYPTS the\n // collections the caller excluded. Pushing the filter down into\n // exportStream is the real fix and is a hub change beyond this port.\n chunks: async function* (collections) {\n const wanted = collections ? new Set(collections) : null\n for await (const chunk of vault.exportStream({ granularity: 'collection' })) {\n if (wanted && !wanted.has(chunk.collection)) continue\n yield chunk\n }\n },\n // NOT swallowed. A caller who asked for redaction and silently got\n // unredacted output is the exact failure this port exists to remove — a\n // security duty that fails quiet. If the description cannot be read, the\n // export fails instead.\n describe: (collection) => vault.collection(collection).describe() as never,\n plan: async (records, policy: ImportPolicy, formatId: string, idKey?: string) => {\n const { diffVault } = await import('../../with-cargo/vault-diff.js')\n const plan = await diffVault(vault, records as never, idKey ? { idKey } : {})\n return {\n plan,\n policy,\n // The apply walk every as-* package had independently: added always,\n // modified unless insert-only, deleted only on replace — in one\n // transaction so a partial failure rolls back. Owned once, here.\n apply: async () => {\n await vault.noydb.transaction((tx) => {\n const txVault = tx.vault(vault.name)\n const reason = `import:${formatId}`\n for (const e of plan.added) {\n txVault.collection(e.collection).put(e.id, e.record as never, { reason })\n }\n if (policy !== 'insert-only') {\n for (const e of plan.modified) {\n txVault.collection(e.collection).put(e.id, e.record as never, { reason })\n }\n }\n if (policy === 'replace') {\n for (const e of plan.deleted) txVault.collection(e.collection).delete(e.id)\n }\n })\n },\n }\n },\n }\n}\n\n/**\n * Enable `vault.export()` / `vault.import()`.\n *\n * ```ts\n * const db = await createNoydb({ store, user, secret, formatsStrategy: withFormats() })\n * const csv = await vault.export(asCsv(), { collections: ['invoices'] })\n * ```\n */\nexport function withFormats(): FormatsStrategy {\n return {\n enabled: true,\n\n async exportWith<Out extends string | Uint8Array>(\n vault: Vault,\n format: NoydbFormat<Out>,\n options: FormatExportOptions = {},\n ): Promise<Out> {\n const ctx = contextFor(vault)\n // FIRST, and before a single record is read. The format is not in scope\n // yet and could not reach the vault if it were.\n if (format.tier === 'bundle') ctx.assertCanExport('bundle')\n else ctx.assertCanExport('plaintext', format.id)\n\n const chunks: ExportChunk[] = []\n for await (const chunk of ctx.chunks(options.collections)) {\n chunks.push(redactChunk(chunk, ctx, options.redact))\n }\n return format.encode(chunks)\n },\n\n async importWith<Out extends string | Uint8Array>(\n vault: Vault,\n format: NoydbFormat<Out>,\n input: Out,\n options: FormatImportOptions = {},\n ): Promise<ImportPlan> {\n const ctx = contextFor(vault)\n // Mirrors the export side: the import gate is two-tier as well, and a\n // bundle format importing under the plaintext tier would be a silent\n // downgrade in the other direction.\n if (format.tier === 'bundle') ctx.assertCanImport('bundle')\n else ctx.assertCanImport('plaintext', format.id)\n if (!format.decode) {\n throw new ValidationError(\n `vault.import: the '${format.id}' format is export-only — it declares no decode(). ` +\n 'Pick a format that round-trips, or write the records directly.',\n )\n }\n const decoded = await format.decode(input)\n const candidate: Record<string, readonly unknown[]> = {}\n for (const chunk of decoded) {\n const target = chunk.collection || options.collection\n if (!target) {\n throw new ValidationError(\n `vault.import: the '${format.id}' input names no collection and none was supplied. ` +\n 'Pass { collection } for formats whose payload is collection-less.',\n )\n }\n candidate[target] = [...(candidate[target] ?? []), ...chunk.records]\n }\n return ctx.plan(candidate, options.policy ?? 'merge', format.id, options.idKey)\n },\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AA4BA,SAAS,YACP,OACA,KACA,QACa;AACb,MAAI,WAAW,OAAW,QAAO;AACjC,QAAM,YAAY,IAAI,SAAS,MAAM,UAAU;AAC/C,MAAI,CAAC,WAAW;AACd,UAAM,IAAI;AAAA,MACR,8CAA8C,MAAM,UAAU;AAAA,IAEhE;AAAA,EACF;AACA,QAAM,OACJ,WAAW,OAAO,SAAY,EAAE,aAAa,OAAO,YAAqB;AAC3E,QAAM,UAAU,MAAM,QAAQ;AAAA,IAAI,CAAC,MACjC,oBAAoB,WAAW,GAA8B,IAAI;AAAA,EACnE;AACA,SAAO,EAAE,GAAG,OAAO,QAAyC;AAC9D;AASA,SAAS,WAAW,OAA8B;AAChD,SAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOL,iBAAiB,CAAC,MAAM,WAAW;AACjC,UAAI,SAAS,SAAU,QAAO,MAAM,gBAAgB,QAAQ;AAC5D,UAA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IAAI,CAAC,GAAI,UAAU,MAAM,KAAK,CAAC,GAAI,GAAG,MAAM,OAAO;AAAA,MACrE;AACA,aAAO,IAAI,KAAK,WAAW,QAAQ,UAAU,SAAS,OAAO,IAAI,QAAQ,KAAK;AAAA,IAChF;AAAA,EACF;AACF;","names":[]}
|
package/dist/at/index.js
CHANGED
|
@@ -3,16 +3,15 @@ import {
|
|
|
3
3
|
MemorySealer,
|
|
4
4
|
SEALED_SECRET_RECORD_ID,
|
|
5
5
|
parseSealedEnvelope
|
|
6
|
-
} from "../chunk-
|
|
7
|
-
import "../chunk-
|
|
8
|
-
import "../chunk-
|
|
9
|
-
import "../chunk-
|
|
10
|
-
import "../chunk-
|
|
11
|
-
import "../chunk-
|
|
12
|
-
import "../chunk-
|
|
13
|
-
import "../chunk-
|
|
14
|
-
import "../chunk-
|
|
15
|
-
import "../chunk-244VXYPG.js";
|
|
6
|
+
} from "../chunk-3XJQBBZD.js";
|
|
7
|
+
import "../chunk-EZGV6F47.js";
|
|
8
|
+
import "../chunk-OIEO4WDL.js";
|
|
9
|
+
import "../chunk-Q2XRFWOI.js";
|
|
10
|
+
import "../chunk-NH2UOV3B.js";
|
|
11
|
+
import "../chunk-42ALPZ2B.js";
|
|
12
|
+
import "../chunk-QMWY2FDS.js";
|
|
13
|
+
import "../chunk-SV2PM2OY.js";
|
|
14
|
+
import "../chunk-37EPTBBR.js";
|
|
16
15
|
export {
|
|
17
16
|
MemoryRecipientSealer,
|
|
18
17
|
MemorySealer,
|
|
@@ -1,41 +1,48 @@
|
|
|
1
|
+
import {
|
|
2
|
+
issueAttestationCore
|
|
3
|
+
} from "../chunk-VMV5SBE4.js";
|
|
1
4
|
import {
|
|
2
5
|
getRevokedDocIdsCore,
|
|
3
6
|
publishRevocationListCore,
|
|
4
7
|
revokeDocCore,
|
|
5
8
|
unrevokeDocCore
|
|
6
|
-
} from "../chunk-
|
|
7
|
-
import
|
|
8
|
-
issueAttestationCore
|
|
9
|
-
} from "../chunk-MTL7MXGR.js";
|
|
9
|
+
} from "../chunk-5UMK7GRI.js";
|
|
10
|
+
import "../chunk-JWWYRR4Q.js";
|
|
10
11
|
import {
|
|
11
12
|
ATTESTATIONS_COLLECTION
|
|
12
|
-
} from "../chunk-
|
|
13
|
+
} from "../chunk-DLD5LGDS.js";
|
|
13
14
|
import {
|
|
14
15
|
NO_ATTESTATION
|
|
15
|
-
} from "../chunk-
|
|
16
|
+
} from "../chunk-PD64727P.js";
|
|
17
|
+
import {
|
|
18
|
+
decodeQr,
|
|
19
|
+
isRevoked,
|
|
20
|
+
signRevocationList,
|
|
21
|
+
verifyAttestation,
|
|
22
|
+
verifyRevocationList
|
|
23
|
+
} from "../chunk-GMKGGY7V.js";
|
|
16
24
|
import "../chunk-4AOERLTV.js";
|
|
17
|
-
import "../chunk-
|
|
18
|
-
import "../chunk-
|
|
19
|
-
import "../chunk-
|
|
20
|
-
import "../chunk-
|
|
21
|
-
import "../chunk-
|
|
22
|
-
import "../chunk-
|
|
23
|
-
import "../chunk-
|
|
24
|
-
import "../chunk-ODVPTDPK.js";
|
|
25
|
+
import "../chunk-EZGV6F47.js";
|
|
26
|
+
import "../chunk-OIEO4WDL.js";
|
|
27
|
+
import "../chunk-Q2XRFWOI.js";
|
|
28
|
+
import "../chunk-NH2UOV3B.js";
|
|
29
|
+
import "../chunk-42ALPZ2B.js";
|
|
30
|
+
import "../chunk-QMWY2FDS.js";
|
|
31
|
+
import "../chunk-SV2PM2OY.js";
|
|
25
32
|
import {
|
|
26
33
|
AttestationError,
|
|
27
34
|
AttestationNotEnabledError
|
|
28
|
-
} from "../chunk-
|
|
35
|
+
} from "../chunk-37EPTBBR.js";
|
|
29
36
|
|
|
30
37
|
// src/with-audit/attestation/active.ts
|
|
31
38
|
function withAttestation() {
|
|
32
39
|
return {
|
|
33
40
|
async issueAttestation(ctx, args) {
|
|
34
|
-
const { issueAttestationCore: issueAttestationCore2 } = await import("../issue-
|
|
41
|
+
const { issueAttestationCore: issueAttestationCore2 } = await import("../issue-YIVBZUTH.js");
|
|
35
42
|
return issueAttestationCore2(ctx, args);
|
|
36
43
|
},
|
|
37
44
|
async getDocumentSigningPublicKey(deps) {
|
|
38
|
-
const { loadSigner, loadOrCreateSigner } = await import("../signer-
|
|
45
|
+
const { loadSigner, loadOrCreateSigner } = await import("../signer-MHGW3OIL.js");
|
|
39
46
|
const existing = await loadSigner(deps.adapter, deps.vault, deps.getDEK);
|
|
40
47
|
if (existing) return { keyId: existing.keyId, publicKeyB64: existing.publicKeyB64 };
|
|
41
48
|
if (deps.role !== "owner") {
|
|
@@ -45,41 +52,45 @@ function withAttestation() {
|
|
|
45
52
|
return { keyId: signer.keyId, publicKeyB64: signer.publicKeyB64 };
|
|
46
53
|
},
|
|
47
54
|
async revokeAttestation(ctx, docId) {
|
|
48
|
-
const { revokeDocCore: revokeDocCore2 } = await import("../revoke-
|
|
55
|
+
const { revokeDocCore: revokeDocCore2 } = await import("../revoke-6DWIEOCV.js");
|
|
49
56
|
return revokeDocCore2(ctx, docId);
|
|
50
57
|
},
|
|
51
58
|
async unrevokeAttestation(ctx, docId) {
|
|
52
|
-
const { unrevokeDocCore: unrevokeDocCore2 } = await import("../revoke-
|
|
59
|
+
const { unrevokeDocCore: unrevokeDocCore2 } = await import("../revoke-6DWIEOCV.js");
|
|
53
60
|
return unrevokeDocCore2(ctx, docId);
|
|
54
61
|
},
|
|
55
62
|
async getRevokedDocIds(ctx) {
|
|
56
|
-
const { getRevokedDocIdsCore: getRevokedDocIdsCore2 } = await import("../revoke-
|
|
63
|
+
const { getRevokedDocIdsCore: getRevokedDocIdsCore2 } = await import("../revoke-6DWIEOCV.js");
|
|
57
64
|
return getRevokedDocIdsCore2(ctx);
|
|
58
65
|
},
|
|
59
66
|
async publishRevocationList(ctx) {
|
|
60
|
-
const { publishRevocationListCore: publishRevocationListCore2 } = await import("../revoke-
|
|
67
|
+
const { publishRevocationListCore: publishRevocationListCore2 } = await import("../revoke-6DWIEOCV.js");
|
|
61
68
|
return publishRevocationListCore2(ctx);
|
|
62
69
|
}
|
|
63
70
|
};
|
|
64
71
|
}
|
|
65
72
|
|
|
66
|
-
// src/with-audit/attestation/
|
|
67
|
-
|
|
73
|
+
// src/with-audit/attestation/verifier.ts
|
|
74
|
+
var verifyAttestation2 = verifyAttestation;
|
|
75
|
+
var decodeQr2 = decodeQr;
|
|
76
|
+
var verifyRevocationList2 = verifyRevocationList;
|
|
77
|
+
var isRevoked2 = isRevoked;
|
|
78
|
+
var signRevocationList2 = signRevocationList;
|
|
68
79
|
export {
|
|
69
80
|
ATTESTATIONS_COLLECTION,
|
|
70
81
|
AttestationError,
|
|
71
82
|
AttestationNotEnabledError,
|
|
72
83
|
NO_ATTESTATION,
|
|
73
|
-
decodeQr,
|
|
84
|
+
decodeQr2 as decodeQr,
|
|
74
85
|
getRevokedDocIdsCore,
|
|
75
|
-
isRevoked,
|
|
86
|
+
isRevoked2 as isRevoked,
|
|
76
87
|
issueAttestationCore,
|
|
77
88
|
publishRevocationListCore,
|
|
78
89
|
revokeDocCore,
|
|
79
|
-
signRevocationList,
|
|
90
|
+
signRevocationList2 as signRevocationList,
|
|
80
91
|
unrevokeDocCore,
|
|
81
|
-
verifyAttestation,
|
|
82
|
-
verifyRevocationList,
|
|
92
|
+
verifyAttestation2 as verifyAttestation,
|
|
93
|
+
verifyRevocationList2 as verifyRevocationList,
|
|
83
94
|
withAttestation
|
|
84
95
|
};
|
|
85
96
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/with-audit/attestation/active.ts","../../src/with-audit/attestation/
|
|
1
|
+
{"version":3,"sources":["../../src/with-audit/attestation/active.ts","../../src/with-audit/attestation/verifier.ts"],"sourcesContent":["import { AttestationError } from '../../kernel/errors.js'\nimport type { AttestationStrategy } from './strategy.js'\n\n/**\n * Enable the attestation capability.\n * Pass to `createNoydb({ attestationStrategy: withAttestation() })` to make the\n * vault's `issueAttestation` / `getDocumentSigningPublicKey` / `revokeAttestation`\n * / `unrevokeAttestation` / `getRevokedDocIds` / `publishRevocationList` methods\n * live. The issue/revoke/signer engines are dynamically imported here, so they\n * stay out of the floor bundle until opted in.\n */\nexport function withAttestation(): AttestationStrategy {\n return {\n async issueAttestation(ctx, args) {\n const { issueAttestationCore } = await import('./issue.js')\n return issueAttestationCore(ctx, args)\n },\n async getDocumentSigningPublicKey(deps) {\n const { loadSigner, loadOrCreateSigner } = await import('./signer.js')\n // Reading an existing public key is open to any role that holds the\n // _attestations DEK — the public key is not secret. But MINTING the\n // signer is the firm's identity operation (same rule as issueAttestation):\n // a non-owner read must not silently create it.\n const existing = await loadSigner(deps.adapter, deps.vault, deps.getDEK)\n if (existing) return { keyId: existing.keyId, publicKeyB64: existing.publicKeyB64 }\n if (deps.role !== 'owner') {\n throw new AttestationError(`getDocumentSigningPublicKey: no document-signing key exists yet; only the 'owner' may mint it. Caller is '${deps.role}'. Have the owner issue an attestation (or call this) first.`)\n }\n const signer = await loadOrCreateSigner(deps.adapter, deps.vault, deps.getDEK)\n return { keyId: signer.keyId, publicKeyB64: signer.publicKeyB64 }\n },\n async revokeAttestation(ctx, docId) {\n const { revokeDocCore } = await import('./revoke.js')\n return revokeDocCore(ctx, docId)\n },\n async unrevokeAttestation(ctx, docId) {\n const { unrevokeDocCore } = await import('./revoke.js')\n return unrevokeDocCore(ctx, docId)\n },\n async getRevokedDocIds(ctx) {\n const { getRevokedDocIdsCore } = await import('./revoke.js')\n return getRevokedDocIdsCore(ctx)\n },\n async publishRevocationList(ctx) {\n const { publishRevocationListCore } = await import('./revoke.js')\n return publishRevocationListCore(ctx)\n },\n }\n}\n","/**\n * The pure verifier surface, re-exported through hub-owned signatures.\n *\n * `export { … } from '@noy-db/attestation'` would compile fine and bundle\n * fine — but tsc emits that specifier verbatim into hub's `.d.ts`, so a\n * consumer would need `@noy-db/attestation` installed just to TYPECHECK\n * against a package that bundles it. Binding each value to a locally-typed\n * `const` makes the declaration name only `./types.js`.\n * `__tests__/no-runtime-dependencies.test.ts` asserts the emitted `dist`\n * never names the package, and pins these types assignable to attestation's.\n */\nimport {\n verifyAttestation as _verifyAttestation,\n decodeQr as _decodeQr,\n verifyRevocationList as _verifyRevocationList,\n isRevoked as _isRevoked,\n signRevocationList as _signRevocationList,\n} from '@noy-db/attestation'\nimport type {\n QrPayload,\n RevocationList,\n SignatureScheme,\n VerifyInput,\n VerifyResult,\n} from './types.js'\n\nexport const verifyAttestation: (\n input: VerifyInput,\n scheme?: SignatureScheme,\n) => Promise<VerifyResult> = _verifyAttestation\n\nexport const decodeQr: (s: string) => QrPayload = _decodeQr\n\nexport const verifyRevocationList: (\n list: RevocationList,\n publicKeyB64: string,\n scheme?: SignatureScheme,\n) => Promise<boolean> = _verifyRevocationList\n\nexport const isRevoked: (docId: string, list: RevocationList) => boolean = _isRevoked\n\nexport const signRevocationList: (\n revokedDocIds: readonly string[],\n asOf: string,\n keyId: string,\n privateKeyPkcs8B64: string,\n scheme?: SignatureScheme,\n) => Promise<RevocationList> = _signRevocationList\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAWO,SAAS,kBAAuC;AACrD,SAAO;AAAA,IACL,MAAM,iBAAiB,KAAK,MAAM;AAChC,YAAM,EAAE,sBAAAA,sBAAqB,IAAI,MAAM,OAAO,sBAAY;AAC1D,aAAOA,sBAAqB,KAAK,IAAI;AAAA,IACvC;AAAA,IACA,MAAM,4BAA4B,MAAM;AACtC,YAAM,EAAE,YAAY,mBAAmB,IAAI,MAAM,OAAO,uBAAa;AAKrE,YAAM,WAAW,MAAM,WAAW,KAAK,SAAS,KAAK,OAAO,KAAK,MAAM;AACvE,UAAI,SAAU,QAAO,EAAE,OAAO,SAAS,OAAO,cAAc,SAAS,aAAa;AAClF,UAAI,KAAK,SAAS,SAAS;AACzB,cAAM,IAAI,iBAAiB,6GAA6G,KAAK,IAAI,8DAA8D;AAAA,MACjN;AACA,YAAM,SAAS,MAAM,mBAAmB,KAAK,SAAS,KAAK,OAAO,KAAK,MAAM;AAC7E,aAAO,EAAE,OAAO,OAAO,OAAO,cAAc,OAAO,aAAa;AAAA,IAClE;AAAA,IACA,MAAM,kBAAkB,KAAK,OAAO;AAClC,YAAM,EAAE,eAAAC,eAAc,IAAI,MAAM,OAAO,uBAAa;AACpD,aAAOA,eAAc,KAAK,KAAK;AAAA,IACjC;AAAA,IACA,MAAM,oBAAoB,KAAK,OAAO;AACpC,YAAM,EAAE,iBAAAC,iBAAgB,IAAI,MAAM,OAAO,uBAAa;AACtD,aAAOA,iBAAgB,KAAK,KAAK;AAAA,IACnC;AAAA,IACA,MAAM,iBAAiB,KAAK;AAC1B,YAAM,EAAE,sBAAAC,sBAAqB,IAAI,MAAM,OAAO,uBAAa;AAC3D,aAAOA,sBAAqB,GAAG;AAAA,IACjC;AAAA,IACA,MAAM,sBAAsB,KAAK;AAC/B,YAAM,EAAE,2BAAAC,2BAA0B,IAAI,MAAM,OAAO,uBAAa;AAChE,aAAOA,2BAA0B,GAAG;AAAA,IACtC;AAAA,EACF;AACF;;;ACtBO,IAAMC,qBAGgB;AAEtB,IAAMC,YAAqC;AAE3C,IAAMC,wBAIW;AAEjB,IAAMC,aAA8D;AAEpE,IAAMC,sBAMkB;","names":["issueAttestationCore","revokeDocCore","unrevokeDocCore","getRevokedDocIdsCore","publishRevocationListCore","verifyAttestation","decodeQr","verifyRevocationList","isRevoked","signRevocationList"]}
|
|
@@ -1,39 +1,38 @@
|
|
|
1
1
|
import {
|
|
2
2
|
MANIFEST_COLLECTION
|
|
3
3
|
} from "./chunk-EPFF7LOX.js";
|
|
4
|
-
import {
|
|
5
|
-
SEQUENCE_COLLECTION
|
|
6
|
-
} from "./chunk-M522UYZ2.js";
|
|
7
4
|
import {
|
|
8
5
|
SCHEMAS_COLLECTION
|
|
9
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-3L2NBKDR.js";
|
|
10
7
|
import {
|
|
11
8
|
PERIODS_COLLECTION,
|
|
12
9
|
PERIOD_ARCHIVES_COLLECTION,
|
|
13
10
|
PERIOD_FREEZES_COLLECTION,
|
|
14
11
|
PERIOD_REOPENS_COLLECTION,
|
|
15
12
|
PERIOD_TARGET_PURGES_COLLECTION
|
|
16
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-QBLT6POL.js";
|
|
14
|
+
import {
|
|
15
|
+
SEQUENCE_COLLECTION
|
|
16
|
+
} from "./chunk-VFHCKG5M.js";
|
|
17
17
|
import {
|
|
18
18
|
LEDGER_COLLECTION,
|
|
19
19
|
LEDGER_DELTAS_COLLECTION
|
|
20
20
|
} from "./chunk-I7FD46FF.js";
|
|
21
|
-
import "./chunk-KJFW62P4.js";
|
|
22
21
|
import {
|
|
23
22
|
buildRecordEnvelope
|
|
24
|
-
} from "./chunk-
|
|
25
|
-
import "./chunk-
|
|
26
|
-
import "./chunk-
|
|
27
|
-
import "./chunk-
|
|
28
|
-
import "./chunk-
|
|
29
|
-
import "./chunk-
|
|
23
|
+
} from "./chunk-EZGV6F47.js";
|
|
24
|
+
import "./chunk-OIEO4WDL.js";
|
|
25
|
+
import "./chunk-Q2XRFWOI.js";
|
|
26
|
+
import "./chunk-NH2UOV3B.js";
|
|
27
|
+
import "./chunk-42ALPZ2B.js";
|
|
28
|
+
import "./chunk-QMWY2FDS.js";
|
|
30
29
|
import {
|
|
31
30
|
NOYDB_BACKUP_VERSION
|
|
32
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-SV2PM2OY.js";
|
|
33
32
|
import {
|
|
34
33
|
BackupCorruptedError,
|
|
35
34
|
BackupLedgerError
|
|
36
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-37EPTBBR.js";
|
|
37
36
|
|
|
38
37
|
// src/with-pod/backup.ts
|
|
39
38
|
async function dumpVault(ctx) {
|
|
@@ -43,7 +42,7 @@ async function dumpVault(ctx) {
|
|
|
43
42
|
for (const keyringId of keyringIds) {
|
|
44
43
|
const envelope = await ctx.adapter.get(ctx.vault, "_keyring", keyringId);
|
|
45
44
|
if (envelope) {
|
|
46
|
-
keyrings[keyringId] = JSON.parse(envelope._data);
|
|
45
|
+
keyrings[keyringId] = JSON.parse(envelope._data ?? "");
|
|
47
46
|
}
|
|
48
47
|
}
|
|
49
48
|
const internalSnapshot = {};
|
|
@@ -267,4 +266,4 @@ export {
|
|
|
267
266
|
loadVault,
|
|
268
267
|
verifyBackupIntegrity
|
|
269
268
|
};
|
|
270
|
-
//# sourceMappingURL=backup-
|
|
269
|
+
//# sourceMappingURL=backup-YE2VQ26S.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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'\nimport { buildRecordEnvelope } from '../capsule/index.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 = buildRecordEnvelope({ collection: '_keyring', id: userId, version: 1 },\n { iv: '', data: JSON.stringify(keyringFile) })\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. A backup with no ledgerHead cannot be\n // integrity-checked, and skipping silently would collapse\n // *unverifiable* into *clean* — so it always warns. But the REMEDY\n // depends on the reader, not the pod (#1303): the pod cannot say\n // whether its exporter predates the ledger or never enabled it, and\n // the reader knows its own configuration.\n //\n // - Reader HAS the ledger: the pod is behind it. \"Re-export\" is\n // actionable; keep the migration wording.\n // - Reader has NO ledger: nothing is stale and nothing is migrating —\n // the consumer priced the ledger (#1248 measured ~2.4x) and declined.\n // Prescribing a re-export is advice they should not take, and\n // repeating it on every read trains people to filter the one line\n // that also fires on a genuinely stale pod. State the consequence,\n // name the discriminator, prescribe nothing.\n if (!backup.ledgerHead) {\n if (ctx.getLedgerOrNull()) {\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 } else {\n console.warn(\n `[noy-db] Loaded a backup with no ledgerHead — this pod is not integrity-checked. ` +\n `This reader has no ledger enabled (withHistory() is not configured), so nothing is stale: ` +\n `enable the ledger on both the exporter and this reader if tamper detection is wanted.`,\n )\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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+FA,eAAsB,UAAU,KAAqC;AACnE,QAAM,WAAW,MAAM,IAAI,QAAQ,QAAQ,IAAI,KAAK;AAIpD,QAAM,aAAa,MAAM,IAAI,QAAQ,KAAK,IAAI,OAAO,UAAU;AAC/D,QAAM,WAAoC,CAAC;AAC3C,aAAW,aAAa,YAAY;AAClC,UAAM,WAAW,MAAM,IAAI,QAAQ,IAAI,IAAI,OAAO,YAAY,SAAS;AACvE,QAAI,UAAU;AACZ,eAAS,SAAS,IAAI,KAAK,MAAM,SAAS,SAAS,EAAE;AAAA,IACvD;AAAA,EACF;AAaA,QAAM,mBAAkC,CAAC;AACzC,QAAM,gBAAgB;AAAA,IACpB;AAAA,IAAmB;AAAA,IAA0B;AAAA,IAAoB;AAAA,IACjE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAQA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA;AAAA,IACA;AAAA,IAAe;AAAA,IAAgB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAM/B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAYA,GAAG,OAAO,KAAK,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,eAAe,CAAC,IAAI,kBAAkB,CAAC,EAAE,CAAC;AAAA,EACrF;AACA,aAAW,gBAAgB,eAAe;AACxC,UAAM,MAAM,MAAM,IAAI,QAAQ,KAAK,IAAI,OAAO,YAAY;AAC1D,QAAI,IAAI,WAAW,EAAG;AACtB,UAAM,UAA6C,CAAC;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AAM,kBAGF,CAAC;AAEL,mBAAiB,SAAS,IAAI,aAAa;AAAA,IACzC,aAAa;AAAA,IACb,gBAAgB,KAAK,mBAAmB;AAAA;AAAA;AAAA,IAGxC,GAAI,KAAK,kBAAkB,SAAY,EAAE,eAAe,KAAK,cAAc,IAAI,CAAC;AAAA,EAClF,CAAC,GAAG;AACF,gBAAY,MAAM,UAAU,IAAI;AAAA,MAC9B,QAAQ;AAAA;AAAA,MACR,MAAM,MAAM;AAAA,MACZ,SAAS,MAAM;AAAA,IACjB;AACA,QAAI,MAAM,WAAY,cAAa,MAAM;AAEzC,QAAI,CAAC,KAAK,iBAAiB,MAAM,cAAc;AAC7C,sBAAgB,MAAM,UAAU,IAAI,MAAM;AAAA,IAC5C;AAAA,EACF;AAEA,QAAM,kBAAkB,OAAO,KAAK,eAAe,EAAE,SAAS;AAC9D,SAAO,KAAK,UAAU;AAAA,IACpB,eAAe;AAAA,IACf,cAAc,IAAI;AAAA,IAClB,eAAc,oBAAI,KAAK,GAAE,YAAY;AAAA,IACrC,cAAc,IAAI,OAAO;AAAA,IACzB;AAAA,IACA,GAAI,kBAAkB,EAAE,eAAe,gBAAgB,IAAI,CAAC;AAAA,IAC5D,GAAI,aAAa,EAAE,WAAW,IAAI,CAAC;AAAA,EACrC,CAAC;AACH;","names":[]}
|
package/dist/blobs/index.js
CHANGED
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
createExportBlobsHandle,
|
|
11
11
|
reportOrphanBlobChunks,
|
|
12
12
|
runCompaction
|
|
13
|
-
} from "../chunk-
|
|
13
|
+
} from "../chunk-JSMTXZR3.js";
|
|
14
14
|
import {
|
|
15
15
|
BLOB_CHUNKS_COLLECTION,
|
|
16
16
|
BLOB_COLLECTION,
|
|
@@ -25,21 +25,20 @@ import {
|
|
|
25
25
|
detectMimeType,
|
|
26
26
|
isPreCompressed,
|
|
27
27
|
memoryBlobPinStore
|
|
28
|
-
} from "../chunk-
|
|
29
|
-
import "../chunk-
|
|
30
|
-
import "../chunk-
|
|
31
|
-
import "../chunk-
|
|
32
|
-
import "../chunk-
|
|
33
|
-
import "../chunk-
|
|
34
|
-
import "../chunk-
|
|
35
|
-
import "../chunk-
|
|
36
|
-
import "../chunk-
|
|
37
|
-
import "../chunk-
|
|
38
|
-
import "../chunk-
|
|
39
|
-
import "../chunk-ODVPTDPK.js";
|
|
28
|
+
} from "../chunk-G2MVBDFP.js";
|
|
29
|
+
import "../chunk-SYNY3VB5.js";
|
|
30
|
+
import "../chunk-7XMHMVTS.js";
|
|
31
|
+
import "../chunk-FLPCETP6.js";
|
|
32
|
+
import "../chunk-EZGV6F47.js";
|
|
33
|
+
import "../chunk-OIEO4WDL.js";
|
|
34
|
+
import "../chunk-Q2XRFWOI.js";
|
|
35
|
+
import "../chunk-NH2UOV3B.js";
|
|
36
|
+
import "../chunk-42ALPZ2B.js";
|
|
37
|
+
import "../chunk-QMWY2FDS.js";
|
|
38
|
+
import "../chunk-SV2PM2OY.js";
|
|
40
39
|
import {
|
|
41
40
|
BlobOfflineError
|
|
42
|
-
} from "../chunk-
|
|
41
|
+
} from "../chunk-37EPTBBR.js";
|
|
43
42
|
|
|
44
43
|
// src/via/blob/active.ts
|
|
45
44
|
function withBlobs(options = {}) {
|
package/dist/blobs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/via/blob/active.ts"],"sourcesContent":["/**\n * Active blob strategy factory. Calling `blobs()` returns a\n * `BlobsStrategy` whose `openSlot` constructs a real `BlobSet` bound\n * to the caller's record. The returned strategy is passed into\n * `createNoydb({ blobsStrategy: blobs() })` to light up the\n * `collection.blob(id)` path.\n *\n * This module is only reachable through the `@noy-db/hub/blobs`\n * subpath — a consumer that never imports the subpath ships none of\n * this (ESM tree-shaking + hub's `\"sideEffects\": false`).\n */\n\nimport { BlobSet } from '../../with-shape/blobs/blob-set.js'\nimport type { BlobsStrategy } from '../../port/with/blob-strategy.js'\nimport { createBlobPinCache } from '../../with-shape/blobs/blob-pinning.js'\nimport type { BlobPinStore } from '../../with-shape/blobs/blob-pinning.js'\n\n/** Options for {@link withBlobs} (#808). */\nexport interface WithBlobsOptions {\n /**\n * Device-local backend for the offline-pin registry + external side-cache\n * (`collection.blob(id).pin()`, the `cacheBudget` LRU stamps). Default:\n * in-memory — pins then last one app session. Supply a durable,\n * DEVICE-LOCAL store (IndexedDB-backed on the web; it must never sync) to\n * keep pins across restarts. See `BlobPinStore`'s doc for the posture.\n */\n readonly pinStore?: BlobPinStore\n}\n\n/**\n * Build a default `BlobsStrategy` ready to pass into `createNoydb`.\n *\n * Named `withBlobs` (plugin-pattern canonical) rather than `blobs` to\n * avoid shadowing the very common local idiom\n * `const blobs = invoices.blob(id)` in user code.\n *\n * One `withBlobs()` instance owns one device-local pin registry + KPI\n * counter set (#808) — treat it as \"this device's\" blob service.\n *\n * @example\n * ```ts\n * import { createNoydb } from '@noy-db/hub'\n * import { withBlobs } from '@noy-db/hub/blobs'\n *\n * const db = await createNoydb({\n * store, user, secret,\n * blobsStrategy: withBlobs(),\n * })\n *\n * // Now live — delegates to BlobSet.\n * const vault = await db.openVault('acme')\n * await vault.collection('invoices').blob('inv-1').put('receipt.pdf', bytes)\n * ```\n */\nexport function withBlobs(options: WithBlobsOptions = {}): BlobsStrategy {\n const pinCache = createBlobPinCache(options.pinStore)\n return {\n openSlot(args) {\n return new BlobSet({ ...args, pinCache })\n },\n cacheStats() {\n return { ...pinCache.stats }\n },\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/via/blob/active.ts"],"sourcesContent":["/**\n * Active blob strategy factory. Calling `blobs()` returns a\n * `BlobsStrategy` whose `openSlot` constructs a real `BlobSet` bound\n * to the caller's record. The returned strategy is passed into\n * `createNoydb({ blobsStrategy: blobs() })` to light up the\n * `collection.blob(id)` path.\n *\n * This module is only reachable through the `@noy-db/hub/blobs`\n * subpath — a consumer that never imports the subpath ships none of\n * this (ESM tree-shaking + hub's `\"sideEffects\": false`).\n */\n\nimport { BlobSet } from '../../with-shape/blobs/blob-set.js'\nimport type { BlobsStrategy } from '../../port/with/blob-strategy.js'\nimport { createBlobPinCache } from '../../with-shape/blobs/blob-pinning.js'\nimport type { BlobPinStore } from '../../with-shape/blobs/blob-pinning.js'\n\n/** Options for {@link withBlobs} (#808). */\nexport interface WithBlobsOptions {\n /**\n * Device-local backend for the offline-pin registry + external side-cache\n * (`collection.blob(id).pin()`, the `cacheBudget` LRU stamps). Default:\n * in-memory — pins then last one app session. Supply a durable,\n * DEVICE-LOCAL store (IndexedDB-backed on the web; it must never sync) to\n * keep pins across restarts. See `BlobPinStore`'s doc for the posture.\n */\n readonly pinStore?: BlobPinStore\n}\n\n/**\n * Build a default `BlobsStrategy` ready to pass into `createNoydb`.\n *\n * Named `withBlobs` (plugin-pattern canonical) rather than `blobs` to\n * avoid shadowing the very common local idiom\n * `const blobs = invoices.blob(id)` in user code.\n *\n * One `withBlobs()` instance owns one device-local pin registry + KPI\n * counter set (#808) — treat it as \"this device's\" blob service.\n *\n * @example\n * ```ts\n * import { createNoydb } from '@noy-db/hub'\n * import { withBlobs } from '@noy-db/hub/blobs'\n *\n * const db = await createNoydb({\n * store, user, secret,\n * blobsStrategy: withBlobs(),\n * })\n *\n * // Now live — delegates to BlobSet.\n * const vault = await db.openVault('acme')\n * await vault.collection('invoices').blob('inv-1').put('receipt.pdf', bytes)\n * ```\n */\nexport function withBlobs(options: WithBlobsOptions = {}): BlobsStrategy {\n const pinCache = createBlobPinCache(options.pinStore)\n return {\n openSlot(args) {\n return new BlobSet({ ...args, pinCache })\n },\n cacheStats() {\n return { ...pinCache.stats }\n },\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsDO,SAAS,UAAU,UAA4B,CAAC,GAAkB;AACvE,QAAM,WAAW,mBAAmB,QAAQ,QAAQ;AACpD,SAAO;AAAA,IACL,SAAS,MAAM;AACb,aAAO,IAAI,QAAQ,EAAE,GAAG,MAAM,SAAS,CAAC;AAAA,IAC1C;AAAA,IACA,aAAa;AACX,aAAO,EAAE,GAAG,SAAS,MAAM;AAAA,IAC7B;AAAA,EACF;AACF;","names":[]}
|
package/dist/broker/index.js
CHANGED
|
@@ -1,22 +1,21 @@
|
|
|
1
1
|
import {
|
|
2
2
|
NO_BROKER
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-GZT3NQRA.js";
|
|
4
4
|
import {
|
|
5
5
|
issueChallenge,
|
|
6
6
|
verifyBrokerProof
|
|
7
|
-
} from "../chunk-
|
|
8
|
-
import "../chunk-
|
|
9
|
-
import "../chunk-
|
|
10
|
-
import "../chunk-
|
|
11
|
-
import "../chunk-
|
|
12
|
-
import "../chunk-
|
|
13
|
-
import "../chunk-
|
|
14
|
-
import "../chunk-ODVPTDPK.js";
|
|
7
|
+
} from "../chunk-EZGV6F47.js";
|
|
8
|
+
import "../chunk-OIEO4WDL.js";
|
|
9
|
+
import "../chunk-Q2XRFWOI.js";
|
|
10
|
+
import "../chunk-NH2UOV3B.js";
|
|
11
|
+
import "../chunk-42ALPZ2B.js";
|
|
12
|
+
import "../chunk-QMWY2FDS.js";
|
|
13
|
+
import "../chunk-SV2PM2OY.js";
|
|
15
14
|
import {
|
|
16
15
|
BrokerEnrolmentError,
|
|
17
16
|
BrokerNotEnabledError,
|
|
18
17
|
BrokerProofError
|
|
19
|
-
} from "../chunk-
|
|
18
|
+
} from "../chunk-37EPTBBR.js";
|
|
20
19
|
|
|
21
20
|
// src/with-party/broker/active.ts
|
|
22
21
|
var DEFAULT_SKEW_MS = 6e4;
|
|
@@ -29,7 +28,7 @@ function withBroker(config) {
|
|
|
29
28
|
const cache = /* @__PURE__ */ new Map();
|
|
30
29
|
return {
|
|
31
30
|
async enroll(ctx) {
|
|
32
|
-
const { enrollSeed } = await import("../seed-
|
|
31
|
+
const { enrollSeed } = await import("../seed-XNSE4U3S.js");
|
|
33
32
|
return enrollSeed({ ...ctx, config });
|
|
34
33
|
},
|
|
35
34
|
async rotate(ctx) {
|
|
@@ -38,7 +37,7 @@ function withBroker(config) {
|
|
|
38
37
|
const inFlight = scoped.map(([, e]) => e.inFlight).filter((p) => p !== void 0);
|
|
39
38
|
await Promise.allSettled(inFlight);
|
|
40
39
|
for (const [key] of scoped) cache.delete(key);
|
|
41
|
-
const { rotateSeed } = await import("../seed-
|
|
40
|
+
const { rotateSeed } = await import("../seed-XNSE4U3S.js");
|
|
42
41
|
return rotateSeed({ ...ctx, config });
|
|
43
42
|
},
|
|
44
43
|
credentialSource(ctx, profile) {
|
|
@@ -55,7 +54,7 @@ function withBroker(config) {
|
|
|
55
54
|
const skewMs = config.skewMs ?? DEFAULT_SKEW_MS;
|
|
56
55
|
const capturedEntry = entry;
|
|
57
56
|
const inFlight = (async () => {
|
|
58
|
-
const { mintStoreCredentials } = await import("../seed-
|
|
57
|
+
const { mintStoreCredentials } = await import("../seed-XNSE4U3S.js");
|
|
59
58
|
const creds = await mintStoreCredentials({ ...ctx, config }, profile);
|
|
60
59
|
capturedEntry.cached = { creds, validUntil: cacheFloor(creds, skewMs) };
|
|
61
60
|
return creds;
|