@burdenoff/be-sdk 2026.1110.1 → 2026.1110.3

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 (469) hide show
  1. package/configs/eslint/index.js +1 -1
  2. package/configs/tsconfig/tsconfig.json +1 -1
  3. package/dist/EventQueueFactory-9NGZV9jl.js +1457 -0
  4. package/dist/EventQueueFactory-9NGZV9jl.js.map +1 -0
  5. package/dist/RedisStreamsConnection-CY8WySJy.js +283 -0
  6. package/dist/RedisStreamsConnection-CY8WySJy.js.map +1 -0
  7. package/dist/ai-credits/index.d.ts +2 -3
  8. package/dist/ai-credits/index.js +3 -4
  9. package/dist/ai-credits/index.js.map +1 -1
  10. package/dist/ai-credits-Ca-NNcVx.js +546 -0
  11. package/dist/ai-credits-Ca-NNcVx.js.map +1 -0
  12. package/dist/{assistant-session-CJZhF4D6.d.ts → assistant-session-DA5ZKJOr.d.ts} +4 -5
  13. package/dist/auth/index.d.ts +2 -77
  14. package/dist/auth/index.js +3 -7
  15. package/dist/auth/index.js.map +1 -1
  16. package/dist/auth-CEuBEBQN.js +228 -0
  17. package/dist/auth-CEuBEBQN.js.map +1 -0
  18. package/dist/cache/index.d.ts +2 -3
  19. package/dist/cache/index.js +3 -7
  20. package/dist/cache/index.js.map +1 -1
  21. package/dist/cache-CU0uLwcS.js +1837 -0
  22. package/dist/cache-CU0uLwcS.js.map +1 -0
  23. package/dist/captcha/index.d.ts +2 -1
  24. package/dist/captcha/index.js +3 -3
  25. package/dist/captcha/index.js.map +1 -1
  26. package/dist/captcha-BT7yh1YS.js +77 -0
  27. package/dist/captcha-BT7yh1YS.js.map +1 -0
  28. package/dist/client/internal-client.d.ts +4 -7
  29. package/dist/client/internal-client.js +172 -4
  30. package/dist/client/internal-client.js.map +1 -1
  31. package/dist/client-BgAEvDC2.d.ts +86 -0
  32. package/dist/client-DcZ3iGES.js +565 -0
  33. package/dist/client-DcZ3iGES.js.map +1 -0
  34. package/dist/collector-endpoint-iyQYeI50.js +50 -0
  35. package/dist/collector-endpoint-iyQYeI50.js.map +1 -0
  36. package/dist/context-CZnXf2yb.js +247 -0
  37. package/dist/context-CZnXf2yb.js.map +1 -0
  38. package/dist/crypto/index.d.ts +2 -1
  39. package/dist/crypto/index.js +3 -3
  40. package/dist/crypto/index.js.map +1 -1
  41. package/dist/crypto-DO9fM0FO.js +145 -0
  42. package/dist/crypto-DO9fM0FO.js.map +1 -0
  43. package/dist/database/index.d.ts +104 -108
  44. package/dist/database/index.js +468 -6
  45. package/dist/database/index.js.map +1 -1
  46. package/dist/dataloader/index.d.ts +2 -1
  47. package/dist/dataloader/index.js +3 -3
  48. package/dist/dataloader/index.js.map +1 -1
  49. package/dist/dataloader-DwpT3YoS.js +294 -0
  50. package/dist/dataloader-DwpT3YoS.js.map +1 -0
  51. package/dist/deployed-environment-p_Tdl3sT.js +38 -0
  52. package/dist/deployed-environment-p_Tdl3sT.js.map +1 -0
  53. package/dist/dist-BGKdXVy3.js +1718 -0
  54. package/dist/dist-BGKdXVy3.js.map +1 -0
  55. package/dist/env-DdaoGjIt.js +74 -0
  56. package/dist/env-DdaoGjIt.js.map +1 -0
  57. package/dist/event-queue/index.d.ts +2 -7
  58. package/dist/event-queue/index.js +7 -9
  59. package/dist/event-queue/index.js.map +1 -1
  60. package/dist/event-queue-Cw-YJPY_.js +1384 -0
  61. package/dist/event-queue-Cw-YJPY_.js.map +1 -0
  62. package/dist/{explicit-activity-scope-CCoxVwAr.d.ts → explicit-activity-scope-D8VeGGpt.d.ts} +1 -2
  63. package/dist/export/index.d.ts +2 -2
  64. package/dist/export/index.js +3 -14
  65. package/dist/export/index.js.map +1 -1
  66. package/dist/export-B6fphx8a.js +642 -0
  67. package/dist/export-B6fphx8a.js.map +1 -0
  68. package/dist/feature-flags/index.d.ts +2 -10
  69. package/dist/feature-flags/index.js +3 -6
  70. package/dist/feature-flags/index.js.map +1 -1
  71. package/dist/feature-flags-71oDkrUe.js +422 -0
  72. package/dist/feature-flags-71oDkrUe.js.map +1 -0
  73. package/dist/files/index.d.ts +2 -3
  74. package/dist/files/index.js +3 -4
  75. package/dist/files/index.js.map +1 -1
  76. package/dist/files-DjH0099H.js +830 -0
  77. package/dist/files-DjH0099H.js.map +1 -0
  78. package/dist/gateway/index.d.ts +4 -6
  79. package/dist/gateway/index.js +7 -13
  80. package/dist/gateway/index.js.map +1 -1
  81. package/dist/gateway/security/index.d.ts +2 -2
  82. package/dist/gateway/security/index.js +3 -5
  83. package/dist/gateway/security/index.js.map +1 -1
  84. package/dist/gateway-DBFmxWks.js +50 -0
  85. package/dist/gateway-DBFmxWks.js.map +1 -0
  86. package/dist/graph/index.d.ts +3 -10
  87. package/dist/graph/index.js +4 -13
  88. package/dist/graph/index.js.map +1 -1
  89. package/dist/graph-DDYgIryR.js +2152 -0
  90. package/dist/graph-DDYgIryR.js.map +1 -0
  91. package/dist/graph-emitter-CdOXP7Tn.js +621 -0
  92. package/dist/graph-emitter-CdOXP7Tn.js.map +1 -0
  93. package/dist/graphql/index.d.ts +3 -2
  94. package/dist/graphql/index.js +4 -6
  95. package/dist/graphql/index.js.map +1 -1
  96. package/dist/graphql/services/index.d.ts +2 -24
  97. package/dist/graphql/services/index.js +3 -4
  98. package/dist/graphql/services/index.js.map +1 -1
  99. package/dist/graphql-DHAHHcww.js +161 -0
  100. package/dist/graphql-DHAHHcww.js.map +1 -0
  101. package/dist/graphql-DNkMkGBZ.d.ts +21 -0
  102. package/dist/i18n/index.d.ts +3 -3
  103. package/dist/i18n/index.js +3 -4
  104. package/dist/i18n/index.js.map +1 -1
  105. package/dist/i18n-BBMYFd0P.js +860 -0
  106. package/dist/i18n-BBMYFd0P.js.map +1 -0
  107. package/dist/import-optional-peer-B82VYxeX.js +18 -0
  108. package/dist/import-optional-peer-B82VYxeX.js.map +1 -0
  109. package/dist/index-3KOZ1zN9.d.ts +233 -0
  110. package/dist/index-BBqooJ52.d.ts +45 -0
  111. package/dist/index-BGzMYJsm.d.ts +209 -0
  112. package/dist/index-BKwHQtHQ.d.ts +63 -0
  113. package/dist/index-BMIMnp6T.d.ts +8 -0
  114. package/dist/index-BQDsNAMR.d.ts +81 -0
  115. package/dist/index-BVOL7458.d.ts +10 -0
  116. package/dist/index-BcqQs-Uq.d.ts +69 -0
  117. package/dist/index-BeVtqGO-.d.ts +208 -0
  118. package/dist/index-BiTzGUZP.d.ts +114 -0
  119. package/dist/index-BqYfCQSP.d.ts +500 -0
  120. package/dist/index-C0qLquY0.d.ts +150 -0
  121. package/dist/index-C5uEKchX.d.ts +60 -0
  122. package/dist/index-CDOqxSIi.d.ts +37 -0
  123. package/dist/index-CG6wj66Y.d.ts +148 -0
  124. package/dist/index-CIgoeobA.d.ts +145 -0
  125. package/dist/index-CPQDMSFS.d.ts +103 -0
  126. package/dist/index-CSRcgkVi.d.ts +23 -0
  127. package/dist/index-CZTnQIRU.d.ts +341 -0
  128. package/dist/index-CaM9JUcc.d.ts +144 -0
  129. package/dist/index-CkT2aUr3.d.ts +704 -0
  130. package/dist/index-CliOgq6L.d.ts +203 -0
  131. package/dist/index-CnzbJZP7.d.ts +999 -0
  132. package/dist/index-D6UeLAye.d.ts +63 -0
  133. package/dist/index-DGgh9DWn.d.ts +59 -0
  134. package/dist/index-DY3dNhMN.d.ts +420 -0
  135. package/dist/index-DZC-2o9R.d.ts +207 -0
  136. package/dist/index-DqbGqfAy.d.ts +127 -0
  137. package/dist/index-Dt1HJPTX.d.ts +12 -0
  138. package/dist/index-DtI6aBtB.d.ts +22 -0
  139. package/dist/index-FKohsiex.d.ts +38 -0
  140. package/dist/index-FbXPfen7.d.ts +132 -0
  141. package/dist/index-MArCb8Aq.d.ts +306 -0
  142. package/dist/index-N-huORcj.d.ts +303 -0
  143. package/dist/index-YOShAwkq.d.ts +45 -0
  144. package/dist/index-bZKZUvBu.d.ts +646 -0
  145. package/dist/index-yBSjMY32.d.ts +24 -0
  146. package/dist/index.d.ts +501 -544
  147. package/dist/index.js +1820 -2171
  148. package/dist/index.js.map +1 -1
  149. package/dist/init/index.d.ts +2 -2
  150. package/dist/init/index.js +3 -16
  151. package/dist/init/index.js.map +1 -1
  152. package/dist/init-Dy3KhT6Y.js +325 -0
  153. package/dist/init-Dy3KhT6Y.js.map +1 -0
  154. package/dist/instrumentation/index.d.ts +3 -4
  155. package/dist/instrumentation/index.js +5 -5
  156. package/dist/instrumentation/index.js.map +1 -1
  157. package/dist/instrumentation-xkkmDgJ0.js +1678 -0
  158. package/dist/instrumentation-xkkmDgJ0.js.map +1 -0
  159. package/dist/lake/index.d.ts +50 -54
  160. package/dist/lake/index.js +169 -193
  161. package/dist/lake/index.js.map +1 -1
  162. package/dist/layer/index.d.ts +3 -2
  163. package/dist/layer/index.js +4 -5
  164. package/dist/layer/index.js.map +1 -1
  165. package/dist/layer-BZBZZWeV.d.ts +69 -0
  166. package/dist/layer-Bcix-WCl.js +105 -0
  167. package/dist/layer-Bcix-WCl.js.map +1 -0
  168. package/dist/layer-CEKy6cm8.js +252 -0
  169. package/dist/layer-CEKy6cm8.js.map +1 -0
  170. package/dist/lifecycle/index.d.ts +2 -1
  171. package/dist/lifecycle/index.js +3 -4
  172. package/dist/lifecycle/index.js.map +1 -1
  173. package/dist/lifecycle-DeoLSX0U.js +76 -0
  174. package/dist/lifecycle-DeoLSX0U.js.map +1 -0
  175. package/dist/logger/index.d.ts +2 -3
  176. package/dist/logger/index.js +3 -3
  177. package/dist/logger/index.js.map +1 -1
  178. package/dist/logger-B6rCpb7D.js +290 -0
  179. package/dist/logger-B6rCpb7D.js.map +1 -0
  180. package/dist/metrics/index.d.ts +13 -14
  181. package/dist/metrics/index.js +3 -4
  182. package/dist/metrics/index.js.map +1 -1
  183. package/dist/metrics-BrLwNUrb.js +52 -0
  184. package/dist/metrics-BrLwNUrb.js.map +1 -0
  185. package/dist/metrics-collector-C2eShrlW.js +922 -0
  186. package/dist/metrics-collector-C2eShrlW.js.map +1 -0
  187. package/dist/middleware/index.d.ts +3 -3
  188. package/dist/middleware/index.js +3 -4
  189. package/dist/middleware/index.js.map +1 -1
  190. package/dist/middleware-CUxJVUpD.js +1243 -0
  191. package/dist/middleware-CUxJVUpD.js.map +1 -0
  192. package/dist/middleware-Cq0zFMGp.js +253 -0
  193. package/dist/middleware-Cq0zFMGp.js.map +1 -0
  194. package/dist/notifications/index.d.ts +2 -5
  195. package/dist/notifications/index.js +3 -6
  196. package/dist/notifications/index.js.map +1 -1
  197. package/dist/notifications-CdETrtFK.js +869 -0
  198. package/dist/notifications-CdETrtFK.js.map +1 -0
  199. package/dist/observability/index.d.ts +2 -3
  200. package/dist/observability/index.js +3 -4
  201. package/dist/observability/index.js.map +1 -1
  202. package/dist/observability-DBDXipTU.js +272 -0
  203. package/dist/observability-DBDXipTU.js.map +1 -0
  204. package/dist/platform/index.d.ts +2 -1
  205. package/dist/platform/index.js +3 -5
  206. package/dist/platform/index.js.map +1 -1
  207. package/dist/platform-DZwczW7v.js +1510 -0
  208. package/dist/platform-DZwczW7v.js.map +1 -0
  209. package/dist/prisma/generator/index.d.ts +1 -1
  210. package/dist/prisma/generator/index.js +97 -84
  211. package/dist/prisma/generator/index.js.map +1 -1
  212. package/dist/prisma/index.d.ts +4 -7
  213. package/dist/prisma/index.js +5 -12
  214. package/dist/prisma/index.js.map +1 -1
  215. package/dist/prisma-BzOOdt79.js +863 -0
  216. package/dist/prisma-BzOOdt79.js.map +1 -0
  217. package/dist/prisma-extension-Cfl09swM.d.ts +172 -0
  218. package/dist/product-alias/index.d.ts +2 -1
  219. package/dist/product-alias/index.js +3 -3
  220. package/dist/product-alias/index.js.map +1 -1
  221. package/dist/product-alias-BPqtskMq.js +273 -0
  222. package/dist/product-alias-BPqtskMq.js.map +1 -0
  223. package/dist/rbac/index.d.ts +2 -122
  224. package/dist/rbac/index.js +3 -6
  225. package/dist/rbac/index.js.map +1 -1
  226. package/dist/rbac-BB9l9Xph.js +1486 -0
  227. package/dist/rbac-BB9l9Xph.js.map +1 -0
  228. package/dist/resource-caps/index.d.ts +66 -72
  229. package/dist/resource-caps/index.js +430 -5
  230. package/dist/resource-caps/index.js.map +1 -1
  231. package/dist/rolldown-runtime-ad2WFvuA.js +17 -0
  232. package/dist/sdk-Dju9o-sq.js +124 -0
  233. package/dist/sdk-Dju9o-sq.js.map +1 -0
  234. package/dist/security-DIG-95Ic.js +1647 -0
  235. package/dist/security-DIG-95Ic.js.map +1 -0
  236. package/dist/server/index.d.ts +7 -164
  237. package/dist/server/index.js +2000 -1507
  238. package/dist/server/index.js.map +1 -1
  239. package/dist/service-jwt-Bu-WNA_-.js +80 -0
  240. package/dist/service-jwt-Bu-WNA_-.js.map +1 -0
  241. package/dist/services-BWzfz7vG.js +102 -0
  242. package/dist/services-BWzfz7vG.js.map +1 -0
  243. package/dist/sharding/index.d.ts +41 -44
  244. package/dist/sharding/index.js +156 -137
  245. package/dist/sharding/index.js.map +1 -1
  246. package/dist/sharing/index.d.ts +2 -1
  247. package/dist/sharing/index.js +3 -4
  248. package/dist/sharing/index.js.map +1 -1
  249. package/dist/sharing-CflDsSJ-.js +911 -0
  250. package/dist/sharing-CflDsSJ-.js.map +1 -0
  251. package/dist/stub-BqwKn4eh.js +630 -0
  252. package/dist/stub-BqwKn4eh.js.map +1 -0
  253. package/dist/tags/index.d.ts +2 -3
  254. package/dist/tags/index.js +3 -4
  255. package/dist/tags/index.js.map +1 -1
  256. package/dist/tags-B5xpbgsk.js +868 -0
  257. package/dist/{chunk-PBZFAAOM.js.map → tags-B5xpbgsk.js.map} +1 -1
  258. package/dist/telemetry/index.d.ts +64 -76
  259. package/dist/telemetry/index.js +369 -201
  260. package/dist/telemetry/index.js.map +1 -1
  261. package/dist/temporal/index.d.ts +2 -148
  262. package/dist/temporal/index.js +3 -5
  263. package/dist/temporal/index.js.map +1 -1
  264. package/dist/temporal-B534uYK8.js +706 -0
  265. package/dist/temporal-B534uYK8.js.map +1 -0
  266. package/dist/tracker/index.d.ts +5 -11
  267. package/dist/tracker/index.js +5 -20
  268. package/dist/tracker/index.js.map +1 -1
  269. package/dist/tracker-BQVoEFUo.js +839 -0
  270. package/dist/tracker-BQVoEFUo.js.map +1 -0
  271. package/dist/types-BYMYND1L.js +44 -0
  272. package/dist/types-BYMYND1L.js.map +1 -0
  273. package/dist/types-C6EKaS3V.d.ts +106 -0
  274. package/dist/types-CWybW61E.d.ts +323 -0
  275. package/dist/types-C_yfu3XK.d.ts +34 -0
  276. package/dist/types-Cj2RWXbz.js +90 -0
  277. package/dist/types-Cj2RWXbz.js.map +1 -0
  278. package/dist/types-DgaQqvxo.d.ts +70 -0
  279. package/dist/usage/index.d.ts +2 -213
  280. package/dist/usage/index.js +3 -15
  281. package/dist/usage/index.js.map +1 -1
  282. package/dist/usage-BKFZiWQn.js +682 -0
  283. package/dist/usage-BKFZiWQn.js.map +1 -0
  284. package/dist/utils/index.d.ts +2 -1
  285. package/dist/utils/index.js +3 -3
  286. package/dist/utils/index.js.map +1 -1
  287. package/dist/utils-DL85Tnbn.js +500 -0
  288. package/dist/utils-DL85Tnbn.js.map +1 -0
  289. package/dist/validation/index.d.ts +2 -2
  290. package/dist/validation/index.js +3 -3
  291. package/dist/validation/index.js.map +1 -1
  292. package/dist/validation-CPUITdMk.js +762 -0
  293. package/dist/validation-CPUITdMk.js.map +1 -0
  294. package/dist/workspace-extension-COrC0dYi.js +979 -0
  295. package/dist/workspace-extension-COrC0dYi.js.map +1 -0
  296. package/dist/{workspace-extension-BGwTOV_r.d.ts → workspace-extension-DTFTdGVF.d.ts} +43 -45
  297. package/package.json +7 -10
  298. package/dist/EventQueueFactory-PP534MBQ.js +0 -8
  299. package/dist/EventQueueFactory-PP534MBQ.js.map +0 -1
  300. package/dist/chunk-4XIBXZ6J.js +0 -276
  301. package/dist/chunk-4XIBXZ6J.js.map +0 -1
  302. package/dist/chunk-554Z4C2K.js +0 -1006
  303. package/dist/chunk-554Z4C2K.js.map +0 -1
  304. package/dist/chunk-5CAFHK2Z.js +0 -107
  305. package/dist/chunk-5CAFHK2Z.js.map +0 -1
  306. package/dist/chunk-63ZXJ42X.js +0 -451
  307. package/dist/chunk-63ZXJ42X.js.map +0 -1
  308. package/dist/chunk-6XEXJATV.js +0 -304
  309. package/dist/chunk-6XEXJATV.js.map +0 -1
  310. package/dist/chunk-726AR6Q7.js +0 -1532
  311. package/dist/chunk-726AR6Q7.js.map +0 -1
  312. package/dist/chunk-7EISSMFP.js +0 -617
  313. package/dist/chunk-7EISSMFP.js.map +0 -1
  314. package/dist/chunk-A5F6Z5UE.js +0 -21
  315. package/dist/chunk-A5F6Z5UE.js.map +0 -1
  316. package/dist/chunk-A6DE32ZS.js +0 -1507
  317. package/dist/chunk-A6DE32ZS.js.map +0 -1
  318. package/dist/chunk-BJQOGOVW.js +0 -602
  319. package/dist/chunk-BJQOGOVW.js.map +0 -1
  320. package/dist/chunk-CFXWH2IS.js +0 -52
  321. package/dist/chunk-CFXWH2IS.js.map +0 -1
  322. package/dist/chunk-DIOS6L7M.js +0 -690
  323. package/dist/chunk-DIOS6L7M.js.map +0 -1
  324. package/dist/chunk-DJNHR37J.js +0 -1185
  325. package/dist/chunk-DJNHR37J.js.map +0 -1
  326. package/dist/chunk-DRWH5XCJ.js +0 -876
  327. package/dist/chunk-DRWH5XCJ.js.map +0 -1
  328. package/dist/chunk-E4QNLVY4.js +0 -909
  329. package/dist/chunk-E4QNLVY4.js.map +0 -1
  330. package/dist/chunk-E6OAFS7A.js +0 -1346
  331. package/dist/chunk-E6OAFS7A.js.map +0 -1
  332. package/dist/chunk-EBDHIL7V.js +0 -774
  333. package/dist/chunk-EBDHIL7V.js.map +0 -1
  334. package/dist/chunk-ELU7VL3E.js +0 -245
  335. package/dist/chunk-ELU7VL3E.js.map +0 -1
  336. package/dist/chunk-FZRODKIN.js +0 -31
  337. package/dist/chunk-FZRODKIN.js.map +0 -1
  338. package/dist/chunk-GCIB76AJ.js +0 -882
  339. package/dist/chunk-GCIB76AJ.js.map +0 -1
  340. package/dist/chunk-HC6MPUIH.js +0 -1571
  341. package/dist/chunk-HC6MPUIH.js.map +0 -1
  342. package/dist/chunk-I3KOWRT3.js +0 -89
  343. package/dist/chunk-I3KOWRT3.js.map +0 -1
  344. package/dist/chunk-ID3WR4JS.js +0 -509
  345. package/dist/chunk-ID3WR4JS.js.map +0 -1
  346. package/dist/chunk-JVMAQOA3.js +0 -521
  347. package/dist/chunk-JVMAQOA3.js.map +0 -1
  348. package/dist/chunk-K56L7NUR.js +0 -1444
  349. package/dist/chunk-K56L7NUR.js.map +0 -1
  350. package/dist/chunk-KH4TRQCO.js +0 -1063
  351. package/dist/chunk-KH4TRQCO.js.map +0 -1
  352. package/dist/chunk-KJOSPVB2.js +0 -57
  353. package/dist/chunk-KJOSPVB2.js.map +0 -1
  354. package/dist/chunk-KO2ZXZ7W.js +0 -61
  355. package/dist/chunk-KO2ZXZ7W.js.map +0 -1
  356. package/dist/chunk-KS2HQCJR.js +0 -56
  357. package/dist/chunk-KS2HQCJR.js.map +0 -1
  358. package/dist/chunk-LA5KPWZ2.js +0 -413
  359. package/dist/chunk-LA5KPWZ2.js.map +0 -1
  360. package/dist/chunk-MESLAC5W.js +0 -574
  361. package/dist/chunk-MESLAC5W.js.map +0 -1
  362. package/dist/chunk-MWPYA2HD.js +0 -94
  363. package/dist/chunk-MWPYA2HD.js.map +0 -1
  364. package/dist/chunk-NUB5GQTU.js +0 -270
  365. package/dist/chunk-NUB5GQTU.js.map +0 -1
  366. package/dist/chunk-O2JMZHNH.js +0 -1908
  367. package/dist/chunk-O2JMZHNH.js.map +0 -1
  368. package/dist/chunk-OBBCR6WY.js +0 -277
  369. package/dist/chunk-OBBCR6WY.js.map +0 -1
  370. package/dist/chunk-OBZQ4AJC.js +0 -272
  371. package/dist/chunk-OBZQ4AJC.js.map +0 -1
  372. package/dist/chunk-OXNCBE7P.js +0 -971
  373. package/dist/chunk-OXNCBE7P.js.map +0 -1
  374. package/dist/chunk-PBZFAAOM.js +0 -941
  375. package/dist/chunk-PYD44IHJ.js +0 -728
  376. package/dist/chunk-PYD44IHJ.js.map +0 -1
  377. package/dist/chunk-QVPIACWD.js +0 -679
  378. package/dist/chunk-QVPIACWD.js.map +0 -1
  379. package/dist/chunk-QWNNFE4P.js +0 -41
  380. package/dist/chunk-QWNNFE4P.js.map +0 -1
  381. package/dist/chunk-RU266375.js +0 -327
  382. package/dist/chunk-RU266375.js.map +0 -1
  383. package/dist/chunk-RYTSVGGA.js +0 -1624
  384. package/dist/chunk-RYTSVGGA.js.map +0 -1
  385. package/dist/chunk-RZOFS2BQ.js +0 -225
  386. package/dist/chunk-RZOFS2BQ.js.map +0 -1
  387. package/dist/chunk-SBS4S2PJ.js +0 -100
  388. package/dist/chunk-SBS4S2PJ.js.map +0 -1
  389. package/dist/chunk-SPRG6G6G.js +0 -530
  390. package/dist/chunk-SPRG6G6G.js.map +0 -1
  391. package/dist/chunk-STWFX5E2.js +0 -233
  392. package/dist/chunk-STWFX5E2.js.map +0 -1
  393. package/dist/chunk-UNASM5VJ.js +0 -419
  394. package/dist/chunk-UNASM5VJ.js.map +0 -1
  395. package/dist/chunk-VAT66FJA.js +0 -245
  396. package/dist/chunk-VAT66FJA.js.map +0 -1
  397. package/dist/chunk-VFCMR5GX.js +0 -49
  398. package/dist/chunk-VFCMR5GX.js.map +0 -1
  399. package/dist/chunk-VGAHZKNJ.js +0 -66
  400. package/dist/chunk-VGAHZKNJ.js.map +0 -1
  401. package/dist/chunk-VTJTAAXC.js +0 -627
  402. package/dist/chunk-VTJTAAXC.js.map +0 -1
  403. package/dist/chunk-VXVLKRU6.js +0 -758
  404. package/dist/chunk-VXVLKRU6.js.map +0 -1
  405. package/dist/chunk-WWUU5ETI.js +0 -163
  406. package/dist/chunk-WWUU5ETI.js.map +0 -1
  407. package/dist/chunk-XE4OXN2W.js +0 -10
  408. package/dist/chunk-XE4OXN2W.js.map +0 -1
  409. package/dist/chunk-XOJORS75.js +0 -1853
  410. package/dist/chunk-XOJORS75.js.map +0 -1
  411. package/dist/chunk-YMZEUTD2.js +0 -110
  412. package/dist/chunk-YMZEUTD2.js.map +0 -1
  413. package/dist/chunk-ZZK3WEDI.js +0 -181
  414. package/dist/chunk-ZZK3WEDI.js.map +0 -1
  415. package/dist/client-CCXpAZ2r.d.ts +0 -89
  416. package/dist/client-DSI_760t.d.ts +0 -36
  417. package/dist/client-JU6T3UPB.js +0 -11
  418. package/dist/client-JU6T3UPB.js.map +0 -1
  419. package/dist/dist-2X4Q7PJA.js +0 -1491
  420. package/dist/dist-2X4Q7PJA.js.map +0 -1
  421. package/dist/env-4UWSUS64.js +0 -4
  422. package/dist/env-4UWSUS64.js.map +0 -1
  423. package/dist/graph-emitter-r5TylDBm.d.ts +0 -47
  424. package/dist/graphql-CMHMQjvd.d.ts +0 -23
  425. package/dist/i18n-Qm2AkPC-.d.ts +0 -33
  426. package/dist/index--yvpa6ay.d.ts +0 -83
  427. package/dist/index-4gKQKZ2B.d.ts +0 -71
  428. package/dist/index-5x0XMKXN.d.ts +0 -149
  429. package/dist/index-B70b5mYS.d.ts +0 -33
  430. package/dist/index-B8KrxO4j.d.ts +0 -755
  431. package/dist/index-BOuDKnqD.d.ts +0 -201
  432. package/dist/index-BTMt4OjA.d.ts +0 -201
  433. package/dist/index-BejbszA7.d.ts +0 -39
  434. package/dist/index-BkeOYZye.d.ts +0 -198
  435. package/dist/index-BuAj5nXg.d.ts +0 -83
  436. package/dist/index-BvkVcW8I.d.ts +0 -349
  437. package/dist/index-CWmH_-RZ.d.ts +0 -247
  438. package/dist/index-CbgWNcus.d.ts +0 -258
  439. package/dist/index-CmfPeQza.d.ts +0 -166
  440. package/dist/index-CmpG-zak.d.ts +0 -607
  441. package/dist/index-CoMKgL-p.d.ts +0 -12
  442. package/dist/index-D8HGwglK.d.ts +0 -541
  443. package/dist/index-DCaVm66D.d.ts +0 -1101
  444. package/dist/index-DE2w7E0d.d.ts +0 -83
  445. package/dist/index-DSOpj8DI.d.ts +0 -17
  446. package/dist/index-DW9q22GH.d.ts +0 -75
  447. package/dist/index-DnjJ9CwI.d.ts +0 -347
  448. package/dist/index-DwMJZ8PP.d.ts +0 -317
  449. package/dist/index-PaojfSdd.d.ts +0 -71
  450. package/dist/index-aHtYvc3i.d.ts +0 -284
  451. package/dist/index-e_18DzAg.d.ts +0 -18
  452. package/dist/index-ffmipXSA.d.ts +0 -55
  453. package/dist/index-joONjwLt.d.ts +0 -33
  454. package/dist/index-kssw5ziY.d.ts +0 -250
  455. package/dist/index-lFffh5-G.d.ts +0 -125
  456. package/dist/index-pxYge_6k.d.ts +0 -79
  457. package/dist/layer-Cv9vSwBx.d.ts +0 -70
  458. package/dist/pino-logger-H4HPW5P6.js +0 -5
  459. package/dist/pino-logger-H4HPW5P6.js.map +0 -1
  460. package/dist/prisma-extension-gYhYriA0.d.ts +0 -174
  461. package/dist/sdk-L75WWUP3.js +0 -156
  462. package/dist/sdk-L75WWUP3.js.map +0 -1
  463. package/dist/shutdown-registry-CW9LryO8.d.ts +0 -10
  464. package/dist/types-Bo2wkjSP.d.ts +0 -35
  465. package/dist/types-DVpvrAhd.d.ts +0 -71
  466. package/dist/types-DgJ4lDYA.d.ts +0 -108
  467. package/dist/types-USOv09qy.d.ts +0 -327
  468. package/dist/workspace-guard-NXVYYBVJ.js +0 -5
  469. package/dist/workspace-guard-NXVYYBVJ.js.map +0 -1
