@noy-db/hub 0.2.0-pre.17 → 0.2.0-pre.19

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 (301) hide show
  1. package/dist/aggregate/index.cjs +227 -3
  2. package/dist/aggregate/index.cjs.map +1 -1
  3. package/dist/aggregate/index.d.cts +3 -3
  4. package/dist/aggregate/index.d.ts +3 -3
  5. package/dist/aggregate/index.js +5 -4
  6. package/dist/aggregate/index.js.map +1 -1
  7. package/dist/attestation/index.cjs.map +1 -1
  8. package/dist/attestation/index.d.cts +5 -5
  9. package/dist/attestation/index.d.ts +5 -5
  10. package/dist/attestation/index.js +6 -6
  11. package/dist/blobs/index.cjs +4 -10
  12. package/dist/blobs/index.cjs.map +1 -1
  13. package/dist/blobs/index.d.cts +6 -6
  14. package/dist/blobs/index.d.ts +6 -6
  15. package/dist/blobs/index.js +6 -6
  16. package/dist/bundle/index.cjs +1587 -392
  17. package/dist/bundle/index.cjs.map +1 -1
  18. package/dist/bundle/index.d.cts +7 -7
  19. package/dist/bundle/index.d.ts +7 -7
  20. package/dist/bundle/index.js +10 -10
  21. package/dist/{chunk-NBBMMJ2H.js → chunk-3FSMVWBN.js} +4 -4
  22. package/dist/{chunk-HGVSHKZW.js → chunk-3Q2AOPLT.js} +100 -29
  23. package/dist/chunk-3Q2AOPLT.js.map +1 -0
  24. package/dist/{chunk-SHX5QBCI.js → chunk-4ULLGYPA.js} +3 -3
  25. package/dist/{chunk-CD2AVTEM.js → chunk-5IGWRMEC.js} +5 -5
  26. package/dist/{chunk-QO6RGLLD.js → chunk-6KESZO5D.js} +35 -7
  27. package/dist/chunk-6KESZO5D.js.map +1 -0
  28. package/dist/{chunk-GP3SDSH2.js → chunk-6OSOE6BY.js} +15 -2
  29. package/dist/chunk-6OSOE6BY.js.map +1 -0
  30. package/dist/{chunk-F4G63NTZ.js → chunk-7C6VFNIY.js} +2 -2
  31. package/dist/{chunk-XJV6OB4D.js → chunk-7HD67R6U.js} +2 -2
  32. package/dist/{chunk-UMLVJTYV.js → chunk-ADB7GPM3.js} +7 -4
  33. package/dist/chunk-ADB7GPM3.js.map +1 -0
  34. package/dist/{chunk-NYSYPFXJ.js → chunk-B6E5IRPJ.js} +3 -3
  35. package/dist/chunk-CYNTFU2D.js +129 -0
  36. package/dist/chunk-CYNTFU2D.js.map +1 -0
  37. package/dist/{chunk-ZEGSDPB7.js → chunk-DJF3FXW5.js} +35 -1
  38. package/dist/chunk-DJF3FXW5.js.map +1 -0
  39. package/dist/{chunk-3G3W65EQ.js → chunk-DY3EOJEN.js} +2 -2
  40. package/dist/{chunk-YYVZYTWW.js → chunk-E66DSTJP.js} +3 -3
  41. package/dist/{chunk-5LIROIDM.js → chunk-FBLAWK6A.js} +2 -2
  42. package/dist/{chunk-E77UKJYL.js → chunk-FPHRTW2Z.js} +5 -5
  43. package/dist/{state-vault-W2OEABNO.js → chunk-G4PYA575.js} +24 -7
  44. package/dist/chunk-G4PYA575.js.map +1 -0
  45. package/dist/{chunk-U5QCMH3W.js → chunk-GKQAU52M.js} +4 -4
  46. package/dist/{chunk-2FU2FTXD.js → chunk-GYAWXHFO.js} +2 -2
  47. package/dist/{chunk-ROPJVUG3.js → chunk-H42KZXNV.js} +5 -210
  48. package/dist/chunk-H42KZXNV.js.map +1 -0
  49. package/dist/{chunk-XPIHJ34I.js → chunk-IBVTH4JR.js} +4 -4
  50. package/dist/{chunk-C3HYQPV4.js → chunk-IVP5IVON.js} +2 -2
  51. package/dist/{chunk-BL5GYANC.js → chunk-KEDJDWWQ.js} +3 -3
  52. package/dist/{chunk-I5IUYN7B.js → chunk-KNKNOJFS.js} +3 -3
  53. package/dist/chunk-KNKNOJFS.js.map +1 -0
  54. package/dist/{chunk-D77ZQSQQ.js → chunk-KYGGXXT6.js} +829 -170
  55. package/dist/chunk-KYGGXXT6.js.map +1 -0
  56. package/dist/{chunk-J7RWBXFY.js → chunk-LSIIPKYT.js} +2 -2
  57. package/dist/{chunk-BSZOCSDZ.js → chunk-M3FPNTO2.js} +4 -4
  58. package/dist/{chunk-XMVHEWF6.js → chunk-MI36HL5G.js} +4 -4
  59. package/dist/{chunk-ROVO6NPJ.js → chunk-NN6IISZO.js} +58 -3
  60. package/dist/chunk-NN6IISZO.js.map +1 -0
  61. package/dist/{chunk-7H2GEJ3O.js → chunk-OBMYMKGO.js} +29 -6
  62. package/dist/{chunk-7H2GEJ3O.js.map → chunk-OBMYMKGO.js.map} +1 -1
  63. package/dist/{chunk-UNTGHX5A.js → chunk-OKOKPYWH.js} +2 -2
  64. package/dist/{chunk-WV7WV6JO.js → chunk-OY7RX2VL.js} +9 -15
  65. package/dist/chunk-OY7RX2VL.js.map +1 -0
  66. package/dist/{chunk-H2MRGONI.js → chunk-PTGQPWMV.js} +2 -2
  67. package/dist/{chunk-BJSLBUJ7.js → chunk-PWFTQHYX.js} +2 -2
  68. package/dist/{chunk-5AXTH4QZ.js → chunk-Q5MCHUXZ.js} +2 -2
  69. package/dist/{chunk-QHM6XEAH.js → chunk-S22UOMHM.js} +6 -6
  70. package/dist/{chunk-WIAOUFFB.js → chunk-S3XA7G35.js} +2 -2
  71. package/dist/{chunk-SISBMAPO.js → chunk-SHIUFIPW.js} +1 -1
  72. package/dist/chunk-SHIUFIPW.js.map +1 -0
  73. package/dist/{chunk-KCEHMDZF.js → chunk-U7JNBSS3.js} +3 -3
  74. package/dist/{chunk-ZNGPEV5J.js → chunk-V3VIRTTE.js} +3 -3
  75. package/dist/{chunk-TIDXB5DF.js → chunk-V5FZWQNN.js} +4 -4
  76. package/dist/chunk-VEIVAYJ7.js +361 -0
  77. package/dist/chunk-VEIVAYJ7.js.map +1 -0
  78. package/dist/{chunk-AEIKD3PP.js → chunk-VNUE6FHP.js} +3 -3
  79. package/dist/{chunk-DYYYUW5D.js → chunk-WFK2EVYU.js} +10 -2
  80. package/dist/chunk-WFK2EVYU.js.map +1 -0
  81. package/dist/{chunk-XMHUK5PN.js → chunk-X7FJMKT3.js} +2 -2
  82. package/dist/{chunk-FEJDVE3Z.js → chunk-XPH3FWME.js} +7 -2
  83. package/dist/{chunk-FEJDVE3Z.js.map → chunk-XPH3FWME.js.map} +1 -1
  84. package/dist/{chunk-SNMJ7SB3.js → chunk-Y5J63SMF.js} +5 -5
  85. package/dist/{chunk-M476FOQ7.js → chunk-YLRRU72W.js} +2 -2
  86. package/dist/{chunk-DWEBTE2W.js → chunk-YX333DPS.js} +4 -4
  87. package/dist/{chunk-BH3X5L6A.js → chunk-YZE6C3TQ.js} +3 -3
  88. package/dist/consent/index.cjs.map +1 -1
  89. package/dist/consent/index.d.cts +6 -6
  90. package/dist/consent/index.d.ts +6 -6
  91. package/dist/consent/index.js +3 -3
  92. package/dist/{crypto-7BN2HDWG.js → crypto-B46VNH6X.js} +3 -3
  93. package/dist/{delegation-MGH5SODX.js → delegation-5HON72PV.js} +5 -5
  94. package/dist/derivations/index.cjs +82 -2
  95. package/dist/derivations/index.cjs.map +1 -1
  96. package/dist/derivations/index.d.cts +7 -7
  97. package/dist/derivations/index.d.ts +7 -7
  98. package/dist/derivations/index.js +8 -6
  99. package/dist/{dev-unlock-iXbYFAWl.d.cts → dev-unlock-BR1rMOS-.d.cts} +1 -1
  100. package/dist/{dev-unlock-CI1ijTML.d.ts → dev-unlock-whL49sxV.d.ts} +1 -1
  101. package/dist/{errors-Dz64FA65.d.cts → errors-DL-zTrrF.d.cts} +29 -1
  102. package/dist/{errors-Dz64FA65.d.ts → errors-DL-zTrrF.d.ts} +29 -1
  103. package/dist/executor-44R5CUS2.js +12 -0
  104. package/dist/executor-AOACUK7Z.js +8 -0
  105. package/dist/executor-OKFLQCDW.js +8 -0
  106. package/dist/{fanout-sidecar-FIJJ46YG.js → fanout-sidecar-DCQWJQ6S.js} +2 -2
  107. package/dist/forget/index.cjs.map +1 -1
  108. package/dist/forget/index.d.cts +1 -1
  109. package/dist/forget/index.d.ts +1 -1
  110. package/dist/forget/index.js +4 -4
  111. package/dist/guards/index.cjs +80 -3
  112. package/dist/guards/index.cjs.map +1 -1
  113. package/dist/guards/index.d.cts +7 -7
  114. package/dist/guards/index.d.ts +7 -7
  115. package/dist/guards/index.js +8 -4
  116. package/dist/{hash-tEcM5fnv.d.cts → hash-BEUBmmI4.d.cts} +1 -1
  117. package/dist/{hash-blk7Bkes.d.ts → hash-Dtb7FwWd.d.ts} +1 -1
  118. package/dist/history/index.cjs.map +1 -1
  119. package/dist/history/index.d.cts +7 -7
  120. package/dist/history/index.d.ts +7 -7
  121. package/dist/history/index.js +5 -5
  122. package/dist/i18n/index.cjs +149 -132
  123. package/dist/i18n/index.cjs.map +1 -1
  124. package/dist/i18n/index.d.cts +6 -6
  125. package/dist/i18n/index.d.ts +6 -6
  126. package/dist/i18n/index.js +14 -14
  127. package/dist/{index-u-kWzSrL.d.cts → index-BM7O48Ur.d.cts} +85 -9
  128. package/dist/{index-C-SSRIxP.d.cts → index-BMmajblo.d.cts} +14 -0
  129. package/dist/{index-C-SSRIxP.d.ts → index-BMmajblo.d.ts} +14 -0
  130. package/dist/{index-DpU6KWof.d.ts → index-BelbyUwz.d.ts} +85 -9
  131. package/dist/index.cjs +2206 -992
  132. package/dist/index.cjs.map +1 -1
  133. package/dist/index.d.cts +29 -16
  134. package/dist/index.d.ts +29 -16
  135. package/dist/index.js +76 -54
  136. package/dist/index.js.map +1 -1
  137. package/dist/indexing/index.cjs.map +1 -1
  138. package/dist/indexing/index.js +4 -4
  139. package/dist/issue-EPA2PSWP.js +12 -0
  140. package/dist/{ledger-LFVLHE5H.js → ledger-LS6GXCBP.js} +5 -5
  141. package/dist/materialized-views/index.cjs +257 -4
  142. package/dist/materialized-views/index.cjs.map +1 -1
  143. package/dist/materialized-views/index.d.cts +7 -7
  144. package/dist/materialized-views/index.d.ts +7 -7
  145. package/dist/materialized-views/index.js +8 -7
  146. package/dist/noydb-BVKFP74P.js +38 -0
  147. package/dist/overlay-views/index.cjs.map +1 -1
  148. package/dist/overlay-views/index.d.cts +7 -7
  149. package/dist/overlay-views/index.d.ts +7 -7
  150. package/dist/overlay-views/index.js +4 -4
  151. package/dist/periods/index.cjs.map +1 -1
  152. package/dist/periods/index.d.cts +6 -6
  153. package/dist/periods/index.d.ts +6 -6
  154. package/dist/periods/index.js +5 -5
  155. package/dist/{public-envelope-RXZNP3V6.js → public-envelope-AGU6SS4Z.js} +4 -4
  156. package/dist/query/index.cjs +320 -28
  157. package/dist/query/index.cjs.map +1 -1
  158. package/dist/query/index.d.cts +3 -3
  159. package/dist/query/index.d.ts +3 -3
  160. package/dist/query/index.js +7 -6
  161. package/dist/read-only-facade-EX6WZZBP.js +7 -0
  162. package/dist/registry-ERNAMRDE.js +8 -0
  163. package/dist/registry-EXTHSXQW.js +8 -0
  164. package/dist/{registry-SECUWSGY.js → registry-RDPTFXQ7.js} +3 -3
  165. package/dist/{revoke-B54H2S2W.js → revoke-IFLXEZA5.js} +6 -6
  166. package/dist/sealed-record/index.cjs.map +1 -1
  167. package/dist/sealed-record/index.d.cts +1 -1
  168. package/dist/sealed-record/index.d.ts +1 -1
  169. package/dist/sealed-record/index.js +2 -2
  170. package/dist/session/index.cjs.map +1 -1
  171. package/dist/session/index.d.cts +7 -7
  172. package/dist/session/index.d.ts +7 -7
  173. package/dist/session/index.js +3 -3
  174. package/dist/shadow/index.cjs.map +1 -1
  175. package/dist/shadow/index.d.cts +6 -6
  176. package/dist/shadow/index.d.ts +6 -6
  177. package/dist/shadow/index.js +2 -2
  178. package/dist/{signer-YSXZT574.js → signer-UNWOUJAK.js} +5 -5
  179. package/dist/snapshots/index.cjs.map +1 -1
  180. package/dist/snapshots/index.d.cts +6 -6
  181. package/dist/snapshots/index.d.ts +6 -6
  182. package/dist/snapshots/index.js +4 -4
  183. package/dist/{stale-TOA36SRK.js → stale-NTEV5SLX.js} +2 -2
  184. package/dist/state-vault-TUTFRTOA.js +14 -0
  185. package/dist/state-vault-TUTFRTOA.js.map +1 -0
  186. package/dist/store/index.cjs +8 -0
  187. package/dist/store/index.cjs.map +1 -1
  188. package/dist/store/index.d.cts +13 -6
  189. package/dist/store/index.d.ts +13 -6
  190. package/dist/store/index.js +2 -2
  191. package/dist/{strategy-4M9jo172.d.ts → strategy-BDxQnnTX.d.ts} +315 -4
  192. package/dist/{strategy-CLC1j79g.d.cts → strategy-C5ol6NdV.d.cts} +315 -4
  193. package/dist/sync/index.cjs.map +1 -1
  194. package/dist/sync/index.d.cts +5 -5
  195. package/dist/sync/index.d.ts +5 -5
  196. package/dist/sync/index.js +4 -4
  197. package/dist/team/index.cjs.map +1 -1
  198. package/dist/team/index.d.cts +6 -6
  199. package/dist/team/index.d.ts +6 -6
  200. package/dist/team/index.js +8 -8
  201. package/dist/transition-guard-B1N82hMf.d.cts +165 -0
  202. package/dist/transition-guard-C__YeF3_.d.ts +165 -0
  203. package/dist/tx/index.cjs.map +1 -1
  204. package/dist/tx/index.d.cts +6 -6
  205. package/dist/tx/index.d.ts +6 -6
  206. package/dist/tx/index.js +3 -3
  207. package/dist/{types-CljIHm_J.d.ts → types-CraiZOyO.d.ts} +609 -305
  208. package/dist/{types-CrSpRDuG.d.cts → types-D-gr5t0G.d.cts} +609 -305
  209. package/dist/{ulid-CrI7PPbA.d.cts → ulid-DQnSAP5W.d.cts} +1 -1
  210. package/dist/{ulid-CWfL2Vfv.d.ts → ulid-FFRRHkVf.d.ts} +1 -1
  211. package/dist/util/index.cjs.map +1 -1
  212. package/dist/util/index.js +1 -1
  213. package/dist/{vault-group-DHAHFX2A.js → vault-group-27EV7KB4.js} +205 -8
  214. package/dist/vault-group-27EV7KB4.js.map +1 -0
  215. package/dist/{with-materialized-view-NzF71cG_.d.cts → with-materialized-view-BboqxyV3.d.cts} +1 -1
  216. package/dist/{with-materialized-view-B892zYZV.d.ts → with-materialized-view-CguCeVcT.d.ts} +1 -1
  217. package/dist/{with-overlayed-view-CR6m7CHe.d.ts → with-overlayed-view-DO08u_tx.d.ts} +1 -1
  218. package/dist/{with-overlayed-view-UI8qSGL4.d.cts → with-overlayed-view-mmsg5Of3.d.cts} +1 -1
  219. package/dist/with-rollup-_TyBzz3T.d.ts +47 -0
  220. package/dist/with-rollup-aaxOZcIb.d.cts +47 -0
  221. package/package.json +3 -3
  222. package/dist/chunk-D77ZQSQQ.js.map +0 -1
  223. package/dist/chunk-DYYYUW5D.js.map +0 -1
  224. package/dist/chunk-GP3SDSH2.js.map +0 -1
  225. package/dist/chunk-HGVSHKZW.js.map +0 -1
  226. package/dist/chunk-I5IUYN7B.js.map +0 -1
  227. package/dist/chunk-JDWE6JMX.js +0 -139
  228. package/dist/chunk-JDWE6JMX.js.map +0 -1
  229. package/dist/chunk-PDULVIBY.js +0 -63
  230. package/dist/chunk-PDULVIBY.js.map +0 -1
  231. package/dist/chunk-QO6RGLLD.js.map +0 -1
  232. package/dist/chunk-ROPJVUG3.js.map +0 -1
  233. package/dist/chunk-ROVO6NPJ.js.map +0 -1
  234. package/dist/chunk-SISBMAPO.js.map +0 -1
  235. package/dist/chunk-UMLVJTYV.js.map +0 -1
  236. package/dist/chunk-WV7WV6JO.js.map +0 -1
  237. package/dist/chunk-ZEGSDPB7.js.map +0 -1
  238. package/dist/executor-3W63Y44O.js +0 -11
  239. package/dist/executor-CFFWPWBJ.js +0 -8
  240. package/dist/executor-VDQQOR4F.js +0 -8
  241. package/dist/immutable-guard-B5M95nbq.d.ts +0 -82
  242. package/dist/immutable-guard-qN3zF8o1.d.cts +0 -82
  243. package/dist/issue-TTMGHQ2J.js +0 -12
  244. package/dist/noydb-36S6GQNC.js +0 -37
  245. package/dist/read-only-facade-ITU6L7BL.js +0 -7
  246. package/dist/registry-3YFLZ7WD.js +0 -8
  247. package/dist/registry-TGZISEWC.js +0 -8
  248. package/dist/state-vault-W2OEABNO.js.map +0 -1
  249. package/dist/vault-group-DHAHFX2A.js.map +0 -1
  250. package/dist/with-derivation-BZ2y4bzF.d.ts +0 -13
  251. package/dist/with-derivation-Bozs8DmD.d.cts +0 -13
  252. /package/dist/{chunk-NBBMMJ2H.js.map → chunk-3FSMVWBN.js.map} +0 -0
  253. /package/dist/{chunk-SHX5QBCI.js.map → chunk-4ULLGYPA.js.map} +0 -0
  254. /package/dist/{chunk-CD2AVTEM.js.map → chunk-5IGWRMEC.js.map} +0 -0
  255. /package/dist/{chunk-F4G63NTZ.js.map → chunk-7C6VFNIY.js.map} +0 -0
  256. /package/dist/{chunk-XJV6OB4D.js.map → chunk-7HD67R6U.js.map} +0 -0
  257. /package/dist/{chunk-NYSYPFXJ.js.map → chunk-B6E5IRPJ.js.map} +0 -0
  258. /package/dist/{chunk-3G3W65EQ.js.map → chunk-DY3EOJEN.js.map} +0 -0
  259. /package/dist/{chunk-YYVZYTWW.js.map → chunk-E66DSTJP.js.map} +0 -0
  260. /package/dist/{chunk-5LIROIDM.js.map → chunk-FBLAWK6A.js.map} +0 -0
  261. /package/dist/{chunk-E77UKJYL.js.map → chunk-FPHRTW2Z.js.map} +0 -0
  262. /package/dist/{chunk-U5QCMH3W.js.map → chunk-GKQAU52M.js.map} +0 -0
  263. /package/dist/{chunk-2FU2FTXD.js.map → chunk-GYAWXHFO.js.map} +0 -0
  264. /package/dist/{chunk-XPIHJ34I.js.map → chunk-IBVTH4JR.js.map} +0 -0
  265. /package/dist/{chunk-C3HYQPV4.js.map → chunk-IVP5IVON.js.map} +0 -0
  266. /package/dist/{chunk-BL5GYANC.js.map → chunk-KEDJDWWQ.js.map} +0 -0
  267. /package/dist/{chunk-J7RWBXFY.js.map → chunk-LSIIPKYT.js.map} +0 -0
  268. /package/dist/{chunk-BSZOCSDZ.js.map → chunk-M3FPNTO2.js.map} +0 -0
  269. /package/dist/{chunk-XMVHEWF6.js.map → chunk-MI36HL5G.js.map} +0 -0
  270. /package/dist/{chunk-UNTGHX5A.js.map → chunk-OKOKPYWH.js.map} +0 -0
  271. /package/dist/{chunk-H2MRGONI.js.map → chunk-PTGQPWMV.js.map} +0 -0
  272. /package/dist/{chunk-BJSLBUJ7.js.map → chunk-PWFTQHYX.js.map} +0 -0
  273. /package/dist/{chunk-5AXTH4QZ.js.map → chunk-Q5MCHUXZ.js.map} +0 -0
  274. /package/dist/{chunk-QHM6XEAH.js.map → chunk-S22UOMHM.js.map} +0 -0
  275. /package/dist/{chunk-WIAOUFFB.js.map → chunk-S3XA7G35.js.map} +0 -0
  276. /package/dist/{chunk-KCEHMDZF.js.map → chunk-U7JNBSS3.js.map} +0 -0
  277. /package/dist/{chunk-ZNGPEV5J.js.map → chunk-V3VIRTTE.js.map} +0 -0
  278. /package/dist/{chunk-TIDXB5DF.js.map → chunk-V5FZWQNN.js.map} +0 -0
  279. /package/dist/{chunk-AEIKD3PP.js.map → chunk-VNUE6FHP.js.map} +0 -0
  280. /package/dist/{chunk-XMHUK5PN.js.map → chunk-X7FJMKT3.js.map} +0 -0
  281. /package/dist/{chunk-SNMJ7SB3.js.map → chunk-Y5J63SMF.js.map} +0 -0
  282. /package/dist/{chunk-M476FOQ7.js.map → chunk-YLRRU72W.js.map} +0 -0
  283. /package/dist/{chunk-DWEBTE2W.js.map → chunk-YX333DPS.js.map} +0 -0
  284. /package/dist/{chunk-BH3X5L6A.js.map → chunk-YZE6C3TQ.js.map} +0 -0
  285. /package/dist/{crypto-7BN2HDWG.js.map → crypto-B46VNH6X.js.map} +0 -0
  286. /package/dist/{delegation-MGH5SODX.js.map → delegation-5HON72PV.js.map} +0 -0
  287. /package/dist/{executor-3W63Y44O.js.map → executor-44R5CUS2.js.map} +0 -0
  288. /package/dist/{executor-CFFWPWBJ.js.map → executor-AOACUK7Z.js.map} +0 -0
  289. /package/dist/{executor-VDQQOR4F.js.map → executor-OKFLQCDW.js.map} +0 -0
  290. /package/dist/{fanout-sidecar-FIJJ46YG.js.map → fanout-sidecar-DCQWJQ6S.js.map} +0 -0
  291. /package/dist/{issue-TTMGHQ2J.js.map → issue-EPA2PSWP.js.map} +0 -0
  292. /package/dist/{ledger-LFVLHE5H.js.map → ledger-LS6GXCBP.js.map} +0 -0
  293. /package/dist/{noydb-36S6GQNC.js.map → noydb-BVKFP74P.js.map} +0 -0
  294. /package/dist/{public-envelope-RXZNP3V6.js.map → public-envelope-AGU6SS4Z.js.map} +0 -0
  295. /package/dist/{read-only-facade-ITU6L7BL.js.map → read-only-facade-EX6WZZBP.js.map} +0 -0
  296. /package/dist/{registry-3YFLZ7WD.js.map → registry-ERNAMRDE.js.map} +0 -0
  297. /package/dist/{registry-SECUWSGY.js.map → registry-EXTHSXQW.js.map} +0 -0
  298. /package/dist/{registry-TGZISEWC.js.map → registry-RDPTFXQ7.js.map} +0 -0
  299. /package/dist/{revoke-B54H2S2W.js.map → revoke-IFLXEZA5.js.map} +0 -0
  300. /package/dist/{signer-YSXZT574.js.map → signer-UNWOUJAK.js.map} +0 -0
  301. /package/dist/{stale-TOA36SRK.js.map → stale-NTEV5SLX.js.map} +0 -0
