@noy-db/hub 0.2.0-pre.14 → 0.2.0-pre.15

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.
Files changed (122) hide show
  1. package/dist/aggregate/index.cjs +56 -56
  2. package/dist/aggregate/index.cjs.map +1 -1
  3. package/dist/aggregate/index.d.cts +2 -2
  4. package/dist/aggregate/index.d.ts +2 -2
  5. package/dist/aggregate/index.js +3 -3
  6. package/dist/attestation/index.d.cts +5 -5
  7. package/dist/attestation/index.d.ts +5 -5
  8. package/dist/blobs/index.d.cts +6 -6
  9. package/dist/blobs/index.d.ts +6 -6
  10. package/dist/bundle/index.cjs +426 -68
  11. package/dist/bundle/index.cjs.map +1 -1
  12. package/dist/bundle/index.d.cts +7 -7
  13. package/dist/bundle/index.d.ts +7 -7
  14. package/dist/bundle/index.js +1 -1
  15. package/dist/{chunk-3EWA37FV.js → chunk-3EWXMOK3.js} +7 -266
  16. package/dist/chunk-3EWXMOK3.js.map +1 -0
  17. package/dist/{chunk-ACKFRSAH.js → chunk-7EFFHEN5.js} +26 -19
  18. package/dist/chunk-7EFFHEN5.js.map +1 -0
  19. package/dist/{chunk-UWNYBOOO.js → chunk-C5T5AFWN.js} +2 -2
  20. package/dist/chunk-CJORTUJ2.js +524 -0
  21. package/dist/chunk-CJORTUJ2.js.map +1 -0
  22. package/dist/{chunk-YNTBADIY.js → chunk-CZI2A4MQ.js} +2 -2
  23. package/dist/{chunk-KGCORI4L.js → chunk-EYVQHAGH.js} +266 -66
  24. package/dist/chunk-EYVQHAGH.js.map +1 -0
  25. package/dist/{chunk-NP6EZT44.js → chunk-IQLVUT37.js} +2 -2
  26. package/dist/{chunk-4PEFEETV.js → chunk-KIP6JLTF.js} +2 -2
  27. package/dist/{chunk-ZWTNWAO4.js → chunk-NU6Q3FOR.js} +3 -3
  28. package/dist/chunk-NU6Q3FOR.js.map +1 -0
  29. package/dist/{chunk-WIBHRONM.js → chunk-XWH4MXIU.js} +2 -2
  30. package/dist/consent/index.d.cts +6 -6
  31. package/dist/consent/index.d.ts +6 -6
  32. package/dist/derivations/index.d.cts +7 -7
  33. package/dist/derivations/index.d.ts +7 -7
  34. package/dist/{dev-unlock-DV7ujTCI.d.ts → dev-unlock-iAS8z9jc.d.ts} +1 -1
  35. package/dist/{dev-unlock-BF4OSxRv.d.cts → dev-unlock-nVkuRLLe.d.cts} +1 -1
  36. package/dist/{executor-723ZP6TH.js → executor-HSSRXDOB.js} +4 -4
  37. package/dist/guards/index.d.cts +7 -7
  38. package/dist/guards/index.d.ts +7 -7
  39. package/dist/{hash-BcF5WQXl.d.cts → hash-Cv6byZs7.d.cts} +1 -1
  40. package/dist/{hash-DswxkLtW.d.ts → hash-DHOnRarj.d.ts} +1 -1
  41. package/dist/history/index.d.cts +7 -7
  42. package/dist/history/index.d.ts +7 -7
  43. package/dist/i18n/index.d.cts +6 -6
  44. package/dist/i18n/index.d.ts +6 -6
  45. package/dist/{immutable-guard-C8IYdzfu.d.ts → immutable-guard-BehB1YGB.d.ts} +1 -1
  46. package/dist/{immutable-guard-7KqslW2K.d.cts → immutable-guard-yBEOYmif.d.cts} +1 -1
  47. package/dist/{index-CUVOMtgg.d.cts → index-D95VK1Qy.d.cts} +11 -3
  48. package/dist/{index-Cqzp4tt9.d.ts → index-XNB2r6bX.d.ts} +11 -3
  49. package/dist/index.cjs +567 -70
  50. package/dist/index.cjs.map +1 -1
  51. package/dist/index.d.cts +145 -15
  52. package/dist/index.d.ts +145 -15
  53. package/dist/index.js +132 -16
  54. package/dist/index.js.map +1 -1
  55. package/dist/indexing/index.cjs +92 -31
  56. package/dist/indexing/index.cjs.map +1 -1
  57. package/dist/indexing/index.d.cts +3 -3
  58. package/dist/indexing/index.d.ts +3 -3
  59. package/dist/indexing/index.js +3 -3
  60. package/dist/{lazy-builder-D5GU14TS.d.ts → lazy-builder-ChSqcF5t.d.ts} +1 -1
  61. package/dist/{lazy-builder-Ci5_YG73.d.cts → lazy-builder-eYZzLEL1.d.cts} +1 -1
  62. package/dist/materialized-views/index.cjs +2 -2
  63. package/dist/materialized-views/index.cjs.map +1 -1
  64. package/dist/materialized-views/index.d.cts +7 -7
  65. package/dist/materialized-views/index.d.ts +7 -7
  66. package/dist/materialized-views/index.js +5 -5
  67. package/dist/{noydb-VZ4JVW55.js → noydb-GZGFBA4E.js} +8 -8
  68. package/dist/overlay-views/index.d.cts +7 -7
  69. package/dist/overlay-views/index.d.ts +7 -7
  70. package/dist/periods/index.d.cts +6 -6
  71. package/dist/periods/index.d.ts +6 -6
  72. package/dist/{predicate-Bt5ft-9c.d.cts → predicate-BmhBSPCH.d.cts} +59 -2
  73. package/dist/{predicate-Bt5ft-9c.d.ts → predicate-BmhBSPCH.d.ts} +59 -2
  74. package/dist/query/index.cjs +580 -195
  75. package/dist/query/index.cjs.map +1 -1
  76. package/dist/query/index.d.cts +3 -3
  77. package/dist/query/index.d.ts +3 -3
  78. package/dist/query/index.js +5 -5
  79. package/dist/session/index.d.cts +7 -7
  80. package/dist/session/index.d.ts +7 -7
  81. package/dist/shadow/index.d.cts +6 -6
  82. package/dist/shadow/index.d.ts +6 -6
  83. package/dist/snapshots/index.d.cts +6 -6
  84. package/dist/snapshots/index.d.ts +6 -6
  85. package/dist/{stale-7FRJVHN6.js → stale-JH67FU57.js} +2 -2
  86. package/dist/store/index.d.cts +6 -6
  87. package/dist/store/index.d.ts +6 -6
  88. package/dist/{strategy-CrS7PnbE.d.ts → strategy-CbneC7bS.d.cts} +1 -1
  89. package/dist/{strategy-CrS7PnbE.d.cts → strategy-CbneC7bS.d.ts} +1 -1
  90. package/dist/sync/index.d.cts +5 -5
  91. package/dist/sync/index.d.ts +5 -5
  92. package/dist/team/index.d.cts +6 -6
  93. package/dist/team/index.d.ts +6 -6
  94. package/dist/tx/index.d.cts +6 -6
  95. package/dist/tx/index.d.ts +6 -6
  96. package/dist/{types-BFHQUjdy.d.ts → types-4t1-tWS4.d.ts} +22 -7
  97. package/dist/{types-V5R2-pd4.d.cts → types-BpPV5uyy.d.cts} +22 -7
  98. package/dist/{ulid-CwNf9e6-.d.cts → ulid-CiPrpGqm.d.cts} +1 -1
  99. package/dist/{ulid-p2nKiiKg.d.ts → ulid-DAfenvFd.d.ts} +1 -1
  100. package/dist/{vault-group-W7QC4UYW.js → vault-group-KOM7QRJG.js} +3 -3
  101. package/dist/{with-derivation-C9K43BOB.d.cts → with-derivation-DBqJB3dQ.d.cts} +1 -1
  102. package/dist/{with-derivation-Ds9yZgCj.d.ts → with-derivation-OK9M2sJE.d.ts} +1 -1
  103. package/dist/{with-materialized-view-DwR4jkV5.d.ts → with-materialized-view-Dt-ufPWQ.d.ts} +1 -1
  104. package/dist/{with-materialized-view-DgQcAjYv.d.cts → with-materialized-view-NzuxYPDF.d.cts} +1 -1
  105. package/dist/{with-overlayed-view-7-rUB3vD.d.cts → with-overlayed-view-CC0_ocy-.d.cts} +1 -1
  106. package/dist/{with-overlayed-view-ByyhHdVr.d.ts → with-overlayed-view-eDvMs6LO.d.ts} +1 -1
  107. package/package.json +3 -3
  108. package/dist/chunk-3EWA37FV.js.map +0 -1
  109. package/dist/chunk-ACKFRSAH.js.map +0 -1
  110. package/dist/chunk-KGCORI4L.js.map +0 -1
  111. package/dist/chunk-TV3YZ35S.js +0 -90
  112. package/dist/chunk-TV3YZ35S.js.map +0 -1
  113. package/dist/chunk-ZWTNWAO4.js.map +0 -1
  114. /package/dist/{chunk-UWNYBOOO.js.map → chunk-C5T5AFWN.js.map} +0 -0
  115. /package/dist/{chunk-YNTBADIY.js.map → chunk-CZI2A4MQ.js.map} +0 -0
  116. /package/dist/{chunk-NP6EZT44.js.map → chunk-IQLVUT37.js.map} +0 -0
  117. /package/dist/{chunk-4PEFEETV.js.map → chunk-KIP6JLTF.js.map} +0 -0
  118. /package/dist/{chunk-WIBHRONM.js.map → chunk-XWH4MXIU.js.map} +0 -0
  119. /package/dist/{executor-723ZP6TH.js.map → executor-HSSRXDOB.js.map} +0 -0
  120. /package/dist/{noydb-VZ4JVW55.js.map → noydb-GZGFBA4E.js.map} +0 -0
  121. /package/dist/{stale-7FRJVHN6.js.map → stale-JH67FU57.js.map} +0 -0
  122. /package/dist/{vault-group-W7QC4UYW.js.map → vault-group-KOM7QRJG.js.map} +0 -0
