@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
package/dist/index.cjs CHANGED
@@ -46,7 +46,7 @@ var init_types = __esm({
46
46
  });
47
47
 
48
48
  // src/errors.ts
49
- var NoydbError, DecryptionError, TamperedError, InvalidKeyError, KeyringCorruptError, NoAccessError, ReadOnlyError, ReadOnlyAtInstantError, ReadOnlyFrameError, PermissionDeniedError, ExportCapabilityError, KeyringExpiredError, ImportCapabilityError, StoreCapabilityError, PrivilegeEscalationError, PeriodClosedError, RecordLockedError, FieldFrozenError, InvariantError, AmendmentForbiddenError, DirectoryDisabledError, TierNotGrantedError, ElevationExpiredError, AlreadyElevatedError, TierDemoteDeniedError, DelegationTargetMissingError, ConflictError, LedgerContentionError, BundleVersionConflictError, NetworkError, NotFoundError, ValidationError, SchemaValidationError, SchemaUpdateError, NonAdditiveSchemaChangeError, SchemaLockedError, SchemaFenceError, MigrationRequiredError, QuiesceTimeoutError, GroupCardinalityError, IndexRequiredError, IndexWriteFailureError, BundleIntegrityError, BundleSealMismatchError, ReservedCollectionNameError, DictKeyMissingError, DictKeyInUseError, MissingTranslationError, LocaleNotSpecifiedError, TranslatorNotConfiguredError, BackupLedgerError, BackupCorruptedError, AttestationError, SessionExpiredError, SessionNotFoundError, SessionPolicyError, JoinTooLargeError, CrossJoinTooLargeError, CrossJoinSourceUnknownError, DanglingReferenceError, FilenameSanitizationError, PathEscapeError, DerivationCycleError, DerivationDepthError, DerivationOutputUnknownError, DerivationOutputShapeError, DerivationCapExceededError, MaterializedViewCycleError, MaterializedViewSourceUnknownError, MaterializedViewTooLargeError, MaterializedViewConfigError, OverlayBaseIsVirtualError, OverlayCollectionUnavailableError, OverlayNameCollisionError, OverlayIdMismatchError, SnapshotNotFoundError;
49
+ var NoydbError, DecryptionError, TamperedError, InvalidKeyError, KeyringCorruptError, NoAccessError, ReadOnlyError, ReadOnlyAtInstantError, ReadOnlyFrameError, PermissionDeniedError, ExportCapabilityError, KeyringExpiredError, ImportCapabilityError, StoreCapabilityError, PrivilegeEscalationError, PeriodClosedError, RecordLockedError, FieldFrozenError, InvariantError, AmendmentForbiddenError, DirectoryDisabledError, TierNotGrantedError, ElevationExpiredError, AlreadyElevatedError, TierDemoteDeniedError, DelegationTargetMissingError, ConflictError, LedgerContentionError, BundleVersionConflictError, NetworkError, NotFoundError, ValidationError, SchemaValidationError, SchemaUpdateError, NonAdditiveSchemaChangeError, SchemaLockedError, SchemaFenceError, MigrationRequiredError, QuiesceTimeoutError, GroupCardinalityError, IndexRequiredError, IndexWriteFailureError, BundleIntegrityError, BundleSealMismatchError, ReservedCollectionNameError, DictKeyMissingError, DictKeyInUseError, MissingTranslationError, LocaleNotSpecifiedError, ScriptViolationError, TranslatorNotConfiguredError, BackupLedgerError, BackupCorruptedError, AttestationError, SessionExpiredError, SessionNotFoundError, SessionPolicyError, JoinTooLargeError, CrossJoinTooLargeError, CrossJoinSourceUnknownError, DanglingReferenceError, FilenameSanitizationError, PathEscapeError, DerivationCycleError, DerivationDepthError, DerivationOutputUnknownError, DerivationOutputShapeError, DerivationCapExceededError, MaterializedViewCycleError, MaterializedViewSourceUnknownError, MaterializedViewTooLargeError, MaterializedViewConfigError, OverlayBaseIsVirtualError, OverlayCollectionUnavailableError, OverlayNameCollisionError, OverlayIdMismatchError, SnapshotNotFoundError;
50
50
  var init_errors = __esm({
51
51
  "src/errors.ts"() {
52
52
  "use strict";
@@ -564,6 +564,27 @@ Resolutions:
564
564
  this.field = field;
565
565
  }
566
566
  };
567
+ ScriptViolationError = class extends NoydbError {
568
+ /** The field whose value violated its script constraint. */
569
+ field;
570
+ /** The locale slot (e.g. `'en'`) that was checked. */
571
+ locale;
572
+ /** The Unicode scripts allowed for this slot. */
573
+ expected;
574
+ /** A short sample of the offending characters, for diagnostics. */
575
+ sample;
576
+ constructor(field, locale, expected, sample, message) {
577
+ super(
578
+ "SCRIPT_VIOLATION",
579
+ message ?? `Field "${field}" slot "${locale}" expects script(s) [${expected.join(", ")}] but contains disallowed character(s): "${sample}".`
580
+ );
581
+ this.name = "ScriptViolationError";
582
+ this.field = field;
583
+ this.locale = locale;
584
+ this.expected = expected;
585
+ this.sample = sample;
586
+ }
587
+ };
567
588
  TranslatorNotConfiguredError = class extends NoydbError {
568
589
  /** The field that requested auto-translation. */
569
590
  field;
@@ -4115,6 +4136,7 @@ __export(src_exports, {
4115
4136
  SchemaLockedError: () => SchemaLockedError,
4116
4137
  SchemaUpdateError: () => SchemaUpdateError,
4117
4138
  SchemaValidationError: () => SchemaValidationError,
4139
+ ScriptViolationError: () => ScriptViolationError,
4118
4140
  SessionExpiredError: () => SessionExpiredError,
4119
4141
  SessionNotFoundError: () => SessionNotFoundError,
4120
4142
  SessionPolicyError: () => SessionPolicyError,
@@ -4190,6 +4212,7 @@ __export(src_exports, {
4190
4212
  enableDevUnlock: () => enableDevUnlock,
4191
4213
  encryptBytes: () => encryptBytes,
4192
4214
  encryptDeterministic: () => encryptDeterministic,
4215
+ enforceScript: () => enforceScript,
4193
4216
  enrollAuthenticator: () => enrollAuthenticator,
4194
4217
  envelopePayloadHash: () => envelopePayloadHash,
4195
4218
  estimateEntropy: () => estimateEntropy,
@@ -4210,6 +4233,7 @@ __export(src_exports, {
4210
4233
  hasRecoveryEnrolled: () => hasRecoveryEnrolled,
4211
4234
  hashEntry: () => hashEntry,
4212
4235
  i18nText: () => i18nText,
4236
+ inferScripts: () => inferScripts,
4213
4237
  isDevUnlockActive: () => isDevUnlockActive,
4214
4238
  isDictCollectionName: () => isDictCollectionName,
4215
4239
  isDictKeyDescriptor: () => isDictKeyDescriptor,
@@ -4270,6 +4294,7 @@ __export(src_exports, {
4270
4294
  resetJoinWarnings: () => resetJoinWarnings,
4271
4295
  resolveCrdtSnapshot: () => resolveCrdtSnapshot,
4272
4296
  resolveI18nText: () => resolveI18nText,
4297
+ resolvePolicy: () => resolvePolicy,
4273
4298
  resolvePublicEnvelopeSchema: () => resolveSchema,
4274
4299
  resolveSession: () => resolveSession,
4275
4300
  revokeAllSessions: () => revokeAllSessions,
@@ -9744,6 +9769,16 @@ var NO_CRDT = {
9744
9769
 
9745
9770
  // src/i18n/core.ts
9746
9771
  init_errors();
9772
+
9773
+ // src/i18n/policy.ts
9774
+ function resolvePolicy(onMissing, layer) {
9775
+ const explicit = onMissing && typeof onMissing === "object" ? onMissing[layer] : void 0;
9776
+ const scalar = typeof onMissing === "string" ? onMissing : void 0;
9777
+ const layerDefault = layer === "guard" ? "substitute" : void 0;
9778
+ return explicit ?? layerDefault ?? scalar ?? "throw";
9779
+ }
9780
+
9781
+ // src/i18n/core.ts
9747
9782
  function i18nText(options) {
9748
9783
  return { _noydbI18nText: true, options };
9749
9784
  }
@@ -9806,7 +9841,21 @@ function validateI18nTextValue(value, field, descriptor) {
9806
9841
  }
9807
9842
  }
9808
9843
  }
9809
- function resolveI18nText(value, locale, fallback, field) {
9844
+ function toChain(fallback) {
9845
+ return Array.isArray(fallback) ? fallback : fallback ? [fallback] : [];
9846
+ }
9847
+ function pickFromChain(value, chain) {
9848
+ for (const fb of chain) {
9849
+ if (fb === "any") {
9850
+ const any = Object.values(value).find((v) => v !== "");
9851
+ if (any !== void 0) return any;
9852
+ } else if (value[fb] !== void 0 && value[fb] !== "") {
9853
+ return value[fb];
9854
+ }
9855
+ }
9856
+ return void 0;
9857
+ }
9858
+ function resolveI18nText(value, locale, fallback, field, opts) {
9810
9859
  if (locale === "raw") {
9811
9860
  return value;
9812
9861
  }
@@ -9816,19 +9865,21 @@ function resolveI18nText(value, locale, fallback, field) {
9816
9865
  if (value[locale] !== void 0 && value[locale] !== "") {
9817
9866
  return value[locale];
9818
9867
  }
9819
- const chain = Array.isArray(fallback) ? fallback : fallback ? [fallback] : [];
9820
- for (const fb of chain) {
9821
- if (fb === "any") {
9822
- const any = Object.values(value).find((v) => v !== "");
9823
- if (any !== void 0) return any;
9824
- } else if (value[fb] !== void 0 && value[fb] !== "") {
9825
- return value[fb];
9826
- }
9868
+ const policy = opts?.policy ?? "throw";
9869
+ const callerChain = toChain(fallback);
9870
+ const callerHit = pickFromChain(value, callerChain);
9871
+ if (callerHit !== void 0) return callerHit;
9872
+ if (policy === "substitute") {
9873
+ const subHit = pickFromChain(value, toChain(opts?.substitute));
9874
+ if (subHit !== void 0) return subHit;
9875
+ }
9876
+ if (policy === "throw") {
9877
+ throw new LocaleNotSpecifiedError(
9878
+ field ?? "<unknown>",
9879
+ `No translation available for locale "${locale}"` + (callerChain.length > 0 ? ` or fallback chain [${callerChain.join(", ")}]` : "") + "."
9880
+ );
9827
9881
  }
9828
- throw new LocaleNotSpecifiedError(
9829
- field ?? "<unknown>",
9830
- `No translation available for locale "${locale}"` + (chain.length > 0 ? ` or fallback chain [${chain.join(", ")}]` : "") + "."
9831
- );
9882
+ return null;
9832
9883
  }
9833
9884
  function getAtPath(obj, path) {
9834
9885
  const arrayIdx = path.indexOf("[].");
@@ -9865,7 +9916,7 @@ function setAtPathInPlace(obj, path, value) {
9865
9916
  }
9866
9917
  obj[path] = value;
9867
9918
  }
9868
- function applyAtPath(obj, path, locale, fallback) {
9919
+ function applyAtPath(obj, path, locale, fallback, opts) {
9869
9920
  const arrayIdx = path.indexOf("[].");
9870
9921
  if (arrayIdx !== -1) {
9871
9922
  const arrayKey = path.slice(0, arrayIdx);
@@ -9876,7 +9927,7 @@ function applyAtPath(obj, path, locale, fallback) {
9876
9927
  ...obj,
9877
9928
  [arrayKey]: arr.map((item) => {
9878
9929
  if (!item || typeof item !== "object" || Array.isArray(item)) return item;
9879
- return applyAtPath(item, restPath, locale, fallback);
9930
+ return applyAtPath(item, restPath, locale, fallback, opts);
9880
9931
  })
9881
9932
  };
9882
9933
  }
@@ -9888,7 +9939,7 @@ function applyAtPath(obj, path, locale, fallback) {
9888
9939
  if (!nested || typeof nested !== "object" || Array.isArray(nested)) return obj;
9889
9940
  return {
9890
9941
  ...obj,
9891
- [head]: applyAtPath(nested, rest, locale, fallback)
9942
+ [head]: applyAtPath(nested, rest, locale, fallback, opts)
9892
9943
  };
9893
9944
  }
9894
9945
  const raw = obj[path];
@@ -9896,15 +9947,20 @@ function applyAtPath(obj, path, locale, fallback) {
9896
9947
  if (typeof raw !== "object" || Array.isArray(raw)) return obj;
9897
9948
  return {
9898
9949
  ...obj,
9899
- [path]: resolveI18nText(raw, locale, fallback, path)
9950
+ [path]: resolveI18nText(raw, locale, fallback, path, opts)
9900
9951
  };
9901
9952
  }
9902
- function applyI18nLocale(record, i18nFields, locale, fallback) {
9953
+ function applyI18nLocale(record, i18nFields, locale, fallback, layer = "read") {
9903
9954
  const fieldNames = Object.keys(i18nFields);
9904
9955
  if (fieldNames.length === 0) return record;
9905
9956
  let result = record;
9906
- for (const field of fieldNames) {
9907
- result = applyAtPath(result, field, locale, fallback);
9957
+ for (const [field, descriptor] of Object.entries(i18nFields)) {
9958
+ const { onMissing, substitute } = descriptor.options;
9959
+ const opts = {
9960
+ policy: resolvePolicy(onMissing, layer),
9961
+ ...substitute !== void 0 ? { substitute } : {}
9962
+ };
9963
+ result = applyAtPath(result, field, locale, fallback, opts);
9908
9964
  }
9909
9965
  return result;
9910
9966
  }
@@ -9922,6 +9978,9 @@ var NO_I18N = {
9922
9978
  validateI18nTextValue() {
9923
9979
  throw notEnabled("i18nText field validation");
9924
9980
  },
9981
+ enforceScript(value) {
9982
+ return { value, warnings: [] };
9983
+ },
9925
9984
  buildDictionaryHandle() {
9926
9985
  throw notEnabled("vault.dictionary()");
9927
9986
  }
@@ -13111,6 +13170,22 @@ var Collection = class {
13111
13170
  setAtPathInPlace(obj, field, translated);
13112
13171
  }
13113
13172
  }
13173
+ if (this.i18nFields) {
13174
+ const obj = record;
13175
+ for (const [field, descriptor] of Object.entries(this.i18nFields)) {
13176
+ if (!descriptor.options.script) continue;
13177
+ for (const leaf of getAtPath(obj, field)) {
13178
+ if (!leaf || typeof leaf !== "object" || Array.isArray(leaf)) continue;
13179
+ const leafMap = leaf;
13180
+ const { value: cleaned } = this.i18nStrategy.enforceScript(
13181
+ leafMap,
13182
+ field,
13183
+ descriptor
13184
+ );
13185
+ if (cleaned !== leafMap) Object.assign(leafMap, cleaned);
13186
+ }
13187
+ }
13188
+ }
13114
13189
  if (this.i18nPutValidator !== void 0) {
13115
13190
  this.i18nPutValidator(record);
13116
13191
  }
@@ -14553,17 +14628,52 @@ var Collection = class {
14553
14628
  }
14554
14629
  if (hasDict && this.dictKeyFields && this.dictLabelResolver && locale !== "raw") {
14555
14630
  const withLabels = { ...result };
14631
+ const resolver = this.dictLabelResolver;
14556
14632
  for (const [field, desc] of Object.entries(this.dictKeyFields)) {
14557
- const key = result[field];
14558
- if (typeof key !== "string") continue;
14559
- const label = await this.dictLabelResolver(
14560
- desc.name,
14561
- key,
14562
- locale,
14563
- localeOpts?.fallback
14564
- );
14565
- if (label !== void 0) {
14566
- withLabels[`${field}Label`] = label;
14633
+ const policy = desc.onMissing ? resolvePolicy(desc.onMissing, "read") : "null";
14634
+ const fallback = policy === "substitute" ? localeOpts?.fallback ?? desc.substitute : localeOpts?.fallback;
14635
+ const resolveKey = async (key) => {
14636
+ const label = await resolver(desc.name, key, locale, fallback);
14637
+ if (label === void 0) {
14638
+ if (policy === "throw") {
14639
+ throw new LocaleNotSpecifiedError(
14640
+ field,
14641
+ `dictKey "${field}": no label for key "${key}" in locale "${locale}".`
14642
+ );
14643
+ }
14644
+ return null;
14645
+ }
14646
+ return label;
14647
+ };
14648
+ if (field.includes("[].")) {
14649
+ const parts = field.split("[].");
14650
+ const arrayKey = parts[0];
14651
+ const leaf = parts[1];
14652
+ if (!leaf || leaf.includes(".")) continue;
14653
+ const arr = withLabels[arrayKey];
14654
+ if (!Array.isArray(arr)) continue;
14655
+ const labelKey = `${leaf}Label`;
14656
+ withLabels[arrayKey] = await Promise.all(
14657
+ arr.map(async (el) => {
14658
+ if (!el || typeof el !== "object" || Array.isArray(el)) return el;
14659
+ const k = el[leaf];
14660
+ if (typeof k !== "string") return el;
14661
+ return { ...el, [labelKey]: await resolveKey(k) };
14662
+ })
14663
+ );
14664
+ continue;
14665
+ }
14666
+ const val = result[field];
14667
+ if (Array.isArray(val)) {
14668
+ withLabels[`${field}Label`] = await Promise.all(
14669
+ val.map(async (k) => ({
14670
+ key: k,
14671
+ label: typeof k === "string" ? await resolveKey(k) : null
14672
+ }))
14673
+ );
14674
+ } else if (typeof val === "string") {
14675
+ const label = await resolveKey(val);
14676
+ if (label !== null) withLabels[`${field}Label`] = label;
14567
14677
  }
14568
14678
  }
14569
14679
  result = withLabels;
@@ -15438,8 +15548,14 @@ function dictCollectionName(dictionaryName) {
15438
15548
  function isDictCollectionName(name) {
15439
15549
  return name.startsWith(DICT_COLLECTION_PREFIX);
15440
15550
  }
15441
- function dictKey(name, keys) {
15442
- return { _noydbDictKey: true, name, keys };
15551
+ function dictKey(name, keys, opts) {
15552
+ return {
15553
+ _noydbDictKey: true,
15554
+ name,
15555
+ keys,
15556
+ ...opts?.onMissing !== void 0 ? { onMissing: opts.onMissing } : {},
15557
+ ...opts?.substitute !== void 0 ? { substitute: opts.substitute } : {}
15558
+ };
15443
15559
  }
15444
15560
  function isDictKeyDescriptor(x) {
15445
15561
  return typeof x === "object" && x !== null && x._noydbDictKey === true;
@@ -23119,6 +23235,139 @@ function withOverlayedView(spec) {
23119
23235
  // src/index.ts
23120
23236
  init_errors();
23121
23237
  init_errors();
23238
+
23239
+ // src/i18n/script.ts
23240
+ init_errors();
23241
+ var LATIN_BASE = /* @__PURE__ */ new Set([
23242
+ "en",
23243
+ "fr",
23244
+ "de",
23245
+ "es",
23246
+ "it",
23247
+ "pt",
23248
+ "nl",
23249
+ "sv",
23250
+ "no",
23251
+ "da",
23252
+ "fi",
23253
+ "is",
23254
+ "pl",
23255
+ "cs",
23256
+ "sk",
23257
+ "hu",
23258
+ "ro",
23259
+ "hr",
23260
+ "sl",
23261
+ "et",
23262
+ "lv",
23263
+ "lt",
23264
+ "tr",
23265
+ "vi",
23266
+ "id",
23267
+ "ms",
23268
+ "tl",
23269
+ "sw",
23270
+ "af",
23271
+ "ca",
23272
+ "gl",
23273
+ "eu",
23274
+ "cy",
23275
+ "ga"
23276
+ ]);
23277
+ var SCRIPT_TABLE = {
23278
+ th: ["Thai"],
23279
+ ko: ["Hangul", "Han"],
23280
+ ja: ["Han", "Hiragana", "Katakana"],
23281
+ zh: ["Han"],
23282
+ ar: ["Arabic"],
23283
+ fa: ["Arabic"],
23284
+ ur: ["Arabic"],
23285
+ ru: ["Cyrillic"],
23286
+ uk: ["Cyrillic"],
23287
+ bg: ["Cyrillic"],
23288
+ sr: ["Cyrillic"],
23289
+ he: ["Hebrew"],
23290
+ el: ["Greek"],
23291
+ hi: ["Devanagari"],
23292
+ ta: ["Tamil"],
23293
+ km: ["Khmer"],
23294
+ lo: ["Lao"],
23295
+ my: ["Myanmar"]
23296
+ };
23297
+ var SUBTAG_SCRIPTS = {
23298
+ Latn: ["Latin"],
23299
+ Cyrl: ["Cyrillic", "Latin"],
23300
+ Hans: ["Han", "Latin"],
23301
+ Hant: ["Han", "Latin"],
23302
+ Thai: ["Thai", "Latin"],
23303
+ Arab: ["Arabic", "Latin"]
23304
+ };
23305
+ function inferScripts(locale) {
23306
+ const parts = locale.split("-");
23307
+ const subtag = parts.find((t) => /^[A-Z][a-z]{3}$/.test(t));
23308
+ if (subtag && SUBTAG_SCRIPTS[subtag]) return SUBTAG_SCRIPTS[subtag];
23309
+ const base = (parts[0] ?? "").toLowerCase();
23310
+ if (LATIN_BASE.has(base)) return ["Latin"];
23311
+ const primary = SCRIPT_TABLE[base];
23312
+ if (primary) return [...primary, "Latin"];
23313
+ return ["Latin"];
23314
+ }
23315
+ function allowedFor(descriptor, locale) {
23316
+ const script = descriptor.options.script;
23317
+ if (script && script !== "auto") {
23318
+ const explicit = script[locale];
23319
+ if (explicit) return explicit;
23320
+ }
23321
+ return inferScripts(locale);
23322
+ }
23323
+ var BASELINE = String.raw`\p{White_Space}\p{Script=Common}\p{Script=Inherited}\p{Mark}`;
23324
+ function fullMatcher(scripts) {
23325
+ const cls = scripts.map((s) => `\\p{Script=${s}}`).join("");
23326
+ return new RegExp(`^[${BASELINE}${cls}]*$`, "u");
23327
+ }
23328
+ function charMatcher(scripts) {
23329
+ const cls = scripts.map((s) => `\\p{Script=${s}}`).join("");
23330
+ return new RegExp(`[${BASELINE}${cls}]`, "u");
23331
+ }
23332
+ function offendingSample(str, scripts) {
23333
+ const ok = charMatcher(scripts);
23334
+ const bad = [];
23335
+ for (const ch of str) {
23336
+ if (!ok.test(ch)) bad.push(ch);
23337
+ if (bad.length >= 8) break;
23338
+ }
23339
+ return bad.join("");
23340
+ }
23341
+ function stripDisallowed(str, scripts) {
23342
+ const ok = charMatcher(scripts);
23343
+ let out = "";
23344
+ for (const ch of str) if (ok.test(ch)) out += ch;
23345
+ return out;
23346
+ }
23347
+ function enforceScript(value, field, descriptor) {
23348
+ const opt = descriptor.options;
23349
+ if (!opt.script) return { value, warnings: [] };
23350
+ const mode = opt.onScriptViolation ?? "reject";
23351
+ const warnings = [];
23352
+ let out = value;
23353
+ for (const [locale, raw] of Object.entries(value)) {
23354
+ if (typeof raw !== "string") continue;
23355
+ const allowed = allowedFor(descriptor, locale);
23356
+ if (fullMatcher(allowed).test(raw)) continue;
23357
+ const sample = offendingSample(raw, allowed);
23358
+ if (mode === "reject") {
23359
+ throw new ScriptViolationError(field, locale, allowed, sample);
23360
+ }
23361
+ warnings.push({ field, locale, expected: allowed, sample });
23362
+ if (mode === "filter") {
23363
+ if (out === value) out = { ...value };
23364
+ out[locale] = stripDisallowed(raw, allowed);
23365
+ }
23366
+ }
23367
+ return { value: out, warnings };
23368
+ }
23369
+
23370
+ // src/index.ts
23122
23371
  init_errors();
23123
23372
 
23124
23373
  // src/team/sync-credentials.ts
@@ -23880,6 +24129,7 @@ function shortJSON(value) {
23880
24129
  SchemaLockedError,
23881
24130
  SchemaUpdateError,
23882
24131
  SchemaValidationError,
24132
+ ScriptViolationError,
23883
24133
  SessionExpiredError,
23884
24134
  SessionNotFoundError,
23885
24135
  SessionPolicyError,
@@ -23955,6 +24205,7 @@ function shortJSON(value) {
23955
24205
  enableDevUnlock,
23956
24206
  encryptBytes,
23957
24207
  encryptDeterministic,
24208
+ enforceScript,
23958
24209
  enrollAuthenticator,
23959
24210
  envelopePayloadHash,
23960
24211
  estimateEntropy,
@@ -23975,6 +24226,7 @@ function shortJSON(value) {
23975
24226
  hasRecoveryEnrolled,
23976
24227
  hashEntry,
23977
24228
  i18nText,
24229
+ inferScripts,
23978
24230
  isDevUnlockActive,
23979
24231
  isDictCollectionName,
23980
24232
  isDictKeyDescriptor,
@@ -24035,6 +24287,7 @@ function shortJSON(value) {
24035
24287
  resetJoinWarnings,
24036
24288
  resolveCrdtSnapshot,
24037
24289
  resolveI18nText,
24290
+ resolvePolicy,
24038
24291
  resolvePublicEnvelopeSchema,
24039
24292
  resolveSession,
24040
24293
  revokeAllSessions,