@@ -1,12 +1,12 @@
1
- import { I as I18nStrategy } from '../types-CrSpRDuG.cjs';
2
- export { D as DICT_COLLECTION_PREFIX, a as DictEntry, b as DictKeyDescriptor, c as DictionaryHandle, d as DictionaryOptions, e as I18nMap, f as I18nTextDescriptor, g as I18nTextOptions, L as Layer, O as OnMissing, h as OnMissingPolicy, R as ResolveI18nOptions, S as ScriptWarning, i as StaticDictDescriptor, j as applyI18nLocale, k as dictCollectionName, l as dictKey, m as enforceScript, n as getAtPath, o as i18nText, p as inferScripts, q as isDictCollectionName, r as isDictKeyDescriptor, s as isI18nTextDescriptor, t as isStaticDictDescriptor, u as resolveI18nText, v as resolvePolicy, w as setAtPathInPlace, x as staticDict, y as validateI18nTextValue } from '../types-CrSpRDuG.cjs';
3
- export { D as DictKeyInUseError, a as DictKeyMissingError, L as LocaleNotSpecifiedError, M as MissingTranslationError, R as ReservedCollectionNameError, S as ScriptViolationError, b as StaticDictReadonlyError, T as TranslatorNotConfiguredError, U as UnknownDictCodeError } from '../errors-Dz64FA65.cjs';
1
+ export { I as I18nMap, a as I18nTextDescriptor, b as I18nTextOptions, L as Layer, O as OnMissing, c as OnMissingPolicy, R as ResolveI18nOptions, d as applyI18nLocale, g as getAtPath, i as i18nText, e as isI18nTextDescriptor, r as resolveI18nText, f as resolvePolicy, s as setAtPathInPlace, v as validateI18nTextValue } from '../strategy-C5ol6NdV.cjs';
2
+ import { I as I18nStrategy } from '../types-D-gr5t0G.cjs';
3
+ export { D as DICT_COLLECTION_PREFIX, a as DictEntry, b as DictKeyDescriptor, c as DictionaryHandle, d as DictionaryOptions, S as ScriptWarning, e as StaticDictDescriptor, f as dictCollectionName, g as dictKey, h as enforceScript, i as inferScripts, j as isDictCollectionName, k as isDictKeyDescriptor, l as isStaticDictDescriptor, s as staticDict } from '../types-D-gr5t0G.cjs';
4
+ export { D as DictKeyInUseError, a as DictKeyMissingError, L as LocaleNotSpecifiedError, M as MissingTranslationError, R as ReservedCollectionNameError, S as ScriptViolationError, b as StaticDictReadonlyError, T as TranslatorNotConfiguredError, U as UnknownDictCodeError } from '../errors-DL-zTrrF.cjs';
4
5
  import '../lazy-builder-eYZzLEL1.cjs';