@@ -1,10 +1,10 @@
1
- export { w as withMaterializedView } from '../with-materialized-view-DgQcAjYv.cjs';
2
- import { aY as Collection, aK as TxContext, bz as MVQueryContext, bA as RegisteredMV, bB as MaterializedViewRegistry } from '../types-V5R2-pd4.cjs';
3
- export { bC as MaterializedFromMeta, bD as MaterializedViewOutput, aV as MaterializedViewStrategy, aW as MaterializedViewStrategyHandle, bE as UnionSource } from '../types-V5R2-pd4.cjs';
4
- import { Q as Query } from '../index-CUVOMtgg.cjs';
5
- export { a3 as MaterializedViewConfigError, a4 as MaterializedViewCycleError, a5 as MaterializedViewSourceUnknownError, a6 as MaterializedViewTooLargeError } from '../strategy-CrS7PnbE.cjs';
6
- import '../lazy-builder-Ci5_YG73.cjs';
7
- import '../predicate-Bt5ft-9c.cjs';
1
+ export { w as withMaterializedView } from '../with-materialized-view-NzuxYPDF.cjs';
2
+ import { aY as Collection, aK as TxContext, bz as MVQueryContext, bA as RegisteredMV, bB as MaterializedViewRegistry } from '../types-BpPV5uyy.cjs';
3
+ export { bC as MaterializedFromMeta, bD as MaterializedViewOutput, aV as MaterializedViewStrategy, aW as MaterializedViewStrategyHandle, bE as UnionSource } from '../types-BpPV5uyy.cjs';
4
+ import { Q as Query } from '../index-D95VK1Qy.cjs';
5
+ export { a3 as MaterializedViewConfigError, a4 as MaterializedViewCycleError, a5 as MaterializedViewSourceUnknownError, a6 as MaterializedViewTooLargeError } from '../strategy-CbneC7bS.cjs';
6
+ import '../lazy-builder-eYZzLEL1.cjs';
7
+ import '../predicate-BmhBSPCH.cjs';
8
8
  import '../strategy-BSxFXGzb.cjs';
