@noy-db/hub 0.2.0-pre.3 → 0.2.0-pre.31

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 (384) hide show
  1. package/README.md +126 -0
  2. package/dist/adapter/index.d.ts +9 -0
  3. package/dist/adapter/index.js +14 -0
  4. package/dist/aggregate/index.d.ts +3 -2
  5. package/dist/aggregate/index.js +10 -8
  6. package/dist/aggregate/index.js.map +1 -1
  7. package/dist/attestation/index.d.ts +7 -5
  8. package/dist/attestation/index.js +7 -6
  9. package/dist/attestation/index.js.map +1 -1
  10. package/dist/blobs/index.d.ts +9 -7
  11. package/dist/blobs/index.js +12 -6
  12. package/dist/blobs/index.js.map +1 -1
  13. package/dist/bundle/index.d.ts +29 -18
  14. package/dist/bundle/index.js +53 -192
  15. package/dist/bundle/index.js.map +1 -1
  16. package/dist/{chunk-75QDHSE4.js → chunk-2QDWRK3B.js} +5 -5
  17. package/dist/{chunk-74JEQFMT.js → chunk-2UT7HJJR.js} +5 -5
  18. package/dist/chunk-2UT7HJJR.js.map +1 -0
  19. package/dist/{chunk-FCDO7UAO.js → chunk-2ZYIN3BL.js} +2 -2
  20. package/dist/{chunk-BFI3RS42.js → chunk-33EQCZXE.js} +2 -2
  21. package/dist/chunk-33EQCZXE.js.map +1 -0
  22. package/dist/{chunk-WRLHNG6H.js → chunk-4K4QKYK4.js} +4 -4
  23. package/dist/chunk-4K4QKYK4.js.map +1 -0
  24. package/dist/{chunk-HGZ7DC5H.js → chunk-4L6N56B4.js} +2 -2
  25. package/dist/chunk-4L6N56B4.js.map +1 -0
  26. package/dist/{chunk-YMYK7US4.js → chunk-4YD7VZH4.js} +2 -2
  27. package/dist/chunk-4YD7VZH4.js.map +1 -0
  28. package/dist/{chunk-ZUMGGHRB.js → chunk-5PTX7PKD.js} +4 -4
  29. package/dist/{chunk-QAU5HM6Q.js → chunk-6EKRQ7QF.js} +3 -3
  30. package/dist/{chunk-ZC2AAE6J.js → chunk-7GPQPLGO.js} +19 -4
  31. package/dist/chunk-7GPQPLGO.js.map +1 -0
  32. package/dist/{chunk-EPK6A3WJ.js → chunk-A3JMGXPG.js} +2 -2
  33. package/dist/chunk-A3JMGXPG.js.map +1 -0
  34. package/dist/{chunk-FXQYZNOW.js → chunk-A7DNZVAV.js} +1 -1
  35. package/dist/chunk-A7DNZVAV.js.map +1 -0
  36. package/dist/{chunk-UMLVJTYV.js → chunk-ADB7GPM3.js} +7 -4
  37. package/dist/chunk-ADB7GPM3.js.map +1 -0
  38. package/dist/{chunk-YL2DR3HY.js → chunk-ASIGWYRA.js} +2 -2
  39. package/dist/chunk-ASIGWYRA.js.map +1 -0
  40. package/dist/{chunk-2EYC3WDT.js → chunk-AWU4JF7C.js} +93 -93
  41. package/dist/chunk-AWU4JF7C.js.map +1 -0
  42. package/dist/chunk-BEZ2EV43.js +129 -0
  43. package/dist/chunk-BEZ2EV43.js.map +1 -0
  44. package/dist/{chunk-IS5HWQO7.js → chunk-CIZDUAHI.js} +30 -4
  45. package/dist/chunk-CIZDUAHI.js.map +1 -0
  46. package/dist/{chunk-4OQWR46B.js → chunk-CUPTCF4R.js} +5 -5
  47. package/dist/chunk-CUPTCF4R.js.map +1 -0
  48. package/dist/{chunk-5ZGZ6HIZ.js → chunk-DEE4CRYN.js} +30 -7
  49. package/dist/chunk-DEE4CRYN.js.map +1 -0
  50. package/dist/{chunk-UOF74WQY.js → chunk-E2MDPPOC.js} +37 -2
  51. package/dist/chunk-E2MDPPOC.js.map +1 -0
  52. package/dist/{chunk-SAVQ6E2O.js → chunk-FFKQ65YX.js} +10 -3
  53. package/dist/chunk-FFKQ65YX.js.map +1 -0
  54. package/dist/{chunk-2XLVPKXG.js → chunk-G7ALNCQH.js} +10 -2
  55. package/dist/chunk-G7ALNCQH.js.map +1 -0
  56. package/dist/chunk-GGXN73NM.js +252 -0
  57. package/dist/chunk-GGXN73NM.js.map +1 -0
  58. package/dist/{chunk-UVPGJXVO.js → chunk-JOJPBZSZ.js} +5 -5
  59. package/dist/{chunk-YDLAFP36.js → chunk-JZ5DS4DP.js} +346 -3
  60. package/dist/chunk-JZ5DS4DP.js.map +1 -0
  61. package/dist/{chunk-KMI2NBBF.js → chunk-K4JID2ZE.js} +44 -8
  62. package/dist/chunk-K4JID2ZE.js.map +1 -0
  63. package/dist/{aggregate/index.cjs → chunk-K6NVSHAH.js} +241 -210
  64. package/dist/chunk-K6NVSHAH.js.map +1 -0
  65. package/dist/chunk-KJ3K5VZM.js +524 -0
  66. package/dist/chunk-KJ3K5VZM.js.map +1 -0
  67. package/dist/chunk-L5HHBOMS.js +232 -0
  68. package/dist/chunk-L5HHBOMS.js.map +1 -0
  69. package/dist/{chunk-YK72A4IT.js → chunk-LBILABKZ.js} +4 -4
  70. package/dist/chunk-LXKBG52H.js +151 -0
  71. package/dist/chunk-LXKBG52H.js.map +1 -0
  72. package/dist/{chunk-NGSPBLLE.js → chunk-MPIZQGFA.js} +50 -20
  73. package/dist/chunk-MPIZQGFA.js.map +1 -0
  74. package/dist/{chunk-4X2S7PBF.js → chunk-MRJPSXPE.js} +84 -70
  75. package/dist/chunk-MRJPSXPE.js.map +1 -0
  76. package/dist/{chunk-6S3LLAQ5.js → chunk-MSMDDDDJ.js} +3 -3
  77. package/dist/{chunk-6S3LLAQ5.js.map → chunk-MSMDDDDJ.js.map} +1 -1
  78. package/dist/{chunk-GAUBWHAF.js → chunk-OCYFFBZS.js} +4 -4
  79. package/dist/{chunk-NCO2JGKK.js → chunk-PDVP3C2I.js} +1 -1
  80. package/dist/chunk-PDVP3C2I.js.map +1 -0
  81. package/dist/chunk-PZ5AY32C.js +10 -0
  82. package/dist/{chunk-P6256WTJ.js → chunk-QBLPY44S.js} +3 -3
  83. package/dist/chunk-QBLPY44S.js.map +1 -0
  84. package/dist/{query/index.cjs → chunk-QGBBQKDS.js} +706 -831
  85. package/dist/chunk-QGBBQKDS.js.map +1 -0
  86. package/dist/{chunk-FS7A4XNF.js → chunk-QWJCNXH2.js} +3 -3
  87. package/dist/chunk-QXWJQ7UU.js +380 -0
  88. package/dist/chunk-QXWJQ7UU.js.map +1 -0
  89. package/dist/{chunk-GDTCGIPX.js → chunk-RCB6GWTC.js} +27 -5
  90. package/dist/chunk-RCB6GWTC.js.map +1 -0
  91. package/dist/{chunk-K5PVGKE4.js → chunk-SAAJYSVV.js} +2 -2
  92. package/dist/{chunk-G7PAZ3TD.js → chunk-SHJ3BRTZ.js} +46 -10
  93. package/dist/chunk-SHJ3BRTZ.js.map +1 -0
  94. package/dist/chunk-SQXTKZL7.js +125 -0
  95. package/dist/chunk-SQXTKZL7.js.map +1 -0
  96. package/dist/chunk-STNPB3UM.js +9 -0
  97. package/dist/chunk-STNPB3UM.js.map +1 -0
  98. package/dist/{chunk-NSLTPGEN.js → chunk-TMUMMAWV.js} +12 -2
  99. package/dist/{chunk-NSLTPGEN.js.map → chunk-TMUMMAWV.js.map} +1 -1
  100. package/dist/{chunk-LS3JLEIB.js → chunk-TZGWI5AX.js} +4 -4
  101. package/dist/{chunk-GD3BGKAR.js → chunk-UBF5JEOJ.js} +44 -5
  102. package/dist/chunk-UBF5JEOJ.js.map +1 -0
  103. package/dist/{chunk-T6HQMVML.js → chunk-W5NVNJDX.js} +5250 -801
  104. package/dist/chunk-W5NVNJDX.js.map +1 -0
  105. package/dist/chunk-XAYDHD2O.js +123 -0
  106. package/dist/chunk-XAYDHD2O.js.map +1 -0
  107. package/dist/{chunk-LOL725S4.js → chunk-XYW2CSCI.js} +31 -3
  108. package/dist/chunk-XYW2CSCI.js.map +1 -0
  109. package/dist/{chunk-TLFUDXVV.js → chunk-ZCMOS4H2.js} +31 -10
  110. package/dist/chunk-ZCMOS4H2.js.map +1 -0
  111. package/dist/{chunk-FBMXWVGP.js → chunk-ZK66B5EY.js} +450 -30
  112. package/dist/chunk-ZK66B5EY.js.map +1 -0
  113. package/dist/{chunk-GVXBHCZ2.js → chunk-ZPJSQPQH.js} +66 -7
  114. package/dist/chunk-ZPJSQPQH.js.map +1 -0
  115. package/dist/consent/index.d.ts +8 -6
  116. package/dist/consent/index.js +4 -3
  117. package/dist/consent/index.js.map +1 -1
  118. package/dist/crdt/index.js +1 -0
  119. package/dist/crdt/index.js.map +1 -1
  120. package/dist/{crypto-H2Y3DDFW.js → crypto-OSIV2IIW.js} +8 -3
  121. package/dist/{ulid-CiM2OAeM.d.ts → decrypt-partition-CXS5KopB.d.ts} +37 -82
  122. package/dist/{delegation-QSC7G5QC.js → delegation-BQTRJATI.js} +6 -5
  123. package/dist/derivations/index.d.ts +11 -9
  124. package/dist/derivations/index.js +9 -6
  125. package/dist/{dev-unlock-Cf2B7Kih.d.ts → dev-unlock-CnHTTVea.d.ts} +1 -1
  126. package/dist/discriminant-BN9REW3o.d.ts +60 -0
  127. package/dist/errors-BAWO5Z5a.d.ts +1500 -0
  128. package/dist/executor-KYSKFJ2R.js +9 -0
  129. package/dist/executor-M7W3NEKR.js +9 -0
  130. package/dist/executor-VDTDGWO6.js +13 -0
  131. package/dist/{fanout-sidecar-NRBWSLRK.js → fanout-sidecar-AZALISHB.js} +3 -2
  132. package/dist/fanout-sidecar-AZALISHB.js.map +1 -0
  133. package/dist/forget/index.d.ts +1 -0
  134. package/dist/forget/index.js +15 -0
  135. package/dist/guards/index.d.ts +16 -8
  136. package/dist/guards/index.js +12 -5
  137. package/dist/{hash-gVn_uKhp.d.ts → hash-oc5paYl0.d.ts} +1 -1
  138. package/dist/history/index.d.ts +9 -7
  139. package/dist/history/index.js +10 -7
  140. package/dist/history/index.js.map +1 -1
  141. package/dist/i18n/index.d.ts +8 -6
  142. package/dist/i18n/index.js +116 -15
  143. package/dist/i18n/index.js.map +1 -1
  144. package/dist/index-BMmajblo.d.ts +362 -0
  145. package/dist/index-BmhGztUi.d.ts +93 -0
  146. package/dist/{types-D9eB0Rvh.d.ts → index-DHn9lEP0.d.ts} +4305 -1523
  147. package/dist/{index-BF1B2HB9.d.ts → index-Ddm8D3Oo.d.ts} +186 -1151
  148. package/dist/index.d.ts +342 -70
  149. package/dist/index.js +420 -112
  150. package/dist/index.js.map +1 -1
  151. package/dist/indexing/index.d.ts +3 -3
  152. package/dist/indexing/index.js +5 -4
  153. package/dist/indexing/index.js.map +1 -1
  154. package/dist/issue-DPHRF2TI.js +13 -0
  155. package/dist/kernel/index.d.ts +11 -0
  156. package/dist/kernel/index.js +50 -0
  157. package/dist/{lazy-builder-Rpd-V3jP.d.ts → lazy-builder-ChSqcF5t.d.ts} +2 -2
  158. package/dist/{ledger-WOEJUYTP.js → ledger-CI7GSMLB.js} +7 -6
  159. package/dist/materialized-views/index.d.ts +23 -20
  160. package/dist/materialized-views/index.js +9 -7
  161. package/dist/mime-magic-JeLKHRng.d.ts +103 -0
  162. package/dist/noydb-NAU2DTFP.js +40 -0
  163. package/dist/overlay-views/index.d.ts +32 -12
  164. package/dist/overlay-views/index.js +7 -6
  165. package/dist/periods/index.d.ts +8 -6
  166. package/dist/periods/index.js +7 -6
  167. package/dist/{predicate-Dnu81tsS.d.cts → predicate-BmhBSPCH.d.ts} +87 -5
  168. package/dist/{public-envelope-OHQ5UZFM.js → public-envelope-MFMBFJLZ.js} +5 -4
  169. package/dist/query/index.d.ts +4 -3
  170. package/dist/query/index.js +14 -6
  171. package/dist/read-only-facade-3OQRZ3VS.js +8 -0
  172. package/dist/registry-IX5WKK4F.js +8 -0
  173. package/dist/registry-LMHO5265.js +11 -0
  174. package/dist/registry-TXCKWH26.js +9 -0
  175. package/dist/registry-VFEDQSYV.js +9 -0
  176. package/dist/revoke-5PUOZPJJ.js +18 -0
  177. package/dist/revoke-5PUOZPJJ.js.map +1 -0
  178. package/dist/sealed-record/index.d.ts +123 -0
  179. package/dist/sealed-record/index.js +43 -0
  180. package/dist/sealed-record/index.js.map +1 -0
  181. package/dist/session/index.d.ts +9 -7
  182. package/dist/session/index.js +4 -3
  183. package/dist/session/index.js.map +1 -1
  184. package/dist/shadow/index.d.ts +8 -6
  185. package/dist/shadow/index.js +3 -2
  186. package/dist/shadow/index.js.map +1 -1
  187. package/dist/{signer-M4K5HBLD.js → signer-UB5TQOZ6.js} +6 -5
  188. package/dist/signer-UB5TQOZ6.js.map +1 -0
  189. package/dist/snapshots/index.d.ts +30 -0
  190. package/dist/snapshots/index.js +153 -0
  191. package/dist/snapshots/index.js.map +1 -0
  192. package/dist/{stale-PAGCS4K5.js → stale-J3TUF5C5.js} +3 -2
  193. package/dist/stale-J3TUF5C5.js.map +1 -0
  194. package/dist/store/index.d.ts +15 -6
  195. package/dist/store/index.js +3 -2
  196. package/dist/{strategy-DSTrsZ8t.d.ts → strategy-8QGs5KQE.d.ts} +475 -7
  197. package/dist/sync/index.d.ts +7 -5
  198. package/dist/sync/index.js +5 -4
  199. package/dist/sync/index.js.map +1 -1
  200. package/dist/team/index.d.ts +8 -6
  201. package/dist/team/index.js +9 -8
  202. package/dist/transition-guard-Dy3NioQr.d.ts +165 -0
  203. package/dist/tx/index.d.ts +26 -8
  204. package/dist/tx/index.js +10 -5
  205. package/dist/tx/index.js.map +1 -1
  206. package/dist/ulid-DRH25k3y.d.ts +66 -0
  207. package/dist/{ulid-COREQ2RQ.js → ulid-KEPZMD2N.js} +2 -1
  208. package/dist/ulid-KEPZMD2N.js.map +1 -0
  209. package/dist/util/index.d.ts +2 -0
  210. package/dist/util/index.js +6 -1
  211. package/dist/util/index.js.map +1 -1
  212. package/dist/{with-materialized-view-qtoJ3xKJ.d.ts → with-materialized-view-DIVeez0W.d.ts} +2 -2
  213. package/dist/{with-overlayed-view-DFaRfgMr.d.ts → with-overlayed-view-DVZrc5Hb.d.ts} +2 -2
  214. package/dist/with-rollup-CbU-O4wP.d.ts +47 -0
  215. package/dist/zod-HAJM7LMS.js +14763 -0
  216. package/dist/zod-HAJM7LMS.js.map +1 -0
  217. package/package.json +73 -191
  218. package/dist/aggregate/index.cjs.map +0 -1
  219. package/dist/aggregate/index.d.cts +0 -38
  220. package/dist/attestation/index.cjs +0 -305
  221. package/dist/attestation/index.cjs.map +0 -1
  222. package/dist/attestation/index.d.cts +0 -52
  223. package/dist/blobs/index.cjs +0 -1480
  224. package/dist/blobs/index.cjs.map +0 -1
  225. package/dist/blobs/index.d.cts +0 -46
  226. package/dist/bundle/index.cjs +0 -18561
  227. package/dist/bundle/index.cjs.map +0 -1
  228. package/dist/bundle/index.d.cts +0 -176
  229. package/dist/chunk-2EYC3WDT.js.map +0 -1
  230. package/dist/chunk-2XLVPKXG.js.map +0 -1
  231. package/dist/chunk-4OQWR46B.js.map +0 -1
  232. package/dist/chunk-4UBOTYP5.js +0 -1367
  233. package/dist/chunk-4UBOTYP5.js.map +0 -1
  234. package/dist/chunk-4X2S7PBF.js.map +0 -1
  235. package/dist/chunk-5YHWBPOT.js +0 -19
  236. package/dist/chunk-5YHWBPOT.js.map +0 -1
  237. package/dist/chunk-5ZGZ6HIZ.js.map +0 -1
  238. package/dist/chunk-74JEQFMT.js.map +0 -1
  239. package/dist/chunk-A6SWRXUQ.js +0 -118
  240. package/dist/chunk-A6SWRXUQ.js.map +0 -1
  241. package/dist/chunk-BFI3RS42.js.map +0 -1
  242. package/dist/chunk-EMEX37ZN.js +0 -51
  243. package/dist/chunk-EMEX37ZN.js.map +0 -1
  244. package/dist/chunk-EPK6A3WJ.js.map +0 -1
  245. package/dist/chunk-FBMXWVGP.js.map +0 -1
  246. package/dist/chunk-FXQYZNOW.js.map +0 -1
  247. package/dist/chunk-G7PAZ3TD.js.map +0 -1
  248. package/dist/chunk-GD3BGKAR.js.map +0 -1
  249. package/dist/chunk-GDTCGIPX.js.map +0 -1
  250. package/dist/chunk-GVXBHCZ2.js.map +0 -1
  251. package/dist/chunk-HGZ7DC5H.js.map +0 -1
  252. package/dist/chunk-IS5HWQO7.js.map +0 -1
  253. package/dist/chunk-KMI2NBBF.js.map +0 -1
  254. package/dist/chunk-KYKMKLJ6.js +0 -340
  255. package/dist/chunk-KYKMKLJ6.js.map +0 -1
  256. package/dist/chunk-LOL725S4.js.map +0 -1
  257. package/dist/chunk-MRIBLZL3.js +0 -86
  258. package/dist/chunk-MRIBLZL3.js.map +0 -1
  259. package/dist/chunk-NCO2JGKK.js.map +0 -1
  260. package/dist/chunk-NGSPBLLE.js.map +0 -1
  261. package/dist/chunk-P6256WTJ.js.map +0 -1
  262. package/dist/chunk-SAVQ6E2O.js.map +0 -1
  263. package/dist/chunk-T6HQMVML.js.map +0 -1
  264. package/dist/chunk-TLFUDXVV.js.map +0 -1
  265. package/dist/chunk-UMLVJTYV.js.map +0 -1
  266. package/dist/chunk-UOF74WQY.js.map +0 -1
  267. package/dist/chunk-WRLHNG6H.js.map +0 -1
  268. package/dist/chunk-YDLAFP36.js.map +0 -1
  269. package/dist/chunk-YL2DR3HY.js.map +0 -1
  270. package/dist/chunk-YMYK7US4.js.map +0 -1
  271. package/dist/chunk-ZC2AAE6J.js.map +0 -1
  272. package/dist/consent/index.cjs +0 -204
  273. package/dist/consent/index.cjs.map +0 -1
  274. package/dist/consent/index.d.cts +0 -25
  275. package/dist/crdt/index.cjs +0 -152
  276. package/dist/crdt/index.cjs.map +0 -1
  277. package/dist/crdt/index.d.cts +0 -30
  278. package/dist/derivations/index.cjs +0 -351
  279. package/dist/derivations/index.cjs.map +0 -1
  280. package/dist/derivations/index.d.cts +0 -72
  281. package/dist/dev-unlock-De3mjQWv.d.cts +0 -263
  282. package/dist/executor-BZKFZVRC.js +0 -8
  283. package/dist/executor-GFZFDQXV.js +0 -8
  284. package/dist/executor-KT2IOZVP.js +0 -11
  285. package/dist/fanout-sidecar-NRBWSLRK.js.map +0 -1
  286. package/dist/guards/index.cjs +0 -322
  287. package/dist/guards/index.cjs.map +0 -1
  288. package/dist/guards/index.d.cts +0 -31
  289. package/dist/hash-vBCB0-Ps.d.cts +0 -63
  290. package/dist/history/index.cjs +0 -1222
  291. package/dist/history/index.cjs.map +0 -1
  292. package/dist/history/index.d.cts +0 -63
  293. package/dist/i18n/index.cjs +0 -840
  294. package/dist/i18n/index.cjs.map +0 -1
  295. package/dist/i18n/index.d.cts +0 -39
  296. package/dist/index-DVkvrgpm.d.cts +0 -2290
  297. package/dist/index.cjs +0 -23590
  298. package/dist/index.cjs.map +0 -1
  299. package/dist/index.d.cts +0 -778
  300. package/dist/indexing/index.cjs +0 -738
  301. package/dist/indexing/index.cjs.map +0 -1
  302. package/dist/indexing/index.d.cts +0 -36
  303. package/dist/issue-BAJ7ZB4S.js +0 -12
  304. package/dist/lazy-builder-C-rPfWG0.d.cts +0 -304
  305. package/dist/materialized-views/index.cjs +0 -837
  306. package/dist/materialized-views/index.cjs.map +0 -1
  307. package/dist/materialized-views/index.d.cts +0 -184
  308. package/dist/mime-magic-CBBSOkjm.d.cts +0 -50
  309. package/dist/mime-magic-CBBSOkjm.d.ts +0 -50
  310. package/dist/noydb-XNQSKXGO.js +0 -34
  311. package/dist/overlay-views/index.cjs +0 -359
  312. package/dist/overlay-views/index.cjs.map +0 -1
  313. package/dist/overlay-views/index.d.cts +0 -82
  314. package/dist/periods/index.cjs +0 -1041
  315. package/dist/periods/index.cjs.map +0 -1
  316. package/dist/periods/index.d.cts +0 -22
  317. package/dist/predicate-Dnu81tsS.d.ts +0 -185
  318. package/dist/query/index.cjs.map +0 -1
  319. package/dist/query/index.d.cts +0 -3
  320. package/dist/read-only-facade-ITU6L7BL.js +0 -7
  321. package/dist/registry-2IEARCGT.js +0 -7
  322. package/dist/registry-CDHASH73.js +0 -10
  323. package/dist/registry-EMGLZGR6.js +0 -8
  324. package/dist/registry-NQALYR77.js +0 -8
  325. package/dist/revoke-7JOVLZFD.js +0 -17
  326. package/dist/session/index.cjs +0 -495
  327. package/dist/session/index.cjs.map +0 -1
  328. package/dist/session/index.d.cts +0 -46
  329. package/dist/shadow/index.cjs +0 -133
  330. package/dist/shadow/index.cjs.map +0 -1
  331. package/dist/shadow/index.d.cts +0 -17
  332. package/dist/store/index.cjs +0 -1083
  333. package/dist/store/index.cjs.map +0 -1
  334. package/dist/store/index.d.cts +0 -492
  335. package/dist/strategy-BSxFXGzb.d.cts +0 -110
  336. package/dist/strategy-DSTrsZ8t.d.cts +0 -601
  337. package/dist/sync/index.cjs +0 -1062
  338. package/dist/sync/index.cjs.map +0 -1
  339. package/dist/sync/index.d.cts +0 -43
  340. package/dist/team/index.cjs +0 -2798
  341. package/dist/team/index.cjs.map +0 -1
  342. package/dist/team/index.d.cts +0 -118
  343. package/dist/tx/index.cjs +0 -544
  344. package/dist/tx/index.cjs.map +0 -1
  345. package/dist/tx/index.d.cts +0 -21
  346. package/dist/types-CSLcfytP.d.cts +0 -12493
  347. package/dist/ulid-CG2YvAbg.d.cts +0 -603
  348. package/dist/util/index.cjs +0 -230
  349. package/dist/util/index.cjs.map +0 -1
  350. package/dist/util/index.d.cts +0 -77
  351. package/dist/with-derivation-Bzpj6UTv.d.ts +0 -13
  352. package/dist/with-derivation-DWajFh4K.d.cts +0 -13
  353. package/dist/with-guard-DF_Ul3DT.d.cts +0 -18
  354. package/dist/with-guard-DR7U-l4v.d.ts +0 -18
  355. package/dist/with-materialized-view-_piodoIz.d.cts +0 -27
  356. package/dist/with-overlayed-view-DwzCKxn2.d.cts +0 -13
  357. /package/dist/{crypto-H2Y3DDFW.js.map → adapter/index.js.map} +0 -0
  358. /package/dist/{chunk-75QDHSE4.js.map → chunk-2QDWRK3B.js.map} +0 -0
  359. /package/dist/{chunk-FCDO7UAO.js.map → chunk-2ZYIN3BL.js.map} +0 -0
  360. /package/dist/{chunk-ZUMGGHRB.js.map → chunk-5PTX7PKD.js.map} +0 -0
  361. /package/dist/{chunk-QAU5HM6Q.js.map → chunk-6EKRQ7QF.js.map} +0 -0
  362. /package/dist/{chunk-UVPGJXVO.js.map → chunk-JOJPBZSZ.js.map} +0 -0
  363. /package/dist/{chunk-YK72A4IT.js.map → chunk-LBILABKZ.js.map} +0 -0
  364. /package/dist/{chunk-GAUBWHAF.js.map → chunk-OCYFFBZS.js.map} +0 -0
  365. /package/dist/{delegation-QSC7G5QC.js.map → chunk-PZ5AY32C.js.map} +0 -0
  366. /package/dist/{chunk-FS7A4XNF.js.map → chunk-QWJCNXH2.js.map} +0 -0
  367. /package/dist/{chunk-K5PVGKE4.js.map → chunk-SAAJYSVV.js.map} +0 -0
  368. /package/dist/{chunk-LS3JLEIB.js.map → chunk-TZGWI5AX.js.map} +0 -0
  369. /package/dist/{executor-BZKFZVRC.js.map → crypto-OSIV2IIW.js.map} +0 -0
  370. /package/dist/{executor-GFZFDQXV.js.map → delegation-BQTRJATI.js.map} +0 -0
  371. /package/dist/{executor-KT2IOZVP.js.map → executor-KYSKFJ2R.js.map} +0 -0
  372. /package/dist/{issue-BAJ7ZB4S.js.map → executor-M7W3NEKR.js.map} +0 -0
  373. /package/dist/{ledger-WOEJUYTP.js.map → executor-VDTDGWO6.js.map} +0 -0
  374. /package/dist/{noydb-XNQSKXGO.js.map → forget/index.js.map} +0 -0
  375. /package/dist/{public-envelope-OHQ5UZFM.js.map → issue-DPHRF2TI.js.map} +0 -0
  376. /package/dist/{read-only-facade-ITU6L7BL.js.map → kernel/index.js.map} +0 -0
  377. /package/dist/{registry-2IEARCGT.js.map → ledger-CI7GSMLB.js.map} +0 -0
  378. /package/dist/{registry-CDHASH73.js.map → noydb-NAU2DTFP.js.map} +0 -0
  379. /package/dist/{registry-EMGLZGR6.js.map → public-envelope-MFMBFJLZ.js.map} +0 -0
  380. /package/dist/{registry-NQALYR77.js.map → read-only-facade-3OQRZ3VS.js.map} +0 -0
  381. /package/dist/{revoke-7JOVLZFD.js.map → registry-IX5WKK4F.js.map} +0 -0
  382. /package/dist/{signer-M4K5HBLD.js.map → registry-LMHO5265.js.map} +0 -0
  383. /package/dist/{stale-PAGCS4K5.js.map → registry-TXCKWH26.js.map} +0 -0
  384. /package/dist/{ulid-COREQ2RQ.js.map → registry-VFEDQSYV.js.map} +0 -0
