@noy-db/hub 0.3.0-pre.1 → 0.3.0-pre.10

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 (435) hide show
  1. package/dist/aggregate/index.d.ts +3 -4
  2. package/dist/aggregate/index.js +9 -8
  3. package/dist/aggregate/index.js.map +1 -1
  4. package/dist/api-TX2EX2FX.js +20 -0
  5. package/dist/as/index.d.ts +4 -5
  6. package/dist/as/index.js +12 -6
  7. package/dist/at/index.d.ts +2 -3
  8. package/dist/attestation/index.d.ts +3 -4
  9. package/dist/attestation/index.js +19 -13
  10. package/dist/attestation/index.js.map +1 -1
  11. package/dist/{backup-XV3IOEGB.js → backup-R7NTDFKY.js} +14 -6
  12. package/dist/backup-R7NTDFKY.js.map +1 -0
  13. package/dist/blobs/index.d.ts +4 -5
  14. package/dist/blobs/index.js +12 -6
  15. package/dist/blobs/index.js.map +1 -1
  16. package/dist/bundle/index.d.ts +5 -6
  17. package/dist/bundle/index.js +21 -15
  18. package/dist/bundle/index.js.map +1 -1
  19. package/dist/{bundle-CH-H06dp.d.ts → bundle-D6GxiUfq.d.ts} +1 -1
  20. package/dist/by/index.js +2 -2
  21. package/dist/cargo/index.d.ts +4 -6
  22. package/dist/cargo/index.js +27 -21
  23. package/dist/chunk-2OV5NVE7.js +95 -0
  24. package/dist/chunk-2OV5NVE7.js.map +1 -0
  25. package/dist/{chunk-5N6CZTCY.js → chunk-2OZXVKVP.js} +3 -3
  26. package/dist/{chunk-BG3SPSR4.js → chunk-2REPHKET.js} +5 -4
  27. package/dist/chunk-2REPHKET.js.map +1 -0
  28. package/dist/{chunk-LXQT4WMP.js → chunk-3JXPAHOZ.js} +8 -6
  29. package/dist/{chunk-LXQT4WMP.js.map → chunk-3JXPAHOZ.js.map} +1 -1
  30. package/dist/{chunk-UAG5KWVA.js → chunk-3MATJ6O4.js} +3 -3
  31. package/dist/chunk-3OPY6MK2.js +404 -0
  32. package/dist/chunk-3OPY6MK2.js.map +1 -0
  33. package/dist/{chunk-62QYRORB.js → chunk-3QSIU3UT.js} +34 -63
  34. package/dist/chunk-3QSIU3UT.js.map +1 -0
  35. package/dist/{chunk-DGDI2D4M.js → chunk-4OMCIY6F.js} +29 -9
  36. package/dist/chunk-4OMCIY6F.js.map +1 -0
  37. package/dist/chunk-5I35DOHK.js +94 -0
  38. package/dist/chunk-5I35DOHK.js.map +1 -0
  39. package/dist/{chunk-2P2HZEXU.js → chunk-5VG4IJR7.js} +11 -9
  40. package/dist/{chunk-2P2HZEXU.js.map → chunk-5VG4IJR7.js.map} +1 -1
  41. package/dist/{chunk-AZAOEIKW.js → chunk-5YESYH2C.js} +2 -2
  42. package/dist/{chunk-GYGWYIOZ.js → chunk-6G5ORS5D.js} +7 -5
  43. package/dist/{chunk-GYGWYIOZ.js.map → chunk-6G5ORS5D.js.map} +1 -1
  44. package/dist/{chunk-VCTFO5CO.js → chunk-6P5XCKSD.js} +2 -2
  45. package/dist/{chunk-IO6GRPT6.js → chunk-7BWJHO2A.js} +2 -2
  46. package/dist/{chunk-IPB7FTQX.js → chunk-7P2SDJG3.js} +15 -9
  47. package/dist/chunk-7P2SDJG3.js.map +1 -0
  48. package/dist/{chunk-SRB2XEWB.js → chunk-ANB77BVV.js} +6 -4
  49. package/dist/chunk-ANB77BVV.js.map +1 -0
  50. package/dist/{chunk-UDRIWL7A.js → chunk-BKARNZJN.js} +3 -3
  51. package/dist/{chunk-Y22T3KQE.js → chunk-BQISD5ZV.js} +3 -3
  52. package/dist/chunk-BQISD5ZV.js.map +1 -0
  53. package/dist/{chunk-UIU2THRG.js → chunk-BUAQ7YI3.js} +138 -378
  54. package/dist/chunk-BUAQ7YI3.js.map +1 -0
  55. package/dist/{chunk-V7RWQRG7.js → chunk-CB7CWSKW.js} +3 -3
  56. package/dist/{chunk-LV7M27WM.js → chunk-DFVUTGT2.js} +14 -201
  57. package/dist/chunk-DFVUTGT2.js.map +1 -0
  58. package/dist/{chunk-CWPPNPOH.js → chunk-DJ7KIPLV.js} +2 -2
  59. package/dist/{chunk-5R5JW2JT.js → chunk-DSKDQP3G.js} +3480 -1916
  60. package/dist/chunk-DSKDQP3G.js.map +1 -0
  61. package/dist/{chunk-VFQGRQIH.js → chunk-DV4HUP5G.js} +7 -5
  62. package/dist/{chunk-VFQGRQIH.js.map → chunk-DV4HUP5G.js.map} +1 -1
  63. package/dist/{chunk-5LUY7UTV.js → chunk-EOXAAJTY.js} +289 -48
  64. package/dist/chunk-EOXAAJTY.js.map +1 -0
  65. package/dist/chunk-ET67AY6B.js +74 -0
  66. package/dist/chunk-ET67AY6B.js.map +1 -0
  67. package/dist/{chunk-TA66UMI4.js → chunk-F4CEK5YM.js} +2 -2
  68. package/dist/chunk-FORYWFN6.js +130 -0
  69. package/dist/chunk-FORYWFN6.js.map +1 -0
  70. package/dist/{chunk-IELYAOGG.js → chunk-FRP6D2DM.js} +19 -6
  71. package/dist/chunk-FRP6D2DM.js.map +1 -0
  72. package/dist/chunk-FUOE7UUV.js +341 -0
  73. package/dist/chunk-FUOE7UUV.js.map +1 -0
  74. package/dist/{chunk-SM3AVUHC.js → chunk-G4JYND6L.js} +2 -2
  75. package/dist/{chunk-AXRXJTE2.js → chunk-G6XV4H65.js} +5 -5
  76. package/dist/{chunk-I2NOIW44.js → chunk-GNMXXTMN.js} +8 -6
  77. package/dist/{chunk-I2NOIW44.js.map → chunk-GNMXXTMN.js.map} +1 -1
  78. package/dist/chunk-GYGLAVCX.js +19 -0
  79. package/dist/chunk-GYGLAVCX.js.map +1 -0
  80. package/dist/{chunk-UV5MFVO3.js → chunk-HPWKV3YB.js} +2 -2
  81. package/dist/chunk-HY3AUMFI.js +41 -0
  82. package/dist/chunk-HY3AUMFI.js.map +1 -0
  83. package/dist/chunk-HYR4WZZ3.js +69 -0
  84. package/dist/chunk-HYR4WZZ3.js.map +1 -0
  85. package/dist/{chunk-SKF73JOP.js → chunk-ICXIFFYZ.js} +3 -3
  86. package/dist/chunk-IGJCYUT5.js +99 -0
  87. package/dist/chunk-IGJCYUT5.js.map +1 -0
  88. package/dist/{chunk-MD3Y6J3L.js → chunk-IVLTXX4W.js} +7 -5
  89. package/dist/{chunk-MD3Y6J3L.js.map → chunk-IVLTXX4W.js.map} +1 -1
  90. package/dist/{chunk-WWGT2MDV.js → chunk-J4LPNIGK.js} +26 -11
  91. package/dist/chunk-J4LPNIGK.js.map +1 -0
  92. package/dist/chunk-JJZ2LW6T.js +36 -0
  93. package/dist/chunk-JJZ2LW6T.js.map +1 -0
  94. package/dist/{chunk-RUIMKQTA.js → chunk-JK733I5V.js} +1 -1
  95. package/dist/chunk-JK733I5V.js.map +1 -0
  96. package/dist/{chunk-UPJNJGGA.js → chunk-KJ2BCBTL.js} +25 -8
  97. package/dist/chunk-KJ2BCBTL.js.map +1 -0
  98. package/dist/{chunk-LMTH2RM6.js → chunk-KNZB6JMR.js} +2 -2
  99. package/dist/{chunk-I3TIKTJO.js → chunk-KPZS5QAQ.js} +29 -10
  100. package/dist/chunk-KPZS5QAQ.js.map +1 -0
  101. package/dist/{chunk-PKHL44ER.js → chunk-LEJIKBBB.js} +2 -2
  102. package/dist/{chunk-AQTBSL7R.js → chunk-LL2NIVUR.js} +14 -7
  103. package/dist/chunk-LL2NIVUR.js.map +1 -0
  104. package/dist/chunk-LP7BEXCT.js +32 -0
  105. package/dist/chunk-LP7BEXCT.js.map +1 -0
  106. package/dist/{chunk-5O3AOPDT.js → chunk-MCHVVJIA.js} +443 -467
  107. package/dist/chunk-MCHVVJIA.js.map +1 -0
  108. package/dist/chunk-NO272T7Q.js +194 -0
  109. package/dist/chunk-NO272T7Q.js.map +1 -0
  110. package/dist/{chunk-LFLXAY2W.js → chunk-NUEQU36L.js} +71 -93
  111. package/dist/chunk-NUEQU36L.js.map +1 -0
  112. package/dist/chunk-O45M6LDB.js +38 -0
  113. package/dist/chunk-O45M6LDB.js.map +1 -0
  114. package/dist/{chunk-PSMV73A5.js → chunk-OBKWYKYC.js} +5 -5
  115. package/dist/{chunk-CMGR4ZEW.js → chunk-OHHKHSJP.js} +2 -2
  116. package/dist/{chunk-HCIPRAGS.js → chunk-OT76OZL6.js} +2 -2
  117. package/dist/{chunk-ITNUCOXM.js → chunk-OVYRLHPE.js} +7 -5
  118. package/dist/{chunk-ITNUCOXM.js.map → chunk-OVYRLHPE.js.map} +1 -1
  119. package/dist/{chunk-SMXWYP24.js → chunk-OXCSVM3B.js} +3 -3
  120. package/dist/{chunk-IGUYVGGI.js → chunk-P33LUIML.js} +3 -3
  121. package/dist/{chunk-JNUWZ6D3.js → chunk-PLS64NCS.js} +7 -5
  122. package/dist/{chunk-JNUWZ6D3.js.map → chunk-PLS64NCS.js.map} +1 -1
  123. package/dist/{chunk-EIZUR2XW.js → chunk-PS2NEWEX.js} +2 -2
  124. package/dist/chunk-QA2KUPCP.js +45 -0
  125. package/dist/chunk-QA2KUPCP.js.map +1 -0
  126. package/dist/{chunk-WYSO2NIH.js → chunk-QOC3VYL2.js} +2 -2
  127. package/dist/{chunk-FISN7WE4.js → chunk-QSFOZUYL.js} +30 -5
  128. package/dist/{chunk-FISN7WE4.js.map → chunk-QSFOZUYL.js.map} +1 -1
  129. package/dist/{chunk-KVOXU4T5.js → chunk-RHK32N73.js} +2 -2
  130. package/dist/{chunk-3YFXJ3ZP.js → chunk-RW3Y22MW.js} +2 -2
  131. package/dist/{chunk-ZYUC53LT.js → chunk-S7VFUQM2.js} +117 -3
  132. package/dist/chunk-S7VFUQM2.js.map +1 -0
  133. package/dist/chunk-T7WSLRAU.js +49 -0
  134. package/dist/chunk-T7WSLRAU.js.map +1 -0
  135. package/dist/{chunk-IUEN57TV.js → chunk-TAKWLZZX.js} +280 -58
  136. package/dist/chunk-TAKWLZZX.js.map +1 -0
  137. package/dist/chunk-THNJ3IKU.js +17 -0
  138. package/dist/chunk-THNJ3IKU.js.map +1 -0
  139. package/dist/{chunk-MTMJVJ5W.js → chunk-TMBXVJKT.js} +5 -3
  140. package/dist/chunk-TMBXVJKT.js.map +1 -0
  141. package/dist/{chunk-QHJW5EXU.js → chunk-TWKKOM55.js} +2 -2
  142. package/dist/{chunk-M6OST55S.js → chunk-U3WZCU7E.js} +2 -2
  143. package/dist/{chunk-AIWULCUO.js → chunk-UF362QVH.js} +5 -3
  144. package/dist/{chunk-AIWULCUO.js.map → chunk-UF362QVH.js.map} +1 -1
  145. package/dist/{chunk-KXGNJJXB.js → chunk-UN4FVIBH.js} +7 -7
  146. package/dist/chunk-VEAVKDDB.js +29 -0
  147. package/dist/chunk-VEAVKDDB.js.map +1 -0
  148. package/dist/chunk-VEPTFUJY.js +29 -0
  149. package/dist/chunk-VEPTFUJY.js.map +1 -0
  150. package/dist/{chunk-TEILUWOI.js → chunk-VJV7GKQK.js} +10 -12
  151. package/dist/chunk-VJV7GKQK.js.map +1 -0
  152. package/dist/chunk-VQRAIPYF.js +50 -0
  153. package/dist/chunk-VQRAIPYF.js.map +1 -0
  154. package/dist/{chunk-NF5JWERG.js → chunk-VRIYFLBA.js} +2 -2
  155. package/dist/chunk-VWM3DAVB.js +265 -0
  156. package/dist/chunk-VWM3DAVB.js.map +1 -0
  157. package/dist/{chunk-RUEKROOS.js → chunk-VWRRVE6D.js} +2 -2
  158. package/dist/chunk-VYYM3MEN.js +98 -0
  159. package/dist/chunk-VYYM3MEN.js.map +1 -0
  160. package/dist/chunk-WBJIQSLL.js +167 -0
  161. package/dist/chunk-WBJIQSLL.js.map +1 -0
  162. package/dist/{chunk-XXYIOFUB.js → chunk-WIGQB62E.js} +5 -5
  163. package/dist/chunk-WZSCE6RM.js +466 -0
  164. package/dist/chunk-WZSCE6RM.js.map +1 -0
  165. package/dist/{chunk-5R3ERCDH.js → chunk-XGDAPN6M.js} +25 -9
  166. package/dist/{chunk-5R3ERCDH.js.map → chunk-XGDAPN6M.js.map} +1 -1
  167. package/dist/{chunk-DFEMTNPJ.js → chunk-XH7XP3OL.js} +8 -6
  168. package/dist/{chunk-DFEMTNPJ.js.map → chunk-XH7XP3OL.js.map} +1 -1
  169. package/dist/{chunk-IAGBDSCS.js → chunk-XREOISSI.js} +2 -2
  170. package/dist/chunk-XUBPSPKD.js +164 -0
  171. package/dist/chunk-XUBPSPKD.js.map +1 -0
  172. package/dist/chunk-Y3A5CB5G.js +247 -0
  173. package/dist/chunk-Y3A5CB5G.js.map +1 -0
  174. package/dist/{chunk-ZCGAHGUS.js → chunk-YCXCR7VG.js} +2 -2
  175. package/dist/{chunk-76722EBH.js → chunk-YMVQD5Q5.js} +11 -9
  176. package/dist/{chunk-76722EBH.js.map → chunk-YMVQD5Q5.js.map} +1 -1
  177. package/dist/{chunk-5TDJ56JE.js → chunk-YN5IAHN6.js} +1 -1
  178. package/dist/chunk-YN5IAHN6.js.map +1 -0
  179. package/dist/{chunk-TJYQIGAP.js → chunk-ZYJ55N7N.js} +9 -5
  180. package/dist/chunk-ZYJ55N7N.js.map +1 -0
  181. package/dist/classified/index.d.ts +16 -0
  182. package/dist/classified/index.js +40 -0
  183. package/dist/classified-marker-H6YSHYNK.js +24 -0
  184. package/dist/classified-marker-H6YSHYNK.js.map +1 -0
  185. package/dist/collection-facade-LVD22JLM.js +39 -0
  186. package/dist/computed-EXDMQODG.js +11 -0
  187. package/dist/consent/index.d.ts +3 -4
  188. package/dist/consent/index.js +10 -4
  189. package/dist/consent/index.js.map +1 -1
  190. package/dist/crdt/index.d.ts +3 -4
  191. package/dist/dead-filter-HQIE2YG7.js +28 -0
  192. package/dist/dead-filter-HQIE2YG7.js.map +1 -0
  193. package/dist/delegation-BJP73GAP.js +25 -0
  194. package/dist/derivations/index.d.ts +4 -5
  195. package/dist/derivations/index.js +13 -6
  196. package/dist/derive-BME7HDWO.js +21 -0
  197. package/dist/{dev-unlock-C9Ro3v_O.d.ts → dev-unlock-Bmm2pgJ0.d.ts} +1 -1
  198. package/dist/{enclave-UL5LW66V.js → enclave-NHORSWSF.js} +55 -18
  199. package/dist/executor-FE6X4LFX.js +9 -0
  200. package/dist/executor-KSHKRJXP.js +25 -0
  201. package/dist/executor-ZHTJJICG.js +9 -0
  202. package/dist/export-accessible-DACHM5VT.js +23 -0
  203. package/dist/extract-partition-RNENZZ4T.js +36 -0
  204. package/dist/{fanout-sidecar-GF3DJ6KR.js → fanout-sidecar-OFWN3NM7.js} +17 -14
  205. package/dist/fanout-sidecar-OFWN3NM7.js.map +1 -0
  206. package/dist/fence-watcher-DHQ775JB.js +69 -0
  207. package/dist/fence-watcher-DHQ775JB.js.map +1 -0
  208. package/dist/find-BNGBJNKP.js +11 -0
  209. package/dist/forget/index.d.ts +2 -2
  210. package/dist/forget/index.js +10 -4
  211. package/dist/forget/index.js.map +1 -1
  212. package/dist/guards/index.d.ts +4 -5
  213. package/dist/guards/index.js +4 -4
  214. package/dist/{hash-Cp5uwiox.d.ts → hash-DAJjMsCE.d.ts} +7 -2
  215. package/dist/history/index.d.ts +4 -5
  216. package/dist/history/index.js +12 -6
  217. package/dist/history/index.js.map +1 -1
  218. package/dist/i18n/index.d.ts +24 -5
  219. package/dist/i18n/index.js +50 -31
  220. package/dist/i18n/index.js.map +1 -1
  221. package/dist/in/index.d.ts +2 -3
  222. package/dist/{index-BzUo1B6n.d.ts → index-DjWbxsjb.d.ts} +8596 -5747
  223. package/dist/{index-BF9_96A5.d.ts → index-qwuNvO2B.d.ts} +26 -5
  224. package/dist/index.d.ts +116 -24
  225. package/dist/index.js +1479 -139
  226. package/dist/index.js.map +1 -1
  227. package/dist/indexing/index.d.ts +3 -4
  228. package/dist/indexing/index.js +4 -4
  229. package/dist/issue-NDI4CVZU.js +19 -0
  230. package/dist/json-schema-I22JCYCG.js +44 -0
  231. package/dist/json-schema-I22JCYCG.js.map +1 -0
  232. package/dist/lazy/index.d.ts +20 -0
  233. package/dist/lazy/index.js +12 -0
  234. package/dist/{ledger-RYI35CDS.js → ledger-6NDS2EO4.js} +12 -6
  235. package/dist/liberate-HN3RIGIP.js +24 -0
  236. package/dist/link-set-SJB2MVJV.js +31 -0
  237. package/dist/materialized-views/index.d.ts +22 -6
  238. package/dist/materialized-views/index.js +20 -10
  239. package/dist/{mime-magic-CGhw37_E.d.ts → mime-magic-bBj5OgUC.d.ts} +1 -1
  240. package/dist/noydb-BWF6EPIR.js +66 -0
  241. package/dist/on/index.d.ts +2 -3
  242. package/dist/on/index.js +10 -4
  243. package/dist/overlay-views/index.d.ts +4 -5
  244. package/dist/overlay-views/index.js +4 -4
  245. package/dist/periods/index.d.ts +3 -4
  246. package/dist/periods/index.js +21 -7
  247. package/dist/pod/index.d.ts +3 -4
  248. package/dist/pod/index.js +12 -6
  249. package/dist/{policy-IXK4FVXP.js → policy-WGNAG5H6.js} +5 -5
  250. package/dist/portability/index.d.ts +3 -4
  251. package/dist/portability/index.js +8 -8
  252. package/dist/post-register-CWKBQRC7.js +55 -0
  253. package/dist/post-register-CWKBQRC7.js.map +1 -0
  254. package/dist/{public-envelope-JHDQCPSX.js → public-envelope-EJLVIFX7.js} +4 -4
  255. package/dist/query/index.d.ts +2 -3
  256. package/dist/query/index.js +9 -6
  257. package/dist/{read-only-facade-5ADRJVTM.js → read-only-facade-CHCKSEPD.js} +2 -2
  258. package/dist/register-SBIX7TVV.js +23 -0
  259. package/dist/registry-3EQG6OOE.js +18 -0
  260. package/dist/registry-CA327ACV.js +9 -0
  261. package/dist/registry-E7OXOTSV.js +19 -0
  262. package/dist/request-withdrawal-KAH2AAXC.js +31 -0
  263. package/dist/reveal-R3JLHMUF.js +38 -0
  264. package/dist/reveal-R3JLHMUF.js.map +1 -0
  265. package/dist/revoke-IXLOJ3IH.js +24 -0
  266. package/dist/satellites/index.d.ts +4 -0
  267. package/dist/satellites/index.js +8 -0
  268. package/dist/sealed-record/index.d.ts +3 -4
  269. package/dist/sealed-record/index.js +13 -7
  270. package/dist/sealed-record/index.js.map +1 -1
  271. package/dist/session/index.d.ts +4 -5
  272. package/dist/session/index.js +10 -4
  273. package/dist/session/index.js.map +1 -1
  274. package/dist/shadow/index.d.ts +3 -4
  275. package/dist/shadow/index.js +2 -2
  276. package/dist/signer-Y46N2GJ3.js +25 -0
  277. package/dist/signer-Y46N2GJ3.js.map +1 -0
  278. package/dist/snapshots/index.d.ts +3 -4
  279. package/dist/snapshots/index.js +11 -5
  280. package/dist/snapshots/index.js.map +1 -1
  281. package/dist/{stale-3JWHNDIY.js → stale-Z7IW6RIL.js} +2 -2
  282. package/dist/stale-Z7IW6RIL.js.map +1 -0
  283. package/dist/storage-ADNP2UWI.js +23 -0
  284. package/dist/storage-ADNP2UWI.js.map +1 -0
  285. package/dist/{store-coordination-provider-3I7XWZZK.js → store-coordination-provider-DTDMI6VL.js} +3 -3
  286. package/dist/{subject-index-O75wKshW.d.ts → subject-index-CyOgGMJL.d.ts} +18 -0
  287. package/dist/sync/index.d.ts +2 -3
  288. package/dist/sync/index.js +10 -4
  289. package/dist/sync/index.js.map +1 -1
  290. package/dist/team/index.d.ts +45 -7
  291. package/dist/team/index.js +25 -12
  292. package/dist/tiers/index.d.ts +2 -3
  293. package/dist/tiers/index.js +11 -5
  294. package/dist/to/index.d.ts +2 -3
  295. package/dist/to/index.js +1 -2
  296. package/dist/{transition-guard-C7ol6oPw.d.ts → transition-guard-DI-krBsZ.d.ts} +1 -1
  297. package/dist/tx/index.d.ts +3 -4
  298. package/dist/tx/index.js +3 -3
  299. package/dist/ui/index.d.ts +4 -1
  300. package/dist/util/index.js +1 -1
  301. package/dist/validators-BUcli5Nh.d.ts +101 -0
  302. package/dist/{vault-diff-B5fYNBL7.d.ts → vault-diff-Z2DUayMe.d.ts} +1 -1
  303. package/dist/verify-JPF2YR5E.js +139 -0
  304. package/dist/verify-JPF2YR5E.js.map +1 -0
  305. package/dist/walk-XYA2O3LW.js +241 -0
  306. package/dist/walk-XYA2O3LW.js.map +1 -0
  307. package/dist/with/index.d.ts +3 -4
  308. package/dist/with/index.js +12 -6
  309. package/dist/{with-materialized-view-6p0Fk8bL.d.ts → with-materialized-view-BUmzlXue.d.ts} +1 -1
  310. package/dist/{with-overlayed-view-BJ6mXGMd.d.ts → with-overlayed-view-m4FaXXTO.d.ts} +1 -1
  311. package/dist/{with-rollup-BvQo3ROo.d.ts → with-rollup-DEKGI9vb.d.ts} +1 -1
  312. package/dist/withdraw-accessible-WLV4MTEN.js +28 -0
  313. package/dist/withdraw-accessible-WLV4MTEN.js.map +1 -0
  314. package/package.json +16 -16
  315. package/dist/adapter/index.d.ts +0 -5
  316. package/dist/adapter/index.js +0 -15
  317. package/dist/api-RW3KP7WU.js +0 -14
  318. package/dist/backup-XV3IOEGB.js.map +0 -1
  319. package/dist/chunk-26LGBE4T.js +0 -42
  320. package/dist/chunk-26LGBE4T.js.map +0 -1
  321. package/dist/chunk-5LUY7UTV.js.map +0 -1
  322. package/dist/chunk-5O3AOPDT.js.map +0 -1
  323. package/dist/chunk-5R5JW2JT.js.map +0 -1
  324. package/dist/chunk-5TDJ56JE.js.map +0 -1
  325. package/dist/chunk-62QYRORB.js.map +0 -1
  326. package/dist/chunk-AQTBSL7R.js.map +0 -1
  327. package/dist/chunk-BG3SPSR4.js.map +0 -1
  328. package/dist/chunk-BGIZAFY7.js +0 -1
  329. package/dist/chunk-DGDI2D4M.js.map +0 -1
  330. package/dist/chunk-I3TIKTJO.js.map +0 -1
  331. package/dist/chunk-IELYAOGG.js.map +0 -1
  332. package/dist/chunk-IPB7FTQX.js.map +0 -1
  333. package/dist/chunk-IUEN57TV.js.map +0 -1
  334. package/dist/chunk-K2WCO3NX.js +0 -1
  335. package/dist/chunk-LFLXAY2W.js.map +0 -1
  336. package/dist/chunk-LV7M27WM.js.map +0 -1
  337. package/dist/chunk-M2YKN37S.js +0 -524
  338. package/dist/chunk-M2YKN37S.js.map +0 -1
  339. package/dist/chunk-MTMJVJ5W.js.map +0 -1
  340. package/dist/chunk-Q7SS3IME.js +0 -120
  341. package/dist/chunk-Q7SS3IME.js.map +0 -1
  342. package/dist/chunk-RUIMKQTA.js.map +0 -1
  343. package/dist/chunk-SRB2XEWB.js.map +0 -1
  344. package/dist/chunk-TEILUWOI.js.map +0 -1
  345. package/dist/chunk-TJYQIGAP.js.map +0 -1
  346. package/dist/chunk-UIU2THRG.js.map +0 -1
  347. package/dist/chunk-UPJNJGGA.js.map +0 -1
  348. package/dist/chunk-WWGT2MDV.js.map +0 -1
  349. package/dist/chunk-Y22T3KQE.js.map +0 -1
  350. package/dist/chunk-ZYUC53LT.js.map +0 -1
  351. package/dist/collection-facade-GQAOGJP2.js +0 -33
  352. package/dist/delegation-UL5HKLER.js +0 -19
  353. package/dist/describe/index.d.ts +0 -1
  354. package/dist/describe/index.js +0 -1
  355. package/dist/describe-aBkJR2sd.d.ts +0 -131
  356. package/dist/executor-2FWQRLMG.js +0 -15
  357. package/dist/executor-QZ7BXICW.js +0 -9
  358. package/dist/executor-Z5ZLJVTV.js +0 -9
  359. package/dist/export-accessible-KRV5W4GH.js +0 -17
  360. package/dist/extract-partition-GLKBOXFQ.js +0 -30
  361. package/dist/fanout-sidecar-GF3DJ6KR.js.map +0 -1
  362. package/dist/issue-Y6UVIR43.js +0 -13
  363. package/dist/kernel/index.d.ts +0 -32
  364. package/dist/kernel/index.js +0 -53
  365. package/dist/liberate-CRPZEV7O.js +0 -18
  366. package/dist/noydb-367AM4HT.js +0 -50
  367. package/dist/registry-45RJNWGU.js +0 -9
  368. package/dist/registry-5GRV5VXI.js +0 -13
  369. package/dist/registry-WEUCHBO4.js +0 -11
  370. package/dist/request-withdrawal-GBPH2FDY.js +0 -25
  371. package/dist/revoke-TUFRGI6S.js +0 -18
  372. package/dist/signer-PNKTBVF7.js +0 -19
  373. package/dist/withdraw-accessible-FFS46EOD.js +0 -22
  374. /package/dist/{adapter/index.js.map → api-TX2EX2FX.js.map} +0 -0
  375. /package/dist/{chunk-5N6CZTCY.js.map → chunk-2OZXVKVP.js.map} +0 -0
  376. /package/dist/{chunk-UAG5KWVA.js.map → chunk-3MATJ6O4.js.map} +0 -0
  377. /package/dist/{chunk-AZAOEIKW.js.map → chunk-5YESYH2C.js.map} +0 -0
  378. /package/dist/{chunk-VCTFO5CO.js.map → chunk-6P5XCKSD.js.map} +0 -0
  379. /package/dist/{chunk-IO6GRPT6.js.map → chunk-7BWJHO2A.js.map} +0 -0
  380. /package/dist/{chunk-UDRIWL7A.js.map → chunk-BKARNZJN.js.map} +0 -0
  381. /package/dist/{chunk-V7RWQRG7.js.map → chunk-CB7CWSKW.js.map} +0 -0
  382. /package/dist/{chunk-CWPPNPOH.js.map → chunk-DJ7KIPLV.js.map} +0 -0
  383. /package/dist/{chunk-TA66UMI4.js.map → chunk-F4CEK5YM.js.map} +0 -0
  384. /package/dist/{chunk-SM3AVUHC.js.map → chunk-G4JYND6L.js.map} +0 -0
  385. /package/dist/{chunk-AXRXJTE2.js.map → chunk-G6XV4H65.js.map} +0 -0
  386. /package/dist/{chunk-UV5MFVO3.js.map → chunk-HPWKV3YB.js.map} +0 -0
  387. /package/dist/{chunk-SKF73JOP.js.map → chunk-ICXIFFYZ.js.map} +0 -0
  388. /package/dist/{chunk-LMTH2RM6.js.map → chunk-KNZB6JMR.js.map} +0 -0
  389. /package/dist/{chunk-PKHL44ER.js.map → chunk-LEJIKBBB.js.map} +0 -0
  390. /package/dist/{chunk-PSMV73A5.js.map → chunk-OBKWYKYC.js.map} +0 -0
  391. /package/dist/{chunk-CMGR4ZEW.js.map → chunk-OHHKHSJP.js.map} +0 -0
  392. /package/dist/{chunk-HCIPRAGS.js.map → chunk-OT76OZL6.js.map} +0 -0
  393. /package/dist/{chunk-SMXWYP24.js.map → chunk-OXCSVM3B.js.map} +0 -0
  394. /package/dist/{chunk-IGUYVGGI.js.map → chunk-P33LUIML.js.map} +0 -0
  395. /package/dist/{chunk-EIZUR2XW.js.map → chunk-PS2NEWEX.js.map} +0 -0
  396. /package/dist/{chunk-WYSO2NIH.js.map → chunk-QOC3VYL2.js.map} +0 -0
  397. /package/dist/{chunk-KVOXU4T5.js.map → chunk-RHK32N73.js.map} +0 -0
  398. /package/dist/{chunk-3YFXJ3ZP.js.map → chunk-RW3Y22MW.js.map} +0 -0
  399. /package/dist/{chunk-QHJW5EXU.js.map → chunk-TWKKOM55.js.map} +0 -0
  400. /package/dist/{chunk-M6OST55S.js.map → chunk-U3WZCU7E.js.map} +0 -0
  401. /package/dist/{chunk-KXGNJJXB.js.map → chunk-UN4FVIBH.js.map} +0 -0
  402. /package/dist/{chunk-NF5JWERG.js.map → chunk-VRIYFLBA.js.map} +0 -0
  403. /package/dist/{chunk-RUEKROOS.js.map → chunk-VWRRVE6D.js.map} +0 -0
  404. /package/dist/{chunk-XXYIOFUB.js.map → chunk-WIGQB62E.js.map} +0 -0
  405. /package/dist/{chunk-IAGBDSCS.js.map → chunk-XREOISSI.js.map} +0 -0
  406. /package/dist/{chunk-ZCGAHGUS.js.map → chunk-YCXCR7VG.js.map} +0 -0
  407. /package/dist/{describe → classified}/index.js.map +0 -0
  408. /package/dist/{api-RW3KP7WU.js.map → collection-facade-LVD22JLM.js.map} +0 -0
  409. /package/dist/{chunk-BGIZAFY7.js.map → computed-EXDMQODG.js.map} +0 -0
  410. /package/dist/{chunk-K2WCO3NX.js.map → delegation-BJP73GAP.js.map} +0 -0
  411. /package/dist/{collection-facade-GQAOGJP2.js.map → derive-BME7HDWO.js.map} +0 -0
  412. /package/dist/{delegation-UL5HKLER.js.map → enclave-NHORSWSF.js.map} +0 -0
  413. /package/dist/{enclave-UL5LW66V.js.map → executor-FE6X4LFX.js.map} +0 -0
  414. /package/dist/{executor-2FWQRLMG.js.map → executor-KSHKRJXP.js.map} +0 -0
  415. /package/dist/{executor-QZ7BXICW.js.map → executor-ZHTJJICG.js.map} +0 -0
  416. /package/dist/{executor-Z5ZLJVTV.js.map → export-accessible-DACHM5VT.js.map} +0 -0
  417. /package/dist/{export-accessible-KRV5W4GH.js.map → extract-partition-RNENZZ4T.js.map} +0 -0
  418. /package/dist/{extract-partition-GLKBOXFQ.js.map → find-BNGBJNKP.js.map} +0 -0
  419. /package/dist/{issue-Y6UVIR43.js.map → issue-NDI4CVZU.js.map} +0 -0
  420. /package/dist/{kernel → lazy}/index.js.map +0 -0
  421. /package/dist/{ledger-RYI35CDS.js.map → ledger-6NDS2EO4.js.map} +0 -0
  422. /package/dist/{liberate-CRPZEV7O.js.map → liberate-HN3RIGIP.js.map} +0 -0
  423. /package/dist/{noydb-367AM4HT.js.map → link-set-SJB2MVJV.js.map} +0 -0
  424. /package/dist/{policy-IXK4FVXP.js.map → noydb-BWF6EPIR.js.map} +0 -0
  425. /package/dist/{public-envelope-JHDQCPSX.js.map → policy-WGNAG5H6.js.map} +0 -0
  426. /package/dist/{read-only-facade-5ADRJVTM.js.map → public-envelope-EJLVIFX7.js.map} +0 -0
  427. /package/dist/{registry-45RJNWGU.js.map → read-only-facade-CHCKSEPD.js.map} +0 -0
  428. /package/dist/{registry-5GRV5VXI.js.map → register-SBIX7TVV.js.map} +0 -0
  429. /package/dist/{registry-WEUCHBO4.js.map → registry-3EQG6OOE.js.map} +0 -0
  430. /package/dist/{request-withdrawal-GBPH2FDY.js.map → registry-CA327ACV.js.map} +0 -0
  431. /package/dist/{revoke-TUFRGI6S.js.map → registry-E7OXOTSV.js.map} +0 -0
  432. /package/dist/{signer-PNKTBVF7.js.map → request-withdrawal-KAH2AAXC.js.map} +0 -0
  433. /package/dist/{stale-3JWHNDIY.js.map → revoke-IXLOJ3IH.js.map} +0 -0
  434. /package/dist/{withdraw-accessible-FFS46EOD.js.map → satellites/index.js.map} +0 -0
  435. /package/dist/{store-coordination-provider-3I7XWZZK.js.map → store-coordination-provider-DTDMI6VL.js.map} +0 -0
