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

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 (938) hide show
  1. package/dist/aggregate/index.js +9 -8
  2. package/dist/aggregate/index.js.map +1 -1
  3. package/dist/api-YGMINAET.js +20 -0
  4. package/dist/as/index.js +12 -6
  5. package/dist/attestation/index.js +19 -13
  6. package/dist/attestation/index.js.map +1 -1
  7. package/dist/backup-XA5STIYQ.js +225 -0
  8. package/dist/backup-XA5STIYQ.js.map +1 -0
  9. package/dist/blobs/index.js +12 -6
  10. package/dist/blobs/index.js.map +1 -1
  11. package/dist/broker/index.js +92 -0
  12. package/dist/broker/index.js.map +1 -0
  13. package/dist/bundle/index.js +21 -15
  14. package/dist/bundle/index.js.map +1 -1
  15. package/dist/by/index.js +2 -2
  16. package/dist/cargo/index.js +32 -26
  17. package/dist/chunk-25NDNMQ7.js +70 -0
  18. package/dist/chunk-25NDNMQ7.js.map +1 -0
  19. package/dist/chunk-2JMMY7HZ.js +188 -0
  20. package/dist/chunk-2JMMY7HZ.js.map +1 -0
  21. package/dist/chunk-3CNQ7FQ3.js +430 -0
  22. package/dist/chunk-3G4KMVUN.js +291 -0
  23. package/dist/chunk-3G4KMVUN.js.map +1 -0
  24. package/dist/chunk-3MSQLQNZ.js +74 -0
  25. package/dist/chunk-45ZZLTFH.js +38 -0
  26. package/dist/chunk-45ZZLTFH.js.map +1 -0
  27. package/dist/chunk-4GPE63GU.js +111 -0
  28. package/dist/chunk-4GPE63GU.js.map +1 -0
  29. package/dist/chunk-4N5QFSNQ.js +150 -0
  30. package/dist/chunk-4N5QFSNQ.js.map +1 -0
  31. package/dist/chunk-4R4Q64W5.js +34 -0
  32. package/dist/chunk-57V5S7PW.js +130 -0
  33. package/dist/chunk-57V5S7PW.js.map +1 -0
  34. package/dist/chunk-5JB73NMC.js +202 -0
  35. package/dist/chunk-5JB73NMC.js.map +1 -0
  36. package/dist/chunk-5XIPOCQC.js +155 -0
  37. package/dist/chunk-5ZOSG3RJ.js +778 -0
  38. package/dist/chunk-5ZOSG3RJ.js.map +1 -0
  39. package/dist/chunk-67TNU77I.js +36 -0
  40. package/dist/chunk-67TNU77I.js.map +1 -0
  41. package/dist/chunk-6QILBDZU.js +205 -0
  42. package/dist/chunk-7E67FJ33.js +155 -0
  43. package/dist/chunk-7ITPJFGC.js +50 -0
  44. package/dist/chunk-7ITPJFGC.js.map +1 -0
  45. package/dist/chunk-7NS43EXZ.js +117 -0
  46. package/dist/chunk-7QIXUSDQ.js +341 -0
  47. package/dist/chunk-7QIXUSDQ.js.map +1 -0
  48. package/dist/chunk-7VSGW5KJ.js +74 -0
  49. package/dist/chunk-7VSGW5KJ.js.map +1 -0
  50. package/dist/chunk-A2QF4JUE.js +14073 -0
  51. package/dist/chunk-A2QF4JUE.js.map +1 -0
  52. package/dist/chunk-A2Y6YFVN.js +209 -0
  53. package/dist/chunk-AOVDSIL3.js +1221 -0
  54. package/dist/chunk-AOVDSIL3.js.map +1 -0
  55. package/dist/chunk-ARSAMO24.js +29 -0
  56. package/dist/chunk-ARSAMO24.js.map +1 -0
  57. package/dist/chunk-AWB5JZW6.js +41 -0
  58. package/dist/chunk-AWB5JZW6.js.map +1 -0
  59. package/dist/chunk-BCYQA5BK.js +45 -0
  60. package/dist/chunk-BE7N3AXA.js +621 -0
  61. package/dist/chunk-BE7N3AXA.js.map +1 -0
  62. package/dist/chunk-BEIRE5K4.js +164 -0
  63. package/dist/chunk-BEIRE5K4.js.map +1 -0
  64. package/dist/chunk-BZO4WCJI.js +86 -0
  65. package/dist/chunk-BZO4WCJI.js.map +1 -0
  66. package/dist/chunk-C3YH34IL.js +75 -0
  67. package/dist/chunk-C3YH34IL.js.map +1 -0
  68. package/dist/chunk-C7NTK5I3.js +49 -0
  69. package/dist/chunk-C7NTK5I3.js.map +1 -0
  70. package/dist/chunk-CB25ONKC.js +129 -0
  71. package/dist/chunk-CIKY6I4W.js +21 -0
  72. package/dist/chunk-CKZW6P5V.js +32 -0
  73. package/dist/chunk-CKZW6P5V.js.map +1 -0
  74. package/dist/chunk-D26JB3LZ.js +54 -0
  75. package/dist/chunk-D3EFFFOL.js +59 -0
  76. package/dist/chunk-D3EFFFOL.js.map +1 -0
  77. package/dist/chunk-DGH65E7Q.js +466 -0
  78. package/dist/chunk-DGH65E7Q.js.map +1 -0
  79. package/dist/chunk-DIRRS7WP.js +42 -0
  80. package/dist/chunk-DJ3VKYFA.js +150 -0
  81. package/dist/chunk-DJ3VKYFA.js.map +1 -0
  82. package/dist/chunk-DMFNPHCX.js +247 -0
  83. package/dist/chunk-DMFNPHCX.js.map +1 -0
  84. package/dist/chunk-ELNBMFOS.js +392 -0
  85. package/dist/chunk-ELNBMFOS.js.map +1 -0
  86. package/dist/chunk-FH542DDY.js +1505 -0
  87. package/dist/chunk-FH542DDY.js.map +1 -0
  88. package/dist/chunk-FQQF23MC.js +45 -0
  89. package/dist/chunk-FQQF23MC.js.map +1 -0
  90. package/dist/chunk-FXK4X4BL.js +91 -0
  91. package/dist/chunk-FXK4X4BL.js.map +1 -0
  92. package/dist/chunk-GA2QHD6P.js +235 -0
  93. package/dist/chunk-GA2QHD6P.js.map +1 -0
  94. package/dist/chunk-GYGLAVCX.js +19 -0
  95. package/dist/chunk-GYGLAVCX.js.map +1 -0
  96. package/dist/chunk-H44ZE4IE.js +355 -0
  97. package/dist/chunk-H6CZSDWK.js +1697 -0
  98. package/dist/chunk-H6CZSDWK.js.map +1 -0
  99. package/dist/chunk-H6HM6CVR.js +279 -0
  100. package/dist/chunk-H6HM6CVR.js.map +1 -0
  101. package/dist/chunk-HFJIGWJC.js +382 -0
  102. package/dist/chunk-HUS3J5WM.js +404 -0
  103. package/dist/chunk-HUS3J5WM.js.map +1 -0
  104. package/dist/chunk-IDIV5NVH.js +99 -0
  105. package/dist/chunk-IDIV5NVH.js.map +1 -0
  106. package/dist/chunk-IGJCYUT5.js +99 -0
  107. package/dist/chunk-IGJCYUT5.js.map +1 -0
  108. package/dist/chunk-IGJHJYM6.js +515 -0
  109. package/dist/chunk-IGJHJYM6.js.map +1 -0
  110. package/dist/chunk-IP2QBAGS.js +589 -0
  111. package/dist/chunk-IP2QBAGS.js.map +1 -0
  112. package/dist/chunk-JK733I5V.js +23 -0
  113. package/dist/chunk-JK733I5V.js.map +1 -0
  114. package/dist/chunk-JOQ53DMI.js +255 -0
  115. package/dist/chunk-JOQ53DMI.js.map +1 -0
  116. package/dist/chunk-K62IUKOD.js +823 -0
  117. package/dist/chunk-K62IUKOD.js.map +1 -0
  118. package/dist/chunk-KPGX66PM.js +230 -0
  119. package/dist/chunk-KPZS5QAQ.js +151 -0
  120. package/dist/chunk-KPZS5QAQ.js.map +1 -0
  121. package/dist/chunk-L2SNBIV7.js +453 -0
  122. package/dist/chunk-L2SNBIV7.js.map +1 -0
  123. package/dist/chunk-LP7BEXCT.js +32 -0
  124. package/dist/chunk-LP7BEXCT.js.map +1 -0
  125. package/dist/chunk-MCEKIAO4.js +367 -0
  126. package/dist/chunk-MELR46EF.js +280 -0
  127. package/dist/chunk-MELR46EF.js.map +1 -0
  128. package/dist/chunk-MSPNM2OM.js +95 -0
  129. package/dist/chunk-MSPNM2OM.js.map +1 -0
  130. package/dist/chunk-NO272T7Q.js +194 -0
  131. package/dist/chunk-NO272T7Q.js.map +1 -0
  132. package/dist/chunk-O2DYPAZY.js +23 -0
  133. package/dist/chunk-ODJWBC5I.js +30 -0
  134. package/dist/chunk-OEAATWH5.js +686 -0
  135. package/dist/chunk-OEAATWH5.js.map +1 -0
  136. package/dist/chunk-OFJ5GPNA.js +71 -0
  137. package/dist/chunk-OOLO4LQG.js +99 -0
  138. package/dist/chunk-OOLO4LQG.js.map +1 -0
  139. package/dist/chunk-P5RY4ZWD.js +662 -0
  140. package/dist/chunk-P5RY4ZWD.js.map +1 -0
  141. package/dist/chunk-PR5LC5YX.js +265 -0
  142. package/dist/chunk-PR5LC5YX.js.map +1 -0
  143. package/dist/chunk-PXWVF7MC.js +135 -0
  144. package/dist/chunk-Q3XSMOZM.js +40 -0
  145. package/dist/chunk-QLLKLFE2.js +94 -0
  146. package/dist/chunk-QLLKLFE2.js.map +1 -0
  147. package/dist/chunk-QQJXBZCO.js +1056 -0
  148. package/dist/chunk-QQJXBZCO.js.map +1 -0
  149. package/dist/chunk-QYPKGVT4.js +261 -0
  150. package/dist/chunk-QYPKGVT4.js.map +1 -0
  151. package/dist/chunk-RKRGDAS7.js +59 -0
  152. package/dist/chunk-SRVQHVNX.js +164 -0
  153. package/dist/chunk-SYMS4546.js +29 -0
  154. package/dist/chunk-SYMS4546.js.map +1 -0
  155. package/dist/chunk-THNJ3IKU.js +17 -0
  156. package/dist/chunk-THNJ3IKU.js.map +1 -0
  157. package/dist/chunk-TPH5EO6L.js +54 -0
  158. package/dist/chunk-TPH5EO6L.js.map +1 -0
  159. package/dist/chunk-UFILRICG.js +14 -0
  160. package/dist/chunk-UTLEAJXC.js +97 -0
  161. package/dist/chunk-VA4ZWLFY.js +123 -0
  162. package/dist/chunk-VR24ILCR.js +367 -0
  163. package/dist/chunk-VYYM3MEN.js +98 -0
  164. package/dist/chunk-VYYM3MEN.js.map +1 -0
  165. package/dist/chunk-W5D62AQD.js +944 -0
  166. package/dist/chunk-W5D62AQD.js.map +1 -0
  167. package/dist/chunk-WGV4CUZT.js +167 -0
  168. package/dist/chunk-WGV4CUZT.js.map +1 -0
  169. package/dist/chunk-WTUNZACT.js +30 -0
  170. package/dist/chunk-WTUNZACT.js.map +1 -0
  171. package/dist/chunk-X6CMGUAG.js +69 -0
  172. package/dist/chunk-X6CMGUAG.js.map +1 -0
  173. package/dist/chunk-XFXUTFWQ.js +85 -0
  174. package/dist/chunk-XFXUTFWQ.js.map +1 -0
  175. package/dist/chunk-XHV25KBM.js +30 -0
  176. package/dist/chunk-YSXEFGND.js +124 -0
  177. package/dist/chunk-YXOUQ2H7.js +36 -0
  178. package/dist/chunk-ZP5PL65C.js +80 -0
  179. package/dist/classified/index.js +40 -0
  180. package/dist/classified-marker-LQWWQNIJ.js +24 -0
  181. package/dist/classified-marker-LQWWQNIJ.js.map +1 -0
  182. package/dist/collection-facade-YE2O4J4O.js +39 -0
  183. package/dist/computed-W6MVAMWZ.js +11 -0
  184. package/dist/consent/index.js +10 -4
  185. package/dist/consent/index.js.map +1 -1
  186. package/dist/crdt/index.js +1 -1
  187. package/dist/dead-filter-4KXZEB3X.js +28 -0
  188. package/dist/dead-filter-4KXZEB3X.js.map +1 -0
  189. package/dist/delegation-OPUU3R2E.js +25 -0
  190. package/dist/derivations/index.js +13 -6
  191. package/dist/derive-BGUHU663.js +21 -0
  192. package/dist/enclave-VXAQD4XJ.js +135 -0
  193. package/dist/executor-GTVSUUBX.js +25 -0
  194. package/dist/executor-GZWMTOXB.js +9 -0
  195. package/dist/executor-XXGS4S3K.js +9 -0
  196. package/dist/export-accessible-BMULIOYB.js +23 -0
  197. package/dist/extract-partition-JUQTWDXR.js +36 -0
  198. package/dist/fanout-sidecar-CKYFH33E.js +74 -0
  199. package/dist/fanout-sidecar-CKYFH33E.js.map +1 -0
  200. package/dist/fence-watcher-DHQ775JB.js +69 -0
  201. package/dist/fence-watcher-DHQ775JB.js.map +1 -0
  202. package/dist/find-XRGCNGNN.js +11 -0
  203. package/dist/forget/index.js +11 -5
  204. package/dist/forget/index.js.map +1 -1
  205. package/dist/guards/index.js +4 -4
  206. package/dist/history/index.js +12 -6
  207. package/dist/history/index.js.map +1 -1
  208. package/dist/i18n/index.js +50 -31
  209. package/dist/i18n/index.js.map +1 -1
  210. package/dist/index.d.ts +303 -1400
  211. package/dist/index.js +1525 -184
  212. package/dist/index.js.map +1 -1
  213. package/dist/indexing/index.js +4 -4
  214. package/dist/issue-UB6AA5M6.js +19 -0
  215. package/dist/json-schema-I22JCYCG.js +44 -0
  216. package/dist/json-schema-I22JCYCG.js.map +1 -0
  217. package/dist/kernel/cache/index.d.ts +10 -0
  218. package/dist/kernel/cache/lru.d.ts +97 -0
  219. package/dist/kernel/cache/policy.d.ts +32 -0
  220. package/dist/kernel/collection-config.d.ts +781 -0
  221. package/dist/kernel/collection.d.ts +1505 -0
  222. package/dist/kernel/constants.d.ts +18 -0
  223. package/dist/kernel/debug.d.ts +25 -0
  224. package/dist/kernel/enclave/broker/proof.d.ts +154 -0
  225. package/dist/kernel/enclave/classify/bidx.d.ts +77 -0
  226. package/dist/kernel/enclave/classify/compare.d.ts +10 -0
  227. package/dist/kernel/enclave/classify/digest.d.ts +8 -0
  228. package/dist/kernel/enclave/classify/find.d.ts +36 -0
  229. package/dist/kernel/enclave/classify/kofn.d.ts +7 -0
  230. package/dist/kernel/enclave/classify/normalize.d.ts +7 -0
  231. package/dist/kernel/enclave/classify/reveal.d.ts +10 -0
  232. package/dist/kernel/enclave/classify/vdig.d.ts +39 -0
  233. package/dist/kernel/enclave/classify/verify.d.ts +33 -0
  234. package/dist/kernel/enclave/classify/write.d.ts +8 -0
  235. package/dist/kernel/enclave/crypto.d.ts +263 -0
  236. package/dist/kernel/enclave/index.d.ts +78 -0
  237. package/dist/kernel/enclave/record-keys/deterministic.d.ts +54 -0
  238. package/dist/kernel/enclave/record-keys/envelope-body.d.ts +79 -0
  239. package/dist/kernel/enclave/record-keys/lifecycle.d.ts +57 -0
  240. package/dist/kernel/enclave/record-keys/record-codec.d.ts +301 -0
  241. package/dist/kernel/enclave/record-keys/sealed-slot.d.ts +14 -0
  242. package/dist/kernel/enclave/record-keys/sealed-slots.d.ts +123 -0
  243. package/dist/kernel/enclave/record-keys/sealing.d.ts +70 -0
  244. package/dist/kernel/enclave/record-keys/tombstone.d.ts +57 -0
  245. package/dist/kernel/env-check.d.ts +1 -0
  246. package/dist/kernel/errors.d.ts +1848 -0
  247. package/dist/kernel/events.d.ts +11 -0
  248. package/dist/kernel/memory-store.d.ts +17 -0
  249. package/dist/kernel/mutation.d.ts +14 -0
  250. package/dist/kernel/noydb.d.ts +818 -0
  251. package/dist/kernel/paths.d.ts +25 -0
  252. package/dist/kernel/query/builder.d.ts +520 -0
  253. package/dist/kernel/query/index.d.ts +31 -0
  254. package/dist/kernel/query/join.d.ts +205 -0
  255. package/dist/kernel/query/live.d.ts +111 -0
  256. package/dist/kernel/query/predicate.d.ts +139 -0
  257. package/dist/kernel/query/scan-builder.d.ts +334 -0
  258. package/dist/kernel/refs.d.ts +205 -0
  259. package/dist/kernel/schema.d.ts +134 -0
  260. package/dist/kernel/sync-policy.d.ts +188 -0
  261. package/dist/kernel/types.d.ts +3147 -0
  262. package/dist/kernel/util/discriminant.d.ts +58 -0
  263. package/dist/kernel/util/index.d.ts +14 -0
  264. package/dist/kernel/util/sanitize-filename.d.ts +75 -0
  265. package/dist/kernel/validation.d.ts +130 -0
  266. package/dist/kernel/vault.d.ts +1723 -0
  267. package/dist/kernel/via/compose.d.ts +144 -0
  268. package/dist/kernel/via/dispatch.d.ts +185 -0
  269. package/dist/kernel/via/graph-wiring.d.ts +145 -0
  270. package/dist/kernel/via/graph.d.ts +165 -0
  271. package/dist/kernel/via/index.d.ts +200 -0
  272. package/dist/kernel/via/pipeline.d.ts +266 -0
  273. package/dist/kernel/via/reconcile.d.ts +153 -0
  274. package/dist/kernel/via/taint-binding.d.ts +66 -0
  275. package/dist/kernel/write-queue.d.ts +46 -0
  276. package/dist/lazy/index.js +12 -0
  277. package/dist/ledger-FU6GH5EH.js +42 -0
  278. package/dist/legacy/bundle.d.ts +30 -0
  279. package/dist/legacy/kernel.d.ts +33 -0
  280. package/dist/liberate-YUN7W5QG.js +24 -0
  281. package/dist/link-set-MNADSH5M.js +31 -0
  282. package/dist/materialized-views/index.js +20 -10
  283. package/dist/noydb-6JLBZU4U.js +67 -0
  284. package/dist/on/index.js +10 -4
  285. package/dist/overlay-views/index.js +4 -4
  286. package/dist/periods/index.js +21 -7
  287. package/dist/pod/index.js +12 -6
  288. package/dist/policy-JTFOPPUU.js +41 -0
  289. package/dist/port/as/index.d.ts +26 -0
  290. package/dist/port/at/index.d.ts +18 -0
  291. package/dist/port/by/default-provider.d.ts +9 -0
  292. package/dist/port/by/index.d.ts +17 -0
  293. package/dist/port/by/types.d.ts +86 -0
  294. package/dist/port/in/index.d.ts +21 -0
  295. package/dist/port/on/index.d.ts +27 -0
  296. package/dist/port/to/index.d.ts +19 -0
  297. package/dist/port/ui/index.d.ts +21 -0
  298. package/dist/port/with/blob-strategy.d.ts +81 -0
  299. package/dist/port/with/broker-strategy.d.ts +84 -0
  300. package/dist/port/with/capabilities.d.ts +31 -0
  301. package/dist/port/with/classified-marker.d.ts +9 -0
  302. package/dist/port/with/classified-strategy.d.ts +62 -0
  303. package/dist/port/with/computed-strategy.d.ts +19 -0
  304. package/dist/port/with/i18n-strategy.d.ts +175 -0
  305. package/dist/port/with/index.d.ts +18 -0
  306. package/dist/port/with/lazy-strategy.d.ts +48 -0
  307. package/dist/port/with/lookup-strategy.d.ts +128 -0
  308. package/dist/port/with/service-bus.d.ts +156 -0
  309. package/dist/port/with/team-strategy.d.ts +36 -0
  310. package/dist/port/with/write-hooks.d.ts +34 -0
  311. package/dist/portability/index.js +8 -8
  312. package/dist/post-register-HAWO3O7O.js +55 -0
  313. package/dist/post-register-HAWO3O7O.js.map +1 -0
  314. package/dist/public-envelope-NJVB7LPA.js +32 -0
  315. package/dist/purge-scope-FGNNLWHD.js +24 -0
  316. package/dist/purge-scope-FGNNLWHD.js.map +1 -0
  317. package/dist/query/index.js +9 -6
  318. package/dist/read-only-facade-CHCKSEPD.js +8 -0
  319. package/dist/register-VCKOBWKT.js +23 -0
  320. package/dist/registry-72UKJ2L4.js +9 -0
  321. package/dist/registry-BZFLJNEH.js +18 -0
  322. package/dist/registry-YJEYSYI5.js +19 -0
  323. package/dist/request-withdrawal-6MJRMFHF.js +31 -0
  324. package/dist/reveal-BOY7XYFH.js +38 -0
  325. package/dist/reveal-BOY7XYFH.js.map +1 -0
  326. package/dist/revoke-4KUNSVJC.js +24 -0
  327. package/dist/satellites/index.js +8 -0
  328. package/dist/sealed-record/index.js +13 -7
  329. package/dist/sealed-record/index.js.map +1 -1
  330. package/dist/seed-4RRXT42N.js +231 -0
  331. package/dist/seed-4RRXT42N.js.map +1 -0
  332. package/dist/session/index.js +10 -4
  333. package/dist/session/index.js.map +1 -1
  334. package/dist/shadow/index.js +2 -2
  335. package/dist/signer-DDDXP5JD.js +25 -0
  336. package/dist/signer-DDDXP5JD.js.map +1 -0
  337. package/dist/snapshots/index.js +11 -5
  338. package/dist/snapshots/index.js.map +1 -1
  339. package/dist/stale-NXPT56JA.js +14 -0
  340. package/dist/stale-NXPT56JA.js.map +1 -0
  341. package/dist/storage-IR6EEAV2.js +23 -0
  342. package/dist/storage-IR6EEAV2.js.map +1 -0
  343. package/dist/store-coordination-provider-HPYVFJCV.js +142 -0
  344. package/dist/sync/index.js +10 -4
  345. package/dist/sync/index.js.map +1 -1
  346. package/dist/team/index.js +25 -12
  347. package/dist/tiers/index.js +11 -5
  348. package/dist/to/index.js +1 -2
  349. package/dist/tx/index.js +3 -3
  350. package/dist/util/index.js +1 -1
  351. package/dist/verify-66RHOW7N.js +139 -0
  352. package/dist/verify-66RHOW7N.js.map +1 -0
  353. package/dist/via/blob/active.d.ts +34 -0
  354. package/dist/via/blob/binding.d.ts +86 -0
  355. package/dist/via/blob/index.d.ts +34 -0
  356. package/dist/via/classified/active.d.ts +3 -0
  357. package/dist/via/classified/binding.d.ts +83 -0
  358. package/dist/via/classified/config-drift.d.ts +34 -0
  359. package/dist/via/classified/descriptor.d.ts +66 -0
  360. package/dist/via/classified/errors.d.ts +19 -0
  361. package/dist/via/classified/guards.d.ts +23 -0
  362. package/dist/via/classified/index.d.ts +11 -0
  363. package/dist/via/classified/presets.d.ts +65 -0
  364. package/dist/via/classified/resolve.d.ts +9 -0
  365. package/dist/via/classified/strategy.d.ts +11 -0
  366. package/dist/via/classified/validators.d.ts +3 -0
  367. package/dist/via/classified/write.d.ts +4 -0
  368. package/dist/via/computed/binding.d.ts +34 -0
  369. package/dist/via/computed/descriptor.d.ts +35 -0
  370. package/dist/via/i18n/active.d.ts +28 -0
  371. package/dist/via/i18n/binding.d.ts +36 -0
  372. package/dist/via/i18n/core.d.ts +267 -0
  373. package/dist/via/i18n/densify.d.ts +24 -0
  374. package/dist/via/i18n/dictionary.d.ts +200 -0
  375. package/dist/via/i18n/index.d.ts +21 -0
  376. package/dist/via/i18n/policy.d.ts +44 -0
  377. package/dist/via/i18n/script.d.ts +26 -0
  378. package/dist/via/i18n/strategy.d.ts +13 -0
  379. package/dist/via/lookup/active.d.ts +19 -0
  380. package/dist/via/lookup/binding.d.ts +99 -0
  381. package/dist/via/lookup/descriptor.d.ts +123 -0
  382. package/dist/via/lookup/handle.d.ts +220 -0
  383. package/dist/via/lookup/index.d.ts +17 -0
  384. package/dist/via/lookup/registry.d.ts +219 -0
  385. package/dist/via/lookup/snapshot.d.ts +67 -0
  386. package/dist/via/money/arith.d.ts +68 -0
  387. package/dist/via/money/binding.d.ts +21 -0
  388. package/dist/via/money/branded.d.ts +61 -0
  389. package/dist/via/money/descriptor.d.ts +73 -0
  390. package/dist/via/money/fixed-point.d.ts +51 -0
  391. package/dist/via/money/index.d.ts +15 -0
  392. package/dist/via/money/iso4217.d.ts +6 -0
  393. package/dist/via/money/money-reducer.d.ts +33 -0
  394. package/dist/via/money/normalize.d.ts +105 -0
  395. package/dist/via/money/paths.d.ts +61 -0
  396. package/dist/via/money/where.d.ts +106 -0
  397. package/dist/walk-2RWEOCAS.js +241 -0
  398. package/dist/walk-2RWEOCAS.js.map +1 -0
  399. package/dist/with/index.js +12 -6
  400. package/dist/with-audit/attestation/active.d.ts +10 -0
  401. package/dist/with-audit/attestation/index.d.ts +16 -0
  402. package/dist/with-audit/attestation/issue.d.ts +29 -0
  403. package/dist/with-audit/attestation/revoke.d.ts +15 -0
  404. package/dist/with-audit/attestation/signer.d.ts +33 -0
  405. package/dist/with-audit/attestation/strategy.d.ts +44 -0
  406. package/dist/with-audit/attestation/vault-facade.d.ts +62 -0
  407. package/dist/with-audit/consent/active.d.ts +14 -0
  408. package/dist/with-audit/consent/consent.d.ts +114 -0
  409. package/dist/with-audit/consent/index.d.ts +14 -0
  410. package/dist/with-audit/consent/strategy.d.ts +36 -0
  411. package/dist/with-audit/forget/active.d.ts +31 -0
  412. package/dist/with-audit/forget/index.d.ts +28 -0
  413. package/dist/with-audit/forget/purge-scope.d.ts +54 -0
  414. package/dist/with-audit/forget/strategy.d.ts +177 -0
  415. package/dist/with-audit/forget/subject-index.d.ts +83 -0
  416. package/dist/with-audit/guards/executor.d.ts +26 -0
  417. package/dist/with-audit/guards/immutable-guard.d.ts +63 -0
  418. package/dist/with-audit/guards/index.d.ts +10 -0
  419. package/dist/with-audit/guards/read-only-facade.d.ts +31 -0
  420. package/dist/with-audit/guards/registry.d.ts +83 -0
  421. package/dist/with-audit/guards/transition-guard.d.ts +82 -0
  422. package/dist/with-audit/guards/types.d.ts +134 -0
  423. package/dist/with-audit/guards/with-guard.d.ts +15 -0
  424. package/dist/with-audit/periods/active.d.ts +11 -0
  425. package/dist/with-audit/periods/index.d.ts +18 -0
  426. package/dist/with-audit/periods/periods.d.ts +417 -0
  427. package/dist/with-audit/periods/strategy.d.ts +32 -0
  428. package/dist/with-audit/periods/vault-facade.d.ts +95 -0
  429. package/dist/with-audit/portability/active.d.ts +11 -0
  430. package/dist/with-audit/portability/export-accessible.d.ts +46 -0
  431. package/dist/with-audit/portability/index.d.ts +18 -0
  432. package/dist/with-audit/portability/request-withdrawal.d.ts +85 -0
  433. package/dist/with-audit/portability/strategy.d.ts +31 -0
  434. package/dist/with-audit/portability/withdraw-accessible.d.ts +82 -0
  435. package/dist/with-audit/sealed-record/active.d.ts +9 -0
  436. package/dist/with-audit/sealed-record/index.d.ts +55 -0
  437. package/dist/with-audit/sealed-record/strategy.d.ts +34 -0
  438. package/dist/with-audit/sealed-record/types.d.ts +27 -0
  439. package/dist/with-audit/tiers/active.d.ts +9 -0
  440. package/dist/with-audit/tiers/index.d.ts +122 -0
  441. package/dist/with-audit/tiers/strategy.d.ts +35 -0
  442. package/dist/with-cargo/active.d.ts +11 -0
  443. package/dist/with-cargo/adopt-partition.d.ts +81 -0
  444. package/dist/with-cargo/decrypt-partition.d.ts +19 -0
  445. package/dist/with-cargo/describe-extraction.d.ts +33 -0
  446. package/dist/with-cargo/extract-partition.d.ts +147 -0
  447. package/dist/with-cargo/index.d.ts +33 -0
  448. package/dist/with-cargo/strategy.d.ts +30 -0
  449. package/dist/with-cargo/vault-diff.d.ts +144 -0
  450. package/dist/with-cargo/walk-closure.d.ts +38 -0
  451. package/dist/with-commit/crdt/active.d.ts +25 -0
  452. package/dist/with-commit/crdt/crdt.d.ts +42 -0
  453. package/dist/with-commit/crdt/index.d.ts +16 -0
  454. package/dist/with-commit/crdt/strategy.d.ts +25 -0
  455. package/dist/with-commit/history/active.d.ts +40 -0
  456. package/dist/with-commit/history/diff.d.ts +23 -0
  457. package/dist/with-commit/history/history.d.ts +27 -0
  458. package/dist/with-commit/history/index.d.ts +30 -0
  459. package/dist/with-commit/history/ledger/constants.d.ts +37 -0
  460. package/dist/with-commit/history/ledger/entry.d.ts +195 -0
  461. package/dist/with-commit/history/ledger/hash.d.ts +30 -0
  462. package/dist/with-commit/history/ledger/index.d.ts +19 -0
  463. package/dist/with-commit/history/ledger/patch.d.ts +99 -0
  464. package/dist/with-commit/history/ledger/store.d.ts +335 -0
  465. package/dist/with-commit/history/strategy.d.ts +126 -0
  466. package/dist/with-commit/history/time-machine.d.ts +179 -0
  467. package/dist/with-commit/numbering/descriptor.d.ts +27 -0
  468. package/dist/with-commit/numbering/index.d.ts +69 -0
  469. package/dist/with-commit/sequence/active.d.ts +10 -0
  470. package/dist/with-commit/sequence/index.d.ts +150 -0
  471. package/dist/with-commit/sequence/strategy.d.ts +26 -0
  472. package/dist/with-commit/tx/active.d.ts +27 -0
  473. package/dist/with-commit/tx/dry-run.d.ts +29 -0
  474. package/dist/with-commit/tx/elevated-handle.d.ts +58 -0
  475. package/dist/with-commit/tx/index.d.ts +13 -0
  476. package/dist/with-commit/tx/invariants.d.ts +68 -0
  477. package/dist/with-commit/tx/strategy.d.ts +23 -0
  478. package/dist/with-commit/tx/transaction.d.ts +207 -0
  479. package/dist/with-fork/archive/engine.d.ts +71 -0
  480. package/dist/with-fork/archive/index.d.ts +23 -0
  481. package/dist/with-fork/shadow/active.d.ts +6 -0
  482. package/dist/with-fork/shadow/index.d.ts +14 -0
  483. package/dist/with-fork/shadow/strategy.d.ts +28 -0
  484. package/dist/with-fork/shadow/vault-frame.d.ts +93 -0
  485. package/dist/with-fork/snapshots/active.d.ts +20 -0
  486. package/dist/with-fork/snapshots/engine.d.ts +36 -0
  487. package/dist/with-fork/snapshots/index.d.ts +5 -0
  488. package/dist/with-fork/snapshots/noydb-facade.d.ts +64 -0
  489. package/dist/with-fork/snapshots/policy.d.ts +23 -0
  490. package/dist/with-fork/snapshots/scheduler.d.ts +34 -0
  491. package/dist/with-fork/snapshots/strategy.d.ts +48 -0
  492. package/dist/with-formula/computed/index.d.ts +48 -0
  493. package/dist/with-formula/computed/lazy.d.ts +13 -0
  494. package/dist/with-formula/derivations/executor.d.ts +61 -0
  495. package/dist/with-formula/derivations/fanout-sidecar.d.ts +75 -0
  496. package/dist/with-formula/derivations/index.d.ts +6 -0
  497. package/dist/with-formula/derivations/registry.d.ts +67 -0
  498. package/dist/with-formula/derivations/stale.d.ts +39 -0
  499. package/dist/with-formula/derivations/strategy-hash.d.ts +1 -0
  500. package/dist/with-formula/derivations/types.d.ts +248 -0
  501. package/dist/with-formula/derivations/with-derivation.d.ts +10 -0
  502. package/dist/with-formula/derivations/with-rollup.d.ts +34 -0
  503. package/dist/with-formula/materialized-views/dependency-analyzer.d.ts +58 -0
  504. package/dist/with-formula/materialized-views/executor.d.ts +71 -0
  505. package/dist/with-formula/materialized-views/index.d.ts +11 -0
  506. package/dist/with-formula/materialized-views/query-hash.d.ts +23 -0
  507. package/dist/with-formula/materialized-views/registry.d.ts +99 -0
  508. package/dist/with-formula/materialized-views/stale.d.ts +62 -0
  509. package/dist/with-formula/materialized-views/types.d.ts +318 -0
  510. package/dist/with-formula/materialized-views/with-materialized-view.d.ts +24 -0
  511. package/dist/with-formula/overlay-views/index.d.ts +5 -0
  512. package/dist/with-formula/overlay-views/registry.d.ts +42 -0
  513. package/dist/with-formula/overlay-views/types.d.ts +97 -0
  514. package/dist/with-formula/overlay-views/virtual-collection.d.ts +90 -0
  515. package/dist/with-formula/overlay-views/with-overlayed-view.d.ts +9 -0
  516. package/dist/with-lookup/aggregate/active.d.ts +33 -0
  517. package/dist/with-lookup/aggregate/aggregation.d.ts +166 -0
  518. package/dist/with-lookup/aggregate/canonical-key.d.ts +16 -0
  519. package/dist/with-lookup/aggregate/groupby.d.ts +280 -0
  520. package/dist/with-lookup/aggregate/index.d.ts +23 -0
  521. package/dist/with-lookup/aggregate/reducers.d.ts +257 -0
  522. package/dist/with-lookup/aggregate/strategy.d.ts +59 -0
  523. package/dist/with-lookup/embeddings/cosine.d.ts +2 -0
  524. package/dist/with-lookup/embeddings/descriptor.d.ts +8 -0
  525. package/dist/with-lookup/embeddings/index.d.ts +3 -0
  526. package/dist/with-lookup/embeddings/vector-set.d.ts +19 -0
  527. package/dist/with-lookup/indexing/active.d.ts +30 -0
  528. package/dist/with-lookup/indexing/collection-facade.d.ts +120 -0
  529. package/dist/with-lookup/indexing/eager-indexes.d.ts +122 -0
  530. package/dist/with-lookup/indexing/index.d.ts +27 -0
  531. package/dist/with-lookup/indexing/lazy-builder.d.ts +69 -0
  532. package/dist/with-lookup/indexing/persisted-indexes.d.ts +186 -0
  533. package/dist/with-lookup/indexing/strategy.d.ts +56 -0
  534. package/dist/with-lookup/indexing/unique-constraints.d.ts +74 -0
  535. package/dist/with-lookup/search/active.d.ts +10 -0
  536. package/dist/with-lookup/search/build-docs.d.ts +15 -0
  537. package/dist/with-lookup/search/collection-facade.d.ts +123 -0
  538. package/dist/with-lookup/search/fuse.d.ts +22 -0
  539. package/dist/with-lookup/search/index-store.d.ts +19 -0
  540. package/dist/with-lookup/search/index.d.ts +19 -0
  541. package/dist/with-lookup/search/inverted-index.d.ts +47 -0
  542. package/dist/with-lookup/search/persisted-index-store.d.ts +41 -0
  543. package/dist/with-lookup/search/retrieve-types.d.ts +29 -0
  544. package/dist/with-lookup/search/scan.d.ts +28 -0
  545. package/dist/with-lookup/search/segment.d.ts +15 -0
  546. package/dist/with-lookup/search/serialize.d.ts +4 -0
  547. package/dist/with-lookup/search/snippet.d.ts +5 -0
  548. package/dist/with-lookup/search/strategy.d.ts +37 -0
  549. package/dist/with-lookup/search/tokenize.d.ts +12 -0
  550. package/dist/with-party/auth-introspection/index.d.ts +44 -0
  551. package/dist/with-party/broker/active.d.ts +23 -0
  552. package/dist/with-party/broker/index.d.ts +28 -0
  553. package/dist/with-party/broker/seed.d.ts +77 -0
  554. package/dist/with-party/custody/active.d.ts +10 -0
  555. package/dist/with-party/custody/index.d.ts +69 -0
  556. package/dist/with-party/custody/liberate.d.ts +64 -0
  557. package/dist/with-party/custody/strategy.d.ts +48 -0
  558. package/dist/with-party/directory/index.d.ts +11 -0
  559. package/dist/with-party/directory/public-envelope/index.d.ts +12 -0
  560. package/dist/with-party/directory/public-envelope/schema.d.ts +24 -0
  561. package/dist/with-party/directory/public-envelope/storage.d.ts +59 -0
  562. package/dist/with-party/directory/public-envelope/types.d.ts +80 -0
  563. package/dist/with-party/directory/storage.d.ts +33 -0
  564. package/dist/with-party/directory/types.d.ts +43 -0
  565. package/dist/with-party/directory/user-envelope/api.d.ts +201 -0
  566. package/dist/with-party/directory/user-envelope/index.d.ts +12 -0
  567. package/dist/with-party/directory/user-envelope/storage.d.ts +54 -0
  568. package/dist/with-party/directory/visibility.d.ts +47 -0
  569. package/dist/with-party/policy/engine.d.ts +60 -0
  570. package/dist/with-party/policy/index.d.ts +15 -0
  571. package/dist/with-party/policy/noydb-facade.d.ts +39 -0
  572. package/dist/with-party/policy/presets.d.ts +38 -0
  573. package/dist/with-party/policy/storage.d.ts +31 -0
  574. package/dist/with-party/session/active.d.ts +34 -0
  575. package/dist/with-party/session/dev-unlock.d.ts +128 -0
  576. package/dist/with-party/session/index.d.ts +23 -0
  577. package/dist/with-party/session/session-policy.d.ts +92 -0
  578. package/dist/with-party/session/session.d.ts +131 -0
  579. package/dist/with-party/session/strategy.d.ts +42 -0
  580. package/dist/with-party/session/unlock-state.d.ts +47 -0
  581. package/dist/with-party/sync/index.d.ts +31 -0
  582. package/dist/with-party/tab-coordination.d.ts +73 -0
  583. package/dist/with-party/tab-write-relay.d.ts +39 -0
  584. package/dist/with-party/team/active.d.ts +13 -0
  585. package/dist/with-party/team/authenticators.d.ts +95 -0
  586. package/dist/with-party/team/deed.d.ts +97 -0
  587. package/dist/with-party/team/delegation.d.ts +88 -0
  588. package/dist/with-party/team/index.d.ts +38 -0
  589. package/dist/with-party/team/keyring.d.ts +318 -0
  590. package/dist/with-party/team/magic-link-grant.d.ts +152 -0
  591. package/dist/with-party/team/managed-passphrase.d.ts +280 -0
  592. package/dist/with-party/team/noydb-facade.d.ts +484 -0
  593. package/dist/with-party/team/peer-recover.d.ts +81 -0
  594. package/dist/with-party/team/presence.d.ts +81 -0
  595. package/dist/with-party/team/recovery.d.ts +191 -0
  596. package/dist/with-party/team/reserved-secret-collections.d.ts +41 -0
  597. package/dist/with-party/team/rotate-recover.d.ts +275 -0
  598. package/dist/with-party/team/shamir-recovery-provider.d.ts +15 -0
  599. package/dist/with-party/team/strategy.d.ts +9 -0
  600. package/dist/with-party/team/sync-active.d.ts +33 -0
  601. package/dist/with-party/team/sync-credentials.d.ts +113 -0
  602. package/dist/with-party/team/sync-strategy.d.ts +67 -0
  603. package/dist/with-party/team/sync-transaction.d.ts +39 -0
  604. package/dist/with-party/team/sync.d.ts +165 -0
  605. package/dist/with-party/team/tiers.d.ts +39 -0
  606. package/dist/with-party/team/wrapped-deks.d.ts +86 -0
  607. package/dist/with-pod/backup.d.ts +74 -0
  608. package/dist/with-pod/bundle.d.ts +414 -0
  609. package/dist/with-pod/format.d.ts +203 -0
  610. package/dist/with-pod/index.d.ts +20 -0
  611. package/dist/with-pod/pod-store.d.ts +54 -0
  612. package/dist/with-pod/ulid.d.ts +64 -0
  613. package/dist/with-shape/blobs/blob-compaction.d.ts +170 -0
  614. package/dist/with-shape/blobs/blob-set.d.ts +342 -0
  615. package/dist/with-shape/blobs/export-blobs.d.ts +110 -0
  616. package/dist/with-shape/blobs/import-external.d.ts +50 -0
  617. package/dist/with-shape/blobs/mime-magic.d.ts +48 -0
  618. package/dist/with-shape/blobs/object-projection.d.ts +70 -0
  619. package/dist/with-shape/introspection/describe.d.ts +237 -0
  620. package/dist/with-shape/introspection/field-meta.d.ts +61 -0
  621. package/dist/with-shape/introspection/fields.d.ts +14 -0
  622. package/dist/with-shape/introspection/index.d.ts +12 -0
  623. package/dist/with-shape/introspection/json-schema.d.ts +13 -0
  624. package/dist/with-shape/introspection/meta.d.ts +22 -0
  625. package/dist/with-shape/introspection/projection.d.ts +13 -0
  626. package/dist/with-shape/introspection/types.d.ts +154 -0
  627. package/dist/with-shape/introspection/walk.d.ts +50 -0
  628. package/dist/with-shape/links/lazy-handle.d.ts +36 -0
  629. package/dist/with-shape/links/link-set.d.ts +67 -0
  630. package/dist/with-shape/links/names.d.ts +65 -0
  631. package/dist/with-shape/links/vault-facade.d.ts +211 -0
  632. package/dist/with-shape/persisted-schemas/canonicalize.d.ts +11 -0
  633. package/dist/with-shape/persisted-schemas/derive.d.ts +29 -0
  634. package/dist/with-shape/persisted-schemas/index.d.ts +21 -0
  635. package/dist/with-shape/persisted-schemas/register.d.ts +66 -0
  636. package/dist/with-shape/persisted-schemas/storage.d.ts +61 -0
  637. package/dist/with-shape/persisted-schemas/types.d.ts +54 -0
  638. package/dist/with-shape/satellites/dead-filter.d.ts +21 -0
  639. package/dist/with-shape/satellites/declare.d.ts +60 -0
  640. package/dist/with-shape/satellites/existence.d.ts +5 -0
  641. package/dist/with-shape/satellites/fanout.d.ts +37 -0
  642. package/dist/with-shape/satellites/forget.d.ts +47 -0
  643. package/dist/with-shape/satellites/index.d.ts +3 -0
  644. package/dist/with-shape/satellites/joined.d.ts +19 -0
  645. package/dist/with-shape/satellites/marker.d.ts +10 -0
  646. package/dist/with-shape/satellites/post-register.d.ts +6 -0
  647. package/dist/with-shape/satellites/proxy.d.ts +37 -0
  648. package/dist/with-shape/satellites/raw-target.d.ts +14 -0
  649. package/dist/with-shape/satellites/registry.d.ts +19 -0
  650. package/dist/with-shape/satellites/types.d.ts +26 -0
  651. package/dist/with-shape/satellites/validate.d.ts +17 -0
  652. package/dist/with-shape/schema-update/client-registry.d.ts +35 -0
  653. package/dist/with-shape/schema-update/cutover.d.ts +5 -0
  654. package/dist/with-shape/schema-update/delta.d.ts +2 -0
  655. package/dist/with-shape/schema-update/dispatch.d.ts +3 -0
  656. package/dist/with-shape/schema-update/fence-controller.d.ts +62 -0
  657. package/dist/with-shape/schema-update/fence-watcher.d.ts +37 -0
  658. package/dist/with-shape/schema-update/fence.d.ts +15 -0
  659. package/dist/with-shape/schema-update/gate.d.ts +16 -0
  660. package/dist/with-shape/schema-update/index.d.ts +6 -0
  661. package/dist/with-shape/schema-update/store-coordination-provider.d.ts +29 -0
  662. package/dist/with-shape/schema-update/strategies.d.ts +12 -0
  663. package/dist/with-shape/schema-update/types.d.ts +53 -0
  664. package/dist/with-store/index.d.ts +15 -0
  665. package/dist/with-store/lazy/active.d.ts +12 -0
  666. package/dist/with-store/lazy/index.d.ts +14 -0
  667. package/dist/with-store/lazy/strategy.d.ts +9 -0
  668. package/dist/with-store/route-store.d.ts +259 -0
  669. package/dist/with-store/store-middleware.d.ts +189 -0
  670. package/dist/withdraw-accessible-CLMZEHQT.js +28 -0
  671. package/dist/withdraw-accessible-CLMZEHQT.js.map +1 -0
  672. package/package.json +56 -52
  673. package/dist/adapter/index.d.ts +0 -5
  674. package/dist/adapter/index.js +0 -15
  675. package/dist/aggregate/index.d.ts +0 -42
  676. package/dist/api-RW3KP7WU.js +0 -14
  677. package/dist/as/index.d.ts +0 -7
  678. package/dist/at/index.d.ts +0 -5
  679. package/dist/attestation/index.d.ts +0 -20
  680. package/dist/backup-XV3IOEGB.js +0 -217
  681. package/dist/backup-XV3IOEGB.js.map +0 -1
  682. package/dist/blobs/index.d.ts +0 -44
  683. package/dist/bundle/index.d.ts +0 -122
  684. package/dist/bundle-CH-H06dp.d.ts +0 -548
  685. package/dist/by/index.d.ts +0 -1
  686. package/dist/cargo/index.d.ts +0 -9
  687. package/dist/chunk-26LGBE4T.js +0 -42
  688. package/dist/chunk-26LGBE4T.js.map +0 -1
  689. package/dist/chunk-2P2HZEXU.js +0 -233
  690. package/dist/chunk-2P2HZEXU.js.map +0 -1
  691. package/dist/chunk-3YFXJ3ZP.js +0 -97
  692. package/dist/chunk-5LUY7UTV.js +0 -380
  693. package/dist/chunk-5LUY7UTV.js.map +0 -1
  694. package/dist/chunk-5N6CZTCY.js +0 -367
  695. package/dist/chunk-5O3AOPDT.js +0 -992
  696. package/dist/chunk-5O3AOPDT.js.map +0 -1
  697. package/dist/chunk-5R3ERCDH.js +0 -239
  698. package/dist/chunk-5R3ERCDH.js.map +0 -1
  699. package/dist/chunk-5R5JW2JT.js +0 -12502
  700. package/dist/chunk-5R5JW2JT.js.map +0 -1
  701. package/dist/chunk-5TDJ56JE.js +0 -32
  702. package/dist/chunk-5TDJ56JE.js.map +0 -1
  703. package/dist/chunk-62QYRORB.js +0 -320
  704. package/dist/chunk-62QYRORB.js.map +0 -1
  705. package/dist/chunk-6S7T6WC4.js +0 -111
  706. package/dist/chunk-6S7T6WC4.js.map +0 -1
  707. package/dist/chunk-76722EBH.js +0 -451
  708. package/dist/chunk-76722EBH.js.map +0 -1
  709. package/dist/chunk-AIWULCUO.js +0 -68
  710. package/dist/chunk-AIWULCUO.js.map +0 -1
  711. package/dist/chunk-AQTBSL7R.js +0 -181
  712. package/dist/chunk-AQTBSL7R.js.map +0 -1
  713. package/dist/chunk-AXRXJTE2.js +0 -59
  714. package/dist/chunk-AZAOEIKW.js +0 -155
  715. package/dist/chunk-BG3SPSR4.js +0 -53
  716. package/dist/chunk-BG3SPSR4.js.map +0 -1
  717. package/dist/chunk-BGIZAFY7.js +0 -1
  718. package/dist/chunk-CMGR4ZEW.js +0 -209
  719. package/dist/chunk-CWPPNPOH.js +0 -23
  720. package/dist/chunk-DFEMTNPJ.js +0 -1219
  721. package/dist/chunk-DFEMTNPJ.js.map +0 -1
  722. package/dist/chunk-DGDI2D4M.js +0 -79
  723. package/dist/chunk-DGDI2D4M.js.map +0 -1
  724. package/dist/chunk-EIZUR2XW.js +0 -36
  725. package/dist/chunk-FISN7WE4.js +0 -798
  726. package/dist/chunk-FISN7WE4.js.map +0 -1
  727. package/dist/chunk-GYGWYIOZ.js +0 -200
  728. package/dist/chunk-GYGWYIOZ.js.map +0 -1
  729. package/dist/chunk-HCIPRAGS.js +0 -45
  730. package/dist/chunk-I2NOIW44.js +0 -83
  731. package/dist/chunk-I2NOIW44.js.map +0 -1
  732. package/dist/chunk-I3TIKTJO.js +0 -132
  733. package/dist/chunk-I3TIKTJO.js.map +0 -1
  734. package/dist/chunk-IAGBDSCS.js +0 -40
  735. package/dist/chunk-IELYAOGG.js +0 -78
  736. package/dist/chunk-IELYAOGG.js.map +0 -1
  737. package/dist/chunk-IGUYVGGI.js +0 -205
  738. package/dist/chunk-IO6GRPT6.js +0 -34
  739. package/dist/chunk-IPB7FTQX.js +0 -273
  740. package/dist/chunk-IPB7FTQX.js.map +0 -1
  741. package/dist/chunk-ITNUCOXM.js +0 -148
  742. package/dist/chunk-ITNUCOXM.js.map +0 -1
  743. package/dist/chunk-IUEN57TV.js +0 -722
  744. package/dist/chunk-IUEN57TV.js.map +0 -1
  745. package/dist/chunk-JNUWZ6D3.js +0 -57
  746. package/dist/chunk-JNUWZ6D3.js.map +0 -1
  747. package/dist/chunk-K2WCO3NX.js +0 -1
  748. package/dist/chunk-KVOXU4T5.js +0 -30
  749. package/dist/chunk-KXGNJJXB.js +0 -135
  750. package/dist/chunk-LFLXAY2W.js +0 -414
  751. package/dist/chunk-LFLXAY2W.js.map +0 -1
  752. package/dist/chunk-LMTH2RM6.js +0 -129
  753. package/dist/chunk-LV7M27WM.js +0 -702
  754. package/dist/chunk-LV7M27WM.js.map +0 -1
  755. package/dist/chunk-LXQT4WMP.js +0 -684
  756. package/dist/chunk-LXQT4WMP.js.map +0 -1
  757. package/dist/chunk-M2YKN37S.js +0 -524
  758. package/dist/chunk-M2YKN37S.js.map +0 -1
  759. package/dist/chunk-M6OST55S.js +0 -14
  760. package/dist/chunk-MD3Y6J3L.js +0 -278
  761. package/dist/chunk-MD3Y6J3L.js.map +0 -1
  762. package/dist/chunk-MTMJVJ5W.js +0 -73
  763. package/dist/chunk-MTMJVJ5W.js.map +0 -1
  764. package/dist/chunk-NF5JWERG.js +0 -74
  765. package/dist/chunk-PKHL44ER.js +0 -124
  766. package/dist/chunk-PSMV73A5.js +0 -117
  767. package/dist/chunk-Q7SS3IME.js +0 -120
  768. package/dist/chunk-Q7SS3IME.js.map +0 -1
  769. package/dist/chunk-QHJW5EXU.js +0 -54
  770. package/dist/chunk-RUEKROOS.js +0 -80
  771. package/dist/chunk-RUIMKQTA.js +0 -23
  772. package/dist/chunk-RUIMKQTA.js.map +0 -1
  773. package/dist/chunk-SKF73JOP.js +0 -355
  774. package/dist/chunk-SM3AVUHC.js +0 -42
  775. package/dist/chunk-SMXWYP24.js +0 -155
  776. package/dist/chunk-SRB2XEWB.js +0 -148
  777. package/dist/chunk-SRB2XEWB.js.map +0 -1
  778. package/dist/chunk-TA66UMI4.js +0 -123
  779. package/dist/chunk-TEILUWOI.js +0 -664
  780. package/dist/chunk-TEILUWOI.js.map +0 -1
  781. package/dist/chunk-TJYQIGAP.js +0 -82
  782. package/dist/chunk-TJYQIGAP.js.map +0 -1
  783. package/dist/chunk-UAG5KWVA.js +0 -367
  784. package/dist/chunk-UDRIWL7A.js +0 -382
  785. package/dist/chunk-UIU2THRG.js +0 -1937
  786. package/dist/chunk-UIU2THRG.js.map +0 -1
  787. package/dist/chunk-UPJNJGGA.js +0 -572
  788. package/dist/chunk-UPJNJGGA.js.map +0 -1
  789. package/dist/chunk-UV5MFVO3.js +0 -21
  790. package/dist/chunk-V7RWQRG7.js +0 -430
  791. package/dist/chunk-VCTFO5CO.js +0 -71
  792. package/dist/chunk-VFQGRQIH.js +0 -97
  793. package/dist/chunk-VFQGRQIH.js.map +0 -1
  794. package/dist/chunk-WWGT2MDV.js +0 -762
  795. package/dist/chunk-WWGT2MDV.js.map +0 -1
  796. package/dist/chunk-WYSO2NIH.js +0 -30
  797. package/dist/chunk-XXYIOFUB.js +0 -164
  798. package/dist/chunk-Y22T3KQE.js +0 -261
  799. package/dist/chunk-Y22T3KQE.js.map +0 -1
  800. package/dist/chunk-ZCGAHGUS.js +0 -230
  801. package/dist/chunk-ZYUC53LT.js +0 -1370
  802. package/dist/chunk-ZYUC53LT.js.map +0 -1
  803. package/dist/collection-facade-GQAOGJP2.js +0 -33
  804. package/dist/consent/index.d.ts +0 -23
  805. package/dist/crdt/index.d.ts +0 -34
  806. package/dist/decrypt-partition-IHtxEnTi.d.ts +0 -21
  807. package/dist/delegation-UL5HKLER.js +0 -19
  808. package/dist/derivations/index.d.ts +0 -70
  809. package/dist/describe/index.d.ts +0 -1
  810. package/dist/describe/index.js +0 -1
  811. package/dist/describe-aBkJR2sd.d.ts +0 -131
  812. package/dist/dev-unlock-C9Ro3v_O.d.ts +0 -263
  813. package/dist/discriminant-BN9REW3o.d.ts +0 -60
  814. package/dist/enclave-UL5LW66V.js +0 -88
  815. package/dist/executor-2FWQRLMG.js +0 -15
  816. package/dist/executor-QZ7BXICW.js +0 -9
  817. package/dist/executor-Z5ZLJVTV.js +0 -9
  818. package/dist/export-accessible-KRV5W4GH.js +0 -17
  819. package/dist/extract-partition-GLKBOXFQ.js +0 -30
  820. package/dist/fanout-sidecar-GF3DJ6KR.js +0 -71
  821. package/dist/fanout-sidecar-GF3DJ6KR.js.map +0 -1
  822. package/dist/forget/index.d.ts +0 -36
  823. package/dist/guards/index.d.ts +0 -35
  824. package/dist/hash-Cp5uwiox.d.ts +0 -67
  825. package/dist/history/index.d.ts +0 -61
  826. package/dist/i18n/index.d.ts +0 -37
  827. package/dist/in/index.d.ts +0 -5
  828. package/dist/index-B9QdHytu.d.ts +0 -123
  829. package/dist/index-BF9_96A5.d.ts +0 -123
  830. package/dist/index-BzUo1B6n.d.ts +0 -20730
  831. package/dist/indexing/index.d.ts +0 -39
  832. package/dist/issue-Y6UVIR43.js +0 -13
  833. package/dist/kernel/index.d.ts +0 -32
  834. package/dist/kernel/index.js +0 -53
  835. package/dist/ledger-RYI35CDS.js +0 -36
  836. package/dist/liberate-CRPZEV7O.js +0 -18
  837. package/dist/materialized-views/index.d.ts +0 -173
  838. package/dist/mime-magic-CGhw37_E.d.ts +0 -103
  839. package/dist/noydb-367AM4HT.js +0 -50
  840. package/dist/on/index.d.ts +0 -5
  841. package/dist/overlay-views/index.d.ts +0 -98
  842. package/dist/periods/index.d.ts +0 -20
  843. package/dist/pod/index.d.ts +0 -63
  844. package/dist/policy-IXK4FVXP.js +0 -41
  845. package/dist/portability/index.d.ts +0 -20
  846. package/dist/public-envelope-JHDQCPSX.js +0 -32
  847. package/dist/query/index.d.ts +0 -5
  848. package/dist/read-only-facade-5ADRJVTM.js +0 -8
  849. package/dist/registry-45RJNWGU.js +0 -9
  850. package/dist/registry-5GRV5VXI.js +0 -13
  851. package/dist/registry-WEUCHBO4.js +0 -11
  852. package/dist/request-withdrawal-GBPH2FDY.js +0 -25
  853. package/dist/revoke-TUFRGI6S.js +0 -18
  854. package/dist/sealed-record/index.d.ts +0 -69
  855. package/dist/session/index.d.ts +0 -44
  856. package/dist/shadow/index.d.ts +0 -15
  857. package/dist/signer-PNKTBVF7.js +0 -19
  858. package/dist/snapshots/index.d.ts +0 -26
  859. package/dist/stale-3JWHNDIY.js +0 -14
  860. package/dist/store-coordination-provider-3I7XWZZK.js +0 -142
  861. package/dist/subject-index-O75wKshW.d.ts +0 -362
  862. package/dist/sync/index.d.ts +0 -41
  863. package/dist/team/index.d.ts +0 -116
  864. package/dist/tiers/index.d.ts +0 -5
  865. package/dist/to/index.d.ts +0 -5
  866. package/dist/transition-guard-C7ol6oPw.d.ts +0 -165
  867. package/dist/tx/index.d.ts +0 -35
  868. package/dist/ui/index.d.ts +0 -1
  869. package/dist/ulid-DRH25k3y.d.ts +0 -66
  870. package/dist/util/index.d.ts +0 -79
  871. package/dist/vault-diff-B5fYNBL7.d.ts +0 -147
  872. package/dist/with/index.d.ts +0 -38
  873. package/dist/with-materialized-view-6p0Fk8bL.d.ts +0 -27
  874. package/dist/with-overlayed-view-BJ6mXGMd.d.ts +0 -12
  875. package/dist/with-rollup-BvQo3ROo.d.ts +0 -47
  876. package/dist/withdraw-accessible-FFS46EOD.js +0 -22
  877. /package/dist/{adapter/index.js.map → api-YGMINAET.js.map} +0 -0
  878. /package/dist/{chunk-V7RWQRG7.js.map → chunk-3CNQ7FQ3.js.map} +0 -0
  879. /package/dist/{chunk-NF5JWERG.js.map → chunk-3MSQLQNZ.js.map} +0 -0
  880. /package/dist/{chunk-IO6GRPT6.js.map → chunk-4R4Q64W5.js.map} +0 -0
  881. /package/dist/{chunk-SMXWYP24.js.map → chunk-5XIPOCQC.js.map} +0 -0
  882. /package/dist/{chunk-IGUYVGGI.js.map → chunk-6QILBDZU.js.map} +0 -0
  883. /package/dist/{chunk-AZAOEIKW.js.map → chunk-7E67FJ33.js.map} +0 -0
  884. /package/dist/{chunk-PSMV73A5.js.map → chunk-7NS43EXZ.js.map} +0 -0
  885. /package/dist/{chunk-CMGR4ZEW.js.map → chunk-A2Y6YFVN.js.map} +0 -0
  886. /package/dist/{chunk-HCIPRAGS.js.map → chunk-BCYQA5BK.js.map} +0 -0
  887. /package/dist/{chunk-LMTH2RM6.js.map → chunk-CB25ONKC.js.map} +0 -0
  888. /package/dist/{chunk-UV5MFVO3.js.map → chunk-CIKY6I4W.js.map} +0 -0
  889. /package/dist/{chunk-QHJW5EXU.js.map → chunk-D26JB3LZ.js.map} +0 -0
  890. /package/dist/{chunk-SM3AVUHC.js.map → chunk-DIRRS7WP.js.map} +0 -0
  891. /package/dist/{chunk-SKF73JOP.js.map → chunk-H44ZE4IE.js.map} +0 -0
  892. /package/dist/{chunk-UDRIWL7A.js.map → chunk-HFJIGWJC.js.map} +0 -0
  893. /package/dist/{chunk-ZCGAHGUS.js.map → chunk-KPGX66PM.js.map} +0 -0
  894. /package/dist/{chunk-5N6CZTCY.js.map → chunk-MCEKIAO4.js.map} +0 -0
  895. /package/dist/{chunk-CWPPNPOH.js.map → chunk-O2DYPAZY.js.map} +0 -0
  896. /package/dist/{chunk-KVOXU4T5.js.map → chunk-ODJWBC5I.js.map} +0 -0
  897. /package/dist/{chunk-VCTFO5CO.js.map → chunk-OFJ5GPNA.js.map} +0 -0
  898. /package/dist/{chunk-KXGNJJXB.js.map → chunk-PXWVF7MC.js.map} +0 -0
  899. /package/dist/{chunk-IAGBDSCS.js.map → chunk-Q3XSMOZM.js.map} +0 -0
  900. /package/dist/{chunk-AXRXJTE2.js.map → chunk-RKRGDAS7.js.map} +0 -0
  901. /package/dist/{chunk-XXYIOFUB.js.map → chunk-SRVQHVNX.js.map} +0 -0
  902. /package/dist/{chunk-M6OST55S.js.map → chunk-UFILRICG.js.map} +0 -0
  903. /package/dist/{chunk-3YFXJ3ZP.js.map → chunk-UTLEAJXC.js.map} +0 -0
  904. /package/dist/{chunk-TA66UMI4.js.map → chunk-VA4ZWLFY.js.map} +0 -0
  905. /package/dist/{chunk-UAG5KWVA.js.map → chunk-VR24ILCR.js.map} +0 -0
  906. /package/dist/{chunk-WYSO2NIH.js.map → chunk-XHV25KBM.js.map} +0 -0
  907. /package/dist/{chunk-PKHL44ER.js.map → chunk-YSXEFGND.js.map} +0 -0
  908. /package/dist/{chunk-EIZUR2XW.js.map → chunk-YXOUQ2H7.js.map} +0 -0
  909. /package/dist/{chunk-RUEKROOS.js.map → chunk-ZP5PL65C.js.map} +0 -0
  910. /package/dist/{describe → classified}/index.js.map +0 -0
  911. /package/dist/{api-RW3KP7WU.js.map → collection-facade-YE2O4J4O.js.map} +0 -0
  912. /package/dist/{chunk-BGIZAFY7.js.map → computed-W6MVAMWZ.js.map} +0 -0
  913. /package/dist/{chunk-K2WCO3NX.js.map → delegation-OPUU3R2E.js.map} +0 -0
  914. /package/dist/{collection-facade-GQAOGJP2.js.map → derive-BGUHU663.js.map} +0 -0
  915. /package/dist/{delegation-UL5HKLER.js.map → enclave-VXAQD4XJ.js.map} +0 -0
  916. /package/dist/{enclave-UL5LW66V.js.map → executor-GTVSUUBX.js.map} +0 -0
  917. /package/dist/{executor-2FWQRLMG.js.map → executor-GZWMTOXB.js.map} +0 -0
  918. /package/dist/{executor-QZ7BXICW.js.map → executor-XXGS4S3K.js.map} +0 -0
  919. /package/dist/{executor-Z5ZLJVTV.js.map → export-accessible-BMULIOYB.js.map} +0 -0
  920. /package/dist/{export-accessible-KRV5W4GH.js.map → extract-partition-JUQTWDXR.js.map} +0 -0
  921. /package/dist/{extract-partition-GLKBOXFQ.js.map → find-XRGCNGNN.js.map} +0 -0
  922. /package/dist/{issue-Y6UVIR43.js.map → issue-UB6AA5M6.js.map} +0 -0
  923. /package/dist/{kernel → lazy}/index.js.map +0 -0
  924. /package/dist/{ledger-RYI35CDS.js.map → ledger-FU6GH5EH.js.map} +0 -0
  925. /package/dist/{liberate-CRPZEV7O.js.map → liberate-YUN7W5QG.js.map} +0 -0
  926. /package/dist/{noydb-367AM4HT.js.map → link-set-MNADSH5M.js.map} +0 -0
  927. /package/dist/{policy-IXK4FVXP.js.map → noydb-6JLBZU4U.js.map} +0 -0
  928. /package/dist/{public-envelope-JHDQCPSX.js.map → policy-JTFOPPUU.js.map} +0 -0
  929. /package/dist/{read-only-facade-5ADRJVTM.js.map → public-envelope-NJVB7LPA.js.map} +0 -0
  930. /package/dist/{registry-45RJNWGU.js.map → read-only-facade-CHCKSEPD.js.map} +0 -0
  931. /package/dist/{registry-5GRV5VXI.js.map → register-VCKOBWKT.js.map} +0 -0
  932. /package/dist/{registry-WEUCHBO4.js.map → registry-72UKJ2L4.js.map} +0 -0
  933. /package/dist/{request-withdrawal-GBPH2FDY.js.map → registry-BZFLJNEH.js.map} +0 -0
  934. /package/dist/{revoke-TUFRGI6S.js.map → registry-YJEYSYI5.js.map} +0 -0
  935. /package/dist/{signer-PNKTBVF7.js.map → request-withdrawal-6MJRMFHF.js.map} +0 -0
  936. /package/dist/{stale-3JWHNDIY.js.map → revoke-4KUNSVJC.js.map} +0 -0
  937. /package/dist/{withdraw-accessible-FFS46EOD.js.map → satellites/index.js.map} +0 -0
  938. /package/dist/{store-coordination-provider-3I7XWZZK.js.map → store-coordination-provider-HPYVFJCV.js.map} +0 -0