@@ -1,27 +1,31 @@
1
- export { w as withOverlayedView } from '../with-overlayed-view-DFaRfgMr.js';
2
- import { aG as OverlayedViewStrategy, aH as Collection } from '../types-D9eB0Rvh.js';
3
- export { aI as OverlayedViewRegistry, aJ as OverlayedViewStrategyHandle } from '../types-D9eB0Rvh.js';
4
- export { O as OverlayBaseIsVirtualError, j as OverlayCollectionUnavailableError, k as OverlayIdMismatchError, l as OverlayNameCollisionError } from '../index-BF1B2HB9.js';
5
- import '../lazy-builder-Rpd-V3jP.js';
6
- import '../predicate-Dnu81tsS.js';
7
- import '../strategy-DSTrsZ8t.js';
1
+ export { w as withOverlayedView } from '../with-overlayed-view-DVZrc5Hb.js';
2
+ import { aM as OverlayedViewStrategy, aN as Collection } from '../index-DHn9lEP0.js';
3
+ export { aO as OverlayFieldMergeMode, aP as OverlayFieldMergeRule, aQ as OverlayedViewRegistry, aR as OverlayedViewStrategyHandle } from '../index-DHn9lEP0.js';
4
+ export { O as OverlayBaseIsVirtualError, n as OverlayCollectionUnavailableError, o as OverlayIdMismatchError, p as OverlayNameCollisionError } from '../errors-BAWO5Z5a.js';
5
+ import '../lazy-builder-ChSqcF5t.js';
6
+ import '../predicate-BmhBSPCH.js';
7
+ import '../strategy-8QGs5KQE.js';
8
8
  import '../strategy-BSxFXGzb.js';
