@noy-db/hub 0.7.0-pre.9 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1319 -0
- package/README.md +7 -6
- package/dist/api-TXFOVOXX.js +19 -0
- package/dist/as/index.js +14 -14
- package/dist/at/index.js +9 -10
- package/dist/attestation/index.js +18 -19
- package/dist/attestation/index.js.map +1 -1
- package/dist/{backup-QZQEP5RO.js → backup-IJTB4S4M.js} +14 -15
- package/dist/{backup-QZQEP5RO.js.map → backup-IJTB4S4M.js.map} +1 -1
- package/dist/blobs/index.js +13 -14
- package/dist/blobs/index.js.map +1 -1
- package/dist/broker/index.js +12 -13
- package/dist/broker/index.js.map +1 -1
- package/dist/by/index.js +2 -3
- package/dist/cargo/index.js +33 -34
- package/dist/{chunk-5UKIZIO3.js → chunk-2577DKXB.js} +2 -2
- package/dist/chunk-2C3AQB46.js +1652 -0
- package/dist/chunk-2C3AQB46.js.map +1 -0
- package/dist/{chunk-LUVGSKXE.js → chunk-2N4GY74U.js} +6 -6
- package/dist/{chunk-I5LSKXT6.js → chunk-2Y4IMKA6.js} +4 -4
- package/dist/{chunk-7XT7KZTN.js → chunk-3RCJJBNR.js} +10 -10
- package/dist/{chunk-GM4IM7TC.js → chunk-453F654R.js} +2 -2
- package/dist/{chunk-JUBWUJY5.js → chunk-4GVM6QZA.js} +2 -2
- package/dist/{chunk-2DGBRE4K.js → chunk-4OZNXTO4.js} +2 -2
- package/dist/{chunk-P2RJAVMR.js → chunk-5VCRVKOZ.js} +4 -4
- package/dist/{chunk-RCONOOVF.js → chunk-5WDXHNSW.js} +5 -5
- package/dist/chunk-66TQOPFM.js +37 -0
- package/dist/chunk-66TQOPFM.js.map +1 -0
- package/dist/{chunk-Q2OAAREU.js → chunk-6GMZ7HEE.js} +6 -6
- package/dist/{chunk-6L5IMNJX.js → chunk-6GOE5PGN.js} +168 -1328
- package/dist/chunk-6GOE5PGN.js.map +1 -0
- package/dist/{chunk-TQGT5BZE.js → chunk-6I2RQCET.js} +4 -4
- package/dist/{chunk-UL7TLJ54.js → chunk-6X6SEMEE.js} +6 -4
- package/dist/{chunk-UL7TLJ54.js.map → chunk-6X6SEMEE.js.map} +1 -1
- package/dist/{chunk-P7KJME6C.js → chunk-6YXCPL4T.js} +2 -2
- package/dist/{chunk-DOPZWTMJ.js → chunk-77K4PG6P.js} +8 -8
- package/dist/{chunk-LAI7ENPW.js → chunk-7MG2LHO5.js} +3 -3
- package/dist/{chunk-N4CHCXDL.js → chunk-7MG7SJT7.js} +1 -1
- package/dist/{chunk-N4CHCXDL.js.map → chunk-7MG7SJT7.js.map} +1 -1
- package/dist/{chunk-SW4TOSJL.js → chunk-7O3Y4PPD.js} +1 -1
- package/dist/chunk-7O3Y4PPD.js.map +1 -0
- package/dist/{chunk-HOIWW2LV.js → chunk-7V4TP3AF.js} +4 -4
- package/dist/{chunk-GKOJR53Y.js → chunk-ANATMFIO.js} +5 -5
- package/dist/{chunk-MU74BYOD.js → chunk-ANSIZYEG.js} +3 -3
- package/dist/{chunk-IS5LFHV2.js → chunk-AO42KJO6.js} +7 -7
- package/dist/{chunk-RPX2H2OL.js → chunk-BLN54W3L.js} +3 -3
- package/dist/{chunk-HS3LEVT4.js → chunk-BM5TWITZ.js} +7 -7
- package/dist/{chunk-JRWLUWDM.js → chunk-BOET4NA4.js} +3 -3
- package/dist/{chunk-XGXVPCYW.js → chunk-BOWNCWZT.js} +3 -3
- package/dist/{chunk-5EC7X5QA.js → chunk-BSFNRLK2.js} +5 -5
- package/dist/{chunk-65ZYRK7O.js → chunk-BUE2D7PX.js} +26 -3
- package/dist/chunk-BUE2D7PX.js.map +1 -0
- package/dist/{chunk-UTFY6W6X.js → chunk-BZ3534YM.js} +2 -2
- package/dist/chunk-CARABLSQ.js +176 -0
- package/dist/chunk-CARABLSQ.js.map +1 -0
- package/dist/{chunk-HLFLJCDX.js → chunk-CHJBLCOG.js} +7 -7
- package/dist/{chunk-OLUTCM23.js → chunk-CPWQB3N5.js} +7 -7
- package/dist/{chunk-3GIA3HJ2.js → chunk-DGOZ4UZD.js} +2 -2
- package/dist/{chunk-FPN5D4JX.js → chunk-ELNXJMGB.js} +6 -6
- package/dist/{chunk-NMDMSHBF.js → chunk-EQEYOJBM.js} +3 -3
- package/dist/{chunk-RHTPGS56.js → chunk-EYBQEIUY.js} +3 -3
- package/dist/{chunk-Q2ZN5DWZ.js → chunk-FAHMLERK.js} +2 -2
- package/dist/chunk-FFWI7UH7.js +53 -0
- package/dist/chunk-FFWI7UH7.js.map +1 -0
- package/dist/{chunk-MENI33ZV.js → chunk-FMZY5Q6L.js} +3 -3
- package/dist/{chunk-FZWAGG5T.js → chunk-FXBIP2WD.js} +6 -6
- package/dist/{chunk-OHGCRKWA.js → chunk-G56KBWFY.js} +18 -8
- package/dist/{chunk-OHGCRKWA.js.map → chunk-G56KBWFY.js.map} +1 -1
- package/dist/{chunk-K432FT7T.js → chunk-GPEQUXHL.js} +4 -4
- package/dist/{chunk-DNMTN46H.js → chunk-GY4WYNNG.js} +2 -2
- package/dist/{chunk-OQDHIAR2.js → chunk-HDOU6I2Y.js} +80 -8
- package/dist/chunk-HDOU6I2Y.js.map +1 -0
- package/dist/{chunk-MQPHKJ74.js → chunk-J6FXAEUG.js} +12 -12
- package/dist/{chunk-PV7XXAXK.js → chunk-JBDFMYKQ.js} +2 -2
- package/dist/{chunk-IZTU6RKH.js → chunk-JMGDHKQF.js} +2 -2
- package/dist/{chunk-AHIIBDNH.js → chunk-K6LHRFBL.js} +7 -7
- package/dist/{chunk-FN26SFGH.js → chunk-K7NTTA6P.js} +2 -2
- package/dist/{chunk-MV2OEK3K.js → chunk-KG7TZKZG.js} +5 -5
- package/dist/{chunk-5NKHCJU5.js → chunk-KJIMGIWO.js} +8 -8
- package/dist/{chunk-ZB2K3FV7.js → chunk-KTFRCC5C.js} +2 -2
- package/dist/{chunk-X6YRP5EC.js → chunk-KUJDV5QH.js} +5 -5
- package/dist/{chunk-PCIBCL26.js → chunk-KUX3OB6D.js} +7 -5
- package/dist/{chunk-PCIBCL26.js.map → chunk-KUX3OB6D.js.map} +1 -1
- package/dist/{chunk-OKCQNMO6.js → chunk-L742JPKZ.js} +6 -6
- package/dist/{chunk-P22XPNFW.js → chunk-L7CIOOBW.js} +2 -2
- package/dist/{chunk-QOHGWFAW.js → chunk-LWBCUYZW.js} +2 -2
- package/dist/{chunk-357ECVLE.js → chunk-MUM7IANK.js} +3 -3
- package/dist/{chunk-JFSUYGNE.js → chunk-MVMXZYXT.js} +2 -2
- package/dist/{chunk-3SWP2FYA.js → chunk-NA2NIJZI.js} +8 -8
- package/dist/{chunk-MOQ6OGKS.js → chunk-NKHRDYOR.js} +4 -4
- package/dist/{chunk-FKQCC4C5.js → chunk-NQKIUNW5.js} +2 -2
- package/dist/{chunk-SWFIXQF5.js → chunk-PT43Y56J.js} +6 -6
- package/dist/{chunk-MTTPHBIE.js → chunk-Q2PU57HC.js} +2 -2
- package/dist/{chunk-FLRLZ4XZ.js → chunk-Q7HZX3IF.js} +2 -2
- package/dist/{chunk-75WNTBZL.js → chunk-QIBVIOXO.js} +3 -3
- package/dist/{chunk-KQIDBIZL.js → chunk-QIZPZMUI.js} +2 -2
- package/dist/{chunk-VT4DTCK5.js → chunk-REDOOY2Q.js} +3 -3
- package/dist/chunk-REDOOY2Q.js.map +1 -0
- package/dist/{chunk-KZTPL7NL.js → chunk-RMF67KCG.js} +2 -2
- package/dist/{chunk-OEJ4R52I.js → chunk-RMS3NEA3.js} +2 -2
- package/dist/{chunk-VTTDPGEK.js → chunk-RRNRNANG.js} +9 -9
- package/dist/chunk-RTBJ5IOO.js +87 -0
- package/dist/chunk-RTBJ5IOO.js.map +1 -0
- package/dist/chunk-RXLYKVTF.js +17 -0
- package/dist/chunk-RXLYKVTF.js.map +1 -0
- package/dist/{chunk-XKA6UH5V.js → chunk-SFAWCTEM.js} +2 -2
- package/dist/{chunk-FYT3DXPN.js → chunk-SKGMN35F.js} +2 -2
- package/dist/{chunk-USKHHOIV.js → chunk-SL3JAAKN.js} +2 -2
- package/dist/chunk-SMH6SRX7.js +87 -0
- package/dist/chunk-SMH6SRX7.js.map +1 -0
- package/dist/{chunk-QJLOWGOU.js → chunk-SPXXX5E4.js} +12 -82
- package/dist/chunk-SPXXX5E4.js.map +1 -0
- package/dist/{chunk-JILOSL4O.js → chunk-SPYWXKJN.js} +3 -3
- package/dist/{chunk-4RUFYGWG.js → chunk-SZJ3DLZA.js} +2 -2
- package/dist/chunk-TFMM5DBB.js +20 -0
- package/dist/chunk-TFMM5DBB.js.map +1 -0
- package/dist/{chunk-O3SNM66K.js → chunk-TFR7DSOV.js} +2 -2
- package/dist/{chunk-DIVY2CJZ.js → chunk-TRGTKX5E.js} +3 -3
- package/dist/{chunk-JY4U6CYV.js → chunk-TUFM4UZP.js} +2 -2
- package/dist/{chunk-FRIVOR5N.js → chunk-U4FOQDY4.js} +5 -172
- package/dist/chunk-U4FOQDY4.js.map +1 -0
- package/dist/{chunk-DZPMKY3J.js → chunk-UGTBXF5U.js} +3 -3
- package/dist/{chunk-THNJ3IKU.js → chunk-ULUMAZ5S.js} +2 -2
- package/dist/{chunk-YHIAWECL.js → chunk-UXVWEX5L.js} +2 -2
- package/dist/{chunk-IAHDSFFA.js → chunk-UXWB3FPF.js} +10 -10
- package/dist/{chunk-NO272T7Q.js → chunk-V4PXLYWM.js} +2 -31
- package/dist/chunk-V4PXLYWM.js.map +1 -0
- package/dist/{chunk-GHADG5QZ.js → chunk-VTFVLCUH.js} +2 -2
- package/dist/{chunk-U3RMWOXY.js → chunk-VXANTWBJ.js} +3 -3
- package/dist/{chunk-5W5CEHLA.js → chunk-VXGSWL6L.js} +6 -6
- package/dist/{chunk-KHKKD62N.js → chunk-VYYM3MEN.js} +2 -16
- package/dist/chunk-VYYM3MEN.js.map +1 -0
- package/dist/{chunk-7YVSWPZB.js → chunk-WEQEYLCS.js} +7 -7
- package/dist/{chunk-TAJZ7GXO.js → chunk-X2DLENDQ.js} +3 -3
- package/dist/{chunk-2E2LT37H.js → chunk-XLMEZIAJ.js} +2 -2
- package/dist/{chunk-2MQ2D5OZ.js → chunk-XTXOCYOJ.js} +5 -5
- package/dist/{chunk-CWFH36SI.js → chunk-YSRUYAVU.js} +2 -2
- package/dist/{chunk-ZQGRZN5L.js → chunk-YYP7WSEB.js} +2 -2
- package/dist/{chunk-4U52PMEL.js → chunk-ZN4FD4PE.js} +4 -4
- package/dist/{chunk-AW4KTQA4.js → chunk-ZORTV6NH.js} +2 -2
- package/dist/{chunk-H5GVPOB4.js → chunk-ZVO4QVPD.js} +5 -5
- package/dist/classified/index.js +5 -6
- package/dist/{classified-marker-R37XW5PC.js → classified-marker-LI2SF2E4.js} +3 -5
- package/dist/{classified-marker-R37XW5PC.js.map → classified-marker-LI2SF2E4.js.map} +1 -1
- package/dist/collection-facade-4GRREZ6C.js +45 -0
- package/dist/computed-VPOKQK4N.js +10 -0
- package/dist/consent/index.js +9 -10
- package/dist/consent/index.js.map +1 -1
- package/dist/cover/index.js +9 -10
- package/dist/crdt/index.js +0 -1
- package/dist/crdt/index.js.map +1 -1
- package/dist/custody/index.js +12 -13
- package/dist/{dead-filter-GRT6RAML.js → dead-filter-TSWZQRR5.js} +2 -3
- package/dist/{dead-filter-GRT6RAML.js.map → dead-filter-TSWZQRR5.js.map} +1 -1
- package/dist/debug/index.js +1 -2
- package/dist/debug/index.js.map +1 -1
- package/dist/{delegation-6QRAYSK6.js → delegation-OVIFFPG4.js} +11 -12
- package/dist/{delegation-6QRAYSK6.js.map → delegation-OVIFFPG4.js.map} +1 -1
- package/dist/derivations/index.js +30 -16
- package/dist/derive-6O5SWQKN.js +21 -0
- package/dist/directory/index.js +10 -11
- package/dist/dispatch-S73TK3IY.js +302 -0
- package/dist/dispatch-S73TK3IY.js.map +1 -0
- package/dist/{dispatch-QCF7KPIP.js → dispatch-WC6X2M6C.js} +5 -7
- package/dist/{dispatch-QCF7KPIP.js.map → dispatch-WC6X2M6C.js.map} +1 -1
- package/dist/{enclave-OXZY3NOP.js → enclave-KJOTOH7X.js} +9 -10
- package/dist/executor-5NIMLSKZ.js +8 -0
- package/dist/executor-AQVXV5GZ.js +8 -0
- package/dist/executor-PUAO6AKJ.js +29 -0
- package/dist/export-accessible-72EQNBMR.js +22 -0
- package/dist/extract-partition-PUYNU3UF.js +37 -0
- package/dist/{fanout-sidecar-KGQCUJ7P.js → fanout-sidecar-WUFXNYP4.js} +9 -10
- package/dist/{fanout-sidecar-KGQCUJ7P.js.map → fanout-sidecar-WUFXNYP4.js.map} +1 -1
- package/dist/{fence-watcher-ZVSMLKQD.js → fence-watcher-U2PW6JU5.js} +1 -3
- package/dist/{fence-watcher-ZVSMLKQD.js.map → fence-watcher-U2PW6JU5.js.map} +1 -1
- package/dist/find-2ABFCZX4.js +10 -0
- package/dist/forget/index.js +9 -10
- package/dist/forget/index.js.map +1 -1
- package/dist/guards/index.js +4 -5
- package/dist/history/index.js +13 -14
- package/dist/history/index.js.map +1 -1
- package/dist/i18n/index.js +14 -15
- package/dist/i18n/index.js.map +1 -1
- package/dist/index.d.ts +20 -4
- package/dist/index.js +122 -115
- package/dist/index.js.map +1 -1
- package/dist/indexing/index.js +2 -3
- package/dist/indexing/index.js.map +1 -1
- package/dist/introspection/index.js +13 -13
- package/dist/issue-SIDORTSZ.js +18 -0
- package/dist/{json-schema-I22JCYCG.js → json-schema-V3M5MUCM.js} +1 -3
- package/dist/{json-schema-I22JCYCG.js.map → json-schema-V3M5MUCM.js.map} +1 -1
- package/dist/kernel/collection-config.d.ts +34 -0
- package/dist/kernel/collection.d.ts +11 -6
- package/dist/kernel/errors.d.ts +28 -0
- package/dist/kernel/match-pairs.d.ts +30 -0
- package/dist/kernel/types.d.ts +39 -0
- package/dist/lazy/index.js +3 -3
- package/dist/{ledger-ZAFULLAF.js → ledger-F33ZVMTK.js} +11 -12
- package/dist/liberate-LCDPNAG2.js +24 -0
- package/dist/link-set-FKNWAYKS.js +30 -0
- package/dist/{managed-secret-7OH7HKXV.js → managed-secret-PQYKSR6T.js} +10 -11
- package/dist/materialized-views/index.js +21 -21
- package/dist/{migrate-cek-QHZ75E6E.js → migrate-cek-5ENH64AA.js} +2 -3
- package/dist/{migrate-cek-QHZ75E6E.js.map → migrate-cek-5ENH64AA.js.map} +1 -1
- package/dist/money/index.js +4 -5
- package/dist/noydb-DUXZPKSN.js +90 -0
- package/dist/overlay-views/index.js +4 -5
- package/dist/periods/index.js +12 -13
- package/dist/pod/index.js +64 -60
- package/dist/{pod-handle-BLOI4IFY.js → pod-handle-Q736KYON.js} +10 -11
- package/dist/{pod-handle-BLOI4IFY.js.map → pod-handle-Q736KYON.js.map} +1 -1
- package/dist/policy/index.js +10 -11
- package/dist/port/to/index.d.ts +40 -0
- package/dist/portability/index.js +8 -9
- package/dist/portability/index.js.map +1 -1
- package/dist/{post-register-R33EKJQR.js → post-register-LNE2FE2A.js} +6 -7
- package/dist/{post-register-R33EKJQR.js.map → post-register-LNE2FE2A.js.map} +1 -1
- package/dist/{purge-scope-FGNNLWHD.js → purge-scope-4HEFPDOW.js} +1 -3
- package/dist/{purge-scope-FGNNLWHD.js.map → purge-scope-4HEFPDOW.js.map} +1 -1
- package/dist/query/index.js +3 -4
- package/dist/{read-only-facade-CHCKSEPD.js → read-only-facade-BIGO37U3.js} +1 -2
- package/dist/reduce/index.js +4 -5
- package/dist/reduce/index.js.map +1 -1
- package/dist/register-I2DZXGAR.js +31 -0
- package/dist/registry-23WF3TGH.js +8 -0
- package/dist/registry-4AYVUNXK.js +8 -0
- package/dist/registry-VSSQPIGF.js +18 -0
- package/dist/registry-YLEWMGAC.js +32 -0
- package/dist/request-withdrawal-KFQHEZ25.js +30 -0
- package/dist/{reveal-PI6ADRQU.js → reveal-67RDQRIN.js} +6 -7
- package/dist/{reveal-PI6ADRQU.js.map → reveal-67RDQRIN.js.map} +1 -1
- package/dist/revoke-DQDZAZZM.js +23 -0
- package/dist/satellites/index.js +1 -2
- package/dist/schema-update/index.js +2 -3
- package/dist/sealed-record/index.js +12 -13
- package/dist/sealed-record/index.js.map +1 -1
- package/dist/search/index.js +4 -5
- package/dist/{seed-CG7JMJNY.js → seed-G42JYN56.js} +12 -13
- package/dist/{seed-CG7JMJNY.js.map → seed-G42JYN56.js.map} +1 -1
- package/dist/sequence/index.js +9 -10
- package/dist/session/index.js +9 -10
- package/dist/session/index.js.map +1 -1
- package/dist/shadow/index.js +2 -3
- package/dist/shadow/index.js.map +1 -1
- package/dist/share-link/index.js +0 -1
- package/dist/share-link/index.js.map +1 -1
- package/dist/signer-WAMDZHEN.js +24 -0
- package/dist/snapshots/index.js +10 -11
- package/dist/snapshots/index.js.map +1 -1
- package/dist/{stale-HZR7745Y.js → stale-DDL7WQEZ.js} +10 -11
- package/dist/storage-FLR73HHF.js +22 -0
- package/dist/store/index.js +0 -1
- package/dist/{store-coordination-provider-MYIHSZXT.js → store-coordination-provider-MEQ2MJQG.js} +10 -11
- package/dist/{store-coordination-provider-MYIHSZXT.js.map → store-coordination-provider-MEQ2MJQG.js.map} +1 -1
- package/dist/sync/index.js +10 -11
- package/dist/sync/index.js.map +1 -1
- package/dist/team/index.js +15 -16
- package/dist/tiers/index.js +11 -12
- package/dist/to/index.js +2 -3
- package/dist/to/index.js.map +1 -1
- package/dist/transactions/index.js +3 -4
- package/dist/transactions/index.js.map +1 -1
- package/dist/{ulid-VQW6ERQN.js → ulid-4MKXG325.js} +1 -2
- package/dist/util/index.js +1 -2
- package/dist/util/index.js.map +1 -1
- package/dist/{vault-diff-FE5J35NJ.js → vault-diff-C6WUJFNP.js} +1 -2
- package/dist/vault-head/index.js +8 -9
- package/dist/vault-head/index.js.map +1 -1
- package/dist/{verify-R6CCBUA3.js → verify-KOV2G5D6.js} +5 -6
- package/dist/{verify-R6CCBUA3.js.map → verify-KOV2G5D6.js.map} +1 -1
- package/dist/walk-3UQBRMDV.js +21 -0
- package/dist/with-formula/derivations/dispatch.d.ts +16 -1
- package/dist/with-formula/derivations/registry.d.ts +20 -0
- package/dist/with-formula/derivations/trigger-match.d.ts +104 -0
- package/dist/with-formula/derivations/types.d.ts +61 -0
- package/dist/with-shape/introspection/behaviors.d.ts +7 -0
- package/dist/with-shape/introspection/describe.d.ts +10 -1
- package/dist/with-shape/introspection/field-meta.d.ts +86 -0
- package/dist/withdraw-accessible-EL5GXZBS.js +27 -0
- package/package.json +8 -3
- package/dist/api-GJQF7OAJ.js +0 -20
- package/dist/chunk-65ZYRK7O.js.map +0 -1
- package/dist/chunk-6L5IMNJX.js.map +0 -1
- package/dist/chunk-FRIVOR5N.js.map +0 -1
- package/dist/chunk-J6FXVDKC.js +0 -81
- package/dist/chunk-J6FXVDKC.js.map +0 -1
- package/dist/chunk-KHKKD62N.js.map +0 -1
- package/dist/chunk-NO272T7Q.js.map +0 -1
- package/dist/chunk-OQDHIAR2.js.map +0 -1
- package/dist/chunk-PZ5AY32C.js +0 -10
- package/dist/chunk-QJLOWGOU.js.map +0 -1
- package/dist/chunk-SW4TOSJL.js.map +0 -1
- package/dist/chunk-VT4DTCK5.js.map +0 -1
- package/dist/chunk-XJP66QEN.js +0 -344
- package/dist/chunk-XJP66QEN.js.map +0 -1
- package/dist/collection-facade-OPJ3EC4L.js +0 -45
- package/dist/computed-HW6IG5UH.js +0 -11
- package/dist/derive-AAIXSQIE.js +0 -22
- package/dist/dispatch-DR3XITEC.js +0 -194
- package/dist/dispatch-DR3XITEC.js.map +0 -1
- package/dist/executor-67NA4KPO.js +0 -29
- package/dist/executor-7JDP7UBK.js +0 -9
- package/dist/executor-CRH5OB4V.js +0 -9
- package/dist/export-accessible-K4GJAU7U.js +0 -23
- package/dist/extract-partition-YJFL5OKK.js +0 -38
- package/dist/find-SVZHMEQI.js +0 -11
- package/dist/issue-64N6OG7U.js +0 -19
- package/dist/liberate-XL6NSGOL.js +0 -25
- package/dist/link-set-LQI2IJX6.js +0 -31
- package/dist/noydb-SWUGPFBK.js +0 -86
- package/dist/register-AYBQNTM3.js +0 -32
- package/dist/registry-CQWWOBO4.js +0 -9
- package/dist/registry-JCZ4BNLV.js +0 -18
- package/dist/registry-JFFENZ44.js +0 -9
- package/dist/registry-ZA4HACYR.js +0 -19
- package/dist/request-withdrawal-7IKUIAEB.js +0 -31
- package/dist/revoke-PUJKRYJF.js +0 -24
- package/dist/signer-5TA7FUC3.js +0 -25
- package/dist/storage-J2QHNJCB.js +0 -23
- package/dist/walk-3PA4ZOKS.js +0 -21
- package/dist/withdraw-accessible-62VI4W7D.js +0 -28
- package/dist/withdraw-accessible-62VI4W7D.js.map +0 -1
- package/dist/zod-HAJM7LMS.js +0 -14763
- package/dist/zod-HAJM7LMS.js.map +0 -1
- /package/dist/{api-GJQF7OAJ.js.map → api-TXFOVOXX.js.map} +0 -0
- /package/dist/{chunk-5UKIZIO3.js.map → chunk-2577DKXB.js.map} +0 -0
- /package/dist/{chunk-LUVGSKXE.js.map → chunk-2N4GY74U.js.map} +0 -0
- /package/dist/{chunk-I5LSKXT6.js.map → chunk-2Y4IMKA6.js.map} +0 -0
- /package/dist/{chunk-7XT7KZTN.js.map → chunk-3RCJJBNR.js.map} +0 -0
- /package/dist/{chunk-GM4IM7TC.js.map → chunk-453F654R.js.map} +0 -0
- /package/dist/{chunk-JUBWUJY5.js.map → chunk-4GVM6QZA.js.map} +0 -0
- /package/dist/{chunk-2DGBRE4K.js.map → chunk-4OZNXTO4.js.map} +0 -0
- /package/dist/{chunk-P2RJAVMR.js.map → chunk-5VCRVKOZ.js.map} +0 -0
- /package/dist/{chunk-RCONOOVF.js.map → chunk-5WDXHNSW.js.map} +0 -0
- /package/dist/{chunk-Q2OAAREU.js.map → chunk-6GMZ7HEE.js.map} +0 -0
- /package/dist/{chunk-TQGT5BZE.js.map → chunk-6I2RQCET.js.map} +0 -0
- /package/dist/{chunk-P7KJME6C.js.map → chunk-6YXCPL4T.js.map} +0 -0
- /package/dist/{chunk-DOPZWTMJ.js.map → chunk-77K4PG6P.js.map} +0 -0
- /package/dist/{chunk-LAI7ENPW.js.map → chunk-7MG2LHO5.js.map} +0 -0
- /package/dist/{chunk-HOIWW2LV.js.map → chunk-7V4TP3AF.js.map} +0 -0
- /package/dist/{chunk-GKOJR53Y.js.map → chunk-ANATMFIO.js.map} +0 -0
- /package/dist/{chunk-MU74BYOD.js.map → chunk-ANSIZYEG.js.map} +0 -0
- /package/dist/{chunk-IS5LFHV2.js.map → chunk-AO42KJO6.js.map} +0 -0
- /package/dist/{chunk-RPX2H2OL.js.map → chunk-BLN54W3L.js.map} +0 -0
- /package/dist/{chunk-HS3LEVT4.js.map → chunk-BM5TWITZ.js.map} +0 -0
- /package/dist/{chunk-JRWLUWDM.js.map → chunk-BOET4NA4.js.map} +0 -0
- /package/dist/{chunk-XGXVPCYW.js.map → chunk-BOWNCWZT.js.map} +0 -0
- /package/dist/{chunk-5EC7X5QA.js.map → chunk-BSFNRLK2.js.map} +0 -0
- /package/dist/{chunk-UTFY6W6X.js.map → chunk-BZ3534YM.js.map} +0 -0
- /package/dist/{chunk-HLFLJCDX.js.map → chunk-CHJBLCOG.js.map} +0 -0
- /package/dist/{chunk-OLUTCM23.js.map → chunk-CPWQB3N5.js.map} +0 -0
- /package/dist/{chunk-3GIA3HJ2.js.map → chunk-DGOZ4UZD.js.map} +0 -0
- /package/dist/{chunk-FPN5D4JX.js.map → chunk-ELNXJMGB.js.map} +0 -0
- /package/dist/{chunk-NMDMSHBF.js.map → chunk-EQEYOJBM.js.map} +0 -0
- /package/dist/{chunk-RHTPGS56.js.map → chunk-EYBQEIUY.js.map} +0 -0
- /package/dist/{chunk-Q2ZN5DWZ.js.map → chunk-FAHMLERK.js.map} +0 -0
- /package/dist/{chunk-MENI33ZV.js.map → chunk-FMZY5Q6L.js.map} +0 -0
- /package/dist/{chunk-FZWAGG5T.js.map → chunk-FXBIP2WD.js.map} +0 -0
- /package/dist/{chunk-K432FT7T.js.map → chunk-GPEQUXHL.js.map} +0 -0
- /package/dist/{chunk-DNMTN46H.js.map → chunk-GY4WYNNG.js.map} +0 -0
- /package/dist/{chunk-MQPHKJ74.js.map → chunk-J6FXAEUG.js.map} +0 -0
- /package/dist/{chunk-PV7XXAXK.js.map → chunk-JBDFMYKQ.js.map} +0 -0
- /package/dist/{chunk-IZTU6RKH.js.map → chunk-JMGDHKQF.js.map} +0 -0
- /package/dist/{chunk-AHIIBDNH.js.map → chunk-K6LHRFBL.js.map} +0 -0
- /package/dist/{chunk-FN26SFGH.js.map → chunk-K7NTTA6P.js.map} +0 -0
- /package/dist/{chunk-MV2OEK3K.js.map → chunk-KG7TZKZG.js.map} +0 -0
- /package/dist/{chunk-5NKHCJU5.js.map → chunk-KJIMGIWO.js.map} +0 -0
- /package/dist/{chunk-ZB2K3FV7.js.map → chunk-KTFRCC5C.js.map} +0 -0
- /package/dist/{chunk-X6YRP5EC.js.map → chunk-KUJDV5QH.js.map} +0 -0
- /package/dist/{chunk-OKCQNMO6.js.map → chunk-L742JPKZ.js.map} +0 -0
- /package/dist/{chunk-P22XPNFW.js.map → chunk-L7CIOOBW.js.map} +0 -0
- /package/dist/{chunk-QOHGWFAW.js.map → chunk-LWBCUYZW.js.map} +0 -0
- /package/dist/{chunk-357ECVLE.js.map → chunk-MUM7IANK.js.map} +0 -0
- /package/dist/{chunk-JFSUYGNE.js.map → chunk-MVMXZYXT.js.map} +0 -0
- /package/dist/{chunk-3SWP2FYA.js.map → chunk-NA2NIJZI.js.map} +0 -0
- /package/dist/{chunk-MOQ6OGKS.js.map → chunk-NKHRDYOR.js.map} +0 -0
- /package/dist/{chunk-FKQCC4C5.js.map → chunk-NQKIUNW5.js.map} +0 -0
- /package/dist/{chunk-SWFIXQF5.js.map → chunk-PT43Y56J.js.map} +0 -0
- /package/dist/{chunk-MTTPHBIE.js.map → chunk-Q2PU57HC.js.map} +0 -0
- /package/dist/{chunk-FLRLZ4XZ.js.map → chunk-Q7HZX3IF.js.map} +0 -0
- /package/dist/{chunk-75WNTBZL.js.map → chunk-QIBVIOXO.js.map} +0 -0
- /package/dist/{chunk-KQIDBIZL.js.map → chunk-QIZPZMUI.js.map} +0 -0
- /package/dist/{chunk-KZTPL7NL.js.map → chunk-RMF67KCG.js.map} +0 -0
- /package/dist/{chunk-OEJ4R52I.js.map → chunk-RMS3NEA3.js.map} +0 -0
- /package/dist/{chunk-VTTDPGEK.js.map → chunk-RRNRNANG.js.map} +0 -0
- /package/dist/{chunk-XKA6UH5V.js.map → chunk-SFAWCTEM.js.map} +0 -0
- /package/dist/{chunk-FYT3DXPN.js.map → chunk-SKGMN35F.js.map} +0 -0
- /package/dist/{chunk-USKHHOIV.js.map → chunk-SL3JAAKN.js.map} +0 -0
- /package/dist/{chunk-JILOSL4O.js.map → chunk-SPYWXKJN.js.map} +0 -0
- /package/dist/{chunk-4RUFYGWG.js.map → chunk-SZJ3DLZA.js.map} +0 -0
- /package/dist/{chunk-O3SNM66K.js.map → chunk-TFR7DSOV.js.map} +0 -0
- /package/dist/{chunk-DIVY2CJZ.js.map → chunk-TRGTKX5E.js.map} +0 -0
- /package/dist/{chunk-JY4U6CYV.js.map → chunk-TUFM4UZP.js.map} +0 -0
- /package/dist/{chunk-DZPMKY3J.js.map → chunk-UGTBXF5U.js.map} +0 -0
- /package/dist/{chunk-THNJ3IKU.js.map → chunk-ULUMAZ5S.js.map} +0 -0
- /package/dist/{chunk-YHIAWECL.js.map → chunk-UXVWEX5L.js.map} +0 -0
- /package/dist/{chunk-IAHDSFFA.js.map → chunk-UXWB3FPF.js.map} +0 -0
- /package/dist/{chunk-GHADG5QZ.js.map → chunk-VTFVLCUH.js.map} +0 -0
- /package/dist/{chunk-U3RMWOXY.js.map → chunk-VXANTWBJ.js.map} +0 -0
- /package/dist/{chunk-5W5CEHLA.js.map → chunk-VXGSWL6L.js.map} +0 -0
- /package/dist/{chunk-7YVSWPZB.js.map → chunk-WEQEYLCS.js.map} +0 -0
- /package/dist/{chunk-TAJZ7GXO.js.map → chunk-X2DLENDQ.js.map} +0 -0
- /package/dist/{chunk-2E2LT37H.js.map → chunk-XLMEZIAJ.js.map} +0 -0
- /package/dist/{chunk-2MQ2D5OZ.js.map → chunk-XTXOCYOJ.js.map} +0 -0
- /package/dist/{chunk-CWFH36SI.js.map → chunk-YSRUYAVU.js.map} +0 -0
- /package/dist/{chunk-ZQGRZN5L.js.map → chunk-YYP7WSEB.js.map} +0 -0
- /package/dist/{chunk-4U52PMEL.js.map → chunk-ZN4FD4PE.js.map} +0 -0
- /package/dist/{chunk-AW4KTQA4.js.map → chunk-ZORTV6NH.js.map} +0 -0
- /package/dist/{chunk-H5GVPOB4.js.map → chunk-ZVO4QVPD.js.map} +0 -0
- /package/dist/{chunk-PZ5AY32C.js.map → collection-facade-4GRREZ6C.js.map} +0 -0
- /package/dist/{collection-facade-OPJ3EC4L.js.map → computed-VPOKQK4N.js.map} +0 -0
- /package/dist/{computed-HW6IG5UH.js.map → derive-6O5SWQKN.js.map} +0 -0
- /package/dist/{derive-AAIXSQIE.js.map → enclave-KJOTOH7X.js.map} +0 -0
- /package/dist/{enclave-OXZY3NOP.js.map → executor-5NIMLSKZ.js.map} +0 -0
- /package/dist/{executor-67NA4KPO.js.map → executor-AQVXV5GZ.js.map} +0 -0
- /package/dist/{executor-7JDP7UBK.js.map → executor-PUAO6AKJ.js.map} +0 -0
- /package/dist/{executor-CRH5OB4V.js.map → export-accessible-72EQNBMR.js.map} +0 -0
- /package/dist/{export-accessible-K4GJAU7U.js.map → extract-partition-PUYNU3UF.js.map} +0 -0
- /package/dist/{extract-partition-YJFL5OKK.js.map → find-2ABFCZX4.js.map} +0 -0
- /package/dist/{find-SVZHMEQI.js.map → issue-SIDORTSZ.js.map} +0 -0
- /package/dist/{issue-64N6OG7U.js.map → ledger-F33ZVMTK.js.map} +0 -0
- /package/dist/{ledger-ZAFULLAF.js.map → liberate-LCDPNAG2.js.map} +0 -0
- /package/dist/{liberate-XL6NSGOL.js.map → link-set-FKNWAYKS.js.map} +0 -0
- /package/dist/{link-set-LQI2IJX6.js.map → managed-secret-PQYKSR6T.js.map} +0 -0
- /package/dist/{managed-secret-7OH7HKXV.js.map → noydb-DUXZPKSN.js.map} +0 -0
- /package/dist/{noydb-SWUGPFBK.js.map → read-only-facade-BIGO37U3.js.map} +0 -0
- /package/dist/{read-only-facade-CHCKSEPD.js.map → register-I2DZXGAR.js.map} +0 -0
- /package/dist/{register-AYBQNTM3.js.map → registry-23WF3TGH.js.map} +0 -0
- /package/dist/{registry-CQWWOBO4.js.map → registry-4AYVUNXK.js.map} +0 -0
- /package/dist/{registry-JCZ4BNLV.js.map → registry-VSSQPIGF.js.map} +0 -0
- /package/dist/{registry-JFFENZ44.js.map → registry-YLEWMGAC.js.map} +0 -0
- /package/dist/{registry-ZA4HACYR.js.map → request-withdrawal-KFQHEZ25.js.map} +0 -0
- /package/dist/{request-withdrawal-7IKUIAEB.js.map → revoke-DQDZAZZM.js.map} +0 -0
- /package/dist/{revoke-PUJKRYJF.js.map → signer-WAMDZHEN.js.map} +0 -0
- /package/dist/{signer-5TA7FUC3.js.map → stale-DDL7WQEZ.js.map} +0 -0
- /package/dist/{stale-HZR7745Y.js.map → storage-FLR73HHF.js.map} +0 -0
- /package/dist/{storage-J2QHNJCB.js.map → ulid-4MKXG325.js.map} +0 -0
- /package/dist/{ulid-VQW6ERQN.js.map → vault-diff-C6WUJFNP.js.map} +0 -0
- /package/dist/{vault-diff-FE5J35NJ.js.map → walk-3UQBRMDV.js.map} +0 -0
- /package/dist/{walk-3PA4ZOKS.js.map → withdraw-accessible-EL5GXZBS.js.map} +0 -0
|
@@ -0,0 +1,302 @@
|
|
|
1
|
+
import {
|
|
2
|
+
hopCollections,
|
|
3
|
+
resolveTuple,
|
|
4
|
+
sameTuple,
|
|
5
|
+
tupleFromIntermediate
|
|
6
|
+
} from "./chunk-FFWI7UH7.js";
|
|
7
|
+
import {
|
|
8
|
+
markStale
|
|
9
|
+
} from "./chunk-SMH6SRX7.js";
|
|
10
|
+
import "./chunk-TFMM5DBB.js";
|
|
11
|
+
import {
|
|
12
|
+
putDerivedOutput,
|
|
13
|
+
selfWriteFieldEqual
|
|
14
|
+
} from "./chunk-CARABLSQ.js";
|
|
15
|
+
import "./chunk-U4FOQDY4.js";
|
|
16
|
+
import "./chunk-5D2ALSM5.js";
|
|
17
|
+
import "./chunk-6I2RQCET.js";
|
|
18
|
+
import "./chunk-TRGTKX5E.js";
|
|
19
|
+
import "./chunk-UXVWEX5L.js";
|
|
20
|
+
import "./chunk-BOET4NA4.js";
|
|
21
|
+
import "./chunk-77K4PG6P.js";
|
|
22
|
+
import "./chunk-SZJ3DLZA.js";
|
|
23
|
+
import "./chunk-BOWNCWZT.js";
|
|
24
|
+
import "./chunk-YSRUYAVU.js";
|
|
25
|
+
import "./chunk-RMF67KCG.js";
|
|
26
|
+
import "./chunk-LP7BEXCT.js";
|
|
27
|
+
import "./chunk-SL3JAAKN.js";
|
|
28
|
+
import "./chunk-7MG7SJT7.js";
|
|
29
|
+
import {
|
|
30
|
+
DerivationCapExceededError
|
|
31
|
+
} from "./chunk-7O3Y4PPD.js";
|
|
32
|
+
|
|
33
|
+
// src/with-formula/derivations/dispatch.ts
|
|
34
|
+
async function dispatchArrayDerivationsOnDelete(ctx, id, eraseRecordShapeToo = false) {
|
|
35
|
+
const { derivationSource, collectionName, adapter, vault, getDEK, storeCiphertext } = ctx;
|
|
36
|
+
const strategies = derivationSource.registry().strategiesForSource(collectionName);
|
|
37
|
+
if (strategies.length === 0) return 0;
|
|
38
|
+
const { loadFanoutSidecar, deleteFanoutSidecar } = await import("./fanout-sidecar-WUFXNYP4.js");
|
|
39
|
+
const txCtx = derivationSource.getActiveTxContext();
|
|
40
|
+
let erased = 0;
|
|
41
|
+
for (const { spec } of strategies) {
|
|
42
|
+
for (const [outputKey, outSpec] of Object.entries(spec.outputs)) {
|
|
43
|
+
if (outSpec.shape === "record") {
|
|
44
|
+
if (eraseRecordShapeToo && spec.source === collectionName && outSpec.collection !== collectionName) {
|
|
45
|
+
if (await derivationSource.getCollection(outSpec.collection)._internalDelete(id, txCtx)) erased += 1;
|
|
46
|
+
}
|
|
47
|
+
continue;
|
|
48
|
+
}
|
|
49
|
+
const sidecar = await loadFanoutSidecar(adapter, vault, spec.source, id, outputKey, getDEK, storeCiphertext);
|
|
50
|
+
if (!sidecar) continue;
|
|
51
|
+
const outputCollection = derivationSource.getCollection(outSpec.collection);
|
|
52
|
+
for (const derivedId of sidecar.keys) {
|
|
53
|
+
if (await outputCollection._internalDelete(derivedId, txCtx)) erased += 1;
|
|
54
|
+
}
|
|
55
|
+
await deleteFanoutSidecar(adapter, vault, spec.source, id, outputKey);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
return erased;
|
|
59
|
+
}
|
|
60
|
+
async function dispatchDerivations(ctx, id, record, version, wave, prior) {
|
|
61
|
+
const { derivationSource, collectionName, via, recomputeRollup } = ctx;
|
|
62
|
+
const incoming = via ? via.canonicalizeStored(record) : record;
|
|
63
|
+
if (incoming && typeof incoming === "object" && "_derivedFrom" in incoming) return;
|
|
64
|
+
const canonicalPrior = prior != null ? via ? via.canonicalizeStored(prior) : prior : prior;
|
|
65
|
+
const registry = derivationSource.registry();
|
|
66
|
+
const strategies = registry.strategiesForSource(collectionName);
|
|
67
|
+
if (strategies.length === 0) return;
|
|
68
|
+
let executorClass = null;
|
|
69
|
+
for (const { spec, strategyHash, triggers } of strategies) {
|
|
70
|
+
const mode = typeof spec.lifecycle === "string" ? spec.lifecycle : spec.lifecycle.mode;
|
|
71
|
+
if (spec.rollup) {
|
|
72
|
+
if (mode !== "eager") continue;
|
|
73
|
+
const asParentId = (v) => typeof v === "string" || typeof v === "number" ? String(v) : null;
|
|
74
|
+
let parentId;
|
|
75
|
+
let oldParentId = null;
|
|
76
|
+
if (collectionName === spec.rollup.from) {
|
|
77
|
+
parentId = asParentId(incoming[spec.rollup.key]);
|
|
78
|
+
const priorKey = canonicalPrior != null ? asParentId(canonicalPrior[spec.rollup.key]) : null;
|
|
79
|
+
if (priorKey !== null && priorKey !== parentId) oldParentId = priorKey;
|
|
80
|
+
} else {
|
|
81
|
+
parentId = id;
|
|
82
|
+
}
|
|
83
|
+
if (parentId !== null) await recomputeRollup(spec, parentId, { collection: collectionName, id }, wave);
|
|
84
|
+
if (oldParentId !== null) await recomputeRollup(spec, oldParentId, { collection: collectionName, id }, wave);
|
|
85
|
+
continue;
|
|
86
|
+
}
|
|
87
|
+
const isSource = spec.source === collectionName;
|
|
88
|
+
const isSibling = !isSource && (spec.sources?.includes(collectionName) ?? false);
|
|
89
|
+
const triggerEntries = !isSource && !isSibling ? triggers.filter((t) => t.collection === collectionName) : [];
|
|
90
|
+
const hopEntries = !isSource && !isSibling ? triggers.filter((t) => hopCollections(t.match).includes(collectionName)) : [];
|
|
91
|
+
const runs = [];
|
|
92
|
+
if (isSource) {
|
|
93
|
+
runs.push({ input: { ...incoming, id }, base: incoming, runId: id, version });
|
|
94
|
+
} else if (isSibling) {
|
|
95
|
+
const p = await derivationSource.getCollection(spec.source).get(id);
|
|
96
|
+
if (p !== null && p !== void 0) {
|
|
97
|
+
const raw = await derivationSource.getCollection(spec.source)._getStoredRecord(id);
|
|
98
|
+
runs.push({ input: { ...p, id }, base: raw ?? p, runId: id, version: 0 });
|
|
99
|
+
}
|
|
100
|
+
} else if (triggerEntries.length > 0 || hopEntries.length > 0) {
|
|
101
|
+
const srcColl = derivationSource.getCollection(spec.source);
|
|
102
|
+
const matched = /* @__PURE__ */ new Set();
|
|
103
|
+
const lookup = async (coll, field, value) => {
|
|
104
|
+
const c = derivationSource.getCollection(coll);
|
|
105
|
+
if (field === "id") return c._getStoredRecord(value);
|
|
106
|
+
const ids = await c._findMatchingCompositeIds([{ field, value }]);
|
|
107
|
+
const first = ids[0];
|
|
108
|
+
return first === void 0 ? null : c._getStoredRecord(first);
|
|
109
|
+
};
|
|
110
|
+
for (const trigger of hopEntries) {
|
|
111
|
+
const tuples = [tupleFromIntermediate(trigger.match, collectionName, incoming)];
|
|
112
|
+
if (canonicalPrior != null) {
|
|
113
|
+
const old = tupleFromIntermediate(trigger.match, collectionName, canonicalPrior);
|
|
114
|
+
if (!sameTuple(old, tuples[0])) tuples.push(old);
|
|
115
|
+
}
|
|
116
|
+
const ids = /* @__PURE__ */ new Set();
|
|
117
|
+
for (const tuple of tuples) {
|
|
118
|
+
if (tuple === null) continue;
|
|
119
|
+
for (const sid of await srcColl._findMatchingCompositeIds(tuple)) ids.add(sid);
|
|
120
|
+
}
|
|
121
|
+
if (trigger.maxFanout !== void 0 && ids.size > trigger.maxFanout) {
|
|
122
|
+
throw new DerivationCapExceededError(
|
|
123
|
+
`triggerBy hop ${collectionName}\u2192${spec.source} [${trigger.match.map((p) => p.to).join(",")}]`,
|
|
124
|
+
ids.size,
|
|
125
|
+
trigger.maxFanout
|
|
126
|
+
);
|
|
127
|
+
}
|
|
128
|
+
for (const sid of ids) matched.add(sid);
|
|
129
|
+
}
|
|
130
|
+
for (const trigger of triggerEntries) {
|
|
131
|
+
const tuples = [await resolveTuple(trigger.match, id, incoming, lookup)];
|
|
132
|
+
if (canonicalPrior != null && trigger.match.some((p) => p.from !== "id")) {
|
|
133
|
+
const old = await resolveTuple(trigger.match, id, canonicalPrior, lookup);
|
|
134
|
+
if (!sameTuple(old, tuples[0])) tuples.push(old);
|
|
135
|
+
}
|
|
136
|
+
const ids = /* @__PURE__ */ new Set();
|
|
137
|
+
for (const tuple of tuples) {
|
|
138
|
+
if (tuple === null) continue;
|
|
139
|
+
for (const sid of await srcColl._findMatchingCompositeIds(tuple)) ids.add(sid);
|
|
140
|
+
}
|
|
141
|
+
if (trigger.maxFanout !== void 0 && ids.size > trigger.maxFanout) {
|
|
142
|
+
throw new DerivationCapExceededError(
|
|
143
|
+
`triggerBy ${collectionName}\u2192${spec.source} [${trigger.match.map((p) => p.to).join(",")}]`,
|
|
144
|
+
ids.size,
|
|
145
|
+
trigger.maxFanout
|
|
146
|
+
);
|
|
147
|
+
}
|
|
148
|
+
for (const sid of ids) matched.add(sid);
|
|
149
|
+
}
|
|
150
|
+
for (const sid of matched) {
|
|
151
|
+
const raw = await srcColl._getStoredRecord(sid);
|
|
152
|
+
if (raw === null) continue;
|
|
153
|
+
runs.push({ input: { ...raw, id: sid }, base: raw, runId: sid, version: 0 });
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
if (runs.length === 0) continue;
|
|
157
|
+
if (mode !== "eager") {
|
|
158
|
+
for (const run of runs) await markStale(registry, spec, run.runId);
|
|
159
|
+
continue;
|
|
160
|
+
}
|
|
161
|
+
if (executorClass === null) {
|
|
162
|
+
;
|
|
163
|
+
({ DerivationExecutor: executorClass } = await import("./executor-5NIMLSKZ.js"));
|
|
164
|
+
}
|
|
165
|
+
for (const run of runs) await runOne(ctx, spec, strategyHash, executorClass, run);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
async function runOne(ctx, spec, strategyHash, executorClass, run) {
|
|
169
|
+
const { derivationSource, adapter, vault, getDEK, storeCiphertext, dispatchCtx, trackPut } = ctx;
|
|
170
|
+
const execCtx = { vault: derivationSource.getReadOnlyFacade() };
|
|
171
|
+
const outCtx = dispatchCtx({ collection: spec.source, id: run.runId });
|
|
172
|
+
const result = await executorClass.run(spec, run.input, run.version, strategyHash, execCtx);
|
|
173
|
+
for (const key of Object.keys(spec.outputs)) {
|
|
174
|
+
const out = result.outputs[key];
|
|
175
|
+
if (!out) continue;
|
|
176
|
+
if (out.kind === "failed") {
|
|
177
|
+
const err = out.error;
|
|
178
|
+
if (spec.strict) throw err;
|
|
179
|
+
console.warn(`[derivation] output "${key}" for source "${spec.source}" id="${run.runId}" failed:`, err);
|
|
180
|
+
continue;
|
|
181
|
+
}
|
|
182
|
+
const outSpec = spec.outputs[key];
|
|
183
|
+
if (!outSpec) continue;
|
|
184
|
+
const outputCollection = derivationSource.getCollection(outSpec.collection);
|
|
185
|
+
const txCtx = derivationSource.getActiveTxContext();
|
|
186
|
+
if (out.kind === "array") {
|
|
187
|
+
const { loadFanoutSidecar, saveFanoutSidecar } = await import("./fanout-sidecar-WUFXNYP4.js");
|
|
188
|
+
const prior = await loadFanoutSidecar(adapter, vault, spec.source, run.runId, key, getDEK, storeCiphertext);
|
|
189
|
+
const prevKeys = new Set(prior?.keys ?? []);
|
|
190
|
+
const newKeysList = out.entries.map((e) => e.key);
|
|
191
|
+
const newKeysSet = new Set(newKeysList);
|
|
192
|
+
for (const k of prevKeys) {
|
|
193
|
+
if (newKeysSet.has(k)) continue;
|
|
194
|
+
await outputCollection._internalDelete(k, txCtx);
|
|
195
|
+
}
|
|
196
|
+
for (const entry of out.entries) {
|
|
197
|
+
if (txCtx !== null) {
|
|
198
|
+
trackPut(txCtx, outSpec.collection, entry.key, await adapter.get(vault, outSpec.collection, entry.key));
|
|
199
|
+
}
|
|
200
|
+
await putDerivedOutput(outputCollection, entry.key, entry.value, outCtx, { source: "derived" });
|
|
201
|
+
}
|
|
202
|
+
await saveFanoutSidecar(adapter, vault, {
|
|
203
|
+
source: spec.source,
|
|
204
|
+
sourceId: run.runId,
|
|
205
|
+
outputKey: key,
|
|
206
|
+
outputCollection: outSpec.collection,
|
|
207
|
+
keys: newKeysList
|
|
208
|
+
}, getDEK, storeCiphertext);
|
|
209
|
+
continue;
|
|
210
|
+
}
|
|
211
|
+
if (out.skipped === true) {
|
|
212
|
+
await outputCollection._internalDelete(run.runId, txCtx);
|
|
213
|
+
continue;
|
|
214
|
+
}
|
|
215
|
+
if (outSpec.shape === "record" && outSpec.denorm !== void 0 && outSpec.collection === spec.source) {
|
|
216
|
+
const value = out.value;
|
|
217
|
+
const patched = { ...run.base };
|
|
218
|
+
let changed = false;
|
|
219
|
+
for (const f of outSpec.denorm) {
|
|
220
|
+
if (!selfWriteFieldEqual(run.base[f], value[f])) {
|
|
221
|
+
patched[f] = value[f];
|
|
222
|
+
changed = true;
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
if (!changed) continue;
|
|
226
|
+
if (txCtx !== null) {
|
|
227
|
+
trackPut(txCtx, outSpec.collection, run.runId, await adapter.get(vault, outSpec.collection, run.runId));
|
|
228
|
+
}
|
|
229
|
+
await putDerivedOutput(outputCollection, run.runId, patched, outCtx, { source: "derived" });
|
|
230
|
+
continue;
|
|
231
|
+
}
|
|
232
|
+
if (txCtx !== null) {
|
|
233
|
+
trackPut(txCtx, outSpec.collection, run.runId, await adapter.get(vault, outSpec.collection, run.runId));
|
|
234
|
+
}
|
|
235
|
+
await putDerivedOutput(outputCollection, run.runId, out.value, outCtx, { source: "derived" });
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
async function dispatchTriggerDerivationsOnDelete(ctx, id, deleted) {
|
|
239
|
+
const { derivationSource, collectionName } = ctx;
|
|
240
|
+
const registry = derivationSource.registry();
|
|
241
|
+
const strategies = registry.strategiesForSource(collectionName);
|
|
242
|
+
if (strategies.length === 0) return;
|
|
243
|
+
let executorClass = null;
|
|
244
|
+
for (const { spec, strategyHash, triggers } of strategies) {
|
|
245
|
+
if (spec.rollup) continue;
|
|
246
|
+
if (spec.source === collectionName) continue;
|
|
247
|
+
if (spec.sources?.includes(collectionName)) continue;
|
|
248
|
+
const entries = triggers.filter((t) => t.collection === collectionName);
|
|
249
|
+
const hopEntries = triggers.filter((t) => hopCollections(t.match).includes(collectionName));
|
|
250
|
+
if (entries.length === 0 && hopEntries.length === 0) continue;
|
|
251
|
+
const mode = typeof spec.lifecycle === "string" ? spec.lifecycle : spec.lifecycle.mode;
|
|
252
|
+
const srcColl = derivationSource.getCollection(spec.source);
|
|
253
|
+
const matched = /* @__PURE__ */ new Set();
|
|
254
|
+
const lookup = async (coll, field, value) => {
|
|
255
|
+
const c = derivationSource.getCollection(coll);
|
|
256
|
+
if (field === "id") return c._getStoredRecord(value);
|
|
257
|
+
const found = await c._findMatchingCompositeIds([{ field, value }]);
|
|
258
|
+
const first = found[0];
|
|
259
|
+
return first === void 0 ? null : c._getStoredRecord(first);
|
|
260
|
+
};
|
|
261
|
+
const cap = (trigger, n, label) => {
|
|
262
|
+
if (trigger.maxFanout !== void 0 && n > trigger.maxFanout) {
|
|
263
|
+
throw new DerivationCapExceededError(
|
|
264
|
+
`triggerBy ${label} ${collectionName}\u2192${spec.source} [${trigger.match.map((p) => p.to).join(",")}] (delete)`,
|
|
265
|
+
n,
|
|
266
|
+
trigger.maxFanout
|
|
267
|
+
);
|
|
268
|
+
}
|
|
269
|
+
};
|
|
270
|
+
for (const trigger of entries) {
|
|
271
|
+
const tuple = await resolveTuple(trigger.match, id, deleted, lookup);
|
|
272
|
+
if (tuple === null) continue;
|
|
273
|
+
const ids = await srcColl._findMatchingCompositeIds(tuple);
|
|
274
|
+
cap(trigger, ids.length, "");
|
|
275
|
+
for (const sid of ids) matched.add(sid);
|
|
276
|
+
}
|
|
277
|
+
for (const trigger of hopEntries) {
|
|
278
|
+
const tuple = tupleFromIntermediate(trigger.match, collectionName, deleted);
|
|
279
|
+
if (tuple === null) continue;
|
|
280
|
+
const ids = await srcColl._findMatchingCompositeIds(tuple);
|
|
281
|
+
cap(trigger, ids.length, "hop");
|
|
282
|
+
for (const sid of ids) matched.add(sid);
|
|
283
|
+
}
|
|
284
|
+
if (matched.size === 0) continue;
|
|
285
|
+
if (mode !== "eager") {
|
|
286
|
+
for (const sid of matched) await markStale(registry, spec, sid);
|
|
287
|
+
continue;
|
|
288
|
+
}
|
|
289
|
+
if (executorClass === null) ({ DerivationExecutor: executorClass } = await import("./executor-5NIMLSKZ.js"));
|
|
290
|
+
for (const sid of matched) {
|
|
291
|
+
const raw = await srcColl._getStoredRecord(sid);
|
|
292
|
+
if (raw === null) continue;
|
|
293
|
+
await runOne(ctx, spec, strategyHash, executorClass, { input: { ...raw, id: sid }, base: raw, runId: sid, version: 0 });
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
export {
|
|
298
|
+
dispatchArrayDerivationsOnDelete,
|
|
299
|
+
dispatchDerivations,
|
|
300
|
+
dispatchTriggerDerivationsOnDelete
|
|
301
|
+
};
|
|
302
|
+
//# sourceMappingURL=dispatch-S73TK3IY.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/with-formula/derivations/dispatch.ts"],"sourcesContent":["/**\n * Derivation dispatch, lifted out of the kernel spine (#842 part b).\n *\n * `Collection` carried ~380 lines of dispatch logic that belongs to the\n * derivation service, not to the always-on kernel. These are free functions\n * taking an explicit context so the spine keeps only a thin delegator.\n *\n * ## How the spine reaches this module\n *\n * By dynamic `import()`, never a static one. `check-architecture.mjs`'s\n * `port-layering` check forbids the spine from statically importing a\n * `with-*` service; `collection.ts` is grandfathered for ten\n * `with-formula/*` specifiers, but that list is frozen per file and a new\n * one is a violation. A dynamic import is the sanctioned S4 gate recipe, and\n * it keeps this chunk out of the floor bundle for consumers who never fire a\n * derivation.\n *\n * The `Collection` type reference below points back at the spine. That is\n * inward (service → kernel) and so allowed, and it is TYPE-ONLY — erased at\n * build, so no runtime cycle exists.\n *\n * @internal\n */\n\nimport type { NoydbStore } from '../../kernel/types.js'\nimport type { TxContext } from '../../with-commit/tx/transaction.js'\nimport type { DerivationRegistry } from './registry.js'\nimport type { ReadOnlyVaultFacade } from '../../with-audit/guards/types.js'\nimport type { Collection } from '../../kernel/collection.js'\nimport type { EnclaveKey } from '../../kernel/enclave/index.js'\nimport type { EncryptedEnvelope } from '../../kernel/types.js'\nimport type { ledgerAuditHook, WaveContext } from '../../kernel/via/dispatch.js'\nimport { putDerivedOutput, selfWriteFieldEqual } from '../../kernel/via/dispatch.js'\nimport { DerivationCapExceededError } from '../../kernel/errors.js'\nimport { sameTuple, resolveTuple, tupleFromIntermediate, hopCollections } from './trigger-match.js'\nimport { markStale } from './stale.js'\nimport type { DerivationExecutor } from './executor.js'\n\n/** The per-write dispatch context threaded into `putDerivedOutput`. */\ninterface DispatchCtx {\n emit: (e: string, p: unknown) => void\n source: { readonly collection: string; readonly id: string }\n audit: ReturnType<typeof ledgerAuditHook>\n}\n\n/**\n * What the dispatchers need from the collection that owns them. Passing this\n * explicitly is what lets the logic live outside the class.\n */\nexport interface DerivationDeleteCtx {\n readonly derivationSource: {\n registry(): DerivationRegistry\n getCollection(name: string): Collection<Record<string, unknown>>\n getActiveTxContext(): TxContext | null\n getReadOnlyFacade(): ReadOnlyVaultFacade\n }\n /** The collection the delete happened in. */\n readonly collectionName: string\n readonly adapter: NoydbStore\n readonly vault: string\n readonly getDEK: (collectionName: string) => Promise<EnclaveKey>\n readonly storeCiphertext: boolean\n}\n\n/**\n * Erase the derived rows a deleted source record fanned out to, and drop the\n * fan-out sidecars that recorded them.\n *\n * @param eraseRecordShapeToo also erase same-id `shape: 'record'` outputs.\n * Restricted to a source-triggered strategy writing into a DIFFERENT\n * collection — the self-denorm case would re-delete the record just\n * tombstoned, and triggerBy/sibling strategies derive under a different id.\n * @returns rows ACTUALLY deleted, not edges visited (#622).\n */\nexport async function dispatchArrayDerivationsOnDelete(\n ctx: DerivationDeleteCtx,\n id: string,\n eraseRecordShapeToo = false,\n): Promise<number> {\n const { derivationSource, collectionName, adapter, vault, getDEK, storeCiphertext } = ctx\n\n const strategies = derivationSource.registry().strategiesForSource(collectionName)\n if (strategies.length === 0) return 0\n\n const { loadFanoutSidecar, deleteFanoutSidecar } = await import('./fanout-sidecar.js')\n const txCtx = derivationSource.getActiveTxContext()\n let erased = 0\n\n for (const { spec } of strategies) {\n for (const [outputKey, outSpec] of Object.entries(spec.outputs)) {\n if (outSpec.shape === 'record') {\n if (eraseRecordShapeToo && spec.source === collectionName && outSpec.collection !== collectionName) {\n if (await derivationSource.getCollection(outSpec.collection)._internalDelete(id, txCtx)) erased += 1\n }\n continue\n }\n\n const sidecar = await loadFanoutSidecar(adapter, vault, spec.source, id, outputKey, getDEK, storeCiphertext)\n if (!sidecar) continue\n\n const outputCollection = derivationSource.getCollection(outSpec.collection)\n for (const derivedId of sidecar.keys) {\n if (await outputCollection._internalDelete(derivedId, txCtx)) erased += 1\n }\n await deleteFanoutSidecar(adapter, vault, spec.source, id, outputKey)\n }\n }\n\n return erased\n}\n\n/** Adds what the on-write derivation dispatch needs beyond the delete path. */\nexport interface DerivationDispatchCtx extends DerivationDeleteCtx {\n /** Via pipeline, for decoding the stored form back to canonical money shape. */\n readonly via: { canonicalizeStored(r: Record<string, unknown>): Record<string, unknown> } | undefined\n /** Recompute a rollup aggregate onto a parent. Stays on the spine — it walks collections. */\n readonly recomputeRollup: (\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n spec: any,\n parentId: string,\n source: { readonly collection: string; readonly id: string },\n wave?: WaveContext,\n ) => Promise<unknown>\n /** Builds the per-write dispatch context threaded into `putDerivedOutput`. */\n readonly dispatchCtx: (source: { readonly collection: string; readonly id: string }) => DispatchCtx\n /** Registers a write on the active transaction for rollback. */\n readonly trackPut: (txCtx: TxContext, collectionName: string, id: string, priorEnvelope: EncryptedEnvelope | null) => void\n}\n\n/**\n * Fire registered derivation strategies for this source collection.\n *\n * Eager mode runs `derive` inline and writes each output; lazy mode records a\n * stale mark for cold-session recompute. Rollups are handled here rather than\n * by the executor — a write to the child recomputes the parent aggregate, and\n * a write to the parent recomputes its own.\n */\nexport async function dispatchDerivations(\n ctx: DerivationDispatchCtx,\n id: string,\n record: Record<string, unknown>,\n version: number,\n wave?: WaveContext,\n /** The pre-write record at `id` in THIS collection (undefined = not\n * captured — no field-match trigger, or a sync-applied wave; null =\n * captured and absent, i.e. a create). Only a `Record` re-fires the OLD\n * matched set alongside the new one (spec §7). */\n prior?: Record<string, unknown> | null,\n): Promise<void> {\n const { derivationSource, collectionName, via, recomputeRollup } = ctx\n\n // `record` is the stored form here (post-quantize) — decode so\n // derive(source, ctx) sees the canonical money shape.\n const incoming = (via ? via.canonicalizeStored(record) : record)\n if (incoming && typeof incoming === 'object' && '_derivedFrom' in incoming) return\n // `prior` is the raw stored pre-write record — canonicalize it the same\n // way as `incoming` before it feeds `resolveTuple` below, or a\n // via-shaped match field (e.g. a money field) compares canonical against\n // raw and never matches the old tuple (Min 5).\n const canonicalPrior = prior != null ? (via ? via.canonicalizeStored(prior) : prior) : prior\n const registry = derivationSource.registry()\n const strategies = registry.strategiesForSource(collectionName)\n if (strategies.length === 0) return\n // Dynamic-import the executor only on the first eager-mode\n // dispatch. Lazy-mode dispatches use `markStale` (a pure helper)\n // which doesn't reach into the executor at all. Keeps the\n // derivation executor chunk out of the floor bundle for any\n // consumer that doesn't fire an eager derivation.\n let executorClass: typeof DerivationExecutor | null = null\n for (const { spec, strategyHash, triggers } of strategies) {\n const mode = typeof spec.lifecycle === 'string' ? spec.lifecycle : spec.lifecycle.mode\n\n // Rollup: a write to the child `from` recomputes the\n // parent at id child[key]; a write to the parent (source = into)\n // recomputes its own aggregate. Handled here (the executor is not run).\n if (spec.rollup) {\n if (mode !== 'eager') continue\n const asParentId = (v: unknown): string | null =>\n (typeof v === 'string' || typeof v === 'number') ? String(v) : null\n let parentId: string | null\n // #1257 — a child that RE-PARENTS strands the old parent's aggregate\n // unless the old key is recomputed too. Reads the prior stored record\n // (canonicalized alongside `incoming`, so a via-shaped key compares like\n // for like). `undefined` prior — a sync-applied wave write or a tiers\n // restore, which do not thread it — degrades to new-parent-only, the\n // pre-#1257 behaviour, rather than guessing.\n let oldParentId: string | null = null\n if (collectionName === spec.rollup.from) {\n parentId = asParentId(incoming[spec.rollup.key])\n const priorKey = canonicalPrior != null ? asParentId(canonicalPrior[spec.rollup.key]) : null\n if (priorKey !== null && priorKey !== parentId) oldParentId = priorKey\n } else {\n parentId = id // a write to the parent recomputes its own aggregate\n }\n if (parentId !== null) await recomputeRollup(spec, parentId, { collection: collectionName, id }, wave)\n // The old parent is recomputed AFTER the new one so a `maxFanout`-style\n // failure on the new parent surfaces before extra work is spent.\n if (oldParentId !== null) await recomputeRollup(spec, oldParentId, { collection: collectionName, id }, wave)\n continue\n }\n\n // Determine how `collectionName` triggers this strategy, and build the list\n // of source records to (re-)derive:\n // • source — re-derive the written record itself (same-id).\n // • sources[] — re-derive the PRIMARY source at the same id.\n // • triggerBy — FK fan-out: re-derive every source record\n // whose `on` field equals the written parent's id.\n // `input` is passed to derive(); `base` is the raw stored source record\n // used as the patch base for a self-write reverse-denorm output.\n const isSource = spec.source === collectionName\n const isSibling = !isSource && (spec.sources?.includes(collectionName) ?? false)\n const triggerEntries = !isSource && !isSibling\n ? triggers.filter((t) => t.collection === collectionName)\n : []\n // #1277 option 2 — a write to an INTERMEDIATE collection fires the trigger\n // too. Without this, re-pointing the intermediate strands every source it\n // used to address: nothing is written to the trigger or source collection,\n // so no other path can notice. Kept separate from `triggerEntries` because\n // the tuple is derived differently (the intermediate IS the written record,\n // so no lookup is needed).\n const hopEntries = !isSource && !isSibling\n ? triggers.filter((t) => hopCollections(t.match).includes(collectionName))\n : []\n\n const runs: Array<{\n input: Record<string, unknown> & { id: string }\n base: Record<string, unknown>\n runId: string\n version: number\n }> = []\n\n if (isSource) {\n runs.push({ input: { ...incoming, id }, base: incoming, runId: id, version })\n } else if (isSibling) {\n const p = await derivationSource.getCollection(spec.source).get(id)\n if (p !== null && p !== undefined) {\n // Raw base for a (rare) sibling self-write; falls back to the\n // resolved primary if the raw read misses.\n const raw = await derivationSource.getCollection(spec.source)._getStoredRecord(id)\n runs.push({ input: { ...p, id }, base: raw ?? p, runId: id, version: 0 })\n }\n } else if (triggerEntries.length > 0 || hopEntries.length > 0) {\n const srcColl = derivationSource.getCollection(spec.source)\n const matched = new Set<string>()\n // One lookup per hop per written record — `take: 'id'` is a direct get,\n // anything else is a single field match on the intermediate. Never per\n // candidate row (#1266's bound).\n const lookup = async (coll: string, field: string, value: string): Promise<Record<string, unknown> | null> => {\n const c = derivationSource.getCollection(coll)\n if (field === 'id') return c._getStoredRecord(value)\n const ids = await c._findMatchingCompositeIds([{ field, value }])\n const first = ids[0]\n return first === undefined ? null : c._getStoredRecord(first)\n }\n // A write to an intermediate collection: fan out on its old ∪ new value.\n // The prior record is the intermediate's own, so #1249's capture already\n // supplies it — the same mechanism, pointed at a third collection.\n for (const trigger of hopEntries) {\n const tuples = [tupleFromIntermediate(trigger.match, collectionName, incoming)]\n if (canonicalPrior != null) {\n const old = tupleFromIntermediate(trigger.match, collectionName, canonicalPrior)\n if (!sameTuple(old, tuples[0]!)) tuples.push(old)\n }\n const ids = new Set<string>()\n for (const tuple of tuples) {\n if (tuple === null) continue\n for (const sid of await srcColl._findMatchingCompositeIds(tuple)) ids.add(sid)\n }\n if (trigger.maxFanout !== undefined && ids.size > trigger.maxFanout) {\n throw new DerivationCapExceededError(\n `triggerBy hop ${collectionName}→${spec.source} [${trigger.match.map(p => p.to).join(',')}]`,\n ids.size, trigger.maxFanout)\n }\n for (const sid of ids) matched.add(sid)\n }\n for (const trigger of triggerEntries) {\n // Union fan-out (spec §7): an update changing any matched component\n // must re-fire BOTH the old and the new matched set, or the old\n // set's derived output goes stale (never re-derived once it no\n // longer matches). `prior` is only ever a `Record` here — a wave\n // dispatch and a create both skip the old tuple outright.\n const tuples = [await resolveTuple(trigger.match, id, incoming, lookup)]\n if (canonicalPrior != null && trigger.match.some((p) => p.from !== 'id')) {\n const old = await resolveTuple(trigger.match, id, canonicalPrior, lookup)\n if (!sameTuple(old, tuples[0]!)) tuples.push(old)\n }\n const ids = new Set<string>()\n for (const tuple of tuples) {\n if (tuple === null) continue // a from-value is absent/non-scalar: matches nothing\n for (const sid of await srcColl._findMatchingCompositeIds(tuple)) ids.add(sid)\n }\n if (trigger.maxFanout !== undefined && ids.size > trigger.maxFanout) {\n throw new DerivationCapExceededError(\n `triggerBy ${collectionName}→${spec.source} [${trigger.match.map(p => p.to).join(',')}]`,\n ids.size, trigger.maxFanout)\n }\n for (const sid of ids) matched.add(sid)\n }\n for (const sid of matched) {\n const raw = await srcColl._getStoredRecord(sid)\n if (raw === null) continue\n runs.push({ input: { ...raw, id: sid }, base: raw, runId: sid, version: 0 })\n }\n }\n\n if (runs.length === 0) continue\n\n if (mode !== 'eager') {\n for (const run of runs) await markStale(registry, spec, run.runId)\n continue\n }\n\n if (executorClass === null) {\n ;({ DerivationExecutor: executorClass } = await import('./executor.js'))\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n for (const run of runs) await runOne(ctx, spec as any, strategyHash, executorClass, run)\n }\n}\n\n/**\n * Run the executor for one (spec, run) pair and write its outputs. Shared by\n * `dispatchDerivations`' eager loop and `dispatchTriggerDerivationsOnDelete`\n * (#1249) — the write-out logic (array diff, record self-write reverse-denorm,\n * normal record output) is identical for a live write and a delete-triggered\n * re-derive; only how `runs` gets built differs.\n */\nasync function runOne(\n ctx: DerivationDispatchCtx,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n spec: any,\n strategyHash: string,\n executorClass: typeof DerivationExecutor,\n run: { input: Record<string, unknown> & { id: string }; base: Record<string, unknown>; runId: string; version: number },\n): Promise<void> {\n const { derivationSource, adapter, vault, getDEK, storeCiphertext, dispatchCtx, trackPut } = ctx\n const execCtx = { vault: derivationSource.getReadOnlyFacade() }\n const outCtx = dispatchCtx({ collection: spec.source, id: run.runId })\n const result = await executorClass.run(spec, run.input, run.version, strategyHash, execCtx)\n for (const key of Object.keys(spec.outputs)) {\n const out = result.outputs[key]\n if (!out) continue\n if (out.kind === 'failed') {\n const err = out.error\n if (spec.strict) throw err\n console.warn(`[derivation] output \"${key}\" for source \"${spec.source}\" id=\"${run.runId}\" failed:`, err)\n continue\n }\n const outSpec = spec.outputs[key]\n if (!outSpec) continue\n const outputCollection = derivationSource.getCollection(outSpec.collection)\n // If we're inside a multi-record transaction, register\n // derived writes as side-effect ops on the active ctx\n // BEFORE they fire. `revertExecuted` walks `_executed` in\n // reverse on rollback, so capturing the pre-write envelope\n // here lets a later mid-batch failure restore this output's\n // prior state alongside the source op. Outside a transaction\n // the context is null and tracking is skipped.\n const txCtx = derivationSource.getActiveTxContext()\n\n // ── Array-shape branch ─────────────────────────────────\n if (out.kind === 'array') {\n // Load the prior key set from the fanout sidecar.\n const { loadFanoutSidecar, saveFanoutSidecar } = await import('./fanout-sidecar.js')\n const prior = await loadFanoutSidecar(adapter, vault, spec.source, run.runId, key, getDEK, storeCiphertext)\n const prevKeys = new Set<string>(prior?.keys ?? [])\n const newKeysList = out.entries.map((e: { key: string }) => e.key)\n const newKeysSet = new Set<string>(newKeysList)\n\n // Diff — delete keys that were in prev but not in new.\n for (const k of prevKeys) {\n if (newKeysSet.has(k)) continue\n await outputCollection._internalDelete(k, txCtx)\n }\n\n // Upsert every entry in the new set. (Slice 1: no\n // identity-skip optimisation; write every row, idempotent\n // at the (collection, id) level.)\n for (const entry of out.entries) {\n if (txCtx !== null) {\n trackPut(txCtx, outSpec.collection, entry.key, await adapter.get(vault, outSpec.collection, entry.key))\n }\n await putDerivedOutput(outputCollection, entry.key, entry.value, outCtx, { source: 'derived' })\n }\n\n // Persist the new key set last, for failure-mode symmetry.\n await saveFanoutSidecar(adapter, vault, {\n source: spec.source,\n sourceId: run.runId,\n outputKey: key,\n outputCollection: outSpec.collection,\n keys: newKeysList,\n }, getDEK, storeCiphertext)\n continue\n }\n\n // ── Record-shape branch ────────────────────────────────\n if (out.skipped === true) {\n // Optional output returned null. Delete the\n // previously-emitted output at this id, if any. Routed\n // through `_internalDelete` so a user-registered\n // `onDelete` on the output collection does NOT\n // fire — this is a system-internal tombstone, not a\n // user-initiated delete. The txCtx hookup captures the\n // prior envelope inside `_internalDelete` for rollback\n // symmetry; delete-of-absent is a silent no-op.\n await outputCollection._internalDelete(run.runId, txCtx)\n continue\n }\n\n // ── Self-write reverse-denorm ───────────────────────────\n // An output back to its own source: patch ONLY the declared\n // `denorm` fields onto the raw stored record, never the whole\n // value (which would clobber user fields / i18n maps and carries\n // the executor's `_derivedFrom` tag). If the patch changes\n // nothing, skip the write — that value-equality is the cycle\n // guard: the self-write re-fires the source-path derivation,\n // which recomputes identical fields and terminates here.\n if (outSpec.shape === 'record' && outSpec.denorm !== undefined && outSpec.collection === spec.source) {\n const value = out.value\n const patched: Record<string, unknown> = { ...run.base }\n let changed = false\n for (const f of outSpec.denorm) {\n if (!selfWriteFieldEqual(run.base[f], value[f])) {\n patched[f] = value[f]\n changed = true\n }\n }\n if (!changed) continue // cycle guard — nothing to write\n if (txCtx !== null) {\n trackPut(txCtx, outSpec.collection, run.runId, await adapter.get(vault, outSpec.collection, run.runId))\n }\n await putDerivedOutput(outputCollection, run.runId, patched, outCtx, { source: 'derived' })\n continue\n }\n\n // ── Normal record output (separate output collection) ──\n if (txCtx !== null) {\n trackPut(txCtx, outSpec.collection, run.runId, await adapter.get(vault, outSpec.collection, run.runId))\n }\n await putDerivedOutput(outputCollection, run.runId, out.value, outCtx, { source: 'derived' })\n }\n}\n\n/**\n * Trigger fan-out for a DELETED parent record (#1249, spec §8). Distinct from\n * the \"record-shape derivations not dispatched on delete\" rule — that is\n * about deleting a SOURCE record; this fires when a TRIGGER collection's\n * record is deleted, re-deriving source records that still exist. Pairs\n * evaluate against the tombstoned record's values; matched sources re-derive\n * through the normal executor (their derive() reads the now-absent parent\n * and decides what that means — the engine never cascades deletes).\n */\nexport async function dispatchTriggerDerivationsOnDelete(\n ctx: DerivationDispatchCtx, id: string, deleted: Record<string, unknown>,\n): Promise<void> {\n const { derivationSource, collectionName } = ctx\n const registry = derivationSource.registry()\n const strategies = registry.strategiesForSource(collectionName)\n if (strategies.length === 0) return\n let executorClass: typeof DerivationExecutor | null = null\n for (const { spec, strategyHash, triggers } of strategies) {\n if (spec.rollup) continue // rollup-on-delete already exists\n if (spec.source === collectionName) continue // source delete: existing rule, untouched\n if (spec.sources?.includes(collectionName)) continue // declared sibling source: same exclusion as the write path's isSibling check\n const entries = triggers.filter((t) => t.collection === collectionName)\n // #1294 — deleting an INTERMEDIATE strands every source it addressed, for\n // the same reason re-pointing one does: nothing is written to the trigger\n // or source collection. The write path handles this; the delete path did\n // not, which made the hop's correctness argument hold for puts only.\n const hopEntries = triggers.filter((t) => hopCollections(t.match).includes(collectionName))\n if (entries.length === 0 && hopEntries.length === 0) continue\n const mode = typeof spec.lifecycle === 'string' ? spec.lifecycle : spec.lifecycle.mode\n const srcColl = derivationSource.getCollection(spec.source)\n const matched = new Set<string>()\n const lookup = async (coll: string, field: string, value: string): Promise<Record<string, unknown> | null> => {\n const c = derivationSource.getCollection(coll)\n if (field === 'id') return c._getStoredRecord(value)\n const found = await c._findMatchingCompositeIds([{ field, value }])\n const first = found[0]\n return first === undefined ? null : c._getStoredRecord(first)\n }\n const cap = (trigger: { maxFanout?: number; match: ReadonlyArray<{ to: string }> }, n: number, label: string): void => {\n if (trigger.maxFanout !== undefined && n > trigger.maxFanout) {\n throw new DerivationCapExceededError(\n `triggerBy ${label} ${collectionName}→${spec.source} [${trigger.match.map(p => p.to).join(',')}] (delete)`,\n n, trigger.maxFanout)\n }\n }\n for (const trigger of entries) {\n // #1294 — resolve the hop here too. The old sync builder compared the raw\n // `from` value against `source[to]`, which for a mapped pair is the\n // wrong side of the relationship: it matched nothing, silently, so a\n // delete through a hop fanned out to no one while a delete through a\n // plain pair worked.\n const tuple = await resolveTuple(trigger.match, id, deleted, lookup)\n if (tuple === null) continue\n const ids = await srcColl._findMatchingCompositeIds(tuple)\n cap(trigger, ids.length, '')\n for (const sid of ids) matched.add(sid)\n }\n for (const trigger of hopEntries) {\n const tuple = tupleFromIntermediate(trigger.match, collectionName, deleted)\n if (tuple === null) continue\n const ids = await srcColl._findMatchingCompositeIds(tuple)\n cap(trigger, ids.length, 'hop')\n for (const sid of ids) matched.add(sid)\n }\n if (matched.size === 0) continue\n if (mode !== 'eager') { for (const sid of matched) await markStale(registry, spec, sid); continue }\n if (executorClass === null) ({ DerivationExecutor: executorClass } = await import('./executor.js'))\n for (const sid of matched) {\n const raw = await srcColl._getStoredRecord(sid)\n if (raw === null) continue\n await runOne(ctx, spec, strategyHash, executorClass, { input: { ...raw, id: sid }, base: raw, runId: sid, version: 0 })\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0EA,eAAsB,iCACpB,KACA,IACA,sBAAsB,OACL;AACjB,QAAM,EAAE,kBAAkB,gBAAgB,SAAS,OAAO,QAAQ,gBAAgB,IAAI;AAEtF,QAA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AAE,oBAAoB,cAAc,IAAI,MAAM,OAAO,wBAAe;AACjG,eAAW,OAAO,SAAS;AACzB,YAAM,MAAM,MAAM,QAAQ,iBAAiB,GAAG;AAC9C,UAAI,QAAQ,KAAM;AAClB,YAAM,OAAO,KAAK,MAAM,cAAc,eAAe,EAAE,OAAO,EAAE,GAAG,KAAK,IAAI,IAAI,GAAG,MAAM,KAAK,OAAO,KAAK,SAAS,EAAE,CAAC;AAAA,IACxH;AAAA,EACF;AACF;","names":[]}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import "./chunk-PZ5AY32C.js";
|
|
2
|
-
|
|
3
1
|
// src/with-formula/materialized-views/dispatch.ts
|
|
4
2
|
async function dispatchMaterializedViews(ctx, id, record, wave) {
|
|
5
3
|
const { materializedViewSource: source, collectionName, dispatchCtx } = ctx;
|
|
@@ -16,7 +14,7 @@ async function dispatchMaterializedViews(ctx, id, record, wave) {
|
|
|
16
14
|
if (wave?.seen(`mv\0${reg.spec.name}`)) continue;
|
|
17
15
|
if (executor === null) {
|
|
18
16
|
;
|
|
19
|
-
({ MaterializedViewExecutor: executor } = await import("./executor-
|
|
17
|
+
({ MaterializedViewExecutor: executor } = await import("./executor-PUAO6AKJ.js"));
|
|
20
18
|
}
|
|
21
19
|
await executor.refresh(reg, {
|
|
22
20
|
getCollection: (name) => source.getCollection(name),
|
|
@@ -25,7 +23,7 @@ async function dispatchMaterializedViews(ctx, id, record, wave) {
|
|
|
25
23
|
dispatchCtx: dispatchCtx({ collection: collectionName, id })
|
|
26
24
|
});
|
|
27
25
|
} else if (mode === "lazy") {
|
|
28
|
-
if (staleHelpers === null) staleHelpers = await import("./stale-
|
|
26
|
+
if (staleHelpers === null) staleHelpers = await import("./stale-DDL7WQEZ.js");
|
|
29
27
|
staleHelpers.markMVStale(registry, reg.spec.name);
|
|
30
28
|
}
|
|
31
29
|
}
|
|
@@ -47,7 +45,7 @@ async function dispatchMaterializedViewsOnDelete(ctx, id) {
|
|
|
47
45
|
if (mode === "eager") {
|
|
48
46
|
if (executor === null) {
|
|
49
47
|
;
|
|
50
|
-
({ MaterializedViewExecutor: executor } = await import("./executor-
|
|
48
|
+
({ MaterializedViewExecutor: executor } = await import("./executor-PUAO6AKJ.js"));
|
|
51
49
|
}
|
|
52
50
|
const rr = await executor.refresh(reg, {
|
|
53
51
|
getCollection: (name) => source.getCollection(name),
|
|
@@ -60,7 +58,7 @@ async function dispatchMaterializedViewsOnDelete(ctx, id) {
|
|
|
60
58
|
residueDeclined.push(...rr.residueDeclined);
|
|
61
59
|
continue;
|
|
62
60
|
}
|
|
63
|
-
if (staleHelpers === null) staleHelpers = await import("./stale-
|
|
61
|
+
if (staleHelpers === null) staleHelpers = await import("./stale-DDL7WQEZ.js");
|
|
64
62
|
const inv = await staleHelpers.invalidateMVAtRest(source, reg, mode);
|
|
65
63
|
deleted += inv.deleted;
|
|
66
64
|
residueUndecodable.push(...inv.residueUndecodable.map((rid) => `${reg.outputCollection}:${rid}`));
|
|
@@ -72,4 +70,4 @@ export {
|
|
|
72
70
|
dispatchMaterializedViews,
|
|
73
71
|
dispatchMaterializedViewsOnDelete
|
|
74
72
|
};
|
|
75
|
-
//# sourceMappingURL=dispatch-
|
|
73
|
+
//# sourceMappingURL=dispatch-WC6X2M6C.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/with-formula/materialized-views/dispatch.ts"],"sourcesContent":["/**\n * Materialized-view dispatch, lifted out of the kernel spine (#842 part b).\n *\n * Reached from `Collection` by dynamic `import()` only — `port-layering`\n * forbids a static spine→`with-*` import, and rejects a type-only one too\n * (it scans import statements, not their erasure). See\n * `with-formula/derivations/dispatch.ts` for the same note.\n *\n * The `Collection` reference below is TYPE-ONLY and points inward\n * (service → kernel), so it is both allowed and erased at build.\n *\n * @internal\n */\n\nimport type { TxContext } from '../../with-commit/tx/transaction.js'\nimport type { Collection } from '../../kernel/collection.js'\nimport type { ledgerAuditHook, WaveContext } from '../../kernel/via/dispatch.js'\nimport type { MaterializedViewExecutor } from './executor.js'\nimport type * as MVStale from './stale.js'\nimport type { MaterializedViewRegistry } from './registry.js'\nimport type { MVQueryContext } from './types.js'\n\n/** The per-write dispatch context the MV executor threads through. */\ninterface DispatchCtx {\n emit: (e: string, p: unknown) => void\n source: { readonly collection: string; readonly id: string }\n audit: ReturnType<typeof ledgerAuditHook>\n}\n\n/** What the MV dispatchers need from the collection that owns them. */\nexport interface MvDispatchCtx {\n readonly materializedViewSource: {\n registry(): MaterializedViewRegistry\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n getCollection(name: string): Collection<any>\n getActiveTxContext(): TxContext | null\n getQueryContext(): MVQueryContext\n }\n /** The collection the delete happened in. */\n readonly collectionName: string\n /** Builds the per-write dispatch context the executor threads through. */\n readonly dispatchCtx: (source: { readonly collection: string; readonly id: string }) => DispatchCtx\n}\n\n/**\n * Fire every MV whose dependency set includes this collection, on write.\n *\n * Skips entirely when the record being written is itself an MV-emitted row\n * (it carries `_materializedFrom`) — a defensive guard against missed cycle\n * detection.\n *\n * @param wave #638 Task 4 — the sync/cutover/restore dispatch wave. An eager\n * MV already refreshed in this wave is skipped, deduped per target on the\n * spec name.\n */\nexport async function dispatchMaterializedViews(\n ctx: MvDispatchCtx,\n id: string,\n record: Record<string, unknown>,\n wave?: WaveContext,\n): Promise<void> {\n const { materializedViewSource: source, collectionName, dispatchCtx } = ctx\n\n if (record && typeof record === 'object' && '_materializedFrom' in record) return\n\n const registry = source.registry()\n // #1139 — replan any query-form strategy parked at vault open because its\n // join named a ref that had not been declared yet. No-op once drained.\n await registry.resolvePendingPlans()\n const mvs = registry.mvsForSource(collectionName)\n if (mvs.length === 0) return\n\n let executor: typeof MaterializedViewExecutor | null = null\n let staleHelpers: typeof MVStale | null = null\n\n for (const reg of mvs) {\n const mode = reg.spec.refresh\n\n if (mode === 'eager') {\n if (wave?.seen(`mv\\0${reg.spec.name}`)) continue\n if (executor === null) {\n ;({ MaterializedViewExecutor: executor } = await import('./executor.js'))\n }\n await executor.refresh(reg, {\n getCollection: (name) => source.getCollection(name),\n getActiveTxContext: () => source.getActiveTxContext(),\n getQueryContext: () => source.getQueryContext(),\n dispatchCtx: dispatchCtx({ collection: collectionName, id }),\n })\n } else if (mode === 'lazy') {\n if (staleHelpers === null) staleHelpers = await import('./stale.js')\n staleHelpers.markMVStale(registry, reg.spec.name)\n }\n // manual: no-op on source-write. `vault.refreshView(name)` is the only\n // path that materializes a manual MV.\n }\n}\n\n/**\n * Mirror of {@link dispatchMaterializedViews} for the delete/forget path. There is\n * no `_materializedFrom` skip — the record is gone — and the `internal` gate\n * at `_doDelete` is the recursion guard.\n *\n * @returns rows TOMBSTONED across every MV sourced here (#638 T6). Eager and\n * lazy/manual `invalidateMVAtRest` purges both contribute (#761 item 1,\n * previously eager-only): lazy persists a stale mark for cold-session\n * recompute, manual serves empty until `refreshView()`.\n * `residueUndecodable` / `residueDeclined` (#776/#785) carry\n * `outputCollection:id` entries whose ownership stamp `invalidateMVAtRest`\n * could not decode, respectively decoded and stamp-matched but declined to\n * erase — surfaced, not erased.\n */\nexport async function dispatchMaterializedViewsOnDelete(\n ctx: MvDispatchCtx,\n id: string,\n): Promise<{ deleted: number; residueUndecodable: string[]; residueDeclined: string[] }> {\n const { materializedViewSource: source, collectionName, dispatchCtx } = ctx\n\n const registry = source.registry()\n await registry.resolvePendingPlans() // #1139 — see the put-path dispatcher\n const mvs = registry.mvsForSource(collectionName)\n const empty = { deleted: 0, residueUndecodable: [], residueDeclined: [] }\n if (mvs.length === 0) return empty\n\n let executor: typeof MaterializedViewExecutor | null = null\n let staleHelpers: typeof MVStale | null = null\n\n let deleted = 0\n const residueUndecodable: string[] = []\n const residueDeclined: string[] = []\n\n for (const reg of mvs) {\n const mode = reg.spec.refresh\n\n if (mode === 'eager') {\n if (executor === null) {\n ;({ MaterializedViewExecutor: executor } = await import('./executor.js'))\n }\n const rr = await executor.refresh(reg, {\n getCollection: (name) => source.getCollection(name),\n getActiveTxContext: () => source.getActiveTxContext(),\n getQueryContext: () => source.getQueryContext(),\n dispatchCtx: dispatchCtx({ collection: collectionName, id }),\n })\n // #782/#785 — the eager leg reports both residue channels.\n deleted += rr.deleted\n residueUndecodable.push(...rr.residueUndecodable)\n residueDeclined.push(...rr.residueDeclined)\n continue\n }\n\n if (staleHelpers === null) staleHelpers = await import('./stale.js')\n const inv = await staleHelpers.invalidateMVAtRest(source, reg, mode)\n deleted += inv.deleted\n residueUndecodable.push(...inv.residueUndecodable.map((rid) => `${reg.outputCollection}:${rid}`))\n residueDeclined.push(...inv.residueDeclined.map((rid) => `${reg.outputCollection}:${rid}`))\n }\n\n return { deleted, residueUndecodable, residueDeclined }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/with-formula/materialized-views/dispatch.ts"],"sourcesContent":["/**\n * Materialized-view dispatch, lifted out of the kernel spine (#842 part b).\n *\n * Reached from `Collection` by dynamic `import()` only — `port-layering`\n * forbids a static spine→`with-*` import, and rejects a type-only one too\n * (it scans import statements, not their erasure). See\n * `with-formula/derivations/dispatch.ts` for the same note.\n *\n * The `Collection` reference below is TYPE-ONLY and points inward\n * (service → kernel), so it is both allowed and erased at build.\n *\n * @internal\n */\n\nimport type { TxContext } from '../../with-commit/tx/transaction.js'\nimport type { Collection } from '../../kernel/collection.js'\nimport type { ledgerAuditHook, WaveContext } from '../../kernel/via/dispatch.js'\nimport type { MaterializedViewExecutor } from './executor.js'\nimport type * as MVStale from './stale.js'\nimport type { MaterializedViewRegistry } from './registry.js'\nimport type { MVQueryContext } from './types.js'\n\n/** The per-write dispatch context the MV executor threads through. */\ninterface DispatchCtx {\n emit: (e: string, p: unknown) => void\n source: { readonly collection: string; readonly id: string }\n audit: ReturnType<typeof ledgerAuditHook>\n}\n\n/** What the MV dispatchers need from the collection that owns them. */\nexport interface MvDispatchCtx {\n readonly materializedViewSource: {\n registry(): MaterializedViewRegistry\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n getCollection(name: string): Collection<any>\n getActiveTxContext(): TxContext | null\n getQueryContext(): MVQueryContext\n }\n /** The collection the delete happened in. */\n readonly collectionName: string\n /** Builds the per-write dispatch context the executor threads through. */\n readonly dispatchCtx: (source: { readonly collection: string; readonly id: string }) => DispatchCtx\n}\n\n/**\n * Fire every MV whose dependency set includes this collection, on write.\n *\n * Skips entirely when the record being written is itself an MV-emitted row\n * (it carries `_materializedFrom`) — a defensive guard against missed cycle\n * detection.\n *\n * @param wave #638 Task 4 — the sync/cutover/restore dispatch wave. An eager\n * MV already refreshed in this wave is skipped, deduped per target on the\n * spec name.\n */\nexport async function dispatchMaterializedViews(\n ctx: MvDispatchCtx,\n id: string,\n record: Record<string, unknown>,\n wave?: WaveContext,\n): Promise<void> {\n const { materializedViewSource: source, collectionName, dispatchCtx } = ctx\n\n if (record && typeof record === 'object' && '_materializedFrom' in record) return\n\n const registry = source.registry()\n // #1139 — replan any query-form strategy parked at vault open because its\n // join named a ref that had not been declared yet. No-op once drained.\n await registry.resolvePendingPlans()\n const mvs = registry.mvsForSource(collectionName)\n if (mvs.length === 0) return\n\n let executor: typeof MaterializedViewExecutor | null = null\n let staleHelpers: typeof MVStale | null = null\n\n for (const reg of mvs) {\n const mode = reg.spec.refresh\n\n if (mode === 'eager') {\n if (wave?.seen(`mv\\0${reg.spec.name}`)) continue\n if (executor === null) {\n ;({ MaterializedViewExecutor: executor } = await import('./executor.js'))\n }\n await executor.refresh(reg, {\n getCollection: (name) => source.getCollection(name),\n getActiveTxContext: () => source.getActiveTxContext(),\n getQueryContext: () => source.getQueryContext(),\n dispatchCtx: dispatchCtx({ collection: collectionName, id }),\n })\n } else if (mode === 'lazy') {\n if (staleHelpers === null) staleHelpers = await import('./stale.js')\n staleHelpers.markMVStale(registry, reg.spec.name)\n }\n // manual: no-op on source-write. `vault.refreshView(name)` is the only\n // path that materializes a manual MV.\n }\n}\n\n/**\n * Mirror of {@link dispatchMaterializedViews} for the delete/forget path. There is\n * no `_materializedFrom` skip — the record is gone — and the `internal` gate\n * at `_doDelete` is the recursion guard.\n *\n * @returns rows TOMBSTONED across every MV sourced here (#638 T6). Eager and\n * lazy/manual `invalidateMVAtRest` purges both contribute (#761 item 1,\n * previously eager-only): lazy persists a stale mark for cold-session\n * recompute, manual serves empty until `refreshView()`.\n * `residueUndecodable` / `residueDeclined` (#776/#785) carry\n * `outputCollection:id` entries whose ownership stamp `invalidateMVAtRest`\n * could not decode, respectively decoded and stamp-matched but declined to\n * erase — surfaced, not erased.\n */\nexport async function dispatchMaterializedViewsOnDelete(\n ctx: MvDispatchCtx,\n id: string,\n): Promise<{ deleted: number; residueUndecodable: string[]; residueDeclined: string[] }> {\n const { materializedViewSource: source, collectionName, dispatchCtx } = ctx\n\n const registry = source.registry()\n await registry.resolvePendingPlans() // #1139 — see the put-path dispatcher\n const mvs = registry.mvsForSource(collectionName)\n const empty = { deleted: 0, residueUndecodable: [], residueDeclined: [] }\n if (mvs.length === 0) return empty\n\n let executor: typeof MaterializedViewExecutor | null = null\n let staleHelpers: typeof MVStale | null = null\n\n let deleted = 0\n const residueUndecodable: string[] = []\n const residueDeclined: string[] = []\n\n for (const reg of mvs) {\n const mode = reg.spec.refresh\n\n if (mode === 'eager') {\n if (executor === null) {\n ;({ MaterializedViewExecutor: executor } = await import('./executor.js'))\n }\n const rr = await executor.refresh(reg, {\n getCollection: (name) => source.getCollection(name),\n getActiveTxContext: () => source.getActiveTxContext(),\n getQueryContext: () => source.getQueryContext(),\n dispatchCtx: dispatchCtx({ collection: collectionName, id }),\n })\n // #782/#785 — the eager leg reports both residue channels.\n deleted += rr.deleted\n residueUndecodable.push(...rr.residueUndecodable)\n residueDeclined.push(...rr.residueDeclined)\n continue\n }\n\n if (staleHelpers === null) staleHelpers = await import('./stale.js')\n const inv = await staleHelpers.invalidateMVAtRest(source, reg, mode)\n deleted += inv.deleted\n residueUndecodable.push(...inv.residueUndecodable.map((rid) => `${reg.outputCollection}:${rid}`))\n residueDeclined.push(...inv.residueDeclined.map((rid) => `${reg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velopeBody
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-77K4PG6P.js";
|
|
34
34
|
import {
|
|
35
35
|
buildDeleteMarker,
|
|
36
36
|
buildRecordEnvelope,
|
|
@@ -39,19 +39,19 @@ import {
|
|
|
39
39
|
isDeleteMarker,
|
|
40
40
|
isTombstone,
|
|
41
41
|
isTombstoneShape
|
|
42
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-SZJ3DLZA.js";
|
|
43
43
|
import {
|
|
44
44
|
ctEqualTags,
|
|
45
45
|
deriveVdigSlotKey,
|
|
46
46
|
evaluateKofN
|
|
47
|
-
} from "./chunk-
|
|
48
|
-
import "./chunk-
|
|
47
|
+
} from "./chunk-BOWNCWZT.js";
|
|
48
|
+
import "./chunk-YSRUYAVU.js";
|
|
49
49
|
import {
|
|
50
50
|
computeBidxTarget,
|
|
51
51
|
deriveClassifyIndexKey,
|
|
52
52
|
deriveClassifyIndexSalt,
|
|
53
53
|
mintBidxTag
|
|
54
|
-
} from "./chunk-
|
|
54
|
+
} from "./chunk-RMF67KCG.js";
|
|
55
55
|
import {
|
|
56
56
|
pbkdf2VerifyDigest
|
|
57
57
|
} from "./chunk-LP7BEXCT.js";
|
|
@@ -85,10 +85,9 @@ import {
|
|
|
85
85
|
unwrapKey,
|
|
86
86
|
wrapCek,
|
|
87
87
|
wrapKey
|
|
88
|
-
} from "./chunk-
|
|
89
|
-
import "./chunk-
|
|
90
|
-
import "./chunk-
|
|
91
|
-
import "./chunk-PZ5AY32C.js";
|
|
88
|
+
} from "./chunk-SL3JAAKN.js";
|
|
89
|
+
import "./chunk-7MG7SJT7.js";
|
|
90
|
+
import "./chunk-7O3Y4PPD.js";
|
|
92
91
|
export {
|
|
93
92
|
RecordCodec,
|
|
94
93
|
SEALED_CEK_NS,
|
|
@@ -166,4 +165,4 @@ export {
|
|
|
166
165
|
wrapKey,
|
|
167
166
|
writeEnvelopeBody
|
|
168
167
|
};
|
|
169
|
-
//# sourceMappingURL=enclave-
|
|
168
|
+
//# sourceMappingURL=enclave-KJOTOH7X.js.map
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import {
|
|
2
|
+
MaterializedViewExecutor
|
|
3
|
+
} from "./chunk-NA2NIJZI.js";
|
|
4
|
+
import "./chunk-QIBVIOXO.js";
|
|
5
|
+
import "./chunk-VXANTWBJ.js";
|
|
6
|
+
import "./chunk-CARABLSQ.js";
|
|
7
|
+
import "./chunk-U4FOQDY4.js";
|
|
8
|
+
import "./chunk-ZORTV6NH.js";
|
|
9
|
+
import "./chunk-ZN4FD4PE.js";
|
|
10
|
+
import "./chunk-XZHEOSQ2.js";
|
|
11
|
+
import "./chunk-ATL3ZVXT.js";
|
|
12
|
+
import "./chunk-NSITFOCJ.js";
|
|
13
|
+
import "./chunk-6I2RQCET.js";
|
|
14
|
+
import "./chunk-TRGTKX5E.js";
|
|
15
|
+
import "./chunk-UXVWEX5L.js";
|
|
16
|
+
import "./chunk-BOET4NA4.js";
|
|
17
|
+
import "./chunk-77K4PG6P.js";
|
|
18
|
+
import "./chunk-SZJ3DLZA.js";
|
|
19
|
+
import "./chunk-BOWNCWZT.js";
|
|
20
|
+
import "./chunk-YSRUYAVU.js";
|
|
21
|
+
import "./chunk-RMF67KCG.js";
|
|
22
|
+
import "./chunk-LP7BEXCT.js";
|
|
23
|
+
import "./chunk-SL3JAAKN.js";
|
|
24
|
+
import "./chunk-7MG7SJT7.js";
|
|
25
|
+
import "./chunk-7O3Y4PPD.js";
|
|
26
|
+
export {
|
|
27
|
+
MaterializedViewExecutor
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=executor-PUAO6AKJ.js.map
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import {
|
|
2
|
+
buildAccessibleBundle,
|
|
3
|
+
exportAccessibleData,
|
|
4
|
+
resolveAccessibleCollections
|
|
5
|
+
} from "./chunk-L7CIOOBW.js";
|
|
6
|
+
import "./chunk-5WDXHNSW.js";
|
|
7
|
+
import "./chunk-EQEYOJBM.js";
|
|
8
|
+
import "./chunk-77K4PG6P.js";
|
|
9
|
+
import "./chunk-SZJ3DLZA.js";
|
|
10
|
+
import "./chunk-BOWNCWZT.js";
|
|
11
|
+
import "./chunk-YSRUYAVU.js";
|
|
12
|
+
import "./chunk-RMF67KCG.js";
|
|
13
|
+
import "./chunk-LP7BEXCT.js";
|
|
14
|
+
import "./chunk-SL3JAAKN.js";
|
|
15
|
+
import "./chunk-7MG7SJT7.js";
|
|
16
|
+
import "./chunk-7O3Y4PPD.js";
|
|
17
|
+
export {
|
|
18
|
+
buildAccessibleBundle,
|
|
19
|
+
exportAccessibleData,
|
|
20
|
+
resolveAccessibleCollections
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=export-accessible-72EQNBMR.js.map
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import {
|
|
2
|
+
extractPartition,
|
|
3
|
+
extractPartitionCore,
|
|
4
|
+
reKeyBlobs,
|
|
5
|
+
reKeyClosure,
|
|
6
|
+
reKeyLedger,
|
|
7
|
+
reKeySchemas,
|
|
8
|
+
sealDeks
|
|
9
|
+
} from "./chunk-3RCJJBNR.js";
|
|
10
|
+
import "./chunk-2Y4IMKA6.js";
|
|
11
|
+
import "./chunk-5WDXHNSW.js";
|
|
12
|
+
import "./chunk-EQEYOJBM.js";
|
|
13
|
+
import "./chunk-BM5TWITZ.js";
|
|
14
|
+
import "./chunk-UGTBXF5U.js";
|
|
15
|
+
import "./chunk-4AOERLTV.js";
|
|
16
|
+
import "./chunk-I7FD46FF.js";
|
|
17
|
+
import "./chunk-BOET4NA4.js";
|
|
18
|
+
import "./chunk-JMGDHKQF.js";
|
|
19
|
+
import "./chunk-77K4PG6P.js";
|
|
20
|
+
import "./chunk-SZJ3DLZA.js";
|
|
21
|
+
import "./chunk-BOWNCWZT.js";
|
|
22
|
+
import "./chunk-YSRUYAVU.js";
|
|
23
|
+
import "./chunk-RMF67KCG.js";
|
|
24
|
+
import "./chunk-LP7BEXCT.js";
|
|
25
|
+
import "./chunk-SL3JAAKN.js";
|
|
26
|
+
import "./chunk-7MG7SJT7.js";
|
|
27
|
+
import "./chunk-7O3Y4PPD.js";
|
|
28
|
+
export {
|
|
29
|
+
extractPartition,
|
|
30
|
+
extractPartitionCore,
|
|
31
|
+
reKeyBlobs,
|
|
32
|
+
reKeyClosure,
|
|
33
|
+
reKeyLedger,
|
|
34
|
+
reKeySchemas,
|
|
35
|
+
sealDeks
|
|
36
|
+
};
|
|
37
|
+
//# sourceMappingURL=extract-partition-PUYNU3UF.js.map
|