5
6
  import '../predicate-BmhBSPCH.cjs';
6
- import '../strategy-CLC1j79g.cjs';
7
7
  import '../strategy-BSxFXGzb.cjs';
8
- import '../index-C-SSRIxP.cjs';
9
- import '../index-u-kWzSrL.cjs';
8
+ import '../index-BMmajblo.cjs';
9
+ import '../index-BM7O48Ur.cjs';
10
10
  import '@noy-db/attestation';
11
11
 
12
12
  /**
@@ -1,12 +1,12 @@
1
- import { I as I18nStrategy } from '../types-CljIHm_J.js';
2
- export { D as DICT_COLLECTION_PREFIX, a as DictEntry, b as DictKeyDescriptor, c as DictionaryHandle, d as DictionaryOptions, e as I18nMap, f as I18nTextDescriptor, g as I18nTextOptions, L as Layer, O as OnMissing, h as OnMissingPolicy, R as ResolveI18nOptions, S as ScriptWarning, i as StaticDictDescriptor, j as applyI18nLocale, k as dictCollectionName, l as dictKey, m as enforceScript, n as getAtPath, o as i18nText, p as inferScripts, q as isDictCollectionName, r as isDictKeyDescriptor, s as isI18nTextDescriptor, t as isStaticDictDescriptor, u as resolveI18nText, v as resolvePolicy, w as setAtPathInPlace, x as staticDict, y as validateI18nTextValue } from '../types-CljIHm_J.js';
3
- export { D as DictKeyInUseError, a as DictKeyMissingError, L as LocaleNotSpecifiedError, M as MissingTranslationError, R as ReservedCollectionNameError, S as ScriptViolationError, b as StaticDictReadonlyError, T as TranslatorNotConfiguredError, U as UnknownDictCodeError } from '../errors-Dz64FA65.js';
1
+ export { I as I18nMap, a as I18nTextDescriptor, b as I18nTextOptions, L as Layer, O as OnMissing, c as OnMissingPolicy, R as ResolveI18nOptions, d as applyI18nLocale, g as getAtPath, i as i18nText, e as isI18nTextDescriptor, r as resolveI18nText, f as resolvePolicy, s as setAtPathInPlace, v as validateI18nTextValue } from '../strategy-BDxQnnTX.js';
2
+ import { I as I18nStrategy } from '../types-CraiZOyO.js';
3
+ export { D as DICT_COLLECTION_PREFIX, a as DictEntry, b as DictKeyDescriptor, c as DictionaryHandle, d as DictionaryOptions, S as ScriptWarning, e as StaticDictDescriptor, f as dictCollectionName, g as dictKey, h as enforceScript, i as inferScripts, j as isDictCollectionName, k as isDictKeyDescriptor, l as isStaticDictDescriptor, s as staticDict } from '../types-CraiZOyO.js';
4
+ export { D as DictKeyInUseError, a as DictKeyMissingError, L as LocaleNotSpecifiedError, M as MissingTranslationError, R as ReservedCollectionNameError, S as ScriptViolationError, b as StaticDictReadonlyError, T as TranslatorNotConfiguredError, U as UnknownDictCodeError } from '../errors-DL-zTrrF.js';
4
5
  import '../lazy-builder-ChSqcF5t.js';
5
6
  import '../predicate-BmhBSPCH.js';
6
- import '../strategy-4M9jo172.js';
7
7
  import '../strategy-BSxFXGzb.js';
8
- import '../index-C-SSRIxP.js';
9
- import '../index-DpU6KWof.js';
8
+ import '../index-BMmajblo.js';
9
+ import '../index-BelbyUwz.js';
10
10
  import '@noy-db/attestation';
11
11
 
12
12
  /**
@@ -1,29 +1,29 @@
1
- import {
2
- enforceScript,
3
- inferScripts
4
- } from "../chunk-JDWE6JMX.js";
5
1
  import {
6
2
  DICT_COLLECTION_PREFIX,
7
3
  DictionaryHandle,
8
- applyI18nLocale,
9
4
  dictCollectionName,
10
5
  dictKey,
11
- getAtPath,
12
- i18nText,
13
6
  isDictCollectionName,
14
7
  isDictKeyDescriptor,
15
- isI18nTextDescriptor,
16
8
  isStaticDictDescriptor,
9
+ staticDict
10
+ } from "../chunk-H42KZXNV.js";
11
+ import {
12
+ applyI18nLocale,
13
+ enforceScript,
14
+ getAtPath,
15
+ i18nText,
16
+ inferScripts,
17
+ isI18nTextDescriptor,
17
18
  resolveI18nText,
18
19
  resolvePolicy,
19
20
  setAtPathInPlace,
20
- staticDict,
21
21
  validateI18nTextValue
22
- } from "../chunk-ROPJVUG3.js";
23
- import "../chunk-BSZOCSDZ.js";
22
+ } from "../chunk-VEIVAYJ7.js";
23
+ import "../chunk-M3FPNTO2.js";
24
24
  import "../chunk-PDVP3C2I.js";
25
- import "../chunk-SISBMAPO.js";
26
- import "../chunk-UNTGHX5A.js";
25
+ import "../chunk-SHIUFIPW.js";
26
+ import "../chunk-OKOKPYWH.js";
27
27
  import {
28
28
  DictKeyInUseError,
29
29
  DictKeyMissingError,
@@ -34,7 +34,7 @@ import {
34
34
  StaticDictReadonlyError,
35
35
  TranslatorNotConfiguredError,
36
36
  UnknownDictCodeError
37
- } from "../chunk-ZEGSDPB7.js";
37
+ } from "../chunk-DJF3FXW5.js";
38
38
 
39
39
  // src/i18n/active.ts
40
40
  function withI18n() {
@@ -1,6 +1,6 @@
1
1
  import { C as CollectionIndexes, a as Clause, O as Operator } from './predicate-BmhBSPCH.cjs';
2
- import { N as NoydbError } from './errors-Dz64FA65.cjs';
3
- import { v as MoneyDescriptor, A as AggregateStrategy, b as AggregateSpec, c as Aggregation, a as AggregateResult, g as GroupedQuery, h as GroupedQueryN } from './strategy-CLC1j79g.cjs';
2
+ import { N as NoydbError } from './errors-DL-zTrrF.cjs';
3
+ import { a as I18nTextDescriptor, N as MoneyDescriptor, A as AggregateStrategy, j as AggregateSpec, k as Aggregation, h as AggregateResult, o as GroupedQuery, p as GroupedQueryN } from './strategy-C5ol6NdV.cjs';
4
4
 
5
5
  /**
6
6
  * Foreign-key references — the soft-FK mechanism.
@@ -59,7 +59,19 @@ type RefMode = 'strict' | 'warn' | 'cascade';
59
59
  interface RefDescriptor {
60
60
  readonly target: string;
61
61
  readonly mode: RefMode;
62
+ /**
63
+ * Present and `true` only for an array ref (#377-A, `refArray()`): the
64
+ * field holds an ARRAY of ids, each validated against `target`
65
+ * independently (M:N). Absent for a scalar `ref()`. The same `mode`
66
+ * semantics apply per element — strict rejects on a missing element at
67
+ * put + blocks delete of a referenced target; cascade deletes every
68
+ * record whose array contains the deleted id; warn surfaces orphans
69
+ * only via `checkIntegrity()`.
70
+ */
71
+ readonly isArray?: true;
62
72
  }
