@noy-db/hub 0.7.0 → 0.8.0-pre.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 +105 -14
- package/LICENSE +202 -21
- package/NOTICE +1 -0
- package/README.md +27 -10
- package/codemods/0.8.0-pre.json +61 -0
- package/dist/api-GVYEKSJE.js +19 -0
- package/dist/as/index.js +11 -11
- package/dist/at/index.js +9 -9
- package/dist/attestation/index.js +20 -20
- package/dist/{backup-IJTB4S4M.js → backup-7TFRVFLH.js} +21 -15
- package/dist/backup-7TFRVFLH.js.map +1 -0
- package/dist/blobs/index.js +13 -13
- package/dist/broker/index.js +12 -12
- package/dist/by/index.js +2 -2
- package/dist/cargo/index.js +39 -36
- package/dist/{chunk-7O3Y4PPD.js → chunk-244VXYPG.js} +140 -16
- package/dist/chunk-244VXYPG.js.map +1 -0
- package/dist/{chunk-BUE2D7PX.js → chunk-32YV3TJT.js} +2 -2
- package/dist/{chunk-3RCJJBNR.js → chunk-3ELRMVJK.js} +12 -12
- package/dist/{chunk-6GMZ7HEE.js → chunk-3F7GLNAE.js} +6 -6
- package/dist/{chunk-2Y4IMKA6.js → chunk-3H5KLDZN.js} +4 -4
- package/dist/{chunk-VTFVLCUH.js → chunk-3JWHAR6E.js} +2 -2
- package/dist/{chunk-YMUFFJCO.js → chunk-3TDUWVWB.js} +5 -2
- package/dist/chunk-3TDUWVWB.js.map +1 -0
- package/dist/{chunk-JBDFMYKQ.js → chunk-4AF3TUMP.js} +2 -2
- package/dist/{chunk-ZORTV6NH.js → chunk-4I522ERM.js} +88 -4
- package/dist/chunk-4I522ERM.js.map +1 -0
- package/dist/{chunk-MUM7IANK.js → chunk-4MXI3ODD.js} +4 -4
- package/dist/chunk-4MXI3ODD.js.map +1 -0
- package/dist/{chunk-BLN54W3L.js → chunk-5FDLC6G7.js} +56 -3
- package/dist/chunk-5FDLC6G7.js.map +1 -0
- package/dist/chunk-5O7D6ZTW.js +53 -0
- package/dist/chunk-5O7D6ZTW.js.map +1 -0
- package/dist/{chunk-J6FXAEUG.js → chunk-6B3VNR4P.js} +12 -12
- package/dist/{chunk-TUFM4UZP.js → chunk-6K7DPM7D.js} +2 -2
- package/dist/{chunk-K6LHRFBL.js → chunk-6LMQ5R26.js} +7 -7
- package/dist/{chunk-SPXXX5E4.js → chunk-6LNL42F5.js} +94 -32
- package/dist/chunk-6LNL42F5.js.map +1 -0
- package/dist/{chunk-XLMEZIAJ.js → chunk-6OWXYZK2.js} +2 -2
- package/dist/{chunk-BOWNCWZT.js → chunk-6QSQQLSE.js} +3 -3
- package/dist/chunk-7JE7BDYJ.js +1558 -0
- package/dist/chunk-7JE7BDYJ.js.map +1 -0
- package/dist/{chunk-KG7TZKZG.js → chunk-7VCXZDA4.js} +5 -5
- package/dist/chunk-7VCXZDA4.js.map +1 -0
- package/dist/{chunk-NQKIUNW5.js → chunk-A6IJU4TK.js} +2 -2
- package/dist/{chunk-BM5TWITZ.js → chunk-ANWPSTZU.js} +38 -9
- package/dist/chunk-ANWPSTZU.js.map +1 -0
- package/dist/{chunk-QIZPZMUI.js → chunk-AOWGXU6D.js} +2 -2
- package/dist/{chunk-CUZLNGD5.js → chunk-B2YY6WDD.js} +1 -1
- package/dist/chunk-B2YY6WDD.js.map +1 -0
- package/dist/{chunk-SFAWCTEM.js → chunk-B57AFBY2.js} +2 -2
- package/dist/{chunk-GPEQUXHL.js → chunk-B6SJIBQK.js} +4 -4
- package/dist/chunk-BJ2IXQ5Q.js +100 -0
- package/dist/chunk-BJ2IXQ5Q.js.map +1 -0
- package/dist/{chunk-Q2PU57HC.js → chunk-BK2HHQGN.js} +2 -2
- package/dist/chunk-BKT776R5.js +1 -0
- package/dist/{chunk-KUX3OB6D.js → chunk-BP6DARYA.js} +33 -5
- package/dist/chunk-BP6DARYA.js.map +1 -0
- package/dist/{chunk-FXBIP2WD.js → chunk-BUDAGWL5.js} +6 -6
- package/dist/chunk-CF5UU4S7.js +757 -0
- package/dist/chunk-CF5UU4S7.js.map +1 -0
- package/dist/{chunk-BOET4NA4.js → chunk-CKNGS5MH.js} +3 -3
- package/dist/chunk-CY2CYVWZ.js +41 -0
- package/dist/chunk-CY2CYVWZ.js.map +1 -0
- package/dist/{chunk-2577DKXB.js → chunk-DC5QVPV7.js} +2 -2
- package/dist/chunk-DC5QVPV7.js.map +1 -0
- package/dist/{chunk-YSRUYAVU.js → chunk-DE4DH2RZ.js} +2 -2
- package/dist/{chunk-6I2RQCET.js → chunk-DF73H4UN.js} +4 -4
- package/dist/{chunk-4GVM6QZA.js → chunk-ENAG3IY7.js} +2 -2
- package/dist/chunk-ENAG3IY7.js.map +1 -0
- package/dist/{chunk-K7NTTA6P.js → chunk-EOVMT6TB.js} +2 -2
- package/dist/chunk-F24ZZTHQ.js +193 -0
- package/dist/chunk-F24ZZTHQ.js.map +1 -0
- package/dist/chunk-F2TDU7MQ.js +456 -0
- package/dist/chunk-F2TDU7MQ.js.map +1 -0
- package/dist/chunk-F6NCB7KT.js +13 -0
- package/dist/chunk-F6NCB7KT.js.map +1 -0
- package/dist/{chunk-SPYWXKJN.js → chunk-F7XGHL5O.js} +3 -3
- package/dist/chunk-F7XGHL5O.js.map +1 -0
- package/dist/{chunk-XTXOCYOJ.js → chunk-FCKWQE2H.js} +5 -5
- package/dist/{chunk-U4FOQDY4.js → chunk-FH2L2E34.js} +4 -4
- package/dist/chunk-FH2L2E34.js.map +1 -0
- package/dist/{chunk-4OZNXTO4.js → chunk-FN5EBVTQ.js} +2 -2
- package/dist/chunk-FQ54DWUQ.js +270 -0
- package/dist/chunk-FQ54DWUQ.js.map +1 -0
- package/dist/{chunk-NKHRDYOR.js → chunk-FQ5VRHIB.js} +4 -4
- package/dist/{chunk-FAHMLERK.js → chunk-FW22ZCXT.js} +2 -2
- package/dist/chunk-FXQBGFOX.js +524 -0
- package/dist/chunk-FXQBGFOX.js.map +1 -0
- package/dist/{chunk-AO42KJO6.js → chunk-GF5BZ7D4.js} +45 -9
- package/dist/chunk-GF5BZ7D4.js.map +1 -0
- package/dist/{chunk-TRGTKX5E.js → chunk-GHLTDZRS.js} +5 -3
- package/dist/{chunk-TRGTKX5E.js.map → chunk-GHLTDZRS.js.map} +1 -1
- package/dist/{chunk-5WDXHNSW.js → chunk-HBPPGWUM.js} +5 -5
- package/dist/chunk-HBPPGWUM.js.map +1 -0
- package/dist/{chunk-KTFRCC5C.js → chunk-HBRLNOHL.js} +82 -8
- package/dist/chunk-HBRLNOHL.js.map +1 -0
- package/dist/chunk-HLEK5VAN.js +275 -0
- package/dist/chunk-HLEK5VAN.js.map +1 -0
- package/dist/{chunk-RMS3NEA3.js → chunk-HT2AHGQI.js} +2 -2
- package/dist/{chunk-CHJBLCOG.js → chunk-HVSCEIYL.js} +7 -7
- package/dist/{chunk-UXWB3FPF.js → chunk-I3JDRCMW.js} +150 -22
- package/dist/chunk-I3JDRCMW.js.map +1 -0
- package/dist/{chunk-GY4WYNNG.js → chunk-ID6Z6E66.js} +2 -2
- package/dist/{chunk-EYBQEIUY.js → chunk-IEX7NK2K.js} +3 -3
- package/dist/{chunk-KUJDV5QH.js → chunk-ISZQJBML.js} +5 -5
- package/dist/{chunk-LWBCUYZW.js → chunk-IT22PWKV.js} +2 -2
- package/dist/{chunk-EQEYOJBM.js → chunk-IUWCVHQ7.js} +3 -3
- package/dist/chunk-IUWCVHQ7.js.map +1 -0
- package/dist/{chunk-7V4TP3AF.js → chunk-J6UOHJY5.js} +4 -4
- package/dist/{chunk-JMGDHKQF.js → chunk-JCN44NCY.js} +2 -2
- package/dist/{chunk-CARABLSQ.js → chunk-K6W7BVZ6.js} +3 -3
- package/dist/{chunk-77K4PG6P.js → chunk-KJFW62P4.js} +29 -11
- package/dist/chunk-KJFW62P4.js.map +1 -0
- package/dist/{chunk-453F654R.js → chunk-L7DOS3TE.js} +2 -2
- package/dist/chunk-LGNDFRYC.js +23 -0
- package/dist/chunk-LGNDFRYC.js.map +1 -0
- package/dist/{chunk-WEQEYLCS.js → chunk-LGRLME4M.js} +7 -7
- package/dist/{chunk-RMF67KCG.js → chunk-LQ4ZHOKP.js} +2 -2
- package/dist/{chunk-ZVO4QVPD.js → chunk-M522UYZ2.js} +5 -5
- package/dist/{chunk-G56KBWFY.js → chunk-M7NI3IWE.js} +45 -12
- package/dist/chunk-M7NI3IWE.js.map +1 -0
- package/dist/chunk-MDWKM2XC.js +293 -0
- package/dist/chunk-MDWKM2XC.js.map +1 -0
- package/dist/chunk-MKXXMNJH.js +204 -0
- package/dist/chunk-MKXXMNJH.js.map +1 -0
- package/dist/{chunk-SKGMN35F.js → chunk-MLPHLJIQ.js} +3 -3
- package/dist/chunk-MLPHLJIQ.js.map +1 -0
- package/dist/{chunk-2N4GY74U.js → chunk-MTL7MXGR.js} +6 -6
- package/dist/{chunk-TFR7DSOV.js → chunk-MVZ2TPVP.js} +2 -2
- package/dist/{chunk-CPWQB3N5.js → chunk-N5DNADLQ.js} +7 -7
- package/dist/{chunk-ELNXJMGB.js → chunk-NNARWO72.js} +6 -6
- package/dist/{chunk-PT43Y56J.js → chunk-NRT6QZQB.js} +102 -16
- package/dist/chunk-NRT6QZQB.js.map +1 -0
- package/dist/{chunk-QIBVIOXO.js → chunk-NWHBJQAL.js} +99 -8
- package/dist/chunk-NWHBJQAL.js.map +1 -0
- package/dist/chunk-NYMLINRP.js +28 -0
- package/dist/chunk-NYMLINRP.js.map +1 -0
- package/dist/{chunk-7MG7SJT7.js → chunk-ODVPTDPK.js} +1 -1
- package/dist/chunk-ODVPTDPK.js.map +1 -0
- package/dist/chunk-ORDURZBU.js +461 -0
- package/dist/chunk-ORDURZBU.js.map +1 -0
- package/dist/{chunk-6YXCPL4T.js → chunk-PDCG6PR5.js} +2 -2
- package/dist/{chunk-REDOOY2Q.js → chunk-PSIV7CJV.js} +2 -2
- package/dist/{chunk-NA2NIJZI.js → chunk-QBBUZ3I3.js} +126 -19
- package/dist/chunk-QBBUZ3I3.js.map +1 -0
- package/dist/{chunk-5VCRVKOZ.js → chunk-QOOUUR4A.js} +6 -4
- package/dist/{chunk-5VCRVKOZ.js.map → chunk-QOOUUR4A.js.map} +1 -1
- package/dist/{chunk-ANATMFIO.js → chunk-QWFHIOD2.js} +5 -5
- package/dist/{chunk-X2DLENDQ.js → chunk-QWGU66MP.js} +3 -3
- package/dist/chunk-RHVMZSUU.js +7 -0
- package/dist/chunk-RHVMZSUU.js.map +1 -0
- package/dist/{chunk-BSFNRLK2.js → chunk-S57HTZ6X.js} +5 -5
- package/dist/{chunk-SZJ3DLZA.js → chunk-SEE332EV.js} +2 -2
- package/dist/{chunk-YYP7WSEB.js → chunk-SI3V7D4G.js} +2 -2
- package/dist/{chunk-UGTBXF5U.js → chunk-SOIQ4MM4.js} +3 -3
- package/dist/chunk-SUZKW6UR.js +25 -0
- package/dist/chunk-SUZKW6UR.js.map +1 -0
- package/dist/{chunk-VXGSWL6L.js → chunk-SYVZW77S.js} +6 -6
- package/dist/{chunk-6GOE5PGN.js → chunk-T2LBQ5DV.js} +883 -227
- package/dist/chunk-T2LBQ5DV.js.map +1 -0
- package/dist/chunk-T52GX4SA.js +215 -0
- package/dist/chunk-T52GX4SA.js.map +1 -0
- package/dist/{chunk-MVMXZYXT.js → chunk-TKUOEU2F.js} +2 -2
- package/dist/chunk-TOPYQ6GA.js +31 -0
- package/dist/chunk-TOPYQ6GA.js.map +1 -0
- package/dist/{chunk-SMH6SRX7.js → chunk-TROR3ALR.js} +2 -2
- package/dist/{chunk-2C3AQB46.js → chunk-UD5EVGZ7.js} +42 -389
- package/dist/chunk-UD5EVGZ7.js.map +1 -0
- package/dist/{chunk-KJIMGIWO.js → chunk-UPD5NWI5.js} +65 -17
- package/dist/chunk-UPD5NWI5.js.map +1 -0
- package/dist/{chunk-SL3JAAKN.js → chunk-UYB234ZR.js} +30 -2
- package/dist/chunk-UYB234ZR.js.map +1 -0
- package/dist/chunk-VHM7HCKB.js +220 -0
- package/dist/chunk-VHM7HCKB.js.map +1 -0
- package/dist/{chunk-DGOZ4UZD.js → chunk-VNNRUGMM.js} +2 -2
- package/dist/{chunk-HDOU6I2Y.js → chunk-VNPEWFPD.js} +4 -4
- package/dist/{chunk-L7CIOOBW.js → chunk-WNJ4AVGE.js} +2 -2
- package/dist/{chunk-FMZY5Q6L.js → chunk-WX5ADGTZ.js} +3 -3
- package/dist/{chunk-VXANTWBJ.js → chunk-WY2XXTET.js} +92 -6
- package/dist/{chunk-VXANTWBJ.js.map → chunk-WY2XXTET.js.map} +1 -1
- package/dist/{chunk-6X6SEMEE.js → chunk-X25NWUZB.js} +33 -8
- package/dist/chunk-X25NWUZB.js.map +1 -0
- package/dist/{chunk-Q7HZX3IF.js → chunk-X4773RBR.js} +2 -2
- package/dist/chunk-XBKH4FOC.js +195 -0
- package/dist/chunk-XBKH4FOC.js.map +1 -0
- package/dist/{chunk-ANSIZYEG.js → chunk-YNIUIERI.js} +3 -3
- package/dist/chunk-YSK2CU2Q.js +936 -0
- package/dist/chunk-YSK2CU2Q.js.map +1 -0
- package/dist/{chunk-UXVWEX5L.js → chunk-Z5HTYMMQ.js} +6 -2
- package/dist/chunk-Z5HTYMMQ.js.map +1 -0
- package/dist/{chunk-RRNRNANG.js → chunk-ZE4CHIED.js} +66 -75
- package/dist/chunk-ZE4CHIED.js.map +1 -0
- package/dist/chunk-ZSX4S5XB.js +1289 -0
- package/dist/chunk-ZSX4S5XB.js.map +1 -0
- package/dist/{chunk-BZ3534YM.js → chunk-ZUVBC32X.js} +2 -2
- package/dist/{chunk-L742JPKZ.js → chunk-ZXABPVM6.js} +6 -6
- package/dist/classified/index.js +5 -5
- package/dist/{classified-marker-LI2SF2E4.js → classified-marker-W3USLL5M.js} +3 -3
- package/dist/collection-facade-QU6IJBN3.js +48 -0
- package/dist/{computed-VPOKQK4N.js → computed-TPFBX7U4.js} +3 -3
- package/dist/consent/index.js +9 -9
- package/dist/cover/index.js +10 -10
- package/dist/coverage/index.js +306 -0
- package/dist/coverage/index.js.map +1 -0
- package/dist/custody/index.js +12 -12
- package/dist/{dead-filter-TSWZQRR5.js → dead-filter-U2UYKSZL.js} +2 -2
- package/dist/debug/index.js +1 -1
- package/dist/{delegation-OVIFFPG4.js → delegation-S3AEPW2T.js} +11 -11
- package/dist/derivations/index.js +25 -22
- package/dist/derive-OX7F6TGG.js +21 -0
- package/dist/directory/index.js +10 -10
- package/dist/{dispatch-WC6X2M6C.js → dispatch-3CQDJV5Q.js} +5 -5
- package/dist/{dispatch-S73TK3IY.js → dispatch-RH4LHKBH.js} +21 -21
- package/dist/{enclave-KJOTOH7X.js → enclave-27SMF6GF.js} +15 -9
- package/dist/executor-B6SRO2QS.js +36 -0
- package/dist/executor-BI5CHWRY.js +8 -0
- package/dist/executor-RBKM5W5K.js +8 -0
- package/dist/export-accessible-VMA3YM5V.js +22 -0
- package/dist/extract-partition-NF7PXGPP.js +37 -0
- package/dist/{fanout-sidecar-WUFXNYP4.js → fanout-sidecar-OT6RYLOL.js} +9 -9
- package/dist/find-LZMP26KF.js +10 -0
- package/dist/forget/index.js +9 -9
- package/dist/guards/index.js +4 -4
- package/dist/history/index.js +13 -13
- package/dist/i18n/index.js +14 -14
- package/dist/index.d.ts +29 -6
- package/dist/index.js +999 -191
- package/dist/index.js.map +1 -1
- package/dist/indexing/index.js +13 -5
- package/dist/indexing/index.js.map +1 -1
- package/dist/introspection/index.js +11 -11
- package/dist/issue-IHARXWW5.js +18 -0
- package/dist/ivf-flat-UZ6DQDLS.js +314 -0
- package/dist/ivf-flat-UZ6DQDLS.js.map +1 -0
- package/dist/{json-schema-V3M5MUCM.js → json-schema-3SHX72CC.js} +2 -1
- package/dist/json-schema-3SHX72CC.js.map +1 -0
- package/dist/kernel/collection-config.d.ts +4 -20
- package/dist/kernel/collection.d.ts +29 -8
- package/dist/kernel/enclave/crypto.d.ts +16 -0
- package/dist/kernel/enclave/index.d.ts +1 -1
- package/dist/kernel/enclave/record-keys/record-codec.d.ts +25 -0
- package/dist/kernel/errors.d.ts +227 -36
- package/dist/kernel/generation-map.d.ts +48 -0
- package/dist/kernel/memory-store.d.ts +35 -7
- package/dist/kernel/noydb.d.ts +6 -1
- package/dist/kernel/present-cache.d.ts +58 -0
- package/dist/kernel/query/all.d.ts +7 -0
- package/dist/kernel/query/builder.d.ts +601 -270
- package/dist/kernel/query/civil-date.d.ts +64 -0
- package/dist/kernel/query/cursor.d.ts +40 -0
- package/dist/kernel/query/distinct-key.d.ts +98 -0
- package/dist/kernel/query/hydration.d.ts +76 -0
- package/dist/kernel/query/index.d.ts +31 -15
- package/dist/kernel/query/internal/core.d.ts +30 -0
- package/dist/kernel/query/internal/hooks.d.ts +22 -0
- package/dist/kernel/query/internal/maintenance.d.ts +43 -0
- package/dist/kernel/query/live/incremental.d.ts +314 -0
- package/dist/kernel/query/live/index.d.ts +22 -0
- package/dist/kernel/query/live/install.d.ts +2 -0
- package/dist/kernel/query/{live.d.ts → live/live.d.ts} +39 -9
- package/dist/kernel/query/live/methods.d.ts +107 -0
- package/dist/kernel/query/predicate.d.ts +119 -1
- package/dist/kernel/query/reduce/date-trunc.d.ts +75 -0
- package/dist/kernel/query/reduce/index.d.ts +36 -0
- package/dist/kernel/query/reduce/install.d.ts +2 -0
- package/dist/kernel/query/reduce/methods.d.ts +259 -0
- package/dist/kernel/query/reduce/scan-methods.d.ts +121 -0
- package/dist/kernel/query/relate/explain.d.ts +199 -0
- package/dist/kernel/query/relate/index.d.ts +48 -0
- package/dist/kernel/query/relate/install.d.ts +2 -0
- package/dist/kernel/query/relate/join-on.d.ts +126 -0
- package/dist/kernel/query/relate/join-reduce.d.ts +16 -0
- package/dist/kernel/query/relate/join.d.ts +452 -0
- package/dist/kernel/query/relate/methods.d.ts +426 -0
- package/dist/kernel/query/relate/partition.d.ts +87 -0
- package/dist/kernel/query/relate/scan-methods.d.ts +163 -0
- package/dist/kernel/query/relate/traverse.d.ts +109 -0
- package/dist/kernel/query/scan-builder.d.ts +79 -176
- package/dist/kernel/query/sort-key.d.ts +52 -0
- package/dist/kernel/tx-write-gate.d.ts +77 -0
- package/dist/kernel/types.d.ts +71 -3
- package/dist/kernel/validation.d.ts +27 -10
- package/dist/kernel/vault.d.ts +9 -4
- package/dist/kernel/via/compose.d.ts +3 -0
- package/dist/kernel/via/index.d.ts +56 -0
- package/dist/kernel/via/pipeline.d.ts +48 -0
- package/dist/{ledger-F33ZVMTK.js → ledger-KZPCMVZY.js} +11 -11
- package/dist/liberate-GRLCZMW4.js +24 -0
- package/dist/link-set-JCMJ7ULP.js +30 -0
- package/dist/{managed-secret-PQYKSR6T.js → managed-secret-S3MQ6SH6.js} +10 -10
- package/dist/materialized-views/index.js +30 -23
- package/dist/{migrate-cek-5ENH64AA.js → migrate-cek-V7GKJZ7O.js} +2 -2
- package/dist/money/index.js +5 -5
- package/dist/noydb-SWQJ3MZS.js +97 -0
- package/dist/overlay-views/index.js +4 -4
- package/dist/periods/index.js +12 -12
- package/dist/pod/index.js +75 -68
- package/dist/{pod-handle-Q736KYON.js → pod-handle-WGDFB4C2.js} +9 -9
- package/dist/policy/index.js +10 -10
- package/dist/port/with/blob-strategy.d.ts +9 -0
- package/dist/port/with/collection-options.d.ts +5 -0
- package/dist/port/with/coverage-strategy.d.ts +83 -0
- package/dist/port/with/service-bus.d.ts +46 -0
- package/dist/port/with/strategies.d.ts +2 -0
- package/dist/portability/index.js +8 -8
- package/dist/{post-register-LNE2FE2A.js → post-register-SLSXIPBV.js} +6 -6
- package/dist/query/all/index.js +31 -0
- package/dist/query/index.js +20 -32
- package/dist/query/live/index.js +21 -0
- package/dist/query/live/index.js.map +1 -0
- package/dist/query/reduce/index.js +33 -0
- package/dist/query/reduce/index.js.map +1 -0
- package/dist/query/relate/index.js +56 -0
- package/dist/query/relate/index.js.map +1 -0
- package/dist/reduce/index.js +72 -18
- package/dist/reduce/index.js.map +1 -1
- package/dist/register-F3OYE7MJ.js +31 -0
- package/dist/registry-CILQFXFK.js +8 -0
- package/dist/registry-XNNYQVKV.js +8 -0
- package/dist/registry-YCDZV3VW.js +35 -0
- package/dist/registry-ZGYS33TE.js +24 -0
- package/dist/request-withdrawal-Z5NC6TXT.js +30 -0
- package/dist/{reveal-67RDQRIN.js → reveal-4BCKPEC2.js} +6 -6
- package/dist/revoke-ZL62WC2D.js +23 -0
- package/dist/satellites/index.js +1 -1
- package/dist/schema-update/index.js +2 -2
- package/dist/sealed-record/index.js +12 -12
- package/dist/search/index.js +11 -5
- package/dist/{seed-G42JYN56.js → seed-4JS2RJ4A.js} +12 -12
- package/dist/sequence/index.js +9 -9
- package/dist/session/index.js +9 -9
- package/dist/shadow/index.js +2 -2
- package/dist/signer-MBZZMXTC.js +24 -0
- package/dist/snapshots/index.js +10 -10
- package/dist/{stale-DDL7WQEZ.js → stale-TJ3DYZMQ.js} +10 -10
- package/dist/storage-SVMKRGCW.js +22 -0
- package/dist/{store-coordination-provider-MEQ2MJQG.js → store-coordination-provider-2O2VUHKW.js} +10 -10
- package/dist/sync/index.js +10 -10
- package/dist/team/index.js +17 -15
- package/dist/tiers/index.js +13 -11
- package/dist/to/index.js +2 -2
- package/dist/transactions/index.js +3 -3
- package/dist/util/index.js +1 -1
- package/dist/vault-head/index.js +8 -8
- package/dist/{verify-KOV2G5D6.js → verify-RVT67IMH.js} +5 -5
- package/dist/via/blob/index.d.ts +1 -0
- package/dist/via/geo/binding.d.ts +31 -0
- package/dist/via/geo/descriptor.d.ts +54 -0
- package/dist/via/geo/geohash.d.ts +95 -0
- package/dist/via/geo/index.d.ts +13 -0
- package/dist/via/geo/where.d.ts +50 -0
- package/dist/via/i18n/core.d.ts +1 -1
- package/dist/via/lookup/registry.d.ts +1 -1
- package/dist/via/lookup/snapshot.d.ts +3 -3
- package/dist/walk-HJ42EISE.js +21 -0
- package/dist/walk-HJ42EISE.js.map +1 -0
- package/dist/with-audit/coverage/accounting.d.ts +112 -0
- package/dist/with-audit/coverage/active.d.ts +29 -0
- package/dist/with-audit/coverage/index.d.ts +61 -0
- package/dist/with-audit/coverage/sketch.d.ts +75 -0
- package/dist/with-audit/periods/periods.d.ts +55 -7
- package/dist/with-audit/periods/reserved-collections.d.ts +3 -0
- package/dist/with-audit/periods/vault-facade.d.ts +17 -0
- package/dist/with-audit/tiers/index.d.ts +51 -0
- package/dist/with-audit/tiers/strategy.d.ts +8 -0
- package/dist/with-cargo/floor.d.ts +2 -2
- package/dist/with-commit/tx/invariants.d.ts +1 -1
- package/dist/with-commit/tx/transaction.d.ts +13 -3
- package/dist/with-formula/materialized-views/dependency-analyzer.d.ts +4 -3
- package/dist/with-formula/materialized-views/emit-memo.d.ts +40 -0
- package/dist/with-formula/materialized-views/executor.d.ts +8 -0
- package/dist/with-formula/materialized-views/index.d.ts +1 -1
- package/dist/with-formula/materialized-views/registry.d.ts +15 -0
- package/dist/with-formula/materialized-views/types.d.ts +106 -14
- package/dist/with-formula/materialized-views/window-stage.d.ts +11 -0
- package/dist/with-formula/overlay-views/types.d.ts +1 -1
- package/dist/with-formula/overlay-views/virtual-collection.d.ts +13 -4
- package/dist/with-lookup/embeddings/chunks.d.ts +79 -0
- package/dist/with-lookup/embeddings/descriptor.d.ts +21 -0
- package/dist/with-lookup/embeddings/index.d.ts +3 -0
- package/dist/with-lookup/embeddings/ivf-flat.d.ts +93 -0
- package/dist/with-lookup/embeddings/vector-index.d.ts +73 -0
- package/dist/with-lookup/embeddings/vector-set.d.ts +94 -1
- package/dist/with-lookup/embeddings/with-vector-index.d.ts +67 -0
- package/dist/with-lookup/indexing/collection-facade.d.ts +85 -2
- package/dist/with-lookup/indexing/compound-indexes.d.ts +129 -0
- package/dist/with-lookup/indexing/eager-indexes.d.ts +170 -1
- package/dist/with-lookup/indexing/index-snapshot.d.ts +62 -0
- package/dist/with-lookup/indexing/lazy-builder.d.ts +33 -0
- package/dist/with-lookup/indexing/persisted-field-indexes.d.ts +104 -0
- package/dist/with-lookup/indexing/persisted-indexes.d.ts +12 -0
- package/dist/with-lookup/indexing/sorted-indexes.d.ts +117 -0
- package/dist/with-lookup/indexing/unique-constraints.d.ts +106 -23
- package/dist/with-lookup/reduce/active.d.ts +2 -24
- package/dist/with-lookup/reduce/group-core.d.ts +43 -0
- package/dist/with-lookup/reduce/groupby.d.ts +195 -36
- package/dist/with-lookup/reduce/incremental-group.d.ts +153 -0
- package/dist/with-lookup/reduce/index.d.ts +26 -5
- package/dist/with-lookup/reduce/reducers.d.ts +255 -1
- package/dist/with-lookup/reduce/reduction.d.ts +44 -13
- package/dist/with-lookup/reduce/strategy.d.ts +43 -3
- package/dist/with-lookup/reduce/window.d.ts +262 -0
- package/dist/with-lookup/search/collection-facade.d.ts +44 -8
- package/dist/with-lookup/search/index-store.d.ts +5 -3
- package/dist/with-lookup/search/index.d.ts +4 -2
- package/dist/with-lookup/search/inverted-index.d.ts +38 -2
- package/dist/with-lookup/search/persisted-index-store.d.ts +5 -2
- package/dist/with-lookup/search/phrase.d.ts +28 -0
- package/dist/with-lookup/search/retrieve-types.d.ts +57 -1
- package/dist/with-lookup/search/serialize.d.ts +29 -3
- package/dist/with-lookup/search/strategy.d.ts +2 -6
- package/dist/with-party/directory/cover/index.d.ts +1 -1
- package/dist/with-party/directory/cover/storage.d.ts +1 -1
- package/dist/with-party/directory/cover/types.d.ts +1 -1
- package/dist/with-party/directory/index.d.ts +1 -1
- package/dist/with-party/directory/types.d.ts +1 -1
- package/dist/with-party/directory/user-envelope/api.d.ts +1 -1
- package/dist/with-party/policy/engine.d.ts +1 -1
- package/dist/with-party/policy/index.d.ts +1 -1
- package/dist/with-party/policy/presets.d.ts +1 -1
- package/dist/with-party/team/authenticators.d.ts +91 -1
- package/dist/with-party/team/index.d.ts +3 -2
- package/dist/with-party/team/keyring.d.ts +13 -6
- package/dist/with-party/team/managed-secret.d.ts +1 -1
- package/dist/with-party/team/noydb-facade.d.ts +12 -3
- package/dist/with-party/team/wrapped-deks.d.ts +4 -4
- package/dist/with-pod/format.d.ts +1 -1
- package/dist/with-pod/pod.d.ts +5 -5
- package/dist/with-shape/blobs/blob-compaction.d.ts +16 -0
- package/dist/with-shape/blobs/blob-set.d.ts +21 -2
- package/dist/with-shape/blobs/legacy-sweep.d.ts +35 -0
- package/dist/with-shape/introspection/describe.d.ts +6 -0
- package/dist/with-shape/introspection/field-meta.d.ts +18 -0
- package/dist/with-shape/introspection/types.d.ts +57 -1
- package/dist/with-shape/links/vault-facade.d.ts +1 -1
- package/dist/with-store/partitioned/index.d.ts +337 -0
- package/dist/with-sync/change-broadcast.d.ts +153 -0
- package/dist/withdraw-accessible-5NZUPAVA.js +27 -0
- package/dist/withdraw-accessible-5NZUPAVA.js.map +1 -0
- package/package.json +37 -10
- package/dist/api-TXFOVOXX.js +0 -19
- package/dist/backup-IJTB4S4M.js.map +0 -1
- package/dist/chunk-2577DKXB.js.map +0 -1
- package/dist/chunk-2C3AQB46.js.map +0 -1
- package/dist/chunk-4GVM6QZA.js.map +0 -1
- package/dist/chunk-5WDXHNSW.js.map +0 -1
- package/dist/chunk-6GOE5PGN.js.map +0 -1
- package/dist/chunk-6X6SEMEE.js.map +0 -1
- package/dist/chunk-77K4PG6P.js.map +0 -1
- package/dist/chunk-7MG2LHO5.js +0 -1616
- package/dist/chunk-7MG2LHO5.js.map +0 -1
- package/dist/chunk-7MG7SJT7.js.map +0 -1
- package/dist/chunk-7O3Y4PPD.js.map +0 -1
- package/dist/chunk-AO42KJO6.js.map +0 -1
- package/dist/chunk-ATL3ZVXT.js +0 -151
- package/dist/chunk-ATL3ZVXT.js.map +0 -1
- package/dist/chunk-BLN54W3L.js.map +0 -1
- package/dist/chunk-BM5TWITZ.js.map +0 -1
- package/dist/chunk-CUZLNGD5.js.map +0 -1
- package/dist/chunk-EQEYOJBM.js.map +0 -1
- package/dist/chunk-G56KBWFY.js.map +0 -1
- package/dist/chunk-I3ISCYT7.js +0 -159
- package/dist/chunk-I3ISCYT7.js.map +0 -1
- package/dist/chunk-KG7TZKZG.js.map +0 -1
- package/dist/chunk-KJIMGIWO.js.map +0 -1
- package/dist/chunk-KTFRCC5C.js.map +0 -1
- package/dist/chunk-KUX3OB6D.js.map +0 -1
- package/dist/chunk-MUM7IANK.js.map +0 -1
- package/dist/chunk-NA2NIJZI.js.map +0 -1
- package/dist/chunk-NSITFOCJ.js +0 -99
- package/dist/chunk-NSITFOCJ.js.map +0 -1
- package/dist/chunk-PT43Y56J.js.map +0 -1
- package/dist/chunk-QIBVIOXO.js.map +0 -1
- package/dist/chunk-RRNRNANG.js.map +0 -1
- package/dist/chunk-RTBJ5IOO.js +0 -87
- package/dist/chunk-RTBJ5IOO.js.map +0 -1
- package/dist/chunk-SKGMN35F.js.map +0 -1
- package/dist/chunk-SL3JAAKN.js.map +0 -1
- package/dist/chunk-SPXXX5E4.js.map +0 -1
- package/dist/chunk-SPYWXKJN.js.map +0 -1
- package/dist/chunk-U4FOQDY4.js.map +0 -1
- package/dist/chunk-UXVWEX5L.js.map +0 -1
- package/dist/chunk-UXWB3FPF.js.map +0 -1
- package/dist/chunk-YMUFFJCO.js.map +0 -1
- package/dist/chunk-ZN4FD4PE.js +0 -364
- package/dist/chunk-ZN4FD4PE.js.map +0 -1
- package/dist/chunk-ZORTV6NH.js.map +0 -1
- package/dist/collection-facade-4GRREZ6C.js +0 -45
- package/dist/derive-6O5SWQKN.js +0 -21
- package/dist/executor-5NIMLSKZ.js +0 -8
- package/dist/executor-AQVXV5GZ.js +0 -8
- package/dist/executor-PUAO6AKJ.js +0 -29
- package/dist/export-accessible-72EQNBMR.js +0 -22
- package/dist/extract-partition-PUYNU3UF.js +0 -37
- package/dist/find-2ABFCZX4.js +0 -10
- package/dist/issue-SIDORTSZ.js +0 -18
- package/dist/json-schema-V3M5MUCM.js.map +0 -1
- package/dist/kernel/query/join.d.ts +0 -232
- package/dist/liberate-LCDPNAG2.js +0 -24
- package/dist/link-set-FKNWAYKS.js +0 -30
- package/dist/noydb-DUXZPKSN.js +0 -90
- package/dist/register-I2DZXGAR.js +0 -31
- package/dist/registry-23WF3TGH.js +0 -8
- package/dist/registry-4AYVUNXK.js +0 -8
- package/dist/registry-VSSQPIGF.js +0 -18
- package/dist/registry-YLEWMGAC.js +0 -32
- package/dist/request-withdrawal-KFQHEZ25.js +0 -30
- package/dist/revoke-DQDZAZZM.js +0 -23
- package/dist/signer-WAMDZHEN.js +0 -24
- package/dist/storage-FLR73HHF.js +0 -22
- package/dist/walk-3UQBRMDV.js +0 -21
- package/dist/withdraw-accessible-EL5GXZBS.js +0 -27
- /package/dist/{api-TXFOVOXX.js.map → api-GVYEKSJE.js.map} +0 -0
- /package/dist/{chunk-BUE2D7PX.js.map → chunk-32YV3TJT.js.map} +0 -0
- /package/dist/{chunk-3RCJJBNR.js.map → chunk-3ELRMVJK.js.map} +0 -0
- /package/dist/{chunk-6GMZ7HEE.js.map → chunk-3F7GLNAE.js.map} +0 -0
- /package/dist/{chunk-2Y4IMKA6.js.map → chunk-3H5KLDZN.js.map} +0 -0
- /package/dist/{chunk-VTFVLCUH.js.map → chunk-3JWHAR6E.js.map} +0 -0
- /package/dist/{chunk-JBDFMYKQ.js.map → chunk-4AF3TUMP.js.map} +0 -0
- /package/dist/{chunk-J6FXAEUG.js.map → chunk-6B3VNR4P.js.map} +0 -0
- /package/dist/{chunk-TUFM4UZP.js.map → chunk-6K7DPM7D.js.map} +0 -0
- /package/dist/{chunk-K6LHRFBL.js.map → chunk-6LMQ5R26.js.map} +0 -0
- /package/dist/{chunk-XLMEZIAJ.js.map → chunk-6OWXYZK2.js.map} +0 -0
- /package/dist/{chunk-BOWNCWZT.js.map → chunk-6QSQQLSE.js.map} +0 -0
- /package/dist/{chunk-NQKIUNW5.js.map → chunk-A6IJU4TK.js.map} +0 -0
- /package/dist/{chunk-QIZPZMUI.js.map → chunk-AOWGXU6D.js.map} +0 -0
- /package/dist/{chunk-SFAWCTEM.js.map → chunk-B57AFBY2.js.map} +0 -0
- /package/dist/{chunk-GPEQUXHL.js.map → chunk-B6SJIBQK.js.map} +0 -0
- /package/dist/{chunk-Q2PU57HC.js.map → chunk-BK2HHQGN.js.map} +0 -0
- /package/dist/{collection-facade-4GRREZ6C.js.map → chunk-BKT776R5.js.map} +0 -0
- /package/dist/{chunk-FXBIP2WD.js.map → chunk-BUDAGWL5.js.map} +0 -0
- /package/dist/{chunk-BOET4NA4.js.map → chunk-CKNGS5MH.js.map} +0 -0
- /package/dist/{chunk-YSRUYAVU.js.map → chunk-DE4DH2RZ.js.map} +0 -0
- /package/dist/{chunk-6I2RQCET.js.map → chunk-DF73H4UN.js.map} +0 -0
- /package/dist/{chunk-K7NTTA6P.js.map → chunk-EOVMT6TB.js.map} +0 -0
- /package/dist/{chunk-XTXOCYOJ.js.map → chunk-FCKWQE2H.js.map} +0 -0
- /package/dist/{chunk-4OZNXTO4.js.map → chunk-FN5EBVTQ.js.map} +0 -0
- /package/dist/{chunk-NKHRDYOR.js.map → chunk-FQ5VRHIB.js.map} +0 -0
- /package/dist/{chunk-FAHMLERK.js.map → chunk-FW22ZCXT.js.map} +0 -0
- /package/dist/{chunk-RMS3NEA3.js.map → chunk-HT2AHGQI.js.map} +0 -0
- /package/dist/{chunk-CHJBLCOG.js.map → chunk-HVSCEIYL.js.map} +0 -0
- /package/dist/{chunk-GY4WYNNG.js.map → chunk-ID6Z6E66.js.map} +0 -0
- /package/dist/{chunk-EYBQEIUY.js.map → chunk-IEX7NK2K.js.map} +0 -0
- /package/dist/{chunk-KUJDV5QH.js.map → chunk-ISZQJBML.js.map} +0 -0
- /package/dist/{chunk-LWBCUYZW.js.map → chunk-IT22PWKV.js.map} +0 -0
- /package/dist/{chunk-7V4TP3AF.js.map → chunk-J6UOHJY5.js.map} +0 -0
- /package/dist/{chunk-JMGDHKQF.js.map → chunk-JCN44NCY.js.map} +0 -0
- /package/dist/{chunk-CARABLSQ.js.map → chunk-K6W7BVZ6.js.map} +0 -0
- /package/dist/{chunk-453F654R.js.map → chunk-L7DOS3TE.js.map} +0 -0
- /package/dist/{chunk-WEQEYLCS.js.map → chunk-LGRLME4M.js.map} +0 -0
- /package/dist/{chunk-RMF67KCG.js.map → chunk-LQ4ZHOKP.js.map} +0 -0
- /package/dist/{chunk-ZVO4QVPD.js.map → chunk-M522UYZ2.js.map} +0 -0
- /package/dist/{chunk-2N4GY74U.js.map → chunk-MTL7MXGR.js.map} +0 -0
- /package/dist/{chunk-TFR7DSOV.js.map → chunk-MVZ2TPVP.js.map} +0 -0
- /package/dist/{chunk-CPWQB3N5.js.map → chunk-N5DNADLQ.js.map} +0 -0
- /package/dist/{chunk-ELNXJMGB.js.map → chunk-NNARWO72.js.map} +0 -0
- /package/dist/{chunk-6YXCPL4T.js.map → chunk-PDCG6PR5.js.map} +0 -0
- /package/dist/{chunk-REDOOY2Q.js.map → chunk-PSIV7CJV.js.map} +0 -0
- /package/dist/{chunk-ANATMFIO.js.map → chunk-QWFHIOD2.js.map} +0 -0
- /package/dist/{chunk-X2DLENDQ.js.map → chunk-QWGU66MP.js.map} +0 -0
- /package/dist/{chunk-BSFNRLK2.js.map → chunk-S57HTZ6X.js.map} +0 -0
- /package/dist/{chunk-SZJ3DLZA.js.map → chunk-SEE332EV.js.map} +0 -0
- /package/dist/{chunk-YYP7WSEB.js.map → chunk-SI3V7D4G.js.map} +0 -0
- /package/dist/{chunk-UGTBXF5U.js.map → chunk-SOIQ4MM4.js.map} +0 -0
- /package/dist/{chunk-VXGSWL6L.js.map → chunk-SYVZW77S.js.map} +0 -0
- /package/dist/{chunk-MVMXZYXT.js.map → chunk-TKUOEU2F.js.map} +0 -0
- /package/dist/{chunk-SMH6SRX7.js.map → chunk-TROR3ALR.js.map} +0 -0
- /package/dist/{chunk-DGOZ4UZD.js.map → chunk-VNNRUGMM.js.map} +0 -0
- /package/dist/{chunk-HDOU6I2Y.js.map → chunk-VNPEWFPD.js.map} +0 -0
- /package/dist/{chunk-L7CIOOBW.js.map → chunk-WNJ4AVGE.js.map} +0 -0
- /package/dist/{chunk-FMZY5Q6L.js.map → chunk-WX5ADGTZ.js.map} +0 -0
- /package/dist/{chunk-Q7HZX3IF.js.map → chunk-X4773RBR.js.map} +0 -0
- /package/dist/{chunk-ANSIZYEG.js.map → chunk-YNIUIERI.js.map} +0 -0
- /package/dist/{chunk-BZ3534YM.js.map → chunk-ZUVBC32X.js.map} +0 -0
- /package/dist/{chunk-L742JPKZ.js.map → chunk-ZXABPVM6.js.map} +0 -0
- /package/dist/{classified-marker-LI2SF2E4.js.map → classified-marker-W3USLL5M.js.map} +0 -0
- /package/dist/{computed-VPOKQK4N.js.map → collection-facade-QU6IJBN3.js.map} +0 -0
- /package/dist/{derive-6O5SWQKN.js.map → computed-TPFBX7U4.js.map} +0 -0
- /package/dist/{dead-filter-TSWZQRR5.js.map → dead-filter-U2UYKSZL.js.map} +0 -0
- /package/dist/{delegation-OVIFFPG4.js.map → delegation-S3AEPW2T.js.map} +0 -0
- /package/dist/{enclave-KJOTOH7X.js.map → derive-OX7F6TGG.js.map} +0 -0
- /package/dist/{dispatch-WC6X2M6C.js.map → dispatch-3CQDJV5Q.js.map} +0 -0
- /package/dist/{dispatch-S73TK3IY.js.map → dispatch-RH4LHKBH.js.map} +0 -0
- /package/dist/{executor-5NIMLSKZ.js.map → enclave-27SMF6GF.js.map} +0 -0
- /package/dist/{executor-AQVXV5GZ.js.map → executor-B6SRO2QS.js.map} +0 -0
- /package/dist/{executor-PUAO6AKJ.js.map → executor-BI5CHWRY.js.map} +0 -0
- /package/dist/{export-accessible-72EQNBMR.js.map → executor-RBKM5W5K.js.map} +0 -0
- /package/dist/{extract-partition-PUYNU3UF.js.map → export-accessible-VMA3YM5V.js.map} +0 -0
- /package/dist/{find-2ABFCZX4.js.map → extract-partition-NF7PXGPP.js.map} +0 -0
- /package/dist/{fanout-sidecar-WUFXNYP4.js.map → fanout-sidecar-OT6RYLOL.js.map} +0 -0
- /package/dist/{issue-SIDORTSZ.js.map → find-LZMP26KF.js.map} +0 -0
- /package/dist/{ledger-F33ZVMTK.js.map → issue-IHARXWW5.js.map} +0 -0
- /package/dist/{liberate-LCDPNAG2.js.map → ledger-KZPCMVZY.js.map} +0 -0
- /package/dist/{link-set-FKNWAYKS.js.map → liberate-GRLCZMW4.js.map} +0 -0
- /package/dist/{managed-secret-PQYKSR6T.js.map → link-set-JCMJ7ULP.js.map} +0 -0
- /package/dist/{noydb-DUXZPKSN.js.map → managed-secret-S3MQ6SH6.js.map} +0 -0
- /package/dist/{migrate-cek-5ENH64AA.js.map → migrate-cek-V7GKJZ7O.js.map} +0 -0
- /package/dist/{register-I2DZXGAR.js.map → noydb-SWQJ3MZS.js.map} +0 -0
- /package/dist/{pod-handle-Q736KYON.js.map → pod-handle-WGDFB4C2.js.map} +0 -0
- /package/dist/{post-register-LNE2FE2A.js.map → post-register-SLSXIPBV.js.map} +0 -0
- /package/dist/{registry-23WF3TGH.js.map → query/all/index.js.map} +0 -0
- /package/dist/{registry-4AYVUNXK.js.map → register-F3OYE7MJ.js.map} +0 -0
- /package/dist/{registry-VSSQPIGF.js.map → registry-CILQFXFK.js.map} +0 -0
- /package/dist/{registry-YLEWMGAC.js.map → registry-XNNYQVKV.js.map} +0 -0
- /package/dist/{request-withdrawal-KFQHEZ25.js.map → registry-YCDZV3VW.js.map} +0 -0
- /package/dist/{revoke-DQDZAZZM.js.map → registry-ZGYS33TE.js.map} +0 -0
- /package/dist/{signer-WAMDZHEN.js.map → request-withdrawal-Z5NC6TXT.js.map} +0 -0
- /package/dist/{reveal-67RDQRIN.js.map → reveal-4BCKPEC2.js.map} +0 -0
- /package/dist/{stale-DDL7WQEZ.js.map → revoke-ZL62WC2D.js.map} +0 -0
- /package/dist/{seed-G42JYN56.js.map → seed-4JS2RJ4A.js.map} +0 -0
- /package/dist/{storage-FLR73HHF.js.map → signer-MBZZMXTC.js.map} +0 -0
- /package/dist/{walk-3UQBRMDV.js.map → stale-TJ3DYZMQ.js.map} +0 -0
- /package/dist/{withdraw-accessible-EL5GXZBS.js.map → storage-SVMKRGCW.js.map} +0 -0
- /package/dist/{store-coordination-provider-MEQ2MJQG.js.map → store-coordination-provider-2O2VUHKW.js.map} +0 -0
- /package/dist/{verify-KOV2G5D6.js.map → verify-RVT67IMH.js.map} +0 -0
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
// src/kernel/query/live/incremental.ts
|
|
2
|
+
var EMPTY_KEY = [];
|
|
3
|
+
var REBUILT = { kind: "rebuilt" };
|
|
4
|
+
function canMaintainIncrementally(plan, indexes) {
|
|
5
|
+
if (plan.joins.length > 0) return false;
|
|
6
|
+
if (plan.orderBy.some((o) => o.by === "label")) return false;
|
|
7
|
+
if (!clausesMaintainable(plan.clauses)) return false;
|
|
8
|
+
if (isIndexDriven(plan.clauses, indexes)) return false;
|
|
9
|
+
if (servedByOrderedIndex(plan, indexes)) return false;
|
|
10
|
+
return true;
|
|
11
|
+
}
|
|
12
|
+
function servedByOrderedIndex(plan, indexes) {
|
|
13
|
+
if (!indexes) return false;
|
|
14
|
+
if (plan.limit === void 0) return false;
|
|
15
|
+
if (plan.clauses.length > 0 || plan.orderBy.length !== 1) return false;
|
|
16
|
+
const order = plan.orderBy[0];
|
|
17
|
+
return order.by !== "label" && indexes.sorted(order.field);
|
|
18
|
+
}
|
|
19
|
+
function clausesMaintainable(clauses) {
|
|
20
|
+
for (const clause of clauses) {
|
|
21
|
+
if (clause.type === "crossJoin" || clause.type === "filter") return false;
|
|
22
|
+
if (clause.type === "group" && !clausesMaintainable(clause.clauses)) return false;
|
|
23
|
+
}
|
|
24
|
+
return true;
|
|
25
|
+
}
|
|
26
|
+
function isIndexDriven(clauses, indexes) {
|
|
27
|
+
if (!indexes) return false;
|
|
28
|
+
for (const clause of clauses) {
|
|
29
|
+
if (clause.type !== "field") continue;
|
|
30
|
+
if (!indexes.covers(clause.field) && !indexes.sorted(clause.field)) continue;
|
|
31
|
+
if (clause.via === void 0 && RANGE_OPS.has(clause.op)) return indexes.sorted(clause.field);
|
|
32
|
+
if (clause.via && clause.via.indexValue === void 0) continue;
|
|
33
|
+
const probe = clause.via ? clause.via.indexValue : clause.value;
|
|
34
|
+
if (clause.op === "==") return true;
|
|
35
|
+
if (clause.op === "in" && Array.isArray(probe)) return true;
|
|
36
|
+
}
|
|
37
|
+
return false;
|
|
38
|
+
}
|
|
39
|
+
var RANGE_OPS = /* @__PURE__ */ new Set(["<", "<=", ">", ">=", "between", "startsWith"]);
|
|
40
|
+
var LiveMaintainer = class {
|
|
41
|
+
constructor(cfg) {
|
|
42
|
+
this.cfg = cfg;
|
|
43
|
+
}
|
|
44
|
+
cfg;
|
|
45
|
+
entries = [];
|
|
46
|
+
memberById = /* @__PURE__ */ new Map();
|
|
47
|
+
seqById = /* @__PURE__ */ new Map();
|
|
48
|
+
maxSeq = -1;
|
|
49
|
+
/** Maintained state is stale — the next `rows()` rebuilds from the snapshot. */
|
|
50
|
+
stale = true;
|
|
51
|
+
/** True once a subscription is driving `apply()`. */
|
|
52
|
+
attached = false;
|
|
53
|
+
/**
|
|
54
|
+
* Start accepting deltas. Every read before this rebuilds from the snapshot,
|
|
55
|
+
* so a detached maintainer is just an eager executor.
|
|
56
|
+
*
|
|
57
|
+
* ⚠️ Call this in the SAME synchronous turn as a read — either immediately
|
|
58
|
+
* before the first `rows()` (the `.live()` path) or immediately after the
|
|
59
|
+
* initial one (the `.aggregate().live()` path, where the reduction computes
|
|
60
|
+
* before it subscribes). Attaching in a turn of its own would let a mutation
|
|
61
|
+
* slip past unrecorded: it arrives with no subscription to `apply()` it, and
|
|
62
|
+
* the maintained state would then be trusted while already behind.
|
|
63
|
+
*/
|
|
64
|
+
attach() {
|
|
65
|
+
this.attached = true;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Stop accepting deltas — the subscription feeding them has gone. Every
|
|
69
|
+
* later read rebuilds, because nothing is keeping the state current any
|
|
70
|
+
* more. Without this, a `Reduction` whose `.live()` was stopped would keep
|
|
71
|
+
* serving its last maintained value from `.run()`.
|
|
72
|
+
*/
|
|
73
|
+
detach() {
|
|
74
|
+
this.attached = false;
|
|
75
|
+
}
|
|
76
|
+
/** Force the next read to rebuild — the caller saw something it can't patch. */
|
|
77
|
+
invalidate() {
|
|
78
|
+
this.stale = true;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Fold one upstream change into the maintained set. A change with no
|
|
82
|
+
* payload (the source could not say which record moved) invalidates
|
|
83
|
+
* instead — the next read pays for a full rebuild.
|
|
84
|
+
*/
|
|
85
|
+
apply(change) {
|
|
86
|
+
if (!this.attached || this.stale) return REBUILT;
|
|
87
|
+
if (!change) {
|
|
88
|
+
this.stale = true;
|
|
89
|
+
return REBUILT;
|
|
90
|
+
}
|
|
91
|
+
try {
|
|
92
|
+
return this.patch(change);
|
|
93
|
+
} catch (err) {
|
|
94
|
+
this.stale = true;
|
|
95
|
+
throw err;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
/** The current result window — a fresh array on every call. */
|
|
99
|
+
rows() {
|
|
100
|
+
if (!this.attached || this.stale) this.rebuild();
|
|
101
|
+
const { offset, limit } = this.cfg;
|
|
102
|
+
const end = limit === void 0 ? this.entries.length : offset + limit;
|
|
103
|
+
const window = [];
|
|
104
|
+
for (let i = offset; i < end && i < this.entries.length; i++) {
|
|
105
|
+
window.push(this.entries[i].record);
|
|
106
|
+
}
|
|
107
|
+
return this.cfg.decode ? this.cfg.decode(window) : window;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* The whole maintained set — every matching record, in maintained order,
|
|
111
|
+
* paired with its id and snapshot sequence. Ignores `offset`/`limit`/
|
|
112
|
+
* `decode` on purpose: this is the input a DERIVED maintainer rebuilds from,
|
|
113
|
+
* and grouped aggregation reduces the full match set, never a window.
|
|
114
|
+
*
|
|
115
|
+
* Rebuilds first when detached or stale, exactly as `rows()` does, so a
|
|
116
|
+
* caller can read it at any time.
|
|
117
|
+
*/
|
|
118
|
+
maintainedEntries() {
|
|
119
|
+
if (!this.attached || this.stale) this.rebuild();
|
|
120
|
+
return this.entries;
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Full recompute from the source snapshot. Equivalent to the eager path by
|
|
124
|
+
* construction: filter in snapshot order, then sort with snapshot sequence
|
|
125
|
+
* as the tiebreak — which is what a stable sort of the same input does.
|
|
126
|
+
*/
|
|
127
|
+
rebuild() {
|
|
128
|
+
const snapshot = this.cfg.snapshotEntries();
|
|
129
|
+
this.entries = [];
|
|
130
|
+
this.memberById.clear();
|
|
131
|
+
this.seqById = /* @__PURE__ */ new Map();
|
|
132
|
+
for (let i = 0; i < snapshot.length; i++) {
|
|
133
|
+
const { id, record } = snapshot[i];
|
|
134
|
+
this.seqById.set(id, i);
|
|
135
|
+
if (this.cfg.matches(record)) {
|
|
136
|
+
const entry = { id, seq: i, record, key: this.keyOf(record) };
|
|
137
|
+
this.entries.push(entry);
|
|
138
|
+
this.memberById.set(id, entry);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
this.maxSeq = snapshot.length - 1;
|
|
142
|
+
this.entries.sort((a, b) => this.compareEntries(a, b));
|
|
143
|
+
this.stale = false;
|
|
144
|
+
}
|
|
145
|
+
patch(change) {
|
|
146
|
+
const { id } = change;
|
|
147
|
+
const previous = this.memberById.get(id);
|
|
148
|
+
const record = change.action === "delete" ? void 0 : this.cfg.lookupById(id);
|
|
149
|
+
if (record === void 0) {
|
|
150
|
+
this.seqById.delete(id);
|
|
151
|
+
if (previous) this.removeEntry(previous);
|
|
152
|
+
return previous ? { kind: "patched", id, removed: { seq: previous.seq, record: previous.record } } : { kind: "patched", id };
|
|
153
|
+
}
|
|
154
|
+
let seq = this.seqById.get(id);
|
|
155
|
+
if (seq === void 0) {
|
|
156
|
+
seq = ++this.maxSeq;
|
|
157
|
+
this.seqById.set(id, seq);
|
|
158
|
+
}
|
|
159
|
+
const matches = this.cfg.matches(record);
|
|
160
|
+
if (previous) this.removeEntry(previous);
|
|
161
|
+
const removed = previous ? { seq: previous.seq, record: previous.record } : void 0;
|
|
162
|
+
if (!matches) {
|
|
163
|
+
return removed ? { kind: "patched", id, removed } : { kind: "patched", id };
|
|
164
|
+
}
|
|
165
|
+
const entry = { id, seq, record, key: this.keyOf(record) };
|
|
166
|
+
this.entries.splice(this.lowerBound(entry), 0, entry);
|
|
167
|
+
this.memberById.set(id, entry);
|
|
168
|
+
const inserted = { seq, record };
|
|
169
|
+
return removed ? { kind: "patched", id, removed, inserted } : { kind: "patched", id, inserted };
|
|
170
|
+
}
|
|
171
|
+
removeEntry(entry) {
|
|
172
|
+
const at = this.lowerBound(entry);
|
|
173
|
+
const index = this.entries[at] === entry ? at : this.entries.indexOf(entry);
|
|
174
|
+
if (index >= 0) this.entries.splice(index, 1);
|
|
175
|
+
this.memberById.delete(entry.id);
|
|
176
|
+
}
|
|
177
|
+
/** First index whose entry does not sort before `probe`. */
|
|
178
|
+
lowerBound(probe) {
|
|
179
|
+
let lo = 0;
|
|
180
|
+
let hi = this.entries.length;
|
|
181
|
+
while (lo < hi) {
|
|
182
|
+
const mid = lo + hi >>> 1;
|
|
183
|
+
if (this.compareEntries(this.entries[mid], probe) < 0) lo = mid + 1;
|
|
184
|
+
else hi = mid;
|
|
185
|
+
}
|
|
186
|
+
return lo;
|
|
187
|
+
}
|
|
188
|
+
keyOf(record) {
|
|
189
|
+
return this.cfg.order ? this.cfg.order.keyOf(record) : EMPTY_KEY;
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* The eager path's ordering, made total.
|
|
193
|
+
*
|
|
194
|
+
* `order.compare` is the query's own `compareOrderKeys`, the identical
|
|
195
|
+
* function `sortRecords` sorts with, so sort keys cannot be read or ranked
|
|
196
|
+
* differently here. It returns 0 for equal keys — it can do nothing else,
|
|
197
|
+
* having been handed the keys rather than the records — and the eager sort
|
|
198
|
+
* then leaves those in the order they arrived, which is candidate order,
|
|
199
|
+
* which is snapshot order given `canMaintainIncrementally` has refused every
|
|
200
|
+
* plan whose candidates arrive in index order. The sequence number below is
|
|
201
|
+
* that same resolution, made explicit so a binary search has an exact
|
|
202
|
+
* position to find. ⚠️ If the eager path ever grows a tiebreak of its own
|
|
203
|
+
* (an id, say), this stops agreeing with it — which is what
|
|
204
|
+
* `__tests__/query-incremental.test.ts`'s "inherits an order key plan that
|
|
205
|
+
* leaves equal keys to the tiebreak" is there to catch.
|
|
206
|
+
*/
|
|
207
|
+
compareEntries(a, b) {
|
|
208
|
+
if (this.cfg.order) {
|
|
209
|
+
const cmp = this.cfg.order.compare(a.key, b.key);
|
|
210
|
+
if (cmp !== 0) return cmp;
|
|
211
|
+
}
|
|
212
|
+
return a.seq - b.seq;
|
|
213
|
+
}
|
|
214
|
+
};
|
|
215
|
+
|
|
216
|
+
export {
|
|
217
|
+
canMaintainIncrementally,
|
|
218
|
+
LiveMaintainer
|
|
219
|
+
};
|
|
220
|
+
//# sourceMappingURL=chunk-VHM7HCKB.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/kernel/query/live/incremental.ts"],"sourcesContent":["/**\n * Incremental (delta) maintenance for `.live()` — #1341.\n *\n * A live query used to re-run its whole plan on every change event: scan\n * every record in the collection, re-evaluate every clause, re-sort, re-slice.\n * That is O(N log N) per keystroke-sized mutation and is what makes a reactive\n * list unusable at 10k+ rows.\n *\n * This module maintains the match set instead. Given a change event\n * `{ id, action }` it re-evaluates the predicate for **that record only** and\n * splices it into (or out of) a sorted array, so the per-change cost is\n * O(log k) comparisons + one array splice, where k is the number of MATCHING\n * records rather than N.\n *\n * ## The correctness contract\n *\n * The maintained array must be **identical** — same records, same order — to\n * what a full re-run would produce, at every step. Two things buy that:\n *\n * 1. **Membership is delegated.** The caller passes the very `matches()`\n * closure the full pipeline uses (`filterRecords` over the plan's\n * clauses), so a maintained membership decision cannot drift from an\n * eagerly-computed one. This module never re-implements a predicate.\n *\n * 2. **The ordering is delegated too, and then made total.** The sort keys\n * are read and ranked by the query's own order key plan — the same\n * `buildOrderKeyPlan`/`orderKeyOf`/`compareOrderKeys` trio `sortRecords`\n * sorts with and the keyset cursor compares against (#1346), so there is\n * one definition of \"what order is this query in\" rather than two that\n * drift. What that trio does NOT decide is equal keys: `compareOrderKeys`\n * is handed two KEY TUPLES, not two records, so with equal keys its\n * inputs are indistinguishable and 0 is the only answer it can give —\n * structurally, not by convention. (#1346 breaks its own ties one level\n * up, at the `page()` call site, never inside the comparator.) The eager\n * path lets its stable sort resolve those, leaving them in candidate =\n * snapshot order; we append each record's snapshot position as a final\n * key, which is the same resolution stated explicitly — and being\n * explicit is what lets a binary search land on an exact index.\n *\n * ⚠️ That rests on one property of the backing cache: **snapshot order is\n * `Map` insertion order.** `Map.set` on an existing key keeps its slot\n * (so an update never moves a record), a new key appends (so a new record\n * sorts last among ties), and `delete` removes without reordering the\n * rest. `Collection`'s eager cache is a `Map`, so this holds. A source\n * whose snapshot order is not insertion-stable must not be maintained —\n * it would produce a correct SET in a wrong ORDER among ties.\n *\n * Anything not provably patchable falls back to a full rebuild: an unknown\n * (payload-less) change event, an error thrown mid-patch, or a plan shape\n * `canMaintainIncrementally()` refuses. **The fallback is the default** —\n * `canMaintainIncrementally` is a whitelist, not a blacklist.\n *\n * ## Stacking on top of it\n *\n * `apply()` reports what it did as a `PatchOutcome`, and `maintainedEntries()`\n * exposes the set with its snapshot sequence numbers. Together those let a\n * DERIVED maintainer mirror this one without forking its membership logic —\n * which is exactly what per-group maintenance for\n * `groupBy().aggregate().live()` does (`with-lookup/reduce/incremental-group.ts`).\n * A layer built that way inherits the whitelist and the fallback rather than\n * re-deciding them, so there is one answer to \"can this plan be maintained\"\n * rather than two that drift.\n */\n\nimport type { Clause } from '../predicate.js'\nimport type { OrderBy } from '../builder.js'\n\n/**\n * The delta a source hands to its `subscribe` callback: which record changed\n * and whether it was written or removed. Deliberately the same shape as the\n * hub-level `ChangeEvent` minus the vault/collection routing fields, which\n * the source has already filtered on.\n *\n * A source that cannot say WHICH record changed simply calls its callback with\n * no argument — every consumer treats that as \"rebuild from scratch\", which is\n * exactly the pre-#1341 behaviour.\n */\nexport interface SourceChange {\n readonly id: string\n readonly action: 'put' | 'delete'\n}\n\n/**\n * One side of a patch: a record that entered or left the maintained set, with\n * the snapshot sequence number it occupies. `seq` is what makes a patch\n * composable — a layer built ON TOP of the match set (grouped aggregation,\n * #1341's second half) can place the record in its own ordering without\n * re-deriving snapshot position, and sequence numbers are stable across an\n * update because `Map.set` on an existing key keeps its slot.\n */\nexport interface PatchDelta {\n readonly seq: number\n readonly record: unknown\n}\n\n/**\n * What `apply()` did, so a layer stacked on the maintained set can mirror it.\n *\n * `'rebuilt'` is the honest answer for everything that is NOT a clean patch —\n * a payload-less event, a detached maintainer, an already-stale one. A\n * consumer reading it must invalidate its own derived state; it must never\n * read `'rebuilt'` as \"nothing happened\".\n *\n * A `'patched'` outcome with neither `removed` nor `inserted` DID happen: a\n * non-member changed and stayed a non-member. That is a no-op for every\n * derived layer, which is exactly why it is reported as a patch rather than a\n * rebuild.\n */\nexport type PatchOutcome =\n | { readonly kind: 'rebuilt' }\n | {\n readonly kind: 'patched'\n readonly id: string\n readonly removed?: PatchDelta\n readonly inserted?: PatchDelta\n }\n\n/** An id-paired member of the maintained set, in maintained order. */\nexport interface MaintainedEntry {\n readonly id: string\n readonly seq: number\n readonly record: unknown\n}\n\n/**\n * The subset of a query source a DERIVED maintainer needs (#1341, grouped\n * half). Deliberately a kernel type even though its only consumer today is\n * the reduce service: everything in it is a kernel concept, and declaring it\n * here is what lets `kernel/query/builder.ts` hand one to the service without\n * a new spine to service import specifier.\n */\nexport interface GroupMaintenanceSource {\n /**\n * Id-paired snapshot, in snapshot (Map insertion) order.\n *\n * ⚠️ Declared as function-typed PROPERTIES, not methods: every member here\n * is a standalone closure the query builder binds before handing it over,\n * and property syntax says so — a method declaration would invite a `this`\n * these closures do not have.\n */\n readonly snapshotEntries: () => readonly { id: string; record: unknown }[]\n /** O(1) current-state lookup for the AFTER state of a change. */\n readonly lookupById: (id: string) => unknown\n /** The plan's membership test — the same one the eager path runs. */\n readonly matches: (record: unknown) => boolean\n /**\n * Per-record projection the eager grouping pipeline applies AFTER filtering\n * and before bucketing — today only `projectDateTruncKeys` (#1350). Applied\n * per record here because the eager path applies it per record too; a\n * projection that read across records could not be maintained and must not\n * be plumbed through this hook.\n */\n readonly project?: (record: unknown) => unknown\n}\n\n/** Everything the maintainer needs, supplied by the query builder. */\nexport interface MaintainerConfig {\n /** Id-paired snapshot, in snapshot (Map insertion) order. */\n snapshotEntries(): readonly { id: string; record: unknown }[]\n /** O(1) current-state lookup, used to read the AFTER state of a change. */\n lookupById(id: string): unknown\n /** The plan's membership test — the same one the eager path runs. */\n matches(record: unknown): boolean\n /**\n * The plan's ordering, in the same key-plan shape `sortRecords` and the\n * keyset cursor use (#1346): read a record's sort-key tuple, and compare two\n * of those tuples. `undefined` when the plan has no `orderBy` — result order\n * is then snapshot order alone.\n *\n * `compare` need not be a total order: it returns 0 for equal sort keys,\n * exactly as it does for the eager sort, and the maintainer resolves those\n * ties by snapshot sequence.\n */\n order?: {\n keyOf(record: unknown): unknown[]\n compare(a: readonly unknown[], b: readonly unknown[]): number\n }\n /** Plan offset (0 when unset). */\n offset: number\n /** Plan limit, or undefined for \"all matching rows\". */\n limit: number | undefined\n /**\n * Post-slice projection the eager path applies to the emitted window (Via\n * result decoding). Applied to the window, never to the maintained records,\n * mirroring `toArray()` which decodes AFTER filter/sort/slice.\n */\n decode?: (rows: readonly unknown[]) => unknown[]\n}\n\nconst EMPTY_KEY: readonly unknown[] = []\n\n/** Shared 'you cannot patch from this' answer — allocation-free on the hot path. */\nconst REBUILT: PatchOutcome = { kind: 'rebuilt' }\n\ninterface Entry {\n readonly id: string\n readonly seq: number\n readonly record: unknown\n /**\n * The record's sort-key tuple, computed once when the entry is built. Every\n * write to a record re-enters it, so a cached key is never stale — and the\n * binary search then compares tuples instead of re-reading fields at every\n * probe.\n */\n readonly key: readonly unknown[]\n}\n\n/**\n * Reject any plan whose result set cannot be provably patched from a single\n * record's delta. Everything this refuses still works — it just re-runs in\n * full, as it did before #1341.\n *\n * Refused, and why:\n * - **joins / crossJoin** — a row's membership depends on other collections'\n * records, so a left-side delta does not determine the new result.\n * - **`.filter(fn)`** — an arbitrary consumer closure with no determinism\n * guarantee. `r => r.due < Date.now()` changes its verdict for records that\n * never changed, which a full re-run observes and a patch cannot.\n * (`.wherePredicate()` is admitted: it is DECLARED deterministic and\n * carries a body hash saying so.)\n * - **`orderBy(..., { by: 'label' })`** — the label maps are built eagerly\n * from a dictionary collection's snapshot, so the comparator would be\n * captured at subscribe time and go stale when that dictionary changes.\n * - **an index-driven plan** — the rows then reach the pipeline in INDEX\n * order rather than snapshot order, so snapshot sequence is the wrong\n * tiebreak among equal sort keys. Three shapes qualify, and all three are\n * refused: an `==`/`in` clause on any indexed field, a range clause on a\n * SORTED-indexed field, and #1344's `orderedIndexRows()` page, which\n * serves `orderBy(f).limit(n)` straight off a sorted index with no\n * predicate at all. Little is lost: each of those re-runs is already\n * proportional to the page or the match set, not to the collection.\n */\nexport function canMaintainIncrementally(\n plan: {\n readonly clauses: readonly Clause[]\n readonly orderBy: readonly OrderBy[]\n readonly limit?: number | undefined\n readonly joins: readonly unknown[]\n },\n indexes: IndexProbe | null,\n): boolean {\n if (plan.joins.length > 0) return false\n if (plan.orderBy.some(o => o.by === 'label')) return false\n if (!clausesMaintainable(plan.clauses)) return false\n if (isIndexDriven(plan.clauses, indexes)) return false\n if (servedByOrderedIndex(plan, indexes)) return false\n return true\n}\n\n/**\n * What the maintainer needs to know about the source's indexes: which fields\n * carry ANY index, and which carry a SORTED one. Both matter — the sorted\n * index feeds two paths (#1344) the hash index does not.\n */\nexport interface IndexProbe {\n covers(field: string): boolean\n sorted(field: string): boolean\n}\n\n/**\n * Would #1344's `orderedIndexRows()` serve this plan off a sorted index?\n *\n * Mirrors the cheap half of its preconditions and deliberately stops there:\n * the remaining ones (full index coverage of the snapshot, no Via ordering)\n * cost a snapshot walk to check, and answering \"maybe\" here only ever costs a\n * fallback. The page it would serve is in stored-key order, and among records\n * with EQUAL keys that order is the index's, not the cache's — which is\n * precisely the tie resolution the maintainer would get wrong.\n */\nfunction servedByOrderedIndex(\n plan: {\n readonly clauses: readonly Clause[]\n readonly orderBy: readonly OrderBy[]\n readonly limit?: number | undefined\n },\n indexes: IndexProbe | null,\n): boolean {\n if (!indexes) return false\n if (plan.limit === undefined) return false\n if (plan.clauses.length > 0 || plan.orderBy.length !== 1) return false\n const order = plan.orderBy[0]!\n return order.by !== 'label' && indexes.sorted(order.field)\n}\n\nfunction clausesMaintainable(clauses: readonly Clause[]): boolean {\n for (const clause of clauses) {\n if (clause.type === 'crossJoin' || clause.type === 'filter') return false\n if (clause.type === 'group' && !clausesMaintainable(clause.clauses)) return false\n }\n return true\n}\n\n/**\n * Would `candidateRecords()` take the index fast path for this plan?\n *\n * Deliberately more eager to say \"yes\" than `candidateRecords` itself (which\n * additionally requires the index probe to return a hit set) — erring that way\n * costs a fallback, never a wrong answer.\n */\nfunction isIndexDriven(clauses: readonly Clause[], indexes: IndexProbe | null): boolean {\n if (!indexes) return false\n for (const clause of clauses) {\n if (clause.type !== 'field') continue\n if (!indexes.covers(clause.field) && !indexes.sorted(clause.field)) continue\n // #1344: a range probe reads the SORTED index, and only for a clause the\n // Via layer has not claimed — mirroring `candidateRecords`'s own branch.\n // On a hash-only field `lookupRange` returns null and the plan scans, so\n // that case is left maintainable.\n if (clause.via === undefined && RANGE_OPS.has(clause.op)) return indexes.sorted(clause.field)\n if (clause.via && clause.via.indexValue === undefined) continue\n const probe = clause.via ? clause.via.indexValue : clause.value\n if (clause.op === '==') return true\n if (clause.op === 'in' && Array.isArray(probe)) return true\n }\n return false\n}\n\n/** The operators #1344's `lookupRange` serves off a sorted index. */\nconst RANGE_OPS: ReadonlySet<string> = new Set(['<', '<=', '>', '>=', 'between', 'startsWith'])\n\n/**\n * The maintained result set behind one live query.\n *\n * Lifecycle: `attach()` when a subscription opens, `apply(change)` per upstream\n * event, `rows()` to read the current window. Before `attach()` (and after any\n * fallback) `rows()` recomputes from the snapshot, so a detached maintainer is\n * simply an eager executor and is safe to read at any time.\n */\nexport class LiveMaintainer {\n private entries: Entry[] = []\n private readonly memberById = new Map<string, Entry>()\n private seqById = new Map<string, number>()\n private maxSeq = -1\n /** Maintained state is stale — the next `rows()` rebuilds from the snapshot. */\n private stale = true\n /** True once a subscription is driving `apply()`. */\n private attached = false\n\n constructor(private readonly cfg: MaintainerConfig) {}\n\n /**\n * Start accepting deltas. Every read before this rebuilds from the snapshot,\n * so a detached maintainer is just an eager executor.\n *\n * ⚠️ Call this in the SAME synchronous turn as a read — either immediately\n * before the first `rows()` (the `.live()` path) or immediately after the\n * initial one (the `.aggregate().live()` path, where the reduction computes\n * before it subscribes). Attaching in a turn of its own would let a mutation\n * slip past unrecorded: it arrives with no subscription to `apply()` it, and\n * the maintained state would then be trusted while already behind.\n */\n attach(): void {\n this.attached = true\n }\n\n /**\n * Stop accepting deltas — the subscription feeding them has gone. Every\n * later read rebuilds, because nothing is keeping the state current any\n * more. Without this, a `Reduction` whose `.live()` was stopped would keep\n * serving its last maintained value from `.run()`.\n */\n detach(): void {\n this.attached = false\n }\n\n /** Force the next read to rebuild — the caller saw something it can't patch. */\n invalidate(): void {\n this.stale = true\n }\n\n /**\n * Fold one upstream change into the maintained set. A change with no\n * payload (the source could not say which record moved) invalidates\n * instead — the next read pays for a full rebuild.\n */\n apply(change: SourceChange | undefined): PatchOutcome {\n if (!this.attached || this.stale) return REBUILT\n if (!change) {\n this.stale = true\n return REBUILT\n }\n try {\n return this.patch(change)\n } catch (err) {\n // A predicate threw mid-patch: the maintained set may be half-updated,\n // so drop it rather than serve a set we can no longer vouch for. The\n // error still reaches the consumer — the rebuild on the next read runs\n // the same predicate and throws the same way.\n this.stale = true\n throw err\n }\n }\n\n /** The current result window — a fresh array on every call. */\n rows(): unknown[] {\n if (!this.attached || this.stale) this.rebuild()\n const { offset, limit } = this.cfg\n const end = limit === undefined ? this.entries.length : offset + limit\n const window: unknown[] = []\n for (let i = offset; i < end && i < this.entries.length; i++) {\n window.push(this.entries[i]!.record)\n }\n return this.cfg.decode ? this.cfg.decode(window) : window\n }\n\n /**\n * The whole maintained set — every matching record, in maintained order,\n * paired with its id and snapshot sequence. Ignores `offset`/`limit`/\n * `decode` on purpose: this is the input a DERIVED maintainer rebuilds from,\n * and grouped aggregation reduces the full match set, never a window.\n *\n * Rebuilds first when detached or stale, exactly as `rows()` does, so a\n * caller can read it at any time.\n */\n maintainedEntries(): readonly MaintainedEntry[] {\n if (!this.attached || this.stale) this.rebuild()\n return this.entries\n }\n\n /**\n * Full recompute from the source snapshot. Equivalent to the eager path by\n * construction: filter in snapshot order, then sort with snapshot sequence\n * as the tiebreak — which is what a stable sort of the same input does.\n */\n private rebuild(): void {\n const snapshot = this.cfg.snapshotEntries()\n this.entries = []\n this.memberById.clear()\n this.seqById = new Map()\n for (let i = 0; i < snapshot.length; i++) {\n const { id, record } = snapshot[i]!\n this.seqById.set(id, i)\n if (this.cfg.matches(record)) {\n const entry: Entry = { id, seq: i, record, key: this.keyOf(record) }\n this.entries.push(entry)\n this.memberById.set(id, entry)\n }\n }\n this.maxSeq = snapshot.length - 1\n this.entries.sort((a, b) => this.compareEntries(a, b))\n this.stale = false\n }\n\n private patch(change: SourceChange): PatchOutcome {\n const { id } = change\n const previous = this.memberById.get(id)\n const record = change.action === 'delete' ? undefined : this.cfg.lookupById(id)\n\n if (record === undefined) {\n // Gone. Its snapshot slot is released too: a later re-add of the same id\n // appends to the cache's Map, so it must earn a fresh sequence number.\n this.seqById.delete(id)\n if (previous) this.removeEntry(previous)\n return previous\n ? { kind: 'patched', id, removed: { seq: previous.seq, record: previous.record } }\n : { kind: 'patched', id }\n }\n\n let seq = this.seqById.get(id)\n if (seq === undefined) {\n // A key the snapshot did not carry — `Map.set` appended it, so it sorts\n // after every record we have seen.\n seq = ++this.maxSeq\n this.seqById.set(id, seq)\n }\n\n const matches = this.cfg.matches(record)\n if (previous) this.removeEntry(previous)\n const removed = previous ? { seq: previous.seq, record: previous.record } : undefined\n if (!matches) {\n return removed ? { kind: 'patched', id, removed } : { kind: 'patched', id }\n }\n\n const entry: Entry = { id, seq, record, key: this.keyOf(record) }\n this.entries.splice(this.lowerBound(entry), 0, entry)\n this.memberById.set(id, entry)\n const inserted = { seq, record }\n return removed ? { kind: 'patched', id, removed, inserted } : { kind: 'patched', id, inserted }\n }\n\n private removeEntry(entry: Entry): void {\n // The comparator is a total order (sequence numbers are unique), so the\n // binary search lands exactly on the entry. The linear scan is a belt-and-\n // braces fallback for a source that broke the ordering assumption.\n const at = this.lowerBound(entry)\n const index = this.entries[at] === entry ? at : this.entries.indexOf(entry)\n if (index >= 0) this.entries.splice(index, 1)\n this.memberById.delete(entry.id)\n }\n\n /** First index whose entry does not sort before `probe`. */\n private lowerBound(probe: Entry): number {\n let lo = 0\n let hi = this.entries.length\n while (lo < hi) {\n const mid = (lo + hi) >>> 1\n if (this.compareEntries(this.entries[mid]!, probe) < 0) lo = mid + 1\n else hi = mid\n }\n return lo\n }\n\n private keyOf(record: unknown): readonly unknown[] {\n return this.cfg.order ? this.cfg.order.keyOf(record) : EMPTY_KEY\n }\n\n /**\n * The eager path's ordering, made total.\n *\n * `order.compare` is the query's own `compareOrderKeys`, the identical\n * function `sortRecords` sorts with, so sort keys cannot be read or ranked\n * differently here. It returns 0 for equal keys — it can do nothing else,\n * having been handed the keys rather than the records — and the eager sort\n * then leaves those in the order they arrived, which is candidate order,\n * which is snapshot order given `canMaintainIncrementally` has refused every\n * plan whose candidates arrive in index order. The sequence number below is\n * that same resolution, made explicit so a binary search has an exact\n * position to find. ⚠️ If the eager path ever grows a tiebreak of its own\n * (an id, say), this stops agreeing with it — which is what\n * `__tests__/query-incremental.test.ts`'s \"inherits an order key plan that\n * leaves equal keys to the tiebreak\" is there to catch.\n */\n private compareEntries(a: Entry, b: Entry): number {\n if (this.cfg.order) {\n const cmp = this.cfg.order.compare(a.key, b.key)\n if (cmp !== 0) return cmp\n }\n return a.seq - b.seq\n }\n}\n"],"mappings":"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","names":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
DuplicateBehaviorNameError
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-244VXYPG.js";
|
|
4
4
|
|
|
5
5
|
// src/with-audit/guards/registry.ts
|
|
6
6
|
var GuardRegistry = class {
|
|
@@ -141,4 +141,4 @@ var GuardRegistry = class {
|
|
|
141
141
|
export {
|
|
142
142
|
GuardRegistry
|
|
143
143
|
};
|
|
144
|
-
//# sourceMappingURL=chunk-
|
|
144
|
+
//# sourceMappingURL=chunk-VNNRUGMM.js.map
|
|
@@ -6,15 +6,15 @@ import {
|
|
|
6
6
|
ViaGraph,
|
|
7
7
|
matchTargetFieldNames,
|
|
8
8
|
schemaFieldKeys
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-UD5EVGZ7.js";
|
|
10
10
|
import {
|
|
11
11
|
sha256Hex
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-UYB234ZR.js";
|
|
13
13
|
import {
|
|
14
14
|
DerivationCycleError,
|
|
15
15
|
DuplicateBehaviorNameError,
|
|
16
16
|
ValidationError
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-244VXYPG.js";
|
|
18
18
|
|
|
19
19
|
// src/with-formula/derivations/strategy-hash.ts
|
|
20
20
|
async function computeStrategyHash(source, outputKeys, derive, sources) {
|
|
@@ -244,4 +244,4 @@ var DerivationRegistry = class {
|
|
|
244
244
|
export {
|
|
245
245
|
DerivationRegistry
|
|
246
246
|
};
|
|
247
|
-
//# sourceMappingURL=chunk-
|
|
247
|
+
//# sourceMappingURL=chunk-VNPEWFPD.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
writePod
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-HBPPGWUM.js";
|
|
4
4
|
|
|
5
5
|
// src/with-audit/portability/export-accessible.ts
|
|
6
6
|
function resolveAccessibleCollections(keyring, scope, writableOnly = false) {
|
|
@@ -42,4 +42,4 @@ export {
|
|
|
42
42
|
buildAccessibleBundle,
|
|
43
43
|
exportAccessibleData
|
|
44
44
|
};
|
|
45
|
-
//# sourceMappingURL=chunk-
|
|
45
|
+
//# sourceMappingURL=chunk-WNJ4AVGE.js.map
|
|
@@ -3,10 +3,10 @@ import {
|
|
|
3
3
|
} from "./chunk-5D2ALSM5.js";
|
|
4
4
|
import {
|
|
5
5
|
RecordCodec
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-KJFW62P4.js";
|
|
7
7
|
|
|
8
8
|
// src/with-formula/materialized-views/stale.ts
|
|
9
|
-
var loadMVExecutor = lazy(() => import("./executor-
|
|
9
|
+
var loadMVExecutor = lazy(() => import("./executor-B6SRO2QS.js"));
|
|
10
10
|
var _staleByRegistry = /* @__PURE__ */ new WeakMap();
|
|
11
11
|
function markMVStale(registry, mvName) {
|
|
12
12
|
let set = _staleByRegistry.get(registry);
|
|
@@ -134,4 +134,4 @@ export {
|
|
|
134
134
|
clearMVStale,
|
|
135
135
|
clearMVStaleFully
|
|
136
136
|
};
|
|
137
|
-
//# sourceMappingURL=chunk-
|
|
137
|
+
//# sourceMappingURL=chunk-WX5ADGTZ.js.map
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
readPath
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-HLEK5VAN.js";
|
|
4
4
|
import {
|
|
5
5
|
installViaBinder
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-Z5HTYMMQ.js";
|
|
7
7
|
import {
|
|
8
8
|
NoydbError,
|
|
9
9
|
ValidationError
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-244VXYPG.js";
|
|
11
11
|
|
|
12
12
|
// src/via/money/iso4217.ts
|
|
13
13
|
var MINOR_UNITS = {
|
|
@@ -816,18 +816,100 @@ function moneyMinMaxReducer(op, field, desc) {
|
|
|
816
816
|
}
|
|
817
817
|
};
|
|
818
818
|
}
|
|
819
|
+
function parseProbability(p) {
|
|
820
|
+
const { int, scale } = parseRate(p);
|
|
821
|
+
return { num: int, den: 10n ** BigInt(scale) };
|
|
822
|
+
}
|
|
823
|
+
function quantileScaled(sorted, p) {
|
|
824
|
+
const n = sorted.length;
|
|
825
|
+
if (n === 1) return sorted[0];
|
|
826
|
+
const { num, den } = parseProbability(p);
|
|
827
|
+
const xNum = num * BigInt(n - 1);
|
|
828
|
+
const lo = xNum / den;
|
|
829
|
+
const rem = xNum - lo * den;
|
|
830
|
+
const i = Number(lo);
|
|
831
|
+
if (rem === 0n) return sorted[i];
|
|
832
|
+
const a = sorted[i];
|
|
833
|
+
const b = sorted[i + 1];
|
|
834
|
+
return a + divRoundHalfEven((b - a) * rem, den);
|
|
835
|
+
}
|
|
836
|
+
function moneyQuantileReducer(op, field, desc, p) {
|
|
837
|
+
const quantile = (arr) => {
|
|
838
|
+
const sorted = [...arr].sort((x, y) => x < y ? -1 : x > y ? 1 : 0);
|
|
839
|
+
return quantileScaled(sorted, p);
|
|
840
|
+
};
|
|
841
|
+
return {
|
|
842
|
+
op,
|
|
843
|
+
field,
|
|
844
|
+
p,
|
|
845
|
+
init: () => /* @__PURE__ */ new Map(),
|
|
846
|
+
step: (state, record) => {
|
|
847
|
+
const m = readMoney(record, field, desc);
|
|
848
|
+
if (m) {
|
|
849
|
+
const arr = state.get(m.currency);
|
|
850
|
+
if (arr) arr.push(m.value);
|
|
851
|
+
else state.set(m.currency, [m.value]);
|
|
852
|
+
}
|
|
853
|
+
return state;
|
|
854
|
+
},
|
|
855
|
+
remove: (state, record) => {
|
|
856
|
+
const m = readMoney(record, field, desc);
|
|
857
|
+
if (m) {
|
|
858
|
+
const arr = state.get(m.currency);
|
|
859
|
+
if (arr) {
|
|
860
|
+
const idx = arr.indexOf(m.value);
|
|
861
|
+
if (idx >= 0) arr.splice(idx, 1);
|
|
862
|
+
}
|
|
863
|
+
}
|
|
864
|
+
return state;
|
|
865
|
+
},
|
|
866
|
+
finalize: (state) => {
|
|
867
|
+
if (desc.mode === "fixed") {
|
|
868
|
+
const cur = desc.fixedCurrency;
|
|
869
|
+
const arr = state.get(cur);
|
|
870
|
+
if (!arr || arr.length === 0) return null;
|
|
871
|
+
return formatScaledInt(quantile(arr), desc.scaleFor(cur));
|
|
872
|
+
}
|
|
873
|
+
const out = {};
|
|
874
|
+
for (const [cur, arr] of state) {
|
|
875
|
+
if (arr.length > 0) out[cur] = formatScaledInt(quantile(arr), desc.scaleFor(cur));
|
|
876
|
+
}
|
|
877
|
+
return out;
|
|
878
|
+
}
|
|
879
|
+
};
|
|
880
|
+
}
|
|
881
|
+
var MONEY_REFUSALS = {
|
|
882
|
+
avg: 'avg() is not supported on money field "%s" in v1 \u2014 use sum() and count() and divide at the boundary.',
|
|
883
|
+
variance: 'variance() is not supported on money field "%s" \u2014 a variance of currency is not a currency amount, and the exact BigInt path cannot express it. Read the scaled integers out and compute at the boundary.',
|
|
884
|
+
stddev: 'stddev() is not supported on money field "%s" \u2014 a square root is not a decimal, so there is no exact answer to return. Read the scaled integers out and compute at the boundary.',
|
|
885
|
+
mode: 'mode() is not implemented for money field "%s" (#1353) \u2014 it is exactly computable, but the generic reducer would read the stored scaled integer as 0, so it refuses rather than answer wrongly.'
|
|
886
|
+
};
|
|
819
887
|
function wrapMoneyReducers(spec, moneyFields) {
|
|
820
888
|
let changed = false;
|
|
821
889
|
const out = {};
|
|
822
890
|
for (const [key, reducer] of Object.entries(spec)) {
|
|
823
891
|
const field = reducer.field;
|
|
824
892
|
const desc = field ? moneyFields[field] : void 0;
|
|
825
|
-
|
|
893
|
+
const refusal = desc && reducer.op ? MONEY_REFUSALS[reducer.op] : void 0;
|
|
894
|
+
if (refusal !== void 0) {
|
|
895
|
+
throw new MoneyUnsupportedError(field, refusal.replace("%s", field));
|
|
896
|
+
}
|
|
897
|
+
if (desc && reducer.op === "percentile" && reducer.approx === true) {
|
|
826
898
|
throw new MoneyUnsupportedError(
|
|
827
899
|
field,
|
|
828
|
-
`
|
|
900
|
+
`percentile({ approx: true }) is not supported on money field "${field}" \u2014 a t-digest summarises values as floating-point centroids. Drop \`approx\` for the exact BigInt path (O(n) memory per group).`
|
|
829
901
|
);
|
|
830
902
|
}
|
|
903
|
+
if (desc && (reducer.op === "median" || reducer.op === "percentile")) {
|
|
904
|
+
changed = true;
|
|
905
|
+
out[key] = moneyQuantileReducer(
|
|
906
|
+
reducer.op,
|
|
907
|
+
field,
|
|
908
|
+
desc,
|
|
909
|
+
reducer.op === "median" ? 0.5 : reducer.p ?? 0.5
|
|
910
|
+
);
|
|
911
|
+
continue;
|
|
912
|
+
}
|
|
831
913
|
if (desc && (reducer.op === "sum" || reducer.op === "min" || reducer.op === "max")) {
|
|
832
914
|
changed = true;
|
|
833
915
|
out[key] = reducer.op === "sum" ? moneySumReducer(field, desc, reducer.convertTo, reducer.fx) : moneyMinMaxReducer(reducer.op, field, desc);
|
|
@@ -845,8 +927,12 @@ function moneyVia(moneyFields, virtualMoneyFields) {
|
|
|
845
927
|
const ordinaryPresentFields = hasVirtualMoney ? Object.fromEntries(Object.entries(moneyFields).filter(([f]) => !virtualMoneyFields.has(f))) : moneyFields;
|
|
846
928
|
return {
|
|
847
929
|
brand: "money",
|
|
930
|
+
presentIsSync: true,
|
|
931
|
+
// #1416 — decodeMoneyFields / presentVirtualMoneyFields are plain functions
|
|
848
932
|
posture: { encryptedAtRest: "envelope", queryable: "ordered", exportable: true, forgettable: true },
|
|
849
933
|
covers: (field) => field in moneyFields,
|
|
934
|
+
coveredFields: Object.keys(moneyFields),
|
|
935
|
+
// #1447
|
|
850
936
|
ingest: (r) => canonicalizeIncomingMoney(r, moneyFields),
|
|
851
937
|
canonicalizeStored: (r) => canonicalizeStoredMoney(r, moneyFields),
|
|
852
938
|
encodeWrite: (r) => quantizeMoneyFields(r, moneyFields),
|
|
@@ -1044,4 +1130,4 @@ export {
|
|
|
1044
1130
|
decodeMoneyFields,
|
|
1045
1131
|
exactMath
|
|
1046
1132
|
};
|
|
1047
|
-
//# sourceMappingURL=chunk-
|
|
1133
|
+
//# sourceMappingURL=chunk-WY2XXTET.js.map
|