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

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 (233) hide show
  1. package/dist/aggregate/index.cjs.map +1 -1
  2. package/dist/aggregate/index.js +2 -2
  3. package/dist/attestation/index.cjs.map +1 -1
  4. package/dist/attestation/index.d.cts +2 -2
  5. package/dist/attestation/index.d.ts +2 -2
  6. package/dist/attestation/index.js +5 -5
  7. package/dist/blobs/index.cjs.map +1 -1
  8. package/dist/blobs/index.d.cts +3 -3
  9. package/dist/blobs/index.d.ts +3 -3
  10. package/dist/blobs/index.js +4 -4
  11. package/dist/bundle/index.cjs +95 -15
  12. package/dist/bundle/index.cjs.map +1 -1
  13. package/dist/bundle/index.d.cts +4 -4
  14. package/dist/bundle/index.d.ts +4 -4
  15. package/dist/bundle/index.js +8 -8
  16. package/dist/{chunk-AYRTGXF3.js → chunk-22DWZL57.js} +62 -26
  17. package/dist/chunk-22DWZL57.js.map +1 -0
  18. package/dist/{chunk-4EOVWJL6.js → chunk-2GLDA55J.js} +2 -2
  19. package/dist/{chunk-CBHPW77B.js → chunk-2WUSG3IT.js} +2 -2
  20. package/dist/{chunk-WBUG3324.js → chunk-3BFJOWSU.js} +2 -2
  21. package/dist/{chunk-7IH5FDXD.js → chunk-3YPCK6JX.js} +5 -5
  22. package/dist/{chunk-SYOSRZN4.js → chunk-53XBRIRT.js} +4 -4
  23. package/dist/{chunk-UPBZ7NVY.js → chunk-5T22KDPN.js} +4 -4
  24. package/dist/{chunk-KK44CQ5B.js → chunk-5XHKQ56N.js} +2 -2
  25. package/dist/{chunk-3O5FNO5O.js → chunk-6774ZOQ7.js} +106 -50
  26. package/dist/chunk-6774ZOQ7.js.map +1 -0
  27. package/dist/chunk-6STK5TQP.js +139 -0
  28. package/dist/chunk-6STK5TQP.js.map +1 -0
  29. package/dist/{chunk-REQJJIPP.js → chunk-B6PB7JLN.js} +23 -1
  30. package/dist/{chunk-REQJJIPP.js.map → chunk-B6PB7JLN.js.map} +1 -1
  31. package/dist/{chunk-2TXMTYWZ.js → chunk-BVRYKATC.js} +3 -3
  32. package/dist/{chunk-6ILPGZXZ.js → chunk-DE6GKS6G.js} +2 -2
  33. package/dist/{chunk-TS4FQPDD.js → chunk-DFMLEQZB.js} +2 -2
  34. package/dist/{chunk-3XCXUJTM.js → chunk-DJHHA6XH.js} +2 -2
  35. package/dist/{chunk-LSY46G55.js → chunk-DL3HWOQ5.js} +3 -3
  36. package/dist/{chunk-6MXGU2PW.js → chunk-DO7C2TOG.js} +2 -2
  37. package/dist/{chunk-N4CDTRDH.js → chunk-DONMZAD2.js} +3 -3
  38. package/dist/{chunk-HNC55FLJ.js → chunk-F3GDRNUT.js} +3 -3
  39. package/dist/{chunk-VZOZ3DBN.js → chunk-H2X3ISXG.js} +3 -3
  40. package/dist/{chunk-XZCBBZLS.js → chunk-HNRHLRDC.js} +2 -2
  41. package/dist/{chunk-22ESLVUM.js → chunk-I5FOWO4J.js} +2 -2
  42. package/dist/{chunk-O3JCRQT3.js → chunk-JWRVQKRZ.js} +3 -3
  43. package/dist/{chunk-CSHY53CZ.js → chunk-K3DK3NU5.js} +2 -2
  44. package/dist/{chunk-BNUCCUES.js → chunk-ML236QKC.js} +2 -2
  45. package/dist/{chunk-GZIDTXC4.js → chunk-NONAAENK.js} +2 -2
  46. package/dist/{chunk-JZDA2SRB.js → chunk-O3VZPBZG.js} +4 -4
  47. package/dist/{chunk-PJKGXUMG.js → chunk-OQ6PIGHA.js} +2 -2
  48. package/dist/{chunk-QYO6I7KK.js → chunk-PE2FR4J3.js} +3 -3
  49. package/dist/{chunk-YAMTXW77.js → chunk-PP6W64Y3.js} +2 -2
  50. package/dist/{chunk-HNFXKQD7.js → chunk-PX35GA7L.js} +4 -4
  51. package/dist/{chunk-OXCFFRF3.js → chunk-QEILDE6R.js} +2 -2
  52. package/dist/{chunk-4YVVF6JN.js → chunk-QODLLGQ7.js} +4 -4
  53. package/dist/{chunk-ASFE2X62.js → chunk-RAZ4OVLL.js} +2 -2
  54. package/dist/{chunk-WM5GFORS.js → chunk-SYMWGEET.js} +2 -2
  55. package/dist/{chunk-SLJQIBT7.js → chunk-T7JEBOGN.js} +2 -2
  56. package/dist/{chunk-OA6HE2RW.js → chunk-TFBP23BX.js} +3 -3
  57. package/dist/{chunk-GI6S5ZF2.js → chunk-U26HQ6KJ.js} +2 -2
  58. package/dist/{chunk-WMKCAN4H.js → chunk-VTKGMEPP.js} +2 -2
  59. package/dist/{chunk-BRZFN354.js → chunk-WPLVTJ5D.js} +3 -3
  60. package/dist/{chunk-DCP4L4SH.js → chunk-XJFLDA7A.js} +2 -2
  61. package/dist/{chunk-BE5ZALMB.js → chunk-ZYWZWG6G.js} +4 -4
  62. package/dist/consent/index.cjs.map +1 -1
  63. package/dist/consent/index.d.cts +3 -3
  64. package/dist/consent/index.d.ts +3 -3
  65. package/dist/consent/index.js +3 -3
  66. package/dist/{crypto-TRZ5BJMY.js → crypto-HTZ4FJOP.js} +3 -3
  67. package/dist/{delegation-TLZTK2XW.js → delegation-RI54P6I5.js} +5 -5
  68. package/dist/derivations/index.cjs.map +1 -1
  69. package/dist/derivations/index.d.cts +4 -4
  70. package/dist/derivations/index.d.ts +4 -4
  71. package/dist/derivations/index.js +4 -4
  72. package/dist/{dev-unlock-L3z34v0J.d.cts → dev-unlock-M4VAWNq_.d.cts} +1 -1
  73. package/dist/{dev-unlock-ClAEZQC4.d.ts → dev-unlock-p3ysikWP.d.ts} +1 -1
  74. package/dist/executor-5PNY7LGW.js +8 -0
  75. package/dist/executor-B4QIYGZX.js +8 -0
  76. package/dist/executor-BWXXDQ7K.js +11 -0
  77. package/dist/guards/index.cjs.map +1 -1
  78. package/dist/guards/index.d.cts +4 -4
  79. package/dist/guards/index.d.ts +4 -4
  80. package/dist/guards/index.js +3 -3
  81. package/dist/{hash-M6-JI3Yu.d.cts → hash-BPsYPcv_.d.cts} +1 -1
  82. package/dist/{hash-B3lV6lw3.d.ts → hash-C1GtiOhR.d.ts} +1 -1
  83. package/dist/history/index.cjs.map +1 -1
  84. package/dist/history/index.d.cts +4 -4
  85. package/dist/history/index.d.ts +4 -4
  86. package/dist/history/index.js +4 -4
  87. package/dist/i18n/index.cjs +217 -22
  88. package/dist/i18n/index.cjs.map +1 -1
  89. package/dist/i18n/index.d.cts +3 -3
  90. package/dist/i18n/index.d.ts +3 -3
  91. package/dist/i18n/index.js +15 -4
  92. package/dist/i18n/index.js.map +1 -1
  93. package/dist/{index-vB43MAt4.d.cts → index-4fBVt8j9.d.cts} +21 -1
  94. package/dist/{index-CmWQyC4e.d.ts → index-D8I_pyJD.d.ts} +21 -1
  95. package/dist/index.cjs +286 -33
  96. package/dist/index.cjs.map +1 -1
  97. package/dist/index.d.cts +11 -11
  98. package/dist/index.d.ts +11 -11
  99. package/dist/index.js +48 -38
  100. package/dist/index.js.map +1 -1
  101. package/dist/indexing/index.cjs.map +1 -1
  102. package/dist/indexing/index.js +2 -2
  103. package/dist/issue-VGDPP4B5.js +12 -0
  104. package/dist/{ledger-SQVVE2DR.js → ledger-TMRZYNVJ.js} +4 -4
  105. package/dist/materialized-views/index.cjs.map +1 -1
  106. package/dist/materialized-views/index.d.cts +5 -5
  107. package/dist/materialized-views/index.d.ts +5 -5
  108. package/dist/materialized-views/index.js +6 -6
  109. package/dist/noydb-LZBH3XDK.js +34 -0
  110. package/dist/overlay-views/index.cjs.map +1 -1
  111. package/dist/overlay-views/index.d.cts +4 -4
  112. package/dist/overlay-views/index.d.ts +4 -4
  113. package/dist/overlay-views/index.js +4 -4
  114. package/dist/periods/index.cjs.map +1 -1
  115. package/dist/periods/index.d.cts +3 -3
  116. package/dist/periods/index.d.ts +3 -3
  117. package/dist/periods/index.js +4 -4
  118. package/dist/{public-envelope-BXPXMN3U.js → public-envelope-BW6OXORV.js} +3 -3
  119. package/dist/query/index.cjs.map +1 -1
  120. package/dist/query/index.d.cts +1 -1
  121. package/dist/query/index.d.ts +1 -1
  122. package/dist/query/index.js +3 -3
  123. package/dist/registry-3QP3YKQS.js +8 -0
  124. package/dist/{registry-4R4IURUM.js → registry-OJIOSBV6.js} +3 -3
  125. package/dist/registry-USRVT6YF.js +8 -0
  126. package/dist/{revoke-Y7UDOXGH.js → revoke-JCC7N56X.js} +5 -5
  127. package/dist/session/index.cjs.map +1 -1
  128. package/dist/session/index.d.cts +4 -4
  129. package/dist/session/index.d.ts +4 -4
  130. package/dist/session/index.js +3 -3
  131. package/dist/shadow/index.cjs.map +1 -1
  132. package/dist/shadow/index.d.cts +3 -3
  133. package/dist/shadow/index.d.ts +3 -3
  134. package/dist/shadow/index.js +2 -2
  135. package/dist/{signer-UD2ZSVDJ.js → signer-72QAUSVW.js} +4 -4
  136. package/dist/snapshots/index.cjs.map +1 -1
  137. package/dist/snapshots/index.d.cts +3 -3
  138. package/dist/snapshots/index.d.ts +3 -3
  139. package/dist/snapshots/index.js +3 -3
  140. package/dist/{stale-F4V5E7ZK.js → stale-6ZDBTQT7.js} +2 -2
  141. package/dist/store/index.cjs.map +1 -1
  142. package/dist/store/index.d.cts +3 -3
  143. package/dist/store/index.d.ts +3 -3
  144. package/dist/store/index.js +2 -2
  145. package/dist/sync/index.cjs.map +1 -1
  146. package/dist/sync/index.d.cts +2 -2
  147. package/dist/sync/index.d.ts +2 -2
  148. package/dist/sync/index.js +3 -3
  149. package/dist/team/index.cjs.map +1 -1
  150. package/dist/team/index.d.cts +3 -3
  151. package/dist/team/index.d.ts +3 -3
  152. package/dist/team/index.js +7 -7
  153. package/dist/tx/index.cjs.map +1 -1
  154. package/dist/tx/index.d.cts +3 -3
  155. package/dist/tx/index.d.ts +3 -3
  156. package/dist/tx/index.js +3 -3
  157. package/dist/{types-DT7cXRHq.d.ts → types-DGU60JDt.d.ts} +174 -5
  158. package/dist/{types-r-y7TIqj.d.cts → types-DjunxzJa.d.cts} +174 -5
  159. package/dist/{ulid-Dt55yn4s.d.ts → ulid-BFJkYRRW.d.ts} +1 -1
  160. package/dist/{ulid-BkW3mLlz.d.cts → ulid-DPeuPgi3.d.cts} +1 -1
  161. package/dist/util/index.cjs.map +1 -1
  162. package/dist/util/index.js +1 -1
  163. package/dist/{with-derivation-DB63Po2m.d.cts → with-derivation-Df0kMlED.d.cts} +1 -1
  164. package/dist/{with-derivation-D_Ids_H6.d.ts → with-derivation-DfOpKjFw.d.ts} +1 -1
  165. package/dist/{with-guard-BJwdc0s6.d.ts → with-guard-0KksDtSR.d.ts} +1 -1
  166. package/dist/{with-guard-BHThLppa.d.cts → with-guard-C6W5RVrH.d.cts} +1 -1
  167. package/dist/{with-materialized-view-D-CRVSDX.d.ts → with-materialized-view-BiasFcYx.d.ts} +1 -1
  168. package/dist/{with-materialized-view-BJmJ-FrO.d.cts → with-materialized-view-BmDKyHrm.d.cts} +1 -1
  169. package/dist/{with-overlayed-view-zePNtUSq.d.cts → with-overlayed-view-CA66vhHz.d.cts} +1 -1
  170. package/dist/{with-overlayed-view-CNf6GbDG.d.ts → with-overlayed-view-CQViuko_.d.ts} +1 -1
  171. package/package.json +5 -4
  172. package/dist/chunk-3O5FNO5O.js.map +0 -1
  173. package/dist/chunk-AYRTGXF3.js.map +0 -1
  174. package/dist/executor-HAVRTQN4.js +0 -11
  175. package/dist/executor-V3DKOADS.js +0 -8
  176. package/dist/executor-XO4M4243.js +0 -8
  177. package/dist/issue-EJKUQ6FA.js +0 -12
  178. package/dist/noydb-MK4UQ626.js +0 -34
  179. package/dist/registry-GPBLCHG7.js +0 -8
  180. package/dist/registry-ZON5HNIV.js +0 -8
  181. /package/dist/{chunk-4EOVWJL6.js.map → chunk-2GLDA55J.js.map} +0 -0
  182. /package/dist/{chunk-CBHPW77B.js.map → chunk-2WUSG3IT.js.map} +0 -0
  183. /package/dist/{chunk-WBUG3324.js.map → chunk-3BFJOWSU.js.map} +0 -0
  184. /package/dist/{chunk-7IH5FDXD.js.map → chunk-3YPCK6JX.js.map} +0 -0
  185. /package/dist/{chunk-SYOSRZN4.js.map → chunk-53XBRIRT.js.map} +0 -0
  186. /package/dist/{chunk-UPBZ7NVY.js.map → chunk-5T22KDPN.js.map} +0 -0
  187. /package/dist/{chunk-KK44CQ5B.js.map → chunk-5XHKQ56N.js.map} +0 -0
  188. /package/dist/{chunk-2TXMTYWZ.js.map → chunk-BVRYKATC.js.map} +0 -0
  189. /package/dist/{chunk-6ILPGZXZ.js.map → chunk-DE6GKS6G.js.map} +0 -0
  190. /package/dist/{chunk-TS4FQPDD.js.map → chunk-DFMLEQZB.js.map} +0 -0
  191. /package/dist/{chunk-3XCXUJTM.js.map → chunk-DJHHA6XH.js.map} +0 -0
  192. /package/dist/{chunk-LSY46G55.js.map → chunk-DL3HWOQ5.js.map} +0 -0
  193. /package/dist/{chunk-6MXGU2PW.js.map → chunk-DO7C2TOG.js.map} +0 -0
  194. /package/dist/{chunk-N4CDTRDH.js.map → chunk-DONMZAD2.js.map} +0 -0
  195. /package/dist/{chunk-HNC55FLJ.js.map → chunk-F3GDRNUT.js.map} +0 -0
  196. /package/dist/{chunk-VZOZ3DBN.js.map → chunk-H2X3ISXG.js.map} +0 -0
  197. /package/dist/{chunk-XZCBBZLS.js.map → chunk-HNRHLRDC.js.map} +0 -0
  198. /package/dist/{chunk-22ESLVUM.js.map → chunk-I5FOWO4J.js.map} +0 -0
  199. /package/dist/{chunk-O3JCRQT3.js.map → chunk-JWRVQKRZ.js.map} +0 -0
  200. /package/dist/{chunk-CSHY53CZ.js.map → chunk-K3DK3NU5.js.map} +0 -0
  201. /package/dist/{chunk-BNUCCUES.js.map → chunk-ML236QKC.js.map} +0 -0
  202. /package/dist/{chunk-GZIDTXC4.js.map → chunk-NONAAENK.js.map} +0 -0
  203. /package/dist/{chunk-JZDA2SRB.js.map → chunk-O3VZPBZG.js.map} +0 -0
  204. /package/dist/{chunk-PJKGXUMG.js.map → chunk-OQ6PIGHA.js.map} +0 -0
  205. /package/dist/{chunk-QYO6I7KK.js.map → chunk-PE2FR4J3.js.map} +0 -0
  206. /package/dist/{chunk-YAMTXW77.js.map → chunk-PP6W64Y3.js.map} +0 -0
  207. /package/dist/{chunk-HNFXKQD7.js.map → chunk-PX35GA7L.js.map} +0 -0
  208. /package/dist/{chunk-OXCFFRF3.js.map → chunk-QEILDE6R.js.map} +0 -0
  209. /package/dist/{chunk-4YVVF6JN.js.map → chunk-QODLLGQ7.js.map} +0 -0
  210. /package/dist/{chunk-ASFE2X62.js.map → chunk-RAZ4OVLL.js.map} +0 -0
  211. /package/dist/{chunk-WM5GFORS.js.map → chunk-SYMWGEET.js.map} +0 -0
  212. /package/dist/{chunk-SLJQIBT7.js.map → chunk-T7JEBOGN.js.map} +0 -0
  213. /package/dist/{chunk-OA6HE2RW.js.map → chunk-TFBP23BX.js.map} +0 -0
  214. /package/dist/{chunk-GI6S5ZF2.js.map → chunk-U26HQ6KJ.js.map} +0 -0
  215. /package/dist/{chunk-WMKCAN4H.js.map → chunk-VTKGMEPP.js.map} +0 -0
  216. /package/dist/{chunk-BRZFN354.js.map → chunk-WPLVTJ5D.js.map} +0 -0
  217. /package/dist/{chunk-DCP4L4SH.js.map → chunk-XJFLDA7A.js.map} +0 -0
  218. /package/dist/{chunk-BE5ZALMB.js.map → chunk-ZYWZWG6G.js.map} +0 -0
  219. /package/dist/{crypto-TRZ5BJMY.js.map → crypto-HTZ4FJOP.js.map} +0 -0
  220. /package/dist/{delegation-TLZTK2XW.js.map → delegation-RI54P6I5.js.map} +0 -0
  221. /package/dist/{executor-HAVRTQN4.js.map → executor-5PNY7LGW.js.map} +0 -0
  222. /package/dist/{executor-V3DKOADS.js.map → executor-B4QIYGZX.js.map} +0 -0
  223. /package/dist/{executor-XO4M4243.js.map → executor-BWXXDQ7K.js.map} +0 -0
  224. /package/dist/{issue-EJKUQ6FA.js.map → issue-VGDPP4B5.js.map} +0 -0
  225. /package/dist/{ledger-SQVVE2DR.js.map → ledger-TMRZYNVJ.js.map} +0 -0
  226. /package/dist/{noydb-MK4UQ626.js.map → noydb-LZBH3XDK.js.map} +0 -0
  227. /package/dist/{public-envelope-BXPXMN3U.js.map → public-envelope-BW6OXORV.js.map} +0 -0
  228. /package/dist/{registry-4R4IURUM.js.map → registry-3QP3YKQS.js.map} +0 -0
  229. /package/dist/{registry-GPBLCHG7.js.map → registry-OJIOSBV6.js.map} +0 -0
  230. /package/dist/{registry-ZON5HNIV.js.map → registry-USRVT6YF.js.map} +0 -0
  231. /package/dist/{revoke-Y7UDOXGH.js.map → revoke-JCC7N56X.js.map} +0 -0
  232. /package/dist/{signer-UD2ZSVDJ.js.map → signer-72QAUSVW.js.map} +0 -0
  233. /package/dist/{stale-F4V5E7ZK.js.map → stale-6ZDBTQT7.js.map} +0 -0