9
+ import '../index-BMmajblo.js';
10
+ import '../index-Ddm8D3Oo.js';
9
11
  import '@noy-db/attestation';
10
12
 
11
13
  /**
12
14
  * Virtual-collection proxy returned by `vault.collection(overlayName)`
13
- * when `overlayName` is a registered `withOverlayedView` (#154).
15
+ * when `overlayName` is a registered `withOverlayedView`.
14
16
  *
15
17
  * Implements the core `Collection<T>`-shaped read/write surface with
16
18
  * merge-on-read semantics:
17
- * - `get(id)`: overlay row wins iff `overlay[shadowField] === shadowValue`
19
+ * - `get(id)`: overlay row wins iff `overlay[shadowField] === shadowValue`;
20
+ * when `spec.mergeMode` is set, an intermediate status may instead pull
21
+ * a declared subset of fields from the overlay over the base (#348)
18
22
  * - `list()` / `.query()`: union of ids, per-id merge applied
19
23
  * - `put(record)` / `put(id, record)`: routes to overlay; id derived
20
24
  * via the base MV's `rowKey` (validated on the two-arg form)
21
25
  * - `delete(id)`: removes the overlay row only; base stays
22
26
  *
23
27
  * Reactive APIs (`live`, `subscribe`, `query().live()`) are out of
24
- * scope for #154 and surface as "not yet implemented" — wired in a
28
+ * scope for this release and surface as "not yet implemented" — wired in a
25
29
  * future sub-issue.
26
30
  */
