@noy-db/hub 0.4.0-pre.5 → 0.4.0-pre.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{api-22ES33N3.js → api-5QVQX4HG.js} +6 -6
- package/dist/attestation/index.js +14 -14
- package/dist/{backup-YCHAC575.js → backup-USYSNCYM.js} +6 -6
- package/dist/blobs/index.js +8 -5
- package/dist/blobs/index.js.map +1 -1
- package/dist/broker/index.js +6 -6
- package/dist/cargo/index.js +26 -28
- package/dist/{chunk-RWW3I3PO.js → chunk-2BVW754E.js} +2 -2
- package/dist/{chunk-VEGQYPCP.js → chunk-2ZSC454H.js} +3 -3
- package/dist/{chunk-S4YERMGJ.js → chunk-32467U5J.js} +3 -3
- package/dist/{chunk-UVBHM7AK.js → chunk-3GXDB3NQ.js} +4 -4
- package/dist/{chunk-L2CAWCQL.js → chunk-3S2YNMUS.js} +53 -5
- package/dist/chunk-3S2YNMUS.js.map +1 -0
- package/dist/{chunk-HAPY7WFP.js → chunk-3TZUC4WS.js} +9 -9
- package/dist/{chunk-M6QA2KK2.js → chunk-44Y3P5U6.js} +2 -2
- package/dist/{chunk-WQN5SM7P.js → chunk-4B3DL75F.js} +2 -2
- package/dist/{chunk-XUFAFHQM.js → chunk-5ABOFAHN.js} +7 -4
- package/dist/chunk-5ABOFAHN.js.map +1 -0
- package/dist/chunk-5D2ALSM5.js +19 -0
- package/dist/chunk-5D2ALSM5.js.map +1 -0
- package/dist/{chunk-OHV6T5JB.js → chunk-6SSWOUUS.js} +2 -2
- package/dist/{chunk-6RPWILRH.js → chunk-7IQWHYL2.js} +3 -3
- package/dist/chunk-AFHQATY4.js +47 -0
- package/dist/chunk-AFHQATY4.js.map +1 -0
- package/dist/{chunk-I2XEBEEF.js → chunk-AZXEOEQK.js} +3 -3
- package/dist/{chunk-K7BADAOS.js → chunk-C2V7AJO2.js} +3 -3
- package/dist/chunk-CADUYBQD.js +151 -0
- package/dist/chunk-CADUYBQD.js.map +1 -0
- package/dist/{chunk-YTW6ZIPD.js → chunk-DOZFU7OZ.js} +1 -1
- package/dist/chunk-DOZFU7OZ.js.map +1 -0
- package/dist/{chunk-YCAJDK4O.js → chunk-E7FSBI6I.js} +3 -3
- package/dist/chunk-EP5L47XV.js +22 -0
- package/dist/chunk-EP5L47XV.js.map +1 -0
- package/dist/{chunk-YWZEDG7F.js → chunk-EPME33Y4.js} +4 -4
- package/dist/{chunk-EEZCB74X.js → chunk-EWPS35AR.js} +465 -393
- package/dist/chunk-EWPS35AR.js.map +1 -0
- package/dist/{chunk-BY5YBSXA.js → chunk-GQT6J4FJ.js} +14 -1
- package/dist/chunk-GQT6J4FJ.js.map +1 -0
- package/dist/{chunk-YXZNGHID.js → chunk-H5GMROCB.js} +2 -2
- package/dist/{chunk-QMMOMBH6.js → chunk-HA7P3BTB.js} +24 -175
- package/dist/chunk-HA7P3BTB.js.map +1 -0
- package/dist/{chunk-FTCGEUOY.js → chunk-HDF5R2K6.js} +4 -4
- package/dist/{chunk-R2N37AA6.js → chunk-HVPW6PCX.js} +2 -2
- package/dist/{chunk-YXIVUWDU.js → chunk-HXVRRJBD.js} +3 -3
- package/dist/{chunk-5ATANZSW.js → chunk-ICYC5YNI.js} +4 -4
- package/dist/{chunk-7ICV4ASA.js → chunk-IUATR5UE.js} +25 -3
- package/dist/chunk-IUATR5UE.js.map +1 -0
- package/dist/{chunk-QZJEYZ4I.js → chunk-JGOKAZNB.js} +3 -3
- package/dist/{chunk-JN3SGXJE.js → chunk-JOCMXSR2.js} +1 -1
- package/dist/{chunk-JN3SGXJE.js.map → chunk-JOCMXSR2.js.map} +1 -1
- package/dist/{chunk-7BIJS6II.js → chunk-JTIPVW4J.js} +3 -3
- package/dist/{chunk-SC4JLMZI.js → chunk-KCZAFDP5.js} +2 -2
- package/dist/{chunk-GP54LU5N.js → chunk-LG2GUYRX.js} +7 -7
- package/dist/{chunk-J5TEU77Q.js → chunk-LN3MQFUE.js} +54 -2
- package/dist/chunk-LN3MQFUE.js.map +1 -0
- package/dist/{chunk-FIP7KI2P.js → chunk-M4GO4ZJK.js} +205 -15
- package/dist/chunk-M4GO4ZJK.js.map +1 -0
- package/dist/{chunk-QMZ5A6FQ.js → chunk-M7W2KYTL.js} +2 -2
- package/dist/{chunk-K4BWPNJO.js → chunk-MLCTPWSO.js} +3 -3
- package/dist/{chunk-GEEJPID6.js → chunk-MMVQ3SUO.js} +3 -3
- package/dist/{chunk-HQKRZIX6.js → chunk-MPPWL64H.js} +24 -41
- package/dist/chunk-MPPWL64H.js.map +1 -0
- package/dist/{chunk-YZN6NRTR.js → chunk-MQBFT2OT.js} +11 -9
- package/dist/chunk-MQBFT2OT.js.map +1 -0
- package/dist/{chunk-TNJVDG2B.js → chunk-NA374QG7.js} +2 -2
- package/dist/chunk-NIKO2BBZ.js +23 -0
- package/dist/chunk-NIKO2BBZ.js.map +1 -0
- package/dist/chunk-PEOZ34EM.js +13 -0
- package/dist/chunk-PEOZ34EM.js.map +1 -0
- package/dist/chunk-PVEWA2DU.js +23 -0
- package/dist/chunk-PVEWA2DU.js.map +1 -0
- package/dist/{chunk-V5JUAW4M.js → chunk-QVIZDLAR.js} +5 -5
- package/dist/{chunk-DYZ5CCVM.js → chunk-RM5EXCFF.js} +1 -1
- package/dist/{chunk-DYZ5CCVM.js.map → chunk-RM5EXCFF.js.map} +1 -1
- package/dist/chunk-SMY5X46Z.js +14 -0
- package/dist/chunk-SMY5X46Z.js.map +1 -0
- package/dist/{chunk-2CRZOVDI.js → chunk-UNREYBZO.js} +2 -2
- package/dist/{chunk-KJTIAECI.js → chunk-V2R2VWER.js} +168 -9
- package/dist/chunk-V2R2VWER.js.map +1 -0
- package/dist/{chunk-CKUYQO2P.js → chunk-VDTWFN2P.js} +7 -5
- package/dist/chunk-VDTWFN2P.js.map +1 -0
- package/dist/chunk-VKQCVU2Z.js +21 -0
- package/dist/chunk-VKQCVU2Z.js.map +1 -0
- package/dist/{chunk-UTEATWHO.js → chunk-VNJMLOQS.js} +4 -4
- package/dist/{chunk-JAMDDLIM.js → chunk-WCJJQV2D.js} +2 -2
- package/dist/{chunk-OMSKGLYA.js → chunk-WWBC4KLB.js} +2 -2
- package/dist/{chunk-JIHH26WQ.js → chunk-XG7OZDOS.js} +3 -3
- package/dist/{chunk-QBOQI6PG.js → chunk-XONZGK6J.js} +2 -2
- package/dist/{chunk-YQQPNXNO.js → chunk-XSOGLHGY.js} +2 -2
- package/dist/{chunk-3OWYOECI.js → chunk-XY6MNSAF.js} +4 -4
- package/dist/chunk-XZHEOSQ2.js +16 -0
- package/dist/chunk-XZHEOSQ2.js.map +1 -0
- package/dist/{chunk-X3MWEFPT.js → chunk-YGMREQAK.js} +3 -3
- package/dist/chunk-YMUFFJCO.js +23 -0
- package/dist/chunk-YMUFFJCO.js.map +1 -0
- package/dist/{chunk-3LJYHE7S.js → chunk-ZDFU34XY.js} +9 -6
- package/dist/{chunk-3LJYHE7S.js.map → chunk-ZDFU34XY.js.map} +1 -1
- package/dist/{chunk-ILM6X6CP.js → chunk-ZF572E2M.js} +2 -2
- package/dist/{chunk-TNATF3HB.js → chunk-ZGEFBDPR.js} +2 -2
- package/dist/chunk-ZGEFBDPR.js.map +1 -0
- package/dist/{chunk-OGVE4IJW.js → chunk-ZHMUFYZF.js} +4 -4
- package/dist/{chunk-YFFEF6HR.js → chunk-ZHZ4PET5.js} +2 -2
- package/dist/{chunk-YZNKFYDC.js → chunk-ZM72UO3Y.js} +2 -2
- package/dist/classified/index.js +3 -3
- package/dist/{classified-marker-52P3D72W.js → classified-marker-SVDRXLD3.js} +3 -3
- package/dist/{collection-facade-XKCFHSLR.js → collection-facade-S5PPKZD5.js} +9 -9
- package/dist/consent/index.js +8 -4
- package/dist/consent/index.js.map +1 -1
- package/dist/{cover-5BSNJREH.js → cover-ADBCTIKN.js} +3 -3
- package/dist/crdt/index.js +4 -0
- package/dist/crdt/index.js.map +1 -1
- package/dist/{dead-filter-JXVCKS6W.js → dead-filter-HKDMTMVY.js} +2 -2
- package/dist/{delegation-WWZPEDK2.js → delegation-EV7LKJPH.js} +5 -5
- package/dist/derivations/index.js +3 -3
- package/dist/{derive-CWWFEQ4N.js → derive-5LDJW76F.js} +4 -4
- package/dist/{dispatch-PKQQFDBT.js → dispatch-SPMYNXNW.js} +12 -11
- package/dist/{dispatch-PKQQFDBT.js.map → dispatch-SPMYNXNW.js.map} +1 -1
- package/dist/{dispatch-SMXUO7W5.js → dispatch-V5MSMQYX.js} +5 -5
- package/dist/{enclave-I5H3GINP.js → enclave-ZA7C3H2L.js} +4 -4
- package/dist/executor-SVHAJZ4A.js +28 -0
- package/dist/{export-accessible-FBL6TDSK.js → export-accessible-S35YKIBL.js} +7 -7
- package/dist/{extract-partition-ZYIRYMTI.js → extract-partition-UVHAM5WZ.js} +10 -10
- package/dist/{fanout-sidecar-WWXVHHUH.js → fanout-sidecar-HRMHC34B.js} +4 -4
- package/dist/forget/index.js +4 -4
- package/dist/history/index.js +10 -6
- package/dist/history/index.js.map +1 -1
- package/dist/i18n/index.js +10 -8
- package/dist/i18n/index.js.map +1 -1
- package/dist/index.d.ts +4 -7
- package/dist/index.js +94 -151
- package/dist/index.js.map +1 -1
- package/dist/indexing/index.js +3 -1
- package/dist/indexing/index.js.map +1 -1
- package/dist/{issue-F76PAGIR.js → issue-5X3SMCF4.js} +6 -6
- package/dist/kernel/lazy.d.ts +30 -0
- package/dist/kernel/noydb.d.ts +21 -10
- package/dist/kernel/query/builder.d.ts +10 -10
- package/dist/kernel/query/index.d.ts +0 -6
- package/dist/kernel/query/scan-builder.d.ts +4 -4
- package/dist/kernel/types.d.ts +5 -5
- package/dist/{ledger-M2BKCNVS.js → ledger-K6JBFL3Z.js} +6 -6
- package/dist/liberate-NHTCKBU4.js +24 -0
- package/dist/{link-set-ZU4E5J5S.js → link-set-XVZY2ODC.js} +5 -5
- package/dist/materialized-views/index.js +15 -12
- package/dist/noydb-TI3RFU6M.js +78 -0
- package/dist/periods/index.js +9 -7
- package/dist/pod/index.js +5 -6
- package/dist/{policy-IY2YEA3A.js → policy-QWGJB7P7.js} +4 -4
- package/dist/port/with/collection-registries.d.ts +62 -0
- package/dist/port/with/strategies.d.ts +2 -2
- package/dist/port/with/team-strategy.d.ts +2 -1
- package/dist/portability/index.js +6 -6
- package/dist/{post-register-XIAHB6KF.js → post-register-5VHHVFJY.js} +4 -4
- package/dist/query/index.js +4 -44
- package/dist/{aggregate → reduce}/index.js +22 -15
- package/dist/reduce/index.js.map +1 -0
- package/dist/{register-HB4TQZSV.js → register-CEX7R7NE.js} +6 -6
- package/dist/{registry-6BMBFEXT.js → registry-DIKMRXUC.js} +5 -5
- package/dist/{registry-JOFO7RAH.js → registry-EWIB5NTI.js} +4 -4
- package/dist/{request-withdrawal-UN3TRHWI.js → request-withdrawal-AAG57QO4.js} +9 -9
- package/dist/{reveal-VWXRV2XU.js → reveal-7OOT5XPD.js} +3 -3
- package/dist/{revoke-OLO2OVR7.js → revoke-U5LCIJMF.js} +6 -6
- package/dist/sealed-record/index.js +6 -6
- package/dist/{seed-CDBFOTIK.js → seed-GVOI6QP6.js} +6 -6
- package/dist/session/index.js +7 -3
- package/dist/session/index.js.map +1 -1
- package/dist/shadow/index.js +4 -0
- package/dist/shadow/index.js.map +1 -1
- package/dist/{signer-MGGKPYAN.js → signer-NAA2OX7H.js} +5 -5
- package/dist/snapshots/index.js +9 -5
- package/dist/snapshots/index.js.map +1 -1
- package/dist/{stale-NBROTA66.js → stale-BJO2WIN7.js} +6 -5
- package/dist/{storage-3R37QZLA.js → storage-FL7XXZTN.js} +5 -5
- package/dist/{store-coordination-provider-P3IU5JHD.js → store-coordination-provider-DX5HECK3.js} +3 -3
- package/dist/sync/index.js +8 -4
- package/dist/sync/index.js.map +1 -1
- package/dist/team/index.js +15 -17
- package/dist/tiers/index.js +4 -4
- package/dist/tx/index.js +5 -1
- package/dist/tx/index.js.map +1 -1
- package/dist/via/blob/index.d.ts +2 -0
- package/dist/via/i18n/core.d.ts +1 -1
- package/dist/via/i18n/index.d.ts +2 -0
- package/dist/via/money/money-reducer.d.ts +2 -2
- package/dist/{walk-E3OVLBFR.js → walk-JXMWKKQW.js} +5 -5
- package/dist/with-audit/consent/index.d.ts +2 -0
- package/dist/with-audit/periods/index.d.ts +2 -0
- package/dist/with-cargo/floor.d.ts +3 -3
- package/dist/with-commit/crdt/index.d.ts +2 -0
- package/dist/with-commit/history/index.d.ts +2 -0
- package/dist/with-fork/shadow/index.d.ts +2 -0
- package/dist/with-fork/snapshots/index.d.ts +2 -0
- package/dist/with-formula/materialized-views/types.d.ts +7 -7
- package/dist/with-lookup/indexing/index.d.ts +2 -0
- package/dist/with-lookup/{aggregate → reduce}/active.d.ts +8 -8
- package/dist/with-lookup/{aggregate → reduce}/groupby.d.ts +21 -21
- package/dist/with-lookup/reduce/index.d.ts +34 -0
- package/dist/with-lookup/{aggregate → reduce}/reducers.d.ts +10 -10
- package/dist/with-lookup/{aggregate/aggregation.d.ts → reduce/reduction.d.ts} +21 -21
- package/dist/with-lookup/{aggregate → reduce}/strategy.d.ts +15 -15
- package/dist/with-party/session/index.d.ts +2 -0
- package/dist/with-party/sync/index.d.ts +2 -0
- package/dist/with-party/team/keyring.d.ts +20 -1
- package/dist/with-party/team/noydb-facade.d.ts +2 -1
- package/dist/{withdraw-accessible-Q2EMATCU.js → withdraw-accessible-GO6KQJVM.js} +8 -8
- package/package.json +6 -34
- package/dist/aggregate/index.js.map +0 -1
- package/dist/as/index.js +0 -30
- package/dist/at/index.js +0 -1
- package/dist/by/index.js +0 -11
- package/dist/chunk-2YELV6TV.js +0 -1
- package/dist/chunk-7ICV4ASA.js.map +0 -1
- package/dist/chunk-AFAPBZAA.js +0 -54
- package/dist/chunk-AFAPBZAA.js.map +0 -1
- package/dist/chunk-BY5YBSXA.js.map +0 -1
- package/dist/chunk-CJVEAVYH.js +0 -205
- package/dist/chunk-CJVEAVYH.js.map +0 -1
- package/dist/chunk-CKUYQO2P.js.map +0 -1
- package/dist/chunk-EEZCB74X.js.map +0 -1
- package/dist/chunk-FIP7KI2P.js.map +0 -1
- package/dist/chunk-HQKRZIX6.js.map +0 -1
- package/dist/chunk-IGLU4ME7.js +0 -255
- package/dist/chunk-IGLU4ME7.js.map +0 -1
- package/dist/chunk-J5TEU77Q.js.map +0 -1
- package/dist/chunk-KJTIAECI.js.map +0 -1
- package/dist/chunk-L2CAWCQL.js.map +0 -1
- package/dist/chunk-LB7FD65R.js +0 -163
- package/dist/chunk-LB7FD65R.js.map +0 -1
- package/dist/chunk-QMMOMBH6.js.map +0 -1
- package/dist/chunk-TNATF3HB.js.map +0 -1
- package/dist/chunk-XUFAFHQM.js.map +0 -1
- package/dist/chunk-YTW6ZIPD.js.map +0 -1
- package/dist/chunk-YZN6NRTR.js.map +0 -1
- package/dist/executor-SHYLIBOM.js +0 -26
- package/dist/in/index.js +0 -1
- package/dist/liberate-ZP7UB57K.js +0 -24
- package/dist/noydb-BNDGEK5X.js +0 -71
- package/dist/on/index.js +0 -17
- package/dist/port/as/index.d.ts +0 -26
- package/dist/port/at/index.d.ts +0 -18
- package/dist/port/in/index.d.ts +0 -21
- package/dist/port/on/index.d.ts +0 -27
- package/dist/port/ui/index.d.ts +0 -21
- package/dist/port/with/index.d.ts +0 -18
- package/dist/request-withdrawal-UN3TRHWI.js.map +0 -1
- package/dist/revoke-OLO2OVR7.js.map +0 -1
- package/dist/signer-MGGKPYAN.js.map +0 -1
- package/dist/stale-NBROTA66.js.map +0 -1
- package/dist/storage-3R37QZLA.js.map +0 -1
- package/dist/ui/index.js +0 -1
- package/dist/ui/index.js.map +0 -1
- package/dist/with/index.js +0 -31
- package/dist/with/index.js.map +0 -1
- package/dist/with-lookup/aggregate/index.d.ts +0 -23
- package/dist/withdraw-accessible-Q2EMATCU.js.map +0 -1
- /package/dist/{api-22ES33N3.js.map → api-5QVQX4HG.js.map} +0 -0
- /package/dist/{backup-YCHAC575.js.map → backup-USYSNCYM.js.map} +0 -0
- /package/dist/{chunk-RWW3I3PO.js.map → chunk-2BVW754E.js.map} +0 -0
- /package/dist/{chunk-VEGQYPCP.js.map → chunk-2ZSC454H.js.map} +0 -0
- /package/dist/{chunk-S4YERMGJ.js.map → chunk-32467U5J.js.map} +0 -0
- /package/dist/{chunk-UVBHM7AK.js.map → chunk-3GXDB3NQ.js.map} +0 -0
- /package/dist/{chunk-HAPY7WFP.js.map → chunk-3TZUC4WS.js.map} +0 -0
- /package/dist/{chunk-M6QA2KK2.js.map → chunk-44Y3P5U6.js.map} +0 -0
- /package/dist/{chunk-WQN5SM7P.js.map → chunk-4B3DL75F.js.map} +0 -0
- /package/dist/{chunk-OHV6T5JB.js.map → chunk-6SSWOUUS.js.map} +0 -0
- /package/dist/{chunk-6RPWILRH.js.map → chunk-7IQWHYL2.js.map} +0 -0
- /package/dist/{chunk-I2XEBEEF.js.map → chunk-AZXEOEQK.js.map} +0 -0
- /package/dist/{chunk-K7BADAOS.js.map → chunk-C2V7AJO2.js.map} +0 -0
- /package/dist/{chunk-YCAJDK4O.js.map → chunk-E7FSBI6I.js.map} +0 -0
- /package/dist/{chunk-YWZEDG7F.js.map → chunk-EPME33Y4.js.map} +0 -0
- /package/dist/{chunk-YXZNGHID.js.map → chunk-H5GMROCB.js.map} +0 -0
- /package/dist/{chunk-FTCGEUOY.js.map → chunk-HDF5R2K6.js.map} +0 -0
- /package/dist/{chunk-R2N37AA6.js.map → chunk-HVPW6PCX.js.map} +0 -0
- /package/dist/{chunk-YXIVUWDU.js.map → chunk-HXVRRJBD.js.map} +0 -0
- /package/dist/{chunk-5ATANZSW.js.map → chunk-ICYC5YNI.js.map} +0 -0
- /package/dist/{chunk-QZJEYZ4I.js.map → chunk-JGOKAZNB.js.map} +0 -0
- /package/dist/{chunk-7BIJS6II.js.map → chunk-JTIPVW4J.js.map} +0 -0
- /package/dist/{chunk-SC4JLMZI.js.map → chunk-KCZAFDP5.js.map} +0 -0
- /package/dist/{chunk-GP54LU5N.js.map → chunk-LG2GUYRX.js.map} +0 -0
- /package/dist/{chunk-QMZ5A6FQ.js.map → chunk-M7W2KYTL.js.map} +0 -0
- /package/dist/{chunk-K4BWPNJO.js.map → chunk-MLCTPWSO.js.map} +0 -0
- /package/dist/{chunk-GEEJPID6.js.map → chunk-MMVQ3SUO.js.map} +0 -0
- /package/dist/{chunk-TNJVDG2B.js.map → chunk-NA374QG7.js.map} +0 -0
- /package/dist/{chunk-V5JUAW4M.js.map → chunk-QVIZDLAR.js.map} +0 -0
- /package/dist/{chunk-2CRZOVDI.js.map → chunk-UNREYBZO.js.map} +0 -0
- /package/dist/{chunk-UTEATWHO.js.map → chunk-VNJMLOQS.js.map} +0 -0
- /package/dist/{chunk-JAMDDLIM.js.map → chunk-WCJJQV2D.js.map} +0 -0
- /package/dist/{chunk-OMSKGLYA.js.map → chunk-WWBC4KLB.js.map} +0 -0
- /package/dist/{chunk-JIHH26WQ.js.map → chunk-XG7OZDOS.js.map} +0 -0
- /package/dist/{chunk-QBOQI6PG.js.map → chunk-XONZGK6J.js.map} +0 -0
- /package/dist/{chunk-YQQPNXNO.js.map → chunk-XSOGLHGY.js.map} +0 -0
- /package/dist/{chunk-3OWYOECI.js.map → chunk-XY6MNSAF.js.map} +0 -0
- /package/dist/{chunk-X3MWEFPT.js.map → chunk-YGMREQAK.js.map} +0 -0
- /package/dist/{chunk-ILM6X6CP.js.map → chunk-ZF572E2M.js.map} +0 -0
- /package/dist/{chunk-OGVE4IJW.js.map → chunk-ZHMUFYZF.js.map} +0 -0
- /package/dist/{chunk-YFFEF6HR.js.map → chunk-ZHZ4PET5.js.map} +0 -0
- /package/dist/{chunk-YZNKFYDC.js.map → chunk-ZM72UO3Y.js.map} +0 -0
- /package/dist/{classified-marker-52P3D72W.js.map → classified-marker-SVDRXLD3.js.map} +0 -0
- /package/dist/{as/index.js.map → collection-facade-S5PPKZD5.js.map} +0 -0
- /package/dist/{at/index.js.map → cover-ADBCTIKN.js.map} +0 -0
- /package/dist/{dead-filter-JXVCKS6W.js.map → dead-filter-HKDMTMVY.js.map} +0 -0
- /package/dist/{by/index.js.map → delegation-EV7LKJPH.js.map} +0 -0
- /package/dist/{chunk-2YELV6TV.js.map → derive-5LDJW76F.js.map} +0 -0
- /package/dist/{dispatch-SMXUO7W5.js.map → dispatch-V5MSMQYX.js.map} +0 -0
- /package/dist/{collection-facade-XKCFHSLR.js.map → enclave-ZA7C3H2L.js.map} +0 -0
- /package/dist/{cover-5BSNJREH.js.map → executor-SVHAJZ4A.js.map} +0 -0
- /package/dist/{delegation-WWZPEDK2.js.map → export-accessible-S35YKIBL.js.map} +0 -0
- /package/dist/{derive-CWWFEQ4N.js.map → extract-partition-UVHAM5WZ.js.map} +0 -0
- /package/dist/{fanout-sidecar-WWXVHHUH.js.map → fanout-sidecar-HRMHC34B.js.map} +0 -0
- /package/dist/{enclave-I5H3GINP.js.map → issue-5X3SMCF4.js.map} +0 -0
- /package/dist/{executor-SHYLIBOM.js.map → ledger-K6JBFL3Z.js.map} +0 -0
- /package/dist/{export-accessible-FBL6TDSK.js.map → liberate-NHTCKBU4.js.map} +0 -0
- /package/dist/{extract-partition-ZYIRYMTI.js.map → link-set-XVZY2ODC.js.map} +0 -0
- /package/dist/{in/index.js.map → noydb-TI3RFU6M.js.map} +0 -0
- /package/dist/{issue-F76PAGIR.js.map → policy-QWGJB7P7.js.map} +0 -0
- /package/dist/{post-register-XIAHB6KF.js.map → post-register-5VHHVFJY.js.map} +0 -0
- /package/dist/{ledger-M2BKCNVS.js.map → register-CEX7R7NE.js.map} +0 -0
- /package/dist/{liberate-ZP7UB57K.js.map → registry-DIKMRXUC.js.map} +0 -0
- /package/dist/{link-set-ZU4E5J5S.js.map → registry-EWIB5NTI.js.map} +0 -0
- /package/dist/{noydb-BNDGEK5X.js.map → request-withdrawal-AAG57QO4.js.map} +0 -0
- /package/dist/{reveal-VWXRV2XU.js.map → reveal-7OOT5XPD.js.map} +0 -0
- /package/dist/{on/index.js.map → revoke-U5LCIJMF.js.map} +0 -0
- /package/dist/{seed-CDBFOTIK.js.map → seed-GVOI6QP6.js.map} +0 -0
- /package/dist/{policy-IY2YEA3A.js.map → signer-NAA2OX7H.js.map} +0 -0
- /package/dist/{register-HB4TQZSV.js.map → stale-BJO2WIN7.js.map} +0 -0
- /package/dist/{registry-6BMBFEXT.js.map → storage-FL7XXZTN.js.map} +0 -0
- /package/dist/{store-coordination-provider-P3IU5JHD.js.map → store-coordination-provider-DX5HECK3.js.map} +0 -0
- /package/dist/{walk-E3OVLBFR.js.map → walk-JXMWKKQW.js.map} +0 -0
- /package/dist/with-lookup/{aggregate → reduce}/canonical-key.d.ts +0 -0
- /package/dist/{registry-JOFO7RAH.js.map → withdraw-accessible-GO6KQJVM.js.map} +0 -0
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
* groupBy doesn't need its own seam for the moment, because it
|
|
59
59
|
* delegates to the reducer protocol for all per-bucket state.
|
|
60
60
|
*/
|
|
61
|
-
import type {
|
|
61
|
+
import type { ReduceSpec, ReduceResult, ReductionUpstream, LiveReduction } from './reduction.js';
|
|
62
62
|
import type { ReducerBuilder } from './reducers.js';
|
|
63
63
|
import type { MoneyDescriptor } from '../../via/money/descriptor.js';
|
|
64
64
|
import type { ViaPipeline } from '../../kernel/via/pipeline.js';
|
|
@@ -78,7 +78,7 @@ export declare const GROUPBY_MAX_CARDINALITY = 100000;
|
|
|
78
78
|
*/
|
|
79
79
|
export declare function resetGroupByWarnings(): void;
|
|
80
80
|
/**
|
|
81
|
-
* Result row shape for a grouped
|
|
81
|
+
* Result row shape for a grouped reduction. Each row carries the
|
|
82
82
|
* group key value under the grouping field name plus every reducer
|
|
83
83
|
* output from the spec.
|
|
84
84
|
*
|
|
@@ -116,7 +116,7 @@ export type GroupedRowN<F extends readonly string[], R> = {
|
|
|
116
116
|
*/
|
|
117
117
|
declare abstract class GroupedQueryBase {
|
|
118
118
|
protected readonly executeRecords: () => readonly unknown[];
|
|
119
|
-
protected readonly upstreams: readonly
|
|
119
|
+
protected readonly upstreams: readonly ReductionUpstream[];
|
|
120
120
|
/**
|
|
121
121
|
* Optional dict label resolver attached by the query builder when
|
|
122
122
|
* the grouping field is a dictKey. Variadic groupings always pass
|
|
@@ -137,7 +137,7 @@ declare abstract class GroupedQueryBase {
|
|
|
137
137
|
* `[field]`.
|
|
138
138
|
*/
|
|
139
139
|
protected readonly fields: readonly string[];
|
|
140
|
-
constructor(executeRecords: () => readonly unknown[], fieldOrFields: string | readonly string[], upstreams: readonly
|
|
140
|
+
constructor(executeRecords: () => readonly unknown[], fieldOrFields: string | readonly string[], upstreams: readonly ReductionUpstream[],
|
|
141
141
|
/**
|
|
142
142
|
* Optional dict label resolver attached by the query builder when
|
|
143
143
|
* the grouping field is a dictKey. Variadic groupings always pass
|
|
@@ -152,21 +152,21 @@ declare abstract class GroupedQueryBase {
|
|
|
152
152
|
*/
|
|
153
153
|
via?: ViaPipeline | undefined);
|
|
154
154
|
/** Apply Via-aware reducer rewriting (e.g. money) when the source declares one. */
|
|
155
|
-
protected wrapSpec<Spec extends
|
|
155
|
+
protected wrapSpec<Spec extends ReduceSpec>(spec: Spec): Spec;
|
|
156
156
|
}
|
|
157
157
|
/**
|
|
158
158
|
* Chainable wrapper returned by `Query.groupBy(field)`. Terminates
|
|
159
|
-
* with `.aggregate(spec)` which returns a `
|
|
159
|
+
* with `.aggregate(spec)` which returns a `GroupedReduction`.
|
|
160
160
|
*
|
|
161
161
|
* Kept minimal — the only operation on a grouped query is
|
|
162
|
-
*
|
|
162
|
+
* reduction. Ordering, limiting, and further filtering belong on
|
|
163
163
|
* the underlying `Query` before `.groupBy()` is called; applying
|
|
164
164
|
* them post-group would be a different operation (`having` /
|
|
165
165
|
* `groupOrderBy`), out of scope for.
|
|
166
166
|
*/
|
|
167
167
|
export declare class GroupedQuery<T, F extends string, S extends keyof T = never, M extends keyof T & string = never> extends GroupedQueryBase {
|
|
168
168
|
/**
|
|
169
|
-
* Build a grouped
|
|
169
|
+
* Build a grouped reduction. Returns a `GroupedReduction`
|
|
170
170
|
* with `.run()`, `.runAsync()`, and `.live()` terminals — same shape
|
|
171
171
|
* as the non-grouped `.aggregate()` wrapper, just with an array
|
|
172
172
|
* result (one row per bucket) instead of a single reduced object.
|
|
@@ -178,8 +178,8 @@ export declare class GroupedQuery<T, F extends string, S extends keyof T = never
|
|
|
178
178
|
* declared `moneyFields` (`M`) member return a `MoneyString`. The
|
|
179
179
|
* bare-spec overload is preserved for backward compatibility.
|
|
180
180
|
*/
|
|
181
|
-
aggregate<Spec extends
|
|
182
|
-
aggregate<Spec extends
|
|
181
|
+
aggregate<Spec extends ReduceSpec>(spec: Spec): GroupedReduction<GroupedRow<F, ReduceResult<Spec>>>;
|
|
182
|
+
aggregate<Spec extends ReduceSpec>(build: (b: ReducerBuilder<T, S, M>) => Spec): GroupedReduction<GroupedRow<F, ReduceResult<Spec>>>;
|
|
183
183
|
}
|
|
184
184
|
/**
|
|
185
185
|
* Variadic-keyed sibling of `GroupedQuery<T, F>`. Constructed by the
|
|
@@ -187,12 +187,12 @@ export declare class GroupedQuery<T, F extends string, S extends keyof T = never
|
|
|
187
187
|
* identical — only the type-level result-row narrowing differs.
|
|
188
188
|
*/
|
|
189
189
|
export declare class GroupedQueryN<T, F extends readonly string[], S extends keyof T = never, M extends keyof T & string = never> extends GroupedQueryBase {
|
|
190
|
-
aggregate<Spec extends
|
|
191
|
-
aggregate<Spec extends
|
|
190
|
+
aggregate<Spec extends ReduceSpec>(spec: Spec): GroupedReduction<GroupedRowN<F, ReduceResult<Spec>>>;
|
|
191
|
+
aggregate<Spec extends ReduceSpec>(build: (b: ReducerBuilder<T, S, M>) => Spec): GroupedReduction<GroupedRowN<F, ReduceResult<Spec>>>;
|
|
192
192
|
}
|
|
193
193
|
/**
|
|
194
194
|
* Execute the group-and-reduce pipeline. Pure function over a
|
|
195
|
-
* record array and a spec — shared by `
|
|
195
|
+
* record array and a spec — shared by `GroupedReduction.run()`
|
|
196
196
|
* and the live-mode refresh path. Exported for tests and for any
|
|
197
197
|
* future `scan().groupBy().aggregate()` reuse.
|
|
198
198
|
*
|
|
@@ -201,10 +201,10 @@ export declare class GroupedQueryN<T, F extends readonly string[], S extends key
|
|
|
201
201
|
* bucket would be created — the consumer doesn't have to wait for
|
|
202
202
|
* the full partition to materialize before the error fires.
|
|
203
203
|
*/
|
|
204
|
-
export declare function groupAndReduce<R>(records: readonly unknown[], fieldOrFields: string | readonly string[], spec:
|
|
204
|
+
export declare function groupAndReduce<R>(records: readonly unknown[], fieldOrFields: string | readonly string[], spec: ReduceSpec, moneyFields?: Record<string, MoneyDescriptor>): R[];
|
|
205
205
|
/**
|
|
206
|
-
* Grouped
|
|
207
|
-
* terminal. Shape mirrors `
|
|
206
|
+
* Grouped reduction wrapper — the `.groupBy(field).aggregate(spec)`
|
|
207
|
+
* terminal. Shape mirrors `Reduction<R>` from aggregate.ts: two
|
|
208
208
|
* terminals (`.run()` and `.live()`), spec bound at construction
|
|
209
209
|
* time, upstreams collected for live mode.
|
|
210
210
|
*
|
|
@@ -212,7 +212,7 @@ export declare function groupAndReduce<R>(records: readonly unknown[], fieldOrFi
|
|
|
212
212
|
* grouped row), and the terminals return `R[]` — one row per
|
|
213
213
|
* bucket.
|
|
214
214
|
*/
|
|
215
|
-
export declare class
|
|
215
|
+
export declare class GroupedReduction<R> {
|
|
216
216
|
private readonly executeRecords;
|
|
217
217
|
private readonly spec;
|
|
218
218
|
private readonly upstreams;
|
|
@@ -222,7 +222,7 @@ export declare class GroupedAggregation<R> {
|
|
|
222
222
|
*/
|
|
223
223
|
private readonly dictLabelResolver?;
|
|
224
224
|
private readonly fields;
|
|
225
|
-
constructor(executeRecords: () => readonly unknown[], fields: string | readonly string[], spec:
|
|
225
|
+
constructor(executeRecords: () => readonly unknown[], fields: string | readonly string[], spec: ReduceSpec, upstreams: readonly ReductionUpstream[],
|
|
226
226
|
/**
|
|
227
227
|
* Optional dict label resolver for `<field>Label` projection
|
|
228
228
|
*. Present when the grouping field is a dictKey.
|
|
@@ -260,10 +260,10 @@ export declare class GroupedAggregation<R> {
|
|
|
260
260
|
fallback?: string | readonly string[];
|
|
261
261
|
}): Promise<R[]>;
|
|
262
262
|
/**
|
|
263
|
-
* Build a reactive `
|
|
263
|
+
* Build a reactive `LiveReduction<R[]>` that re-runs the full
|
|
264
264
|
* group-and-reduce pipeline whenever any upstream source notifies
|
|
265
265
|
* of a change. Same error-isolation and idempotent-stop contract
|
|
266
|
-
* as `
|
|
266
|
+
* as `Reduction.live()` — the implementation delegates to the
|
|
267
267
|
* same `LiveAggregationImpl` class by threading a fresh
|
|
268
268
|
* recompute closure through the existing constructor.
|
|
269
269
|
*
|
|
@@ -275,6 +275,6 @@ export declare class GroupedAggregation<R> {
|
|
|
275
275
|
*
|
|
276
276
|
* Always call `live.stop()` when finished.
|
|
277
277
|
*/
|
|
278
|
-
live():
|
|
278
|
+
live(): LiveReduction<R[]>;
|
|
279
279
|
}
|
|
280
280
|
export {};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @noy-db/hub/reduce — opt-in reduction + groupBy service.
|
|
3
|
+
*
|
|
4
|
+
* @category capability
|
|
5
|
+
*
|
|
6
|
+
* Groups every file whose reason-for-existing is record reduction:
|
|
7
|
+
* - `reduction` (`Reduction<R>`, `reduceRecords`, `buildLiveReduction`)
|
|
8
|
+
* - `groupby` (`GroupedQuery`, `GroupedReduction`, cardinality guards)
|
|
9
|
+
* - `reducers` (`count`, `sum`, `avg`, `min`, `max` factories)
|
|
10
|
+
*
|
|
11
|
+
* The root barrel (`@noy-db/hub`) and the `@noy-db/hub/query` subpath
|
|
12
|
+
* continue to re-export the same symbols for backward compatibility
|
|
13
|
+
* with consumers written before the relocation. New code should
|
|
14
|
+
* prefer this subpath.
|
|
15
|
+
*/
|
|
16
|
+
export { withReduce } from './active.js';
|
|
17
|
+
export type { ReduceStrategy } from './strategy.js';
|
|
18
|
+
export { Reduction, reduceRecords, buildLiveReduction } from './reduction.js';
|
|
19
|
+
export type { ReduceSpec, ReduceResult, ReductionUpstream, LiveReduction, } from './reduction.js';
|
|
20
|
+
export { GroupedQuery, GroupedQueryN, GroupedReduction, groupAndReduce, resetGroupByWarnings, GROUPBY_WARN_CARDINALITY, GROUPBY_MAX_CARDINALITY, } from './groupby.js';
|
|
21
|
+
export type { GroupedRow, GroupedRowN } from './groupby.js';
|
|
22
|
+
export { count, sum, avg, min, max, moneySum, moneyMin, moneyMax, reducerBuilder } from './reducers.js';
|
|
23
|
+
export type { Reducer, ReducerOptions, ReducerBuilder } from './reducers.js';
|
|
24
|
+
/** The un-opted-in stub for this service — exported so callers can compare against it (#844). */
|
|
25
|
+
export { NO_REDUCE } from './strategy.js';
|
|
26
|
+
/**
|
|
27
|
+
* Types named by this entry's own signatures (#843a). `min`/`max` return a
|
|
28
|
+
* `MinMaxState`, and the money reducers speak `MoneyString`; both must be
|
|
29
|
+
* nameable from the entry that exports the functions, or a caller can invoke
|
|
30
|
+
* them and cannot annotate the result.
|
|
31
|
+
*/
|
|
32
|
+
export type { MinMaxState } from './reducers.js';
|
|
33
|
+
export type { MoneyString } from '../../via/money/branded.js';
|
|
34
|
+
export type { MoneyDescriptor } from '../../via/money/descriptor.js';
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Reduction reducers for the query DSL.
|
|
3
3
|
*
|
|
4
4
|
* the reducer protocol plus five built-in factories
|
|
5
5
|
* (`count`, `sum`, `avg`, `min`, `max`) consumed by `Query.aggregate()`
|
|
6
6
|
* and, in the future, `Scan.aggregate()`. Every factory accepts
|
|
7
7
|
* an optional `{ seed }` parameter that is plumbed through the
|
|
8
8
|
* protocol but unused by the executor — that's the load-bearing
|
|
9
|
-
* half of constraint #2. When partition-aware
|
|
9
|
+
* half of constraint #2. When partition-aware reduction
|
|
10
10
|
* lands, the seed carries the previous partition's running total into
|
|
11
11
|
* the next partition without requiring a protocol change.
|
|
12
12
|
*
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
* Reducers are pure data — `init` / `step` / `finalize` / optional
|
|
20
20
|
* `remove` are stateless functions that receive and return `S`. This
|
|
21
21
|
* is the shape that admits O(1) incremental maintenance in a future
|
|
22
|
-
* optimization (delta-aware `
|
|
22
|
+
* optimization (delta-aware `LiveReduction` applies `step` or
|
|
23
23
|
* `remove` per delta), without blocking the simpler "full re-run on
|
|
24
24
|
* source change" that ships.
|
|
25
25
|
*/
|
|
@@ -30,19 +30,19 @@ import type { QueryField } from '../../kernel/types.js';
|
|
|
30
30
|
* `.aggregate()` spec.
|
|
31
31
|
*
|
|
32
32
|
* Type parameters:
|
|
33
|
-
* - `R` — user-visible result type (what the
|
|
33
|
+
* - `R` — user-visible result type (what the reduction returns
|
|
34
34
|
* for this slot, e.g. `number` for `sum()`)
|
|
35
35
|
* - `S` — internal state type, defaults to `R` for simple reducers
|
|
36
36
|
* that don't need compound bookkeeping
|
|
37
37
|
*
|
|
38
38
|
* A reducer is stateless: every method is pure over `S`. `init()` is
|
|
39
|
-
* called once per
|
|
39
|
+
* called once per reduction run to build the initial state; `step()`
|
|
40
40
|
* folds a record into the state; `remove()` (optional) un-folds a
|
|
41
41
|
* record, enabling incremental live maintenance; `finalize()` reads
|
|
42
42
|
* the final answer out of the state at the end of the run.
|
|
43
43
|
*/
|
|
44
44
|
export interface Reducer<R, S = R> {
|
|
45
|
-
/** Build the initial state for a fresh
|
|
45
|
+
/** Build the initial state for a fresh reduction run. */
|
|
46
46
|
init(): S;
|
|
47
47
|
/** Fold a record into the state. Returns the new state. */
|
|
48
48
|
step(state: S, record: unknown): S;
|
|
@@ -63,7 +63,7 @@ export interface Reducer<R, S = R> {
|
|
|
63
63
|
* Combine two independent partial states into one (then `finalize` once).
|
|
64
64
|
* Optional. MUST be associative + commutative with `init()` as identity.
|
|
65
65
|
* Never merge finalized results — only states. Enables parallel /
|
|
66
|
-
* hierarchical
|
|
66
|
+
* hierarchical reduction (e.g. cross-shard or advisor→firm rollup).
|
|
67
67
|
*/
|
|
68
68
|
merge?(a: S, b: S): S;
|
|
69
69
|
/**
|
|
@@ -94,10 +94,10 @@ export interface Reducer<R, S = R> {
|
|
|
94
94
|
*
|
|
95
95
|
* `seed` — optional initial value for the internal state. **Unused by
|
|
96
96
|
* the executor**, plumbed through the protocol for constraint
|
|
97
|
-
* #2 (partition-aware
|
|
98
|
-
*
|
|
97
|
+
* #2 (partition-aware reduction seam). In, partitioned
|
|
98
|
+
* reductions will pass the previous partition's carry as `seed` so
|
|
99
99
|
* a long time series can be rolled forward one partition at a time
|
|
100
|
-
* without re-
|
|
100
|
+
* without re-reducing closed partitions.
|
|
101
101
|
*
|
|
102
102
|
* always uses `init()` with the factory's zero value, regardless
|
|
103
103
|
* of whether `seed` was passed. Do not remove the parameter — that's
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Aggregate execution — the runtime behind `Query.aggregate()`.
|
|
3
3
|
*
|
|
4
|
-
* takes an `
|
|
4
|
+
* takes an `ReduceSpec` (a record of named reducers
|
|
5
5
|
* built from `reducers.ts`) and runs every reducer over the records
|
|
6
6
|
* produced by the underlying query. Two terminal surfaces:
|
|
7
7
|
*
|
|
8
8
|
* - `.run(): R` — synchronous one-shot reduction. Matches the
|
|
9
9
|
* existing `Query.toArray()` / `.first()` / `.count()` style.
|
|
10
|
-
* - `.live():
|
|
10
|
+
* - `.live(): LiveReduction<R>` — reactive primitive that
|
|
11
11
|
* re-runs the reduction whenever the query's source notifies of
|
|
12
12
|
* a change. uses naive full re-run; incremental delta
|
|
13
13
|
* maintenance is admitted by the reducer protocol (`remove()`)
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* can switch from full re-run to delta-based without breaking
|
|
16
16
|
* the public API. Consumers get correct, reactive values today.
|
|
17
17
|
*
|
|
18
|
-
* The `
|
|
18
|
+
* The `Reduction<R>` wrapper is deliberately tiny — it exists so
|
|
19
19
|
* `.aggregate(spec)` can be chained with either `.run()` or `.live()`
|
|
20
20
|
* without the builder needing two separate terminal methods. It
|
|
21
21
|
* holds the closure over the query execution (produces the current
|
|
@@ -39,9 +39,9 @@ import type { Reducer } from './reducers.js';
|
|
|
39
39
|
* }
|
|
40
40
|
* ```
|
|
41
41
|
*/
|
|
42
|
-
export type
|
|
42
|
+
export type ReduceSpec = Readonly<Record<string, Reducer<unknown, unknown>>>;
|
|
43
43
|
/**
|
|
44
|
-
* Map an `
|
|
44
|
+
* Map an `ReduceSpec` to its reduced result shape — each key
|
|
45
45
|
* carries the finalized result type from its reducer. A spec built
|
|
46
46
|
* from `{ total: sum('amount'), n: count() }` yields a result of
|
|
47
47
|
* `{ total: number, n: number }`.
|
|
@@ -50,26 +50,26 @@ export type AggregateSpec = Readonly<Record<string, Reducer<unknown, unknown>>>;
|
|
|
50
50
|
* each `Reducer<R, _>`. The `infer` captures the user-visible result
|
|
51
51
|
* type, discarding the internal state type `S`.
|
|
52
52
|
*/
|
|
53
|
-
export type
|
|
53
|
+
export type ReduceResult<Spec extends ReduceSpec> = {
|
|
54
54
|
[K in keyof Spec]: Spec[K] extends Reducer<infer R, unknown> ? R : never;
|
|
55
55
|
};
|
|
56
56
|
/**
|
|
57
57
|
* Pure reduction over a record array. Runs every reducer's
|
|
58
58
|
* `init → step* → finalize` pipeline exactly once over the records.
|
|
59
59
|
*
|
|
60
|
-
* Called by `
|
|
60
|
+
* Called by `Reduction.run()` and by the live-mode refresh path.
|
|
61
61
|
* Exported for tests and for future `scan().aggregate()` reuse
|
|
62
62
|
* — the streaming path will call the same reducer protocol with a
|
|
63
63
|
* per-page loop instead of a single array.
|
|
64
64
|
*/
|
|
65
|
-
export declare function reduceRecords<Spec extends
|
|
65
|
+
export declare function reduceRecords<Spec extends ReduceSpec>(records: readonly unknown[], spec: Spec): ReduceResult<Spec>;
|
|
66
66
|
/**
|
|
67
|
-
* A minimal reactive primitive for
|
|
67
|
+
* A minimal reactive primitive for reduction results.
|
|
68
68
|
*
|
|
69
69
|
* Same spirit as the `LiveQuery` in : frame-agnostic, a plain
|
|
70
70
|
* object with `value` / `error` fields and a `subscribe(cb)`
|
|
71
71
|
* notification channel that Vue / React / Solid adapters wrap in
|
|
72
|
-
* their own primitive. Intentionally NOT a Promise —
|
|
72
|
+
* their own primitive. Intentionally NOT a Promise — reductions
|
|
73
73
|
* have a well-defined "current value" at every instant, and the
|
|
74
74
|
* reactive consumer wants to read that value synchronously.
|
|
75
75
|
*
|
|
@@ -86,7 +86,7 @@ export declare function reduceRecords<Spec extends AggregateSpec>(records: reado
|
|
|
86
86
|
* Always call `stop()` when done; Vue's `onUnmounted` is the
|
|
87
87
|
* canonical place. Raw consumers must do it themselves.
|
|
88
88
|
*/
|
|
89
|
-
export interface
|
|
89
|
+
export interface LiveReduction<R> {
|
|
90
90
|
/** Current reduced value. Undefined only if the first compute threw. */
|
|
91
91
|
readonly value: R | undefined;
|
|
92
92
|
/** Last execution error, if any. Cleared on the next successful run. */
|
|
@@ -97,14 +97,14 @@ export interface LiveAggregation<R> {
|
|
|
97
97
|
stop(): void;
|
|
98
98
|
}
|
|
99
99
|
/**
|
|
100
|
-
* Upstream change-notification hook for live
|
|
100
|
+
* Upstream change-notification hook for live reduction.
|
|
101
101
|
*
|
|
102
102
|
* Matches the shape that `QuerySource.subscribe` already uses — a
|
|
103
103
|
* single method that accepts a callback and returns an unsubscribe
|
|
104
|
-
* function. The `
|
|
104
|
+
* function. The `Reduction` wrapper collects upstreams from the
|
|
105
105
|
* query's source and wires them into a single re-run trigger.
|
|
106
106
|
*/
|
|
107
|
-
export interface
|
|
107
|
+
export interface ReductionUpstream {
|
|
108
108
|
subscribe(cb: () => void): () => void;
|
|
109
109
|
}
|
|
110
110
|
/**
|
|
@@ -120,14 +120,14 @@ export interface AggregationUpstream {
|
|
|
120
120
|
* `.aggregate(spec).live()`. Wrapping lets the spec be named once
|
|
121
121
|
* and reused for either terminal, and keeps the `Query` class
|
|
122
122
|
* from growing a pair of near-duplicate method overloads
|
|
123
|
-
* (`
|
|
123
|
+
* (`reduceRun` / `reduceLive`) that would be harder to
|
|
124
124
|
* discover.
|
|
125
125
|
*/
|
|
126
|
-
export declare class
|
|
126
|
+
export declare class Reduction<R> {
|
|
127
127
|
private readonly executeRecords;
|
|
128
128
|
private readonly spec;
|
|
129
129
|
private readonly upstreams;
|
|
130
|
-
constructor(executeRecords: () => readonly unknown[], spec:
|
|
130
|
+
constructor(executeRecords: () => readonly unknown[], spec: ReduceSpec, upstreams: readonly ReductionUpstream[]);
|
|
131
131
|
/**
|
|
132
132
|
* Execute the query and reduce the results synchronously.
|
|
133
133
|
* Returns the reduced shape matching the spec — e.g. a spec of
|
|
@@ -136,7 +136,7 @@ export declare class Aggregation<R> {
|
|
|
136
136
|
*/
|
|
137
137
|
run(): R;
|
|
138
138
|
/**
|
|
139
|
-
* Build a reactive `
|
|
139
|
+
* Build a reactive `LiveReduction<R>` that re-runs the reduction
|
|
140
140
|
* whenever any upstream source notifies of a change. The initial
|
|
141
141
|
* value is computed eagerly in the constructor, so consumers can
|
|
142
142
|
* read `live.value` immediately after calling `.live()`.
|
|
@@ -153,14 +153,14 @@ export declare class Aggregation<R> {
|
|
|
153
153
|
* correct, reactive values today; future PRs can switch to
|
|
154
154
|
* delta-based maintenance without changing this API.
|
|
155
155
|
*/
|
|
156
|
-
live():
|
|
156
|
+
live(): LiveReduction<R>;
|
|
157
157
|
}
|
|
158
158
|
/**
|
|
159
|
-
* Build a `
|
|
159
|
+
* Build a `LiveReduction<V>` from a recompute closure and a list
|
|
160
160
|
* of upstreams. Exposed so sibling files in the query DSL
|
|
161
161
|
* (currently `groupby.ts`) can reuse the reactive primitive
|
|
162
162
|
* without reaching into `LiveAggregationImpl` directly. This keeps
|
|
163
163
|
* the implementation class private while still allowing planned
|
|
164
164
|
* composition with `.groupBy().aggregate().live()`.
|
|
165
165
|
*/
|
|
166
|
-
export declare function
|
|
166
|
+
export declare function buildLiveReduction<V>(recompute: () => V, upstreams: readonly ReductionUpstream[]): LiveReduction<V>;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Strategy seam between the core Query / ScanBuilder chain and the
|
|
3
3
|
* optional aggregate / groupBy service. Core imports
|
|
4
|
-
* `
|
|
4
|
+
* `ReduceStrategy` as a TYPE-ONLY symbol and `NO_REDUCE` as a
|
|
5
5
|
* tiny runtime stub.
|
|
6
6
|
*
|
|
7
|
-
* The heavy machinery — `
|
|
8
|
-
* reducer-step logic — is only reachable from `
|
|
7
|
+
* The heavy machinery — `Reduction`, `GroupedQuery`, the
|
|
8
|
+
* reducer-step logic — is only reachable from `withReduce()` in
|
|
9
9
|
* `./active.ts`, which is only exported through the
|
|
10
|
-
* `@noy-db/hub/
|
|
10
|
+
* `@noy-db/hub/reduce` subpath. Consumers that don't import the
|
|
11
11
|
* subpath ship none of the ~886 LOC.
|
|
12
12
|
*
|
|
13
13
|
* @internal
|
|
14
14
|
*/
|
|
15
|
-
import type {
|
|
15
|
+
import type { Reduction, ReduceSpec, ReduceResult, ReductionUpstream } from './reduction.js';
|
|
16
16
|
import type { GroupedQuery, GroupedQueryN } from './groupby.js';
|
|
17
17
|
import type { ViaPipeline } from '../../kernel/via/pipeline.js';
|
|
18
18
|
/**
|
|
@@ -21,39 +21,39 @@ import type { ViaPipeline } from '../../kernel/via/pipeline.js';
|
|
|
21
21
|
*
|
|
22
22
|
* @internal
|
|
23
23
|
*/
|
|
24
|
-
export interface
|
|
24
|
+
export interface ReduceStrategy {
|
|
25
25
|
/**
|
|
26
|
-
* Build an `
|
|
26
|
+
* Build an `Reduction<R>` for `Query.aggregate(spec)`. `executeRecords`
|
|
27
27
|
* is a closure that produces the matching record set when the
|
|
28
|
-
*
|
|
29
|
-
* constructs a real `
|
|
28
|
+
* reduction runs. NO_REDUCE throws; the active strategy
|
|
29
|
+
* constructs a real `Reduction`.
|
|
30
30
|
*/
|
|
31
|
-
aggregate<Spec extends
|
|
31
|
+
aggregate<Spec extends ReduceSpec>(executeRecords: () => readonly unknown[], spec: Spec, upstreams: readonly ReductionUpstream[]): Reduction<ReduceResult<Spec>>;
|
|
32
32
|
/**
|
|
33
33
|
* Build a `GroupedQuery<T, F, S>` for `Query.groupBy(field)`. Same
|
|
34
34
|
* closure / upstream inputs as `aggregate` plus the group key field.
|
|
35
35
|
*/
|
|
36
|
-
groupBy<T, F extends string, S extends keyof T = never, M extends keyof T & string = never>(executeRecords: () => readonly unknown[], field: F, upstreams: readonly
|
|
36
|
+
groupBy<T, F extends string, S extends keyof T = never, M extends keyof T & string = never>(executeRecords: () => readonly unknown[], field: F, upstreams: readonly ReductionUpstream[], dictLabelResolver?: (key: string, locale: string, fallback?: string | readonly string[]) => Promise<string | undefined>, via?: ViaPipeline): GroupedQuery<T, F, S, M>;
|
|
37
37
|
/**
|
|
38
38
|
* Variadic-keyed sibling — builds a `GroupedQueryN<T, F, S>` for
|
|
39
39
|
* `Query.groupBy(...fields)`. No dictLabelResolver — `<field>Label`
|
|
40
40
|
* projection only applies to single-field groupings, which dispatch
|
|
41
41
|
* through `groupBy` above.
|
|
42
42
|
*/
|
|
43
|
-
groupByN<T, F extends readonly string[], S extends keyof T = never, M extends keyof T & string = never>(executeRecords: () => readonly unknown[], fields: F, upstreams: readonly
|
|
43
|
+
groupByN<T, F extends readonly string[], S extends keyof T = never, M extends keyof T & string = never>(executeRecords: () => readonly unknown[], fields: F, upstreams: readonly ReductionUpstream[], via?: ViaPipeline): GroupedQueryN<T, F, S, M>;
|
|
44
44
|
/**
|
|
45
45
|
* Terminal streaming aggregator for `ScanBuilder.aggregate(spec)`.
|
|
46
46
|
* Takes an async iterable of decrypted records + the spec and
|
|
47
47
|
* returns the reduced result.
|
|
48
48
|
*/
|
|
49
|
-
scanAggregate<Spec extends
|
|
49
|
+
scanAggregate<Spec extends ReduceSpec>(iter: AsyncIterable<unknown>, spec: Spec): Promise<ReduceResult<Spec>>;
|
|
50
50
|
}
|
|
51
51
|
/**
|
|
52
52
|
* No-aggregate stub. Every `.aggregate()` / `.groupBy()` / streaming
|
|
53
53
|
* `scan().aggregate()` call throws with a pointer at the subpath. The
|
|
54
|
-
* real `
|
|
54
|
+
* real `Reduction` / `GroupedQuery` classes are never referenced at
|
|
55
55
|
* runtime, so the bundler drops the ~886 LOC.
|
|
56
56
|
*
|
|
57
57
|
* @internal
|
|
58
58
|
*/
|
|
59
|
-
export declare const
|
|
59
|
+
export declare const NO_REDUCE: ReduceStrategy;
|
|
@@ -21,3 +21,5 @@ export type { DevUnlockOptions } from './dev-unlock.js';
|
|
|
21
21
|
export { withSession } from './active.js';
|
|
22
22
|
export type { SessionStrategy } from './strategy.js';
|
|
23
23
|
export { SessionExpiredError, SessionNotFoundError, SessionPolicyError, } from '../../kernel/errors.js';
|
|
24
|
+
/** The un-opted-in stub for this service — exported so callers can compare against it (#844). */
|
|
25
|
+
export { NO_SESSION } from './strategy.js';
|
|
@@ -29,3 +29,5 @@
|
|
|
29
29
|
*/
|
|
30
30
|
export { withSync } from '../team/sync-active.js';
|
|
31
31
|
export type { SyncStrategy } from '../team/sync-strategy.js';
|
|
32
|
+
/** The un-opted-in stub for this service — exported so callers can compare against it (#844). */
|
|
33
|
+
export { NO_SYNC } from '../team/sync-strategy.js';
|
|
@@ -132,7 +132,26 @@ export declare function updateKeyringIdentity(adapter: NoydbStore, vault: string
|
|
|
132
132
|
* 2. Re-encrypt all records in affected collections
|
|
133
133
|
* 3. Re-wrap new DEKs for all remaining users
|
|
134
134
|
*/
|
|
135
|
-
|
|
135
|
+
/**
|
|
136
|
+
* What a DEK rotation leaves behind (#854).
|
|
137
|
+
*
|
|
138
|
+
* A member's DEKs are wrapped under that member's KEK, and a KEK derives only
|
|
139
|
+
* from that member's secret — so the caller cannot re-wrap a fresh DEK for
|
|
140
|
+
* anyone else. That is the zero-knowledge property working as designed, but it
|
|
141
|
+
* means rotation necessarily DROPS the rotated collections from every other
|
|
142
|
+
* member's keyring rather than re-keying them.
|
|
143
|
+
*
|
|
144
|
+
* `needsRegrant` names exactly who lost what, so the caller can re-run
|
|
145
|
+
* `grant()` instead of discovering the access loss later.
|
|
146
|
+
*/
|
|
147
|
+
export interface RotateResult {
|
|
148
|
+
/** (member, collection) pairs whose access was dropped by the rotation. */
|
|
149
|
+
readonly needsRegrant: ReadonlyArray<{
|
|
150
|
+
readonly userId: string;
|
|
151
|
+
readonly collection: string;
|
|
152
|
+
}>;
|
|
153
|
+
}
|
|
154
|
+
export declare function rotateKeys(adapter: NoydbStore, vault: string, callerKeyring: UnlockedKeyring, collections: string[]): Promise<RotateResult>;
|
|
136
155
|
/**
|
|
137
156
|
* Change the user's secret. Re-wraps every DEK under the new KEK.
|
|
138
157
|
*
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
* Internal service — reached through `noydb.team.rotateSecret(...)` etc.
|
|
20
20
|
*/
|
|
21
21
|
import type { NoydbOptions, NoydbStore, KeyringAuthenticator } from '../../kernel/types.js';
|
|
22
|
+
import type { RotateResult } from './keyring.js';
|
|
22
23
|
import { type RotateSecretInput, type RecoverSecretInput, type RecoverSecretResult, type RotateRecoveryOptions, type RotateRecoveryResult, type EnrollRecoveryResult, type RecoveryEnrollmentInput, type RecoveryProof } from './rotate-recover.js';
|
|
23
24
|
import { type RecoverUserOptions } from './peer-recover.js';
|
|
24
25
|
import { type PaperRecoveryEntry, type ShamirRecoveryEntry } from './recovery.js';
|
|
@@ -72,7 +73,7 @@ export declare class TeamFacade {
|
|
|
72
73
|
/** Gate + run a `revoke` engine. See `Noydb.revoke` for the public contract. */
|
|
73
74
|
runRevoke(engine: (adapter: NoydbStore, vault: string, callerKeyring: UnlockedKeyring, options: RevokeOptions) => Promise<void>, vault: string, options: RevokeOptions, factors?: FactorProofBundle): Promise<void>;
|
|
74
75
|
/** Gate + run a `rotateKeys` engine. See `Noydb.rotate` for the public contract. */
|
|
75
|
-
runRotate(engine: (adapter: NoydbStore, vault: string, callerKeyring: UnlockedKeyring, collections: string[]) => Promise<
|
|
76
|
+
runRotate(engine: (adapter: NoydbStore, vault: string, callerKeyring: UnlockedKeyring, collections: string[]) => Promise<RotateResult>, vault: string, collections: string[]): Promise<RotateResult>;
|
|
76
77
|
/**
|
|
77
78
|
* Add a tier-2 authenticator slot to the calling user's keyring.
|
|
78
79
|
* Each slot independently wraps the SAME KEK under a method-specific
|
|
@@ -4,18 +4,18 @@ import {
|
|
|
4
4
|
freezeSnapshotOnly,
|
|
5
5
|
randomId,
|
|
6
6
|
withdrawAccessibleData
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-
|
|
7
|
+
} from "./chunk-MLCTPWSO.js";
|
|
8
|
+
import "./chunk-WWBC4KLB.js";
|
|
9
|
+
import "./chunk-E7FSBI6I.js";
|
|
10
|
+
import "./chunk-ZHZ4PET5.js";
|
|
11
|
+
import "./chunk-MMVQ3SUO.js";
|
|
12
|
+
import "./chunk-KCZAFDP5.js";
|
|
13
13
|
import "./chunk-5WLDZZ6S.js";
|
|
14
14
|
import "./chunk-5HSSTOOG.js";
|
|
15
15
|
import "./chunk-G4MFQXYX.js";
|
|
16
16
|
import "./chunk-LP7BEXCT.js";
|
|
17
17
|
import "./chunk-7U6AB7DZ.js";
|
|
18
|
-
import "./chunk-
|
|
18
|
+
import "./chunk-DOZFU7OZ.js";
|
|
19
19
|
import "./chunk-6SYOHUHM.js";
|
|
20
20
|
import "./chunk-PZ5AY32C.js";
|
|
21
21
|
export {
|
|
@@ -25,4 +25,4 @@ export {
|
|
|
25
25
|
randomId,
|
|
26
26
|
withdrawAccessibleData
|
|
27
27
|
};
|
|
28
|
-
//# sourceMappingURL=withdraw-accessible-
|
|
28
|
+
//# sourceMappingURL=withdraw-accessible-GO6KQJVM.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@noy-db/hub",
|
|
3
|
-
"version": "0.4.0-pre.
|
|
3
|
+
"version": "0.4.0-pre.6",
|
|
4
4
|
"description": "Zero-knowledge, offline-first, encrypted document store — core library with AES-256-GCM, PBKDF2, multi-user keyring, and sync engine",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "vLannaAi <vicio@lanna.ai>",
|
|
@@ -64,10 +64,6 @@
|
|
|
64
64
|
"types": "./dist/with-store/lazy/index.d.ts",
|
|
65
65
|
"default": "./dist/lazy/index.js"
|
|
66
66
|
},
|
|
67
|
-
"./aggregate": {
|
|
68
|
-
"types": "./dist/with-lookup/aggregate/index.d.ts",
|
|
69
|
-
"default": "./dist/aggregate/index.js"
|
|
70
|
-
},
|
|
71
67
|
"./crdt": {
|
|
72
68
|
"types": "./dist/with-commit/crdt/index.d.ts",
|
|
73
69
|
"default": "./dist/crdt/index.js"
|
|
@@ -152,33 +148,9 @@
|
|
|
152
148
|
"types": "./dist/port/to/index.d.ts",
|
|
153
149
|
"default": "./dist/to/index.js"
|
|
154
150
|
},
|
|
155
|
-
"./
|
|
156
|
-
"types": "./dist/
|
|
157
|
-
"default": "./dist/
|
|
158
|
-
},
|
|
159
|
-
"./ui": {
|
|
160
|
-
"types": "./dist/port/ui/index.d.ts",
|
|
161
|
-
"default": "./dist/ui/index.js"
|
|
162
|
-
},
|
|
163
|
-
"./by": {
|
|
164
|
-
"types": "./dist/port/by/index.d.ts",
|
|
165
|
-
"default": "./dist/by/index.js"
|
|
166
|
-
},
|
|
167
|
-
"./on": {
|
|
168
|
-
"types": "./dist/port/on/index.d.ts",
|
|
169
|
-
"default": "./dist/on/index.js"
|
|
170
|
-
},
|
|
171
|
-
"./at": {
|
|
172
|
-
"types": "./dist/port/at/index.d.ts",
|
|
173
|
-
"default": "./dist/at/index.js"
|
|
174
|
-
},
|
|
175
|
-
"./in": {
|
|
176
|
-
"types": "./dist/port/in/index.d.ts",
|
|
177
|
-
"default": "./dist/in/index.js"
|
|
178
|
-
},
|
|
179
|
-
"./as": {
|
|
180
|
-
"types": "./dist/port/as/index.d.ts",
|
|
181
|
-
"default": "./dist/as/index.js"
|
|
151
|
+
"./reduce": {
|
|
152
|
+
"types": "./dist/with-lookup/reduce/index.d.ts",
|
|
153
|
+
"default": "./dist/reduce/index.js"
|
|
182
154
|
}
|
|
183
155
|
},
|
|
184
156
|
"module": "./dist/index.js",
|
|
@@ -192,14 +164,14 @@
|
|
|
192
164
|
"node": ">=22.0.0"
|
|
193
165
|
},
|
|
194
166
|
"dependencies": {
|
|
195
|
-
"@noy-db/attestation": "0.4.0-pre.
|
|
167
|
+
"@noy-db/attestation": "0.4.0-pre.6"
|
|
196
168
|
},
|
|
197
169
|
"devDependencies": {
|
|
198
170
|
"@types/node": "^22.0.0",
|
|
199
171
|
"esbuild": "^0.25.0",
|
|
200
172
|
"zod": "^4.0.0",
|
|
201
173
|
"zod-to-json-schema": "^3.25.2",
|
|
202
|
-
"@noy-db/on-shamir": "0.4.0-pre.
|
|
174
|
+
"@noy-db/on-shamir": "0.4.0-pre.6"
|
|
203
175
|
},
|
|
204
176
|
"peerDependencies": {
|
|
205
177
|
"zod-to-json-schema": "^3.25.0"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/with-lookup/aggregate/active.ts"],"sourcesContent":["/**\n * Active aggregate strategy factory. Calling `withAggregate()` returns\n * an `AggregateStrategy` whose methods construct real `Aggregation` /\n * `GroupedQuery` instances and run the streaming reducer protocol.\n *\n * This module is only reachable through the `@noy-db/hub/aggregate`\n * subpath — a consumer that never imports the subpath ships none of\n * this (ESM tree-shaking + hub's `\"sideEffects\": false`).\n */\n\nimport { Aggregation, reduceRecords } from './aggregation.js'\nimport type { AggregateSpec, AggregateResult } from './aggregation.js'\nimport { GroupedQuery, GroupedQueryN } from './groupby.js'\nimport type { AggregateStrategy } from './strategy.js'\n\n/**\n * Build the default aggregate strategy. Pass into\n * `createNoydb({ aggregateStrategy: withAggregate() })` to light up\n * `.aggregate()` and `.groupBy()` on `Query` and `ScanBuilder`.\n *\n * @example\n * ```ts\n * import { createNoydb } from '@noy-db/hub'\n * import { withAggregate, sum, count } from '@noy-db/hub/aggregate'\n *\n * const db = await createNoydb({\n * store, user, secret,\n * aggregateStrategy: withAggregate(),\n * })\n *\n * const totals = invoices.query()\n * .where('status', '==', 'paid')\n * .groupBy('clientId')\n * .aggregate({ amount: sum('amount'), n: count() })\n * .run()\n * ```\n */\nexport function withAggregate(): AggregateStrategy {\n return {\n aggregate(executeRecords, spec, upstreams) {\n return new Aggregation(executeRecords, spec as unknown as AggregateSpec, upstreams) as unknown as Aggregation<AggregateResult<typeof spec>>\n },\n groupBy(executeRecords, field, upstreams, dictLabelResolver, via) {\n return new GroupedQuery(executeRecords, field, upstreams, dictLabelResolver, via)\n },\n groupByN(executeRecords, fields, upstreams, via) {\n return new GroupedQueryN(executeRecords, fields, upstreams, undefined, via)\n },\n async scanAggregate(iter, spec) {\n const collected: unknown[] = []\n for await (const record of iter) collected.push(record)\n return reduceRecords(collected, spec as unknown as AggregateSpec) as unknown as AggregateResult<typeof spec>\n },\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqCO,SAAS,gBAAmC;AACjD,SAAO;AAAA,IACL,UAAU,gBAAgB,MAAM,WAAW;AACzC,aAAO,IAAI,YAAY,gBAAgB,MAAkC,SAAS;AAAA,IACpF;AAAA,IACA,QAAQ,gBAAgB,OAAO,WAAW,mBAAmB,KAAK;AAChE,aAAO,IAAI,aAAa,gBAAgB,OAAO,WAAW,mBAAmB,GAAG;AAAA,IAClF;AAAA,IACA,SAAS,gBAAgB,QAAQ,WAAW,KAAK;AAC/C,aAAO,IAAI,cAAc,gBAAgB,QAAQ,WAAW,QAAW,GAAG;AAAA,IAC5E;AAAA,IACA,MAAM,cAAc,MAAM,MAAM;AAC9B,YAAM,YAAuB,CAAC;AAC9B,uBAAiB,UAAU,KAAM,WAAU,KAAK,MAAM;AACtD,aAAO,cAAc,WAAW,IAAgC;AAAA,IAClE;AAAA,EACF;AACF;","names":[]}
|