@@ -1,11 +1,11 @@
1
- import { aT as HistoryStrategy, aU as NoydbStore, aV as HistoryOptions, aW as EncryptedEnvelope, aX as PruneOptions } from '../types-r-y7TIqj.cjs';
2
- export { aY as AppendInput, aZ as ChangeType, a_ as CollectionInstant, a$ as DiffEntry, b0 as JsonPatch, b1 as JsonPatchOp, b2 as LedgerEntry, b3 as LedgerStore, b4 as VaultEngine, b5 as VaultInstant, b6 as VerifyResult, b7 as applyPatch, b8 as canonicalJson, b9 as computePatch, ba as diff, bb as formatDiff, bc as hashEntry, bd as paddedIndex, be as parseIndex, bf as sha256Hex } from '../types-r-y7TIqj.cjs';
3
- export { L as LEDGER_COLLECTION, a as LEDGER_DELTAS_COLLECTION, e as envelopePayloadHash } from '../hash-M6-JI3Yu.cjs';
1
+ import { b0 as HistoryStrategy, b1 as NoydbStore, b2 as HistoryOptions, b3 as EncryptedEnvelope, b4 as PruneOptions } from '../types-DjunxzJa.cjs';
2
+ export { b5 as AppendInput, b6 as ChangeType, b7 as CollectionInstant, b8 as DiffEntry, b9 as JsonPatch, ba as JsonPatchOp, bb as LedgerEntry, bc as LedgerStore, bd as VaultEngine, be as VaultInstant, bf as VerifyResult, bg as applyPatch, bh as canonicalJson, bi as computePatch, bj as diff, bk as formatDiff, bl as hashEntry, bm as paddedIndex, bn as parseIndex, bo as sha256Hex } from '../types-DjunxzJa.cjs';
3
+ export { L as LEDGER_COLLECTION, a as LEDGER_DELTAS_COLLECTION, e as envelopePayloadHash } from '../hash-BPsYPcv_.cjs';
4
4
  import '../lazy-builder-wY4pMCEe.cjs';
