@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
|
@@ -1,28 +1,31 @@
|
|
|
1
|
-
import {
|
|
2
|
-
jsonSchemaToFields
|
|
3
|
-
} from "./chunk-VYYM3MEN.js";
|
|
4
1
|
import {
|
|
5
2
|
NO_SEQUENCE,
|
|
6
3
|
SEQUENCE_COLLECTION,
|
|
7
4
|
compileSequenceFormat,
|
|
8
5
|
resolveSequenceKey
|
|
9
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-YGMREQAK.js";
|
|
10
7
|
import {
|
|
11
8
|
loadVaultPolicy
|
|
12
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-M7W2KYTL.js";
|
|
10
|
+
import {
|
|
11
|
+
jsonSchemaToFields
|
|
12
|
+
} from "./chunk-VYYM3MEN.js";
|
|
13
|
+
import {
|
|
14
|
+
resolveStaleOnRead
|
|
15
|
+
} from "./chunk-5ABOFAHN.js";
|
|
13
16
|
import {
|
|
14
17
|
LinkIntegrityError,
|
|
15
18
|
isLinkCollectionName,
|
|
16
19
|
linkCollectionName,
|
|
17
20
|
linkRowKey
|
|
18
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-MUPZ6IZX.js";
|
|
19
22
|
import {
|
|
20
23
|
hashFields,
|
|
21
24
|
validateSatelliteDeclaration
|
|
22
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-522MBPE5.js";
|
|
23
26
|
import {
|
|
24
27
|
loadFence
|
|
25
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-44Y3P5U6.js";
|
|
26
29
|
import {
|
|
27
30
|
InvertedIndex,
|
|
28
31
|
MemoryIndexStore,
|
|
@@ -31,60 +34,62 @@ import {
|
|
|
31
34
|
buildPersistedIndexCallbacks,
|
|
32
35
|
encodeVecId,
|
|
33
36
|
syncTierSearch
|
|
34
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-3TZUC4WS.js";
|
|
35
38
|
import {
|
|
36
39
|
derivePersistedSchema,
|
|
37
40
|
isZod4Schema
|
|
38
|
-
} from "./chunk-
|
|
39
|
-
import {
|
|
40
|
-
isBaseLive,
|
|
41
|
-
liveBaseIdSet
|
|
42
|
-
} from "./chunk-GYGLAVCX.js";
|
|
41
|
+
} from "./chunk-SEU6QHH4.js";
|
|
43
42
|
import {
|
|
44
43
|
CustodyApi,
|
|
45
44
|
NO_CARGO,
|
|
46
|
-
NO_CUSTODY
|
|
47
|
-
|
|
45
|
+
NO_CUSTODY,
|
|
46
|
+
runDrainBarrier
|
|
47
|
+
} from "./chunk-3S2YNMUS.js";
|
|
48
48
|
import {
|
|
49
49
|
resolveManagedSecret,
|
|
50
|
-
|
|
51
|
-
} from "./chunk-
|
|
50
|
+
saveSealedSecret
|
|
51
|
+
} from "./chunk-6SSWOUUS.js";
|
|
52
52
|
import {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
assertCanImport,
|
|
57
|
-
canExport,
|
|
58
|
-
canImport
|
|
59
|
-
} from "./chunk-WEC3JGBA.js";
|
|
53
|
+
isBaseLive,
|
|
54
|
+
liveBaseIdSet
|
|
55
|
+
} from "./chunk-GYGLAVCX.js";
|
|
60
56
|
import {
|
|
61
|
-
|
|
62
|
-
} from "./chunk-
|
|
57
|
+
NO_SYNC
|
|
58
|
+
} from "./chunk-EP5L47XV.js";
|
|
63
59
|
import {
|
|
64
60
|
NO_ATTESTATION
|
|
65
|
-
} from "./chunk-
|
|
61
|
+
} from "./chunk-GTNRMJYH.js";
|
|
66
62
|
import {
|
|
67
63
|
NO_CLASSIFIED,
|
|
68
64
|
guardClassifiedCompat,
|
|
69
65
|
resolveClassifiedFields
|
|
70
|
-
} from "./chunk-
|
|
66
|
+
} from "./chunk-ZM72UO3Y.js";
|
|
71
67
|
import {
|
|
72
68
|
NO_TIERS,
|
|
73
69
|
classifySealedShred,
|
|
74
70
|
syncDerivedOutputs
|
|
75
|
-
} from "./chunk-
|
|
71
|
+
} from "./chunk-HDF5R2K6.js";
|
|
76
72
|
import {
|
|
77
73
|
NO_PORTABILITY
|
|
78
|
-
} from "./chunk-
|
|
74
|
+
} from "./chunk-OWLZONGX.js";
|
|
75
|
+
import {
|
|
76
|
+
NO_PERIODS
|
|
77
|
+
} from "./chunk-IUATR5UE.js";
|
|
78
|
+
import {
|
|
79
|
+
NO_SHADOW
|
|
80
|
+
} from "./chunk-SMY5X46Z.js";
|
|
81
|
+
import {
|
|
82
|
+
NO_SNAPSHOTS
|
|
83
|
+
} from "./chunk-NIKO2BBZ.js";
|
|
79
84
|
import {
|
|
80
85
|
TxContext,
|
|
81
86
|
bestEffortRevert,
|
|
82
87
|
revertExecuted
|
|
83
|
-
} from "./chunk-
|
|
88
|
+
} from "./chunk-QVGEVZ5F.js";
|
|
84
89
|
import {
|
|
85
90
|
DEFAULT_POSTURE,
|
|
86
91
|
ViaGraph
|
|
87
|
-
} from "./chunk-
|
|
92
|
+
} from "./chunk-Z4D3YGAB.js";
|
|
88
93
|
import {
|
|
89
94
|
buildLookupAltIndex,
|
|
90
95
|
buildLookupSnapshotRows,
|
|
@@ -105,27 +110,32 @@ import {
|
|
|
105
110
|
resolveLabelFromMap,
|
|
106
111
|
resolveRollupDeleteIntents,
|
|
107
112
|
runGraphDispatchWave,
|
|
113
|
+
selfWriteFieldEqual,
|
|
108
114
|
touchFor,
|
|
109
115
|
updateReferencingRecords
|
|
110
|
-
} from "./chunk-
|
|
116
|
+
} from "./chunk-JTIPVW4J.js";
|
|
117
|
+
import {
|
|
118
|
+
lazy
|
|
119
|
+
} from "./chunk-5D2ALSM5.js";
|
|
111
120
|
import {
|
|
112
121
|
OverlayedCollection
|
|
113
|
-
} from "./chunk-
|
|
122
|
+
} from "./chunk-PWWWMRT7.js";
|
|
114
123
|
import {
|
|
115
|
-
NO_AGGREGATE,
|
|
116
124
|
Query,
|
|
117
125
|
ScanBuilder
|
|
118
|
-
} from "./chunk-
|
|
126
|
+
} from "./chunk-MPPWL64H.js";
|
|
119
127
|
import {
|
|
120
128
|
EXPORT_AUDIT_COLLECTION,
|
|
129
|
+
NO_BLOBS,
|
|
121
130
|
createExportBlobsHandle,
|
|
122
131
|
runCompaction
|
|
123
|
-
} from "./chunk-
|
|
132
|
+
} from "./chunk-LN3MQFUE.js";
|
|
124
133
|
import {
|
|
125
134
|
LazyQuery,
|
|
135
|
+
NO_INDEXING,
|
|
126
136
|
decodeIdxId,
|
|
127
137
|
encodeIdxId
|
|
128
|
-
} from "./chunk-
|
|
138
|
+
} from "./chunk-GQT6J4FJ.js";
|
|
129
139
|
import {
|
|
130
140
|
IMPLICIT_LAZY,
|
|
131
141
|
Lru,
|
|
@@ -133,13 +143,22 @@ import {
|
|
|
133
143
|
} from "./chunk-NO272T7Q.js";
|
|
134
144
|
import {
|
|
135
145
|
canonicalGroupKey
|
|
136
|
-
} from "./chunk-
|
|
146
|
+
} from "./chunk-XZHEOSQ2.js";
|
|
147
|
+
import {
|
|
148
|
+
NO_REDUCE
|
|
149
|
+
} from "./chunk-YMUFFJCO.js";
|
|
137
150
|
import {
|
|
138
151
|
readPath
|
|
139
152
|
} from "./chunk-IGJCYUT5.js";
|
|
153
|
+
import {
|
|
154
|
+
NO_CRDT
|
|
155
|
+
} from "./chunk-PVEWA2DU.js";
|
|
156
|
+
import {
|
|
157
|
+
NO_CONSENT
|
|
158
|
+
} from "./chunk-PEOZ34EM.js";
|
|
140
159
|
import {
|
|
141
160
|
dictCollectionName
|
|
142
|
-
} from "./chunk-
|
|
161
|
+
} from "./chunk-C2V7AJO2.js";
|
|
143
162
|
import {
|
|
144
163
|
NO_I18N,
|
|
145
164
|
getAtPath,
|
|
@@ -147,23 +166,30 @@ import {
|
|
|
147
166
|
isDictKeyDescriptor,
|
|
148
167
|
isI18nTextDescriptor,
|
|
149
168
|
isStaticDictDescriptor
|
|
150
|
-
} from "./chunk-
|
|
169
|
+
} from "./chunk-JOCMXSR2.js";
|
|
151
170
|
import {
|
|
152
|
-
installViaBinder,
|
|
153
171
|
isViaInstalled,
|
|
154
172
|
viaBinder
|
|
155
|
-
} from "./chunk-
|
|
173
|
+
} from "./chunk-ZUDAK436.js";
|
|
156
174
|
import {
|
|
157
175
|
NO_TEAM,
|
|
158
176
|
enrollAuthenticator,
|
|
159
177
|
findAuthenticator,
|
|
160
|
-
|
|
178
|
+
hasRecoveryEnrolled,
|
|
179
|
+
hasStrongRecoveryEnrolled,
|
|
180
|
+
loadPaperRecoveryEntries,
|
|
181
|
+
loadShamirRecoveryEntries,
|
|
182
|
+
mintPaperRecoveryEntry,
|
|
183
|
+
mintShamirRecoveryEntry,
|
|
184
|
+
recoverSecret,
|
|
161
185
|
recoverUser,
|
|
162
186
|
removeAuthenticator,
|
|
163
|
-
|
|
187
|
+
rotateSecret,
|
|
188
|
+
savePaperRecoveryEntries,
|
|
189
|
+
saveShamirRecoveryEntries,
|
|
164
190
|
updateAuthenticator,
|
|
165
191
|
writeMagicLinkGrant
|
|
166
|
-
} from "./chunk-
|
|
192
|
+
} from "./chunk-M4GO4ZJK.js";
|
|
167
193
|
import {
|
|
168
194
|
assertKeyringOpenAllowed,
|
|
169
195
|
buildRecipientKeyringFile,
|
|
@@ -171,26 +197,18 @@ import {
|
|
|
171
197
|
createOwnerKeyring,
|
|
172
198
|
ensureCollectionDEK,
|
|
173
199
|
hasAccess,
|
|
200
|
+
hasExportCapability,
|
|
201
|
+
hasImportCapability,
|
|
174
202
|
hasWritePermission,
|
|
175
203
|
isSecretBearingReservedCollection,
|
|
176
204
|
listUsers,
|
|
177
205
|
loadKeyring,
|
|
178
206
|
updateKeyringIdentity
|
|
179
|
-
} from "./chunk-
|
|
207
|
+
} from "./chunk-ZDFU34XY.js";
|
|
180
208
|
import {
|
|
181
209
|
persistDirectoryConfig,
|
|
182
210
|
readDirectoryConfig
|
|
183
|
-
} from "./chunk-
|
|
184
|
-
import {
|
|
185
|
-
hasRecoveryEnrolled,
|
|
186
|
-
hasStrongRecoveryEnrolled,
|
|
187
|
-
loadPaperRecoveryEntries,
|
|
188
|
-
loadShamirRecoveryEntries,
|
|
189
|
-
mintPaperRecoveryEntry,
|
|
190
|
-
mintShamirRecoveryEntry,
|
|
191
|
-
savePaperRecoveryEntries,
|
|
192
|
-
saveShamirRecoveryEntries
|
|
193
|
-
} from "./chunk-3O62PVDW.js";
|
|
211
|
+
} from "./chunk-7IQWHYL2.js";
|
|
194
212
|
import {
|
|
195
213
|
INDEXED_STORE_POLICY
|
|
196
214
|
} from "./chunk-VQNJ7UZL.js";
|
|
@@ -200,22 +218,28 @@ import {
|
|
|
200
218
|
PERIOD_FREEZES_COLLECTION,
|
|
201
219
|
PERIOD_TARGET_PURGES_COLLECTION,
|
|
202
220
|
periodExclusiveUpperBound
|
|
203
|
-
} from "./chunk-
|
|
221
|
+
} from "./chunk-TMR64XPL.js";
|
|
204
222
|
import {
|
|
205
223
|
NO_BROKER,
|
|
206
224
|
buildCredentialBrokerHandle
|
|
207
|
-
} from "./chunk-
|
|
225
|
+
} from "./chunk-P4NUJVWL.js";
|
|
226
|
+
import {
|
|
227
|
+
NO_SESSION
|
|
228
|
+
} from "./chunk-VKQCVU2Z.js";
|
|
208
229
|
import {
|
|
209
230
|
generateULID
|
|
210
231
|
} from "./chunk-ZJADGNYF.js";
|
|
232
|
+
import {
|
|
233
|
+
NO_HISTORY
|
|
234
|
+
} from "./chunk-AFHQATY4.js";
|
|
211
235
|
import {
|
|
212
236
|
assertCutoverTierSafe,
|
|
213
237
|
assertTierWritable,
|
|
214
238
|
liveRecordIsElevated
|
|
215
|
-
} from "./chunk-
|
|
239
|
+
} from "./chunk-PTT2NB46.js";
|
|
216
240
|
import {
|
|
217
241
|
sha256Hex
|
|
218
|
-
} from "./chunk-
|
|
242
|
+
} from "./chunk-2BVW754E.js";
|
|
219
243
|
import {
|
|
220
244
|
NO_FORGET,
|
|
221
245
|
addSubjectRef,
|
|
@@ -224,10 +248,10 @@ import {
|
|
|
224
248
|
readDottedPath,
|
|
225
249
|
rebuildSubjectIndex,
|
|
226
250
|
removeSubjectRef
|
|
227
|
-
} from "./chunk-
|
|
251
|
+
} from "./chunk-AZXEOEQK.js";
|
|
228
252
|
import {
|
|
229
253
|
NO_SEALED_RECORD
|
|
230
|
-
} from "./chunk-
|
|
254
|
+
} from "./chunk-7LP7FFJ2.js";
|
|
231
255
|
import {
|
|
232
256
|
RecordCodec,
|
|
233
257
|
SEALED_CEK_NS,
|
|
@@ -238,20 +262,20 @@ import {
|
|
|
238
262
|
queryByDet,
|
|
239
263
|
resolveStableCek,
|
|
240
264
|
validateSchemaInput
|
|
241
|
-
} from "./chunk-
|
|
265
|
+
} from "./chunk-MMVQ3SUO.js";
|
|
242
266
|
import {
|
|
243
267
|
buildDeleteMarker,
|
|
244
268
|
buildTombstone,
|
|
245
269
|
isDeleteMarker,
|
|
246
270
|
isTombstone
|
|
247
|
-
} from "./chunk-
|
|
271
|
+
} from "./chunk-KCZAFDP5.js";
|
|
248
272
|
import {
|
|
249
273
|
encrypt
|
|
250
|
-
} from "./chunk-
|
|
274
|
+
} from "./chunk-7U6AB7DZ.js";
|
|
251
275
|
import {
|
|
252
276
|
NOYDB_FORMAT_VERSION,
|
|
253
277
|
SealedHandle
|
|
254
|
-
} from "./chunk-
|
|
278
|
+
} from "./chunk-DOZFU7OZ.js";
|
|
255
279
|
import {
|
|
256
280
|
AlreadyElevatedError,
|
|
257
281
|
AttestationError,
|
|
@@ -260,11 +284,12 @@ import {
|
|
|
260
284
|
ClassifiedVerifyError,
|
|
261
285
|
ConflictError,
|
|
262
286
|
DebugPlaintextError,
|
|
263
|
-
DerivationCapExceededError,
|
|
264
287
|
DictKeyInUseError,
|
|
265
288
|
ElevationExpiredError,
|
|
289
|
+
ExportCapabilityError,
|
|
266
290
|
FieldNotQueryableError,
|
|
267
291
|
ForgetStrategyNotConfiguredError,
|
|
292
|
+
ImportCapabilityError,
|
|
268
293
|
IndexWriteFailureError,
|
|
269
294
|
InvalidKeyError,
|
|
270
295
|
KeyringCorruptError,
|
|
@@ -291,234 +316,18 @@ import {
|
|
|
291
316
|
UnsupportedIndexOptionError,
|
|
292
317
|
UnsupportedTierCompositionError,
|
|
293
318
|
ValidationError
|
|
294
|
-
} from "./chunk-
|
|
295
|
-
|
|
296
|
-
// src/via/blob/binding.ts
|
|
297
|
-
async function eraseBlobs(ctx, cfg) {
|
|
298
|
-
if (cfg.purgeBlobsForRecord) return cfg.purgeBlobsForRecord(ctx.id);
|
|
299
|
-
return { shredded: 0, residue: [] };
|
|
300
|
-
}
|
|
301
|
-
function buildBlobDescribeFragment(fields) {
|
|
302
|
-
return {
|
|
303
|
-
blobFields: Object.fromEntries(
|
|
304
|
-
Object.entries(fields).map(([field, p]) => [field, {
|
|
305
|
-
...p.retainDays !== void 0 ? { retainDays: p.retainDays } : {},
|
|
306
|
-
...p.evictWhen !== void 0 ? { evictWhen: true } : {},
|
|
307
|
-
...p.legalHold !== void 0 ? { legalHold: true } : {},
|
|
308
|
-
...p.retainUntil !== void 0 ? { retainUntil: true } : {},
|
|
309
|
-
...p.external === true ? { external: true } : {},
|
|
310
|
-
...p.public === true ? { public: true } : {},
|
|
311
|
-
...p.backlink !== void 0 ? { backlink: p.backlink } : {}
|
|
312
|
-
}])
|
|
313
|
-
)
|
|
314
|
-
};
|
|
315
|
-
}
|
|
316
|
-
function blobBinding(cfg) {
|
|
317
|
-
return {
|
|
318
|
-
brand: "blob",
|
|
319
|
-
// encryptedAtRest: 'envelope' — blob chunks are AEAD-encrypted envelopes
|
|
320
|
-
// in `_blob_chunks` (service-side), not sealed record fields; queryable:
|
|
321
|
-
// 'none' — nothing indexes blob content; exportable — vault.exportBlobs()
|
|
322
|
-
// is a first-class door; forgettable — shredAllForRecord participates in
|
|
323
|
-
// vault.forget().
|
|
324
|
-
posture: { encryptedAtRest: "envelope", queryable: "none", exportable: true, forgettable: true },
|
|
325
|
-
covers: (field) => field in cfg.fields,
|
|
326
|
-
erase: (ctx) => eraseBlobs(ctx, cfg),
|
|
327
|
-
describeFragment: () => buildBlobDescribeFragment(cfg.fields)
|
|
328
|
-
};
|
|
329
|
-
}
|
|
330
|
-
function linkBlobVia() {
|
|
331
|
-
installViaBinder("blob", (c) => blobBinding(c));
|
|
332
|
-
}
|
|
333
|
-
|
|
334
|
-
// src/port/with/blob-strategy.ts
|
|
335
|
-
linkBlobVia();
|
|
336
|
-
var NO_BLOBS = {
|
|
337
|
-
openSlot() {
|
|
338
|
-
throw new Error(
|
|
339
|
-
'Blob storage is not enabled on this Noydb instance. Import `{ withBlobs }` from "@noy-db/hub/blobs" and pass `withBlobs()` to `createNoydb({ blobStrategy: withBlobs() })`.'
|
|
340
|
-
);
|
|
341
|
-
}
|
|
342
|
-
};
|
|
343
|
-
|
|
344
|
-
// src/with-audit/consent/strategy.ts
|
|
345
|
-
var NO_CONSENT = {
|
|
346
|
-
async write() {
|
|
347
|
-
},
|
|
348
|
-
async read() {
|
|
349
|
-
return [];
|
|
350
|
-
}
|
|
351
|
-
};
|
|
352
|
-
|
|
353
|
-
// src/with-commit/crdt/strategy.ts
|
|
354
|
-
var NOT_ENABLED = new Error(
|
|
355
|
-
'CRDT mode requires the CRDT strategy. Import `{ withCrdt }` from "@noy-db/hub/crdt" and pass it to `createNoydb({ crdtStrategy: withCrdt() })`.'
|
|
356
|
-
);
|
|
357
|
-
var NO_CRDT = {
|
|
358
|
-
buildLwwMapState() {
|
|
359
|
-
throw NOT_ENABLED;
|
|
360
|
-
},
|
|
361
|
-
buildRgaState() {
|
|
362
|
-
throw NOT_ENABLED;
|
|
363
|
-
},
|
|
364
|
-
mergeCrdtStates() {
|
|
365
|
-
throw NOT_ENABLED;
|
|
366
|
-
},
|
|
367
|
-
resolveCrdtSnapshot() {
|
|
368
|
-
throw NOT_ENABLED;
|
|
369
|
-
}
|
|
370
|
-
};
|
|
371
|
-
|
|
372
|
-
// src/with-commit/history/strategy.ts
|
|
373
|
-
function notEnabled(op) {
|
|
374
|
-
return new Error(
|
|
375
|
-
`${op} requires the history strategy. Import \`{ withHistory }\` from "@noy-db/hub/history" and pass it to \`createNoydb({ historyStrategy: withHistory() })\`.`
|
|
376
|
-
);
|
|
377
|
-
}
|
|
378
|
-
var NO_HISTORY = {
|
|
379
|
-
async saveHistory() {
|
|
380
|
-
},
|
|
381
|
-
async getHistoryEntries() {
|
|
382
|
-
throw notEnabled("collection.history()");
|
|
383
|
-
},
|
|
384
|
-
async getVersionEnvelope() {
|
|
385
|
-
throw notEnabled("collection.getVersion()");
|
|
386
|
-
},
|
|
387
|
-
async pruneHistory() {
|
|
388
|
-
return 0;
|
|
389
|
-
},
|
|
390
|
-
async clearHistory() {
|
|
391
|
-
return 0;
|
|
392
|
-
},
|
|
393
|
-
async tombstoneHistory() {
|
|
394
|
-
return 0;
|
|
395
|
-
},
|
|
396
|
-
async rewrapHistory() {
|
|
397
|
-
},
|
|
398
|
-
async envelopePayloadHash() {
|
|
399
|
-
return "";
|
|
400
|
-
},
|
|
401
|
-
computePatch() {
|
|
402
|
-
return [];
|
|
403
|
-
},
|
|
404
|
-
diff() {
|
|
405
|
-
throw notEnabled("collection.diff()");
|
|
406
|
-
},
|
|
407
|
-
buildLedger() {
|
|
408
|
-
return null;
|
|
409
|
-
},
|
|
410
|
-
buildVaultInstant() {
|
|
411
|
-
throw notEnabled("vault.at() / vault.timeMachine()");
|
|
412
|
-
}
|
|
413
|
-
};
|
|
414
|
-
|
|
415
|
-
// src/with-lookup/indexing/strategy.ts
|
|
416
|
-
var NO_INDEXING = {
|
|
417
|
-
createState() {
|
|
418
|
-
return DISABLED_STATE;
|
|
419
|
-
}
|
|
420
|
-
};
|
|
421
|
-
var DISABLED_STATE = {
|
|
422
|
-
isEnabled: false,
|
|
423
|
-
getEagerIndexes: () => null,
|
|
424
|
-
getPersistedIndexes: () => null
|
|
425
|
-
};
|
|
426
|
-
|
|
427
|
-
// src/with-audit/periods/strategy.ts
|
|
428
|
-
var NOT_ENABLED2 = new Error(
|
|
429
|
-
'Accounting periods require the periods strategy. Import `{ withPeriods }` from "@noy-db/hub/periods" and pass it to `createNoydb({ periodsStrategy: withPeriods() })`.'
|
|
430
|
-
);
|
|
431
|
-
var NO_PERIODS = {
|
|
432
|
-
async loadPeriods() {
|
|
433
|
-
return [];
|
|
434
|
-
},
|
|
435
|
-
async chainAnchor() {
|
|
436
|
-
return { priorPeriodHash: "" };
|
|
437
|
-
},
|
|
438
|
-
assertTsWritable() {
|
|
439
|
-
},
|
|
440
|
-
validatePeriodName() {
|
|
441
|
-
throw NOT_ENABLED2;
|
|
442
|
-
},
|
|
443
|
-
async appendPeriodLedgerEntry() {
|
|
444
|
-
throw NOT_ENABLED2;
|
|
445
|
-
}
|
|
446
|
-
};
|
|
447
|
-
|
|
448
|
-
// src/with-party/session/strategy.ts
|
|
449
|
-
function notEnabled2(op) {
|
|
450
|
-
return new Error(
|
|
451
|
-
`${op} requires the session strategy. Import \`{ withSession }\` from "@noy-db/hub/session" and pass it to \`createNoydb({ sessionStrategy: withSession() })\`.`
|
|
452
|
-
);
|
|
453
|
-
}
|
|
454
|
-
var NO_SESSION = {
|
|
455
|
-
validateSessionPolicy() {
|
|
456
|
-
throw notEnabled2("sessionPolicy");
|
|
457
|
-
},
|
|
458
|
-
createEnforcer() {
|
|
459
|
-
throw notEnabled2("session policy enforcement");
|
|
460
|
-
},
|
|
461
|
-
revokeAllSessions() {
|
|
462
|
-
}
|
|
463
|
-
};
|
|
464
|
-
|
|
465
|
-
// src/with-fork/shadow/strategy.ts
|
|
466
|
-
var NOT_ENABLED3 = new Error(
|
|
467
|
-
'VaultFrame requires the shadow strategy. Import `{ withShadow }` from "@noy-db/hub/shadow" and pass it to `createNoydb({ shadowStrategy: withShadow() })`.'
|
|
468
|
-
);
|
|
469
|
-
var NO_SHADOW = {
|
|
470
|
-
buildFrame() {
|
|
471
|
-
throw NOT_ENABLED3;
|
|
472
|
-
}
|
|
473
|
-
};
|
|
474
|
-
|
|
475
|
-
// src/with-fork/snapshots/strategy.ts
|
|
476
|
-
var NOT_ENABLED4 = new Error(
|
|
477
|
-
'Snapshots require the snapshot strategy. Import `{ withSnapshots }` from "@noy-db/hub/snapshots" and pass it to `createNoydb({ snapshotStrategy: withSnapshots({ store }) })`.'
|
|
478
|
-
);
|
|
479
|
-
var NO_SNAPSHOTS = {
|
|
480
|
-
async snapshot() {
|
|
481
|
-
throw NOT_ENABLED4;
|
|
482
|
-
},
|
|
483
|
-
async listSnapshots() {
|
|
484
|
-
throw NOT_ENABLED4;
|
|
485
|
-
},
|
|
486
|
-
async restoreSnapshot() {
|
|
487
|
-
throw NOT_ENABLED4;
|
|
488
|
-
},
|
|
489
|
-
async autoSnapshot() {
|
|
490
|
-
throw NOT_ENABLED4;
|
|
491
|
-
}
|
|
492
|
-
};
|
|
493
|
-
|
|
494
|
-
// src/with-party/team/sync-strategy.ts
|
|
495
|
-
function notEnabled3(op) {
|
|
496
|
-
return new Error(
|
|
497
|
-
`${op} requires the sync strategy. Import \`{ withSync }\` from "@noy-db/hub/sync" and pass it to \`createNoydb({ syncStrategy: withSync() })\`.`
|
|
498
|
-
);
|
|
499
|
-
}
|
|
500
|
-
var NO_SYNC = {
|
|
501
|
-
buildSyncEngine() {
|
|
502
|
-
throw notEnabled3("SyncEngine");
|
|
503
|
-
},
|
|
504
|
-
buildSyncTransaction() {
|
|
505
|
-
throw notEnabled3("SyncTransaction");
|
|
506
|
-
},
|
|
507
|
-
buildPresence() {
|
|
508
|
-
throw notEnabled3("collection.presence()");
|
|
509
|
-
}
|
|
510
|
-
};
|
|
319
|
+
} from "./chunk-6SYOHUHM.js";
|
|
511
320
|
|
|
512
321
|
// src/with-commit/tx/strategy.ts
|
|
513
|
-
var
|
|
322
|
+
var NOT_ENABLED = new Error(
|
|
514
323
|
'Multi-record transactions require the tx strategy. Import `{ withTransactions }` from "@noy-db/hub/tx" and pass it to `createNoydb({ txStrategy: withTransactions() })`.'
|
|
515
324
|
);
|
|
516
325
|
var NO_TX = {
|
|
517
326
|
async runTransaction(_db, _fn, _options, _txInvariants) {
|
|
518
|
-
throw
|
|
327
|
+
throw NOT_ENABLED;
|
|
519
328
|
},
|
|
520
329
|
async runDryRun() {
|
|
521
|
-
throw
|
|
330
|
+
throw NOT_ENABLED;
|
|
522
331
|
}
|
|
523
332
|
};
|
|
524
333
|
|
|
@@ -532,7 +341,7 @@ var NO_ARCHIVE = {
|
|
|
532
341
|
|
|
533
342
|
// src/port/with/strategies.ts
|
|
534
343
|
var STRATEGY_DEFAULTS = {
|
|
535
|
-
|
|
344
|
+
reduce: NO_REDUCE,
|
|
536
345
|
archive: NO_ARCHIVE,
|
|
537
346
|
attestation: NO_ATTESTATION,
|
|
538
347
|
blob: NO_BLOBS,
|
|
@@ -573,10 +382,61 @@ function resolveStrategies(options) {
|
|
|
573
382
|
|
|
574
383
|
// src/port/by/default-provider.ts
|
|
575
384
|
async function createDefaultCoordinationProvider(store) {
|
|
576
|
-
const { StoreCoordinationProvider } = await import("./store-coordination-provider-
|
|
385
|
+
const { StoreCoordinationProvider } = await import("./store-coordination-provider-DX5HECK3.js");
|
|
577
386
|
return new StoreCoordinationProvider(store);
|
|
578
387
|
}
|
|
579
388
|
|
|
389
|
+
// src/port/with/collection-registries.ts
|
|
390
|
+
function populateCollectionRegistries(r, collectionName, options, effectiveViaFields) {
|
|
391
|
+
if (options?.refs) {
|
|
392
|
+
r.refRegistry.register(collectionName, options.refs);
|
|
393
|
+
}
|
|
394
|
+
if (effectiveViaFields.i18nFields) {
|
|
395
|
+
r.i18nFieldRegistry.set(collectionName, effectiveViaFields.i18nFields);
|
|
396
|
+
}
|
|
397
|
+
if (options?.blobFields) {
|
|
398
|
+
r.blobFieldsRegistry.set(collectionName, options.blobFields);
|
|
399
|
+
}
|
|
400
|
+
if (options?.archive) {
|
|
401
|
+
r.archiveRegistry.set(collectionName, options.archive);
|
|
402
|
+
}
|
|
403
|
+
if (options?.attestation !== void 0) {
|
|
404
|
+
r.attestation.register(collectionName, options.attestation);
|
|
405
|
+
}
|
|
406
|
+
if (effectiveViaFields.dictKeyFields || effectiveViaFields.lookupFields) {
|
|
407
|
+
const dictFieldMap = {};
|
|
408
|
+
const staticFieldMap = {};
|
|
409
|
+
for (const [field, desc] of Object.entries(effectiveViaFields.dictKeyFields ?? {})) {
|
|
410
|
+
if (isStaticDictDescriptor(desc)) {
|
|
411
|
+
staticFieldMap[field] = desc;
|
|
412
|
+
r.staticDictNames.add(desc.name);
|
|
413
|
+
r.staticByName.set(desc.name, desc);
|
|
414
|
+
} else {
|
|
415
|
+
dictFieldMap[field] = desc.name;
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
const lookupCompat = collectLookupDictCompat(effectiveViaFields.lookupFields);
|
|
419
|
+
Object.assign(dictFieldMap, lookupCompat.dictFieldMap);
|
|
420
|
+
for (const [field, desc] of lookupCompat.staticEntries) {
|
|
421
|
+
staticFieldMap[field] = desc;
|
|
422
|
+
r.staticDictNames.add(desc.name);
|
|
423
|
+
r.staticByName.set(desc.name, desc);
|
|
424
|
+
}
|
|
425
|
+
if (Object.keys(dictFieldMap).length > 0) {
|
|
426
|
+
r.dictKeyFieldRegistry.set(collectionName, dictFieldMap);
|
|
427
|
+
for (const dictName of new Set(Object.values(dictFieldMap))) {
|
|
428
|
+
r.reservedLookupCollections.set(dictCollectionName(dictName), dictName);
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
if (Object.keys(staticFieldMap).length > 0) {
|
|
432
|
+
r.staticDescriptorByField.set(collectionName, staticFieldMap);
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
if ((options?.schemaUpdate?.length ?? 0) > 0) {
|
|
436
|
+
r.schemaUpdateNames.set(collectionName, (options.schemaUpdate ?? []).map((s) => s.name));
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
|
|
580
440
|
// src/kernel/via/pipeline.ts
|
|
581
441
|
var ViaPipeline = class _ViaPipeline {
|
|
582
442
|
constructor(bindings, taint) {
|
|
@@ -1844,79 +1704,6 @@ function buildDescription(input) {
|
|
|
1844
1704
|
};
|
|
1845
1705
|
}
|
|
1846
1706
|
|
|
1847
|
-
// src/with-formula/derivations/stale.ts
|
|
1848
|
-
var _staleByRegistry = /* @__PURE__ */ new WeakMap();
|
|
1849
|
-
var keyFor = (source, sourceId) => `${source}/${sourceId}`;
|
|
1850
|
-
async function markStale(registry, strategy, sourceId) {
|
|
1851
|
-
let map = _staleByRegistry.get(registry);
|
|
1852
|
-
if (!map) {
|
|
1853
|
-
map = /* @__PURE__ */ new Map();
|
|
1854
|
-
_staleByRegistry.set(registry, map);
|
|
1855
|
-
}
|
|
1856
|
-
const k = keyFor(strategy.source, sourceId);
|
|
1857
|
-
let set = map.get(k);
|
|
1858
|
-
if (!set) {
|
|
1859
|
-
set = /* @__PURE__ */ new Set();
|
|
1860
|
-
map.set(k, set);
|
|
1861
|
-
}
|
|
1862
|
-
set.add(strategy);
|
|
1863
|
-
}
|
|
1864
|
-
async function resolveStaleOnRead(accessor, outputCollection, id) {
|
|
1865
|
-
const registry = accessor.registry();
|
|
1866
|
-
const producers = registry.strategiesProducingOutput(outputCollection);
|
|
1867
|
-
if (producers.length === 0) return;
|
|
1868
|
-
const map = _staleByRegistry.get(registry);
|
|
1869
|
-
if (!map) return;
|
|
1870
|
-
let DerivationExecutor = null;
|
|
1871
|
-
for (const { spec, strategyHash } of producers) {
|
|
1872
|
-
const k = keyFor(spec.source, id);
|
|
1873
|
-
const pending = map.get(k);
|
|
1874
|
-
if (!pending || !pending.has(spec)) continue;
|
|
1875
|
-
const sourceColl = accessor.getCollection(spec.source);
|
|
1876
|
-
const source = await sourceColl.get(id);
|
|
1877
|
-
if (!source) {
|
|
1878
|
-
pending.delete(spec);
|
|
1879
|
-
continue;
|
|
1880
|
-
}
|
|
1881
|
-
const sourceWithId = { ...source, id };
|
|
1882
|
-
if (DerivationExecutor === null) {
|
|
1883
|
-
({ DerivationExecutor } = await import("./executor-TEZYRDN3.js"));
|
|
1884
|
-
}
|
|
1885
|
-
const ctx = { vault: accessor.getReadOnlyFacade() };
|
|
1886
|
-
const result = await DerivationExecutor.run(spec, sourceWithId, 0, strategyHash, ctx);
|
|
1887
|
-
for (const key of Object.keys(spec.outputs)) {
|
|
1888
|
-
const out = result.outputs[key];
|
|
1889
|
-
if (!out) continue;
|
|
1890
|
-
if (out.kind === "failed") {
|
|
1891
|
-
const err = out.error;
|
|
1892
|
-
if (spec.strict) {
|
|
1893
|
-
throw err;
|
|
1894
|
-
}
|
|
1895
|
-
console.warn(
|
|
1896
|
-
`[derivation] lazy output "${key}" for source "${spec.source}" id="${id}" failed:`,
|
|
1897
|
-
err
|
|
1898
|
-
);
|
|
1899
|
-
continue;
|
|
1900
|
-
}
|
|
1901
|
-
if (out.kind === "array") {
|
|
1902
|
-
console.warn(
|
|
1903
|
-
`[derivation] unexpected array-shape output "${key}" in lazy resolve path; array-shape derivations require lifecycle: "eager".`
|
|
1904
|
-
);
|
|
1905
|
-
continue;
|
|
1906
|
-
}
|
|
1907
|
-
const outSpec = spec.outputs[key];
|
|
1908
|
-
if (!outSpec) continue;
|
|
1909
|
-
const outputColl = accessor.getCollection(outSpec.collection);
|
|
1910
|
-
if (out.skipped === true) {
|
|
1911
|
-
await outputColl._internalDelete(id, accessor.getActiveTxContext());
|
|
1912
|
-
continue;
|
|
1913
|
-
}
|
|
1914
|
-
await outputColl.put(id, out.value);
|
|
1915
|
-
}
|
|
1916
|
-
pending.delete(spec);
|
|
1917
|
-
}
|
|
1918
|
-
}
|
|
1919
|
-
|
|
1920
1707
|
// src/kernel/via/compose.ts
|
|
1921
1708
|
function via(...descriptors) {
|
|
1922
1709
|
if (descriptors.length === 0) {
|
|
@@ -2381,22 +2168,12 @@ function resolveCollectionConfig(opts) {
|
|
|
2381
2168
|
}
|
|
2382
2169
|
|
|
2383
2170
|
// src/with-formula/computed/lazy.ts
|
|
2384
|
-
var
|
|
2171
|
+
var loadComputed = lazy(() => import("./computed-33DRJDOC.js"));
|
|
2385
2172
|
async function loadEvalComputedFields() {
|
|
2386
|
-
|
|
2387
|
-
return fn;
|
|
2173
|
+
return (await loadComputed()).evalComputedFields;
|
|
2388
2174
|
}
|
|
2389
2175
|
|
|
2390
2176
|
// src/kernel/collection.ts
|
|
2391
|
-
function selfWriteFieldEqual(a, b) {
|
|
2392
|
-
if (a === b) return true;
|
|
2393
|
-
if (a === null || b === null || typeof a !== "object" || typeof b !== "object") return false;
|
|
2394
|
-
try {
|
|
2395
|
-
return JSON.stringify(a) === JSON.stringify(b);
|
|
2396
|
-
} catch {
|
|
2397
|
-
return false;
|
|
2398
|
-
}
|
|
2399
|
-
}
|
|
2400
2177
|
var fallbackWarned = /* @__PURE__ */ new Set();
|
|
2401
2178
|
function warnOnceFallback(adapterName) {
|
|
2402
2179
|
if (fallbackWarned.has(adapterName)) return;
|
|
@@ -3169,7 +2946,7 @@ var Collection = class {
|
|
|
3169
2946
|
}
|
|
3170
2947
|
await this.onAccess?.("find", "*");
|
|
3171
2948
|
if (hits.length === 0) return [];
|
|
3172
|
-
const { verifyDigestField } = await import("./verify-
|
|
2949
|
+
const { verifyDigestField } = await import("./verify-5X37OXRY.js");
|
|
3173
2950
|
const policy = {
|
|
3174
2951
|
normalize: spec.verifyNormalize ?? "password",
|
|
3175
2952
|
notLastN: spec.notLastN ?? 0,
|
|
@@ -3375,7 +3152,7 @@ var Collection = class {
|
|
|
3375
3152
|
}
|
|
3376
3153
|
}
|
|
3377
3154
|
if (this.materializedViewSource !== void 0) {
|
|
3378
|
-
const { resolveStaleMVOnRead } = await import("./stale-
|
|
3155
|
+
const { resolveStaleMVOnRead } = await import("./stale-BJO2WIN7.js");
|
|
3379
3156
|
await resolveStaleMVOnRead(this.materializedViewSource, this.name, this.#dispatchCtx({ collection: this.name, id: "resolve-on-read" }));
|
|
3380
3157
|
}
|
|
3381
3158
|
let record;
|
|
@@ -3631,6 +3408,103 @@ var Collection = class {
|
|
|
3631
3408
|
return clone;
|
|
3632
3409
|
}
|
|
3633
3410
|
/** @internal Untracked put body — call {@link put}, not this. */
|
|
3411
|
+
/**
|
|
3412
|
+
* Decode a prior envelope's CRDT state, or `undefined` when there is no
|
|
3413
|
+
* usable prior: no envelope, a shredded body decrypting to `null`, or a
|
|
3414
|
+
* payload that is not a CRDT state. The `lww-map` and `rga` branches each
|
|
3415
|
+
* carried a copy, byte-identical apart from the cast (#842).
|
|
3416
|
+
*/
|
|
3417
|
+
async #decodePriorCrdtState(envelope) {
|
|
3418
|
+
if (!envelope) return void 0;
|
|
3419
|
+
const prevJson = await this.codec.decryptJsonString(envelope);
|
|
3420
|
+
if (prevJson === null) return void 0;
|
|
3421
|
+
const prevParsed = JSON.parse(prevJson);
|
|
3422
|
+
if (prevParsed === null || typeof prevParsed !== "object" || !("_crdt" in prevParsed)) {
|
|
3423
|
+
return void 0;
|
|
3424
|
+
}
|
|
3425
|
+
return prevParsed;
|
|
3426
|
+
}
|
|
3427
|
+
/**
|
|
3428
|
+
* Record a write on the active transaction so a mid-batch failure rolls it
|
|
3429
|
+
* back. Four sites in the derivation/MV dispatch hand-built this literal (#842).
|
|
3430
|
+
*/
|
|
3431
|
+
#trackPut(txCtx, collectionName, id, priorEnvelope) {
|
|
3432
|
+
txCtx._executed.push({
|
|
3433
|
+
op: { type: "put", vaultName: this.vault, collectionName, id },
|
|
3434
|
+
priorEnvelope
|
|
3435
|
+
});
|
|
3436
|
+
}
|
|
3437
|
+
/**
|
|
3438
|
+
* Snapshot the PRIOR version into history, emit, and prune.
|
|
3439
|
+
*
|
|
3440
|
+
* Deliberately does NOT carry `source` from the current write — a history
|
|
3441
|
+
* entry describes the version being replaced, not the one replacing it.
|
|
3442
|
+
*
|
|
3443
|
+
* Kept OUT of {@link #commitWriteTail} because the two paths call it at
|
|
3444
|
+
* different points: the normal path snapshots BEFORE `adapter.put` (so a
|
|
3445
|
+
* history failure leaves no write behind), while the CRDT path must merge
|
|
3446
|
+
* and persist first to resolve the prior record at all. Folding it into the
|
|
3447
|
+
* tail would silently reorder one of them (#842).
|
|
3448
|
+
*/
|
|
3449
|
+
async #savePriorHistory(id, prior, cek, vdigCtx) {
|
|
3450
|
+
if (this.historyConfig.enabled === false) return;
|
|
3451
|
+
await this.strategies.history.saveHistory(
|
|
3452
|
+
this.adapter,
|
|
3453
|
+
this.vault,
|
|
3454
|
+
this.name,
|
|
3455
|
+
id,
|
|
3456
|
+
await this.codec.encryptRecord(prior.record, prior.version, cek, void 0, void 0, vdigCtx, id)
|
|
3457
|
+
);
|
|
3458
|
+
this.emitter.emit("history:save", { vault: this.vault, collection: this.name, id, version: prior.version });
|
|
3459
|
+
if (this.historyConfig.maxVersions) {
|
|
3460
|
+
await this.strategies.history.pruneHistory(this.adapter, this.vault, this.name, id, { keepVersions: this.historyConfig.maxVersions });
|
|
3461
|
+
}
|
|
3462
|
+
}
|
|
3463
|
+
/**
|
|
3464
|
+
* Everything both write paths do once the envelope is on the adapter:
|
|
3465
|
+
* classified marker, embedding sidecar, ledger append, cache/index
|
|
3466
|
+
* maintenance, and the mutation event that drives derivation dispatch.
|
|
3467
|
+
*
|
|
3468
|
+
* The CRDT branch used to re-implement all of it, and in doing so skipped
|
|
3469
|
+
* `_ensureClassifiedMarker`, the unique-constraint upsert and
|
|
3470
|
+
* `_toCacheableRecord` (#835). All three were unreachable — each blocked by
|
|
3471
|
+
* a config-time refusal on CRDT collections — but only by accident of what
|
|
3472
|
+
* that copy happened to omit. One tail makes the divergence unrepresentable
|
|
3473
|
+
* rather than merely unreachable; on a CRDT collection the extra steps are
|
|
3474
|
+
* provably no-ops (classified/unique + crdt are refused at construction, and
|
|
3475
|
+
* a CRDT body never produces a `_sealed` slot, so `_toCacheableRecord` is
|
|
3476
|
+
* the identity).
|
|
3477
|
+
*/
|
|
3478
|
+
async #commitWriteTail(args) {
|
|
3479
|
+
const { id, envelope, version, indexed, event, prior, reason } = args;
|
|
3480
|
+
await this._ensureClassifiedMarker();
|
|
3481
|
+
if (this.embeddings) {
|
|
3482
|
+
await this.strategies.search.embedOnWrite(this.searchContext(), id, indexed, version);
|
|
3483
|
+
}
|
|
3484
|
+
if (this.ledger) {
|
|
3485
|
+
const appendInput = {
|
|
3486
|
+
op: "put",
|
|
3487
|
+
collection: this.name,
|
|
3488
|
+
id,
|
|
3489
|
+
version,
|
|
3490
|
+
actor: this.keyring.userId,
|
|
3491
|
+
payloadHash: await this.strategies.history.envelopePayloadHash(envelope)
|
|
3492
|
+
};
|
|
3493
|
+
if (prior) appendInput.delta = this.strategies.history.computePatch(indexed, prior.record);
|
|
3494
|
+
if (reason !== void 0) appendInput.reason = reason;
|
|
3495
|
+
await this.ledger.append(appendInput);
|
|
3496
|
+
}
|
|
3497
|
+
const cacheable = await this._toCacheableRecord(indexed, envelope, id);
|
|
3498
|
+
if (this.lazy && this.lru) {
|
|
3499
|
+
this.lru.set(id, { record: cacheable, version }, estimateRecordBytes(indexed));
|
|
3500
|
+
await this.maintainPersistedIndexesOnPut(id, indexed, prior ? prior.record : null, version);
|
|
3501
|
+
} else {
|
|
3502
|
+
this.cache.set(id, { record: cacheable, version });
|
|
3503
|
+
this.indexes?.upsert(id, indexed, prior ? prior.record : null);
|
|
3504
|
+
this.uniqueConstraints?.upsert(id, indexed, prior?.record);
|
|
3505
|
+
}
|
|
3506
|
+
await this._onRecordMutated(id, "put", "local-write", { record: event, version });
|
|
3507
|
+
}
|
|
3634
3508
|
async _putInternal(id, record, options) {
|
|
3635
3509
|
if (!hasWritePermission(this.keyring, this.name)) {
|
|
3636
3510
|
throw new ReadOnlyError();
|
|
@@ -3679,28 +3553,10 @@ var Collection = class {
|
|
|
3679
3553
|
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
3680
3554
|
let crdtState;
|
|
3681
3555
|
if (this.crdtMode === "lww-map") {
|
|
3682
|
-
|
|
3683
|
-
if (existingEnvelope) {
|
|
3684
|
-
const prevJson = await this.codec.decryptJsonString(existingEnvelope);
|
|
3685
|
-
if (prevJson !== null) {
|
|
3686
|
-
const prevParsed = JSON.parse(prevJson);
|
|
3687
|
-
if (prevParsed !== null && typeof prevParsed === "object" && "_crdt" in prevParsed) {
|
|
3688
|
-
existingState = prevParsed;
|
|
3689
|
-
}
|
|
3690
|
-
}
|
|
3691
|
-
}
|
|
3556
|
+
const existingState = await this.#decodePriorCrdtState(existingEnvelope);
|
|
3692
3557
|
crdtState = this.strategies.crdt.buildLwwMapState(record, existingState, now);
|
|
3693
3558
|
} else if (this.crdtMode === "rga") {
|
|
3694
|
-
|
|
3695
|
-
if (existingEnvelope) {
|
|
3696
|
-
const prevJson = await this.codec.decryptJsonString(existingEnvelope);
|
|
3697
|
-
if (prevJson !== null) {
|
|
3698
|
-
const prevParsed = JSON.parse(prevJson);
|
|
3699
|
-
if (prevParsed !== null && typeof prevParsed === "object" && "_crdt" in prevParsed) {
|
|
3700
|
-
existingState = prevParsed;
|
|
3701
|
-
}
|
|
3702
|
-
}
|
|
3703
|
-
}
|
|
3559
|
+
const existingState = await this.#decodePriorCrdtState(existingEnvelope);
|
|
3704
3560
|
crdtState = this.strategies.crdt.buildRgaState(Array.isArray(record) ? record : [record], existingState, generateULID);
|
|
3705
3561
|
} else {
|
|
3706
3562
|
crdtState = { _crdt: "yjs", update: record };
|
|
@@ -3712,39 +3568,18 @@ var Collection = class {
|
|
|
3712
3568
|
const resolvedRecord = this.strategies.crdt.resolveCrdtSnapshot(crdtState);
|
|
3713
3569
|
const existingResolvedRecord = existingEnvelope ? await this.codec.decryptRecord(existingEnvelope, { skipValidation: true }) : null;
|
|
3714
3570
|
const existingResolved = existingResolvedRecord !== null ? { record: existingResolvedRecord, version: existingVersion } : void 0;
|
|
3715
|
-
if (existingResolved
|
|
3716
|
-
await this
|
|
3717
|
-
this.emitter.emit("history:save", { vault: this.vault, collection: this.name, id, version: existingResolved.version });
|
|
3718
|
-
if (this.historyConfig.maxVersions) {
|
|
3719
|
-
await this.strategies.history.pruneHistory(this.adapter, this.vault, this.name, id, { keepVersions: this.historyConfig.maxVersions });
|
|
3720
|
-
}
|
|
3721
|
-
}
|
|
3722
|
-
if (this.ledger) {
|
|
3723
|
-
const appendInput = {
|
|
3724
|
-
op: "put",
|
|
3725
|
-
collection: this.name,
|
|
3726
|
-
id,
|
|
3727
|
-
version: version2,
|
|
3728
|
-
actor: this.keyring.userId,
|
|
3729
|
-
payloadHash: await this.strategies.history.envelopePayloadHash(envelope2)
|
|
3730
|
-
};
|
|
3731
|
-
if (existingResolved) appendInput.delta = this.strategies.history.computePatch(resolvedRecord, existingResolved.record);
|
|
3732
|
-
if (options?.reason !== void 0) appendInput.reason = options.reason;
|
|
3733
|
-
await this.ledger.append(appendInput);
|
|
3734
|
-
}
|
|
3735
|
-
if (this.lazy && this.lru) {
|
|
3736
|
-
this.lru.set(id, { record: resolvedRecord, version: version2 }, estimateRecordBytes(resolvedRecord));
|
|
3737
|
-
await this.maintainPersistedIndexesOnPut(
|
|
3738
|
-
id,
|
|
3739
|
-
resolvedRecord,
|
|
3740
|
-
existingResolved ? existingResolved.record : null,
|
|
3741
|
-
version2
|
|
3742
|
-
);
|
|
3743
|
-
} else {
|
|
3744
|
-
this.cache.set(id, { record: resolvedRecord, version: version2 });
|
|
3745
|
-
this.indexes?.upsert(id, resolvedRecord, existingResolved ? existingResolved.record : null);
|
|
3571
|
+
if (existingResolved) {
|
|
3572
|
+
await this.#savePriorHistory(id, existingResolved, cek2, this.vdigFields !== null ? { id, prev: existingEnvelope } : void 0);
|
|
3746
3573
|
}
|
|
3747
|
-
await this
|
|
3574
|
+
await this.#commitWriteTail({
|
|
3575
|
+
id,
|
|
3576
|
+
envelope: envelope2,
|
|
3577
|
+
version: version2,
|
|
3578
|
+
indexed: resolvedRecord,
|
|
3579
|
+
event: record,
|
|
3580
|
+
prior: existingResolved,
|
|
3581
|
+
reason: options?.reason
|
|
3582
|
+
});
|
|
3748
3583
|
return;
|
|
3749
3584
|
}
|
|
3750
3585
|
let existing;
|
|
@@ -3774,47 +3609,19 @@ var Collection = class {
|
|
|
3774
3609
|
this.uniqueConstraints?.check(id, record);
|
|
3775
3610
|
const cek = this.perRecordCek ? await this.resolveRecordCek(id) : void 0;
|
|
3776
3611
|
const vdigCtx = this.vdigFields !== null ? { id, prev: await this.adapter.get(this.vault, this.name, id) } : void 0;
|
|
3777
|
-
if (existing
|
|
3778
|
-
await this.strategies.history.saveHistory(this.adapter, this.vault, this.name, id, await this.codec.encryptRecord(existing.record, existing.version, cek, void 0, void 0, vdigCtx, id));
|
|
3779
|
-
this.emitter.emit("history:save", {
|
|
3780
|
-
vault: this.vault,
|
|
3781
|
-
collection: this.name,
|
|
3782
|
-
id,
|
|
3783
|
-
version: existing.version
|
|
3784
|
-
});
|
|
3785
|
-
if (this.historyConfig.maxVersions) await this.strategies.history.pruneHistory(this.adapter, this.vault, this.name, id, { keepVersions: this.historyConfig.maxVersions });
|
|
3786
|
-
}
|
|
3612
|
+
if (existing) await this.#savePriorHistory(id, existing, cek, vdigCtx);
|
|
3787
3613
|
const envelope = await this.codec.encryptRecord(record, version, cek, options?.source, options?.sourceTs, vdigCtx, id);
|
|
3788
3614
|
await this.adapter.put(this.vault, this.name, id, envelope);
|
|
3789
3615
|
this.markerIds.delete(id);
|
|
3790
|
-
await this
|
|
3791
|
-
|
|
3792
|
-
|
|
3793
|
-
|
|
3794
|
-
|
|
3795
|
-
|
|
3796
|
-
|
|
3797
|
-
|
|
3798
|
-
|
|
3799
|
-
version,
|
|
3800
|
-
actor: this.keyring.userId,
|
|
3801
|
-
payloadHash: await this.strategies.history.envelopePayloadHash(envelope)
|
|
3802
|
-
};
|
|
3803
|
-
if (existing) {
|
|
3804
|
-
appendInput.delta = this.strategies.history.computePatch(record, existing.record);
|
|
3805
|
-
}
|
|
3806
|
-
if (options?.reason !== void 0) appendInput.reason = options.reason;
|
|
3807
|
-
await this.ledger.append(appendInput);
|
|
3808
|
-
}
|
|
3809
|
-
if (this.lazy && this.lru) {
|
|
3810
|
-
this.lru.set(id, { record: await this._toCacheableRecord(record, envelope, id), version }, estimateRecordBytes(record));
|
|
3811
|
-
await this.maintainPersistedIndexesOnPut(id, record, existing ? existing.record : null, version);
|
|
3812
|
-
} else {
|
|
3813
|
-
this.cache.set(id, { record: await this._toCacheableRecord(record, envelope, id), version });
|
|
3814
|
-
this.indexes?.upsert(id, record, existing ? existing.record : null);
|
|
3815
|
-
this.uniqueConstraints?.upsert(id, record, existing?.record);
|
|
3816
|
-
}
|
|
3817
|
-
await this._onRecordMutated(id, "put", "local-write", { record, version });
|
|
3616
|
+
await this.#commitWriteTail({
|
|
3617
|
+
id,
|
|
3618
|
+
envelope,
|
|
3619
|
+
version,
|
|
3620
|
+
indexed: record,
|
|
3621
|
+
event: record,
|
|
3622
|
+
prior: existing,
|
|
3623
|
+
reason: options?.reason
|
|
3624
|
+
});
|
|
3818
3625
|
}
|
|
3819
3626
|
/**
|
|
3820
3627
|
* Fire registered MV strategies whose dependency set includes this
|
|
@@ -3831,34 +3638,8 @@ var Collection = class {
|
|
|
3831
3638
|
*/
|
|
3832
3639
|
async dispatchMaterializedViews(id, record, wave) {
|
|
3833
3640
|
if (this.materializedViewSource === void 0) return;
|
|
3834
|
-
const
|
|
3835
|
-
|
|
3836
|
-
const registry = this.materializedViewSource.registry();
|
|
3837
|
-
const mvs = registry.mvsForSource(this.name);
|
|
3838
|
-
if (mvs.length === 0) return;
|
|
3839
|
-
let executor = null;
|
|
3840
|
-
let staleHelpers = null;
|
|
3841
|
-
for (const reg of mvs) {
|
|
3842
|
-
const mode = reg.spec.refresh;
|
|
3843
|
-
if (mode === "eager") {
|
|
3844
|
-
if (wave?.seen(`mv\0${reg.spec.name}`)) continue;
|
|
3845
|
-
if (executor === null) {
|
|
3846
|
-
;
|
|
3847
|
-
({ MaterializedViewExecutor: executor } = await import("./executor-YORMIBWV.js"));
|
|
3848
|
-
}
|
|
3849
|
-
await executor.refresh(reg, {
|
|
3850
|
-
getCollection: (name) => this.materializedViewSource.getCollection(name),
|
|
3851
|
-
getActiveTxContext: () => this.materializedViewSource.getActiveTxContext(),
|
|
3852
|
-
getQueryContext: () => this.materializedViewSource.getQueryContext(),
|
|
3853
|
-
dispatchCtx: this.#dispatchCtx({ collection: this.name, id })
|
|
3854
|
-
});
|
|
3855
|
-
} else if (mode === "lazy") {
|
|
3856
|
-
if (staleHelpers === null) {
|
|
3857
|
-
staleHelpers = await import("./stale-4UNPHWOU.js");
|
|
3858
|
-
}
|
|
3859
|
-
staleHelpers.markMVStale(registry, reg.spec.name);
|
|
3860
|
-
}
|
|
3861
|
-
}
|
|
3641
|
+
const { dispatchMaterializedViews } = await import("./dispatch-V5MSMQYX.js");
|
|
3642
|
+
return dispatchMaterializedViews(this.#mvDispatchCtx(this.materializedViewSource), id, record, wave);
|
|
3862
3643
|
}
|
|
3863
3644
|
/**
|
|
3864
3645
|
* Fire registered derivation strategies for this source collection.
|
|
@@ -3946,6 +3727,32 @@ var Collection = class {
|
|
|
3946
3727
|
return out;
|
|
3947
3728
|
}
|
|
3948
3729
|
/** @internal — ctx for `putDerivedOutput`'s frozen-period skip+audit (#638 Task 5). */
|
|
3730
|
+
/** What `with-formula/materialized-views/dispatch.ts` needs from this collection (#842). */
|
|
3731
|
+
#mvDispatchCtx(materializedViewSource) {
|
|
3732
|
+
return {
|
|
3733
|
+
materializedViewSource,
|
|
3734
|
+
collectionName: this.name,
|
|
3735
|
+
dispatchCtx: (source) => this.#dispatchCtx(source)
|
|
3736
|
+
};
|
|
3737
|
+
}
|
|
3738
|
+
/**
|
|
3739
|
+
* What `with-formula/derivations/dispatch.ts` needs from this collection (#842).
|
|
3740
|
+
*
|
|
3741
|
+
* The return type is inferred, not annotated: importing `DerivationDeleteCtx`
|
|
3742
|
+
* would be a STATIC spine→service import, which `port-layering` rejects even
|
|
3743
|
+
* when it is type-only — the guard scans import statements, not their
|
|
3744
|
+
* erasure. The dynamic `import()` at the call site still types the argument.
|
|
3745
|
+
*/
|
|
3746
|
+
#derivationDeleteCtx(derivationSource) {
|
|
3747
|
+
return {
|
|
3748
|
+
derivationSource,
|
|
3749
|
+
collectionName: this.name,
|
|
3750
|
+
adapter: this.adapter,
|
|
3751
|
+
vault: this.vault,
|
|
3752
|
+
getDEK: this.getDEK,
|
|
3753
|
+
storeCiphertext: this.storeCiphertext
|
|
3754
|
+
};
|
|
3755
|
+
}
|
|
3949
3756
|
#dispatchCtx(source) {
|
|
3950
3757
|
return { emit: (e, p) => this.emitter.emit(e, p), source, audit: ledgerAuditHook(this.ledger, this.keyring.userId) };
|
|
3951
3758
|
}
|
|
@@ -3971,11 +3778,7 @@ var Collection = class {
|
|
|
3971
3778
|
const patched = { ...base, [field]: newValue };
|
|
3972
3779
|
const txCtx = this.derivationSource.getActiveTxContext();
|
|
3973
3780
|
if (txCtx !== null) {
|
|
3974
|
-
|
|
3975
|
-
txCtx._executed.push({
|
|
3976
|
-
op: { type: "put", vaultName: this.vault, collectionName: into, id: parentId },
|
|
3977
|
-
priorEnvelope: prior
|
|
3978
|
-
});
|
|
3781
|
+
this.#trackPut(txCtx, into, parentId, await this.adapter.get(this.vault, into, parentId));
|
|
3979
3782
|
}
|
|
3980
3783
|
return putDerivedOutput(intoColl, parentId, patched, this.#dispatchCtx(source));
|
|
3981
3784
|
}
|
|
@@ -4008,150 +3811,14 @@ var Collection = class {
|
|
|
4008
3811
|
* dispatch wave's per-target dedup; `undefined` on the local-write path (byte-identical). */
|
|
4009
3812
|
async dispatchDerivations(id, record, version, wave) {
|
|
4010
3813
|
if (this.derivationSource === void 0) return;
|
|
4011
|
-
const
|
|
4012
|
-
|
|
4013
|
-
|
|
4014
|
-
|
|
4015
|
-
|
|
4016
|
-
|
|
4017
|
-
|
|
4018
|
-
|
|
4019
|
-
if (spec.rollup) {
|
|
4020
|
-
if (mode !== "eager") continue;
|
|
4021
|
-
let parentId;
|
|
4022
|
-
if (this.name === spec.rollup.from) {
|
|
4023
|
-
const kv = incoming[spec.rollup.key];
|
|
4024
|
-
parentId = typeof kv === "string" || typeof kv === "number" ? String(kv) : null;
|
|
4025
|
-
} else {
|
|
4026
|
-
parentId = id;
|
|
4027
|
-
}
|
|
4028
|
-
if (parentId !== null) await this.recomputeRollup(spec, parentId, { collection: this.name, id }, wave);
|
|
4029
|
-
continue;
|
|
4030
|
-
}
|
|
4031
|
-
const isSource = spec.source === this.name;
|
|
4032
|
-
const isSibling = !isSource && (spec.sources?.includes(this.name) ?? false);
|
|
4033
|
-
const trigger = !isSource && !isSibling ? spec.triggerBy?.find((t) => t.collection === this.name) : void 0;
|
|
4034
|
-
const runs = [];
|
|
4035
|
-
if (isSource) {
|
|
4036
|
-
runs.push({ input: { ...incoming, id }, base: incoming, runId: id, version });
|
|
4037
|
-
} else if (isSibling) {
|
|
4038
|
-
const p = await this.derivationSource.getCollection(spec.source).get(id);
|
|
4039
|
-
if (p !== null && p !== void 0) {
|
|
4040
|
-
const raw = await this.derivationSource.getCollection(spec.source)._getStoredRecord(id);
|
|
4041
|
-
runs.push({ input: { ...p, id }, base: raw ?? p, runId: id, version: 0 });
|
|
4042
|
-
}
|
|
4043
|
-
} else if (trigger) {
|
|
4044
|
-
const srcColl = this.derivationSource.getCollection(spec.source);
|
|
4045
|
-
const ids = await srcColl._findMatchingIds(trigger.on, id);
|
|
4046
|
-
if (trigger.maxFanout !== void 0 && ids.length > trigger.maxFanout) {
|
|
4047
|
-
throw new DerivationCapExceededError(`triggerBy ${this.name}\u2192${spec.source}`, ids.length, trigger.maxFanout);
|
|
4048
|
-
}
|
|
4049
|
-
for (const sid of ids) {
|
|
4050
|
-
const raw = await srcColl._getStoredRecord(sid);
|
|
4051
|
-
if (raw === null) continue;
|
|
4052
|
-
runs.push({ input: { ...raw, id: sid }, base: raw, runId: sid, version: 0 });
|
|
4053
|
-
}
|
|
4054
|
-
}
|
|
4055
|
-
if (runs.length === 0) continue;
|
|
4056
|
-
if (mode !== "eager") {
|
|
4057
|
-
for (const run of runs) await markStale(registry, spec, run.runId);
|
|
4058
|
-
continue;
|
|
4059
|
-
}
|
|
4060
|
-
if (DerivationExecutor === null) {
|
|
4061
|
-
({ DerivationExecutor } = await import("./executor-TEZYRDN3.js"));
|
|
4062
|
-
}
|
|
4063
|
-
for (const run of runs) {
|
|
4064
|
-
const ctx = { vault: this.derivationSource.getReadOnlyFacade() };
|
|
4065
|
-
const outCtx = this.#dispatchCtx({ collection: spec.source, id: run.runId });
|
|
4066
|
-
const result = await DerivationExecutor.run(spec, run.input, run.version, strategyHash, ctx);
|
|
4067
|
-
for (const key of Object.keys(spec.outputs)) {
|
|
4068
|
-
const out = result.outputs[key];
|
|
4069
|
-
if (!out) continue;
|
|
4070
|
-
if (out.kind === "failed") {
|
|
4071
|
-
const err = out.error;
|
|
4072
|
-
if (spec.strict) throw err;
|
|
4073
|
-
console.warn(`[derivation] output "${key}" for source "${spec.source}" id="${run.runId}" failed:`, err);
|
|
4074
|
-
continue;
|
|
4075
|
-
}
|
|
4076
|
-
const outSpec = spec.outputs[key];
|
|
4077
|
-
if (!outSpec) continue;
|
|
4078
|
-
const outputCollection = this.derivationSource.getCollection(outSpec.collection);
|
|
4079
|
-
const txCtx = this.derivationSource.getActiveTxContext();
|
|
4080
|
-
if (out.kind === "array") {
|
|
4081
|
-
const { loadFanoutSidecar, saveFanoutSidecar } = await import("./fanout-sidecar-HJV3A7PM.js");
|
|
4082
|
-
const prior = await loadFanoutSidecar(this.adapter, this.vault, spec.source, run.runId, key, this.getDEK, this.storeCiphertext);
|
|
4083
|
-
const prevKeys = new Set(prior?.keys ?? []);
|
|
4084
|
-
const newKeysList = out.entries.map((e) => e.key);
|
|
4085
|
-
const newKeysSet = new Set(newKeysList);
|
|
4086
|
-
for (const k of prevKeys) {
|
|
4087
|
-
if (newKeysSet.has(k)) continue;
|
|
4088
|
-
await outputCollection._internalDelete(k, txCtx);
|
|
4089
|
-
}
|
|
4090
|
-
for (const entry of out.entries) {
|
|
4091
|
-
if (txCtx !== null) {
|
|
4092
|
-
const priorEnvelope = await this.adapter.get(this.vault, outSpec.collection, entry.key);
|
|
4093
|
-
txCtx._executed.push({
|
|
4094
|
-
op: {
|
|
4095
|
-
type: "put",
|
|
4096
|
-
vaultName: this.vault,
|
|
4097
|
-
collectionName: outSpec.collection,
|
|
4098
|
-
id: entry.key
|
|
4099
|
-
},
|
|
4100
|
-
priorEnvelope
|
|
4101
|
-
});
|
|
4102
|
-
}
|
|
4103
|
-
await putDerivedOutput(outputCollection, entry.key, entry.value, outCtx, { source: "derived" });
|
|
4104
|
-
}
|
|
4105
|
-
await saveFanoutSidecar(this.adapter, this.vault, {
|
|
4106
|
-
source: spec.source,
|
|
4107
|
-
sourceId: run.runId,
|
|
4108
|
-
outputKey: key,
|
|
4109
|
-
outputCollection: outSpec.collection,
|
|
4110
|
-
keys: newKeysList
|
|
4111
|
-
}, this.getDEK, this.storeCiphertext);
|
|
4112
|
-
continue;
|
|
4113
|
-
}
|
|
4114
|
-
if (out.skipped === true) {
|
|
4115
|
-
await outputCollection._internalDelete(run.runId, txCtx);
|
|
4116
|
-
continue;
|
|
4117
|
-
}
|
|
4118
|
-
if (outSpec.shape === "record" && outSpec.denorm !== void 0 && outSpec.collection === spec.source) {
|
|
4119
|
-
const value = out.value;
|
|
4120
|
-
const patched = { ...run.base };
|
|
4121
|
-
let changed = false;
|
|
4122
|
-
for (const f of outSpec.denorm) {
|
|
4123
|
-
if (!selfWriteFieldEqual(run.base[f], value[f])) {
|
|
4124
|
-
patched[f] = value[f];
|
|
4125
|
-
changed = true;
|
|
4126
|
-
}
|
|
4127
|
-
}
|
|
4128
|
-
if (!changed) continue;
|
|
4129
|
-
if (txCtx !== null) {
|
|
4130
|
-
const prior = await this.adapter.get(this.vault, outSpec.collection, run.runId);
|
|
4131
|
-
txCtx._executed.push({
|
|
4132
|
-
op: { type: "put", vaultName: this.vault, collectionName: outSpec.collection, id: run.runId },
|
|
4133
|
-
priorEnvelope: prior
|
|
4134
|
-
});
|
|
4135
|
-
}
|
|
4136
|
-
await putDerivedOutput(outputCollection, run.runId, patched, outCtx, { source: "derived" });
|
|
4137
|
-
continue;
|
|
4138
|
-
}
|
|
4139
|
-
if (txCtx !== null) {
|
|
4140
|
-
const prior = await this.adapter.get(this.vault, outSpec.collection, run.runId);
|
|
4141
|
-
txCtx._executed.push({
|
|
4142
|
-
op: {
|
|
4143
|
-
type: "put",
|
|
4144
|
-
vaultName: this.vault,
|
|
4145
|
-
collectionName: outSpec.collection,
|
|
4146
|
-
id: run.runId
|
|
4147
|
-
},
|
|
4148
|
-
priorEnvelope: prior
|
|
4149
|
-
});
|
|
4150
|
-
}
|
|
4151
|
-
await putDerivedOutput(outputCollection, run.runId, out.value, outCtx, { source: "derived" });
|
|
4152
|
-
}
|
|
4153
|
-
}
|
|
4154
|
-
}
|
|
3814
|
+
const { dispatchDerivations } = await import("./dispatch-SPMYNXNW.js");
|
|
3815
|
+
return dispatchDerivations({
|
|
3816
|
+
...this.#derivationDeleteCtx(this.derivationSource),
|
|
3817
|
+
via: this.via,
|
|
3818
|
+
recomputeRollup: (spec, parentId, source, w) => this.recomputeRollup(spec, parentId, source, w),
|
|
3819
|
+
dispatchCtx: (source) => this.#dispatchCtx(source),
|
|
3820
|
+
trackPut: (txCtx, collectionName, rid, prior) => this.#trackPut(txCtx, collectionName, rid, prior)
|
|
3821
|
+
}, id, record, version, wave);
|
|
4155
3822
|
}
|
|
4156
3823
|
/**
|
|
4157
3824
|
* Delete a record by ID. Runs inside the hub's write-queue tracker
|
|
@@ -4421,33 +4088,8 @@ var Collection = class {
|
|
|
4421
4088
|
*/
|
|
4422
4089
|
async dispatchArrayDerivationsOnDelete(id, eraseRecordShapeToo = false) {
|
|
4423
4090
|
if (this.derivationSource === void 0) return 0;
|
|
4424
|
-
const
|
|
4425
|
-
|
|
4426
|
-
if (strategies.length === 0) return 0;
|
|
4427
|
-
let helpers = null;
|
|
4428
|
-
const txCtx = this.derivationSource.getActiveTxContext();
|
|
4429
|
-
let erased = 0;
|
|
4430
|
-
for (const { spec } of strategies) {
|
|
4431
|
-
for (const [outputKey, outSpec] of Object.entries(spec.outputs)) {
|
|
4432
|
-
if (outSpec.shape === "record") {
|
|
4433
|
-
if (eraseRecordShapeToo && spec.source === this.name && outSpec.collection !== this.name) {
|
|
4434
|
-
if (await this.derivationSource.getCollection(outSpec.collection)._internalDelete(id, txCtx)) erased += 1;
|
|
4435
|
-
}
|
|
4436
|
-
continue;
|
|
4437
|
-
}
|
|
4438
|
-
if (helpers === null) {
|
|
4439
|
-
helpers = await import("./fanout-sidecar-HJV3A7PM.js");
|
|
4440
|
-
}
|
|
4441
|
-
const sidecar = await helpers.loadFanoutSidecar(this.adapter, this.vault, spec.source, id, outputKey, this.getDEK, this.storeCiphertext);
|
|
4442
|
-
if (!sidecar) continue;
|
|
4443
|
-
const outputCollection = this.derivationSource.getCollection(outSpec.collection);
|
|
4444
|
-
for (const derivedId of sidecar.keys) {
|
|
4445
|
-
if (await outputCollection._internalDelete(derivedId, txCtx)) erased += 1;
|
|
4446
|
-
}
|
|
4447
|
-
await helpers.deleteFanoutSidecar(this.adapter, this.vault, spec.source, id, outputKey);
|
|
4448
|
-
}
|
|
4449
|
-
}
|
|
4450
|
-
return erased;
|
|
4091
|
+
const { dispatchArrayDerivationsOnDelete } = await import("./dispatch-SPMYNXNW.js");
|
|
4092
|
+
return dispatchArrayDerivationsOnDelete(this.#derivationDeleteCtx(this.derivationSource), id, eraseRecordShapeToo);
|
|
4451
4093
|
}
|
|
4452
4094
|
/**
|
|
4453
4095
|
* Mirror of {@link dispatchMaterializedViews} for the delete/forget path — no `_materializedFrom`
|
|
@@ -4460,41 +4102,8 @@ var Collection = class {
|
|
|
4460
4102
|
*/
|
|
4461
4103
|
async dispatchMaterializedViewsOnDelete(id) {
|
|
4462
4104
|
if (this.materializedViewSource === void 0) return { deleted: 0, residueUndecodable: [], residueDeclined: [] };
|
|
4463
|
-
const
|
|
4464
|
-
|
|
4465
|
-
if (mvs.length === 0) return { deleted: 0, residueUndecodable: [], residueDeclined: [] };
|
|
4466
|
-
let executor = null;
|
|
4467
|
-
let staleHelpers = null;
|
|
4468
|
-
let deleted = 0;
|
|
4469
|
-
const residueUndecodable = [];
|
|
4470
|
-
const residueDeclined = [];
|
|
4471
|
-
for (const reg of mvs) {
|
|
4472
|
-
const mode = reg.spec.refresh;
|
|
4473
|
-
if (mode === "eager") {
|
|
4474
|
-
if (executor === null) {
|
|
4475
|
-
;
|
|
4476
|
-
({ MaterializedViewExecutor: executor } = await import("./executor-YORMIBWV.js"));
|
|
4477
|
-
}
|
|
4478
|
-
const rr = await executor.refresh(reg, {
|
|
4479
|
-
getCollection: (name) => this.materializedViewSource.getCollection(name),
|
|
4480
|
-
getActiveTxContext: () => this.materializedViewSource.getActiveTxContext(),
|
|
4481
|
-
getQueryContext: () => this.materializedViewSource.getQueryContext(),
|
|
4482
|
-
dispatchCtx: this.#dispatchCtx({ collection: this.name, id })
|
|
4483
|
-
});
|
|
4484
|
-
deleted += rr.deleted;
|
|
4485
|
-
residueUndecodable.push(...rr.residueUndecodable);
|
|
4486
|
-
residueDeclined.push(...rr.residueDeclined);
|
|
4487
|
-
} else {
|
|
4488
|
-
if (staleHelpers === null) {
|
|
4489
|
-
staleHelpers = await import("./stale-4UNPHWOU.js");
|
|
4490
|
-
}
|
|
4491
|
-
const inv = await staleHelpers.invalidateMVAtRest(this.materializedViewSource, reg, mode);
|
|
4492
|
-
deleted += inv.deleted;
|
|
4493
|
-
residueUndecodable.push(...inv.residueUndecodable.map((rid) => `${reg.outputCollection}:${rid}`));
|
|
4494
|
-
residueDeclined.push(...inv.residueDeclined.map((rid) => `${reg.outputCollection}:${rid}`));
|
|
4495
|
-
}
|
|
4496
|
-
}
|
|
4497
|
-
return { deleted, residueUndecodable, residueDeclined };
|
|
4105
|
+
const { dispatchMaterializedViewsOnDelete } = await import("./dispatch-V5MSMQYX.js");
|
|
4106
|
+
return dispatchMaterializedViewsOnDelete(this.#mvDispatchCtx(this.materializedViewSource), id);
|
|
4498
4107
|
}
|
|
4499
4108
|
/**
|
|
4500
4109
|
* List all records in the collection.
|
|
@@ -4513,7 +4122,7 @@ var Collection = class {
|
|
|
4513
4122
|
);
|
|
4514
4123
|
}
|
|
4515
4124
|
if (this.materializedViewSource !== void 0) {
|
|
4516
|
-
const { resolveStaleMVOnRead } = await import("./stale-
|
|
4125
|
+
const { resolveStaleMVOnRead } = await import("./stale-BJO2WIN7.js");
|
|
4517
4126
|
await resolveStaleMVOnRead(this.materializedViewSource, this.name, this.#dispatchCtx({ collection: this.name, id: "resolve-on-read" }));
|
|
4518
4127
|
}
|
|
4519
4128
|
await this.ensureHydrated();
|
|
@@ -4765,7 +4374,7 @@ var Collection = class {
|
|
|
4765
4374
|
...this.defaultLocale !== void 0 ? { defaultLocale: this.defaultLocale } : {},
|
|
4766
4375
|
...resolver.resolveDictSource ? { resolveDictSource: (field) => resolver.resolveDictSource(leftCollection, field) } : {}
|
|
4767
4376
|
} : void 0;
|
|
4768
|
-
return new Query(source, void 0, joinContext, this.strategies.
|
|
4377
|
+
return new Query(source, void 0, joinContext, this.strategies.reduce);
|
|
4769
4378
|
}
|
|
4770
4379
|
/**
|
|
4771
4380
|
* Subscribe to every put/delete on this collection. Returns an
|
|
@@ -5666,14 +5275,14 @@ var Collection = class {
|
|
|
5666
5275
|
/** C-A/R10: persist the classified marker once per classified handle (store I/O in config-drift.ts). */
|
|
5667
5276
|
async _ensureClassifiedMarker() {
|
|
5668
5277
|
if (this._markerPersisted || this.vdigFields === null) return;
|
|
5669
|
-
const { persistClassifiedMarkerForFields } = await import("./classified-marker-
|
|
5278
|
+
const { persistClassifiedMarkerForFields } = await import("./classified-marker-SVDRXLD3.js");
|
|
5670
5279
|
await persistClassifiedMarkerForFields(this.adapter, this.vault, this.name, this.vdigFields, await this.getDEK(this.name));
|
|
5671
5280
|
this._markerPersisted = true;
|
|
5672
5281
|
}
|
|
5673
5282
|
/** C-A/R10 drift signal — the marker's declared digest-only set, memoized to one store read per handle (see config-drift.ts). */
|
|
5674
5283
|
async _classifiedMarkerDigestOnly() {
|
|
5675
5284
|
if (this._markerDigestOnlyCache !== void 0) return this._markerDigestOnlyCache;
|
|
5676
|
-
const { readClassifiedMarkerDigestOnly } = await import("./classified-marker-
|
|
5285
|
+
const { readClassifiedMarkerDigestOnly } = await import("./classified-marker-SVDRXLD3.js");
|
|
5677
5286
|
this._markerDigestOnlyCache = await readClassifiedMarkerDigestOnly(this.adapter, this.vault, this.name, await this.getDEK(this.name));
|
|
5678
5287
|
return this._markerDigestOnlyCache;
|
|
5679
5288
|
}
|
|
@@ -5844,6 +5453,64 @@ var Collection = class {
|
|
|
5844
5453
|
}
|
|
5845
5454
|
};
|
|
5846
5455
|
|
|
5456
|
+
// src/port/with/capabilities.ts
|
|
5457
|
+
function assertCanExport(keyring, tier, format) {
|
|
5458
|
+
if (tier === "plaintext") {
|
|
5459
|
+
if (format === void 0) {
|
|
5460
|
+
throw new Error("vault.assertCanExport: plaintext tier requires a format");
|
|
5461
|
+
}
|
|
5462
|
+
if (!hasExportCapability(keyring, "plaintext", format)) {
|
|
5463
|
+
throw new ExportCapabilityError({
|
|
5464
|
+
tier: "plaintext",
|
|
5465
|
+
userId: keyring.userId,
|
|
5466
|
+
format
|
|
5467
|
+
});
|
|
5468
|
+
}
|
|
5469
|
+
return;
|
|
5470
|
+
}
|
|
5471
|
+
if (!hasExportCapability(keyring, "bundle")) {
|
|
5472
|
+
throw new ExportCapabilityError({
|
|
5473
|
+
tier: "bundle",
|
|
5474
|
+
userId: keyring.userId
|
|
5475
|
+
});
|
|
5476
|
+
}
|
|
5477
|
+
}
|
|
5478
|
+
function assertCanImport(keyring, tier, format) {
|
|
5479
|
+
if (tier === "plaintext") {
|
|
5480
|
+
if (format === void 0) {
|
|
5481
|
+
throw new Error("vault.assertCanImport: plaintext tier requires a format");
|
|
5482
|
+
}
|
|
5483
|
+
if (!hasImportCapability(keyring, "plaintext", format)) {
|
|
5484
|
+
throw new ImportCapabilityError({
|
|
5485
|
+
tier: "plaintext",
|
|
5486
|
+
userId: keyring.userId,
|
|
5487
|
+
format
|
|
5488
|
+
});
|
|
5489
|
+
}
|
|
5490
|
+
return;
|
|
5491
|
+
}
|
|
5492
|
+
if (!hasImportCapability(keyring, "bundle")) {
|
|
5493
|
+
throw new ImportCapabilityError({
|
|
5494
|
+
tier: "bundle",
|
|
5495
|
+
userId: keyring.userId
|
|
5496
|
+
});
|
|
5497
|
+
}
|
|
5498
|
+
}
|
|
5499
|
+
function canExport(keyring, tier, format) {
|
|
5500
|
+
if (tier === "plaintext") {
|
|
5501
|
+
if (format === void 0) return false;
|
|
5502
|
+
return hasExportCapability(keyring, "plaintext", format);
|
|
5503
|
+
}
|
|
5504
|
+
return hasExportCapability(keyring, "bundle");
|
|
5505
|
+
}
|
|
5506
|
+
function canImport(keyring, tier, format) {
|
|
5507
|
+
if (tier === "plaintext") {
|
|
5508
|
+
if (format === void 0) return false;
|
|
5509
|
+
return hasImportCapability(keyring, "plaintext", format);
|
|
5510
|
+
}
|
|
5511
|
+
return hasImportCapability(keyring, "bundle");
|
|
5512
|
+
}
|
|
5513
|
+
|
|
5847
5514
|
// src/with-commit/tx/elevated-handle.ts
|
|
5848
5515
|
var ELEVATION_AUDIT_COLLECTION = "_elevation_audit";
|
|
5849
5516
|
var ElevatedHandle = class {
|
|
@@ -7058,7 +6725,7 @@ var VaultLinks = class {
|
|
|
7058
6725
|
// src/with-shape/links/lazy-handle.ts
|
|
7059
6726
|
function makeLazyLinkSetHandle(d) {
|
|
7060
6727
|
let engine = null;
|
|
7061
|
-
const load = () => engine ??= import("./link-set-
|
|
6728
|
+
const load = () => engine ??= import("./link-set-XVZY2ODC.js").then(
|
|
7062
6729
|
({ LinkSet }) => new LinkSet(d.adapter, d.vault, d.name, d.spec, d.encrypted, d.getDEK, d.actor, d.emitter, d.endpointExists)
|
|
7063
6730
|
);
|
|
7064
6731
|
return {
|
|
@@ -7541,7 +7208,7 @@ var SatelliteRegistry = class {
|
|
|
7541
7208
|
if (reason !== void 0) throw new SatelliteConfigError(reason);
|
|
7542
7209
|
}
|
|
7543
7210
|
/** Per-base async mutex: chains sections on a stored promise tail. */
|
|
7544
|
-
async withPairLock(base,
|
|
7211
|
+
async withPairLock(base, fn) {
|
|
7545
7212
|
const tail = this.locks.get(base) ?? Promise.resolve();
|
|
7546
7213
|
let release;
|
|
7547
7214
|
const gate = new Promise((res) => {
|
|
@@ -7550,7 +7217,7 @@ var SatelliteRegistry = class {
|
|
|
7550
7217
|
this.locks.set(base, tail.then(() => gate));
|
|
7551
7218
|
await tail;
|
|
7552
7219
|
try {
|
|
7553
|
-
return await
|
|
7220
|
+
return await fn();
|
|
7554
7221
|
} finally {
|
|
7555
7222
|
release();
|
|
7556
7223
|
}
|
|
@@ -7596,7 +7263,7 @@ function declareSatellite(ctx, collectionName, options, existingRegistry) {
|
|
|
7596
7263
|
ctx.forEachSyncEngine((e) => e.remirrorPairResolvers([spec.base, spec.satellite]));
|
|
7597
7264
|
const registry = reg;
|
|
7598
7265
|
const baseSchema = ctx.getBaseSchema(spec.base);
|
|
7599
|
-
void import("./post-register-
|
|
7266
|
+
void import("./post-register-5VHHVFJY.js").then((m) => m.postRegister(ctx.adapter, ctx.vaultName, spec, ctx.getDEK, baseSchema, registry)).catch(() => {
|
|
7600
7267
|
});
|
|
7601
7268
|
return reg;
|
|
7602
7269
|
}
|
|
@@ -8113,6 +7780,43 @@ var VaultAttestation = class {
|
|
|
8113
7780
|
};
|
|
8114
7781
|
|
|
8115
7782
|
// src/kernel/vault.ts
|
|
7783
|
+
var COLLECTION_PASSTHROUGH_KEYS = [
|
|
7784
|
+
"indexes",
|
|
7785
|
+
"reconcileOnOpen",
|
|
7786
|
+
"prefetch",
|
|
7787
|
+
"cache",
|
|
7788
|
+
"schema",
|
|
7789
|
+
"conflictPolicy",
|
|
7790
|
+
"crdt",
|
|
7791
|
+
"deterministicFields",
|
|
7792
|
+
"acknowledgeDeterministicRisk",
|
|
7793
|
+
"acknowledgeEquatableRisk",
|
|
7794
|
+
"sensitive",
|
|
7795
|
+
"perRecordKeys",
|
|
7796
|
+
"provenance",
|
|
7797
|
+
"ramCiphertext",
|
|
7798
|
+
"tiers",
|
|
7799
|
+
"tierMode",
|
|
7800
|
+
"blobTierPolicy",
|
|
7801
|
+
"i18nFields",
|
|
7802
|
+
"embeddings",
|
|
7803
|
+
"textIndexes",
|
|
7804
|
+
"warmIndexOnOpen",
|
|
7805
|
+
"textIndexPersist",
|
|
7806
|
+
"moneyFields",
|
|
7807
|
+
"viaFields",
|
|
7808
|
+
"computed",
|
|
7809
|
+
"classifiedFields",
|
|
7810
|
+
"fieldMeta",
|
|
7811
|
+
"meta"
|
|
7812
|
+
];
|
|
7813
|
+
function copyDefined(dst, src, keys) {
|
|
7814
|
+
if (src === void 0) return;
|
|
7815
|
+
for (const key of keys) {
|
|
7816
|
+
const value = src[key];
|
|
7817
|
+
if (value !== void 0) dst[key] = value;
|
|
7818
|
+
}
|
|
7819
|
+
}
|
|
8116
7820
|
var Vault = class {
|
|
8117
7821
|
adapter;
|
|
8118
7822
|
/** The vault's name as passed to `openVault()`. Stable for the instance lifetime. */
|
|
@@ -8194,7 +7898,7 @@ var Vault = class {
|
|
|
8194
7898
|
* @see docs/superpowers/specs/2026-06-17-fr6-deed-custodian-liberate-design.md
|
|
8195
7899
|
*/
|
|
8196
7900
|
custody;
|
|
8197
|
-
/** Re-derives an UnlockedKeyring from the adapter using the active user's
|
|
7901
|
+
/** Re-derives an UnlockedKeyring from the adapter using the active user's secret; called by
|
|
8198
7902
|
* `load()` after the on-disk keyring file has been replaced. Provided by Noydb at openVault()
|
|
8199
7903
|
* time; `undefined` in tests that construct Vault directly (load() then skips the refresh). */
|
|
8200
7904
|
reloadKeyring;
|
|
@@ -8455,6 +8159,22 @@ var Vault = class {
|
|
|
8455
8159
|
enforceStaticDictOnPut: (collectionName, record) => this.enforceStaticDictOnPut(collectionName, record)
|
|
8456
8160
|
};
|
|
8457
8161
|
}
|
|
8162
|
+
/** The registries `populateCollectionRegistries` writes into (#841). */
|
|
8163
|
+
#registries() {
|
|
8164
|
+
return {
|
|
8165
|
+
refRegistry: this.refRegistry,
|
|
8166
|
+
i18nFieldRegistry: this.i18nFieldRegistry,
|
|
8167
|
+
blobFieldsRegistry: this.blobFieldsRegistry,
|
|
8168
|
+
archiveRegistry: this.archiveRegistry,
|
|
8169
|
+
attestation: this.attestation,
|
|
8170
|
+
dictKeyFieldRegistry: this.dictKeyFieldRegistry,
|
|
8171
|
+
staticDictNames: this.staticDictNames,
|
|
8172
|
+
staticByName: this.staticByName,
|
|
8173
|
+
staticDescriptorByField: this.staticDescriptorByField,
|
|
8174
|
+
reservedLookupCollections: this.reservedLookupCollections,
|
|
8175
|
+
schemaUpdateNames: this.#schemaUpdateNames
|
|
8176
|
+
};
|
|
8177
|
+
}
|
|
8458
8178
|
collection(collectionName, options) {
|
|
8459
8179
|
const overlayRegistry = this.overlayedViewRegistry;
|
|
8460
8180
|
if (overlayRegistry !== null && overlayRegistry.isOverlay(collectionName)) {
|
|
@@ -8488,8 +8208,8 @@ var Vault = class {
|
|
|
8488
8208
|
registerPoisonHook: (hook) => {
|
|
8489
8209
|
this.noydb._writeHooks.onBeforeWrite(hook);
|
|
8490
8210
|
},
|
|
8491
|
-
forEachSyncEngine: (
|
|
8492
|
-
this.noydb._forEachSyncEngine(this.name,
|
|
8211
|
+
forEachSyncEngine: (fn) => {
|
|
8212
|
+
this.noydb._forEachSyncEngine(this.name, fn);
|
|
8493
8213
|
}
|
|
8494
8214
|
}, collectionName, { ...options, satelliteOf: options.satelliteOf }, this.satelliteRegistry);
|
|
8495
8215
|
}
|
|
@@ -8506,60 +8226,14 @@ var Vault = class {
|
|
|
8506
8226
|
});
|
|
8507
8227
|
}
|
|
8508
8228
|
if (!coll) {
|
|
8509
|
-
|
|
8510
|
-
this.refRegistry.register(collectionName, options.refs);
|
|
8511
|
-
}
|
|
8512
|
-
if (effectiveViaFields.i18nFields) {
|
|
8513
|
-
this.i18nFieldRegistry.set(collectionName, effectiveViaFields.i18nFields);
|
|
8514
|
-
}
|
|
8515
|
-
if (options?.blobFields) {
|
|
8516
|
-
this.blobFieldsRegistry.set(collectionName, options.blobFields);
|
|
8517
|
-
}
|
|
8518
|
-
if (options?.archive) {
|
|
8519
|
-
this.archiveRegistry.set(collectionName, options.archive);
|
|
8520
|
-
}
|
|
8521
|
-
if (options?.attestation !== void 0) {
|
|
8522
|
-
this.attestation.register(collectionName, options.attestation);
|
|
8523
|
-
}
|
|
8524
|
-
if (effectiveViaFields.dictKeyFields || effectiveViaFields.lookupFields) {
|
|
8525
|
-
const dictFieldMap = {};
|
|
8526
|
-
const staticFieldMap = {};
|
|
8527
|
-
for (const [field, desc] of Object.entries(effectiveViaFields.dictKeyFields ?? {})) {
|
|
8528
|
-
if (isStaticDictDescriptor(desc)) {
|
|
8529
|
-
staticFieldMap[field] = desc;
|
|
8530
|
-
this.staticDictNames.add(desc.name);
|
|
8531
|
-
this.staticByName.set(desc.name, desc);
|
|
8532
|
-
} else {
|
|
8533
|
-
dictFieldMap[field] = desc.name;
|
|
8534
|
-
}
|
|
8535
|
-
}
|
|
8536
|
-
const lookupCompat = collectLookupDictCompat(effectiveViaFields.lookupFields);
|
|
8537
|
-
Object.assign(dictFieldMap, lookupCompat.dictFieldMap);
|
|
8538
|
-
for (const [field, desc] of lookupCompat.staticEntries) {
|
|
8539
|
-
staticFieldMap[field] = desc;
|
|
8540
|
-
this.staticDictNames.add(desc.name);
|
|
8541
|
-
this.staticByName.set(desc.name, desc);
|
|
8542
|
-
}
|
|
8543
|
-
if (Object.keys(dictFieldMap).length > 0) {
|
|
8544
|
-
this.dictKeyFieldRegistry.set(collectionName, dictFieldMap);
|
|
8545
|
-
for (const dictName of new Set(Object.values(dictFieldMap))) {
|
|
8546
|
-
this.reservedLookupCollections.set(dictCollectionName(dictName), dictName);
|
|
8547
|
-
}
|
|
8548
|
-
}
|
|
8549
|
-
if (Object.keys(staticFieldMap).length > 0) {
|
|
8550
|
-
this.staticDescriptorByField.set(collectionName, staticFieldMap);
|
|
8551
|
-
}
|
|
8552
|
-
}
|
|
8553
|
-
if ((options?.schemaUpdate?.length ?? 0) > 0) {
|
|
8554
|
-
this.#schemaUpdateNames.set(collectionName, (options.schemaUpdate ?? []).map((s) => s.name));
|
|
8555
|
-
}
|
|
8229
|
+
populateCollectionRegistries(this.#registries(), collectionName, options, effectiveViaFields);
|
|
8556
8230
|
let schemaUpdateGate;
|
|
8557
8231
|
if (options?.persistJsonSchema === true && options.schema !== void 0 && (options.schemaUpdate?.length ?? 0) > 0) {
|
|
8558
8232
|
const validator = options.schema;
|
|
8559
8233
|
const strategies = options.schemaUpdate ?? [];
|
|
8560
8234
|
const work = (async () => {
|
|
8561
8235
|
const dek = await this.getDEK(collectionName);
|
|
8562
|
-
const { persistSchemaIfNeeded } = await import("./register-
|
|
8236
|
+
const { persistSchemaIfNeeded } = await import("./register-CEX7R7NE.js");
|
|
8563
8237
|
const result = await persistSchemaIfNeeded({
|
|
8564
8238
|
store: this.adapter,
|
|
8565
8239
|
vault: this.name,
|
|
@@ -8640,26 +8314,7 @@ var Vault = class {
|
|
|
8640
8314
|
}
|
|
8641
8315
|
} : {}
|
|
8642
8316
|
};
|
|
8643
|
-
|
|
8644
|
-
if (options?.reconcileOnOpen !== void 0) collOpts.reconcileOnOpen = options.reconcileOnOpen;
|
|
8645
|
-
if (options?.prefetch !== void 0) collOpts.prefetch = options.prefetch;
|
|
8646
|
-
if (options?.cache !== void 0) collOpts.cache = options.cache;
|
|
8647
|
-
if (options?.schema !== void 0) collOpts.schema = options.schema;
|
|
8648
|
-
if (options?.conflictPolicy !== void 0) collOpts.conflictPolicy = options.conflictPolicy;
|
|
8649
|
-
if (options?.crdt !== void 0) collOpts.crdt = options.crdt;
|
|
8650
|
-
if (options?.deterministicFields !== void 0) {
|
|
8651
|
-
collOpts.deterministicFields = options.deterministicFields;
|
|
8652
|
-
}
|
|
8653
|
-
if (options?.acknowledgeDeterministicRisk !== void 0) {
|
|
8654
|
-
collOpts.acknowledgeDeterministicRisk = options.acknowledgeDeterministicRisk;
|
|
8655
|
-
}
|
|
8656
|
-
if (options?.acknowledgeEquatableRisk !== void 0) {
|
|
8657
|
-
collOpts.acknowledgeEquatableRisk = options.acknowledgeEquatableRisk;
|
|
8658
|
-
}
|
|
8659
|
-
if (options?.sensitive !== void 0) {
|
|
8660
|
-
collOpts.sensitive = options.sensitive;
|
|
8661
|
-
}
|
|
8662
|
-
if (options?.perRecordKeys !== void 0) collOpts.perRecordKeys = options.perRecordKeys;
|
|
8317
|
+
copyDefined(collOpts, options, COLLECTION_PASSTHROUGH_KEYS);
|
|
8663
8318
|
const subjectKey = this.strategies.forget.subjects[collectionName];
|
|
8664
8319
|
if (subjectKey !== void 0) {
|
|
8665
8320
|
if (options?.perRecordKeys === false) {
|
|
@@ -8674,22 +8329,8 @@ var Vault = class {
|
|
|
8674
8329
|
if (value !== void 0 && value !== null) await this._addSubjectRef(coerceSubjectId(value), { collection: collectionName, id });
|
|
8675
8330
|
};
|
|
8676
8331
|
}
|
|
8677
|
-
if (options?.provenance !== void 0) collOpts.provenance = options.provenance;
|
|
8678
|
-
if (options?.ramCiphertext !== void 0) collOpts.ramCiphertext = options.ramCiphertext;
|
|
8679
|
-
if (options?.tiers !== void 0) collOpts.tiers = options.tiers;
|
|
8680
|
-
if (options?.tierMode !== void 0) collOpts.tierMode = options.tierMode;
|
|
8681
|
-
if (options?.blobTierPolicy !== void 0) collOpts.blobTierPolicy = options.blobTierPolicy;
|
|
8682
8332
|
collOpts.onCrossTierAccess = (event) => this.emitCrossTier(event);
|
|
8683
8333
|
if (this.syncAdapter !== void 0) collOpts.syncAdapter = this.syncAdapter;
|
|
8684
|
-
if (options?.i18nFields !== void 0) collOpts.i18nFields = options.i18nFields;
|
|
8685
|
-
if (options?.embeddings !== void 0) collOpts.embeddings = options.embeddings;
|
|
8686
|
-
if (options?.textIndexes !== void 0) collOpts.textIndexes = options.textIndexes;
|
|
8687
|
-
if (options?.warmIndexOnOpen !== void 0) collOpts.warmIndexOnOpen = options.warmIndexOnOpen;
|
|
8688
|
-
if (options?.textIndexPersist !== void 0) collOpts.textIndexPersist = options.textIndexPersist;
|
|
8689
|
-
if (options?.moneyFields !== void 0) collOpts.moneyFields = options.moneyFields;
|
|
8690
|
-
if (options?.viaFields !== void 0) collOpts.viaFields = options.viaFields;
|
|
8691
|
-
if (options?.computed !== void 0) collOpts.computed = options.computed;
|
|
8692
|
-
if (options?.classifiedFields !== void 0) collOpts.classifiedFields = options.classifiedFields;
|
|
8693
8334
|
if (effectiveViaFields.dictKeyFields !== void 0 || effectiveViaFields.lookupFields !== void 0) {
|
|
8694
8335
|
collOpts.dictLabelResolver = async (dictName, key, locale, fallback) => {
|
|
8695
8336
|
const stat = this.staticByName.get(dictName);
|
|
@@ -8723,10 +8364,6 @@ var Vault = class {
|
|
|
8723
8364
|
if (effectiveViaFields.i18nFields !== void 0 && this.translateText) {
|
|
8724
8365
|
collOpts.autoTranslateHook = this.translateText;
|
|
8725
8366
|
}
|
|
8726
|
-
if (options?.fieldMeta !== void 0) {
|
|
8727
|
-
collOpts.fieldMeta = options.fieldMeta;
|
|
8728
|
-
}
|
|
8729
|
-
if (options?.meta !== void 0) collOpts.meta = options.meta;
|
|
8730
8367
|
if (options?.refs !== void 0) {
|
|
8731
8368
|
collOpts.declaredRefs = this.refRegistry.getOutbound(collectionName);
|
|
8732
8369
|
}
|
|
@@ -8745,7 +8382,7 @@ var Vault = class {
|
|
|
8745
8382
|
const work = (async () => {
|
|
8746
8383
|
try {
|
|
8747
8384
|
const dek = await this.getDEK(collectionName);
|
|
8748
|
-
await (await import("./register-
|
|
8385
|
+
await (await import("./register-CEX7R7NE.js")).persistSchemaIfNeeded({
|
|
8749
8386
|
store: this.adapter,
|
|
8750
8387
|
vault: this.name,
|
|
8751
8388
|
collectionName,
|
|
@@ -9243,7 +8880,7 @@ var Vault = class {
|
|
|
9243
8880
|
* is re-keyed for distinct recipients.
|
|
9244
8881
|
*
|
|
9245
8882
|
* Each recipient becomes its own `KeyringFile` sealed with that
|
|
9246
|
-
* recipient's
|
|
8883
|
+
* recipient's secret. The DEKs wrapped into each slot are
|
|
9247
8884
|
* exactly those the recipient's role + permissions justify, and
|
|
9248
8885
|
* never wider than the source keyring's own DEK set
|
|
9249
8886
|
* (privilege-escalation check).
|
|
@@ -9932,7 +9569,7 @@ var Vault = class {
|
|
|
9932
9569
|
async _initDerivations(handles) {
|
|
9933
9570
|
if (handles.length === 0) return;
|
|
9934
9571
|
const [{ DerivationRegistry }, { ReadOnlyVaultFacade }] = await Promise.all([
|
|
9935
|
-
import("./registry-
|
|
9572
|
+
import("./registry-EWIB5NTI.js"),
|
|
9936
9573
|
import("./read-only-facade-CHCKSEPD.js")
|
|
9937
9574
|
]);
|
|
9938
9575
|
const registry = new DerivationRegistry();
|
|
@@ -9964,7 +9601,7 @@ var Vault = class {
|
|
|
9964
9601
|
*/
|
|
9965
9602
|
async _initMaterializedViews(handles) {
|
|
9966
9603
|
if (handles.length === 0) return;
|
|
9967
|
-
const { MaterializedViewRegistry } = await import("./registry-
|
|
9604
|
+
const { MaterializedViewRegistry } = await import("./registry-DIKMRXUC.js");
|
|
9968
9605
|
const registry = new MaterializedViewRegistry();
|
|
9969
9606
|
this.materializedViewRegistry = registry;
|
|
9970
9607
|
const db = this;
|
|
@@ -9989,7 +9626,7 @@ var Vault = class {
|
|
|
9989
9626
|
*/
|
|
9990
9627
|
async _initOverlayedViews(handles) {
|
|
9991
9628
|
if (handles.length === 0) return;
|
|
9992
|
-
const { OverlayedViewRegistry } = await import("./registry-
|
|
9629
|
+
const { OverlayedViewRegistry } = await import("./registry-7CZWF3EQ.js");
|
|
9993
9630
|
const registry = new OverlayedViewRegistry();
|
|
9994
9631
|
const mvRegistry = this.materializedViewRegistry;
|
|
9995
9632
|
const overlayNames = /* @__PURE__ */ new Set();
|
|
@@ -10036,14 +9673,14 @@ var Vault = class {
|
|
|
10036
9673
|
if (!reg) {
|
|
10037
9674
|
throw new Error(`refreshView: no MV registered with name "${name}"`);
|
|
10038
9675
|
}
|
|
10039
|
-
const { MaterializedViewExecutor } = await import("./executor-
|
|
9676
|
+
const { MaterializedViewExecutor } = await import("./executor-SVHAJZ4A.js");
|
|
10040
9677
|
const result = await MaterializedViewExecutor.refresh(reg, {
|
|
10041
9678
|
getCollection: (n) => this.collection(n),
|
|
10042
9679
|
getActiveTxContext: () => this.noydb._activeTxContextOrNull,
|
|
10043
9680
|
getQueryContext: () => this,
|
|
10044
9681
|
dispatchCtx: this._dispatchCtx({ collection: name, id: "refreshView" })
|
|
10045
9682
|
});
|
|
10046
|
-
const { clearMVStaleFully } = await import("./stale-
|
|
9683
|
+
const { clearMVStaleFully } = await import("./stale-BJO2WIN7.js");
|
|
10047
9684
|
await clearMVStaleFully(this.adapter, this.name, registry, name);
|
|
10048
9685
|
return result;
|
|
10049
9686
|
}
|
|
@@ -10056,7 +9693,7 @@ var Vault = class {
|
|
|
10056
9693
|
if (registry === null) return { derived: 0, failed: 0, skippedFrozen: 0 };
|
|
10057
9694
|
const strategies = registry.strategiesForSource(sourceCollection);
|
|
10058
9695
|
if (strategies.length === 0) return { derived: 0, failed: 0, skippedFrozen: 0 };
|
|
10059
|
-
const { DerivationExecutor } = await import("./executor-
|
|
9696
|
+
const { DerivationExecutor } = await import("./executor-FCJEH3FU.js");
|
|
10060
9697
|
const sourceColl = this.collection(sourceCollection);
|
|
10061
9698
|
const records = await sourceColl.list();
|
|
10062
9699
|
const ctx = { vault: this.derivationFacade ?? new (await import("./read-only-facade-CHCKSEPD.js")).ReadOnlyVaultFacade(this, "derivation") };
|
|
@@ -10083,7 +9720,7 @@ var Vault = class {
|
|
|
10083
9720
|
if (!outSpec) continue;
|
|
10084
9721
|
const outputColl = this.collection(outSpec.collection);
|
|
10085
9722
|
if (out.kind === "array") {
|
|
10086
|
-
const { loadFanoutSidecar, saveFanoutSidecar } = await import("./fanout-sidecar-
|
|
9723
|
+
const { loadFanoutSidecar, saveFanoutSidecar } = await import("./fanout-sidecar-HRMHC34B.js");
|
|
10087
9724
|
const prior = await loadFanoutSidecar(this.adapter, this.name, spec.source, id, key, this.getDEK, this.encrypted);
|
|
10088
9725
|
const prevKeys = new Set(prior?.keys ?? []);
|
|
10089
9726
|
const newKeysList = out.entries.map((e) => e.key);
|
|
@@ -10238,11 +9875,11 @@ var Vault = class {
|
|
|
10238
9875
|
*
|
|
10239
9876
|
*.
|
|
10240
9877
|
*/
|
|
10241
|
-
async withConsent(ctx,
|
|
9878
|
+
async withConsent(ctx, fn) {
|
|
10242
9879
|
const prior = this.consentContext;
|
|
10243
9880
|
this.consentContext = ctx;
|
|
10244
9881
|
try {
|
|
10245
|
-
return await
|
|
9882
|
+
return await fn();
|
|
10246
9883
|
} finally {
|
|
10247
9884
|
this.consentContext = prior;
|
|
10248
9885
|
}
|
|
@@ -10310,10 +9947,10 @@ var Vault = class {
|
|
|
10310
9947
|
* collection.
|
|
10311
9948
|
*/
|
|
10312
9949
|
async delegate(opts) {
|
|
10313
|
-
const { issueDelegation, DELEGATIONS_COLLECTION } = await import("./delegation-
|
|
9950
|
+
const { issueDelegation, DELEGATIONS_COLLECTION } = await import("./delegation-EV7LKJPH.js");
|
|
10314
9951
|
if (!this.keyring.kek) {
|
|
10315
9952
|
throw new ValidationError(
|
|
10316
|
-
"issueDelegation: keyring.kek is null \u2014 issuing a delegation requires a tier-1 unlock. Re-authenticate at tier 1 (
|
|
9953
|
+
"issueDelegation: keyring.kek is null \u2014 issuing a delegation requires a tier-1 unlock. Re-authenticate at tier 1 (secret) first."
|
|
10317
9954
|
);
|
|
10318
9955
|
}
|
|
10319
9956
|
const targetKek = this.keyring.kek;
|
|
@@ -10332,7 +9969,7 @@ var Vault = class {
|
|
|
10332
9969
|
* if the id does not exist.
|
|
10333
9970
|
*/
|
|
10334
9971
|
async revokeDelegation(id) {
|
|
10335
|
-
const { revokeDelegation, DELEGATIONS_COLLECTION } = await import("./delegation-
|
|
9972
|
+
const { revokeDelegation, DELEGATIONS_COLLECTION } = await import("./delegation-EV7LKJPH.js");
|
|
10336
9973
|
await revokeDelegation(this.adapter, this.name, id);
|
|
10337
9974
|
void DELEGATIONS_COLLECTION;
|
|
10338
9975
|
}
|
|
@@ -10580,7 +10217,7 @@ var Vault = class {
|
|
|
10580
10217
|
* @see docs/superpowers/specs/2026-05-22-schema-dump-design.md
|
|
10581
10218
|
*/
|
|
10582
10219
|
async dumpSchema(opts = {}) {
|
|
10583
|
-
const { dumpVaultSchema } = await import("./walk-
|
|
10220
|
+
const { dumpVaultSchema } = await import("./walk-JXMWKKQW.js");
|
|
10584
10221
|
return dumpVaultSchema(this, opts);
|
|
10585
10222
|
}
|
|
10586
10223
|
/**
|
|
@@ -10715,7 +10352,7 @@ var Vault = class {
|
|
|
10715
10352
|
* @see https://github.com/vLannaAi/noy-db-docs/blob/main/content/docs/services/public-envelope.md
|
|
10716
10353
|
*/
|
|
10717
10354
|
async getCover(opts = {}) {
|
|
10718
|
-
const { readCover } = await import("./cover-
|
|
10355
|
+
const { readCover } = await import("./cover-ADBCTIKN.js");
|
|
10719
10356
|
return readCover(this.adapter, this.name, opts);
|
|
10720
10357
|
}
|
|
10721
10358
|
/**
|
|
@@ -10730,7 +10367,7 @@ var Vault = class {
|
|
|
10730
10367
|
* both modes round-trip cleanly.
|
|
10731
10368
|
*/
|
|
10732
10369
|
async dump() {
|
|
10733
|
-
const { dumpVault } = await import("./backup-
|
|
10370
|
+
const { dumpVault } = await import("./backup-USYSNCYM.js");
|
|
10734
10371
|
return dumpVault(this.backupContext());
|
|
10735
10372
|
}
|
|
10736
10373
|
/**
|
|
@@ -10782,7 +10419,7 @@ var Vault = class {
|
|
|
10782
10419
|
* — there's no chain to verify against.
|
|
10783
10420
|
*/
|
|
10784
10421
|
async load(backupJson) {
|
|
10785
|
-
const { loadVault } = await import("./backup-
|
|
10422
|
+
const { loadVault } = await import("./backup-USYSNCYM.js");
|
|
10786
10423
|
return loadVault(this.backupContext(), backupJson);
|
|
10787
10424
|
}
|
|
10788
10425
|
/**
|
|
@@ -10814,7 +10451,7 @@ var Vault = class {
|
|
|
10814
10451
|
* way to detect tampering of an in-place vault.
|
|
10815
10452
|
*/
|
|
10816
10453
|
async verifyBackupIntegrity() {
|
|
10817
|
-
const { verifyBackupIntegrity } = await import("./backup-
|
|
10454
|
+
const { verifyBackupIntegrity } = await import("./backup-USYSNCYM.js");
|
|
10818
10455
|
return verifyBackupIntegrity(this.backupContext());
|
|
10819
10456
|
}
|
|
10820
10457
|
/**
|
|
@@ -11032,7 +10669,7 @@ var Vault = class {
|
|
|
11032
10669
|
* is the live validator object, not a serialization of it).
|
|
11033
10670
|
*/
|
|
11034
10671
|
async exportJSON(opts = {}) {
|
|
11035
|
-
const { exportVaultJSON } = await import("./backup-
|
|
10672
|
+
const { exportVaultJSON } = await import("./backup-USYSNCYM.js");
|
|
11036
10673
|
return exportVaultJSON(this.backupContext(), opts);
|
|
11037
10674
|
}
|
|
11038
10675
|
};
|
|
@@ -11109,10 +10746,10 @@ var WriteQueueTracker = class {
|
|
|
11109
10746
|
* (success or failure). The fn's resolved value is returned; a thrown
|
|
11110
10747
|
* error is re-thrown after the queue is decremented.
|
|
11111
10748
|
*/
|
|
11112
|
-
async track(
|
|
10749
|
+
async track(fn) {
|
|
11113
10750
|
this.begin();
|
|
11114
10751
|
try {
|
|
11115
|
-
const value = await
|
|
10752
|
+
const value = await fn();
|
|
11116
10753
|
this.settle();
|
|
11117
10754
|
return value;
|
|
11118
10755
|
} catch (error) {
|
|
@@ -11135,6 +10772,183 @@ var WriteQueueTracker = class {
|
|
|
11135
10772
|
}
|
|
11136
10773
|
};
|
|
11137
10774
|
|
|
10775
|
+
// src/port/with/write-hooks.ts
|
|
10776
|
+
var WriteHookRegistry = class {
|
|
10777
|
+
#before = [];
|
|
10778
|
+
#after = [];
|
|
10779
|
+
#suppressed = false;
|
|
10780
|
+
/** True while handlers are running — used by the write path to skip nested firing. */
|
|
10781
|
+
get suppressed() {
|
|
10782
|
+
return this.#suppressed;
|
|
10783
|
+
}
|
|
10784
|
+
/** True when any hook is registered (cheap gate for the write path). */
|
|
10785
|
+
get hasHandlers() {
|
|
10786
|
+
return this.#before.length > 0 || this.#after.length > 0;
|
|
10787
|
+
}
|
|
10788
|
+
onBeforeWrite(handler) {
|
|
10789
|
+
this.#before.push(handler);
|
|
10790
|
+
return () => {
|
|
10791
|
+
const i = this.#before.indexOf(handler);
|
|
10792
|
+
if (i >= 0) this.#before.splice(i, 1);
|
|
10793
|
+
};
|
|
10794
|
+
}
|
|
10795
|
+
onAfterWrite(handler) {
|
|
10796
|
+
this.#after.push(handler);
|
|
10797
|
+
return () => {
|
|
10798
|
+
const i = this.#after.indexOf(handler);
|
|
10799
|
+
if (i >= 0) this.#after.splice(i, 1);
|
|
10800
|
+
};
|
|
10801
|
+
}
|
|
10802
|
+
/** Run before-hooks (awaited, in order). A throw propagates and aborts the write. */
|
|
10803
|
+
async runBefore(event) {
|
|
10804
|
+
if (this.#before.length === 0) return;
|
|
10805
|
+
this.#suppressed = true;
|
|
10806
|
+
try {
|
|
10807
|
+
for (const h of this.#before.slice()) await h(event);
|
|
10808
|
+
} finally {
|
|
10809
|
+
this.#suppressed = false;
|
|
10810
|
+
}
|
|
10811
|
+
}
|
|
10812
|
+
/** Run after-hooks (awaited, in order). Per-handler errors are warned, not thrown. */
|
|
10813
|
+
async runAfter(event) {
|
|
10814
|
+
if (this.#after.length === 0) return;
|
|
10815
|
+
this.#suppressed = true;
|
|
10816
|
+
try {
|
|
10817
|
+
for (const h of this.#after.slice()) {
|
|
10818
|
+
try {
|
|
10819
|
+
await h(event);
|
|
10820
|
+
} catch (err) {
|
|
10821
|
+
console.warn(
|
|
10822
|
+
`[noy-db] onAfterWrite handler failed for ${event.collection}/${event.docId}: ` + (err instanceof Error ? err.message : String(err))
|
|
10823
|
+
);
|
|
10824
|
+
}
|
|
10825
|
+
}
|
|
10826
|
+
} finally {
|
|
10827
|
+
this.#suppressed = false;
|
|
10828
|
+
}
|
|
10829
|
+
}
|
|
10830
|
+
};
|
|
10831
|
+
|
|
10832
|
+
// src/port/with/service-bus.ts
|
|
10833
|
+
var ServiceBus = class {
|
|
10834
|
+
#handlers = /* @__PURE__ */ new Map();
|
|
10835
|
+
#gateHandlers = /* @__PURE__ */ new Map();
|
|
10836
|
+
#depth = 0;
|
|
10837
|
+
/** Register a handler for an observe point. Returns an unsubscribe fn. */
|
|
10838
|
+
register(point, handler) {
|
|
10839
|
+
let arr = this.#handlers.get(point);
|
|
10840
|
+
if (!arr) {
|
|
10841
|
+
arr = [];
|
|
10842
|
+
this.#handlers.set(point, arr);
|
|
10843
|
+
}
|
|
10844
|
+
arr.push(handler);
|
|
10845
|
+
return () => {
|
|
10846
|
+
const a = this.#handlers.get(point);
|
|
10847
|
+
if (!a) return;
|
|
10848
|
+
const i = a.indexOf(handler);
|
|
10849
|
+
if (i >= 0) a.splice(i, 1);
|
|
10850
|
+
};
|
|
10851
|
+
}
|
|
10852
|
+
/** Cheap gate for the write path — true when any handler is registered for the point. */
|
|
10853
|
+
hasHandlers(point) {
|
|
10854
|
+
const a = this.#handlers.get(point);
|
|
10855
|
+
return a !== void 0 && a.length > 0;
|
|
10856
|
+
}
|
|
10857
|
+
/**
|
|
10858
|
+
* True while one or more dispatches are in flight. Backed by a depth counter
|
|
10859
|
+
* so that two concurrent async dispatches (`Promise.all([put('a'), put('b')])`
|
|
10860
|
+
* each captured `busAfterPut=true` at their respective put() tops while depth
|
|
10861
|
+
* was 0) both proceed independently — the counter stays > 0 until BOTH finish,
|
|
10862
|
+
* so any nested write attempted by a handler still sees `dispatching === true`
|
|
10863
|
+
* and is suppressed by the write-path gate in `collection.ts`
|
|
10864
|
+
* (`busAfterPut = hasHandlers('afterPut') && !dispatching`). Re-entrancy
|
|
10865
|
+
* suppression lives exclusively on that write-path gate; concurrent independent
|
|
10866
|
+
* dispatches must not drop each other's events.
|
|
10867
|
+
*/
|
|
10868
|
+
get dispatching() {
|
|
10869
|
+
return this.#depth > 0;
|
|
10870
|
+
}
|
|
10871
|
+
/**
|
|
10872
|
+
* Dispatch in registration order, awaited. Per-handler errors are warned, not
|
|
10873
|
+
* thrown — an observe handler must never abort a completed write. A
|
|
10874
|
+
* re-entrancy guard suppresses nested firing so a handler that itself writes
|
|
10875
|
+
* cannot loop (same rationale as WriteHookRegistry.#suppressed).
|
|
10876
|
+
*/
|
|
10877
|
+
async dispatch(point, event) {
|
|
10878
|
+
const a = this.#handlers.get(point);
|
|
10879
|
+
if (!a || a.length === 0) return;
|
|
10880
|
+
this.#depth++;
|
|
10881
|
+
try {
|
|
10882
|
+
for (const h of a.slice()) {
|
|
10883
|
+
try {
|
|
10884
|
+
await h(event);
|
|
10885
|
+
} catch (err) {
|
|
10886
|
+
console.warn(
|
|
10887
|
+
`[noy-db] service observe handler failed at ${point}: ` + (err instanceof Error ? err.message : String(err))
|
|
10888
|
+
);
|
|
10889
|
+
}
|
|
10890
|
+
}
|
|
10891
|
+
} finally {
|
|
10892
|
+
this.#depth--;
|
|
10893
|
+
}
|
|
10894
|
+
}
|
|
10895
|
+
/**
|
|
10896
|
+
* Register a write-gating handler. A throw from the handler ABORTS the
|
|
10897
|
+
* write. Returns an unsubscribe fn. See {@link GateRegisterOptions} for
|
|
10898
|
+
* the `needsPrior` prior-read declaration (#267).
|
|
10899
|
+
*/
|
|
10900
|
+
registerGate(point, handler, opts) {
|
|
10901
|
+
let arr = this.#gateHandlers.get(point);
|
|
10902
|
+
if (!arr) {
|
|
10903
|
+
arr = [];
|
|
10904
|
+
this.#gateHandlers.set(point, arr);
|
|
10905
|
+
}
|
|
10906
|
+
const entry = { fn: handler, needsPrior: opts?.needsPrior !== false };
|
|
10907
|
+
arr.push(entry);
|
|
10908
|
+
return () => {
|
|
10909
|
+
const a = this.#gateHandlers.get(point);
|
|
10910
|
+
if (!a) return;
|
|
10911
|
+
const i = a.indexOf(entry);
|
|
10912
|
+
if (i >= 0) a.splice(i, 1);
|
|
10913
|
+
};
|
|
10914
|
+
}
|
|
10915
|
+
/** Cheap gate for the write path — true when any gate handler is registered for the point. */
|
|
10916
|
+
hasGateHandlers(point) {
|
|
10917
|
+
const a = this.#gateHandlers.get(point);
|
|
10918
|
+
return a !== void 0 && a.length > 0;
|
|
10919
|
+
}
|
|
10920
|
+
/**
|
|
10921
|
+
* True when at least one gate handler at `point` needs the prior record
|
|
10922
|
+
* (the default). False when the point has no handlers or every handler
|
|
10923
|
+
* registered with `needsPrior: false` — the write path then skips the
|
|
10924
|
+
* prior-read before dispatching (#267 prior-read elision).
|
|
10925
|
+
*/
|
|
10926
|
+
gateNeedsPrior(point) {
|
|
10927
|
+
const a = this.#gateHandlers.get(point);
|
|
10928
|
+
if (!a) return false;
|
|
10929
|
+
return a.some((e) => e.needsPrior);
|
|
10930
|
+
}
|
|
10931
|
+
/**
|
|
10932
|
+
* Run gate handlers in registration order, awaited. Unlike `dispatch`
|
|
10933
|
+
* (observe), a handler throw is NOT swallowed — it PROPAGATES, aborting the
|
|
10934
|
+
* write before it reaches the store. The first throw stops the remaining
|
|
10935
|
+
* handlers (fail-fast). This is the seam guards/periods migrate onto.
|
|
10936
|
+
*
|
|
10937
|
+
* Note: gate handlers are validators that read, not write. A gate handler
|
|
10938
|
+
* that writes back into the same collection would re-enter the write path
|
|
10939
|
+
* and re-dispatch this point; loop-suppression for that case is deferred to
|
|
10940
|
+
* the migration slice (contract: gate handlers must not perform writes that
|
|
10941
|
+
* re-trigger their own point).
|
|
10942
|
+
*/
|
|
10943
|
+
async dispatchGate(point, event) {
|
|
10944
|
+
const a = this.#gateHandlers.get(point);
|
|
10945
|
+
if (!a || a.length === 0) return;
|
|
10946
|
+
for (const e of a.slice()) {
|
|
10947
|
+
await e.fn(event);
|
|
10948
|
+
}
|
|
10949
|
+
}
|
|
10950
|
+
};
|
|
10951
|
+
|
|
11138
10952
|
// src/with-party/tab-coordination.ts
|
|
11139
10953
|
var TabCoordinator = class {
|
|
11140
10954
|
tabId;
|
|
@@ -11197,13 +11011,13 @@ var TabCoordinator = class {
|
|
|
11197
11011
|
const out = [self, ...[...this.#peers.values()].filter((p) => p.lastSeen >= cutoff)];
|
|
11198
11012
|
return out.sort((a, b) => a.tabId.localeCompare(b.tabId));
|
|
11199
11013
|
}
|
|
11200
|
-
onTabRoleChange(
|
|
11201
|
-
this.#roleHandlers.add(
|
|
11202
|
-
return () => this.#roleHandlers.delete(
|
|
11014
|
+
onTabRoleChange(fn) {
|
|
11015
|
+
this.#roleHandlers.add(fn);
|
|
11016
|
+
return () => this.#roleHandlers.delete(fn);
|
|
11203
11017
|
}
|
|
11204
|
-
onActiveTabsChange(
|
|
11205
|
-
this.#tabsHandlers.add(
|
|
11206
|
-
return () => this.#tabsHandlers.delete(
|
|
11018
|
+
onActiveTabsChange(fn) {
|
|
11019
|
+
this.#tabsHandlers.add(fn);
|
|
11020
|
+
return () => this.#tabsHandlers.delete(fn);
|
|
11207
11021
|
}
|
|
11208
11022
|
dispose() {
|
|
11209
11023
|
if (this.#disposed) return;
|
|
@@ -11720,8 +11534,8 @@ async function describeAuthConfig(store, vault) {
|
|
|
11720
11534
|
const lines = [];
|
|
11721
11535
|
lines.push(`Vault "${vault}" \u2014 three-tier authentication`);
|
|
11722
11536
|
lines.push("");
|
|
11723
|
-
lines.push("Tier 1 \u2014
|
|
11724
|
-
lines.push(` Phrase format: ${policy.
|
|
11537
|
+
lines.push("Tier 1 \u2014 Secret (master)");
|
|
11538
|
+
lines.push(` Phrase format: ${policy.secret?.minWords ?? 6}+ words, lowercase letters, \u2265${policy.secret?.minWordLength ?? 3} chars/word`);
|
|
11725
11539
|
lines.push(" Strength validator: enforced (override available for tests only)");
|
|
11726
11540
|
lines.push("");
|
|
11727
11541
|
lines.push("Tier 2 \u2014 Authenticate (routine login)");
|
|
@@ -11732,7 +11546,7 @@ async function describeAuthConfig(store, vault) {
|
|
|
11732
11546
|
lines.push(" Method: PIN (per-app configurable)");
|
|
11733
11547
|
lines.push("");
|
|
11734
11548
|
lines.push(`Recovery profiles enrolled: ${recoveryProfiles.length === 0 ? "none" : recoveryProfiles.join(", ")}`);
|
|
11735
|
-
lines.push("Managed-
|
|
11549
|
+
lines.push("Managed-secret mode: off (post-1.0)");
|
|
11736
11550
|
lines.push("");
|
|
11737
11551
|
lines.push("Sensitive-action gates:");
|
|
11738
11552
|
for (const [gate, gp] of Object.entries(policy.gates)) {
|
|
@@ -11745,7 +11559,7 @@ async function diagramAuthConfig(store, vault) {
|
|
|
11745
11559
|
const lines = [];
|
|
11746
11560
|
lines.push("flowchart TB");
|
|
11747
11561
|
lines.push(` vault["Vault: ${escapeMermaid(vault)}"]`);
|
|
11748
|
-
lines.push(' tier1["Tier 1<br/>
|
|
11562
|
+
lines.push(' tier1["Tier 1<br/>Secret"]');
|
|
11749
11563
|
lines.push(' tier2["Tier 2<br/>Multi-slot Authenticate"]');
|
|
11750
11564
|
lines.push(' tier3["Tier 3<br/>PIN / Quick-resume"]');
|
|
11751
11565
|
lines.push(" vault --> tier1");
|
|
@@ -11819,7 +11633,7 @@ function describeGatePolicy(gp) {
|
|
|
11819
11633
|
}
|
|
11820
11634
|
function defaultPolicySnapshot() {
|
|
11821
11635
|
return {
|
|
11822
|
-
|
|
11636
|
+
secret: { minWords: 6, minWordLength: 3, rejectRepeatedAdjacent: true },
|
|
11823
11637
|
gates: {}
|
|
11824
11638
|
};
|
|
11825
11639
|
}
|
|
@@ -11877,8 +11691,9 @@ var TeamFacade = class {
|
|
|
11877
11691
|
async runRotate(engine, vault, collections) {
|
|
11878
11692
|
this.deps.checkPolicyOperation(vault, "rotate");
|
|
11879
11693
|
const keyring = await this.deps.getKeyringInternal(vault);
|
|
11880
|
-
await engine(this.deps.options.store, vault, keyring, collections);
|
|
11694
|
+
const result = await engine(this.deps.options.store, vault, keyring, collections);
|
|
11881
11695
|
this.deps.keyringCache.set(vault, keyring);
|
|
11696
|
+
return result;
|
|
11882
11697
|
}
|
|
11883
11698
|
// ─── Tier-2 enroll / remove ─────────────────────────────────────
|
|
11884
11699
|
/**
|
|
@@ -11969,7 +11784,7 @@ var TeamFacade = class {
|
|
|
11969
11784
|
* ```ts
|
|
11970
11785
|
* import { enrollWebAuthn } from '@noy-db/on-webauthn'
|
|
11971
11786
|
*
|
|
11972
|
-
* await db.enrollWebAuthn('demo', async (keyring) => {
|
|
11787
|
+
* await db.team.enrollWebAuthn('demo', async (keyring) => {
|
|
11973
11788
|
* const e = await enrollWebAuthn(keyring, 'demo', { rp: {...} })
|
|
11974
11789
|
* return {
|
|
11975
11790
|
* id: `webauthn-${e.credentialId.slice(0, 8)}`,
|
|
@@ -11998,7 +11813,7 @@ var TeamFacade = class {
|
|
|
11998
11813
|
const slotOptions = await ceremony(keyring);
|
|
11999
11814
|
if (slotOptions.method !== "webauthn") {
|
|
12000
11815
|
throw new ValidationError(
|
|
12001
|
-
`enrollWebAuthn: ceremony returned method "${slotOptions.method}"; expected "webauthn". Use db.enrollAuthenticator() for non-webauthn methods.`
|
|
11816
|
+
`enrollWebAuthn: ceremony returned method "${slotOptions.method}"; expected "webauthn". Use db.team.enrollAuthenticator() for non-webauthn methods.`
|
|
12002
11817
|
);
|
|
12003
11818
|
}
|
|
12004
11819
|
const credentialId = slotOptions.meta.credentialId;
|
|
@@ -12076,44 +11891,44 @@ var TeamFacade = class {
|
|
|
12076
11891
|
}
|
|
12077
11892
|
// ─── Tier-1 change flows ────────────────────────────────────────
|
|
12078
11893
|
/**
|
|
12079
|
-
* Rotate the user's
|
|
12080
|
-
* new phrase against the configured `
|
|
12081
|
-
* `rotate-
|
|
11894
|
+
* Rotate the user's secret (user remembers old). Validates the
|
|
11895
|
+
* new phrase against the configured `secret` policy, runs the
|
|
11896
|
+
* `rotate-secret` gate, then re-derives + re-wraps every DEK.
|
|
12082
11897
|
*
|
|
12083
11898
|
* Tier-2 authenticator slots are dropped — each slot wraps the old
|
|
12084
11899
|
* KEK and would need its derivation key to be re-presented. Re-enrol
|
|
12085
11900
|
* via `db.enrollAuthenticator` after rotation.
|
|
12086
11901
|
*
|
|
12087
|
-
* @throws `
|
|
11902
|
+
* @throws `WeakSecretError` on a weak new phrase.
|
|
12088
11903
|
* @throws `PolicyDeniedError` when the gate denies (missing factor, …).
|
|
12089
|
-
* @throws `InvalidKeyError` when `
|
|
11904
|
+
* @throws `InvalidKeyError` when `oldSecret` is wrong.
|
|
12090
11905
|
*/
|
|
12091
|
-
async
|
|
12092
|
-
if (this.deps.options.
|
|
11906
|
+
async rotateSecret(vault, input, factors) {
|
|
11907
|
+
if (this.deps.options.secretMode === "managed") {
|
|
12093
11908
|
throw new PolicyDeniedError(
|
|
12094
|
-
"rotate-
|
|
11909
|
+
"rotate-secret",
|
|
12095
11910
|
"disabled",
|
|
12096
11911
|
{ minTier: 1, enabled: false },
|
|
12097
|
-
"Managed-
|
|
11912
|
+
"Managed-secret mode (#14): the secret is hub-generated and sealed under the SealingKeyProvider \u2014 there is no plaintext to rotate. Use the recovery flow (follow-up issue) to mint a fresh sealed secret."
|
|
12098
11913
|
);
|
|
12099
11914
|
}
|
|
12100
|
-
await this.deps.checkGate(vault, "rotate-
|
|
11915
|
+
await this.deps.checkGate(vault, "rotate-secret", factors);
|
|
12101
11916
|
const userId = this.deps.options.user;
|
|
12102
|
-
const next = await
|
|
11917
|
+
const next = await rotateSecret(this.deps.options.store, vault, userId, input);
|
|
12103
11918
|
this.deps.keyringCache.set(vault, next);
|
|
12104
11919
|
}
|
|
12105
11920
|
/**
|
|
12106
|
-
* Reset the
|
|
11921
|
+
* Reset the secret using a recovery proof (user forgot the old).
|
|
12107
11922
|
* Currently supports the `'paper'` profile end-to-end; the
|
|
12108
11923
|
* other profiles throw {@link RecoveryProfileNotImplementedError}.
|
|
12109
11924
|
*
|
|
12110
11925
|
* Burns the used recovery entry on success.
|
|
12111
11926
|
*/
|
|
12112
|
-
async
|
|
12113
|
-
await this.deps.checkGate(vault, "recover-
|
|
11927
|
+
async recoverSecret(vault, input, factors) {
|
|
11928
|
+
await this.deps.checkGate(vault, "recover-secret", factors);
|
|
12114
11929
|
const userId = this.deps.options.user;
|
|
12115
11930
|
const entriesBeforeRecovery = await loadPaperRecoveryEntries(this.deps.options.store, vault);
|
|
12116
|
-
const next = await
|
|
11931
|
+
const next = await recoverSecret(this.deps.options.shamirRecovery, this.deps.options.store, vault, userId, input);
|
|
12117
11932
|
this.deps.keyringCache.set(vault, next);
|
|
12118
11933
|
const rotateRemaining = input.rotateRemainingCodes ?? true;
|
|
12119
11934
|
const remainingAfterBurn = Math.max(0, entriesBeforeRecovery.length - 1);
|
|
@@ -12135,15 +11950,15 @@ var TeamFacade = class {
|
|
|
12135
11950
|
}
|
|
12136
11951
|
/**
|
|
12137
11952
|
* Deliberate paper-recovery-code regeneration. User knows their
|
|
12138
|
-
*
|
|
11953
|
+
* secret but wants a fresh sheet — they lost the printout or
|
|
12139
11954
|
* suspect compromise of the off-site copy.
|
|
12140
11955
|
*
|
|
12141
|
-
* Symmetric to {@link
|
|
11956
|
+
* Symmetric to {@link rotateSecret} for the recovery profile:
|
|
12142
11957
|
* gated, audit-trackable, ergonomic. Replaces (not appends) the
|
|
12143
11958
|
* paper sheet under `_meta/recovery-paper` in a single envelope `put`.
|
|
12144
11959
|
*
|
|
12145
11960
|
* Gated by the `rotate-recovery` policy gate:
|
|
12146
|
-
* - PERSONAL_POLICY: `{ minTier: 1 }` — knowing the
|
|
11961
|
+
* - PERSONAL_POLICY: `{ minTier: 1 }` — knowing the secret
|
|
12147
11962
|
* suffices, matching the lower-level flow's bar.
|
|
12148
11963
|
* - STRICT_POLICY: `{ minTier: 1, factors: [{ anyOf: ['totp',
|
|
12149
11964
|
* 'email-otp', 'webauthn-roaming'] }] }` — rotation is an
|
|
@@ -12163,13 +11978,13 @@ var TeamFacade = class {
|
|
|
12163
11978
|
*
|
|
12164
11979
|
* @example Default count + show-once UI
|
|
12165
11980
|
* ```ts
|
|
12166
|
-
* const { newCodes } = await db.rotateRecovery('acme', { profile: 'paper' })
|
|
11981
|
+
* const { newCodes } = await db.team.rotateRecovery('acme', { profile: 'paper' })
|
|
12167
11982
|
* showCodesToUser(newCodes)
|
|
12168
11983
|
* ```
|
|
12169
11984
|
*
|
|
12170
11985
|
* @example STRICT-policy site with TOTP factor proof
|
|
12171
11986
|
* ```ts
|
|
12172
|
-
* await db.rotateRecovery(
|
|
11987
|
+
* await db.team.rotateRecovery(
|
|
12173
11988
|
* 'acme',
|
|
12174
11989
|
* { profile: 'paper', count: 10 },
|
|
12175
11990
|
* { factors: [{ kind: 'totp', proof: '123456' }] },
|
|
@@ -12193,7 +12008,7 @@ var TeamFacade = class {
|
|
|
12193
12008
|
const existing = await loadPaperRecoveryEntries(this.deps.options.store, vault);
|
|
12194
12009
|
if (existing.length === 0) {
|
|
12195
12010
|
throw new Error(
|
|
12196
|
-
`db.rotateRecovery: no recovery codes are enrolled for vault "${vault}". Call db.enrollRecovery({ profile: 'paper', entries }) first; rotateRecovery replaces an existing sheet rather than minting one from scratch.`
|
|
12011
|
+
`db.rotateRecovery: no recovery codes are enrolled for vault "${vault}". Call db.team.enrollRecovery({ profile: 'paper', entries }) first; rotateRecovery replaces an existing sheet rather than minting one from scratch.`
|
|
12197
12012
|
);
|
|
12198
12013
|
}
|
|
12199
12014
|
const keyring = await this.getKeyring(vault);
|
|
@@ -12215,7 +12030,7 @@ var TeamFacade = class {
|
|
|
12215
12030
|
const existing = await loadShamirRecoveryEntries(this.deps.options.store, vault);
|
|
12216
12031
|
if (existing.length === 0) {
|
|
12217
12032
|
throw new Error(
|
|
12218
|
-
`db.rotateRecovery: no Shamir recovery entry is enrolled for vault "${vault}". Call db.enrollRecovery({ profile: 'shamir', k, n }) first; rotateRecovery replaces an existing entry rather than minting one from scratch.`
|
|
12033
|
+
`db.rotateRecovery: no Shamir recovery entry is enrolled for vault "${vault}". Call db.team.enrollRecovery({ profile: 'shamir', k, n }) first; rotateRecovery replaces an existing entry rather than minting one from scratch.`
|
|
12219
12034
|
);
|
|
12220
12035
|
}
|
|
12221
12036
|
let targetEntryId;
|
|
@@ -12252,7 +12067,7 @@ var TeamFacade = class {
|
|
|
12252
12067
|
* **Atomic create-and-enroll for managed-mode vaults.**
|
|
12253
12068
|
*
|
|
12254
12069
|
* Bootstraps a managed-mode vault and enrolls strong recovery in
|
|
12255
|
-
* a single ceremony. Under `
|
|
12070
|
+
* a single ceremony. Under `secretMode: 'managed'`, every
|
|
12256
12071
|
* `openVault` call requires a strong recovery profile (Shamir
|
|
12257
12072
|
* today) to be enrolled — otherwise it throws
|
|
12258
12073
|
* {@link ManagedRecoveryNotEnrolledError}. This method bypasses
|
|
@@ -12271,11 +12086,11 @@ var TeamFacade = class {
|
|
|
12271
12086
|
* ```ts
|
|
12272
12087
|
* const db = await createNoydb({
|
|
12273
12088
|
* store, user: 'alice',
|
|
12274
|
-
*
|
|
12089
|
+
* secretMode: 'managed',
|
|
12275
12090
|
* sealingKey: macosKeychainSealingProvider({ ... }),
|
|
12276
12091
|
* })
|
|
12277
12092
|
*
|
|
12278
|
-
* const { vault, recoveryEnrollments } = await db.openVaultAndEnrollRecovery('acme', {
|
|
12093
|
+
* const { vault, recoveryEnrollments } = await db.team.openVaultAndEnrollRecovery('acme', {
|
|
12279
12094
|
* recovery: [{ profile: 'shamir', k: 2, n: 3 }],
|
|
12280
12095
|
* })
|
|
12281
12096
|
* for (const r of recoveryEnrollments) {
|
|
@@ -12292,11 +12107,11 @@ var TeamFacade = class {
|
|
|
12292
12107
|
"openVaultAndEnrollRecovery: at least one recovery enrollment is required."
|
|
12293
12108
|
);
|
|
12294
12109
|
}
|
|
12295
|
-
if (this.deps.options.
|
|
12110
|
+
if (this.deps.options.secretMode === "managed") {
|
|
12296
12111
|
const hasStrong = opts.recovery.some((r) => r.profile === "shamir");
|
|
12297
12112
|
if (!hasStrong) {
|
|
12298
12113
|
throw new ValidationError(
|
|
12299
|
-
'openVaultAndEnrollRecovery: managed-mode vaults require at least one strong recovery profile in the `recovery` array. Paper alone is not strong under managed mode (no user
|
|
12114
|
+
'openVaultAndEnrollRecovery: managed-mode vaults require at least one strong recovery profile in the `recovery` array. Paper alone is not strong under managed mode (no user secret to fall back on). Include { profile: "shamir", k, n } in `recovery`.'
|
|
12300
12115
|
);
|
|
12301
12116
|
}
|
|
12302
12117
|
}
|
|
@@ -12311,7 +12126,7 @@ var TeamFacade = class {
|
|
|
12311
12126
|
for (const enrollment of opts.recovery) {
|
|
12312
12127
|
recoveryEnrollments.push(await this.enrollRecovery(vault, enrollment));
|
|
12313
12128
|
}
|
|
12314
|
-
if (this.deps.options.
|
|
12129
|
+
if (this.deps.options.secretMode === "managed") {
|
|
12315
12130
|
const policy = this.deps.policyCache.get(vault);
|
|
12316
12131
|
if (policy) {
|
|
12317
12132
|
await this.deps.assertRecoveryEnrolled(vault, policy);
|
|
@@ -12320,20 +12135,20 @@ var TeamFacade = class {
|
|
|
12320
12135
|
return { vault: vaultHandle, recoveryEnrollments };
|
|
12321
12136
|
}
|
|
12322
12137
|
/**
|
|
12323
|
-
* **Recovery flow under managed-
|
|
12138
|
+
* **Recovery flow under managed-secret mode.**
|
|
12324
12139
|
*
|
|
12325
|
-
* Replaces the sealed
|
|
12140
|
+
* Replaces the sealed secret of a managed-mode vault with a
|
|
12326
12141
|
* fresh 256-bit random, sealed under the configured
|
|
12327
|
-
* `SealingKeyProvider`. The user never sees the new
|
|
12142
|
+
* `SealingKeyProvider`. The user never sees the new secret.
|
|
12328
12143
|
*
|
|
12329
12144
|
* Internally:
|
|
12330
12145
|
* 1. Verify the recovery proof (Shamir today) and unwrap the
|
|
12331
12146
|
* DEK set.
|
|
12332
|
-
* 2. Mint a fresh 256-bit random as the new effective
|
|
12147
|
+
* 2. Mint a fresh 256-bit random as the new effective secret.
|
|
12333
12148
|
* 3. Rewrap the DEK set under a fresh KEK derived from the new
|
|
12334
|
-
*
|
|
12149
|
+
* secret (via the existing `recoverSecret` path).
|
|
12335
12150
|
* 4. Seal the random bytes under the provider and overwrite
|
|
12336
|
-
* `_meta/sealed-
|
|
12151
|
+
* `_meta/sealed-secret`.
|
|
12337
12152
|
* 5. Drop the keyring cache so the next operation re-derives.
|
|
12338
12153
|
*
|
|
12339
12154
|
* The vault's strong-recovery enrollment is preserved across
|
|
@@ -12341,40 +12156,40 @@ var TeamFacade = class {
|
|
|
12341
12156
|
*
|
|
12342
12157
|
* @throws ValidationError if the Noydb instance is not in managed mode.
|
|
12343
12158
|
*/
|
|
12344
|
-
async
|
|
12345
|
-
if (this.deps.options.
|
|
12159
|
+
async recoverManagedSecret(vault, options) {
|
|
12160
|
+
if (this.deps.options.secretMode !== "managed") {
|
|
12346
12161
|
throw new ValidationError(
|
|
12347
|
-
"
|
|
12162
|
+
"recoverManagedSecret: this method only applies to vaults opened in managed-secret mode. For standard mode, use db.recoverSecret."
|
|
12348
12163
|
);
|
|
12349
12164
|
}
|
|
12350
12165
|
const provider = this.deps.options.sealingKey;
|
|
12351
12166
|
if (!provider) {
|
|
12352
12167
|
throw new ValidationError(
|
|
12353
|
-
'
|
|
12168
|
+
'recoverManagedSecret: createNoydb({ secretMode: "managed" }) requires `sealingKey` to be supplied; without it the new sealed secret cannot be persisted.'
|
|
12354
12169
|
);
|
|
12355
12170
|
}
|
|
12356
12171
|
const randomBytes = new Uint8Array(32);
|
|
12357
12172
|
globalThis.crypto.getRandomValues(randomBytes);
|
|
12358
12173
|
let binary = "";
|
|
12359
12174
|
for (let i = 0; i < randomBytes.length; i++) binary += String.fromCharCode(randomBytes[i]);
|
|
12360
|
-
const
|
|
12175
|
+
const newSecret = btoa(binary);
|
|
12361
12176
|
try {
|
|
12362
12177
|
const sealed = await provider.seal(randomBytes);
|
|
12363
|
-
await
|
|
12178
|
+
await recoverSecret(
|
|
12364
12179
|
this.deps.options.shamirRecovery,
|
|
12365
12180
|
this.deps.options.store,
|
|
12366
12181
|
vault,
|
|
12367
12182
|
this.deps.options.user,
|
|
12368
12183
|
{
|
|
12369
|
-
|
|
12184
|
+
newSecret,
|
|
12370
12185
|
recoveryProof: options.recoveryProof,
|
|
12371
|
-
// The new
|
|
12186
|
+
// The new secret IS 256 bits of random; policy gates on
|
|
12372
12187
|
// length/entropy don't apply.
|
|
12373
|
-
|
|
12374
|
-
...options.
|
|
12188
|
+
allowWeakSecret: true,
|
|
12189
|
+
...options.secretPolicy !== void 0 ? { secretPolicy: options.secretPolicy } : {}
|
|
12375
12190
|
}
|
|
12376
12191
|
);
|
|
12377
|
-
await
|
|
12192
|
+
await saveSealedSecret(this.deps.options.store, vault, {
|
|
12378
12193
|
providerId: provider.id,
|
|
12379
12194
|
sealed
|
|
12380
12195
|
});
|
|
@@ -12385,7 +12200,7 @@ var TeamFacade = class {
|
|
|
12385
12200
|
}
|
|
12386
12201
|
/**
|
|
12387
12202
|
* Atomic peer-recovery — re-wraps an EXISTING user's keyring under
|
|
12388
|
-
* a fresh temp
|
|
12203
|
+
* a fresh temp secret in a single store write. Closes the
|
|
12389
12204
|
* partial-failure window (the previous compose-from-primitives
|
|
12390
12205
|
* pattern was `db.revoke + db.grant`, two writes — if the issuer
|
|
12391
12206
|
* cancelled between them the target was locked out entirely).
|
|
@@ -12404,17 +12219,17 @@ var TeamFacade = class {
|
|
|
12404
12219
|
* recovery / TOTP / email-OTP factor proof at the moment of
|
|
12405
12220
|
* recovery, so the issuer affirmatively re-asserts identity.
|
|
12406
12221
|
*
|
|
12407
|
-
* The recipient should call `db.
|
|
12222
|
+
* The recipient should call `db.rotateSecret` on first session
|
|
12408
12223
|
* to choose their own phrase — the temp acts as a single-use
|
|
12409
12224
|
* bridge.
|
|
12410
12225
|
*
|
|
12411
12226
|
* ```ts
|
|
12412
|
-
* await db.recoverUser('acme', {
|
|
12227
|
+
* await db.team.recoverUser('acme', {
|
|
12413
12228
|
* userId: 'bob',
|
|
12414
|
-
*
|
|
12229
|
+
* secret: 'temporary-correct-horse-battery-staple-printer',
|
|
12415
12230
|
* }, { factors: [{ kind: 'recovery' }] })
|
|
12416
12231
|
* // Bob opens createNoydb({ user: 'bob', secret: tempPhrase })
|
|
12417
|
-
* // and immediately calls db.
|
|
12232
|
+
* // and immediately calls db.rotateSecret to set his own.
|
|
12418
12233
|
* ```
|
|
12419
12234
|
*
|
|
12420
12235
|
* @throws `NoAccessError` when no keyring exists for the target.
|
|
@@ -12440,17 +12255,17 @@ var TeamFacade = class {
|
|
|
12440
12255
|
* The hub wraps the user's DEK set (not the KEK) under a code-derived
|
|
12441
12256
|
* AES-GCM key — see `team/recovery.ts` for the rationale. The mint
|
|
12442
12257
|
* helper {@link mintPaperRecoveryEntry} is the canonical primitive;
|
|
12443
|
-
* pair it with `db.getKeyring(vault)` to obtain the live DEK set:
|
|
12258
|
+
* pair it with `db.team.getKeyring(vault)` to obtain the live DEK set:
|
|
12444
12259
|
*
|
|
12445
12260
|
* ```ts
|
|
12446
12261
|
* import { mintPaperRecoveryEntry } from '@noy-db/hub'
|
|
12447
12262
|
*
|
|
12448
|
-
* const keyring = await db.getKeyring('acme')
|
|
12263
|
+
* const keyring = await db.team.getKeyring('acme')
|
|
12449
12264
|
* const codes: string[] = ['CORRECT-HORSE-1', 'BATTERY-STAPLE-2', ...]
|
|
12450
12265
|
* const entries = await Promise.all(
|
|
12451
12266
|
* codes.map((code, i) => mintPaperRecoveryEntry(keyring.deks, code, `code-${i}`)),
|
|
12452
12267
|
* )
|
|
12453
|
-
* await db.enrollRecovery('acme', { profile: 'paper', entries })
|
|
12268
|
+
* await db.team.enrollRecovery('acme', { profile: 'paper', entries })
|
|
12454
12269
|
* showCodesToUser(codes)
|
|
12455
12270
|
* ```
|
|
12456
12271
|
*
|
|
@@ -12461,7 +12276,7 @@ var TeamFacade = class {
|
|
|
12461
12276
|
* ```ts
|
|
12462
12277
|
* import { generateRecoveryCodeSet } from '@noy-db/on-recovery'
|
|
12463
12278
|
* const { codes, entries } = await generateRecoveryCodeSet({ deks: keyring.deks, count: 8 })
|
|
12464
|
-
* await db.enrollRecovery('acme', { profile: 'paper', entries })
|
|
12279
|
+
* await db.team.enrollRecovery('acme', { profile: 'paper', entries })
|
|
12465
12280
|
* ```
|
|
12466
12281
|
*/
|
|
12467
12282
|
async enrollRecovery(vault, enrollment) {
|
|
@@ -12561,7 +12376,7 @@ var TeamFacade = class {
|
|
|
12561
12376
|
* and no `secret` / `getKeyring` is configured.
|
|
12562
12377
|
*
|
|
12563
12378
|
* ```ts
|
|
12564
|
-
* const keyring = await db.getKeyring('acme')
|
|
12379
|
+
* const keyring = await db.team.getKeyring('acme')
|
|
12565
12380
|
* // keyring.deks: Map<collection, CryptoKey>
|
|
12566
12381
|
* // keyring.kek: CryptoKey | null (null for tier-3 / wrap-DEKs sessions)
|
|
12567
12382
|
* // keyring.role / .permissions / .authenticators
|
|
@@ -12638,7 +12453,7 @@ var Noydb = class {
|
|
|
12638
12453
|
keyringCache = /* @__PURE__ */ new Map();
|
|
12639
12454
|
syncEngines = /* @__PURE__ */ new Map();
|
|
12640
12455
|
/**
|
|
12641
|
-
* Per-vault active session tier — defaults to `1` after a
|
|
12456
|
+
* Per-vault active session tier — defaults to `1` after a secret
|
|
12642
12457
|
* unlock; tier-2 / tier-3 unlocks downgrade it. Used by
|
|
12643
12458
|
* {@link checkGate} to evaluate `gate.minTier`.
|
|
12644
12459
|
*/
|
|
@@ -12686,7 +12501,23 @@ var Noydb = class {
|
|
|
12686
12501
|
policyManager;
|
|
12687
12502
|
/** Pre-resolved policy-gate engine function (mirrors `coordinationProvider`/`userApiFactory` above). */
|
|
12688
12503
|
policyCheckGate;
|
|
12689
|
-
|
|
12504
|
+
/**
|
|
12505
|
+
* Credential and multi-user operations — enrolment, secret rotation,
|
|
12506
|
+
* recovery, quick-unlock (#846).
|
|
12507
|
+
*
|
|
12508
|
+
* Public because 23 methods on this class did nothing but restate a
|
|
12509
|
+
* TeamFacade signature and forward to it, so every signature had to be
|
|
12510
|
+
* hand-kept in sync with its counterpart. `db.team.rotateSecret(…)`
|
|
12511
|
+
* reads the same and has one source of truth.
|
|
12512
|
+
*
|
|
12513
|
+
* A getter, not a field, so it appears in the prototype-based kernel API
|
|
12514
|
+
* manifest — an instance field is invisible to it (the same reason
|
|
12515
|
+
* `custodyStrategy` became one in #838).
|
|
12516
|
+
*/
|
|
12517
|
+
get team() {
|
|
12518
|
+
return this.#team;
|
|
12519
|
+
}
|
|
12520
|
+
#team;
|
|
12690
12521
|
/**
|
|
12691
12522
|
* Currently-running multi-record transaction, set by
|
|
12692
12523
|
* `runTransaction` at the start of Phase 2 (commit) and cleared in
|
|
@@ -12748,7 +12579,7 @@ var Noydb = class {
|
|
|
12748
12579
|
this.vaultCache.delete(vault);
|
|
12749
12580
|
}
|
|
12750
12581
|
});
|
|
12751
|
-
this
|
|
12582
|
+
this.#team = new TeamFacade({
|
|
12752
12583
|
options: this.options,
|
|
12753
12584
|
keyringCache: this.keyringCache,
|
|
12754
12585
|
activeTier: this.activeTier,
|
|
@@ -12850,7 +12681,7 @@ var Noydb = class {
|
|
|
12850
12681
|
if (!facade) return;
|
|
12851
12682
|
const ctx = { existing, vault: facade, userId: e.userId, role: e.role };
|
|
12852
12683
|
await registry.runChecks(e.collection, incoming, ctx);
|
|
12853
|
-
const { GuardExecutor } = await import("./executor-
|
|
12684
|
+
const { GuardExecutor } = await import("./executor-OHET7TF7.js");
|
|
12854
12685
|
for (const g of guards) {
|
|
12855
12686
|
await GuardExecutor.checkFrozenFields(g, e.docId, existing, incoming, e.computedFieldNames);
|
|
12856
12687
|
}
|
|
@@ -13205,16 +13036,26 @@ var Noydb = class {
|
|
|
13205
13036
|
/**
|
|
13206
13037
|
* Rotate the DEKs for the given collections in a vault.
|
|
13207
13038
|
*
|
|
13208
|
-
* Generates fresh DEKs
|
|
13209
|
-
*
|
|
13210
|
-
*
|
|
13211
|
-
*
|
|
13212
|
-
* key-rotation policy.
|
|
13039
|
+
* Generates fresh DEKs and re-encrypts every record in each collection.
|
|
13040
|
+
* The old DEKs become unreachable — useful as a defense-in-depth measure
|
|
13041
|
+
* after a suspected key leak, or as the scheduled half of a key-rotation
|
|
13042
|
+
* policy.
|
|
13213
13043
|
*
|
|
13214
|
-
*
|
|
13215
|
-
*
|
|
13216
|
-
*
|
|
13217
|
-
*
|
|
13044
|
+
* ## Other members LOSE access to the rotated collections (#854)
|
|
13045
|
+
*
|
|
13046
|
+
* A member's DEKs are wrapped under that member's KEK, and a KEK derives
|
|
13047
|
+
* only from that member's secret. The caller cannot derive anyone else's
|
|
13048
|
+
* KEK, so re-wrapping a fresh DEK for them is impossible — that is the
|
|
13049
|
+
* zero-knowledge property working as designed. Rotation therefore DROPS
|
|
13050
|
+
* the rotated collections from every other member's keyring.
|
|
13051
|
+
*
|
|
13052
|
+
* The returned {@link RotateResult.needsRegrant} names each (member,
|
|
13053
|
+
* collection) pair that was dropped. Re-run `grant()` for those pairs, or
|
|
13054
|
+
* they stay locked out.
|
|
13055
|
+
*
|
|
13056
|
+
* Unlike `revoke({ rotateKeys: true })`, this call does not REMOVE any
|
|
13057
|
+
* user from the vault — they keep membership and their other collections.
|
|
13058
|
+
* This is the "just rotate" path; "revoke and rotate" lives in `revoke()`.
|
|
13218
13059
|
*
|
|
13219
13060
|
* Exposed on Noydb (rather than only on the lower-level keyring
|
|
13220
13061
|
* module) so CLI and admin tooling can trigger rotation without
|
|
@@ -13235,9 +13076,9 @@ var Noydb = class {
|
|
|
13235
13076
|
*
|
|
13236
13077
|
* The walk is a two-step pipeline: first ask the adapter for the
|
|
13237
13078
|
* universe of compartments it stores, then for each one attempt to
|
|
13238
|
-
* load the calling user's keyring with the in-memory
|
|
13079
|
+
* load the calling user's keyring with the in-memory secret.
|
|
13239
13080
|
* Compartments where the user has no keyring file (`NoAccessError`)
|
|
13240
|
-
* or where the
|
|
13081
|
+
* or where the secret doesn't unwrap (`InvalidKeyError`) are
|
|
13241
13082
|
* silently dropped from the result — the existence of those
|
|
13242
13083
|
* compartments is **not** confirmed in the return value.
|
|
13243
13084
|
*
|
|
@@ -13258,15 +13099,15 @@ var Noydb = class {
|
|
|
13258
13099
|
* **Known edge case.** A vault whose keyring file
|
|
13259
13100
|
* happens to have an empty wrapped-DEKs map (because the owner
|
|
13260
13101
|
* granted access before any collection was created) will pass the
|
|
13261
|
-
* `loadKeyring` probe with *any*
|
|
13102
|
+
* `loadKeyring` probe with *any* secret — there are no DEKs to
|
|
13262
13103
|
* unwrap, so the integrity-checked unwrap that normally rejects
|
|
13263
|
-
* wrong
|
|
13104
|
+
* wrong secrets never runs. The result is that an unrelated
|
|
13264
13105
|
* principal who happens to know the user-id and the vault
|
|
13265
13106
|
* name can show up in `listAccessibleVaults()` as having
|
|
13266
13107
|
* access to that empty vault. They cannot read any actual
|
|
13267
13108
|
* data (their DEK set is empty), so this is a metadata leak
|
|
13268
13109
|
* (vault name + user-id), not a content leak. Hardening this
|
|
13269
|
-
* via a
|
|
13110
|
+
* via a secret canary in the keyring file is a deferred
|
|
13270
13111
|
* follow-up.
|
|
13271
13112
|
*
|
|
13272
13113
|
* **Cost.** O(compartments × keyring-load) — one `loadKeyring`
|
|
@@ -13307,7 +13148,7 @@ var Noydb = class {
|
|
|
13307
13148
|
}
|
|
13308
13149
|
if (!this.options.secret) {
|
|
13309
13150
|
throw new ValidationError(
|
|
13310
|
-
"Noydb.listAccessibleVaults(): a secret (
|
|
13151
|
+
"Noydb.listAccessibleVaults(): a secret (secret) is required when encryption is enabled."
|
|
13311
13152
|
);
|
|
13312
13153
|
}
|
|
13313
13154
|
const minRank = ROLE_RANK[options.minRole ?? "client"];
|
|
@@ -13382,7 +13223,7 @@ var Noydb = class {
|
|
|
13382
13223
|
* })
|
|
13383
13224
|
* ```
|
|
13384
13225
|
*/
|
|
13385
|
-
async queryAcross(vaultIds,
|
|
13226
|
+
async queryAcross(vaultIds, fn, options = {}) {
|
|
13386
13227
|
if (this.closed) throw new ValidationError("Instance is closed");
|
|
13387
13228
|
this.resetSessionTimer();
|
|
13388
13229
|
const concurrency = Math.max(1, options.concurrency ?? 1);
|
|
@@ -13396,7 +13237,7 @@ var Noydb = class {
|
|
|
13396
13237
|
const task = (async () => {
|
|
13397
13238
|
try {
|
|
13398
13239
|
const comp = await this.openVault(vaultId, { create: options.create !== false });
|
|
13399
|
-
const result = await
|
|
13240
|
+
const result = await fn(comp);
|
|
13400
13241
|
results[idx] = { vault: vaultId, result };
|
|
13401
13242
|
} catch (err) {
|
|
13402
13243
|
results[idx] = {
|
|
@@ -13446,21 +13287,21 @@ var Noydb = class {
|
|
|
13446
13287
|
return store.resolveBackend ? store.resolveBackend(vaultId) : this.options.store;
|
|
13447
13288
|
}
|
|
13448
13289
|
/**
|
|
13449
|
-
* Change the current user's
|
|
13290
|
+
* Change the current user's secret for a vault.
|
|
13450
13291
|
*
|
|
13451
|
-
* Validates the new
|
|
13452
|
-
* `{
|
|
13453
|
-
* fixtures and migrations. Pass a `
|
|
13292
|
+
* Validates the new secret against the strength rules. Pass
|
|
13293
|
+
* `{ allowWeakSecret: true }` to skip — typically only useful for
|
|
13294
|
+
* fixtures and migrations. Pass a `SecretPolicy` to override the
|
|
13454
13295
|
* default rules (e.g. consumer-tunable `pattern` / `customValidator`).
|
|
13455
13296
|
*/
|
|
13456
|
-
async changeSecret(vault,
|
|
13297
|
+
async changeSecret(vault, newSecret, options) {
|
|
13457
13298
|
this.checkPolicyOperation(vault, "changeSecret");
|
|
13458
13299
|
const keyring = await this._getKeyringInternal(vault);
|
|
13459
13300
|
const updated = await changeSecret(
|
|
13460
13301
|
this.options.store,
|
|
13461
13302
|
vault,
|
|
13462
13303
|
keyring,
|
|
13463
|
-
|
|
13304
|
+
newSecret,
|
|
13464
13305
|
options
|
|
13465
13306
|
);
|
|
13466
13307
|
this.keyringCache.set(vault, updated);
|
|
@@ -13618,8 +13459,8 @@ var Noydb = class {
|
|
|
13618
13459
|
}
|
|
13619
13460
|
return engine;
|
|
13620
13461
|
}
|
|
13621
|
-
_forEachSyncEngine(vault,
|
|
13622
|
-
for (const [key, engine] of this.syncEngines) if (key === vault || key.startsWith(`${vault}::`))
|
|
13462
|
+
_forEachSyncEngine(vault, fn) {
|
|
13463
|
+
for (const [key, engine] of this.syncEngines) if (key === vault || key.startsWith(`${vault}::`)) fn(engine);
|
|
13623
13464
|
}
|
|
13624
13465
|
// ─── Events ────────────────────────────────────────────────────
|
|
13625
13466
|
on(event, handler) {
|
|
@@ -13663,9 +13504,9 @@ var Noydb = class {
|
|
|
13663
13504
|
return this.writeHooks.onAfterWrite(handler);
|
|
13664
13505
|
}
|
|
13665
13506
|
/** Subscribe to cross-tab write conflicts. Returns an unsubscribe. */
|
|
13666
|
-
onWriteConflict(
|
|
13667
|
-
this.on("write:conflict",
|
|
13668
|
-
return () => this.off("write:conflict",
|
|
13507
|
+
onWriteConflict(fn) {
|
|
13508
|
+
this.on("write:conflict", fn);
|
|
13509
|
+
return () => this.off("write:conflict", fn);
|
|
13669
13510
|
}
|
|
13670
13511
|
/**
|
|
13671
13512
|
* Enable same-device multi-tab coordination: primary/secondary
|
|
@@ -13739,12 +13580,12 @@ var Noydb = class {
|
|
|
13739
13580
|
activeTabs() {
|
|
13740
13581
|
return this.tabCoordinator?.activeTabs() ?? [];
|
|
13741
13582
|
}
|
|
13742
|
-
onTabRoleChange(
|
|
13743
|
-
return this.tabCoordinator?.onTabRoleChange(
|
|
13583
|
+
onTabRoleChange(fn) {
|
|
13584
|
+
return this.tabCoordinator?.onTabRoleChange(fn) ?? (() => {
|
|
13744
13585
|
});
|
|
13745
13586
|
}
|
|
13746
|
-
onActiveTabsChange(
|
|
13747
|
-
return this.tabCoordinator?.onActiveTabsChange(
|
|
13587
|
+
onActiveTabsChange(fn) {
|
|
13588
|
+
return this.tabCoordinator?.onActiveTabsChange(fn) ?? (() => {
|
|
13748
13589
|
});
|
|
13749
13590
|
}
|
|
13750
13591
|
/** @internal The write-hook registry, threaded into each Collection. */
|
|
@@ -13941,7 +13782,7 @@ var Noydb = class {
|
|
|
13941
13782
|
* denial; resolves with `void` on success.
|
|
13942
13783
|
*
|
|
13943
13784
|
* @param vault The vault whose policy applies.
|
|
13944
|
-
* @param gate Gate name — built-in (e.g. `'rotate-
|
|
13785
|
+
* @param gate Gate name — built-in (e.g. `'rotate-secret'`)
|
|
13945
13786
|
* or app-defined (`app:*`).
|
|
13946
13787
|
* @param presented Caller-supplied factor proofs.
|
|
13947
13788
|
*/
|
|
@@ -13966,12 +13807,12 @@ var Noydb = class {
|
|
|
13966
13807
|
* Two enforcement modes:
|
|
13967
13808
|
*
|
|
13968
13809
|
* 1. **Managed-mode mandatory strong-recovery.** When
|
|
13969
|
-
* `
|
|
13810
|
+
* `secretMode === 'managed'`, the vault MUST have at least
|
|
13970
13811
|
* one **strong** recovery profile (Shamir today). Paper alone is
|
|
13971
13812
|
* rejected because under managed mode the user has no memorized
|
|
13972
|
-
*
|
|
13813
|
+
* secret, so losing the paper sheet = losing every record.
|
|
13973
13814
|
* This check is unconditional — independent of `requireRecovery`
|
|
13974
|
-
* and the `recover-
|
|
13815
|
+
* and the `recover-secret` gate.
|
|
13975
13816
|
*
|
|
13976
13817
|
* 2. **Opt-in strict mandatory-recovery.** When
|
|
13977
13818
|
* `requireRecovery: true` is set on createNoydb (and the gate is
|
|
@@ -13985,14 +13826,14 @@ var Noydb = class {
|
|
|
13985
13826
|
*/
|
|
13986
13827
|
async assertRecoveryEnrolled(vault, policy, opts) {
|
|
13987
13828
|
const skipManaged = (opts?.skipManagedCheck ?? false) || this._skipNextManagedRecoveryCheck;
|
|
13988
|
-
if (this.options.
|
|
13829
|
+
if (this.options.secretMode === "managed" && !skipManaged) {
|
|
13989
13830
|
const enrolled2 = await hasStrongRecoveryEnrolled(this.options.store, vault);
|
|
13990
13831
|
if (!enrolled2) {
|
|
13991
13832
|
throw new ManagedRecoveryNotEnrolledError(vault);
|
|
13992
13833
|
}
|
|
13993
13834
|
}
|
|
13994
13835
|
if (this.options.requireRecovery !== true) return;
|
|
13995
|
-
const gate = policy.gates["recover-
|
|
13836
|
+
const gate = policy.gates["recover-secret"];
|
|
13996
13837
|
if (gate?.enabled === false) return;
|
|
13997
13838
|
const enrolled = await hasRecoveryEnrolled(this.options.store, vault);
|
|
13998
13839
|
if (enrolled) return;
|
|
@@ -14007,34 +13848,6 @@ var Noydb = class {
|
|
|
14007
13848
|
this.activeTier.set(vault, tier);
|
|
14008
13849
|
}
|
|
14009
13850
|
// ─── Tier-2 enroll / remove ─────────────────────────────────────
|
|
14010
|
-
/** Add a tier-2 authenticator slot — see {@link TeamFacade.enrollAuthenticator}. */
|
|
14011
|
-
async enrollAuthenticator(vault, options, factors) {
|
|
14012
|
-
return this.team.enrollAuthenticator(vault, options, factors);
|
|
14013
|
-
}
|
|
14014
|
-
/** Remove a tier-2 authenticator slot — see {@link TeamFacade.removeAuthenticator}. */
|
|
14015
|
-
async removeAuthenticator(vault, slotId, factors) {
|
|
14016
|
-
return this.team.removeAuthenticator(vault, slotId, factors);
|
|
14017
|
-
}
|
|
14018
|
-
/** Read the slot list for a vault — see {@link TeamFacade.listAuthenticators}. */
|
|
14019
|
-
async listAuthenticators(vault) {
|
|
14020
|
-
return this.team.listAuthenticators(vault);
|
|
14021
|
-
}
|
|
14022
|
-
/** Mutate an authenticator slot's `meta` — see {@link TeamFacade.updateAuthenticator}. */
|
|
14023
|
-
async updateAuthenticator(vault, slotId, options, factors) {
|
|
14024
|
-
return this.team.updateAuthenticator(vault, slotId, options, factors);
|
|
14025
|
-
}
|
|
14026
|
-
/** Native WebAuthn enrollment — see {@link TeamFacade.enrollWebAuthn}. */
|
|
14027
|
-
async enrollWebAuthn(vault, ceremony, factors) {
|
|
14028
|
-
return this.team.enrollWebAuthn(vault, ceremony, factors);
|
|
14029
|
-
}
|
|
14030
|
-
/** List webauthn-method slots — see {@link TeamFacade.listWebAuthnSlots}. */
|
|
14031
|
-
async listWebAuthnSlots(vault) {
|
|
14032
|
-
return this.team.listWebAuthnSlots(vault);
|
|
14033
|
-
}
|
|
14034
|
-
/** Unlock via a tier-2 authenticator slot — see {@link TeamFacade.unlockViaAuthenticator}. */
|
|
14035
|
-
async unlockViaAuthenticator(vault, slotId, verify) {
|
|
14036
|
-
return this.team.unlockViaAuthenticator(vault, slotId, verify);
|
|
14037
|
-
}
|
|
14038
13851
|
// ─── Cover (https://github.com/vLannaAi/noy-db-docs/blob/main/content/docs/services/public-envelope.md) ──────
|
|
14039
13852
|
/**
|
|
14040
13853
|
* Set the owner-curated cover for a vault. Throws
|
|
@@ -14058,7 +13871,7 @@ var Noydb = class {
|
|
|
14058
13871
|
"setCover: the cover feature is not enabled. Pass `cover: true` (or a schema object) to `createNoydb`."
|
|
14059
13872
|
);
|
|
14060
13873
|
}
|
|
14061
|
-
const { loadCover, saveCover, resolveSchema, validateCoverInput, mergeCustom, validateCoverSize } = await import("./cover-
|
|
13874
|
+
const { loadCover, saveCover, resolveSchema, validateCoverInput, mergeCustom, validateCoverSize } = await import("./cover-ADBCTIKN.js");
|
|
14062
13875
|
const schema = resolveSchema(coverOption);
|
|
14063
13876
|
validateCoverInput(input, schema);
|
|
14064
13877
|
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
@@ -14090,76 +13903,12 @@ var Noydb = class {
|
|
|
14090
13903
|
* regardless).
|
|
14091
13904
|
*/
|
|
14092
13905
|
async getCover(vault, opts = {}) {
|
|
14093
|
-
const { readCover } = await import("./cover-
|
|
13906
|
+
const { readCover } = await import("./cover-ADBCTIKN.js");
|
|
14094
13907
|
return readCover(this.options.store, vault, opts);
|
|
14095
13908
|
}
|
|
14096
13909
|
// ─── Auth introspection ─────────────────────────────────────────
|
|
14097
|
-
/** English summary of the configured auth model — see {@link TeamFacade.describeAuthConfig}. */
|
|
14098
|
-
async describeAuthConfig(vault) {
|
|
14099
|
-
return this.team.describeAuthConfig(vault);
|
|
14100
|
-
}
|
|
14101
|
-
/** Mermaid `flowchart TB` source for the auth graph — see {@link TeamFacade.diagramAuthConfig}. */
|
|
14102
|
-
async diagramAuthConfig(vault) {
|
|
14103
|
-
return this.team.diagramAuthConfig(vault);
|
|
14104
|
-
}
|
|
14105
|
-
/** Per-user enrollment summary — see {@link TeamFacade.describeUserAuth}. */
|
|
14106
|
-
async describeUserAuth(vault, userId, factors) {
|
|
14107
|
-
return this.team.describeUserAuth(vault, userId, factors);
|
|
14108
|
-
}
|
|
14109
|
-
/** Bulk per-user enrollment summary — see {@link TeamFacade.describeAllUsersAuth}. */
|
|
14110
|
-
async describeAllUsersAuth(vault, factors) {
|
|
14111
|
-
return this.team.describeAllUsersAuth(vault, factors);
|
|
14112
|
-
}
|
|
14113
13910
|
// ─── Tier-1 change flows ────────────────────────────────────────
|
|
14114
|
-
/** Rotate the user's passphrase (user remembers old) — see {@link TeamFacade.rotatePassphrase}. */
|
|
14115
|
-
async rotatePassphrase(vault, input, factors) {
|
|
14116
|
-
return this.team.rotatePassphrase(vault, input, factors);
|
|
14117
|
-
}
|
|
14118
|
-
/** Reset the passphrase using a recovery proof — see {@link TeamFacade.recoverPassphrase}. */
|
|
14119
|
-
async recoverPassphrase(vault, input, factors) {
|
|
14120
|
-
return this.team.recoverPassphrase(vault, input, factors);
|
|
14121
|
-
}
|
|
14122
|
-
/** Deliberate paper/Shamir recovery-code regeneration — see {@link TeamFacade.rotateRecovery}. */
|
|
14123
|
-
async rotateRecovery(vault, options, factors) {
|
|
14124
|
-
return this.team.rotateRecovery(vault, options, factors);
|
|
14125
|
-
}
|
|
14126
|
-
/** Atomic create-and-enroll for managed-mode vaults — see {@link TeamFacade.openVaultAndEnrollRecovery}. */
|
|
14127
|
-
async openVaultAndEnrollRecovery(vault, opts) {
|
|
14128
|
-
return this.team.openVaultAndEnrollRecovery(vault, opts);
|
|
14129
|
-
}
|
|
14130
|
-
/** Recovery flow under managed-passphrase mode — see {@link TeamFacade.recoverManagedPassphrase}. */
|
|
14131
|
-
async recoverManagedPassphrase(vault, options) {
|
|
14132
|
-
return this.team.recoverManagedPassphrase(vault, options);
|
|
14133
|
-
}
|
|
14134
|
-
/** Atomic peer-recovery of an existing user's keyring — see {@link TeamFacade.recoverUser}. */
|
|
14135
|
-
async recoverUser(vault, options, factors) {
|
|
14136
|
-
return this.team.recoverUser(vault, options, factors);
|
|
14137
|
-
}
|
|
14138
|
-
/** Persist a recovery enrollment (paper or Shamir) — see {@link TeamFacade.enrollRecovery}. */
|
|
14139
|
-
async enrollRecovery(vault, enrollment) {
|
|
14140
|
-
return this.team.enrollRecovery(vault, enrollment);
|
|
14141
|
-
}
|
|
14142
|
-
/** Read the persisted recovery entries (paper + Shamir) — see {@link TeamFacade.listRecoveryEntries}. */
|
|
14143
|
-
async listRecoveryEntries(vault) {
|
|
14144
|
-
return this.team.listRecoveryEntries(vault);
|
|
14145
|
-
}
|
|
14146
13911
|
// ─── Tier-3 enroll / unlock ─────────────────────────────────────
|
|
14147
|
-
/** Register a tier-3 quick-unlock state — see {@link TeamFacade.enrollUnlock}. */
|
|
14148
|
-
async enrollUnlock(vault, state, factors) {
|
|
14149
|
-
return this.team.enrollUnlock(vault, state, factors);
|
|
14150
|
-
}
|
|
14151
|
-
/** Resume a session via the registered tier-3 state — see {@link TeamFacade.unlockViaPin}. */
|
|
14152
|
-
async unlockViaPin(vault, resume) {
|
|
14153
|
-
return this.team.unlockViaPin(vault, resume);
|
|
14154
|
-
}
|
|
14155
|
-
/** Drop the tier-3 state for a vault — see {@link TeamFacade.clearQuickUnlock}. */
|
|
14156
|
-
clearQuickUnlock(vault) {
|
|
14157
|
-
this.team.clearQuickUnlock(vault);
|
|
14158
|
-
}
|
|
14159
|
-
/** Public defensive-copy accessor for the unlocked keyring — see {@link TeamFacade.getKeyring}. */
|
|
14160
|
-
async getKeyring(vault) {
|
|
14161
|
-
return this.team.getKeyring(vault);
|
|
14162
|
-
}
|
|
14163
13912
|
/**
|
|
14164
13913
|
* Live-reference variant used by the hub's own code paths. Internal
|
|
14165
13914
|
* mutations on `deks` (e.g. {@link ensureCollectionDEK} adding a
|
|
@@ -14180,7 +13929,7 @@ var Noydb = class {
|
|
|
14180
13929
|
}
|
|
14181
13930
|
await assertKeyringOpenAllowed(this.options.store, vault, this.options.user, opts.create);
|
|
14182
13931
|
let effectiveSecret;
|
|
14183
|
-
if (this.options.
|
|
13932
|
+
if (this.options.secretMode === "managed") {
|
|
14184
13933
|
effectiveSecret = await resolveManagedSecret(
|
|
14185
13934
|
this.options.store,
|
|
14186
13935
|
vault,
|
|
@@ -14190,7 +13939,7 @@ var Noydb = class {
|
|
|
14190
13939
|
effectiveSecret = this.options.secret;
|
|
14191
13940
|
}
|
|
14192
13941
|
if (!effectiveSecret) {
|
|
14193
|
-
throw new ValidationError("A secret (
|
|
13942
|
+
throw new ValidationError("A secret (secret) or getKeyring callback is required when encryption is enabled");
|
|
14194
13943
|
}
|
|
14195
13944
|
let keyring;
|
|
14196
13945
|
try {
|
|
@@ -14204,10 +13953,10 @@ var Noydb = class {
|
|
|
14204
13953
|
effectiveSecret,
|
|
14205
13954
|
{
|
|
14206
13955
|
// Managed mode generates 256-bit base64 strings that don't satisfy
|
|
14207
|
-
// the human-
|
|
13956
|
+
// the human-secret strength rules (no spaces, no "words").
|
|
14208
13957
|
// Skip validation in managed mode — the entropy floor is already
|
|
14209
13958
|
// 256 bits by construction.
|
|
14210
|
-
validate: this.options.
|
|
13959
|
+
validate: this.options.secretMode === "managed" ? false : this.options.validateSecret === true
|
|
14211
13960
|
}
|
|
14212
13961
|
);
|
|
14213
13962
|
} else if (err instanceof InvalidKeyError && this.options.onInvalidKey === "reset") {
|
|
@@ -14218,7 +13967,7 @@ var Noydb = class {
|
|
|
14218
13967
|
this.options.user,
|
|
14219
13968
|
effectiveSecret,
|
|
14220
13969
|
{
|
|
14221
|
-
validate: this.options.
|
|
13970
|
+
validate: this.options.secretMode === "managed" ? false : this.options.validateSecret === true
|
|
14222
13971
|
}
|
|
14223
13972
|
);
|
|
14224
13973
|
} else {
|
|
@@ -14256,34 +14005,34 @@ var Noydb = class {
|
|
|
14256
14005
|
async function createNoydb(options) {
|
|
14257
14006
|
if (!options.store) options = { ...options, store: memoryStore() };
|
|
14258
14007
|
const encrypted = options.encrypt !== false;
|
|
14259
|
-
const managed = options.
|
|
14008
|
+
const managed = options.secretMode === "managed";
|
|
14260
14009
|
if (options.secret && options.getKeyring) {
|
|
14261
14010
|
throw new ValidationError("Provide either `secret` or `getKeyring`, not both");
|
|
14262
14011
|
}
|
|
14263
14012
|
if (managed) {
|
|
14264
14013
|
if (options.secret) {
|
|
14265
14014
|
throw new ValidationError(
|
|
14266
|
-
'`
|
|
14015
|
+
'`secretMode: "managed"` is mutually exclusive with `secret` \u2014 managed mode generates the secret itself. Drop `secret`.'
|
|
14267
14016
|
);
|
|
14268
14017
|
}
|
|
14269
14018
|
if (options.getKeyring) {
|
|
14270
14019
|
throw new ValidationError(
|
|
14271
|
-
'`
|
|
14020
|
+
'`secretMode: "managed"` is mutually exclusive with `getKeyring` \u2014 a custom unlock callback would bypass the sealing flow. Drop `getKeyring`.'
|
|
14272
14021
|
);
|
|
14273
14022
|
}
|
|
14274
14023
|
if (!options.sealingKey) {
|
|
14275
14024
|
throw new ValidationError(
|
|
14276
|
-
'`
|
|
14025
|
+
'`secretMode: "managed"` requires `sealingKey: SealingKeyProvider` (see @noy-db/seal-macos-keychain / @noy-db/seal-aws-kms / etc.).'
|
|
14277
14026
|
);
|
|
14278
14027
|
}
|
|
14279
14028
|
}
|
|
14280
14029
|
if (encrypted && !managed && !options.secret && !options.getKeyring) {
|
|
14281
|
-
throw new ValidationError("A secret (
|
|
14030
|
+
throw new ValidationError("A secret (secret) or getKeyring callback is required when encryption is enabled");
|
|
14282
14031
|
}
|
|
14283
14032
|
if (!options.coordinationStrategy) options = { ...options, coordinationStrategy: await createDefaultCoordinationProvider(options.store) };
|
|
14284
|
-
if (!options.userApiFactory) options = { ...options, userApiFactory: (await import("./api-
|
|
14033
|
+
if (!options.userApiFactory) options = { ...options, userApiFactory: (await import("./api-5QVQX4HG.js")).createUserApi };
|
|
14285
14034
|
if (!options.policyFactory) {
|
|
14286
|
-
const policyModule = await import("./policy-
|
|
14035
|
+
const policyModule = await import("./policy-QWGJB7P7.js");
|
|
14287
14036
|
options = { ...options, policyFactory: policyModule.createNoydbPolicy, policyCheckGateFn: policyModule.checkGate };
|
|
14288
14037
|
}
|
|
14289
14038
|
return new Noydb(options);
|
|
@@ -14320,4 +14069,4 @@ export {
|
|
|
14320
14069
|
Noydb,
|
|
14321
14070
|
createNoydb
|
|
14322
14071
|
};
|
|
14323
|
-
//# sourceMappingURL=chunk-
|
|
14072
|
+
//# sourceMappingURL=chunk-EWPS35AR.js.map
|