73
+ /** Runtime predicate: is this an array ref (`refArray()`) vs a scalar `ref()`? */
74
+ declare function isRefArray(desc: RefDescriptor): boolean;
63
75
  /**
64
76
  * Thrown when a strict reference is violated — either `put()` with a
65
77
  * missing target id, or `delete()` of a target that still has
@@ -102,6 +114,30 @@ declare class RefScopeError extends NoydbError {
102
114
  * fails at collection construction time, not at the first put.
103
115
  */
104
116
  declare function ref(target: string, mode?: RefMode): RefDescriptor;
117
+ /**
118
+ * Array reference (#377-A) — the many-to-many soft-FK. The field holds an
119
+ * array of ids; each element is validated against `target` independently.
120
+ *
121
+ * ```ts
122
+ * const orders = company.collection<Order>('orders', {
123
+ * refs: { productIds: refArray('products', 'warn') },
124
+ * })
125
+ * ```
126
+ *
127
+ * Same three `mode` semantics as `ref()`, applied per element:
128
+ * - **strict** — `put()` rejects if ANY element's target is missing;
129
+ * `delete()` of a target is blocked while any record's array still
130
+ * contains its id.
131
+ * - **warn** — both succeed; orphaned elements surface via
132
+ * `vault.checkIntegrity()` (one violation per dangling element).
133
+ * - **cascade** — `delete()` of a target deletes every record whose
134
+ * array contains its id (cycle-safe, like scalar cascade).
135
+ *
136
+ * A `null`/`undefined` field is allowed (no links). Non-array values, or
137
+ * non-string/number elements, are an integrity error. Cross-vault targets
138
+ * are rejected exactly as in `ref()`.
139
+ */
140
+ declare function refArray(target: string, mode?: RefMode): RefDescriptor;
105
141
  /**
106
142
  * Per-vault registry of reference declarations.
107
143
  *
@@ -144,6 +180,7 @@ declare class RefRegistry {
144
180
  collection: string;
145
181
  field: string;
146
182
  mode: RefMode;
183
+ isArray?: true;
147
184
  }>;
148
185
  /**
149
186
  * Iterate every (collection → refs) pair that has at least one
@@ -285,6 +322,16 @@ interface JoinableSource {
285
322
  * (#291). Plain `_dict_*`-backed sources omit it.
286
323
  */