5
5
  import '../predicate-BSAGEyu5.cjs';
6
6
  import '../strategy-DSTrsZ8t.cjs';
7
7
  import '../strategy-BSxFXGzb.cjs';
8
- import '../index-vB43MAt4.cjs';
8
+ import '../index-4fBVt8j9.cjs';
9
9
  import '@noy-db/attestation';
10
10
 
11
11
  /**
@@ -1,11 +1,11 @@
1
- import { aT as HistoryStrategy, aU as NoydbStore, aV as HistoryOptions, aW as EncryptedEnvelope, aX as PruneOptions } from '../types-DT7cXRHq.js';
2
- export { aY as AppendInput, aZ as ChangeType, a_ as CollectionInstant, a$ as DiffEntry, b0 as JsonPatch, b1 as JsonPatchOp, b2 as LedgerEntry, b3 as LedgerStore, b4 as VaultEngine, b5 as VaultInstant, b6 as VerifyResult, b7 as applyPatch, b8 as canonicalJson, b9 as computePatch, ba as diff, bb as formatDiff, bc as hashEntry, bd as paddedIndex, be as parseIndex, bf as sha256Hex } from '../types-DT7cXRHq.js';
3
- export { L as LEDGER_COLLECTION, a as LEDGER_DELTAS_COLLECTION, e as envelopePayloadHash } from '../hash-B3lV6lw3.js';
1
+ import { b0 as HistoryStrategy, b1 as NoydbStore, b2 as HistoryOptions, b3 as EncryptedEnvelope, b4 as PruneOptions } from '../types-DGU60JDt.js';
2
+ export { b5 as AppendInput, b6 as ChangeType, b7 as CollectionInstant, b8 as DiffEntry, b9 as JsonPatch, ba as JsonPatchOp, bb as LedgerEntry, bc as LedgerStore, bd as VaultEngine, be as VaultInstant, bf as VerifyResult, bg as applyPatch, bh as canonicalJson, bi as computePatch, bj as diff, bk as formatDiff, bl as hashEntry, bm as paddedIndex, bn as parseIndex, bo as sha256Hex } from '../types-DGU60JDt.js';
3
+ export { L as LEDGER_COLLECTION, a as LEDGER_DELTAS_COLLECTION, e as envelopePayloadHash } from '../hash-C1GtiOhR.js';
4
4
  import '../lazy-builder-7tIpFyWN.js';
5
5
  import '../predicate-BSAGEyu5.js';
6
6
  import '../strategy-DSTrsZ8t.js';
7
7
  import '../strategy-BSxFXGzb.js';
8
- import '../index-CmWQyC4e.js';
8
+ import '../index-D8I_pyJD.js';
9
9
  import '@noy-db/attestation';
10
10
 
11
11
  /**
@@ -8,14 +8,14 @@ import {
8
8
  getVersionEnvelope,
9
9
  pruneHistory,
10
10
  saveHistory
11
- } from "../chunk-HNC55FLJ.js";
11
+ } from "../chunk-F3GDRNUT.js";
12
12
  import {
13
13
  LEDGER_COLLECTION,
14
14
  LEDGER_DELTAS_COLLECTION,
15
15
  LedgerStore,
16
16
  applyPatch,
17
17
  computePatch
18
- } from "../chunk-QYO6I7KK.js";
18
+ } from "../chunk-PE2FR4J3.js";
19
19
  import {
20
20
  canonicalJson,
21
21
  envelopePayloadHash,
@@ -25,8 +25,8 @@ import {
25
25
  sha256Hex
26
26
  } from "../chunk-Z6FNBOTC.js";
27
27
  import "../chunk-WIRRPTFH.js";
28
- import "../chunk-YAMTXW77.js";
29
- import "../chunk-REQJJIPP.js";
28
+ import "../chunk-PP6W64Y3.js";
29
+ import "../chunk-B6PB7JLN.js";
30
30
 
31
31
  // src/history/active.ts
32
32
  function withHistory() {
@@ -27,16 +27,20 @@ __export(i18n_exports, {
27
27
  LocaleNotSpecifiedError: () => LocaleNotSpecifiedError,
28
28
  MissingTranslationError: () => MissingTranslationError,
29
29
  ReservedCollectionNameError: () => ReservedCollectionNameError,
30
+ ScriptViolationError: () => ScriptViolationError,
30
31
  TranslatorNotConfiguredError: () => TranslatorNotConfiguredError,
31
32
  applyI18nLocale: () => applyI18nLocale,
32
33
  dictCollectionName: () => dictCollectionName,
33
34
  dictKey: () => dictKey,
35
+ enforceScript: () => enforceScript,
34
36
  getAtPath: () => getAtPath,
35
37
  i18nText: () => i18nText,
38
+ inferScripts: () => inferScripts,
36
39
  isDictCollectionName: () => isDictCollectionName,
37
40
  isDictKeyDescriptor: () => isDictKeyDescriptor,
38
41
  isI18nTextDescriptor: () => isI18nTextDescriptor,
39
42
  resolveI18nText: () => resolveI18nText,
43
+ resolvePolicy: () => resolvePolicy,
40
44
  setAtPathInPlace: () => setAtPathInPlace,
41
45
  validateI18nTextValue: () => validateI18nTextValue,
42
46
  withI18n: () => withI18n
@@ -152,6 +156,27 @@ var LocaleNotSpecifiedError = class extends NoydbError {
152
156
  this.field = field;
153
157
  }
154
158
  };
159
+ var ScriptViolationError = class extends NoydbError {
160
+ /** The field whose value violated its script constraint. */
161
+ field;
162
+ /** The locale slot (e.g. `'en'`) that was checked. */
163
+ locale;
164
+ /** The Unicode scripts allowed for this slot. */
165
+ expected;
166
+ /** A short sample of the offending characters, for diagnostics. */
167
+ sample;
168
+ constructor(field, locale, expected, sample, message) {
169
+ super(
170
+ "SCRIPT_VIOLATION",
171
+ message ?? `Field "${field}" slot "${locale}" expects script(s) [${expected.join(", ")}] but contains disallowed character(s): "${sample}".`
172
+ );
173
+ this.name = "ScriptViolationError";
174
+ this.field = field;
175
+ this.locale = locale;
176
+ this.expected = expected;
177
+ this.sample = sample;
178
+ }
179
+ };
155
180
  var TranslatorNotConfiguredError = class extends NoydbError {
156
181
  /** The field that requested auto-translation. */
157
182
  field;
@@ -168,6 +193,14 @@ var TranslatorNotConfiguredError = class extends NoydbError {
168
193
  }
169
194
  };