package/dist/index.js CHANGED
@@ -1,3 +1,17 @@
1
+ import {
2
+ DELEGATIONS_COLLECTION,
3
+ issueDelegation,
4
+ loadActiveDelegations,
5
+ revokeDelegation
6
+ } from "./chunk-DV4HUP5G.js";
7
+ import {
8
+ DEFAULT_PUBLIC_ENVELOPE_SCHEMA,
9
+ PUBLIC_ENVELOPE_FIELDS,
10
+ resolveSchema
11
+ } from "./chunk-WXSYDNBT.js";
12
+ import {
13
+ UserApi
14
+ } from "./chunk-BKARNZJN.js";
1
15
  import {
2
16
  DEFAULT_FRESHNESS_MS,
3
17
  PERSONAL_POLICY,
@@ -5,15 +19,11 @@ import {
5
19
  checkGate,
6
20
  describeGate,
7
21
  mergePolicy
8
- } from "./chunk-5N6CZTCY.js";
22
+ } from "./chunk-2OZXVKVP.js";
9
23
  import {
10
24
  Collection,
11
- ComputedFieldError,
12
25
  ELEVATION_AUDIT_COLLECTION,
13
26
  ElevatedHandle,
14
- LinkEndpointError,
15
- LinkIntegrityError,
16
- Lru,
17
27
  Noydb,
18
28
  QuickUnlockStore,
19
29
  RefIntegrityError,
@@ -21,153 +31,182 @@ import {
21
31
  RefScopeError,
22
32
  Vault,
23
33
  createNoydb,
24
- derivePersistedSchema,
25
34
  describeAllUsersAuth,
26
35
  describeAuthConfig,
27
36
  describeUserAuth,
28
37
  diagramAuthConfig,
29
- estimateRecordBytes,
30
- evalComputedFields,
31
- isLinkCollectionName,
32
38
  isRefArray,
33
- isZodSchema,
39
+ isViaFieldSpec,
34
40
  memoryStore,
35
- parseBytes,
36
- persistSchemaIfNeeded,
37
41
  ref,
38
42
  refArray,
43
+ via,
39
44
  withArchive
40
- } from "./chunk-5R5JW2JT.js";
45
+ } from "./chunk-DSKDQP3G.js";
46
+ import "./chunk-VYYM3MEN.js";
47
+ import {
48
+ NO_SEQUENCE,
49
+ SequenceStore,
50
+ compileSequenceFormat,
51
+ resolveSequenceKey,
52
+ withSequence
53
+ } from "./chunk-6G5ORS5D.js";
41
54
  import {
42
55
  META_COLLECTION,
43
56
  POLICY_RECORD_ID,
44
57
  loadVaultPolicy,
45
58
  saveVaultPolicy
46
- } from "./chunk-SM3AVUHC.js";
59
+ } from "./chunk-G4JYND6L.js";
47
60
  import {
48
- DELEGATIONS_COLLECTION,
49
- issueDelegation,
50
- loadActiveDelegations,
51
- revokeDelegation
52
- } from "./chunk-VFQGRQIH.js";
61
+ LinkEndpointError
62
+ } from "./chunk-FORYWFN6.js";
53
63
  import {
54
- DEFAULT_PUBLIC_ENVELOPE_SCHEMA,
55
- PUBLIC_ENVELOPE_FIELDS,
56
- resolveSchema
57
- } from "./chunk-WXSYDNBT.js";
64
+ LinkIntegrityError,
65
+ isLinkCollectionName
66
+ } from "./chunk-HY3AUMFI.js";
67
+ import "./chunk-VQRAIPYF.js";
58
68
  import {
59
- NO_SEQUENCE,
60
- SequenceStore,
61
- compileSequenceFormat,
62
- resolveSequenceKey,
63
- withSequence
64
- } from "./chunk-GYGWYIOZ.js";
69
+ persistSchemaIfNeeded
70
+ } from "./chunk-WBJIQSLL.js";
71
+ import "./chunk-XREOISSI.js";
65
72
  import {
66
- UserApi
67
- } from "./chunk-UDRIWL7A.js";
73
+ NO_SEARCH,
74
+ tokenize,
75
+ withSearch
76
+ } from "./chunk-VJV7GKQK.js";
77
+ import {
78
+ derivePersistedSchema,
79
+ isZodSchema
80
+ } from "./chunk-5I35DOHK.js";
81
+ import {
82
+ ComputedFieldError,
83
+ evalComputedFields
84
+ } from "./chunk-O45M6LDB.js";
85
+ import "./chunk-GYGLAVCX.js";
68
86
  import {
69
87
  WithdrawalRequestError,
70
88
  approveWithdrawal,
71
89
  listWithdrawalRequests,
72
90
  rejectWithdrawal,
73
91
  requestWithdrawal
74
- } from "./chunk-XXYIOFUB.js";
75
- import "./chunk-IAGBDSCS.js";
76
- import {
77
- NO_SEARCH,
78
- tokenize,
79
- withSearch
80
- } from "./chunk-TEILUWOI.js";
81
- import "./chunk-5R3ERCDH.js";
92
+ } from "./chunk-WIGQB62E.js";
93
+ import "./chunk-XGDAPN6M.js";
82
94
  import {
83
95
  isDiscriminant
84
96
  } from "./chunk-PY4KJPYU.js";
