@oxyhq/services 5.13.0 → 5.13.2
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/README.md +71 -0
- package/lib/commonjs/core/HttpClient.js +238 -0
- package/lib/commonjs/core/HttpClient.js.map +1 -0
- package/lib/commonjs/core/OxyServices.js +530 -332
- package/lib/commonjs/core/OxyServices.js.map +1 -1
- package/lib/commonjs/core/RequestManager.js +199 -0
- package/lib/commonjs/core/RequestManager.js.map +1 -0
- package/lib/commonjs/core/index.js +38 -1
- package/lib/commonjs/core/index.js.map +1 -1
- package/lib/commonjs/i18n/index.js +37 -1
- package/lib/commonjs/i18n/index.js.map +1 -1
- package/lib/commonjs/i18n/locales/ar-SA.json +128 -0
- package/lib/commonjs/i18n/locales/ca-ES.json +128 -0
- package/lib/commonjs/i18n/locales/de-DE.json +128 -0
- package/lib/commonjs/i18n/locales/en-US.json +85 -12
- package/lib/commonjs/i18n/locales/es-ES.json +58 -6
- package/lib/commonjs/i18n/locales/fr-FR.json +128 -0
- package/lib/commonjs/i18n/locales/it-IT.json +128 -0
- package/lib/commonjs/i18n/locales/ja-JP.json +127 -0
- package/lib/commonjs/i18n/locales/ko-KR.json +128 -0
- package/lib/commonjs/i18n/locales/pt-PT.json +128 -0
- package/lib/commonjs/i18n/locales/zh-CN.json +128 -0
- package/lib/commonjs/index.js +36 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/ui/components/Avatar.js +94 -27
- package/lib/commonjs/ui/components/Avatar.js.map +1 -1
- package/lib/commonjs/ui/components/FollowButton.js +1 -0
- package/lib/commonjs/ui/components/FollowButton.js.map +1 -1
- package/lib/commonjs/ui/components/FontLoader.js +22 -42
- package/lib/commonjs/ui/components/FontLoader.js.map +1 -1
- package/lib/commonjs/ui/components/OxyProvider.js +5 -8
- package/lib/commonjs/ui/components/OxyProvider.js.map +1 -1
- package/lib/commonjs/ui/components/StepBasedScreen.js +64 -44
- package/lib/commonjs/ui/components/StepBasedScreen.js.map +1 -1
- package/lib/commonjs/ui/components/internal/GroupedPillButtons.js +14 -35
- package/lib/commonjs/ui/components/internal/GroupedPillButtons.js.map +1 -1
- package/lib/commonjs/ui/components/internal/PinInput.js +2 -2
- package/lib/commonjs/ui/components/internal/PinInput.js.map +1 -1
- package/lib/commonjs/ui/components/internal/TextField.js +13 -8
- package/lib/commonjs/ui/components/internal/TextField.js.map +1 -1
- package/lib/commonjs/ui/context/OxyContext.js +443 -371
- package/lib/commonjs/ui/context/OxyContext.js.map +1 -1
- package/lib/commonjs/ui/hooks/useSessionSocket.js +80 -22
- package/lib/commonjs/ui/hooks/useSessionSocket.js.map +1 -1
- package/lib/commonjs/ui/index.js +4 -1
- package/lib/commonjs/ui/index.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountSettingsScreen.js +32 -2
- package/lib/commonjs/ui/screens/AccountSettingsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountSwitcherScreen.js +101 -59
- package/lib/commonjs/ui/screens/AccountSwitcherScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/FileManagementScreen.js +3 -2
- package/lib/commonjs/ui/screens/FileManagementScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/LanguageSelectorScreen.js +75 -117
- package/lib/commonjs/ui/screens/LanguageSelectorScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/SignInScreen.js +43 -50
- package/lib/commonjs/ui/screens/SignInScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/SignUpScreen.js +14 -16
- package/lib/commonjs/ui/screens/SignUpScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/WelcomeNewUserScreen.js +188 -142
- package/lib/commonjs/ui/screens/WelcomeNewUserScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/internal/SignInPasswordStep.js +10 -10
- package/lib/commonjs/ui/screens/internal/SignInPasswordStep.js.map +1 -1
- package/lib/commonjs/ui/screens/internal/SignInUsernameStep.js +2 -4
- package/lib/commonjs/ui/screens/internal/SignInUsernameStep.js.map +1 -1
- package/lib/commonjs/ui/screens/steps/RecoverRequestStep.js +45 -25
- package/lib/commonjs/ui/screens/steps/RecoverRequestStep.js.map +1 -1
- package/lib/commonjs/ui/screens/steps/RecoverResetPasswordStep.js +88 -53
- package/lib/commonjs/ui/screens/steps/RecoverResetPasswordStep.js.map +1 -1
- package/lib/commonjs/ui/screens/steps/RecoverSuccessStep.js +79 -58
- package/lib/commonjs/ui/screens/steps/RecoverSuccessStep.js.map +1 -1
- package/lib/commonjs/ui/screens/steps/RecoverVerifyStep.js +61 -52
- package/lib/commonjs/ui/screens/steps/RecoverVerifyStep.js.map +1 -1
- package/lib/commonjs/ui/screens/steps/SignInPasswordStep.js +218 -39
- package/lib/commonjs/ui/screens/steps/SignInPasswordStep.js.map +1 -1
- package/lib/commonjs/ui/screens/steps/SignInTotpStep.js +77 -50
- package/lib/commonjs/ui/screens/steps/SignInTotpStep.js.map +1 -1
- package/lib/commonjs/ui/screens/steps/SignInUsernameStep.js +424 -71
- package/lib/commonjs/ui/screens/steps/SignInUsernameStep.js.map +1 -1
- package/lib/commonjs/ui/screens/steps/SignUpIdentityStep.js +55 -30
- package/lib/commonjs/ui/screens/steps/SignUpIdentityStep.js.map +1 -1
- package/lib/commonjs/ui/screens/steps/SignUpSecurityStep.js +64 -46
- package/lib/commonjs/ui/screens/steps/SignUpSecurityStep.js.map +1 -1
- package/lib/commonjs/ui/screens/steps/SignUpSummaryStep.js +84 -146
- package/lib/commonjs/ui/screens/steps/SignUpSummaryStep.js.map +1 -1
- package/lib/commonjs/ui/screens/steps/SignUpWelcomeStep.js +113 -34
- package/lib/commonjs/ui/screens/steps/SignUpWelcomeStep.js.map +1 -1
- package/lib/commonjs/ui/stores/accountStore.js +237 -0
- package/lib/commonjs/ui/stores/accountStore.js.map +1 -0
- package/lib/commonjs/ui/stores/authStore.js +17 -20
- package/lib/commonjs/ui/stores/authStore.js.map +1 -1
- package/lib/commonjs/ui/styles/authStyles.js +16 -8
- package/lib/commonjs/ui/styles/authStyles.js.map +1 -1
- package/lib/commonjs/ui/styles/index.js +11 -0
- package/lib/commonjs/ui/styles/index.js.map +1 -1
- package/lib/commonjs/ui/styles/spacing.js +51 -0
- package/lib/commonjs/ui/styles/spacing.js.map +1 -0
- package/lib/commonjs/utils/asyncUtils.js +9 -22
- package/lib/commonjs/utils/asyncUtils.js.map +1 -1
- package/lib/commonjs/utils/cache.js +259 -0
- package/lib/commonjs/utils/cache.js.map +1 -0
- package/lib/commonjs/utils/index.js +99 -0
- package/lib/commonjs/utils/index.js.map +1 -1
- package/lib/commonjs/utils/languageUtils.js +159 -0
- package/lib/commonjs/utils/languageUtils.js.map +1 -0
- package/lib/commonjs/utils/requestUtils.js +217 -0
- package/lib/commonjs/utils/requestUtils.js.map +1 -0
- package/lib/commonjs/utils/sessionUtils.js +191 -0
- package/lib/commonjs/utils/sessionUtils.js.map +1 -0
- package/lib/commonjs/utils/validationUtils.js +1 -1
- package/lib/module/core/HttpClient.js +232 -0
- package/lib/module/core/HttpClient.js.map +1 -0
- package/lib/module/core/OxyServices.js +528 -326
- package/lib/module/core/OxyServices.js.map +1 -1
- package/lib/module/core/RequestManager.js +194 -0
- package/lib/module/core/RequestManager.js.map +1 -0
- package/lib/module/core/index.js +2 -0
- package/lib/module/core/index.js.map +1 -1
- package/lib/module/i18n/index.js +37 -1
- package/lib/module/i18n/index.js.map +1 -1
- package/lib/module/i18n/locales/ar-SA.json +128 -0
- package/lib/module/i18n/locales/ca-ES.json +128 -0
- package/lib/module/i18n/locales/de-DE.json +128 -0
- package/lib/module/i18n/locales/en-US.json +85 -12
- package/lib/module/i18n/locales/es-ES.json +58 -6
- package/lib/module/i18n/locales/fr-FR.json +128 -0
- package/lib/module/i18n/locales/it-IT.json +128 -0
- package/lib/module/i18n/locales/ja-JP.json +127 -0
- package/lib/module/i18n/locales/ko-KR.json +128 -0
- package/lib/module/i18n/locales/pt-PT.json +128 -0
- package/lib/module/i18n/locales/zh-CN.json +128 -0
- package/lib/module/index.js +2 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/ui/components/Avatar.js +94 -27
- package/lib/module/ui/components/Avatar.js.map +1 -1
- package/lib/module/ui/components/FollowButton.js +1 -0
- package/lib/module/ui/components/FollowButton.js.map +1 -1
- package/lib/module/ui/components/FontLoader.js +23 -43
- package/lib/module/ui/components/FontLoader.js.map +1 -1
- package/lib/module/ui/components/OxyProvider.js +6 -8
- package/lib/module/ui/components/OxyProvider.js.map +1 -1
- package/lib/module/ui/components/StepBasedScreen.js +65 -45
- package/lib/module/ui/components/StepBasedScreen.js.map +1 -1
- package/lib/module/ui/components/internal/GroupedPillButtons.js +14 -35
- package/lib/module/ui/components/internal/GroupedPillButtons.js.map +1 -1
- package/lib/module/ui/components/internal/PinInput.js +2 -2
- package/lib/module/ui/components/internal/PinInput.js.map +1 -1
- package/lib/module/ui/components/internal/TextField.js +13 -8
- package/lib/module/ui/components/internal/TextField.js.map +1 -1
- package/lib/module/ui/context/OxyContext.js +442 -370
- package/lib/module/ui/context/OxyContext.js.map +1 -1
- package/lib/module/ui/hooks/useSessionSocket.js +80 -22
- package/lib/module/ui/hooks/useSessionSocket.js.map +1 -1
- package/lib/module/ui/index.js +4 -2
- package/lib/module/ui/index.js.map +1 -1
- package/lib/module/ui/screens/AccountSettingsScreen.js +33 -2
- package/lib/module/ui/screens/AccountSettingsScreen.js.map +1 -1
- package/lib/module/ui/screens/AccountSwitcherScreen.js +102 -60
- package/lib/module/ui/screens/AccountSwitcherScreen.js.map +1 -1
- package/lib/module/ui/screens/FileManagementScreen.js +3 -2
- package/lib/module/ui/screens/FileManagementScreen.js.map +1 -1
- package/lib/module/ui/screens/LanguageSelectorScreen.js +73 -117
- package/lib/module/ui/screens/LanguageSelectorScreen.js.map +1 -1
- package/lib/module/ui/screens/SignInScreen.js +44 -51
- package/lib/module/ui/screens/SignInScreen.js.map +1 -1
- package/lib/module/ui/screens/SignUpScreen.js +14 -16
- package/lib/module/ui/screens/SignUpScreen.js.map +1 -1
- package/lib/module/ui/screens/WelcomeNewUserScreen.js +187 -143
- package/lib/module/ui/screens/WelcomeNewUserScreen.js.map +1 -1
- package/lib/module/ui/screens/internal/SignInPasswordStep.js +10 -10
- package/lib/module/ui/screens/internal/SignInPasswordStep.js.map +1 -1
- package/lib/module/ui/screens/internal/SignInUsernameStep.js +2 -4
- package/lib/module/ui/screens/internal/SignInUsernameStep.js.map +1 -1
- package/lib/module/ui/screens/steps/RecoverRequestStep.js +45 -25
- package/lib/module/ui/screens/steps/RecoverRequestStep.js.map +1 -1
- package/lib/module/ui/screens/steps/RecoverResetPasswordStep.js +89 -54
- package/lib/module/ui/screens/steps/RecoverResetPasswordStep.js.map +1 -1
- package/lib/module/ui/screens/steps/RecoverSuccessStep.js +80 -59
- package/lib/module/ui/screens/steps/RecoverSuccessStep.js.map +1 -1
- package/lib/module/ui/screens/steps/RecoverVerifyStep.js +62 -53
- package/lib/module/ui/screens/steps/RecoverVerifyStep.js.map +1 -1
- package/lib/module/ui/screens/steps/SignInPasswordStep.js +219 -40
- package/lib/module/ui/screens/steps/SignInPasswordStep.js.map +1 -1
- package/lib/module/ui/screens/steps/SignInTotpStep.js +78 -51
- package/lib/module/ui/screens/steps/SignInTotpStep.js.map +1 -1
- package/lib/module/ui/screens/steps/SignInUsernameStep.js +426 -73
- package/lib/module/ui/screens/steps/SignInUsernameStep.js.map +1 -1
- package/lib/module/ui/screens/steps/SignUpIdentityStep.js +55 -30
- package/lib/module/ui/screens/steps/SignUpIdentityStep.js.map +1 -1
- package/lib/module/ui/screens/steps/SignUpSecurityStep.js +65 -47
- package/lib/module/ui/screens/steps/SignUpSecurityStep.js.map +1 -1
- package/lib/module/ui/screens/steps/SignUpSummaryStep.js +84 -146
- package/lib/module/ui/screens/steps/SignUpSummaryStep.js.map +1 -1
- package/lib/module/ui/screens/steps/SignUpWelcomeStep.js +114 -35
- package/lib/module/ui/screens/steps/SignUpWelcomeStep.js.map +1 -1
- package/lib/module/ui/stores/accountStore.js +229 -0
- package/lib/module/ui/stores/accountStore.js.map +1 -0
- package/lib/module/ui/stores/authStore.js +17 -20
- package/lib/module/ui/stores/authStore.js.map +1 -1
- package/lib/module/ui/styles/authStyles.js +16 -8
- package/lib/module/ui/styles/authStyles.js.map +1 -1
- package/lib/module/ui/styles/index.js +1 -0
- package/lib/module/ui/styles/index.js.map +1 -1
- package/lib/module/ui/styles/spacing.js +48 -0
- package/lib/module/ui/styles/spacing.js.map +1 -0
- package/lib/module/utils/asyncUtils.js +10 -22
- package/lib/module/utils/asyncUtils.js.map +1 -1
- package/lib/module/utils/cache.js +250 -0
- package/lib/module/utils/cache.js.map +1 -0
- package/lib/module/utils/index.js +7 -0
- package/lib/module/utils/index.js.map +1 -1
- package/lib/module/utils/languageUtils.js +151 -0
- package/lib/module/utils/languageUtils.js.map +1 -0
- package/lib/module/utils/requestUtils.js +210 -0
- package/lib/module/utils/requestUtils.js.map +1 -0
- package/lib/module/utils/sessionUtils.js +180 -0
- package/lib/module/utils/sessionUtils.js.map +1 -0
- package/lib/module/utils/validationUtils.js +1 -1
- package/lib/typescript/core/HttpClient.d.ts +64 -0
- package/lib/typescript/core/HttpClient.d.ts.map +1 -0
- package/lib/typescript/core/OxyServices.d.ts +86 -73
- package/lib/typescript/core/OxyServices.d.ts.map +1 -1
- package/lib/typescript/core/RequestManager.d.ts +67 -0
- package/lib/typescript/core/RequestManager.d.ts.map +1 -0
- package/lib/typescript/core/index.d.ts +2 -0
- package/lib/typescript/core/index.d.ts.map +1 -1
- package/lib/typescript/i18n/index.d.ts.map +1 -1
- package/lib/typescript/index.d.ts +2 -0
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/models/interfaces.d.ts +15 -0
- package/lib/typescript/models/interfaces.d.ts.map +1 -1
- package/lib/typescript/models/session.d.ts +1 -0
- package/lib/typescript/models/session.d.ts.map +1 -1
- package/lib/typescript/ui/components/Avatar.d.ts +6 -7
- package/lib/typescript/ui/components/Avatar.d.ts.map +1 -1
- package/lib/typescript/ui/components/FollowButton.d.ts.map +1 -1
- package/lib/typescript/ui/components/FontLoader.d.ts +3 -3
- package/lib/typescript/ui/components/FontLoader.d.ts.map +1 -1
- package/lib/typescript/ui/components/OxyProvider.d.ts +2 -2
- package/lib/typescript/ui/components/OxyProvider.d.ts.map +1 -1
- package/lib/typescript/ui/components/StepBasedScreen.d.ts.map +1 -1
- package/lib/typescript/ui/components/internal/GroupedPillButtons.d.ts.map +1 -1
- package/lib/typescript/ui/components/internal/TextField.d.ts.map +1 -1
- package/lib/typescript/ui/context/OxyContext.d.ts +5 -0
- package/lib/typescript/ui/context/OxyContext.d.ts.map +1 -1
- package/lib/typescript/ui/hooks/useSessionSocket.d.ts.map +1 -1
- package/lib/typescript/ui/index.d.ts +2 -2
- package/lib/typescript/ui/index.d.ts.map +1 -1
- package/lib/typescript/ui/screens/AccountSettingsScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/AccountSwitcherScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/LanguageSelectorScreen.d.ts +3 -3
- package/lib/typescript/ui/screens/LanguageSelectorScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/SignInScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/SignUpScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/WelcomeNewUserScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/internal/SignInPasswordStep.d.ts.map +1 -1
- package/lib/typescript/ui/screens/steps/RecoverRequestStep.d.ts.map +1 -1
- package/lib/typescript/ui/screens/steps/RecoverResetPasswordStep.d.ts.map +1 -1
- package/lib/typescript/ui/screens/steps/RecoverSuccessStep.d.ts.map +1 -1
- package/lib/typescript/ui/screens/steps/RecoverVerifyStep.d.ts.map +1 -1
- package/lib/typescript/ui/screens/steps/SignInPasswordStep.d.ts +2 -0
- package/lib/typescript/ui/screens/steps/SignInPasswordStep.d.ts.map +1 -1
- package/lib/typescript/ui/screens/steps/SignInTotpStep.d.ts.map +1 -1
- package/lib/typescript/ui/screens/steps/SignInUsernameStep.d.ts.map +1 -1
- package/lib/typescript/ui/screens/steps/SignUpIdentityStep.d.ts.map +1 -1
- package/lib/typescript/ui/screens/steps/SignUpSecurityStep.d.ts.map +1 -1
- package/lib/typescript/ui/screens/steps/SignUpSummaryStep.d.ts.map +1 -1
- package/lib/typescript/ui/screens/steps/SignUpWelcomeStep.d.ts.map +1 -1
- package/lib/typescript/ui/stores/accountStore.d.ts +34 -0
- package/lib/typescript/ui/stores/accountStore.d.ts.map +1 -0
- package/lib/typescript/ui/stores/authStore.d.ts +7 -3
- package/lib/typescript/ui/stores/authStore.d.ts.map +1 -1
- package/lib/typescript/ui/styles/authStyles.d.ts +19 -2
- package/lib/typescript/ui/styles/authStyles.d.ts.map +1 -1
- package/lib/typescript/ui/styles/index.d.ts +1 -0
- package/lib/typescript/ui/styles/index.d.ts.map +1 -1
- package/lib/typescript/ui/styles/spacing.d.ts +43 -0
- package/lib/typescript/ui/styles/spacing.d.ts.map +1 -0
- package/lib/typescript/utils/asyncUtils.d.ts +2 -0
- package/lib/typescript/utils/asyncUtils.d.ts.map +1 -1
- package/lib/typescript/utils/cache.d.ts +128 -0
- package/lib/typescript/utils/cache.d.ts.map +1 -0
- package/lib/typescript/utils/index.d.ts +4 -0
- package/lib/typescript/utils/index.d.ts.map +1 -1
- package/lib/typescript/utils/languageUtils.d.ts +38 -0
- package/lib/typescript/utils/languageUtils.d.ts.map +1 -0
- package/lib/typescript/utils/requestUtils.d.ts +122 -0
- package/lib/typescript/utils/requestUtils.d.ts.map +1 -0
- package/lib/typescript/utils/sessionUtils.d.ts +55 -0
- package/lib/typescript/utils/sessionUtils.d.ts.map +1 -0
- package/lib/typescript/utils/validationUtils.d.ts +1 -1
- package/package.json +1 -1
- package/src/core/HttpClient.ts +277 -0
- package/src/core/OxyServices.ts +461 -352
- package/src/core/RequestManager.ts +240 -0
- package/src/core/index.ts +10 -0
- package/src/i18n/index.ts +36 -0
- package/src/i18n/locales/ar-SA.json +128 -0
- package/src/i18n/locales/ca-ES.json +128 -0
- package/src/i18n/locales/de-DE.json +128 -0
- package/src/i18n/locales/en-US.json +85 -12
- package/src/i18n/locales/es-ES.json +58 -6
- package/src/i18n/locales/fr-FR.json +128 -0
- package/src/i18n/locales/it-IT.json +128 -0
- package/src/i18n/locales/ja-JP.json +127 -0
- package/src/i18n/locales/ko-KR.json +128 -0
- package/src/i18n/locales/pt-PT.json +128 -0
- package/src/i18n/locales/zh-CN.json +128 -0
- package/src/index.ts +10 -0
- package/src/models/interfaces.ts +19 -0
- package/src/models/session.ts +1 -1
- package/src/ui/components/Avatar.tsx +151 -35
- package/src/ui/components/FollowButton.tsx +1 -0
- package/src/ui/components/FontLoader.tsx +17 -37
- package/src/ui/components/OxyProvider.tsx +14 -13
- package/src/ui/components/StepBasedScreen.tsx +66 -43
- package/src/ui/components/internal/GroupedPillButtons.tsx +15 -31
- package/src/ui/components/internal/PinInput.tsx +2 -2
- package/src/ui/components/internal/TextField.tsx +7 -6
- package/src/ui/context/OxyContext.tsx +441 -326
- package/src/ui/hooks/useSessionSocket.ts +72 -18
- package/src/ui/index.ts +4 -1
- package/src/ui/screens/AccountSettingsScreen.tsx +34 -2
- package/src/ui/screens/AccountSwitcherScreen.tsx +102 -68
- package/src/ui/screens/FileManagementScreen.tsx +16 -16
- package/src/ui/screens/LanguageSelectorScreen.tsx +86 -143
- package/src/ui/screens/SignInScreen.tsx +59 -43
- package/src/ui/screens/SignUpScreen.tsx +14 -15
- package/src/ui/screens/WelcomeNewUserScreen.tsx +153 -105
- package/src/ui/screens/internal/SignInPasswordStep.tsx +4 -6
- package/src/ui/screens/internal/SignInUsernameStep.tsx +1 -1
- package/src/ui/screens/steps/RecoverRequestStep.tsx +34 -24
- package/src/ui/screens/steps/RecoverResetPasswordStep.tsx +65 -36
- package/src/ui/screens/steps/RecoverSuccessStep.tsx +71 -47
- package/src/ui/screens/steps/RecoverVerifyStep.tsx +60 -50
- package/src/ui/screens/steps/SignInPasswordStep.tsx +190 -32
- package/src/ui/screens/steps/SignInTotpStep.tsx +68 -34
- package/src/ui/screens/steps/SignInUsernameStep.tsx +446 -63
- package/src/ui/screens/steps/SignUpIdentityStep.tsx +49 -35
- package/src/ui/screens/steps/SignUpSecurityStep.tsx +56 -39
- package/src/ui/screens/steps/SignUpSummaryStep.tsx +99 -89
- package/src/ui/screens/steps/SignUpWelcomeStep.tsx +88 -20
- package/src/ui/stores/accountStore.ts +285 -0
- package/src/ui/stores/authStore.ts +16 -19
- package/src/ui/styles/authStyles.ts +16 -8
- package/src/ui/styles/index.ts +1 -0
- package/src/ui/styles/spacing.ts +46 -0
- package/src/utils/asyncUtils.ts +10 -24
- package/src/utils/cache.ts +264 -0
- package/src/utils/index.ts +19 -0
- package/src/utils/languageUtils.ts +174 -0
- package/src/utils/requestUtils.ts +234 -0
- package/src/utils/sessionUtils.ts +206 -0
- package/src/utils/validationUtils.ts +1 -1
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.TTLCache = void 0;
|
|
7
|
+
exports.createCache = createCache;
|
|
8
|
+
exports.registerCacheForCleanup = registerCacheForCleanup;
|
|
9
|
+
exports.stopAllCacheCleanup = stopAllCacheCleanup;
|
|
10
|
+
exports.unregisterCacheFromCleanup = unregisterCacheFromCleanup;
|
|
11
|
+
/**
|
|
12
|
+
* Centralized cache utility with TTL support
|
|
13
|
+
*
|
|
14
|
+
* This is a production-ready cache implementation used across the codebase
|
|
15
|
+
* for consistent caching behavior and performance optimization.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Cache entry with expiration tracking
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Cache statistics
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* TTL-based cache implementation
|
|
28
|
+
*
|
|
29
|
+
* Features:
|
|
30
|
+
* - Automatic expiration based on TTL
|
|
31
|
+
* - Manual cleanup of expired entries
|
|
32
|
+
* - Statistics tracking (hits, misses, hit rate)
|
|
33
|
+
* - Type-safe generic interface
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* ```typescript
|
|
37
|
+
* const cache = new TTLCache<string>(5 * 60 * 1000); // 5 minutes
|
|
38
|
+
*
|
|
39
|
+
* // Set with default TTL
|
|
40
|
+
* cache.set('key', 'value');
|
|
41
|
+
*
|
|
42
|
+
* // Set with custom TTL
|
|
43
|
+
* cache.set('key', 'value', 10 * 60 * 1000); // 10 minutes
|
|
44
|
+
*
|
|
45
|
+
* // Get value
|
|
46
|
+
* const value = cache.get('key');
|
|
47
|
+
*
|
|
48
|
+
* // Get statistics
|
|
49
|
+
* const stats = cache.getStats();
|
|
50
|
+
* ```
|
|
51
|
+
*/
|
|
52
|
+
class TTLCache {
|
|
53
|
+
cache = new Map();
|
|
54
|
+
hits = 0;
|
|
55
|
+
misses = 0;
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Create a new TTL cache
|
|
59
|
+
* @param defaultTTL Default TTL in milliseconds (default: 5 minutes)
|
|
60
|
+
*/
|
|
61
|
+
constructor(defaultTTL = 5 * 60 * 1000) {
|
|
62
|
+
this.defaultTTL = defaultTTL;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Get a value from cache
|
|
67
|
+
* @param key Cache key
|
|
68
|
+
* @returns Cached value or null if not found or expired
|
|
69
|
+
*/
|
|
70
|
+
get(key) {
|
|
71
|
+
const entry = this.cache.get(key);
|
|
72
|
+
if (!entry) {
|
|
73
|
+
this.misses++;
|
|
74
|
+
return null;
|
|
75
|
+
}
|
|
76
|
+
const now = Date.now();
|
|
77
|
+
if (now > entry.expiresAt) {
|
|
78
|
+
this.cache.delete(key);
|
|
79
|
+
this.misses++;
|
|
80
|
+
return null;
|
|
81
|
+
}
|
|
82
|
+
this.hits++;
|
|
83
|
+
return entry.data;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Set a value in cache
|
|
88
|
+
* @param key Cache key
|
|
89
|
+
* @param data Data to cache
|
|
90
|
+
* @param ttl Optional TTL override (uses default if not provided)
|
|
91
|
+
*/
|
|
92
|
+
set(key, data, ttl) {
|
|
93
|
+
const now = Date.now();
|
|
94
|
+
const expiresAt = now + (ttl || this.defaultTTL);
|
|
95
|
+
this.cache.set(key, {
|
|
96
|
+
data,
|
|
97
|
+
timestamp: now,
|
|
98
|
+
expiresAt
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Delete a specific cache entry
|
|
104
|
+
* @param key Cache key
|
|
105
|
+
* @returns true if entry was deleted, false if not found
|
|
106
|
+
*/
|
|
107
|
+
delete(key) {
|
|
108
|
+
return this.cache.delete(key);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Clear all cache entries
|
|
113
|
+
*/
|
|
114
|
+
clear() {
|
|
115
|
+
this.cache.clear();
|
|
116
|
+
this.hits = 0;
|
|
117
|
+
this.misses = 0;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* Check if a key exists and is not expired
|
|
122
|
+
* @param key Cache key
|
|
123
|
+
* @returns true if key exists and is valid
|
|
124
|
+
*/
|
|
125
|
+
has(key) {
|
|
126
|
+
const entry = this.cache.get(key);
|
|
127
|
+
if (!entry) return false;
|
|
128
|
+
if (Date.now() > entry.expiresAt) {
|
|
129
|
+
this.cache.delete(key);
|
|
130
|
+
return false;
|
|
131
|
+
}
|
|
132
|
+
return true;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* Get all valid cache keys
|
|
137
|
+
* @returns Array of valid cache keys
|
|
138
|
+
*/
|
|
139
|
+
keys() {
|
|
140
|
+
const now = Date.now();
|
|
141
|
+
const validKeys = [];
|
|
142
|
+
for (const [key, entry] of this.cache.entries()) {
|
|
143
|
+
if (now <= entry.expiresAt) {
|
|
144
|
+
validKeys.push(key);
|
|
145
|
+
} else {
|
|
146
|
+
this.cache.delete(key);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
return validKeys;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* Clean up expired entries
|
|
154
|
+
* @returns Number of entries removed
|
|
155
|
+
*/
|
|
156
|
+
cleanup() {
|
|
157
|
+
const now = Date.now();
|
|
158
|
+
let removed = 0;
|
|
159
|
+
for (const [key, entry] of this.cache.entries()) {
|
|
160
|
+
if (now > entry.expiresAt) {
|
|
161
|
+
this.cache.delete(key);
|
|
162
|
+
removed++;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
return removed;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* Get cache size (number of entries)
|
|
170
|
+
*/
|
|
171
|
+
size() {
|
|
172
|
+
return this.cache.size;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* Get cache statistics
|
|
177
|
+
*/
|
|
178
|
+
getStats() {
|
|
179
|
+
const total = this.hits + this.misses;
|
|
180
|
+
return {
|
|
181
|
+
size: this.cache.size,
|
|
182
|
+
hits: this.hits,
|
|
183
|
+
misses: this.misses,
|
|
184
|
+
hitRate: total > 0 ? this.hits / total : 0
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* Reset statistics (keeps cache entries)
|
|
190
|
+
*/
|
|
191
|
+
resetStats() {
|
|
192
|
+
this.hits = 0;
|
|
193
|
+
this.misses = 0;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
* Create a TTL cache instance (convenience function)
|
|
199
|
+
*
|
|
200
|
+
* @example
|
|
201
|
+
* ```typescript
|
|
202
|
+
* const cache = createCache<string>(5 * 60 * 1000);
|
|
203
|
+
* ```
|
|
204
|
+
*/
|
|
205
|
+
exports.TTLCache = TTLCache;
|
|
206
|
+
function createCache(ttl = 5 * 60 * 1000) {
|
|
207
|
+
return new TTLCache(ttl);
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
/**
|
|
211
|
+
* Global cache cleanup interval (runs every minute)
|
|
212
|
+
* This helps prevent memory leaks from expired cache entries
|
|
213
|
+
*/
|
|
214
|
+
let cleanupInterval = null;
|
|
215
|
+
const activeCaches = new Set();
|
|
216
|
+
|
|
217
|
+
/**
|
|
218
|
+
* Register a cache for automatic cleanup
|
|
219
|
+
* @param cache Cache instance to register
|
|
220
|
+
*/
|
|
221
|
+
function registerCacheForCleanup(cache) {
|
|
222
|
+
activeCaches.add(cache);
|
|
223
|
+
|
|
224
|
+
// Start cleanup interval if not already running
|
|
225
|
+
if (!cleanupInterval) {
|
|
226
|
+
cleanupInterval = setInterval(() => {
|
|
227
|
+
for (const cache of activeCaches) {
|
|
228
|
+
cache.cleanup();
|
|
229
|
+
}
|
|
230
|
+
}, 60000); // Every minute
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
/**
|
|
235
|
+
* Unregister a cache from automatic cleanup
|
|
236
|
+
* @param cache Cache instance to unregister
|
|
237
|
+
*/
|
|
238
|
+
function unregisterCacheFromCleanup(cache) {
|
|
239
|
+
activeCaches.delete(cache);
|
|
240
|
+
|
|
241
|
+
// Stop cleanup interval if no caches are registered
|
|
242
|
+
if (activeCaches.size === 0 && cleanupInterval) {
|
|
243
|
+
clearInterval(cleanupInterval);
|
|
244
|
+
cleanupInterval = null;
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
/**
|
|
249
|
+
* Stop all cache cleanup intervals
|
|
250
|
+
* Useful for tests to prevent Jest from hanging
|
|
251
|
+
*/
|
|
252
|
+
function stopAllCacheCleanup() {
|
|
253
|
+
if (cleanupInterval) {
|
|
254
|
+
clearInterval(cleanupInterval);
|
|
255
|
+
cleanupInterval = null;
|
|
256
|
+
}
|
|
257
|
+
activeCaches.clear();
|
|
258
|
+
}
|
|
259
|
+
//# sourceMappingURL=cache.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["TTLCache","cache","Map","hits","misses","constructor","defaultTTL","get","key","entry","now","Date","expiresAt","delete","data","set","ttl","timestamp","clear","has","keys","validKeys","entries","push","cleanup","removed","size","getStats","total","hitRate","resetStats","exports","createCache","cleanupInterval","activeCaches","Set","registerCacheForCleanup","add","setInterval","unregisterCacheFromCleanup","clearInterval","stopAllCacheCleanup"],"sourceRoot":"../../../src","sources":["utils/cache.ts"],"mappings":";;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAOA;AACA;AACA;;AAQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMA,QAAQ,CAAI;EACfC,KAAK,GAAG,IAAIC,GAAG,CAAwB,CAAC;EAExCC,IAAI,GAAG,CAAC;EACRC,MAAM,GAAG,CAAC;;EAElB;AACF;AACA;AACA;EACEC,WAAWA,CAACC,UAAkB,GAAG,CAAC,GAAG,EAAE,GAAG,IAAI,EAAE;IAC9C,IAAI,CAACA,UAAU,GAAGA,UAAU;EAC9B;;EAEA;AACF;AACA;AACA;AACA;EACEC,GAAGA,CAACC,GAAW,EAAY;IACzB,MAAMC,KAAK,GAAG,IAAI,CAACR,KAAK,CAACM,GAAG,CAACC,GAAG,CAAC;IACjC,IAAI,CAACC,KAAK,EAAE;MACV,IAAI,CAACL,MAAM,EAAE;MACb,OAAO,IAAI;IACb;IAEA,MAAMM,GAAG,GAAGC,IAAI,CAACD,GAAG,CAAC,CAAC;IACtB,IAAIA,GAAG,GAAGD,KAAK,CAACG,SAAS,EAAE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9,5 +9,104 @@ Object.defineProperty(exports, "DeviceManager", {
|
|
|
9
9
|
return _deviceManager.DeviceManager;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
|
+
Object.defineProperty(exports, "RequestDeduplicator", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _requestUtils.RequestDeduplicator;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(exports, "RequestQueue", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function () {
|
|
21
|
+
return _requestUtils.RequestQueue;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
Object.defineProperty(exports, "SimpleLogger", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function () {
|
|
27
|
+
return _requestUtils.SimpleLogger;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
Object.defineProperty(exports, "TTLCache", {
|
|
31
|
+
enumerable: true,
|
|
32
|
+
get: function () {
|
|
33
|
+
return _cache.TTLCache;
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
Object.defineProperty(exports, "createCache", {
|
|
37
|
+
enumerable: true,
|
|
38
|
+
get: function () {
|
|
39
|
+
return _cache.createCache;
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
Object.defineProperty(exports, "deduplicateSessions", {
|
|
43
|
+
enumerable: true,
|
|
44
|
+
get: function () {
|
|
45
|
+
return _sessionUtils.deduplicateSessions;
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
Object.defineProperty(exports, "deduplicateSessionsByUserId", {
|
|
49
|
+
enumerable: true,
|
|
50
|
+
get: function () {
|
|
51
|
+
return _sessionUtils.deduplicateSessionsByUserId;
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
Object.defineProperty(exports, "mergeSessions", {
|
|
55
|
+
enumerable: true,
|
|
56
|
+
get: function () {
|
|
57
|
+
return _sessionUtils.mergeSessions;
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
Object.defineProperty(exports, "normalizeAndSortSessions", {
|
|
61
|
+
enumerable: true,
|
|
62
|
+
get: function () {
|
|
63
|
+
return _sessionUtils.normalizeAndSortSessions;
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
Object.defineProperty(exports, "normalizeSession", {
|
|
67
|
+
enumerable: true,
|
|
68
|
+
get: function () {
|
|
69
|
+
return _sessionUtils.normalizeSession;
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
Object.defineProperty(exports, "registerCacheForCleanup", {
|
|
73
|
+
enumerable: true,
|
|
74
|
+
get: function () {
|
|
75
|
+
return _cache.registerCacheForCleanup;
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
Object.defineProperty(exports, "sessionsArraysEqual", {
|
|
79
|
+
enumerable: true,
|
|
80
|
+
get: function () {
|
|
81
|
+
return _sessionUtils.sessionsArraysEqual;
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
Object.defineProperty(exports, "sessionsEqual", {
|
|
85
|
+
enumerable: true,
|
|
86
|
+
get: function () {
|
|
87
|
+
return _sessionUtils.sessionsEqual;
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
Object.defineProperty(exports, "sortSessions", {
|
|
91
|
+
enumerable: true,
|
|
92
|
+
get: function () {
|
|
93
|
+
return _sessionUtils.sortSessions;
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
Object.defineProperty(exports, "stopAllCacheCleanup", {
|
|
97
|
+
enumerable: true,
|
|
98
|
+
get: function () {
|
|
99
|
+
return _cache.stopAllCacheCleanup;
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
Object.defineProperty(exports, "unregisterCacheFromCleanup", {
|
|
103
|
+
enumerable: true,
|
|
104
|
+
get: function () {
|
|
105
|
+
return _cache.unregisterCacheFromCleanup;
|
|
106
|
+
}
|
|
107
|
+
});
|
|
12
108
|
var _deviceManager = require("./deviceManager");
|
|
109
|
+
var _requestUtils = require("./requestUtils");
|
|
110
|
+
var _cache = require("./cache");
|
|
111
|
+
var _sessionUtils = require("./sessionUtils");
|
|
13
112
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_deviceManager","require"],"sourceRoot":"../../../src","sources":["utils/index.ts"],"mappings":"
|
|
1
|
+
{"version":3,"names":["_deviceManager","require","_requestUtils","_cache","_sessionUtils"],"sourceRoot":"../../../src","sources":["utils/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,cAAA,GAAAC,OAAA;AAIA,IAAAC,aAAA,GAAAD,OAAA;AAGA,IAAAE,MAAA,GAAAF,OAAA;AAIA,IAAAG,aAAA,GAAAH,OAAA","ignoreList":[]}
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.SUPPORTED_LANGUAGES = void 0;
|
|
7
|
+
exports.getLanguageMetadata = getLanguageMetadata;
|
|
8
|
+
exports.getLanguageName = getLanguageName;
|
|
9
|
+
exports.getNativeLanguageName = getNativeLanguageName;
|
|
10
|
+
exports.normalizeLanguageCode = normalizeLanguageCode;
|
|
11
|
+
/**
|
|
12
|
+
* Language utilities for OxyServices
|
|
13
|
+
* Provides access to supported languages and language metadata
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
// Supported languages with their metadata
|
|
17
|
+
const SUPPORTED_LANGUAGES = exports.SUPPORTED_LANGUAGES = [{
|
|
18
|
+
id: 'en-US',
|
|
19
|
+
name: 'English',
|
|
20
|
+
nativeName: 'English',
|
|
21
|
+
flag: '🇺🇸',
|
|
22
|
+
icon: 'language-outline',
|
|
23
|
+
color: '#007AFF'
|
|
24
|
+
}, {
|
|
25
|
+
id: 'es-ES',
|
|
26
|
+
name: 'Spanish',
|
|
27
|
+
nativeName: 'Español',
|
|
28
|
+
flag: '🇪🇸',
|
|
29
|
+
icon: 'language-outline',
|
|
30
|
+
color: '#FF3B30'
|
|
31
|
+
}, {
|
|
32
|
+
id: 'ca-ES',
|
|
33
|
+
name: 'Catalan',
|
|
34
|
+
nativeName: 'Català',
|
|
35
|
+
flag: '🇪🇸',
|
|
36
|
+
icon: 'language-outline',
|
|
37
|
+
color: '#0CA678'
|
|
38
|
+
}, {
|
|
39
|
+
id: 'fr-FR',
|
|
40
|
+
name: 'French',
|
|
41
|
+
nativeName: 'Français',
|
|
42
|
+
flag: '🇫🇷',
|
|
43
|
+
icon: 'language-outline',
|
|
44
|
+
color: '#5856D6'
|
|
45
|
+
}, {
|
|
46
|
+
id: 'de-DE',
|
|
47
|
+
name: 'German',
|
|
48
|
+
nativeName: 'Deutsch',
|
|
49
|
+
flag: '🇩🇪',
|
|
50
|
+
icon: 'language-outline',
|
|
51
|
+
color: '#FF9500'
|
|
52
|
+
}, {
|
|
53
|
+
id: 'it-IT',
|
|
54
|
+
name: 'Italian',
|
|
55
|
+
nativeName: 'Italiano',
|
|
56
|
+
flag: '🇮🇹',
|
|
57
|
+
icon: 'language-outline',
|
|
58
|
+
color: '#34C759'
|
|
59
|
+
}, {
|
|
60
|
+
id: 'pt-PT',
|
|
61
|
+
name: 'Portuguese',
|
|
62
|
+
nativeName: 'Português',
|
|
63
|
+
flag: '🇵🇹',
|
|
64
|
+
icon: 'language-outline',
|
|
65
|
+
color: '#AF52DE'
|
|
66
|
+
}, {
|
|
67
|
+
id: 'ja-JP',
|
|
68
|
+
name: 'Japanese',
|
|
69
|
+
nativeName: '日本語',
|
|
70
|
+
flag: '🇯🇵',
|
|
71
|
+
icon: 'language-outline',
|
|
72
|
+
color: '#FF2D92'
|
|
73
|
+
}, {
|
|
74
|
+
id: 'ko-KR',
|
|
75
|
+
name: 'Korean',
|
|
76
|
+
nativeName: '한국어',
|
|
77
|
+
flag: '🇰🇷',
|
|
78
|
+
icon: 'language-outline',
|
|
79
|
+
color: '#32D74B'
|
|
80
|
+
}, {
|
|
81
|
+
id: 'zh-CN',
|
|
82
|
+
name: 'Chinese',
|
|
83
|
+
nativeName: '中文',
|
|
84
|
+
flag: '🇨🇳',
|
|
85
|
+
icon: 'language-outline',
|
|
86
|
+
color: '#FF9F0A'
|
|
87
|
+
}, {
|
|
88
|
+
id: 'ar-SA',
|
|
89
|
+
name: 'Arabic',
|
|
90
|
+
nativeName: 'العربية',
|
|
91
|
+
flag: '🇸🇦',
|
|
92
|
+
icon: 'language-outline',
|
|
93
|
+
color: '#30B0C7'
|
|
94
|
+
}];
|
|
95
|
+
const FALLBACK_LANGUAGE = 'en-US';
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Get language metadata by language code
|
|
99
|
+
* @param languageCode - BCP-47 language code (e.g., 'en-US', 'es-ES')
|
|
100
|
+
* @returns Language metadata or null if not found
|
|
101
|
+
*/
|
|
102
|
+
function getLanguageMetadata(languageCode) {
|
|
103
|
+
if (!languageCode) return null;
|
|
104
|
+
|
|
105
|
+
// Direct match
|
|
106
|
+
const exactMatch = SUPPORTED_LANGUAGES.find(lang => lang.id === languageCode);
|
|
107
|
+
if (exactMatch) return exactMatch;
|
|
108
|
+
|
|
109
|
+
// Try to match base language code (e.g., 'en' matches 'en-US')
|
|
110
|
+
const baseCode = languageCode.split('-')[0];
|
|
111
|
+
const baseMatch = SUPPORTED_LANGUAGES.find(lang => lang.id.startsWith(baseCode + '-'));
|
|
112
|
+
if (baseMatch) return baseMatch;
|
|
113
|
+
return null;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Get language name by language code
|
|
118
|
+
* @param languageCode - BCP-47 language code (e.g., 'en-US', 'es-ES')
|
|
119
|
+
* @returns Language name (e.g., 'English') or the code if not found
|
|
120
|
+
*/
|
|
121
|
+
function getLanguageName(languageCode) {
|
|
122
|
+
const metadata = getLanguageMetadata(languageCode);
|
|
123
|
+
return metadata?.name || languageCode || FALLBACK_LANGUAGE;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Get native language name by language code
|
|
128
|
+
* @param languageCode - BCP-47 language code (e.g., 'en-US', 'es-ES')
|
|
129
|
+
* @returns Native language name (e.g., 'Español') or the code if not found
|
|
130
|
+
*/
|
|
131
|
+
function getNativeLanguageName(languageCode) {
|
|
132
|
+
const metadata = getLanguageMetadata(languageCode);
|
|
133
|
+
return metadata?.nativeName || languageCode || FALLBACK_LANGUAGE;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* Normalize language code to BCP-47 format
|
|
138
|
+
* @param lang - Language code (may be short like 'en' or full like 'en-US')
|
|
139
|
+
* @returns Normalized BCP-47 language code
|
|
140
|
+
*/
|
|
141
|
+
function normalizeLanguageCode(lang) {
|
|
142
|
+
if (!lang) return FALLBACK_LANGUAGE;
|
|
143
|
+
if (lang.includes('-')) return lang;
|
|
144
|
+
const map = {
|
|
145
|
+
en: 'en-US',
|
|
146
|
+
es: 'es-ES',
|
|
147
|
+
ca: 'ca-ES',
|
|
148
|
+
fr: 'fr-FR',
|
|
149
|
+
de: 'de-DE',
|
|
150
|
+
it: 'it-IT',
|
|
151
|
+
pt: 'pt-PT',
|
|
152
|
+
ja: 'ja-JP',
|
|
153
|
+
ko: 'ko-KR',
|
|
154
|
+
zh: 'zh-CN',
|
|
155
|
+
ar: 'ar-SA'
|
|
156
|
+
};
|
|
157
|
+
return map[lang] || lang;
|
|
158
|
+
}
|
|
159
|
+
//# sourceMappingURL=languageUtils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["SUPPORTED_LANGUAGES","exports","id","name","nativeName","flag","icon","color","FALLBACK_LANGUAGE","getLanguageMetadata","languageCode","exactMatch","find","lang","baseCode","split","baseMatch","startsWith","getLanguageName","metadata","getNativeLanguageName","normalizeLanguageCode","includes","map","en","es","ca","fr","de","it","pt","ja","ko","zh","ar"],"sourceRoot":"../../../src","sources":["utils/languageUtils.ts"],"mappings":";;;;;;;;;;AAAA;AACA;AACA;AACA;;AAWA;AACO,MAAMA,mBAAuC,GAAAC,OAAA,CAAAD,mBAAA,GAAG,CACrD;EACEE,EAAE,EAAE,OAAO;EACXC,IAAI,EAAE,SAAS;EACfC,UAAU,EAAE,SAAS;EACrBC,IAAI,EAAE,MAAM;EACZC,IAAI,EAAE,kBAAkB;EACxBC,KAAK,EAAE;AACT,CAAC,EACD;EACEL,EAAE,EAAE,OAAO;EACXC,IAAI,EAAE,SAAS;EACfC,UAAU,EAAE,SAAS;EACrBC,IAAI,EAAE,MAAM;EACZC,IAAI,EAAE,kBAAkB;EACxBC,KAAK,EAAE;AACT,CAAC,EACD;EACEL,EAAE,EAAE,OAAO;EACXC,IAAI,EAAE,SAAS;EACfC,UAAU,EAAE,QAAQ;EACpBC,IAAI,EAAE,MAAM;EACZC,IAAI,EAAE,kBAAkB;EACxBC,KAAK,EAAE;AACT,CAAC,EACD;EACEL,EAAE,EAAE,OAAO;EACXC,IAAI,EAAE,QAAQ;EACdC,UAAU,EAAE,UAAU;EACtBC,IAAI,EAAE,MAAM;EACZC,IAAI,EAAE,kBAAkB;EACxBC,KAAK,EAAE;AACT,CAAC,EACD;EACEL,EAAE,EAAE,OAAO;EACXC,IAAI,EAAE,QAAQ;EACdC,UAAU,EAAE,SAAS;EACrBC,IAAI,EAAE,MAAM;EACZC,IAAI,EAAE,kBAAkB;EACxBC,KAAK,EAAE;AACT,CAAC,EACD;EACEL,EAAE,EAAE,OAAO;EACXC,IAAI,EAAE,SAAS;EACfC,UAAU,EAAE,UAAU;EACtBC,IAAI,EAAE,MAAM;EACZC,IAAI,EAAE,kBAAkB;EACxBC,KAAK,EAAE;AACT,CAAC,EACD;EACEL,EAAE,EAAE,OAAO;EACXC,IAAI,EAAE,YAAY;EAClBC,UAAU,EAAE,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