@noy-db/hub 0.4.0-pre.4 → 0.4.0-pre.6
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/README.md +2 -2
- package/dist/api-5QVQX4HG.js +20 -0
- package/dist/attestation/index.js +18 -18
- package/dist/{backup-JL2GOTYQ.js → backup-USYSNCYM.js} +11 -11
- package/dist/blobs/index.js +15 -12
- package/dist/blobs/index.js.map +1 -1
- package/dist/broker/index.js +12 -12
- package/dist/cargo/index.js +34 -36
- package/dist/{chunk-JLHKBAFY.js → chunk-2BVW754E.js} +3 -3
- package/dist/{chunk-T7S4V52L.js → chunk-2PDBYF2O.js} +4 -4
- package/dist/{chunk-YGBIBOCR.js → chunk-2ZSC454H.js} +7 -7
- package/dist/{chunk-IGAIOGCN.js → chunk-32467U5J.js} +4 -4
- package/dist/{chunk-JA5O7UEZ.js → chunk-3GXDB3NQ.js} +6 -6
- package/dist/chunk-3GXDB3NQ.js.map +1 -0
- package/dist/{chunk-U73LHVPF.js → chunk-3S2YNMUS.js} +54 -6
- package/dist/chunk-3S2YNMUS.js.map +1 -0
- package/dist/{chunk-JW3XCZA2.js → chunk-3TZUC4WS.js} +11 -11
- package/dist/{chunk-JA5B3SLH.js → chunk-44Y3P5U6.js} +2 -2
- package/dist/{chunk-25G7U6RD.js → chunk-4B3DL75F.js} +2 -2
- package/dist/{chunk-L4OA7G5T.js → chunk-522MBPE5.js} +2 -2
- package/dist/chunk-5ABOFAHN.js +81 -0
- package/dist/chunk-5ABOFAHN.js.map +1 -0
- package/dist/chunk-5D2ALSM5.js +19 -0
- package/dist/chunk-5D2ALSM5.js.map +1 -0
- package/dist/{chunk-M25ZIEB2.js → chunk-5HSSTOOG.js} +2 -2
- package/dist/{chunk-LLVW4V7R.js → chunk-5WLDZZ6S.js} +3 -3
- package/dist/{chunk-BCOKZC4B.js → chunk-6SSWOUUS.js} +19 -19
- package/dist/chunk-6SSWOUUS.js.map +1 -0
- package/dist/{chunk-IGM563N5.js → chunk-6SYOHUHM.js} +6 -6
- package/dist/chunk-6SYOHUHM.js.map +1 -0
- package/dist/{chunk-7B4GPCX7.js → chunk-7IQWHYL2.js} +5 -5
- package/dist/{chunk-J3VW4J4E.js → chunk-7LP7FFJ2.js} +2 -2
- package/dist/chunk-7LP7FFJ2.js.map +1 -0
- package/dist/{chunk-5P5AAXYA.js → chunk-7U6AB7DZ.js} +7 -7
- package/dist/chunk-7U6AB7DZ.js.map +1 -0
- package/dist/chunk-AFHQATY4.js +47 -0
- package/dist/chunk-AFHQATY4.js.map +1 -0
- package/dist/{chunk-OWE4BNTM.js → chunk-AZXEOEQK.js} +4 -4
- package/dist/{chunk-GBEXTC6Z.js → chunk-BAAUFCJK.js} +3 -3
- package/dist/chunk-BAAUFCJK.js.map +1 -0
- package/dist/{chunk-BZEPJJOK.js → chunk-C2V7AJO2.js} +4 -4
- package/dist/chunk-CADUYBQD.js +151 -0
- package/dist/chunk-CADUYBQD.js.map +1 -0
- package/dist/{chunk-2JZ763FV.js → chunk-D4LAJ737.js} +2 -2
- package/dist/{chunk-5BHNQNBI.js → chunk-DOZFU7OZ.js} +1 -1
- package/dist/chunk-DOZFU7OZ.js.map +1 -0
- package/dist/{chunk-MEKAMERX.js → chunk-E7FSBI6I.js} +29 -29
- package/dist/chunk-E7FSBI6I.js.map +1 -0
- package/dist/{chunk-N4FZ6ITM.js → chunk-EGU4PWQW.js} +2 -2
- package/dist/chunk-EP5L47XV.js +22 -0
- package/dist/chunk-EP5L47XV.js.map +1 -0
- package/dist/{chunk-EW4HFWGJ.js → chunk-EPME33Y4.js} +6 -6
- package/dist/{chunk-W7TCXZWU.js → chunk-EWPS35AR.js} +794 -1045
- package/dist/chunk-EWPS35AR.js.map +1 -0
- package/dist/{chunk-JKWNG3TM.js → chunk-FHHYCBBP.js} +2 -2
- package/dist/{chunk-5BB3N4KU.js → chunk-G4MFQXYX.js} +2 -2
- package/dist/{chunk-KVHWEPT2.js → chunk-GHEMAVTN.js} +2 -2
- package/dist/{chunk-CGPO3ZYB.js → chunk-GQT6J4FJ.js} +15 -2
- package/dist/chunk-GQT6J4FJ.js.map +1 -0
- package/dist/{chunk-XW7NWO4A.js → chunk-GTNRMJYH.js} +2 -2
- package/dist/{chunk-YG2EG6CB.js → chunk-H5GMROCB.js} +4 -4
- package/dist/{chunk-JIMEB4C6.js → chunk-HA7P3BTB.js} +26 -177
- package/dist/chunk-HA7P3BTB.js.map +1 -0
- package/dist/{chunk-5KI3REO3.js → chunk-HDF5R2K6.js} +7 -7
- package/dist/{chunk-V3YB7RGR.js → chunk-HVPW6PCX.js} +3 -3
- package/dist/{chunk-2VUISNGP.js → chunk-HXVRRJBD.js} +5 -5
- package/dist/{chunk-ZJGZDOQO.js → chunk-ICYC5YNI.js} +6 -6
- package/dist/{chunk-KR5EGWI4.js → chunk-IUATR5UE.js} +27 -5
- package/dist/chunk-IUATR5UE.js.map +1 -0
- package/dist/{chunk-AFBJHD55.js → chunk-JGOKAZNB.js} +5 -5
- package/dist/{chunk-XGVDLQJE.js → chunk-JOCMXSR2.js} +3 -3
- package/dist/{chunk-XGVDLQJE.js.map → chunk-JOCMXSR2.js.map} +1 -1
- package/dist/{chunk-HGVFJL63.js → chunk-JTIPVW4J.js} +15 -5
- package/dist/{chunk-HGVFJL63.js.map → chunk-JTIPVW4J.js.map} +1 -1
- package/dist/{chunk-QXPOEAKR.js → chunk-KCZAFDP5.js} +2 -2
- package/dist/{chunk-MSO2C3KG.js → chunk-LC7DSMHR.js} +2 -2
- package/dist/{chunk-OVFCAS7U.js → chunk-LG2GUYRX.js} +9 -9
- package/dist/{chunk-2KL6NDD4.js → chunk-LN3MQFUE.js} +56 -4
- package/dist/chunk-LN3MQFUE.js.map +1 -0
- package/dist/{chunk-QUIG6BZT.js → chunk-M4GO4ZJK.js} +226 -36
- package/dist/chunk-M4GO4ZJK.js.map +1 -0
- package/dist/{chunk-QDNVHA2F.js → chunk-M7W2KYTL.js} +2 -2
- package/dist/{chunk-XULHFSHO.js → chunk-MLCTPWSO.js} +5 -5
- package/dist/chunk-MLCTPWSO.js.map +1 -0
- package/dist/{chunk-PEY6ZTCF.js → chunk-MMVQ3SUO.js} +9 -9
- package/dist/{chunk-PEY6ZTCF.js.map → chunk-MMVQ3SUO.js.map} +1 -1
- package/dist/{chunk-4X6DJZHY.js → chunk-MPPWL64H.js} +26 -43
- package/dist/chunk-MPPWL64H.js.map +1 -0
- package/dist/{chunk-QYJIOWKN.js → chunk-MQBFT2OT.js} +11 -9
- package/dist/chunk-MQBFT2OT.js.map +1 -0
- package/dist/{chunk-IUIVDVXM.js → chunk-MUPZ6IZX.js} +2 -2
- package/dist/{chunk-GZ2GKOF6.js → chunk-NA374QG7.js} +3 -3
- package/dist/chunk-NIKO2BBZ.js +23 -0
- package/dist/chunk-NIKO2BBZ.js.map +1 -0
- package/dist/{chunk-2U7Y7BNJ.js → chunk-ONB627HU.js} +2 -2
- package/dist/{chunk-GYB2QK5H.js → chunk-OWLZONGX.js} +2 -2
- package/dist/{chunk-YHPUDB7Q.js → chunk-OWOT7CFC.js} +2 -2
- package/dist/{chunk-VEX6G3YL.js → chunk-P4NUJVWL.js} +2 -2
- package/dist/chunk-PEOZ34EM.js +13 -0
- package/dist/chunk-PEOZ34EM.js.map +1 -0
- package/dist/{chunk-NM4LVUXH.js → chunk-PTT2NB46.js} +2 -2
- package/dist/chunk-PVEWA2DU.js +23 -0
- package/dist/chunk-PVEWA2DU.js.map +1 -0
- package/dist/{chunk-2ITLQZV5.js → chunk-PWWWMRT7.js} +2 -2
- package/dist/{chunk-FLHOTGOO.js → chunk-QVGEVZ5F.js} +3 -3
- package/dist/{chunk-HKR25MGX.js → chunk-QVIZDLAR.js} +10 -10
- package/dist/chunk-QVIZDLAR.js.map +1 -0
- package/dist/{chunk-OOTTXUNV.js → chunk-RM5EXCFF.js} +2 -2
- package/dist/{chunk-OOTTXUNV.js.map → chunk-RM5EXCFF.js.map} +1 -1
- package/dist/{chunk-OGFPMCSP.js → chunk-SBOHNJUD.js} +2 -2
- package/dist/{chunk-EDC6MLXV.js → chunk-SEU6QHH4.js} +2 -2
- package/dist/chunk-SMY5X46Z.js +14 -0
- package/dist/chunk-SMY5X46Z.js.map +1 -0
- package/dist/{chunk-F4COUZLL.js → chunk-TMR64XPL.js} +2 -2
- package/dist/{chunk-5OZCCLNC.js → chunk-TSNRZSRC.js} +2 -2
- package/dist/{chunk-2RMDVWGB.js → chunk-UNREYBZO.js} +2 -2
- package/dist/{chunk-BLB7P7LS.js → chunk-V2R2VWER.js} +176 -17
- package/dist/chunk-V2R2VWER.js.map +1 -0
- package/dist/{chunk-3XVOLB75.js → chunk-VDTWFN2P.js} +7 -5
- package/dist/chunk-VDTWFN2P.js.map +1 -0
- package/dist/chunk-VKQCVU2Z.js +21 -0
- package/dist/chunk-VKQCVU2Z.js.map +1 -0
- package/dist/{chunk-QCUH2G77.js → chunk-VNJMLOQS.js} +6 -6
- package/dist/{chunk-UEO5CHOP.js → chunk-WCJJQV2D.js} +13 -13
- package/dist/chunk-WCJJQV2D.js.map +1 -0
- package/dist/{chunk-25ZDB25Z.js → chunk-WWBC4KLB.js} +3 -3
- package/dist/chunk-WWBC4KLB.js.map +1 -0
- package/dist/{chunk-V7RGFJ3Z.js → chunk-XG7OZDOS.js} +6 -6
- package/dist/{chunk-GS3Q2KOZ.js → chunk-XONZGK6J.js} +2 -2
- package/dist/{chunk-5SZ24DL5.js → chunk-XSOGLHGY.js} +6 -6
- package/dist/{chunk-CCT4WZI6.js → chunk-XY6MNSAF.js} +5 -5
- package/dist/chunk-XY6MNSAF.js.map +1 -0
- package/dist/chunk-XZHEOSQ2.js +16 -0
- package/dist/chunk-XZHEOSQ2.js.map +1 -0
- package/dist/{chunk-NOT7XA7Q.js → chunk-YGMREQAK.js} +5 -5
- package/dist/{chunk-H4SMS4O2.js → chunk-YJ3TREAC.js} +2 -2
- package/dist/chunk-YMUFFJCO.js +23 -0
- package/dist/chunk-YMUFFJCO.js.map +1 -0
- package/dist/{chunk-E2R5NRZD.js → chunk-Z4D3YGAB.js} +2 -2
- package/dist/{chunk-WJDYZP3U.js → chunk-ZDFU34XY.js} +42 -39
- package/dist/chunk-ZDFU34XY.js.map +1 -0
- package/dist/{chunk-BZK6JEX4.js → chunk-ZF572E2M.js} +5 -5
- package/dist/{chunk-DEQ2JTBR.js → chunk-ZGEFBDPR.js} +4 -4
- package/dist/chunk-ZGEFBDPR.js.map +1 -0
- package/dist/{chunk-QAFWRGVD.js → chunk-ZHMUFYZF.js} +7 -7
- package/dist/{chunk-BVZGNMVM.js → chunk-ZHZ4PET5.js} +3 -3
- package/dist/{chunk-IZX3WZBF.js → chunk-ZM72UO3Y.js} +4 -4
- package/dist/{chunk-STR7WBOB.js → chunk-ZUDAK436.js} +2 -2
- package/dist/{chunk-ITI3SJRB.js → chunk-ZX5FNWH7.js} +2 -2
- package/dist/classified/index.js +5 -5
- package/dist/{classified-marker-7S5IEP6Q.js → classified-marker-SVDRXLD3.js} +3 -3
- package/dist/collection-facade-S5PPKZD5.js +44 -0
- package/dist/{computed-WZNKRLCY.js → computed-33DRJDOC.js} +3 -3
- package/dist/consent/index.js +13 -9
- package/dist/consent/index.js.map +1 -1
- package/dist/{cover-B5MY43CK.js → cover-ADBCTIKN.js} +4 -4
- package/dist/crdt/index.js +4 -0
- package/dist/crdt/index.js.map +1 -1
- package/dist/{dead-filter-KRRD57MR.js → dead-filter-HKDMTMVY.js} +2 -2
- package/dist/delegation-EV7LKJPH.js +25 -0
- package/dist/derivations/index.js +12 -12
- package/dist/derive-5LDJW76F.js +21 -0
- package/dist/dispatch-SPMYNXNW.js +194 -0
- package/dist/dispatch-SPMYNXNW.js.map +1 -0
- package/dist/dispatch-V5MSMQYX.js +72 -0
- package/dist/dispatch-V5MSMQYX.js.map +1 -0
- package/dist/{enclave-YFKA3GJT.js → enclave-ZA7C3H2L.js} +11 -11
- package/dist/executor-FCJEH3FU.js +9 -0
- package/dist/executor-OHET7TF7.js +9 -0
- package/dist/executor-SVHAJZ4A.js +28 -0
- package/dist/export-accessible-S35YKIBL.js +23 -0
- package/dist/extract-partition-UVHAM5WZ.js +38 -0
- package/dist/{fanout-sidecar-HJV3A7PM.js → fanout-sidecar-HRMHC34B.js} +9 -9
- package/dist/find-LEBUXVL7.js +11 -0
- package/dist/forget/index.js +9 -9
- package/dist/guards/index.js +3 -3
- package/dist/history/index.js +16 -12
- package/dist/history/index.js.map +1 -1
- package/dist/i18n/index.js +16 -14
- package/dist/i18n/index.js.map +1 -1
- package/dist/index.d.ts +17 -16
- package/dist/index.js +155 -211
- package/dist/index.js.map +1 -1
- package/dist/indexing/index.js +4 -2
- package/dist/indexing/index.js.map +1 -1
- package/dist/issue-5X3SMCF4.js +19 -0
- package/dist/kernel/collection.d.ts +0 -1
- package/dist/kernel/enclave/crypto.d.ts +8 -8
- package/dist/kernel/enclave/index.d.ts +2 -2
- package/dist/kernel/errors.d.ts +20 -20
- package/dist/kernel/lazy.d.ts +30 -0
- package/dist/kernel/noydb.d.ts +53 -101
- package/dist/kernel/query/builder.d.ts +10 -10
- package/dist/kernel/query/index.d.ts +0 -6
- package/dist/kernel/query/scan-builder.d.ts +4 -4
- package/dist/kernel/types.d.ts +87 -46
- package/dist/kernel/validation.d.ts +33 -33
- package/dist/kernel/vault.d.ts +12 -149
- package/dist/kernel/via/dispatch.d.ts +7 -0
- package/dist/{ledger-SW6QQOAV.js → ledger-K6JBFL3Z.js} +11 -11
- package/dist/liberate-NHTCKBU4.js +24 -0
- package/dist/{link-set-GNGGCFI4.js → link-set-XVZY2ODC.js} +11 -11
- package/dist/materialized-views/index.js +22 -19
- package/dist/noydb-TI3RFU6M.js +78 -0
- package/dist/overlay-views/index.js +4 -4
- package/dist/periods/index.js +15 -13
- package/dist/pod/index.js +11 -12
- package/dist/{policy-EAXSJNOT.js → policy-QWGJB7P7.js} +5 -5
- package/dist/port/with/collection-options.d.ts +171 -0
- package/dist/port/with/collection-registries.d.ts +62 -0
- package/dist/port/with/strategies.d.ts +2 -2
- package/dist/port/with/team-strategy.d.ts +3 -2
- package/dist/portability/index.js +8 -8
- package/dist/{post-register-A7HCFBP5.js → post-register-5VHHVFJY.js} +6 -6
- package/dist/query/index.js +6 -46
- package/dist/{aggregate → reduce}/index.js +24 -17
- package/dist/reduce/index.js.map +1 -0
- package/dist/register-CEX7R7NE.js +23 -0
- package/dist/registry-7CZWF3EQ.js +9 -0
- package/dist/registry-DIKMRXUC.js +19 -0
- package/dist/registry-EWIB5NTI.js +18 -0
- package/dist/request-withdrawal-AAG57QO4.js +31 -0
- package/dist/{reveal-PB3YG544.js → reveal-7OOT5XPD.js} +6 -6
- package/dist/revoke-U5LCIJMF.js +24 -0
- package/dist/satellites/index.js +1 -1
- package/dist/sealed-record/index.js +12 -12
- package/dist/{seed-EKF4DIBB.js → seed-GVOI6QP6.js} +12 -12
- package/dist/seed-GVOI6QP6.js.map +1 -0
- package/dist/session/index.js +13 -9
- package/dist/session/index.js.map +1 -1
- package/dist/shadow/index.js +6 -2
- package/dist/shadow/index.js.map +1 -1
- package/dist/signer-NAA2OX7H.js +25 -0
- package/dist/snapshots/index.js +14 -10
- package/dist/snapshots/index.js.map +1 -1
- package/dist/{stale-4UNPHWOU.js → stale-BJO2WIN7.js} +11 -10
- package/dist/storage-FL7XXZTN.js +23 -0
- package/dist/{store-coordination-provider-3AELCZ4Y.js → store-coordination-provider-DX5HECK3.js} +3 -3
- package/dist/sync/index.js +14 -10
- package/dist/sync/index.js.map +1 -1
- package/dist/team/index.js +26 -28
- package/dist/tiers/index.js +10 -10
- package/dist/to/index.js +1 -1
- package/dist/tx/index.js +7 -3
- package/dist/tx/index.js.map +1 -1
- package/dist/util/index.js +1 -1
- package/dist/{verify-MXN66IIH.js → verify-5X37OXRY.js} +5 -5
- package/dist/via/blob/index.d.ts +2 -0
- package/dist/via/i18n/core.d.ts +1 -1
- package/dist/via/i18n/index.d.ts +2 -0
- package/dist/via/money/money-reducer.d.ts +2 -2
- package/dist/{walk-H4YE52S2.js → walk-JXMWKKQW.js} +11 -11
- package/dist/with-audit/consent/index.d.ts +2 -0
- package/dist/with-audit/periods/index.d.ts +2 -0
- package/dist/with-audit/portability/export-accessible.d.ts +4 -4
- package/dist/with-audit/portability/request-withdrawal.d.ts +3 -3
- package/dist/with-audit/portability/withdraw-accessible.d.ts +2 -2
- package/dist/with-audit/sealed-record/strategy.d.ts +1 -1
- package/dist/with-cargo/adopt-partition.d.ts +7 -7
- package/dist/with-cargo/floor.d.ts +3 -3
- package/dist/with-cargo/index.d.ts +1 -1
- package/dist/with-commit/crdt/index.d.ts +2 -0
- package/dist/with-commit/history/index.d.ts +2 -0
- package/dist/with-commit/history/time-machine.d.ts +2 -2
- package/dist/with-fork/shadow/index.d.ts +2 -0
- package/dist/with-fork/snapshots/index.d.ts +2 -0
- package/dist/with-formula/derivations/dispatch.d.ts +98 -0
- package/dist/with-formula/materialized-views/dispatch.d.ts +75 -0
- package/dist/with-formula/materialized-views/types.d.ts +7 -7
- package/dist/with-lookup/indexing/index.d.ts +2 -0
- package/dist/with-lookup/{aggregate → reduce}/active.d.ts +8 -8
- package/dist/with-lookup/{aggregate → reduce}/groupby.d.ts +21 -21
- package/dist/with-lookup/reduce/index.d.ts +34 -0
- package/dist/with-lookup/{aggregate → reduce}/reducers.d.ts +10 -10
- package/dist/with-lookup/{aggregate/aggregation.d.ts → reduce/reduction.d.ts} +21 -21
- package/dist/with-lookup/{aggregate → reduce}/strategy.d.ts +15 -15
- package/dist/with-party/custody/liberate.d.ts +3 -3
- package/dist/with-party/session/dev-unlock.d.ts +2 -2
- package/dist/with-party/session/index.d.ts +2 -0
- package/dist/with-party/session/session.d.ts +2 -2
- package/dist/with-party/sync/index.d.ts +2 -0
- package/dist/with-party/team/deed.d.ts +8 -8
- package/dist/with-party/team/index.d.ts +2 -2
- package/dist/with-party/team/keyring.d.ts +39 -20
- package/dist/with-party/team/{managed-passphrase.d.ts → managed-secret.d.ts} +27 -27
- package/dist/with-party/team/noydb-facade.d.ts +43 -42
- package/dist/with-party/team/peer-recover.d.ts +13 -13
- package/dist/with-party/team/recovery.d.ts +5 -5
- package/dist/with-party/team/rotate-recover.d.ts +30 -30
- package/dist/with-pod/bundle.d.ts +30 -30
- package/dist/with-pod/format.d.ts +2 -2
- package/dist/withdraw-accessible-GO6KQJVM.js +28 -0
- package/package.json +6 -34
- package/dist/aggregate/index.js.map +0 -1
- package/dist/api-UPAT2O3M.js +0 -20
- package/dist/as/index.js +0 -30
- package/dist/at/index.js +0 -1
- package/dist/by/index.js +0 -11
- package/dist/chunk-25ZDB25Z.js.map +0 -1
- package/dist/chunk-2KL6NDD4.js.map +0 -1
- package/dist/chunk-2YELV6TV.js +0 -1
- package/dist/chunk-3O62PVDW.js +0 -205
- package/dist/chunk-3O62PVDW.js.map +0 -1
- package/dist/chunk-3XVOLB75.js.map +0 -1
- package/dist/chunk-4X6DJZHY.js.map +0 -1
- package/dist/chunk-5BHNQNBI.js.map +0 -1
- package/dist/chunk-5P5AAXYA.js.map +0 -1
- package/dist/chunk-BCOKZC4B.js.map +0 -1
- package/dist/chunk-BLB7P7LS.js.map +0 -1
- package/dist/chunk-CCT4WZI6.js.map +0 -1
- package/dist/chunk-CGPO3ZYB.js.map +0 -1
- package/dist/chunk-DEQ2JTBR.js.map +0 -1
- package/dist/chunk-GBEXTC6Z.js.map +0 -1
- package/dist/chunk-HKR25MGX.js.map +0 -1
- package/dist/chunk-IGM563N5.js.map +0 -1
- package/dist/chunk-J3VW4J4E.js.map +0 -1
- package/dist/chunk-JA5O7UEZ.js.map +0 -1
- package/dist/chunk-JIMEB4C6.js.map +0 -1
- package/dist/chunk-KMONEHDJ.js +0 -54
- package/dist/chunk-KMONEHDJ.js.map +0 -1
- package/dist/chunk-KR5EGWI4.js.map +0 -1
- package/dist/chunk-LB7FD65R.js +0 -163
- package/dist/chunk-LB7FD65R.js.map +0 -1
- package/dist/chunk-MEKAMERX.js.map +0 -1
- package/dist/chunk-QUIG6BZT.js.map +0 -1
- package/dist/chunk-QYJIOWKN.js.map +0 -1
- package/dist/chunk-U73LHVPF.js.map +0 -1
- package/dist/chunk-UEO5CHOP.js.map +0 -1
- package/dist/chunk-W7TCXZWU.js.map +0 -1
- package/dist/chunk-WEC3JGBA.js +0 -255
- package/dist/chunk-WEC3JGBA.js.map +0 -1
- package/dist/chunk-WJDYZP3U.js.map +0 -1
- package/dist/chunk-XULHFSHO.js.map +0 -1
- package/dist/collection-facade-CMZGQ6IS.js +0 -44
- package/dist/delegation-UT76AQIG.js +0 -25
- package/dist/derive-SGRCCKVP.js +0 -21
- package/dist/executor-TEZYRDN3.js +0 -9
- package/dist/executor-WQQRU6DO.js +0 -9
- package/dist/executor-YORMIBWV.js +0 -26
- package/dist/export-accessible-HXMKW5LJ.js +0 -23
- package/dist/extract-partition-QGQ2R42J.js +0 -38
- package/dist/find-VV6PBIHK.js +0 -11
- package/dist/in/index.js +0 -1
- package/dist/issue-7JJ4Z7E2.js +0 -19
- package/dist/liberate-FK7JI2QX.js +0 -24
- package/dist/noydb-N5IW6OFZ.js +0 -70
- package/dist/on/index.js +0 -17
- package/dist/port/as/index.d.ts +0 -26
- package/dist/port/at/index.d.ts +0 -18
- package/dist/port/in/index.d.ts +0 -21
- package/dist/port/on/index.d.ts +0 -27
- package/dist/port/ui/index.d.ts +0 -21
- package/dist/port/with/index.d.ts +0 -18
- package/dist/register-YBMRLZLO.js +0 -23
- package/dist/registry-3LXKNXWI.js +0 -9
- package/dist/registry-4V4YQCXJ.js +0 -19
- package/dist/registry-ZULMLCJK.js +0 -18
- package/dist/request-withdrawal-SEVUEUDG.js +0 -31
- package/dist/request-withdrawal-SEVUEUDG.js.map +0 -1
- package/dist/revoke-5QULL5GT.js +0 -24
- package/dist/revoke-5QULL5GT.js.map +0 -1
- package/dist/seed-EKF4DIBB.js.map +0 -1
- package/dist/signer-ZMH35FT4.js +0 -25
- package/dist/signer-ZMH35FT4.js.map +0 -1
- package/dist/stale-4UNPHWOU.js.map +0 -1
- package/dist/storage-QOZKQMID.js +0 -23
- package/dist/storage-QOZKQMID.js.map +0 -1
- package/dist/ui/index.js +0 -1
- package/dist/ui/index.js.map +0 -1
- package/dist/with/index.js +0 -31
- package/dist/with/index.js.map +0 -1
- package/dist/with-lookup/aggregate/index.d.ts +0 -23
- package/dist/withdraw-accessible-HPOVNG2G.js +0 -28
- package/dist/withdraw-accessible-HPOVNG2G.js.map +0 -1
- /package/dist/{api-UPAT2O3M.js.map → api-5QVQX4HG.js.map} +0 -0
- /package/dist/{backup-JL2GOTYQ.js.map → backup-USYSNCYM.js.map} +0 -0
- /package/dist/{chunk-JLHKBAFY.js.map → chunk-2BVW754E.js.map} +0 -0
- /package/dist/{chunk-T7S4V52L.js.map → chunk-2PDBYF2O.js.map} +0 -0
- /package/dist/{chunk-YGBIBOCR.js.map → chunk-2ZSC454H.js.map} +0 -0
- /package/dist/{chunk-IGAIOGCN.js.map → chunk-32467U5J.js.map} +0 -0
- /package/dist/{chunk-JW3XCZA2.js.map → chunk-3TZUC4WS.js.map} +0 -0
- /package/dist/{chunk-JA5B3SLH.js.map → chunk-44Y3P5U6.js.map} +0 -0
- /package/dist/{chunk-25G7U6RD.js.map → chunk-4B3DL75F.js.map} +0 -0
- /package/dist/{chunk-L4OA7G5T.js.map → chunk-522MBPE5.js.map} +0 -0
- /package/dist/{chunk-M25ZIEB2.js.map → chunk-5HSSTOOG.js.map} +0 -0
- /package/dist/{chunk-LLVW4V7R.js.map → chunk-5WLDZZ6S.js.map} +0 -0
- /package/dist/{chunk-7B4GPCX7.js.map → chunk-7IQWHYL2.js.map} +0 -0
- /package/dist/{chunk-OWE4BNTM.js.map → chunk-AZXEOEQK.js.map} +0 -0
- /package/dist/{chunk-BZEPJJOK.js.map → chunk-C2V7AJO2.js.map} +0 -0
- /package/dist/{chunk-2JZ763FV.js.map → chunk-D4LAJ737.js.map} +0 -0
- /package/dist/{chunk-N4FZ6ITM.js.map → chunk-EGU4PWQW.js.map} +0 -0
- /package/dist/{chunk-EW4HFWGJ.js.map → chunk-EPME33Y4.js.map} +0 -0
- /package/dist/{chunk-JKWNG3TM.js.map → chunk-FHHYCBBP.js.map} +0 -0
- /package/dist/{chunk-5BB3N4KU.js.map → chunk-G4MFQXYX.js.map} +0 -0
- /package/dist/{chunk-KVHWEPT2.js.map → chunk-GHEMAVTN.js.map} +0 -0
- /package/dist/{chunk-XW7NWO4A.js.map → chunk-GTNRMJYH.js.map} +0 -0
- /package/dist/{chunk-YG2EG6CB.js.map → chunk-H5GMROCB.js.map} +0 -0
- /package/dist/{chunk-5KI3REO3.js.map → chunk-HDF5R2K6.js.map} +0 -0
- /package/dist/{chunk-V3YB7RGR.js.map → chunk-HVPW6PCX.js.map} +0 -0
- /package/dist/{chunk-2VUISNGP.js.map → chunk-HXVRRJBD.js.map} +0 -0
- /package/dist/{chunk-ZJGZDOQO.js.map → chunk-ICYC5YNI.js.map} +0 -0
- /package/dist/{chunk-AFBJHD55.js.map → chunk-JGOKAZNB.js.map} +0 -0
- /package/dist/{chunk-QXPOEAKR.js.map → chunk-KCZAFDP5.js.map} +0 -0
- /package/dist/{chunk-MSO2C3KG.js.map → chunk-LC7DSMHR.js.map} +0 -0
- /package/dist/{chunk-OVFCAS7U.js.map → chunk-LG2GUYRX.js.map} +0 -0
- /package/dist/{chunk-QDNVHA2F.js.map → chunk-M7W2KYTL.js.map} +0 -0
- /package/dist/{chunk-IUIVDVXM.js.map → chunk-MUPZ6IZX.js.map} +0 -0
- /package/dist/{chunk-GZ2GKOF6.js.map → chunk-NA374QG7.js.map} +0 -0
- /package/dist/{chunk-2U7Y7BNJ.js.map → chunk-ONB627HU.js.map} +0 -0
- /package/dist/{chunk-GYB2QK5H.js.map → chunk-OWLZONGX.js.map} +0 -0
- /package/dist/{chunk-YHPUDB7Q.js.map → chunk-OWOT7CFC.js.map} +0 -0
- /package/dist/{chunk-VEX6G3YL.js.map → chunk-P4NUJVWL.js.map} +0 -0
- /package/dist/{chunk-NM4LVUXH.js.map → chunk-PTT2NB46.js.map} +0 -0
- /package/dist/{chunk-2ITLQZV5.js.map → chunk-PWWWMRT7.js.map} +0 -0
- /package/dist/{chunk-FLHOTGOO.js.map → chunk-QVGEVZ5F.js.map} +0 -0
- /package/dist/{chunk-OGFPMCSP.js.map → chunk-SBOHNJUD.js.map} +0 -0
- /package/dist/{chunk-EDC6MLXV.js.map → chunk-SEU6QHH4.js.map} +0 -0
- /package/dist/{chunk-F4COUZLL.js.map → chunk-TMR64XPL.js.map} +0 -0
- /package/dist/{chunk-5OZCCLNC.js.map → chunk-TSNRZSRC.js.map} +0 -0
- /package/dist/{chunk-2RMDVWGB.js.map → chunk-UNREYBZO.js.map} +0 -0
- /package/dist/{chunk-QCUH2G77.js.map → chunk-VNJMLOQS.js.map} +0 -0
- /package/dist/{chunk-V7RGFJ3Z.js.map → chunk-XG7OZDOS.js.map} +0 -0
- /package/dist/{chunk-GS3Q2KOZ.js.map → chunk-XONZGK6J.js.map} +0 -0
- /package/dist/{chunk-5SZ24DL5.js.map → chunk-XSOGLHGY.js.map} +0 -0
- /package/dist/{chunk-NOT7XA7Q.js.map → chunk-YGMREQAK.js.map} +0 -0
- /package/dist/{chunk-H4SMS4O2.js.map → chunk-YJ3TREAC.js.map} +0 -0
- /package/dist/{chunk-E2R5NRZD.js.map → chunk-Z4D3YGAB.js.map} +0 -0
- /package/dist/{chunk-BZK6JEX4.js.map → chunk-ZF572E2M.js.map} +0 -0
- /package/dist/{chunk-QAFWRGVD.js.map → chunk-ZHMUFYZF.js.map} +0 -0
- /package/dist/{chunk-BVZGNMVM.js.map → chunk-ZHZ4PET5.js.map} +0 -0
- /package/dist/{chunk-IZX3WZBF.js.map → chunk-ZM72UO3Y.js.map} +0 -0
- /package/dist/{chunk-STR7WBOB.js.map → chunk-ZUDAK436.js.map} +0 -0
- /package/dist/{chunk-ITI3SJRB.js.map → chunk-ZX5FNWH7.js.map} +0 -0
- /package/dist/{classified-marker-7S5IEP6Q.js.map → classified-marker-SVDRXLD3.js.map} +0 -0
- /package/dist/{as/index.js.map → collection-facade-S5PPKZD5.js.map} +0 -0
- /package/dist/{at/index.js.map → computed-33DRJDOC.js.map} +0 -0
- /package/dist/{by/index.js.map → cover-ADBCTIKN.js.map} +0 -0
- /package/dist/{dead-filter-KRRD57MR.js.map → dead-filter-HKDMTMVY.js.map} +0 -0
- /package/dist/{chunk-2YELV6TV.js.map → delegation-EV7LKJPH.js.map} +0 -0
- /package/dist/{collection-facade-CMZGQ6IS.js.map → derive-5LDJW76F.js.map} +0 -0
- /package/dist/{computed-WZNKRLCY.js.map → enclave-ZA7C3H2L.js.map} +0 -0
- /package/dist/{cover-B5MY43CK.js.map → executor-FCJEH3FU.js.map} +0 -0
- /package/dist/{delegation-UT76AQIG.js.map → executor-OHET7TF7.js.map} +0 -0
- /package/dist/{derive-SGRCCKVP.js.map → executor-SVHAJZ4A.js.map} +0 -0
- /package/dist/{enclave-YFKA3GJT.js.map → export-accessible-S35YKIBL.js.map} +0 -0
- /package/dist/{executor-TEZYRDN3.js.map → extract-partition-UVHAM5WZ.js.map} +0 -0
- /package/dist/{fanout-sidecar-HJV3A7PM.js.map → fanout-sidecar-HRMHC34B.js.map} +0 -0
- /package/dist/{executor-WQQRU6DO.js.map → find-LEBUXVL7.js.map} +0 -0
- /package/dist/{executor-YORMIBWV.js.map → issue-5X3SMCF4.js.map} +0 -0
- /package/dist/{export-accessible-HXMKW5LJ.js.map → ledger-K6JBFL3Z.js.map} +0 -0
- /package/dist/{extract-partition-QGQ2R42J.js.map → liberate-NHTCKBU4.js.map} +0 -0
- /package/dist/{find-VV6PBIHK.js.map → link-set-XVZY2ODC.js.map} +0 -0
- /package/dist/{in/index.js.map → noydb-TI3RFU6M.js.map} +0 -0
- /package/dist/{issue-7JJ4Z7E2.js.map → policy-QWGJB7P7.js.map} +0 -0
- /package/dist/{post-register-A7HCFBP5.js.map → post-register-5VHHVFJY.js.map} +0 -0
- /package/dist/{ledger-SW6QQOAV.js.map → register-CEX7R7NE.js.map} +0 -0
- /package/dist/{liberate-FK7JI2QX.js.map → registry-7CZWF3EQ.js.map} +0 -0
- /package/dist/{link-set-GNGGCFI4.js.map → registry-DIKMRXUC.js.map} +0 -0
- /package/dist/{noydb-N5IW6OFZ.js.map → registry-EWIB5NTI.js.map} +0 -0
- /package/dist/{on/index.js.map → request-withdrawal-AAG57QO4.js.map} +0 -0
- /package/dist/{reveal-PB3YG544.js.map → reveal-7OOT5XPD.js.map} +0 -0
- /package/dist/{policy-EAXSJNOT.js.map → revoke-U5LCIJMF.js.map} +0 -0
- /package/dist/{register-YBMRLZLO.js.map → signer-NAA2OX7H.js.map} +0 -0
- /package/dist/{registry-3LXKNXWI.js.map → stale-BJO2WIN7.js.map} +0 -0
- /package/dist/{registry-4V4YQCXJ.js.map → storage-FL7XXZTN.js.map} +0 -0
- /package/dist/{store-coordination-provider-3AELCZ4Y.js.map → store-coordination-provider-DX5HECK3.js.map} +0 -0
- /package/dist/{verify-MXN66IIH.js.map → verify-5X37OXRY.js.map} +0 -0
- /package/dist/{walk-H4YE52S2.js.map → walk-JXMWKKQW.js.map} +0 -0
- /package/dist/with-lookup/{aggregate → reduce}/canonical-key.d.ts +0 -0
- /package/dist/{registry-ZULMLCJK.js.map → withdraw-accessible-GO6KQJVM.js.map} +0 -0
package/README.md
CHANGED
|
@@ -60,7 +60,7 @@ type Invoice = { id: string; amount: number; customer: string }
|
|
|
60
60
|
const db = await createNoydb({
|
|
61
61
|
store: memory(),
|
|
62
62
|
userId: 'alice',
|
|
63
|
-
|
|
63
|
+
secret: 'correct horse battery staple',
|
|
64
64
|
})
|
|
65
65
|
|
|
66
66
|
const acme = await db.openVault('acme')
|
|
@@ -85,7 +85,7 @@ When a single principal holds grants across many vaults — multi-tenant apps, m
|
|
|
85
85
|
|
|
86
86
|
### `db.listAccessibleVaults(options?)` — enumerate
|
|
87
87
|
|
|
88
|
-
Returns every vault the calling principal can unwrap, optionally filtered by minimum role. The walk is bounded by the local keyring index — vaults where the user has no keyring file or where the
|
|
88
|
+
Returns every vault the calling principal can unwrap, optionally filtered by minimum role. The walk is bounded by the local keyring index — vaults where the user has no keyring file or where the secret doesn't unwrap are silently dropped from the result.
|
|
89
89
|
|
|
90
90
|
```ts
|
|
91
91
|
// All vaults I can unlock
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import {
|
|
2
|
+
UserApi,
|
|
3
|
+
createUserApi
|
|
4
|
+
} from "./chunk-NA374QG7.js";
|
|
5
|
+
import "./chunk-7IQWHYL2.js";
|
|
6
|
+
import "./chunk-MMVQ3SUO.js";
|
|
7
|
+
import "./chunk-KCZAFDP5.js";
|
|
8
|
+
import "./chunk-5WLDZZ6S.js";
|
|
9
|
+
import "./chunk-5HSSTOOG.js";
|
|
10
|
+
import "./chunk-G4MFQXYX.js";
|
|
11
|
+
import "./chunk-LP7BEXCT.js";
|
|
12
|
+
import "./chunk-7U6AB7DZ.js";
|
|
13
|
+
import "./chunk-DOZFU7OZ.js";
|
|
14
|
+
import "./chunk-6SYOHUHM.js";
|
|
15
|
+
import "./chunk-PZ5AY32C.js";
|
|
16
|
+
export {
|
|
17
|
+
UserApi,
|
|
18
|
+
createUserApi
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=api-5QVQX4HG.js.map
|
|
@@ -1,42 +1,42 @@
|
|
|
1
1
|
import {
|
|
2
2
|
issueAttestationCore
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-HXVRRJBD.js";
|
|
4
4
|
import {
|
|
5
5
|
getRevokedDocIdsCore,
|
|
6
6
|
publishRevocationListCore,
|
|
7
7
|
revokeDocCore,
|
|
8
8
|
unrevokeDocCore
|
|
9
|
-
} from "../chunk-
|
|
9
|
+
} from "../chunk-VNJMLOQS.js";
|
|
10
10
|
import {
|
|
11
11
|
ATTESTATIONS_COLLECTION
|
|
12
|
-
} from "../chunk-
|
|
12
|
+
} from "../chunk-JGOKAZNB.js";
|
|
13
13
|
import {
|
|
14
14
|
NO_ATTESTATION
|
|
15
|
-
} from "../chunk-
|
|
15
|
+
} from "../chunk-GTNRMJYH.js";
|
|
16
16
|
import "../chunk-ZJADGNYF.js";
|
|
17
|
-
import "../chunk-
|
|
18
|
-
import "../chunk-
|
|
19
|
-
import "../chunk-
|
|
20
|
-
import "../chunk-
|
|
21
|
-
import "../chunk-
|
|
17
|
+
import "../chunk-MMVQ3SUO.js";
|
|
18
|
+
import "../chunk-KCZAFDP5.js";
|
|
19
|
+
import "../chunk-5WLDZZ6S.js";
|
|
20
|
+
import "../chunk-5HSSTOOG.js";
|
|
21
|
+
import "../chunk-G4MFQXYX.js";
|
|
22
22
|
import "../chunk-LP7BEXCT.js";
|
|
23
|
-
import "../chunk-
|
|
24
|
-
import "../chunk-
|
|
23
|
+
import "../chunk-7U6AB7DZ.js";
|
|
24
|
+
import "../chunk-DOZFU7OZ.js";
|
|
25
25
|
import {
|
|
26
26
|
AttestationError,
|
|
27
27
|
AttestationNotEnabledError
|
|
28
|
-
} from "../chunk-
|
|
28
|
+
} from "../chunk-6SYOHUHM.js";
|
|
29
29
|
import "../chunk-PZ5AY32C.js";
|
|
30
30
|
|
|
31
31
|
// src/with-audit/attestation/active.ts
|
|
32
32
|
function withAttestation() {
|
|
33
33
|
return {
|
|
34
34
|
async issueAttestation(ctx, args) {
|
|
35
|
-
const { issueAttestationCore: issueAttestationCore2 } = await import("../issue-
|
|
35
|
+
const { issueAttestationCore: issueAttestationCore2 } = await import("../issue-5X3SMCF4.js");
|
|
36
36
|
return issueAttestationCore2(ctx, args);
|
|
37
37
|
},
|
|
38
38
|
async getDocumentSigningPublicKey(deps) {
|
|
39
|
-
const { loadSigner, loadOrCreateSigner } = await import("../signer-
|
|
39
|
+
const { loadSigner, loadOrCreateSigner } = await import("../signer-NAA2OX7H.js");
|
|
40
40
|
const existing = await loadSigner(deps.adapter, deps.vault, deps.getDEK);
|
|
41
41
|
if (existing) return { keyId: existing.keyId, publicKeyB64: existing.publicKeyB64 };
|
|
42
42
|
if (deps.role !== "owner") {
|
|
@@ -46,19 +46,19 @@ function withAttestation() {
|
|
|
46
46
|
return { keyId: signer.keyId, publicKeyB64: signer.publicKeyB64 };
|
|
47
47
|
},
|
|
48
48
|
async revokeAttestation(ctx, docId) {
|
|
49
|
-
const { revokeDocCore: revokeDocCore2 } = await import("../revoke-
|
|
49
|
+
const { revokeDocCore: revokeDocCore2 } = await import("../revoke-U5LCIJMF.js");
|
|
50
50
|
return revokeDocCore2(ctx, docId);
|
|
51
51
|
},
|
|
52
52
|
async unrevokeAttestation(ctx, docId) {
|
|
53
|
-
const { unrevokeDocCore: unrevokeDocCore2 } = await import("../revoke-
|
|
53
|
+
const { unrevokeDocCore: unrevokeDocCore2 } = await import("../revoke-U5LCIJMF.js");
|
|
54
54
|
return unrevokeDocCore2(ctx, docId);
|
|
55
55
|
},
|
|
56
56
|
async getRevokedDocIds(ctx) {
|
|
57
|
-
const { getRevokedDocIdsCore: getRevokedDocIdsCore2 } = await import("../revoke-
|
|
57
|
+
const { getRevokedDocIdsCore: getRevokedDocIdsCore2 } = await import("../revoke-U5LCIJMF.js");
|
|
58
58
|
return getRevokedDocIdsCore2(ctx);
|
|
59
59
|
},
|
|
60
60
|
async publishRevocationList(ctx) {
|
|
61
|
-
const { publishRevocationListCore: publishRevocationListCore2 } = await import("../revoke-
|
|
61
|
+
const { publishRevocationListCore: publishRevocationListCore2 } = await import("../revoke-U5LCIJMF.js");
|
|
62
62
|
return publishRevocationListCore2(ctx);
|
|
63
63
|
}
|
|
64
64
|
};
|
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
import {
|
|
2
2
|
SEQUENCE_COLLECTION
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-YGMREQAK.js";
|
|
4
4
|
import {
|
|
5
5
|
SCHEMAS_COLLECTION
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-32467U5J.js";
|
|
7
7
|
import {
|
|
8
8
|
LEDGER_COLLECTION,
|
|
9
9
|
LEDGER_DELTAS_COLLECTION
|
|
10
10
|
} from "./chunk-I7FD46FF.js";
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-
|
|
15
|
-
import "./chunk-
|
|
11
|
+
import "./chunk-MMVQ3SUO.js";
|
|
12
|
+
import "./chunk-KCZAFDP5.js";
|
|
13
|
+
import "./chunk-5WLDZZ6S.js";
|
|
14
|
+
import "./chunk-5HSSTOOG.js";
|
|
15
|
+
import "./chunk-G4MFQXYX.js";
|
|
16
16
|
import "./chunk-LP7BEXCT.js";
|
|
17
|
-
import "./chunk-
|
|
17
|
+
import "./chunk-7U6AB7DZ.js";
|
|
18
18
|
import {
|
|
19
19
|
NOYDB_BACKUP_VERSION
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-DOZFU7OZ.js";
|
|
21
21
|
import {
|
|
22
22
|
BackupCorruptedError,
|
|
23
23
|
BackupLedgerError
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-6SYOHUHM.js";
|
|
25
25
|
import "./chunk-PZ5AY32C.js";
|
|
26
26
|
|
|
27
27
|
// src/with-pod/backup.ts
|
|
@@ -239,4 +239,4 @@ export {
|
|
|
239
239
|
loadVault,
|
|
240
240
|
verifyBackupIntegrity
|
|
241
241
|
};
|
|
242
|
-
//# sourceMappingURL=backup-
|
|
242
|
+
//# sourceMappingURL=backup-USYSNCYM.js.map
|
package/dist/blobs/index.js
CHANGED
|
@@ -6,9 +6,10 @@ import {
|
|
|
6
6
|
BLOB_EVICTION_AUDIT_COLLECTION,
|
|
7
7
|
EXPORT_AUDIT_COLLECTION,
|
|
8
8
|
ExportBlobsAbortedError,
|
|
9
|
+
NO_BLOBS,
|
|
9
10
|
createExportBlobsHandle,
|
|
10
11
|
runCompaction
|
|
11
|
-
} from "../chunk-
|
|
12
|
+
} from "../chunk-LN3MQFUE.js";
|
|
12
13
|
import {
|
|
13
14
|
BLOB_CHUNKS_COLLECTION,
|
|
14
15
|
BLOB_COLLECTION,
|
|
@@ -23,20 +24,21 @@ import {
|
|
|
23
24
|
detectMimeType,
|
|
24
25
|
isPreCompressed,
|
|
25
26
|
memoryBlobPinStore
|
|
26
|
-
} from "../chunk-
|
|
27
|
-
import "../chunk-
|
|
28
|
-
import "../chunk-
|
|
29
|
-
import "../chunk-
|
|
30
|
-
import "../chunk-
|
|
31
|
-
import "../chunk-
|
|
32
|
-
import "../chunk-
|
|
33
|
-
import "../chunk-
|
|
27
|
+
} from "../chunk-2ZSC454H.js";
|
|
28
|
+
import "../chunk-ZUDAK436.js";
|
|
29
|
+
import "../chunk-LC7DSMHR.js";
|
|
30
|
+
import "../chunk-PTT2NB46.js";
|
|
31
|
+
import "../chunk-MMVQ3SUO.js";
|
|
32
|
+
import "../chunk-KCZAFDP5.js";
|
|
33
|
+
import "../chunk-5WLDZZ6S.js";
|
|
34
|
+
import "../chunk-5HSSTOOG.js";
|
|
35
|
+
import "../chunk-G4MFQXYX.js";
|
|
34
36
|
import "../chunk-LP7BEXCT.js";
|
|
35
|
-
import "../chunk-
|
|
36
|
-
import "../chunk-
|
|
37
|
+
import "../chunk-7U6AB7DZ.js";
|
|
38
|
+
import "../chunk-DOZFU7OZ.js";
|
|
37
39
|
import {
|
|
38
40
|
BlobOfflineError
|
|
39
|
-
} from "../chunk-
|
|
41
|
+
} from "../chunk-6SYOHUHM.js";
|
|
40
42
|
import "../chunk-PZ5AY32C.js";
|
|
41
43
|
|
|
42
44
|
// src/via/blob/active.ts
|
|
@@ -63,6 +65,7 @@ export {
|
|
|
63
65
|
DEFAULT_CHUNK_SIZE,
|
|
64
66
|
EXPORT_AUDIT_COLLECTION,
|
|
65
67
|
ExportBlobsAbortedError,
|
|
68
|
+
NO_BLOBS,
|
|
66
69
|
blobPinKey,
|
|
67
70
|
createExportBlobsHandle,
|
|
68
71
|
detectMagic,
|
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 * `BlobStrategy` whose `openSlot` constructs a real `BlobSet` bound\n * to the caller's record. The returned strategy is passed into\n * `createNoydb({ blobStrategy: 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 { BlobStrategy } from '../../port/with/blob-strategy.js'\nimport { createBlobPinCache } from '../../with-shape/blobs/blob-pinning.js'\nimport type { BlobPinStore, BlobCacheStats } 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 * The strategy `withBlobs()` returns — a `BlobStrategy` plus the device-local\n * blob-cache KPI surface (#808).\n */\nexport interface BlobsService extends BlobStrategy {\n /**\n * Snapshot of this device's blob-cache KPI counters: local-read hits,\n * network misses, and total bytes downloaded from the object store.\n */\n cacheStats(): BlobCacheStats\n}\n\n/**\n * Build a default `BlobStrategy` 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 * blobStrategy: 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 = {}): BlobsService {\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 * `BlobStrategy` whose `openSlot` constructs a real `BlobSet` bound\n * to the caller's record. The returned strategy is passed into\n * `createNoydb({ blobStrategy: 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 { BlobStrategy } from '../../port/with/blob-strategy.js'\nimport { createBlobPinCache } from '../../with-shape/blobs/blob-pinning.js'\nimport type { BlobPinStore, BlobCacheStats } 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 * The strategy `withBlobs()` returns — a `BlobStrategy` plus the device-local\n * blob-cache KPI surface (#808).\n */\nexport interface BlobsService extends BlobStrategy {\n /**\n * Snapshot of this device's blob-cache KPI counters: local-read hits,\n * network misses, and total bytes downloaded from the object store.\n */\n cacheStats(): BlobCacheStats\n}\n\n/**\n * Build a default `BlobStrategy` 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 * blobStrategy: 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 = {}): BlobsService {\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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkEO,SAAS,UAAU,UAA4B,CAAC,GAAiB;AACtE,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,22 @@
|
|
|
1
1
|
import {
|
|
2
2
|
NO_BROKER
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-P4NUJVWL.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-
|
|
7
|
+
} from "../chunk-MMVQ3SUO.js";
|
|
8
|
+
import "../chunk-KCZAFDP5.js";
|
|
9
|
+
import "../chunk-5WLDZZ6S.js";
|
|
10
|
+
import "../chunk-5HSSTOOG.js";
|
|
11
|
+
import "../chunk-G4MFQXYX.js";
|
|
12
12
|
import "../chunk-LP7BEXCT.js";
|
|
13
|
-
import "../chunk-
|
|
14
|
-
import "../chunk-
|
|
13
|
+
import "../chunk-7U6AB7DZ.js";
|
|
14
|
+
import "../chunk-DOZFU7OZ.js";
|
|
15
15
|
import {
|
|
16
16
|
BrokerEnrolmentError,
|
|
17
17
|
BrokerNotEnabledError,
|
|
18
18
|
BrokerProofError
|
|
19
|
-
} from "../chunk-
|
|
19
|
+
} from "../chunk-6SYOHUHM.js";
|
|
20
20
|
import "../chunk-PZ5AY32C.js";
|
|
21
21
|
|
|
22
22
|
// src/with-party/broker/active.ts
|
|
@@ -30,7 +30,7 @@ function withBroker(config) {
|
|
|
30
30
|
const cache = /* @__PURE__ */ new Map();
|
|
31
31
|
return {
|
|
32
32
|
async enroll(ctx) {
|
|
33
|
-
const { enrollSeed } = await import("../seed-
|
|
33
|
+
const { enrollSeed } = await import("../seed-GVOI6QP6.js");
|
|
34
34
|
return enrollSeed({ ...ctx, config });
|
|
35
35
|
},
|
|
36
36
|
async rotate(ctx) {
|
|
@@ -39,7 +39,7 @@ function withBroker(config) {
|
|
|
39
39
|
const inFlight = scoped.map(([, e]) => e.inFlight).filter((p) => p !== void 0);
|
|
40
40
|
await Promise.allSettled(inFlight);
|
|
41
41
|
for (const [key] of scoped) cache.delete(key);
|
|
42
|
-
const { rotateSeed } = await import("../seed-
|
|
42
|
+
const { rotateSeed } = await import("../seed-GVOI6QP6.js");
|
|
43
43
|
return rotateSeed({ ...ctx, config });
|
|
44
44
|
},
|
|
45
45
|
credentialSource(ctx, profile) {
|
|
@@ -56,7 +56,7 @@ function withBroker(config) {
|
|
|
56
56
|
const skewMs = config.skewMs ?? DEFAULT_SKEW_MS;
|
|
57
57
|
const capturedEntry = entry;
|
|
58
58
|
const inFlight = (async () => {
|
|
59
|
-
const { mintStoreCredentials } = await import("../seed-
|
|
59
|
+
const { mintStoreCredentials } = await import("../seed-GVOI6QP6.js");
|
|
60
60
|
const creds = await mintStoreCredentials({ ...ctx, config }, profile);
|
|
61
61
|
capturedEntry.cached = { creds, validUntil: cacheFloor(creds, skewMs) };
|
|
62
62
|
return creds;
|
package/dist/cargo/index.js
CHANGED
|
@@ -3,70 +3,68 @@ import {
|
|
|
3
3
|
createOwnerOnAdoptedPartition,
|
|
4
4
|
decryptExtractedPartition,
|
|
5
5
|
describeExtraction,
|
|
6
|
+
diffVault,
|
|
6
7
|
unsealDeks,
|
|
7
8
|
withCargo
|
|
8
|
-
} from "../chunk-
|
|
9
|
+
} from "../chunk-V2R2VWER.js";
|
|
9
10
|
import {
|
|
10
11
|
CustodyApi,
|
|
11
|
-
NO_CARGO
|
|
12
|
-
|
|
12
|
+
NO_CARGO,
|
|
13
|
+
isQuorum,
|
|
14
|
+
runDrainBarrier
|
|
15
|
+
} from "../chunk-3S2YNMUS.js";
|
|
13
16
|
import {
|
|
14
17
|
extractPartition,
|
|
15
18
|
walkClosure
|
|
16
|
-
} from "../chunk-
|
|
19
|
+
} from "../chunk-LG2GUYRX.js";
|
|
17
20
|
import {
|
|
18
21
|
createDeedOwner,
|
|
19
22
|
isDeedVault,
|
|
20
23
|
liberateVault,
|
|
21
24
|
loadDeedMarker
|
|
22
|
-
} from "../chunk-
|
|
23
|
-
import "../chunk-
|
|
25
|
+
} from "../chunk-QVIZDLAR.js";
|
|
26
|
+
import "../chunk-6SSWOUUS.js";
|
|
24
27
|
import {
|
|
25
28
|
fuseRetrieval
|
|
26
29
|
} from "../chunk-AURFOK3D.js";
|
|
27
|
-
import
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
import "../chunk-
|
|
31
|
-
import "../chunk-XULHFSHO.js";
|
|
32
|
-
import "../chunk-25ZDB25Z.js";
|
|
33
|
-
import {
|
|
34
|
-
isQuorum,
|
|
35
|
-
runDrainBarrier
|
|
36
|
-
} from "../chunk-KMONEHDJ.js";
|
|
37
|
-
import "../chunk-YGBIBOCR.js";
|
|
30
|
+
import "../chunk-32467U5J.js";
|
|
31
|
+
import "../chunk-MLCTPWSO.js";
|
|
32
|
+
import "../chunk-WWBC4KLB.js";
|
|
33
|
+
import "../chunk-2ZSC454H.js";
|
|
38
34
|
import {
|
|
39
35
|
groupAndReduce,
|
|
40
36
|
reduceRecords
|
|
41
|
-
} from "../chunk-
|
|
37
|
+
} from "../chunk-HA7P3BTB.js";
|
|
38
|
+
import "../chunk-XZHEOSQ2.js";
|
|
39
|
+
import "../chunk-CADUYBQD.js";
|
|
42
40
|
import {
|
|
43
41
|
readPath
|
|
44
42
|
} from "../chunk-IGJCYUT5.js";
|
|
45
|
-
import "../chunk-
|
|
46
|
-
import "../chunk-
|
|
47
|
-
import "../chunk-
|
|
48
|
-
import "../chunk-
|
|
49
|
-
import "../chunk-
|
|
50
|
-
import "../chunk-
|
|
51
|
-
import "../chunk-
|
|
43
|
+
import "../chunk-E7FSBI6I.js";
|
|
44
|
+
import "../chunk-ZHZ4PET5.js";
|
|
45
|
+
import "../chunk-JOCMXSR2.js";
|
|
46
|
+
import "../chunk-ZUDAK436.js";
|
|
47
|
+
import "../chunk-ZDFU34XY.js";
|
|
48
|
+
import "../chunk-7IQWHYL2.js";
|
|
49
|
+
import "../chunk-LC7DSMHR.js";
|
|
52
50
|
import {
|
|
53
51
|
generateULID
|
|
54
52
|
} from "../chunk-ZJADGNYF.js";
|
|
55
53
|
import "../chunk-SVLR4POP.js";
|
|
56
|
-
import "../chunk-
|
|
54
|
+
import "../chunk-ICYC5YNI.js";
|
|
57
55
|
import "../chunk-I7FD46FF.js";
|
|
58
|
-
import "../chunk-
|
|
59
|
-
import "../chunk-
|
|
60
|
-
import "../chunk-
|
|
61
|
-
import "../chunk-
|
|
62
|
-
import "../chunk-
|
|
63
|
-
import "../chunk-
|
|
64
|
-
import "../chunk-
|
|
56
|
+
import "../chunk-PTT2NB46.js";
|
|
57
|
+
import "../chunk-2BVW754E.js";
|
|
58
|
+
import "../chunk-MMVQ3SUO.js";
|
|
59
|
+
import "../chunk-KCZAFDP5.js";
|
|
60
|
+
import "../chunk-5WLDZZ6S.js";
|
|
61
|
+
import "../chunk-5HSSTOOG.js";
|
|
62
|
+
import "../chunk-G4MFQXYX.js";
|
|
65
63
|
import "../chunk-LP7BEXCT.js";
|
|
66
64
|
import {
|
|
67
65
|
sha256Hex
|
|
68
|
-
} from "../chunk-
|
|
69
|
-
import "../chunk-
|
|
66
|
+
} from "../chunk-7U6AB7DZ.js";
|
|
67
|
+
import "../chunk-DOZFU7OZ.js";
|
|
70
68
|
import {
|
|
71
69
|
AdoptionStateError,
|
|
72
70
|
CargoNotEnabledError,
|
|
@@ -81,7 +79,7 @@ import {
|
|
|
81
79
|
UnknownShardError,
|
|
82
80
|
ValidationError,
|
|
83
81
|
VaultTemplateNotFoundError
|
|
84
|
-
} from "../chunk-
|
|
82
|
+
} from "../chunk-6SYOHUHM.js";
|
|
85
83
|
import "../chunk-PZ5AY32C.js";
|
|
86
84
|
export {
|
|
87
85
|
AdoptionStateError,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
envelopeBodyForHash
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-MMVQ3SUO.js";
|
|
4
4
|
import {
|
|
5
5
|
sha256Hex
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-7U6AB7DZ.js";
|
|
7
7
|
|
|
8
8
|
// src/with-commit/history/ledger/entry.ts
|
|
9
9
|
function canonicalJson(value) {
|
|
@@ -67,4 +67,4 @@ export {
|
|
|
67
67
|
parseIndex,
|
|
68
68
|
envelopePayloadHash
|
|
69
69
|
};
|
|
70
|
-
//# sourceMappingURL=chunk-
|
|
70
|
+
//# sourceMappingURL=chunk-2BVW754E.js.map
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ViaGraph
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-Z4D3YGAB.js";
|
|
4
4
|
import {
|
|
5
5
|
sha256Hex
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-7U6AB7DZ.js";
|
|
7
7
|
import {
|
|
8
8
|
DerivationCycleError
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-6SYOHUHM.js";
|
|
10
10
|
|
|
11
11
|
// src/with-formula/derivations/strategy-hash.ts
|
|
12
12
|
async function computeStrategyHash(source, outputKeys, derive, sources) {
|
|
@@ -161,4 +161,4 @@ var DerivationRegistry = class {
|
|
|
161
161
|
export {
|
|
162
162
|
DerivationRegistry
|
|
163
163
|
};
|
|
164
|
-
//# sourceMappingURL=chunk-
|
|
164
|
+
//# sourceMappingURL=chunk-2PDBYF2O.js.map
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
assertTierAccess,
|
|
3
3
|
dekKey
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-LC7DSMHR.js";
|
|
5
5
|
import {
|
|
6
6
|
liveRecordIsElevated,
|
|
7
7
|
liveRecordTier
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-PTT2NB46.js";
|
|
9
9
|
import {
|
|
10
10
|
openEnvelopeJson,
|
|
11
11
|
writeEnvelopeBody
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-MMVQ3SUO.js";
|
|
13
13
|
import {
|
|
14
14
|
base64ToBuffer,
|
|
15
15
|
bufferToBase64,
|
|
@@ -21,10 +21,10 @@ import {
|
|
|
21
21
|
sha256Hex,
|
|
22
22
|
unwrapCek,
|
|
23
23
|
wrapCek
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-7U6AB7DZ.js";
|
|
25
25
|
import {
|
|
26
26
|
NOYDB_FORMAT_VERSION
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-DOZFU7OZ.js";
|
|
28
28
|
import {
|
|
29
29
|
BlobIntentPendingError,
|
|
30
30
|
BlobOfflineError,
|
|
@@ -34,7 +34,7 @@ import {
|
|
|
34
34
|
TierNotGrantedError,
|
|
35
35
|
UnsupportedTierCompositionError,
|
|
36
36
|
ValidationError
|
|
37
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-6SYOHUHM.js";
|
|
38
38
|
|
|
39
39
|
// src/with-shape/blobs/blob-pinning.ts
|
|
40
40
|
function memoryBlobPinStore() {
|
|
@@ -3069,4 +3069,4 @@ export {
|
|
|
3069
3069
|
DEFAULT_CHUNK_SIZE,
|
|
3070
3070
|
BlobSet
|
|
3071
3071
|
};
|
|
3072
|
-
//# sourceMappingURL=chunk-
|
|
3072
|
+
//# sourceMappingURL=chunk-2ZSC454H.js.map
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
openEnvelopeJson
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-MMVQ3SUO.js";
|
|
4
4
|
import {
|
|
5
5
|
encrypt
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-7U6AB7DZ.js";
|
|
7
7
|
import {
|
|
8
8
|
NOYDB_FORMAT_VERSION
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-DOZFU7OZ.js";
|
|
10
10
|
|
|
11
11
|
// src/with-shape/persisted-schemas/storage.ts
|
|
12
12
|
var SCHEMAS_COLLECTION = "_schemas";
|
|
@@ -46,4 +46,4 @@ export {
|
|
|
46
46
|
loadPersistedSchema,
|
|
47
47
|
savePersistedSchema
|
|
48
48
|
};
|
|
49
|
-
//# sourceMappingURL=chunk-
|
|
49
|
+
//# sourceMappingURL=chunk-32467U5J.js.map
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import {
|
|
2
2
|
liveRecordIsElevated
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-PTT2NB46.js";
|
|
4
4
|
import {
|
|
5
5
|
isRewrappedUnder,
|
|
6
6
|
openEnvelopeJson,
|
|
7
7
|
rewrapEnvelope
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-MMVQ3SUO.js";
|
|
9
9
|
import {
|
|
10
10
|
isTombstone,
|
|
11
11
|
isTombstoneShape
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-KCZAFDP5.js";
|
|
13
13
|
import {
|
|
14
14
|
NOYDB_FORMAT_VERSION
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-DOZFU7OZ.js";
|
|
16
16
|
import {
|
|
17
17
|
ReadOnlyAtInstantError
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-6SYOHUHM.js";
|
|
19
19
|
|
|
20
20
|
// src/with-commit/history/history.ts
|
|
21
21
|
var HISTORY_COLLECTION = "_history";
|
|
@@ -330,4 +330,4 @@ export {
|
|
|
330
330
|
VaultInstant,
|
|
331
331
|
CollectionInstant
|
|
332
332
|
};
|
|
333
|
-
//# sourceMappingURL=chunk-
|
|
333
|
+
//# sourceMappingURL=chunk-3GXDB3NQ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/with-commit/history/history.ts","../src/with-commit/history/time-machine.ts"],"sourcesContent":["import type { NoydbStore, EncryptedEnvelope, HistoryOptions, PruneOptions } from '../../kernel/types.js'\nimport { NOYDB_FORMAT_VERSION } from '../../kernel/types.js'\nimport { isTombstone, isTombstoneShape, rewrapEnvelope, isRewrappedUnder, type EnclaveKey } from '../../kernel/enclave/index.js'\n\n/**\n * History storage convention:\n * Collection: `_history`\n * ID format: `{collection}:{recordId}:{paddedVersion}`\n * Version is zero-padded to 10 digits for lexicographic sorting.\n */\n\nconst HISTORY_COLLECTION = '_history'\nconst VERSION_PAD = 10\n\nfunction historyId(collection: string, recordId: string, version: number): string {\n return `${collection}:${recordId}:${String(version).padStart(VERSION_PAD, '0')}`\n}\n\n// Unused today, kept for future history-id parsing utilities.\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nfunction parseHistoryId(id: string): { collection: string; recordId: string; version: number } | null {\n const lastColon = id.lastIndexOf(':')\n if (lastColon < 0) return null\n const versionStr = id.slice(lastColon + 1)\n const rest = id.slice(0, lastColon)\n const firstColon = rest.indexOf(':')\n if (firstColon < 0) return null\n return {\n collection: rest.slice(0, firstColon),\n recordId: rest.slice(firstColon + 1),\n version: parseInt(versionStr, 10),\n }\n}\n\nfunction matchesPrefix(id: string, collection: string, recordId?: string): boolean {\n if (recordId) {\n return id.startsWith(`${collection}:${recordId}:`)\n }\n return id.startsWith(`${collection}:`)\n}\n\n/** Save a history entry (a complete encrypted envelope snapshot). */\nexport async function saveHistory(\n adapter: NoydbStore,\n vault: string,\n collection: string,\n recordId: string,\n envelope: EncryptedEnvelope,\n): Promise<void> {\n const id = historyId(collection, recordId, envelope._v)\n await adapter.put(vault, HISTORY_COLLECTION, id, envelope)\n}\n\n/** Get history entries for a record, sorted newest-first. */\nexport async function getHistory(\n adapter: NoydbStore,\n vault: string,\n collection: string,\n recordId: string,\n options?: HistoryOptions,\n): Promise<EncryptedEnvelope[]> {\n const allIds = await adapter.list(vault, HISTORY_COLLECTION)\n const matchingIds = allIds\n .filter(id => matchesPrefix(id, collection, recordId))\n .sort()\n .reverse() // newest first\n\n const entries: EncryptedEnvelope[] = []\n\n for (const id of matchingIds) {\n const envelope = await adapter.get(vault, HISTORY_COLLECTION, id)\n if (!envelope) continue\n\n // Apply time filters\n if (options?.from && envelope._ts < options.from) continue\n if (options?.to && envelope._ts > options.to) continue\n\n entries.push(envelope)\n\n if (options?.limit && entries.length >= options.limit) break\n }\n\n return entries\n}\n\n/** Get a specific version's envelope from history. */\nexport async function getVersionEnvelope(\n adapter: NoydbStore,\n vault: string,\n collection: string,\n recordId: string,\n version: number,\n): Promise<EncryptedEnvelope | null> {\n const id = historyId(collection, recordId, version)\n return adapter.get(vault, HISTORY_COLLECTION, id)\n}\n\n/** Prune history entries. Returns the number of entries deleted. */\nexport async function pruneHistory(\n adapter: NoydbStore,\n vault: string,\n collection: string,\n recordId: string | undefined,\n options: PruneOptions,\n): Promise<number> {\n const allIds = await adapter.list(vault, HISTORY_COLLECTION)\n const matchingIds = allIds\n .filter(id => recordId ? matchesPrefix(id, collection, recordId) : matchesPrefix(id, collection))\n .sort()\n\n let toDelete: string[] = []\n\n if (options.keepVersions !== undefined) {\n // Keep only the N most recent, delete the rest\n const keep = options.keepVersions\n if (matchingIds.length > keep) {\n toDelete = matchingIds.slice(0, matchingIds.length - keep)\n }\n }\n\n if (options.beforeDate) {\n // Delete entries older than the specified date\n for (const id of matchingIds) {\n if (toDelete.includes(id)) continue\n const envelope = await adapter.get(vault, HISTORY_COLLECTION, id)\n if (envelope && envelope._ts < options.beforeDate) {\n toDelete.push(id)\n }\n }\n }\n\n // Deduplicate\n const uniqueDeletes = [...new Set(toDelete)]\n\n for (const id of uniqueDeletes) {\n await adapter.delete(vault, HISTORY_COLLECTION, id)\n }\n\n return uniqueDeletes.length\n}\n\n/** Clear all history for a vault, optionally scoped to a collection or record. */\nexport async function clearHistory(\n adapter: NoydbStore,\n vault: string,\n collection?: string,\n recordId?: string,\n): Promise<number> {\n const allIds = await adapter.list(vault, HISTORY_COLLECTION)\n let toDelete: string[]\n\n if (collection && recordId) {\n toDelete = allIds.filter(id => matchesPrefix(id, collection, recordId))\n } else if (collection) {\n toDelete = allIds.filter(id => matchesPrefix(id, collection))\n } else {\n toDelete = allIds\n }\n\n for (const id of toDelete) {\n await adapter.delete(vault, HISTORY_COLLECTION, id)\n }\n\n return toDelete.length\n}\n\n/**\n * Crypto-shred every `_history` version of a record. Each non-tombstone\n * history envelope is OVERWRITTEN in place with a tombstone\n * `{ _noydb, _v, _ts: now, _by: actor, _iv: '', _data: '' }` — dropping\n * `_iv`/`_data`/`_cek`/`_det`, so the prior ciphertext (and the wrapped CEK\n * that could decrypt it) is gone everywhere this store reaches. The version\n * counter (`_v`) is preserved so the audit trail still shows \"N versions\n * existed and were erased.\"\n *\n * Overwrite — NOT delete — so the history key itself survives as proof the\n * version existed. Already-tombstoned versions (re-run / idempotent forget)\n * are left untouched and not counted.\n *\n * Returns the number of history versions newly tombstoned.\n */\nexport async function tombstoneHistory(\n adapter: NoydbStore,\n vault: string,\n collection: string,\n recordId: string,\n actor: string,\n encrypted: boolean,\n): Promise<number> {\n const allIds = await adapter.list(vault, HISTORY_COLLECTION)\n const matchingIds = allIds.filter(id => matchesPrefix(id, collection, recordId))\n\n const now = new Date().toISOString()\n let count = 0\n for (const id of matchingIds) {\n const env = await adapter.get(vault, HISTORY_COLLECTION, id)\n if (!env) continue\n // Already a tombstone (no body and no wrapped CEK)? Skip — idempotent.\n if (isTombstone(env, encrypted)) continue\n const tombstone: EncryptedEnvelope = {\n _noydb: NOYDB_FORMAT_VERSION,\n _v: env._v,\n _ts: now,\n _iv: '',\n _data: '',\n ...(actor ? { _by: actor } : {}),\n }\n await adapter.put(vault, HISTORY_COLLECTION, id, tombstone)\n count++\n }\n return count\n}\n\n/**\n * Re-key every `_history` snapshot of a record from `fromDek` to `toDek`.\n * Mirrors what `rewrapBodyToDek` already does for a record's LIVE body on a\n * tier move (elevate/demote/putAtTier) — each `_history` envelope also\n * carries its own `_cek`, wrapped under the collection's tier-0 DEK at write\n * time (`record-codec.ts`), so a tier move that rewraps only the live\n * envelope leaves prior versions decryptable at rest under the tier the\n * record left. This is defense-in-depth *beneath* the read-gate\n * (`history()`/`getVersion()` already return empty for an elevated record;\n * this protects the ciphertext even if that gate is bypassed).\n *\n * Rewraps content in place — unlike `tombstoneHistory`, it does NOT blank\n * `_iv`/`_data`/`_cek` — so a subsequent `demote()` restores tier-0\n * readability. Tombstone-shaped entries (a forgotten/shredded version —\n * blanked `_data`, no `_cek`) are skipped: there is no key material left to\n * rewrap.\n *\n * **Legacy fallback.** A snapshot written before this fix stays wrapped\n * under the tier-0 DEK even after its live record has since moved tiers, so\n * a rewrap attempted with a tier-N `fromDek` fails to unwrap/decrypt. When\n * the caller supplies `tier0Dek`, a failed rewrap is retried once with\n * `tier0Dek` as `fromDek` (the only other key a pre-fix snapshot can be\n * wrapped under — history is written only by tier-0 `put()`). The output is\n * always wrapped under `toDek` regardless of which `fromDek` succeeded. A\n * rewrap that fails under BOTH keys re-throws — that is real corruption, not\n * a tier mismatch, and must not be swallowed.\n *\n * **Crash-atomicity / idempotency (#712 whole-branch-fix-3).** This loop has\n * no transaction around it: a crash after some entries have been rewritten\n * under `toDek` but before the loop finishes leaves the record's history\n * split across two keys. A retry of the SAME call must not re-fail on the\n * entries that already made it — so each entry is probed with\n * `isRewrappedUnder(env, toDek)` FIRST; a match means it's already at the\n * target key and is skipped (put nothing). This makes same-target retries\n * and demote-after-crash fully self-healing. It does NOT close every crash\n * window: a crash that lands SOME entries under `toDek` while the record's\n * NEXT move target differs from this call's `toDek` (an intermediate-tier\n * crash — e.g. elevate 0→1 crashes mid-loop, then the record is moved 1→2)\n * still finds those entries unreadable under either `fromDek` or the\n * tier-0 fallback, since `toDek` is a third key the next call never probes\n * for. That residual window is an accepted, fail-closed limitation (see\n * `.changeset/history-at-rest.md` and the design doc) — availability is\n * lost, never confidentiality.\n */\nexport async function rewrapHistory(\n adapter: NoydbStore,\n vault: string,\n collection: string,\n recordId: string,\n fromDek: EnclaveKey,\n toDek: EnclaveKey,\n tier0Dek?: EnclaveKey,\n): Promise<void> {\n const allIds = await adapter.list(vault, HISTORY_COLLECTION)\n const matchingIds = allIds.filter(id => matchesPrefix(id, collection, recordId))\n\n for (const id of matchingIds) {\n const env = await adapter.get(vault, HISTORY_COLLECTION, id)\n if (!env) continue\n // Already a tombstone (forgotten/shredded version)? Nothing to rewrap.\n if (isTombstoneShape(env)) continue\n // #712/whole-branch-fix-3: toDek-first idempotency skip — already at the\n // target key (a same-target retry, or demote-after-crash landing back on\n // a key it already reached)? Nothing to do; put nothing.\n if (await isRewrappedUnder(env, toDek)) continue\n\n let next: EncryptedEnvelope\n try {\n next = await rewrapEnvelope(env, fromDek, toDek)\n } catch (err) {\n if (!tier0Dek) throw err\n // Legacy fallback: retry once under the tier-0 DEK. A failure here is\n // real corruption, not a tier mismatch — let it propagate.\n next = await rewrapEnvelope(env, tier0Dek, toDek)\n }\n\n await adapter.put(vault, HISTORY_COLLECTION, id, next)\n }\n}\n","/**\n * Time-machine queries — point-in-time reads reconstructed from the\n * existing history + ledger infrastructure.\n *\n * ## Usage\n *\n * ```ts\n * const vault = await db.openVault('acme', { secret })\n * const q1End = vault.at('2026-03-31T23:59:59Z')\n * const invoice = await q1End.collection<Invoice>('invoices').get('inv-001')\n * // → the record as it stood at the close of Q1 2026\n * ```\n *\n * ## How it works\n *\n * Every write path already fans out into two persistence lanes:\n *\n * 1. `saveHistory(...)` persists a **full encrypted envelope snapshot**\n * per version under the `_history` collection (one envelope per\n * version, keyed by `{collection}:{id}:{paddedVersion}`). Each\n * envelope carries its own `_ts` (the write timestamp).\n * 2. `ledger.append(...)` appends a hash-chained audit entry that\n * records the `op` (put / delete), `version`, and `ts`.\n *\n * Reconstruction at a target timestamp T is therefore:\n *\n * - Find the newest history envelope for `(collection, id)` whose\n * `_ts ≤ T` — that's the state the record was in at T.\n * - Check the ledger for any `op: 'delete'` entry for the same\n * `(collection, id)` with `entry.ts` in `(latestEnvelope._ts, T]` —\n * if present, the record was deleted before T, so return `null`.\n * - Decrypt the surviving envelope with the current collection DEK\n * (DEKs are per-collection but stable across versions — the same\n * key encrypts v1 and v15 of a record).\n *\n * No delta replay. The existing `history.ts` module already stores\n * complete snapshots; we just pick the right one.\n *\n * ## Read-only contract\n *\n * Every write method on `CollectionInstant` throws\n * {@link ReadOnlyAtInstantError}. A historical view is a *read*\n * surface — mutating the past would require either a branch/shadow\n * mechanism (tracked under shadow vaults) or a rewrite of\n * history, which breaks the ledger's tamper-evidence guarantee.\n *\n * @module\n */\nimport type { EncryptedEnvelope, NoydbStore } from '../../kernel/types.js'\nimport type { LedgerStore } from './ledger/store.js'\nimport { getHistory } from './history.js'\nimport { openEnvelopeJson, type EnclaveKey } from '../../kernel/enclave/index.js'\nimport { ReadOnlyAtInstantError } from '../../kernel/errors.js'\nimport { liveRecordIsElevated } from '../../kernel/tier-visibility.js'\n\n/**\n * Narrow view of a {@link Vault}'s internals that\n * {@link VaultInstant} needs. Passed in by `Vault.at()` rather than\n * constructed here so all crypto + adapter access stays inside the\n * Vault class.\n *\n * Not exported from the public barrel — consumers should get a\n * `VaultInstant` via `vault.at(ts)`, never by constructing one\n * directly.\n */\nexport interface VaultEngine {\n readonly adapter: NoydbStore\n /** Vault name (the compartment). */\n readonly name: string\n /**\n * `true` when the vault was opened with a secret (the normal\n * case). `false` in plaintext-mode vaults (`encrypt: false`) — in\n * that case `envelope._data` is raw JSON and we skip the DEK lookup.\n */\n readonly encrypted: boolean\n /**\n * Resolves the DEK used to decrypt a given collection's envelopes.\n * Not called when `encrypted` is false.\n */\n getDEK(collection: string): Promise<EnclaveKey>\n /**\n * Lazily-initialised ledger. We consult it to detect deletes that\n * happened between the latest history snapshot and the target\n * timestamp. `null` when history is disabled for this vault — in\n * that case time-machine reads fall back to history-only\n * reconstruction (which may miss deletes).\n */\n getLedger(): LedgerStore | null\n}\n\n/**\n * A vault at a fixed instant. Produced by `vault.at(timestamp)`.\n * Carries no session state of its own — every read is a fresh\n * lookup through the vault's adapter.\n *\n * Cheap to construct; safe to throw away. Create one per query.\n */\nexport class VaultInstant {\n constructor(\n private readonly engine: VaultEngine,\n /** Fully-resolved target timestamp (ISO-8601 UTC). */\n public readonly timestamp: string,\n ) {}\n\n /** Get a point-in-time view of a collection. */\n collection<T = unknown>(name: string): CollectionInstant<T> {\n return new CollectionInstant<T>(this.engine, this.timestamp, name)\n }\n}\n\n/**\n * A read-only collection view anchored to a past instant.\n *\n * Every write method throws {@link ReadOnlyAtInstantError} — see the\n * module docstring for why. The read surface is intentionally smaller\n * than the live {@link Collection}: `get` and `list` cover the\n * \"what did the books look like on date X\" use case without pulling\n * in the full query DSL / joins / aggregates at this stage. Follow-up\n * work tracked under.\n */\nexport class CollectionInstant<T = unknown> {\n constructor(\n private readonly engine: VaultEngine,\n private readonly targetTs: string,\n public readonly name: string,\n ) {}\n\n /**\n * Return the record as it existed at the target timestamp, or\n * `null` if the record had not been created yet or had already been\n * deleted by then.\n *\n * Gated on the LIVE record's current tier — #730, mirroring the #712\n * read-gate `history()`/`getVersion()` already apply: an elevated record\n * is invisible through the whole time-machine surface, not just a\n * decrypt failure. See {@link resolveVisibleEnvelope}.\n *\n * Decrypts through {@link openEnvelopeJson}, the `_cek`-aware envelope\n * body opener — a snapshot from a `perRecordKeys` collection is encrypted\n * under its own per-record CEK (wrapped in `_cek`), not the collection\n * DEK directly.\n */\n async get(id: string): Promise<T | null> {\n const envelope = await this.resolveVisibleEnvelope(id)\n if (!envelope) return null\n const plaintext = this.engine.encrypted\n ? await openEnvelopeJson(envelope, await this.engine.getDEK(this.name))\n : envelope._data\n return JSON.parse(plaintext) as T\n }\n\n /**\n * IDs of records that existed (had at least one `put` and were not\n * subsequently deleted) at the target timestamp.\n *\n * Implemented as a linear scan over history + ledger. Performance\n * is bounded by total history size (not live-vault size), so the\n * memory-first vault-scale cap (1K–50K records × average history\n * depth) still applies.\n */\n async list(): Promise<string[]> {\n const historyIds = await collectHistoryIds(this.engine.adapter, this.engine.name, this.name)\n const liveIds = await this.engine.adapter.list(this.engine.name, this.name)\n const candidateIds = new Set<string>([...historyIds, ...liveIds])\n const alive: string[] = []\n for (const id of candidateIds) {\n const env = await this.resolveVisibleEnvelope(id)\n if (env) alive.push(id)\n }\n return alive.sort()\n }\n\n // ── write guards ───────────────────────────────────────────────────\n\n async put(_id: string, _record: T): Promise<never> {\n throw new ReadOnlyAtInstantError('put', this.targetTs)\n }\n async delete(_id: string): Promise<never> {\n throw new ReadOnlyAtInstantError('delete', this.targetTs)\n }\n async update(_id: string, _patch: Partial<T>): Promise<never> {\n throw new ReadOnlyAtInstantError('update', this.targetTs)\n }\n\n // ── internals ─────────────────────────────────────────────────────\n\n /**\n * {@link resolveEnvelope}, additionally gated on the record's LIVE\n * (current, not historical) tier — #730. Mirrors the #712 read-gate\n * `history()`/`getVersion()` apply: history snapshots keep their\n * tier-0-wrapped CEKs and carry no `_tier` of their own, so an elevated\n * record's prior versions would otherwise stay tier-0-decryptable here.\n * `null` for a resolved envelope carrying its own `_tier > 0` (a\n * tier-aware snapshot reached some other way) or whose LIVE record is\n * currently elevated — both `get()` and `list()` route through this so\n * the invisibility law holds on the whole time-machine read surface, not\n * just a decrypt failure.\n */\n private async resolveVisibleEnvelope(id: string): Promise<EncryptedEnvelope | null> {\n const envelope = await this.resolveEnvelope(id)\n if (!envelope || (envelope._tier ?? 0) > 0) return null\n if (await liveRecordIsElevated(this.engine.adapter, this.engine.name, this.name, id)) return null\n return envelope\n }\n\n /**\n * Return the envelope that represents the record's state at\n * `targetTs`, accounting for deletes. `null` if the record didn't\n * exist at that instant.\n *\n * ## Why we use the ledger as the authoritative timeline\n *\n * The per-version history snapshots saved by `saveHistory()` do\n * carry a `_ts` field, but that timestamp is the moment the\n * snapshot was *captured* (i.e. the instant right before the\n * subsequent overwrite), not the original write time. The ledger,\n * by contrast, records `ts` at the moment of each `put` / `delete`\n * — it's the only source that tracks the real timeline. So:\n *\n * 1. Walk the ledger; find the latest entry for `(collection, id)`\n * with `ts ≤ targetTs`.\n * 2. If that entry is a `delete`, the record was gone at the\n * target instant — return null.\n * 3. Otherwise it's a `put` with a specific `version`. Load the\n * envelope for that version from history, falling back to the\n * live collection for the most recent version.\n *\n * ## Fallback when the ledger is disabled\n *\n * If the vault has history disabled, `getLedger()` returns null and\n * we fall back to comparing envelope `_ts` fields. This is\n * approximate and gets the *last write* right but may confuse the\n * intermediate versions; adopters needing accurate time-machine\n * reads should leave history enabled.\n */\n private async resolveEnvelope(id: string): Promise<EncryptedEnvelope | null> {\n const ledger = this.engine.getLedger()\n if (ledger) {\n return this.resolveViaLedger(id, ledger)\n }\n return this.resolveViaEnvelopeTs(id)\n }\n\n private async resolveViaLedger(id: string, ledger: LedgerStore): Promise<EncryptedEnvelope | null> {\n const entries = await ledger.entries()\n // Entries are already ordered by index which is the mutation order.\n let latest: { op: 'put' | 'delete'; version: number } | null = null\n for (const e of entries) {\n if (e.collection !== this.name || e.id !== id) continue\n if (e.ts > this.targetTs) break // entries are time-ordered by index\n // `amendment` + `lifecycle` entries are audit-only summaries — they\n // carry no (collection, id) tuple of their own and would never match\n // the filter above. The narrow here is a type guard, not a runtime\n // skip.\n // `forget` is a subject-erasure summary with empty (collection, id) —\n // never matches the filter above; the narrow is a type guard.\n if (e.op === 'amendment' || e.op === 'lifecycle' || e.op === 'forget') continue\n // `migration` is a record rewrite (cutover) — resolve it like a put.\n latest = { op: e.op === 'migration' ? 'put' : e.op, version: e.version }\n }\n if (!latest) return null\n if (latest.op === 'delete') return null\n return this.loadVersion(id, latest.version)\n }\n\n private async resolveViaEnvelopeTs(id: string): Promise<EncryptedEnvelope | null> {\n const history = await getHistory(\n this.engine.adapter, this.engine.name, this.name, id,\n )\n const live = await this.engine.adapter.get(this.engine.name, this.name, id)\n const byVersion = new Map<number, EncryptedEnvelope>()\n for (const e of history) byVersion.set(e._v, e)\n if (live) byVersion.set(live._v, live)\n const sorted = [...byVersion.values()].sort((a, b) =>\n a._ts < b._ts ? 1 : a._ts > b._ts ? -1 : 0,\n )\n return sorted.find((e) => e._ts <= this.targetTs) ?? null\n }\n\n /**\n * Fetch the envelope for a specific version. The live record (most\n * recent put) lives in the main collection; prior versions live in\n * `_history`. We check live first because the common case after a\n * delete is that we're trying to load the last-live version from\n * history, and skipping live for the current-version case avoids a\n * redundant lookup.\n */\n private async loadVersion(id: string, version: number): Promise<EncryptedEnvelope | null> {\n const live = await this.engine.adapter.get(this.engine.name, this.name, id)\n if (live && live._v === version) return live\n\n // Direct lookup by (collection, id, version) — avoids scanning all history.\n const historyId = `${this.name}:${id}:${String(version).padStart(10, '0')}`\n return await this.engine.adapter.get(this.engine.name, '_history', historyId)\n }\n}\n\n/**\n * Scan the `_history` collection once and collect every distinct\n * `recordId` for the given collection. History keys follow the\n * shape `<collection>:<recordId>:<paddedVersion>`; we split on the\n * last two colons (delimiter-safe because `paddedVersion` is\n * exactly 10 digits).\n */\nasync function collectHistoryIds(\n adapter: NoydbStore,\n vault: string,\n collection: string,\n): Promise<string[]> {\n const all = await adapter.list(vault, '_history')\n const prefix = `${collection}:`\n const seen = new Set<string>()\n for (const key of all) {\n if (!key.startsWith(prefix)) continue\n const lastColon = key.lastIndexOf(':')\n if (lastColon <= prefix.length) continue\n const middle = key.slice(prefix.length, lastColon)\n seen.add(middle)\n }\n return [...seen]\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAWA,IAAM,qBAAqB;AAC3B,IAAM,cAAc;AAEpB,SAAS,UAAU,YAAoB,UAAkB,SAAyB;AAChF,SAAO,GAAG,UAAU,IAAI,QAAQ,IAAI,OAAO,OAAO,EAAE,SAAS,aAAa,GAAG,CAAC;AAChF;AAkBA,SAAS,cAAc,IAAY,YAAoB,UAA4B;AACjF,MAAI,UAAU;AACZ,WAAO,GAAG,WAAW,GAAG,UAAU,IAAI,QAAQ,GAAG;AAAA,EACnD;AACA,SAAO,GAAG,WAAW,GAAG,UAAU,GAAG;AACvC;AAGA,eAAsB,YACpB,SACA,OACA,YACA,UACA,UACe;AACf,QAAM,KAAK,UAAU,YAAY,UAAU,SAAS,EAAE;AACtD,QAAM,QAAQ,IAAI,OAAO,oBAAoB,IAAI,QAAQ;AAC3D;AAGA,eAAsB,WACpB,SACA,OACA,YACA,UACA,SAC8B;AAC9B,QAAM,SAAS,MAAM,QAAQ,KAAK,OAAO,kBAAkB;AAC3D,QAAM,cAAc,OACjB,OAAO,QAAM,cAAc,IAAI,YAAY,QAAQ,CAAC,EACpD,KAAK,EACL,QAAQ;AAEX,QAAM,UAA+B,CAAC;AAEtC,aAAW,MAAM,aAAa;AAC5B,UAAM,WAAW,MAAM,QAAQ,IAAI,O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