85
- import "./chunk-WYSO2NIH.js";
86
- import "./chunk-IPB7FTQX.js";
87
- import "./chunk-KVOXU4T5.js";
97
+ import "./chunk-QOC3VYL2.js";
98
+ import {
99
+ classified,
100
+ luhnCheck
101
+ } from "./chunk-Y3A5CB5G.js";
102
+ import {
103
+ ClassifiedNeverStoredError,
104
+ ClassifiedValidationError,
105
+ isClassifiedFieldSpec,
106
+ isClassifiedGroup,
107
+ resolveClassifiedFields
108
+ } from "./chunk-VWM3DAVB.js";
109
+ import "./chunk-7P2SDJG3.js";
110
+ import "./chunk-RHK32N73.js";
88
111
  import {
89
112
  withCargo
90
- } from "./chunk-M6OST55S.js";
113
+ } from "./chunk-U3WZCU7E.js";
91
114
  import {
92
115
  CustodyApi,
93
116
  NO_CARGO,
94
117
  NO_CUSTODY,
95
118
  withCustody
96
- } from "./chunk-TJYQIGAP.js";
119
+ } from "./chunk-ZYJ55N7N.js";
97
120
  import {
98
121
  DEED_RECORD_ID,
99
122
  createDeedOwner,
100
123
  isDeedVault,
101
124
  liberateVault,
102
125
  loadDeedMarker
103
- } from "./chunk-KXGNJJXB.js";
126
+ } from "./chunk-UN4FVIBH.js";
127
+ import {
128
+ fuseRetrieval
129
+ } from "./chunk-AURFOK3D.js";
104
130
  import {
105
131
  withdrawAccessibleData
106
- } from "./chunk-PSMV73A5.js";
132
+ } from "./chunk-OBKWYKYC.js";
107
133
  import {
108
134
  exportAccessibleData
109
- } from "./chunk-HCIPRAGS.js";
135
+ } from "./chunk-OT76OZL6.js";
136
+ import "./chunk-TWKKOM55.js";
110
137
  import {
111
138
  diffVault
112
139
  } from "./chunk-LB7FD65R.js";
113
- import "./chunk-BGIZAFY7.js";
140
+ import "./chunk-DJ7KIPLV.js";
114
141
  import {
115
- fuseRetrieval
116
- } from "./chunk-AURFOK3D.js";
117
- import "./chunk-QHJW5EXU.js";
142
+ PERIODS_COLLECTION
143
+ } from "./chunk-FRP6D2DM.js";
144
+ import "./chunk-GHVIKOHT.js";
118
145
  import {
119
146
  immutableGuard,
120
147
  transitionGuard,
121
148
  withGuard
122
- } from "./chunk-TA66UMI4.js";
149
+ } from "./chunk-F4CEK5YM.js";
123
150
  import "./chunk-YMUGBZN2.js";
124
- import "./chunk-RUIMKQTA.js";
125
- import "./chunk-RUEKROOS.js";
151
+ import "./chunk-JK733I5V.js";
152
+ import "./chunk-VWRRVE6D.js";
126
153
  import {
127
154
  CollectionFrame,
128
155
  VaultFrame
129
- } from "./chunk-NF5JWERG.js";
156
+ } from "./chunk-VRIYFLBA.js";
130
157
  import {
131
158
  TxCollection,
132
159
  TxContext,
133
160
  TxVault,
134
161
  runTransaction
135
- } from "./chunk-SKF73JOP.js";
162
+ } from "./chunk-ICXIFFYZ.js";
136
163
  import {
137
164
  withDerivation,
138
165
  withRollup
139
- } from "./chunk-LMTH2RM6.js";
140
- import "./chunk-Q7SS3IME.js";
141
- import "./chunk-PKHL44ER.js";
166
+ } from "./chunk-KNZB6JMR.js";
167
+ import "./chunk-XUBPSPKD.js";
168
+ import "./chunk-FUOE7UUV.js";
169
+ import "./chunk-LEJIKBBB.js";
142
170
  import {
143
171
  withMaterializedView
144
- } from "./chunk-3YFXJ3ZP.js";
145
- import "./chunk-AQTBSL7R.js";
146
- import "./chunk-62QYRORB.js";
147
- import "./chunk-BG3SPSR4.js";
172
+ } from "./chunk-RW3Y22MW.js";
173
+ import "./chunk-LL2NIVUR.js";
174
+ import {
175
+ buildLookupSnapshot
176
+ } from "./chunk-WZSCE6RM.js";
177
+ import "./chunk-3QSIU3UT.js";
178
+ import "./chunk-2REPHKET.js";
148
179
  import {
149
180
  withOverlayedView
150
- } from "./chunk-EIZUR2XW.js";
151
- import "./chunk-CMGR4ZEW.js";
152
- import "./chunk-VCTFO5CO.js";
181
+ } from "./chunk-PS2NEWEX.js";
182
+ import "./chunk-OHHKHSJP.js";
183
+ import "./chunk-6P5XCKSD.js";
153
184
  import {
154
185
  importExternalObjects,
155
186
  memoryObjectProjection
156
187
  } from "./chunk-4Q6HSHHL.js";
157
- import "./chunk-Y22T3KQE.js";
158
- import "./chunk-V7RWQRG7.js";
188
+ import "./chunk-BQISD5ZV.js";
189
+ import "./chunk-CB7CWSKW.js";
190
+ import {
191
+ withLazy
192
+ } from "./chunk-THNJ3IKU.js";
193
+ import {
194
+ Lru,
195
+ estimateRecordBytes,
196
+ parseBytes
197
+ } from "./chunk-NO272T7Q.js";
159
198
  import {
160
199
  mergeCrdtStates,
161
200
  resolveCrdtSnapshot
162
201
  } from "./chunk-6S7T6WC4.js";