package/dist/index.js CHANGED
@@ -1,19 +1,7 @@
1
- import {
2
- DEFAULT_FRESHNESS_MS,
3
- PERSONAL_POLICY,
4
- STRICT_POLICY,
5
- checkGate,
6
- describeGate,
7
- mergePolicy
8
- } from "./chunk-5N6CZTCY.js";
9
1
  import {
10
2
  Collection,
11
- ComputedFieldError,
12
3
  ELEVATION_AUDIT_COLLECTION,
13
4
  ElevatedHandle,
14
- LinkEndpointError,
15
- LinkIntegrityError,
16
- Lru,
17
5
  Noydb,
18
6
  QuickUnlockStore,
19
7
  RefIntegrityError,
@@ -21,35 +9,25 @@ import {
21
9
  RefScopeError,
22
10
  Vault,
23
11
  createNoydb,
24
- derivePersistedSchema,
25
12
  describeAllUsersAuth,
26
13
  describeAuthConfig,
27
14
  describeUserAuth,
28
15
  diagramAuthConfig,
29
- estimateRecordBytes,
30
- evalComputedFields,
31
- isLinkCollectionName,
32
16
  isRefArray,
33
- isZodSchema,
17
+ isViaFieldSpec,
34
18
  memoryStore,
35
- parseBytes,
36
- persistSchemaIfNeeded,
37
19
  ref,
38
20
  refArray,
21
+ via,
39
22
  withArchive
40
- } from "./chunk-5R5JW2JT.js";
41
- import {
42
- META_COLLECTION,
43
- POLICY_RECORD_ID,
44
- loadVaultPolicy,
45
- saveVaultPolicy
46
- } from "./chunk-SM3AVUHC.js";
23
+ } from "./chunk-A2QF4JUE.js";
47
24
  import {
48
25
  DELEGATIONS_COLLECTION,
49
26
  issueDelegation,
50
27
  loadActiveDelegations,
51
28
  revokeDelegation
52
- } from "./chunk-VFQGRQIH.js";
29
+ } from "./chunk-IDIV5NVH.js";
30
+ import "./chunk-VYYM3MEN.js";
53
31
  import {
54
32
  DEFAULT_PUBLIC_ENVELOPE_SCHEMA,
55
33
  PUBLIC_ENVELOPE_FIELDS,
@@ -61,113 +39,214 @@ import {
61
39
  compileSequenceFormat,
62
40
  resolveSequenceKey,
63
41
  withSequence
64
- } from "./chunk-GYGWYIOZ.js";
42
+ } from "./chunk-5JB73NMC.js";
65
43
  import {
66
44
  UserApi
67
- } from "./chunk-UDRIWL7A.js";
45
+ } from "./chunk-HFJIGWJC.js";
68
46
  import {
69
- WithdrawalRequestError,
70
- approveWithdrawal,
71
- listWithdrawalRequests,
72
- rejectWithdrawal,
73
- requestWithdrawal
74
- } from "./chunk-XXYIOFUB.js";
75
- import "./chunk-IAGBDSCS.js";
47
+ DEFAULT_FRESHNESS_MS,
48
+ PERSONAL_POLICY,
49
+ STRICT_POLICY,
50
+ checkGate,
51
+ describeGate,
52
+ mergePolicy
53
+ } from "./chunk-MCEKIAO4.js";
54
+ import {
55
+ META_COLLECTION,
56
+ POLICY_RECORD_ID,
57
+ loadVaultPolicy,
58
+ saveVaultPolicy
59
+ } from "./chunk-DIRRS7WP.js";
60
+ import {
61
+ LinkEndpointError
62
+ } from "./chunk-57V5S7PW.js";
63
+ import {
64
+ LinkIntegrityError,
65
+ isLinkCollectionName
66
+ } from "./chunk-AWB5JZW6.js";
67
+ import "./chunk-7ITPJFGC.js";
68
+ import {
69
+ persistSchemaIfNeeded
70
+ } from "./chunk-WGV4CUZT.js";
71
+ import "./chunk-Q3XSMOZM.js";
76
72
  import {
77
73
  NO_SEARCH,
78
74
  tokenize,
79
75
  withSearch
80
- } from "./chunk-TEILUWOI.js";
81
- import "./chunk-5R3ERCDH.js";
76
+ } from "./chunk-P5RY4ZWD.js";
82
77
  import {
83
- isDiscriminant
84
- } from "./chunk-PY4KJPYU.js";
85
- import "./chunk-WYSO2NIH.js";
86
- import "./chunk-IPB7FTQX.js";
87
- import "./chunk-KVOXU4T5.js";
78
+ derivePersistedSchema,
79
+ isZodSchema
80
+ } from "./chunk-QLLKLFE2.js";
81
+ import {
82
+ ComputedFieldError,
83
+ evalComputedFields
84
+ } from "./chunk-45ZZLTFH.js";
85
+ import "./chunk-GYGLAVCX.js";
86
+ import {
87
+ WithdrawalRequestError,
88
+ approveWithdrawal,
89
+ listWithdrawalRequests,
90
+ rejectWithdrawal,
91
+ requestWithdrawal
92
+ } from "./chunk-SRVQHVNX.js";
88
93
  import {
89
94
  withCargo
90
- } from "./chunk-M6OST55S.js";
95
+ } from "./chunk-UFILRICG.js";
91
96
  import {
92
97
  CustodyApi,
93
98
  NO_CARGO,
94
99
  NO_CUSTODY,
95
100
  withCustody
96
- } from "./chunk-TJYQIGAP.js";
101
+ } from "./chunk-BZO4WCJI.js";
97
102
  import {
98
103
  DEED_RECORD_ID,
99
104
  createDeedOwner,
100
105
  isDeedVault,
101
106
  liberateVault,
102
107
  loadDeedMarker
103
- } from "./chunk-KXGNJJXB.js";
108
+ } from "./chunk-PXWVF7MC.js";
109
+ import {
110
+ fuseRetrieval
111
+ } from "./chunk-AURFOK3D.js";
112
+ import {
113
+ diffVault
114
+ } from "./chunk-LB7FD65R.js";
104
115
  import {
105
116
  withdrawAccessibleData
106
- } from "./chunk-PSMV73A5.js";
117
+ } from "./chunk-7NS43EXZ.js";
107
118
  import {
108
119
  exportAccessibleData
109
- } from "./chunk-HCIPRAGS.js";
120
+ } from "./chunk-BCYQA5BK.js";
121
+ import "./chunk-JOQ53DMI.js";
122
+ import "./chunk-D26JB3LZ.js";
110
123
  import {
111
- diffVault
112
- } from "./chunk-LB7FD65R.js";
113
- import "./chunk-BGIZAFY7.js";
124
+ withOverlayedView
125
+ } from "./chunk-YXOUQ2H7.js";
126
+ import "./chunk-A2Y6YFVN.js";
127
+ import "./chunk-OFJ5GPNA.js";
114
128
  import {
115
- fuseRetrieval
116
- } from "./chunk-AURFOK3D.js";
117
- import "./chunk-QHJW5EXU.js";
129
+ isDiscriminant
130
+ } from "./chunk-PY4KJPYU.js";
131
+ import "./chunk-XHV25KBM.js";
132
+ import {
133
+ classified,
134
+ luhnCheck
135
+ } from "./chunk-DMFNPHCX.js";
136
+ import {
137
+ ClassifiedNeverStoredError,
138
+ ClassifiedValidationError,
139
+ isClassifiedFieldSpec,
140
+ isClassifiedGroup,
141
+ resolveClassifiedFields
142
+ } from "./chunk-PR5LC5YX.js";
143
+ import "./chunk-H6HM6CVR.js";
144
+ import "./chunk-ODJWBC5I.js";
145
+ import {
146
+ CONSENT_AUDIT_COLLECTION
147
+ } from "./chunk-C3YH34IL.js";
148
+ import "./chunk-O2DYPAZY.js";
149
+ import {
150
+ PERIODS_COLLECTION
151
+ } from "./chunk-FXK4X4BL.js";
152
+ import "./chunk-GHVIKOHT.js";
118
153
  import {
119
154
  immutableGuard,
120
155
  transitionGuard,
121
156
  withGuard
122
- } from "./chunk-TA66UMI4.js";
157
+ } from "./chunk-VA4ZWLFY.js";
123
158
  import "./chunk-YMUGBZN2.js";