@@ -1,774 +0,0 @@
1
- import { logger } from './chunk-RU266375.js';
2
- import { __export, __name } from './chunk-XE4OXN2W.js';
3
- import { readdir, stat } from 'fs/promises';
4
- import { join, extname, basename, resolve, relative } from 'path';
5
-
6
- // src/i18n/index.ts
7
- var i18n_exports = {};
8
- __export(i18n_exports, {
9
- DEFAULT_I18N_CONFIG: () => DEFAULT_I18N_CONFIG,
10
- I18n: () => I18n,
11
- Locales: () => Locales,
12
- RTL_LANGUAGES: () => RTL_LANGUAGES,
13
- clearTranslationCache: () => clearTranslationCache,
14
- createI18n: () => createI18n,
15
- createTranslator: () => createTranslator,
16
- discoverLocales: () => discoverLocales,
17
- extractLocaleFromRequest: () => extractLocaleFromRequest,
18
- findBestMatch: () => findBestMatch,
19
- flattenDictionary: () => flattenDictionary,
20
- getCachedTranslations: () => getCachedTranslations,
21
- getI18n: () => getI18n,
22
- getLanguage: () => getLanguage,
23
- getLanguageFromLocale: () => getLanguageFromLocale,
24
- getLocale: () => getLocale,
25
- getRegionFromLocale: () => getRegionFromLocale,
26
- getTextDirection: () => getTextDirection,
27
- hasI18n: () => hasI18n,
28
- initializeI18n: () => initializeI18n,
29
- loadTranslationFile: () => loadTranslationFile,
30
- loadTranslationsForLocale: () => loadTranslationsForLocale,
31
- normalizeLocale: () => normalizeLocale,
32
- parseAcceptLanguage: () => parseAcceptLanguage,
33
- parseLocaleString: () => parseLocaleString,
34
- preloadAllTranslations: () => preloadAllTranslations,
35
- setCachedTranslations: () => setCachedTranslations,
36
- t: () => t
37
- });
38
-
39
- // src/i18n/types.ts
40
- var RTL_LANGUAGES = [
41
- "ar",
42
- "he"
43
- ];
44
- function getTextDirection(language) {
45
- return RTL_LANGUAGES.includes(language) ? "rtl" : "ltr";
46
- }
47
- __name(getTextDirection, "getTextDirection");
48
-
49
- // src/i18n/parser.ts
50
- function parseLocaleString(localeStr) {
51
- const trimmed = localeStr.trim();
52
- if (!trimmed || trimmed === "*") {
53
- return null;
54
- }
55
- const [localePart, ...params] = trimmed.split(";");
56
- let quality = 1;
57
- for (const param of params) {
58
- const [key, value] = param.trim().split("=");
59
- if (key?.toLowerCase() === "q" && value) {
60
- const parsed = parseFloat(value);
61
- if (!isNaN(parsed) && parsed >= 0 && parsed <= 1) {
62
- quality = parsed;
63
- }
64
- }
65
- }
66
- const locale = localePart?.trim();
67
- if (!locale) {
68
- return null;
69
- }
70
- const parts = locale.split("-");
71
- const language = parts[0]?.toLowerCase();
72
- const region = parts[1]?.toUpperCase();
73
- const normalizedLocale = region ? `${language}-${region}` : language;
74
- return {
75
- locale: normalizedLocale,
76
- language,
77
- region,
78
- quality
79
- };
80
- }
81
- __name(parseLocaleString, "parseLocaleString");
82
- function parseAcceptLanguage(header) {
83
- if (!header || header.trim() === "") {
84
- return [];
85
- }
86
- const locales = [];
87
- const parts = header.split(",");
88
- for (const part of parts) {
89
- const parsed = parseLocaleString(part);
90
- if (parsed) {
91
- locales.push(parsed);
92
- }
93
- }
94
- locales.sort((a, b) => b.quality - a.quality);
95
- return locales;
96
- }
97
- __name(parseAcceptLanguage, "parseAcceptLanguage");
98
- function extractLocaleFromRequest(request, defaultLocale = "en-US") {
99
- const explicitLocale = request.headers.get("x-locale") || request.headers.get("x-language");
100
- if (explicitLocale) {
101
- const parsed = parseLocaleString(explicitLocale);
102
- if (parsed) {
103
- return parsed;
104
- }
105
- }
106
- const acceptLanguage = request.headers.get("accept-language");
107
- const parsedLocales = parseAcceptLanguage(acceptLanguage);
108
- if (parsedLocales.length > 0) {
109
- return parsedLocales[0];
110
- }
111
- const [language, region] = defaultLocale.split("-");
112
- return {
113
- locale: defaultLocale,
114
- language,
115
- region,
116
- quality: 1
117
- };
118
- }
119
- __name(extractLocaleFromRequest, "extractLocaleFromRequest");
120
- function normalizeLocale(locale) {
121
- const parts = locale.trim().split(/[-_]/);
122
- const language = parts[0]?.toLowerCase();
123
- const region = parts[1]?.toUpperCase();
124
- if (region) {
125
- return `${language}-${region}`;
126
- }
127
- return language;
128
- }
129
- __name(normalizeLocale, "normalizeLocale");
130
- function getLanguageFromLocale(locale) {
131
- return locale.split("-")[0];
132
- }
133
- __name(getLanguageFromLocale, "getLanguageFromLocale");
134
- function getRegionFromLocale(locale) {
135
- const parts = locale.split("-");
136
- return parts[1];
137
- }
138
- __name(getRegionFromLocale, "getRegionFromLocale");
139
- function findBestMatch(requested, available, defaultLocale) {
140
- const availableSet = new Set(available.map((l) => l.toLowerCase()));
141
- for (const req of requested) {
142
- if (availableSet.has(req.locale.toLowerCase())) {
143
- return available.find((l) => l.toLowerCase() === req.locale.toLowerCase()) || req.locale;
144
- }
145
- if (availableSet.has(req.language.toLowerCase())) {
146
- return available.find((l) => l.toLowerCase() === req.language.toLowerCase()) || req.language;
147
- }
148
- const langMatch = available.find((l) => getLanguageFromLocale(l).toLowerCase() === req.language.toLowerCase());
149
- if (langMatch) {
150
- return langMatch;
151
- }
152
- }
153
- return defaultLocale;
154
- }
155
- __name(findBestMatch, "findBestMatch");
156
-
157
- // src/i18n/loader.ts
158
- var translationCache = /* @__PURE__ */ new Map();
159
- function validateFilePath(filePath, baseDir) {
160
- const resolvedBase = resolve(baseDir);
161
- const resolvedPath = resolve(filePath);
162
- const relativePath = relative(resolvedBase, resolvedPath);
163
- if (relativePath.startsWith("..") || resolve(relativePath) === relativePath) {
164
- throw new Error(`Invalid file path: ${filePath} is outside base directory ${baseDir}`);
165
- }
166
- return resolvedPath;
167
- }
168
- __name(validateFilePath, "validateFilePath");
169
- async function safeReadFile(filePath, baseDir) {
170
- const validatedPath = validateFilePath(filePath, baseDir);
171
- return Bun.file(validatedPath).text();
172
- }
173
- __name(safeReadFile, "safeReadFile");
174
- async function safeStat(filePath, baseDir) {
175
- const validatedPath = validateFilePath(filePath, baseDir);
176
- return stat(validatedPath).catch(() => null);
177
- }
178
- __name(safeStat, "safeStat");
179
- async function safeReaddir(dirPath, baseDir) {
180
- const validatedPath = validateFilePath(dirPath, baseDir);
181
- return readdir(validatedPath);
182
- }
183
- __name(safeReaddir, "safeReaddir");
184
- function flattenDictionary(obj, prefix = "") {
185
- const result = {};
186
- for (const [key, value] of Object.entries(obj)) {
187
- const fullKey = prefix ? `${prefix}.${key}` : key;
188
- if (typeof value === "string") {
189
- result[fullKey] = value;
190
- } else if (value !== null && typeof value === "object") {
191
- Object.assign(result, flattenDictionary(value, fullKey));
192
- }
193
- }
194
- return result;
195
- }
196
- __name(flattenDictionary, "flattenDictionary");
197
- async function loadTranslationFile(filePath, baseDir) {
198
- try {
199
- const content = await safeReadFile(filePath, baseDir);
200
- const data = JSON.parse(content);
201
- return data;
202
- } catch (error) {
203
- logger.error(`[I18n] Failed to load translation file: ${filePath}`, error);
204
- return {};
205
- }
206
- }
207
- __name(loadTranslationFile, "loadTranslationFile");
208
- function getCacheKey(namespace, locale) {
209
- return namespace ? `${namespace}:${locale}` : locale;
210
- }
211
- __name(getCacheKey, "getCacheKey");
212
- async function loadTranslationsForLocale(config, locale) {
213
- const cacheKey = getCacheKey(config.namespace, locale);
214
- if (config.enableCache !== false && translationCache.has(cacheKey)) {
215
- return translationCache.get(cacheKey);
216
- }
217
- const normalizedLocale = normalizeLocale(locale);
218
- const language = getLanguageFromLocale(normalizedLocale);
219
- const result = {};
220
- const pathsToTry = [
221
- // Most specific: full locale
222
- join(config.localesPath, `${normalizedLocale}.json`),
223
- // Directory format
224
- join(config.localesPath, normalizedLocale),
225
- // Language only fallback
226
- join(config.localesPath, `${language}.json`),
227
- // Language directory
228
- join(config.localesPath, language)
229
- ];
230
- for (const path of pathsToTry) {
231
- try {
232
- const stats = await safeStat(path, config.localesPath);
233
- if (!stats) continue;
234
- if (stats.isFile() && path.endsWith(".json")) {
235
- const translations = await loadTranslationFile(path, config.localesPath);
236
- const flattened = flattenDictionary(translations);
237
- if (Object.keys(flattened).length === 0) {
238
- logger.debug(`[I18n] Skipped ${path}: no translation keys`);
239
- continue;
240
- }
241
- Object.assign(result, flattened);
242
- logger.debug(`[I18n] Loaded translations from ${path}`);
243
- break;
244
- } else if (stats.isDirectory()) {
245
- const files = await safeReaddir(path, config.localesPath);
246
- const directoryTranslations = {};
247
- for (const file of files) {
248
- if (extname(file) === ".json") {
249
- const namespace = basename(file, ".json");
250
- const filePath = join(path, file);
251
- const translations = await loadTranslationFile(filePath, config.localesPath);
252
- const flattened = flattenDictionary(translations, namespace);
253
- Object.assign(directoryTranslations, flattened);
254
- logger.debug(`[I18n] Loaded namespace ${namespace} from ${filePath}`);
255
- }
256
- }
257
- if (Object.keys(directoryTranslations).length === 0) {
258
- logger.debug(`[I18n] Skipped ${path}: no translation keys`);
259
- continue;
260
- }
261
- Object.assign(result, directoryTranslations);
262
- break;
263
- }
264
- } catch {
265
- }
266
- }
267
- if (Object.keys(result).length === 0 && config.fallbackLocale && config.fallbackLocale !== locale) {
268
- logger.warn(`[I18n] No translations found for ${locale}, trying fallback ${config.fallbackLocale}`);
269
- const fallbackTranslations = await loadTranslationsForLocale({
270
- ...config,
271
- fallbackLocale: void 0
272
- }, config.fallbackLocale);
273
- Object.assign(result, fallbackTranslations);
274
- }
275
- if (config.enableCache !== false) {
276
- translationCache.set(cacheKey, result);
277
- }
278
- return result;
279
- }
280
- __name(loadTranslationsForLocale, "loadTranslationsForLocale");
281
- async function discoverLocales(localesPath) {
282
- const locales = [];
283
- try {
284
- const validatedBasePath = resolve(localesPath);
285
- const entries = await readdir(validatedBasePath);
286
- for (const entry of entries) {
287
- const entryPath = join(validatedBasePath, entry);
288
- const stats = await safeStat(entryPath, validatedBasePath);
289
- if (!stats) continue;
290
- if (stats.isFile() && entry.endsWith(".json")) {
291
- const locale = basename(entry, ".json");
292
- locales.push(normalizeLocale(locale));
293
- } else if (stats.isDirectory()) {
294
- locales.push(normalizeLocale(entry));
295
- }
296
- }
297
- } catch (error) {
298
- logger.error(`[I18n] Failed to discover locales in ${localesPath}`, error);
299
- }
300
- return locales;
301
- }
302
- __name(discoverLocales, "discoverLocales");
303
- async function preloadAllTranslations(config) {
304
- const locales = config.supportedLocales || await discoverLocales(config.localesPath);
305
- logger.info(`[I18n] Preloading translations for ${locales.length} locales...`);
306
- await Promise.all(locales.map(async (locale) => {
307
- try {
308
- await loadTranslationsForLocale(config, locale);
309
- } catch (error) {
310
- logger.error(`[I18n] Failed to preload locale ${locale}`, error);
311
- }
312
- }));
313
- logger.info(`[I18n] Preloaded translations for: ${locales.join(", ")}`);
314
- }
315
- __name(preloadAllTranslations, "preloadAllTranslations");
316
- function clearTranslationCache(namespace) {
317
- if (namespace) {
318
- for (const key of translationCache.keys()) {
319
- if (key.startsWith(`${namespace}:`)) {
320
- translationCache.delete(key);
321
- }
322
- }
323
- } else {
324
- translationCache.clear();
325
- }
326
- }
327
- __name(clearTranslationCache, "clearTranslationCache");
328
- function getCachedTranslations(namespace, locale) {
329
- return translationCache.get(getCacheKey(namespace, locale));
330
- }
331
- __name(getCachedTranslations, "getCachedTranslations");
332
- function setCachedTranslations(namespace, locale, translations) {
333
- translationCache.set(getCacheKey(namespace, locale), translations);
334
- }
335
- __name(setCachedTranslations, "setCachedTranslations");
336
-
337
- // src/i18n/i18n.ts
338
- function getEnglishPluralCategory(absCount) {
339
- if (absCount === 1) return "one";
340
- return "other";
341
- }
342
- __name(getEnglishPluralCategory, "getEnglishPluralCategory");
343
- function getFrenchPluralCategory(absCount) {
344
- if (absCount === 0 || absCount === 1) return "one";
345
- return "other";
346
- }
347
- __name(getFrenchPluralCategory, "getFrenchPluralCategory");
348
- function getSlavicPluralCategory(absCount) {
349
- const mod10 = absCount % 10;
350
- const mod100 = absCount % 100;
351
- if (mod10 === 1 && mod100 !== 11) return "one";
352
- if (mod10 >= 2 && mod10 <= 4 && (mod100 < 12 || mod100 > 14)) return "few";
353
- if (mod10 === 0 || mod10 >= 5 && mod10 <= 9 || mod100 >= 11 && mod100 <= 14) return "many";
354
- return "other";
355
- }
356
- __name(getSlavicPluralCategory, "getSlavicPluralCategory");
357
- function getArabicPluralCategory(absCount) {
358
- if (absCount === 0) return "zero";
359
- if (absCount === 1) return "one";
360
- if (absCount === 2) return "two";
361
- const mod100 = absCount % 100;
362
- if (mod100 >= 3 && mod100 <= 10) return "few";
363
- if (mod100 >= 11 && mod100 <= 99) return "many";
364
- return "other";
365
- }
366
- __name(getArabicPluralCategory, "getArabicPluralCategory");
367
- function getPolishCzechPluralCategory(absCount) {
368
- const mod10 = absCount % 10;
369
- const mod100 = absCount % 100;
370
- if (absCount === 1) return "one";
371
- if (mod10 >= 2 && mod10 <= 4 && (mod100 < 12 || mod100 > 14)) return "few";
372
- return "many";
373
- }
374
- __name(getPolishCzechPluralCategory, "getPolishCzechPluralCategory");
375
- function getRomanianPluralCategory(absCount) {
376
- if (absCount === 1) return "one";
377
- const mod100 = absCount % 100;
378
- if (absCount === 0 || mod100 >= 1 && mod100 <= 19) return "few";
379
- return "other";
380
- }
381
- __name(getRomanianPluralCategory, "getRomanianPluralCategory");
382
- function getHebrewPluralCategory(absCount) {
383
- if (absCount === 1) return "one";
384
- if (absCount === 2) return "two";
385
- return "other";
386
- }
387
- __name(getHebrewPluralCategory, "getHebrewPluralCategory");
388
- function getPluralCategory(language, count) {
389
- const absCount = Math.abs(count);
390
- const englishLanguages = [
391
- "en",
392
- "de",
393
- "es",
394
- "it",
395
- "nl",
396
- "sv",
397
- "da",
398
- "nb",
399
- "fi",
400
- "pt",
401
- "el",
402
- "hu",
403
- "tr",
404
- "id",
405
- "ms",
406
- "th",
407
- "vi",
408
- "ko",
409
- "zh",
410
- "ja"
411
- ];
412
- if (englishLanguages.includes(language)) {
413
- return getEnglishPluralCategory(absCount);
414
- }
415
- if (language === "fr") {
416
- return getFrenchPluralCategory(absCount);
417
- }
418
- if (language === "ru" || language === "uk") {
419
- return getSlavicPluralCategory(absCount);
420
- }
421
- if (language === "ar") {
422
- return getArabicPluralCategory(absCount);
423
- }
424
- if (language === "pl" || language === "cs") {
425
- return getPolishCzechPluralCategory(absCount);
426
- }
427
- if (language === "ro") {
428
- return getRomanianPluralCategory(absCount);
429
- }
430
- if (language === "he") {
431
- return getHebrewPluralCategory(absCount);
432
- }
433
- return getEnglishPluralCategory(absCount);
434
- }
435
- __name(getPluralCategory, "getPluralCategory");
436
- function interpolate(text, variables) {
437
- if (!variables || !text) {
438
- return text;
439
- }
440
- return text.replace(/\{\{\s*(\w+)\s*\}\}/g, (match, key) => {
441
- const value = variables[key.trim()];
442
- if (value !== void 0) {
443
- return String(value);
444
- }
445
- return match;
446
- });
447
- }
448
- __name(interpolate, "interpolate");
449
- var I18n = class {
450
- static {
451
- __name(this, "I18n");
452
- }
453
- config;
454
- currentLocale;
455
- supportedLocales = [];
456
- initialized = false;
457
- constructor(config) {
458
- this.config = {
459
- ...config,
460
- fallbackLocale: config.fallbackLocale || "en-US",
461
- enableCache: config.enableCache !== false,
462
- returnKeyOnMissing: config.returnKeyOnMissing !== false,
463
- logMissing: config.logMissing !== false
464
- };
465
- this.currentLocale = normalizeLocale(config.defaultLocale);
466
- }
467
- /**
468
- * Initialize the i18n instance
469
- * Discovers available locales and optionally preloads translations
470
- */
471
- async initialize() {
472
- if (this.initialized) return;
473
- if (this.config.supportedLocales && this.config.supportedLocales.length > 0) {
474
- this.supportedLocales = this.config.supportedLocales;
475
- } else {
476
- this.supportedLocales = await discoverLocales(this.config.localesPath);
477
- }
478
- if (!this.config.lazyLoad) {
479
- await preloadAllTranslations(this.config);
480
- }
481
- this.initialized = true;
482
- logger.info(`[I18n] Initialized with ${this.supportedLocales.length} locales, default: ${this.currentLocale}`);
483
- }
484
- /**
485
- * Get current locale
486
- */
487
- getLocale() {
488
- return this.currentLocale;
489
- }
490
- /**
491
- * Set current locale
492
- */
493
- setLocale(locale) {
494
- this.currentLocale = normalizeLocale(locale);
495
- }
496
- /**
497
- * Get supported locales
498
- */
499
- getSupportedLocales() {
500
- return [
501
- ...this.supportedLocales
502
- ];
503
- }
504
- /**
505
- * Check if a locale is supported
506
- */
507
- isSupported(locale) {
508
- const normalized = normalizeLocale(locale);
509
- const language = getLanguageFromLocale(normalized);
510
- return this.supportedLocales.some((l) => {
511
- const supportedNorm = normalizeLocale(l);
512
- return supportedNorm === normalized || getLanguageFromLocale(supportedNorm) === language;
513
- });
514
- }
515
- /**
516
- * Load translations for a specific locale
517
- */
518
- async loadLocale(locale) {
519
- await loadTranslationsForLocale(this.config, locale);
520
- }
521
- /**
522
- * Get all translations for a locale
523
- */
524
- getTranslations(locale) {
525
- return getCachedTranslations(this.config.namespace, locale);
526
- }
527
- /**
528
- * Translate a key
529
- */
530
- t = /* @__PURE__ */ __name((key, variables, defaultValue) => {
531
- return this.translate(this.currentLocale, key, variables, defaultValue);
532
- }, "t");
533
- /**
534
- * Translate with pluralization
535
- */
536
- tp = /* @__PURE__ */ __name((key, count, variables) => {
537
- return this.translatePlural(this.currentLocale, key, count, variables);
538
- }, "tp");
539
- /**
540
- * Internal translate method
541
- */
542
- translate(locale, key, variables, defaultValue) {
543
- const translations = getCachedTranslations(this.config.namespace, locale);
544
- let text = translations?.[key];
545
- if (!text && this.config.fallbackLocale && locale !== this.config.fallbackLocale) {
546
- const fallbackTranslations = getCachedTranslations(this.config.namespace, this.config.fallbackLocale);
547
- text = fallbackTranslations?.[key];
548
- }
549
- if (!text) {
550
- const language = getLanguageFromLocale(locale);
551
- if (language !== locale) {
552
- const langTranslations = getCachedTranslations(this.config.namespace, language);
553
- text = langTranslations?.[key];
554
- }
555
- }
556
- if (!text) {
557
- if (this.config.logMissing) {
558
- logger.warn(`[I18n] Missing translation for key: ${key} in locale: ${locale}`);
559
- }
560
- return interpolate(defaultValue ?? (this.config.returnKeyOnMissing ? key : ""), variables);
561
- }
562
- return interpolate(text, variables);
563
- }
564
- /**
565
- * Internal translate with pluralization
566
- */
567
- translatePlural(locale, key, count, variables) {
568
- const language = getLanguageFromLocale(locale);
569
- const category = getPluralCategory(language, count);
570
- const pluralKey = `${key}.${category}`;
571
- let text = this.translate(locale, pluralKey, void 0, "");
572
- if (!text && category !== "other") {
573
- text = this.translate(locale, `${key}.other`, void 0, "");
574
- }
575
- if (!text) {
576
- text = this.translate(locale, key, void 0, key);
577
- }
578
- return interpolate(text, {
579
- ...variables,
580
- count
581
- });
582
- }
583
- /**
584
- * Create an i18n context for a specific locale
585
- */
586
- createContext(locale) {
587
- const normalizedLocale = normalizeLocale(locale);
588
- const language = getLanguageFromLocale(normalizedLocale);
589
- const region = getRegionFromLocale(normalizedLocale);
590
- const t2 = /* @__PURE__ */ __name((key, variables, defaultValue) => {
591
- return this.translate(normalizedLocale, key, variables, defaultValue);
592
- }, "t");
593
- const tp = /* @__PURE__ */ __name((key, count, variables) => {
594
- return this.translatePlural(normalizedLocale, key, count, variables);
595
- }, "tp");
596
- const formatNumber = /* @__PURE__ */ __name((value, options) => {
597
- return new Intl.NumberFormat(normalizedLocale, options).format(value);
598
- }, "formatNumber");
599
- const formatCurrency = /* @__PURE__ */ __name((value, currency) => {
600
- return new Intl.NumberFormat(normalizedLocale, {
601
- style: "currency",
602
- currency
603
- }).format(value);
604
- }, "formatCurrency");
605
- const formatDate = /* @__PURE__ */ __name((date, options) => {
606
- const dateObj = typeof date === "string" ? new Date(date) : date;
607
- return new Intl.DateTimeFormat(normalizedLocale, options).format(dateObj);
608
- }, "formatDate");
609
- const formatRelativeTime = /* @__PURE__ */ __name((value, unit) => {
610
- return new Intl.RelativeTimeFormat(normalizedLocale, {
611
- numeric: "auto"
612
- }).format(value, unit);
613
- }, "formatRelativeTime");
614
- return {
615
- locale: normalizedLocale,
616
- language,
617
- region,
618
- t: t2,
619
- tp,
620
- formatNumber,
621
- formatCurrency,
622
- formatDate,
623
- formatRelativeTime
624
- };
625
- }
626
- /**
627
- * Create context from a request
628
- */
629
- createContextFromRequest(request) {
630
- const parsed = extractLocaleFromRequest(request, this.config.defaultLocale);
631
- const bestMatch = findBestMatch([
632
- parsed
633
- ], this.supportedLocales, this.config.defaultLocale);
634
- return this.createContext(bestMatch);
635
- }
636
- /**
637
- * Get language metadata
638
- */
639
- getLanguageInfo(locale) {
640
- const language = getLanguageFromLocale(locale);
641
- const region = getRegionFromLocale(locale);
642
- const direction = getTextDirection(language);
643
- return {
644
- code: language,
645
- direction,
646
- locale,
647
- region
648
- };
649
- }
650
- };
651
- var globalI18n = null;
652
- async function initializeI18n(config) {
653
- globalI18n = new I18n(config);
654
- await globalI18n.initialize();
655
- return globalI18n;
656
- }
657
- __name(initializeI18n, "initializeI18n");
658
- function getI18n() {
659
- return globalI18n;
660
- }
661
- __name(getI18n, "getI18n");
662
- function createI18n(config) {
663
- return new I18n(config);
664
- }
665
- __name(createI18n, "createI18n");
666
-
667
- // src/i18n/helpers.ts
668
- function interpolateVariables(text, variables) {
669
- if (!variables) return text;
670
- return text.replace(/\{\{(\w+)\}\}/g, (match, key) => {
671
- const value = variables[key];
672
- return value !== void 0 ? String(value) : match;
673
- });
674
- }
675
- __name(interpolateVariables, "interpolateVariables");
676
- function t(ctx, key, defaultMessage, variables) {
677
- if (!ctx.i18n?.t) {
678
- return interpolateVariables(defaultMessage, variables);
679
- }
680
- const translated = ctx.i18n.t(key, variables, defaultMessage);
681
- if (translated === key) {
682
- return interpolateVariables(defaultMessage, variables);
683
- }
684
- return translated;
685
- }
686
- __name(t, "t");
687
- function createTranslator(ctx) {
688
- return (key, defaultMessage, variables) => {
689
- return t(ctx, key, defaultMessage, variables);
690
- };
691
- }
692
- __name(createTranslator, "createTranslator");
693
- function hasI18n(ctx) {
694
- return ctx.i18n?.t !== void 0;
695
- }
696
- __name(hasI18n, "hasI18n");
697
- function getLocale(ctx, defaultLocale = "en-US") {
698
- return ctx.i18n?.locale ?? defaultLocale;
699
- }
700
- __name(getLocale, "getLocale");
701
- function getLanguage(ctx, defaultLanguage = "en") {
702
- return ctx.i18n?.language ?? defaultLanguage;
703
- }
704
- __name(getLanguage, "getLanguage");
705
-
706
- // src/i18n/index.ts
707
- var Locales = {
708
- // English
709
- EN_US: "en-US",
710
- EN_GB: "en-GB",
711
- EN_AU: "en-AU",
712
- EN_CA: "en-CA",
713
- EN_IN: "en-IN",
714
- // Spanish
715
- ES_ES: "es-ES",
716
- ES_MX: "es-MX",
717
- // French
718
- FR_FR: "fr-FR",
719
- FR_CA: "fr-CA",
720
- // German
721
- DE_DE: "de-DE",
722
- DE_AT: "de-AT",
723
- DE_CH: "de-CH",
724
- // Italian
725
- IT_IT: "it-IT",
726
- // Portuguese
727
- PT_PT: "pt-PT",
728
- PT_BR: "pt-BR",
729
- // Russian
730
- RU_RU: "ru-RU",
731
- // Chinese
732
- ZH_CN: "zh-CN",
733
- ZH_TW: "zh-TW",
734
- ZH_HK: "zh-HK",
735
- // Japanese
736
- JA_JP: "ja-JP",
737
- // Korean
738
- KO_KR: "ko-KR",
739
- // Arabic
740
- AR_SA: "ar-SA",
741
- AR_AE: "ar-AE",
742
- // Hindi
743
- HI_IN: "hi-IN",
744
- // Tamil
745
- TA_IN: "ta-IN",
746
- // Dutch
747
- NL_NL: "nl-NL",
748
- // Polish
749
- PL_PL: "pl-PL",
750
- // Turkish
751
- TR_TR: "tr-TR",
752
- // Vietnamese
753
- VI_VN: "vi-VN",
754
- // Thai
755
- TH_TH: "th-TH",
756
- // Indonesian
757
- ID_ID: "id-ID",
758
- // Hebrew
759
- HE_IL: "he-IL",
760
- // Ukrainian
761
- UK_UA: "uk-UA"
762
- };
763
- var DEFAULT_I18N_CONFIG = {
764
- defaultLocale: "en-US",
765
- fallbackLocale: "en-US",
766
- enableCache: true,
767
- lazyLoad: false,
768
- logMissing: true,
769
- returnKeyOnMissing: true
770
- };
771
-
772
- export { DEFAULT_I18N_CONFIG, I18n, Locales, RTL_LANGUAGES, clearTranslationCache, createI18n, createTranslator, discoverLocales, extractLocaleFromRequest, findBestMatch, flattenDictionary, getCachedTranslations, getI18n, getLanguage, getLanguageFromLocale, getLocale, getRegionFromLocale, getTextDirection, hasI18n, i18n_exports, initializeI18n, loadTranslationFile, loadTranslationsForLocale, normalizeLocale, parseAcceptLanguage, parseLocaleString, preloadAllTranslations, setCachedTranslations, t };
773
- //# sourceMappingURL=chunk-EBDHIL7V.js.map
774
- //# sourceMappingURL=chunk-EBDHIL7V.js.map