@noy-db/hub 0.2.0-pre.6 → 0.2.0-pre.7

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 (254) hide show
  1. package/dist/aggregate/index.cjs.map +1 -1
  2. package/dist/aggregate/index.js +4 -4
  3. package/dist/attestation/index.cjs.map +1 -1
  4. package/dist/attestation/index.d.cts +4 -4
  5. package/dist/attestation/index.d.ts +4 -4
  6. package/dist/attestation/index.js +6 -6
  7. package/dist/blobs/index.cjs.map +1 -1
  8. package/dist/blobs/index.d.cts +5 -5
  9. package/dist/blobs/index.d.ts +5 -5
  10. package/dist/blobs/index.js +5 -5
  11. package/dist/bundle/index.cjs +326 -15
  12. package/dist/bundle/index.cjs.map +1 -1
  13. package/dist/bundle/index.d.cts +6 -6
  14. package/dist/bundle/index.d.ts +6 -6
  15. package/dist/bundle/index.js +12 -12
  16. package/dist/{chunk-E225X5CQ.js → chunk-22ESLVUM.js} +3 -3
  17. package/dist/{chunk-5QPF2MJ5.js → chunk-2TXMTYWZ.js} +3 -3
  18. package/dist/{chunk-W277AG6N.js → chunk-3O5FNO5O.js} +104 -47
  19. package/dist/chunk-3O5FNO5O.js.map +1 -0
  20. package/dist/{chunk-34XGYMQT.js → chunk-3XCXUJTM.js} +2 -2
  21. package/dist/{chunk-XDW37COG.js → chunk-4EOVWJL6.js} +212 -7
  22. package/dist/chunk-4EOVWJL6.js.map +1 -0
  23. package/dist/{chunk-KGFV72WK.js → chunk-4YVVF6JN.js} +5 -5
  24. package/dist/{chunk-UGVDIOY7.js → chunk-6ILPGZXZ.js} +2 -2
  25. package/dist/{chunk-DFCINPB5.js → chunk-6MXGU2PW.js} +2 -2
  26. package/dist/{chunk-Y3P5DEMZ.js → chunk-7IH5FDXD.js} +6 -6
  27. package/dist/{chunk-2GMRNNI3.js → chunk-ASFE2X62.js} +2 -2
  28. package/dist/{chunk-JICBEFBT.js → chunk-AYRTGXF3.js} +5 -5
  29. package/dist/{chunk-CCC25PA7.js → chunk-BE5ZALMB.js} +5 -5
  30. package/dist/{chunk-WEA4TDTJ.js → chunk-BNUCCUES.js} +3 -3
  31. package/dist/{chunk-PS5G6A3Y.js → chunk-BRZFN354.js} +4 -4
  32. package/dist/{chunk-RIHZBSWJ.js → chunk-CBHPW77B.js} +3 -3
  33. package/dist/{chunk-LWFQYT4N.js → chunk-CSHY53CZ.js} +2 -2
  34. package/dist/{chunk-MDIC4FAU.js → chunk-DCP4L4SH.js} +2 -2
  35. package/dist/{chunk-TNBIWSQ7.js → chunk-GI6S5ZF2.js} +2 -2
  36. package/dist/{chunk-G26QAQNI.js → chunk-GZIDTXC4.js} +2 -2
  37. package/dist/{chunk-ARZAHCCF.js → chunk-HNC55FLJ.js} +3 -3
  38. package/dist/{chunk-SGSHQ4PH.js → chunk-HNFXKQD7.js} +5 -5
  39. package/dist/{chunk-YEHUEUNP.js → chunk-JZDA2SRB.js} +4 -4
  40. package/dist/{chunk-PX3MJ6RB.js → chunk-KK44CQ5B.js} +3 -3
  41. package/dist/{chunk-OPD3PZOG.js → chunk-LSY46G55.js} +4 -4
  42. package/dist/{chunk-T6MTNGBM.js → chunk-N4CDTRDH.js} +4 -4
  43. package/dist/{chunk-ZQMYB56Z.js → chunk-O3JCRQT3.js} +3 -3
  44. package/dist/{chunk-LJO6Q3X6.js → chunk-OA6HE2RW.js} +3 -3
  45. package/dist/{chunk-HIELMTUK.js → chunk-OIF6LZUR.js} +2 -2
  46. package/dist/{chunk-YJ46RFCD.js → chunk-OXCFFRF3.js} +2 -2
  47. package/dist/{chunk-ED3E3OLO.js → chunk-PJKGXUMG.js} +2 -2
  48. package/dist/{chunk-6A4AMQ2H.js → chunk-QYO6I7KK.js} +4 -4
  49. package/dist/{chunk-6HJ2ZALB.js → chunk-REQJJIPP.js} +44 -2
  50. package/dist/chunk-REQJJIPP.js.map +1 -0
  51. package/dist/{chunk-7TX7HN42.js → chunk-SLJQIBT7.js} +20 -3
  52. package/dist/chunk-SLJQIBT7.js.map +1 -0
  53. package/dist/{chunk-A4JNVBPF.js → chunk-SYOSRZN4.js} +5 -5
  54. package/dist/{chunk-R4LTCI6O.js → chunk-TS4FQPDD.js} +2 -2
  55. package/dist/{chunk-ICH4AIGL.js → chunk-TV3YZ35S.js} +5 -1
  56. package/dist/chunk-TV3YZ35S.js.map +1 -0
  57. package/dist/{chunk-CKH247ZR.js → chunk-UPBZ7NVY.js} +4 -4
  58. package/dist/{chunk-XVJFFGTG.js → chunk-VZOZ3DBN.js} +3 -3
  59. package/dist/{chunk-5VMTAX4Y.js → chunk-W6EQLGMB.js} +2 -2
  60. package/dist/{chunk-JSYTGEX4.js → chunk-WBUG3324.js} +3 -3
  61. package/dist/{chunk-5OVIFUQE.js → chunk-WIRRPTFH.js} +1 -1
  62. package/dist/chunk-WIRRPTFH.js.map +1 -0
  63. package/dist/{chunk-25WFLKOH.js → chunk-WM5GFORS.js} +2 -2
  64. package/dist/{chunk-CGJFCT3X.js → chunk-WMKCAN4H.js} +2 -2
  65. package/dist/{chunk-R7JTYCRX.js → chunk-XZCBBZLS.js} +2 -2
  66. package/dist/{chunk-EKTOYEZ3.js → chunk-YAMTXW77.js} +2 -2
  67. package/dist/consent/index.cjs.map +1 -1
  68. package/dist/consent/index.d.cts +5 -5
  69. package/dist/consent/index.d.ts +5 -5
  70. package/dist/consent/index.js +3 -3
  71. package/dist/{crypto-5UDZZL26.js → crypto-TRZ5BJMY.js} +3 -3
  72. package/dist/{delegation-42LO4WFO.js → delegation-TLZTK2XW.js} +5 -5
  73. package/dist/derivations/index.cjs.map +1 -1
  74. package/dist/derivations/index.d.cts +6 -6
  75. package/dist/derivations/index.d.ts +6 -6
  76. package/dist/derivations/index.js +4 -4
  77. package/dist/{dev-unlock-Cvo-xCQC.d.ts → dev-unlock-ClAEZQC4.d.ts} +1 -1
  78. package/dist/{dev-unlock-Dy1qVpkL.d.cts → dev-unlock-L3z34v0J.d.cts} +1 -1
  79. package/dist/executor-HAVRTQN4.js +11 -0
  80. package/dist/executor-V3DKOADS.js +8 -0
  81. package/dist/executor-XO4M4243.js +8 -0
  82. package/dist/{fanout-sidecar-EVICRM46.js → fanout-sidecar-OKPMMPLG.js} +2 -2
  83. package/dist/guards/index.cjs.map +1 -1
  84. package/dist/guards/index.d.cts +6 -6
  85. package/dist/guards/index.d.ts +6 -6
  86. package/dist/guards/index.js +3 -3
  87. package/dist/{hash-BAlWR4WD.d.ts → hash-B3lV6lw3.d.ts} +1 -1
  88. package/dist/{hash-BgEQklQc.d.cts → hash-M6-JI3Yu.d.cts} +1 -1
  89. package/dist/history/index.cjs.map +1 -1
  90. package/dist/history/index.d.cts +6 -6
  91. package/dist/history/index.d.ts +6 -6
  92. package/dist/history/index.js +5 -5
  93. package/dist/i18n/index.cjs.map +1 -1
  94. package/dist/i18n/index.d.cts +5 -5
  95. package/dist/i18n/index.d.ts +5 -5
  96. package/dist/i18n/index.js +5 -5
  97. package/dist/{index-fIPPh5dg.d.ts → index-CmWQyC4e.d.ts} +84 -7
  98. package/dist/{index-5I0MZ0jQ.d.cts → index-vB43MAt4.d.cts} +84 -7
  99. package/dist/index.cjs +340 -9
  100. package/dist/index.cjs.map +1 -1
  101. package/dist/index.d.cts +13 -13
  102. package/dist/index.d.ts +13 -13
  103. package/dist/index.js +60 -52
  104. package/dist/index.js.map +1 -1
  105. package/dist/indexing/index.cjs +4 -0
  106. package/dist/indexing/index.cjs.map +1 -1
  107. package/dist/indexing/index.d.cts +3 -3
  108. package/dist/indexing/index.d.ts +3 -3
  109. package/dist/indexing/index.js +4 -4
  110. package/dist/issue-EJKUQ6FA.js +12 -0
  111. package/dist/{lazy-builder-D1MyR1qH.d.ts → lazy-builder-7tIpFyWN.d.ts} +1 -1
  112. package/dist/{lazy-builder-DXlSCNCJ.d.cts → lazy-builder-wY4pMCEe.d.cts} +1 -1
  113. package/dist/{ledger-UX4QIHWI.js → ledger-SQVVE2DR.js} +5 -5
  114. package/dist/materialized-views/index.cjs +18 -1
  115. package/dist/materialized-views/index.cjs.map +1 -1
  116. package/dist/materialized-views/index.d.cts +10 -8
  117. package/dist/materialized-views/index.d.ts +10 -8
  118. package/dist/materialized-views/index.js +12 -12
  119. package/dist/noydb-MK4UQ626.js +34 -0
  120. package/dist/overlay-views/index.cjs.map +1 -1
  121. package/dist/overlay-views/index.d.cts +6 -6
  122. package/dist/overlay-views/index.d.ts +6 -6
  123. package/dist/overlay-views/index.js +6 -6
  124. package/dist/periods/index.cjs.map +1 -1
  125. package/dist/periods/index.d.cts +5 -5
  126. package/dist/periods/index.d.ts +5 -5
  127. package/dist/periods/index.js +5 -5
  128. package/dist/{predicate-B0IKeBXx.d.cts → predicate-BSAGEyu5.d.cts} +26 -2
  129. package/dist/{predicate-B0IKeBXx.d.ts → predicate-BSAGEyu5.d.ts} +26 -2
  130. package/dist/{public-envelope-YKHKP74C.js → public-envelope-BXPXMN3U.js} +4 -4
  131. package/dist/query/index.cjs +244 -4
  132. package/dist/query/index.cjs.map +1 -1
  133. package/dist/query/index.d.cts +2 -2
  134. package/dist/query/index.d.ts +2 -2
  135. package/dist/query/index.js +12 -6
  136. package/dist/{registry-4NEW7LQY.js → registry-4R4IURUM.js} +3 -3
  137. package/dist/registry-GPBLCHG7.js +8 -0
  138. package/dist/registry-ZON5HNIV.js +8 -0
  139. package/dist/{revoke-R5NIQ74J.js → revoke-Y7UDOXGH.js} +6 -6
  140. package/dist/session/index.cjs.map +1 -1
  141. package/dist/session/index.d.cts +6 -6
  142. package/dist/session/index.d.ts +6 -6
  143. package/dist/session/index.js +3 -3
  144. package/dist/shadow/index.cjs.map +1 -1
  145. package/dist/shadow/index.d.cts +5 -5
  146. package/dist/shadow/index.d.ts +5 -5
  147. package/dist/shadow/index.js +2 -2
  148. package/dist/{signer-WGDJNWSU.js → signer-UD2ZSVDJ.js} +5 -5
  149. package/dist/snapshots/index.cjs +903 -0
  150. package/dist/snapshots/index.cjs.map +1 -0
  151. package/dist/snapshots/index.d.cts +21 -0
  152. package/dist/snapshots/index.d.ts +21 -0
  153. package/dist/snapshots/index.js +118 -0
  154. package/dist/snapshots/index.js.map +1 -0
  155. package/dist/{stale-74WGLVZ2.js → stale-F4V5E7ZK.js} +2 -2
  156. package/dist/store/index.cjs.map +1 -1
  157. package/dist/store/index.d.cts +5 -5
  158. package/dist/store/index.d.ts +5 -5
  159. package/dist/store/index.js +2 -2
  160. package/dist/sync/index.cjs.map +1 -1
  161. package/dist/sync/index.d.cts +4 -4
  162. package/dist/sync/index.d.ts +4 -4
  163. package/dist/sync/index.js +4 -4
  164. package/dist/team/index.cjs.map +1 -1
  165. package/dist/team/index.d.cts +5 -5
  166. package/dist/team/index.d.ts +5 -5
  167. package/dist/team/index.js +8 -8
  168. package/dist/tx/index.cjs.map +1 -1
  169. package/dist/tx/index.d.cts +5 -5
  170. package/dist/tx/index.d.ts +5 -5
  171. package/dist/tx/index.js +3 -3
  172. package/dist/{types-DlnZh1_i.d.ts → types-DT7cXRHq.d.ts} +63 -4
  173. package/dist/{types-DVlvNn2c.d.cts → types-r-y7TIqj.d.cts} +63 -4
  174. package/dist/{ulid-r98nkjVd.d.cts → ulid-BkW3mLlz.d.cts} +1 -1
  175. package/dist/{ulid-CzPONlhG.d.ts → ulid-Dt55yn4s.d.ts} +1 -1
  176. package/dist/util/index.cjs.map +1 -1
  177. package/dist/util/index.js +1 -1
  178. package/dist/{with-derivation-BMQ9pIHe.d.cts → with-derivation-DB63Po2m.d.cts} +1 -1
  179. package/dist/{with-derivation-B98shCV8.d.ts → with-derivation-D_Ids_H6.d.ts} +1 -1
  180. package/dist/{with-guard-DUnC3JDN.d.cts → with-guard-BHThLppa.d.cts} +1 -1
  181. package/dist/{with-guard-DmT50nVG.d.ts → with-guard-BJwdc0s6.d.ts} +1 -1
  182. package/dist/{with-materialized-view-eMTZ65_J.d.cts → with-materialized-view-BJmJ-FrO.d.cts} +1 -1
  183. package/dist/{with-materialized-view-Bp_M3sNG.d.ts → with-materialized-view-D-CRVSDX.d.ts} +1 -1
  184. package/dist/{with-overlayed-view-zzSnRQmS.d.ts → with-overlayed-view-CNf6GbDG.d.ts} +1 -1
  185. package/dist/{with-overlayed-view-BoY6PB3n.d.cts → with-overlayed-view-zePNtUSq.d.cts} +1 -1
  186. package/package.json +13 -3
  187. package/dist/chunk-5OVIFUQE.js.map +0 -1
  188. package/dist/chunk-6HJ2ZALB.js.map +0 -1
  189. package/dist/chunk-7TX7HN42.js.map +0 -1
  190. package/dist/chunk-ICH4AIGL.js.map +0 -1
  191. package/dist/chunk-W277AG6N.js.map +0 -1
  192. package/dist/chunk-XDW37COG.js.map +0 -1
  193. package/dist/executor-AWCHQ2KN.js +0 -8
  194. package/dist/executor-RWICJI7J.js +0 -11
  195. package/dist/executor-SOLEQVUB.js +0 -8
  196. package/dist/issue-IODMTPME.js +0 -12
  197. package/dist/noydb-FY2666NY.js +0 -34
  198. package/dist/registry-446I2NMN.js +0 -8
  199. package/dist/registry-524KJZG4.js +0 -8
  200. /package/dist/{chunk-E225X5CQ.js.map → chunk-22ESLVUM.js.map} +0 -0
  201. /package/dist/{chunk-5QPF2MJ5.js.map → chunk-2TXMTYWZ.js.map} +0 -0
  202. /package/dist/{chunk-34XGYMQT.js.map → chunk-3XCXUJTM.js.map} +0 -0
  203. /package/dist/{chunk-KGFV72WK.js.map → chunk-4YVVF6JN.js.map} +0 -0
  204. /package/dist/{chunk-UGVDIOY7.js.map → chunk-6ILPGZXZ.js.map} +0 -0
  205. /package/dist/{chunk-DFCINPB5.js.map → chunk-6MXGU2PW.js.map} +0 -0
  206. /package/dist/{chunk-Y3P5DEMZ.js.map → chunk-7IH5FDXD.js.map} +0 -0
  207. /package/dist/{chunk-2GMRNNI3.js.map → chunk-ASFE2X62.js.map} +0 -0
  208. /package/dist/{chunk-JICBEFBT.js.map → chunk-AYRTGXF3.js.map} +0 -0
  209. /package/dist/{chunk-CCC25PA7.js.map → chunk-BE5ZALMB.js.map} +0 -0
  210. /package/dist/{chunk-WEA4TDTJ.js.map → chunk-BNUCCUES.js.map} +0 -0
  211. /package/dist/{chunk-PS5G6A3Y.js.map → chunk-BRZFN354.js.map} +0 -0
  212. /package/dist/{chunk-RIHZBSWJ.js.map → chunk-CBHPW77B.js.map} +0 -0
  213. /package/dist/{chunk-LWFQYT4N.js.map → chunk-CSHY53CZ.js.map} +0 -0
  214. /package/dist/{chunk-MDIC4FAU.js.map → chunk-DCP4L4SH.js.map} +0 -0
  215. /package/dist/{chunk-TNBIWSQ7.js.map → chunk-GI6S5ZF2.js.map} +0 -0
  216. /package/dist/{chunk-G26QAQNI.js.map → chunk-GZIDTXC4.js.map} +0 -0
  217. /package/dist/{chunk-ARZAHCCF.js.map → chunk-HNC55FLJ.js.map} +0 -0
  218. /package/dist/{chunk-SGSHQ4PH.js.map → chunk-HNFXKQD7.js.map} +0 -0
  219. /package/dist/{chunk-YEHUEUNP.js.map → chunk-JZDA2SRB.js.map} +0 -0
  220. /package/dist/{chunk-PX3MJ6RB.js.map → chunk-KK44CQ5B.js.map} +0 -0
  221. /package/dist/{chunk-OPD3PZOG.js.map → chunk-LSY46G55.js.map} +0 -0
  222. /package/dist/{chunk-T6MTNGBM.js.map → chunk-N4CDTRDH.js.map} +0 -0
  223. /package/dist/{chunk-ZQMYB56Z.js.map → chunk-O3JCRQT3.js.map} +0 -0
  224. /package/dist/{chunk-LJO6Q3X6.js.map → chunk-OA6HE2RW.js.map} +0 -0
  225. /package/dist/{chunk-HIELMTUK.js.map → chunk-OIF6LZUR.js.map} +0 -0
  226. /package/dist/{chunk-YJ46RFCD.js.map → chunk-OXCFFRF3.js.map} +0 -0
  227. /package/dist/{chunk-ED3E3OLO.js.map → chunk-PJKGXUMG.js.map} +0 -0
  228. /package/dist/{chunk-6A4AMQ2H.js.map → chunk-QYO6I7KK.js.map} +0 -0
  229. /package/dist/{chunk-A4JNVBPF.js.map → chunk-SYOSRZN4.js.map} +0 -0
  230. /package/dist/{chunk-R4LTCI6O.js.map → chunk-TS4FQPDD.js.map} +0 -0
  231. /package/dist/{chunk-CKH247ZR.js.map → chunk-UPBZ7NVY.js.map} +0 -0
  232. /package/dist/{chunk-XVJFFGTG.js.map → chunk-VZOZ3DBN.js.map} +0 -0
  233. /package/dist/{chunk-5VMTAX4Y.js.map → chunk-W6EQLGMB.js.map} +0 -0
  234. /package/dist/{chunk-JSYTGEX4.js.map → chunk-WBUG3324.js.map} +0 -0
  235. /package/dist/{chunk-25WFLKOH.js.map → chunk-WM5GFORS.js.map} +0 -0
  236. /package/dist/{chunk-CGJFCT3X.js.map → chunk-WMKCAN4H.js.map} +0 -0
  237. /package/dist/{chunk-R7JTYCRX.js.map → chunk-XZCBBZLS.js.map} +0 -0
  238. /package/dist/{chunk-EKTOYEZ3.js.map → chunk-YAMTXW77.js.map} +0 -0
  239. /package/dist/{crypto-5UDZZL26.js.map → crypto-TRZ5BJMY.js.map} +0 -0
  240. /package/dist/{delegation-42LO4WFO.js.map → delegation-TLZTK2XW.js.map} +0 -0
  241. /package/dist/{executor-AWCHQ2KN.js.map → executor-HAVRTQN4.js.map} +0 -0
  242. /package/dist/{executor-RWICJI7J.js.map → executor-V3DKOADS.js.map} +0 -0
  243. /package/dist/{executor-SOLEQVUB.js.map → executor-XO4M4243.js.map} +0 -0
  244. /package/dist/{fanout-sidecar-EVICRM46.js.map → fanout-sidecar-OKPMMPLG.js.map} +0 -0
  245. /package/dist/{issue-IODMTPME.js.map → issue-EJKUQ6FA.js.map} +0 -0
  246. /package/dist/{ledger-UX4QIHWI.js.map → ledger-SQVVE2DR.js.map} +0 -0
  247. /package/dist/{noydb-FY2666NY.js.map → noydb-MK4UQ626.js.map} +0 -0
  248. /package/dist/{public-envelope-YKHKP74C.js.map → public-envelope-BXPXMN3U.js.map} +0 -0
  249. /package/dist/{registry-446I2NMN.js.map → registry-4R4IURUM.js.map} +0 -0
  250. /package/dist/{registry-4NEW7LQY.js.map → registry-GPBLCHG7.js.map} +0 -0
  251. /package/dist/{registry-524KJZG4.js.map → registry-ZON5HNIV.js.map} +0 -0
  252. /package/dist/{revoke-R5NIQ74J.js.map → revoke-Y7UDOXGH.js.map} +0 -0
  253. /package/dist/{signer-WGDJNWSU.js.map → signer-UD2ZSVDJ.js.map} +0 -0
  254. /package/dist/{stale-74WGLVZ2.js.map → stale-F4V5E7ZK.js.map} +0 -0
