@noy-db/hub 0.7.1-pre.0 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +147 -14
- package/LICENSE +202 -21
- package/NOTICE +1 -0
- package/README.md +5 -5
- package/codemods/0.8.0-pre.json +61 -0
- package/dist/api-OS747DS4.js +18 -0
- package/dist/as/index.js +11 -12
- package/dist/as/index.js.map +1 -1
- package/dist/at/index.js +9 -10
- package/dist/attestation/index.js +37 -26
- package/dist/attestation/index.js.map +1 -1
- package/dist/{backup-XKCXVKV3.js → backup-YE2VQ26S.js} +15 -16
- package/dist/backup-YE2VQ26S.js.map +1 -0
- package/dist/blobs/index.js +13 -14
- package/dist/blobs/index.js.map +1 -1
- package/dist/broker/index.js +12 -13
- package/dist/broker/index.js.map +1 -1
- package/dist/by/index.js +2 -2
- package/dist/capsule/contract.d.ts +159 -0
- package/dist/capsule/contract.js +95 -0
- package/dist/capsule/enclave-aes/bound.d.ts +52 -0
- package/dist/capsule/enclave-aes/capabilities.d.ts +2 -0
- package/dist/capsule/enclave-aes/classify/compare.d.ts +20 -0
- package/dist/{kernel/enclave → capsule/enclave-aes}/classify/find.d.ts +1 -1
- package/dist/{kernel/enclave → capsule/enclave-aes}/classify/reveal.d.ts +1 -1
- package/dist/{kernel/enclave → capsule/enclave-aes}/classify/verify.d.ts +2 -2
- package/dist/{kernel/enclave → capsule/enclave-aes}/classify/write.d.ts +1 -1
- package/dist/{kernel/enclave → capsule/enclave-aes}/crypto.d.ts +33 -129
- package/dist/capsule/enclave-aes/index.d.ts +113 -0
- package/dist/capsule/enclave-aes/index.js +335 -0
- package/dist/capsule/enclave-aes/index.js.map +1 -0
- package/dist/capsule/enclave-aes/primitives.d.ts +29 -0
- package/dist/capsule/index.d.ts +27 -0
- package/dist/capsule/plumbing/ct-equal.d.ts +11 -0
- package/dist/{kernel/enclave/record-keys → capsule/plumbing}/deterministic.d.ts +8 -21
- package/dist/capsule/plumbing/digest.d.ts +122 -0
- package/dist/{kernel/enclave/record-keys → capsule/plumbing}/envelope-body.d.ts +44 -48
- package/dist/capsule/plumbing/index.d.ts +100 -0
- package/dist/capsule/plumbing/lifecycle.d.ts +50 -0
- package/dist/{kernel/enclave/record-keys → capsule/plumbing}/record-codec.d.ts +80 -20
- package/dist/{kernel/enclave → capsule/plumbing}/record-envelope.d.ts +1 -1
- package/dist/capsule/plumbing/rekey-blob.d.ts +33 -0
- package/dist/capsule/plumbing/rekey.d.ts +44 -0
- package/dist/capsule/plumbing/sealed-slot.d.ts +22 -0
- package/dist/capsule/plumbing/sealed-slots.d.ts +37 -0
- package/dist/capsule/plumbing/sealing.d.ts +29 -0
- package/dist/capsule/plumbing/sign.d.ts +9 -0
- package/dist/{kernel/enclave/record-keys → capsule/plumbing}/tombstone.d.ts +2 -2
- package/dist/capsule-VOLX3QRQ.js +209 -0
- package/dist/cargo/index.js +39 -36
- package/dist/{chunk-Q2MPFCQ7.js → chunk-23D6M6VM.js} +5 -5
- package/dist/chunk-23D6M6VM.js.map +1 -0
- package/dist/{chunk-R7BX2NB3.js → chunk-244QBK7Z.js} +4 -4
- package/dist/chunk-244QBK7Z.js.map +1 -0
- package/dist/chunk-2AFX33YA.js +936 -0
- package/dist/chunk-2AFX33YA.js.map +1 -0
- package/dist/{chunk-MVMXZYXT.js → chunk-2GHDLTPE.js} +2 -2
- package/dist/{chunk-GYGLAVCX.js → chunk-2MG3SW7Q.js} +6 -2
- package/dist/chunk-2MG3SW7Q.js.map +1 -0
- package/dist/{chunk-XLMEZIAJ.js → chunk-2ODVB6LZ.js} +2 -2
- package/dist/{chunk-HJUWN7JN.js → chunk-2PVXF5CS.js} +33 -8
- package/dist/chunk-2PVXF5CS.js.map +1 -0
- package/dist/{chunk-YJRT5UQM.js → chunk-2RH777HH.js} +21 -20
- package/dist/{chunk-YJRT5UQM.js.map → chunk-2RH777HH.js.map} +1 -1
- package/dist/{chunk-7O3Y4PPD.js → chunk-37EPTBBR.js} +153 -16
- package/dist/chunk-37EPTBBR.js.map +1 -0
- package/dist/{chunk-2ENE6445.js → chunk-3A5DUZ56.js} +102 -16
- package/dist/chunk-3A5DUZ56.js.map +1 -0
- package/dist/chunk-3EWS67C7.js +461 -0
- package/dist/chunk-3EWS67C7.js.map +1 -0
- package/dist/{chunk-SGZAIJCV.js → chunk-3L2NBKDR.js} +4 -8
- package/dist/chunk-3L2NBKDR.js.map +1 -0
- package/dist/{chunk-YMUFFJCO.js → chunk-3TDUWVWB.js} +5 -2
- package/dist/chunk-3TDUWVWB.js.map +1 -0
- package/dist/{chunk-4GVM6QZA.js → chunk-3XJQBBZD.js} +26 -28
- package/dist/chunk-3XJQBBZD.js.map +1 -0
- package/dist/{chunk-4ZS56W5S.js → chunk-42ALPZ2B.js} +672 -664
- package/dist/chunk-42ALPZ2B.js.map +1 -0
- package/dist/chunk-4CIQDWRB.js +524 -0
- package/dist/chunk-4CIQDWRB.js.map +1 -0
- package/dist/{chunk-RMS3NEA3.js → chunk-4JPMZTJY.js} +2 -2
- package/dist/{chunk-P3MG6QCN.js → chunk-4T3SE27M.js} +5 -9
- package/dist/chunk-4T3SE27M.js.map +1 -0
- package/dist/chunk-4V3Q35WG.js +204 -0
- package/dist/chunk-4V3Q35WG.js.map +1 -0
- package/dist/{chunk-NQKIUNW5.js → chunk-52MGURXO.js} +2 -2
- package/dist/{chunk-EQEYOJBM.js → chunk-5A4345TG.js} +4 -4
- package/dist/chunk-5A4345TG.js.map +1 -0
- package/dist/{chunk-334WSVOW.js → chunk-5FE75J4S.js} +6 -6
- package/dist/chunk-5FE75J4S.js.map +1 -0
- package/dist/chunk-5KC7QYEC.js +565 -0
- package/dist/chunk-5KC7QYEC.js.map +1 -0
- package/dist/{chunk-RSGLUIO6.js → chunk-5UMK7GRI.js} +13 -12
- package/dist/chunk-5UMK7GRI.js.map +1 -0
- package/dist/chunk-5WWDGFOS.js +275 -0
- package/dist/chunk-5WWDGFOS.js.map +1 -0
- package/dist/{chunk-QPQUVOZ2.js → chunk-6QVKPHBF.js} +3 -5
- package/dist/chunk-6QVKPHBF.js.map +1 -0
- package/dist/{chunk-ACAQ2DSG.js → chunk-747G6CT3.js} +2 -2
- package/dist/chunk-747G6CT3.js.map +1 -0
- package/dist/{chunk-QTQUH4DS.js → chunk-7R2Q7CPL.js} +16 -16
- package/dist/chunk-7R2Q7CPL.js.map +1 -0
- package/dist/{chunk-UGTBXF5U.js → chunk-7XMHMVTS.js} +3 -3
- package/dist/{chunk-YJX7EOJD.js → chunk-A4XMIZT3.js} +6 -6
- package/dist/{chunk-YJX7EOJD.js.map → chunk-A4XMIZT3.js.map} +1 -1
- package/dist/{chunk-A66I4JOA.js → chunk-AEQGFRU4.js} +4 -4
- package/dist/chunk-AEQGFRU4.js.map +1 -0
- package/dist/chunk-AL6ML4LA.js +1558 -0
- package/dist/chunk-AL6ML4LA.js.map +1 -0
- package/dist/{chunk-BZ3534YM.js → chunk-AUKKUPVB.js} +2 -2
- package/dist/{chunk-CUZLNGD5.js → chunk-B2YY6WDD.js} +1 -1
- package/dist/chunk-B2YY6WDD.js.map +1 -0
- package/dist/chunk-BKT776R5.js +1 -0
- package/dist/chunk-BNWA3WG5.js +22 -0
- package/dist/chunk-BNWA3WG5.js.map +1 -0
- package/dist/{chunk-VXANTWBJ.js → chunk-BPWYQ25R.js} +92 -6
- package/dist/{chunk-VXANTWBJ.js.map → chunk-BPWYQ25R.js.map} +1 -1
- package/dist/{chunk-6LKOJBV6.js → chunk-BVCUTXE3.js} +2 -2
- package/dist/chunk-CY2CYVWZ.js +41 -0
- package/dist/chunk-CY2CYVWZ.js.map +1 -0
- package/dist/{chunk-M4YPHYEH.js → chunk-DHHGL42E.js} +70 -25
- package/dist/chunk-DHHGL42E.js.map +1 -0
- package/dist/{chunk-VTFVLCUH.js → chunk-DIZLQVAA.js} +2 -2
- package/dist/{chunk-G73UVHCA.js → chunk-DLD5LGDS.js} +11 -12
- package/dist/chunk-DLD5LGDS.js.map +1 -0
- package/dist/{chunk-WQBG4SZS.js → chunk-DQESF6RP.js} +60 -49
- package/dist/chunk-DQESF6RP.js.map +1 -0
- package/dist/{chunk-LWBCUYZW.js → chunk-E2N2T5ZO.js} +2 -2
- package/dist/{chunk-3PGS7TYR.js → chunk-EGVJ7TM4.js} +29 -32
- package/dist/chunk-EGVJ7TM4.js.map +1 -0
- package/dist/{chunk-JVIBCBC7.js → chunk-EJLV62NI.js} +2 -2
- package/dist/{chunk-KKEESNPE.js → chunk-EYG2CY2X.js} +126 -19
- package/dist/chunk-EYG2CY2X.js.map +1 -0
- package/dist/{enclave-55PAM4YO.js → chunk-EZGV6F47.js} +83 -56
- package/dist/chunk-EZGV6F47.js.map +1 -0
- package/dist/{chunk-CHQCZZWC.js → chunk-EZOAKKTB.js} +36 -27
- package/dist/chunk-EZOAKKTB.js.map +1 -0
- package/dist/chunk-F6NCB7KT.js +13 -0
- package/dist/chunk-F6NCB7KT.js.map +1 -0
- package/dist/chunk-FFJFE4T7.js +100 -0
- package/dist/chunk-FFJFE4T7.js.map +1 -0
- package/dist/{chunk-JMGDHKQF.js → chunk-FLPCETP6.js} +2 -2
- package/dist/chunk-FOEDQATO.js +53 -0
- package/dist/chunk-FOEDQATO.js.map +1 -0
- package/dist/{chunk-DGOZ4UZD.js → chunk-FVH5QYY2.js} +2 -2
- package/dist/{chunk-HIWCKBEY.js → chunk-G2MVBDFP.js} +54 -28
- package/dist/chunk-G2MVBDFP.js.map +1 -0
- package/dist/chunk-GMKGGY7V.js +234 -0
- package/dist/chunk-GMKGGY7V.js.map +1 -0
- package/dist/{chunk-EIPVYUEP.js → chunk-GQ4MF3CM.js} +3 -3
- package/dist/chunk-GQ4MF3CM.js.map +1 -0
- package/dist/{chunk-PEOZ34EM.js → chunk-GSAK56VF.js} +1 -1
- package/dist/chunk-GSAK56VF.js.map +1 -0
- package/dist/{chunk-5VCRVKOZ.js → chunk-GUZET4SG.js} +12 -4
- package/dist/chunk-GUZET4SG.js.map +1 -0
- package/dist/{chunk-JBDFMYKQ.js → chunk-GZT3NQRA.js} +2 -2
- package/dist/{chunk-K23VKTN4.js → chunk-H23XHRTT.js} +19 -34
- package/dist/chunk-H23XHRTT.js.map +1 -0
- package/dist/{chunk-TFR7DSOV.js → chunk-H427H63K.js} +2 -2
- package/dist/{chunk-DFMWUOU5.js → chunk-H7JBY4P7.js} +23 -32
- package/dist/chunk-H7JBY4P7.js.map +1 -0
- package/dist/{chunk-SKGMN35F.js → chunk-HS554XAF.js} +3 -3
- package/dist/chunk-HS554XAF.js.map +1 -0
- package/dist/{chunk-HK67PX4J.js → chunk-HW7CMKUG.js} +1 -1
- package/dist/chunk-HW7CMKUG.js.map +1 -0
- package/dist/{chunk-3BVH633C.js → chunk-IMQKWR46.js} +5 -7
- package/dist/chunk-IMQKWR46.js.map +1 -0
- package/dist/{chunk-R42NSZI6.js → chunk-IUBMZPHM.js} +7 -7
- package/dist/chunk-IUBMZPHM.js.map +1 -0
- package/dist/{chunk-CUQPWYRX.js → chunk-IUT3GWP3.js} +75 -386
- package/dist/chunk-IUT3GWP3.js.map +1 -0
- package/dist/{chunk-RF6D3Y5E.js → chunk-JDEYF3PJ.js} +4 -8
- package/dist/{chunk-RF6D3Y5E.js.map → chunk-JDEYF3PJ.js.map} +1 -1
- package/dist/{chunk-PPTHY5QO.js → chunk-JIBUPZHA.js} +99 -8
- package/dist/chunk-JIBUPZHA.js.map +1 -0
- package/dist/{chunk-SMH6SRX7.js → chunk-JOSPH3E5.js} +2 -2
- package/dist/chunk-JQYKPKG6.js +193 -0
- package/dist/chunk-JQYKPKG6.js.map +1 -0
- package/dist/{chunk-7APJ6CO6.js → chunk-JSMTXZR3.js} +45 -13
- package/dist/chunk-JSMTXZR3.js.map +1 -0
- package/dist/chunk-JWWYRR4Q.js +12 -0
- package/dist/chunk-JWWYRR4Q.js.map +1 -0
- package/dist/{chunk-BVN6KXL2.js → chunk-KZXDLBY6.js} +14 -9
- package/dist/chunk-KZXDLBY6.js.map +1 -0
- package/dist/chunk-LGNDFRYC.js +23 -0
- package/dist/chunk-LGNDFRYC.js.map +1 -0
- package/dist/{chunk-XKWGNJ26.js → chunk-LIOVX5TJ.js} +7 -11
- package/dist/chunk-LIOVX5TJ.js.map +1 -0
- package/dist/{chunk-AYX7AINO.js → chunk-LNSVGRHO.js} +5 -7
- package/dist/chunk-LNSVGRHO.js.map +1 -0
- package/dist/chunk-M5B2W6YY.js +293 -0
- package/dist/chunk-M5B2W6YY.js.map +1 -0
- package/dist/chunk-MBMTND6D.js +456 -0
- package/dist/chunk-MBMTND6D.js.map +1 -0
- package/dist/{chunk-3BZZJJMQ.js → chunk-MILI22XQ.js} +3 -3
- package/dist/{chunk-A2HKRLPV.js → chunk-MXKI4ABF.js} +18 -59
- package/dist/chunk-MXKI4ABF.js.map +1 -0
- package/dist/{chunk-ZYIYHJ5R.js → chunk-MXOQ5JCG.js} +869 -238
- package/dist/chunk-MXOQ5JCG.js.map +1 -0
- package/dist/{chunk-V7ZRRCRJ.js → chunk-N7EVQD5S.js} +9 -13
- package/dist/chunk-N7EVQD5S.js.map +1 -0
- package/dist/chunk-N7UDP5VU.js +757 -0
- package/dist/chunk-N7UDP5VU.js.map +1 -0
- package/dist/chunk-NBQ3KK6X.js +270 -0
- package/dist/chunk-NBQ3KK6X.js.map +1 -0
- package/dist/{chunk-ZORTV6NH.js → chunk-NCO25JZO.js} +88 -4
- package/dist/chunk-NCO25JZO.js.map +1 -0
- package/dist/chunk-NH2UOV3B.js +18 -0
- package/dist/chunk-NH2UOV3B.js.map +1 -0
- package/dist/chunk-NYMLINRP.js +28 -0
- package/dist/chunk-NYMLINRP.js.map +1 -0
- package/dist/{chunk-YYP7WSEB.js → chunk-O2IMQSNA.js} +2 -2
- package/dist/chunk-O46CHQT7.js +215 -0
- package/dist/chunk-O46CHQT7.js.map +1 -0
- package/dist/chunk-OIEO4WDL.js +27 -0
- package/dist/chunk-OIEO4WDL.js.map +1 -0
- package/dist/{chunk-TRGTKX5E.js → chunk-OKSTSITU.js} +27 -4
- package/dist/chunk-OKSTSITU.js.map +1 -0
- package/dist/chunk-OYW3I5M4.js +31 -0
- package/dist/chunk-OYW3I5M4.js.map +1 -0
- package/dist/{chunk-Q7HZX3IF.js → chunk-PD64727P.js} +2 -2
- package/dist/chunk-PD64727P.js.map +1 -0
- package/dist/{chunk-FET5XCAT.js → chunk-PP3K67AJ.js} +34 -6
- package/dist/chunk-PP3K67AJ.js.map +1 -0
- package/dist/chunk-Q2XRFWOI.js +40 -0
- package/dist/chunk-Q2XRFWOI.js.map +1 -0
- package/dist/{chunk-QIZPZMUI.js → chunk-Q4UHJ5SN.js} +2 -2
- package/dist/{chunk-FAHMLERK.js → chunk-QBLT6POL.js} +2 -2
- package/dist/chunk-QMWY2FDS.js +157 -0
- package/dist/chunk-QMWY2FDS.js.map +1 -0
- package/dist/{chunk-LH5A3ZPG.js → chunk-RB4DOPGZ.js} +150 -22
- package/dist/chunk-RB4DOPGZ.js.map +1 -0
- package/dist/chunk-RHVMZSUU.js +7 -0
- package/dist/chunk-RHVMZSUU.js.map +1 -0
- package/dist/{chunk-BUE2D7PX.js → chunk-SMV2HRDU.js} +2 -2
- package/dist/chunk-SUZKW6UR.js +25 -0
- package/dist/chunk-SUZKW6UR.js.map +1 -0
- package/dist/{chunk-7MG7SJT7.js → chunk-SV2PM2OY.js} +1 -1
- package/dist/chunk-SV2PM2OY.js.map +1 -0
- package/dist/{chunk-UXVWEX5L.js → chunk-SYNY3VB5.js} +6 -2
- package/dist/chunk-SYNY3VB5.js.map +1 -0
- package/dist/{chunk-4GFX6MPA.js → chunk-TEHHROZL.js} +6 -8
- package/dist/chunk-TEHHROZL.js.map +1 -0
- package/dist/chunk-TKVUE4JF.js +1289 -0
- package/dist/chunk-TKVUE4JF.js.map +1 -0
- package/dist/{chunk-SFAWCTEM.js → chunk-TZZBXPZK.js} +2 -2
- package/dist/{chunk-F3W6YMDC.js → chunk-U2FZNEWJ.js} +4 -4
- package/dist/chunk-U2FZNEWJ.js.map +1 -0
- package/dist/{chunk-BLN54W3L.js → chunk-UA372JHH.js} +56 -3
- package/dist/chunk-UA372JHH.js.map +1 -0
- package/dist/{chunk-6YXCPL4T.js → chunk-UEFOQH74.js} +2 -2
- package/dist/chunk-UEFOQH74.js.map +1 -0
- package/dist/{chunk-2N5ML6HT.js → chunk-UIYESRD6.js} +9 -11
- package/dist/chunk-UIYESRD6.js.map +1 -0
- package/dist/{chunk-UHHPLO3I.js → chunk-V3RWOOSO.js} +4 -4
- package/dist/{chunk-KTFRCC5C.js → chunk-V7ADQF5O.js} +82 -8
- package/dist/chunk-V7ADQF5O.js.map +1 -0
- package/dist/{chunk-453F654R.js → chunk-VAORSCSU.js} +3 -3
- package/dist/chunk-VAORSCSU.js.map +1 -0
- package/dist/{chunk-GPNTB4Y7.js → chunk-VFHCKG5M.js} +6 -10
- package/dist/chunk-VFHCKG5M.js.map +1 -0
- package/dist/{chunk-2577DKXB.js → chunk-VHBKYN2J.js} +3 -3
- package/dist/chunk-VHBKYN2J.js.map +1 -0
- package/dist/chunk-VHM7HCKB.js +220 -0
- package/dist/chunk-VHM7HCKB.js.map +1 -0
- package/dist/{chunk-ZHKOPKE3.js → chunk-VKI2EB3N.js} +3 -3
- package/dist/chunk-VKI2EB3N.js.map +1 -0
- package/dist/{chunk-UDHWDSRL.js → chunk-VMV5SBE4.js} +16 -17
- package/dist/chunk-VMV5SBE4.js.map +1 -0
- package/dist/{chunk-SPYWXKJN.js → chunk-VQDZYB2B.js} +3 -3
- package/dist/chunk-VQDZYB2B.js.map +1 -0
- package/dist/{chunk-Q2PU57HC.js → chunk-VVOLDVIR.js} +2 -2
- package/dist/{chunk-3VF3WQ4F.js → chunk-WPOYWFSE.js} +7 -7
- package/dist/{chunk-3VF3WQ4F.js.map → chunk-WPOYWFSE.js.map} +1 -1
- package/dist/{chunk-OTQZ7ZWU.js → chunk-WXE4W2U6.js} +7 -11
- package/dist/chunk-WXE4W2U6.js.map +1 -0
- package/dist/chunk-XBKH4FOC.js +195 -0
- package/dist/chunk-XBKH4FOC.js.map +1 -0
- package/dist/{chunk-TUFM4UZP.js → chunk-XQRFSKYM.js} +2 -2
- package/dist/{chunk-3V4KWFX7.js → chunk-XSPFDUDG.js} +58 -53
- package/dist/chunk-XSPFDUDG.js.map +1 -0
- package/dist/{chunk-GY4WYNNG.js → chunk-Y2RKVFKR.js} +2 -2
- package/dist/{chunk-UP4BECPY.js → chunk-Y3LPTBG7.js} +89 -27
- package/dist/chunk-Y3LPTBG7.js.map +1 -0
- package/dist/{chunk-4OZNXTO4.js → chunk-YRXFFWG4.js} +2 -2
- package/dist/classified/index.js +5 -5
- package/dist/{classified-marker-BWOFVYAC.js → classified-marker-SIYKUU5L.js} +3 -3
- package/dist/classified-marker-SIYKUU5L.js.map +1 -0
- package/dist/collection-facade-CS7CA2XO.js +47 -0
- package/dist/{computed-VPOKQK4N.js → computed-FAD7SED4.js} +3 -3
- package/dist/consent/index.js +10 -11
- package/dist/consent/index.js.map +1 -1
- package/dist/cover/index.js +10 -11
- package/dist/coverage/index.js +306 -0
- package/dist/coverage/index.js.map +1 -0
- package/dist/custody/index.js +12 -13
- package/dist/{dead-filter-PKQDLOT4.js → dead-filter-4F3LWYKH.js} +11 -3
- package/dist/dead-filter-4F3LWYKH.js.map +1 -0
- package/dist/debug/index.js +11 -2
- package/dist/debug/index.js.map +1 -1
- package/dist/{delegation-DS5NRILW.js → delegation-NANZDG4N.js} +13 -16
- package/dist/delegation-NANZDG4N.js.map +1 -0
- package/dist/derivations/index.js +25 -23
- package/dist/derive-XLOJVXPU.js +20 -0
- package/dist/directory/index.js +10 -11
- package/dist/{dispatch-IEPAVQUM.js → dispatch-H4HV32AM.js} +5 -5
- package/dist/{dispatch-Q6MWLOJY.js → dispatch-JDZNGEB3.js} +20 -21
- package/dist/dispatch-JDZNGEB3.js.map +1 -0
- package/dist/executor-FMPVN6DT.js +35 -0
- package/dist/executor-LBBBRTN5.js +8 -0
- package/dist/executor-OSRZST2U.js +8 -0
- package/dist/export-accessible-RAOJAAU5.js +22 -0
- package/dist/extract-partition-JD5CUSTG.js +37 -0
- package/dist/{fanout-sidecar-S3QL53YX.js → fanout-sidecar-L7NHPIOC.js} +13 -15
- package/dist/fanout-sidecar-L7NHPIOC.js.map +1 -0
- package/dist/find-JRN4RNQ5.js +10 -0
- package/dist/forget/index.js +9 -10
- package/dist/forget/index.js.map +1 -1
- package/dist/guards/index.js +4 -4
- package/dist/history/index.js +13 -14
- package/dist/history/index.js.map +1 -1
- package/dist/i18n/index.js +14 -15
- package/dist/i18n/index.js.map +1 -1
- package/dist/index.d.ts +36 -14
- package/dist/index.js +970 -163
- 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 -12
- package/dist/issue-YIVBZUTH.js +19 -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/attestation-types.d.ts +62 -0
- package/dist/kernel/collection-config.d.ts +5 -68
- package/dist/kernel/collection.d.ts +30 -9
- package/dist/kernel/cutover-transform.d.ts +1 -1
- package/dist/kernel/errors.d.ts +257 -38
- package/dist/kernel/generation-map.d.ts +48 -0
- package/dist/kernel/merge-authority.d.ts +1 -1
- package/dist/kernel/noydb.d.ts +6 -1
- package/dist/kernel/paths.d.ts +29 -5
- package/dist/kernel/prepared-write.d.ts +1 -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/secret-mode.d.ts +1 -1
- package/dist/kernel/tx-write-gate.d.ts +77 -0
- package/dist/kernel/types.d.ts +113 -8
- package/dist/kernel/validation.d.ts +27 -10
- package/dist/kernel/vault.d.ts +11 -6
- 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/kernel/write-queue.d.ts +17 -0
- package/dist/{ledger-EDXFFZQL.js → ledger-5ZMGE44K.js} +11 -12
- package/dist/liberate-WZSZM2W6.js +24 -0
- package/dist/link-set-MFXC24VK.js +29 -0
- package/dist/{managed-secret-NCWEMPUQ.js → managed-secret-MFTFT22X.js} +10 -11
- package/dist/materialized-views/index.js +30 -24
- package/dist/{migrate-cek-5ENH64AA.js → migrate-cek-DZRFFOHW.js} +2 -2
- package/dist/money/index.js +5 -5
- package/dist/noydb-ITIGNKUF.js +96 -0
- package/dist/overlay-views/index.js +4 -4
- package/dist/periods/index.js +12 -13
- package/dist/pod/index.js +74 -67
- package/dist/{pod-handle-ECVCDIXW.js → pod-handle-A3LET7NO.js} +10 -11
- package/dist/pod-handle-A3LET7NO.js.map +1 -0
- package/dist/policy/index.js +10 -11
- package/dist/port/on/index.d.ts +1 -1
- package/dist/port/to/index.d.ts +1 -1
- package/dist/port/with/blob-strategy.d.ts +10 -1
- package/dist/port/with/classified-strategy.d.ts +1 -1
- package/dist/port/with/collection-options.d.ts +6 -1
- package/dist/port/with/collection-registries.d.ts +1 -1
- package/dist/port/with/coverage-strategy.d.ts +83 -0
- package/dist/port/with/lookup-strategy.d.ts +2 -2
- 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-3IPCSG6Q.js → post-register-7ND27CF2.js} +6 -6
- package/dist/post-register-7ND27CF2.js.map +1 -0
- 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-DT5HZ2LZ.js +30 -0
- package/dist/registry-BHRZGZHF.js +8 -0
- package/dist/registry-ET6ZFFWA.js +34 -0
- package/dist/registry-HXFGLGTG.js +8 -0
- package/dist/registry-THCPDEOD.js +23 -0
- package/dist/request-withdrawal-AV2MJJKY.js +30 -0
- package/dist/{reveal-QZDHSGD4.js → reveal-B2TLP4JQ.js} +10 -9
- package/dist/reveal-B2TLP4JQ.js.map +1 -0
- package/dist/revoke-6DWIEOCV.js +24 -0
- package/dist/satellites/index.js +1 -1
- package/dist/schema-update/index.js +2 -2
- package/dist/sealed-record/index.js +16 -18
- package/dist/sealed-record/index.js.map +1 -1
- package/dist/search/index.js +11 -5
- package/dist/{seed-X5CC22CQ.js → seed-XNSE4U3S.js} +15 -18
- package/dist/seed-XNSE4U3S.js.map +1 -0
- package/dist/sequence/index.js +9 -10
- package/dist/session/index.js +9 -10
- package/dist/session/index.js.map +1 -1
- package/dist/shadow/index.js +2 -2
- package/dist/signer-MHGW3OIL.js +23 -0
- package/dist/snapshots/index.js +11 -11
- package/dist/stale-6GCFMOOR.js +28 -0
- package/dist/storage-BYN5LO6Z.js +21 -0
- package/dist/storage-BYN5LO6Z.js.map +1 -0
- package/dist/store/index.js +1 -1
- package/dist/{store-coordination-provider-4WZAIRHC.js → store-coordination-provider-C4BPT5XF.js} +11 -12
- package/dist/store-coordination-provider-C4BPT5XF.js.map +1 -0
- package/dist/sync/index.js +10 -11
- package/dist/sync/index.js.map +1 -1
- package/dist/team/index.js +17 -16
- package/dist/tiers/index.js +13 -12
- package/dist/to/index.js +2 -2
- package/dist/transactions/index.js +3 -3
- package/dist/util/index.js +1 -1
- package/dist/vault-head/index.js +11 -14
- package/dist/vault-head/index.js.map +1 -1
- package/dist/{verify-6MDTIUEV.js → verify-UKALW7C2.js} +14 -12
- package/dist/verify-UKALW7C2.js.map +1 -0
- package/dist/via/blob/index.d.ts +1 -0
- package/dist/via/classified/binding.d.ts +2 -2
- package/dist/via/classified/config-drift.d.ts +2 -2
- package/dist/via/classified/errors.d.ts +1 -1
- package/dist/via/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/handle.d.ts +4 -4
- package/dist/via/lookup/registry.d.ts +1 -1
- package/dist/via/lookup/snapshot.d.ts +3 -3
- package/dist/walk-4VPK7AS4.js +20 -0
- package/dist/walk-4VPK7AS4.js.map +1 -0
- package/dist/with-audit/attestation/index.d.ts +2 -1
- package/dist/with-audit/attestation/issue.d.ts +2 -2
- package/dist/with-audit/attestation/revoke.d.ts +2 -2
- package/dist/with-audit/attestation/scheme.d.ts +7 -0
- package/dist/with-audit/attestation/signer.d.ts +1 -1
- package/dist/with-audit/attestation/strategy.d.ts +2 -2
- package/dist/with-audit/attestation/types.d.ts +10 -0
- package/dist/with-audit/attestation/vault-facade.d.ts +2 -2
- package/dist/with-audit/attestation/verifier.d.ts +6 -0
- package/dist/with-audit/consent/consent.d.ts +1 -1
- package/dist/with-audit/consent/strategy.d.ts +1 -1
- package/dist/with-audit/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/forget/subject-index.d.ts +1 -1
- 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 +18 -1
- package/dist/with-audit/sealed-record/index.d.ts +2 -2
- package/dist/with-audit/sealed-record/strategy.d.ts +1 -1
- package/dist/with-audit/tiers/index.d.ts +53 -2
- package/dist/with-audit/tiers/strategy.d.ts +8 -0
- package/dist/with-cargo/adopt-partition.d.ts +1 -1
- package/dist/with-cargo/extract-partition.d.ts +1 -1
- package/dist/with-cargo/floor.d.ts +3 -3
- package/dist/with-commit/history/history.d.ts +2 -2
- package/dist/with-commit/history/index.d.ts +1 -1
- package/dist/with-commit/history/ledger/store.d.ts +1 -1
- package/dist/with-commit/history/strategy.d.ts +1 -1
- package/dist/with-commit/history/time-machine.d.ts +1 -1
- package/dist/with-commit/numbering/index.d.ts +1 -1
- package/dist/with-commit/sequence/index.d.ts +1 -1
- package/dist/with-commit/tx/invariants.d.ts +1 -1
- package/dist/with-commit/tx/transaction.d.ts +13 -3
- package/dist/with-commit/vault-head/head.d.ts +1 -1
- package/dist/with-commit/vault-head/index.d.ts +1 -1
- package/dist/with-commit/vault-head/strategy.d.ts +1 -1
- package/dist/with-commit/vault-head/verify.d.ts +1 -1
- package/dist/with-formula/derivations/dispatch.d.ts +1 -1
- package/dist/with-formula/derivations/fanout-sidecar.d.ts +1 -1
- package/dist/with-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 +86 -3
- 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 +45 -9
- 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/broker/index.d.ts +3 -3
- 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/directory/user-envelope/storage.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/delegation.d.ts +1 -1
- package/dist/with-party/team/echo-secret.d.ts +2 -2
- package/dist/with-party/team/index.d.ts +4 -3
- package/dist/with-party/team/keyring.d.ts +2 -2
- package/dist/with-party/team/magic-link-grant.d.ts +1 -1
- 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/recovery.d.ts +1 -1
- package/dist/with-party/team/roster-tag.d.ts +1 -1
- package/dist/with-party/team/rotate-recover.d.ts +1 -1
- package/dist/with-party/team/wrapped-deks.d.ts +1 -1
- package/dist/with-pod/format.d.ts +1 -1
- package/dist/with-pod/index.d.ts +1 -1
- package/dist/with-pod/pod.d.ts +1 -1
- package/dist/with-shape/blobs/blob-compaction.d.ts +17 -1
- package/dist/with-shape/blobs/blob-intent.d.ts +1 -1
- package/dist/with-shape/blobs/blob-set.d.ts +23 -4
- package/dist/with-shape/blobs/legacy-sweep.d.ts +35 -0
- package/dist/with-shape/introspection/describe.d.ts +7 -1
- 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/introspection/walk.d.ts +1 -1
- package/dist/with-shape/links/lazy-handle.d.ts +1 -1
- package/dist/with-shape/links/link-set.d.ts +1 -1
- package/dist/with-shape/links/vault-facade.d.ts +1 -1
- package/dist/with-shape/manifest/derive.d.ts +1 -1
- package/dist/with-shape/manifest/storage.d.ts +1 -1
- package/dist/with-shape/persisted-schemas/register.d.ts +1 -1
- package/dist/with-shape/persisted-schemas/storage.d.ts +1 -1
- package/dist/with-shape/satellites/dead-filter.d.ts +1 -1
- package/dist/with-shape/satellites/declare.d.ts +1 -1
- package/dist/with-shape/satellites/marker.d.ts +1 -1
- package/dist/with-shape/satellites/post-register.d.ts +1 -1
- package/dist/with-store/partitioned/index.d.ts +337 -0
- package/dist/with-sync/change-broadcast.d.ts +153 -0
- package/dist/with-sync/presence.d.ts +5 -10
- package/dist/withdraw-accessible-HL7GACUE.js +27 -0
- package/dist/withdraw-accessible-HL7GACUE.js.map +1 -0
- package/package.json +48 -12
- package/dist/api-WYW4YEQG.js +0 -19
- package/dist/backup-XKCXVKV3.js.map +0 -1
- package/dist/chunk-2577DKXB.js.map +0 -1
- package/dist/chunk-2ENE6445.js.map +0 -1
- package/dist/chunk-2N5ML6HT.js.map +0 -1
- package/dist/chunk-334WSVOW.js.map +0 -1
- package/dist/chunk-3BVH633C.js.map +0 -1
- package/dist/chunk-3PGS7TYR.js.map +0 -1
- package/dist/chunk-3V4KWFX7.js.map +0 -1
- package/dist/chunk-453F654R.js.map +0 -1
- package/dist/chunk-4GFX6MPA.js.map +0 -1
- package/dist/chunk-4GVM6QZA.js.map +0 -1
- package/dist/chunk-4ZS56W5S.js.map +0 -1
- package/dist/chunk-5VCRVKOZ.js.map +0 -1
- package/dist/chunk-6YXCPL4T.js.map +0 -1
- package/dist/chunk-7APJ6CO6.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-A2HKRLPV.js.map +0 -1
- package/dist/chunk-A66I4JOA.js.map +0 -1
- package/dist/chunk-ACAQ2DSG.js.map +0 -1
- package/dist/chunk-ATL3ZVXT.js +0 -151
- package/dist/chunk-ATL3ZVXT.js.map +0 -1
- package/dist/chunk-AYX7AINO.js.map +0 -1
- package/dist/chunk-BLN54W3L.js.map +0 -1
- package/dist/chunk-BRLKZUBT.js +0 -95
- package/dist/chunk-BRLKZUBT.js.map +0 -1
- package/dist/chunk-BTDR2PXY.js +0 -29
- package/dist/chunk-BTDR2PXY.js.map +0 -1
- package/dist/chunk-BVN6KXL2.js.map +0 -1
- package/dist/chunk-CHQCZZWC.js.map +0 -1
- package/dist/chunk-CUQPWYRX.js.map +0 -1
- package/dist/chunk-CUZLNGD5.js.map +0 -1
- package/dist/chunk-DFMWUOU5.js.map +0 -1
- package/dist/chunk-EIPVYUEP.js.map +0 -1
- package/dist/chunk-EQEYOJBM.js.map +0 -1
- package/dist/chunk-F3W6YMDC.js.map +0 -1
- package/dist/chunk-FET5XCAT.js.map +0 -1
- package/dist/chunk-G73UVHCA.js.map +0 -1
- package/dist/chunk-GPNTB4Y7.js.map +0 -1
- package/dist/chunk-GYGLAVCX.js.map +0 -1
- package/dist/chunk-HIWCKBEY.js.map +0 -1
- package/dist/chunk-HJUWN7JN.js.map +0 -1
- package/dist/chunk-HK67PX4J.js.map +0 -1
- package/dist/chunk-HPVZCW43.js +0 -479
- package/dist/chunk-HPVZCW43.js.map +0 -1
- package/dist/chunk-I3ISCYT7.js +0 -159
- package/dist/chunk-I3ISCYT7.js.map +0 -1
- package/dist/chunk-K23VKTN4.js.map +0 -1
- package/dist/chunk-KKEESNPE.js.map +0 -1
- package/dist/chunk-KTFRCC5C.js.map +0 -1
- package/dist/chunk-LH5A3ZPG.js.map +0 -1
- package/dist/chunk-LP7BEXCT.js +0 -32
- package/dist/chunk-LP7BEXCT.js.map +0 -1
- package/dist/chunk-M4YPHYEH.js.map +0 -1
- package/dist/chunk-NSITFOCJ.js +0 -99
- package/dist/chunk-NSITFOCJ.js.map +0 -1
- package/dist/chunk-OTQZ7ZWU.js.map +0 -1
- package/dist/chunk-P3MG6QCN.js.map +0 -1
- package/dist/chunk-PEOZ34EM.js.map +0 -1
- package/dist/chunk-PPTHY5QO.js.map +0 -1
- package/dist/chunk-Q2MPFCQ7.js.map +0 -1
- package/dist/chunk-Q7HZX3IF.js.map +0 -1
- package/dist/chunk-QPQUVOZ2.js.map +0 -1
- package/dist/chunk-QTQUH4DS.js.map +0 -1
- package/dist/chunk-R42NSZI6.js.map +0 -1
- package/dist/chunk-R7BX2NB3.js.map +0 -1
- package/dist/chunk-RSGLUIO6.js.map +0 -1
- package/dist/chunk-RTBJ5IOO.js +0 -87
- package/dist/chunk-RTBJ5IOO.js.map +0 -1
- package/dist/chunk-SGZAIJCV.js.map +0 -1
- package/dist/chunk-SKGMN35F.js.map +0 -1
- package/dist/chunk-SPYWXKJN.js.map +0 -1
- package/dist/chunk-SZJ3DLZA.js +0 -66
- package/dist/chunk-SZJ3DLZA.js.map +0 -1
- package/dist/chunk-TRGTKX5E.js.map +0 -1
- package/dist/chunk-UDHWDSRL.js.map +0 -1
- package/dist/chunk-UP4BECPY.js.map +0 -1
- package/dist/chunk-UXVWEX5L.js.map +0 -1
- package/dist/chunk-V7ZRRCRJ.js.map +0 -1
- package/dist/chunk-WQBG4SZS.js.map +0 -1
- package/dist/chunk-XKWGNJ26.js.map +0 -1
- package/dist/chunk-YMUFFJCO.js.map +0 -1
- package/dist/chunk-ZHKOPKE3.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/chunk-ZYIYHJ5R.js.map +0 -1
- package/dist/classified-marker-BWOFVYAC.js.map +0 -1
- package/dist/collection-facade-JSJYIKS4.js +0 -45
- package/dist/dead-filter-PKQDLOT4.js.map +0 -1
- package/dist/delegation-DS5NRILW.js.map +0 -1
- package/dist/derive-E642AOUB.js +0 -21
- package/dist/dispatch-Q6MWLOJY.js.map +0 -1
- package/dist/executor-5NIMLSKZ.js +0 -8
- package/dist/executor-7UQ3BZ4F.js +0 -29
- package/dist/executor-AQVXV5GZ.js +0 -8
- package/dist/export-accessible-ORMKLA3E.js +0 -22
- package/dist/extract-partition-NKYO3WNG.js +0 -37
- package/dist/fanout-sidecar-S3QL53YX.js.map +0 -1
- package/dist/find-NOGJ25VX.js +0 -10
- package/dist/issue-3DTQ7VJJ.js +0 -18
- package/dist/json-schema-V3M5MUCM.js.map +0 -1
- package/dist/kernel/enclave/classify/compare.d.ts +0 -10
- package/dist/kernel/enclave/index.d.ts +0 -87
- package/dist/kernel/enclave/record-keys/lifecycle.d.ts +0 -124
- package/dist/kernel/enclave/record-keys/rekey-blob.d.ts +0 -88
- package/dist/kernel/enclave/record-keys/rekey.d.ts +0 -91
- package/dist/kernel/enclave/record-keys/sealed-slot.d.ts +0 -14
- package/dist/kernel/enclave/record-keys/sealed-slots.d.ts +0 -123
- package/dist/kernel/enclave/record-keys/sealing.d.ts +0 -70
- package/dist/kernel/query/join.d.ts +0 -232
- package/dist/liberate-V35QUHJP.js +0 -24
- package/dist/link-set-2TTM3IZC.js +0 -30
- package/dist/noydb-62MX4QUG.js +0 -90
- package/dist/pod-handle-ECVCDIXW.js.map +0 -1
- package/dist/post-register-3IPCSG6Q.js.map +0 -1
- package/dist/register-HHLXEQDN.js +0 -31
- package/dist/registry-23WF3TGH.js +0 -8
- package/dist/registry-4AYVUNXK.js +0 -8
- package/dist/registry-JS3YFQQM.js +0 -18
- package/dist/registry-XX2Z7B46.js +0 -32
- package/dist/request-withdrawal-CHPATE4G.js +0 -30
- package/dist/reveal-QZDHSGD4.js.map +0 -1
- package/dist/revoke-7M2VW4ON.js +0 -23
- package/dist/seed-X5CC22CQ.js.map +0 -1
- package/dist/signer-SJQJVSM6.js +0 -24
- package/dist/stale-BZS6H2RY.js +0 -29
- package/dist/storage-RW4QBS23.js +0 -22
- package/dist/store-coordination-provider-4WZAIRHC.js.map +0 -1
- package/dist/verify-6MDTIUEV.js.map +0 -1
- package/dist/walk-ZURCH6RZ.js +0 -21
- package/dist/withdraw-accessible-PXR4IXDX.js +0 -27
- /package/dist/{api-WYW4YEQG.js.map → api-OS747DS4.js.map} +0 -0
- /package/dist/{computed-VPOKQK4N.js.map → capsule/contract.js.map} +0 -0
- /package/dist/{kernel/enclave → capsule/enclave-aes}/broker/proof.d.ts +0 -0
- /package/dist/{kernel/enclave → capsule/enclave-aes}/classify/bidx.d.ts +0 -0
- /package/dist/{kernel/enclave → capsule/enclave-aes}/classify/digest.d.ts +0 -0
- /package/dist/{kernel/enclave → capsule/enclave-aes}/classify/vdig.d.ts +0 -0
- /package/dist/{kernel/enclave/classify → capsule/plumbing}/kofn.d.ts +0 -0
- /package/dist/{kernel/enclave/classify → capsule/plumbing}/normalize.d.ts +0 -0
- /package/dist/{kernel/enclave → capsule/plumbing}/record-aad.d.ts +0 -0
- /package/dist/{collection-facade-JSJYIKS4.js.map → capsule-VOLX3QRQ.js.map} +0 -0
- /package/dist/{chunk-MVMXZYXT.js.map → chunk-2GHDLTPE.js.map} +0 -0
- /package/dist/{chunk-XLMEZIAJ.js.map → chunk-2ODVB6LZ.js.map} +0 -0
- /package/dist/{chunk-RMS3NEA3.js.map → chunk-4JPMZTJY.js.map} +0 -0
- /package/dist/{chunk-NQKIUNW5.js.map → chunk-52MGURXO.js.map} +0 -0
- /package/dist/{chunk-UGTBXF5U.js.map → chunk-7XMHMVTS.js.map} +0 -0
- /package/dist/{chunk-BZ3534YM.js.map → chunk-AUKKUPVB.js.map} +0 -0
- /package/dist/{derive-E642AOUB.js.map → chunk-BKT776R5.js.map} +0 -0
- /package/dist/{chunk-6LKOJBV6.js.map → chunk-BVCUTXE3.js.map} +0 -0
- /package/dist/{chunk-VTFVLCUH.js.map → chunk-DIZLQVAA.js.map} +0 -0
- /package/dist/{chunk-LWBCUYZW.js.map → chunk-E2N2T5ZO.js.map} +0 -0
- /package/dist/{chunk-JVIBCBC7.js.map → chunk-EJLV62NI.js.map} +0 -0
- /package/dist/{chunk-JMGDHKQF.js.map → chunk-FLPCETP6.js.map} +0 -0
- /package/dist/{chunk-DGOZ4UZD.js.map → chunk-FVH5QYY2.js.map} +0 -0
- /package/dist/{chunk-JBDFMYKQ.js.map → chunk-GZT3NQRA.js.map} +0 -0
- /package/dist/{chunk-TFR7DSOV.js.map → chunk-H427H63K.js.map} +0 -0
- /package/dist/{chunk-SMH6SRX7.js.map → chunk-JOSPH3E5.js.map} +0 -0
- /package/dist/{chunk-3BZZJJMQ.js.map → chunk-MILI22XQ.js.map} +0 -0
- /package/dist/{chunk-YYP7WSEB.js.map → chunk-O2IMQSNA.js.map} +0 -0
- /package/dist/{chunk-QIZPZMUI.js.map → chunk-Q4UHJ5SN.js.map} +0 -0
- /package/dist/{chunk-FAHMLERK.js.map → chunk-QBLT6POL.js.map} +0 -0
- /package/dist/{chunk-BUE2D7PX.js.map → chunk-SMV2HRDU.js.map} +0 -0
- /package/dist/{chunk-SFAWCTEM.js.map → chunk-TZZBXPZK.js.map} +0 -0
- /package/dist/{chunk-UHHPLO3I.js.map → chunk-V3RWOOSO.js.map} +0 -0
- /package/dist/{chunk-Q2PU57HC.js.map → chunk-VVOLDVIR.js.map} +0 -0
- /package/dist/{chunk-TUFM4UZP.js.map → chunk-XQRFSKYM.js.map} +0 -0
- /package/dist/{chunk-GY4WYNNG.js.map → chunk-Y2RKVFKR.js.map} +0 -0
- /package/dist/{chunk-4OZNXTO4.js.map → chunk-YRXFFWG4.js.map} +0 -0
- /package/dist/{enclave-55PAM4YO.js.map → collection-facade-CS7CA2XO.js.map} +0 -0
- /package/dist/{executor-5NIMLSKZ.js.map → computed-FAD7SED4.js.map} +0 -0
- /package/dist/{executor-7UQ3BZ4F.js.map → derive-XLOJVXPU.js.map} +0 -0
- /package/dist/{dispatch-IEPAVQUM.js.map → dispatch-H4HV32AM.js.map} +0 -0
- /package/dist/{executor-AQVXV5GZ.js.map → executor-FMPVN6DT.js.map} +0 -0
- /package/dist/{export-accessible-ORMKLA3E.js.map → executor-LBBBRTN5.js.map} +0 -0
- /package/dist/{extract-partition-NKYO3WNG.js.map → executor-OSRZST2U.js.map} +0 -0
- /package/dist/{find-NOGJ25VX.js.map → export-accessible-RAOJAAU5.js.map} +0 -0
- /package/dist/{issue-3DTQ7VJJ.js.map → extract-partition-JD5CUSTG.js.map} +0 -0
- /package/dist/{ledger-EDXFFZQL.js.map → find-JRN4RNQ5.js.map} +0 -0
- /package/dist/{liberate-V35QUHJP.js.map → issue-YIVBZUTH.js.map} +0 -0
- /package/dist/{link-set-2TTM3IZC.js.map → ledger-5ZMGE44K.js.map} +0 -0
- /package/dist/{managed-secret-NCWEMPUQ.js.map → liberate-WZSZM2W6.js.map} +0 -0
- /package/dist/{noydb-62MX4QUG.js.map → link-set-MFXC24VK.js.map} +0 -0
- /package/dist/{register-HHLXEQDN.js.map → managed-secret-MFTFT22X.js.map} +0 -0
- /package/dist/{migrate-cek-5ENH64AA.js.map → migrate-cek-DZRFFOHW.js.map} +0 -0
- /package/dist/{registry-23WF3TGH.js.map → noydb-ITIGNKUF.js.map} +0 -0
- /package/dist/{registry-4AYVUNXK.js.map → query/all/index.js.map} +0 -0
- /package/dist/{registry-JS3YFQQM.js.map → register-DT5HZ2LZ.js.map} +0 -0
- /package/dist/{registry-XX2Z7B46.js.map → registry-BHRZGZHF.js.map} +0 -0
- /package/dist/{request-withdrawal-CHPATE4G.js.map → registry-ET6ZFFWA.js.map} +0 -0
- /package/dist/{revoke-7M2VW4ON.js.map → registry-HXFGLGTG.js.map} +0 -0
- /package/dist/{signer-SJQJVSM6.js.map → registry-THCPDEOD.js.map} +0 -0
- /package/dist/{stale-BZS6H2RY.js.map → request-withdrawal-AV2MJJKY.js.map} +0 -0
- /package/dist/{storage-RW4QBS23.js.map → revoke-6DWIEOCV.js.map} +0 -0
- /package/dist/{walk-ZURCH6RZ.js.map → signer-MHGW3OIL.js.map} +0 -0
- /package/dist/{withdraw-accessible-PXR4IXDX.js.map → stale-6GCFMOOR.js.map} +0 -0
|
@@ -0,0 +1,426 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* #1458 — **Relate**: every multi-source and plan-level operation.
|
|
3
|
+
*
|
|
4
|
+
* `join` · `joinOn` · `rightJoin` · `fullOuterJoin` · `crossJoin` ·
|
|
5
|
+
* `crossJoinWith` · `traverse` · `ancestorsOf` · `descendantsOf` · `explain`
|
|
6
|
+
*
|
|
7
|
+
* The bodies below moved out of `kernel/query/builder.ts` UNCHANGED. They read
|
|
8
|
+
* `this.source` / `this.plan` / `this.joinContext` exactly as they did while
|
|
9
|
+
* they were class members, because at runtime that is precisely what they
|
|
10
|
+
* still are: `install()` copies them onto `Query.prototype`, and TypeScript's
|
|
11
|
+
* `private` never existed at runtime. The `declare` fields at the top of the
|
|
12
|
+
* mixin are how the compiler is told the same thing.
|
|
13
|
+
*
|
|
14
|
+
* ⚠️ **Do not import this module for its side effects — import
|
|
15
|
+
* `./index.js`.** This file defines the methods; the barrel installs them, and
|
|
16
|
+
* the barrel is what `package.json`'s `sideEffects` list names.
|
|
17
|
+
*/
|
|
18
|
+
import type { QueryField } from '../../types.js';
|
|
19
|
+
import { Query } from '../builder.js';
|
|
20
|
+
import type { DeclaredPredicate, InternalSource, QueryPlan } from '../builder.js';
|
|
21
|
+
import type { CrossJoinClause } from '../predicate.js';
|
|
22
|
+
import type { ReduceStrategy } from '../../../with-lookup/reduce/strategy.js';
|
|
23
|
+
import type { JoinableSource, JoinContext, JoinStrategy } from './join.js';
|
|
24
|
+
import { type JoinOnSpec } from './join-on.js';
|
|
25
|
+
import type { QueryExplanation } from './explain.js';
|
|
26
|
+
import type { CyclePolicy, TraversalRow, TraverseOptions } from './traverse.js';
|
|
27
|
+
/**
|
|
28
|
+
* The Relate half of `Query`, as a mixin whose prototype is copied onto the
|
|
29
|
+
* real class. Never instantiated.
|
|
30
|
+
*/
|
|
31
|
+
export declare class RelateMethods<T, S extends keyof T = never, Q extends keyof T & string = never, M extends keyof T & string = never> {
|
|
32
|
+
protected readonly source: InternalSource;
|
|
33
|
+
protected readonly plan: QueryPlan;
|
|
34
|
+
protected readonly joinContext: JoinContext | undefined;
|
|
35
|
+
protected readonly reduceStrategy: ReduceStrategy;
|
|
36
|
+
protected readonly predicates: ReadonlyMap<string, DeclaredPredicate> | undefined;
|
|
37
|
+
protected decodeVia: (records: readonly unknown[], locale?: string) => unknown[];
|
|
38
|
+
protected requireJoinContext: (terminal: string) => JoinContext;
|
|
39
|
+
ids: () => string[];
|
|
40
|
+
/**
|
|
41
|
+
* INNER join (#1361): `{ mode: 'inner' }` drops every left row whose alias
|
|
42
|
+
* resolves to nothing, and types the alias NON-nullable.
|
|
43
|
+
*
|
|
44
|
+
* ```ts
|
|
45
|
+
* invoices.query()
|
|
46
|
+
* .join<'client', Client>('clientId', { as: 'client', mode: 'inner' })
|
|
47
|
+
* .orderBy('total', 'desc')
|
|
48
|
+
* .limit(10)
|
|
49
|
+
* // → the ten largest invoices THAT HAVE a client; `row.client.name` needs
|
|
50
|
+
* // no null check.
|
|
51
|
+
* ```
|
|
52
|
+
*
|
|
53
|
+
* The long-hand `.join(f, { as }).where(as, '!=', null)` returns the same
|
|
54
|
+
* rows and keeps working unchanged — what it cannot do is keep the sort on
|
|
55
|
+
* the pre-join side. That predicate addresses the alias, so #1030 moves the
|
|
56
|
+
* WHOLE sort and page behind the legs; `mode: 'inner'` moves only the page,
|
|
57
|
+
* because the drop cannot reorder a left-side sort key. `.explain()` says
|
|
58
|
+
* which: `pre-join` on the `orderBy` node, `post-join` on the `page` node.
|
|
59
|
+
*
|
|
60
|
+
* The drop runs after `attachJoin`, so ref-mode semantics are unchanged — a
|
|
61
|
+
* `strict` dangling ref still throws rather than vanishing because the
|
|
62
|
+
* caller asked for an inner join.
|
|
63
|
+
*/
|
|
64
|
+
join<As extends string, R = unknown>(field: QueryField<T, S>, opts: {
|
|
65
|
+
as: As;
|
|
66
|
+
mode: 'inner';
|
|
67
|
+
strategy?: JoinStrategy;
|
|
68
|
+
maxRows?: number;
|
|
69
|
+
}): Query<T & Record<As, R>, S, Q, M>;
|
|
70
|
+
join<As extends string, R = unknown>(field: QueryField<T, S>, opts: {
|
|
71
|
+
as: As;
|
|
72
|
+
mode?: undefined;
|
|
73
|
+
strategy?: JoinStrategy;
|
|
74
|
+
maxRows?: number;
|
|
75
|
+
}): Query<T & Record<As, R | null>, S, Q, M>;
|
|
76
|
+
/**
|
|
77
|
+
* DECLARED non-equi / non-id join (#1339) — a join whose `on` is data, not
|
|
78
|
+
* a callback.
|
|
79
|
+
*
|
|
80
|
+
* ```ts
|
|
81
|
+
* // composite equality — a hash join over a tuple key
|
|
82
|
+
* entries.query().joinOn<'rate', Rate>('rates', {
|
|
83
|
+
* as: 'rate',
|
|
84
|
+
* on: [['clientId', 'clientId'], ['year', 'year']],
|
|
85
|
+
* })
|
|
86
|
+
*
|
|
87
|
+
* // a range — nested loop over a right side sorted once
|
|
88
|
+
* entries.query().joinOn<'rate', Rate>('rates', {
|
|
89
|
+
* as: 'rate',
|
|
90
|
+
* on: { left: 'date', op: 'between', right: ['from', 'to'] },
|
|
91
|
+
* })
|
|
92
|
+
* ```
|
|
93
|
+
*
|
|
94
|
+
* ⭐ **Why this exists when `.crossJoin({ on })` already pairs anything.**
|
|
95
|
+
* `crossJoin`'s `on` is a closure. It cannot be serialized, so a
|
|
96
|
+
* materialized view built over one has its drift detection disabled — the
|
|
97
|
+
* plan summary records the sentinel `'[inline]'` and two different
|
|
98
|
+
* predicates hash identically. A `joinOn` predicate is plain JSON: it folds
|
|
99
|
+
* into `toPlan()` and into the MV `queryHash`, so an MV can genuinely
|
|
100
|
+
* DEPEND on it. That, not the pairing, is the feature.
|
|
101
|
+
*
|
|
102
|
+
* **No `ref()` needed** — the predicate names both sides itself, so `target`
|
|
103
|
+
* is the collection name rather than a declared FK field. Dangling is not a
|
|
104
|
+
* concept here: a left row matching nothing gets `null` under the alias (a
|
|
105
|
+
* LEFT outer join, like `.join()`), and `{ mode: 'inner' }` drops it.
|
|
106
|
+
*
|
|
107
|
+
* **⚠️ This join EXPANDS rows.** A ref join is one-to-one, so the left row
|
|
108
|
+
* count is constant; a declared `on` emits one row per MATCH, so a left row
|
|
109
|
+
* matching three right records becomes three rows. The per-side `maxRows`
|
|
110
|
+
* ceilings therefore cannot bound the result, and a third ceiling on the
|
|
111
|
+
* OUTPUT throws `JoinTooLargeError` with `side: 'output'`. Do not remove
|
|
112
|
+
* it: without it an unbounded theta join is a hang, not an error.
|
|
113
|
+
*
|
|
114
|
+
* **Cost.** Composite equality is O(n + m + output). A range is
|
|
115
|
+
* O(m log m) to sort the right side once, then O(log m) per left row for
|
|
116
|
+
* `< <= > >=`; `between` is O(log m + p) per left row, where p is the
|
|
117
|
+
* number of right intervals starting at or before the probe — which
|
|
118
|
+
* degrades to O(n·m) when every interval starts early. `explain()` names
|
|
119
|
+
* which of the two ran. Neither reaches the right collection's declared
|
|
120
|
+
* indexes: a `JoinableSource` does not expose them.
|
|
121
|
+
*/
|
|
122
|
+
joinOn<As extends string, R = unknown>(target: string, opts: {
|
|
123
|
+
as: As;
|
|
124
|
+
on: JoinOnSpec;
|
|
125
|
+
mode: 'inner';
|
|
126
|
+
maxRows?: number;
|
|
127
|
+
}): Query<T & Record<As, R>, S, Q, M>;
|
|
128
|
+
joinOn<As extends string, R = unknown>(target: string, opts: {
|
|
129
|
+
as: As;
|
|
130
|
+
on: JoinOnSpec;
|
|
131
|
+
mode?: undefined;
|
|
132
|
+
maxRows?: number;
|
|
133
|
+
}): Query<T & Record<As, R | null>, S, Q, M>;
|
|
134
|
+
/**
|
|
135
|
+
* RIGHT outer join (#1289): every record of the TARGET collection appears,
|
|
136
|
+
* including one no left row points at. The mirror of `.join()`, which is
|
|
137
|
+
* and always was the left outer join.
|
|
138
|
+
*
|
|
139
|
+
* ```ts
|
|
140
|
+
* invoices.query().rightJoin<'client', Client>('clientId', { as: 'client' })
|
|
141
|
+
* // → one row per invoice/client match, PLUS { client } for every client
|
|
142
|
+
* // no invoice references. An invoice whose clientId matches nothing is
|
|
143
|
+
* // dropped — that is what makes it a right join.
|
|
144
|
+
* ```
|
|
145
|
+
*
|
|
146
|
+
* **The row shape is not `T`.** A right-only row carries the alias and
|
|
147
|
+
* nothing else, so the left fields are typed `Partial<T>` — SQL's "the left
|
|
148
|
+
* columns are NULL" in an object language. Read them defensively; a row
|
|
149
|
+
* where `amount` is `undefined` is a real, correct result, not a bug.
|
|
150
|
+
*
|
|
151
|
+
* **Cost.** A forward leg follows the left row's FK and is O(1) per row. A
|
|
152
|
+
* right leg cannot: the rows it must produce are exactly the ones no FK
|
|
153
|
+
* names. It builds a reverse index — the left rows bucketed by FK value —
|
|
154
|
+
* and walks the right snapshot against it. That is one extra pass over the
|
|
155
|
+
* left set and one `Map` the size of the distinct FK values; both sides are
|
|
156
|
+
* fully materialized either way, and both row ceilings still apply.
|
|
157
|
+
*
|
|
158
|
+
* **Ordering.** Like `.join()`, legs run AFTER `orderBy`/`limit`/`offset`
|
|
159
|
+
* unless the ordering addresses the alias (#1337),
|
|
160
|
+
* so those narrow the LEFT side. Rows are emitted in right-snapshot order.
|
|
161
|
+
*
|
|
162
|
+
* A left row whose non-null FK resolves to nothing is dropped, but the
|
|
163
|
+
* ref-mode check still runs on it: `strict` still throws
|
|
164
|
+
* `DanglingReferenceError`. Corruption should not become invisible because
|
|
165
|
+
* the caller changed join direction.
|
|
166
|
+
*/
|
|
167
|
+
rightJoin<As extends string, R = unknown>(field: QueryField<T, S>, opts: {
|
|
168
|
+
as: As;
|
|
169
|
+
strategy?: JoinStrategy;
|
|
170
|
+
maxRows?: number;
|
|
171
|
+
}): Query<Partial<T> & Record<As, R>, S, Q, M>;
|
|
172
|
+
/**
|
|
173
|
+
* FULL outer join (#1289): the union of `.join()` and `.rightJoin()` —
|
|
174
|
+
* every left row, every right record, matched where they meet.
|
|
175
|
+
*
|
|
176
|
+
* ```ts
|
|
177
|
+
* invoices.query().fullOuterJoin<'client', Client>('clientId', { as: 'client' })
|
|
178
|
+
* // → matched rows, plus { client: null, ...invoice } for an unreferenced
|
|
179
|
+
* // invoice, plus { client } for a client no invoice points at.
|
|
180
|
+
* ```
|
|
181
|
+
*
|
|
182
|
+
* The alias is `R | null` and the left fields are `Partial<T>`, because a
|
|
183
|
+
* row can be missing either side — never both. Same reverse index, same
|
|
184
|
+
* ordering and same ref-mode semantics as {@link rightJoin}; the only
|
|
185
|
+
* difference is that the unmatched LEFT rows are emitted (after the
|
|
186
|
+
* right-driven ones) instead of dropped.
|
|
187
|
+
*/
|
|
188
|
+
fullOuterJoin<As extends string, R = unknown>(field: QueryField<T, S>, opts: {
|
|
189
|
+
as: As;
|
|
190
|
+
strategy?: JoinStrategy;
|
|
191
|
+
maxRows?: number;
|
|
192
|
+
}): Query<Partial<T> & Record<As, R | null>, S, Q, M>;
|
|
193
|
+
/**
|
|
194
|
+
* The one place a `JoinLeg` is built. `.join()`, `.rightJoin()` and
|
|
195
|
+
* `.fullOuterJoin()` differ ONLY in `direction` and in the type they
|
|
196
|
+
* publish — keeping the plan-time validation (ref declared? dict join?
|
|
197
|
+
* join context?) in a single body is what stops the three from drifting on
|
|
198
|
+
* which errors they raise.
|
|
199
|
+
*/
|
|
200
|
+
private withJoinLeg;
|
|
201
|
+
/**
|
|
202
|
+
* Cartesian-product cross-join against `target` collection. Each result row
|
|
203
|
+
* carries the original `T` fields plus `result[as]` populated from every
|
|
204
|
+
* right-side row (or the filtered subset when `on:` is supplied).
|
|
205
|
+
*
|
|
206
|
+
* **⚠️ INNER-join semantics — an empty right subset DROPS the left row.**
|
|
207
|
+
* Each left row is emitted once per matching right row, so when `on:`
|
|
208
|
+
* yields nothing the row vanishes with no error, no warning and no count
|
|
209
|
+
* mismatch. This bites hardest on a reverse FK, where `.join()` (which is
|
|
210
|
+
* forward-only, and already a genuine LEFT outer join) does not apply and
|
|
211
|
+
* `.crossJoin()` is the only tool. To keep the row, return a one-element
|
|
212
|
+
* array holding `null`:
|
|
213
|
+
*
|
|
214
|
+
* ```ts
|
|
215
|
+
* .crossJoin('clients', { as: 'client', on: (b) => byEntity.get(b.entityId) ?? [null] })
|
|
216
|
+
* // ^^^^^^^^
|
|
217
|
+
* // the ONLY thing preserving the row
|
|
218
|
+
* ```
|
|
219
|
+
*
|
|
220
|
+
* **Prefer `outer: true`**, which does exactly this and types the alias as
|
|
221
|
+
* `TTarget | null`:
|
|
222
|
+
*
|
|
223
|
+
* ```ts
|
|
224
|
+
* .crossJoin('clients', { as: 'client', outer: true, on: (b) => byEntity.get(b.entityId) ?? [] })
|
|
225
|
+
* ```
|
|
226
|
+
*
|
|
227
|
+
* The `?? [null]` form remains valid and is what `outer` does internally, but
|
|
228
|
+
* it is invisible intent: it types the alias as non-null while the row can
|
|
229
|
+
* hold null, and a later "simplification" that drops it silently
|
|
230
|
+
* reintroduces the row loss.
|
|
231
|
+
*
|
|
232
|
+
* **Order matters:** `.where().crossJoin()` filters BEFORE expanding (cheaper);
|
|
233
|
+
* `.crossJoin().where('alias.field', ...)` filters AFTER (required when the
|
|
234
|
+
* where clause references the aliased fields).
|
|
235
|
+
*
|
|
236
|
+
* **Cost ceiling:** `CrossJoinTooLargeError` fires before allocation when
|
|
237
|
+
* `leftRows × rightRows` (or the cumulative lateral count) exceeds the limit.
|
|
238
|
+
* Default: 50,000 rows. Override per-clause with `{ maxRows: N }`.
|
|
239
|
+
*
|
|
240
|
+
* **`on:` shapes:**
|
|
241
|
+
* - `on: (left) => TTarget[]` — subset form (most efficient)
|
|
242
|
+
* - `on: (left) => (right) => boolean` — predicate form
|
|
243
|
+
* - `on: { predicate: 'name' }` — MV-safe, hash-tracked form
|
|
244
|
+
* (requires the Query to have been augmented via `_withPredicates`)
|
|
245
|
+
*
|
|
246
|
+
* Requires a JoinContext (constructed via `collection.query()`).
|
|
247
|
+
*/
|
|
248
|
+
crossJoin<TTarget = unknown, As extends string = string, TOuter extends boolean = false>(target: string, opts: {
|
|
249
|
+
as: As;
|
|
250
|
+
on?: ((left: T) => unknown[] | ((right: TTarget) => boolean)) | {
|
|
251
|
+
readonly predicate: string;
|
|
252
|
+
};
|
|
253
|
+
maxRows?: number;
|
|
254
|
+
/**
|
|
255
|
+
* Keep the left row when its right side is empty, with `null` under
|
|
256
|
+
* `as`, instead of dropping it (#1130). Widens the alias to
|
|
257
|
+
* `TTarget | null` — which is why it is a type parameter rather than a
|
|
258
|
+
* plain boolean: `outer: false` must not pay for a null the row can
|
|
259
|
+
* never hold.
|
|
260
|
+
*/
|
|
261
|
+
outer?: TOuter;
|
|
262
|
+
}): Query<T & {
|
|
263
|
+
[K in As]: TOuter extends true ? TTarget | null : TTarget;
|
|
264
|
+
}, S, Q, M>;
|
|
265
|
+
/**
|
|
266
|
+
* Self cross-join with BOTH sides aliased (#1289).
|
|
267
|
+
*
|
|
268
|
+
* ```ts
|
|
269
|
+
* const pairs = trades.query()
|
|
270
|
+
* .crossJoinWith({ leftAs: 'a', rightAs: 'b', on: (t) => laterThan(t) })
|
|
271
|
+
* .toArray()
|
|
272
|
+
* // → [{ a: Trade, b: Trade }, ...] — no field at the top level
|
|
273
|
+
* ```
|
|
274
|
+
*
|
|
275
|
+
* `.crossJoin('trades', { as: 'other' })` can already pair a collection
|
|
276
|
+
* with itself, but only ASYMMETRICALLY: the left row's fields stay at the
|
|
277
|
+
* top level and only the right side gets a name. Every comparison then
|
|
278
|
+
* reads `r.amount` against `r.other.amount`, which is exactly the shape
|
|
279
|
+
* that makes an accidentally-transposed pair invisible.
|
|
280
|
+
*
|
|
281
|
+
* ⚠️ **The cost is not the join, it is the Via dressing.** Aliasing the
|
|
282
|
+
* left row moves every field off the top level, and the money / i18n /
|
|
283
|
+
* lookup pipeline keys by BARE FIELD NAME — so the plain top-level decode
|
|
284
|
+
* `toArray()` applies cannot see either side. Both aliases are therefore
|
|
285
|
+
* dressed explicitly, through the source's own Via result decode, before
|
|
286
|
+
* the rows are returned. Silently serving raw money under an alias is the
|
|
287
|
+
* failure this method exists to not have; `dressAliases` is where it is
|
|
288
|
+
* prevented and `__tests__/query-outer-join.test.ts` is what proves it.
|
|
289
|
+
*
|
|
290
|
+
* `on:` takes the same subset / predicate shapes as `.crossJoin()`, and the
|
|
291
|
+
* same `maxRows` ceiling applies to the product. The target is always this
|
|
292
|
+
* query's own collection — a cross-join against a DIFFERENT collection is
|
|
293
|
+
* `.crossJoin()`, which needs no left alias to stay unambiguous.
|
|
294
|
+
*
|
|
295
|
+
* The returned `Query` drops this query's schema / queryable / money field
|
|
296
|
+
* parameters. That is not laziness: those parameters name TOP-LEVEL fields,
|
|
297
|
+
* and after `crossJoinWith` there are no top-level fields — only the two
|
|
298
|
+
* aliases. Carrying them would let `where('amount', ...)` type-check on a
|
|
299
|
+
* row where `amount` does not exist.
|
|
300
|
+
*/
|
|
301
|
+
crossJoinWith<LeftAs extends string, RightAs extends string>(opts: {
|
|
302
|
+
leftAs: LeftAs;
|
|
303
|
+
rightAs: RightAs;
|
|
304
|
+
on?: ((left: T) => unknown[] | ((right: T) => boolean)) | {
|
|
305
|
+
readonly predicate: string;
|
|
306
|
+
};
|
|
307
|
+
maxRows?: number;
|
|
308
|
+
}): Query<{
|
|
309
|
+
[K in LeftAs]: T;
|
|
310
|
+
} & {
|
|
311
|
+
[K in RightAs]: T;
|
|
312
|
+
}>;
|
|
313
|
+
/**
|
|
314
|
+
* Describe how this plan WOULD run (#1348): the dispatch per clause
|
|
315
|
+
* (`index:hash` vs `scan`, and why), row estimates taken from real index
|
|
316
|
+
* cardinalities, join strategy and side sizes against the row ceiling,
|
|
317
|
+
* whether ordering/pagination lands pre- or post-join, and which
|
|
318
|
+
* cardinality caps are close to tripping. `.text` renders one line per
|
|
319
|
+
* node.
|
|
320
|
+
*
|
|
321
|
+
* ⛔ Purely observational — it probes index buckets and reads snapshot
|
|
322
|
+
* sizes, never executes the plan. A terminal returns the same thing
|
|
323
|
+
* whether or not `explain()` was called. See `query/explain.ts`.
|
|
324
|
+
*/
|
|
325
|
+
explain(): QueryExplanation;
|
|
326
|
+
/**
|
|
327
|
+
* Recursive traversal over ONE declared, self-referencing `ref()` field
|
|
328
|
+
* (#1352) — the org-chart / bill-of-materials / parent-client shape that
|
|
329
|
+
* otherwise forces the consumer to hand-roll recursion.
|
|
330
|
+
*
|
|
331
|
+
* ```ts
|
|
332
|
+
* people.query().where('name', '==', 'Dana')
|
|
333
|
+
* .traverse('parentId', { direction: 'up', maxDepth: 10 })
|
|
334
|
+
* // → [{ id: 'dana', record, depth: 0, path: ['dana'] },
|
|
335
|
+
* // { id: 'bea', record, depth: 1, path: ['dana', 'bea'] }, …]
|
|
336
|
+
* ```
|
|
337
|
+
*
|
|
338
|
+
* **A TERMINAL.** It returns rows, not a `Query`, so it composes with
|
|
339
|
+
* `where()` / `orderBy()` / `limit()` on the way IN, not on the way out.
|
|
340
|
+
*
|
|
341
|
+
* **Seeds are this query's matched records** — the clauses choose the roots
|
|
342
|
+
* of the walk, not which nodes the walk may pass through. A traversal from
|
|
343
|
+
* one seed is `ancestorsOf` / `descendantsOf` below.
|
|
344
|
+
*
|
|
345
|
+
* **`maxDepth` is required**, with no default: an unbounded walk over a
|
|
346
|
+
* large collection is a denial of service against your own UI, and a
|
|
347
|
+
* silent default would truncate a result without saying so.
|
|
348
|
+
*
|
|
349
|
+
* **Cycles terminate.** A parent chain can be circular through user error,
|
|
350
|
+
* and an unguarded BFS hangs the tab. The default `{ onCycle: 'stop' }`
|
|
351
|
+
* prunes a node the walk is already standing on; `'throw'` raises
|
|
352
|
+
* `TraversalCycleError` for hierarchies that are supposed to be acyclic.
|
|
353
|
+
*
|
|
354
|
+
* **A node is emitted once**, at its shallowest depth — so a diamond (two
|
|
355
|
+
* seeds converging on one ancestor) yields ONE row for that ancestor,
|
|
356
|
+
* carrying the path of whichever branch reached it first.
|
|
357
|
+
*
|
|
358
|
+
* **Declared refs only.** This is not a general graph engine: the field
|
|
359
|
+
* must carry a `ref()` whose target is this same collection.
|
|
360
|
+
*
|
|
361
|
+
* **Cost.** Every hop reads the vault's already-decrypted in-memory cache
|
|
362
|
+
* (`query()` is eager-mode only), so a depth-5 traversal costs
|
|
363
|
+
* `depth × frontier` Map lookups and ZERO additional decrypts — the
|
|
364
|
+
* AES-GCM work was paid once at `openVault()`. `direction: 'down'` adds one
|
|
365
|
+
* O(n) pass to build the reverse-FK index; `'up'` adds nothing.
|
|
366
|
+
*
|
|
367
|
+
* ⛔ **Not an `explain()` node.** `explain()` describes the plan, and a
|
|
368
|
+
* traversal is a terminal over the plan's result rather than a clause in
|
|
369
|
+
* it — the same reason `.window()` and #1336's post-group ops are absent.
|
|
370
|
+
* `explain()` on the seed query still describes how the SEEDS are found.
|
|
371
|
+
*/
|
|
372
|
+
traverse(field: QueryField<T, S>, opts: TraverseOptions): TraversalRow<T>[];
|
|
373
|
+
/**
|
|
374
|
+
* `.traverse()` sugar: every ancestor of one record, that record included
|
|
375
|
+
* at `depth: 0`. See {@link traverse} for the full contract.
|
|
376
|
+
*
|
|
377
|
+
* Refused on a query that already carries clauses — the seed is named
|
|
378
|
+
* explicitly here, so a `where()` would silently do nothing. Use
|
|
379
|
+
* `.traverse()` when the seeds come from a query.
|
|
380
|
+
*/
|
|
381
|
+
ancestorsOf(id: string, field: QueryField<T, S>, opts: {
|
|
382
|
+
maxDepth: number;
|
|
383
|
+
onCycle?: CyclePolicy;
|
|
384
|
+
}): TraversalRow<T>[];
|
|
385
|
+
/**
|
|
386
|
+
* `.traverse()` sugar: every descendant of one record, that record included
|
|
387
|
+
* at `depth: 0`. See {@link traverse} for the full contract.
|
|
388
|
+
*/
|
|
389
|
+
descendantsOf(id: string, field: QueryField<T, S>, opts: {
|
|
390
|
+
maxDepth: number;
|
|
391
|
+
onCycle?: CyclePolicy;
|
|
392
|
+
}): TraversalRow<T>[];
|
|
393
|
+
private traverseFromId;
|
|
394
|
+
/**
|
|
395
|
+
* The one place a traversal runs. Both entry points share it so they cannot
|
|
396
|
+
* drift on Via decoding or on which source view the walk reads.
|
|
397
|
+
*/
|
|
398
|
+
private runTraverse;
|
|
399
|
+
/**
|
|
400
|
+
* Plan-time validation shared by `.traverse()` and its sugar: the field must
|
|
401
|
+
* carry a `ref()`, and that ref must point back at this same collection.
|
|
402
|
+
*
|
|
403
|
+
* The second half is what keeps this from becoming a general graph engine.
|
|
404
|
+
* A ref to ANOTHER collection has no second hop — the target's records do
|
|
405
|
+
* not carry this field — so a two-collection "traversal" is a `.join()`
|
|
406
|
+
* wearing the wrong name, and would walk exactly one level before stopping
|
|
407
|
+
* for reasons the caller could not see.
|
|
408
|
+
*/
|
|
409
|
+
private assertSelfRef;
|
|
410
|
+
}
|
|
411
|
+
/**
|
|
412
|
+
* The public Relate surface, named once. The `declare module` block in
|
|
413
|
+
* `./index.ts` merges exactly this into `Query`, so the signatures live in one
|
|
414
|
+
* place and cannot drift from the implementations above.
|
|
415
|
+
*
|
|
416
|
+
* `Pick` rather than the class itself: an interface that extended
|
|
417
|
+
* `RelateMethods` would inherit the `protected` state declarations too, and
|
|
418
|
+
* they collide with `Query`'s own `private` fields.
|
|
419
|
+
*/
|
|
420
|
+
export type RelateSurface<T, S extends keyof T = never, Q extends keyof T & string = never, M extends keyof T & string = never> = Pick<RelateMethods<T, S, Q, M>, 'join' | 'joinOn' | 'rightJoin' | 'fullOuterJoin' | 'crossJoin' | 'crossJoinWith' | 'traverse' | 'ancestorsOf' | 'descendantsOf' | 'explain'>;
|
|
421
|
+
/**
|
|
422
|
+
* Expand `leftRel` by cross-joining with `rightSource`. Enforces the cost ceiling
|
|
423
|
+
* BEFORE allocating the expanded relation (full cartesian) or cumulatively
|
|
424
|
+
* (lateral form). Throws `CrossJoinTooLargeError` on breach.
|
|
425
|
+
*/
|
|
426
|
+
export declare function applyCrossJoin(leftRel: unknown[], clause: CrossJoinClause, rightSource: JoinableSource): unknown[];
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Partition pruning — the ONE decision function (#1342, ADR 0007).
|
|
3
|
+
*
|
|
4
|
+
* ADR 0007 rules that a partition is a COLLECTION, not a field lifted out of
|
|
5
|
+
* the ciphertext: `listPage(vault, **collection**, cursor, limit)` already
|
|
6
|
+
* takes the collection name in cleartext, so a partition modelled as its own
|
|
7
|
+
* collection buys the pruning for free — no `@noy-db/hub/to` change, no
|
|
8
|
+
* adapter change, no new leak class. What is left for the kernel is deciding
|
|
9
|
+
* WHICH member collections a query has to read at all, and that is this file.
|
|
10
|
+
*
|
|
11
|
+
* ⭐ **SHARED, NOT MIRRORED.** `explain()` and the executor both call
|
|
12
|
+
* {@link resolvePartitionScope}. `explain.ts`'s header warns that dispatch
|
|
13
|
+
* selection is mirrored between it and `candidateRecords`, and #1375 spent a
|
|
14
|
+
* whole issue deleting one of those mirrors by exporting the classifier from
|
|
15
|
+
* `builder.ts`. Partition dispatch would have been a THIRD site. It is not:
|
|
16
|
+
* there is one function, and both callers import it.
|
|
17
|
+
*
|
|
18
|
+
* ⛔ **SOUND IN ONE DIRECTION ONLY, AND THE ASYMMETRY IS THE DESIGN.** A
|
|
19
|
+
* partition wrongly INCLUDED costs a scan nobody needed. A partition wrongly
|
|
20
|
+
* EXCLUDED is silently missing data — no error, no warning, a short answer
|
|
21
|
+
* that looks complete. So narrowing happens off a WHITELIST of provable
|
|
22
|
+
* shapes, never off a blacklist of known-bad ones:
|
|
23
|
+
*
|
|
24
|
+
* - `key == "<string>"` → that one partition
|
|
25
|
+
* - `key in ["<string>", …]` → that set
|
|
26
|
+
* - two of those AND-ed → their intersection
|
|
27
|
+
*
|
|
28
|
+
* and EVERYTHING else degrades to {@link ALL_PARTITIONS} by falling off the
|
|
29
|
+
* end of the whitelist: `or`/`and` groups (a nested clause is not AND-ed with
|
|
30
|
+
* the top level), `!=`, `!in`, `<`/`<=`/`>`/`>=`/`between`, `contains`,
|
|
31
|
+
* `startsWith`, `matches`, `near`, `filter()` callbacks, `wherePredicate()`,
|
|
32
|
+
* `crossJoin`, a clause on any other field, a non-string operand — and, the
|
|
33
|
+
* one that is easy to miss, **any Via-covered clause** (`clause.via`), whose
|
|
34
|
+
* operand is in STORED form rather than in partition-key space. That is the
|
|
35
|
+
* same reason `candidateRecords()` refuses the index for a Via clause, and
|
|
36
|
+
* getting it wrong here is worse than getting it wrong there: an index miss
|
|
37
|
+
* returns the right rows slowly, a partition miss returns the wrong rows fast.
|
|
38
|
+
*
|
|
39
|
+
* An operator added next year that this function has never heard of degrades
|
|
40
|
+
* to "read everything" without anyone editing this file. That is the whole
|
|
41
|
+
* point of the whitelist, and it is why the tests in
|
|
42
|
+
* `__tests__/partitioned-collection.test.ts` cover the FALLBACKS at least as
|
|
43
|
+
* heavily as the fast path.
|
|
44
|
+
*
|
|
45
|
+
* ⚠️ One narrowing this file does NOT do, deliberately: a RANGE on an ordered
|
|
46
|
+
* partition key (`period >= 'FY2026-Q2'`) intersected against declared
|
|
47
|
+
* partition boundaries. It is sound only once partitions carry declared
|
|
48
|
+
* boundaries AND the open/closed distinction is honoured — an OPEN period's
|
|
49
|
+
* upper bound can still move, so any range whose upper end is unbounded or in
|
|
50
|
+
* the future must keep the open partition. Cheap rule, and the first one a
|
|
51
|
+
* range narrowing gets wrong; it waits for a declaration that carries
|
|
52
|
+
* boundaries.
|
|
53
|
+
*/
|
|
54
|
+
import type { Clause } from '../predicate.js';
|
|
55
|
+
/**
|
|
56
|
+
* "Read every declared partition." The sound fallback, and the value every
|
|
57
|
+
* shape this file cannot PROVE safe resolves to.
|
|
58
|
+
*/
|
|
59
|
+
export declare const ALL_PARTITIONS: "all";
|
|
60
|
+
/**
|
|
61
|
+
* The partitions a query must read: {@link ALL_PARTITIONS}, or the exact
|
|
62
|
+
* subset — which may be EMPTY, when the predicate names a partition value
|
|
63
|
+
* that has never been declared. An empty scope is a real answer, not a
|
|
64
|
+
* degenerate one: the partition key is the collection a record lives in, so
|
|
65
|
+
* "no such partition" means "no such record".
|
|
66
|
+
*/
|
|
67
|
+
export type PartitionScope = typeof ALL_PARTITIONS | readonly string[];
|
|
68
|
+
/**
|
|
69
|
+
* Narrow `declared` to the partitions `clauses` can PROVE are needed.
|
|
70
|
+
*
|
|
71
|
+
* `clauses` must be the plan's TOP-LEVEL clause list — those are AND-ed, and
|
|
72
|
+
* an intersection across them is therefore sound. Anything nested inside a
|
|
73
|
+
* `group` is not AND-ed with the top level and is ignored by construction
|
|
74
|
+
* (a `group` never matches the whitelist).
|
|
75
|
+
*
|
|
76
|
+
* The result preserves `declared`'s order, so a caller reading partitions in
|
|
77
|
+
* sequence gets a stable, declaration-ordered walk whether or not it pruned.
|
|
78
|
+
*/
|
|
79
|
+
export declare function resolvePartitionScope(clauses: readonly Clause[], key: string, declared: readonly string[]): PartitionScope;
|
|
80
|
+
/**
|
|
81
|
+
* The `explain()` line, in the existing vocabulary: `partitions: 3 of 12
|
|
82
|
+
* scanned`. Shared so the executor's accounting and the explanation cannot
|
|
83
|
+
* drift into disagreeing about what "scanned" counts.
|
|
84
|
+
*/
|
|
85
|
+
export declare function describePartitionScope(scope: PartitionScope, declared: readonly string[]): string;
|
|
86
|
+
/** The member partitions a scope resolves to, in declaration order. */
|
|
87
|
+
export declare function partitionsInScope(scope: PartitionScope, declared: readonly string[]): readonly string[];
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* #1458 — the **Relate** half of `ScanBuilder`.
|
|
3
|
+
*
|
|
4
|
+
* `join` · plus the two streaming-join privates the iterator calls.
|
|
5
|
+
*
|
|
6
|
+
* ⭐ **`ScanBuilder` gets the same treatment as `Query` because it has the same
|
|
7
|
+
* problem** (ruled 2026-09-06): it is one class carrying Find (`where`,
|
|
8
|
+
* `filter`, the async iterator), Reduce (`aggregate`, `groupBy`) and Relate
|
|
9
|
+
* (`join`) methods, and `sideEffects: false` cannot drop a method. Left
|
|
10
|
+
* unsplit it would have kept `relate/join.ts` and the whole reducer engine in
|
|
11
|
+
* every `/query` bundle no matter what `Query` did — the architecture rule
|
|
12
|
+
* would have been true of `builder.ts` and false of the package.
|
|
13
|
+
*
|
|
14
|
+
* ⚠️ `buildJoinResolvers` and `applyOneJoinStreaming` are called from the
|
|
15
|
+
* ITERATOR, which stays in Find. Both calls sit behind `joins.length === 0`,
|
|
16
|
+
* so a Find-only scan never reaches them — the same guarantee, and the same
|
|
17
|
+
* shape of guarantee, as `internal/hooks.ts` gives the eager executor.
|
|
18
|
+
*/
|
|
19
|
+
import { ScanBuilder } from '../scan-builder.js';
|
|
20
|
+
import type { ScanPageProvider } from '../scan-builder.js';
|
|
21
|
+
import type { QueryField } from '../../types.js';
|
|
22
|
+
import type { Clause } from '../predicate.js';
|
|
23
|
+
import type { ViaPipeline } from '../../via/pipeline.js';
|
|
24
|
+
import type { JoinContext, JoinLeg, JoinableSource } from './join.js';
|
|
25
|
+
/** One resolved leg, prepared once per iteration. @internal */
|
|
26
|
+
export interface ScanJoinResolver {
|
|
27
|
+
leg: JoinLeg;
|
|
28
|
+
source: JoinableSource;
|
|
29
|
+
lookupById: ((id: string) => unknown) | null;
|
|
30
|
+
hashByPrimaryKey: ReadonlyMap<string, unknown> | null;
|
|
31
|
+
warnedKeys: Set<string>;
|
|
32
|
+
}
|
|
33
|
+
/** @internal — the mixin whose prototype `./index.ts` copies onto `ScanBuilder`. */
|
|
34
|
+
export declare class ScanRelateMethods<T, S extends keyof T = never, M extends keyof T & string = never> {
|
|
35
|
+
protected readonly pageProvider: ScanPageProvider<T>;
|
|
36
|
+
protected readonly pageSize: number;
|
|
37
|
+
protected readonly clauses: readonly Clause[];
|
|
38
|
+
protected readonly joins: readonly JoinLeg[];
|
|
39
|
+
protected readonly joinContext: JoinContext | undefined;
|
|
40
|
+
protected readonly via: ViaPipeline | undefined;
|
|
41
|
+
/**
|
|
42
|
+
* Resolve a `ref()`-declared foreign key per record as the scan
|
|
43
|
+
* stream flows, attaching the right-side record (or null) under
|
|
44
|
+
* `opts.as`. — streaming joins over `scan()`.
|
|
45
|
+
*
|
|
46
|
+
* ```ts
|
|
47
|
+
* for await (const inv of invoices.scan().join('clientId', { as: 'client' })) {
|
|
48
|
+
* await processInvoice(inv) // inv.client is attached
|
|
49
|
+
* }
|
|
50
|
+
*
|
|
51
|
+
* // Or terminate with .aggregate() for streaming joined aggregation
|
|
52
|
+
* const { total } = await invoices.scan()
|
|
53
|
+
* .where('status', '==', 'open')
|
|
54
|
+
* .join('clientId', { as: 'client' })
|
|
55
|
+
* .aggregate({ total: sum('amount') })
|
|
56
|
+
* ```
|
|
57
|
+
*
|
|
58
|
+
* **The key difference from eager `.join()`:** the LEFT
|
|
59
|
+
* side streams page-by-page from the adapter and is never
|
|
60
|
+
* materialized. Memory ceiling on the left is O(pageSize), not
|
|
61
|
+
* O(rowCount). This is what makes streaming joins suitable for
|
|
62
|
+
* collections that exceed the eager join's 50_000-row ceiling.
|
|
63
|
+
*
|
|
64
|
+
* **Right-side strategy** is auto-selected per leg:
|
|
65
|
+
* - **Indexed** — right source exposes `lookupById`, so each
|
|
66
|
+
* left row costs O(1). This is the common path for
|
|
67
|
+
* Collection right sides, which back `lookupById` with a Map
|
|
68
|
+
* lookup over the in-memory cache. The right collection must
|
|
69
|
+
* be in eager mode (the same constraint as eager join's
|
|
70
|
+
* `querySourceForJoin` from ).
|
|
71
|
+
* - **Hash** — right source has only `snapshot()`. Build a
|
|
72
|
+
* `Map<id, record>` once at iteration start, probe per left
|
|
73
|
+
* row. Same correctness, same per-row cost as the indexed
|
|
74
|
+
* path; the difference is the upfront cost of materializing
|
|
75
|
+
* the right side once.
|
|
76
|
+
*
|
|
77
|
+
* Both strategies hold the right side in memory for the duration
|
|
78
|
+
* of the iteration. The "streaming" property applies to the LEFT
|
|
79
|
+
* side only — true left-and-right streaming joins (where neither
|
|
80
|
+
* side fits in memory) require a sort-merge join planner that's
|
|
81
|
+
* out of scope for.
|
|
82
|
+
*
|
|
83
|
+
* **Ref-mode semantics** match eager `.join()` exactly:
|
|
84
|
+
* - `strict` → throws `DanglingReferenceError` mid-stream
|
|
85
|
+
* when a left record points at a non-existent right id.
|
|
86
|
+
* The throw aborts the async iterator — consumers should
|
|
87
|
+
* wrap the `for await` in try/catch if they want to recover.
|
|
88
|
+
* - `warn` → attaches `null` and emits a one-shot warning
|
|
89
|
+
* per unique dangling pair (deduped via the same warn
|
|
90
|
+
* channel as eager join).
|
|
91
|
+
* - `cascade` → attaches `null` silently. A delete-time mode;
|
|
92
|
+
* dangling refs at read time are mid-flight or pre-existing
|
|
93
|
+
* orphans, not a DSL error.
|
|
94
|
+
*
|
|
95
|
+
* Left records with null/undefined FK values attach `null`
|
|
96
|
+
* regardless of mode — same "no reference at all" policy as
|
|
97
|
+
* eager join and write-time `enforceRefsOnPut`.
|
|
98
|
+
*
|
|
99
|
+
* **Multi-FK chaining** is supported via repeated `.join()`
|
|
100
|
+
* calls: each leg resolves an independent ref. Each leg
|
|
101
|
+
* independently picks its right-side strategy and applies its
|
|
102
|
+
* own ref mode.
|
|
103
|
+
*
|
|
104
|
+
* **Joins are NOT applied** to a `.aggregate()` terminal that
|
|
105
|
+
* doesn't reference joined fields — wait, that's not quite
|
|
106
|
+
* right. The streaming path actually DOES apply joins before
|
|
107
|
+
* `.aggregate()` because the join attaches a field that the
|
|
108
|
+
* spec might reference. Unlike `Query.aggregate()` (which skips
|
|
109
|
+
* joins entirely as a projection-only short-circuit), the
|
|
110
|
+
* streaming aggregation can't know whether the spec touches a
|
|
111
|
+
* joined field, so it always applies joins. Consumers who want
|
|
112
|
+
* unjoined streaming aggregation should leave `.join()` off the
|
|
113
|
+
* chain — the chain is composable for a reason.
|
|
114
|
+
*
|
|
115
|
+
* Every JoinLeg carries `partitionScope: 'all'`, plumbed through but never
|
|
116
|
+
* read. Same seam as the eager join — see {@link JoinLeg.partitionScope}.
|
|
117
|
+
*/
|
|
118
|
+
join<As extends string, R = unknown>(field: QueryField<T, S>, opts: {
|
|
119
|
+
as: As;
|
|
120
|
+
}): ScanBuilder<T & Record<As, R | null>, S, M>;
|
|
121
|
+
/**
|
|
122
|
+
* Iterate the scan as an async iterable. Walks the page
|
|
123
|
+
* provider's cursors forward until exhaustion, applying every
|
|
124
|
+
* clause per record — only matching records are yielded.
|
|
125
|
+
*
|
|
126
|
+
* Backward-compatible with the previous async-generator `scan()`
|
|
127
|
+
* return type for `for await … of` consumers.
|
|
128
|
+
*/
|
|
129
|
+
/**
|
|
130
|
+
* Per-leg right-side resolution state. Built once at iteration
|
|
131
|
+
* start and reused for every left record. Two strategies:
|
|
132
|
+
*
|
|
133
|
+
* - `lookupById`: present when the right source exposes the
|
|
134
|
+
* hook directly (typical Collection right side). Per-row
|
|
135
|
+
* cost is O(1).
|
|
136
|
+
* - `hashByPrimaryKey`: built from `snapshot()` when no
|
|
137
|
+
* lookupById. Per-row cost is O(1) after the upfront O(N)
|
|
138
|
+
* materialization. Same as eager join's hash strategy.
|
|
139
|
+
*
|
|
140
|
+
* `warnedKeys` is the per-leg dedup set for ref-mode 'warn'. We
|
|
141
|
+
* key on `field→target:refId` so the same dangling pair only
|
|
142
|
+
* warns once per iteration. The dedup is per-iteration, not
|
|
143
|
+
* per-process — a long-running scan that re-iterates would warn
|
|
144
|
+
* again, which is the desired behavior (the data may have
|
|
145
|
+
* changed between iterations).
|
|
146
|
+
*/
|
|
147
|
+
private buildJoinResolvers;
|
|
148
|
+
/**
|
|
149
|
+
* Resolve a single join leg for one left record and return the
|
|
150
|
+
* left record with the joined field attached under
|
|
151
|
+
* `leg.as`. Pure function over `(left, resolver)`; never
|
|
152
|
+
* mutates the input.
|
|
153
|
+
*
|
|
154
|
+
* Ref-mode dispatch matches eager `applyJoins` from :
|
|
155
|
+
* - null/undefined FK → attach null silently (always allowed)
|
|
156
|
+
* - dangling FK + strict → throw `DanglingReferenceError`
|
|
157
|
+
* - dangling FK + warn → attach null, warn-once per pair
|
|
158
|
+
* - dangling FK + cascade → attach null silently
|
|
159
|
+
*/
|
|
160
|
+
private applyOneJoinStreaming;
|
|
161
|
+
}
|
|
162
|
+
/** The public Relate surface of `ScanBuilder` — merged by `./index.ts`. */
|
|
163
|
+
export type ScanRelateSurface<T, S extends keyof T = never, M extends keyof T & string = never> = Pick<ScanRelateMethods<T, S, M>, 'join'>;
|