163
202
  import {
164
203
  decryptExtractedPartition
165
- } from "./chunk-2P2HZEXU.js";
204
+ } from "./chunk-5VG4IJR7.js";
166
205
  import {
167
206
  SCHEMAS_COLLECTION,
168
207
  loadPersistedSchema,
169
208
  savePersistedSchema
170
- } from "./chunk-26LGBE4T.js";
209
+ } from "./chunk-T7WSLRAU.js";
171
210
  import {
172
211
  MemoryRecipientSealer,
173
212
  MemorySealingKeyProvider,
@@ -178,7 +217,7 @@ import {
178
217
  parseSealedEnvelope,
179
218
  saveSealedPassphrase,
180
219
  sealRsaOaepTlv
181
- } from "./chunk-ZCGAHGUS.js";
220
+ } from "./chunk-YCXCR7VG.js";
182
221
  import {
183
222
  BLOB_CHUNKS_COLLECTION,
184
223
  BLOB_COLLECTION,
@@ -190,13 +229,13 @@ import {
190
229
  detectMagic,
191
230
  detectMimeType,
192
231
  isPreCompressed
193
- } from "./chunk-DFEMTNPJ.js";
232
+ } from "./chunk-XH7XP3OL.js";
194
233
  import {
195
234
  createBundleStore,
196
235
  createPodStore,
197
236
  wrapBundleStore,
198
237
  wrapPodStore
199
- } from "./chunk-AZAOEIKW.js";
238
+ } from "./chunk-5YESYH2C.js";
200
239
  import {
201
240
  NOYDB_BUNDLE_FORMAT_VERSION,
202
241
  NOYDB_BUNDLE_MAGIC,
@@ -210,7 +249,7 @@ import {
210
249
  resetBrotliSupportCache,
211
250
  writeNoydbBundle,
212
251
  writePod
213
- } from "./chunk-FISN7WE4.js";
252
+ } from "./chunk-QSFOZUYL.js";
214
253
  import {
215
254
  PUBLIC_ENVELOPE_RECORD_ID,
216
255
  isPublicEnvelope,
@@ -218,37 +257,33 @@ import {
218
257
  readPublicEnvelope,
219
258
  savePublicEnvelope,
220
259
  validatePublicEnvelopeInput
221
- } from "./chunk-SMXWYP24.js";
260
+ } from "./chunk-OXCSVM3B.js";
222
261
  import {
223
262
  CONSENT_AUDIT_COLLECTION
224
- } from "./chunk-MTMJVJ5W.js";
225
- import "./chunk-CWPPNPOH.js";
226
- import {
227
- PERIODS_COLLECTION
228
- } from "./chunk-IELYAOGG.js";
229
- import "./chunk-GHVIKOHT.js";
263
+ } from "./chunk-TMBXVJKT.js";
264
+ import "./chunk-JJZ2LW6T.js";
230
265
  import {
231
- DICT_COLLECTION_PREFIX,
232
- DictionaryHandle,
233
- dictCollectionName,
234
266
  dictKey,
235
- isDictCollectionName,
236
- isDictKeyDescriptor,
237
- isStaticDictDescriptor,
238
267
  staticDict
239
- } from "./chunk-LFLXAY2W.js";
268
+ } from "./chunk-ET67AY6B.js";
269
+ import {
270
+ DICT_COLLECTION_PREFIX,
271
+ LookupHandle,
272
+ dictCollectionName
273
+ } from "./chunk-NUEQU36L.js";
240
274
  import {
241
- SYNC_CREDENTIALS_COLLECTION,
242
275
  credentialStatus,
243
276
  deleteCredential,
244
277
  getCredential,
245
278
  listCredentials,
246
- putCredential
247
- } from "./chunk-DGDI2D4M.js";
279
+ putCredential,
280
+ withTeam
281
+ } from "./chunk-4OMCIY6F.js";
248
282
  import {
249
283
  MAGIC_LINK_CONTENT_INFO_PREFIX,
250
284
  MAGIC_LINK_GRANTS_COLLECTION,
251
285
  MAGIC_LINK_KEK_INFO_PREFIX,
286
+ NO_TEAM,
252
287
  deriveMagicLinkContentKey,
253
288
  enrollAuthenticator,
254
289
  findAuthenticator,
@@ -263,7 +298,7 @@ import {
263
298
  rotatePassphrase,
264
299
  unwrapMagicLinkGrant,
265
300
  writeMagicLinkGrant
266
- } from "./chunk-UPJNJGGA.js";
301
+ } from "./chunk-KJ2BCBTL.js";
267
302
  import {
268
303
  burnPaperRecoveryEntry,
269
304
  hasRecoveryEnrolled,
@@ -277,17 +312,12 @@ import {
277
312
  unwrapDeksFromBlob,
278
313
  unwrapDeksFromPaperEntry,
279
314
  unwrapDeksFromShamirEntry
280
- } from "./chunk-IGUYVGGI.js";
281
- import {
282
- assertTierAccess,
283
- dekKey,
284
- effectiveClearance
285
- } from "./chunk-IO6GRPT6.js";
315
+ } from "./chunk-P33LUIML.js";
286
316
  import {
287
317
  PresenceHandle,
288
318
  SyncEngine,
289
319
  SyncTransaction
290
- } from "./chunk-IUEN57TV.js";
320
+ } from "./chunk-TAKWLZZX.js";
291
321
  import {
292
322
  BUNDLE_STORE_POLICY,
293
323
  INDEXED_STORE_POLICY,
@@ -295,6 +325,12 @@ import {
295
325
  SyncScheduler
296
326
  } from "./chunk-VQNJ7UZL.js";
297
327
  import {
328
+ assertTierAccess,
329
+ dekKey,
330
+ effectiveClearance
331
+ } from "./chunk-7BWJHO2A.js";
332
+ import {
333
+ SYNC_CREDENTIALS_COLLECTION,
298
334
  WeakPassphraseError,
299
335
  assertStrongPassphrase,
300
336
  buildRecipientKeyringFile,
@@ -306,7 +342,7 @@ import {
306
342
  listUsers,
307
343
  listUsersWithEnvelopes,
308
344
  validatePassphrase
309
- } from "./chunk-WWGT2MDV.js";
345
+ } from "./chunk-J4LPNIGK.js";
310
346
  import {
311
347
  DIRECTORY_RECORD_ID,
312
348
  VISIBILITY_RECORD_PREFIX,
@@ -320,7 +356,7 @@ import {
320
356
  readUserVisibility,
321
357
  saveUserEnvelope,
322
358
  visibilityRecordId
323
- } from "./chunk-ITNUCOXM.js";
359
+ } from "./chunk-OVYRLHPE.js";
324
360
  import {
325
361
  PolicyEnforcer,
326
362
  activeSessionCount,
@@ -335,7 +371,7 @@ import {
335
371
  revokeAllSessions,
336
372
  revokeSession,
337
373
  validateSessionPolicy
338
- } from "./chunk-UAG5KWVA.js";
374
+ } from "./chunk-3MATJ6O4.js";
339
375
  import {
340
376
  generateULID,
341
377
  isULID
@@ -343,7 +379,7 @@ import {
343
379
  import {
344
380
  CollectionInstant,
345
381
  VaultInstant
346
- } from "./chunk-MD3Y6J3L.js";
382
+ } from "./chunk-IVLTXX4W.js";
347
383
  import {
348
384
  diff,
349
385
  formatDiff
@@ -352,7 +388,7 @@ import {
352
388
  LedgerStore,
353
389
  applyPatch,
354
390
  computePatch
355
- } from "./chunk-LXQT4WMP.js";
391
+ } from "./chunk-3JXPAHOZ.js";
356
392
  import {
357
393
  LEDGER_COLLECTION,
358
394
  LEDGER_DELTAS_COLLECTION
@@ -364,9 +400,18 @@ import {
364
400
  paddedIndex,
365
401
  parseIndex,
366
402
  sha256Hex
367
- } from "./chunk-AIWULCUO.js";
368
- import "./chunk-SRB2XEWB.js";
369
- import "./chunk-UV5MFVO3.js";
403
+ } from "./chunk-UF362QVH.js";
404
+ import "./chunk-ANB77BVV.js";
405
+ import "./chunk-HPWKV3YB.js";
406
+ import {
407
+ validateSchemaInput,
408
+ validateSchemaOutput
409
+ } from "./chunk-MCHVVJIA.js";
410
+ import "./chunk-QA2KUPCP.js";
411
+ import "./chunk-2OV5NVE7.js";
412
+ import "./chunk-VEPTFUJY.js";
413
+ import "./chunk-HYR4WZZ3.js";
414
+ import "./chunk-LP7BEXCT.js";
370
415
  import {
371
416
  base64ToBuffer,
372
417
  bufferToBase64,
@@ -374,10 +419,8 @@ import {
374
419
  decryptDeterministic,
375
420
  derivePresenceKey,
376
421
  encryptBytes,
377
- encryptDeterministic,
378
- validateSchemaInput,
379
- validateSchemaOutput
380
- } from "./chunk-5O3AOPDT.js";
422
+ encryptDeterministic
423
+ } from "./chunk-3OPY6MK2.js";
381
424
  import {
382
425
  NOYDB_BACKUP_VERSION,
383
426
  NOYDB_FORMAT_VERSION,
@@ -385,7 +428,7 @@ import {
385
428
  NOYDB_SYNC_VERSION,
386
429
  SealedHandle,
387
430
  createStore
388
- } from "./chunk-5TDJ56JE.js";
431
+ } from "./chunk-YN5IAHN6.js";
389
432
  import {
390
433
  DEFAULT_CROSS_JOIN_MAX_ROWS,
391
434
  DEFAULT_JOIN_MAX_ROWS,
@@ -395,10 +438,10 @@ import {
395
438
  buildLiveQuery,
396
439
  executePlan,
397
440
  resetJoinWarnings
398
- } from "./chunk-UIU2THRG.js";
441
+ } from "./chunk-BUAQ7YI3.js";
399
442
  import {
400
443
  CollectionIndexes
401
- } from "./chunk-I3TIKTJO.js";
444
+ } from "./chunk-KPZS5QAQ.js";
402
445
  import {
403
446
  Aggregation,
404
447
  GROUPBY_MAX_CARDINALITY,
@@ -417,32 +460,30 @@ import {
417
460
  reduceRecords,
418
461
  reducerBuilder,
419
462
  sum
420
- } from "./chunk-LV7M27WM.js";
463
+ } from "./chunk-DFVUTGT2.js";
421
464
  import {
422
- MoneyCurrencyError,
423
- MoneyPrecisionError,
424
- MoneyUnsupportedError,
425
- decimalScaleOf,
426
465
  evaluateClause,
427
466
  evaluateFieldClause,
428
- formatScaledInt,
429
- isMoneyDescriptor,
430
- money,
431
- parseToScaledInt,
432
- readPath,
433
- rescaleScaledInt,
434
- scaleForCurrency
435
- } from "./chunk-M2YKN37S.js";
467
+ readPath
468
+ } from "./chunk-IGJCYUT5.js";
436
469
  import {
437
470
  applyI18nLocale,
438
471
  enforceScript,
472
+ getAtPath,
439
473
  i18nText,
440
474
  inferScripts,
475
+ isDictCollectionName,
476
+ isDictKeyDescriptor,
441
477
  isI18nTextDescriptor,
478
+ isStaticDictDescriptor,
442
479
  resolveI18nText,
443
480
  resolvePolicy,
481
+ setAtPathInPlace,
444
482
  validateI18nTextValue
445
- } from "./chunk-5LUY7UTV.js";
483
+ } from "./chunk-EOXAAJTY.js";
484
+ import {
485
+ installViaBinder
486
+ } from "./chunk-VEAVKDDB.js";
446
487
  import {
447
488
  AlreadyElevatedError,
448
489
  AmendmentForbiddenError,
@@ -454,6 +495,11 @@ import {
454
495
  BundleSealMismatchError,
455
496
  BundleVersionConflictError,
456
497
  CargoNotEnabledError,
498
+ ClassifiedConfigError,
499
+ ClassifiedNotEnabledError,
500
+ ClassifiedRevealError,
501
+ ClassifiedRotationError,
502
+ ClassifiedVerifyError,
457
503
  ConflictError,
458
504
  CrossJoinSourceUnknownError,
459
505
  CrossJoinTooLargeError,
@@ -478,6 +524,7 @@ import {
478
524
  EnclaveNotSupportedError,
479
525
  ExportCapabilityError,
480
526
  FieldFrozenError,
527
+ FieldNotQueryableError,
481
528
  FilenameSanitizationError,
482
529
  ForgetStrategyNotConfiguredError,
483
530
  GroupCardinalityError,
@@ -526,6 +573,7 @@ import {
526
573
  RecoveryProfileNotImplementedError,
527
574
  ReservedCollectionNameError,
528
575
  ReservedVaultNameError,
576
+ RestrictRefUnresolvableError,
529
577
  STATE_VAULT_NAME,
530
578
  SchemaFenceError,
531
579
  SchemaLockedError,
@@ -547,6 +595,7 @@ import {
547
595
  StaticDictReadonlyError,
548
596
  StoreCapabilityError,
549
597
  TamperedError,
598
+ TeamNotEnabledError,
550
599
  TierDemoteDeniedError,
551
600
  TierNotGrantedError,
552
601
  TiersNotEnabledError,
@@ -555,12 +604,13 @@ import {
555
604
  USER_ENVELOPE_MAX_BYTES,
556
605
  UniqueConstraintError,
557
606
  UnknownDictCodeError,
607
+ UnknownLookupKeyError,
558
608
  UnknownShardError,
559
609
  UnsupportedIndexOptionError,
560
610
  UserEnvelopeOversizedError,
561
611
  ValidationError,
562
612
  VaultTemplateNotFoundError
563
- } from "./chunk-ZYUC53LT.js";
613
+ } from "./chunk-S7VFUQM2.js";
564
614
  import "./chunk-PZ5AY32C.js";
565
615
 
566
616
  // src/kernel/debug.ts
@@ -581,6 +631,34 @@ function readPlaintextRecord(envelope) {
581
631
  return JSON.parse(envelope._data);
582
632
  }
583
633
 
634
+ // src/with-shape/introspection/projection.ts
635
+ function applyListProjection(desc, record, opts) {
636
+ const out = { ...record };
637
+ for (const f of desc.fields) {
638
+ if (f.classified !== void 0) {
639
+ const list = f.classified.list;
640
+ if (list === "omit") {
641
+ delete out[f.key];
642
+ continue;
643
+ }
644
+ if ("mask" in list) {
645
+ out[f.key] = list.mask.replace(/\$\{(\w+)\}/g, (_m, rider) => {
646
+ const v = record[`${f.key}_${rider}`];
647
+ return v === void 0 || v === null ? "\u2022" : `${v}`;
648
+ });
649
+ continue;
650
+ }
651
+ out[f.key] = record[`${f.key}_${list.rider}`];
652
+ continue;
653
+ }
654
+ if (opts?.sensitivity !== void 0 && (f.sensitivity === "pii" || f.sensitivity === "secret")) {
655
+ if (opts.sensitivity === "omit") delete out[f.key];
656
+ else out[f.key] = "\u2022\u2022\u2022";
657
+ }
658
+ }
659
+ return out;
660
+ }
661
+
584
662
  // src/with-shape/schema-update/strategies.ts
585
663
  function blindUpdate() {
586
664
  return { name: "blindUpdate", onSchemaDelta: () => ({ action: "allow" }) };
@@ -753,18 +831,19 @@ function routeStore(opts) {
753
831
  }
754
832
  return tieredBlobs.large;
755
833
  }
756
- function isCold(collection, envelope) {
834
+ function isCold(collection, envelope, before) {
757
835
  if (!opts.age) return false;
758
836
  if (isInternal(collection)) return false;
759
837
  if (opts.age.collections && opts.age.collections.length > 0) {
760
838
  if (!opts.age.collections.includes(collection)) return false;
761
839
  }
762
- const cutoff = Date.now() - opts.age.coldAfterDays * 24 * 60 * 60 * 1e3;
763
- const ts = new Date(envelope._ts).getTime();
764
- return ts < cutoff;
840
+ const cutoffIso = before ?? (opts.age.coldAfterDays != null ? new Date(Date.now() - opts.age.coldAfterDays * 24 * 60 * 60 * 1e3).toISOString() : void 0);
841
+ if (cutoffIso === void 0) return false;
842
+ return envelope._ts < cutoffIso;
765
843
  }
766
844
  const store = {
767
845
  name: buildName(),
846
+ ...opts.age?.cold ? { capabilities: { ...primary.capabilities, coldArchival: true } } : primary.capabilities ? { capabilities: { ...primary.capabilities, coldArchival: false } } : {},
768
847
  async get(vault, collection, id) {
769
848
  const s = storeFor(vault, collection);
770
849
  const result = await s.get(vault, collection, id);
@@ -833,16 +912,16 @@ function routeStore(opts) {
833
912
  [...partitioned.entries()].map(([s, snap]) => s.saveAll(vault, snap))
834
913
  );
835
914
  },
836
- async compact(vault) {
915
+ async compact(vault, compactOpts) {
837
916
  if (!opts.age) return 0;
838
917
  let migrated = 0;
839
- const collections = opts.age.collections?.length ? opts.age.collections : await primary.list(vault, "").catch(() => []);
918
+ const collections = opts.age.collections?.length ? opts.age.collections : Object.keys(await primary.loadAll(vault).catch(() => ({})));
840
919
  for (const collection of collections) {
841
920
  const ids = await primary.list(vault, collection).catch(() => []);
842
921
  for (const id of ids) {
843
922
  const envelope = await primary.get(vault, collection, id);
844
923
  if (!envelope) continue;
845
- if (isCold(collection, envelope)) {
924
+ if (isCold(collection, envelope, compactOpts?.before)) {
846
925
  await opts.age.cold.put(vault, collection, id, envelope);
847
926
  await primary.delete(vault, collection, id);
848
927
  migrated++;
@@ -1284,7 +1363,950 @@ function withDeferredNumbering(config) {
1284
1363
  };
1285
1364
  }
1286
1365
 
1287
- // src/with-shape/money/arith.ts
1366
+ // src/via/money/iso4217.ts
1367
+ var MINOR_UNITS = {
1368
+ // 2-decimal majors
1369
+ EUR: 2,
1370
+ USD: 2,
1371
+ GBP: 2,
1372
+ CHF: 2,
1373
+ CAD: 2,
1374
+ AUD: 2,
1375
+ NZD: 2,
1376
+ SGD: 2,
1377
+ HKD: 2,
1378
+ CNY: 2,
1379
+ INR: 2,
1380
+ BRL: 2,
1381
+ MXN: 2,
1382
+ ZAR: 2,
1383
+ RUB: 2,
1384
+ TRY: 2,
1385
+ PLN: 2,
1386
+ SEK: 2,
1387
+ NOK: 2,
1388
+ DKK: 2,
1389
+ CZK: 2,
1390
+ HUF: 2,
1391
+ RON: 2,
1392
+ ILS: 2,
1393
+ THB: 2,
1394
+ PHP: 2,
1395
+ MYR: 2,
1396
+ IDR: 2,
1397
+ AED: 2,
1398
+ SAR: 2,
1399
+ QAR: 2,
1400
+ EGP: 2,
1401
+ // 0-decimal
1402
+ JPY: 0,
1403
+ KRW: 0,
1404
+ ISK: 0,
1405
+ CLP: 0,
1406
+ VND: 0,
1407
+ XOF: 0,
1408
+ XAF: 0,
1409
+ PYG: 0,
1410
+ // 3-decimal
1411
+ BHD: 3,
1412
+ KWD: 3,
1413
+ OMR: 3,
1414
+ TND: 3,
1415
+ JOD: 3,
1416
+ IQD: 3,
1417
+ LYD: 3
1418
+ };
1419
+ function scaleForCurrency(code) {
1420
+ const v = MINOR_UNITS[code];
1421
+ return v === void 0 ? null : v;
1422
+ }
1423
+
1424
+ // src/via/money/fixed-point.ts
1425
+ function expandExponent(s) {
1426
+ const m = /^([+-]?)(\d+)(?:\.(\d+))?[eE]([+-]?\d+)$/.exec(s);
1427
+ if (!m) return s;
1428
+ const sign = m[1] === "-" ? "-" : "";
1429
+ const intp = m[2];
1430
+ const frac = m[3] ?? "";
1431
+ const exp = Number(m[4]);
1432
+ const digits = intp + frac;
1433
+ const pointPos = intp.length + exp;
1434
+ let body;
1435
+ if (pointPos <= 0) {
1436
+ body = "0." + "0".repeat(-pointPos) + digits;
1437
+ } else if (pointPos >= digits.length) {
1438
+ body = digits + "0".repeat(pointPos - digits.length);
1439
+ } else {
1440
+ body = digits.slice(0, pointPos) + "." + digits.slice(pointPos);
1441
+ }
1442
+ return sign + body;
1443
+ }
1444
+ function toCanonicalDecimalString(input) {
1445
+ let s;
1446
+ if (typeof input === "number") {
1447
+ if (!Number.isFinite(input)) return null;
1448
+ s = String(input);
1449
+ } else {
1450
+ s = input.trim();
1451
+ }
1452
+ s = expandExponent(s);
1453
+ if (s.startsWith("+")) s = s.slice(1);
1454
+ if (!/^-?(\d+(\.\d*)?|\.\d+)$/.test(s)) return null;
1455
+ return s;
1456
+ }
1457
+ function shouldRoundUp(negative, lastKeptDigit, firstDiscarded, hasMoreNonZeroAfterFirst, mode) {
1458
+ switch (mode) {
1459
+ case "up":
1460
+ return true;
1461
+ case "down":
1462
+ return false;
1463
+ case "ceil":
1464
+ return !negative;
1465
+ case "floor":
1466
+ return negative;
1467
+ case "half-up":
1468
+ return firstDiscarded >= 5;
1469
+ case "half-down":
1470
+ return firstDiscarded > 5 || firstDiscarded === 5 && hasMoreNonZeroAfterFirst;
1471
+ case "half-even":
1472
+ if (firstDiscarded > 5) return true;
1473
+ if (firstDiscarded < 5) return false;
1474
+ return hasMoreNonZeroAfterFirst || lastKeptDigit % 2 === 1;
1475
+ }
1476
+ }
1477
+ function parseToScaledInt(input, scale, rounding) {
1478
+ const canonical = toCanonicalDecimalString(input);
1479
+ if (canonical === null) return { ok: false, reason: "nonfinite" };
1480
+ const negative = canonical.startsWith("-");
1481
+ const unsigned = negative ? canonical.slice(1) : canonical;
1482
+ const dot = unsigned.indexOf(".");
1483
+ const intPart = dot === -1 ? unsigned : unsigned.slice(0, dot);
1484
+ const fracPart = dot === -1 ? "" : unsigned.slice(dot + 1);
1485
+ const intDigits = intPart === "" ? "0" : intPart;
1486
+ if (fracPart.length <= scale) {
1487
+ const keep2 = fracPart.padEnd(scale, "0");
1488
+ const magnitude2 = BigInt(intDigits + keep2);
1489
+ return { ok: true, value: negative && magnitude2 !== 0n ? -magnitude2 : magnitude2 };
1490
+ }
1491
+ const keep = fracPart.slice(0, scale);
1492
+ const tail = fracPart.slice(scale);
1493
+ const magnitudeDigits = intDigits + keep;
1494
+ let magnitude = BigInt(magnitudeDigits);
1495
+ if (/^0+$/.test(tail)) {
1496
+ return { ok: true, value: negative && magnitude !== 0n ? -magnitude : magnitude };
1497
+ }
1498
+ if (rounding === void 0) return { ok: false, reason: "precision" };
1499
+ const lastKeptDigit = Number(magnitudeDigits[magnitudeDigits.length - 1]);
1500
+ const firstDiscarded = Number(tail[0]);
1501
+ const hasMoreNonZeroAfterFirst = /[1-9]/.test(tail.slice(1));
1502
+ if (shouldRoundUp(negative, lastKeptDigit, firstDiscarded, hasMoreNonZeroAfterFirst, rounding)) {
1503
+ magnitude += 1n;
1504
+ }
1505
+ return { ok: true, value: negative && magnitude !== 0n ? -magnitude : magnitude };
1506
+ }
1507
+ function decimalScaleOf(input) {
1508
+ const s = toCanonicalDecimalString(input);
1509
+ if (s === null) return null;
1510
+ const dot = s.indexOf(".");
1511
+ return dot === -1 ? 0 : s.length - dot - 1;
1512
+ }
1513
+ function rescaleScaledInt(value, fromScale, toScale, rounding = "half-up") {
1514
+ if (toScale >= fromScale) return value * 10n ** BigInt(toScale - fromScale);
1515
+ const drop = fromScale - toScale;
1516
+ const negative = value < 0n;
1517
+ const absStr = (negative ? -value : value).toString().padStart(drop + 1, "0");
1518
+ const keptStr = absStr.slice(0, absStr.length - drop);
1519
+ const tail = absStr.slice(absStr.length - drop);
1520
+ let magnitude = BigInt(keptStr);
1521
+ if (!/^0+$/.test(tail)) {
1522
+ const lastKeptDigit = Number(keptStr[keptStr.length - 1]);
1523
+ const firstDiscarded = Number(tail[0]);
1524
+ const hasMoreNonZeroAfterFirst = /[1-9]/.test(tail.slice(1));
1525
+ if (shouldRoundUp(negative, lastKeptDigit, firstDiscarded, hasMoreNonZeroAfterFirst, rounding)) {
1526
+ magnitude += 1n;
1527
+ }
1528
+ }
1529
+ return negative && magnitude !== 0n ? -magnitude : magnitude;
1530
+ }
1531
+ function formatScaledInt(value, scale) {
1532
+ const negative = value < 0n;
1533
+ const abs = (negative ? -value : value).toString();
1534
+ if (scale === 0) return (negative ? "-" : "") + abs;
1535
+ const padded = abs.padStart(scale + 1, "0");
1536
+ const cut = padded.length - scale;
1537
+ const intPart = padded.slice(0, cut);
1538
+ const fracPart = padded.slice(cut);
1539
+ return (negative ? "-" : "") + intPart + "." + fracPart;
1540
+ }
1541
+
1542
+ // src/via/money/paths.ts
1543
+ var SEGMENT_RE = /^(\*|[^.[\]*]+)(\[\])?$/;
1544
+ var parseCache = /* @__PURE__ */ new Map();
1545
+ function parseMoneyPath(path) {
1546
+ const cached = parseCache.get(path);
1547
+ if (cached) return cached;
1548
+ if (typeof path !== "string" || path.length === 0) {
1549
+ throw new ValidationError("moneyFields: path must be a non-empty string");
1550
+ }
1551
+ const segments = [];
1552
+ for (const part of path.split(".")) {
1553
+ const m = SEGMENT_RE.exec(part);
1554
+ if (!m) {
1555
+ throw new ValidationError(
1556
+ `moneyFields: invalid path "${path}" \u2014 segment "${part}" must be a key, "key[]", "*", or "*[]"`
1557
+ );
1558
+ }
1559
+ const array = m[2] === "[]";
1560
+ segments.push(
1561
+ m[1] === "*" ? { kind: "wildcard", array } : { kind: "key", key: m[1], array }
1562
+ );
1563
+ }
1564
+ parseCache.set(path, segments);
1565
+ return segments;
1566
+ }
1567
+ function isSimpleMoneyPath(path) {
1568
+ return !path.includes(".") && !path.includes("[") && !path.includes("*");
1569
+ }
1570
+ function validateMoneyFieldPaths(moneyFields) {
1571
+ for (const path of Object.keys(moneyFields)) parseMoneyPath(path);
1572
+ }
1573
+ function transformAtMoneyPath(node, path, segments, index, visit, lenient) {
1574
+ if (node === null || node === void 0) return node;
1575
+ const seg = segments[index];
1576
+ const last = index === segments.length - 1;
1577
+ if (seg.kind === "key") {
1578
+ if (typeof node !== "object" || Array.isArray(node)) {
1579
+ if (lenient) return node;
1580
+ throw new ValidationError(
1581
+ `moneyFields: path "${path}" expected an object at segment "${seg.key}", got ${Array.isArray(node) ? "an array" : typeof node}`
1582
+ );
1583
+ }
1584
+ const obj2 = node;
1585
+ if (!(seg.key in obj2) || obj2[seg.key] === null || obj2[seg.key] === void 0) return node;
1586
+ if (seg.array) {
1587
+ const arr = obj2[seg.key];
1588
+ if (!Array.isArray(arr)) {
1589
+ if (lenient) return node;
1590
+ throw new ValidationError(
1591
+ `moneyFields: path "${path}" declares "${seg.key}[]" but the value is not an array`
1592
+ );
1593
+ }
1594
+ const cloned = [...arr];
1595
+ if (last) {
1596
+ for (let i = 0; i < cloned.length; i++) visit(cloned, i);
1597
+ } else {
1598
+ for (let i = 0; i < cloned.length; i++) {
1599
+ cloned[i] = transformAtMoneyPath(cloned[i], path, segments, index + 1, visit, lenient);
1600
+ }
1601
+ }
1602
+ return { ...obj2, [seg.key]: cloned };
1603
+ }
1604
+ const clone2 = { ...obj2 };
1605
+ if (last) {
1606
+ visit(clone2, seg.key);
1607
+ } else {
1608
+ clone2[seg.key] = transformAtMoneyPath(clone2[seg.key], path, segments, index + 1, visit, lenient);
1609
+ }
1610
+ return clone2;
1611
+ }
1612
+ if (seg.array) {
1613
+ if (!Array.isArray(node)) {
1614
+ if (lenient) return node;
1615
+ throw new ValidationError(`moneyFields: path "${path}" declares "*[]" but the value is not an array`);
1616
+ }
1617
+ const cloned = [...node];
1618
+ if (last) {
1619
+ for (let i = 0; i < cloned.length; i++) visit(cloned, i);
1620
+ } else {
1621
+ for (let i = 0; i < cloned.length; i++) {
1622
+ cloned[i] = transformAtMoneyPath(cloned[i], path, segments, index + 1, visit, lenient);
1623
+ }
1624
+ }
1625
+ return cloned;
1626
+ }
1627
+ if (typeof node !== "object" || Array.isArray(node)) {
1628
+ if (lenient) return node;
1629
+ throw new ValidationError(
1630
+ `moneyFields: path "${path}" applies "*" to a non-object (${Array.isArray(node) ? 'array \u2014 use "*[]"' : typeof node})`
1631
+ );
1632
+ }
1633
+ const obj = node;
1634
+ const clone = { ...obj };
1635
+ for (const key of Object.keys(obj)) {
1636
+ const v = clone[key];
1637
+ if (v === null || v === void 0) continue;
1638
+ if (last) visit(clone, key);
1639
+ else clone[key] = transformAtMoneyPath(v, path, segments, index + 1, visit, lenient);
1640
+ }
1641
+ return clone;
1642
+ }
1643
+
1644
+ // src/via/money/normalize.ts
1645
+ function isMoneyValueObject(v) {
1646
+ return typeof v === "object" && v !== null && "currency" in v;
1647
+ }
1648
+ function quantizeAmount(field, input, scale, rounding) {
1649
+ const r = parseToScaledInt(input, scale, rounding);
1650
+ if (!r.ok) {
1651
+ if (r.reason === "precision") throw new MoneyPrecisionError(field, input, scale);
1652
+ throw new TypeError(`money: field "${field}" value ${JSON.stringify(input)} is not a finite decimal`);
1653
+ }
1654
+ return r.value.toString();
1655
+ }
1656
+ function canonicalizeStoredMoney(record, moneyFields) {
1657
+ if (record === null || record === void 0) return record;
1658
+ if (!moneyFields || Object.keys(moneyFields).length === 0) return record;
1659
+ return decodeMoneyFields(record, moneyFields, "raw");
1660
+ }
1661
+ function canonicalizeIncomingMoney(record, moneyFields) {
1662
+ if (!moneyFields || Object.keys(moneyFields).length === 0) return record;
1663
+ try {
1664
+ return decodeMoneyFields(
1665
+ quantizeMoneyFields(record, moneyFields),
1666
+ moneyFields,
1667
+ "raw"
1668
+ );
1669
+ } catch {
1670
+ return record;
1671
+ }
1672
+ }
1673
+ function quantizeValue(field, raw, desc) {
1674
+ if (desc.mode === "fixed") {
1675
+ const currency2 = desc.fixedCurrency;
1676
+ return quantizeAmount(field, raw, desc.scaleFor(currency2), desc.rounding);
1677
+ }
1678
+ let amount;
1679
+ let currency;
1680
+ if (isMoneyValueObject(raw)) {
1681
+ currency = String(raw.currency);
1682
+ amount = raw.amount;
1683
+ } else {
1684
+ const sole = desc.soleCurrency();
1685
+ if (sole === void 0) {
1686
+ throw new TypeError(
1687
+ `money: field "${field}" is multi-currency \u2014 write { amount, currency }, not a bare amount`
1688
+ );
1689
+ }
1690
+ currency = sole;
1691
+ amount = raw;
1692
+ }
1693
+ const scale = desc.scaleFor(currency);
1694
+ return { amount: quantizeAmount(field, amount, scale, desc.rounding), currency };
1695
+ }
1696
+ function quantizeMoneyFields(record, moneyFields) {
1697
+ let out = { ...record };
1698
+ for (const [path, desc] of Object.entries(moneyFields)) {
1699
+ if (isSimpleMoneyPath(path)) {
1700
+ const raw = out[path];
1701
+ if (raw === null || raw === void 0) continue;
1702
+ out[path] = quantizeValue(path, raw, desc);
1703
+ continue;
1704
+ }
1705
+ out = transformAtMoneyPath(
1706
+ out,
1707
+ path,
1708
+ parseMoneyPath(path),
1709
+ 0,
1710
+ (container, key) => {
1711
+ const raw = container[key];
1712
+ if (raw === null || raw === void 0) return;
1713
+ container[key] = quantizeValue(path, raw, desc);
1714
+ },
1715
+ /* lenient */
1716
+ false
1717
+ );
1718
+ }
1719
+ return out;
1720
+ }
1721
+ function formatCurrency(decimal, currency, scale, locale) {
1722
+ const fmt = new Intl.NumberFormat(locale, {
1723
+ style: "currency",
1724
+ currency,
1725
+ minimumFractionDigits: scale,
1726
+ maximumFractionDigits: scale
1727
+ });
1728
+ return fmt.format(decimal);
1729
+ }
1730
+ function moneyScaledValue(stored, desc) {
1731
+ let raw;
1732
+ if (desc.mode === "fixed") {
1733
+ raw = stored;
1734
+ } else {
1735
+ if (!isMoneyValueObject(stored)) return null;
1736
+ raw = stored.amount;
1737
+ }
1738
+ if (typeof raw !== "string" && typeof raw !== "number") return null;
1739
+ try {
1740
+ return BigInt(String(raw));
1741
+ } catch {
1742
+ return null;
1743
+ }
1744
+ }
1745
+ function canonicalizeMoneyIndexKey(field, rawValue, moneyFields) {
1746
+ const desc = moneyFields[field];
1747
+ if (!desc || desc.mode !== "fixed") return void 0;
1748
+ return moneyScaledValue(rawValue, desc)?.toString();
1749
+ }
1750
+ function decodeValue(stored, desc) {
1751
+ let currency;
1752
+ let scaledIntString;
1753
+ if (desc.mode === "fixed") {
1754
+ if (typeof stored !== "string" && typeof stored !== "number") return null;
1755
+ currency = desc.fixedCurrency;
1756
+ scaledIntString = String(stored);
1757
+ } else {
1758
+ if (!isMoneyValueObject(stored)) return null;
1759
+ const amount = stored.amount;
1760
+ if (typeof stored.currency !== "string" || typeof amount !== "string" && typeof amount !== "number") return null;
1761
+ currency = stored.currency;
1762
+ scaledIntString = String(amount);
1763
+ }
1764
+ const scale = desc.scaleFor(currency);
1765
+ let decimal;
1766
+ try {
1767
+ decimal = formatScaledInt(BigInt(scaledIntString), scale);
1768
+ } catch {
1769
+ return null;
1770
+ }
1771
+ return {
1772
+ decoded: desc.mode === "fixed" ? decimal : { amount: decimal, currency },
1773
+ decimal,
1774
+ currency,
1775
+ scale
1776
+ };
1777
+ }
1778
+ function presentVirtualMoneyFields(record, moneyFields, virtualMoney, locale) {
1779
+ let out = record;
1780
+ const format = locale !== "raw";
1781
+ const fmtLocale = typeof locale === "string" && locale !== "raw" ? locale : "en-US";
1782
+ for (const field of virtualMoney) {
1783
+ const desc = moneyFields[field];
1784
+ if (!desc || desc.mode !== "fixed") continue;
1785
+ const raw = out[field];
1786
+ if (raw === null || raw === void 0) continue;
1787
+ if (typeof raw !== "number" && typeof raw !== "string") continue;
1788
+ const currency = desc.fixedCurrency;
1789
+ const scale = desc.scaleFor(currency);
1790
+ const r = parseToScaledInt(raw, scale, desc.rounding);
1791
+ if (!r.ok) continue;
1792
+ if (out === record) out = { ...record };
1793
+ const decimal = formatScaledInt(r.value, scale);
1794
+ out[field] = decimal;
1795
+ if (format) {
1796
+ out[`${field}Formatted`] = formatCurrency(decimal, currency, scale, fmtLocale);
1797
+ out[`${field}Number`] = Number(decimal);
1798
+ }
1799
+ }
1800
+ return out;
1801
+ }
1802
+ function decodeMoneyFields(record, moneyFields, locale) {
1803
+ let out = { ...record };
1804
+ const format = locale !== "raw";
1805
+ const fmtLocale = typeof locale === "string" && locale !== "raw" ? locale : "en-US";
1806
+ for (const [path, desc] of Object.entries(moneyFields)) {
1807
+ if (isSimpleMoneyPath(path)) {
1808
+ const stored = out[path];
1809
+ if (stored === null || stored === void 0) continue;
1810
+ const r = decodeValue(stored, desc);
1811
+ if (r === null) continue;
1812
+ out[path] = r.decoded;
1813
+ if (format) {
1814
+ out[`${path}Formatted`] = formatCurrency(r.decimal, r.currency, r.scale, fmtLocale);
1815
+ out[`${path}Number`] = Number(r.decimal);
1816
+ }
1817
+ continue;
1818
+ }
1819
+ out = transformAtMoneyPath(
1820
+ out,
1821
+ path,
1822
+ parseMoneyPath(path),
1823
+ 0,
1824
+ (container, key) => {
1825
+ const stored = container[key];
1826
+ if (stored === null || stored === void 0) return;
1827
+ const r = decodeValue(stored, desc);
1828
+ if (r === null) return;
1829
+ container[key] = r.decoded;
1830
+ if (format && typeof key === "string" && !Array.isArray(container)) {
1831
+ container[`${key}Formatted`] = formatCurrency(r.decimal, r.currency, r.scale, fmtLocale);
1832
+ container[`${key}Number`] = Number(r.decimal);
1833
+ }
1834
+ },
1835
+ /* lenient */
1836
+ true
1837
+ );
1838
+ }
1839
+ return out;
1840
+ }
1841
+
1842
+ // src/via/money/where.ts
1843
+ function isMoneyValueObject2(v) {
1844
+ return typeof v === "object" && v !== null && "currency" in v;
1845
+ }
1846
+ function parseOperand(field, raw, desc) {
1847
+ let amount;
1848
+ let currency;
1849
+ if (desc.mode === "fixed") {
1850
+ currency = desc.fixedCurrency;
1851
+ amount = raw;
1852
+ } else if (isMoneyValueObject2(raw)) {
1853
+ currency = String(raw.currency);
1854
+ amount = raw.amount;
1855
+ } else {
1856
+ const sole = desc.soleCurrency();
1857
+ if (sole === void 0) {
1858
+ throw new MoneyUnsupportedError(
1859
+ `where("${field}"): field is multi-currency \u2014 compare against { amount, currency }, not a bare amount`
1860
+ );
1861
+ }
1862
+ currency = sole;
1863
+ amount = raw;
1864
+ }
1865
+ if (typeof amount !== "number" && typeof amount !== "string") {
1866
+ throw new MoneyUnsupportedError(
1867
+ `where("${field}"): operand ${JSON.stringify(raw)} is not a money amount`
1868
+ );
1869
+ }
1870
+ const r = parseToScaledInt(amount, desc.scaleFor(currency), desc.rounding);
1871
+ if (!r.ok) {
1872
+ throw new MoneyUnsupportedError(
1873
+ `where("${field}"): operand ${JSON.stringify(amount)} is not a finite decimal`
1874
+ );
1875
+ }
1876
+ return { scaled: r.value.toString(), currency };
1877
+ }
1878
+ function moneyFieldClause(field, op, value, desc) {
1879
+ switch (op) {
1880
+ case "==":
1881
+ case "!=":
1882
+ case "<":
1883
+ case "<=":
1884
+ case ">":
1885
+ case ">=": {
1886
+ const e = parseOperand(field, value, desc);
1887
+ return { mode: desc.mode, entries: [e] };
1888
+ }
1889
+ case "between": {
1890
+ if (!Array.isArray(value) || value.length !== 2) {
1891
+ throw new MoneyUnsupportedError(`where("${field}"): 'between' needs a [lo, hi] tuple`);
1892
+ }
1893
+ const lo = parseOperand(field, value[0], desc);
1894
+ const hi = parseOperand(field, value[1], desc);
1895
+ if (lo.currency !== hi.currency) {
1896
+ throw new MoneyUnsupportedError(
1897
+ `where("${field}"): 'between' bounds mix currencies (${lo.currency} vs ${hi.currency})`
1898
+ );
1899
+ }
1900
+ return { mode: desc.mode, entries: [lo, hi] };
1901
+ }
1902
+ case "in": {
1903
+ if (!Array.isArray(value)) {
1904
+ throw new MoneyUnsupportedError(`where("${field}"): 'in' needs an array of amounts`);
1905
+ }
1906
+ return { mode: desc.mode, entries: value.map((v) => parseOperand(field, v, desc)) };
1907
+ }
1908
+ default:
1909
+ throw new MoneyUnsupportedError(
1910
+ `where("${field}"): operator '${op}' is not supported on a money field`
1911
+ );
1912
+ }
1913
+ }
1914
+ function moneyIndexProbe(op, payload) {
1915
+ if (payload.mode !== "fixed") return void 0;
1916
+ if (op === "==") return payload.entries[0]?.scaled;
1917
+ if (op === "in") return payload.entries.map((e) => e.scaled);
1918
+ return void 0;
1919
+ }
1920
+ function readStored(actual, operand) {
1921
+ let amount;
1922
+ let currency;
1923
+ if (operand.mode === "fixed") {
1924
+ if (typeof actual !== "string" && typeof actual !== "number") return null;
1925
+ amount = actual;
1926
+ currency = operand.entries[0]?.currency ?? "";
1927
+ } else {
1928
+ if (!isMoneyValueObject2(actual)) return null;
1929
+ if (typeof actual.currency !== "string") return null;
1930
+ amount = actual.amount;
1931
+ currency = actual.currency;
1932
+ }
1933
+ if (typeof amount !== "string" && typeof amount !== "number") return null;
1934
+ try {
1935
+ return { scaled: BigInt(amount).toString(), currency };
1936
+ } catch {
1937
+ return null;
1938
+ }
1939
+ }
1940
+ function evaluateMoneyClause(actual, op, operand) {
1941
+ const stored = readStored(actual, operand);
1942
+ if (stored === null) return op === "!=";
1943
+ const a = BigInt(stored.scaled);
1944
+ if (op === "in") {
1945
+ return operand.entries.some(
1946
+ (e2) => e2.currency === stored.currency && BigInt(e2.scaled) === a
1947
+ );
1948
+ }
1949
+ if (op === "between") {
1950
+ const [lo, hi] = operand.entries;
1951
+ if (!lo || !hi || lo.currency !== stored.currency) return false;
1952
+ return a >= BigInt(lo.scaled) && a <= BigInt(hi.scaled);
1953
+ }
1954
+ const e = operand.entries[0];
1955
+ if (!e) return false;
1956
+ if (e.currency !== stored.currency) return op === "!=";
1957
+ const b = BigInt(e.scaled);
1958
+ switch (op) {
1959
+ case "==":
1960
+ return a === b;
1961
+ case "!=":
1962
+ return a !== b;
1963
+ case "<":
1964
+ return a < b;
1965
+ case "<=":
1966
+ return a <= b;
1967
+ case ">":
1968
+ return a > b;
1969
+ case ">=":
1970
+ return a >= b;
1971
+ default:
1972
+ return false;
1973
+ }
1974
+ }
1975
+
1976
+ // src/via/money/money-reducer.ts
1977
+ function toScaledIntFromAny(v, scale) {
1978
+ if (typeof v === "bigint") return v;
1979
+ if (typeof v === "number") {
1980
+ const r = parseToScaledInt(v, scale);
1981
+ return r.ok ? r.value : null;
1982
+ }
1983
+ if (typeof v === "string") {
1984
+ if (!v.includes(".")) {
1985
+ try {
1986
+ return BigInt(v);
1987
+ } catch {
1988
+ return null;
1989
+ }
1990
+ }
1991
+ const r = parseToScaledInt(v, scale);
1992
+ return r.ok ? r.value : null;
1993
+ }
1994
+ return null;
1995
+ }
1996
+ function readMoney(record, field, desc) {
1997
+ const raw = readPath(record, field);
1998
+ if (raw === null || raw === void 0) return null;
1999
+ if (desc.mode === "fixed") {
2000
+ const cur = desc.fixedCurrency;
2001
+ const value2 = toScaledIntFromAny(raw, desc.scaleFor(cur));
2002
+ return value2 === null ? null : { currency: cur, value: value2 };
2003
+ }
2004
+ if (typeof raw !== "object") return null;
2005
+ const o = raw;
2006
+ if (typeof o.currency !== "string") return null;
2007
+ const scale = desc.allows(o.currency) ? desc.scaleFor(o.currency) : 0;
2008
+ const value = toScaledIntFromAny(o.amount, scale);
2009
+ return value === null ? null : { currency: o.currency, value };
2010
+ }
2011
+ function targetScaleFor(desc, currency) {
2012
+ if (desc.allows(currency)) return desc.scaleFor(currency);
2013
+ const s = scaleForCurrency(currency);
2014
+ if (s === null) {
2015
+ throw new Error(`money: cannot determine scale for conversion target "${currency}"`);
2016
+ }
2017
+ return s;
2018
+ }
2019
+ function parseRate(rate) {
2020
+ const s = String(rate).trim();
2021
+ const neg = s.startsWith("-");
2022
+ const body = neg ? s.slice(1) : s;
2023
+ const dot = body.indexOf(".");
2024
+ const intPart = dot === -1 ? body : body.slice(0, dot);
2025
+ const fracPart = dot === -1 ? "" : body.slice(dot + 1);
2026
+ const int = BigInt((intPart === "" ? "0" : intPart) + fracPart);
2027
+ return { int: neg ? -int : int, scale: fracPart.length };
2028
+ }
2029
+ function divRoundHalfEven(n, d) {
2030
+ const q = n / d;
2031
+ const r = n % d;
2032
+ const twiceR = (r < 0n ? -r : r) * 2n;
2033
+ if (twiceR < d) return q;
2034
+ if (twiceR > d) return q + (n < 0n ? -1n : 1n);
2035
+ return q % 2n === 0n ? q : q + (n < 0n ? -1n : 1n);
2036
+ }
2037
+ function convertScaled(value, srcScale, rate, targetScale) {
2038
+ const { int: rateInt, scale: rateScale } = parseRate(rate);
2039
+ const product = value * rateInt;
2040
+ const curScale = srcScale + rateScale;
2041
+ if (curScale === targetScale) return product;
2042
+ if (curScale < targetScale) return product * 10n ** BigInt(targetScale - curScale);
2043
+ return divRoundHalfEven(product, 10n ** BigInt(curScale - targetScale));
2044
+ }
2045
+ function finalizeSum(state, desc, convertTo, fx) {
2046
+ if (convertTo !== void 0) {
2047
+ if (fx === void 0) {
2048
+ throw new Error(`money: sum convertTo "${convertTo}" requires an fx rate map`);
2049
+ }
2050
+ const targetScale = targetScaleFor(desc, convertTo);
2051
+ let total = 0n;
2052
+ for (const [cur, v] of state) {
2053
+ if (cur === convertTo) {
2054
+ total += convertScaled(v, desc.scaleFor(cur), 1, targetScale);
2055
+ continue;
2056
+ }
2057
+ const rate = fx[`${cur}->${convertTo}`];
2058
+ if (rate === void 0) {
2059
+ throw new Error(`money: no fx rate for "${cur}->${convertTo}"`);
2060
+ }
2061
+ total += convertScaled(v, desc.scaleFor(cur), rate, targetScale);
2062
+ }
2063
+ return formatScaledInt(total, targetScale);
2064
+ }
2065
+ if (desc.mode === "fixed") {
2066
+ const cur = desc.fixedCurrency;
2067
+ return formatScaledInt(state.get(cur) ?? 0n, desc.scaleFor(cur));
2068
+ }
2069
+ const out = {};
2070
+ for (const [cur, v] of state) out[cur] = formatScaledInt(v, desc.scaleFor(cur));
2071
+ return out;
2072
+ }
2073
+ function moneySumReducer(field, desc, convertTo, fx) {
2074
+ return {
2075
+ op: "sum",
2076
+ field,
2077
+ init: () => /* @__PURE__ */ new Map(),
2078
+ step: (state, record) => {
2079
+ const m = readMoney(record, field, desc);
2080
+ if (m) state.set(m.currency, (state.get(m.currency) ?? 0n) + m.value);
2081
+ return state;
2082
+ },
2083
+ remove: (state, record) => {
2084
+ const m = readMoney(record, field, desc);
2085
+ if (m) state.set(m.currency, (state.get(m.currency) ?? 0n) - m.value);
2086
+ return state;
2087
+ },
2088
+ finalize: (state) => finalizeSum(state, desc, convertTo, fx)
2089
+ };
2090
+ }
2091
+ function extremum(values, op) {
2092
+ let out = values[0];
2093
+ for (let i = 1; i < values.length; i++) {
2094
+ const v = values[i];
2095
+ if (op === "min" ? v < out : v > out) out = v;
2096
+ }
2097
+ return out;
2098
+ }
2099
+ function moneyMinMaxReducer(op, field, desc) {
2100
+ return {
2101
+ op,
2102
+ field,
2103
+ init: () => /* @__PURE__ */ new Map(),
2104
+ step: (state, record) => {
2105
+ const m = readMoney(record, field, desc);
2106
+ if (m) {
2107
+ const arr = state.get(m.currency);
2108
+ if (arr) arr.push(m.value);
2109
+ else state.set(m.currency, [m.value]);
2110
+ }
2111
+ return state;
2112
+ },
2113
+ remove: (state, record) => {
2114
+ const m = readMoney(record, field, desc);
2115
+ if (m) {
2116
+ const arr = state.get(m.currency);
2117
+ if (arr) {
2118
+ const idx = arr.indexOf(m.value);
2119
+ if (idx >= 0) arr.splice(idx, 1);
2120
+ }
2121
+ }
2122
+ return state;
2123
+ },
2124
+ finalize: (state) => {
2125
+ if (desc.mode === "fixed") {
2126
+ const cur = desc.fixedCurrency;
2127
+ const arr = state.get(cur);
2128
+ if (!arr || arr.length === 0) return null;
2129
+ return formatScaledInt(extremum(arr, op), desc.scaleFor(cur));
2130
+ }
2131
+ const out = {};
2132
+ for (const [cur, arr] of state) {
2133
+ if (arr.length > 0) out[cur] = formatScaledInt(extremum(arr, op), desc.scaleFor(cur));
2134
+ }
2135
+ return out;
2136
+ }
2137
+ };
2138
+ }
2139
+ function wrapMoneyReducers(spec, moneyFields) {
2140
+ let changed = false;
2141
+ const out = {};
2142
+ for (const [key, reducer] of Object.entries(spec)) {
2143
+ const field = reducer.field;
2144
+ const desc = field ? moneyFields[field] : void 0;
2145
+ if (desc && reducer.op === "avg") {
2146
+ throw new MoneyUnsupportedError(
2147
+ field,
2148
+ `avg() is not supported on money field "${field}" in v1 \u2014 use sum() and count() and divide at the boundary.`
2149
+ );
2150
+ }
2151
+ if (desc && (reducer.op === "sum" || reducer.op === "min" || reducer.op === "max")) {
2152
+ changed = true;
2153
+ out[key] = reducer.op === "sum" ? moneySumReducer(field, desc, reducer.convertTo, reducer.fx) : moneyMinMaxReducer(reducer.op, field, desc);
2154
+ } else {
2155
+ out[key] = reducer;
2156
+ }
2157
+ }
2158
+ return changed ? out : spec;
2159
+ }
2160
+
2161
+ // src/via/money/binding.ts
2162
+ function moneyBinding(moneyFields, virtualMoneyFields) {
2163
+ validateMoneyFieldPaths(moneyFields);
2164
+ const hasVirtualMoney = virtualMoneyFields !== void 0 && virtualMoneyFields.size > 0;
2165
+ const ordinaryPresentFields = hasVirtualMoney ? Object.fromEntries(Object.entries(moneyFields).filter(([f]) => !virtualMoneyFields.has(f))) : moneyFields;
2166
+ return {
2167
+ brand: "money",
2168
+ posture: { encryptedAtRest: "envelope", queryable: "ordered", exportable: true, forgettable: true },
2169
+ covers: (field) => field in moneyFields,
2170
+ ingest: (r) => canonicalizeIncomingMoney(r, moneyFields),
2171
+ canonicalizeStored: (r) => canonicalizeStoredMoney(r, moneyFields),
2172
+ encodeWrite: (r) => quantizeMoneyFields(r, moneyFields),
2173
+ present: (r, ctx) => decodeMoneyFields(r, ordinaryPresentFields, typeof ctx.locale === "string" ? ctx.locale : void 0),
2174
+ ...hasVirtualMoney ? {
2175
+ presentLate: (r, ctx) => presentVirtualMoneyFields(r, moneyFields, virtualMoneyFields, typeof ctx.locale === "string" ? ctx.locale : void 0)
2176
+ } : {},
2177
+ buildClause: (field, op, value) => {
2178
+ const desc = moneyFields[field];
2179
+ if (!desc) return void 0;
2180
+ return moneyFieldClause(field, op, value, desc);
2181
+ },
2182
+ evaluateClause: (actual, op, payload) => evaluateMoneyClause(actual, op, payload),
2183
+ indexProbe: (op, payload) => moneyIndexProbe(op, payload),
2184
+ canonicalizeIndexKey: (field, rawValue) => canonicalizeMoneyIndexKey(field, rawValue, moneyFields),
2185
+ decodeResults: (r) => decodeMoneyFields(r, moneyFields, "raw"),
2186
+ compareForOrder: (field, a, b) => {
2187
+ const desc = moneyFields[field];
2188
+ if (!desc) return void 0;
2189
+ const av = moneyScaledValue(a, desc);
2190
+ const bv = moneyScaledValue(b, desc);
2191
+ if (av === null) return bv === null ? 0 : 1;
2192
+ if (bv === null) return -1;
2193
+ return av < bv ? -1 : av > bv ? 1 : 0;
2194
+ },
2195
+ wrapReducers: (spec) => wrapMoneyReducers(spec, moneyFields)
2196
+ };
2197
+ }
2198
+ function linkMoneyVia() {
2199
+ installViaBinder("money", (cfg) => {
2200
+ const c = cfg;
2201
+ return moneyBinding(c.moneyFields, c.virtualMoneyFields);
2202
+ });
2203
+ }
2204
+
2205
+ // src/via/money/descriptor.ts
2206
+ var MoneyPrecisionError = class extends NoydbError {
2207
+ constructor(field, value, scale) {
2208
+ super(
2209
+ "MONEY_PRECISION",
2210
+ `money: value ${JSON.stringify(value)} for field "${field}" exceeds scale ${scale} and no rounding mode is configured`
2211
+ );
2212
+ this.field = field;
2213
+ this.value = value;
2214
+ this.scale = scale;
2215
+ this.name = "MoneyPrecisionError";
2216
+ }
2217
+ field;
2218
+ value;
2219
+ scale;
2220
+ };
2221
+ var MoneyCurrencyError = class extends NoydbError {
2222
+ constructor(currency, reason, field) {
2223
+ super(
2224
+ "MONEY_CURRENCY",
2225
+ reason === "not-allowed" ? `money: currency "${currency}" is not allowed${field ? ` for field "${field}"` : ""}` : `money: no scale known for currency "${currency}"${field ? ` (field "${field}")` : ""} \u2014 pass an explicit scale / scaleOverrides`
2226
+ );
2227
+ this.currency = currency;
2228
+ this.reason = reason;
2229
+ this.field = field;
2230
+ this.name = "MoneyCurrencyError";
2231
+ }
2232
+ currency;
2233
+ reason;
2234
+ field;
2235
+ };
2236
+ var MoneyUnsupportedError = class extends NoydbError {
2237
+ constructor(field, message) {
2238
+ super(
2239
+ "MONEY_UNSUPPORTED",
2240
+ message ?? `money: operation is not supported on field "${field}" \u2014 use sum() and count() and divide at the boundary`
2241
+ );
2242
+ this.field = field;
2243
+ this.name = "MoneyUnsupportedError";
2244
+ }
2245
+ field;
2246
+ };
2247
+ function isMultiOptions(o) {
2248
+ return "currencies" in o;
2249
+ }
2250
+ function money(options) {
2251
+ linkMoneyVia();
2252
+ const hasFixed = "currency" in options;
2253
+ const hasMulti = "currencies" in options;
2254
+ if (hasFixed && hasMulti) {
2255
+ throw new TypeError("money: `currency` and `currencies` are mutually exclusive");
2256
+ }
2257
+ if (!hasFixed && !hasMulti) {
2258
+ throw new TypeError("money: one of `currency` or `currencies` is required");
2259
+ }
2260
+ const rounding = options.rounding;
2261
+ if (isMultiOptions(options)) {
2262
+ const overrides = options.scaleOverrides ?? {};
2263
+ const allowList = options.currencies;
2264
+ const allows = (c) => allowList === "any" ? true : allowList.includes(c);
2265
+ const scaleFor = (c) => {
2266
+ if (!allows(c)) throw new MoneyCurrencyError(c, "not-allowed");
2267
+ const s = overrides[c] ?? scaleForCurrency(c);
2268
+ if (s === null || s === void 0) throw new MoneyCurrencyError(c, "unknown-scale");
2269
+ return s;
2270
+ };
2271
+ if (allowList !== "any") for (const c of allowList) scaleFor(c);
2272
+ const soleCurrency = () => allowList !== "any" && allowList.length === 1 ? allowList[0] : void 0;
2273
+ return {
2274
+ _noydbMoney: true,
2275
+ _viaBrand: "money",
2276
+ mode: "multi",
2277
+ options,
2278
+ rounding,
2279
+ fixedCurrency: void 0,
2280
+ scaleFor,
2281
+ allows,
2282
+ soleCurrency
2283
+ };
2284
+ }
2285
+ const currency = options.currency;
2286
+ const resolvedScale = options.scale ?? scaleForCurrency(currency);
2287
+ if (resolvedScale === null || resolvedScale === void 0) {
2288
+ throw new MoneyCurrencyError(currency, "unknown-scale");
2289
+ }
2290
+ return {
2291
+ _noydbMoney: true,
2292
+ _viaBrand: "money",
2293
+ mode: "fixed",
2294
+ options,
2295
+ rounding,
2296
+ fixedCurrency: currency,
2297
+ scaleFor(c) {
2298
+ if (c !== currency) throw new MoneyCurrencyError(c, "not-allowed");
2299
+ return resolvedScale;
2300
+ },
2301
+ allows: (c) => c === currency,
2302
+ soleCurrency: () => currency
2303
+ };
2304
+ }
2305
+ function isMoneyDescriptor(x) {
2306
+ return typeof x === "object" && x !== null && x._noydbMoney === true;
2307
+ }
2308
+
2309
+ // src/via/money/arith.ts
1288
2310
  function parseAmount(label, amount, scale, rounding) {
1289
2311
  const r = parseToScaledInt(amount, scale, rounding);
1290
2312
  if (!r.ok) {
@@ -1369,7 +2391,7 @@ function allocate(amount, weights, opts = {}) {
1369
2391
  return base.map((p) => formatScaledInt(negative && p !== 0n ? -p : p, scale));
1370
2392
  }
1371
2393
 
1372
- // src/with-shape/money/branded.ts
2394
+ // src/via/money/branded.ts
1373
2395
  function asMoney(value) {
1374
2396
  if (!isMoneyLike(value)) {
1375
2397
  throw new MoneyUnsupportedError(`asMoney: ${JSON.stringify(value)} is not a finite decimal`);
@@ -1390,6 +2412,296 @@ function isMoneyLike(value) {
1390
2412
  if (typeof value !== "string") return false;
1391
2413
  return decimalScaleOf(value) !== null;
1392
2414
  }
2415
+
2416
+ // src/via/computed/descriptor.ts
2417
+ function computed(fn, opts) {
2418
+ return {
2419
+ _viaBrand: "computed",
2420
+ fn,
2421
+ ...opts?.deps !== void 0 ? { deps: opts.deps } : {},
2422
+ mode: opts?.mode ?? "materialized"
2423
+ };
2424
+ }
2425
+ function isComputedDescriptor(x) {
2426
+ return typeof x === "object" && x !== null && x._viaBrand === "computed";
2427
+ }
2428
+
2429
+ // src/via/lookup/binding.ts
2430
+ function hasLabelSource(desc) {
2431
+ return !(desc.backing === "static" && desc.table === void 0);
2432
+ }
2433
+ async function fetchLookupLabel(desc, key, effLocale, fieldFallback, cfg) {
2434
+ if (desc.backing === "collection") {
2435
+ const getRow = cfg.getLookupBacking?.(desc);
2436
+ const row = getRow ? await getRow(key) : void 0;
2437
+ const labelField = desc.present?.label;
2438
+ if (!row || labelField === void 0) return void 0;
2439
+ const raw = row[labelField];
2440
+ if (desc.present?.by !== void 0) {
2441
+ return raw && typeof raw === "object" ? raw[effLocale] : void 0;
2442
+ }
2443
+ return typeof raw === "string" ? raw : void 0;
2444
+ }
2445
+ return cfg.lookupLabelResolver?.(desc.dimension, key, effLocale, fieldFallback);
2446
+ }
2447
+ async function runLookupPresent(record, ctx, cfg) {
2448
+ const fields = Object.entries(cfg.lookupFields).filter(([, d]) => hasLabelSource(d));
2449
+ if (fields.length === 0) return record;
2450
+ const locale = typeof ctx.locale === "string" ? ctx.locale : void 0;
2451
+ const fallback = ctx.fallback;
2452
+ const layer = ctx.layer;
2453
+ if (locale === "raw") return record;
2454
+ const hasStaticDisplay = fields.some(([, d]) => d.backing === "static" && d.displayLocale !== void 0);
2455
+ if (!locale && !hasStaticDisplay) return record;
2456
+ let result = record;
2457
+ const withLabels = { ...result };
2458
+ for (const [field, desc] of fields) {
2459
+ const policy = desc.onMissing ? resolvePolicy(desc.onMissing, layer) : "null";
2460
+ const fieldFallback = policy === "substitute" ? fallback ?? desc.substitute : fallback;
2461
+ const effLocale = locale ?? (desc.backing === "static" ? desc.displayLocale : void 0);
2462
+ const resolveKey = async (key) => {
2463
+ if (!effLocale) {
2464
+ if (policy === "throw") {
2465
+ throw new LocaleNotSpecifiedError(field, `lookup "${field}": no locale active to resolve key "${key}".`);
2466
+ }
2467
+ return null;
2468
+ }
2469
+ const label = await fetchLookupLabel(desc, key, effLocale, fieldFallback, cfg);
2470
+ if (label === void 0) {
2471
+ if (policy === "throw") {
2472
+ throw new LocaleNotSpecifiedError(field, `lookup "${field}": no label for key "${key}" in locale "${effLocale}".`);
2473
+ }
2474
+ return null;
2475
+ }
2476
+ return label;
2477
+ };
2478
+ if (field.includes("[].")) {
2479
+ const parts = field.split("[].");
2480
+ const arrayKey = parts[0];
2481
+ const leaf = parts[1];
2482
+ if (!leaf || leaf.includes(".")) continue;
2483
+ const arr = withLabels[arrayKey];
2484
+ if (!Array.isArray(arr)) continue;
2485
+ const labelKey = `${leaf}Label`;
2486
+ withLabels[arrayKey] = await Promise.all(
2487
+ arr.map(async (el) => {
2488
+ if (!el || typeof el !== "object" || Array.isArray(el)) return el;
2489
+ const k = el[leaf];
2490
+ if (typeof k !== "string") return el;
2491
+ return { ...el, [labelKey]: await resolveKey(k) };
2492
+ })
2493
+ );
2494
+ continue;
2495
+ }
2496
+ const val = result[field];
2497
+ if (Array.isArray(val)) {
2498
+ withLabels[`${field}Label`] = await Promise.all(
2499
+ val.map(async (k) => ({ key: k, label: typeof k === "string" ? await resolveKey(k) : null }))
2500
+ );
2501
+ } else if (typeof val === "string") {
2502
+ const label = await resolveKey(val);
2503
+ if (label !== null) withLabels[`${field}Label`] = label;
2504
+ }
2505
+ }
2506
+ result = withLabels;
2507
+ return result;
2508
+ }
2509
+ function buildLookupDescribeFragment(cfg) {
2510
+ const lookupFields = {};
2511
+ for (const [field, desc] of Object.entries(cfg.lookupFields)) {
2512
+ lookupFields[field] = {
2513
+ ...desc.dimension !== "" ? { dimension: desc.dimension } : {},
2514
+ backing: desc.backing,
2515
+ vocabulary: desc.vocabulary,
2516
+ key: desc.key,
2517
+ onDelete: desc.onDelete,
2518
+ ...desc.altKeys !== void 0 ? { altKeys: desc.altKeys } : {},
2519
+ ...desc.present !== void 0 ? { present: desc.present } : {},
2520
+ ...desc.sortBy !== void 0 ? { sortBy: desc.sortBy } : {},
2521
+ // #657 — static tier: when no `keys` was explicitly declared but a
2522
+ // `table` was (the staticDict()-equivalent `lookup(dim, {backing:
2523
+ // 'static', table})` shape), the table's own key set IS the
2524
+ // statically-known closed-vocabulary set the DescribedField.lookup
2525
+ // docblock promises ("declared `keys`, OR a static table's own
2526
+ // keys"). Reserved/matrix tiers never carry `table`, so this branch
2527
+ // never fires for them — their `keys` emission is unchanged.
2528
+ ...desc.keys !== void 0 ? { keys: desc.keys } : desc.backing === "static" && desc.table !== void 0 ? { keys: Object.keys(desc.table) } : {}
2529
+ };
2530
+ }
2531
+ return { lookupFields };
2532
+ }
2533
+ function getAltIndexOrThrow(field, desc, cfg) {
2534
+ try {
2535
+ return cfg.getAltIndex?.(desc);
2536
+ } catch (err) {
2537
+ if (err instanceof Error && err.message.includes("lazy-mode")) {
2538
+ throw new ValidationError(
2539
+ `lookup: altKeys on "${field}" require the backing collection "${desc.dimension}" to be prefetch-enabled (lazy mode unsupported); open it without {prefetch:false} or drop altKeys.`
2540
+ );
2541
+ }
2542
+ throw err;
2543
+ }
2544
+ }
2545
+ function runLookupIngest(record, cfg) {
2546
+ const withAltKeys = Object.entries(cfg.lookupFields).filter(([, d]) => (d.altKeys?.length ?? 0) > 0);
2547
+ if (withAltKeys.length === 0) return record;
2548
+ let result = record;
2549
+ for (const [field, desc] of withAltKeys) {
2550
+ const backing = getAltIndexOrThrow(field, desc, cfg);
2551
+ if (!backing || backing.altIndex.size === 0) continue;
2552
+ if (field.includes("[].")) {
2553
+ const [arrayKey, leaf] = field.split("[].");
2554
+ if (!leaf || leaf.includes(".")) continue;
2555
+ const arr = record[arrayKey];
2556
+ if (!Array.isArray(arr)) continue;
2557
+ let changed = false;
2558
+ const normalized = arr.map((item) => {
2559
+ if (!item || typeof item !== "object" || Array.isArray(item)) return item;
2560
+ const value2 = item[leaf];
2561
+ if (typeof value2 !== "string") return item;
2562
+ const canonical2 = backing.altIndex.get(value2);
2563
+ if (canonical2 === void 0 || canonical2 === value2) return item;
2564
+ changed = true;
2565
+ return { ...item, [leaf]: canonical2 };
2566
+ });
2567
+ if (!changed) continue;
2568
+ if (result === record) result = { ...record };
2569
+ result[arrayKey] = normalized;
2570
+ continue;
2571
+ }
2572
+ const values = getAtPath(record, field);
2573
+ if (values.length !== 1) continue;
2574
+ const value = values[0];
2575
+ if (Array.isArray(value)) {
2576
+ if (value.length === 0) continue;
2577
+ let changed = false;
2578
+ const normalized = value.map((el) => {
2579
+ if (typeof el !== "string") return el;
2580
+ const canonical2 = backing.altIndex.get(el);
2581
+ if (canonical2 === void 0 || canonical2 === el) return el;
2582
+ changed = true;
2583
+ return canonical2;
2584
+ });
2585
+ if (!changed) continue;
2586
+ if (result === record) result = { ...record };
2587
+ setAtPathInPlace(result, field, normalized);
2588
+ continue;
2589
+ }
2590
+ if (typeof value !== "string") continue;
2591
+ const canonical = backing.altIndex.get(value);
2592
+ if (canonical === void 0 || canonical === value) continue;
2593
+ if (result === record) result = { ...record };
2594
+ setAtPathInPlace(result, field, canonical);
2595
+ }
2596
+ return result;
2597
+ }
2598
+ async function runLookupEnforceWrite(record, cfg) {
2599
+ for (const [field, desc] of Object.entries(cfg.lookupFields)) {
2600
+ if (desc.vocabulary !== "closed") continue;
2601
+ for (const value of getAtPath(record, field)) {
2602
+ if (Array.isArray(value)) {
2603
+ for (const el of value) {
2604
+ if (typeof el !== "string") continue;
2605
+ const known2 = cfg.membership ? await cfg.membership(field, el) : true;
2606
+ if (!known2) throw new UnknownLookupKeyError(desc.dimension, field, el);
2607
+ }
2608
+ continue;
2609
+ }
2610
+ if (typeof value !== "string") continue;
2611
+ const known = cfg.membership ? await cfg.membership(field, value) : true;
2612
+ if (!known) throw new UnknownLookupKeyError(desc.dimension, field, value);
2613
+ }
2614
+ }
2615
+ }
2616
+ function compareLookupOrder(field, a, b, cfg) {
2617
+ if (typeof a !== "string" || typeof b !== "string") return void 0;
2618
+ const desc = cfg.lookupFields[field];
2619
+ if (!desc || desc.sortBy === void 0) return void 0;
2620
+ const rows = desc.backing === "static" ? desc.table ? new Map(Object.entries(desc.table)) : void 0 : cfg.snapshotFor?.(desc);
2621
+ if (!rows) return void 0;
2622
+ return buildLookupSnapshot(desc.dimension, rows, desc).compareKeys(a, b, desc.displayLocale ?? "");
2623
+ }
2624
+ function resolveLookupOrderLabel(field, key, locale, cfg) {
2625
+ const desc = cfg.lookupFields[field];
2626
+ if (!desc) return void 0;
2627
+ const rows = desc.backing === "static" ? desc.table ? new Map(Object.entries(desc.table)) : void 0 : cfg.snapshotFor?.(desc);
2628
+ if (!rows) return void 0;
2629
+ return buildLookupSnapshot(desc.dimension, rows, desc).label(key, locale ?? desc.displayLocale ?? "");
2630
+ }
2631
+ function lookupBinding(cfg) {
2632
+ return {
2633
+ brand: "lookup",
2634
+ posture: { encryptedAtRest: "envelope", queryable: "full", exportable: true, forgettable: false },
2635
+ reservedPrefixes: ["_dict_", "_lookup_"],
2636
+ covers: (field) => field in cfg.lookupFields,
2637
+ ingest: (record) => runLookupIngest(record, cfg),
2638
+ enforceWrite: (record) => runLookupEnforceWrite(record, cfg),
2639
+ present: async (record, ctx) => runLookupPresent(record, ctx, cfg),
2640
+ compareForOrder: (field, a, b) => compareLookupOrder(field, a, b, cfg),
2641
+ resolveOrderLabel: (field, key, locale) => resolveLookupOrderLabel(field, key, locale, cfg),
2642
+ describeFragment: () => buildLookupDescribeFragment(cfg)
2643
+ };
2644
+ }
2645
+ function linkLookupVia() {
2646
+ installViaBinder("lookup", (c) => lookupBinding(c));
2647
+ }
2648
+
2649
+ // src/via/lookup/descriptor.ts
2650
+ function warnIfSortByNeedsDisplayLocale(dimension, opts) {
2651
+ if (opts?.sortBy !== void 0 && opts.present?.by !== void 0 && opts.displayLocale === void 0) {
2652
+ console.warn(
2653
+ `[noy-db] lookup("${dimension}"): sortBy "${opts.sortBy}" is locale-keyed (present.by is set) but no displayLocale is declared \u2014 a locale-less orderBy() will silently sort by the raw stored key instead of the resolved label. Declare displayLocale, or sort via orderBy(field, dir, { by: 'label' }), which resolves at the query's own per-call locale.`
2654
+ );
2655
+ }
2656
+ }
2657
+ function lookup(dimension, opts) {
2658
+ linkLookupVia();
2659
+ warnIfSortByNeedsDisplayLocale(dimension, opts);
2660
+ return {
2661
+ _viaBrand: "lookup",
2662
+ dimension,
2663
+ key: opts?.key ?? "id",
2664
+ vocabulary: opts?.vocabulary ?? "open",
2665
+ backing: opts?.backing ?? "collection",
2666
+ onDelete: opts?.onDelete ?? "restrict",
2667
+ ...opts?.altKeys !== void 0 ? { altKeys: opts.altKeys } : {},
2668
+ ...opts?.present !== void 0 ? { present: opts.present } : {},
2669
+ ...opts?.sortBy !== void 0 ? { sortBy: opts.sortBy } : {},
2670
+ ...opts?.keys !== void 0 ? { keys: opts.keys } : {},
2671
+ ...opts?.table !== void 0 ? { table: opts.table } : {},
2672
+ ...opts?.displayLocale !== void 0 ? { displayLocale: opts.displayLocale } : {},
2673
+ ...opts?.onMissing !== void 0 ? { onMissing: opts.onMissing } : {},
2674
+ ...opts?.substitute !== void 0 ? { substitute: opts.substitute } : {},
2675
+ ...opts?.labels !== void 0 ? { labels: opts.labels } : {}
2676
+ };
2677
+ }
2678
+ function enumOf(keys) {
2679
+ linkLookupVia();
2680
+ return {
2681
+ _viaBrand: "lookup",
2682
+ dimension: "",
2683
+ key: "id",
2684
+ vocabulary: "closed",
2685
+ backing: "static",
2686
+ onDelete: "restrict",
2687
+ keys
2688
+ };
2689
+ }
2690
+ function dict(dimension, opts) {
2691
+ linkLookupVia();
2692
+ return {
2693
+ _viaBrand: "lookup",
2694
+ dimension,
2695
+ key: "id",
2696
+ vocabulary: opts?.vocabulary ?? "open",
2697
+ backing: "reserved",
2698
+ onDelete: opts?.onDelete ?? "restrict",
2699
+ ...opts?.keys !== void 0 ? { keys: opts.keys } : {},
2700
+ ...opts?.present !== void 0 ? { present: opts.present } : {},
2701
+ ...opts?.onMissing !== void 0 ? { onMissing: opts.onMissing } : {},
2702
+ ...opts?.substitute !== void 0 ? { substitute: opts.substitute } : {}
2703
+ };
2704
+ }
1393
2705
  export {
1394
2706
  Aggregation,
1395
2707
  AlreadyElevatedError,
@@ -1410,6 +2722,13 @@ export {
1410
2722
  BundleVersionConflictError,
1411
2723
  CONSENT_AUDIT_COLLECTION,
1412
2724
  CargoNotEnabledError,
2725
+ ClassifiedConfigError,
2726
+ ClassifiedNeverStoredError,
2727
+ ClassifiedNotEnabledError,
2728
+ ClassifiedRevealError,
2729
+ ClassifiedRotationError,
2730
+ ClassifiedValidationError,
2731
+ ClassifiedVerifyError,
1413
2732
  Collection,
1414
2733
  CollectionFrame,
1415
2734
  CollectionIndexes,
@@ -1442,7 +2761,7 @@ export {
1442
2761
  DerivationOutputUnknownError,
1443
2762
  DictKeyInUseError,
1444
2763
  DictKeyMissingError,
1445
- DictionaryHandle,
2764
+ LookupHandle as DictionaryHandle,
1446
2765
  DirectoryDisabledError,
1447
2766
  ELEVATION_AUDIT_COLLECTION,
1448
2767
  ElevatedHandle,
@@ -1452,6 +2771,7 @@ export {
1452
2771
  EnclaveNotSupportedError,
1453
2772
  ExportCapabilityError,
1454
2773
  FieldFrozenError,
2774
+ FieldNotQueryableError,
1455
2775
  FilenameSanitizationError,
1456
2776
  ForgetStrategyNotConfiguredError,
1457
2777
  GROUPBY_MAX_CARDINALITY,
@@ -1505,6 +2825,7 @@ export {
1505
2825
  NO_CUSTODY,
1506
2826
  NO_SEARCH,
1507
2827
  NO_SEQUENCE,
2828
+ NO_TEAM,
1508
2829
  NetworkError,
1509
2830
  NoAccessError,
1510
2831
  NonAdditiveSchemaChangeError,
@@ -1546,6 +2867,7 @@ export {
1546
2867
  RefScopeError,
1547
2868
  ReservedCollectionNameError,
1548
2869
  ReservedVaultNameError,
2870
+ RestrictRefUnresolvableError,
1549
2871
  SCHEMAS_COLLECTION,
1550
2872
  SEALED_PASSPHRASE_RECORD_ID,
1551
2873
  STATE_VAULT_NAME,
@@ -1577,6 +2899,7 @@ export {
1577
2899
  SyncScheduler,
1578
2900
  SyncTransaction,
1579
2901
  TamperedError,
2902
+ TeamNotEnabledError,
1580
2903
  TierDemoteDeniedError,
1581
2904
  TierNotGrantedError,
1582
2905
  TiersNotEnabledError,
@@ -1588,6 +2911,7 @@ export {
1588
2911
  USER_ENVELOPE_MAX_BYTES,
1589
2912
  UniqueConstraintError,
1590
2913
  UnknownDictCodeError,
2914
+ UnknownLookupKeyError,
1591
2915
  UnknownShardError,
1592
2916
  UnsupportedIndexOptionError,
1593
2917
  UserApi,
@@ -1606,6 +2930,7 @@ export {
1606
2930
  allocate,
1607
2931
  applyI18nLocale,
1608
2932
  applyJoins,
2933
+ applyListProjection,
1609
2934
  applyPatch,
1610
2935
  approveWithdrawal,
1611
2936
  asMoney,
@@ -1620,9 +2945,11 @@ export {
1620
2945
  burnPaperRecoveryEntry,
1621
2946
  canonicalJson,
1622
2947
  checkGate,
2948
+ classified,
1623
2949
  clearDevUnlock,
1624
2950
  compileSequenceFormat,
1625
2951
  computePatch,
2952
+ computed,
1626
2953
  coordinatedCutover,
1627
2954
  count,
1628
2955
  createBundleStore,
@@ -1650,6 +2977,7 @@ export {
1650
2977
  detectMagic,
1651
2978
  detectMimeType,
1652
2979
  diagramAuthConfig,
2980
+ dict,
1653
2981
  dictCollectionName,
1654
2982
  dictKey,
1655
2983
  diff,
@@ -1660,6 +2988,8 @@ export {
1660
2988
  encryptDeterministic,
1661
2989
  enforceScript,
1662
2990
  enrollAuthenticator,
2991
+ enumOf as enum,
2992
+ enumOf,
1663
2993
  envelopePayloadHash,
1664
2994
  estimateEntropy,
1665
2995
  estimateRecordBytes,
@@ -1685,6 +3015,9 @@ export {
1685
3015
  immutableGuard,
1686
3016
  importExternalObjects,
1687
3017
  inferScripts,
3018
+ isClassifiedFieldSpec,
3019
+ isClassifiedGroup,
3020
+ isComputedDescriptor,
1688
3021
  isDeedVault,
1689
3022
  isDevUnlockActive,
1690
3023
  isDictCollectionName,
@@ -1701,6 +3034,7 @@ export {
1701
3034
  isSessionAlive,
1702
3035
  isStaticDictDescriptor,
1703
3036
  isULID,
3037
+ isViaFieldSpec,
1704
3038
  isZodSchema,
1705
3039
  issueDelegation,
1706
3040
  recoverPassphrase as keyringRecoverPassphrase,
@@ -1723,6 +3057,8 @@ export {
1723
3057
  loadUserEnvelope,
1724
3058
  loadVaultPolicy,
1725
3059
  lockSchema,
3060
+ lookup,
3061
+ luhnCheck,
1726
3062
  magicLinkGrantRecordId,
1727
3063
  max,
1728
3064
  memoryObjectProjection,
@@ -1769,6 +3105,7 @@ export {
1769
3105
  requestWithdrawal,
1770
3106
  resetBrotliSupportCache,
1771
3107
  resetJoinWarnings,
3108
+ resolveClassifiedFields,
1772
3109
  resolveCrdtSnapshot,
1773
3110
  resolveI18nText,
1774
3111
  resolvePolicy,
@@ -1805,6 +3142,7 @@ export {
1805
3142
  validateSchemaInput,
1806
3143
  validateSchemaOutput,
1807
3144
  validateSessionPolicy,
3145
+ via,
1808
3146
  visibilityRecordId,
1809
3147
  withArchive,
1810
3148
  withCache,
@@ -1815,6 +3153,7 @@ export {
1815
3153
  withDerivation,
1816
3154
  withGuard,
1817
3155
  withHealthCheck,
3156
+ withLazy,
1818
3157
  withLogging,
1819
3158
  withMaterializedView,
1820
3159
  withMetrics,
@@ -1823,6 +3162,7 @@ export {
1823
3162
  withRollup,
1824
3163
  withSearch,
1825
3164
  withSequence,
3165
+ withTeam,
1826
3166
  withdrawAccessibleData,
1827
3167
  wrapBundleStore,
1828
3168
  wrapPodStore,