287
324
  readonly displayLocale?: string;
325
+ /**
326
+ * i18nText descriptors of the right-side collection (#285 §3, `join`
327
+ * layer). When present and the query carries a locale, each joined
328
+ * right-side record's i18n fields resolve to that locale at the `join`
329
+ * layer (`resolvePolicy(onMissing, 'join')`) BEFORE it is attached under
330
+ * the leg's alias — so a joined `i18nText` field is a resolved string, not
331
+ * a raw `{ locale }` map. Locale-less queries leave joined fields raw
332
+ * (consistent with a locale-less read).
333
+ */
334
+ readonly i18nFields?: Record<string, I18nTextDescriptor>;
288
335
  /**
289
336
  * Subscribe to mutations on this source. The callback fires
290
337
  * AFTER the underlying record set has been updated. Returns an
@@ -307,6 +354,13 @@ interface JoinableSource {
307
354
  interface JoinContext {
308
355
  /** Name of the left-side (owning) collection. */
309
356
  readonly leftCollection: string;
357
+ /**
358
+ * The owning collection's default locale (#285 §3). Used to resolve joined
359
+ * i18n fields at the `join` layer when a terminal call doesn't pass an
360
+ * explicit locale — so `openVault({ locale })` flows to joins like it does
361
+ * to `get`/`list`. A per-call `toArray({ locale })` overrides it.
362
+ */
363
+ readonly defaultLocale?: string;
310
364
  /** Look up a `RefDescriptor` by field name on the left collection. */