package/dist/index.cjs CHANGED
@@ -46,7 +46,7 @@ var init_types = __esm({
46
46
  });
47
47
 
48
48
  // src/errors.ts
49
- var NoydbError, DecryptionError, TamperedError, InvalidKeyError, KeyringCorruptError, NoAccessError, ReadOnlyError, ReadOnlyAtInstantError, ReadOnlyFrameError, PermissionDeniedError, ExportCapabilityError, KeyringExpiredError, ImportCapabilityError, StoreCapabilityError, PrivilegeEscalationError, PeriodClosedError, RecordLockedError, FieldFrozenError, InvariantError, AmendmentForbiddenError, DirectoryDisabledError, TierNotGrantedError, ElevationExpiredError, AlreadyElevatedError, TierDemoteDeniedError, DelegationTargetMissingError, ConflictError, LedgerContentionError, BundleVersionConflictError, NetworkError, NotFoundError, ValidationError, SchemaValidationError, SchemaUpdateError, NonAdditiveSchemaChangeError, SchemaLockedError, SchemaFenceError, MigrationRequiredError, QuiesceTimeoutError, GroupCardinalityError, IndexRequiredError, IndexWriteFailureError, BundleIntegrityError, BundleSealMismatchError, ReservedCollectionNameError, DictKeyMissingError, DictKeyInUseError, MissingTranslationError, LocaleNotSpecifiedError, TranslatorNotConfiguredError, BackupLedgerError, BackupCorruptedError, AttestationError, SessionExpiredError, SessionNotFoundError, SessionPolicyError, JoinTooLargeError, DanglingReferenceError, FilenameSanitizationError, PathEscapeError, DerivationCycleError, DerivationDepthError, DerivationOutputUnknownError, DerivationOutputShapeError, DerivationCapExceededError, MaterializedViewCycleError, MaterializedViewSourceUnknownError, MaterializedViewTooLargeError, MaterializedViewConfigError, OverlayBaseIsVirtualError, OverlayCollectionUnavailableError, OverlayNameCollisionError, OverlayIdMismatchError;
49
+ var NoydbError, DecryptionError, TamperedError, InvalidKeyError, KeyringCorruptError, NoAccessError, ReadOnlyError, ReadOnlyAtInstantError, ReadOnlyFrameError, PermissionDeniedError, ExportCapabilityError, KeyringExpiredError, ImportCapabilityError, StoreCapabilityError, PrivilegeEscalationError, PeriodClosedError, RecordLockedError, FieldFrozenError, InvariantError, AmendmentForbiddenError, DirectoryDisabledError, TierNotGrantedError, ElevationExpiredError, AlreadyElevatedError, TierDemoteDeniedError, DelegationTargetMissingError, ConflictError, LedgerContentionError, BundleVersionConflictError, NetworkError, NotFoundError, ValidationError, SchemaValidationError, SchemaUpdateError, NonAdditiveSchemaChangeError, SchemaLockedError, SchemaFenceError, MigrationRequiredError, QuiesceTimeoutError, GroupCardinalityError, IndexRequiredError, IndexWriteFailureError, BundleIntegrityError, BundleSealMismatchError, ReservedCollectionNameError, DictKeyMissingError, DictKeyInUseError, MissingTranslationError, LocaleNotSpecifiedError, TranslatorNotConfiguredError, BackupLedgerError, BackupCorruptedError, AttestationError, SessionExpiredError, SessionNotFoundError, SessionPolicyError, JoinTooLargeError, CrossJoinTooLargeError, CrossJoinSourceUnknownError, DanglingReferenceError, FilenameSanitizationError, PathEscapeError, DerivationCycleError, DerivationDepthError, DerivationOutputUnknownError, DerivationOutputShapeError, DerivationCapExceededError, MaterializedViewCycleError, MaterializedViewSourceUnknownError, MaterializedViewTooLargeError, MaterializedViewConfigError, OverlayBaseIsVirtualError, OverlayCollectionUnavailableError, OverlayNameCollisionError, OverlayIdMismatchError, SnapshotNotFoundError;
50
50
  var init_errors = __esm({
51
51
  "src/errors.ts"() {
52
52
  "use strict";
@@ -646,6 +646,34 @@ Resolutions:
646
646
  this.side = opts.side;
647
647
  }
648
648
  };
649
+ CrossJoinTooLargeError = class extends NoydbError {
650
+ target;
651
+ expected;
652
+ limit;
653
+ constructor(opts) {
654
+ super(
655
+ "CROSS_JOIN_TOO_LARGE",
656
+ `crossJoin("${opts.target}"): would produce ${opts.expected} rows, exceeding the limit of ${opts.limit}. Narrow the left side with .where() first, or raise the ceiling with crossJoin("${opts.target}", { ..., maxRows: ${opts.expected} }).`
657
+ );
658
+ this.name = "CrossJoinTooLargeError";
659
+ this.target = opts.target;
660
+ this.expected = opts.expected;
661
+ this.limit = opts.limit;
662
+ }
663
+ };
664
+ CrossJoinSourceUnknownError = class extends NoydbError {
665
+ target;
666
+ leftCollection;
667
+ constructor(target, leftCollection) {
668
+ super(
669
+ "CROSS_JOIN_SOURCE_UNKNOWN",
670
+ `crossJoin("${target}"): collection "${target}" is not known in the vault (cross-joining from "${leftCollection}"). Make sure "${target}" is open in the same vault before executing this query.`
671
+ );
672
+ this.name = "CrossJoinSourceUnknownError";
673
+ this.target = target;
674
+ this.leftCollection = leftCollection;
675
+ }
676
+ };
649
677
  DanglingReferenceError = class extends NoydbError {
650
678
  field;
651
679
  target;
@@ -836,6 +864,17 @@ Resolutions:
836
864
  this.expected = expected;
837
865
  }
838
866
  };
