@noy-db/hub 0.2.0-pre.11 → 0.2.0-pre.13
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/README.md +126 -0
- package/dist/aggregate/index.cjs +289 -12
- package/dist/aggregate/index.cjs.map +1 -1
- package/dist/aggregate/index.d.cts +2 -2
- package/dist/aggregate/index.d.ts +2 -2
- package/dist/aggregate/index.js +7 -7
- package/dist/aggregate/index.js.map +1 -1
- package/dist/attestation/index.cjs.map +1 -1
- package/dist/attestation/index.d.cts +3 -3
- package/dist/attestation/index.d.ts +3 -3
- package/dist/attestation/index.js +6 -6
- package/dist/blobs/index.cjs +28 -0
- package/dist/blobs/index.cjs.map +1 -1
- package/dist/blobs/index.d.cts +4 -4
- package/dist/blobs/index.d.ts +4 -4
- package/dist/blobs/index.js +5 -5
- package/dist/bundle/index.cjs +2024 -69
- package/dist/bundle/index.cjs.map +1 -1
- package/dist/bundle/index.d.cts +5 -5
- package/dist/bundle/index.d.ts +5 -5
- package/dist/bundle/index.js +9 -9
- package/dist/{chunk-LSTBFLL2.js → chunk-3OUCWHV6.js} +2 -2
- package/dist/{chunk-7CEGU63S.js → chunk-3XZRRBFW.js} +2 -2
- package/dist/{chunk-RC6SU5NO.js → chunk-4VCQH32J.js} +2 -2
- package/dist/{chunk-ZROPXHJY.js → chunk-4YDZ7JPZ.js} +2 -2
- package/dist/{chunk-IMYKDWB4.js → chunk-5NISHSBO.js} +2 -2
- package/dist/{chunk-ZBBW7YQN.js → chunk-7TEI2K2A.js} +5 -5
- package/dist/{chunk-6T2UDBKG.js → chunk-AYNF7PVX.js} +2 -2
- package/dist/{chunk-QCXNMCHN.js → chunk-C3WRKABE.js} +4 -4
- package/dist/{chunk-GAUEWM7D.js → chunk-CWFQTAD4.js} +4 -4
- package/dist/{chunk-QSOYKKMD.js → chunk-D5Y3HIC6.js} +2 -2
- package/dist/{chunk-R233SLY3.js → chunk-E3DIBDKA.js} +2 -2
- package/dist/chunk-FNVFT4HZ.js +64 -0
- package/dist/chunk-FNVFT4HZ.js.map +1 -0
- package/dist/{chunk-SLV4LAKX.js → chunk-GC4V7RU7.js} +1 -1
- package/dist/chunk-GC4V7RU7.js.map +1 -0
- package/dist/{chunk-5OEJ6GOT.js → chunk-GL3Z7LH7.js} +2 -2
- package/dist/{chunk-YW5DBAPG.js → chunk-GZJ5JBED.js} +4 -4
- package/dist/{chunk-LJXYPGRH.js → chunk-HHZ77DHM.js} +3 -3
- package/dist/{chunk-6MFH4BMK.js → chunk-HQXOEWLZ.js} +4 -4
- package/dist/{chunk-RYIL3PI2.js → chunk-ILWQGTNH.js} +2 -2
- package/dist/{chunk-3DGHRDCX.js → chunk-J67BP5EP.js} +3 -3
- package/dist/{chunk-PVUUIWHY.js → chunk-JPOQMXGT.js} +10 -3
- package/dist/chunk-JPOQMXGT.js.map +1 -0
- package/dist/{chunk-RRNA5GKT.js → chunk-JWFNOD2T.js} +2 -2
- package/dist/{chunk-BDV7INMP.js → chunk-KHQ3N5AB.js} +4 -4
- package/dist/{chunk-JQ4NEJJ6.js → chunk-KJF7EPUE.js} +3 -3
- package/dist/{chunk-FO3UEG4S.js → chunk-KKB42D3Q.js} +2 -2
- package/dist/{chunk-26NK23DZ.js → chunk-M6KXHRIA.js} +3 -3
- package/dist/{chunk-DAP2XL7Q.js → chunk-NIUXQDWD.js} +2 -2
- package/dist/{chunk-6YLPHBKR.js → chunk-NJMKHRQI.js} +145 -11
- package/dist/chunk-NJMKHRQI.js.map +1 -0
- package/dist/{chunk-O6EJ6WTI.js → chunk-NKGY3C53.js} +87 -2
- package/dist/chunk-NKGY3C53.js.map +1 -0
- package/dist/{chunk-CXJG63MA.js → chunk-NP6EZT44.js} +20 -6
- package/dist/chunk-NP6EZT44.js.map +1 -0
- package/dist/{chunk-Y26YV5R3.js → chunk-O2JW656W.js} +3 -3
- package/dist/{chunk-MPOLUAMI.js → chunk-P5MW7BG2.js} +665 -60
- package/dist/chunk-P5MW7BG2.js.map +1 -0
- package/dist/{chunk-TGALXXLV.js → chunk-PW26DAXS.js} +3 -3
- package/dist/{chunk-V2PZC6AW.js → chunk-QAWCVWCX.js} +5 -5
- package/dist/{chunk-CH22FZHT.js → chunk-QFYVGJLI.js} +2 -2
- package/dist/{chunk-YM7LFCG7.js → chunk-QIVFGU2M.js} +3 -3
- package/dist/{chunk-CXFOITNS.js → chunk-SJ24GHID.js} +2 -2
- package/dist/{chunk-EBVBE7UK.js → chunk-SOU42FGB.js} +5 -5
- package/dist/{chunk-YVZRTCGG.js → chunk-SYSKC237.js} +6 -6
- package/dist/{chunk-77DWLQRY.js → chunk-TDECYU4Y.js} +31 -3
- package/dist/chunk-TDECYU4Y.js.map +1 -0
- package/dist/{chunk-73YLDCNF.js → chunk-TEQGXA7L.js} +5 -5
- package/dist/{chunk-PC6ZEDRL.js → chunk-UNQEWORI.js} +2 -2
- package/dist/{chunk-PC3ZZBTO.js → chunk-VAK6NQAK.js} +5 -5
- package/dist/{chunk-GKI4SDP7.js → chunk-WQKZIQIL.js} +4 -4
- package/dist/chunk-YWBHS25M.js +783 -0
- package/dist/chunk-YWBHS25M.js.map +1 -0
- package/dist/chunk-ZC7J6ZYV.js +7 -0
- package/dist/chunk-ZC7J6ZYV.js.map +1 -0
- package/dist/consent/index.cjs.map +1 -1
- package/dist/consent/index.d.cts +4 -4
- package/dist/consent/index.d.ts +4 -4
- package/dist/consent/index.js +3 -3
- package/dist/{crypto-2CRLG4F4.js → crypto-YXH6SAOW.js} +3 -3
- package/dist/{delegation-ZTRT2PRV.js → delegation-K5ERUH6A.js} +5 -5
- package/dist/derivations/index.cjs.map +1 -1
- package/dist/derivations/index.d.cts +5 -5
- package/dist/derivations/index.d.ts +5 -5
- package/dist/derivations/index.js +4 -4
- package/dist/{dev-unlock-BH6y3Hx0.d.ts → dev-unlock-BW0GNBEV.d.ts} +1 -1
- package/dist/{dev-unlock-H1Xwxc3U.d.cts → dev-unlock-a7SOtaV0.d.cts} +1 -1
- package/dist/executor-AVJ7UEWA.js +8 -0
- package/dist/executor-IQO3KGXQ.js +11 -0
- package/dist/executor-VT7TKGE4.js +8 -0
- package/dist/{fanout-sidecar-F3ZRFU4H.js → fanout-sidecar-N6OJX6QR.js} +2 -2
- package/dist/guards/index.cjs +53 -1
- package/dist/guards/index.cjs.map +1 -1
- package/dist/guards/index.d.cts +12 -6
- package/dist/guards/index.d.ts +12 -6
- package/dist/guards/index.js +5 -3
- package/dist/{hash-_sDFvtmX.d.cts → hash-B0cLQcq_.d.cts} +1 -1
- package/dist/{hash-D89JdDbj.d.ts → hash-uMNIAAW8.d.ts} +1 -1
- package/dist/history/index.cjs.map +1 -1
- package/dist/history/index.d.cts +5 -5
- package/dist/history/index.d.ts +5 -5
- package/dist/history/index.js +5 -5
- package/dist/i18n/index.cjs.map +1 -1
- package/dist/i18n/index.d.cts +4 -4
- package/dist/i18n/index.d.ts +4 -4
- package/dist/i18n/index.js +6 -6
- package/dist/immutable-guard-B0h-ipLz.d.ts +67 -0
- package/dist/immutable-guard-BZIcYhYX.d.cts +67 -0
- package/dist/index-CUVOMtgg.d.cts +1216 -0
- package/dist/index-Cqzp4tt9.d.ts +1216 -0
- package/dist/index.cjs +2200 -106
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +55 -13
- package/dist/index.d.ts +55 -13
- package/dist/index.js +95 -44
- package/dist/index.js.map +1 -1
- package/dist/indexing/index.cjs.map +1 -1
- package/dist/indexing/index.js +2 -2
- package/dist/issue-ZH27C23Y.js +12 -0
- package/dist/{ledger-NYCGJX2D.js → ledger-64TTQMRS.js} +5 -5
- package/dist/materialized-views/index.cjs.map +1 -1
- package/dist/materialized-views/index.d.cts +5 -6
- package/dist/materialized-views/index.d.ts +5 -6
- package/dist/materialized-views/index.js +6 -6
- package/dist/noydb-O76SKBST.js +35 -0
- package/dist/overlay-views/index.cjs.map +1 -1
- package/dist/overlay-views/index.d.cts +5 -5
- package/dist/overlay-views/index.d.ts +5 -5
- package/dist/overlay-views/index.js +4 -4
- package/dist/periods/index.cjs.map +1 -1
- package/dist/periods/index.d.cts +4 -4
- package/dist/periods/index.d.ts +4 -4
- package/dist/periods/index.js +5 -5
- package/dist/{public-envelope-QOXZEHKH.js → public-envelope-MHG6YVXW.js} +4 -4
- package/dist/query/index.cjs +382 -17
- package/dist/query/index.cjs.map +1 -1
- package/dist/query/index.d.cts +2 -2
- package/dist/query/index.d.ts +2 -2
- package/dist/query/index.js +4 -4
- package/dist/registry-2PKBQDCH.js +8 -0
- package/dist/registry-4VXFKCBJ.js +8 -0
- package/dist/{registry-ST2VNFZC.js → registry-PV4G3OPA.js} +3 -3
- package/dist/{revoke-RT7QYB4G.js → revoke-5BOLVJ3N.js} +6 -6
- package/dist/session/index.cjs.map +1 -1
- package/dist/session/index.d.cts +5 -5
- package/dist/session/index.d.ts +5 -5
- package/dist/session/index.js +3 -3
- package/dist/shadow/index.cjs.map +1 -1
- package/dist/shadow/index.d.cts +4 -4
- package/dist/shadow/index.d.ts +4 -4
- package/dist/shadow/index.js +2 -2
- package/dist/{signer-QNU66JF5.js → signer-GRIYBA22.js} +5 -5
- package/dist/snapshots/index.cjs.map +1 -1
- package/dist/snapshots/index.d.cts +4 -4
- package/dist/snapshots/index.d.ts +4 -4
- package/dist/snapshots/index.js +4 -4
- package/dist/{stale-VKXSXJF4.js → stale-LZYMMDDS.js} +2 -2
- package/dist/state-vault-QFJWU23A.js +147 -0
- package/dist/state-vault-QFJWU23A.js.map +1 -0
- package/dist/store/index.cjs.map +1 -1
- package/dist/store/index.d.cts +4 -4
- package/dist/store/index.d.ts +4 -4
- package/dist/store/index.js +2 -2
- package/dist/strategy-CrS7PnbE.d.cts +2048 -0
- package/dist/strategy-CrS7PnbE.d.ts +2048 -0
- package/dist/sync/index.cjs.map +1 -1
- package/dist/sync/index.d.cts +3 -3
- package/dist/sync/index.d.ts +3 -3
- package/dist/sync/index.js +4 -4
- package/dist/team/index.cjs.map +1 -1
- package/dist/team/index.d.cts +4 -4
- package/dist/team/index.d.ts +4 -4
- package/dist/team/index.js +8 -8
- package/dist/tx/index.cjs +8 -1
- package/dist/tx/index.cjs.map +1 -1
- package/dist/tx/index.d.cts +4 -4
- package/dist/tx/index.d.ts +4 -4
- package/dist/tx/index.js +3 -3
- package/dist/{types-DiSXn3a4.d.cts → types-CDwSSXiI.d.cts} +709 -6
- package/dist/{types-CD8mc8zR.d.ts → types-pax34sec.d.ts} +709 -6
- package/dist/{ulid-DQ1hcJvZ.d.cts → ulid-7bCSgIgb.d.cts} +1 -1
- package/dist/{ulid-8p83wbR4.d.ts → ulid-C_t4hL3d.d.ts} +1 -1
- package/dist/util/index.cjs.map +1 -1
- package/dist/util/index.js +1 -1
- package/dist/vault-group-UO4YUZOG.js +493 -0
- package/dist/vault-group-UO4YUZOG.js.map +1 -0
- package/dist/{with-derivation-DWMTpgEH.d.ts → with-derivation-BjdOxUBn.d.ts} +1 -1
- package/dist/{with-derivation-CVT7-dUt.d.cts → with-derivation-D8wFlb6V.d.cts} +1 -1
- package/dist/{with-materialized-view-BTTU3BNK.d.cts → with-materialized-view-5QMF1rS_.d.cts} +1 -1
- package/dist/{with-materialized-view-X0CoL8-L.d.ts → with-materialized-view-DJb-HO65.d.ts} +1 -1
- package/dist/{with-overlayed-view-DQjO_DSG.d.ts → with-overlayed-view-CkqTefbz.d.ts} +1 -1
- package/dist/{with-overlayed-view-DcacRRsS.d.cts → with-overlayed-view-DDNflPvC.d.cts} +1 -1
- package/package.json +3 -3
- package/dist/chunk-2LPPNWF6.js +0 -340
- package/dist/chunk-2LPPNWF6.js.map +0 -1
- package/dist/chunk-6YLPHBKR.js.map +0 -1
- package/dist/chunk-77DWLQRY.js.map +0 -1
- package/dist/chunk-C3WE6UJY.js +0 -19
- package/dist/chunk-C3WE6UJY.js.map +0 -1
- package/dist/chunk-CXJG63MA.js.map +0 -1
- package/dist/chunk-MPOLUAMI.js.map +0 -1
- package/dist/chunk-O6EJ6WTI.js.map +0 -1
- package/dist/chunk-PVUUIWHY.js.map +0 -1
- package/dist/chunk-SLV4LAKX.js.map +0 -1
- package/dist/executor-S76VN45G.js +0 -8
- package/dist/executor-UCXLIGLW.js +0 -11
- package/dist/executor-ZCNZJMGR.js +0 -8
- package/dist/index-B8bjExET.d.cts +0 -2434
- package/dist/index-DfUbNad8.d.ts +0 -2434
- package/dist/issue-IVTVSKWW.js +0 -12
- package/dist/noydb-SH4RLE47.js +0 -34
- package/dist/registry-UFIK7CSR.js +0 -8
- package/dist/registry-ZGYYSM5I.js +0 -8
- package/dist/strategy-CT2LCKAX.d.cts +0 -613
- package/dist/strategy-CT2LCKAX.d.ts +0 -613
- package/dist/with-guard-BRvt53da.d.ts +0 -18
- package/dist/with-guard-Dx2zZnTA.d.cts +0 -18
- /package/dist/{chunk-LSTBFLL2.js.map → chunk-3OUCWHV6.js.map} +0 -0
- /package/dist/{chunk-7CEGU63S.js.map → chunk-3XZRRBFW.js.map} +0 -0
- /package/dist/{chunk-RC6SU5NO.js.map → chunk-4VCQH32J.js.map} +0 -0
- /package/dist/{chunk-ZROPXHJY.js.map → chunk-4YDZ7JPZ.js.map} +0 -0
- /package/dist/{chunk-IMYKDWB4.js.map → chunk-5NISHSBO.js.map} +0 -0
- /package/dist/{chunk-ZBBW7YQN.js.map → chunk-7TEI2K2A.js.map} +0 -0
- /package/dist/{chunk-6T2UDBKG.js.map → chunk-AYNF7PVX.js.map} +0 -0
- /package/dist/{chunk-QCXNMCHN.js.map → chunk-C3WRKABE.js.map} +0 -0
- /package/dist/{chunk-GAUEWM7D.js.map → chunk-CWFQTAD4.js.map} +0 -0
- /package/dist/{chunk-QSOYKKMD.js.map → chunk-D5Y3HIC6.js.map} +0 -0
- /package/dist/{chunk-R233SLY3.js.map → chunk-E3DIBDKA.js.map} +0 -0
- /package/dist/{chunk-5OEJ6GOT.js.map → chunk-GL3Z7LH7.js.map} +0 -0
- /package/dist/{chunk-YW5DBAPG.js.map → chunk-GZJ5JBED.js.map} +0 -0
- /package/dist/{chunk-LJXYPGRH.js.map → chunk-HHZ77DHM.js.map} +0 -0
- /package/dist/{chunk-6MFH4BMK.js.map → chunk-HQXOEWLZ.js.map} +0 -0
- /package/dist/{chunk-RYIL3PI2.js.map → chunk-ILWQGTNH.js.map} +0 -0
- /package/dist/{chunk-3DGHRDCX.js.map → chunk-J67BP5EP.js.map} +0 -0
- /package/dist/{chunk-RRNA5GKT.js.map → chunk-JWFNOD2T.js.map} +0 -0
- /package/dist/{chunk-BDV7INMP.js.map → chunk-KHQ3N5AB.js.map} +0 -0
- /package/dist/{chunk-JQ4NEJJ6.js.map → chunk-KJF7EPUE.js.map} +0 -0
- /package/dist/{chunk-FO3UEG4S.js.map → chunk-KKB42D3Q.js.map} +0 -0
- /package/dist/{chunk-26NK23DZ.js.map → chunk-M6KXHRIA.js.map} +0 -0
- /package/dist/{chunk-DAP2XL7Q.js.map → chunk-NIUXQDWD.js.map} +0 -0
- /package/dist/{chunk-Y26YV5R3.js.map → chunk-O2JW656W.js.map} +0 -0
- /package/dist/{chunk-TGALXXLV.js.map → chunk-PW26DAXS.js.map} +0 -0
- /package/dist/{chunk-V2PZC6AW.js.map → chunk-QAWCVWCX.js.map} +0 -0
- /package/dist/{chunk-CH22FZHT.js.map → chunk-QFYVGJLI.js.map} +0 -0
- /package/dist/{chunk-YM7LFCG7.js.map → chunk-QIVFGU2M.js.map} +0 -0
- /package/dist/{chunk-CXFOITNS.js.map → chunk-SJ24GHID.js.map} +0 -0
- /package/dist/{chunk-EBVBE7UK.js.map → chunk-SOU42FGB.js.map} +0 -0
- /package/dist/{chunk-YVZRTCGG.js.map → chunk-SYSKC237.js.map} +0 -0
- /package/dist/{chunk-73YLDCNF.js.map → chunk-TEQGXA7L.js.map} +0 -0
- /package/dist/{chunk-PC6ZEDRL.js.map → chunk-UNQEWORI.js.map} +0 -0
- /package/dist/{chunk-PC3ZZBTO.js.map → chunk-VAK6NQAK.js.map} +0 -0
- /package/dist/{chunk-GKI4SDP7.js.map → chunk-WQKZIQIL.js.map} +0 -0
- /package/dist/{crypto-2CRLG4F4.js.map → crypto-YXH6SAOW.js.map} +0 -0
- /package/dist/{delegation-ZTRT2PRV.js.map → delegation-K5ERUH6A.js.map} +0 -0
- /package/dist/{executor-S76VN45G.js.map → executor-AVJ7UEWA.js.map} +0 -0
- /package/dist/{executor-UCXLIGLW.js.map → executor-IQO3KGXQ.js.map} +0 -0
- /package/dist/{executor-ZCNZJMGR.js.map → executor-VT7TKGE4.js.map} +0 -0
- /package/dist/{fanout-sidecar-F3ZRFU4H.js.map → fanout-sidecar-N6OJX6QR.js.map} +0 -0
- /package/dist/{issue-IVTVSKWW.js.map → issue-ZH27C23Y.js.map} +0 -0
- /package/dist/{ledger-NYCGJX2D.js.map → ledger-64TTQMRS.js.map} +0 -0
- /package/dist/{noydb-SH4RLE47.js.map → noydb-O76SKBST.js.map} +0 -0
- /package/dist/{public-envelope-QOXZEHKH.js.map → public-envelope-MHG6YVXW.js.map} +0 -0
- /package/dist/{registry-ST2VNFZC.js.map → registry-2PKBQDCH.js.map} +0 -0
- /package/dist/{registry-UFIK7CSR.js.map → registry-4VXFKCBJ.js.map} +0 -0
- /package/dist/{registry-ZGYYSM5I.js.map → registry-PV4G3OPA.js.map} +0 -0
- /package/dist/{revoke-RT7QYB4G.js.map → revoke-5BOLVJ3N.js.map} +0 -0
- /package/dist/{signer-QNU66JF5.js.map → signer-GRIYBA22.js.map} +0 -0
- /package/dist/{stale-VKXSXJF4.js.map → stale-LZYMMDDS.js.map} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
DerivationCapExceededError,
|
|
3
3
|
DerivationOutputShapeError
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-NKGY3C53.js";
|
|
5
5
|
|
|
6
6
|
// src/derivations/executor.ts
|
|
7
7
|
var DerivationExecutor = {
|
|
@@ -121,4 +121,4 @@ var DerivationExecutor = {
|
|
|
121
121
|
export {
|
|
122
122
|
DerivationExecutor
|
|
123
123
|
};
|
|
124
|
-
//# sourceMappingURL=chunk-
|
|
124
|
+
//# sourceMappingURL=chunk-GL3Z7LH7.js.map
|
|
@@ -3,17 +3,17 @@ import {
|
|
|
3
3
|
} from "./chunk-2QR2PQTT.js";
|
|
4
4
|
import {
|
|
5
5
|
NOYDB_SYNC_VERSION
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-GC4V7RU7.js";
|
|
7
7
|
import {
|
|
8
8
|
bufferToBase64,
|
|
9
9
|
decrypt,
|
|
10
10
|
derivePresenceKey,
|
|
11
11
|
encrypt,
|
|
12
12
|
generateIV
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-E3DIBDKA.js";
|
|
14
14
|
import {
|
|
15
15
|
ConflictError
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-NKGY3C53.js";
|
|
17
17
|
|
|
18
18
|
// src/team/presence.ts
|
|
19
19
|
var PresenceHandle = class {
|
|
@@ -719,4 +719,4 @@ export {
|
|
|
719
719
|
SyncEngine,
|
|
720
720
|
SyncTransaction
|
|
721
721
|
};
|
|
722
|
-
//# sourceMappingURL=chunk-
|
|
722
|
+
//# sourceMappingURL=chunk-GZJ5JBED.js.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
NOYDB_FORMAT_VERSION
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-GC4V7RU7.js";
|
|
4
4
|
import {
|
|
5
5
|
decrypt,
|
|
6
6
|
encrypt
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-E3DIBDKA.js";
|
|
8
8
|
|
|
9
9
|
// src/persisted-schemas/storage.ts
|
|
10
10
|
var SCHEMAS_COLLECTION = "_schemas";
|
|
@@ -248,4 +248,4 @@ export {
|
|
|
248
248
|
loadSealedPassphrase,
|
|
249
249
|
resolveManagedSecret
|
|
250
250
|
};
|
|
251
|
-
//# sourceMappingURL=chunk-
|
|
251
|
+
//# sourceMappingURL=chunk-HHZ77DHM.js.map
|
|
@@ -6,15 +6,15 @@ import {
|
|
|
6
6
|
} from "./chunk-Z6FNBOTC.js";
|
|
7
7
|
import {
|
|
8
8
|
NOYDB_FORMAT_VERSION
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-GC4V7RU7.js";
|
|
10
10
|
import {
|
|
11
11
|
decrypt,
|
|
12
12
|
encrypt
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-E3DIBDKA.js";
|
|
14
14
|
import {
|
|
15
15
|
ConflictError,
|
|
16
16
|
LedgerContentionError
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-NKGY3C53.js";
|
|
18
18
|
|
|
19
19
|
// src/history/ledger/patch.ts
|
|
20
20
|
function computePatch(prev, next) {
|
|
@@ -683,4 +683,4 @@ export {
|
|
|
683
683
|
LEDGER_DELTAS_COLLECTION,
|
|
684
684
|
LedgerStore
|
|
685
685
|
};
|
|
686
|
-
//# sourceMappingURL=chunk-
|
|
686
|
+
//# sourceMappingURL=chunk-HQXOEWLZ.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ReadOnlyFrameError
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-NKGY3C53.js";
|
|
4
4
|
|
|
5
5
|
// src/shadow/vault-frame.ts
|
|
6
6
|
var VaultFrame = class {
|
|
@@ -76,4 +76,4 @@ export {
|
|
|
76
76
|
VaultFrame,
|
|
77
77
|
CollectionFrame
|
|
78
78
|
};
|
|
79
|
-
//# sourceMappingURL=chunk-
|
|
79
|
+
//# sourceMappingURL=chunk-ILWQGTNH.js.map
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
import {
|
|
6
6
|
PeriodClosedError,
|
|
7
7
|
ValidationError
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-NKGY3C53.js";
|
|
9
9
|
|
|
10
10
|
// src/periods/periods.ts
|
|
11
11
|
var PERIODS_COLLECTION = "_periods";
|
|
@@ -56,7 +56,7 @@ function validatePeriodName(name, existing) {
|
|
|
56
56
|
}
|
|
57
57
|
async function appendPeriodLedgerEntry(ledger, actor, envelope, name) {
|
|
58
58
|
if (!ledger) return;
|
|
59
|
-
const { envelopePayloadHash } = await import("./ledger-
|
|
59
|
+
const { envelopePayloadHash } = await import("./ledger-64TTQMRS.js");
|
|
60
60
|
await ledger.append({
|
|
61
61
|
op: "put",
|
|
62
62
|
collection: PERIODS_COLLECTION,
|
|
@@ -87,4 +87,4 @@ export {
|
|
|
87
87
|
appendPeriodLedgerEntry,
|
|
88
88
|
withPeriods
|
|
89
89
|
};
|
|
90
|
-
//# sourceMappingURL=chunk-
|
|
90
|
+
//# sourceMappingURL=chunk-J67BP5EP.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
FieldFrozenError,
|
|
3
3
|
InvariantError
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-NKGY3C53.js";
|
|
5
5
|
|
|
6
6
|
// src/guards/executor.ts
|
|
7
7
|
var GuardExecutor = {
|
|
@@ -9,14 +9,21 @@ var GuardExecutor = {
|
|
|
9
9
|
* Compare existing vs incoming for each `frozenFields.fields` entry
|
|
10
10
|
* when `frozenFields.when(existing)` is true. Throws
|
|
11
11
|
* `FieldFrozenError` listing every changed frozen field.
|
|
12
|
+
*
|
|
13
|
+
* @param skipFields — field names that are schema-owned computed fields.
|
|
14
|
+
* These are excluded from the comparison because `incoming` carries the
|
|
15
|
+
* raw user input (computed fields not yet evaluated), so comparing
|
|
16
|
+
* `existing[field]` vs `incoming[field]` would always look like a
|
|
17
|
+
* change even when the computed result is unchanged.
|
|
12
18
|
*/
|
|
13
|
-
async checkFrozenFields(guard, id, existing, incoming) {
|
|
19
|
+
async checkFrozenFields(guard, id, existing, incoming, skipFields) {
|
|
14
20
|
const ff = guard.frozenFields;
|
|
15
21
|
if (!ff) return;
|
|
16
22
|
if (existing === null) return;
|
|
17
23
|
if (!ff.when(existing)) return;
|
|
18
24
|
const changed = [];
|
|
19
25
|
for (const f of ff.fields) {
|
|
26
|
+
if (skipFields?.has(String(f))) continue;
|
|
20
27
|
if (existing[f] !== incoming[f]) {
|
|
21
28
|
if (!deepEqual(existing[f], incoming[f])) changed.push(String(f));
|
|
22
29
|
}
|
|
@@ -70,4 +77,4 @@ function deepEqual(a, b) {
|
|
|
70
77
|
export {
|
|
71
78
|
GuardExecutor
|
|
72
79
|
};
|
|
73
|
-
//# sourceMappingURL=chunk-
|
|
80
|
+
//# sourceMappingURL=chunk-JPOQMXGT.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/guards/executor.ts"],"sourcesContent":["import { FieldFrozenError, InvariantError } from '../errors.js'\nimport type { GuardStrategy, GuardContext, GuardChange } from './types.js'\n\n/**\n * Pure functions that execute the work declared by a `GuardStrategy`.\n * Stateless — `GuardRegistry` decides when to call these.\n *\n * @internal\n */\nexport const GuardExecutor = {\n /**\n * Compare existing vs incoming for each `frozenFields.fields` entry\n * when `frozenFields.when(existing)` is true. Throws\n * `FieldFrozenError` listing every changed frozen field.\n *\n * @param skipFields — field names that are schema-owned computed fields.\n * These are excluded from the comparison because `incoming` carries the\n * raw user input (computed fields not yet evaluated), so comparing\n * `existing[field]` vs `incoming[field]` would always look like a\n * change even when the computed result is unchanged.\n */\n async checkFrozenFields<T extends Record<string, unknown>>(\n guard: GuardStrategy<T>,\n id: string,\n existing: T | null,\n incoming: T,\n skipFields?: ReadonlySet<string>,\n ): Promise<void> {\n const ff = guard.frozenFields\n if (!ff) return\n if (existing === null) return // insert — nothing to freeze\n if (!ff.when(existing)) return\n\n const changed: string[] = []\n for (const f of ff.fields) {\n // Skip computed fields — they are re-evaluated after this gate and\n // their raw-input value is not comparable to the prior computed value.\n if (skipFields?.has(String(f))) continue\n // Strict equality first, then deep-equality fallback for objects.\n if (existing[f] !== incoming[f]) {\n if (!deepEqual(existing[f], incoming[f])) changed.push(String(f))\n }\n }\n if (changed.length > 0) {\n throw new FieldFrozenError(guard.collection, id, changed)\n }\n },\n\n /**\n * Run a single guard's invariant over its slice of the change-set.\n * Any throw is converted to `InvariantError` unless it already is one.\n */\n async runInvariant<T extends Record<string, unknown>>(\n guard: GuardStrategy<T>,\n changes: ReadonlyArray<GuardChange<T>>,\n ctx: GuardContext<T>,\n ): Promise<void> {\n const amendment = guard.amendment\n if (!amendment) return\n try {\n await amendment.invariant(changes, ctx)\n } catch (err) {\n if (err instanceof InvariantError) throw err\n throw new InvariantError(\n err instanceof Error ? err.message : `invariant violated: ${String(err)}`,\n )\n }\n },\n}\n\n/**\n * Minimal deep-equality for guarded field diff. Handles arrays, plain\n * objects, primitives. Not for cyclic structures.\n *\n * @internal\n */\nfunction deepEqual(a: unknown, b: unknown): boolean {\n if (a === b) return true\n if (a === null || b === null) return a === b\n if (typeof a !== typeof b) return false\n if (typeof a !== 'object') return a === b\n if (Array.isArray(a) !== Array.isArray(b)) return false\n if (Array.isArray(a)) {\n const aa = a as unknown[]\n const bb = b as unknown[]\n if (aa.length !== bb.length) return false\n for (let i = 0; i < aa.length; i++) if (!deepEqual(aa[i], bb[i])) return false\n return true\n }\n const ao = a as Record<string, unknown>\n const bo = b as Record<string, unknown>\n const ak = Object.keys(ao)\n const bk = Object.keys(bo)\n if (ak.length !== bk.length) return false\n for (const k of ak) {\n if (!Object.prototype.hasOwnProperty.call(bo, k)) return false\n if (!deepEqual(ao[k], bo[k])) return false\n }\n return true\n}\n"],"mappings":";;;;;;AASO,IAAM,gBAAgB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAY3B,MAAM,kBACJ,OACA,IACA,UACA,UACA,YACe;AACf,UAAM,KAAK,MAAM;AACjB,QAAI,CAAC,GAAI;AACT,QAAI,aAAa,KAAM;AACvB,QAAI,CAAC,GAAG,KAAK,QAAQ,EAAG;AAExB,UAAM,UAAoB,CAAC;AAC3B,eAAW,KAAK,GAAG,QAAQ;AAGzB,UAAI,YAAY,IAAI,OAAO,CAAC,CAAC,EAAG;AAEhC,UAAI,SAAS,CAAC,MAAM,SAAS,CAAC,GAAG;AAC/B,YAAI,CAAC,UAAU,SAAS,CAAC,GAAG,SAAS,CAAC,CAAC,EAAG,SAAQ,KAAK,OAAO,CAAC,CAAC;AAAA,MAClE;AAAA,IACF;AACA,QAAI,QAAQ,SAAS,GAAG;AACtB,YAAM,IAAI,iBAAiB,MAAM,YAAY,IAAI,OAAO;AAAA,IAC1D;AAAA,EACF;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,MAAM,aACJ,OACA,SACA,KACe;AACf,UAAM,YAAY,MAAM;AACxB,QAAI,CAAC,UAAW;AAChB,QAAI;AACF,YAAM,UAAU,UAAU,SAAS,GAAG;AAAA,IACxC,SAAS,KAAK;AACZ,UAAI,eAAe,eAAgB,OAAM;AACzC,YAAM,IAAI;AAAA,QACR,eAAe,QAAQ,IAAI,UAAU,uBAAuB,OAAO,GAAG,CAAC;AAAA,MACzE;AAAA,IACF;AAAA,EACF;AACF;AAQA,SAAS,UAAU,GAAY,GAAqB;AAClD,MAAI,MAAM,EAAG,QAAO;AACpB,MAAI,MAAM,QAAQ,MAAM,KAAM,QAAO,MAAM;AAC3C,MAAI,OAAO,MAAM,OAAO,EAAG,QAAO;AAClC,MAAI,OAAO,MAAM,SAAU,QAAO,MAAM;AACxC,MAAI,MAAM,QAAQ,CAAC,MAAM,MAAM,QAAQ,CAAC,EAAG,QAAO;AAClD,MAAI,MAAM,QAAQ,CAAC,GAAG;AACpB,UAAM,KAAK;AACX,UAAM,KAAK;AACX,QAAI,GAAG,WAAW,GAAG,OAAQ,QAAO;AACpC,aAAS,IAAI,GAAG,IAAI,GAAG,QAAQ,IAAK,KAAI,CAAC,UAAU,GAAG,CAAC,GAAG,GAAG,CAAC,CAAC,EAAG,QAAO;AACzE,WAAO;AAAA,EACT;AACA,QAAM,KAAK;AACX,QAAM,KAAK;AACX,QAAM,KAAK,OAAO,KAAK,EAAE;AACzB,QAAM,KAAK,OAAO,KAAK,EAAE;AACzB,MAAI,GAAG,WAAW,GAAG,OAAQ,QAAO;AACpC,aAAW,KAAK,IAAI;AAClB,QAAI,CAAC,OAAO,UAAU,eAAe,KAAK,IAAI,CAAC,EAAG,QAAO;AACzD,QAAI,CAAC,UAAU,GAAG,CAAC,GAAG,GAAG,CAAC,CAAC,EAAG,QAAO;AAAA,EACvC;AACA,SAAO;AACT;","names":[]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
BundleVersionConflictError,
|
|
3
3
|
ConflictError
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-NKGY3C53.js";
|
|
5
5
|
|
|
6
6
|
// src/store/bundle-store.ts
|
|
7
7
|
var BUNDLE_STORE_VERSION = 1;
|
|
@@ -790,4 +790,4 @@ export {
|
|
|
790
790
|
withCache,
|
|
791
791
|
withHealthCheck
|
|
792
792
|
};
|
|
793
|
-
//# sourceMappingURL=chunk-
|
|
793
|
+
//# sourceMappingURL=chunk-JWFNOD2T.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
dekKey
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-SJ24GHID.js";
|
|
4
4
|
import {
|
|
5
5
|
generateULID
|
|
6
6
|
} from "./chunk-FZU343FL.js";
|
|
@@ -9,10 +9,10 @@ import {
|
|
|
9
9
|
encrypt,
|
|
10
10
|
unwrapKey,
|
|
11
11
|
wrapKey
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-E3DIBDKA.js";
|
|
13
13
|
import {
|
|
14
14
|
DelegationTargetMissingError
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-NKGY3C53.js";
|
|
16
16
|
|
|
17
17
|
// src/team/delegation.ts
|
|
18
18
|
var DELEGATIONS_COLLECTION = "_delegations";
|
|
@@ -94,4 +94,4 @@ export {
|
|
|
94
94
|
loadActiveDelegations,
|
|
95
95
|
revokeDelegation
|
|
96
96
|
};
|
|
97
|
-
//# sourceMappingURL=chunk-
|
|
97
|
+
//# sourceMappingURL=chunk-KHQ3N5AB.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
NOYDB_FORMAT_VERSION
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-GC4V7RU7.js";
|
|
4
4
|
import {
|
|
5
5
|
ValidationError
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-NKGY3C53.js";
|
|
7
7
|
|
|
8
8
|
// src/meta/public-envelope/schema.ts
|
|
9
9
|
var DATA_URL_PREFIX = /^data:([a-zA-Z0-9.+-]+\/[a-zA-Z0-9.+-]+);base64,/;
|
|
@@ -152,4 +152,4 @@ export {
|
|
|
152
152
|
resolveLocale,
|
|
153
153
|
pickLocale
|
|
154
154
|
};
|
|
155
|
-
//# sourceMappingURL=chunk-
|
|
155
|
+
//# sourceMappingURL=chunk-KJF7EPUE.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
MaterializedViewCycleError,
|
|
3
3
|
MaterializedViewSourceUnknownError
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-NKGY3C53.js";
|
|
5
5
|
|
|
6
6
|
// src/materialized-views/dependency-analyzer.ts
|
|
7
7
|
function analyzeDependencies(query) {
|
|
@@ -310,4 +310,4 @@ export {
|
|
|
310
310
|
MaterializedViewRegistry,
|
|
311
311
|
wrapDbWithPredicates
|
|
312
312
|
};
|
|
313
|
-
//# sourceMappingURL=chunk-
|
|
313
|
+
//# sourceMappingURL=chunk-KKB42D3Q.js.map
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
ConflictError,
|
|
7
7
|
InvariantError,
|
|
8
8
|
ValidationError
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-NKGY3C53.js";
|
|
10
10
|
|
|
11
11
|
// src/tx/transaction.ts
|
|
12
12
|
var TxContext = class {
|
|
@@ -209,7 +209,7 @@ async function runTransaction(db, fn, options) {
|
|
|
209
209
|
db._clearActiveTxContext(ctx);
|
|
210
210
|
}
|
|
211
211
|
if (ctx._amendment) {
|
|
212
|
-
const { GuardExecutor } = await import("./executor-
|
|
212
|
+
const { GuardExecutor } = await import("./executor-VT7TKGE4.js");
|
|
213
213
|
try {
|
|
214
214
|
for (const [vaultName, v] of ctx._amendmentVaults) {
|
|
215
215
|
const registry = v._getGuardRegistry();
|
|
@@ -293,4 +293,4 @@ export {
|
|
|
293
293
|
runTransaction,
|
|
294
294
|
revertExecuted
|
|
295
295
|
};
|
|
296
|
-
//# sourceMappingURL=chunk-
|
|
296
|
+
//# sourceMappingURL=chunk-M6KXHRIA.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ValidationError
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-NKGY3C53.js";
|
|
4
4
|
|
|
5
5
|
// src/derivations/with-derivation.ts
|
|
6
6
|
function withDerivation(spec) {
|
|
@@ -48,4 +48,4 @@ function withDerivation(spec) {
|
|
|
48
48
|
export {
|
|
49
49
|
withDerivation
|
|
50
50
|
};
|
|
51
|
-
//# sourceMappingURL=chunk-
|
|
51
|
+
//# sourceMappingURL=chunk-NIUXQDWD.js.map
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
import {
|
|
2
|
+
MoneyPrecisionError,
|
|
3
|
+
formatScaledInt,
|
|
4
|
+
parseToScaledInt,
|
|
5
|
+
wrapMoneyReducers
|
|
6
|
+
} from "./chunk-YWBHS25M.js";
|
|
1
7
|
import {
|
|
2
8
|
evaluateClause,
|
|
3
9
|
readPath
|
|
@@ -7,7 +13,7 @@ import {
|
|
|
7
13
|
CrossJoinTooLargeError,
|
|
8
14
|
DanglingReferenceError,
|
|
9
15
|
JoinTooLargeError
|
|
10
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-NKGY3C53.js";
|
|
11
17
|
|
|
12
18
|
// src/query/join.ts
|
|
13
19
|
var DEFAULT_JOIN_MAX_ROWS = 5e4;
|
|
@@ -254,6 +260,88 @@ var NO_AGGREGATE = {
|
|
|
254
260
|
}
|
|
255
261
|
};
|
|
256
262
|
|
|
263
|
+
// src/money/normalize.ts
|
|
264
|
+
function isMoneyValueObject(v) {
|
|
265
|
+
return typeof v === "object" && v !== null && "currency" in v;
|
|
266
|
+
}
|
|
267
|
+
function quantizeAmount(field, input, scale, rounding) {
|
|
268
|
+
const r = parseToScaledInt(input, scale, rounding);
|
|
269
|
+
if (!r.ok) {
|
|
270
|
+
if (r.reason === "precision") throw new MoneyPrecisionError(field, input, scale);
|
|
271
|
+
throw new TypeError(`money: field "${field}" value ${JSON.stringify(input)} is not a finite decimal`);
|
|
272
|
+
}
|
|
273
|
+
return r.value.toString();
|
|
274
|
+
}
|
|
275
|
+
function quantizeMoneyFields(record, moneyFields) {
|
|
276
|
+
const out = { ...record };
|
|
277
|
+
for (const [field, desc] of Object.entries(moneyFields)) {
|
|
278
|
+
const raw = out[field];
|
|
279
|
+
if (raw === null || raw === void 0) continue;
|
|
280
|
+
if (desc.mode === "fixed") {
|
|
281
|
+
const currency2 = desc.fixedCurrency;
|
|
282
|
+
out[field] = quantizeAmount(field, raw, desc.scaleFor(currency2), desc.rounding);
|
|
283
|
+
continue;
|
|
284
|
+
}
|
|
285
|
+
let amount;
|
|
286
|
+
let currency;
|
|
287
|
+
if (isMoneyValueObject(raw)) {
|
|
288
|
+
currency = String(raw.currency);
|
|
289
|
+
amount = raw.amount;
|
|
290
|
+
} else {
|
|
291
|
+
const sole = desc.soleCurrency();
|
|
292
|
+
if (sole === void 0) {
|
|
293
|
+
throw new TypeError(
|
|
294
|
+
`money: field "${field}" is multi-currency \u2014 write { amount, currency }, not a bare amount`
|
|
295
|
+
);
|
|
296
|
+
}
|
|
297
|
+
currency = sole;
|
|
298
|
+
amount = raw;
|
|
299
|
+
}
|
|
300
|
+
const scale = desc.scaleFor(currency);
|
|
301
|
+
out[field] = { amount: quantizeAmount(field, amount, scale, desc.rounding), currency };
|
|
302
|
+
}
|
|
303
|
+
return out;
|
|
304
|
+
}
|
|
305
|
+
function formatCurrency(decimal, currency, scale, locale) {
|
|
306
|
+
const fmt = new Intl.NumberFormat(locale, {
|
|
307
|
+
style: "currency",
|
|
308
|
+
currency,
|
|
309
|
+
minimumFractionDigits: scale,
|
|
310
|
+
maximumFractionDigits: scale
|
|
311
|
+
});
|
|
312
|
+
return fmt.format(decimal);
|
|
313
|
+
}
|
|
314
|
+
function decodeMoneyFields(record, moneyFields, locale) {
|
|
315
|
+
const out = { ...record };
|
|
316
|
+
const format = locale !== "raw";
|
|
317
|
+
const fmtLocale = typeof locale === "string" && locale !== "raw" ? locale : "en-US";
|
|
318
|
+
for (const [field, desc] of Object.entries(moneyFields)) {
|
|
319
|
+
const stored = out[field];
|
|
320
|
+
if (stored === null || stored === void 0) continue;
|
|
321
|
+
let currency;
|
|
322
|
+
let scaledIntString;
|
|
323
|
+
if (desc.mode === "fixed") {
|
|
324
|
+
if (typeof stored !== "string" && typeof stored !== "number") continue;
|
|
325
|
+
currency = desc.fixedCurrency;
|
|
326
|
+
scaledIntString = String(stored);
|
|
327
|
+
} else {
|
|
328
|
+
if (!isMoneyValueObject(stored)) continue;
|
|
329
|
+
const amount = stored.amount;
|
|
330
|
+
if (typeof stored.currency !== "string" || typeof amount !== "string" && typeof amount !== "number") continue;
|
|
331
|
+
currency = stored.currency;
|
|
332
|
+
scaledIntString = String(amount);
|
|
333
|
+
}
|
|
334
|
+
const scale = desc.scaleFor(currency);
|
|
335
|
+
const decimal = formatScaledInt(BigInt(scaledIntString), scale);
|
|
336
|
+
out[field] = desc.mode === "fixed" ? decimal : { amount: decimal, currency };
|
|
337
|
+
if (format) {
|
|
338
|
+
out[`${field}Formatted`] = formatCurrency(decimal, currency, scale, fmtLocale);
|
|
339
|
+
out[`${field}Number`] = Number(decimal);
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
return out;
|
|
343
|
+
}
|
|
344
|
+
|
|
257
345
|
// src/query/builder.ts
|
|
258
346
|
var EMPTY_PLAN = {
|
|
259
347
|
clauses: [],
|
|
@@ -623,7 +711,7 @@ var Query = class _Query {
|
|
|
623
711
|
* for the ordering rationale.
|
|
624
712
|
*/
|
|
625
713
|
toArray() {
|
|
626
|
-
const base = executePlanWithSource(this.source, this.plan, this.joinContext);
|
|
714
|
+
const base = this.decodeMoney(executePlanWithSource(this.source, this.plan, this.joinContext));
|
|
627
715
|
if (this.plan.joins.length === 0) return base;
|
|
628
716
|
if (!this.joinContext) {
|
|
629
717
|
throw new Error(
|
|
@@ -632,6 +720,23 @@ var Query = class _Query {
|
|
|
632
720
|
}
|
|
633
721
|
return applyJoins(base, this.plan.joins, this.joinContext);
|
|
634
722
|
}
|
|
723
|
+
/**
|
|
724
|
+
* Decode this source's money fields on read (stored scaled-int → canonical
|
|
725
|
+
* decimal), so `query().toArray()` agrees with `get()`/`sum()` on the value.
|
|
726
|
+
* No-op when the source declares no money fields.
|
|
727
|
+
*
|
|
728
|
+
* The query layer carries no locale context, so we decode with `'raw'` —
|
|
729
|
+
* canonical decimal, WITHOUT fabricating locale-formatted `<field>Formatted`
|
|
730
|
+
* / `<field>Number` virtuals. Producing a guessed-locale string here would
|
|
731
|
+
* just reintroduce #322's "two read paths disagree" failure on the virtual
|
|
732
|
+
* field (e.g. it-IT via `get()` vs en-US here). Consumers who need formatted
|
|
733
|
+
* money read through `get()`/`list()` with a locale.
|
|
734
|
+
*/
|
|
735
|
+
decodeMoney(records) {
|
|
736
|
+
const moneyFields = this.source.moneyFields;
|
|
737
|
+
if (!moneyFields || Object.keys(moneyFields).length === 0) return records;
|
|
738
|
+
return records.map((r) => decodeMoneyFields(r, moneyFields, "raw"));
|
|
739
|
+
}
|
|
635
740
|
/** Return the first matching record, or null. Joins are applied. */
|
|
636
741
|
first() {
|
|
637
742
|
const arr = this.limit(1).toArray();
|
|
@@ -700,6 +805,10 @@ var Query = class _Query {
|
|
|
700
805
|
* partition boundaries without an API break.
|
|
701
806
|
*/
|
|
702
807
|
aggregate(spec) {
|
|
808
|
+
const moneyFields = this.source.moneyFields;
|
|
809
|
+
if (moneyFields) {
|
|
810
|
+
spec = wrapMoneyReducers(spec, moneyFields);
|
|
811
|
+
}
|
|
703
812
|
const source = this.source;
|
|
704
813
|
const clauses = this.plan.clauses;
|
|
705
814
|
const joinCtx = this.joinContext;
|
|
@@ -747,13 +856,15 @@ var Query = class _Query {
|
|
|
747
856
|
executeRecords,
|
|
748
857
|
field,
|
|
749
858
|
upstreams,
|
|
750
|
-
dictLabelResolver
|
|
859
|
+
dictLabelResolver,
|
|
860
|
+
this.source.moneyFields
|
|
751
861
|
);
|
|
752
862
|
}
|
|
753
863
|
return this.aggregateStrategy.groupByN(
|
|
754
864
|
executeRecords,
|
|
755
865
|
fields,
|
|
756
|
-
upstreams
|
|
866
|
+
upstreams,
|
|
867
|
+
this.source.moneyFields
|
|
757
868
|
);
|
|
758
869
|
}
|
|
759
870
|
/**
|
|
@@ -1182,12 +1293,29 @@ var ScanBuilder = class _ScanBuilder {
|
|
|
1182
1293
|
* context throws with an actionable error.
|
|
1183
1294
|
*/
|
|
1184
1295
|
joinContext;
|
|
1185
|
-
|
|
1296
|
+
/**
|
|
1297
|
+
* Money field descriptors for the backing collection. When present, yielded
|
|
1298
|
+
* records are decoded (stored scaled-int → canonical decimal) so `scan()`
|
|
1299
|
+
* agrees with `get()`/`list()`/`query().toArray()` — #322. Decoded with
|
|
1300
|
+
* `'raw'` (canonical decimal, no locale-formatted virtuals) since the scan
|
|
1301
|
+
* stream carries no locale context, mirroring `Query.toArray()`.
|
|
1302
|
+
*/
|
|
1303
|
+
moneyFields;
|
|
1304
|
+
constructor(pageProvider, pageSize = DEFAULT_SCAN_PAGE_SIZE, clauses = [], joins = [], joinContext, moneyFields) {
|
|
1186
1305
|
this.pageProvider = pageProvider;
|
|
1187
1306
|
this.pageSize = pageSize;
|
|
1188
1307
|
this.clauses = clauses;
|
|
1189
1308
|
this.joins = joins;
|
|
1190
1309
|
this.joinContext = joinContext;
|
|
1310
|
+
this.moneyFields = moneyFields;
|
|
1311
|
+
}
|
|
1312
|
+
/**
|
|
1313
|
+
* Decode this scan's money fields on a record (stored scaled-int → canonical
|
|
1314
|
+
* decimal). No-op when no money fields are declared. See {@link moneyFields}.
|
|
1315
|
+
*/
|
|
1316
|
+
decodeMoney(record) {
|
|
1317
|
+
if (!this.moneyFields || Object.keys(this.moneyFields).length === 0) return record;
|
|
1318
|
+
return decodeMoneyFields(record, this.moneyFields, "raw");
|
|
1191
1319
|
}
|
|
1192
1320
|
/**
|
|
1193
1321
|
* Add a field comparison. Runs per record as the scan stream
|
|
@@ -1209,7 +1337,8 @@ var ScanBuilder = class _ScanBuilder {
|
|
|
1209
1337
|
this.pageSize,
|
|
1210
1338
|
[...this.clauses, clause],
|
|
1211
1339
|
this.joins,
|
|
1212
|
-
this.joinContext
|
|
1340
|
+
this.joinContext,
|
|
1341
|
+
this.moneyFields
|
|
1213
1342
|
);
|
|
1214
1343
|
}
|
|
1215
1344
|
/**
|
|
@@ -1228,7 +1357,8 @@ var ScanBuilder = class _ScanBuilder {
|
|
|
1228
1357
|
this.pageSize,
|
|
1229
1358
|
[...this.clauses, clause],
|
|
1230
1359
|
this.joins,
|
|
1231
|
-
this.joinContext
|
|
1360
|
+
this.joinContext,
|
|
1361
|
+
this.moneyFields
|
|
1232
1362
|
);
|
|
1233
1363
|
}
|
|
1234
1364
|
/**
|
|
@@ -1339,7 +1469,8 @@ var ScanBuilder = class _ScanBuilder {
|
|
|
1339
1469
|
this.pageSize,
|
|
1340
1470
|
this.clauses,
|
|
1341
1471
|
[...this.joins, leg],
|
|
1342
|
-
this.joinContext
|
|
1472
|
+
this.joinContext,
|
|
1473
|
+
this.moneyFields
|
|
1343
1474
|
);
|
|
1344
1475
|
}
|
|
1345
1476
|
/**
|
|
@@ -1356,10 +1487,11 @@ var ScanBuilder = class _ScanBuilder {
|
|
|
1356
1487
|
while (true) {
|
|
1357
1488
|
for (const record of page.items) {
|
|
1358
1489
|
if (!this.recordMatches(record)) continue;
|
|
1490
|
+
const decoded = this.decodeMoney(record);
|
|
1359
1491
|
if (joinResolvers === null) {
|
|
1360
|
-
yield
|
|
1492
|
+
yield decoded;
|
|
1361
1493
|
} else {
|
|
1362
|
-
let attached =
|
|
1494
|
+
let attached = decoded;
|
|
1363
1495
|
for (const resolver of joinResolvers) {
|
|
1364
1496
|
attached = this.applyOneJoinStreaming(attached, resolver);
|
|
1365
1497
|
}
|
|
@@ -1559,6 +1691,8 @@ function coerceRefKey2(value) {
|
|
|
1559
1691
|
}
|
|
1560
1692
|
|
|
1561
1693
|
export {
|
|
1694
|
+
quantizeMoneyFields,
|
|
1695
|
+
decodeMoneyFields,
|
|
1562
1696
|
DEFAULT_JOIN_MAX_ROWS,
|
|
1563
1697
|
applyJoins,
|
|
1564
1698
|
resetJoinWarnings,
|
|
@@ -1569,4 +1703,4 @@ export {
|
|
|
1569
1703
|
executePlan,
|
|
1570
1704
|
ScanBuilder
|
|
1571
1705
|
};
|
|
1572
|
-
//# sourceMappingURL=chunk-
|
|
1706
|
+
//# sourceMappingURL=chunk-NJMKHRQI.js.map
|