@noy-db/hub 0.3.0-pre.3 → 0.3.0-pre.5
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/adapter/index.d.ts +2 -2
- package/dist/adapter/index.js +1 -1
- package/dist/aggregate/index.d.ts +3 -3
- package/dist/aggregate/index.js +4 -4
- package/dist/api-JOXUNSKP.js +20 -0
- package/dist/as/index.d.ts +4 -4
- package/dist/as/index.js +12 -9
- package/dist/at/index.d.ts +2 -2
- package/dist/attestation/index.d.ts +3 -3
- package/dist/attestation/index.js +21 -18
- package/dist/attestation/index.js.map +1 -1
- package/dist/{backup-NGRJ46SH.js → backup-OPONO6Q5.js} +12 -9
- package/dist/{backup-NGRJ46SH.js.map → backup-OPONO6Q5.js.map} +1 -1
- package/dist/blobs/index.d.ts +4 -4
- package/dist/blobs/index.js +11 -8
- package/dist/blobs/index.js.map +1 -1
- package/dist/bundle/index.d.ts +5 -5
- package/dist/bundle/index.js +21 -18
- package/dist/bundle/index.js.map +1 -1
- package/dist/{bundle-B-P3_Jvb.d.ts → bundle-Bs13EZtX.d.ts} +1 -1
- package/dist/by/index.js +2 -2
- package/dist/cargo/index.d.ts +4 -4
- package/dist/cargo/index.js +23 -20
- package/dist/{chunk-VBYVKOMJ.js → chunk-3QRQOBS7.js} +3 -3
- package/dist/{chunk-JFYIHLU3.js → chunk-3Y4QLJ6K.js} +2 -2
- package/dist/{chunk-BZIWKN74.js → chunk-43ISXURO.js} +2 -2
- package/dist/{chunk-PYWW4KLO.js → chunk-44UTIDE2.js} +9 -9
- package/dist/{chunk-7IP75FP2.js → chunk-4K3MQ5S3.js} +2 -2
- package/dist/chunk-5EWYUR5P.js +37 -0
- package/dist/chunk-5EWYUR5P.js.map +1 -0
- package/dist/{chunk-2KSPDSWI.js → chunk-5MRE3C4Q.js} +5 -5
- package/dist/{chunk-PUNJAEY6.js → chunk-6HNKCKFZ.js} +7 -7
- package/dist/{chunk-PJDK2PPQ.js → chunk-6RXPSMKR.js} +3 -3
- package/dist/{chunk-6DP5HBQD.js → chunk-6UOSONVI.js} +9 -9
- package/dist/{chunk-YN66UOXT.js → chunk-7SY3PTED.js} +25 -9
- package/dist/{chunk-YN66UOXT.js.map → chunk-7SY3PTED.js.map} +1 -1
- package/dist/{chunk-UP6EMMDI.js → chunk-A4DWPOP3.js} +10 -10
- package/dist/{chunk-MCJAUQGE.js → chunk-A5DYVMDR.js} +3 -3
- package/dist/{chunk-MIOLJG2R.js → chunk-AF5ZRTZ4.js} +5 -2
- package/dist/chunk-AF5ZRTZ4.js.map +1 -0
- package/dist/{chunk-TICO2I2O.js → chunk-BKGIWGCX.js} +2 -2
- package/dist/{chunk-O5DNEXQC.js → chunk-BMQOH7MM.js} +2 -2
- package/dist/{chunk-3UDPDRUC.js → chunk-EWR7HL3K.js} +4 -4
- package/dist/{chunk-CVXLJIAV.js → chunk-FH52CDEW.js} +5 -5
- package/dist/chunk-G4MGYGSS.js +130 -0
- package/dist/chunk-G4MGYGSS.js.map +1 -0
- package/dist/{chunk-FELHYKIO.js → chunk-G7RDYYTE.js} +2 -2
- package/dist/{chunk-N2FP26NH.js → chunk-GBTUANXF.js} +16 -297
- package/dist/chunk-GBTUANXF.js.map +1 -0
- package/dist/{chunk-DHIN36UC.js → chunk-GQOT6QJR.js} +8 -8
- package/dist/{chunk-DGUR3CC4.js → chunk-GXGK22QU.js} +2 -2
- package/dist/{chunk-YTIAXSUE.js → chunk-GZZL5R73.js} +4 -4
- package/dist/{chunk-E4YJUNPU.js → chunk-H5XRIJX3.js} +7 -7
- package/dist/{chunk-DA34OEZU.js → chunk-H7RYPVMJ.js} +2 -2
- package/dist/{chunk-2ZORB5RW.js → chunk-HBKDR7R3.js} +3 -3
- package/dist/{chunk-ZNI3RTFV.js → chunk-HMXLN43G.js} +2 -2
- package/dist/{chunk-BYW7EU5L.js → chunk-HY6ZGGEC.js} +2 -2
- package/dist/{chunk-ADBMJDBW.js → chunk-IEUIUSBO.js} +449 -1077
- package/dist/chunk-IEUIUSBO.js.map +1 -0
- package/dist/{chunk-OVIVYAQL.js → chunk-LEA7WJEZ.js} +25 -10
- package/dist/chunk-LEA7WJEZ.js.map +1 -0
- package/dist/{chunk-5Z3RNFJC.js → chunk-LIP6JWYK.js} +3 -3
- package/dist/{chunk-OCDUQUAP.js → chunk-LN22XH4B.js} +1 -1
- package/dist/chunk-LN22XH4B.js.map +1 -0
- package/dist/chunk-LP7BEXCT.js +32 -0
- package/dist/chunk-LP7BEXCT.js.map +1 -0
- package/dist/{chunk-IJW6K6UX.js → chunk-LPRPVCNY.js} +5 -5
- package/dist/{chunk-6EVZXETK.js → chunk-M66NAZA4.js} +3 -3
- package/dist/{chunk-HGQG3VIP.js → chunk-N5YVZHCB.js} +2 -2
- package/dist/chunk-NO272T7Q.js +194 -0
- package/dist/chunk-NO272T7Q.js.map +1 -0
- package/dist/{chunk-NIA5VQ7G.js → chunk-NQVZB3S7.js} +29 -11
- package/dist/chunk-NQVZB3S7.js.map +1 -0
- package/dist/{chunk-6OQ7NKMZ.js → chunk-O2DB4C3M.js} +6 -6
- package/dist/{chunk-LHYQE3BP.js → chunk-OFBFAVLI.js} +6 -6
- package/dist/{chunk-IWVWB7BZ.js → chunk-OJU3CPFA.js} +12 -12
- package/dist/{chunk-ZFME46HJ.js → chunk-OPTFANOX.js} +3 -3
- package/dist/chunk-OPTFANOX.js.map +1 -0
- package/dist/{chunk-5EZAJEES.js → chunk-OVO2RZAE.js} +81 -27
- package/dist/chunk-OVO2RZAE.js.map +1 -0
- package/dist/{chunk-6I2YPLAG.js → chunk-P27Z66EB.js} +7 -7
- package/dist/{chunk-7MHVHGQZ.js → chunk-P2LDXRGP.js} +2 -2
- package/dist/chunk-P3NGV5RV.js +41 -0
- package/dist/chunk-P3NGV5RV.js.map +1 -0
- package/dist/{chunk-NPVICKZE.js → chunk-P5WXDYMD.js} +8 -197
- package/dist/chunk-P5WXDYMD.js.map +1 -0
- package/dist/{chunk-CPAROOKP.js → chunk-PGFY7IRW.js} +12 -41
- package/dist/chunk-PGFY7IRW.js.map +1 -0
- package/dist/{chunk-Z44OY24N.js → chunk-PI5CG2OV.js} +9 -5
- package/dist/chunk-PI5CG2OV.js.map +1 -0
- package/dist/{chunk-6RASM2J4.js → chunk-QKVILR7N.js} +2 -2
- package/dist/{chunk-LKBLAUOB.js → chunk-QNTEDPWP.js} +3 -3
- package/dist/{chunk-P6UXDALK.js → chunk-RDHAGBEB.js} +3 -3
- package/dist/{chunk-XRE4JOEO.js → chunk-RTS23VIJ.js} +2 -2
- package/dist/{chunk-5ZPWVNL3.js → chunk-S2WKOCTU.js} +2 -2
- package/dist/chunk-SAJJWVNQ.js +135 -0
- package/dist/chunk-SAJJWVNQ.js.map +1 -0
- package/dist/{chunk-VHEEU4ZO.js → chunk-SW56GSYC.js} +2 -2
- package/dist/{chunk-46YGCU6Z.js → chunk-T2EGAXPM.js} +2 -2
- package/dist/{chunk-LES2Z7B4.js → chunk-T45LAT2Y.js} +2 -2
- package/dist/{chunk-4NMFWOS2.js → chunk-T65UZXR6.js} +3 -3
- package/dist/{chunk-2N4MUSF3.js → chunk-TB5RNNJ4.js} +7 -7
- package/dist/chunk-TCIUO62Z.js +29 -0
- package/dist/chunk-TCIUO62Z.js.map +1 -0
- package/dist/chunk-THNJ3IKU.js +17 -0
- package/dist/chunk-THNJ3IKU.js.map +1 -0
- package/dist/{chunk-U6OM4E67.js → chunk-TL7QR5T6.js} +20 -15
- package/dist/chunk-TL7QR5T6.js.map +1 -0
- package/dist/{chunk-L4IRFTIF.js → chunk-TLJOJBZD.js} +3 -23
- package/dist/chunk-TLJOJBZD.js.map +1 -0
- package/dist/chunk-TQ3REHVF.js +95 -0
- package/dist/chunk-TQ3REHVF.js.map +1 -0
- package/dist/{chunk-6CNLU4TO.js → chunk-TYGW5TOR.js} +7 -7
- package/dist/{chunk-BLZRNHMG.js → chunk-U23JUUPX.js} +8 -1
- package/dist/{chunk-BLZRNHMG.js.map → chunk-U23JUUPX.js.map} +1 -1
- package/dist/{chunk-U5DWHU3S.js → chunk-U24XHXNK.js} +2 -2
- package/dist/chunk-ULIHDPKL.js +94 -0
- package/dist/chunk-ULIHDPKL.js.map +1 -0
- package/dist/chunk-UOEWDCUX.js +69 -0
- package/dist/chunk-UOEWDCUX.js.map +1 -0
- package/dist/{chunk-NTHKOFVL.js → chunk-VFRNWE5P.js} +52 -8
- package/dist/chunk-VFRNWE5P.js.map +1 -0
- package/dist/{chunk-4DZGZ7II.js → chunk-VMJ5URU7.js} +8 -8
- package/dist/chunk-VMJ5URU7.js.map +1 -0
- package/dist/{chunk-YDP2SA5K.js → chunk-VPCMJ5Z4.js} +5 -5
- package/dist/{chunk-ZAWD6O46.js → chunk-VRPBEOWU.js} +2 -2
- package/dist/{chunk-AY4P6PHN.js → chunk-VWGCJUTV.js} +2 -2
- package/dist/{chunk-IIK7W3AN.js → chunk-XJR3COJO.js} +5 -5
- package/dist/{chunk-ZD4D7UM6.js → chunk-XYYW64LB.js} +2 -2
- package/dist/{chunk-4NZCZUGL.js → chunk-YFF2RP3X.js} +2 -2
- package/dist/{chunk-WVIIJPTJ.js → chunk-Z3FZC5GV.js} +7 -7
- package/dist/{chunk-55HDKLI3.js → chunk-Z5PIUYNB.js} +8 -8
- package/dist/{chunk-ZRDYQZYH.js → chunk-Z7KI4WHR.js} +2 -2
- package/dist/{chunk-BV7KNFJY.js → chunk-ZBDK7T6X.js} +9 -9
- package/dist/chunk-ZKF6HH7V.js +120 -0
- package/dist/chunk-ZKF6HH7V.js.map +1 -0
- package/dist/{chunk-P6DN5QU7.js → chunk-ZKYMKF2S.js} +8 -8
- package/dist/{chunk-NMRKAGHE.js → chunk-ZROMNP7Q.js} +2 -2
- package/dist/{chunk-5A6TC3RQ.js → chunk-ZT4GWVTX.js} +29 -14
- package/dist/chunk-ZT4GWVTX.js.map +1 -0
- package/dist/classified/index.d.ts +4 -4
- package/dist/classified/index.js +3 -3
- package/dist/collection-facade-THH4ASGX.js +39 -0
- package/dist/computed-BMMEFRFJ.js +11 -0
- package/dist/config-drift-3UIJVI5G.js +24 -0
- package/dist/config-drift-3UIJVI5G.js.map +1 -0
- package/dist/consent/index.d.ts +3 -3
- package/dist/consent/index.js +10 -7
- package/dist/consent/index.js.map +1 -1
- package/dist/crdt/index.d.ts +3 -3
- package/dist/delegation-BQNIEHZE.js +25 -0
- package/dist/derivations/index.d.ts +4 -4
- package/dist/derivations/index.js +12 -9
- package/dist/describe/index.d.ts +1 -1
- package/dist/{describe-0tiXAjoO.d.ts → describe-C6iHNlqJ.d.ts} +9 -0
- package/dist/{dev-unlock-B_s9DUWa.d.ts → dev-unlock-Cqd5Xv5J.d.ts} +1 -1
- package/dist/{enclave-IS7HZSQ7.js → enclave-YN6223OG.js} +21 -8
- package/dist/executor-CBTNU5VZ.js +9 -0
- package/dist/executor-DJHNSTIR.js +9 -0
- package/dist/executor-FGISLQIN.js +21 -0
- package/dist/export-accessible-P7SLRLK3.js +23 -0
- package/dist/extract-partition-6JGY3KYR.js +36 -0
- package/dist/{fanout-sidecar-DDKRG2MX.js → fanout-sidecar-WS22Q5WH.js} +12 -9
- package/dist/{fanout-sidecar-DDKRG2MX.js.map → fanout-sidecar-WS22Q5WH.js.map} +1 -1
- package/dist/fence-watcher-DHQ775JB.js +69 -0
- package/dist/fence-watcher-DHQ775JB.js.map +1 -0
- package/dist/find-RNBG7LBY.js +11 -0
- package/dist/forget/index.js +10 -7
- package/dist/forget/index.js.map +1 -1
- package/dist/guards/index.d.ts +4 -4
- package/dist/guards/index.js +3 -3
- package/dist/{hash-CWxn7sf6.d.ts → hash-D8Q5MJLA.d.ts} +1 -1
- package/dist/history/index.d.ts +4 -4
- package/dist/history/index.js +12 -9
- package/dist/history/index.js.map +1 -1
- package/dist/i18n/index.d.ts +3 -3
- package/dist/i18n/index.js +14 -11
- package/dist/i18n/index.js.map +1 -1
- package/dist/in/index.d.ts +2 -2
- package/dist/{index-D05bV0_g.d.ts → index-D4GQe1Rx.d.ts} +818 -49
- package/dist/{index-DTMUUwwW.d.ts → index-DRxk8q_7.d.ts} +3 -3
- package/dist/index.d.ts +54 -18
- package/dist/index.js +1022 -123
- package/dist/index.js.map +1 -1
- package/dist/indexing/index.d.ts +3 -3
- package/dist/indexing/index.js +4 -4
- package/dist/issue-W5QG53B5.js +19 -0
- package/dist/json-schema-I22JCYCG.js +44 -0
- package/dist/json-schema-I22JCYCG.js.map +1 -0
- package/dist/kernel/index.d.ts +3 -3
- package/dist/kernel/index.js +13 -10
- package/dist/lazy/index.d.ts +21 -0
- package/dist/lazy/index.js +12 -0
- package/dist/{ledger-YUAJUNFP.js → ledger-KZWBKAG5.js} +12 -9
- package/dist/liberate-AQ7OWBZZ.js +24 -0
- package/dist/link-set-UQEIYQAM.js +31 -0
- package/dist/materialized-views/index.d.ts +4 -4
- package/dist/materialized-views/index.js +16 -13
- package/dist/{mime-magic-Qr_4HjP6.d.ts → mime-magic-DmwT7OzZ.d.ts} +1 -1
- package/dist/noydb-WQZNAECY.js +60 -0
- package/dist/on/index.d.ts +2 -2
- package/dist/on/index.js +10 -7
- package/dist/overlay-views/index.d.ts +4 -4
- package/dist/overlay-views/index.js +4 -4
- package/dist/periods/index.d.ts +3 -3
- package/dist/periods/index.js +13 -10
- package/dist/pod/index.d.ts +3 -3
- package/dist/pod/index.js +12 -9
- package/dist/{policy-LRE6HTO5.js → policy-YIKUH4AD.js} +5 -5
- package/dist/portability/index.d.ts +3 -3
- package/dist/portability/index.js +8 -8
- package/dist/{public-envelope-WVRRUVAJ.js → public-envelope-MRN5YYZZ.js} +4 -4
- package/dist/query/index.d.ts +2 -2
- package/dist/query/index.js +6 -6
- package/dist/register-V5AQTXNI.js +21 -0
- package/dist/registry-IMNMHWTM.js +17 -0
- package/dist/registry-K6VUQXKV.js +19 -0
- package/dist/registry-ZVO3T4M5.js +9 -0
- package/dist/request-withdrawal-EHALV66Y.js +31 -0
- package/dist/request-withdrawal-EHALV66Y.js.map +1 -0
- package/dist/{reveal-WSUHXCSS.js → reveal-TBLTFWQ2.js} +6 -5
- package/dist/{reveal-WSUHXCSS.js.map → reveal-TBLTFWQ2.js.map} +1 -1
- package/dist/revoke-MHAUAESM.js +24 -0
- package/dist/revoke-MHAUAESM.js.map +1 -0
- package/dist/sealed-record/index.d.ts +3 -3
- package/dist/sealed-record/index.js +13 -10
- package/dist/sealed-record/index.js.map +1 -1
- package/dist/session/index.d.ts +4 -4
- package/dist/session/index.js +10 -7
- package/dist/session/index.js.map +1 -1
- package/dist/shadow/index.d.ts +3 -3
- package/dist/shadow/index.js +2 -2
- package/dist/signer-PQ74YXRY.js +25 -0
- package/dist/signer-PQ74YXRY.js.map +1 -0
- package/dist/snapshots/index.d.ts +3 -3
- package/dist/snapshots/index.js +11 -8
- package/dist/snapshots/index.js.map +1 -1
- package/dist/{stale-LX4BR43V.js → stale-7Q62KVI3.js} +2 -2
- package/dist/stale-7Q62KVI3.js.map +1 -0
- package/dist/storage-3FKGLQMC.js +23 -0
- package/dist/storage-3FKGLQMC.js.map +1 -0
- package/dist/{store-coordination-provider-KTRIC6PR.js → store-coordination-provider-JJCEMTAE.js} +3 -3
- package/dist/sync/index.d.ts +2 -2
- package/dist/sync/index.js +10 -7
- package/dist/sync/index.js.map +1 -1
- package/dist/team/index.d.ts +45 -6
- package/dist/team/index.js +25 -15
- package/dist/tiers/index.d.ts +2 -2
- package/dist/tiers/index.js +11 -8
- package/dist/to/index.d.ts +2 -2
- package/dist/to/index.js +1 -1
- package/dist/{transition-guard-C1Pyz8nH.d.ts → transition-guard-C4hvR-Ac.d.ts} +1 -1
- package/dist/tx/index.d.ts +3 -3
- package/dist/tx/index.js +3 -3
- package/dist/ui/index.d.ts +1 -1
- package/dist/util/index.js +1 -1
- package/dist/validators-Ctgkj5qd.d.ts +101 -0
- package/dist/{vault-diff-Fn0WeY2w.d.ts → vault-diff-B1Ir6EGs.d.ts} +1 -1
- package/dist/{verify-SW6J63Q2.js → verify-YB5LQHNA.js} +11 -7
- package/dist/{verify-SW6J63Q2.js.map → verify-YB5LQHNA.js.map} +1 -1
- package/dist/walk-T65TZDN2.js +241 -0
- package/dist/walk-T65TZDN2.js.map +1 -0
- package/dist/with/index.d.ts +3 -3
- package/dist/with/index.js +12 -9
- package/dist/{with-materialized-view-NKxs6iK5.d.ts → with-materialized-view-Bp65kKdQ.d.ts} +1 -1
- package/dist/{with-overlayed-view-B4fPYHwV.d.ts → with-overlayed-view-BRhdQNrK.d.ts} +1 -1
- package/dist/{with-rollup-Bl0sRFEt.d.ts → with-rollup-bQRPc3y1.d.ts} +1 -1
- package/dist/withdraw-accessible-JMX2TCPX.js +28 -0
- package/dist/withdraw-accessible-JMX2TCPX.js.map +1 -0
- package/package.json +7 -3
- package/dist/api-LORZ2EZU.js +0 -17
- package/dist/chunk-4DZGZ7II.js.map +0 -1
- package/dist/chunk-5A6TC3RQ.js.map +0 -1
- package/dist/chunk-5EZAJEES.js.map +0 -1
- package/dist/chunk-ADBMJDBW.js.map +0 -1
- package/dist/chunk-CPAROOKP.js.map +0 -1
- package/dist/chunk-L4IRFTIF.js.map +0 -1
- package/dist/chunk-MIOLJG2R.js.map +0 -1
- package/dist/chunk-N2FP26NH.js.map +0 -1
- package/dist/chunk-NIA5VQ7G.js.map +0 -1
- package/dist/chunk-NPVICKZE.js.map +0 -1
- package/dist/chunk-NTHKOFVL.js.map +0 -1
- package/dist/chunk-OCDUQUAP.js.map +0 -1
- package/dist/chunk-OVIVYAQL.js.map +0 -1
- package/dist/chunk-QLQS5A7X.js +0 -524
- package/dist/chunk-QLQS5A7X.js.map +0 -1
- package/dist/chunk-U6OM4E67.js.map +0 -1
- package/dist/chunk-Z44OY24N.js.map +0 -1
- package/dist/chunk-ZFME46HJ.js.map +0 -1
- package/dist/collection-facade-XPVRHBGU.js +0 -36
- package/dist/delegation-4HUHUE6T.js +0 -22
- package/dist/executor-ANFBCOYA.js +0 -9
- package/dist/executor-IKT47SH2.js +0 -9
- package/dist/executor-OIECZXTV.js +0 -18
- package/dist/export-accessible-NZWCFZHL.js +0 -20
- package/dist/extract-partition-52LX6RQH.js +0 -33
- package/dist/issue-F4SYPJGJ.js +0 -16
- package/dist/liberate-6LDETRIW.js +0 -21
- package/dist/noydb-WQNBVJIG.js +0 -54
- package/dist/registry-6HZ2JSQ7.js +0 -14
- package/dist/registry-GPXZQ7DT.js +0 -9
- package/dist/registry-USYD2ECC.js +0 -16
- package/dist/request-withdrawal-54V4L6CR.js +0 -28
- package/dist/revoke-JV26NTQD.js +0 -21
- package/dist/signer-AE56T5HE.js +0 -22
- package/dist/validators-Dzn7T-3x.d.ts +0 -62
- package/dist/withdraw-accessible-DGA4V2TP.js +0 -25
- /package/dist/{api-LORZ2EZU.js.map → api-JOXUNSKP.js.map} +0 -0
- /package/dist/{chunk-VBYVKOMJ.js.map → chunk-3QRQOBS7.js.map} +0 -0
- /package/dist/{chunk-JFYIHLU3.js.map → chunk-3Y4QLJ6K.js.map} +0 -0
- /package/dist/{chunk-BZIWKN74.js.map → chunk-43ISXURO.js.map} +0 -0
- /package/dist/{chunk-PYWW4KLO.js.map → chunk-44UTIDE2.js.map} +0 -0
- /package/dist/{chunk-7IP75FP2.js.map → chunk-4K3MQ5S3.js.map} +0 -0
- /package/dist/{chunk-2KSPDSWI.js.map → chunk-5MRE3C4Q.js.map} +0 -0
- /package/dist/{chunk-PUNJAEY6.js.map → chunk-6HNKCKFZ.js.map} +0 -0
- /package/dist/{chunk-PJDK2PPQ.js.map → chunk-6RXPSMKR.js.map} +0 -0
- /package/dist/{chunk-6DP5HBQD.js.map → chunk-6UOSONVI.js.map} +0 -0
- /package/dist/{chunk-UP6EMMDI.js.map → chunk-A4DWPOP3.js.map} +0 -0
- /package/dist/{chunk-MCJAUQGE.js.map → chunk-A5DYVMDR.js.map} +0 -0
- /package/dist/{chunk-TICO2I2O.js.map → chunk-BKGIWGCX.js.map} +0 -0
- /package/dist/{chunk-O5DNEXQC.js.map → chunk-BMQOH7MM.js.map} +0 -0
- /package/dist/{chunk-3UDPDRUC.js.map → chunk-EWR7HL3K.js.map} +0 -0
- /package/dist/{chunk-CVXLJIAV.js.map → chunk-FH52CDEW.js.map} +0 -0
- /package/dist/{chunk-FELHYKIO.js.map → chunk-G7RDYYTE.js.map} +0 -0
- /package/dist/{chunk-DHIN36UC.js.map → chunk-GQOT6QJR.js.map} +0 -0
- /package/dist/{chunk-DGUR3CC4.js.map → chunk-GXGK22QU.js.map} +0 -0
- /package/dist/{chunk-YTIAXSUE.js.map → chunk-GZZL5R73.js.map} +0 -0
- /package/dist/{chunk-E4YJUNPU.js.map → chunk-H5XRIJX3.js.map} +0 -0
- /package/dist/{chunk-DA34OEZU.js.map → chunk-H7RYPVMJ.js.map} +0 -0
- /package/dist/{chunk-2ZORB5RW.js.map → chunk-HBKDR7R3.js.map} +0 -0
- /package/dist/{chunk-ZNI3RTFV.js.map → chunk-HMXLN43G.js.map} +0 -0
- /package/dist/{chunk-BYW7EU5L.js.map → chunk-HY6ZGGEC.js.map} +0 -0
- /package/dist/{chunk-5Z3RNFJC.js.map → chunk-LIP6JWYK.js.map} +0 -0
- /package/dist/{chunk-IJW6K6UX.js.map → chunk-LPRPVCNY.js.map} +0 -0
- /package/dist/{chunk-6EVZXETK.js.map → chunk-M66NAZA4.js.map} +0 -0
- /package/dist/{chunk-HGQG3VIP.js.map → chunk-N5YVZHCB.js.map} +0 -0
- /package/dist/{chunk-6OQ7NKMZ.js.map → chunk-O2DB4C3M.js.map} +0 -0
- /package/dist/{chunk-LHYQE3BP.js.map → chunk-OFBFAVLI.js.map} +0 -0
- /package/dist/{chunk-IWVWB7BZ.js.map → chunk-OJU3CPFA.js.map} +0 -0
- /package/dist/{chunk-6I2YPLAG.js.map → chunk-P27Z66EB.js.map} +0 -0
- /package/dist/{chunk-7MHVHGQZ.js.map → chunk-P2LDXRGP.js.map} +0 -0
- /package/dist/{chunk-6RASM2J4.js.map → chunk-QKVILR7N.js.map} +0 -0
- /package/dist/{chunk-LKBLAUOB.js.map → chunk-QNTEDPWP.js.map} +0 -0
- /package/dist/{chunk-P6UXDALK.js.map → chunk-RDHAGBEB.js.map} +0 -0
- /package/dist/{chunk-XRE4JOEO.js.map → chunk-RTS23VIJ.js.map} +0 -0
- /package/dist/{chunk-5ZPWVNL3.js.map → chunk-S2WKOCTU.js.map} +0 -0
- /package/dist/{chunk-VHEEU4ZO.js.map → chunk-SW56GSYC.js.map} +0 -0
- /package/dist/{chunk-46YGCU6Z.js.map → chunk-T2EGAXPM.js.map} +0 -0
- /package/dist/{chunk-LES2Z7B4.js.map → chunk-T45LAT2Y.js.map} +0 -0
- /package/dist/{chunk-4NMFWOS2.js.map → chunk-T65UZXR6.js.map} +0 -0
- /package/dist/{chunk-2N4MUSF3.js.map → chunk-TB5RNNJ4.js.map} +0 -0
- /package/dist/{chunk-6CNLU4TO.js.map → chunk-TYGW5TOR.js.map} +0 -0
- /package/dist/{chunk-U5DWHU3S.js.map → chunk-U24XHXNK.js.map} +0 -0
- /package/dist/{chunk-YDP2SA5K.js.map → chunk-VPCMJ5Z4.js.map} +0 -0
- /package/dist/{chunk-ZAWD6O46.js.map → chunk-VRPBEOWU.js.map} +0 -0
- /package/dist/{chunk-AY4P6PHN.js.map → chunk-VWGCJUTV.js.map} +0 -0
- /package/dist/{chunk-IIK7W3AN.js.map → chunk-XJR3COJO.js.map} +0 -0
- /package/dist/{chunk-ZD4D7UM6.js.map → chunk-XYYW64LB.js.map} +0 -0
- /package/dist/{chunk-4NZCZUGL.js.map → chunk-YFF2RP3X.js.map} +0 -0
- /package/dist/{chunk-WVIIJPTJ.js.map → chunk-Z3FZC5GV.js.map} +0 -0
- /package/dist/{chunk-55HDKLI3.js.map → chunk-Z5PIUYNB.js.map} +0 -0
- /package/dist/{chunk-ZRDYQZYH.js.map → chunk-Z7KI4WHR.js.map} +0 -0
- /package/dist/{chunk-BV7KNFJY.js.map → chunk-ZBDK7T6X.js.map} +0 -0
- /package/dist/{chunk-P6DN5QU7.js.map → chunk-ZKYMKF2S.js.map} +0 -0
- /package/dist/{chunk-NMRKAGHE.js.map → chunk-ZROMNP7Q.js.map} +0 -0
- /package/dist/{collection-facade-XPVRHBGU.js.map → collection-facade-THH4ASGX.js.map} +0 -0
- /package/dist/{delegation-4HUHUE6T.js.map → computed-BMMEFRFJ.js.map} +0 -0
- /package/dist/{enclave-IS7HZSQ7.js.map → delegation-BQNIEHZE.js.map} +0 -0
- /package/dist/{executor-ANFBCOYA.js.map → enclave-YN6223OG.js.map} +0 -0
- /package/dist/{executor-IKT47SH2.js.map → executor-CBTNU5VZ.js.map} +0 -0
- /package/dist/{executor-OIECZXTV.js.map → executor-DJHNSTIR.js.map} +0 -0
- /package/dist/{export-accessible-NZWCFZHL.js.map → executor-FGISLQIN.js.map} +0 -0
- /package/dist/{extract-partition-52LX6RQH.js.map → export-accessible-P7SLRLK3.js.map} +0 -0
- /package/dist/{issue-F4SYPJGJ.js.map → extract-partition-6JGY3KYR.js.map} +0 -0
- /package/dist/{ledger-YUAJUNFP.js.map → find-RNBG7LBY.js.map} +0 -0
- /package/dist/{liberate-6LDETRIW.js.map → issue-W5QG53B5.js.map} +0 -0
- /package/dist/{noydb-WQNBVJIG.js.map → lazy/index.js.map} +0 -0
- /package/dist/{policy-LRE6HTO5.js.map → ledger-KZWBKAG5.js.map} +0 -0
- /package/dist/{public-envelope-WVRRUVAJ.js.map → liberate-AQ7OWBZZ.js.map} +0 -0
- /package/dist/{registry-6HZ2JSQ7.js.map → link-set-UQEIYQAM.js.map} +0 -0
- /package/dist/{registry-GPXZQ7DT.js.map → noydb-WQZNAECY.js.map} +0 -0
- /package/dist/{registry-USYD2ECC.js.map → policy-YIKUH4AD.js.map} +0 -0
- /package/dist/{request-withdrawal-54V4L6CR.js.map → public-envelope-MRN5YYZZ.js.map} +0 -0
- /package/dist/{revoke-JV26NTQD.js.map → register-V5AQTXNI.js.map} +0 -0
- /package/dist/{signer-AE56T5HE.js.map → registry-IMNMHWTM.js.map} +0 -0
- /package/dist/{stale-LX4BR43V.js.map → registry-K6VUQXKV.js.map} +0 -0
- /package/dist/{withdraw-accessible-DGA4V2TP.js.map → registry-ZVO3T4M5.js.map} +0 -0
- /package/dist/{store-coordination-provider-KTRIC6PR.js.map → store-coordination-provider-JJCEMTAE.js.map} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/with-shape/classified/descriptor.ts","../src/with-shape/classified/errors.ts","../src/with-shape/classified/resolve.ts","../src/with-shape/classified/write.ts","../src/with-shape/classified/strategy.ts"],"sourcesContent":["/**\n * Classified fields — behavioral sensitive-field descriptors (stage 1).\n * Design: docs/superpowers/specs/2026-07-04-classified-fields-design.md\n * Law: open on write, declarative on read — read-side behavior is this\n * closed vocabulary; there are no read-side callbacks.\n * @module\n */\n\nexport type ClassifiedStorage = 'recoverable' | 'never' | 'digest-only'\n\nexport type ClassifiedList =\n | { readonly kind: 'omit' }\n | { readonly kind: 'mask'; readonly pattern: string }\n | { readonly kind: 'rider'; readonly rider: string }\n\nexport type ClassifiedRider = (value: unknown) => unknown\n\nexport interface ClassifiedFieldSpec {\n readonly _noydbClassified: true\n readonly preset: string\n readonly storage: ClassifiedStorage\n readonly list: ClassifiedList\n readonly sensitivity: 'pii' | 'secret'\n /** Write-time safe projections; companion field name is `<field>_<rider>`. */\n readonly riders?: Record<string, ClassifiedRider>\n /** Write-time validator: error message, or null when valid. */\n readonly validate?: (value: unknown) => string | null\n /** Digest-only verify policy (stage 2). Mode both sides normalize under. */\n readonly verifyNormalize?: 'password' | 'secret-answer'\n /** Decorate ok:true verdicts with mustRotate after this many days (I1). */\n readonly rotateDays?: number\n /** Refuse reuse of the last N values on rotate (cap 8, spec Q4). */\n readonly notLastN?: number\n /** Member of the collection's matchGroup (secretAnswer preset). */\n readonly verifyGroupMember?: true\n /**\n * Opt into a store-visible blind-index (`_bidx`) tag so equal values become\n * queryable/joinable while staying digest-only. Digest-only knob (R7); gated\n * behind the collection's `acknowledgeEquatableRisk` door (R8). Equal values\n * produce equal tags — a partition leak a DEK holder can offline-dictionary\n * at the PBKDF2 floor. Absent/false ⇒ refused-by-default.\n */\n readonly equatable?: true\n}\n\nexport interface ClassifiedGroup {\n readonly _noydbClassifiedGroup: true\n readonly preset: string\n /** member record-field name -> spec (differential per-member policy). */\n readonly members: Record<string, ClassifiedFieldSpec>\n}\n\nexport type ClassifiedEntry = ClassifiedFieldSpec | ClassifiedGroup\n\nexport function isClassifiedFieldSpec(x: unknown): x is ClassifiedFieldSpec {\n return typeof x === 'object' && x !== null\n && (x as { _noydbClassified?: unknown })._noydbClassified === true\n}\n\nexport function isClassifiedGroup(x: unknown): x is ClassifiedGroup {\n return typeof x === 'object' && x !== null\n && (x as { _noydbClassifiedGroup?: unknown })._noydbClassifiedGroup === true\n}\n","/**\n * Configuration/write errors for classified fields. @module\n *\n * `ClassifiedConfigError` / `ClassifiedRevealError` moved to `kernel/errors.ts`\n * (stage 2) so `kernel/enclave/classify/*` can throw them without importing\n * with-*. Re-exported here under the same names so existing import paths\n * keep working.\n */\nexport { ClassifiedConfigError, ClassifiedRevealError, ClassifiedVerifyError, ClassifiedRotationError } from '../../kernel/errors.js'\n\nexport class ClassifiedNeverStoredError extends Error {\n constructor(public readonly collection: string, public readonly field: string) {\n super(`Field \"${field}\" in collection \"${collection}\" is classified storage:'never' `\n + `(e.g. a CVC) and must not be persisted. Validate it at capture and drop it before put().`)\n this.name = 'ClassifiedNeverStoredError'\n }\n}\n\nexport class ClassifiedValidationError extends Error {\n constructor(public readonly collection: string, public readonly field: string, detail: string) {\n super(`Classified field \"${field}\" in collection \"${collection}\" failed validation: ${detail}`)\n this.name = 'ClassifiedValidationError'\n }\n}\n","/** Flatten a classifiedFields config into a per-field map + rider computed entries. @module */\n\nimport { isClassifiedGroup, type ClassifiedEntry, type ClassifiedFieldSpec } from './descriptor.js'\nimport { ClassifiedConfigError } from './errors.js'\n\nexport type { ClassifiedEntry, ClassifiedFieldSpec, ClassifiedGroup, ClassifiedList } from './descriptor.js'\nexport { ClassifiedConfigError } from './errors.js'\n\nexport interface ResolvedClassified {\n readonly byField: Record<string, ClassifiedFieldSpec>\n readonly riderComputed: Record<string, (record: Record<string, unknown>) => unknown>\n}\n\nexport function resolveClassifiedFields(\n collection: string,\n config: Record<string, ClassifiedEntry>,\n): ResolvedClassified {\n const byField: Record<string, ClassifiedFieldSpec> = {}\n const claim = (field: string, spec: ClassifiedFieldSpec): void => {\n if (byField[field] !== undefined) {\n throw new ClassifiedConfigError(collection,\n `field \"${field}\" is claimed twice — storage forms are mutually exclusive per field (R5): ` +\n `a field is digest-only OR recoverable OR never, exactly one`)\n }\n byField[field] = spec\n }\n for (const [key, entry] of Object.entries(config)) {\n if (isClassifiedGroup(entry)) {\n for (const [field, spec] of Object.entries(entry.members)) claim(field, spec)\n } else {\n claim(key, entry)\n }\n }\n const riderComputed: Record<string, (record: Record<string, unknown>) => unknown> = {}\n for (const [field, spec] of Object.entries(byField)) {\n for (const [name, rider] of Object.entries(spec.riders ?? {})) {\n const companion = `${field}_${name}`\n if (byField[companion] !== undefined || riderComputed[companion] !== undefined) {\n throw new ClassifiedConfigError(collection, `rider companion \"${companion}\" collides with a declared field`)\n }\n riderComputed[companion] = (record) =>\n record[field] === undefined ? undefined : rider(record[field])\n }\n }\n return { byField, riderComputed }\n}\n","/** Write-path enforcement: storage:'never' rejection + preset validators.\n * Runs BEFORE riders/computed and BEFORE schema validation. Pure. @module */\n\nimport type { ClassifiedFieldSpec } from './descriptor.js'\nimport { ClassifiedNeverStoredError, ClassifiedValidationError } from './errors.js'\n\nexport function enforceClassifiedWrite(\n record: Record<string, unknown>,\n byField: Record<string, ClassifiedFieldSpec>,\n collection: string,\n): void {\n for (const [field, spec] of Object.entries(byField)) {\n const value = record[field]\n if (value === undefined) continue\n if (value === null && spec.storage === 'digest-only') continue // explicit clear (C6 branch 3)\n if (spec.storage === 'never') throw new ClassifiedNeverStoredError(collection, field)\n const problem = spec.validate?.(value) ?? null\n if (problem !== null) throw new ClassifiedValidationError(collection, field, problem)\n }\n}\n","/** The ② capability seam for classified read-egress ops (stage 1: reveal; stage 2: verify). @module */\nimport type { ClassifiedFieldSpec } from './descriptor.js'\nimport { ClassifiedNotEnabledError } from '../../kernel/errors.js'\nimport type { EncryptedEnvelope } from '../../kernel/types.js'\nimport type { EnclaveKey } from '../../kernel/enclave/index.js'\n\nexport type { ClassifiedVerdict } from '../../kernel/types.js'\nimport type { ClassifiedVerdict } from '../../kernel/types.js'\n\nexport interface ClassifiedRevealCtx {\n readonly collection: string\n readonly spec: ClassifiedFieldSpec\n /** True on an encrypted collection — false selects the plaintext-body read. */\n readonly encrypted: boolean\n readonly getEnvelope: (id: string) => Promise<EncryptedEnvelope | null>\n readonly resolveCek: (env: EncryptedEnvelope) => Promise<EnclaveKey | undefined>\n readonly getDEK: () => Promise<EnclaveKey>\n readonly onAccess?: ((op: 'reveal', id: string) => Promise<void>) | undefined\n}\n\nexport interface ClassifiedVerifyCtx {\n readonly collection: string\n readonly spec: ClassifiedFieldSpec\n readonly getEnvelope: (id: string) => Promise<EncryptedEnvelope | null> // raw envelope, NOT a decrypted view\n readonly resolveCek: (env: EncryptedEnvelope) => Promise<EnclaveKey | undefined>\n readonly getDEK: () => Promise<EnclaveKey>\n readonly now: () => number // injected (Q7)\n /** Group members resolved by the collection (matchGroup only). */\n readonly groupMembers?: ReadonlyArray<{ readonly field: string; readonly spec: ClassifiedFieldSpec }>\n readonly onAccess?: ((op: 'verify' | 'find', id: string) => Promise<void>) | undefined\n}\n\nexport interface ClassifiedStrategy {\n reveal(ctx: ClassifiedRevealCtx, id: string, field: string): Promise<unknown>\n verify(ctx: ClassifiedVerifyCtx, id: string, field: string, candidate: string): Promise<ClassifiedVerdict>\n verifyText(ctx: ClassifiedVerifyCtx, id: string, field: string, candidate: string): Promise<ClassifiedVerdict>\n matchGroup(ctx: ClassifiedVerifyCtx, id: string, answers: Record<string, string>,\n opts: { readonly min: number }): Promise<{ readonly passed: boolean }>\n computeTarget(ctx: ClassifiedVerifyCtx, field: string, candidate: string, costByte?: number): Promise<string | null>\n}\n\nexport const NO_CLASSIFIED: ClassifiedStrategy = {\n async reveal() { throw new ClassifiedNotEnabledError() },\n async verify() { throw new ClassifiedNotEnabledError() },\n async verifyText() { throw new ClassifiedNotEnabledError() },\n async matchGroup() { throw new ClassifiedNotEnabledError() },\n async computeTarget() { throw new ClassifiedNotEnabledError() },\n}\n"],"mappings":";;;;;;AAsDO,SAAS,sBAAsB,GAAsC;AAC1E,SAAO,OAAO,MAAM,YAAY,MAAM,QAChC,EAAqC,qBAAqB;AAClE;AAEO,SAAS,kBAAkB,GAAkC;AAClE,SAAO,OAAO,MAAM,YAAY,MAAM,QAChC,EAA0C,0BAA0B;AAC5E;;;ACpDO,IAAM,6BAAN,cAAyC,MAAM;AAAA,EACpD,YAA4B,YAAoC,OAAe;AAC7E,UAAM,UAAU,KAAK,oBAAoB,UAAU,0HAC2C;AAFpE;AAAoC;AAG9D,SAAK,OAAO;AAAA,EACd;AAAA,EAJ4B;AAAA,EAAoC;AAKlE;AAEO,IAAM,4BAAN,cAAwC,MAAM;AAAA,EACnD,YAA4B,YAAoC,OAAe,QAAgB;AAC7F,UAAM,qBAAqB,KAAK,oBAAoB,UAAU,wBAAwB,MAAM,EAAE;AADpE;AAAoC;AAE9D,SAAK,OAAO;AAAA,EACd;AAAA,EAH4B;AAAA,EAAoC;AAIlE;;;ACVO,SAAS,wBACd,YACA,QACoB;AACpB,QAAM,UAA+C,CAAC;AACtD,QAAM,QAAQ,CAAC,OAAe,SAAoC;AAChE,QAAI,QAAQ,KAAK,MAAM,QAAW;AAChC,YAAM,IAAI;AAAA,QAAsB;AAAA,QAC9B,UAAU,KAAK;AAAA,MAC8C;AAAA,IACjE;AACA,YAAQ,KAAK,IAAI;AAAA,EACnB;AACA,aAAW,CAAC,KAAK,KAAK,KAAK,OAAO,QAAQ,MAAM,GAAG;AACjD,QAAI,kBAAkB,KAAK,GAAG;AAC5B,iBAAW,CAAC,OAAO,IAAI,KAAK,OAAO,QAAQ,MAAM,OAAO,EAAG,OAAM,OAAO,IAAI;AAAA,IAC9E,OAAO;AACL,YAAM,KAAK,KAAK;AAAA,IAClB;AAAA,EACF;AACA,QAAM,gBAA8E,CAAC;AACrF,aAAW,CAAC,OAAO,IAAI,KAAK,OAAO,QAAQ,OAAO,GAAG;AACnD,eAAW,CAAC,MAAM,KAAK,KAAK,OAAO,QAAQ,KAAK,UAAU,CAAC,CAAC,GAAG;AAC7D,YAAM,YAAY,GAAG,KAAK,IAAI,IAAI;AAClC,UAAI,QAAQ,SAAS,MAAM,UAAa,cAAc,SAAS,MAAM,QAAW;AAC9E,cAAM,IAAI,sBAAsB,YAAY,oBAAoB,SAAS,kCAAkC;AAAA,MAC7G;AACA,oBAAc,SAAS,IAAI,CAAC,WAC1B,OAAO,KAAK,MAAM,SAAY,SAAY,MAAM,OAAO,KAAK,CAAC;AAAA,IACjE;AAAA,EACF;AACA,SAAO,EAAE,SAAS,cAAc;AAClC;;;ACvCO,SAAS,uBACd,QACA,SACA,YACM;AACN,aAAW,CAAC,OAAO,IAAI,KAAK,OAAO,QAAQ,OAAO,GAAG;AACnD,UAAM,QAAQ,OAAO,KAAK;AAC1B,QAAI,UAAU,OAAW;AACzB,QAAI,UAAU,QAAQ,KAAK,YAAY,cAAe;AACtD,QAAI,KAAK,YAAY,QAAS,OAAM,IAAI,2BAA2B,YAAY,KAAK;AACpF,UAAM,UAAU,KAAK,WAAW,KAAK,KAAK;AAC1C,QAAI,YAAY,KAAM,OAAM,IAAI,0BAA0B,YAAY,OAAO,OAAO;AAAA,EACtF;AACF;;;ACsBO,IAAM,gBAAoC;AAAA,EAC/C,MAAM,SAAS;AAAE,UAAM,IAAI,0BAA0B;AAAA,EAAE;AAAA,EACvD,MAAM,SAAS;AAAE,UAAM,IAAI,0BAA0B;AAAA,EAAE;AAAA,EACvD,MAAM,aAAa;AAAE,UAAM,IAAI,0BAA0B;AAAA,EAAE;AAAA,EAC3D,MAAM,aAAa;AAAE,UAAM,IAAI,0BAA0B;AAAA,EAAE;AAAA,EAC3D,MAAM,gBAAgB;AAAE,UAAM,IAAI,0BAA0B;AAAA,EAAE;AAChE;","names":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
readPath
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-ZKF6HH7V.js";
|
|
4
4
|
|
|
5
5
|
// src/with-lookup/indexing/eager-indexes.ts
|
|
6
6
|
var CollectionIndexes = class {
|
|
@@ -129,4 +129,4 @@ function removeFromIndex(idx, id, record) {
|
|
|
129
129
|
export {
|
|
130
130
|
CollectionIndexes
|
|
131
131
|
};
|
|
132
|
-
//# sourceMappingURL=chunk-
|
|
132
|
+
//# sourceMappingURL=chunk-BKGIWGCX.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
TierNotGrantedError
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-U23JUUPX.js";
|
|
4
4
|
|
|
5
5
|
// src/with-party/team/tiers.ts
|
|
6
6
|
function dekKey(collection, tier) {
|
|
@@ -31,4 +31,4 @@ export {
|
|
|
31
31
|
effectiveClearance,
|
|
32
32
|
assertTierAccess
|
|
33
33
|
};
|
|
34
|
-
//# sourceMappingURL=chunk-
|
|
34
|
+
//# sourceMappingURL=chunk-BMQOH7MM.js.map
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
pickLocale
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-3QRQOBS7.js";
|
|
4
4
|
import {
|
|
5
5
|
sha256Hex
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-TLJOJBZD.js";
|
|
7
7
|
import {
|
|
8
8
|
BundleIntegrityError,
|
|
9
9
|
BundleSealMismatchError,
|
|
10
10
|
ValidationError
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-U23JUUPX.js";
|
|
12
12
|
|
|
13
13
|
// src/with-pod/format.ts
|
|
14
14
|
var NOYDB_BUNDLE_MAGIC = new Uint8Array([78, 68, 66, 49]);
|
|
@@ -795,4 +795,4 @@ export {
|
|
|
795
795
|
readPod,
|
|
796
796
|
readNoydbBundle
|
|
797
797
|
};
|
|
798
|
-
//# sourceMappingURL=chunk-
|
|
798
|
+
//# sourceMappingURL=chunk-EWR7HL3K.js.map
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
wrapDbWithPredicates
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-LIP6JWYK.js";
|
|
4
4
|
import {
|
|
5
5
|
canonicalGroupKey,
|
|
6
6
|
groupAndReduce
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-P5WXDYMD.js";
|
|
8
8
|
import {
|
|
9
9
|
applyI18nLocale
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-4K3MQ5S3.js";
|
|
11
11
|
import {
|
|
12
12
|
LocaleNotSpecifiedError,
|
|
13
13
|
MaterializedViewTooLargeError
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-U23JUUPX.js";
|
|
15
15
|
|
|
16
16
|
// src/with-formula/materialized-views/executor.ts
|
|
17
17
|
var DEFAULT_MAX_ROWS = 1e5;
|
|
@@ -178,4 +178,4 @@ async function listOutputIds(outputColl) {
|
|
|
178
178
|
export {
|
|
179
179
|
MaterializedViewExecutor
|
|
180
180
|
};
|
|
181
|
-
//# sourceMappingURL=chunk-
|
|
181
|
+
//# sourceMappingURL=chunk-FH52CDEW.js.map
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import {
|
|
2
|
+
linkCollectionName,
|
|
3
|
+
linkRowKey
|
|
4
|
+
} from "./chunk-P3NGV5RV.js";
|
|
5
|
+
import {
|
|
6
|
+
openEnvelopeJson
|
|
7
|
+
} from "./chunk-OVO2RZAE.js";
|
|
8
|
+
import {
|
|
9
|
+
NOYDB_FORMAT_VERSION
|
|
10
|
+
} from "./chunk-LN22XH4B.js";
|
|
11
|
+
import {
|
|
12
|
+
encrypt
|
|
13
|
+
} from "./chunk-TLJOJBZD.js";
|
|
14
|
+
import {
|
|
15
|
+
NoydbError
|
|
16
|
+
} from "./chunk-U23JUUPX.js";
|
|
17
|
+
|
|
18
|
+
// src/with-shape/links/link-set.ts
|
|
19
|
+
var LinkSet = class {
|
|
20
|
+
constructor(adapter, vault, name, spec, encrypted, getDEK, actor, emitter, endpointExists) {
|
|
21
|
+
this.adapter = adapter;
|
|
22
|
+
this.vault = vault;
|
|
23
|
+
this.name = name;
|
|
24
|
+
this.spec = spec;
|
|
25
|
+
this.encrypted = encrypted;
|
|
26
|
+
this.getDEK = getDEK;
|
|
27
|
+
this.actor = actor;
|
|
28
|
+
this.emitter = emitter;
|
|
29
|
+
this.endpointExists = endpointExists;
|
|
30
|
+
this.collName = linkCollectionName(name);
|
|
31
|
+
}
|
|
32
|
+
adapter;
|
|
33
|
+
vault;
|
|
34
|
+
name;
|
|
35
|
+
spec;
|
|
36
|
+
encrypted;
|
|
37
|
+
getDEK;
|
|
38
|
+
actor;
|
|
39
|
+
emitter;
|
|
40
|
+
endpointExists;
|
|
41
|
+
collName;
|
|
42
|
+
dekPromise = null;
|
|
43
|
+
dek() {
|
|
44
|
+
if (!this.dekPromise) this.dekPromise = this.getDEK(this.collName);
|
|
45
|
+
return this.dekPromise;
|
|
46
|
+
}
|
|
47
|
+
async encryptEntry(entry, version) {
|
|
48
|
+
const json = JSON.stringify(entry);
|
|
49
|
+
const base = { _noydb: NOYDB_FORMAT_VERSION, _v: version, _ts: (/* @__PURE__ */ new Date()).toISOString(), _by: this.actor };
|
|
50
|
+
if (!this.encrypted) return { ...base, _iv: "", _data: json };
|
|
51
|
+
const { iv, data } = await encrypt(json, await this.dek());
|
|
52
|
+
return { ...base, _iv: iv, _data: data };
|
|
53
|
+
}
|
|
54
|
+
async decryptEntry(env) {
|
|
55
|
+
const json = this.encrypted ? await openEnvelopeJson(env, await this.dek()) : env._data;
|
|
56
|
+
return JSON.parse(json);
|
|
57
|
+
}
|
|
58
|
+
async connect(aId, bId, meta) {
|
|
59
|
+
if (!await this.endpointExists(this.spec.a, aId)) {
|
|
60
|
+
throw new LinkEndpointError(this.name, this.spec.a, aId);
|
|
61
|
+
}
|
|
62
|
+
if (!await this.endpointExists(this.spec.b, bId)) {
|
|
63
|
+
throw new LinkEndpointError(this.name, this.spec.b, bId);
|
|
64
|
+
}
|
|
65
|
+
const key = linkRowKey(aId, bId);
|
|
66
|
+
const entry = meta !== void 0 ? { a: aId, b: bId, meta } : { a: aId, b: bId };
|
|
67
|
+
const existing = await this.adapter.get(this.vault, this.collName, key);
|
|
68
|
+
const env = await this.encryptEntry(entry, (existing?._v ?? 0) + 1);
|
|
69
|
+
await this.adapter.put(this.vault, this.collName, key, env, existing?._v);
|
|
70
|
+
this.emitter.emit("change", { vault: this.vault, collection: this.collName, id: key, action: "put" });
|
|
71
|
+
}
|
|
72
|
+
async disconnect(aId, bId) {
|
|
73
|
+
const key = linkRowKey(aId, bId);
|
|
74
|
+
const existing = await this.adapter.get(this.vault, this.collName, key);
|
|
75
|
+
if (!existing) return;
|
|
76
|
+
await this.adapter.delete(this.vault, this.collName, key);
|
|
77
|
+
this.emitter.emit("change", { vault: this.vault, collection: this.collName, id: key, action: "delete" });
|
|
78
|
+
}
|
|
79
|
+
async has(aId, bId) {
|
|
80
|
+
return await this.adapter.get(this.vault, this.collName, linkRowKey(aId, bId)) !== null;
|
|
81
|
+
}
|
|
82
|
+
async of(id) {
|
|
83
|
+
const rows = await this.list();
|
|
84
|
+
return rows.filter((r) => r.a === id || r.b === id);
|
|
85
|
+
}
|
|
86
|
+
async list() {
|
|
87
|
+
const keys = await this.adapter.list(this.vault, this.collName);
|
|
88
|
+
const out = [];
|
|
89
|
+
for (const key of keys) {
|
|
90
|
+
const env = await this.adapter.get(this.vault, this.collName, key);
|
|
91
|
+
if (!env) continue;
|
|
92
|
+
const e = await this.decryptEntry(env);
|
|
93
|
+
out.push(e.meta !== void 0 ? { a: e.a, b: e.b, meta: e.meta } : { a: e.a, b: e.b });
|
|
94
|
+
}
|
|
95
|
+
return out;
|
|
96
|
+
}
|
|
97
|
+
// ── Vault-internal cascade helpers ──────────────────────────────────
|
|
98
|
+
/** @internal — rows where the deleted endpoint id matches the relevant slot. */
|
|
99
|
+
async _rowsTouchingEndpoint(collection, id) {
|
|
100
|
+
const rows = await this.list();
|
|
101
|
+
return rows.filter(
|
|
102
|
+
(r) => this.spec.a === collection && r.a === id || this.spec.b === collection && r.b === id
|
|
103
|
+
);
|
|
104
|
+
}
|
|
105
|
+
/** @internal — the storage collection name (for tx pre-image capture). */
|
|
106
|
+
get _collectionName() {
|
|
107
|
+
return this.collName;
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
var LinkEndpointError = class extends NoydbError {
|
|
111
|
+
link;
|
|
112
|
+
endpoint;
|
|
113
|
+
missingId;
|
|
114
|
+
constructor(link, endpoint, missingId) {
|
|
115
|
+
super(
|
|
116
|
+
"LINK_ENDPOINT",
|
|
117
|
+
`link("${link}").connect: endpoint "${endpoint}" has no record "${missingId}".`
|
|
118
|
+
);
|
|
119
|
+
this.name = "LinkEndpointError";
|
|
120
|
+
this.link = link;
|
|
121
|
+
this.endpoint = endpoint;
|
|
122
|
+
this.missingId = missingId;
|
|
123
|
+
}
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
export {
|
|
127
|
+
LinkSet,
|
|
128
|
+
LinkEndpointError
|
|
129
|
+
};
|
|
130
|
+
//# sourceMappingURL=chunk-G4MGYGSS.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/with-shape/links/link-set.ts"],"sourcesContent":["/**\n * `_links_*` reserved collections — managed bidirectional many-to-many\n * junctions (design B).\n *\n * Where `refArray` (design A) stores an id-array on one owning record,\n * `vault.link()` creates a first-class junction: a dedicated encrypted\n * `_links_<name>` collection whose rows are `{ a, b, meta? }` link tuples.\n * It is queryable from BOTH sides (`of(id)`), carries optional per-link\n * metadata, and cascades on endpoint delete.\n *\n * Each link is slot-typed: `a` is an id in the `a` endpoint collection,\n * `b` an id in the `b` endpoint collection (they may be the same\n * collection for self-links). A link's identity is the ordered pair\n * `(a, b)`; `of(id)` matches either slot.\n *\n * Rows are encrypted under a dedicated `_links_<name>` DEK — same\n * zero-knowledge stack as every other collection (the store sees only\n * ciphertext). Backup/restore rides the normal `loadAll` path.\n */\n\nimport type { NoydbStore, EncryptedEnvelope } from '../../kernel/types.js'\nimport type { NoydbEventEmitter } from '../../kernel/events.js'\nimport { NOYDB_FORMAT_VERSION } from '../../kernel/types.js'\nimport { encrypt, openEnvelopeJson, type EnclaveKey } from '../../kernel/enclave/index.js'\nimport { NoydbError } from '../../kernel/errors.js'\n\n// Naming helpers, declaration types, and LinkIntegrityError live in\n// `names.ts` (the always-loadable slice — #553); re-exported here so\n// existing import paths and the root barrel are unchanged.\nexport {\n LINK_COLLECTION_PREFIX,\n linkCollectionName,\n isLinkCollectionName,\n linkRowKey,\n LinkIntegrityError,\n} from './names.js'\nexport type { LinkOnDelete, LinkSpec, LinkRow, LinkSetHandle } from './names.js'\nimport { linkCollectionName, linkRowKey } from './names.js'\nimport type { LinkSpec, LinkRow, LinkSetHandle } from './names.js'\n\n/** Stored form (also the row key derivation source). */\ninterface LinkEntry {\n a: string\n b: string\n meta?: Record<string, unknown>\n}\n\n/**\n * @internal — the concrete handle. The Vault owns construction (one per\n * link name) and the cascade hooks; consumers use the {@link LinkSetHandle}\n * surface via `vault.links(name)`.\n */\nexport class LinkSet implements LinkSetHandle {\n private readonly collName: string\n private dekPromise: Promise<EnclaveKey> | null = null\n\n constructor(\n private readonly adapter: NoydbStore,\n private readonly vault: string,\n private readonly name: string,\n private readonly spec: LinkSpec,\n private readonly encrypted: boolean,\n private readonly getDEK: (collectionName: string) => Promise<EnclaveKey>,\n private readonly actor: string,\n private readonly emitter: NoydbEventEmitter,\n /** Vault-provided existence check for endpoint validation on connect(). */\n private readonly endpointExists: (collection: string, id: string) => Promise<boolean>,\n ) {\n this.collName = linkCollectionName(name)\n }\n\n private dek(): Promise<EnclaveKey> {\n if (!this.dekPromise) this.dekPromise = this.getDEK(this.collName)\n return this.dekPromise\n }\n\n private async encryptEntry(entry: LinkEntry, version: number): Promise<EncryptedEnvelope> {\n const json = JSON.stringify(entry)\n const base = { _noydb: NOYDB_FORMAT_VERSION, _v: version, _ts: new Date().toISOString(), _by: this.actor }\n if (!this.encrypted) return { ...base, _iv: '', _data: json }\n const { iv, data } = await encrypt(json, await this.dek())\n return { ...base, _iv: iv, _data: data }\n }\n\n private async decryptEntry(env: EncryptedEnvelope): Promise<LinkEntry> {\n const json = this.encrypted ? await openEnvelopeJson(env, await this.dek()) : env._data\n return JSON.parse(json) as LinkEntry\n }\n\n async connect(aId: string, bId: string, meta?: Record<string, unknown>): Promise<void> {\n if (!(await this.endpointExists(this.spec.a, aId))) {\n throw new LinkEndpointError(this.name, this.spec.a, aId)\n }\n if (!(await this.endpointExists(this.spec.b, bId))) {\n throw new LinkEndpointError(this.name, this.spec.b, bId)\n }\n const key = linkRowKey(aId, bId)\n const entry: LinkEntry = meta !== undefined ? { a: aId, b: bId, meta } : { a: aId, b: bId }\n const existing = await this.adapter.get(this.vault, this.collName, key)\n const env = await this.encryptEntry(entry, (existing?._v ?? 0) + 1)\n await this.adapter.put(this.vault, this.collName, key, env, existing?._v)\n this.emitter.emit('change', { vault: this.vault, collection: this.collName, id: key, action: 'put' })\n }\n\n async disconnect(aId: string, bId: string): Promise<void> {\n const key = linkRowKey(aId, bId)\n const existing = await this.adapter.get(this.vault, this.collName, key)\n if (!existing) return\n await this.adapter.delete(this.vault, this.collName, key)\n this.emitter.emit('change', { vault: this.vault, collection: this.collName, id: key, action: 'delete' })\n }\n\n async has(aId: string, bId: string): Promise<boolean> {\n return (await this.adapter.get(this.vault, this.collName, linkRowKey(aId, bId))) !== null\n }\n\n async of(id: string): Promise<LinkRow[]> {\n const rows = await this.list()\n return rows.filter((r) => r.a === id || r.b === id)\n }\n\n async list(): Promise<LinkRow[]> {\n const keys = await this.adapter.list(this.vault, this.collName)\n const out: LinkRow[] = []\n for (const key of keys) {\n const env = await this.adapter.get(this.vault, this.collName, key)\n if (!env) continue\n const e = await this.decryptEntry(env)\n out.push(e.meta !== undefined ? { a: e.a, b: e.b, meta: e.meta } : { a: e.a, b: e.b })\n }\n return out\n }\n\n // ── Vault-internal cascade helpers ──────────────────────────────────\n\n /** @internal — rows where the deleted endpoint id matches the relevant slot. */\n async _rowsTouchingEndpoint(collection: string, id: string): Promise<LinkRow[]> {\n const rows = await this.list()\n return rows.filter(\n (r) => (this.spec.a === collection && r.a === id) || (this.spec.b === collection && r.b === id),\n )\n }\n\n /** @internal — the storage collection name (for tx pre-image capture). */\n get _collectionName(): string {\n return this.collName\n }\n}\n\n/** Thrown by `connect()` when an endpoint record does not exist. */\nexport class LinkEndpointError extends NoydbError {\n readonly link: string\n readonly endpoint: string\n readonly missingId: string\n constructor(link: string, endpoint: string, missingId: string) {\n super(\n 'LINK_ENDPOINT',\n `link(\"${link}\").connect: endpoint \"${endpoint}\" has no record \"${missingId}\".`,\n )\n this.name = 'LinkEndpointError'\n this.link = link\n this.endpoint = endpoint\n this.missingId = missingId\n }\n}\n"],"mappings":"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","names":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
SealedRecordNotEnabledError
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-U23JUUPX.js";
|
|
4
4
|
|
|
5
5
|
// src/with-audit/sealed-record/strategy.ts
|
|
6
6
|
var NO_SEALED_RECORD = {
|
|
@@ -18,4 +18,4 @@ var NO_SEALED_RECORD = {
|
|
|
18
18
|
export {
|
|
19
19
|
NO_SEALED_RECORD
|
|
20
20
|
};
|
|
21
|
-
//# sourceMappingURL=chunk-
|
|
21
|
+
//# sourceMappingURL=chunk-G7RDYYTE.js.map
|
|
@@ -1,26 +1,21 @@
|
|
|
1
1
|
import {
|
|
2
|
-
reducerBuilder
|
|
3
|
-
|
|
4
|
-
} from "./chunk-NPVICKZE.js";
|
|
2
|
+
reducerBuilder
|
|
3
|
+
} from "./chunk-P5WXDYMD.js";
|
|
5
4
|
import {
|
|
6
|
-
MoneyPrecisionError,
|
|
7
5
|
evaluateClause,
|
|
8
|
-
formatScaledInt,
|
|
9
6
|
hasFnClause,
|
|
10
|
-
|
|
11
|
-
parseToScaledInt,
|
|
7
|
+
moneyRuntime,
|
|
12
8
|
readPath
|
|
13
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-ZKF6HH7V.js";
|
|
14
10
|
import {
|
|
15
11
|
applyI18nLocale
|
|
16
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-4K3MQ5S3.js";
|
|
17
13
|
import {
|
|
18
14
|
CrossJoinSourceUnknownError,
|
|
19
15
|
CrossJoinTooLargeError,
|
|
20
16
|
DanglingReferenceError,
|
|
21
|
-
JoinTooLargeError
|
|
22
|
-
|
|
23
|
-
} from "./chunk-BLZRNHMG.js";
|
|
17
|
+
JoinTooLargeError
|
|
18
|
+
} from "./chunk-U23JUUPX.js";
|
|
24
19
|
|
|
25
20
|
// src/kernel/query/join.ts
|
|
26
21
|
var DEFAULT_JOIN_MAX_ROWS = 5e4;
|
|
@@ -271,277 +266,6 @@ var NO_AGGREGATE = {
|
|
|
271
266
|
}
|
|
272
267
|
};
|
|
273
268
|
|
|
274
|
-
// src/with-shape/money/paths.ts
|
|
275
|
-
var SEGMENT_RE = /^(\*|[^.[\]*]+)(\[\])?$/;
|
|
276
|
-
var parseCache = /* @__PURE__ */ new Map();
|
|
277
|
-
function parseMoneyPath(path) {
|
|
278
|
-
const cached = parseCache.get(path);
|
|
279
|
-
if (cached) return cached;
|
|
280
|
-
if (typeof path !== "string" || path.length === 0) {
|
|
281
|
-
throw new ValidationError("moneyFields: path must be a non-empty string");
|
|
282
|
-
}
|
|
283
|
-
const segments = [];
|
|
284
|
-
for (const part of path.split(".")) {
|
|
285
|
-
const m = SEGMENT_RE.exec(part);
|
|
286
|
-
if (!m) {
|
|
287
|
-
throw new ValidationError(
|
|
288
|
-
`moneyFields: invalid path "${path}" \u2014 segment "${part}" must be a key, "key[]", "*", or "*[]"`
|
|
289
|
-
);
|
|
290
|
-
}
|
|
291
|
-
const array = m[2] === "[]";
|
|
292
|
-
segments.push(
|
|
293
|
-
m[1] === "*" ? { kind: "wildcard", array } : { kind: "key", key: m[1], array }
|
|
294
|
-
);
|
|
295
|
-
}
|
|
296
|
-
parseCache.set(path, segments);
|
|
297
|
-
return segments;
|
|
298
|
-
}
|
|
299
|
-
function isSimpleMoneyPath(path) {
|
|
300
|
-
return !path.includes(".") && !path.includes("[") && !path.includes("*");
|
|
301
|
-
}
|
|
302
|
-
function validateMoneyFieldPaths(moneyFields) {
|
|
303
|
-
for (const path of Object.keys(moneyFields)) parseMoneyPath(path);
|
|
304
|
-
}
|
|
305
|
-
function transformAtMoneyPath(node, path, segments, index, visit, lenient) {
|
|
306
|
-
if (node === null || node === void 0) return node;
|
|
307
|
-
const seg = segments[index];
|
|
308
|
-
const last = index === segments.length - 1;
|
|
309
|
-
if (seg.kind === "key") {
|
|
310
|
-
if (typeof node !== "object" || Array.isArray(node)) {
|
|
311
|
-
if (lenient) return node;
|
|
312
|
-
throw new ValidationError(
|
|
313
|
-
`moneyFields: path "${path}" expected an object at segment "${seg.key}", got ${Array.isArray(node) ? "an array" : typeof node}`
|
|
314
|
-
);
|
|
315
|
-
}
|
|
316
|
-
const obj2 = node;
|
|
317
|
-
if (!(seg.key in obj2) || obj2[seg.key] === null || obj2[seg.key] === void 0) return node;
|
|
318
|
-
if (seg.array) {
|
|
319
|
-
const arr = obj2[seg.key];
|
|
320
|
-
if (!Array.isArray(arr)) {
|
|
321
|
-
if (lenient) return node;
|
|
322
|
-
throw new ValidationError(
|
|
323
|
-
`moneyFields: path "${path}" declares "${seg.key}[]" but the value is not an array`
|
|
324
|
-
);
|
|
325
|
-
}
|
|
326
|
-
const cloned = [...arr];
|
|
327
|
-
if (last) {
|
|
328
|
-
for (let i = 0; i < cloned.length; i++) visit(cloned, i);
|
|
329
|
-
} else {
|
|
330
|
-
for (let i = 0; i < cloned.length; i++) {
|
|
331
|
-
cloned[i] = transformAtMoneyPath(cloned[i], path, segments, index + 1, visit, lenient);
|
|
332
|
-
}
|
|
333
|
-
}
|
|
334
|
-
return { ...obj2, [seg.key]: cloned };
|
|
335
|
-
}
|
|
336
|
-
const clone2 = { ...obj2 };
|
|
337
|
-
if (last) {
|
|
338
|
-
visit(clone2, seg.key);
|
|
339
|
-
} else {
|
|
340
|
-
clone2[seg.key] = transformAtMoneyPath(clone2[seg.key], path, segments, index + 1, visit, lenient);
|
|
341
|
-
}
|
|
342
|
-
return clone2;
|
|
343
|
-
}
|
|
344
|
-
if (seg.array) {
|
|
345
|
-
if (!Array.isArray(node)) {
|
|
346
|
-
if (lenient) return node;
|
|
347
|
-
throw new ValidationError(`moneyFields: path "${path}" declares "*[]" but the value is not an array`);
|
|
348
|
-
}
|
|
349
|
-
const cloned = [...node];
|
|
350
|
-
if (last) {
|
|
351
|
-
for (let i = 0; i < cloned.length; i++) visit(cloned, i);
|
|
352
|
-
} else {
|
|
353
|
-
for (let i = 0; i < cloned.length; i++) {
|
|
354
|
-
cloned[i] = transformAtMoneyPath(cloned[i], path, segments, index + 1, visit, lenient);
|
|
355
|
-
}
|
|
356
|
-
}
|
|
357
|
-
return cloned;
|
|
358
|
-
}
|
|
359
|
-
if (typeof node !== "object" || Array.isArray(node)) {
|
|
360
|
-
if (lenient) return node;
|
|
361
|
-
throw new ValidationError(
|
|
362
|
-
`moneyFields: path "${path}" applies "*" to a non-object (${Array.isArray(node) ? 'array \u2014 use "*[]"' : typeof node})`
|
|
363
|
-
);
|
|
364
|
-
}
|
|
365
|
-
const obj = node;
|
|
366
|
-
const clone = { ...obj };
|
|
367
|
-
for (const key of Object.keys(obj)) {
|
|
368
|
-
const v = clone[key];
|
|
369
|
-
if (v === null || v === void 0) continue;
|
|
370
|
-
if (last) visit(clone, key);
|
|
371
|
-
else clone[key] = transformAtMoneyPath(v, path, segments, index + 1, visit, lenient);
|
|
372
|
-
}
|
|
373
|
-
return clone;
|
|
374
|
-
}
|
|
375
|
-
|
|
376
|
-
// src/with-shape/money/normalize.ts
|
|
377
|
-
function isMoneyValueObject(v) {
|
|
378
|
-
return typeof v === "object" && v !== null && "currency" in v;
|
|
379
|
-
}
|
|
380
|
-
function quantizeAmount(field, input, scale, rounding) {
|
|
381
|
-
const r = parseToScaledInt(input, scale, rounding);
|
|
382
|
-
if (!r.ok) {
|
|
383
|
-
if (r.reason === "precision") throw new MoneyPrecisionError(field, input, scale);
|
|
384
|
-
throw new TypeError(`money: field "${field}" value ${JSON.stringify(input)} is not a finite decimal`);
|
|
385
|
-
}
|
|
386
|
-
return r.value.toString();
|
|
387
|
-
}
|
|
388
|
-
function canonicalizeStoredMoney(record, moneyFields) {
|
|
389
|
-
if (record === null || record === void 0) return record;
|
|
390
|
-
if (!moneyFields || Object.keys(moneyFields).length === 0) return record;
|
|
391
|
-
return decodeMoneyFields(record, moneyFields, "raw");
|
|
392
|
-
}
|
|
393
|
-
function canonicalizeIncomingMoney(record, moneyFields) {
|
|
394
|
-
if (!moneyFields || Object.keys(moneyFields).length === 0) return record;
|
|
395
|
-
try {
|
|
396
|
-
return decodeMoneyFields(
|
|
397
|
-
quantizeMoneyFields(record, moneyFields),
|
|
398
|
-
moneyFields,
|
|
399
|
-
"raw"
|
|
400
|
-
);
|
|
401
|
-
} catch {
|
|
402
|
-
return record;
|
|
403
|
-
}
|
|
404
|
-
}
|
|
405
|
-
function quantizeValue(field, raw, desc) {
|
|
406
|
-
if (desc.mode === "fixed") {
|
|
407
|
-
const currency2 = desc.fixedCurrency;
|
|
408
|
-
return quantizeAmount(field, raw, desc.scaleFor(currency2), desc.rounding);
|
|
409
|
-
}
|
|
410
|
-
let amount;
|
|
411
|
-
let currency;
|
|
412
|
-
if (isMoneyValueObject(raw)) {
|
|
413
|
-
currency = String(raw.currency);
|
|
414
|
-
amount = raw.amount;
|
|
415
|
-
} else {
|
|
416
|
-
const sole = desc.soleCurrency();
|
|
417
|
-
if (sole === void 0) {
|
|
418
|
-
throw new TypeError(
|
|
419
|
-
`money: field "${field}" is multi-currency \u2014 write { amount, currency }, not a bare amount`
|
|
420
|
-
);
|
|
421
|
-
}
|
|
422
|
-
currency = sole;
|
|
423
|
-
amount = raw;
|
|
424
|
-
}
|
|
425
|
-
const scale = desc.scaleFor(currency);
|
|
426
|
-
return { amount: quantizeAmount(field, amount, scale, desc.rounding), currency };
|
|
427
|
-
}
|
|
428
|
-
function quantizeMoneyFields(record, moneyFields) {
|
|
429
|
-
let out = { ...record };
|
|
430
|
-
for (const [path, desc] of Object.entries(moneyFields)) {
|
|
431
|
-
if (isSimpleMoneyPath(path)) {
|
|
432
|
-
const raw = out[path];
|
|
433
|
-
if (raw === null || raw === void 0) continue;
|
|
434
|
-
out[path] = quantizeValue(path, raw, desc);
|
|
435
|
-
continue;
|
|
436
|
-
}
|
|
437
|
-
out = transformAtMoneyPath(
|
|
438
|
-
out,
|
|
439
|
-
path,
|
|
440
|
-
parseMoneyPath(path),
|
|
441
|
-
0,
|
|
442
|
-
(container, key) => {
|
|
443
|
-
const raw = container[key];
|
|
444
|
-
if (raw === null || raw === void 0) return;
|
|
445
|
-
container[key] = quantizeValue(path, raw, desc);
|
|
446
|
-
},
|
|
447
|
-
/* lenient */
|
|
448
|
-
false
|
|
449
|
-
);
|
|
450
|
-
}
|
|
451
|
-
return out;
|
|
452
|
-
}
|
|
453
|
-
function formatCurrency(decimal, currency, scale, locale) {
|
|
454
|
-
const fmt = new Intl.NumberFormat(locale, {
|
|
455
|
-
style: "currency",
|
|
456
|
-
currency,
|
|
457
|
-
minimumFractionDigits: scale,
|
|
458
|
-
maximumFractionDigits: scale
|
|
459
|
-
});
|
|
460
|
-
return fmt.format(decimal);
|
|
461
|
-
}
|
|
462
|
-
function moneyScaledValue(stored, desc) {
|
|
463
|
-
let raw;
|
|
464
|
-
if (desc.mode === "fixed") {
|
|
465
|
-
raw = stored;
|
|
466
|
-
} else {
|
|
467
|
-
if (!isMoneyValueObject(stored)) return null;
|
|
468
|
-
raw = stored.amount;
|
|
469
|
-
}
|
|
470
|
-
if (typeof raw !== "string" && typeof raw !== "number") return null;
|
|
471
|
-
try {
|
|
472
|
-
return BigInt(String(raw));
|
|
473
|
-
} catch {
|
|
474
|
-
return null;
|
|
475
|
-
}
|
|
476
|
-
}
|
|
477
|
-
function decodeValue(stored, desc) {
|
|
478
|
-
let currency;
|
|
479
|
-
let scaledIntString;
|
|
480
|
-
if (desc.mode === "fixed") {
|
|
481
|
-
if (typeof stored !== "string" && typeof stored !== "number") return null;
|
|
482
|
-
currency = desc.fixedCurrency;
|
|
483
|
-
scaledIntString = String(stored);
|
|
484
|
-
} else {
|
|
485
|
-
if (!isMoneyValueObject(stored)) return null;
|
|
486
|
-
const amount = stored.amount;
|
|
487
|
-
if (typeof stored.currency !== "string" || typeof amount !== "string" && typeof amount !== "number") return null;
|
|
488
|
-
currency = stored.currency;
|
|
489
|
-
scaledIntString = String(amount);
|
|
490
|
-
}
|
|
491
|
-
const scale = desc.scaleFor(currency);
|
|
492
|
-
let decimal;
|
|
493
|
-
try {
|
|
494
|
-
decimal = formatScaledInt(BigInt(scaledIntString), scale);
|
|
495
|
-
} catch {
|
|
496
|
-
return null;
|
|
497
|
-
}
|
|
498
|
-
return {
|
|
499
|
-
decoded: desc.mode === "fixed" ? decimal : { amount: decimal, currency },
|
|
500
|
-
decimal,
|
|
501
|
-
currency,
|
|
502
|
-
scale
|
|
503
|
-
};
|
|
504
|
-
}
|
|
505
|
-
function decodeMoneyFields(record, moneyFields, locale) {
|
|
506
|
-
let out = { ...record };
|
|
507
|
-
const format = locale !== "raw";
|
|
508
|
-
const fmtLocale = typeof locale === "string" && locale !== "raw" ? locale : "en-US";
|
|
509
|
-
for (const [path, desc] of Object.entries(moneyFields)) {
|
|
510
|
-
if (isSimpleMoneyPath(path)) {
|
|
511
|
-
const stored = out[path];
|
|
512
|
-
if (stored === null || stored === void 0) continue;
|
|
513
|
-
const r = decodeValue(stored, desc);
|
|
514
|
-
if (r === null) continue;
|
|
515
|
-
out[path] = r.decoded;
|
|
516
|
-
if (format) {
|
|
517
|
-
out[`${path}Formatted`] = formatCurrency(r.decimal, r.currency, r.scale, fmtLocale);
|
|
518
|
-
out[`${path}Number`] = Number(r.decimal);
|
|
519
|
-
}
|
|
520
|
-
continue;
|
|
521
|
-
}
|
|
522
|
-
out = transformAtMoneyPath(
|
|
523
|
-
out,
|
|
524
|
-
path,
|
|
525
|
-
parseMoneyPath(path),
|
|
526
|
-
0,
|
|
527
|
-
(container, key) => {
|
|
528
|
-
const stored = container[key];
|
|
529
|
-
if (stored === null || stored === void 0) return;
|
|
530
|
-
const r = decodeValue(stored, desc);
|
|
531
|
-
if (r === null) return;
|
|
532
|
-
container[key] = r.decoded;
|
|
533
|
-
if (format && typeof key === "string" && !Array.isArray(container)) {
|
|
534
|
-
container[`${key}Formatted`] = formatCurrency(r.decimal, r.currency, r.scale, fmtLocale);
|
|
535
|
-
container[`${key}Number`] = Number(r.decimal);
|
|
536
|
-
}
|
|
537
|
-
},
|
|
538
|
-
/* lenient */
|
|
539
|
-
true
|
|
540
|
-
);
|
|
541
|
-
}
|
|
542
|
-
return out;
|
|
543
|
-
}
|
|
544
|
-
|
|
545
269
|
// src/kernel/query/builder.ts
|
|
546
270
|
var EMPTY_PLAN = {
|
|
547
271
|
clauses: [],
|
|
@@ -675,7 +399,7 @@ var Query = class _Query {
|
|
|
675
399
|
*/
|
|
676
400
|
where(field, op, value) {
|
|
677
401
|
const desc = this.source.moneyFields?.[field];
|
|
678
|
-
const clause = desc ? moneyFieldClause(field, op, value, desc) : { type: "field", field, op, value };
|
|
402
|
+
const clause = desc ? moneyRuntime().moneyFieldClause(field, op, value, desc) : { type: "field", field, op, value };
|
|
679
403
|
return new _Query(
|
|
680
404
|
this.source,
|
|
681
405
|
{ ...this.plan, clauses: [...this.plan.clauses, clause] },
|
|
@@ -984,7 +708,7 @@ var Query = class _Query {
|
|
|
984
708
|
decodeMoney(records) {
|
|
985
709
|
const moneyFields = this.source.moneyFields;
|
|
986
710
|
if (!moneyFields || Object.keys(moneyFields).length === 0) return records;
|
|
987
|
-
return records.map((r) => decodeMoneyFields(r, moneyFields, "raw"));
|
|
711
|
+
return records.map((r) => moneyRuntime().decodeMoneyFields(r, moneyFields, "raw"));
|
|
988
712
|
}
|
|
989
713
|
/** Return the first matching record, or null. Joins are applied. `opts.locale` resolves joined i18n fields. */
|
|
990
714
|
first(opts) {
|
|
@@ -1017,7 +741,7 @@ var Query = class _Query {
|
|
|
1017
741
|
let spec = typeof specOrBuild === "function" ? specOrBuild(reducerBuilder) : specOrBuild;
|
|
1018
742
|
const moneyFields = this.source.moneyFields;
|
|
1019
743
|
if (moneyFields) {
|
|
1020
|
-
spec = wrapMoneyReducers(spec, moneyFields);
|
|
744
|
+
spec = moneyRuntime().wrapMoneyReducers(spec, moneyFields);
|
|
1021
745
|
}
|
|
1022
746
|
const source = this.source;
|
|
1023
747
|
const clauses = this.plan.clauses;
|
|
@@ -1277,7 +1001,7 @@ function executePlan(records, plan) {
|
|
|
1277
1001
|
function fnViewDecoder(source) {
|
|
1278
1002
|
const mf = source.moneyFields;
|
|
1279
1003
|
if (!mf || Object.keys(mf).length === 0) return void 0;
|
|
1280
|
-
return (r) => decodeMoneyFields(r, mf, "raw");
|
|
1004
|
+
return (r) => moneyRuntime().decodeMoneyFields(r, mf, "raw");
|
|
1281
1005
|
}
|
|
1282
1006
|
function filterRecords(records, clauses, decodeForFns) {
|
|
1283
1007
|
if (clauses.length === 0) return [...records];
|
|
@@ -1408,8 +1132,8 @@ function buildOrderLabelMaps(orderBy, joinContext, locale) {
|
|
|
1408
1132
|
return maps;
|
|
1409
1133
|
}
|
|
1410
1134
|
function compareMoney(a, b, desc) {
|
|
1411
|
-
const av = moneyScaledValue(a, desc);
|
|
1412
|
-
const bv = moneyScaledValue(b, desc);
|
|
1135
|
+
const av = moneyRuntime().moneyScaledValue(a, desc);
|
|
1136
|
+
const bv = moneyRuntime().moneyScaledValue(b, desc);
|
|
1413
1137
|
if (av === null) return bv === null ? 0 : 1;
|
|
1414
1138
|
if (bv === null) return -1;
|
|
1415
1139
|
return av < bv ? -1 : av > bv ? 1 : 0;
|
|
@@ -1576,7 +1300,7 @@ var ScanBuilder = class _ScanBuilder {
|
|
|
1576
1300
|
*/
|
|
1577
1301
|
decodeMoney(record) {
|
|
1578
1302
|
if (!this.moneyFields || Object.keys(this.moneyFields).length === 0) return record;
|
|
1579
|
-
return decodeMoneyFields(record, this.moneyFields, "raw");
|
|
1303
|
+
return moneyRuntime().decodeMoneyFields(record, this.moneyFields, "raw");
|
|
1580
1304
|
}
|
|
1581
1305
|
/**
|
|
1582
1306
|
* Add a field comparison. Runs per record as the scan stream
|
|
@@ -1593,7 +1317,7 @@ var ScanBuilder = class _ScanBuilder {
|
|
|
1593
1317
|
*/
|
|
1594
1318
|
where(field, op, value) {
|
|
1595
1319
|
const desc = this.moneyFields?.[field];
|
|
1596
|
-
const clause = desc ? moneyFieldClause(field, op, value, desc) : { type: "field", field, op, value };
|
|
1320
|
+
const clause = desc ? moneyRuntime().moneyFieldClause(field, op, value, desc) : { type: "field", field, op, value };
|
|
1597
1321
|
return new _ScanBuilder(
|
|
1598
1322
|
this.pageProvider,
|
|
1599
1323
|
this.pageSize,
|
|
@@ -1919,11 +1643,6 @@ function coerceRefKey2(value) {
|
|
|
1919
1643
|
}
|
|
1920
1644
|
|
|
1921
1645
|
export {
|
|
1922
|
-
validateMoneyFieldPaths,
|
|
1923
|
-
canonicalizeStoredMoney,
|
|
1924
|
-
canonicalizeIncomingMoney,
|
|
1925
|
-
quantizeMoneyFields,
|
|
1926
|
-
decodeMoneyFields,
|
|
1927
1646
|
DEFAULT_JOIN_MAX_ROWS,
|
|
1928
1647
|
applyJoins,
|
|
1929
1648
|
resetJoinWarnings,
|
|
@@ -1934,4 +1653,4 @@ export {
|
|
|
1934
1653
|
executePlan,
|
|
1935
1654
|
ScanBuilder
|
|
1936
1655
|
};
|
|
1937
|
-
//# sourceMappingURL=chunk-
|
|
1656
|
+
//# sourceMappingURL=chunk-GBTUANXF.js.map
|