867
+ SnapshotNotFoundError = class extends NoydbError {
868
+ version;
869
+ constructor(version) {
870
+ super(
871
+ "SNAPSHOT_NOT_FOUND",
872
+ `Snapshot not found: "${version}" does not exist in the snapshot store. It may have been pruned by the retention policy or deleted manually.`
873
+ );
874
+ this.name = "SnapshotNotFoundError";
875
+ this.version = version;
876
+ }
877
+ };
839
878
  }
840
879
  });
841
880
 
@@ -2231,6 +2270,10 @@ function evaluateClause(record, clause) {
2231
2270
  return clause.fn(record);
2232
2271
  case "wherePredicate":
2233
2272
  return clause.fn(record, clause.ctx);
2273
+ case "crossJoin":
2274
+ throw new Error(
2275
+ `evaluateClause: 'crossJoin' clauses are expansion primitives and are not evaluated per-record. This is a query planner routing error \u2014 crossJoin clauses must be extracted from the clause list before calling evaluateClause or filterRecords.`
2276
+ );
2234
2277
  case "group":
2235
2278
  if (clause.op === "and") {
2236
2279
  for (const child of clause.clauses) {
@@ -2800,6 +2843,11 @@ function analyzeDependencies(query) {
2800
2843
  for (const leg of plan.joins) {
2801
2844
  deps.add(leg.target);
2802
2845
  }
2846
+ for (const clause of plan.clauses) {
2847
+ if (clause.type === "crossJoin") {
2848
+ deps.add(clause.target);
2849
+ }
2850
+ }
2803
2851
  walkClausesForJoins(plan, deps, ctx);
2804
2852
  return deps;
2805
2853
  }
@@ -2815,7 +2863,19 @@ function summarizeQueryPlan(query) {
2815
2863
  const ctx = query._joinContext();
2816
2864
  return JSON.stringify({
2817
2865
  root: ctx?.leftCollection ?? null,
2818
- clauses: plan.clauses,
2866
+ clauses: plan.clauses.map((c) => {
2867
+ if (c.type === "crossJoin") {
2868
+ return {
2869
+ type: "crossJoin",
2870
+ target: c.target,
2871
+ as: c.as,
2872
+ // Inline on: callback: use sentinel — drift detection disabled for this MV
2873
+ onPredicateName: c.onPredicateName ?? (c.on ? "[inline]" : null),
2874
+ maxRows: c.maxRows ?? null
2875
+ };
2876
+ }
2877
+ return c;
2878
+ }),
2819
2879
  orderBy: plan.orderBy,
2820
2880
  limit: plan.limit ?? null,
2821
2881
  offset: plan.offset,
@@ -3942,7 +4002,10 @@ __export(src_exports, {
3942
4002
  CollectionIndexes: () => CollectionIndexes,
3943
4003
  CollectionInstant: () => CollectionInstant,
3944
4004
  ConflictError: () => ConflictError,
4005
+ CrossJoinSourceUnknownError: () => CrossJoinSourceUnknownError,
4006
+ CrossJoinTooLargeError: () => CrossJoinTooLargeError,
3945
4007
  DEFAULT_CHUNK_SIZE: () => DEFAULT_CHUNK_SIZE,
4008
+ DEFAULT_CROSS_JOIN_MAX_ROWS: () => DEFAULT_CROSS_JOIN_MAX_ROWS,
3946
4009
  DEFAULT_FRESHNESS_MS: () => DEFAULT_FRESHNESS_MS,
3947
4010
  DEFAULT_JOIN_MAX_ROWS: () => DEFAULT_JOIN_MAX_ROWS,
3948
4011
  DEFAULT_PUBLIC_ENVELOPE_SCHEMA: () => DEFAULT_PUBLIC_ENVELOPE_SCHEMA,
@@ -4055,6 +4118,7 @@ __export(src_exports, {
4055
4118
  SessionExpiredError: () => SessionExpiredError,
4056
4119
  SessionNotFoundError: () => SessionNotFoundError,
4057
4120
  SessionPolicyError: () => SessionPolicyError,
4121
+ SnapshotNotFoundError: () => SnapshotNotFoundError,
4058
4122
  StoreCapabilityError: () => StoreCapabilityError,
4059
4123
  SyncEngine: () => SyncEngine,
4060
4124
  SyncScheduler: () => SyncScheduler,
@@ -6223,6 +6287,7 @@ function withHealthCheck(opts = {}) {
6223
6287
 
6224
6288
  // src/index.ts
6225
6289
  init_errors();
6290
+ init_errors();
6226
6291
 
6227
6292
  // src/bundle/format.ts
6228
6293
  var NOYDB_BUNDLE_MAGIC = new Uint8Array([78, 68, 66, 49]);
@@ -10065,6 +10130,9 @@ function resetJoinWarnings() {
10065
10130
  warnedCeilingKeys.clear();
10066
10131
  }
10067
10132
 
10133
+ // src/query/builder.ts
10134
+ init_errors();
10135
+
10068
10136
  // src/query/live.ts
10069
10137
  function buildLiveQuery(recompute, upstreams) {
10070
10138
  return new LiveQueryImpl(recompute, upstreams);
@@ -10163,6 +10231,7 @@ var EMPTY_PLAN = {
10163
10231
  offset: 0,
10164
10232
  joins: []
10165
10233
  };
10234
+ var DEFAULT_CROSS_JOIN_MAX_ROWS = 5e4;
10166
10235
  var Query = class _Query {
10167
10236
  source;
10168
10237
  plan;
@@ -10444,6 +10513,78 @@ var Query = class _Query {
10444
10513
  this.predicates
10445
10514
  );
10446
10515
  }
10516
+ /**
10517
+ * Cartesian-product cross-join against `target` collection. Each result row
10518
+ * carries the original `T` fields plus `result[as]` populated from every
10519
+ * right-side row (or the filtered subset when `on:` is supplied).
10520
+ *
10521
+ * **Order matters:** `.where().crossJoin()` filters BEFORE expanding (cheaper);
10522
+ * `.crossJoin().where('alias.field', ...)` filters AFTER (required when the
10523
+ * where clause references the aliased fields).
10524
+ *
10525
+ * **Cost ceiling:** `CrossJoinTooLargeError` fires before allocation when
10526
+ * `leftRows × rightRows` (or the cumulative lateral count) exceeds the limit.
10527
+ * Default: 50,000 rows. Override per-clause with `{ maxRows: N }`.
10528
+ *
10529
+ * **`on:` shapes:**
10530
+ * - `on: (left) => TTarget[]` — subset form (most efficient)
10531
+ * - `on: (left) => (right) => boolean` — predicate form
10532
+ * - `on: { predicate: 'name' }` — MV-safe, hash-tracked form
10533
+ * (requires the Query to have been augmented via `_withPredicates`)
10534
+ *
10535
+ * Requires a JoinContext (constructed via `collection.query()`).
10536
+ */
10537
+ crossJoin(target, opts) {
10538
+ if (!this.joinContext) {
10539
+ throw new Error(
10540
+ `Query.crossJoin("${target}"): requires a join context. Use collection.query() to construct a cross-join-capable Query instead of the Query constructor directly.`
10541
+ );
10542
+ }
10543
+ let onFn;
10544
+ let onPredicateName;
10545
+ if (opts.on !== void 0) {
10546
+ if (typeof opts.on === "function") {
10547
+ onFn = opts.on;
10548
+ if (this.predicates) {
10549
+ console.warn(
10550
+ `Query.crossJoin("${target}", { on: callback }): inline on: callback inside a withMaterializedView query() disables queryHash drift detection for this cross-join. Use on: { predicate: '<name>' } to enable it.`
10551
+ );
10552
+ }
10553
+ } else {
10554
+ const predName = opts.on.predicate;
10555
+ if (!this.predicates) {
10556
+ throw new Error(
10557
+ `Query.crossJoin("${target}", { on: { predicate: "${predName}" } }): the { predicate } form requires a predicates map. Use this form inside a withMaterializedView query() callback that declares predicates: { ${predName}: { hash, fn } }.`
10558
+ );
10559
+ }
10560
+ const decl = this.predicates.get(predName);
10561
+ if (!decl) {
10562
+ throw new Error(
10563
+ `Query.crossJoin("${target}"): predicate "${predName}" not registered. Available: ${[...this.predicates.keys()].join(", ") || "(none)"}.`
10564
+ );
10565
+ }
10566
+ const as = opts.as;
10567
+ const predicateFn = decl.fn;
10568
+ onFn = (_left) => (right) => predicateFn({ ..._left, [as]: right });
10569
+ onPredicateName = predName;
10570
+ }
10571
+ }
10572
+ const clause = {
10573
+ type: "crossJoin",
10574
+ target,
10575
+ as: opts.as,
10576
+ ...onFn !== void 0 && { on: onFn },
10577
+ ...onPredicateName !== void 0 && { onPredicateName },
10578
+ ...opts.maxRows !== void 0 && { maxRows: opts.maxRows }
10579
+ };
10580
+ return new _Query(
10581
+ this.source,
10582
+ { ...this.plan, clauses: [...this.plan.clauses, clause] },
10583
+ this.joinContext,
10584
+ this.aggregateStrategy,
10585
+ this.predicates
10586
+ );
10587
+ }
10447
10588
  /**
10448
10589
  * Execute the plan and return the matching records. When the plan
10449
10590
  * carries any join legs, they are applied after `where` / `orderBy`
@@ -10451,7 +10592,7 @@ var Query = class _Query {
10451
10592
  * for the ordering rationale.
10452
10593
  */
10453
10594
  toArray() {
10454
- const base = executePlanWithSource(this.source, this.plan);
10595
+ const base = executePlanWithSource(this.source, this.plan, this.joinContext);
10455
10596
  if (this.plan.joins.length === 0) return base;
10456
10597
  if (!this.joinContext) {
10457
10598
  throw new Error(
@@ -10475,6 +10616,14 @@ var Query = class _Query {
10475
10616
  * intent is purely to count.
10476
10617
  */
10477
10618
  count() {
10619
+ if (this.plan.clauses.some((c) => c.type === "crossJoin")) {
10620
+ if (!this.joinContext) {
10621
+ throw new Error(
10622
+ `Query.count(): plan contains crossJoin clauses but no JoinContext is attached.`
10623
+ );
10624
+ }
10625
+ return executeClausePipeline(this.source, this.plan.clauses, this.joinContext).length;
10626
+ }
10478
10627
  const { candidates, remainingClauses } = candidateRecords(this.source, this.plan.clauses);
10479
10628
  if (remainingClauses.length === 0) return candidates.length;
10480
10629
  return filterRecords(candidates, remainingClauses).length;
@@ -10522,7 +10671,13 @@ var Query = class _Query {
10522
10671
  aggregate(spec) {
10523
10672
  const source = this.source;
10524
10673
  const clauses = this.plan.clauses;
10674
+ const joinCtx = this.joinContext;
10675
+ const hasCrossJoins = clauses.some((c) => c.type === "crossJoin");
10525
10676
  const executeRecords = () => {
10677
+ if (hasCrossJoins) {
10678
+ if (!joinCtx) throw new Error("Query.aggregate(): crossJoin requires a join context");
10679
+ return executeClausePipeline(source, clauses, joinCtx);
10680
+ }
10526
10681
  const { candidates, remainingClauses } = candidateRecords(source, clauses);
10527
10682
  return remainingClauses.length === 0 ? candidates : filterRecords(candidates, remainingClauses);
10528
10683
  };
@@ -10539,7 +10694,13 @@ var Query = class _Query {
10539
10694
  }
10540
10695
  const source = this.source;
10541
10696
  const clauses = this.plan.clauses;
10697
+ const joinCtx = this.joinContext;
10698
+ const hasCrossJoins = clauses.some((c) => c.type === "crossJoin");
10542
10699
  const executeRecords = () => {
10700
+ if (hasCrossJoins) {
10701
+ if (!joinCtx) throw new Error("Query.groupBy(): crossJoin requires a join context");
10702
+ return executeClausePipeline(source, clauses, joinCtx);
10703
+ }
10543
10704
  const { candidates, remainingClauses } = candidateRecords(source, clauses);
10544
10705
  return remainingClauses.length === 0 ? candidates : filterRecords(candidates, remainingClauses);
10545
10706
  };
@@ -10653,6 +10814,21 @@ var Query = class _Query {
10653
10814
  }
10654
10815
  }
10655
10816
  }
10817
+ if (this.joinContext) {
10818
+ const subscribedCross = /* @__PURE__ */ new Set();
10819
+ for (const clause of this.plan.clauses) {
10820
+ if (clause.type !== "crossJoin") continue;
10821
+ if (subscribedCross.has(clause.target)) continue;
10822
+ subscribedCross.add(clause.target);
10823
+ const rightSource = this.joinContext.resolveSource(clause.target);
10824
+ if (rightSource?.subscribe) {
10825
+ const rightSubscribe = rightSource.subscribe.bind(rightSource);
10826
+ upstreams.push({
10827
+ subscribe: (cb) => rightSubscribe(cb)
10828
+ });
10829
+ }
10830
+ }
10831
+ }
10656
10832
  return buildLiveQuery(() => this.toArray(), upstreams);
10657
10833
  }
10658
10834
  /**
@@ -10664,9 +10840,20 @@ var Query = class _Query {
10664
10840
  return serializePlan(this.plan);
10665
10841
  }
10666
10842
  };
10667
- function executePlanWithSource(source, plan) {
10668
- const { candidates, remainingClauses } = candidateRecords(source, plan.clauses);
10669
- let result = remainingClauses.length === 0 ? [...candidates] : filterRecords(candidates, remainingClauses);
10843
+ function executePlanWithSource(source, plan, joinContext) {
10844
+ const hasCrossJoins = plan.clauses.some((c) => c.type === "crossJoin");
10845
+ let result;
10846
+ if (hasCrossJoins) {
10847
+ if (!joinContext) {
10848
+ throw new Error(
10849
+ `Query.toArray(): plan contains crossJoin clauses but no JoinContext is attached. Use collection.query() instead of new Query() for cross-join support.`
10850
+ );
10851
+ }
10852
+ result = executeClausePipeline(source, plan.clauses, joinContext);
10853
+ } else {
10854
+ const { candidates, remainingClauses } = candidateRecords(source, plan.clauses);
10855
+ result = remainingClauses.length === 0 ? [...candidates] : filterRecords(candidates, remainingClauses);
10856
+ }
10670
10857
  if (plan.orderBy.length > 0) {
10671
10858
  result = sortRecords(result, plan.orderBy);
10672
10859
  }
@@ -10716,6 +10903,11 @@ function materializeIds(ids, lookupById) {
10716
10903
  return out;
10717
10904
  }
10718
10905
  function executePlan(records, plan) {
10906
+ if (plan.clauses.some((c) => c.type === "crossJoin")) {
10907
+ throw new Error(
10908
+ `executePlan(): does not support crossJoin clauses. executePlan is a stateless pure function \u2014 it cannot resolve cross-join right-side collections. Use Query.toArray() (via collection.query()) instead.`
10909
+ );
10910
+ }
10719
10911
  let result = filterRecords(records, plan.clauses);
10720
10912
  if (plan.orderBy.length > 0) {
10721
10913
  result = sortRecords(result, plan.orderBy);
@@ -10743,6 +10935,74 @@ function filterRecords(records, clauses) {
10743
10935
  }
10744
10936
  return out;
10745
10937
  }
10938
+ function executeClausePipeline(source, clauses, joinContext) {
10939
+ let rel = [...source.snapshot()];
10940
+ let filterBatch = [];
10941
+ for (const clause of clauses) {
10942
+ if (clause.type === "crossJoin") {
10943
+ if (filterBatch.length > 0) {
10944
+ rel = filterRecords(rel, filterBatch);
10945
+ filterBatch = [];
10946
+ }
10947
+ const rightSource = joinContext.resolveSource(clause.target);
10948
+ if (!rightSource) {
10949
+ throw new CrossJoinSourceUnknownError(clause.target, joinContext.leftCollection);
10950
+ }
10951
+ rel = applyCrossJoin(rel, clause, rightSource);
10952
+ } else {
10953
+ filterBatch.push(clause);
10954
+ }
10955
+ }
10956
+ if (filterBatch.length > 0) {
10957
+ rel = filterRecords(rel, filterBatch);
10958
+ }
10959
+ return rel;
10960
+ }
10961
+ function applyCrossJoin(leftRel, clause, rightSource) {
10962
+ const rightRows = rightSource.snapshot();
10963
+ const maxRows = clause.maxRows ?? DEFAULT_CROSS_JOIN_MAX_ROWS;
10964
+ const { as } = clause;
10965
+ if (!clause.on) {
10966
+ const product = leftRel.length * rightRows.length;
10967
+ if (product > maxRows) {
10968
+ throw new CrossJoinTooLargeError({ target: clause.target, expected: product, limit: maxRows });
10969
+ }
10970
+ const expanded2 = [];
10971
+ for (const left of leftRel) {
10972
+ const leftObj = left;
10973
+ for (const right of rightRows) {
10974
+ expanded2.push({ ...leftObj, [as]: right });
10975
+ }
10976
+ }
10977
+ return expanded2;
10978
+ }
10979
+ const expanded = [];
10980
+ let cumulative = 0;
10981
+ for (const left of leftRel) {
10982
+ const callbackResult = clause.on(left);
10983
+ let filteredRight;
10984
+ if (Array.isArray(callbackResult)) {
10985
+ filteredRight = callbackResult;
10986
+ } else {
10987
+ filteredRight = rightRows.filter(
10988
+ callbackResult
10989
+ );
10990
+ }
10991
+ cumulative += filteredRight.length;
10992
+ if (cumulative > maxRows) {
10993
+ throw new CrossJoinTooLargeError({
10994
+ target: clause.target,
10995
+ expected: cumulative,
10996
+ limit: maxRows
10997
+ });
10998
+ }
10999
+ const leftObj = left;
11000
+ for (const right of filteredRight) {
11001
+ expanded.push({ ...leftObj, [as]: right });
11002
+ }
11003
+ }
11004
+ return expanded;
11005
+ }
10746
11006
  function sortRecords(records, orderBy) {
10747
11007
  return [...records].sort((a, b) => {
10748
11008
  for (const { field, direction } of orderBy) {
@@ -10805,6 +11065,16 @@ function serializeClause(clause) {
10805
11065
  clauses: clause.clauses.map(serializeClause)
10806
11066
  };
10807
11067
  }
11068
+ if (clause.type === "crossJoin") {
11069
+ return {
11070
+ type: "crossJoin",
11071
+ target: clause.target,
11072
+ as: clause.as,
11073
+ on: clause.on ? "[function]" : void 0,
11074
+ onPredicateName: clause.onPredicateName,
11075
+ maxRows: clause.maxRows
11076
+ };
11077
+ }
10808
11078
  return clause;
10809
11079
  }
10810
11080
  function canonicalCtxHash(ctx) {
@@ -19464,16 +19734,32 @@ function isTabWriteMsg(x) {
19464
19734
  return o["kind"] === "tab-write" && typeof o["writerId"] === "string" && typeof o["vault"] === "string" && typeof o["collection"] === "string" && typeof o["docId"] === "string" && (o["action"] === "put" || o["action"] === "delete") && typeof o["baseV"] === "number" && typeof o["v"] === "number";
19465
19735
  }
19466
19736
 
19467
- // src/tx/strategy.ts
19737
+ // src/snapshots/strategy.ts
19468
19738
  var NOT_ENABLED5 = new Error(
19739
+ 'Snapshots require the snapshot strategy. Import `{ withSnapshots }` from "@noy-db/hub/snapshots" and pass it to `createNoydb({ snapshotStrategy: withSnapshots({ store }) })`.'
19740
+ );
19741
+ var NO_SNAPSHOTS = {
19742
+ async snapshot() {
19743
+ throw NOT_ENABLED5;
19744
+ },
19745
+ async listSnapshots() {
19746
+ throw NOT_ENABLED5;
19747
+ },
19748
+ async restoreSnapshot() {
19749
+ throw NOT_ENABLED5;
19750
+ }
19751
+ };
19752
+
19753
+ // src/tx/strategy.ts
19754
+ var NOT_ENABLED6 = new Error(
19469
19755
  'Multi-record transactions require the tx strategy. Import `{ withTransactions }` from "@noy-db/hub/tx" and pass it to `createNoydb({ txStrategy: withTransactions() })`.'
19470
19756
  );
19471
19757
  var NO_TX = {
19472
19758
  async runTransaction() {
19473
- throw NOT_ENABLED5;
19759
+ throw NOT_ENABLED6;
19474
19760
  },
19475
19761
  async runDryRun() {
19476
- throw NOT_ENABLED5;
19762
+ throw NOT_ENABLED6;
19477
19763
  }
19478
19764
  };
19479
19765
 
@@ -19816,6 +20102,7 @@ var Noydb = class {
19816
20102
  txStrategy;
19817
20103
  sessionStrategy;
19818
20104
  syncStrategy;
20105
+ snapshotStrategy;
19819
20106
  /**
19820
20107
  * Currently-running multi-record transaction, set by
19821
20108
  * `runTransaction` at the start of Phase 2 (commit) and cleared in
@@ -19840,6 +20127,7 @@ var Noydb = class {
19840
20127
  this.txStrategy = options.txStrategy ?? NO_TX;
19841
20128
  this.sessionStrategy = options.sessionStrategy ?? NO_SESSION;
19842
20129
  this.syncStrategy = options.syncStrategy ?? NO_SYNC;
20130
+ this.snapshotStrategy = options.snapshotStrategy ?? NO_SNAPSHOTS;
19843
20131
  this.publicEnvelopeSchema = resolveSchema(options.publicEnvelope);
19844
20132
  if (options.sessionPolicy) {
19845
20133
  this.sessionStrategy.validateSessionPolicy(options.sessionPolicy);
@@ -21826,6 +22114,45 @@ var Noydb = class {
21826
22114
  this.keyringCache.set(vault, keyring);
21827
22115
  return keyring;
21828
22116
  }
22117
+ /**
22118
+ * Take an on-demand checkpoint of the given vault.
22119
+ * Requires `snapshotStrategy: withSnapshots({ store })` in `createNoydb`.
22120
+ * @throws ValidationError when the vault is not open
22121
+ */
22122
+ async snapshot(vault, opts) {
22123
+ if (this.closed) throw new ValidationError("Instance is closed");
22124
+ const v = this.vaultCache.get(vault);
22125
+ if (!v) {
22126
+ throw new ValidationError(
22127
+ `Vault "${vault}" is not open. Call openVault() first.`
22128
+ );
22129
+ }
22130
+ return this.snapshotStrategy.snapshot(v, this.options.user, opts);
22131
+ }
22132
+ /**
22133
+ * List all snapshots for the given vault, newest first.
22134
+ * Reads only the sidecar index — does not download snapshot bytes.
22135
+ */
22136
+ async listSnapshots(vault) {
22137
+ if (this.closed) throw new ValidationError("Instance is closed");
22138
+ return this.snapshotStrategy.listSnapshots(vault);
22139
+ }
22140
+ /**
22141
+ * Restore the vault to a previously snapshotted state.
22142
+ * Runs `verifyBackupIntegrity()` automatically on restore.
22143
+ * @throws SnapshotNotFoundError when `version` doesn't exist in the store
22144
+ * @throws ValidationError when the vault is not open
22145
+ */
22146
+ async restoreSnapshot(vault, version) {
22147
+ if (this.closed) throw new ValidationError("Instance is closed");
22148
+ const v = this.vaultCache.get(vault);
22149
+ if (!v) {
22150
+ throw new ValidationError(
22151
+ `Vault "${vault}" is not open. Call openVault() first.`
22152
+ );
22153
+ }
22154
+ return this.snapshotStrategy.restoreSnapshot(v, version);
22155
+ }
21829
22156
  };
21830
22157
  async function createNoydb(options) {
21831
22158
  const encrypted = options.encrypt !== false;
@@ -23440,7 +23767,10 @@ function shortJSON(value) {
23440
23767
  CollectionIndexes,
23441
23768
  CollectionInstant,
23442
23769
  ConflictError,
23770
+ CrossJoinSourceUnknownError,
23771
+ CrossJoinTooLargeError,
23443
23772
  DEFAULT_CHUNK_SIZE,
23773
+ DEFAULT_CROSS_JOIN_MAX_ROWS,
23444
23774
  DEFAULT_FRESHNESS_MS,
23445
23775
  DEFAULT_JOIN_MAX_ROWS,
23446
23776
  DEFAULT_PUBLIC_ENVELOPE_SCHEMA,
@@ -23553,6 +23883,7 @@ function shortJSON(value) {
23553
23883
  SessionExpiredError,
23554
23884
  SessionNotFoundError,
23555
23885
  SessionPolicyError,
23886
+ SnapshotNotFoundError,
23556
23887
  StoreCapabilityError,
23557
23888
  SyncEngine,
23558
23889
  SyncScheduler,