311
365
  resolveRef(field: string): RefDescriptor | null;
312
366
  /** Resolve a right-side source by target collection name. */
@@ -348,7 +402,7 @@ interface JoinContext {
348
402
  * query like `.join('a', { maxRows: 100_000 }).join('b', { maxRows: 50 })`,
349
403
  * which should throw on the second leg if the left set exceeds 50.
350
404
  */
351
- declare function applyJoins(rows: readonly unknown[], joins: readonly JoinLeg[], context: JoinContext): unknown[];
405
+ declare function applyJoins(rows: readonly unknown[], joins: readonly JoinLeg[], context: JoinContext, locale?: string): unknown[];
352
406
  /**
353
407
  * Test-only: reset the join warning deduplication state between
354
408
  * tests. Production code never calls this — the dedup state is
@@ -479,6 +533,13 @@ declare function buildLiveQuery<T>(recompute: () => T[], upstreams: readonly Liv
479
533
  interface OrderBy {
480
534
  readonly field: string;
481
535
  readonly direction: 'asc' | 'desc';
536
+ /**
537
+ * Sort key for a `dictKey`/`staticDict` field (#285): `'value'` (default)
538
+ * sorts by the stored code; `'label'` sorts by the code's resolved label at
539
+ * the query locale (`toArray({ locale })`, or a `staticDict` `displayLocale`).
540
+ * Falls back to the code when no label resolves.
541
+ */
542
+ readonly by?: 'value' | 'label';
482
543
  }
483
544
  /**
484
545
  * A complete query plan: zero-or-more clauses, optional ordering, pagination,
@@ -617,8 +678,14 @@ declare class Query<T> {
617
678
  and(builder: (q: Query<T>) => Query<T>): Query<T>;
618
679
  /** Escape hatch: add an arbitrary predicate function. Not serializable. */
619
680
  filter(fn: (record: T) => boolean): Query<T>;
620
- /** Sort by a field. Subsequent calls are tie-breakers. */
621
- orderBy(field: string, direction?: 'asc' | 'desc'): Query<T>;
681
+ /**
682
+ * Sort by a field. Subsequent calls are tie-breakers. Pass
683
+ * `{ by: 'label' }` to sort a `dictKey`/`staticDict` field by its resolved
684
+ * label at the query locale instead of the stored code (#285).
685
+ */
686
+ orderBy(field: string, direction?: 'asc' | 'desc', opts?: {
687
+ by?: 'value' | 'label';
688
+ }): Query<T>;
622
689
  /** Cap the result size. */
623
690
  limit(n: number): Query<T>;
624
691
  /** Skip the first N matching records (after ordering). */