9
9
  import '@noy-db/attestation';
10
10
 
@@ -1,10 +1,10 @@
1
- export { w as withMaterializedView } from '../with-materialized-view-DwR4jkV5.js';
2
- import { aY as Collection, aK as TxContext, bz as MVQueryContext, bA as RegisteredMV, bB as MaterializedViewRegistry } from '../types-BFHQUjdy.js';
3
- export { bC as MaterializedFromMeta, bD as MaterializedViewOutput, aV as MaterializedViewStrategy, aW as MaterializedViewStrategyHandle, bE as UnionSource } from '../types-BFHQUjdy.js';
4
- import { Q as Query } from '../index-Cqzp4tt9.js';
5
- export { a3 as MaterializedViewConfigError, a4 as MaterializedViewCycleError, a5 as MaterializedViewSourceUnknownError, a6 as MaterializedViewTooLargeError } from '../strategy-CrS7PnbE.js';
6
- import '../lazy-builder-D5GU14TS.js';
7
- import '../predicate-Bt5ft-9c.js';
1
+ export { w as withMaterializedView } from '../with-materialized-view-Dt-ufPWQ.js';
2
+ import { aY as Collection, aK as TxContext, bz as MVQueryContext, bA as RegisteredMV, bB as MaterializedViewRegistry } from '../types-4t1-tWS4.js';
3
+ export { bC as MaterializedFromMeta, bD as MaterializedViewOutput, aV as MaterializedViewStrategy, aW as MaterializedViewStrategyHandle, bE as UnionSource } from '../types-4t1-tWS4.js';
4
+ import { Q as Query } from '../index-XNB2r6bX.js';
5
+ export { a3 as MaterializedViewConfigError, a4 as MaterializedViewCycleError, a5 as MaterializedViewSourceUnknownError, a6 as MaterializedViewTooLargeError } from '../strategy-CbneC7bS.js';
6
+ import '../lazy-builder-ChSqcF5t.js';
7
+ import '../predicate-BmhBSPCH.js';
8
8
  import '../strategy-BSxFXGzb.js';