124
- import "./chunk-RUIMKQTA.js";
125
- import "./chunk-RUEKROOS.js";
159
+ import "./chunk-JK733I5V.js";
160
+ import "./chunk-ZP5PL65C.js";
126
161
  import {
127
162
  CollectionFrame,
128
163
  VaultFrame
129
- } from "./chunk-NF5JWERG.js";
164
+ } from "./chunk-3MSQLQNZ.js";
130
165
  import {
131
166
  TxCollection,
132
167
  TxContext,
133
168
  TxVault,
134
169
  runTransaction
135
- } from "./chunk-SKF73JOP.js";
170
+ } from "./chunk-H44ZE4IE.js";
136
171
  import {
137
172
  withDerivation,
138
173
  withRollup
139
- } from "./chunk-LMTH2RM6.js";
140
- import "./chunk-Q7SS3IME.js";
141
- import "./chunk-PKHL44ER.js";
174
+ } from "./chunk-CB25ONKC.js";
175
+ import "./chunk-BEIRE5K4.js";
176
+ import "./chunk-7QIXUSDQ.js";
177
+ import "./chunk-YSXEFGND.js";
142
178
  import {
143
179
  withMaterializedView
144
- } from "./chunk-3YFXJ3ZP.js";
145
- import "./chunk-AQTBSL7R.js";
146
- import "./chunk-62QYRORB.js";
147
- import "./chunk-BG3SPSR4.js";
180
+ } from "./chunk-UTLEAJXC.js";
181
+ import "./chunk-2JMMY7HZ.js";
148
182
  import {
149
- withOverlayedView
150
- } from "./chunk-EIZUR2XW.js";
151
- import "./chunk-CMGR4ZEW.js";
152
- import "./chunk-VCTFO5CO.js";
183
+ buildLookupSnapshot
184
+ } from "./chunk-DGH65E7Q.js";
185
+ import "./chunk-3G4KMVUN.js";
186
+ import "./chunk-TPH5EO6L.js";
187
+ import {
188
+ DEFAULT_CROSS_JOIN_MAX_ROWS,
189
+ DEFAULT_JOIN_MAX_ROWS,
190
+ Query,
191
+ ScanBuilder,
192
+ applyJoins,
193
+ buildLiveQuery,
194
+ executePlan,
195
+ resetJoinWarnings
196
+ } from "./chunk-H6CZSDWK.js";
153
197
  import {
154
198
  importExternalObjects,
155
199
  memoryObjectProjection
156
200
  } from "./chunk-4Q6HSHHL.js";