@@ -721,8 +788,15 @@ declare class Query<T> {
721
788
  * carries any join legs, they are applied after `where` / `orderBy`
722
789
  * / `limit` / `offset` narrow the left set. See the `.join()` doc
723
790
  * for the ordering rationale.
791
+ *
792
+ * `opts.locale` (#285 §3) resolves JOINED right-side i18n fields at the
793
+ * `join` layer to that locale; without it, the owning collection's default
794
+ * locale applies, and a locale-less query leaves joined i18n fields raw.
795
+ * (Left/base i18n fields are resolved by `get`/`list`, not here.)
724
796
  */
725
- toArray(): T[];
797
+ toArray(opts?: {
798
+ locale?: string;
799
+ }): T[];
726
800
  /**
727
801
  * Decode this source's money fields on read (stored scaled-int → canonical
728
802
  * decimal), so `query().toArray()` agrees with `get()`/`sum()` on the value.
@@ -736,8 +810,10 @@ declare class Query<T> {
736
810
  * money read through `get()`/`list()` with a locale.
737
811
  */
738
812
  private decodeMoney;
739
- /** Return the first matching record, or null. Joins are applied. */
740
- first(): T | null;
813
+ /** Return the first matching record, or null. Joins are applied. `opts.locale` resolves joined i18n fields (#285 §3). */
814
+ first(opts?: {
815
+ locale?: string;
816
+ }): T | null;
741
817
  /**
742
818
  * Return the number of matching records (after where/filter,
743
819
  * before limit). **Joins are NOT applied** — count() reports the
@@ -1229,4 +1305,4 @@ declare class ScanBuilder<T> implements AsyncIterable<T> {
1229
1305
  private recordMatches;
1230
1306
  }
1231
1307
 
1232
- export { DEFAULT_CROSS_JOIN_MAX_ROWS as D, type JoinContext as J, type LiveQuery as L, type OrderBy as O, Query as Q, type RefDescriptor as R, ScanBuilder as S, DEFAULT_JOIN_MAX_ROWS as a, type JoinLeg as b, type JoinStrategy as c, type JoinableSource as d, type LiveUpstream as e, type QueryPlan as f, type QuerySource as g, RefIntegrityError as h, type RefMode as i, RefRegistry as j, RefScopeError as k, type RefViolation as l, type ScanPageProvider as m, applyJoins as n, buildLiveQuery as o, executePlan as p, resetJoinWarnings as q, ref as r };
1308
+ export { DEFAULT_CROSS_JOIN_MAX_ROWS as D, type JoinContext as J, type LiveQuery as L, type OrderBy as O, Query as Q, type RefDescriptor as R, ScanBuilder as S, DEFAULT_JOIN_MAX_ROWS as a, type JoinLeg as b, type JoinStrategy as c, type JoinableSource as d, type LiveUpstream as e, type QueryPlan as f, type QuerySource as g, RefIntegrityError as h, type RefMode as i, RefRegistry as j, RefScopeError as k, type RefViolation as l, type ScanPageProvider as m, applyJoins as n, buildLiveQuery as o, executePlan as p, isRefArray as q, ref as r, refArray as s, resetJoinWarnings as t };
@@ -333,6 +333,20 @@ interface ForgetResult {
333
333
  readonly blobsRetainedShared: number;
334
334
  /** Collections with blobs that could NOT be crypto-shredded — legacy (no `_cek`) or blobs disabled (see type docs). */
335
335
  readonly blobResidueCollections: readonly string[];
336
+ /**
337
+ * Count of persisted `_idx/<field>/<recordId>` index side-cars hard-deleted
338
+ * across the shredded records (#401). These live under the retained
339
+ * collection DEK, so crypto-shred alone would leave the indexed field VALUES
340
+ * readable — `forget()` must delete them.
341
+ */
342
+ readonly indexPostingsPurged: number;
343
+ /**
344
+ * `collection:id:field` entries whose persisted `_idx` side-car could NOT be
345
+ * deleted (#401) — index residue that still leaks the indexed value under the
346
+ * retained collection DEK. Non-empty means erasure is INCOMPLETE: retry, or
347
+ * purge the side-car out of band.
348
+ */
349
+ readonly indexResidue: readonly string[];
336
350
  /** The single `op:'forget'` ledger entry appended for this erasure. */
337
351
  readonly ledgerEntry: LedgerEntry;
338
352
  }
@@ -333,6 +333,20 @@ interface ForgetResult {
333
333
  readonly blobsRetainedShared: number;
334
334
  /** Collections with blobs that could NOT be crypto-shredded — legacy (no `_cek`) or blobs disabled (see type docs). */
335
335
  readonly blobResidueCollections: readonly string[];
336
+ /**
337
+ * Count of persisted `_idx/<field>/<recordId>` index side-cars hard-deleted
338
+ * across the shredded records (#401). These live under the retained
339
+ * collection DEK, so crypto-shred alone would leave the indexed field VALUES
340
+ * readable — `forget()` must delete them.
341
+ */
342
+ readonly indexPostingsPurged: number;
343
+ /**
344
+ * `collection:id:field` entries whose persisted `_idx` side-car could NOT be
345
+ * deleted (#401) — index residue that still leaks the indexed value under the
346
+ * retained collection DEK. Non-empty means erasure is INCOMPLETE: retry, or
347
+ * purge the side-car out of band.
348
+ */
349
+ readonly indexResidue: readonly string[];
336
350
  /** The single `op:'forget'` ledger entry appended for this erasure. */
337
351
  readonly ledgerEntry: LedgerEntry;
338
352
  }
@@ -1,6 +1,6 @@
1
1
  import { C as CollectionIndexes, a as Clause, O as Operator } from './predicate-BmhBSPCH.js';
2
- import { N as NoydbError } from './errors-Dz64FA65.js';
3
- import { v as MoneyDescriptor, A as AggregateStrategy, b as AggregateSpec, c as Aggregation, a as AggregateResult, g as GroupedQuery, h as GroupedQueryN } from './strategy-4M9jo172.js';
2
+ import { N as NoydbError } from './errors-DL-zTrrF.js';
3
+ import { a as I18nTextDescriptor, N as MoneyDescriptor, A as AggregateStrategy, j as AggregateSpec, k as Aggregation, h as AggregateResult, o as GroupedQuery, p as GroupedQueryN } from './strategy-BDxQnnTX.js';
4
4
 
5
5
  /**
6
6
  * Foreign-key references — the soft-FK mechanism.
@@ -59,7 +59,19 @@ type RefMode = 'strict' | 'warn' | 'cascade';
59
59
  interface RefDescriptor {
60
60
  readonly target: string;
61
61
  readonly mode: RefMode;
62
+ /**
63
+ * Present and `true` only for an array ref (#377-A, `refArray()`): the
64
+ * field holds an ARRAY of ids, each validated against `target`
65
+ * independently (M:N). Absent for a scalar `ref()`. The same `mode`
66
+ * semantics apply per element — strict rejects on a missing element at
67
+ * put + blocks delete of a referenced target; cascade deletes every
68
+ * record whose array contains the deleted id; warn surfaces orphans
69
+ * only via `checkIntegrity()`.
70
+ */
71
+ readonly isArray?: true;
62
72
  }
73
+ /** Runtime predicate: is this an array ref (`refArray()`) vs a scalar `ref()`? */
74
+ declare function isRefArray(desc: RefDescriptor): boolean;
63
75
  /**
64
76
  * Thrown when a strict reference is violated — either `put()` with a
65
77
  * missing target id, or `delete()` of a target that still has
@@ -102,6 +114,30 @@ declare class RefScopeError extends NoydbError {
102
114
  * fails at collection construction time, not at the first put.
103
115
  */
104
116
  declare function ref(target: string, mode?: RefMode): RefDescriptor;
117
+ /**
118
+ * Array reference (#377-A) — the many-to-many soft-FK. The field holds an
119
+ * array of ids; each element is validated against `target` independently.
120
+ *
121
+ * ```ts
122
+ * const orders = company.collection<Order>('orders', {
123
+ * refs: { productIds: refArray('products', 'warn') },
124
+ * })
125
+ * ```
126
+ *
127
+ * Same three `mode` semantics as `ref()`, applied per element:
128
+ * - **strict** — `put()` rejects if ANY element's target is missing;
129
+ * `delete()` of a target is blocked while any record's array still
130
+ * contains its id.
131
+ * - **warn** — both succeed; orphaned elements surface via
132
+ * `vault.checkIntegrity()` (one violation per dangling element).
133
+ * - **cascade** — `delete()` of a target deletes every record whose
134
+ * array contains its id (cycle-safe, like scalar cascade).
135
+ *
136
+ * A `null`/`undefined` field is allowed (no links). Non-array values, or
137
+ * non-string/number elements, are an integrity error. Cross-vault targets
138
+ * are rejected exactly as in `ref()`.
139
+ */
140
+ declare function refArray(target: string, mode?: RefMode): RefDescriptor;
105
141
  /**
106
142
  * Per-vault registry of reference declarations.
107
143
  *
@@ -144,6 +180,7 @@ declare class RefRegistry {
144
180
  collection: string;
145
181
  field: string;
146
182
  mode: RefMode;
183
+ isArray?: true;
147
184
  }>;
148
185
  /**
149
186
  * Iterate every (collection → refs) pair that has at least one
@@ -285,6 +322,16 @@ interface JoinableSource {
285
322
  * (#291). Plain `_dict_*`-backed sources omit it.
286
323
  */