9
9
  import '@noy-db/attestation';
10
10
 
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  withMaterializedView
3
- } from "../chunk-ZWTNWAO4.js";
3
+ } from "../chunk-NU6Q3FOR.js";
4
4
  import {
5
5
  clearMVStale,
6
6
  isMVStale,
7
7
  markMVStale,
8
8
  resolveStaleMVOnRead
9
- } from "../chunk-4PEFEETV.js";
9
+ } from "../chunk-KIP6JLTF.js";
10
10
  import {
11
11
  MaterializedViewExecutor
12
- } from "../chunk-UWNYBOOO.js";
12
+ } from "../chunk-C5T5AFWN.js";
13
13
  import {
14
14
  MaterializedViewRegistry,
15
15
  analyzeDependencies,
@@ -17,8 +17,8 @@ import {
17
17
  computeQueryHash,
18
18
  summarizeQueryPlan
19
19
  } from "../chunk-5LQG6ZO2.js";
20
- import "../chunk-3EWA37FV.js";
21
- import "../chunk-TV3YZ35S.js";
20
+ import "../chunk-3EWXMOK3.js";
21
+ import "../chunk-CJORTUJ2.js";
22
22
  import {
23
23
  MaterializedViewConfigError,
24
24
  MaterializedViewCycleError,
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  Noydb,
3
3
  createNoydb
4
- } from "./chunk-ACKFRSAH.js";
4
+ } from "./chunk-7EFFHEN5.js";
5
5
  import "./chunk-ZC7J6ZYV.js";
6
6
  import "./chunk-EMIGCR7X.js";
7
7
  import "./chunk-YHPM5D7Y.js";
8
8
  import "./chunk-OHVFWCJP.js";
9
- import "./chunk-YNTBADIY.js";
9
+ import "./chunk-CZI2A4MQ.js";
10
10
  import "./chunk-WGHU7BLI.js";
11
11
  import "./chunk-DKO2QFSA.js";
12
12
  import "./chunk-KI6HAJWL.js";
@@ -19,11 +19,11 @@ import "./chunk-2QR2PQTT.js";
19
19
  import "./chunk-FZU343FL.js";
20
20
  import "./chunk-56DJ7JVK.js";
21
21
  import "./chunk-Z6FNBOTC.js";