27
31
  declare class OverlayedCollection<T extends Record<string, unknown> = any> {
@@ -57,8 +61,24 @@ declare class OverlayedCollection<T extends Record<string, unknown> = any> {
57
61
  * subsequent reads return it.
58
62
  */
59
63
  delete(id: string): Promise<void>;
60
- /** True when `overlay[shadowField] === shadowValue`. */
61
- private shadowPredicateApplies;
64
+ /**
65
+ * Merge a single id's overlay + base rows into the visible row.
66
+ *
67
+ * Priority (first match wins):
68
+ * 1. Binary shadow win — overlay present AND
69
+ * `overlay[shadowField] === shadowValue` → return the overlay row
70
+ * entirely. This stays FIRST so the original binary behaviour is
71
+ * unchanged whether or not `mergeMode` is configured.
72
+ * 2. Field-level merge — overlay present, `mergeMode` configured,
73
+ * and a rule whose `whenStatus` equals `overlay[shadowField]`.
74
+ * The matched rule pulls its `overlayFields` (those present on
75
+ * the overlay row) on top of the base row. With no base row, the
76
+ * overlay row is returned as-is.
77
+ * 3. Fallback — return the base row (possibly `null`). An
78
+ * overlay-only row that qualifies under neither (1) nor (2) and
79
+ * has no base is therefore NOT surfaced.
80
+ */
81
+ private mergeRows;
62
82
  /** @throws — chainable Query<T> over a virtual collection is deferred. */
63
83
  query(): never;
64
84
  /** @throws — change-stream subscription over a virtual collection is deferred. */
@@ -1,18 +1,19 @@
1
1
  import {
2
2
  withOverlayedView
3
- } from "../chunk-YL2DR3HY.js";
4
- import {
5
- OverlayedCollection
6
- } from "../chunk-NGSPBLLE.js";
3
+ } from "../chunk-ASIGWYRA.js";
7
4
  import {
8
5
  OverlayedViewRegistry
9
- } from "../chunk-NSLTPGEN.js";
6
+ } from "../chunk-TMUMMAWV.js";
7
+ import {
8
+ OverlayedCollection
9
+ } from "../chunk-MPIZQGFA.js";
10
10
  import {
11
11
  OverlayBaseIsVirtualError,
12
12
  OverlayCollectionUnavailableError,
13
13
  OverlayIdMismatchError,
14
14
  OverlayNameCollisionError
15
- } from "../chunk-YDLAFP36.js";
15
+ } from "../chunk-JZ5DS4DP.js";
16
+ import "../chunk-PZ5AY32C.js";
16
17
  export {
17
18
  OverlayBaseIsVirtualError,
18
19
  OverlayCollectionUnavailableError,
@@ -1,10 +1,12 @@
1
- import { a5 as PeriodsStrategy } from '../types-D9eB0Rvh.js';
2
- export { a6 as CarryForwardContext, a7 as ClosePeriodOptions, a8 as OpenPeriodOptions, a9 as PERIODS_COLLECTION, aa as PeriodRecord, ab as ReadOnlyCollection, ac as appendPeriodLedgerEntry, ad as assertTsWritable, ae as chainAnchor, af as loadPeriods, ag as validatePeriodName } from '../types-D9eB0Rvh.js';
3
- import '../lazy-builder-Rpd-V3jP.js';
4
- import '../predicate-Dnu81tsS.js';
5
- import '../strategy-DSTrsZ8t.js';
1
+ import { ab as PeriodsStrategy } from '../index-DHn9lEP0.js';
2
+ export { ac as CarryForwardContext, ad as ClosePeriodOptions, ae as OpenPeriodOptions, af as PERIODS_COLLECTION, ag as PeriodRecord, ah as ReadOnlyCollection, ai as appendPeriodLedgerEntry, aj as assertTsWritable, ak as chainAnchor, al as loadPeriods, am as validatePeriodName } from '../index-DHn9lEP0.js';
3
+ import '../lazy-builder-ChSqcF5t.js';
4
+ import '../predicate-BmhBSPCH.js';
5
+ import '../strategy-8QGs5KQE.js';
6
+ import '../errors-BAWO5Z5a.js';
6
7
  import '../strategy-BSxFXGzb.js';
7
- import '../index-BF1B2HB9.js';
8
+ import '../index-BMmajblo.js';
9
+ import '../index-Ddm8D3Oo.js';
8
10
  import '@noy-db/attestation';
9
11
 
10
12
  /**
@@ -6,13 +6,14 @@ import {
6
6
  loadPeriods,
7
7
  validatePeriodName,
8
8
  withPeriods
9
- } from "../chunk-GAUBWHAF.js";
9
+ } from "../chunk-OCYFFBZS.js";
10
10
  import "../chunk-UF3BUNQZ.js";
11
- import "../chunk-74JEQFMT.js";
12
- import "../chunk-NCO2JGKK.js";
13
- import "../chunk-FXQYZNOW.js";
14
- import "../chunk-UOF74WQY.js";
15
- import "../chunk-YDLAFP36.js";
11
+ import "../chunk-2UT7HJJR.js";
12
+ import "../chunk-PDVP3C2I.js";
13
+ import "../chunk-A7DNZVAV.js";
14
+ import "../chunk-E2MDPPOC.js";
15
+ import "../chunk-JZ5DS4DP.js";
16
+ import "../chunk-PZ5AY32C.js";
16
17
  export {
17
18
  PERIODS_COLLECTION,
18
19
  appendPeriodLedgerEntry,
@@ -30,6 +30,7 @@
30
30
  */
31
31
  type IndexDef = string | {
32
32
  readonly fields: readonly string[];
33
+ readonly unique?: boolean;
33
34
  } | readonly string[];
34
35
  /**
35
36
  * Internal representation of a built hash index.
@@ -103,12 +104,55 @@ declare class CollectionIndexes {
103
104
  lookupIn(field: string, values: readonly unknown[]): ReadonlySet<string> | null;
104
105
  }
105
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
+
106
148
  /**
107
149
  * Operator implementations for the query DSL.
108
150
  *
109
151
  * All predicates run client-side, AFTER decryption — they never see ciphertext.
110
- * This file is dependency-free and tree-shakeable.
152
+ * The only dependency is the money clause evaluator (#336) — still
153
+ * tree-shakeable through it.
111
154
  */
155
+
112
156
  /** Comparison operators supported by the where() builder. */
113
157
  type Operator = '==' | '!=' | '<' | '<=' | '>' | '>=' | 'in' | 'contains' | 'startsWith' | 'between';
114
158
  /**
@@ -120,6 +164,14 @@ interface FieldClause {
120
164
  readonly field: string;
121
165
  readonly op: Operator;
122
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;
123
175
  }
124
176
  /**
125
177
  * A user-supplied predicate function escape hatch. Not serializable.
@@ -134,7 +186,7 @@ interface FilterClause {
134
186
  readonly fn: (record: unknown) => boolean;
135
187
  }
136
188
  /**
137
- * A declared deterministic predicate reference (#153). The query
189
+ * A declared deterministic predicate reference. The query
138
190
  * builder produces this via `.wherePredicate(name, ctx?)` when a
139
191
  * Query has been augmented with a predicates map (typically by the
140
192
  * materialized-view registry — see MV v2 spec § Function-based
@@ -163,7 +215,31 @@ interface GroupClause {
163
215
  readonly op: 'and' | 'or';
164
216
  readonly clauses: readonly Clause[];
165
217
  }
166
- type Clause = FieldClause | FilterClause | WherePredicateClause | GroupClause;
218
+ /**
219
+ * Cartesian-product expansion clause. Appended to `QueryPlan.clauses`
220
+ * by `Query.crossJoin()`. Processed in declaration order by
221
+ * `executeClausePipeline` — NOT by `evaluateClause` (which is a
222
+ * per-record predicate and throws on this type).
223
+ */
224
+ interface CrossJoinClause {
225
+ readonly type: 'crossJoin';
226
+ /** Target collection name to cross-join against. */
227
+ readonly target: string;
228
+ /** Alias under which the right-side record is exposed on each result row. */
229
+ readonly as: string;
230
+ /**
231
+ * Lateral filter callback. `undefined` → full cartesian product.
232
+ * Two call shapes:
233
+ * - Subset: `(left) => TTarget[]` — returns the right rows for this left row
234
+ * - Predicate: `(left) => (right) => boolean` — executor materializes then filters
235
+ */
236
+ readonly on?: (left: unknown) => unknown[] | ((right: unknown) => boolean);
237
+ /** When `on:` was supplied as `{ predicate: name }`, the name is stored here for queryHash. */
238
+ readonly onPredicateName?: string;
239
+ /** Per-clause row ceiling override. `undefined` → `DEFAULT_CROSS_JOIN_MAX_ROWS`. */
240
+ readonly maxRows?: number;
241
+ }
242
+ type Clause = FieldClause | FilterClause | WherePredicateClause | GroupClause | CrossJoinClause;
167
243
  /**
168
244
  * Read a possibly nested field path like "address.city" from a record.
169
245
  * Returns undefined if any segment is missing.
@@ -179,7 +255,13 @@ declare function evaluateFieldClause(record: unknown, clause: FieldClause): bool
179
255
  * Evaluate any clause (field / filter / group) against a record.
180
256
  * The recursion depth is bounded by the user's query expression — no risk of
181
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).
182
264
  */
183
- declare function evaluateClause(record: unknown, clause: Clause): boolean;
265
+ declare function evaluateClause(record: unknown, clause: Clause, fnRecord?: unknown): boolean;
184
266
 
185
- 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, evaluateClause as e, readPath as r };
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 };
@@ -12,9 +12,10 @@ import {
12
12
  resolveLocale,
13
13
  savePublicEnvelope,
14
14
  validatePublicEnvelopeInput
15
- } from "./chunk-FS7A4XNF.js";
16
- import "./chunk-FXQYZNOW.js";
17
- import "./chunk-YDLAFP36.js";
15
+ } from "./chunk-QWJCNXH2.js";
16
+ import "./chunk-A7DNZVAV.js";
17
+ import "./chunk-JZ5DS4DP.js";
18
+ import "./chunk-PZ5AY32C.js";
18
19
  export {
19
20
  DEFAULT_PUBLIC_ENVELOPE_SCHEMA,
20
21
  PUBLIC_ENVELOPE_FIELDS,
@@ -28,4 +29,4 @@ export {
28
29
  savePublicEnvelope,
29
30
  validatePublicEnvelopeInput
30
31
  };
31
- //# sourceMappingURL=public-envelope-OHQ5UZFM.js.map
32
+ //# sourceMappingURL=public-envelope-MFMBFJLZ.js.map
@@ -1,3 +1,4 @@
1
- export { y as DEFAULT_JOIN_MAX_ROWS, z as DanglingReferenceError, V as GroupCardinalityError, X as IndexRequiredError, Y as IndexWriteFailureError, _ as JoinContext, $ as JoinLeg, a0 as JoinStrategy, a1 as JoinTooLargeError, a2 as JoinableSource, a6 as LiveQuery, a7 as LiveUpstream, ad as OrderBy, Q as Query, ai as QueryPlan, aj as QuerySource, au as ScanBuilder, av as ScanPageProvider, aF as applyJoins, aG as buildLiveQuery, aH as executePlan, aJ as resetJoinWarnings } from '../index-BF1B2HB9.js';
2
- export { a as Clause, C as CollectionIndexes, F as FieldClause, b as FilterClause, G as GroupClause, H as HashIndex, I as IndexDef, O as Operator, e as evaluateClause, c as evaluateFieldClause, r as readPath } from '../predicate-Dnu81tsS.js';
3
- export { a as AggregateResult, b as AggregateSpec, c as Aggregation, d as AggregationUpstream, G as GROUPBY_MAX_CARDINALITY, e as GROUPBY_WARN_CARDINALITY, f as GroupedAggregation, g as GroupedQuery, h as GroupedQueryN, i as GroupedRow, j as GroupedRowN, L as LiveAggregation, R as Reducer, k as ReducerOptions, l as avg, m as buildLiveAggregation, n as count, o as groupAndReduce, p as max, q as min, r as reduceRecords, s as resetGroupByWarnings, t as sum } from '../strategy-DSTrsZ8t.js';
1
+ export { D as DEFAULT_CROSS_JOIN_MAX_ROWS, a as DEFAULT_JOIN_MAX_ROWS, J as JoinContext, b as JoinLeg, c as JoinStrategy, d as JoinableSource, L as LiveQuery, e as LiveUpstream, O as OrderBy, Q as Query, f as QueryPlan, g as QuerySource, S as ScanBuilder, m as ScanPageProvider, n as applyJoins, o as buildLiveQuery, p as executePlan, t as resetJoinWarnings } from '../index-Ddm8D3Oo.js';
2
+ export { a as Clause, C as CollectionIndexes, d as CrossJoinClause, F as FieldClause, b as FilterClause, G as GroupClause, H as HashIndex, I as IndexDef, O as Operator, e as evaluateClause, c as evaluateFieldClause, r as readPath } from '../predicate-BmhBSPCH.js';
3
+ export { j as AggregateResult, k as AggregateSpec, l as Aggregation, m as AggregationUpstream, G as GROUPBY_MAX_CARDINALITY, n as GROUPBY_WARN_CARDINALITY, o as GroupedAggregation, p as GroupedQuery, q as GroupedQueryN, t as GroupedRow, u as GroupedRowN, w as LiveAggregation, x as Reducer, y as ReducerOptions, z as avg, B as buildLiveAggregation, C as count, D as groupAndReduce, E as max, F as min, H as reduceRecords, J as resetGroupByWarnings, K as sum } from '../strategy-8QGs5KQE.js';
4
+ export { K as CrossJoinSourceUnknownError, Q as CrossJoinTooLargeError, V as DanglingReferenceError, a6 as GroupCardinalityError, a8 as IndexRequiredError, a9 as IndexWriteFailureError, ab as JoinTooLargeError } from '../errors-BAWO5Z5a.js';
@@ -1,4 +1,5 @@
1
1
  import {
2
+ DEFAULT_CROSS_JOIN_MAX_ROWS,
2
3
  DEFAULT_JOIN_MAX_ROWS,
3
4
  Query,
4
5
  ScanBuilder,
@@ -6,17 +7,17 @@ import {
6
7
  buildLiveQuery,
7
8
  executePlan,
8
9
  resetJoinWarnings
9
- } from "../chunk-4UBOTYP5.js";
10
+ } from "../chunk-QGBBQKDS.js";
10
11
  import {
11
12
  CollectionIndexes
12
- } from "../chunk-YMYK7US4.js";
13
+ } from "../chunk-4YD7VZH4.js";
13
14
  import {
14
15
  avg,
15
16
  count,
16
17
  max,
17
18
  min,
18
19
  sum
19
- } from "../chunk-5ZGZ6HIZ.js";
20
+ } from "../chunk-DEE4CRYN.js";
20
21
  import {
21
22
  Aggregation,
22
23
  GROUPBY_MAX_CARDINALITY,
@@ -28,22 +29,29 @@ import {
28
29
  groupAndReduce,
29
30
  reduceRecords,
30
31
  resetGroupByWarnings
31
- } from "../chunk-KYKMKLJ6.js";
32
+ } from "../chunk-K6NVSHAH.js";
32
33
  import {
33
34
  evaluateClause,
34
35
  evaluateFieldClause,
35
36
  readPath
36
- } from "../chunk-MRIBLZL3.js";
37
+ } from "../chunk-KJ3K5VZM.js";
38
+ import "../chunk-QXWJQ7UU.js";
37
39
  import {
40
+ CrossJoinSourceUnknownError,
41
+ CrossJoinTooLargeError,
38
42
  DanglingReferenceError,
39
43
  GroupCardinalityError,
40
44
  IndexRequiredError,
41
45
  IndexWriteFailureError,
42
46
  JoinTooLargeError
43
- } from "../chunk-YDLAFP36.js";
47
+ } from "../chunk-JZ5DS4DP.js";
48
+ import "../chunk-PZ5AY32C.js";
44
49
  export {
45
50
  Aggregation,
46
51
  CollectionIndexes,
52
+ CrossJoinSourceUnknownError,
53
+ CrossJoinTooLargeError,
54
+ DEFAULT_CROSS_JOIN_MAX_ROWS,
47
55
  DEFAULT_JOIN_MAX_ROWS,
48
56
  DanglingReferenceError,
49
57
  GROUPBY_MAX_CARDINALITY,
@@ -0,0 +1,8 @@
1
+ import {
2
+ ReadOnlyVaultFacade
3
+ } from "./chunk-ADB7GPM3.js";
4
+ import "./chunk-PZ5AY32C.js";
5
+ export {
6
+ ReadOnlyVaultFacade
7
+ };
8
+ //# sourceMappingURL=read-only-facade-3OQRZ3VS.js.map
@@ -0,0 +1,8 @@
1
+ import {
2
+ GuardRegistry
3
+ } from "./chunk-A3JMGXPG.js";
4
+ import "./chunk-PZ5AY32C.js";
5
+ export {
6
+ GuardRegistry
7
+ };
8
+ //# sourceMappingURL=registry-IX5WKK4F.js.map
@@ -0,0 +1,11 @@
1
+ import {
2
+ MaterializedViewRegistry,
3
+ wrapDbWithPredicates
4
+ } from "./chunk-RCB6GWTC.js";
5
+ import "./chunk-JZ5DS4DP.js";
6
+ import "./chunk-PZ5AY32C.js";
7
+ export {
8
+ MaterializedViewRegistry,
9
+ wrapDbWithPredicates
10
+ };
11
+ //# sourceMappingURL=registry-LMHO5265.js.map
@@ -0,0 +1,9 @@
1
+ import {
2
+ DerivationRegistry
3
+ } from "./chunk-UBF5JEOJ.js";
4
+ import "./chunk-JZ5DS4DP.js";
5
+ import "./chunk-PZ5AY32C.js";
6
+ export {
7
+ DerivationRegistry
8
+ };
9
+ //# sourceMappingURL=registry-TXCKWH26.js.map
@@ -0,0 +1,9 @@
1
+ import {
2
+ OverlayedViewRegistry
3
+ } from "./chunk-TMUMMAWV.js";
4
+ import "./chunk-JZ5DS4DP.js";
5
+ import "./chunk-PZ5AY32C.js";
6
+ export {
7
+ OverlayedViewRegistry
8
+ };
9
+ //# sourceMappingURL=registry-VFEDQSYV.js.map
@@ -0,0 +1,18 @@
1
+ import {
2
+ getRevokedDocIdsCore,
3
+ publishRevocationListCore,
4
+ revokeDocCore,
5
+ unrevokeDocCore
6
+ } from "./chunk-JOJPBZSZ.js";
7
+ import "./chunk-5PTX7PKD.js";
8
+ import "./chunk-A7DNZVAV.js";
9
+ import "./chunk-E2MDPPOC.js";
10
+ import "./chunk-JZ5DS4DP.js";
11
+ import "./chunk-PZ5AY32C.js";
12
+ export {
13
+ getRevokedDocIdsCore,
14
+ publishRevocationListCore,
15
+ revokeDocCore,
16
+ unrevokeDocCore
17
+ };
18
+ //# sourceMappingURL=revoke-5PUOZPJJ.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,123 @@
1
+ export { q as SealedRecordExpiredError, r as SealedRecordMismatchError } from '../errors-BAWO5Z5a.js';
2
+
3
+ /**
4
+ * Wire + binding types for record-scoped CEK sealing (#306 slices 2-3).
5
+ *
6
+ * A vault owner who holds the collection DEK can **seal a single record's
7
+ * content-encryption key (CEK)** to an `at-*` host (e.g. a KMS-backed
8
+ * {@link RecipientSealer}) so that host — and only that host — can decrypt
9
+ * exactly that one record, with no access to the vault DEK and no ability to
10
+ * read any other record. This is the record-granular counterpart to the
11
+ * bundle-granular sealed-credential delivery (`SealedEnvelope`).
12
+ *
13
+ * Two shapes live here:
14
+ *
15
+ * - {@link SealedCekDeliveryEnvelope} — the **thin delivery envelope** the
16
+ * grantor writes to `_sealed_cek/<collection>/<id>/<pid>`. It carries only
17
+ * routing metadata (`pid`, `expiresAt`) in the clear plus the opaque sealed
18
+ * `payload`. The `expiresAt` here is a *fast-path* hint; the authoritative
19
+ * expiry lives INSIDE the sealed payload (see below).
20
+ *
21
+ * - {@link SealedCekBinding} — the plaintext struct that is sealed for the
22
+ * host. It binds the CEK to its `{collection, id}` and an authoritative
23
+ * `expiresAt`, so a host cannot take a CEK sealed for record A and apply it
24
+ * to record B's envelope (mismatch is rejected), nor read past expiry. The
25
+ * binding is the security boundary; the delivery envelope is just transport.
26
+ *
27
+ * @module
28
+ */
29
+ /**
30
+ * Thin delivery envelope persisted at
31
+ * `_sealed_cek/<collection>/<id>/<pid>`. The grantor writes one per
32
+ * (record, recipient host) pair. `payload` is the base64 of the bytes returned
33
+ * by {@link RecipientSealer.sealForRecipient} over a UTF-8
34
+ * `JSON.stringify({@link SealedCekBinding})`.
35
+ *
36
+ * `expiresAt` is duplicated here for a cheap pre-unseal reject, but is NOT
37
+ * authoritative — the binding inside `payload` carries the expiry the host
38
+ * verifies after unsealing, so a tampered delivery envelope cannot extend a
39
+ * grant.
40
+ */
41
+ interface SealedCekDeliveryEnvelope {
42
+ /** Envelope schema version. */
43
+ readonly v: 1;
44
+ /** Magic marker for forensics + format detection. */
45
+ readonly _noydb_sealed_cek: 1;
46
+ /** Recipient host provider id; matches the sealer's `.id` / hint `pid`. */
47
+ readonly pid: string;
48
+ /** base64 of the sealed {@link SealedCekBinding} bytes. */
49
+ readonly payload: string;
50
+ /** Fast-path expiry hint (ISO 8601). Authoritative copy is inside `payload`. */
51
+ readonly expiresAt: string;
52
+ }
53
+ /**
54
+ * The plaintext struct sealed for the recipient host. After the host unseals
55
+ * `SealedCekDeliveryEnvelope.payload` it parses this and MUST verify:
56
+ * - `collection` + `id` match the record envelope it is decrypting, and
57
+ * - `expiresAt` has not passed (authoritative expiry check).
58
+ *
59
+ * `cek` is the base64 of the raw 32-byte AES-256-GCM record CEK.
60
+ */
61
+ interface SealedCekBinding {
62
+ /** Collection the CEK belongs to. */
63
+ readonly collection: string;
64
+ /** Record id the CEK belongs to. */
65
+ readonly id: string;
66
+ /** base64 of the raw AES-256-GCM CEK bytes. */
67
+ readonly cek: string;
68
+ /** Authoritative expiry (ISO 8601). */
69
+ readonly expiresAt: string;
70
+ }
71
+
72
+ /**
73
+ * `@noy-db/hub/sealed-record` — host-side opener for record-scoped CEK
74
+ * sealing (#306 slices 2-3).
75
+ *
76
+ * The **grantor** side (sealing a record's CEK to a host, revoking, and hard
77
+ * rotation) lives on `Vault` (`vault.sealRecordToHost` /
78
+ * `vault.revokeSealedRecord` / `vault.rotateRecordCek`) because it needs the
79
+ * collection DEK. This subpath exposes the **recipient host** side:
80
+ * {@link openSealedRecord} reconstructs a single record's plaintext from
81
+ * (a) the sealed-CEK delivery envelope, (b) the record's encrypted envelope
82
+ * body, and (c) the host's own unsealer — and **nothing else**. The host never
83
+ * touches a vault DEK and can decrypt exactly the one bound record.
84
+ *
85
+ * @module
86
+ */
87
+
88
+ /**
89
+ * Host-side: decrypt a single record whose CEK was sealed to this host by a
90
+ * vault grantor via `vault.sealRecordToHost()`.
91
+ *
92
+ * Verification order (security-critical — do NOT reorder past the unseal):
93
+ * 1. **Fast-path expiry** — reject on the delivery envelope's clear-text
94
+ * `expiresAt` before doing any (potentially expensive) unseal work. This is
95
+ * a hint only.
96
+ * 2. **Unseal** the `payload` with the host's `recipientSealer.unseal` →
97
+ * parse the {@link SealedCekBinding}.
98
+ * 3. **Binding match** — the binding's `{collection, id}` MUST equal the
99
+ * expected pair, else {@link SealedRecordMismatchError}. This is the
100
+ * host-denial boundary (a CEK sealed for record A cannot open record B).
101
+ * 4. **Authoritative expiry** — re-check `binding.expiresAt` (the copy that
102
+ * cannot be forged by editing the delivery envelope), else
103
+ * {@link SealedRecordExpiredError}.
104
+ * 5. **Decrypt** the record body under the unsealed CEK. A CEK from a
105
+ * PRE-rotation seal applied to a POST-rotation live envelope passes (1)-(4)
106
+ * but fails the AES-GCM auth tag → `TamperedError` from `decrypt`.
107
+ *
108
+ * @param sealedCekEnvelope The `SealedCekDeliveryEnvelope` written by the grantor.
109
+ * @param recordEnvelope The record's `{ _iv, _data }` (the encrypted body).
110
+ * @param recipientSealer The host's unsealer (`{ unseal(bytes) }`) — e.g. a
111
+ * KMS-backed sealer or `MemoryRecipientSealer`.
112
+ * @param expectedCollection Collection the caller believes `recordEnvelope` is in.
113
+ * @param expectedId Record id the caller believes `recordEnvelope` is.
114
+ * @returns The decrypted record body as a JSON string.
115
+ */
116
+ declare function openSealedRecord(sealedCekEnvelope: SealedCekDeliveryEnvelope, recordEnvelope: {
117
+ readonly _iv: string;
118
+ readonly _data: string;
119
+ }, recipientSealer: {
120
+ unseal(bytes: Uint8Array): Promise<Uint8Array>;
121
+ }, expectedCollection: string, expectedId: string): Promise<string>;
122
+
123
+ export { type SealedCekBinding, type SealedCekDeliveryEnvelope, openSealedRecord };
@@ -0,0 +1,43 @@
1
+ import {
2
+ base64ToBuffer,
3
+ decrypt
4
+ } from "../chunk-E2MDPPOC.js";
5
+ import {
6
+ SealedRecordExpiredError,
7
+ SealedRecordMismatchError
8
+ } from "../chunk-JZ5DS4DP.js";
9
+ import "../chunk-PZ5AY32C.js";
10
+
11
+ // src/sealed-record/index.ts
12
+ var subtle = globalThis.crypto.subtle;
13
+ async function openSealedRecord(sealedCekEnvelope, recordEnvelope, recipientSealer, expectedCollection, expectedId) {
14
+ if (Date.parse(sealedCekEnvelope.expiresAt) <= Date.now()) {
15
+ throw new SealedRecordExpiredError(sealedCekEnvelope.expiresAt);
16
+ }
17
+ const payloadBytes = base64ToBuffer(sealedCekEnvelope.payload);
18
+ const openedBytes = await recipientSealer.unseal(payloadBytes);
19
+ const binding = JSON.parse(new TextDecoder().decode(openedBytes));
20
+ if (binding.collection !== expectedCollection || binding.id !== expectedId) {
21
+ throw new SealedRecordMismatchError(
22
+ { collection: expectedCollection, id: expectedId },
23
+ { collection: binding.collection, id: binding.id }
24
+ );
25
+ }
26
+ if (Date.parse(binding.expiresAt) <= Date.now()) {
27
+ throw new SealedRecordExpiredError(binding.expiresAt);
28
+ }
29
+ const cek = await subtle.importKey(
30
+ "raw",
31
+ base64ToBuffer(binding.cek),
32
+ { name: "AES-GCM", length: 256 },
33
+ false,
34
+ ["decrypt"]
35
+ );
36
+ return decrypt(recordEnvelope._iv, recordEnvelope._data, cek);
37
+ }
38
+ export {
39
+ SealedRecordExpiredError,
40
+ SealedRecordMismatchError,
41
+ openSealedRecord
42
+ };
43
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/sealed-record/index.ts"],"sourcesContent":["/**\n * `@noy-db/hub/sealed-record` — host-side opener for record-scoped CEK\n * sealing (#306 slices 2-3).\n *\n * The **grantor** side (sealing a record's CEK to a host, revoking, and hard\n * rotation) lives on `Vault` (`vault.sealRecordToHost` /\n * `vault.revokeSealedRecord` / `vault.rotateRecordCek`) because it needs the\n * collection DEK. This subpath exposes the **recipient host** side:\n * {@link openSealedRecord} reconstructs a single record's plaintext from\n * (a) the sealed-CEK delivery envelope, (b) the record's encrypted envelope\n * body, and (c) the host's own unsealer — and **nothing else**. The host never\n * touches a vault DEK and can decrypt exactly the one bound record.\n *\n * @module\n */\n\nimport { decrypt, base64ToBuffer } from '../crypto.js'\nimport {\n SealedRecordExpiredError,\n SealedRecordMismatchError,\n} from '../errors.js'\nimport type {\n SealedCekDeliveryEnvelope,\n SealedCekBinding,\n} from './types.js'\n\nexport type { SealedCekDeliveryEnvelope, SealedCekBinding } from './types.js'\nexport { SealedRecordExpiredError, SealedRecordMismatchError } from '../errors.js'\n\nconst subtle = globalThis.crypto.subtle\n\n/**\n * Host-side: decrypt a single record whose CEK was sealed to this host by a\n * vault grantor via `vault.sealRecordToHost()`.\n *\n * Verification order (security-critical — do NOT reorder past the unseal):\n * 1. **Fast-path expiry** — reject on the delivery envelope's clear-text\n * `expiresAt` before doing any (potentially expensive) unseal work. This is\n * a hint only.\n * 2. **Unseal** the `payload` with the host's `recipientSealer.unseal` →\n * parse the {@link SealedCekBinding}.\n * 3. **Binding match** — the binding's `{collection, id}` MUST equal the\n * expected pair, else {@link SealedRecordMismatchError}. This is the\n * host-denial boundary (a CEK sealed for record A cannot open record B).\n * 4. **Authoritative expiry** — re-check `binding.expiresAt` (the copy that\n * cannot be forged by editing the delivery envelope), else\n * {@link SealedRecordExpiredError}.\n * 5. **Decrypt** the record body under the unsealed CEK. A CEK from a\n * PRE-rotation seal applied to a POST-rotation live envelope passes (1)-(4)\n * but fails the AES-GCM auth tag → `TamperedError` from `decrypt`.\n *\n * @param sealedCekEnvelope The `SealedCekDeliveryEnvelope` written by the grantor.\n * @param recordEnvelope The record's `{ _iv, _data }` (the encrypted body).\n * @param recipientSealer The host's unsealer (`{ unseal(bytes) }`) — e.g. a\n * KMS-backed sealer or `MemoryRecipientSealer`.\n * @param expectedCollection Collection the caller believes `recordEnvelope` is in.\n * @param expectedId Record id the caller believes `recordEnvelope` is.\n * @returns The decrypted record body as a JSON string.\n */\nexport async function openSealedRecord(\n sealedCekEnvelope: SealedCekDeliveryEnvelope,\n recordEnvelope: { readonly _iv: string; readonly _data: string },\n recipientSealer: { unseal(bytes: Uint8Array): Promise<Uint8Array> },\n expectedCollection: string,\n expectedId: string,\n): Promise<string> {\n // (1) Fast-path expiry on the (unauthenticated) delivery envelope.\n if (Date.parse(sealedCekEnvelope.expiresAt) <= Date.now()) {\n throw new SealedRecordExpiredError(sealedCekEnvelope.expiresAt)\n }\n\n // (2) Unseal → parse binding.\n const payloadBytes = base64ToBuffer(sealedCekEnvelope.payload)\n const openedBytes = await recipientSealer.unseal(payloadBytes)\n const binding = JSON.parse(new TextDecoder().decode(openedBytes)) as SealedCekBinding\n\n // (3) Binding match — host-denial boundary.\n if (binding.collection !== expectedCollection || binding.id !== expectedId) {\n throw new SealedRecordMismatchError(\n { collection: expectedCollection, id: expectedId },\n { collection: binding.collection, id: binding.id },\n )\n }\n\n // (4) Authoritative expiry — the copy that cannot be forged on the envelope.\n if (Date.parse(binding.expiresAt) <= Date.now()) {\n throw new SealedRecordExpiredError(binding.expiresAt)\n }\n\n // (5) Import the raw CEK + decrypt the body. Wrong-key (pre-rotation CEK vs\n // post-rotation body) surfaces as TamperedError from decrypt's GCM tag check.\n const cek = await subtle.importKey(\n 'raw',\n base64ToBuffer(binding.cek) as BufferSource,\n { name: 'AES-GCM', length: 256 },\n false,\n ['decrypt'],\n )\n return decrypt(recordEnvelope._iv, recordEnvelope._data, cek)\n}\n"],"mappings":";;;;;;;;;;;AA6BA,IAAM,SAAS,WAAW,OAAO;AA8BjC,eAAsB,iBACpB,mBACA,gBACA,iBACA,oBACA,YACiB;AAEjB,MAAI,KAAK,MAAM,kBAAkB,SAAS,KAAK,KAAK,IAAI,GAAG;AACzD,UAAM,IAAI,yBAAyB,kBAAkB,SAAS;AAAA,EAChE;AAGA,QAAM,eAAe,eAAe,kBAAkB,OAAO;AAC7D,QAAM,cAAc,MAAM,gBAAgB,OAAO,YAAY;AAC7D,QAAM,UAAU,KAAK,MAAM,IAAI,YAAY,EAAE,OAAO,WAAW,CAAC;AAGhE,MAAI,QAAQ,eAAe,sBAAsB,QAAQ,OAAO,YAAY;AAC1E,UAAM,IAAI;AAAA,MACR,EAAE,YAAY,oBAAoB,IAAI,WAAW;AAAA,MACjD,EAAE,YAAY,QAAQ,YAAY,IAAI,QAAQ,GAAG;AAAA,IACnD;AAAA,EACF;AAGA,MAAI,KAAK,MAAM,QAAQ,SAAS,KAAK,KAAK,IAAI,GAAG;AAC/C,UAAM,IAAI,yBAAyB,QAAQ,SAAS;AAAA,EACtD;AAIA,QAAM,MAAM,MAAM,OAAO;AAAA,IACvB;AAAA,IACA,eAAe,QAAQ,GAAG;AAAA,IAC1B,EAAE,MAAM,WAAW,QAAQ,IAAI;AAAA,IAC/B;AAAA,IACA,CAAC,SAAS;AAAA,EACZ;AACA,SAAO,QAAQ,eAAe,KAAK,eAAe,OAAO,GAAG;AAC9D;","names":[]}
@@ -1,11 +1,13 @@
1
- export { C as CreateSessionOptions, a as CreateSessionResult, D as DevUnlockOptions, S as SessionToken, b as activeSessionCount, c as clearDevUnlock, d as createSession, e as enableDevUnlock, i as isDevUnlockActive, f as isSessionAlive, l as loadDevUnlock, r as resolveSession, g as revokeAllSessions, h as revokeSession } from '../dev-unlock-Cf2B7Kih.js';
2
- import { S as SessionStrategy } from '../types-D9eB0Rvh.js';
3
- export { P as PolicyEnforcer, n as createEnforcer, o as validateSessionPolicy } from '../types-D9eB0Rvh.js';
4
- export { S as SessionExpiredError, b as SessionNotFoundError, c as SessionPolicyError } from '../index-BF1B2HB9.js';
5
- import '../lazy-builder-Rpd-V3jP.js';
6
- import '../predicate-Dnu81tsS.js';
7
- import '../strategy-DSTrsZ8t.js';
1
+ export { C as CreateSessionOptions, a as CreateSessionResult, D as DevUnlockOptions, S as SessionToken, b as activeSessionCount, c as clearDevUnlock, d as createSession, e as enableDevUnlock, i as isDevUnlockActive, f as isSessionAlive, l as loadDevUnlock, r as resolveSession, g as revokeAllSessions, h as revokeSession } from '../dev-unlock-CnHTTVea.js';
2
+ import { m as SessionStrategy } from '../index-DHn9lEP0.js';
3
+ export { P as PolicyEnforcer, n as createEnforcer, v as validateSessionPolicy } from '../index-DHn9lEP0.js';
4
+ export { c as SessionExpiredError, d as SessionNotFoundError, e as SessionPolicyError } from '../errors-BAWO5Z5a.js';
5
+ import '../lazy-builder-ChSqcF5t.js';
6
+ import '../predicate-BmhBSPCH.js';
7
+ import '../strategy-8QGs5KQE.js';
8
8
  import '../strategy-BSxFXGzb.js';
9
+ import '../index-BMmajblo.js';
10
+ import '../index-Ddm8D3Oo.js';
9
11
  import '@noy-db/attestation';
10
12
 
11
13
  /**