157
- import "./chunk-Y22T3KQE.js";
158
- import "./chunk-V7RWQRG7.js";
201
+ import "./chunk-QYPKGVT4.js";
202
+ import "./chunk-3CNQ7FQ3.js";
203
+ import {
204
+ CollectionIndexes
205
+ } from "./chunk-KPZS5QAQ.js";
206
+ import {
207
+ withLazy
208
+ } from "./chunk-THNJ3IKU.js";
209
+ import {
210
+ Lru,
211
+ estimateRecordBytes,
212
+ parseBytes
213
+ } from "./chunk-NO272T7Q.js";
214
+ import {
215
+ Aggregation,
216
+ GROUPBY_MAX_CARDINALITY,
217
+ GROUPBY_WARN_CARDINALITY,
218
+ GroupedAggregation,
219
+ GroupedQuery,
220
+ GroupedQueryN,
221
+ avg,
222
+ count,
223
+ groupAndReduce,
224
+ max,
225
+ min,
226
+ moneyMax,
227
+ moneyMin,
228
+ moneySum,
229
+ reduceRecords,
230
+ reducerBuilder,
231
+ sum
232
+ } from "./chunk-IGJHJYM6.js";
233
+ import {
234
+ evaluateClause,
235
+ evaluateFieldClause,
236
+ readPath
237
+ } from "./chunk-IGJCYUT5.js";
159
238
  import {
160
239
  mergeCrdtStates,
161
240
  resolveCrdtSnapshot
162
- } from "./chunk-6S7T6WC4.js";
241
+ } from "./chunk-4GPE63GU.js";
163
242
  import {
164
243
  decryptExtractedPartition
165
- } from "./chunk-2P2HZEXU.js";
244
+ } from "./chunk-GA2QHD6P.js";
166
245
  import {
167
246
  SCHEMAS_COLLECTION,
168
247
  loadPersistedSchema,
169
248
  savePersistedSchema
170
- } from "./chunk-26LGBE4T.js";
249
+ } from "./chunk-C7NTK5I3.js";
171
250
  import {
172
251
  MemoryRecipientSealer,
173
252
  MemorySealingKeyProvider,
@@ -178,7 +257,7 @@ import {
178
257
  parseSealedEnvelope,
179
258
  saveSealedPassphrase,
180
259
  sealRsaOaepTlv
181
- } from "./chunk-ZCGAHGUS.js";
260
+ } from "./chunk-KPGX66PM.js";
182
261
  import {
183
262
  BLOB_CHUNKS_COLLECTION,
184
263
  BLOB_COLLECTION,
@@ -190,13 +269,13 @@ import {
190
269
  detectMagic,
191
270
  detectMimeType,
192
271
  isPreCompressed
193
- } from "./chunk-DFEMTNPJ.js";
272
+ } from "./chunk-AOVDSIL3.js";
194
273
  import {
195
274
  createBundleStore,
196
275
  createPodStore,
197
276
  wrapBundleStore,
198
277
  wrapPodStore
199
- } from "./chunk-AZAOEIKW.js";
278
+ } from "./chunk-7E67FJ33.js";
200
279
  import {
201
280
  NOYDB_BUNDLE_FORMAT_VERSION,
202
281
  NOYDB_BUNDLE_MAGIC,
@@ -210,7 +289,7 @@ import {
210
289
  resetBrotliSupportCache,
211
290
  writeNoydbBundle,
212
291
  writePod
213
- } from "./chunk-FISN7WE4.js";
292
+ } from "./chunk-K62IUKOD.js";
214
293
  import {
215
294
  PUBLIC_ENVELOPE_RECORD_ID,
216
295
  isPublicEnvelope,
@@ -218,37 +297,48 @@ import {
218
297
  readPublicEnvelope,
219
298
  savePublicEnvelope,
220
299
  validatePublicEnvelopeInput
221
- } from "./chunk-SMXWYP24.js";
300
+ } from "./chunk-5XIPOCQC.js";
301
+ import "./chunk-67TNU77I.js";
222
302
  import {
223
- 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";
303
+ dictKey,
304
+ staticDict
305
+ } from "./chunk-7VSGW5KJ.js";
230
306
  import {
231
307
  DICT_COLLECTION_PREFIX,
232
- DictionaryHandle,
233
- dictCollectionName,
234
- dictKey,
308
+ LookupHandle,
309
+ dictCollectionName
310
+ } from "./chunk-ELNBMFOS.js";
311
+ import {
312
+ applyI18nLocale,
313
+ enforceScript,
314
+ getAtPath,
315
+ i18nText,
316
+ inferScripts,
235
317
  isDictCollectionName,
236
318
  isDictKeyDescriptor,
319
+ isI18nTextDescriptor,
237
320
  isStaticDictDescriptor,
238
- staticDict
239
- } from "./chunk-LFLXAY2W.js";
321
+ resolveI18nText,
322
+ resolvePolicy,
323
+ setAtPathInPlace,
324
+ validateI18nTextValue
325
+ } from "./chunk-BE7N3AXA.js";
326
+ import {
327
+ installViaBinder
328
+ } from "./chunk-ARSAMO24.js";
240
329
  import {
241
- SYNC_CREDENTIALS_COLLECTION,
242
330
  credentialStatus,
243
331
  deleteCredential,
244
332
  getCredential,
245
333
  listCredentials,
246
- putCredential
247
- } from "./chunk-DGDI2D4M.js";
334
+ putCredential,
335
+ withTeam
336
+ } from "./chunk-OOLO4LQG.js";
248
337
  import {
249
338
  MAGIC_LINK_CONTENT_INFO_PREFIX,
250
339
  MAGIC_LINK_GRANTS_COLLECTION,
251
340
  MAGIC_LINK_KEK_INFO_PREFIX,
341
+ NO_TEAM,
252
342
  deriveMagicLinkContentKey,
253
343
  enrollAuthenticator,
254
344
  findAuthenticator,
@@ -263,7 +353,7 @@ import {
263
353
  rotatePassphrase,
264
354
  unwrapMagicLinkGrant,
265
355
  writeMagicLinkGrant
266
- } from "./chunk-UPJNJGGA.js";
356
+ } from "./chunk-IP2QBAGS.js";
267
357
  import {
268
358
  burnPaperRecoveryEntry,
269
359
  hasRecoveryEnrolled,
@@ -277,17 +367,12 @@ import {
277
367
  unwrapDeksFromBlob,
278
368
  unwrapDeksFromPaperEntry,
279
369
  unwrapDeksFromShamirEntry
280
- } from "./chunk-IGUYVGGI.js";
281
- import {
282
- assertTierAccess,
283
- dekKey,
284
- effectiveClearance
285
- } from "./chunk-IO6GRPT6.js";
370
+ } from "./chunk-6QILBDZU.js";
286
371
  import {
287
372
  PresenceHandle,
288
373
  SyncEngine,
289
374
  SyncTransaction
290
- } from "./chunk-IUEN57TV.js";
375
+ } from "./chunk-W5D62AQD.js";
291
376
  import {
292
377
  BUNDLE_STORE_POLICY,
293
378
  INDEXED_STORE_POLICY,
@@ -295,6 +380,12 @@ import {
295
380
  SyncScheduler
296
381
  } from "./chunk-VQNJ7UZL.js";
297
382
  import {
383
+ assertTierAccess,
384
+ dekKey,
385
+ effectiveClearance
386
+ } from "./chunk-4R4Q64W5.js";
387
+ import {
388
+ SYNC_CREDENTIALS_COLLECTION,
298
389
  WeakPassphraseError,
299
390
  assertStrongPassphrase,
300
391
  buildRecipientKeyringFile,
@@ -306,7 +397,7 @@ import {
306
397
  listUsers,
307
398
  listUsersWithEnvelopes,
308
399
  validatePassphrase
309
- } from "./chunk-WWGT2MDV.js";
400
+ } from "./chunk-5ZOSG3RJ.js";
310
401
  import {
311
402
  DIRECTORY_RECORD_ID,
312
403
  VISIBILITY_RECORD_PREFIX,
@@ -320,7 +411,8 @@ import {
320
411
  readUserVisibility,
321
412
  saveUserEnvelope,
322
413
  visibilityRecordId
323
- } from "./chunk-ITNUCOXM.js";
414
+ } from "./chunk-4N5QFSNQ.js";
415
+ import "./chunk-WTUNZACT.js";
324
416
  import {
325
417
  PolicyEnforcer,
326
418
  activeSessionCount,
@@ -335,7 +427,7 @@ import {
335
427
  revokeAllSessions,
336
428
  revokeSession,
337
429
  validateSessionPolicy
338
- } from "./chunk-UAG5KWVA.js";
430
+ } from "./chunk-VR24ILCR.js";
339
431
  import {
340
432
  generateULID,
341
433
  isULID
@@ -343,7 +435,7 @@ import {
343
435
  import {
344
436
  CollectionInstant,
345
437
  VaultInstant
346
- } from "./chunk-MD3Y6J3L.js";
438
+ } from "./chunk-MELR46EF.js";
347
439
  import {
348
440
  diff,
349
441
  formatDiff
@@ -352,7 +444,7 @@ import {
352
444
  LedgerStore,
353
445
  applyPatch,
354
446
  computePatch
355
- } from "./chunk-LXQT4WMP.js";
447
+ } from "./chunk-OEAATWH5.js";
356
448
  import {
357
449
  LEDGER_COLLECTION,
358
450
  LEDGER_DELTAS_COLLECTION
@@ -364,9 +456,18 @@ import {
364
456
  paddedIndex,
365
457
  parseIndex,
366
458
  sha256Hex
367
- } from "./chunk-AIWULCUO.js";
368
- import "./chunk-SRB2XEWB.js";
369
- import "./chunk-UV5MFVO3.js";
459
+ } from "./chunk-25NDNMQ7.js";
460
+ import "./chunk-DJ3VKYFA.js";
461
+ import "./chunk-CIKY6I4W.js";
462
+ import {
463
+ validateSchemaInput,
464
+ validateSchemaOutput
465
+ } from "./chunk-QQJXBZCO.js";
466
+ import "./chunk-FQQF23MC.js";
467
+ import "./chunk-MSPNM2OM.js";
468
+ import "./chunk-SYMS4546.js";
469
+ import "./chunk-X6CMGUAG.js";
470
+ import "./chunk-LP7BEXCT.js";
370
471
  import {
371
472
  base64ToBuffer,
372
473
  bufferToBase64,
@@ -374,10 +475,8 @@ import {
374
475
  decryptDeterministic,
375
476
  derivePresenceKey,
376
477
  encryptBytes,
377
- encryptDeterministic,
378
- validateSchemaInput,
379
- validateSchemaOutput
380
- } from "./chunk-5O3AOPDT.js";
478
+ encryptDeterministic
479
+ } from "./chunk-HUS3J5WM.js";
381
480
  import {
382
481
  NOYDB_BACKUP_VERSION,
383
482
  NOYDB_FORMAT_VERSION,
@@ -385,64 +484,7 @@ import {
385
484
  NOYDB_SYNC_VERSION,
386
485
  SealedHandle,
387
486
  createStore
388
- } from "./chunk-5TDJ56JE.js";
389
- import {
390
- DEFAULT_CROSS_JOIN_MAX_ROWS,
391
- DEFAULT_JOIN_MAX_ROWS,
392
- Query,
393
- ScanBuilder,
394
- applyJoins,
395
- buildLiveQuery,
396
- executePlan,
397
- resetJoinWarnings
398
- } from "./chunk-UIU2THRG.js";
399
- import {
400
- CollectionIndexes
401
- } from "./chunk-I3TIKTJO.js";
402
- import {
403
- Aggregation,
404
- GROUPBY_MAX_CARDINALITY,
405
- GROUPBY_WARN_CARDINALITY,
406
- GroupedAggregation,
407
- GroupedQuery,
408
- GroupedQueryN,
409
- avg,
410
- count,
411
- groupAndReduce,
412
- max,
413
- min,
414
- moneyMax,
415
- moneyMin,
416
- moneySum,
417
- reduceRecords,
418
- reducerBuilder,
419
- sum
420
- } from "./chunk-LV7M27WM.js";
421
- import {
422
- MoneyCurrencyError,
423
- MoneyPrecisionError,
424
- MoneyUnsupportedError,
425
- decimalScaleOf,
426
- evaluateClause,
427
- evaluateFieldClause,
428
- formatScaledInt,
429
- isMoneyDescriptor,
430
- money,
431
- parseToScaledInt,
432
- readPath,
433
- rescaleScaledInt,
434
- scaleForCurrency
435
- } from "./chunk-M2YKN37S.js";
436
- import {
437
- applyI18nLocale,
438
- enforceScript,
439
- i18nText,
440
- inferScripts,
441
- isI18nTextDescriptor,
442
- resolveI18nText,
443
- resolvePolicy,
444
- validateI18nTextValue
445
- } from "./chunk-5LUY7UTV.js";
487
+ } from "./chunk-CKZW6P5V.js";
446
488
  import {
447
489
  AlreadyElevatedError,
448
490
  AmendmentForbiddenError,
@@ -454,6 +496,11 @@ import {
454
496
  BundleSealMismatchError,
455
497
  BundleVersionConflictError,
456
498
  CargoNotEnabledError,
499
+ ClassifiedConfigError,
500
+ ClassifiedNotEnabledError,
501
+ ClassifiedRevealError,
502
+ ClassifiedRotationError,
503
+ ClassifiedVerifyError,
457
504
  ConflictError,
458
505
  CrossJoinSourceUnknownError,
459
506
  CrossJoinTooLargeError,
@@ -478,6 +525,7 @@ import {
478
525
  EnclaveNotSupportedError,
479
526
  ExportCapabilityError,
480
527
  FieldFrozenError,
528
+ FieldNotQueryableError,
481
529
  FilenameSanitizationError,
482
530
  ForgetStrategyNotConfiguredError,
483
531
  GroupCardinalityError,
@@ -526,6 +574,7 @@ import {
526
574
  RecoveryProfileNotImplementedError,
527
575
  ReservedCollectionNameError,
528
576
  ReservedVaultNameError,
577
+ RestrictRefUnresolvableError,
529
578
  STATE_VAULT_NAME,
530
579
  SchemaFenceError,
531
580
  SchemaLockedError,
@@ -547,6 +596,7 @@ import {
547
596
  StaticDictReadonlyError,
548
597
  StoreCapabilityError,
549
598
  TamperedError,
599
+ TeamNotEnabledError,
550
600
  TierDemoteDeniedError,
551
601
  TierNotGrantedError,
552
602
  TiersNotEnabledError,
@@ -555,12 +605,13 @@ import {
555
605
  USER_ENVELOPE_MAX_BYTES,
556
606
  UniqueConstraintError,
557
607
  UnknownDictCodeError,
608
+ UnknownLookupKeyError,
558
609
  UnknownShardError,
559
610
  UnsupportedIndexOptionError,
560
611
  UserEnvelopeOversizedError,
561
612
  ValidationError,
562
613
  VaultTemplateNotFoundError
563
- } from "./chunk-ZYUC53LT.js";
614
+ } from "./chunk-FH542DDY.js";
564
615
  import "./chunk-PZ5AY32C.js";
565
616
 
566
617
  // src/kernel/debug.ts
@@ -581,6 +632,34 @@ function readPlaintextRecord(envelope) {
581
632
  return JSON.parse(envelope._data);
582
633
  }
583
634
 
635
+ // src/with-shape/introspection/projection.ts
636
+ function applyListProjection(desc, record, opts) {
637
+ const out = { ...record };
638
+ for (const f of desc.fields) {
639
+ if (f.classified !== void 0) {
640
+ const list = f.classified.list;
641
+ if (list === "omit") {
642
+ delete out[f.key];
643
+ continue;
644
+ }
645
+ if ("mask" in list) {
646
+ out[f.key] = list.mask.replace(/\$\{(\w+)\}/g, (_m, rider) => {
647
+ const v = record[`${f.key}_${rider}`];
648
+ return v === void 0 || v === null ? "\u2022" : `${v}`;
649
+ });
650
+ continue;
651
+ }
652
+ out[f.key] = record[`${f.key}_${list.rider}`];
653
+ continue;
654
+ }
655
+ if (opts?.sensitivity !== void 0 && (f.sensitivity === "pii" || f.sensitivity === "secret")) {
656
+ if (opts.sensitivity === "omit") delete out[f.key];
657
+ else out[f.key] = "\u2022\u2022\u2022";
658
+ }
659
+ }
660
+ return out;
661
+ }
662
+
584
663
  // src/with-shape/schema-update/strategies.ts
585
664
  function blindUpdate() {
586
665
  return { name: "blindUpdate", onSchemaDelta: () => ({ action: "allow" }) };
@@ -753,18 +832,19 @@ function routeStore(opts) {
753
832
  }
754
833
  return tieredBlobs.large;
755
834
  }
756
- function isCold(collection, envelope) {
835
+ function isCold(collection, envelope, before) {
757
836
  if (!opts.age) return false;
758
837
  if (isInternal(collection)) return false;
759
838
  if (opts.age.collections && opts.age.collections.length > 0) {
760
839
  if (!opts.age.collections.includes(collection)) return false;
761
840
  }
762
- const cutoff = Date.now() - opts.age.coldAfterDays * 24 * 60 * 60 * 1e3;
763
- const ts = new Date(envelope._ts).getTime();
764
- return ts < cutoff;
841
+ const cutoffIso = before ?? (opts.age.coldAfterDays != null ? new Date(Date.now() - opts.age.coldAfterDays * 24 * 60 * 60 * 1e3).toISOString() : void 0);
842
+ if (cutoffIso === void 0) return false;
843
+ return envelope._ts < cutoffIso;
765
844
  }
766
845
  const store = {
767
846
  name: buildName(),
847
+ ...opts.age?.cold ? { capabilities: { ...primary.capabilities, coldArchival: true } } : primary.capabilities ? { capabilities: { ...primary.capabilities, coldArchival: false } } : {},
768
848
  async get(vault, collection, id) {
769
849
  const s = storeFor(vault, collection);
770
850
  const result = await s.get(vault, collection, id);
@@ -833,16 +913,16 @@ function routeStore(opts) {
833
913
  [...partitioned.entries()].map(([s, snap]) => s.saveAll(vault, snap))
834
914
  );
835
915
  },
836
- async compact(vault) {
916
+ async compact(vault, compactOpts) {
837
917
  if (!opts.age) return 0;
838
918
  let migrated = 0;
839
- const collections = opts.age.collections?.length ? opts.age.collections : await primary.list(vault, "").catch(() => []);
919
+ const collections = opts.age.collections?.length ? opts.age.collections : Object.keys(await primary.loadAll(vault).catch(() => ({})));
840
920
  for (const collection of collections) {
841
921
  const ids = await primary.list(vault, collection).catch(() => []);
842
922
  for (const id of ids) {
843
923
  const envelope = await primary.get(vault, collection, id);
844
924
  if (!envelope) continue;
845
- if (isCold(collection, envelope)) {
925
+ if (isCold(collection, envelope, compactOpts?.before)) {
846
926
  await opts.age.cold.put(vault, collection, id, envelope);
847
927
  await primary.delete(vault, collection, id);
848
928
  migrated++;
@@ -1284,7 +1364,950 @@ function withDeferredNumbering(config) {
1284
1364
  };
1285
1365
  }
1286
1366
 
1287
- // src/with-shape/money/arith.ts
1367
+ // src/via/money/iso4217.ts
1368
+ var MINOR_UNITS = {
1369
+ // 2-decimal majors
1370
+ EUR: 2,
1371
+ USD: 2,
1372
+ GBP: 2,
1373
+ CHF: 2,
1374
+ CAD: 2,
1375
+ AUD: 2,
1376
+ NZD: 2,
1377
+ SGD: 2,
1378
+ HKD: 2,
1379
+ CNY: 2,
1380
+ INR: 2,
1381
+ BRL: 2,
1382
+ MXN: 2,
1383
+ ZAR: 2,
1384
+ RUB: 2,
1385
+ TRY: 2,
1386
+ PLN: 2,
1387
+ SEK: 2,
1388
+ NOK: 2,
1389
+ DKK: 2,
1390
+ CZK: 2,
1391
+ HUF: 2,
1392
+ RON: 2,
1393
+ ILS: 2,
1394
+ THB: 2,
1395
+ PHP: 2,
1396
+ MYR: 2,
1397
+ IDR: 2,
1398
+ AED: 2,
1399
+ SAR: 2,
1400
+ QAR: 2,
1401
+ EGP: 2,
1402
+ // 0-decimal
1403
+ JPY: 0,
1404
+ KRW: 0,
1405
+ ISK: 0,
1406
+ CLP: 0,
1407
+ VND: 0,
1408
+ XOF: 0,
1409
+ XAF: 0,
1410
+ PYG: 0,
1411
+ // 3-decimal
1412
+ BHD: 3,
1413
+ KWD: 3,
1414
+ OMR: 3,
1415
+ TND: 3,
1416
+ JOD: 3,
1417
+ IQD: 3,
1418
+ LYD: 3
1419
+ };
1420
+ function scaleForCurrency(code) {
1421
+ const v = MINOR_UNITS[code];
1422
+ return v === void 0 ? null : v;
1423
+ }
1424
+
1425
+ // src/via/money/fixed-point.ts
1426
+ function expandExponent(s) {
1427
+ const m = /^([+-]?)(\d+)(?:\.(\d+))?[eE]([+-]?\d+)$/.exec(s);
1428
+ if (!m) return s;
1429
+ const sign = m[1] === "-" ? "-" : "";
1430
+ const intp = m[2];
1431
+ const frac = m[3] ?? "";
1432
+ const exp = Number(m[4]);
1433
+ const digits = intp + frac;
1434
+ const pointPos = intp.length + exp;
1435
+ let body;
1436
+ if (pointPos <= 0) {
1437
+ body = "0." + "0".repeat(-pointPos) + digits;
1438
+ } else if (pointPos >= digits.length) {
1439
+ body = digits + "0".repeat(pointPos - digits.length);
1440
+ } else {
1441
+ body = digits.slice(0, pointPos) + "." + digits.slice(pointPos);
1442
+ }
1443
+ return sign + body;
1444
+ }
1445
+ function toCanonicalDecimalString(input) {
1446
+ let s;
1447
+ if (typeof input === "number") {
1448
+ if (!Number.isFinite(input)) return null;
1449
+ s = String(input);
1450
+ } else {
1451
+ s = input.trim();
1452
+ }
1453
+ s = expandExponent(s);
1454
+ if (s.startsWith("+")) s = s.slice(1);
1455
+ if (!/^-?(\d+(\.\d*)?|\.\d+)$/.test(s)) return null;
1456
+ return s;
1457
+ }
1458
+ function shouldRoundUp(negative, lastKeptDigit, firstDiscarded, hasMoreNonZeroAfterFirst, mode) {
1459
+ switch (mode) {
1460
+ case "up":
1461
+ return true;
1462
+ case "down":
1463
+ return false;
1464
+ case "ceil":
1465
+ return !negative;
1466
+ case "floor":
1467
+ return negative;
1468
+ case "half-up":
1469
+ return firstDiscarded >= 5;
1470
+ case "half-down":
1471
+ return firstDiscarded > 5 || firstDiscarded === 5 && hasMoreNonZeroAfterFirst;
1472
+ case "half-even":
1473
+ if (firstDiscarded > 5) return true;
1474
+ if (firstDiscarded < 5) return false;
1475
+ return hasMoreNonZeroAfterFirst || lastKeptDigit % 2 === 1;
1476
+ }
1477
+ }
1478
+ function parseToScaledInt(input, scale, rounding) {
1479
+ const canonical = toCanonicalDecimalString(input);
1480
+ if (canonical === null) return { ok: false, reason: "nonfinite" };
1481
+ const negative = canonical.startsWith("-");
1482
+ const unsigned = negative ? canonical.slice(1) : canonical;
1483
+ const dot = unsigned.indexOf(".");
1484
+ const intPart = dot === -1 ? unsigned : unsigned.slice(0, dot);
1485
+ const fracPart = dot === -1 ? "" : unsigned.slice(dot + 1);
1486
+ const intDigits = intPart === "" ? "0" : intPart;
1487
+ if (fracPart.length <= scale) {
1488
+ const keep2 = fracPart.padEnd(scale, "0");
1489
+ const magnitude2 = BigInt(intDigits + keep2);
1490
+ return { ok: true, value: negative && magnitude2 !== 0n ? -magnitude2 : magnitude2 };
1491
+ }
1492
+ const keep = fracPart.slice(0, scale);
1493
+ const tail = fracPart.slice(scale);
1494
+ const magnitudeDigits = intDigits + keep;
1495
+ let magnitude = BigInt(magnitudeDigits);
1496
+ if (/^0+$/.test(tail)) {
1497
+ return { ok: true, value: negative && magnitude !== 0n ? -magnitude : magnitude };
1498
+ }
1499
+ if (rounding === void 0) return { ok: false, reason: "precision" };
1500
+ const lastKeptDigit = Number(magnitudeDigits[magnitudeDigits.length - 1]);
1501
+ const firstDiscarded = Number(tail[0]);
1502
+ const hasMoreNonZeroAfterFirst = /[1-9]/.test(tail.slice(1));
1503
+ if (shouldRoundUp(negative, lastKeptDigit, firstDiscarded, hasMoreNonZeroAfterFirst, rounding)) {
1504
+ magnitude += 1n;
1505
+ }
1506
+ return { ok: true, value: negative && magnitude !== 0n ? -magnitude : magnitude };
1507
+ }
1508
+ function decimalScaleOf(input) {
1509
+ const s = toCanonicalDecimalString(input);
1510
+ if (s === null) return null;
1511
+ const dot = s.indexOf(".");
1512
+ return dot === -1 ? 0 : s.length - dot - 1;
1513
+ }
1514
+ function rescaleScaledInt(value, fromScale, toScale, rounding = "half-up") {
1515
+ if (toScale >= fromScale) return value * 10n ** BigInt(toScale - fromScale);
1516
+ const drop = fromScale - toScale;
1517
+ const negative = value < 0n;
1518
+ const absStr = (negative ? -value : value).toString().padStart(drop + 1, "0");
1519
+ const keptStr = absStr.slice(0, absStr.length - drop);
1520
+ const tail = absStr.slice(absStr.length - drop);
1521
+ let magnitude = BigInt(keptStr);
1522
+ if (!/^0+$/.test(tail)) {
1523
+ const lastKeptDigit = Number(keptStr[keptStr.length - 1]);
1524
+ const firstDiscarded = Number(tail[0]);
1525
+ const hasMoreNonZeroAfterFirst = /[1-9]/.test(tail.slice(1));
1526
+ if (shouldRoundUp(negative, lastKeptDigit, firstDiscarded, hasMoreNonZeroAfterFirst, rounding)) {
1527
+ magnitude += 1n;
1528
+ }
1529
+ }
1530
+ return negative && magnitude !== 0n ? -magnitude : magnitude;
1531
+ }
1532
+ function formatScaledInt(value, scale) {
1533
+ const negative = value < 0n;
1534
+ const abs = (negative ? -value : value).toString();
1535
+ if (scale === 0) return (negative ? "-" : "") + abs;
1536
+ const padded = abs.padStart(scale + 1, "0");
1537
+ const cut = padded.length - scale;
1538
+ const intPart = padded.slice(0, cut);
1539
+ const fracPart = padded.slice(cut);
1540
+ return (negative ? "-" : "") + intPart + "." + fracPart;
1541
+ }
1542
+
1543
+ // src/via/money/paths.ts
1544
+ var SEGMENT_RE = /^(\*|[^.[\]*]+)(\[\])?$/;
1545
+ var parseCache = /* @__PURE__ */ new Map();
1546
+ function parseMoneyPath(path) {
1547
+ const cached = parseCache.get(path);
1548
+ if (cached) return cached;
1549
+ if (typeof path !== "string" || path.length === 0) {
1550
+ throw new ValidationError("moneyFields: path must be a non-empty string");
1551
+ }
1552
+ const segments = [];
1553
+ for (const part of path.split(".")) {
1554
+ const m = SEGMENT_RE.exec(part);
1555
+ if (!m) {
1556
+ throw new ValidationError(
1557
+ `moneyFields: invalid path "${path}" \u2014 segment "${part}" must be a key, "key[]", "*", or "*[]"`
1558
+ );
1559
+ }
1560
+ const array = m[2] === "[]";
1561
+ segments.push(
1562
+ m[1] === "*" ? { kind: "wildcard", array } : { kind: "key", key: m[1], array }
1563
+ );
1564
+ }
1565
+ parseCache.set(path, segments);
1566
+ return segments;
1567
+ }
1568
+ function isSimpleMoneyPath(path) {
1569
+ return !path.includes(".") && !path.includes("[") && !path.includes("*");
1570
+ }
1571
+ function validateMoneyFieldPaths(moneyFields) {
1572
+ for (const path of Object.keys(moneyFields)) parseMoneyPath(path);
1573
+ }
1574
+ function transformAtMoneyPath(node, path, segments, index, visit, lenient) {
1575
+ if (node === null || node === void 0) return node;
1576
+ const seg = segments[index];
1577
+ const last = index === segments.length - 1;
1578
+ if (seg.kind === "key") {
1579
+ if (typeof node !== "object" || Array.isArray(node)) {
1580
+ if (lenient) return node;
1581
+ throw new ValidationError(
1582
+ `moneyFields: path "${path}" expected an object at segment "${seg.key}", got ${Array.isArray(node) ? "an array" : typeof node}`
1583
+ );
1584
+ }
1585
+ const obj2 = node;
1586
+ if (!(seg.key in obj2) || obj2[seg.key] === null || obj2[seg.key] === void 0) return node;
1587
+ if (seg.array) {
1588
+ const arr = obj2[seg.key];
1589
+ if (!Array.isArray(arr)) {
1590
+ if (lenient) return node;
1591
+ throw new ValidationError(
1592
+ `moneyFields: path "${path}" declares "${seg.key}[]" but the value is not an array`
1593
+ );
1594
+ }
1595
+ const cloned = [...arr];
1596
+ if (last) {
1597
+ for (let i = 0; i < cloned.length; i++) visit(cloned, i);
1598
+ } else {
1599
+ for (let i = 0; i < cloned.length; i++) {
1600
+ cloned[i] = transformAtMoneyPath(cloned[i], path, segments, index + 1, visit, lenient);
1601
+ }
1602
+ }
1603
+ return { ...obj2, [seg.key]: cloned };
1604
+ }
1605
+ const clone2 = { ...obj2 };
1606
+ if (last) {
1607
+ visit(clone2, seg.key);
1608
+ } else {
1609
+ clone2[seg.key] = transformAtMoneyPath(clone2[seg.key], path, segments, index + 1, visit, lenient);
1610
+ }
1611
+ return clone2;
1612
+ }
1613
+ if (seg.array) {
1614
+ if (!Array.isArray(node)) {
1615
+ if (lenient) return node;
1616
+ throw new ValidationError(`moneyFields: path "${path}" declares "*[]" but the value is not an array`);
1617
+ }
1618
+ const cloned = [...node];
1619
+ if (last) {
1620
+ for (let i = 0; i < cloned.length; i++) visit(cloned, i);
1621
+ } else {
1622
+ for (let i = 0; i < cloned.length; i++) {
1623
+ cloned[i] = transformAtMoneyPath(cloned[i], path, segments, index + 1, visit, lenient);
1624
+ }
1625
+ }
1626
+ return cloned;
1627
+ }
1628
+ if (typeof node !== "object" || Array.isArray(node)) {
1629
+ if (lenient) return node;
1630
+ throw new ValidationError(
1631
+ `moneyFields: path "${path}" applies "*" to a non-object (${Array.isArray(node) ? 'array \u2014 use "*[]"' : typeof node})`
1632
+ );
1633
+ }
1634
+ const obj = node;
1635
+ const clone = { ...obj };
1636
+ for (const key of Object.keys(obj)) {
1637
+ const v = clone[key];
1638
+ if (v === null || v === void 0) continue;
1639
+ if (last) visit(clone, key);
1640
+ else clone[key] = transformAtMoneyPath(v, path, segments, index + 1, visit, lenient);
1641
+ }
1642
+ return clone;
1643
+ }
1644
+
1645
+ // src/via/money/normalize.ts
1646
+ function isMoneyValueObject(v) {
1647
+ return typeof v === "object" && v !== null && "currency" in v;
1648
+ }
1649
+ function quantizeAmount(field, input, scale, rounding) {
1650
+ const r = parseToScaledInt(input, scale, rounding);
1651
+ if (!r.ok) {
1652
+ if (r.reason === "precision") throw new MoneyPrecisionError(field, input, scale);
1653
+ throw new TypeError(`money: field "${field}" value ${JSON.stringify(input)} is not a finite decimal`);
1654
+ }
1655
+ return r.value.toString();
1656
+ }
1657
+ function canonicalizeStoredMoney(record, moneyFields) {
1658
+ if (record === null || record === void 0) return record;
1659
+ if (!moneyFields || Object.keys(moneyFields).length === 0) return record;
1660
+ return decodeMoneyFields(record, moneyFields, "raw");
1661
+ }
1662
+ function canonicalizeIncomingMoney(record, moneyFields) {
1663
+ if (!moneyFields || Object.keys(moneyFields).length === 0) return record;
1664
+ try {
1665
+ return decodeMoneyFields(
1666
+ quantizeMoneyFields(record, moneyFields),
1667
+ moneyFields,
1668
+ "raw"
1669
+ );
1670
+ } catch {
1671
+ return record;
1672
+ }
1673
+ }
1674
+ function quantizeValue(field, raw, desc) {
1675
+ if (desc.mode === "fixed") {
1676
+ const currency2 = desc.fixedCurrency;
1677
+ return quantizeAmount(field, raw, desc.scaleFor(currency2), desc.rounding);
1678
+ }
1679
+ let amount;
1680
+ let currency;
1681
+ if (isMoneyValueObject(raw)) {
1682
+ currency = String(raw.currency);
1683
+ amount = raw.amount;
1684
+ } else {
1685
+ const sole = desc.soleCurrency();
1686
+ if (sole === void 0) {
1687
+ throw new TypeError(
1688
+ `money: field "${field}" is multi-currency \u2014 write { amount, currency }, not a bare amount`
1689
+ );
1690
+ }
1691
+ currency = sole;
1692
+ amount = raw;
1693
+ }
1694
+ const scale = desc.scaleFor(currency);
1695
+ return { amount: quantizeAmount(field, amount, scale, desc.rounding), currency };
1696
+ }
1697
+ function quantizeMoneyFields(record, moneyFields) {
1698
+ let out = { ...record };
1699
+ for (const [path, desc] of Object.entries(moneyFields)) {
1700
+ if (isSimpleMoneyPath(path)) {
1701
+ const raw = out[path];
1702
+ if (raw === null || raw === void 0) continue;
1703
+ out[path] = quantizeValue(path, raw, desc);
1704
+ continue;
1705
+ }
1706
+ out = transformAtMoneyPath(
1707
+ out,
1708
+ path,
1709
+ parseMoneyPath(path),
1710
+ 0,
1711
+ (container, key) => {
1712
+ const raw = container[key];
1713
+ if (raw === null || raw === void 0) return;
1714
+ container[key] = quantizeValue(path, raw, desc);
1715
+ },
1716
+ /* lenient */
1717
+ false
1718
+ );
1719
+ }
1720
+ return out;
1721
+ }
1722
+ function formatCurrency(decimal, currency, scale, locale) {
1723
+ const fmt = new Intl.NumberFormat(locale, {
1724
+ style: "currency",
1725
+ currency,
1726
+ minimumFractionDigits: scale,
1727
+ maximumFractionDigits: scale
1728
+ });
1729
+ return fmt.format(decimal);
1730
+ }
1731
+ function moneyScaledValue(stored, desc) {
1732
+ let raw;
1733
+ if (desc.mode === "fixed") {
1734
+ raw = stored;
1735
+ } else {
1736
+ if (!isMoneyValueObject(stored)) return null;
1737
+ raw = stored.amount;
1738
+ }
1739
+ if (typeof raw !== "string" && typeof raw !== "number") return null;
1740
+ try {
1741
+ return BigInt(String(raw));
1742
+ } catch {
1743
+ return null;
1744
+ }
1745
+ }
1746
+ function canonicalizeMoneyIndexKey(field, rawValue, moneyFields) {
1747
+ const desc = moneyFields[field];
1748
+ if (!desc || desc.mode !== "fixed") return void 0;
1749
+ return moneyScaledValue(rawValue, desc)?.toString();
1750
+ }
1751
+ function decodeValue(stored, desc) {
1752
+ let currency;
1753
+ let scaledIntString;
1754
+ if (desc.mode === "fixed") {
1755
+ if (typeof stored !== "string" && typeof stored !== "number") return null;
1756
+ currency = desc.fixedCurrency;
1757
+ scaledIntString = String(stored);
1758
+ } else {
1759
+ if (!isMoneyValueObject(stored)) return null;
1760
+ const amount = stored.amount;
1761
+ if (typeof stored.currency !== "string" || typeof amount !== "string" && typeof amount !== "number") return null;
1762
+ currency = stored.currency;
1763
+ scaledIntString = String(amount);
1764
+ }
1765
+ const scale = desc.scaleFor(currency);
1766
+ let decimal;
1767
+ try {
1768
+ decimal = formatScaledInt(BigInt(scaledIntString), scale);
1769
+ } catch {
1770
+ return null;
1771
+ }
1772
+ return {
1773
+ decoded: desc.mode === "fixed" ? decimal : { amount: decimal, currency },
1774
+ decimal,
1775
+ currency,
1776
+ scale
1777
+ };
1778
+ }
1779
+ function presentVirtualMoneyFields(record, moneyFields, virtualMoney, locale) {
1780
+ let out = record;
1781
+ const format = locale !== "raw";
1782
+ const fmtLocale = typeof locale === "string" && locale !== "raw" ? locale : "en-US";
1783
+ for (const field of virtualMoney) {
1784
+ const desc = moneyFields[field];
1785
+ if (!desc || desc.mode !== "fixed") continue;
1786
+ const raw = out[field];
1787
+ if (raw === null || raw === void 0) continue;
1788
+ if (typeof raw !== "number" && typeof raw !== "string") continue;
1789
+ const currency = desc.fixedCurrency;
1790
+ const scale = desc.scaleFor(currency);
1791
+ const r = parseToScaledInt(raw, scale, desc.rounding);
1792
+ if (!r.ok) continue;
1793
+ if (out === record) out = { ...record };
1794
+ const decimal = formatScaledInt(r.value, scale);
1795
+ out[field] = decimal;
1796
+ if (format) {
1797
+ out[`${field}Formatted`] = formatCurrency(decimal, currency, scale, fmtLocale);
1798
+ out[`${field}Number`] = Number(decimal);
1799
+ }
1800
+ }
1801
+ return out;
1802
+ }
1803
+ function decodeMoneyFields(record, moneyFields, locale) {
1804
+ let out = { ...record };
1805
+ const format = locale !== "raw";
1806
+ const fmtLocale = typeof locale === "string" && locale !== "raw" ? locale : "en-US";
1807
+ for (const [path, desc] of Object.entries(moneyFields)) {
1808
+ if (isSimpleMoneyPath(path)) {
1809
+ const stored = out[path];
1810
+ if (stored === null || stored === void 0) continue;
1811
+ const r = decodeValue(stored, desc);
1812
+ if (r === null) continue;
1813
+ out[path] = r.decoded;
1814
+ if (format) {
1815
+ out[`${path}Formatted`] = formatCurrency(r.decimal, r.currency, r.scale, fmtLocale);
1816
+ out[`${path}Number`] = Number(r.decimal);
1817
+ }
1818
+ continue;
1819
+ }
1820
+ out = transformAtMoneyPath(
1821
+ out,
1822
+ path,
1823
+ parseMoneyPath(path),
1824
+ 0,
1825
+ (container, key) => {
1826
+ const stored = container[key];
1827
+ if (stored === null || stored === void 0) return;
1828
+ const r = decodeValue(stored, desc);
1829
+ if (r === null) return;
1830
+ container[key] = r.decoded;
1831
+ if (format && typeof key === "string" && !Array.isArray(container)) {
1832
+ container[`${key}Formatted`] = formatCurrency(r.decimal, r.currency, r.scale, fmtLocale);
1833
+ container[`${key}Number`] = Number(r.decimal);
1834
+ }
1835
+ },
1836
+ /* lenient */
1837
+ true
1838
+ );
1839
+ }
1840
+ return out;
1841
+ }
1842
+
1843
+ // src/via/money/where.ts
1844
+ function isMoneyValueObject2(v) {
1845
+ return typeof v === "object" && v !== null && "currency" in v;
1846
+ }
1847
+ function parseOperand(field, raw, desc) {
1848
+ let amount;
1849
+ let currency;
1850
+ if (desc.mode === "fixed") {
1851
+ currency = desc.fixedCurrency;
1852
+ amount = raw;
1853
+ } else if (isMoneyValueObject2(raw)) {
1854
+ currency = String(raw.currency);
1855
+ amount = raw.amount;
1856
+ } else {
1857
+ const sole = desc.soleCurrency();
1858
+ if (sole === void 0) {
1859
+ throw new MoneyUnsupportedError(
1860
+ `where("${field}"): field is multi-currency \u2014 compare against { amount, currency }, not a bare amount`
1861
+ );
1862
+ }
1863
+ currency = sole;
1864
+ amount = raw;
1865
+ }
1866
+ if (typeof amount !== "number" && typeof amount !== "string") {
1867
+ throw new MoneyUnsupportedError(
1868
+ `where("${field}"): operand ${JSON.stringify(raw)} is not a money amount`
1869
+ );
1870
+ }
1871
+ const r = parseToScaledInt(amount, desc.scaleFor(currency), desc.rounding);
1872
+ if (!r.ok) {
1873
+ throw new MoneyUnsupportedError(
1874
+ `where("${field}"): operand ${JSON.stringify(amount)} is not a finite decimal`
1875
+ );
1876
+ }
1877
+ return { scaled: r.value.toString(), currency };
1878
+ }
1879
+ function moneyFieldClause(field, op, value, desc) {
1880
+ switch (op) {
1881
+ case "==":
1882
+ case "!=":
1883
+ case "<":
1884
+ case "<=":
1885
+ case ">":
1886
+ case ">=": {
1887
+ const e = parseOperand(field, value, desc);
1888
+ return { mode: desc.mode, entries: [e] };
1889
+ }
1890
+ case "between": {
1891
+ if (!Array.isArray(value) || value.length !== 2) {
1892
+ throw new MoneyUnsupportedError(`where("${field}"): 'between' needs a [lo, hi] tuple`);
1893
+ }
1894
+ const lo = parseOperand(field, value[0], desc);
1895
+ const hi = parseOperand(field, value[1], desc);
1896
+ if (lo.currency !== hi.currency) {
1897
+ throw new MoneyUnsupportedError(
1898
+ `where("${field}"): 'between' bounds mix currencies (${lo.currency} vs ${hi.currency})`
1899
+ );
1900
+ }
1901
+ return { mode: desc.mode, entries: [lo, hi] };
1902
+ }
1903
+ case "in": {
1904
+ if (!Array.isArray(value)) {
1905
+ throw new MoneyUnsupportedError(`where("${field}"): 'in' needs an array of amounts`);
1906
+ }
1907
+ return { mode: desc.mode, entries: value.map((v) => parseOperand(field, v, desc)) };
1908
+ }
1909
+ default:
1910
+ throw new MoneyUnsupportedError(
1911
+ `where("${field}"): operator '${op}' is not supported on a money field`
1912
+ );
1913
+ }
1914
+ }
1915
+ function moneyIndexProbe(op, payload) {
1916
+ if (payload.mode !== "fixed") return void 0;
1917
+ if (op === "==") return payload.entries[0]?.scaled;
1918
+ if (op === "in") return payload.entries.map((e) => e.scaled);
1919
+ return void 0;
1920
+ }
1921
+ function readStored(actual, operand) {
1922
+ let amount;
1923
+ let currency;
1924
+ if (operand.mode === "fixed") {
1925
+ if (typeof actual !== "string" && typeof actual !== "number") return null;
1926
+ amount = actual;
1927
+ currency = operand.entries[0]?.currency ?? "";
1928
+ } else {
1929
+ if (!isMoneyValueObject2(actual)) return null;
1930
+ if (typeof actual.currency !== "string") return null;
1931
+ amount = actual.amount;
1932
+ currency = actual.currency;
1933
+ }
1934
+ if (typeof amount !== "string" && typeof amount !== "number") return null;
1935
+ try {
1936
+ return { scaled: BigInt(amount).toString(), currency };
1937
+ } catch {
1938
+ return null;
1939
+ }
1940
+ }
1941
+ function evaluateMoneyClause(actual, op, operand) {
1942
+ const stored = readStored(actual, operand);
1943
+ if (stored === null) return op === "!=";
1944
+ const a = BigInt(stored.scaled);
1945
+ if (op === "in") {
1946
+ return operand.entries.some(
1947
+ (e2) => e2.currency === stored.currency && BigInt(e2.scaled) === a
1948
+ );
1949
+ }
1950
+ if (op === "between") {
1951
+ const [lo, hi] = operand.entries;
1952
+ if (!lo || !hi || lo.currency !== stored.currency) return false;
1953
+ return a >= BigInt(lo.scaled) && a <= BigInt(hi.scaled);
1954
+ }
1955
+ const e = operand.entries[0];
1956
+ if (!e) return false;
1957
+ if (e.currency !== stored.currency) return op === "!=";
1958
+ const b = BigInt(e.scaled);
1959
+ switch (op) {
1960
+ case "==":
1961
+ return a === b;
1962
+ case "!=":
1963
+ return a !== b;
1964
+ case "<":
1965
+ return a < b;
1966
+ case "<=":
1967
+ return a <= b;
1968
+ case ">":
1969
+ return a > b;
1970
+ case ">=":
1971
+ return a >= b;
1972
+ default:
1973
+ return false;
1974
+ }
1975
+ }
1976
+
1977
+ // src/via/money/money-reducer.ts
1978
+ function toScaledIntFromAny(v, scale) {
1979
+ if (typeof v === "bigint") return v;
1980
+ if (typeof v === "number") {
1981
+ const r = parseToScaledInt(v, scale);
1982
+ return r.ok ? r.value : null;
1983
+ }
1984
+ if (typeof v === "string") {
1985
+ if (!v.includes(".")) {
1986
+ try {
1987
+ return BigInt(v);
1988
+ } catch {
1989
+ return null;
1990
+ }
1991
+ }
1992
+ const r = parseToScaledInt(v, scale);
1993
+ return r.ok ? r.value : null;
1994
+ }
1995
+ return null;
1996
+ }
1997
+ function readMoney(record, field, desc) {
1998
+ const raw = readPath(record, field);
1999
+ if (raw === null || raw === void 0) return null;
2000
+ if (desc.mode === "fixed") {
2001
+ const cur = desc.fixedCurrency;
2002
+ const value2 = toScaledIntFromAny(raw, desc.scaleFor(cur));
2003
+ return value2 === null ? null : { currency: cur, value: value2 };
2004
+ }
2005
+ if (typeof raw !== "object") return null;
2006
+ const o = raw;
2007
+ if (typeof o.currency !== "string") return null;
2008
+ const scale = desc.allows(o.currency) ? desc.scaleFor(o.currency) : 0;
2009
+ const value = toScaledIntFromAny(o.amount, scale);
2010
+ return value === null ? null : { currency: o.currency, value };
2011
+ }
2012
+ function targetScaleFor(desc, currency) {
2013
+ if (desc.allows(currency)) return desc.scaleFor(currency);
2014
+ const s = scaleForCurrency(currency);
2015
+ if (s === null) {
2016
+ throw new Error(`money: cannot determine scale for conversion target "${currency}"`);
2017
+ }
2018
+ return s;
2019
+ }
2020
+ function parseRate(rate) {
2021
+ const s = String(rate).trim();
2022
+ const neg = s.startsWith("-");
2023
+ const body = neg ? s.slice(1) : s;
2024
+ const dot = body.indexOf(".");
2025
+ const intPart = dot === -1 ? body : body.slice(0, dot);
2026
+ const fracPart = dot === -1 ? "" : body.slice(dot + 1);
2027
+ const int = BigInt((intPart === "" ? "0" : intPart) + fracPart);
2028
+ return { int: neg ? -int : int, scale: fracPart.length };
2029
+ }
2030
+ function divRoundHalfEven(n, d) {
2031
+ const q = n / d;
2032
+ const r = n % d;
2033
+ const twiceR = (r < 0n ? -r : r) * 2n;
2034
+ if (twiceR < d) return q;
2035
+ if (twiceR > d) return q + (n < 0n ? -1n : 1n);
2036
+ return q % 2n === 0n ? q : q + (n < 0n ? -1n : 1n);
2037
+ }
2038
+ function convertScaled(value, srcScale, rate, targetScale) {
2039
+ const { int: rateInt, scale: rateScale } = parseRate(rate);
2040
+ const product = value * rateInt;
2041
+ const curScale = srcScale + rateScale;
2042
+ if (curScale === targetScale) return product;
2043
+ if (curScale < targetScale) return product * 10n ** BigInt(targetScale - curScale);
2044
+ return divRoundHalfEven(product, 10n ** BigInt(curScale - targetScale));
2045
+ }
2046
+ function finalizeSum(state, desc, convertTo, fx) {
2047
+ if (convertTo !== void 0) {
2048
+ if (fx === void 0) {
2049
+ throw new Error(`money: sum convertTo "${convertTo}" requires an fx rate map`);
2050
+ }
2051
+ const targetScale = targetScaleFor(desc, convertTo);
2052
+ let total = 0n;
2053
+ for (const [cur, v] of state) {
2054
+ if (cur === convertTo) {
2055
+ total += convertScaled(v, desc.scaleFor(cur), 1, targetScale);
2056
+ continue;
2057
+ }
2058
+ const rate = fx[`${cur}->${convertTo}`];
2059
+ if (rate === void 0) {
2060
+ throw new Error(`money: no fx rate for "${cur}->${convertTo}"`);
2061
+ }
2062
+ total += convertScaled(v, desc.scaleFor(cur), rate, targetScale);
2063
+ }
2064
+ return formatScaledInt(total, targetScale);
2065
+ }
2066
+ if (desc.mode === "fixed") {
2067
+ const cur = desc.fixedCurrency;
2068
+ return formatScaledInt(state.get(cur) ?? 0n, desc.scaleFor(cur));
2069
+ }
2070
+ const out = {};
2071
+ for (const [cur, v] of state) out[cur] = formatScaledInt(v, desc.scaleFor(cur));
2072
+ return out;
2073
+ }
2074
+ function moneySumReducer(field, desc, convertTo, fx) {
2075
+ return {
2076
+ op: "sum",
2077
+ field,
2078
+ init: () => /* @__PURE__ */ new Map(),
2079
+ step: (state, record) => {
2080
+ const m = readMoney(record, field, desc);
2081
+ if (m) state.set(m.currency, (state.get(m.currency) ?? 0n) + m.value);
2082
+ return state;
2083
+ },
2084
+ remove: (state, record) => {
2085
+ const m = readMoney(record, field, desc);
2086
+ if (m) state.set(m.currency, (state.get(m.currency) ?? 0n) - m.value);
2087
+ return state;
2088
+ },
2089
+ finalize: (state) => finalizeSum(state, desc, convertTo, fx)
2090
+ };
2091
+ }
2092
+ function extremum(values, op) {
2093
+ let out = values[0];
2094
+ for (let i = 1; i < values.length; i++) {
2095
+ const v = values[i];
2096
+ if (op === "min" ? v < out : v > out) out = v;
2097
+ }
2098
+ return out;
2099
+ }
2100
+ function moneyMinMaxReducer(op, field, desc) {
2101
+ return {
2102
+ op,
2103
+ field,
2104
+ init: () => /* @__PURE__ */ new Map(),
2105
+ step: (state, record) => {
2106
+ const m = readMoney(record, field, desc);
2107
+ if (m) {
2108
+ const arr = state.get(m.currency);
2109
+ if (arr) arr.push(m.value);
2110
+ else state.set(m.currency, [m.value]);
2111
+ }
2112
+ return state;
2113
+ },
2114
+ remove: (state, record) => {
2115
+ const m = readMoney(record, field, desc);
2116
+ if (m) {
2117
+ const arr = state.get(m.currency);
2118
+ if (arr) {
2119
+ const idx = arr.indexOf(m.value);
2120
+ if (idx >= 0) arr.splice(idx, 1);
2121
+ }
2122
+ }
2123
+ return state;
2124
+ },
2125
+ finalize: (state) => {
2126
+ if (desc.mode === "fixed") {
2127
+ const cur = desc.fixedCurrency;
2128
+ const arr = state.get(cur);
2129
+ if (!arr || arr.length === 0) return null;
2130
+ return formatScaledInt(extremum(arr, op), desc.scaleFor(cur));
2131
+ }
2132
+ const out = {};
2133
+ for (const [cur, arr] of state) {
2134
+ if (arr.length > 0) out[cur] = formatScaledInt(extremum(arr, op), desc.scaleFor(cur));
2135
+ }
2136
+ return out;
2137
+ }
2138
+ };
2139
+ }
2140
+ function wrapMoneyReducers(spec, moneyFields) {
2141
+ let changed = false;
2142
+ const out = {};
2143
+ for (const [key, reducer] of Object.entries(spec)) {
2144
+ const field = reducer.field;
2145
+ const desc = field ? moneyFields[field] : void 0;
2146
+ if (desc && reducer.op === "avg") {
2147
+ throw new MoneyUnsupportedError(
2148
+ field,
2149
+ `avg() is not supported on money field "${field}" in v1 \u2014 use sum() and count() and divide at the boundary.`
2150
+ );
2151
+ }
2152
+ if (desc && (reducer.op === "sum" || reducer.op === "min" || reducer.op === "max")) {
2153
+ changed = true;
2154
+ out[key] = reducer.op === "sum" ? moneySumReducer(field, desc, reducer.convertTo, reducer.fx) : moneyMinMaxReducer(reducer.op, field, desc);
2155
+ } else {
2156
+ out[key] = reducer;
2157
+ }
2158
+ }
2159
+ return changed ? out : spec;
2160
+ }
2161
+
2162
+ // src/via/money/binding.ts
2163
+ function moneyBinding(moneyFields, virtualMoneyFields) {
2164
+ validateMoneyFieldPaths(moneyFields);
2165
+ const hasVirtualMoney = virtualMoneyFields !== void 0 && virtualMoneyFields.size > 0;
2166
+ const ordinaryPresentFields = hasVirtualMoney ? Object.fromEntries(Object.entries(moneyFields).filter(([f]) => !virtualMoneyFields.has(f))) : moneyFields;
2167
+ return {
2168
+ brand: "money",
2169
+ posture: { encryptedAtRest: "envelope", queryable: "ordered", exportable: true, forgettable: true },
2170
+ covers: (field) => field in moneyFields,
2171
+ ingest: (r) => canonicalizeIncomingMoney(r, moneyFields),
2172
+ canonicalizeStored: (r) => canonicalizeStoredMoney(r, moneyFields),
2173
+ encodeWrite: (r) => quantizeMoneyFields(r, moneyFields),
2174
+ present: (r, ctx) => decodeMoneyFields(r, ordinaryPresentFields, typeof ctx.locale === "string" ? ctx.locale : void 0),
2175
+ ...hasVirtualMoney ? {
2176
+ presentLate: (r, ctx) => presentVirtualMoneyFields(r, moneyFields, virtualMoneyFields, typeof ctx.locale === "string" ? ctx.locale : void 0)
2177
+ } : {},
2178
+ buildClause: (field, op, value) => {
2179
+ const desc = moneyFields[field];
2180
+ if (!desc) return void 0;
2181
+ return moneyFieldClause(field, op, value, desc);
2182
+ },
2183
+ evaluateClause: (actual, op, payload) => evaluateMoneyClause(actual, op, payload),
2184
+ indexProbe: (op, payload) => moneyIndexProbe(op, payload),
2185
+ canonicalizeIndexKey: (field, rawValue) => canonicalizeMoneyIndexKey(field, rawValue, moneyFields),
2186
+ decodeResults: (r) => decodeMoneyFields(r, moneyFields, "raw"),
2187
+ compareForOrder: (field, a, b) => {
2188
+ const desc = moneyFields[field];
2189
+ if (!desc) return void 0;
2190
+ const av = moneyScaledValue(a, desc);
2191
+ const bv = moneyScaledValue(b, desc);
2192
+ if (av === null) return bv === null ? 0 : 1;
2193
+ if (bv === null) return -1;
2194
+ return av < bv ? -1 : av > bv ? 1 : 0;
2195
+ },
2196
+ wrapReducers: (spec) => wrapMoneyReducers(spec, moneyFields)
2197
+ };
2198
+ }
2199
+ function linkMoneyVia() {
2200
+ installViaBinder("money", (cfg) => {
2201
+ const c = cfg;
2202
+ return moneyBinding(c.moneyFields, c.virtualMoneyFields);
2203
+ });
2204
+ }
2205
+
2206
+ // src/via/money/descriptor.ts
2207
+ var MoneyPrecisionError = class extends NoydbError {
2208
+ constructor(field, value, scale) {
2209
+ super(
2210
+ "MONEY_PRECISION",
2211
+ `money: value ${JSON.stringify(value)} for field "${field}" exceeds scale ${scale} and no rounding mode is configured`
2212
+ );
2213
+ this.field = field;
2214
+ this.value = value;
2215
+ this.scale = scale;
2216
+ this.name = "MoneyPrecisionError";
2217
+ }
2218
+ field;
2219
+ value;
2220
+ scale;
2221
+ };
2222
+ var MoneyCurrencyError = class extends NoydbError {
2223
+ constructor(currency, reason, field) {
2224
+ super(
2225
+ "MONEY_CURRENCY",
2226
+ 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`
2227
+ );
2228
+ this.currency = currency;
2229
+ this.reason = reason;
2230
+ this.field = field;
2231
+ this.name = "MoneyCurrencyError";
2232
+ }
2233
+ currency;
2234
+ reason;
2235
+ field;
2236
+ };
2237
+ var MoneyUnsupportedError = class extends NoydbError {
2238
+ constructor(field, message) {
2239
+ super(
2240
+ "MONEY_UNSUPPORTED",
2241
+ message ?? `money: operation is not supported on field "${field}" \u2014 use sum() and count() and divide at the boundary`
2242
+ );
2243
+ this.field = field;
2244
+ this.name = "MoneyUnsupportedError";
2245
+ }
2246
+ field;
2247
+ };
2248
+ function isMultiOptions(o) {
2249
+ return "currencies" in o;
2250
+ }
2251
+ function money(options) {
2252
+ linkMoneyVia();
2253
+ const hasFixed = "currency" in options;
2254
+ const hasMulti = "currencies" in options;
2255
+ if (hasFixed && hasMulti) {
2256
+ throw new TypeError("money: `currency` and `currencies` are mutually exclusive");
2257
+ }
2258
+ if (!hasFixed && !hasMulti) {
2259
+ throw new TypeError("money: one of `currency` or `currencies` is required");
2260
+ }
2261
+ const rounding = options.rounding;
2262
+ if (isMultiOptions(options)) {
2263
+ const overrides = options.scaleOverrides ?? {};
2264
+ const allowList = options.currencies;
2265
+ const allows = (c) => allowList === "any" ? true : allowList.includes(c);
2266
+ const scaleFor = (c) => {
2267
+ if (!allows(c)) throw new MoneyCurrencyError(c, "not-allowed");
2268
+ const s = overrides[c] ?? scaleForCurrency(c);
2269
+ if (s === null || s === void 0) throw new MoneyCurrencyError(c, "unknown-scale");
2270
+ return s;
2271
+ };
2272
+ if (allowList !== "any") for (const c of allowList) scaleFor(c);
2273
+ const soleCurrency = () => allowList !== "any" && allowList.length === 1 ? allowList[0] : void 0;
2274
+ return {
2275
+ _noydbMoney: true,
2276
+ _viaBrand: "money",
2277
+ mode: "multi",
2278
+ options,
2279
+ rounding,
2280
+ fixedCurrency: void 0,
2281
+ scaleFor,
2282
+ allows,
2283
+ soleCurrency
2284
+ };
2285
+ }
2286
+ const currency = options.currency;
2287
+ const resolvedScale = options.scale ?? scaleForCurrency(currency);
2288
+ if (resolvedScale === null || resolvedScale === void 0) {
2289
+ throw new MoneyCurrencyError(currency, "unknown-scale");
2290
+ }
2291
+ return {
2292
+ _noydbMoney: true,
2293
+ _viaBrand: "money",
2294
+ mode: "fixed",
2295
+ options,
2296
+ rounding,
2297
+ fixedCurrency: currency,
2298
+ scaleFor(c) {
2299
+ if (c !== currency) throw new MoneyCurrencyError(c, "not-allowed");
2300
+ return resolvedScale;
2301
+ },
2302
+ allows: (c) => c === currency,
2303
+ soleCurrency: () => currency
2304
+ };
2305
+ }
2306
+ function isMoneyDescriptor(x) {
2307
+ return typeof x === "object" && x !== null && x._noydbMoney === true;
2308
+ }
2309
+
2310
+ // src/via/money/arith.ts
1288
2311
  function parseAmount(label, amount, scale, rounding) {
1289
2312
  const r = parseToScaledInt(amount, scale, rounding);
1290
2313
  if (!r.ok) {
@@ -1369,7 +2392,7 @@ function allocate(amount, weights, opts = {}) {
1369
2392
  return base.map((p) => formatScaledInt(negative && p !== 0n ? -p : p, scale));
1370
2393
  }
1371
2394
 
1372
- // src/with-shape/money/branded.ts
2395
+ // src/via/money/branded.ts
1373
2396
  function asMoney(value) {
1374
2397
  if (!isMoneyLike(value)) {
1375
2398
  throw new MoneyUnsupportedError(`asMoney: ${JSON.stringify(value)} is not a finite decimal`);
@@ -1390,6 +2413,296 @@ function isMoneyLike(value) {
1390
2413
  if (typeof value !== "string") return false;
1391
2414
  return decimalScaleOf(value) !== null;
1392
2415
  }
2416
+
2417
+ // src/via/computed/descriptor.ts
2418
+ function computed(fn, opts) {
2419
+ return {
2420
+ _viaBrand: "computed",
2421
+ fn,
2422
+ ...opts?.deps !== void 0 ? { deps: opts.deps } : {},
2423
+ mode: opts?.mode ?? "materialized"
2424
+ };
2425
+ }
2426
+ function isComputedDescriptor(x) {
2427
+ return typeof x === "object" && x !== null && x._viaBrand === "computed";
2428
+ }
2429
+
2430
+ // src/via/lookup/binding.ts
2431
+ function hasLabelSource(desc) {
2432
+ return !(desc.backing === "static" && desc.table === void 0);
2433
+ }
2434
+ async function fetchLookupLabel(desc, key, effLocale, fieldFallback, cfg) {
2435
+ if (desc.backing === "collection") {
2436
+ const getRow = cfg.getLookupBacking?.(desc);
2437
+ const row = getRow ? await getRow(key) : void 0;
2438
+ const labelField = desc.present?.label;
2439
+ if (!row || labelField === void 0) return void 0;
2440
+ const raw = row[labelField];
2441
+ if (desc.present?.by !== void 0) {
2442
+ return raw && typeof raw === "object" ? raw[effLocale] : void 0;
2443
+ }
2444
+ return typeof raw === "string" ? raw : void 0;
2445
+ }
2446
+ return cfg.lookupLabelResolver?.(desc.dimension, key, effLocale, fieldFallback);
2447
+ }
2448
+ async function runLookupPresent(record, ctx, cfg) {
2449
+ const fields = Object.entries(cfg.lookupFields).filter(([, d]) => hasLabelSource(d));
2450
+ if (fields.length === 0) return record;
2451
+ const locale = typeof ctx.locale === "string" ? ctx.locale : void 0;
2452
+ const fallback = ctx.fallback;
2453
+ const layer = ctx.layer;
2454
+ if (locale === "raw") return record;
2455
+ const hasStaticDisplay = fields.some(([, d]) => d.backing === "static" && d.displayLocale !== void 0);
2456
+ if (!locale && !hasStaticDisplay) return record;
2457
+ let result = record;
2458
+ const withLabels = { ...result };
2459
+ for (const [field, desc] of fields) {
2460
+ const policy = desc.onMissing ? resolvePolicy(desc.onMissing, layer) : "null";
2461
+ const fieldFallback = policy === "substitute" ? fallback ?? desc.substitute : fallback;
2462
+ const effLocale = locale ?? (desc.backing === "static" ? desc.displayLocale : void 0);
2463
+ const resolveKey = async (key) => {
2464
+ if (!effLocale) {
2465
+ if (policy === "throw") {
2466
+ throw new LocaleNotSpecifiedError(field, `lookup "${field}": no locale active to resolve key "${key}".`);
2467
+ }
2468
+ return null;
2469
+ }
2470
+ const label = await fetchLookupLabel(desc, key, effLocale, fieldFallback, cfg);
2471
+ if (label === void 0) {
2472
+ if (policy === "throw") {
2473
+ throw new LocaleNotSpecifiedError(field, `lookup "${field}": no label for key "${key}" in locale "${effLocale}".`);
2474
+ }
2475
+ return null;
2476
+ }
2477
+ return label;
2478
+ };
2479
+ if (field.includes("[].")) {
2480
+ const parts = field.split("[].");
2481
+ const arrayKey = parts[0];
2482
+ const leaf = parts[1];
2483
+ if (!leaf || leaf.includes(".")) continue;
2484
+ const arr = withLabels[arrayKey];
2485
+ if (!Array.isArray(arr)) continue;
2486
+ const labelKey = `${leaf}Label`;
2487
+ withLabels[arrayKey] = await Promise.all(
2488
+ arr.map(async (el) => {
2489
+ if (!el || typeof el !== "object" || Array.isArray(el)) return el;
2490
+ const k = el[leaf];
2491
+ if (typeof k !== "string") return el;
2492
+ return { ...el, [labelKey]: await resolveKey(k) };
2493
+ })
2494
+ );
2495
+ continue;
2496
+ }
2497
+ const val = result[field];
2498
+ if (Array.isArray(val)) {
2499
+ withLabels[`${field}Label`] = await Promise.all(
2500
+ val.map(async (k) => ({ key: k, label: typeof k === "string" ? await resolveKey(k) : null }))
2501
+ );
2502
+ } else if (typeof val === "string") {
2503
+ const label = await resolveKey(val);
2504
+ if (label !== null) withLabels[`${field}Label`] = label;
2505
+ }
2506
+ }
2507
+ result = withLabels;
2508
+ return result;
2509
+ }
2510
+ function buildLookupDescribeFragment(cfg) {
2511
+ const lookupFields = {};
2512
+ for (const [field, desc] of Object.entries(cfg.lookupFields)) {
2513
+ lookupFields[field] = {
2514
+ ...desc.dimension !== "" ? { dimension: desc.dimension } : {},
2515
+ backing: desc.backing,
2516
+ vocabulary: desc.vocabulary,
2517
+ key: desc.key,
2518
+ onDelete: desc.onDelete,
2519
+ ...desc.altKeys !== void 0 ? { altKeys: desc.altKeys } : {},
2520
+ ...desc.present !== void 0 ? { present: desc.present } : {},
2521
+ ...desc.sortBy !== void 0 ? { sortBy: desc.sortBy } : {},
2522
+ // #657 — static tier: when no `keys` was explicitly declared but a
2523
+ // `table` was (the staticDict()-equivalent `lookup(dim, {backing:
2524
+ // 'static', table})` shape), the table's own key set IS the
2525
+ // statically-known closed-vocabulary set the DescribedField.lookup
2526
+ // docblock promises ("declared `keys`, OR a static table's own
2527
+ // keys"). Reserved/matrix tiers never carry `table`, so this branch
2528
+ // never fires for them — their `keys` emission is unchanged.
2529
+ ...desc.keys !== void 0 ? { keys: desc.keys } : desc.backing === "static" && desc.table !== void 0 ? { keys: Object.keys(desc.table) } : {}
2530
+ };
2531
+ }
2532
+ return { lookupFields };
2533
+ }
2534
+ function getAltIndexOrThrow(field, desc, cfg) {
2535
+ try {
2536
+ return cfg.getAltIndex?.(desc);
2537
+ } catch (err) {
2538
+ if (err instanceof Error && err.message.includes("lazy-mode")) {
2539
+ throw new ValidationError(
2540
+ `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.`
2541
+ );
2542
+ }
2543
+ throw err;
2544
+ }
2545
+ }
2546
+ function runLookupIngest(record, cfg) {
2547
+ const withAltKeys = Object.entries(cfg.lookupFields).filter(([, d]) => (d.altKeys?.length ?? 0) > 0);
2548
+ if (withAltKeys.length === 0) return record;
2549
+ let result = record;
2550
+ for (const [field, desc] of withAltKeys) {
2551
+ const backing = getAltIndexOrThrow(field, desc, cfg);
2552
+ if (!backing || backing.altIndex.size === 0) continue;
2553
+ if (field.includes("[].")) {
2554
+ const [arrayKey, leaf] = field.split("[].");
2555
+ if (!leaf || leaf.includes(".")) continue;
2556
+ const arr = record[arrayKey];
2557
+ if (!Array.isArray(arr)) continue;
2558
+ let changed = false;
2559
+ const normalized = arr.map((item) => {
2560
+ if (!item || typeof item !== "object" || Array.isArray(item)) return item;
2561
+ const value2 = item[leaf];
2562
+ if (typeof value2 !== "string") return item;
2563
+ const canonical2 = backing.altIndex.get(value2);
2564
+ if (canonical2 === void 0 || canonical2 === value2) return item;
2565
+ changed = true;
2566
+ return { ...item, [leaf]: canonical2 };
2567
+ });
2568
+ if (!changed) continue;
2569
+ if (result === record) result = { ...record };
2570
+ result[arrayKey] = normalized;
2571
+ continue;
2572
+ }
2573
+ const values = getAtPath(record, field);
2574
+ if (values.length !== 1) continue;
2575
+ const value = values[0];
2576
+ if (Array.isArray(value)) {
2577
+ if (value.length === 0) continue;
2578
+ let changed = false;
2579
+ const normalized = value.map((el) => {
2580
+ if (typeof el !== "string") return el;
2581
+ const canonical2 = backing.altIndex.get(el);
2582
+ if (canonical2 === void 0 || canonical2 === el) return el;
2583
+ changed = true;
2584
+ return canonical2;
2585
+ });
2586
+ if (!changed) continue;
2587
+ if (result === record) result = { ...record };
2588
+ setAtPathInPlace(result, field, normalized);
2589
+ continue;
2590
+ }
2591
+ if (typeof value !== "string") continue;
2592
+ const canonical = backing.altIndex.get(value);
2593
+ if (canonical === void 0 || canonical === value) continue;
2594
+ if (result === record) result = { ...record };
2595
+ setAtPathInPlace(result, field, canonical);
2596
+ }
2597
+ return result;
2598
+ }
2599
+ async function runLookupEnforceWrite(record, cfg) {
2600
+ for (const [field, desc] of Object.entries(cfg.lookupFields)) {
2601
+ if (desc.vocabulary !== "closed") continue;
2602
+ for (const value of getAtPath(record, field)) {
2603
+ if (Array.isArray(value)) {
2604
+ for (const el of value) {
2605
+ if (typeof el !== "string") continue;
2606
+ const known2 = cfg.membership ? await cfg.membership(field, el) : true;
2607
+ if (!known2) throw new UnknownLookupKeyError(desc.dimension, field, el);
2608
+ }
2609
+ continue;
2610
+ }
2611
+ if (typeof value !== "string") continue;
2612
+ const known = cfg.membership ? await cfg.membership(field, value) : true;
2613
+ if (!known) throw new UnknownLookupKeyError(desc.dimension, field, value);
2614
+ }
2615
+ }
2616
+ }
2617
+ function compareLookupOrder(field, a, b, cfg) {
2618
+ if (typeof a !== "string" || typeof b !== "string") return void 0;
2619
+ const desc = cfg.lookupFields[field];
2620
+ if (!desc || desc.sortBy === void 0) return void 0;
2621
+ const rows = desc.backing === "static" ? desc.table ? new Map(Object.entries(desc.table)) : void 0 : cfg.snapshotFor?.(desc);
2622
+ if (!rows) return void 0;
2623
+ return buildLookupSnapshot(desc.dimension, rows, desc).compareKeys(a, b, desc.displayLocale ?? "");
2624
+ }
2625
+ function resolveLookupOrderLabel(field, key, locale, cfg) {
2626
+ const desc = cfg.lookupFields[field];
2627
+ if (!desc) return void 0;
2628
+ const rows = desc.backing === "static" ? desc.table ? new Map(Object.entries(desc.table)) : void 0 : cfg.snapshotFor?.(desc);
2629
+ if (!rows) return void 0;
2630
+ return buildLookupSnapshot(desc.dimension, rows, desc).label(key, locale ?? desc.displayLocale ?? "");
2631
+ }
2632
+ function lookupBinding(cfg) {
2633
+ return {
2634
+ brand: "lookup",
2635
+ posture: { encryptedAtRest: "envelope", queryable: "full", exportable: true, forgettable: false },
2636
+ reservedPrefixes: ["_dict_", "_lookup_"],
2637
+ covers: (field) => field in cfg.lookupFields,
2638
+ ingest: (record) => runLookupIngest(record, cfg),
2639
+ enforceWrite: (record) => runLookupEnforceWrite(record, cfg),
2640
+ present: async (record, ctx) => runLookupPresent(record, ctx, cfg),
2641
+ compareForOrder: (field, a, b) => compareLookupOrder(field, a, b, cfg),
2642
+ resolveOrderLabel: (field, key, locale) => resolveLookupOrderLabel(field, key, locale, cfg),
2643
+ describeFragment: () => buildLookupDescribeFragment(cfg)
2644
+ };
2645
+ }
2646
+ function linkLookupVia() {
2647
+ installViaBinder("lookup", (c) => lookupBinding(c));
2648
+ }
2649
+
2650
+ // src/via/lookup/descriptor.ts
2651
+ function warnIfSortByNeedsDisplayLocale(dimension, opts) {
2652
+ if (opts?.sortBy !== void 0 && opts.present?.by !== void 0 && opts.displayLocale === void 0) {
2653
+ console.warn(
2654
+ `[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.`
2655
+ );
2656
+ }
2657
+ }
2658
+ function lookup(dimension, opts) {
2659
+ linkLookupVia();
2660
+ warnIfSortByNeedsDisplayLocale(dimension, opts);
2661
+ return {
2662
+ _viaBrand: "lookup",
2663
+ dimension,
2664
+ key: opts?.key ?? "id",
2665
+ vocabulary: opts?.vocabulary ?? "open",
2666
+ backing: opts?.backing ?? "collection",
2667
+ onDelete: opts?.onDelete ?? "restrict",
2668
+ ...opts?.altKeys !== void 0 ? { altKeys: opts.altKeys } : {},
2669
+ ...opts?.present !== void 0 ? { present: opts.present } : {},
2670
+ ...opts?.sortBy !== void 0 ? { sortBy: opts.sortBy } : {},
2671
+ ...opts?.keys !== void 0 ? { keys: opts.keys } : {},
2672
+ ...opts?.table !== void 0 ? { table: opts.table } : {},
2673
+ ...opts?.displayLocale !== void 0 ? { displayLocale: opts.displayLocale } : {},
2674
+ ...opts?.onMissing !== void 0 ? { onMissing: opts.onMissing } : {},
2675
+ ...opts?.substitute !== void 0 ? { substitute: opts.substitute } : {},
2676
+ ...opts?.labels !== void 0 ? { labels: opts.labels } : {}
2677
+ };
2678
+ }
2679
+ function enumOf(keys) {
2680
+ linkLookupVia();
2681
+ return {
2682
+ _viaBrand: "lookup",
2683
+ dimension: "",
2684
+ key: "id",
2685
+ vocabulary: "closed",
2686
+ backing: "static",
2687
+ onDelete: "restrict",
2688
+ keys
2689
+ };
2690
+ }
2691
+ function dict(dimension, opts) {
2692
+ linkLookupVia();
2693
+ return {
2694
+ _viaBrand: "lookup",
2695
+ dimension,
2696
+ key: "id",
2697
+ vocabulary: opts?.vocabulary ?? "open",
2698
+ backing: "reserved",
2699
+ onDelete: opts?.onDelete ?? "restrict",
2700
+ ...opts?.keys !== void 0 ? { keys: opts.keys } : {},
2701
+ ...opts?.present !== void 0 ? { present: opts.present } : {},
2702
+ ...opts?.onMissing !== void 0 ? { onMissing: opts.onMissing } : {},
2703
+ ...opts?.substitute !== void 0 ? { substitute: opts.substitute } : {}
2704
+ };
2705
+ }
1393
2706
  export {
1394
2707
  Aggregation,
1395
2708
  AlreadyElevatedError,
@@ -1410,6 +2723,13 @@ export {
1410
2723
  BundleVersionConflictError,
1411
2724
  CONSENT_AUDIT_COLLECTION,
1412
2725
  CargoNotEnabledError,
2726
+ ClassifiedConfigError,
2727
+ ClassifiedNeverStoredError,
2728
+ ClassifiedNotEnabledError,
2729
+ ClassifiedRevealError,
2730
+ ClassifiedRotationError,
2731
+ ClassifiedValidationError,
2732
+ ClassifiedVerifyError,
1413
2733
  Collection,
1414
2734
  CollectionFrame,
1415
2735
  CollectionIndexes,
@@ -1442,7 +2762,7 @@ export {
1442
2762
  DerivationOutputUnknownError,
1443
2763
  DictKeyInUseError,
1444
2764
  DictKeyMissingError,
1445
- DictionaryHandle,
2765
+ LookupHandle as DictionaryHandle,
1446
2766
  DirectoryDisabledError,
1447
2767
  ELEVATION_AUDIT_COLLECTION,
1448
2768
  ElevatedHandle,
@@ -1452,6 +2772,7 @@ export {
1452
2772
  EnclaveNotSupportedError,
1453
2773
  ExportCapabilityError,
1454
2774
  FieldFrozenError,
2775
+ FieldNotQueryableError,
1455
2776
  FilenameSanitizationError,
1456
2777
  ForgetStrategyNotConfiguredError,
1457
2778
  GROUPBY_MAX_CARDINALITY,
@@ -1505,6 +2826,7 @@ export {
1505
2826
  NO_CUSTODY,
1506
2827
  NO_SEARCH,
1507
2828
  NO_SEQUENCE,
2829
+ NO_TEAM,
1508
2830
  NetworkError,
1509
2831
  NoAccessError,
1510
2832
  NonAdditiveSchemaChangeError,
@@ -1546,6 +2868,7 @@ export {
1546
2868
  RefScopeError,
1547
2869
  ReservedCollectionNameError,
1548
2870
  ReservedVaultNameError,
2871
+ RestrictRefUnresolvableError,
1549
2872
  SCHEMAS_COLLECTION,
1550
2873
  SEALED_PASSPHRASE_RECORD_ID,
1551
2874
  STATE_VAULT_NAME,
@@ -1577,6 +2900,7 @@ export {
1577
2900
  SyncScheduler,
1578
2901
  SyncTransaction,
1579
2902
  TamperedError,
2903
+ TeamNotEnabledError,
1580
2904
  TierDemoteDeniedError,
1581
2905
  TierNotGrantedError,
1582
2906
  TiersNotEnabledError,
@@ -1588,6 +2912,7 @@ export {
1588
2912
  USER_ENVELOPE_MAX_BYTES,
1589
2913
  UniqueConstraintError,
1590
2914
  UnknownDictCodeError,
2915
+ UnknownLookupKeyError,
1591
2916
  UnknownShardError,
1592
2917
  UnsupportedIndexOptionError,
1593
2918
  UserApi,
@@ -1606,6 +2931,7 @@ export {
1606
2931
  allocate,
1607
2932
  applyI18nLocale,
1608
2933
  applyJoins,
2934
+ applyListProjection,
1609
2935
  applyPatch,
1610
2936
  approveWithdrawal,
1611
2937
  asMoney,
@@ -1620,9 +2946,11 @@ export {
1620
2946
  burnPaperRecoveryEntry,
1621
2947
  canonicalJson,
1622
2948
  checkGate,
2949
+ classified,
1623
2950
  clearDevUnlock,
1624
2951
  compileSequenceFormat,
1625
2952
  computePatch,
2953
+ computed,
1626
2954
  coordinatedCutover,
1627
2955
  count,
1628
2956
  createBundleStore,
@@ -1650,6 +2978,7 @@ export {
1650
2978
  detectMagic,
1651
2979
  detectMimeType,
1652
2980
  diagramAuthConfig,
2981
+ dict,
1653
2982
  dictCollectionName,
1654
2983
  dictKey,
1655
2984
  diff,
@@ -1660,6 +2989,8 @@ export {
1660
2989
  encryptDeterministic,
1661
2990
  enforceScript,
1662
2991
  enrollAuthenticator,
2992
+ enumOf as enum,
2993
+ enumOf,
1663
2994
  envelopePayloadHash,
1664
2995
  estimateEntropy,
1665
2996
  estimateRecordBytes,
@@ -1685,6 +3016,9 @@ export {
1685
3016
  immutableGuard,
1686
3017
  importExternalObjects,
1687
3018
  inferScripts,
3019
+ isClassifiedFieldSpec,
3020
+ isClassifiedGroup,
3021
+ isComputedDescriptor,
1688
3022
  isDeedVault,
1689
3023
  isDevUnlockActive,
1690
3024
  isDictCollectionName,
@@ -1701,6 +3035,7 @@ export {
1701
3035
  isSessionAlive,
1702
3036
  isStaticDictDescriptor,
1703
3037
  isULID,
3038
+ isViaFieldSpec,
1704
3039
  isZodSchema,
1705
3040
  issueDelegation,
1706
3041
  recoverPassphrase as keyringRecoverPassphrase,
@@ -1723,6 +3058,8 @@ export {
1723
3058
  loadUserEnvelope,
1724
3059
  loadVaultPolicy,
1725
3060
  lockSchema,
3061
+ lookup,
3062
+ luhnCheck,
1726
3063
  magicLinkGrantRecordId,
1727
3064
  max,
1728
3065
  memoryObjectProjection,
@@ -1769,6 +3106,7 @@ export {
1769
3106
  requestWithdrawal,
1770
3107
  resetBrotliSupportCache,
1771
3108
  resetJoinWarnings,
3109
+ resolveClassifiedFields,
1772
3110
  resolveCrdtSnapshot,
1773
3111
  resolveI18nText,
1774
3112
  resolvePolicy,
@@ -1805,6 +3143,7 @@ export {
1805
3143
  validateSchemaInput,
1806
3144
  validateSchemaOutput,
1807
3145
  validateSessionPolicy,
3146
+ via,
1808
3147
  visibilityRecordId,
1809
3148
  withArchive,
1810
3149
  withCache,
@@ -1815,6 +3154,7 @@ export {
1815
3154
  withDerivation,
1816
3155
  withGuard,
1817
3156
  withHealthCheck,
3157
+ withLazy,
1818
3158
  withLogging,
1819
3159
  withMaterializedView,
1820
3160
  withMetrics,
@@ -1823,6 +3163,7 @@ export {
1823
3163
  withRollup,
1824
3164
  withSearch,
1825
3165
  withSequence,
3166
+ withTeam,
1826
3167
  withdrawAccessibleData,
1827
3168
  wrapBundleStore,
1828
3169
  wrapPodStore,