22
- import "./chunk-KGCORI4L.js";
23
- import "./chunk-WIBHRONM.js";
24
- import "./chunk-NP6EZT44.js";
25
- import "./chunk-3EWA37FV.js";
26
- import "./chunk-TV3YZ35S.js";
22
+ import "./chunk-EYVQHAGH.js";
23
+ import "./chunk-XWH4MXIU.js";
24
+ import "./chunk-IQLVUT37.js";
25
+ import "./chunk-3EWXMOK3.js";
26
+ import "./chunk-CJORTUJ2.js";
27
27
  import "./chunk-6AJBSQU4.js";
28
28
  import "./chunk-GC4V7RU7.js";
29
29
  import "./chunk-YULZKK4F.js";
@@ -32,4 +32,4 @@ export {
32
32
  Noydb,
33
33
  createNoydb
34
34
  };
35
- //# sourceMappingURL=noydb-VZ4JVW55.js.map
35
+ //# sourceMappingURL=noydb-GZGFBA4E.js.map
@@ -1,11 +1,11 @@
1
- export { w as withOverlayedView } from '../with-overlayed-view-7-rUB3vD.cjs';
2
- import { aX as OverlayedViewStrategy, aY as Collection } from '../types-V5R2-pd4.cjs';
3
- export { aZ as OverlayedViewRegistry, a_ as OverlayedViewStrategyHandle } from '../types-V5R2-pd4.cjs';
4
- export { P as OverlayBaseIsVirtualError, Q as OverlayCollectionUnavailableError, U as OverlayIdMismatchError, V as OverlayNameCollisionError } from '../strategy-CrS7PnbE.cjs';
5
- import '../lazy-builder-Ci5_YG73.cjs';
6
- import '../predicate-Bt5ft-9c.cjs';
1
+ export { w as withOverlayedView } from '../with-overlayed-view-CC0_ocy-.cjs';
2
+ import { aX as OverlayedViewStrategy, aY as Collection } from '../types-BpPV5uyy.cjs';
3
+ export { aZ as OverlayedViewRegistry, a_ as OverlayedViewStrategyHandle } from '../types-BpPV5uyy.cjs';
4
+ export { P as OverlayBaseIsVirtualError, Q as OverlayCollectionUnavailableError, U as OverlayIdMismatchError, V as OverlayNameCollisionError } from '../strategy-CbneC7bS.cjs';
5
+ import '../lazy-builder-eYZzLEL1.cjs';
6
+ import '../predicate-BmhBSPCH.cjs';
7
7
  import '../strategy-BSxFXGzb.cjs';
8
- import '../index-CUVOMtgg.cjs';
8
+ import '../index-D95VK1Qy.cjs';
9
9
  import '@noy-db/attestation';
10
10
 
