@oxyhq/services 5.21.6 → 5.22.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 +201 -2
- package/lib/commonjs/assets/assets/fonts/Inter/Inter_18pt-Black.ttf +0 -0
- package/lib/commonjs/assets/assets/fonts/Inter/Inter_18pt-Bold.ttf +0 -0
- package/lib/commonjs/assets/assets/fonts/Inter/Inter_18pt-ExtraBold.ttf +0 -0
- package/lib/commonjs/assets/assets/fonts/Inter/Inter_18pt-Light.ttf +0 -0
- package/lib/commonjs/assets/assets/fonts/Inter/Inter_18pt-Medium.ttf +0 -0
- package/lib/commonjs/assets/assets/fonts/Inter/Inter_18pt-Regular.ttf +0 -0
- package/lib/commonjs/assets/assets/fonts/Inter/Inter_18pt-SemiBold.ttf +0 -0
- package/lib/commonjs/assets/fonts/Inter/Inter_18pt-Black.ttf +0 -0
- package/lib/commonjs/assets/fonts/Inter/Inter_18pt-Bold.ttf +0 -0
- package/lib/commonjs/assets/fonts/Inter/Inter_18pt-ExtraBold.ttf +0 -0
- package/lib/commonjs/assets/fonts/Inter/Inter_18pt-Light.ttf +0 -0
- package/lib/commonjs/assets/fonts/Inter/Inter_18pt-Medium.ttf +0 -0
- package/lib/commonjs/assets/fonts/Inter/Inter_18pt-Regular.ttf +0 -0
- package/lib/commonjs/assets/fonts/Inter/Inter_18pt-SemiBold.ttf +0 -0
- package/lib/commonjs/core/HttpService.js +87 -2
- package/lib/commonjs/core/HttpService.js.map +1 -1
- package/lib/commonjs/core/mixins/OxyServices.assets.js +3 -1
- package/lib/commonjs/core/mixins/OxyServices.assets.js.map +1 -1
- package/lib/commonjs/crypto/keyManager.js +67 -22
- package/lib/commonjs/crypto/keyManager.js.map +1 -1
- package/lib/commonjs/i18n/locales/en-US.json +3 -3
- package/lib/commonjs/i18n/locales/es-ES.json +240 -19
- package/lib/commonjs/index.js +66 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/ui/components/Avatar.js +1 -1
- package/lib/commonjs/ui/components/Avatar.js.map +1 -1
- package/lib/commonjs/ui/components/FollowButton.js +1 -1
- package/lib/commonjs/ui/components/FollowButton.js.map +1 -1
- package/lib/commonjs/ui/components/FontLoader.js +34 -34
- package/lib/commonjs/ui/components/FontLoader.js.map +1 -1
- package/lib/commonjs/ui/components/Header.js +4 -4
- package/lib/commonjs/ui/components/Header.js.map +1 -1
- package/lib/commonjs/ui/components/OxyPayButton.js +1 -1
- package/lib/commonjs/ui/components/OxyPayButton.js.map +1 -1
- package/lib/commonjs/ui/components/OxySignInButton.js +2 -1
- package/lib/commonjs/ui/components/OxySignInButton.js.map +1 -1
- package/lib/commonjs/ui/components/ProfileCard.js +1 -1
- package/lib/commonjs/ui/components/ProfileCard.js.map +1 -1
- package/lib/commonjs/ui/components/SectionTitle.js +1 -1
- package/lib/commonjs/ui/components/SectionTitle.js.map +1 -1
- package/lib/commonjs/ui/components/StepBasedScreen.js +2 -1
- package/lib/commonjs/ui/components/StepBasedScreen.js.map +1 -1
- package/lib/commonjs/ui/components/feedback/feedbackStyles.js +2 -1
- package/lib/commonjs/ui/components/feedback/feedbackStyles.js.map +1 -1
- package/lib/commonjs/ui/components/fileManagement/AnimatedButton.js +57 -0
- package/lib/commonjs/ui/components/fileManagement/AnimatedButton.js.map +1 -0
- package/lib/commonjs/ui/components/fileManagement/styles.js +17 -17
- package/lib/commonjs/ui/components/fileManagement/styles.js.map +1 -1
- package/lib/commonjs/ui/components/payment/paymentStyles.js +7 -7
- package/lib/commonjs/ui/components/payment/paymentStyles.js.map +1 -1
- package/lib/commonjs/ui/hooks/mutations/mutationFactory.js +177 -0
- package/lib/commonjs/ui/hooks/mutations/mutationFactory.js.map +1 -0
- package/lib/commonjs/ui/hooks/mutations/useAccountMutations.js +10 -123
- package/lib/commonjs/ui/hooks/mutations/useAccountMutations.js.map +1 -1
- package/lib/commonjs/ui/hooks/queries/useAccountQueries.js +2 -32
- package/lib/commonjs/ui/hooks/queries/useAccountQueries.js.map +1 -1
- package/lib/commonjs/ui/hooks/queries/useServicesQueries.js +2 -31
- package/lib/commonjs/ui/hooks/queries/useServicesQueries.js.map +1 -1
- package/lib/commonjs/ui/hooks/useFileFiltering.js +76 -0
- package/lib/commonjs/ui/hooks/useFileFiltering.js.map +1 -0
- package/lib/commonjs/ui/navigation/routes.js +2 -0
- package/lib/commonjs/ui/navigation/routes.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountCenterScreen.js +4 -2
- package/lib/commonjs/ui/screens/AccountCenterScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountOverviewScreen.js +13 -5
- package/lib/commonjs/ui/screens/AccountOverviewScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountSettingsScreen.js +273 -1820
- package/lib/commonjs/ui/screens/AccountSettingsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountSwitcherScreen.js +1 -1
- package/lib/commonjs/ui/screens/AccountSwitcherScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountVerificationScreen.js +3 -1
- package/lib/commonjs/ui/screens/AccountVerificationScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AppInfoScreen.js +2 -2
- package/lib/commonjs/ui/screens/AppInfoScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/EditProfileFieldScreen.js +640 -0
- package/lib/commonjs/ui/screens/EditProfileFieldScreen.js.map +1 -0
- package/lib/commonjs/ui/screens/FileManagementScreen.js +41 -23
- package/lib/commonjs/ui/screens/FileManagementScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/HistoryViewScreen.js +9 -3
- package/lib/commonjs/ui/screens/HistoryViewScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/LanguageSelectorScreen.js +4 -2
- package/lib/commonjs/ui/screens/LanguageSelectorScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/LegalDocumentsScreen.js +3 -1
- package/lib/commonjs/ui/screens/LegalDocumentsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/PremiumSubscriptionScreen.js +11 -12
- package/lib/commonjs/ui/screens/PremiumSubscriptionScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/PrivacySettingsScreen.js +12 -4
- package/lib/commonjs/ui/screens/PrivacySettingsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/SearchSettingsScreen.js +3 -1
- package/lib/commonjs/ui/screens/SearchSettingsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/SessionManagementScreen.js +15 -5
- package/lib/commonjs/ui/screens/SessionManagementScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/UserLinksScreen.js +3 -1
- package/lib/commonjs/ui/screens/UserLinksScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/WelcomeNewUserScreen.js +2 -1
- package/lib/commonjs/ui/screens/WelcomeNewUserScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/karma/KarmaAboutScreen.js +2 -4
- package/lib/commonjs/ui/screens/karma/KarmaAboutScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/karma/KarmaCenterScreen.js +3 -3
- package/lib/commonjs/ui/screens/karma/KarmaCenterScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/karma/KarmaRewardsScreen.js +3 -3
- package/lib/commonjs/ui/screens/karma/KarmaRewardsScreen.js.map +1 -1
- package/lib/commonjs/ui/styles/authStyles.js +5 -4
- package/lib/commonjs/ui/styles/authStyles.js.map +1 -1
- package/lib/commonjs/ui/styles/fonts.js +27 -27
- package/lib/commonjs/ui/styles/fonts.js.map +1 -1
- package/lib/commonjs/ui/styles/theme.js +3 -3
- package/lib/commonjs/ui/styles/theme.js.map +1 -1
- package/lib/commonjs/ui/utils/authHelpers.js +164 -0
- package/lib/commonjs/ui/utils/authHelpers.js.map +1 -0
- package/lib/commonjs/ui/utils/avatarUtils.js +18 -61
- package/lib/commonjs/ui/utils/avatarUtils.js.map +1 -1
- package/lib/commonjs/web.js +682 -0
- package/lib/commonjs/web.js.map +1 -0
- package/lib/module/assets/assets/fonts/Inter/Inter_18pt-Black.ttf +0 -0
- package/lib/module/assets/assets/fonts/Inter/Inter_18pt-Bold.ttf +0 -0
- package/lib/module/assets/assets/fonts/Inter/Inter_18pt-ExtraBold.ttf +0 -0
- package/lib/module/assets/assets/fonts/Inter/Inter_18pt-Light.ttf +0 -0
- package/lib/module/assets/assets/fonts/Inter/Inter_18pt-Medium.ttf +0 -0
- package/lib/module/assets/assets/fonts/Inter/Inter_18pt-Regular.ttf +0 -0
- package/lib/module/assets/assets/fonts/Inter/Inter_18pt-SemiBold.ttf +0 -0
- package/lib/module/assets/fonts/Inter/Inter_18pt-Black.ttf +0 -0
- package/lib/module/assets/fonts/Inter/Inter_18pt-Bold.ttf +0 -0
- package/lib/module/assets/fonts/Inter/Inter_18pt-ExtraBold.ttf +0 -0
- package/lib/module/assets/fonts/Inter/Inter_18pt-Light.ttf +0 -0
- package/lib/module/assets/fonts/Inter/Inter_18pt-Medium.ttf +0 -0
- package/lib/module/assets/fonts/Inter/Inter_18pt-Regular.ttf +0 -0
- package/lib/module/assets/fonts/Inter/Inter_18pt-SemiBold.ttf +0 -0
- package/lib/module/core/HttpService.js +87 -2
- package/lib/module/core/HttpService.js.map +1 -1
- package/lib/module/core/mixins/OxyServices.assets.js +3 -1
- package/lib/module/core/mixins/OxyServices.assets.js.map +1 -1
- package/lib/module/crypto/keyManager.js +67 -22
- package/lib/module/crypto/keyManager.js.map +1 -1
- package/lib/module/i18n/locales/en-US.json +3 -3
- package/lib/module/i18n/locales/es-ES.json +240 -19
- package/lib/module/index.js +6 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/ui/components/Avatar.js +1 -1
- package/lib/module/ui/components/Avatar.js.map +1 -1
- package/lib/module/ui/components/FollowButton.js +1 -1
- package/lib/module/ui/components/FollowButton.js.map +1 -1
- package/lib/module/ui/components/FontLoader.js +34 -34
- package/lib/module/ui/components/FontLoader.js.map +1 -1
- package/lib/module/ui/components/Header.js +4 -4
- package/lib/module/ui/components/Header.js.map +1 -1
- package/lib/module/ui/components/OxyPayButton.js +1 -1
- package/lib/module/ui/components/OxyPayButton.js.map +1 -1
- package/lib/module/ui/components/OxySignInButton.js +2 -1
- package/lib/module/ui/components/OxySignInButton.js.map +1 -1
- package/lib/module/ui/components/ProfileCard.js +1 -1
- package/lib/module/ui/components/ProfileCard.js.map +1 -1
- package/lib/module/ui/components/SectionTitle.js +1 -1
- package/lib/module/ui/components/SectionTitle.js.map +1 -1
- package/lib/module/ui/components/StepBasedScreen.js +2 -1
- package/lib/module/ui/components/StepBasedScreen.js.map +1 -1
- package/lib/module/ui/components/feedback/feedbackStyles.js +2 -1
- package/lib/module/ui/components/feedback/feedbackStyles.js.map +1 -1
- package/lib/module/ui/components/fileManagement/AnimatedButton.js +50 -0
- package/lib/module/ui/components/fileManagement/AnimatedButton.js.map +1 -0
- package/lib/module/ui/components/fileManagement/styles.js +17 -17
- package/lib/module/ui/components/fileManagement/styles.js.map +1 -1
- package/lib/module/ui/components/payment/paymentStyles.js +7 -7
- package/lib/module/ui/components/payment/paymentStyles.js.map +1 -1
- package/lib/module/ui/hooks/mutations/mutationFactory.js +173 -0
- package/lib/module/ui/hooks/mutations/mutationFactory.js.map +1 -0
- package/lib/module/ui/hooks/mutations/useAccountMutations.js +10 -122
- package/lib/module/ui/hooks/mutations/useAccountMutations.js.map +1 -1
- package/lib/module/ui/hooks/queries/useAccountQueries.js +2 -32
- package/lib/module/ui/hooks/queries/useAccountQueries.js.map +1 -1
- package/lib/module/ui/hooks/queries/useServicesQueries.js +2 -31
- package/lib/module/ui/hooks/queries/useServicesQueries.js.map +1 -1
- package/lib/module/ui/hooks/useFileFiltering.js +72 -0
- package/lib/module/ui/hooks/useFileFiltering.js.map +1 -0
- package/lib/module/ui/navigation/routes.js +2 -0
- package/lib/module/ui/navigation/routes.js.map +1 -1
- package/lib/module/ui/screens/AccountCenterScreen.js +4 -2
- package/lib/module/ui/screens/AccountCenterScreen.js.map +1 -1
- package/lib/module/ui/screens/AccountOverviewScreen.js +13 -5
- package/lib/module/ui/screens/AccountOverviewScreen.js.map +1 -1
- package/lib/module/ui/screens/AccountSettingsScreen.js +277 -1824
- package/lib/module/ui/screens/AccountSettingsScreen.js.map +1 -1
- package/lib/module/ui/screens/AccountSwitcherScreen.js +1 -1
- package/lib/module/ui/screens/AccountSwitcherScreen.js.map +1 -1
- package/lib/module/ui/screens/AccountVerificationScreen.js +3 -1
- package/lib/module/ui/screens/AccountVerificationScreen.js.map +1 -1
- package/lib/module/ui/screens/AppInfoScreen.js +2 -2
- package/lib/module/ui/screens/AppInfoScreen.js.map +1 -1
- package/lib/module/ui/screens/EditProfileFieldScreen.js +635 -0
- package/lib/module/ui/screens/EditProfileFieldScreen.js.map +1 -0
- package/lib/module/ui/screens/FileManagementScreen.js +41 -23
- package/lib/module/ui/screens/FileManagementScreen.js.map +1 -1
- package/lib/module/ui/screens/HistoryViewScreen.js +9 -3
- package/lib/module/ui/screens/HistoryViewScreen.js.map +1 -1
- package/lib/module/ui/screens/LanguageSelectorScreen.js +4 -2
- package/lib/module/ui/screens/LanguageSelectorScreen.js.map +1 -1
- package/lib/module/ui/screens/LegalDocumentsScreen.js +3 -1
- package/lib/module/ui/screens/LegalDocumentsScreen.js.map +1 -1
- package/lib/module/ui/screens/PremiumSubscriptionScreen.js +11 -12
- package/lib/module/ui/screens/PremiumSubscriptionScreen.js.map +1 -1
- package/lib/module/ui/screens/PrivacySettingsScreen.js +12 -4
- package/lib/module/ui/screens/PrivacySettingsScreen.js.map +1 -1
- package/lib/module/ui/screens/SearchSettingsScreen.js +3 -1
- package/lib/module/ui/screens/SearchSettingsScreen.js.map +1 -1
- package/lib/module/ui/screens/SessionManagementScreen.js +15 -5
- package/lib/module/ui/screens/SessionManagementScreen.js.map +1 -1
- package/lib/module/ui/screens/UserLinksScreen.js +3 -1
- package/lib/module/ui/screens/UserLinksScreen.js.map +1 -1
- package/lib/module/ui/screens/WelcomeNewUserScreen.js +2 -1
- package/lib/module/ui/screens/WelcomeNewUserScreen.js.map +1 -1
- package/lib/module/ui/screens/karma/KarmaAboutScreen.js +2 -4
- package/lib/module/ui/screens/karma/KarmaAboutScreen.js.map +1 -1
- package/lib/module/ui/screens/karma/KarmaCenterScreen.js +3 -3
- package/lib/module/ui/screens/karma/KarmaCenterScreen.js.map +1 -1
- package/lib/module/ui/screens/karma/KarmaRewardsScreen.js +3 -3
- package/lib/module/ui/screens/karma/KarmaRewardsScreen.js.map +1 -1
- package/lib/module/ui/styles/authStyles.js +5 -4
- package/lib/module/ui/styles/authStyles.js.map +1 -1
- package/lib/module/ui/styles/fonts.js +27 -27
- package/lib/module/ui/styles/fonts.js.map +1 -1
- package/lib/module/ui/styles/theme.js +3 -3
- package/lib/module/ui/styles/theme.js.map +1 -1
- package/lib/module/ui/utils/authHelpers.js +154 -0
- package/lib/module/ui/utils/authHelpers.js.map +1 -0
- package/lib/module/ui/utils/avatarUtils.js +18 -61
- package/lib/module/ui/utils/avatarUtils.js.map +1 -1
- package/lib/module/web.js +75 -0
- package/lib/module/web.js.map +1 -0
- package/lib/typescript/commonjs/core/HttpService.d.ts +5 -0
- package/lib/typescript/commonjs/core/HttpService.d.ts.map +1 -1
- package/lib/typescript/commonjs/crypto/keyManager.d.ts.map +1 -1
- package/lib/typescript/commonjs/index.d.ts +6 -0
- package/lib/typescript/commonjs/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/OxySignInButton.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/StepBasedScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/feedback/feedbackStyles.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/fileManagement/AnimatedButton.d.ts +16 -0
- package/lib/typescript/commonjs/ui/components/fileManagement/AnimatedButton.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/hooks/mutations/mutationFactory.d.ts +76 -0
- package/lib/typescript/commonjs/ui/hooks/mutations/mutationFactory.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/hooks/mutations/useAccountMutations.d.ts +29 -4
- package/lib/typescript/commonjs/ui/hooks/mutations/useAccountMutations.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/queries/useAccountQueries.d.ts +1 -1
- package/lib/typescript/commonjs/ui/hooks/queries/useAccountQueries.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/queries/useServicesQueries.d.ts +1 -1
- package/lib/typescript/commonjs/ui/hooks/queries/useServicesQueries.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/useFileFiltering.d.ts +29 -0
- package/lib/typescript/commonjs/ui/hooks/useFileFiltering.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/navigation/routes.d.ts +1 -1
- package/lib/typescript/commonjs/ui/navigation/routes.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/AccountCenterScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/AccountOverviewScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/AccountSettingsScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/AccountVerificationScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/EditProfileFieldScreen.d.ts +13 -0
- package/lib/typescript/commonjs/ui/screens/EditProfileFieldScreen.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/screens/FileManagementScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/HistoryViewScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/LanguageSelectorScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/LegalDocumentsScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/PremiumSubscriptionScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/PrivacySettingsScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/SearchSettingsScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/SessionManagementScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/UserLinksScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/WelcomeNewUserScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/karma/KarmaAboutScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/styles/fonts.d.ts +7 -7
- package/lib/typescript/commonjs/ui/styles/theme.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/utils/authHelpers.d.ts +99 -0
- package/lib/typescript/commonjs/ui/utils/authHelpers.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/utils/avatarUtils.d.ts.map +1 -1
- package/lib/typescript/commonjs/web.d.ts +54 -0
- package/lib/typescript/commonjs/web.d.ts.map +1 -0
- package/lib/typescript/module/core/HttpService.d.ts +5 -0
- package/lib/typescript/module/core/HttpService.d.ts.map +1 -1
- package/lib/typescript/module/crypto/keyManager.d.ts.map +1 -1
- package/lib/typescript/module/index.d.ts +6 -0
- package/lib/typescript/module/index.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/OxySignInButton.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/StepBasedScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/feedback/feedbackStyles.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/fileManagement/AnimatedButton.d.ts +16 -0
- package/lib/typescript/module/ui/components/fileManagement/AnimatedButton.d.ts.map +1 -0
- package/lib/typescript/module/ui/hooks/mutations/mutationFactory.d.ts +76 -0
- package/lib/typescript/module/ui/hooks/mutations/mutationFactory.d.ts.map +1 -0
- package/lib/typescript/module/ui/hooks/mutations/useAccountMutations.d.ts +29 -4
- package/lib/typescript/module/ui/hooks/mutations/useAccountMutations.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/queries/useAccountQueries.d.ts +1 -1
- package/lib/typescript/module/ui/hooks/queries/useAccountQueries.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/queries/useServicesQueries.d.ts +1 -1
- package/lib/typescript/module/ui/hooks/queries/useServicesQueries.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/useFileFiltering.d.ts +29 -0
- package/lib/typescript/module/ui/hooks/useFileFiltering.d.ts.map +1 -0
- package/lib/typescript/module/ui/navigation/routes.d.ts +1 -1
- package/lib/typescript/module/ui/navigation/routes.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/AccountCenterScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/AccountOverviewScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/AccountSettingsScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/AccountVerificationScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/EditProfileFieldScreen.d.ts +13 -0
- package/lib/typescript/module/ui/screens/EditProfileFieldScreen.d.ts.map +1 -0
- package/lib/typescript/module/ui/screens/FileManagementScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/HistoryViewScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/LanguageSelectorScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/LegalDocumentsScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/PremiumSubscriptionScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/PrivacySettingsScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/SearchSettingsScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/SessionManagementScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/UserLinksScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/WelcomeNewUserScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/karma/KarmaAboutScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/styles/fonts.d.ts +7 -7
- package/lib/typescript/module/ui/styles/theme.d.ts.map +1 -1
- package/lib/typescript/module/ui/utils/authHelpers.d.ts +99 -0
- package/lib/typescript/module/ui/utils/authHelpers.d.ts.map +1 -0
- package/lib/typescript/module/ui/utils/avatarUtils.d.ts.map +1 -1
- package/lib/typescript/module/web.d.ts +54 -0
- package/lib/typescript/module/web.d.ts.map +1 -0
- package/package.json +27 -41
- package/src/assets/fonts/Inter/Inter_18pt-Black.ttf +0 -0
- package/src/assets/fonts/Inter/Inter_18pt-Bold.ttf +0 -0
- package/src/assets/fonts/Inter/Inter_18pt-ExtraBold.ttf +0 -0
- package/src/assets/fonts/Inter/Inter_18pt-Light.ttf +0 -0
- package/src/assets/fonts/Inter/Inter_18pt-Medium.ttf +0 -0
- package/src/assets/fonts/Inter/Inter_18pt-Regular.ttf +0 -0
- package/src/assets/fonts/Inter/Inter_18pt-SemiBold.ttf +0 -0
- package/src/core/HttpService.ts +91 -0
- package/src/core/mixins/OxyServices.assets.ts +1 -1
- package/src/crypto/keyManager.ts +23 -22
- package/src/i18n/locales/en-US.json +3 -3
- package/src/i18n/locales/es-ES.json +240 -19
- package/src/index.ts +25 -0
- package/src/ui/components/Avatar.tsx +1 -1
- package/src/ui/components/FollowButton.tsx +1 -1
- package/src/ui/components/FontLoader.tsx +34 -34
- package/src/ui/components/Header.tsx +4 -4
- package/src/ui/components/OxyPayButton.tsx +1 -1
- package/src/ui/components/OxySignInButton.tsx +2 -1
- package/src/ui/components/ProfileCard.tsx +1 -1
- package/src/ui/components/SectionTitle.tsx +1 -1
- package/src/ui/components/StepBasedScreen.tsx +2 -1
- package/src/ui/components/feedback/feedbackStyles.ts +2 -1
- package/src/ui/components/fileManagement/AnimatedButton.tsx +56 -0
- package/src/ui/components/fileManagement/styles.ts +17 -17
- package/src/ui/components/payment/paymentStyles.ts +7 -7
- package/src/ui/hooks/mutations/mutationFactory.ts +215 -0
- package/src/ui/hooks/mutations/useAccountMutations.ts +48 -136
- package/src/ui/hooks/queries/useAccountQueries.ts +6 -33
- package/src/ui/hooks/queries/useServicesQueries.ts +6 -32
- package/src/ui/hooks/useFileFiltering.ts +115 -0
- package/src/ui/navigation/routes.ts +3 -0
- package/src/ui/screens/AccountCenterScreen.tsx +4 -2
- package/src/ui/screens/AccountOverviewScreen.tsx +13 -5
- package/src/ui/screens/AccountSettingsScreen.tsx +35 -1511
- package/src/ui/screens/AccountSwitcherScreen.tsx +1 -1
- package/src/ui/screens/AccountVerificationScreen.tsx +3 -1
- package/src/ui/screens/AppInfoScreen.tsx +2 -2
- package/src/ui/screens/EditProfileFieldScreen.tsx +685 -0
- package/src/ui/screens/FileManagementScreen.tsx +35 -17
- package/src/ui/screens/HistoryViewScreen.tsx +9 -3
- package/src/ui/screens/LanguageSelectorScreen.tsx +4 -2
- package/src/ui/screens/LegalDocumentsScreen.tsx +3 -1
- package/src/ui/screens/PremiumSubscriptionScreen.tsx +11 -13
- package/src/ui/screens/PrivacySettingsScreen.tsx +12 -4
- package/src/ui/screens/SearchSettingsScreen.tsx +3 -1
- package/src/ui/screens/SessionManagementScreen.tsx +15 -5
- package/src/ui/screens/UserLinksScreen.tsx +3 -1
- package/src/ui/screens/WelcomeNewUserScreen.tsx +2 -1
- package/src/ui/screens/karma/KarmaAboutScreen.tsx +6 -8
- package/src/ui/screens/karma/KarmaCenterScreen.tsx +3 -3
- package/src/ui/screens/karma/KarmaRewardsScreen.tsx +3 -3
- package/src/ui/styles/authStyles.ts +4 -4
- package/src/ui/styles/fonts.ts +26 -26
- package/src/ui/styles/theme.ts +3 -5
- package/src/ui/utils/authHelpers.ts +183 -0
- package/src/ui/utils/avatarUtils.ts +25 -65
- package/src/web.ts +230 -0
- package/lib/commonjs/assets/assets/fonts/Phudu/Phudu-Black.ttf +0 -0
- package/lib/commonjs/assets/assets/fonts/Phudu/Phudu-Bold.ttf +0 -0
- package/lib/commonjs/assets/assets/fonts/Phudu/Phudu-ExtraBold.ttf +0 -0
- package/lib/commonjs/assets/assets/fonts/Phudu/Phudu-Light.ttf +0 -0
- package/lib/commonjs/assets/assets/fonts/Phudu/Phudu-Medium.ttf +0 -0
- package/lib/commonjs/assets/assets/fonts/Phudu/Phudu-Regular.ttf +0 -0
- package/lib/commonjs/assets/assets/fonts/Phudu/Phudu-SemiBold.ttf +0 -0
- package/lib/commonjs/assets/fonts/Phudu/Phudu-Black.ttf +0 -0
- package/lib/commonjs/assets/fonts/Phudu/Phudu-Bold.ttf +0 -0
- package/lib/commonjs/assets/fonts/Phudu/Phudu-ExtraBold.ttf +0 -0
- package/lib/commonjs/assets/fonts/Phudu/Phudu-Light.ttf +0 -0
- package/lib/commonjs/assets/fonts/Phudu/Phudu-Medium.ttf +0 -0
- package/lib/commonjs/assets/fonts/Phudu/Phudu-Regular.ttf +0 -0
- package/lib/commonjs/assets/fonts/Phudu/Phudu-SemiBold.ttf +0 -0
- package/lib/commonjs/ui/components/profile/EditBioModal.js +0 -181
- package/lib/commonjs/ui/components/profile/EditBioModal.js.map +0 -1
- package/lib/commonjs/ui/components/profile/EditDisplayNameModal.js +0 -204
- package/lib/commonjs/ui/components/profile/EditDisplayNameModal.js.map +0 -1
- package/lib/commonjs/ui/components/profile/EditEmailModal.js +0 -184
- package/lib/commonjs/ui/components/profile/EditEmailModal.js.map +0 -1
- package/lib/commonjs/ui/components/profile/EditFieldModal.js +0 -412
- package/lib/commonjs/ui/components/profile/EditFieldModal.js.map +0 -1
- package/lib/commonjs/ui/components/profile/EditLinksModal.js +0 -315
- package/lib/commonjs/ui/components/profile/EditLinksModal.js.map +0 -1
- package/lib/commonjs/ui/components/profile/EditLocationModal.js +0 -273
- package/lib/commonjs/ui/components/profile/EditLocationModal.js.map +0 -1
- package/lib/commonjs/ui/components/profile/EditUsernameModal.js +0 -180
- package/lib/commonjs/ui/components/profile/EditUsernameModal.js.map +0 -1
- package/lib/module/assets/assets/fonts/Phudu/Phudu-Black.ttf +0 -0
- package/lib/module/assets/assets/fonts/Phudu/Phudu-Bold.ttf +0 -0
- package/lib/module/assets/assets/fonts/Phudu/Phudu-ExtraBold.ttf +0 -0
- package/lib/module/assets/assets/fonts/Phudu/Phudu-Light.ttf +0 -0
- package/lib/module/assets/assets/fonts/Phudu/Phudu-Medium.ttf +0 -0
- package/lib/module/assets/assets/fonts/Phudu/Phudu-Regular.ttf +0 -0
- package/lib/module/assets/assets/fonts/Phudu/Phudu-SemiBold.ttf +0 -0
- package/lib/module/assets/fonts/Phudu/Phudu-Black.ttf +0 -0
- package/lib/module/assets/fonts/Phudu/Phudu-Bold.ttf +0 -0
- package/lib/module/assets/fonts/Phudu/Phudu-ExtraBold.ttf +0 -0
- package/lib/module/assets/fonts/Phudu/Phudu-Light.ttf +0 -0
- package/lib/module/assets/fonts/Phudu/Phudu-Medium.ttf +0 -0
- package/lib/module/assets/fonts/Phudu/Phudu-Regular.ttf +0 -0
- package/lib/module/assets/fonts/Phudu/Phudu-SemiBold.ttf +0 -0
- package/lib/module/ui/components/profile/EditBioModal.js +0 -175
- package/lib/module/ui/components/profile/EditBioModal.js.map +0 -1
- package/lib/module/ui/components/profile/EditDisplayNameModal.js +0 -198
- package/lib/module/ui/components/profile/EditDisplayNameModal.js.map +0 -1
- package/lib/module/ui/components/profile/EditEmailModal.js +0 -178
- package/lib/module/ui/components/profile/EditEmailModal.js.map +0 -1
- package/lib/module/ui/components/profile/EditFieldModal.js +0 -406
- package/lib/module/ui/components/profile/EditFieldModal.js.map +0 -1
- package/lib/module/ui/components/profile/EditLinksModal.js +0 -309
- package/lib/module/ui/components/profile/EditLinksModal.js.map +0 -1
- package/lib/module/ui/components/profile/EditLocationModal.js +0 -267
- package/lib/module/ui/components/profile/EditLocationModal.js.map +0 -1
- package/lib/module/ui/components/profile/EditUsernameModal.js +0 -174
- package/lib/module/ui/components/profile/EditUsernameModal.js.map +0 -1
- package/lib/typescript/commonjs/ui/components/profile/EditBioModal.d.ts +0 -11
- package/lib/typescript/commonjs/ui/components/profile/EditBioModal.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/components/profile/EditDisplayNameModal.d.ts +0 -12
- package/lib/typescript/commonjs/ui/components/profile/EditDisplayNameModal.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/components/profile/EditEmailModal.d.ts +0 -11
- package/lib/typescript/commonjs/ui/components/profile/EditEmailModal.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/components/profile/EditFieldModal.d.ts +0 -110
- package/lib/typescript/commonjs/ui/components/profile/EditFieldModal.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/components/profile/EditLinksModal.d.ts +0 -18
- package/lib/typescript/commonjs/ui/components/profile/EditLinksModal.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/components/profile/EditLocationModal.d.ts +0 -20
- package/lib/typescript/commonjs/ui/components/profile/EditLocationModal.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/components/profile/EditUsernameModal.d.ts +0 -11
- package/lib/typescript/commonjs/ui/components/profile/EditUsernameModal.d.ts.map +0 -1
- package/lib/typescript/module/ui/components/profile/EditBioModal.d.ts +0 -11
- package/lib/typescript/module/ui/components/profile/EditBioModal.d.ts.map +0 -1
- package/lib/typescript/module/ui/components/profile/EditDisplayNameModal.d.ts +0 -12
- package/lib/typescript/module/ui/components/profile/EditDisplayNameModal.d.ts.map +0 -1
- package/lib/typescript/module/ui/components/profile/EditEmailModal.d.ts +0 -11
- package/lib/typescript/module/ui/components/profile/EditEmailModal.d.ts.map +0 -1
- package/lib/typescript/module/ui/components/profile/EditFieldModal.d.ts +0 -110
- package/lib/typescript/module/ui/components/profile/EditFieldModal.d.ts.map +0 -1
- package/lib/typescript/module/ui/components/profile/EditLinksModal.d.ts +0 -18
- package/lib/typescript/module/ui/components/profile/EditLinksModal.d.ts.map +0 -1
- package/lib/typescript/module/ui/components/profile/EditLocationModal.d.ts +0 -20
- package/lib/typescript/module/ui/components/profile/EditLocationModal.d.ts.map +0 -1
- package/lib/typescript/module/ui/components/profile/EditUsernameModal.d.ts +0 -11
- package/lib/typescript/module/ui/components/profile/EditUsernameModal.d.ts.map +0 -1
- package/src/assets/fonts/Phudu/Phudu-Black.ttf +0 -0
- package/src/assets/fonts/Phudu/Phudu-Bold.ttf +0 -0
- package/src/assets/fonts/Phudu/Phudu-ExtraBold.ttf +0 -0
- package/src/assets/fonts/Phudu/Phudu-Light.ttf +0 -0
- package/src/assets/fonts/Phudu/Phudu-Medium.ttf +0 -0
- package/src/assets/fonts/Phudu/Phudu-Regular.ttf +0 -0
- package/src/assets/fonts/Phudu/Phudu-SemiBold.ttf +0 -0
- package/src/ui/components/profile/EditBioModal.tsx +0 -184
- package/src/ui/components/profile/EditDisplayNameModal.tsx +0 -203
- package/src/ui/components/profile/EditEmailModal.tsx +0 -188
- package/src/ui/components/profile/EditFieldModal.tsx +0 -465
- package/src/ui/components/profile/EditLinksModal.tsx +0 -316
- package/src/ui/components/profile/EditLocationModal.tsx +0 -278
- package/src/ui/components/profile/EditUsernameModal.tsx +0 -183
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Authentication helper utilities to reduce code duplication across hooks and utilities.
|
|
3
|
+
* These functions handle common token validation and authentication error patterns.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import type { OxyServices } from '../../core';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Error thrown when session sync is required
|
|
10
|
+
*/
|
|
11
|
+
export class SessionSyncRequiredError extends Error {
|
|
12
|
+
constructor(message = 'Session needs to be synced. Please try again.') {
|
|
13
|
+
super(message);
|
|
14
|
+
this.name = 'SessionSyncRequiredError';
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Error thrown when authentication fails
|
|
20
|
+
*/
|
|
21
|
+
export class AuthenticationFailedError extends Error {
|
|
22
|
+
constructor(message = 'Authentication failed. Please sign in again.') {
|
|
23
|
+
super(message);
|
|
24
|
+
this.name = 'AuthenticationFailedError';
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Ensures a valid token exists before making authenticated API calls.
|
|
30
|
+
* If no valid token exists and an active session ID is available,
|
|
31
|
+
* attempts to refresh the token using the session.
|
|
32
|
+
*
|
|
33
|
+
* @param oxyServices - The OxyServices instance
|
|
34
|
+
* @param activeSessionId - The active session ID (if available)
|
|
35
|
+
* @throws {SessionSyncRequiredError} If the session needs to be synced (offline session)
|
|
36
|
+
* @throws {Error} If token refresh fails for other reasons
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* ```ts
|
|
40
|
+
* // In a mutation or query function:
|
|
41
|
+
* await ensureValidToken(oxyServices, activeSessionId);
|
|
42
|
+
* return await oxyServices.updateProfile(updates);
|
|
43
|
+
* ```
|
|
44
|
+
*/
|
|
45
|
+
export async function ensureValidToken(
|
|
46
|
+
oxyServices: OxyServices,
|
|
47
|
+
activeSessionId: string | null | undefined
|
|
48
|
+
): Promise<void> {
|
|
49
|
+
if (oxyServices.hasValidToken() || !activeSessionId) {
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
try {
|
|
54
|
+
await oxyServices.getTokenBySession(activeSessionId);
|
|
55
|
+
} catch (tokenError) {
|
|
56
|
+
const errorMessage = tokenError instanceof Error ? tokenError.message : String(tokenError);
|
|
57
|
+
|
|
58
|
+
if (errorMessage.includes('AUTH_REQUIRED_OFFLINE_SESSION') || errorMessage.includes('offline')) {
|
|
59
|
+
throw new SessionSyncRequiredError();
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
throw tokenError;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Options for handling API authentication errors
|
|
68
|
+
*/
|
|
69
|
+
export interface HandleApiErrorOptions {
|
|
70
|
+
/** Optional callback to attempt session sync and retry */
|
|
71
|
+
syncSession?: () => Promise<unknown>;
|
|
72
|
+
/** The active session ID for retry attempts */
|
|
73
|
+
activeSessionId?: string | null;
|
|
74
|
+
/** The OxyServices instance for retry attempts */
|
|
75
|
+
oxyServices?: OxyServices;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Checks if an error is an authentication error (401 or auth-related message)
|
|
80
|
+
*
|
|
81
|
+
* @param error - The error to check
|
|
82
|
+
* @returns True if the error is an authentication error
|
|
83
|
+
*/
|
|
84
|
+
export function isAuthenticationError(error: unknown): boolean {
|
|
85
|
+
if (!error || typeof error !== 'object') {
|
|
86
|
+
return false;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
const errorObj = error as { message?: string; status?: number; response?: { status?: number } };
|
|
90
|
+
const errorMessage = errorObj.message || '';
|
|
91
|
+
const status = errorObj.status || errorObj.response?.status;
|
|
92
|
+
|
|
93
|
+
return (
|
|
94
|
+
status === 401 ||
|
|
95
|
+
errorMessage.includes('Authentication required') ||
|
|
96
|
+
errorMessage.includes('Invalid or missing authorization header')
|
|
97
|
+
);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Wraps an API call with authentication error handling.
|
|
102
|
+
* If an authentication error occurs, it can optionally attempt to sync the session and retry.
|
|
103
|
+
*
|
|
104
|
+
* @param apiCall - The API call function to execute
|
|
105
|
+
* @param options - Optional error handling configuration
|
|
106
|
+
* @returns The result of the API call
|
|
107
|
+
* @throws {AuthenticationFailedError} If authentication fails and cannot be recovered
|
|
108
|
+
* @throws {Error} If the API call fails for non-auth reasons
|
|
109
|
+
*
|
|
110
|
+
* @example
|
|
111
|
+
* ```ts
|
|
112
|
+
* // Simple usage:
|
|
113
|
+
* const result = await withAuthErrorHandling(
|
|
114
|
+
* () => oxyServices.updateProfile(updates)
|
|
115
|
+
* );
|
|
116
|
+
*
|
|
117
|
+
* // With retry on auth failure:
|
|
118
|
+
* const result = await withAuthErrorHandling(
|
|
119
|
+
* () => oxyServices.updateProfile(updates),
|
|
120
|
+
* { syncSession, activeSessionId, oxyServices }
|
|
121
|
+
* );
|
|
122
|
+
* ```
|
|
123
|
+
*/
|
|
124
|
+
export async function withAuthErrorHandling<T>(
|
|
125
|
+
apiCall: () => Promise<T>,
|
|
126
|
+
options?: HandleApiErrorOptions
|
|
127
|
+
): Promise<T> {
|
|
128
|
+
try {
|
|
129
|
+
return await apiCall();
|
|
130
|
+
} catch (error) {
|
|
131
|
+
if (!isAuthenticationError(error)) {
|
|
132
|
+
throw error;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
// If we have sync capabilities, try to recover
|
|
136
|
+
if (options?.syncSession && options?.activeSessionId && options?.oxyServices) {
|
|
137
|
+
try {
|
|
138
|
+
await options.syncSession();
|
|
139
|
+
await options.oxyServices.getTokenBySession(options.activeSessionId);
|
|
140
|
+
// Retry the API call after refreshing token
|
|
141
|
+
return await apiCall();
|
|
142
|
+
} catch {
|
|
143
|
+
throw new AuthenticationFailedError();
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
throw new AuthenticationFailedError();
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* Combines token validation and auth error handling for a complete authenticated API call.
|
|
153
|
+
* This is the recommended helper for most authenticated API operations.
|
|
154
|
+
*
|
|
155
|
+
* @param oxyServices - The OxyServices instance
|
|
156
|
+
* @param activeSessionId - The active session ID
|
|
157
|
+
* @param apiCall - The API call function to execute
|
|
158
|
+
* @param syncSession - Optional callback to sync session on auth failure
|
|
159
|
+
* @returns The result of the API call
|
|
160
|
+
*
|
|
161
|
+
* @example
|
|
162
|
+
* ```ts
|
|
163
|
+
* return await authenticatedApiCall(
|
|
164
|
+
* oxyServices,
|
|
165
|
+
* activeSessionId,
|
|
166
|
+
* () => oxyServices.updateProfile(updates)
|
|
167
|
+
* );
|
|
168
|
+
* ```
|
|
169
|
+
*/
|
|
170
|
+
export async function authenticatedApiCall<T>(
|
|
171
|
+
oxyServices: OxyServices,
|
|
172
|
+
activeSessionId: string | null | undefined,
|
|
173
|
+
apiCall: () => Promise<T>,
|
|
174
|
+
syncSession?: () => Promise<unknown>
|
|
175
|
+
): Promise<T> {
|
|
176
|
+
await ensureValidToken(oxyServices, activeSessionId);
|
|
177
|
+
|
|
178
|
+
return withAuthErrorHandling(apiCall, {
|
|
179
|
+
syncSession,
|
|
180
|
+
activeSessionId,
|
|
181
|
+
oxyServices,
|
|
182
|
+
});
|
|
183
|
+
}
|
|
@@ -4,6 +4,7 @@ import { useAccountStore } from '../stores/accountStore';
|
|
|
4
4
|
import { useAuthStore } from '../stores/authStore';
|
|
5
5
|
import { QueryClient } from '@tanstack/react-query';
|
|
6
6
|
import { queryKeys, invalidateUserQueries, invalidateAccountQueries } from '../hooks/queries/queryKeys';
|
|
7
|
+
import { authenticatedApiCall } from './authHelpers';
|
|
7
8
|
|
|
8
9
|
/**
|
|
9
10
|
* Updates file visibility to public for avatar use.
|
|
@@ -57,7 +58,7 @@ export function refreshAvatarInStore(
|
|
|
57
58
|
/**
|
|
58
59
|
* Updates user profile with avatar and handles all side effects (query invalidation, accountStore update).
|
|
59
60
|
* This function can be used from within OxyContext provider without requiring useOxy hook.
|
|
60
|
-
*
|
|
61
|
+
*
|
|
61
62
|
* @param updates - Profile updates including avatar
|
|
62
63
|
* @param oxyServices - OxyServices instance
|
|
63
64
|
* @param activeSessionId - Active session ID
|
|
@@ -72,72 +73,31 @@ export async function updateProfileWithAvatar(
|
|
|
72
73
|
queryClient: QueryClient,
|
|
73
74
|
syncSession?: () => Promise<User>
|
|
74
75
|
): Promise<User> {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
} catch (syncError) {
|
|
87
|
-
throw new Error('Session needs to be synced. Please try again.');
|
|
88
|
-
}
|
|
89
|
-
} else {
|
|
90
|
-
throw tokenError;
|
|
91
|
-
}
|
|
92
|
-
} else {
|
|
93
|
-
throw tokenError;
|
|
94
|
-
}
|
|
95
|
-
}
|
|
76
|
+
const data = await authenticatedApiCall<User>(
|
|
77
|
+
oxyServices,
|
|
78
|
+
activeSessionId,
|
|
79
|
+
() => oxyServices.updateProfile(updates),
|
|
80
|
+
syncSession
|
|
81
|
+
);
|
|
82
|
+
|
|
83
|
+
// Update cache with server response
|
|
84
|
+
queryClient.setQueryData(queryKeys.accounts.current(), data);
|
|
85
|
+
if (activeSessionId) {
|
|
86
|
+
queryClient.setQueryData(queryKeys.users.profile(activeSessionId), data);
|
|
96
87
|
}
|
|
97
88
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
queryClient.setQueryData(queryKeys.users.profile(activeSessionId), data);
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
// Update authStore so frontend components see the changes immediately
|
|
108
|
-
useAuthStore.getState().setUser(data);
|
|
109
|
-
|
|
110
|
-
// If avatar was updated, refresh accountStore with cache-busted URL
|
|
111
|
-
if (updates.avatar && activeSessionId) {
|
|
112
|
-
refreshAvatarInStore(activeSessionId, updates.avatar, oxyServices);
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
// Invalidate all related queries to refresh everywhere
|
|
116
|
-
invalidateUserQueries(queryClient);
|
|
117
|
-
invalidateAccountQueries(queryClient);
|
|
118
|
-
|
|
119
|
-
return data;
|
|
120
|
-
} catch (error: any) {
|
|
121
|
-
const errorMessage = error?.message || '';
|
|
122
|
-
const status = error?.status || error?.response?.status;
|
|
123
|
-
|
|
124
|
-
// Handle authentication errors
|
|
125
|
-
if (status === 401 || errorMessage.includes('Authentication required') || errorMessage.includes('Invalid or missing authorization header')) {
|
|
126
|
-
if (activeSessionId && syncSession) {
|
|
127
|
-
try {
|
|
128
|
-
await syncSession();
|
|
129
|
-
await oxyServices.getTokenBySession(activeSessionId);
|
|
130
|
-
// Retry the update after getting token
|
|
131
|
-
return await updateProfileWithAvatar(updates, oxyServices, activeSessionId, queryClient, syncSession);
|
|
132
|
-
} catch (retryError) {
|
|
133
|
-
throw new Error('Authentication failed. Please sign in again.');
|
|
134
|
-
}
|
|
135
|
-
} else {
|
|
136
|
-
throw new Error('No active session. Please sign in.');
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
throw error;
|
|
89
|
+
// Update authStore so frontend components see the changes immediately
|
|
90
|
+
useAuthStore.getState().setUser(data);
|
|
91
|
+
|
|
92
|
+
// If avatar was updated, refresh accountStore with cache-busted URL
|
|
93
|
+
if (updates.avatar && activeSessionId) {
|
|
94
|
+
refreshAvatarInStore(activeSessionId, updates.avatar, oxyServices);
|
|
141
95
|
}
|
|
96
|
+
|
|
97
|
+
// Invalidate all related queries to refresh everywhere
|
|
98
|
+
invalidateUserQueries(queryClient);
|
|
99
|
+
invalidateAccountQueries(queryClient);
|
|
100
|
+
|
|
101
|
+
return data;
|
|
142
102
|
}
|
|
143
103
|
|
package/src/web.ts
ADDED
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OxyHQServices Web Entry Point - Pure React/Next.js Apps
|
|
3
|
+
*
|
|
4
|
+
* This entry point is optimized for pure web applications without Expo or React Native.
|
|
5
|
+
* It excludes all React Native dependencies for a smaller bundle size.
|
|
6
|
+
*
|
|
7
|
+
* Use this for:
|
|
8
|
+
* - Pure React apps (Vite, Create React App)
|
|
9
|
+
* - Next.js apps
|
|
10
|
+
* - Any web-only application
|
|
11
|
+
*
|
|
12
|
+
* For Expo apps (native + web), use the main entry point instead:
|
|
13
|
+
* import { OxyProvider } from '@oxyhq/services';
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
// IMPORTANT: Import crypto module first to ensure polyfills are loaded
|
|
17
|
+
import './crypto/polyfill';
|
|
18
|
+
|
|
19
|
+
// Core exports (no React Native dependencies)
|
|
20
|
+
export { OxyServices, OxyAuthenticationError, OxyAuthenticationTimeoutError } from './core';
|
|
21
|
+
export { OXY_CLOUD_URL, oxyClient } from './core';
|
|
22
|
+
|
|
23
|
+
// Cross-domain authentication (Web SSO via FedCM/popup/redirect)
|
|
24
|
+
export { CrossDomainAuth, createCrossDomainAuth } from './core';
|
|
25
|
+
export type { CrossDomainAuthOptions } from './core';
|
|
26
|
+
|
|
27
|
+
// Crypto/Identity exports
|
|
28
|
+
export {
|
|
29
|
+
KeyManager,
|
|
30
|
+
SignatureService,
|
|
31
|
+
RecoveryPhraseService
|
|
32
|
+
} from './crypto';
|
|
33
|
+
export type {
|
|
34
|
+
KeyPair,
|
|
35
|
+
SignedMessage,
|
|
36
|
+
AuthChallenge,
|
|
37
|
+
RecoveryPhraseResult
|
|
38
|
+
} from './crypto';
|
|
39
|
+
|
|
40
|
+
// React context and auth hooks
|
|
41
|
+
export { useOxy } from './ui/context/OxyContext';
|
|
42
|
+
export { useAuth } from './ui/hooks/useAuth';
|
|
43
|
+
export type { AuthState, AuthActions, UseAuthReturn } from './ui/hooks/useAuth';
|
|
44
|
+
|
|
45
|
+
// Web-only provider (NO React Native dependencies)
|
|
46
|
+
export { default as WebOxyProvider } from './ui/components/WebOxyProvider';
|
|
47
|
+
|
|
48
|
+
// Device management
|
|
49
|
+
export { DeviceManager } from './utils/deviceManager';
|
|
50
|
+
export type { DeviceFingerprint, StoredDeviceInfo } from './utils/deviceManager';
|
|
51
|
+
|
|
52
|
+
// Language utilities
|
|
53
|
+
export {
|
|
54
|
+
SUPPORTED_LANGUAGES,
|
|
55
|
+
getLanguageMetadata,
|
|
56
|
+
getLanguageName,
|
|
57
|
+
getNativeLanguageName,
|
|
58
|
+
normalizeLanguageCode
|
|
59
|
+
} from './utils/languageUtils';
|
|
60
|
+
export type { LanguageMetadata } from './utils/languageUtils';
|
|
61
|
+
|
|
62
|
+
// Type exports
|
|
63
|
+
export type {
|
|
64
|
+
OxyConfig,
|
|
65
|
+
User,
|
|
66
|
+
LoginResponse,
|
|
67
|
+
Notification,
|
|
68
|
+
Wallet,
|
|
69
|
+
Transaction,
|
|
70
|
+
TransferFundsRequest,
|
|
71
|
+
PurchaseRequest,
|
|
72
|
+
WithdrawalRequest,
|
|
73
|
+
TransactionResponse,
|
|
74
|
+
KarmaRule,
|
|
75
|
+
KarmaHistory,
|
|
76
|
+
KarmaLeaderboardEntry,
|
|
77
|
+
KarmaAwardRequest,
|
|
78
|
+
ApiError,
|
|
79
|
+
PaymentMethod,
|
|
80
|
+
PaymentRequest,
|
|
81
|
+
PaymentResponse,
|
|
82
|
+
AnalyticsData,
|
|
83
|
+
FollowerDetails,
|
|
84
|
+
ContentViewer,
|
|
85
|
+
FileMetadata,
|
|
86
|
+
FileUploadResponse,
|
|
87
|
+
FileListResponse,
|
|
88
|
+
FileUpdateRequest,
|
|
89
|
+
FileDeleteResponse,
|
|
90
|
+
DeviceSession,
|
|
91
|
+
DeviceSessionsResponse,
|
|
92
|
+
DeviceSessionLogoutResponse,
|
|
93
|
+
UpdateDeviceNameResponse,
|
|
94
|
+
BlockedUser,
|
|
95
|
+
RestrictedUser,
|
|
96
|
+
FileVisibility,
|
|
97
|
+
AssetLink,
|
|
98
|
+
AssetVariant,
|
|
99
|
+
Asset,
|
|
100
|
+
AssetInitRequest,
|
|
101
|
+
AssetInitResponse,
|
|
102
|
+
AssetCompleteRequest,
|
|
103
|
+
AssetLinkRequest,
|
|
104
|
+
AssetUnlinkRequest,
|
|
105
|
+
AssetUrlResponse,
|
|
106
|
+
AssetDeleteSummary,
|
|
107
|
+
AssetUploadProgress,
|
|
108
|
+
AssetUpdateVisibilityRequest,
|
|
109
|
+
AssetUpdateVisibilityResponse,
|
|
110
|
+
AccountStorageCategoryUsage,
|
|
111
|
+
AccountStorageUsageResponse,
|
|
112
|
+
SecurityEventType,
|
|
113
|
+
SecurityEventSeverity,
|
|
114
|
+
SecurityActivity,
|
|
115
|
+
SecurityActivityResponse
|
|
116
|
+
} from './models/interfaces';
|
|
117
|
+
|
|
118
|
+
export { SECURITY_EVENT_SEVERITY_MAP } from './models/interfaces';
|
|
119
|
+
|
|
120
|
+
export type {
|
|
121
|
+
SessionLoginResponse,
|
|
122
|
+
ClientSession,
|
|
123
|
+
MinimalUserData
|
|
124
|
+
} from './models/session';
|
|
125
|
+
|
|
126
|
+
// UI hooks - Stores
|
|
127
|
+
export { useAuthStore } from './ui/stores/authStore';
|
|
128
|
+
export {
|
|
129
|
+
useAssetStore,
|
|
130
|
+
useAssets as useAssetsStore,
|
|
131
|
+
useAsset,
|
|
132
|
+
useUploadProgress,
|
|
133
|
+
useAssetLoading,
|
|
134
|
+
useAssetErrors,
|
|
135
|
+
useAssetsByApp,
|
|
136
|
+
useAssetsByEntity,
|
|
137
|
+
useAssetUsageCount,
|
|
138
|
+
useIsAssetLinked
|
|
139
|
+
} from './ui/stores/assetStore';
|
|
140
|
+
|
|
141
|
+
// UI hooks - Custom hooks
|
|
142
|
+
export { useSessionSocket } from './ui/hooks/useSessionSocket';
|
|
143
|
+
export { useAssets, setOxyAssetInstance } from './ui/hooks/useAssets';
|
|
144
|
+
export { useFileDownloadUrl, setOxyFileUrlInstance } from './ui/hooks/useFileDownloadUrl';
|
|
145
|
+
|
|
146
|
+
// UI hooks - Query hooks (TanStack Query)
|
|
147
|
+
export {
|
|
148
|
+
useUserProfile,
|
|
149
|
+
useUserProfiles,
|
|
150
|
+
useCurrentUser,
|
|
151
|
+
useUserById,
|
|
152
|
+
useUserByUsername,
|
|
153
|
+
useUsersBySessions,
|
|
154
|
+
usePrivacySettings,
|
|
155
|
+
useSessions,
|
|
156
|
+
useSession,
|
|
157
|
+
useDeviceSessions,
|
|
158
|
+
useUserDevices,
|
|
159
|
+
useSecurityInfo,
|
|
160
|
+
useSecurityActivity,
|
|
161
|
+
useRecentSecurityActivity,
|
|
162
|
+
} from './ui/hooks/queries';
|
|
163
|
+
|
|
164
|
+
// UI hooks - Mutation hooks (TanStack Query)
|
|
165
|
+
export {
|
|
166
|
+
useUpdateProfile,
|
|
167
|
+
useUploadAvatar,
|
|
168
|
+
useUpdateAccountSettings,
|
|
169
|
+
useUpdatePrivacySettings,
|
|
170
|
+
useUploadFile,
|
|
171
|
+
useSwitchSession,
|
|
172
|
+
useLogoutSession,
|
|
173
|
+
useLogoutAll,
|
|
174
|
+
useUpdateDeviceName,
|
|
175
|
+
useRemoveDevice,
|
|
176
|
+
} from './ui/hooks/mutations';
|
|
177
|
+
|
|
178
|
+
// Mutation factory utilities
|
|
179
|
+
export {
|
|
180
|
+
createProfileMutation,
|
|
181
|
+
createGenericMutation,
|
|
182
|
+
} from './ui/hooks/mutations/mutationFactory';
|
|
183
|
+
export type {
|
|
184
|
+
ProfileMutationConfig,
|
|
185
|
+
GenericMutationConfig,
|
|
186
|
+
} from './ui/hooks/mutations/mutationFactory';
|
|
187
|
+
|
|
188
|
+
// Authentication helpers
|
|
189
|
+
export {
|
|
190
|
+
ensureValidToken,
|
|
191
|
+
withAuthErrorHandling,
|
|
192
|
+
authenticatedApiCall,
|
|
193
|
+
isAuthenticationError,
|
|
194
|
+
SessionSyncRequiredError,
|
|
195
|
+
AuthenticationFailedError,
|
|
196
|
+
} from './ui/utils/authHelpers';
|
|
197
|
+
export type { HandleApiErrorOptions } from './ui/utils/authHelpers';
|
|
198
|
+
|
|
199
|
+
// File filtering hook
|
|
200
|
+
export { useFileFiltering } from './ui/hooks/useFileFiltering';
|
|
201
|
+
export type { ViewMode, SortBy, SortOrder } from './ui/hooks/useFileFiltering';
|
|
202
|
+
|
|
203
|
+
// Web-compatible UI components (no React Native dependencies)
|
|
204
|
+
export { OxySignInButton } from './ui/components/OxySignInButton';
|
|
205
|
+
export { OxyLogo } from './ui/components/OxyLogo';
|
|
206
|
+
|
|
207
|
+
// Utilities
|
|
208
|
+
export * from './utils/apiUtils';
|
|
209
|
+
export {
|
|
210
|
+
ErrorCodes,
|
|
211
|
+
createApiError,
|
|
212
|
+
handleHttpError,
|
|
213
|
+
validateRequiredFields,
|
|
214
|
+
retryWithBackoff
|
|
215
|
+
} from './utils/errorUtils';
|
|
216
|
+
export * from './utils/validationUtils';
|
|
217
|
+
export {
|
|
218
|
+
logger,
|
|
219
|
+
LogLevel,
|
|
220
|
+
LogContext,
|
|
221
|
+
logAuth,
|
|
222
|
+
logApi,
|
|
223
|
+
logSession,
|
|
224
|
+
logUser,
|
|
225
|
+
logDevice,
|
|
226
|
+
logPayment,
|
|
227
|
+
logPerformance
|
|
228
|
+
} from './utils/loggerUtils';
|
|
229
|
+
export * from './utils/asyncUtils';
|
|
230
|
+
export * from './utils/hookUtils';
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|