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