11
11
  /**
@@ -1,11 +1,11 @@
1
- export { w as withOverlayedView } from '../with-overlayed-view-ByyhHdVr.js';
2
- import { aX as OverlayedViewStrategy, aY as Collection } from '../types-BFHQUjdy.js';
3
- export { aZ as OverlayedViewRegistry, a_ as OverlayedViewStrategyHandle } from '../types-BFHQUjdy.js';
4
- export { P as OverlayBaseIsVirtualError, Q as OverlayCollectionUnavailableError, U as OverlayIdMismatchError, V as OverlayNameCollisionError } from '../strategy-CrS7PnbE.js';
5
- import '../lazy-builder-D5GU14TS.js';
6
- import '../predicate-Bt5ft-9c.js';
1
+ export { w as withOverlayedView } from '../with-overlayed-view-eDvMs6LO.js';
2
+ import { aX as OverlayedViewStrategy, aY as Collection } from '../types-4t1-tWS4.js';
3
+ export { aZ as OverlayedViewRegistry, a_ as OverlayedViewStrategyHandle } from '../types-4t1-tWS4.js';
4
+ export { P as OverlayBaseIsVirtualError, Q as OverlayCollectionUnavailableError, U as OverlayIdMismatchError, V as OverlayNameCollisionError } from '../strategy-CbneC7bS.js';
5
+ import '../lazy-builder-ChSqcF5t.js';
6
+ import '../predicate-BmhBSPCH.js';
7
7
  import '../strategy-BSxFXGzb.js';
8
- import '../index-Cqzp4tt9.js';
8
+ import '../index-XNB2r6bX.js';
9
9
  import '@noy-db/attestation';
10
10
 
11
11
  /**
@@ -1,10 +1,10 @@
1
- import { ag as PeriodsStrategy } from '../types-V5R2-pd4.cjs';
2
- export { ah as CarryForwardContext, ai as ClosePeriodOptions, aj as OpenPeriodOptions, ak as PERIODS_COLLECTION, al as PeriodRecord, am as ReadOnlyCollection, an as appendPeriodLedgerEntry, ao as assertTsWritable, ap as chainAnchor, aq as loadPeriods, ar as validatePeriodName } from '../types-V5R2-pd4.cjs';
3
- import '../lazy-builder-Ci5_YG73.cjs';
4
- import '../predicate-Bt5ft-9c.cjs';
5
- import '../strategy-CrS7PnbE.cjs';
1
+ import { ag as PeriodsStrategy } from '../types-BpPV5uyy.cjs';
2
+ export { ah as CarryForwardContext, ai as ClosePeriodOptions, aj as OpenPeriodOptions, ak as PERIODS_COLLECTION, al as PeriodRecord, am as ReadOnlyCollection, an as appendPeriodLedgerEntry, ao as assertTsWritable, ap as chainAnchor, aq as loadPeriods, ar as validatePeriodName } from '../types-BpPV5uyy.cjs';
3
+ import '../lazy-builder-eYZzLEL1.cjs';
4
+ import '../predicate-BmhBSPCH.cjs';
5
+ import '../strategy-CbneC7bS.cjs';
6
6
  import '../strategy-BSxFXGzb.cjs';
7
- import '../index-CUVOMtgg.cjs';
7
+ import '../index-D95VK1Qy.cjs';
8
8
  import '@noy-db/attestation';
9
9
 
10
10
  /**
@@ -1,10 +1,10 @@
1
- import { ag as PeriodsStrategy } from '../types-BFHQUjdy.js';
2
- export { ah as CarryForwardContext, ai as ClosePeriodOptions, aj as OpenPeriodOptions, ak as PERIODS_COLLECTION, al as PeriodRecord, am as ReadOnlyCollection, an as appendPeriodLedgerEntry, ao as assertTsWritable, ap as chainAnchor, aq as loadPeriods, ar as validatePeriodName } from '../types-BFHQUjdy.js';
3
- import '../lazy-builder-D5GU14TS.js';
4
- import '../predicate-Bt5ft-9c.js';
5
- import '../strategy-CrS7PnbE.js';
1
+ import { ag as PeriodsStrategy } from '../types-4t1-tWS4.js';
2
+ export { ah as CarryForwardContext, ai as ClosePeriodOptions, aj as OpenPeriodOptions, ak as PERIODS_COLLECTION, al as PeriodRecord, am as ReadOnlyCollection, an as appendPeriodLedgerEntry, ao as assertTsWritable, ap as chainAnchor, aq as loadPeriods, ar as validatePeriodName } from '../types-4t1-tWS4.js';
3
+ import '../lazy-builder-ChSqcF5t.js';
4
+ import '../predicate-BmhBSPCH.js';
5
+ import '../strategy-CbneC7bS.js';
6
6
  import '../strategy-BSxFXGzb.js';
7
- import '../index-Cqzp4tt9.js';
7
+ import '../index-XNB2r6bX.js';
8
8
  import '@noy-db/attestation';
9
9
 
10
10
  /**
@@ -104,12 +104,55 @@ declare class CollectionIndexes {
104
104
  lookupIn(field: string, values: readonly unknown[]): ReadonlySet<string> | null;
105
105
  }
106
106
 
107
+ /**
108
+ * Money-aware `where()` comparison (#336).
109
+ *
110
+ * Query clauses evaluate against RAW stored records — money decode
111
+ * happens on output only (#322) — so a money field's stored form is a
112
+ * scaled-integer digit string (`'1000000'`) while the caller naturally
113
+ * writes the operand in major units (`10000`, `'10000.00'`). Without a
114
+ * rewrite the comparison is silently wrong by the scale factor, and a
115
+ * string-vs-number comparison is excluded by `isComparable` anyway.
116
+ *
117
+ * Two halves:
118
+ *
119
+ * - {@link moneyFieldClause} runs at QUERY BUILD time: it quantizes the
120
+ * caller's major-unit operand into stored scaled-int space via the
121
+ * same `parseToScaledInt` path as writes, so a malformed operand
122
+ * throws at `.where()` — not silently filters everything out.
123
+ * - {@link evaluateMoneyClause} runs per record and compares
124
+ * `BigInt`-exact in scaled space (exact past 2^53, like the rest of
125
+ * the money subsystem).
126
+ *
127
+ * Currency semantics (multi mode): an operand carries one currency —
128
+ * explicit via `{ amount, currency }`, or the descriptor's sole allowed
129
+ * currency for a bare amount. A record in a DIFFERENT currency has no
130
+ * defined order against the operand: it matches `!=` and nothing else.
131
+ */
132
+
133
+ /** One quantized operand value: scaled digit string + its currency. */
134
+ interface MoneyOperandEntry {
135
+ readonly scaled: string;
136
+ readonly currency: string;
137
+ }
138
+ /**
139
+ * The money payload attached to a {@link FieldClause} over a declared
140
+ * money field. `entries` holds one element for comparison ops, two for
141
+ * `between` (lo, hi — same currency), N for `in`.
142
+ */
143
+ interface MoneyWhereOperand {
144
+ readonly mode: 'fixed' | 'multi';
145
+ readonly entries: ReadonlyArray<MoneyOperandEntry>;
146
+ }
147
+
107
148
  /**
108
149
  * Operator implementations for the query DSL.
109
150
  *
110
151
  * All predicates run client-side, AFTER decryption — they never see ciphertext.
111
- * This file is dependency-free and tree-shakeable.
152
+ * The only dependency is the money clause evaluator (#336) — still
153
+ * tree-shakeable through it.
112
154
  */
