@oxyhq/services 5.11.12 → 5.12.0
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 +48 -7
- package/lib/commonjs/core/OxyServices.js +162 -12
- package/lib/commonjs/core/OxyServices.js.map +1 -1
- package/lib/commonjs/i18n/index.js +40 -0
- package/lib/commonjs/i18n/index.js.map +1 -0
- package/lib/commonjs/i18n/locales/en-US.json +681 -0
- package/lib/commonjs/i18n/locales/es-ES.json +689 -0
- package/lib/commonjs/ui/components/GroupedItem.js +2 -1
- package/lib/commonjs/ui/components/GroupedItem.js.map +1 -1
- package/lib/commonjs/ui/components/Header.js +4 -3
- package/lib/commonjs/ui/components/Header.js.map +1 -1
- package/lib/commonjs/ui/components/OxyProvider.js +110 -103
- package/lib/commonjs/ui/components/OxyProvider.js.map +1 -1
- package/lib/commonjs/ui/components/ProfileCard.js +5 -1
- package/lib/commonjs/ui/components/ProfileCard.js.map +1 -1
- package/lib/commonjs/ui/components/Section.js +1 -1
- package/lib/commonjs/ui/components/StepBasedScreen.js +16 -16
- package/lib/commonjs/ui/components/StepBasedScreen.js.map +1 -1
- package/lib/commonjs/ui/components/internal/GroupedPillButtons.js +15 -3
- package/lib/commonjs/ui/components/internal/GroupedPillButtons.js.map +1 -1
- package/lib/commonjs/ui/components/internal/PinInput.js +10 -4
- package/lib/commonjs/ui/components/internal/PinInput.js.map +1 -1
- package/lib/commonjs/ui/context/OxyContext.js +128 -12
- package/lib/commonjs/ui/context/OxyContext.js.map +1 -1
- package/lib/commonjs/ui/hooks/useI18n.js +22 -0
- package/lib/commonjs/ui/hooks/useI18n.js.map +1 -0
- package/lib/commonjs/ui/navigation/OxyRouter.js +11 -131
- package/lib/commonjs/ui/navigation/OxyRouter.js.map +1 -1
- package/lib/commonjs/ui/navigation/routes.js +127 -0
- package/lib/commonjs/ui/navigation/routes.js.map +1 -0
- package/lib/commonjs/ui/navigation/types.js +7 -0
- package/lib/commonjs/ui/navigation/types.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountCenterScreen.js +55 -47
- package/lib/commonjs/ui/screens/AccountCenterScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountOverviewScreen.js +69 -61
- package/lib/commonjs/ui/screens/AccountOverviewScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountSettingsScreen.js +378 -37
- package/lib/commonjs/ui/screens/AccountSettingsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountSwitcherScreen.js +52 -34
- package/lib/commonjs/ui/screens/AccountSwitcherScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/FeedbackScreen.js +40 -36
- package/lib/commonjs/ui/screens/FeedbackScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/LanguageSelectorScreen.js +105 -78
- package/lib/commonjs/ui/screens/LanguageSelectorScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/PaymentGatewayScreen.js +1 -1
- package/lib/commonjs/ui/screens/PaymentGatewayScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/PremiumSubscriptionScreen.js +92 -60
- package/lib/commonjs/ui/screens/PremiumSubscriptionScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/ProfileScreen.js +21 -11
- package/lib/commonjs/ui/screens/ProfileScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/RecoverAccountScreen.js +30 -8
- package/lib/commonjs/ui/screens/RecoverAccountScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/SignInScreen.js +47 -26
- package/lib/commonjs/ui/screens/SignInScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/WelcomeNewUserScreen.js +31 -24
- package/lib/commonjs/ui/screens/WelcomeNewUserScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/internal/SignInPasswordStep.js +11 -7
- package/lib/commonjs/ui/screens/internal/SignInPasswordStep.js.map +1 -1
- package/lib/commonjs/ui/screens/internal/SignInUsernameStep.js +12 -6
- package/lib/commonjs/ui/screens/internal/SignInUsernameStep.js.map +1 -1
- package/lib/commonjs/ui/screens/karma/KarmaAboutScreen.js +11 -7
- package/lib/commonjs/ui/screens/karma/KarmaAboutScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/karma/KarmaCenterScreen.js +15 -11
- package/lib/commonjs/ui/screens/karma/KarmaCenterScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/karma/KarmaFAQScreen.js +19 -27
- package/lib/commonjs/ui/screens/karma/KarmaFAQScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/karma/KarmaLeaderboardScreen.js +8 -4
- package/lib/commonjs/ui/screens/karma/KarmaLeaderboardScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/karma/KarmaRewardsScreen.js +14 -10
- package/lib/commonjs/ui/screens/karma/KarmaRewardsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/karma/KarmaRulesScreen.js +7 -3
- package/lib/commonjs/ui/screens/karma/KarmaRulesScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/steps/RecoverRequestStep.js +19 -14
- package/lib/commonjs/ui/screens/steps/RecoverRequestStep.js.map +1 -1
- package/lib/commonjs/ui/screens/steps/RecoverResetPasswordStep.js +130 -0
- package/lib/commonjs/ui/screens/steps/RecoverResetPasswordStep.js.map +1 -0
- package/lib/commonjs/ui/screens/steps/RecoverSuccessStep.js +13 -13
- package/lib/commonjs/ui/screens/steps/RecoverSuccessStep.js.map +1 -1
- package/lib/commonjs/ui/screens/steps/RecoverVerifyStep.js +14 -20
- package/lib/commonjs/ui/screens/steps/RecoverVerifyStep.js.map +1 -1
- package/lib/commonjs/ui/screens/steps/SignInPasswordStep.js +22 -8
- package/lib/commonjs/ui/screens/steps/SignInPasswordStep.js.map +1 -1
- package/lib/commonjs/ui/screens/steps/SignInTotpStep.js +161 -0
- package/lib/commonjs/ui/screens/steps/SignInTotpStep.js.map +1 -0
- package/lib/commonjs/ui/screens/steps/SignInUsernameStep.js +12 -6
- package/lib/commonjs/ui/screens/steps/SignInUsernameStep.js.map +1 -1
- package/lib/commonjs/ui/screens/steps/SignUpIdentityStep.js +10 -6
- package/lib/commonjs/ui/screens/steps/SignUpIdentityStep.js.map +1 -1
- package/lib/commonjs/ui/screens/steps/SignUpSecurityStep.js +10 -6
- package/lib/commonjs/ui/screens/steps/SignUpSecurityStep.js.map +1 -1
- package/lib/commonjs/ui/screens/steps/SignUpSummaryStep.js +34 -4
- package/lib/commonjs/ui/screens/steps/SignUpSummaryStep.js.map +1 -1
- package/lib/commonjs/ui/screens/steps/SignUpWelcomeStep.js +9 -10
- package/lib/commonjs/ui/screens/steps/SignUpWelcomeStep.js.map +1 -1
- package/lib/commonjs/ui/styles/authStyles.js +1 -2
- package/lib/commonjs/ui/styles/authStyles.js.map +1 -1
- package/lib/commonjs/utils/deviceManager.js +1 -1
- package/lib/commonjs/utils/deviceManager.js.map +1 -1
- package/lib/commonjs/utils/validationUtils.js +4 -2
- package/lib/commonjs/utils/validationUtils.js.map +1 -1
- package/lib/module/core/OxyServices.js +162 -12
- package/lib/module/core/OxyServices.js.map +1 -1
- package/lib/module/i18n/index.js +35 -0
- package/lib/module/i18n/index.js.map +1 -0
- package/lib/module/i18n/locales/en-US.json +681 -0
- package/lib/module/i18n/locales/es-ES.json +689 -0
- package/lib/module/ui/components/GroupedItem.js +2 -1
- package/lib/module/ui/components/GroupedItem.js.map +1 -1
- package/lib/module/ui/components/Header.js +4 -3
- package/lib/module/ui/components/Header.js.map +1 -1
- package/lib/module/ui/components/OxyProvider.js +109 -103
- package/lib/module/ui/components/OxyProvider.js.map +1 -1
- package/lib/module/ui/components/ProfileCard.js +5 -1
- package/lib/module/ui/components/ProfileCard.js.map +1 -1
- package/lib/module/ui/components/Section.js +1 -1
- package/lib/module/ui/components/StepBasedScreen.js +16 -16
- package/lib/module/ui/components/StepBasedScreen.js.map +1 -1
- package/lib/module/ui/components/internal/GroupedPillButtons.js +15 -3
- package/lib/module/ui/components/internal/GroupedPillButtons.js.map +1 -1
- package/lib/module/ui/components/internal/PinInput.js +9 -4
- package/lib/module/ui/components/internal/PinInput.js.map +1 -1
- package/lib/module/ui/context/OxyContext.js +128 -12
- package/lib/module/ui/context/OxyContext.js.map +1 -1
- package/lib/module/ui/hooks/useI18n.js +18 -0
- package/lib/module/ui/hooks/useI18n.js.map +1 -0
- package/lib/module/ui/navigation/OxyRouter.js +7 -124
- package/lib/module/ui/navigation/OxyRouter.js.map +1 -1
- package/lib/module/ui/navigation/routes.js +122 -0
- package/lib/module/ui/navigation/routes.js.map +1 -0
- package/lib/module/ui/navigation/types.js +19 -1
- package/lib/module/ui/navigation/types.js.map +1 -1
- package/lib/module/ui/screens/AccountCenterScreen.js +55 -47
- package/lib/module/ui/screens/AccountCenterScreen.js.map +1 -1
- package/lib/module/ui/screens/AccountOverviewScreen.js +69 -61
- package/lib/module/ui/screens/AccountOverviewScreen.js.map +1 -1
- package/lib/module/ui/screens/AccountSettingsScreen.js +378 -37
- package/lib/module/ui/screens/AccountSettingsScreen.js.map +1 -1
- package/lib/module/ui/screens/AccountSwitcherScreen.js +52 -34
- package/lib/module/ui/screens/AccountSwitcherScreen.js.map +1 -1
- package/lib/module/ui/screens/FeedbackScreen.js +40 -36
- package/lib/module/ui/screens/FeedbackScreen.js.map +1 -1
- package/lib/module/ui/screens/LanguageSelectorScreen.js +107 -80
- package/lib/module/ui/screens/LanguageSelectorScreen.js.map +1 -1
- package/lib/module/ui/screens/PaymentGatewayScreen.js +1 -1
- package/lib/module/ui/screens/PaymentGatewayScreen.js.map +1 -1
- package/lib/module/ui/screens/PremiumSubscriptionScreen.js +92 -60
- package/lib/module/ui/screens/PremiumSubscriptionScreen.js.map +1 -1
- package/lib/module/ui/screens/ProfileScreen.js +21 -11
- package/lib/module/ui/screens/ProfileScreen.js.map +1 -1
- package/lib/module/ui/screens/RecoverAccountScreen.js +30 -8
- package/lib/module/ui/screens/RecoverAccountScreen.js.map +1 -1
- package/lib/module/ui/screens/SignInScreen.js +47 -26
- package/lib/module/ui/screens/SignInScreen.js.map +1 -1
- package/lib/module/ui/screens/WelcomeNewUserScreen.js +31 -24
- package/lib/module/ui/screens/WelcomeNewUserScreen.js.map +1 -1
- package/lib/module/ui/screens/internal/SignInPasswordStep.js +11 -7
- package/lib/module/ui/screens/internal/SignInPasswordStep.js.map +1 -1
- package/lib/module/ui/screens/internal/SignInUsernameStep.js +12 -6
- package/lib/module/ui/screens/internal/SignInUsernameStep.js.map +1 -1
- package/lib/module/ui/screens/karma/KarmaAboutScreen.js +11 -7
- package/lib/module/ui/screens/karma/KarmaAboutScreen.js.map +1 -1
- package/lib/module/ui/screens/karma/KarmaCenterScreen.js +15 -11
- package/lib/module/ui/screens/karma/KarmaCenterScreen.js.map +1 -1
- package/lib/module/ui/screens/karma/KarmaFAQScreen.js +19 -27
- package/lib/module/ui/screens/karma/KarmaFAQScreen.js.map +1 -1
- package/lib/module/ui/screens/karma/KarmaLeaderboardScreen.js +8 -4
- package/lib/module/ui/screens/karma/KarmaLeaderboardScreen.js.map +1 -1
- package/lib/module/ui/screens/karma/KarmaRewardsScreen.js +14 -10
- package/lib/module/ui/screens/karma/KarmaRewardsScreen.js.map +1 -1
- package/lib/module/ui/screens/karma/KarmaRulesScreen.js +7 -3
- package/lib/module/ui/screens/karma/KarmaRulesScreen.js.map +1 -1
- package/lib/module/ui/screens/steps/RecoverRequestStep.js +19 -14
- package/lib/module/ui/screens/steps/RecoverRequestStep.js.map +1 -1
- package/lib/module/ui/screens/steps/RecoverResetPasswordStep.js +125 -0
- package/lib/module/ui/screens/steps/RecoverResetPasswordStep.js.map +1 -0
- package/lib/module/ui/screens/steps/RecoverSuccessStep.js +13 -13
- package/lib/module/ui/screens/steps/RecoverSuccessStep.js.map +1 -1
- package/lib/module/ui/screens/steps/RecoverVerifyStep.js +14 -20
- package/lib/module/ui/screens/steps/RecoverVerifyStep.js.map +1 -1
- package/lib/module/ui/screens/steps/SignInPasswordStep.js +22 -8
- package/lib/module/ui/screens/steps/SignInPasswordStep.js.map +1 -1
- package/lib/module/ui/screens/steps/SignInTotpStep.js +156 -0
- package/lib/module/ui/screens/steps/SignInTotpStep.js.map +1 -0
- package/lib/module/ui/screens/steps/SignInUsernameStep.js +12 -6
- package/lib/module/ui/screens/steps/SignInUsernameStep.js.map +1 -1
- package/lib/module/ui/screens/steps/SignUpIdentityStep.js +10 -6
- package/lib/module/ui/screens/steps/SignUpIdentityStep.js.map +1 -1
- package/lib/module/ui/screens/steps/SignUpSecurityStep.js +10 -6
- package/lib/module/ui/screens/steps/SignUpSecurityStep.js.map +1 -1
- package/lib/module/ui/screens/steps/SignUpSummaryStep.js +34 -4
- package/lib/module/ui/screens/steps/SignUpSummaryStep.js.map +1 -1
- package/lib/module/ui/screens/steps/SignUpWelcomeStep.js +9 -10
- package/lib/module/ui/screens/steps/SignUpWelcomeStep.js.map +1 -1
- package/lib/module/ui/styles/authStyles.js +1 -2
- package/lib/module/ui/styles/authStyles.js.map +1 -1
- package/lib/module/utils/deviceManager.js +1 -1
- package/lib/module/utils/deviceManager.js.map +1 -1
- package/lib/module/utils/validationUtils.js +4 -2
- package/lib/module/utils/validationUtils.js.map +1 -1
- package/lib/typescript/core/OxyServices.d.ts +57 -3
- package/lib/typescript/core/OxyServices.d.ts.map +1 -1
- package/lib/typescript/i18n/index.d.ts +4 -0
- package/lib/typescript/i18n/index.d.ts.map +1 -0
- package/lib/typescript/models/interfaces.d.ts +4 -0
- package/lib/typescript/models/interfaces.d.ts.map +1 -1
- package/lib/typescript/ui/components/GroupedItem.d.ts.map +1 -1
- package/lib/typescript/ui/components/Header.d.ts.map +1 -1
- package/lib/typescript/ui/components/OxyProvider.d.ts +1 -1
- package/lib/typescript/ui/components/OxyProvider.d.ts.map +1 -1
- package/lib/typescript/ui/components/ProfileCard.d.ts.map +1 -1
- package/lib/typescript/ui/components/StepBasedScreen.d.ts +2 -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/PinInput.d.ts +6 -3
- package/lib/typescript/ui/components/internal/PinInput.d.ts.map +1 -1
- package/lib/typescript/ui/context/OxyContext.d.ts +7 -4
- package/lib/typescript/ui/context/OxyContext.d.ts.map +1 -1
- package/lib/typescript/ui/hooks/useI18n.d.ts +5 -0
- package/lib/typescript/ui/hooks/useI18n.d.ts.map +1 -0
- package/lib/typescript/ui/navigation/OxyRouter.d.ts.map +1 -1
- package/lib/typescript/ui/navigation/routes.d.ts +9 -0
- package/lib/typescript/ui/navigation/routes.d.ts.map +1 -0
- package/lib/typescript/ui/navigation/types.d.ts +24 -10
- package/lib/typescript/ui/navigation/types.d.ts.map +1 -1
- package/lib/typescript/ui/screens/AccountCenterScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/AccountOverviewScreen.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/FeedbackScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/LanguageSelectorScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/PremiumSubscriptionScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/ProfileScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/RecoverAccountScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/SignInScreen.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 +2 -1
- package/lib/typescript/ui/screens/internal/SignInPasswordStep.d.ts.map +1 -1
- package/lib/typescript/ui/screens/internal/SignInUsernameStep.d.ts.map +1 -1
- package/lib/typescript/ui/screens/karma/KarmaAboutScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/karma/KarmaCenterScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/karma/KarmaFAQScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/karma/KarmaLeaderboardScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/karma/KarmaRewardsScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/karma/KarmaRulesScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/steps/RecoverRequestStep.d.ts +4 -1
- package/lib/typescript/ui/screens/steps/RecoverRequestStep.d.ts.map +1 -1
- package/lib/typescript/ui/screens/steps/RecoverResetPasswordStep.d.ts +24 -0
- package/lib/typescript/ui/screens/steps/RecoverResetPasswordStep.d.ts.map +1 -0
- package/lib/typescript/ui/screens/steps/RecoverSuccessStep.d.ts +2 -1
- package/lib/typescript/ui/screens/steps/RecoverSuccessStep.d.ts.map +1 -1
- package/lib/typescript/ui/screens/steps/RecoverVerifyStep.d.ts +3 -1
- package/lib/typescript/ui/screens/steps/RecoverVerifyStep.d.ts.map +1 -1
- package/lib/typescript/ui/screens/steps/SignInPasswordStep.d.ts +1 -0
- package/lib/typescript/ui/screens/steps/SignInPasswordStep.d.ts.map +1 -1
- package/lib/typescript/ui/screens/steps/SignInTotpStep.d.ts +19 -0
- package/lib/typescript/ui/screens/steps/SignInTotpStep.d.ts.map +1 -0
- package/lib/typescript/ui/screens/steps/SignInUsernameStep.d.ts +2 -1
- package/lib/typescript/ui/screens/steps/SignInUsernameStep.d.ts.map +1 -1
- package/lib/typescript/ui/screens/steps/SignUpIdentityStep.d.ts +2 -1
- package/lib/typescript/ui/screens/steps/SignUpIdentityStep.d.ts.map +1 -1
- package/lib/typescript/ui/screens/steps/SignUpSecurityStep.d.ts +2 -1
- package/lib/typescript/ui/screens/steps/SignUpSecurityStep.d.ts.map +1 -1
- package/lib/typescript/ui/screens/steps/SignUpSummaryStep.d.ts +2 -1
- package/lib/typescript/ui/screens/steps/SignUpSummaryStep.d.ts.map +1 -1
- package/lib/typescript/ui/screens/steps/SignUpWelcomeStep.d.ts +2 -1
- package/lib/typescript/ui/screens/steps/SignUpWelcomeStep.d.ts.map +1 -1
- package/lib/typescript/ui/styles/authStyles.d.ts +0 -1
- package/lib/typescript/ui/styles/authStyles.d.ts.map +1 -1
- package/lib/typescript/utils/validationUtils.d.ts.map +1 -1
- package/package.json +49 -15
- package/src/core/OxyServices.ts +138 -19
- package/src/i18n/index.ts +39 -0
- package/src/i18n/locales/en-US.json +681 -0
- package/src/i18n/locales/es-ES.json +689 -0
- package/src/models/interfaces.ts +6 -1
- package/src/ui/components/GroupedItem.tsx +2 -1
- package/src/ui/components/Header.tsx +4 -3
- package/src/ui/components/OxyProvider.tsx +105 -112
- package/src/ui/components/ProfileCard.tsx +5 -1
- package/src/ui/components/Section.tsx +1 -1
- package/src/ui/components/StepBasedScreen.tsx +16 -13
- package/src/ui/components/internal/GroupedPillButtons.tsx +10 -6
- package/src/ui/components/internal/PinInput.tsx +15 -6
- package/src/ui/context/OxyContext.tsx +123 -20
- package/src/ui/hooks/useI18n.ts +12 -0
- package/src/ui/navigation/OxyRouter.tsx +15 -134
- package/src/ui/navigation/routes.ts +153 -0
- package/src/ui/navigation/types.ts +28 -10
- package/src/ui/screens/AccountCenterScreen.tsx +47 -45
- package/src/ui/screens/AccountOverviewScreen.tsx +68 -70
- package/src/ui/screens/AccountSettingsScreen.tsx +265 -41
- package/src/ui/screens/AccountSwitcherScreen.tsx +35 -33
- package/src/ui/screens/FeedbackScreen.tsx +39 -37
- package/src/ui/screens/LanguageSelectorScreen.tsx +99 -70
- package/src/ui/screens/PaymentGatewayScreen.tsx +5 -5
- package/src/ui/screens/PremiumSubscriptionScreen.tsx +56 -54
- package/src/ui/screens/ProfileScreen.tsx +14 -8
- package/src/ui/screens/RecoverAccountScreen.tsx +29 -8
- package/src/ui/screens/SignInScreen.tsx +39 -30
- package/src/ui/screens/WelcomeNewUserScreen.tsx +31 -17
- package/src/ui/screens/internal/SignInPasswordStep.tsx +11 -8
- package/src/ui/screens/internal/SignInUsernameStep.tsx +10 -8
- package/src/ui/screens/karma/KarmaAboutScreen.tsx +23 -11
- package/src/ui/screens/karma/KarmaCenterScreen.tsx +21 -11
- package/src/ui/screens/karma/KarmaFAQScreen.tsx +15 -33
- package/src/ui/screens/karma/KarmaLeaderboardScreen.tsx +6 -4
- package/src/ui/screens/karma/KarmaRewardsScreen.tsx +28 -10
- package/src/ui/screens/karma/KarmaRulesScreen.tsx +5 -3
- package/src/ui/screens/steps/RecoverRequestStep.tsx +20 -17
- package/src/ui/screens/steps/RecoverResetPasswordStep.tsx +133 -0
- package/src/ui/screens/steps/RecoverSuccessStep.tsx +12 -19
- package/src/ui/screens/steps/RecoverVerifyStep.tsx +15 -24
- package/src/ui/screens/steps/SignInPasswordStep.tsx +19 -6
- package/src/ui/screens/steps/SignInTotpStep.tsx +129 -0
- package/src/ui/screens/steps/SignInUsernameStep.tsx +11 -10
- package/src/ui/screens/steps/SignUpIdentityStep.tsx +10 -11
- package/src/ui/screens/steps/SignUpSecurityStep.tsx +10 -11
- package/src/ui/screens/steps/SignUpSummaryStep.tsx +24 -9
- package/src/ui/screens/steps/SignUpWelcomeStep.tsx +8 -14
- package/src/ui/styles/authStyles.ts +0 -1
- package/src/utils/deviceManager.ts +1 -1
- package/src/utils/validationUtils.ts +5 -3
package/package.json
CHANGED
|
@@ -1,29 +1,42 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oxyhq/services",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.12.0",
|
|
4
4
|
"description": "Reusable OxyHQ module to handle authentication, user management, karma system, device-based session management and more 🚀",
|
|
5
5
|
"main": "lib/commonjs/index.js",
|
|
6
6
|
"module": "lib/module/index.js",
|
|
7
7
|
"types": "lib/typescript/index.d.ts",
|
|
8
8
|
"react-native": "src/index.ts",
|
|
9
9
|
"source": "src/index.ts",
|
|
10
|
+
"sideEffects": false,
|
|
11
|
+
"publishConfig": {
|
|
12
|
+
"access": "public"
|
|
13
|
+
},
|
|
10
14
|
"exports": {
|
|
11
15
|
".": {
|
|
16
|
+
"react-native": "./src/index.ts",
|
|
17
|
+
"node": {
|
|
18
|
+
"import": "./lib/module/core/index.js",
|
|
19
|
+
"require": "./lib/commonjs/core/index.js",
|
|
20
|
+
"types": "./lib/typescript/core/index.d.ts"
|
|
21
|
+
},
|
|
12
22
|
"import": "./lib/module/index.js",
|
|
13
23
|
"require": "./lib/commonjs/index.js",
|
|
14
24
|
"types": "./lib/typescript/index.d.ts"
|
|
15
25
|
},
|
|
16
26
|
"./core": {
|
|
27
|
+
"react-native": "./src/core/index.ts",
|
|
17
28
|
"import": "./lib/module/core/index.js",
|
|
18
29
|
"require": "./lib/commonjs/core/index.js",
|
|
19
30
|
"types": "./lib/typescript/core/index.d.ts"
|
|
20
31
|
},
|
|
21
32
|
"./ui": {
|
|
33
|
+
"react-native": "./src/ui/index.ts",
|
|
22
34
|
"import": "./lib/module/ui/index.js",
|
|
23
35
|
"require": "./lib/commonjs/ui/index.js",
|
|
24
36
|
"types": "./lib/typescript/ui/index.d.ts"
|
|
25
37
|
},
|
|
26
38
|
"./full": {
|
|
39
|
+
"react-native": "./src/index.ts",
|
|
27
40
|
"import": "./lib/module/index.js",
|
|
28
41
|
"require": "./lib/commonjs/index.js",
|
|
29
42
|
"types": "./lib/typescript/index.d.ts"
|
|
@@ -66,32 +79,25 @@
|
|
|
66
79
|
"copy-dts": "copyfiles -u 1 \"src/**/*.d.ts\" lib/typescript",
|
|
67
80
|
"delete-debug-view": "rm -rf ./lib/commonjs/components/bottomSheetDebugView ./lib/module/components/bottomSheetDebugView ./lib/typescript/components/bottomSheetDebugView || true",
|
|
68
81
|
"delete-dts.js": "find ./lib/commonjs -name '*.d.js*' -delete && find ./lib/module -name '*.d.js*' -delete",
|
|
69
|
-
"release": "rm -rf lib && npm run build && release-it"
|
|
82
|
+
"release": "rm -rf lib && npm run build && release-it",
|
|
83
|
+
"prepublishOnly": "npm run typescript && npm test && npm run build"
|
|
70
84
|
},
|
|
71
85
|
"dependencies": {
|
|
86
|
+
"@amir-hossein-karimi/bottom-sheet": "^9.1.2",
|
|
87
|
+
"@gorhom/bottom-sheet": "^5.1.6",
|
|
72
88
|
"@react-native-async-storage/async-storage": "2.1.2",
|
|
73
|
-
"@react-
|
|
89
|
+
"@tanstack/react-query": "^5.59.0",
|
|
74
90
|
"@th3rdwave/react-navigation-bottom-sheet": "^0.3.2",
|
|
75
91
|
"axios": "^1.9.0",
|
|
76
|
-
"expo": "^53.0.20",
|
|
77
|
-
"expo-font": "^13.3.1",
|
|
78
|
-
"expo-image": "~2.4.0",
|
|
79
|
-
"expo-linear-gradient": "^14.1.4",
|
|
80
92
|
"invariant": "^2.2.4",
|
|
81
93
|
"jwt-decode": "^4.0.0",
|
|
82
|
-
"react-native-iap": "^12.16.4",
|
|
83
94
|
"react-native-qrcode-svg": "^6.3.0",
|
|
84
|
-
"react-native-safe-area-context": "^5.4.0",
|
|
85
95
|
"react-native-url-polyfill": "^2.0.0",
|
|
86
96
|
"socket.io-client": "^4.8.1",
|
|
87
97
|
"sonner": "^2.0.4",
|
|
88
98
|
"sonner-native": "^0.20.0",
|
|
89
|
-
"tailwindcss": "^4.1.11",
|
|
90
99
|
"zod": "^3.25.64",
|
|
91
|
-
"zustand": "^5.0.6"
|
|
92
|
-
"@tanstack/react-query": "^5.59.0",
|
|
93
|
-
"@amir-hossein-karimi/bottom-sheet": "^9.1.2",
|
|
94
|
-
"@gorhom/bottom-sheet": "^5.1.6"
|
|
100
|
+
"zustand": "^5.0.6"
|
|
95
101
|
},
|
|
96
102
|
"devDependencies": {
|
|
97
103
|
"@biomejs/biome": "^1.9.4",
|
|
@@ -108,13 +114,17 @@
|
|
|
108
114
|
"@types/react": "~19.0.10",
|
|
109
115
|
"@types/react-native": "~0.73.0",
|
|
110
116
|
"copyfiles": "^2.4.1",
|
|
117
|
+
"expo-font": "^13.3.2",
|
|
118
|
+
"expo-image": "^2.4.0",
|
|
111
119
|
"husky": "^4.3.8",
|
|
112
120
|
"jest": "~29.7.0",
|
|
113
121
|
"lint-staged": "^13.2.2",
|
|
114
122
|
"metro-react-native-babel-preset": "^0.77.0",
|
|
115
123
|
"react-native-builder-bob": "^0.30.3",
|
|
116
124
|
"react-native-gesture-handler": "~2.24.0",
|
|
125
|
+
"react-native-iap": "^13.0.4",
|
|
117
126
|
"react-native-reanimated": "~3.17.4",
|
|
127
|
+
"react-native-safe-area-context": "^5.6.1",
|
|
118
128
|
"react-native-svg": "15.11.2",
|
|
119
129
|
"react-test-renderer": "^18.3.1",
|
|
120
130
|
"release-it": "^17.6.0",
|
|
@@ -123,14 +133,20 @@
|
|
|
123
133
|
},
|
|
124
134
|
"peerDependencies": {
|
|
125
135
|
"@expo/vector-icons": "^14.1.0",
|
|
136
|
+
"@react-navigation/native": "^7.0.0",
|
|
126
137
|
"@types/react": "*",
|
|
127
138
|
"@types/react-native": "*",
|
|
128
139
|
"axios": "^1.9.0",
|
|
140
|
+
"expo": "^53.0.0",
|
|
141
|
+
"expo-font": "^13.0.0",
|
|
142
|
+
"expo-image": "^2.4.0",
|
|
143
|
+
"expo-linear-gradient": "^14.0.0",
|
|
129
144
|
"invariant": "^2.2.4",
|
|
130
145
|
"jwt-decode": "^4.0.0",
|
|
131
146
|
"react": ">=18.0.0",
|
|
132
147
|
"react-native": ">=0.76.0",
|
|
133
148
|
"react-native-gesture-handler": ">=2.16.1",
|
|
149
|
+
"react-native-iap": "^12.16.0",
|
|
134
150
|
"react-native-reanimated": ">=3.16.0",
|
|
135
151
|
"react-native-safe-area-context": "^5.4.0",
|
|
136
152
|
"react-native-svg": ">=13.0.0"
|
|
@@ -147,6 +163,24 @@
|
|
|
147
163
|
},
|
|
148
164
|
"react-native-qrcode-svg": {
|
|
149
165
|
"optional": true
|
|
166
|
+
},
|
|
167
|
+
"expo": {
|
|
168
|
+
"optional": true
|
|
169
|
+
},
|
|
170
|
+
"expo-font": {
|
|
171
|
+
"optional": true
|
|
172
|
+
},
|
|
173
|
+
"expo-image": {
|
|
174
|
+
"optional": true
|
|
175
|
+
},
|
|
176
|
+
"expo-linear-gradient": {
|
|
177
|
+
"optional": true
|
|
178
|
+
},
|
|
179
|
+
"@react-navigation/native": {
|
|
180
|
+
"optional": true
|
|
181
|
+
},
|
|
182
|
+
"react-native-iap": {
|
|
183
|
+
"optional": true
|
|
150
184
|
}
|
|
151
185
|
},
|
|
152
186
|
"react-native-builder-bob": {
|
|
@@ -163,4 +197,4 @@
|
|
|
163
197
|
"react-native-gesture-handler": "^2.20.2",
|
|
164
198
|
"react-native-reanimated": "^3.16.1"
|
|
165
199
|
}
|
|
166
|
-
}
|
|
200
|
+
}
|
package/src/core/OxyServices.ts
CHANGED
|
@@ -121,18 +121,10 @@ export class OxyAuthenticationTimeoutError extends OxyAuthenticationError {
|
|
|
121
121
|
*/
|
|
122
122
|
// Centralized token store
|
|
123
123
|
class TokenStore {
|
|
124
|
-
private static instance: TokenStore;
|
|
125
124
|
private accessToken: string | null = null;
|
|
126
125
|
private refreshToken: string | null = null;
|
|
127
126
|
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
static getInstance(): TokenStore {
|
|
131
|
-
if (!TokenStore.instance) {
|
|
132
|
-
TokenStore.instance = new TokenStore();
|
|
133
|
-
}
|
|
134
|
-
return TokenStore.instance;
|
|
135
|
-
}
|
|
127
|
+
constructor() {}
|
|
136
128
|
|
|
137
129
|
setTokens(accessToken: string, refreshToken = ''): void {
|
|
138
130
|
this.accessToken = accessToken;
|
|
@@ -177,9 +169,8 @@ export class OxyServices {
|
|
|
177
169
|
baseURL: config.baseURL,
|
|
178
170
|
timeout: 10000 // 10 second timeout
|
|
179
171
|
});
|
|
180
|
-
this.cloudURL = config.cloudURL ||
|
|
181
|
-
this.
|
|
182
|
-
this.tokenStore = TokenStore.getInstance();
|
|
172
|
+
this.cloudURL = config.cloudURL || OXY_CLOUD_URL;
|
|
173
|
+
this.tokenStore = new TokenStore();
|
|
183
174
|
this.setupInterceptors();
|
|
184
175
|
}
|
|
185
176
|
|
|
@@ -453,8 +444,13 @@ export class OxyServices {
|
|
|
453
444
|
/**
|
|
454
445
|
* Centralized error handling
|
|
455
446
|
*/
|
|
456
|
-
protected handleError(error: any):
|
|
457
|
-
|
|
447
|
+
protected handleError(error: any): Error {
|
|
448
|
+
const api = handleHttpError(error);
|
|
449
|
+
const err = new Error(api.message) as Error & { code?: string; status?: number; details?: Record<string, unknown> };
|
|
450
|
+
err.code = api.code;
|
|
451
|
+
err.status = api.status;
|
|
452
|
+
err.details = api.details as any;
|
|
453
|
+
return err;
|
|
458
454
|
}
|
|
459
455
|
|
|
460
456
|
/**
|
|
@@ -488,16 +484,90 @@ export class OxyServices {
|
|
|
488
484
|
email,
|
|
489
485
|
password
|
|
490
486
|
});
|
|
487
|
+
if (!res || !res.data || (typeof res.data === 'object' && Object.keys(res.data).length === 0)) {
|
|
488
|
+
throw new OxyAuthenticationError('Sign up failed', 'SIGNUP_FAILED', 400);
|
|
489
|
+
}
|
|
491
490
|
return res.data;
|
|
492
491
|
} catch (error) {
|
|
493
492
|
throw this.handleError(error);
|
|
494
493
|
}
|
|
495
494
|
}
|
|
496
495
|
|
|
496
|
+
/**
|
|
497
|
+
* Request account recovery (send verification code)
|
|
498
|
+
*/
|
|
499
|
+
async requestRecovery(identifier: string): Promise<{ delivery?: string; destination?: string }> {
|
|
500
|
+
try {
|
|
501
|
+
const res = await this.client.post('/api/auth/recover/request', { identifier });
|
|
502
|
+
return res.data;
|
|
503
|
+
} catch (error: any) {
|
|
504
|
+
throw this.handleError(error);
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
/**
|
|
509
|
+
* Verify recovery code
|
|
510
|
+
*/
|
|
511
|
+
async verifyRecoveryCode(identifier: string, code: string): Promise<{ verified: boolean }> {
|
|
512
|
+
try {
|
|
513
|
+
const res = await this.client.post('/api/auth/recover/verify', { identifier, code });
|
|
514
|
+
return res.data;
|
|
515
|
+
} catch (error: any) {
|
|
516
|
+
throw this.handleError(error);
|
|
517
|
+
}
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
/**
|
|
521
|
+
* Reset password using verified code
|
|
522
|
+
*/
|
|
523
|
+
async resetPassword(identifier: string, code: string, newPassword: string): Promise<{ success: boolean }> {
|
|
524
|
+
try {
|
|
525
|
+
const res = await this.client.post('/api/auth/recover/reset', { identifier, code, newPassword });
|
|
526
|
+
return res.data;
|
|
527
|
+
} catch (error: any) {
|
|
528
|
+
throw this.handleError(error);
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
/**
|
|
533
|
+
* Reset password using TOTP code (recommended recovery)
|
|
534
|
+
*/
|
|
535
|
+
async resetPasswordWithTotp(identifier: string, code: string, newPassword: string): Promise<{ success: boolean }> {
|
|
536
|
+
try {
|
|
537
|
+
const res = await this.client.post('/api/auth/recover/totp/reset', { identifier, code, newPassword });
|
|
538
|
+
return res.data;
|
|
539
|
+
} catch (error: any) {
|
|
540
|
+
throw this.handleError(error);
|
|
541
|
+
}
|
|
542
|
+
}
|
|
543
|
+
|
|
544
|
+
async resetPasswordWithBackupCode(identifier: string, backupCode: string, newPassword: string): Promise<{ success: boolean }> {
|
|
545
|
+
try {
|
|
546
|
+
const res = await this.client.post('/api/auth/recover/backup/reset', { identifier, backupCode, newPassword });
|
|
547
|
+
return res.data;
|
|
548
|
+
} catch (error: any) {
|
|
549
|
+
throw this.handleError(error);
|
|
550
|
+
}
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
async resetPasswordWithRecoveryKey(identifier: string, recoveryKey: string, newPassword: string): Promise<{ success: boolean; nextRecoveryKey?: string }> {
|
|
554
|
+
try {
|
|
555
|
+
const res = await this.client.post('/api/auth/recover/recovery-key/reset', { identifier, recoveryKey, newPassword });
|
|
556
|
+
return res.data;
|
|
557
|
+
} catch (error: any) {
|
|
558
|
+
throw this.handleError(error);
|
|
559
|
+
}
|
|
560
|
+
}
|
|
561
|
+
|
|
497
562
|
/**
|
|
498
563
|
* Sign in with device management
|
|
499
564
|
*/
|
|
500
|
-
async signIn(
|
|
565
|
+
async signIn(
|
|
566
|
+
username: string,
|
|
567
|
+
password: string,
|
|
568
|
+
deviceName?: string,
|
|
569
|
+
deviceFingerprint?: any
|
|
570
|
+
): Promise<SessionLoginResponse | { mfaRequired: true; mfaToken: string; expiresAt: string }> {
|
|
501
571
|
try {
|
|
502
572
|
const res = await this.client.post('/api/auth/login', {
|
|
503
573
|
username,
|
|
@@ -511,6 +581,18 @@ export class OxyServices {
|
|
|
511
581
|
}
|
|
512
582
|
}
|
|
513
583
|
|
|
584
|
+
/**
|
|
585
|
+
* Complete login by verifying TOTP with MFA token
|
|
586
|
+
*/
|
|
587
|
+
async verifyTotpLogin(mfaToken: string, code: string): Promise<SessionLoginResponse> {
|
|
588
|
+
try {
|
|
589
|
+
const res = await this.client.post('/api/auth/totp/verify-login', { mfaToken, code });
|
|
590
|
+
return res.data;
|
|
591
|
+
} catch (error) {
|
|
592
|
+
throw this.handleError(error);
|
|
593
|
+
}
|
|
594
|
+
}
|
|
595
|
+
|
|
514
596
|
/**
|
|
515
597
|
* Get user by session ID
|
|
516
598
|
*/
|
|
@@ -657,6 +739,43 @@ export class OxyServices {
|
|
|
657
739
|
}
|
|
658
740
|
}
|
|
659
741
|
|
|
742
|
+
// ============================================================================
|
|
743
|
+
// TOTP ENROLLMENT
|
|
744
|
+
// ============================================================================
|
|
745
|
+
|
|
746
|
+
async startTotpEnrollment(sessionId: string): Promise<{ secret: string; otpauthUrl: string; issuer: string; label: string }> {
|
|
747
|
+
try {
|
|
748
|
+
const res = await this.client.post('/api/auth/totp/enroll/start', { sessionId }, {
|
|
749
|
+
headers: { 'x-session-id': sessionId }
|
|
750
|
+
});
|
|
751
|
+
return res.data;
|
|
752
|
+
} catch (error) {
|
|
753
|
+
throw this.handleError(error);
|
|
754
|
+
}
|
|
755
|
+
}
|
|
756
|
+
|
|
757
|
+
async verifyTotpEnrollment(sessionId: string, code: string): Promise<{ enabled: boolean; backupCodes?: string[]; recoveryKey?: string }> {
|
|
758
|
+
try {
|
|
759
|
+
const res = await this.client.post('/api/auth/totp/enroll/verify', { sessionId, code }, {
|
|
760
|
+
headers: { 'x-session-id': sessionId }
|
|
761
|
+
});
|
|
762
|
+
return res.data;
|
|
763
|
+
} catch (error) {
|
|
764
|
+
throw this.handleError(error);
|
|
765
|
+
}
|
|
766
|
+
}
|
|
767
|
+
|
|
768
|
+
async disableTotp(sessionId: string, code: string): Promise<{ disabled: boolean }> {
|
|
769
|
+
try {
|
|
770
|
+
const res = await this.client.post('/api/auth/totp/disable', { sessionId, code }, {
|
|
771
|
+
headers: { 'x-session-id': sessionId }
|
|
772
|
+
});
|
|
773
|
+
return res.data;
|
|
774
|
+
} catch (error) {
|
|
775
|
+
throw this.handleError(error);
|
|
776
|
+
}
|
|
777
|
+
}
|
|
778
|
+
|
|
660
779
|
/**
|
|
661
780
|
* Search user profiles
|
|
662
781
|
*/
|
|
@@ -1631,14 +1750,14 @@ export class OxyServices {
|
|
|
1631
1750
|
|
|
1632
1751
|
next();
|
|
1633
1752
|
} catch (error) {
|
|
1634
|
-
const apiError = this.handleError(error);
|
|
1753
|
+
const apiError = this.handleError(error) as any;
|
|
1635
1754
|
|
|
1636
1755
|
if (debug) {
|
|
1637
1756
|
console.log(`❌ Auth: Unexpected error:`, apiError);
|
|
1638
1757
|
}
|
|
1639
1758
|
|
|
1640
1759
|
if (onError) return onError(apiError);
|
|
1641
|
-
return res.status(apiError.status || 500).json(apiError);
|
|
1760
|
+
return res.status((apiError && apiError.status) || 500).json(apiError);
|
|
1642
1761
|
}
|
|
1643
1762
|
};
|
|
1644
1763
|
}
|
|
@@ -1647,7 +1766,7 @@ export class OxyServices {
|
|
|
1647
1766
|
/**
|
|
1648
1767
|
* Export the default Oxy Cloud URL (for backward compatibility)
|
|
1649
1768
|
*/
|
|
1650
|
-
export const OXY_CLOUD_URL = 'https://cloud.
|
|
1769
|
+
export const OXY_CLOUD_URL = 'https://cloud.oxyhq.com';
|
|
1651
1770
|
|
|
1652
1771
|
/**
|
|
1653
1772
|
* Export the default Oxy API URL (for documentation)
|
|
@@ -1658,4 +1777,4 @@ export const OXY_API_URL = 'https://api.oxy.so';
|
|
|
1658
1777
|
* Pre-configured client instance for easy import
|
|
1659
1778
|
* Uses OXY_API_URL as baseURL and OXY_CLOUD_URL as cloudURL
|
|
1660
1779
|
*/
|
|
1661
|
-
export const oxyClient = new OxyServices({ baseURL: OXY_API_URL, cloudURL: OXY_CLOUD_URL });
|
|
1780
|
+
export const oxyClient = new OxyServices({ baseURL: OXY_API_URL, cloudURL: OXY_CLOUD_URL });
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
// Use JSON locale files (RN Metro supports static requires reliably)
|
|
2
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
3
|
+
const enUS = require('./locales/en-US.json') as Record<string, any>;
|
|
4
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
5
|
+
const esES = require('./locales/es-ES.json') as Record<string, any>;
|
|
6
|
+
|
|
7
|
+
export type LocaleDict = Record<string, any>;
|
|
8
|
+
|
|
9
|
+
const DICTS: Record<string, LocaleDict> = {
|
|
10
|
+
'en': enUS as LocaleDict,
|
|
11
|
+
'en-US': enUS as LocaleDict,
|
|
12
|
+
'es': esES as LocaleDict,
|
|
13
|
+
'es-ES': esES as LocaleDict,
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
const FALLBACK = 'en-US';
|
|
17
|
+
|
|
18
|
+
function getNested(obj: any, path: string): any {
|
|
19
|
+
return path.split('.').reduce((acc, key) => (acc && acc[key] != null ? acc[key] : undefined), obj);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export function translate(locale: string | undefined, key: string, vars?: Record<string, string | number>): string {
|
|
23
|
+
const lang = locale && DICTS[locale] ? locale : FALLBACK;
|
|
24
|
+
const dict = DICTS[lang] || DICTS[FALLBACK];
|
|
25
|
+
let val = getNested(dict, key);
|
|
26
|
+
if (typeof val !== 'string') return key; // fallback to key if missing
|
|
27
|
+
if (vars) {
|
|
28
|
+
Object.keys(vars).forEach(k => {
|
|
29
|
+
const token = `{{${k}}}`;
|
|
30
|
+
val = val.replaceAll(token, String(vars[k]));
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
return val;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export function hasKey(locale: string | undefined, key: string): boolean {
|
|
37
|
+
const lang = locale && DICTS[locale] ? locale : FALLBACK;
|
|
38
|
+
return getNested(DICTS[lang], key) != null || getNested(DICTS[FALLBACK], key) != null;
|
|
39
|
+
}
|