287
324
  readonly displayLocale?: string;
325
+ /**
326
+ * i18nText descriptors of the right-side collection (#285 §3, `join`
327
+ * layer). When present and the query carries a locale, each joined
328
+ * right-side record's i18n fields resolve to that locale at the `join`
329
+ * layer (`resolvePolicy(onMissing, 'join')`) BEFORE it is attached under
330
+ * the leg's alias — so a joined `i18nText` field is a resolved string, not
331
+ * a raw `{ locale }` map. Locale-less queries leave joined fields raw
332
+ * (consistent with a locale-less read).
333
+ */
334
+ readonly i18nFields?: Record<string, I18nTextDescriptor>;
288
335
  /**
289
336
  * Subscribe to mutations on this source. The callback fires
290
337
  * AFTER the underlying record set has been updated. Returns an
@@ -307,6 +354,13 @@ interface JoinableSource {
307
354
  interface JoinContext {
308
355
  /** Name of the left-side (owning) collection. */
309
356
  readonly leftCollection: string;
357
+ /**
358
+ * The owning collection's default locale (#285 §3). Used to resolve joined
359
+ * i18n fields at the `join` layer when a terminal call doesn't pass an
360
+ * explicit locale — so `openVault({ locale })` flows to joins like it does
361
+ * to `get`/`list`. A per-call `toArray({ locale })` overrides it.
362
+ */
363
+ readonly defaultLocale?: string;
310
364
  /** Look up a `RefDescriptor` by field name on the left collection. */
311
365
  resolveRef(field: string): RefDescriptor | null;
312
366
  /** Resolve a right-side source by target collection name. */
@@ -348,7 +402,7 @@ interface JoinContext {
348
402
  * query like `.join('a', { maxRows: 100_000 }).join('b', { maxRows: 50 })`,
349
403
  * which should throw on the second leg if the left set exceeds 50.
350
404
  */
351
- declare function applyJoins(rows: readonly unknown[], joins: readonly JoinLeg[], context: JoinContext): unknown[];
405
+ declare function applyJoins(rows: readonly unknown[], joins: readonly JoinLeg[], context: JoinContext, locale?: string): unknown[];
352
406
  /**
353
407
  * Test-only: reset the join warning deduplication state between
354
408
  * tests. Production code never calls this — the dedup state is
@@ -479,6 +533,13 @@ declare function buildLiveQuery<T>(recompute: () => T[], upstreams: readonly Liv
479
533
  interface OrderBy {
480
534
  readonly field: string;
481
535
  readonly direction: 'asc' | 'desc';
536
+ /**
537
+ * Sort key for a `dictKey`/`staticDict` field (#285): `'value'` (default)
538
+ * sorts by the stored code; `'label'` sorts by the code's resolved label at
539
+ * the query locale (`toArray({ locale })`, or a `staticDict` `displayLocale`).
540
+ * Falls back to the code when no label resolves.
541
+ */
542
+ readonly by?: 'value' | 'label';
482
543
  }
483
544
  /**
484
545
  * A complete query plan: zero-or-more clauses, optional ordering, pagination,
@@ -617,8 +678,14 @@ declare class Query<T> {
617
678
  and(builder: (q: Query<T>) => Query<T>): Query<T>;
618
679
  /** Escape hatch: add an arbitrary predicate function. Not serializable. */
619
680
  filter(fn: (record: T) => boolean): Query<T>;
620
- /** Sort by a field. Subsequent calls are tie-breakers. */
621
- orderBy(field: string, direction?: 'asc' | 'desc'): Query<T>;
681
+ /**
682
+ * Sort by a field. Subsequent calls are tie-breakers. Pass
683
+ * `{ by: 'label' }` to sort a `dictKey`/`staticDict` field by its resolved
684
+ * label at the query locale instead of the stored code (#285).
685
+ */
686
+ orderBy(field: string, direction?: 'asc' | 'desc', opts?: {
687
+ by?: 'value' | 'label';
688
+ }): Query<T>;
622
689
  /** Cap the result size. */
623
690
  limit(n: number): Query<T>;
624
691
  /** Skip the first N matching records (after ordering). */
@@ -721,8 +788,15 @@ declare class Query<T> {
721
788
  * carries any join legs, they are applied after `where` / `orderBy`
722
789
  * / `limit` / `offset` narrow the left set. See the `.join()` doc
723
790
  * for the ordering rationale.
791
+ *
792
+ * `opts.locale` (#285 §3) resolves JOINED right-side i18n fields at the
793
+ * `join` layer to that locale; without it, the owning collection's default
794
+ * locale applies, and a locale-less query leaves joined i18n fields raw.
795
+ * (Left/base i18n fields are resolved by `get`/`list`, not here.)
724
796
  */
725
- toArray(): T[];
797
+ toArray(opts?: {
798
+ locale?: string;
799
+ }): T[];
726
800
  /**
727
801
  * Decode this source's money fields on read (stored scaled-int → canonical
728
802
  * decimal), so `query().toArray()` agrees with `get()`/`sum()` on the value.
@@ -736,8 +810,10 @@ declare class Query<T> {
736
810
  * money read through `get()`/`list()` with a locale.
737
811
  */
738
812
  private decodeMoney;
739
- /** Return the first matching record, or null. Joins are applied. */
740
- first(): T | null;
813
+ /** Return the first matching record, or null. Joins are applied. `opts.locale` resolves joined i18n fields (#285 §3). */
814
+ first(opts?: {
815
+ locale?: string;
816
+ }): T | null;
741
817
  /**
742
818
  * Return the number of matching records (after where/filter,
743
819
  * before limit). **Joins are NOT applied** — count() reports the
@@ -1229,4 +1305,4 @@ declare class ScanBuilder<T> implements AsyncIterable<T> {
1229
1305
  private recordMatches;
1230
1306
  }
1231
1307
 
1232
- export { DEFAULT_CROSS_JOIN_MAX_ROWS as D, type JoinContext as J, type LiveQuery as L, type OrderBy as O, Query as Q, type RefDescriptor as R, ScanBuilder as S, DEFAULT_JOIN_MAX_ROWS as a, type JoinLeg as b, type JoinStrategy as c, type JoinableSource as d, type LiveUpstream as e, type QueryPlan as f, type QuerySource as g, RefIntegrityError as h, type RefMode as i, RefRegistry as j, RefScopeError as k, type RefViolation as l, type ScanPageProvider as m, applyJoins as n, buildLiveQuery as o, executePlan as p, resetJoinWarnings as q, ref as r };
1308
+ export { DEFAULT_CROSS_JOIN_MAX_ROWS as D, type JoinContext as J, type LiveQuery as L, type OrderBy as O, Query as Q, type RefDescriptor as R, ScanBuilder as S, DEFAULT_JOIN_MAX_ROWS as a, type JoinLeg as b, type JoinStrategy as c, type JoinableSource as d, type LiveUpstream as e, type QueryPlan as f, type QuerySource as g, RefIntegrityError as h, type RefMode as i, RefRegistry as j, RefScopeError as k, type RefViolation as l, type ScanPageProvider as m, applyJoins as n, buildLiveQuery as o, executePlan as p, isRefArray as q, ref as r, refArray as s, resetJoinWarnings as t };