155
+
113
156
  /** Comparison operators supported by the where() builder. */
114
157
  type Operator = '==' | '!=' | '<' | '<=' | '>' | '>=' | 'in' | 'contains' | 'startsWith' | 'between';
115
158
  /**
@@ -121,6 +164,14 @@ interface FieldClause {
121
164
  readonly field: string;
122
165
  readonly op: Operator;
123
166
  readonly value: unknown;
167
+ /**
168
+ * Present when `field` is a declared money field (#336): the operand
169
+ * quantized into stored scaled-int space at query BUILD time, so the
170
+ * per-record comparison is BigInt-exact against the raw stored value.
171
+ * Built by `moneyFieldClause` — `Query.where()` attaches it when the
172
+ * source declares the field in `moneyFields`.
173
+ */
174
+ readonly money?: MoneyWhereOperand;
124
175
  }
125
176
  /**
126
177
  * A user-supplied predicate function escape hatch. Not serializable.
@@ -204,7 +255,13 @@ declare function evaluateFieldClause(record: unknown, clause: FieldClause): bool
204
255
  * Evaluate any clause (field / filter / group) against a record.
205
256
  * The recursion depth is bounded by the user's query expression — no risk of
206
257
  * blowing the stack on a 50K-record collection.
258
+ *
259
+ * `fnRecord`, when provided, is the view handed to USER CALLBACK clauses
260
+ * (`filter` / `wherePredicate`) instead of `record` — the executor passes
261
+ * the money-decoded view there (#335) so user code never sees the stored
262
+ * scaled-int form, while field clauses keep evaluating against the raw
263
+ * record (their money operands are pre-quantized to that space, #336).
207
264
  */
208
- declare function evaluateClause(record: unknown, clause: Clause): boolean;
265
+ declare function evaluateClause(record: unknown, clause: Clause, fnRecord?: unknown): boolean;
209
266
 
210
267
  export { CollectionIndexes as C, type FieldClause as F, type GroupClause as G, type HashIndex as H, type IndexDef as I, type Operator as O, type Clause as a, type FilterClause as b, evaluateFieldClause as c, type CrossJoinClause as d, evaluateClause as e, readPath as r };
@@ -104,12 +104,55 @@ declare class CollectionIndexes {
104
104
  lookupIn(field: string, values: readonly unknown[]): ReadonlySet<string> | null;
105
105
  }
106
106
 