170
195
 
196
+ // src/i18n/policy.ts
197
+ function resolvePolicy(onMissing, layer) {
198
+ const explicit = onMissing && typeof onMissing === "object" ? onMissing[layer] : void 0;
199
+ const scalar = typeof onMissing === "string" ? onMissing : void 0;
200
+ const layerDefault = layer === "guard" ? "substitute" : void 0;
201
+ return explicit ?? layerDefault ?? scalar ?? "throw";
202
+ }
203
+
171
204
  // src/i18n/core.ts
172
205
  function i18nText(options) {
173
206
  return { _noydbI18nText: true, options };
@@ -231,7 +264,21 @@ function validateI18nTextValue(value, field, descriptor) {
231
264
  }
232
265
  }
233
266
  }
234
- function resolveI18nText(value, locale, fallback, field) {
267
+ function toChain(fallback) {
268
+ return Array.isArray(fallback) ? fallback : fallback ? [fallback] : [];
269
+ }
270
+ function pickFromChain(value, chain) {
271
+ for (const fb of chain) {
272
+ if (fb === "any") {
273
+ const any = Object.values(value).find((v) => v !== "");
274
+ if (any !== void 0) return any;
275
+ } else if (value[fb] !== void 0 && value[fb] !== "") {
276
+ return value[fb];
277
+ }
278
+ }
279
+ return void 0;
280
+ }
281
+ function resolveI18nText(value, locale, fallback, field, opts) {
235
282
  if (locale === "raw") {
236
283
  return value;
237
284
  }
@@ -241,19 +288,21 @@ function resolveI18nText(value, locale, fallback, field) {
241
288
  if (value[locale] !== void 0 && value[locale] !== "") {
242
289
  return value[locale];
243
290
  }
244
- const chain = Array.isArray(fallback) ? fallback : fallback ? [fallback] : [];
245
- for (const fb of chain) {
246
- if (fb === "any") {
247
- const any = Object.values(value).find((v) => v !== "");
248
- if (any !== void 0) return any;
249
- } else if (value[fb] !== void 0 && value[fb] !== "") {
250
- return value[fb];
251
- }
291
+ const policy = opts?.policy ?? "throw";
292
+ const callerChain = toChain(fallback);
293
+ const callerHit = pickFromChain(value, callerChain);
294
+ if (callerHit !== void 0) return callerHit;
295
+ if (policy === "substitute") {
296
+ const subHit = pickFromChain(value, toChain(opts?.substitute));
297
+ if (subHit !== void 0) return subHit;
252
298
  }
253
- throw new LocaleNotSpecifiedError(
254
- field ?? "<unknown>",
255
- `No translation available for locale "${locale}"` + (chain.length > 0 ? ` or fallback chain [${chain.join(", ")}]` : "") + "."
256
- );
299
+ if (policy === "throw") {
300
+ throw new LocaleNotSpecifiedError(
301
+ field ?? "<unknown>",
302
+ `No translation available for locale "${locale}"` + (callerChain.length > 0 ? ` or fallback chain [${callerChain.join(", ")}]` : "") + "."
303
+ );
304
+ }
305
+ return null;
257
306
  }
258
307
  function getAtPath(obj, path) {
259
308
  const arrayIdx = path.indexOf("[].");
@@ -290,7 +339,7 @@ function setAtPathInPlace(obj, path, value) {
290
339
  }
291
340
  obj[path] = value;
292
341
  }
293
- function applyAtPath(obj, path, locale, fallback) {
342
+ function applyAtPath(obj, path, locale, fallback, opts) {
294
343
  const arrayIdx = path.indexOf("[].");
295
344
  if (arrayIdx !== -1) {
296
345
  const arrayKey = path.slice(0, arrayIdx);
@@ -301,7 +350,7 @@ function applyAtPath(obj, path, locale, fallback) {
301
350
  ...obj,
302
351
  [arrayKey]: arr.map((item) => {
303
352
  if (!item || typeof item !== "object" || Array.isArray(item)) return item;
304
- return applyAtPath(item, restPath, locale, fallback);
353
+ return applyAtPath(item, restPath, locale, fallback, opts);
305
354
  })
306
355
  };
307
356
  }
@@ -313,7 +362,7 @@ function applyAtPath(obj, path, locale, fallback) {
313
362
  if (!nested || typeof nested !== "object" || Array.isArray(nested)) return obj;
314
363
  return {
315
364
  ...obj,
316
- [head]: applyAtPath(nested, rest, locale, fallback)
365
+ [head]: applyAtPath(nested, rest, locale, fallback, opts)
317
366
  };
318
367
  }
319
368
  const raw = obj[path];
@@ -321,15 +370,20 @@ function applyAtPath(obj, path, locale, fallback) {
321
370
  if (typeof raw !== "object" || Array.isArray(raw)) return obj;
322
371
  return {
323
372
  ...obj,
324
- [path]: resolveI18nText(raw, locale, fallback, path)
373
+ [path]: resolveI18nText(raw, locale, fallback, path, opts)
325
374
  };
326
375
  }
327
- function applyI18nLocale(record, i18nFields, locale, fallback) {
376
+ function applyI18nLocale(record, i18nFields, locale, fallback, layer = "read") {
328
377
  const fieldNames = Object.keys(i18nFields);
329
378
  if (fieldNames.length === 0) return record;
330
379
  let result = record;
331
- for (const field of fieldNames) {
332
- result = applyAtPath(result, field, locale, fallback);
380
+ for (const [field, descriptor] of Object.entries(i18nFields)) {
381
+ const { onMissing, substitute } = descriptor.options;
382
+ const opts = {
383
+ policy: resolvePolicy(onMissing, layer),
384
+ ...substitute !== void 0 ? { substitute } : {}
385
+ };
386
+ result = applyAtPath(result, field, locale, fallback, opts);
333
387
  }
334
388
  return result;
335
389
  }
@@ -515,8 +569,14 @@ function dictCollectionName(dictionaryName) {
515
569
  function isDictCollectionName(name) {
516
570
  return name.startsWith(DICT_COLLECTION_PREFIX);
517
571
  }
518
- function dictKey(name, keys) {
519
- return { _noydbDictKey: true, name, keys };
572
+ function dictKey(name, keys, opts) {
573
+ return {
574
+ _noydbDictKey: true,
575
+ name,
576
+ keys,
577
+ ...opts?.onMissing !== void 0 ? { onMissing: opts.onMissing } : {},
578
+ ...opts?.substitute !== void 0 ? { substitute: opts.substitute } : {}
579
+ };
520
580
  }
521
581
  function isDictKeyDescriptor(x) {
522
582
  return typeof x === "object" && x !== null && x._noydbDictKey === true;
@@ -858,11 +918,142 @@ var DictionaryHandle = class {
858
918
  }
859
919
  };
860
920
 
921
+ // src/i18n/script.ts
922
+ var LATIN_BASE = /* @__PURE__ */ new Set([
923
+ "en",
924
+ "fr",
925
+ "de",
926
+ "es",
927
+ "it",
928
+ "pt",
929
+ "nl",
930
+ "sv",
931
+ "no",
932
+ "da",
933
+ "fi",
934
+ "is",
935
+ "pl",
936
+ "cs",
937
+ "sk",
938
+ "hu",
939
+ "ro",
940
+ "hr",
941
+ "sl",
942
+ "et",
943
+ "lv",
944
+ "lt",
945
+ "tr",
946
+ "vi",
947
+ "id",
948
+ "ms",
949
+ "tl",
950
+ "sw",
951
+ "af",
952
+ "ca",
953
+ "gl",
954
+ "eu",
955
+ "cy",
956
+ "ga"
957
+ ]);
958
+ var SCRIPT_TABLE = {
959
+ th: ["Thai"],
960
+ ko: ["Hangul", "Han"],
961
+ ja: ["Han", "Hiragana", "Katakana"],
962
+ zh: ["Han"],
963
+ ar: ["Arabic"],
964
+ fa: ["Arabic"],
965
+ ur: ["Arabic"],
966
+ ru: ["Cyrillic"],
967
+ uk: ["Cyrillic"],
968
+ bg: ["Cyrillic"],
969
+ sr: ["Cyrillic"],
970
+ he: ["Hebrew"],
971
+ el: ["Greek"],
972
+ hi: ["Devanagari"],
973
+ ta: ["Tamil"],
974
+ km: ["Khmer"],
975
+ lo: ["Lao"],
976
+ my: ["Myanmar"]
977
+ };
978
+ var SUBTAG_SCRIPTS = {
979
+ Latn: ["Latin"],
980
+ Cyrl: ["Cyrillic", "Latin"],
981
+ Hans: ["Han", "Latin"],
982
+ Hant: ["Han", "Latin"],
983
+ Thai: ["Thai", "Latin"],
984
+ Arab: ["Arabic", "Latin"]
985
+ };
986
+ function inferScripts(locale) {
987
+ const parts = locale.split("-");
988
+ const subtag = parts.find((t) => /^[A-Z][a-z]{3}$/.test(t));
989
+ if (subtag && SUBTAG_SCRIPTS[subtag]) return SUBTAG_SCRIPTS[subtag];
990
+ const base = (parts[0] ?? "").toLowerCase();
991
+ if (LATIN_BASE.has(base)) return ["Latin"];
992
+ const primary = SCRIPT_TABLE[base];
993
+ if (primary) return [...primary, "Latin"];
994
+ return ["Latin"];
995
+ }
996
+ function allowedFor(descriptor, locale) {
997
+ const script = descriptor.options.script;
998
+ if (script && script !== "auto") {
999
+ const explicit = script[locale];
1000
+ if (explicit) return explicit;
1001
+ }
1002
+ return inferScripts(locale);
1003
+ }
1004
+ var BASELINE = String.raw`\p{White_Space}\p{Script=Common}\p{Script=Inherited}\p{Mark}`;
1005
+ function fullMatcher(scripts) {
1006
+ const cls = scripts.map((s) => `\\p{Script=${s}}`).join("");
1007
+ return new RegExp(`^[${BASELINE}${cls}]*$`, "u");
1008
+ }
1009
+ function charMatcher(scripts) {
1010
+ const cls = scripts.map((s) => `\\p{Script=${s}}`).join("");
1011
+ return new RegExp(`[${BASELINE}${cls}]`, "u");
1012
+ }
1013
+ function offendingSample(str, scripts) {
1014
+ const ok = charMatcher(scripts);
1015
+ const bad = [];
1016
+ for (const ch of str) {
1017
+ if (!ok.test(ch)) bad.push(ch);
1018
+ if (bad.length >= 8) break;
1019
+ }
1020
+ return bad.join("");
1021
+ }
1022
+ function stripDisallowed(str, scripts) {
1023
+ const ok = charMatcher(scripts);
1024
+ let out = "";
1025
+ for (const ch of str) if (ok.test(ch)) out += ch;
1026
+ return out;
1027
+ }
1028
+ function enforceScript(value, field, descriptor) {
1029
+ const opt = descriptor.options;
1030
+ if (!opt.script) return { value, warnings: [] };
1031
+ const mode = opt.onScriptViolation ?? "reject";
1032
+ const warnings = [];
1033
+ let out = value;
1034
+ for (const [locale, raw] of Object.entries(value)) {
1035
+ if (typeof raw !== "string") continue;
1036
+ const allowed = allowedFor(descriptor, locale);
1037
+ if (fullMatcher(allowed).test(raw)) continue;
1038
+ const sample = offendingSample(raw, allowed);
1039
+ if (mode === "reject") {
1040
+ throw new ScriptViolationError(field, locale, allowed, sample);
1041
+ }
1042
+ warnings.push({ field, locale, expected: allowed, sample });
1043
+ if (mode === "filter") {
1044
+ if (out === value) out = { ...value };
1045
+ out[locale] = stripDisallowed(raw, allowed);
1046
+ }
1047
+ }
1048
+ return { value: out, warnings };
1049
+ }
1050
+
861
1051
  // src/i18n/active.ts
862
1052
  function withI18n() {
863
1053
  return {
864
1054
  applyI18nLocale,
865
1055
  validateI18nTextValue,
1056
+ enforceScript,
866
1057
  buildDictionaryHandle(opts) {
867
1058
  return new DictionaryHandle(
868
1059
  opts.adapter,
@@ -888,16 +1079,20 @@ function withI18n() {
888
1079
  LocaleNotSpecifiedError,
889
1080
  MissingTranslationError,
890
1081
  ReservedCollectionNameError,
1082
+ ScriptViolationError,
891
1083
  TranslatorNotConfiguredError,
892
1084
  applyI18nLocale,
893
1085
  dictCollectionName,
894
1086
  dictKey,
1087
+ enforceScript,
895
1088
  getAtPath,
896
1089
  i18nText,
1090
+ inferScripts,
897
1091
  isDictCollectionName,
898
1092
  isDictKeyDescriptor,
899
1093
  isI18nTextDescriptor,
900
1094
  resolveI18nText,
1095
+ resolvePolicy,
901
1096
  setAtPathInPlace,
902
1097
  validateI18nTextValue,
903
1098
  withI18n