107
+ /**
108
+ * Money-aware `where()` comparison (#336).
109
+ *
110
+ * Query clauses evaluate against RAW stored records — money decode
111
+ * happens on output only (#322) — so a money field's stored form is a
112
+ * scaled-integer digit string (`'1000000'`) while the caller naturally
113
+ * writes the operand in major units (`10000`, `'10000.00'`). Without a
114
+ * rewrite the comparison is silently wrong by the scale factor, and a
115
+ * string-vs-number comparison is excluded by `isComparable` anyway.
116
+ *
117
+ * Two halves:
118
+ *
119
+ * - {@link moneyFieldClause} runs at QUERY BUILD time: it quantizes the
120
+ * caller's major-unit operand into stored scaled-int space via the
121
+ * same `parseToScaledInt` path as writes, so a malformed operand
122
+ * throws at `.where()` — not silently filters everything out.
123
+ * - {@link evaluateMoneyClause} runs per record and compares
124
+ * `BigInt`-exact in scaled space (exact past 2^53, like the rest of
125
+ * the money subsystem).
126
+ *
127
+ * Currency semantics (multi mode): an operand carries one currency —
128
+ * explicit via `{ amount, currency }`, or the descriptor's sole allowed
129
+ * currency for a bare amount. A record in a DIFFERENT currency has no
130
+ * defined order against the operand: it matches `!=` and nothing else.
131
+ */
132
+
133
+ /** One quantized operand value: scaled digit string + its currency. */
134
+ interface MoneyOperandEntry {
135
+ readonly scaled: string;
136
+ readonly currency: string;
137
+ }
138
+ /**
139
+ * The money payload attached to a {@link FieldClause} over a declared
140
+ * money field. `entries` holds one element for comparison ops, two for
141
+ * `between` (lo, hi — same currency), N for `in`.
142
+ */
143
+ interface MoneyWhereOperand {
144
+ readonly mode: 'fixed' | 'multi';
145
+ readonly entries: ReadonlyArray<MoneyOperandEntry>;
146
+ }
147
+
107
148
  /**
108
149
  * Operator implementations for the query DSL.
109
150
  *
110
151
  * All predicates run client-side, AFTER decryption — they never see ciphertext.
111
- * This file is dependency-free and tree-shakeable.
152
+ * The only dependency is the money clause evaluator (#336) — still
153
+ * tree-shakeable through it.
112
154
  */
155
+
113
156
  /** Comparison operators supported by the where() builder. */
114
157
  type Operator = '==' | '!=' | '<' | '<=' | '>' | '>=' | 'in' | 'contains' | 'startsWith' | 'between';
115
158
  /**
@@ -121,6 +164,14 @@ interface FieldClause {
121
164
  readonly field: string;
122
165
  readonly op: Operator;
123
166
  readonly value: unknown;
167
+ /**
168
+ * Present when `field` is a declared money field (#336): the operand
169
+ * quantized into stored scaled-int space at query BUILD time, so the
170
+ * per-record comparison is BigInt-exact against the raw stored value.
171
+ * Built by `moneyFieldClause` — `Query.where()` attaches it when the
172
+ * source declares the field in `moneyFields`.
173
+ */
174
+ readonly money?: MoneyWhereOperand;
124
175
  }
125
176
  /**
126
177
  * A user-supplied predicate function escape hatch. Not serializable.
@@ -204,7 +255,13 @@ declare function evaluateFieldClause(record: unknown, clause: FieldClause): bool
204
255
  * Evaluate any clause (field / filter / group) against a record.
205
256
  * The recursion depth is bounded by the user's query expression — no risk of
206
257
  * blowing the stack on a 50K-record collection.
258
+ *
259
+ * `fnRecord`, when provided, is the view handed to USER CALLBACK clauses
260
+ * (`filter` / `wherePredicate`) instead of `record` — the executor passes
261
+ * the money-decoded view there (#335) so user code never sees the stored
262
+ * scaled-int form, while field clauses keep evaluating against the raw
263
+ * record (their money operands are pre-quantized to that space, #336).
207
264
  */
208
- declare function evaluateClause(record: unknown, clause: Clause): boolean;
265
+ declare function evaluateClause(record: unknown, clause: Clause, fnRecord?: unknown): boolean;
209
266
 
210
267
  export { CollectionIndexes as C, type FieldClause as F, type GroupClause as G, type HashIndex as H, type IndexDef as I, type Operator as O, type Clause as a, type FilterClause as b, evaluateFieldClause as c, type CrossJoinClause as d, evaluateClause as e, readPath as r };