@oxyhq/services 5.24.0 → 5.26.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 +60 -8
- package/lib/commonjs/core/AuthManager.js +405 -0
- package/lib/commonjs/core/AuthManager.js.map +1 -0
- package/lib/commonjs/core/HttpService.js +39 -1
- package/lib/commonjs/core/HttpService.js.map +1 -1
- package/lib/commonjs/core/index.js +16 -0
- package/lib/commonjs/core/index.js.map +1 -1
- package/lib/commonjs/core/mixins/OxyServices.fedcm.js +38 -44
- package/lib/commonjs/core/mixins/OxyServices.fedcm.js.map +1 -1
- package/lib/commonjs/core/mixins/OxyServices.popup.js +9 -7
- package/lib/commonjs/core/mixins/OxyServices.popup.js.map +1 -1
- package/lib/commonjs/index.js +321 -18
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/shared/index.js +227 -0
- package/lib/commonjs/shared/index.js.map +1 -0
- package/lib/commonjs/shared/utils/colorUtils.js +161 -0
- package/lib/commonjs/shared/utils/colorUtils.js.map +1 -0
- package/lib/commonjs/shared/utils/debugUtils.js +84 -0
- package/lib/commonjs/shared/utils/debugUtils.js.map +1 -0
- package/lib/commonjs/shared/utils/errorUtils.js +190 -0
- package/lib/commonjs/shared/utils/errorUtils.js.map +1 -0
- package/lib/commonjs/shared/utils/index.js +196 -0
- package/lib/commonjs/shared/utils/index.js.map +1 -0
- package/lib/commonjs/shared/utils/networkUtils.js +213 -0
- package/lib/commonjs/shared/utils/networkUtils.js.map +1 -0
- package/lib/commonjs/shared/utils/themeUtils.js +118 -0
- package/lib/commonjs/shared/utils/themeUtils.js.map +1 -0
- package/lib/commonjs/ui/components/BottomSheetRouter.js +1 -1
- package/lib/commonjs/ui/components/FontLoader.js +1 -1
- package/lib/commonjs/ui/components/FontLoader.js.map +1 -1
- package/lib/commonjs/ui/components/GroupedItem.js +1 -1
- package/lib/commonjs/ui/components/Header.js +1 -1
- package/lib/commonjs/ui/components/OxyProvider.js +9 -1
- package/lib/commonjs/ui/components/OxyProvider.js.map +1 -1
- package/lib/commonjs/ui/components/OxySignInButton.js +19 -20
- 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/QuickActions.js +1 -1
- package/lib/commonjs/ui/components/QuickActions.js.map +1 -1
- package/lib/commonjs/ui/components/Section.js +1 -1
- package/lib/commonjs/ui/components/SectionTitle.js +1 -1
- package/lib/commonjs/ui/components/SignInModal.js +546 -0
- package/lib/commonjs/ui/components/SignInModal.js.map +1 -0
- package/lib/commonjs/ui/context/OxyContext.js +2 -1
- package/lib/commonjs/ui/context/OxyContext.js.map +1 -1
- package/lib/commonjs/ui/hooks/{use-color-scheme.js → useColorScheme.js} +1 -1
- package/lib/commonjs/ui/hooks/useColorScheme.js.map +1 -0
- package/lib/commonjs/ui/hooks/useSessionSocket.js +6 -12
- package/lib/commonjs/ui/hooks/useSessionSocket.js.map +1 -1
- package/lib/commonjs/ui/hooks/useThemeColors.js +1 -1
- package/lib/commonjs/ui/hooks/useThemeStyles.js +1 -1
- package/lib/commonjs/ui/navigation/bottomSheetManager.js +5 -2
- package/lib/commonjs/ui/navigation/bottomSheetManager.js.map +1 -1
- package/lib/commonjs/ui/navigation/routes.js +7 -8
- package/lib/commonjs/ui/navigation/routes.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountCenterScreen.js +7 -7
- package/lib/commonjs/ui/screens/AccountCenterScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountOverviewScreen.js +6 -6
- package/lib/commonjs/ui/screens/AccountOverviewScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountSettingsScreen.js +2 -2
- package/lib/commonjs/ui/screens/AccountSwitcherScreen.js +4 -4
- package/lib/commonjs/ui/screens/AccountSwitcherScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AppInfoScreen.js +1 -1
- package/lib/commonjs/ui/screens/EditProfileFieldScreen.js +1 -1
- package/lib/commonjs/ui/screens/FileManagementScreen.js +1 -1
- package/lib/commonjs/ui/screens/FollowersListScreen.js +18 -0
- package/lib/commonjs/ui/screens/FollowersListScreen.js.map +1 -0
- package/lib/commonjs/ui/screens/FollowingListScreen.js +18 -0
- package/lib/commonjs/ui/screens/FollowingListScreen.js.map +1 -0
- package/lib/commonjs/ui/screens/HelpSupportScreen.js +1 -1
- package/lib/commonjs/ui/screens/HelpSupportScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/HistoryViewScreen.js +1 -1
- package/lib/commonjs/ui/screens/LanguageSelectorScreen.js +1 -1
- package/lib/commonjs/ui/screens/LearnMoreUsernamesScreen.js +229 -0
- package/lib/commonjs/ui/screens/LearnMoreUsernamesScreen.js.map +1 -0
- package/lib/commonjs/ui/screens/LegalDocumentsScreen.js +1 -1
- package/lib/commonjs/ui/screens/LegalDocumentsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/OxyAuthScreen.js +9 -21
- package/lib/commonjs/ui/screens/OxyAuthScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/PremiumSubscriptionScreen.js +1 -1
- package/lib/commonjs/ui/screens/ProfileScreen.js +1 -1
- package/lib/commonjs/ui/screens/ProfileScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/SavesCollectionsScreen.js +1 -1
- package/lib/commonjs/ui/screens/UserListScreen.js +411 -0
- package/lib/commonjs/ui/screens/UserListScreen.js.map +1 -0
- package/lib/commonjs/ui/screens/karma/KarmaAboutScreen.js +1 -1
- package/lib/commonjs/ui/screens/karma/KarmaCenterScreen.js +1 -1
- package/lib/commonjs/ui/screens/karma/KarmaFAQScreen.js +1 -1
- package/lib/commonjs/ui/screens/karma/KarmaLeaderboardScreen.js +1 -1
- package/lib/commonjs/ui/screens/karma/KarmaRewardsScreen.js +1 -1
- package/lib/commonjs/ui/screens/karma/KarmaRulesScreen.js +1 -1
- package/lib/commonjs/ui/stores/authStore.js +4 -6
- package/lib/commonjs/ui/stores/authStore.js.map +1 -1
- package/lib/commonjs/ui/utils/colorUtils.js +43 -46
- package/lib/commonjs/ui/utils/colorUtils.js.map +1 -1
- package/lib/commonjs/ui/utils/themeUtils.js +29 -39
- package/lib/commonjs/ui/utils/themeUtils.js.map +1 -1
- package/lib/commonjs/ui/utils/{user-utils.js → userUtils.js} +1 -1
- package/lib/commonjs/ui/utils/userUtils.js.map +1 -0
- package/lib/commonjs/utils/errorUtils.js +0 -13
- package/lib/commonjs/utils/errorUtils.js.map +1 -1
- package/lib/commonjs/utils/hookUtils.js +8 -8
- package/lib/commonjs/utils/hookUtils.js.map +1 -1
- package/lib/commonjs/web/WebOxyContext.js +277 -72
- package/lib/commonjs/web/WebOxyContext.js.map +1 -1
- package/lib/commonjs/web/index.js +177 -4
- package/lib/commonjs/web/index.js.map +1 -1
- package/lib/commonjs/web.js +12 -12
- package/lib/commonjs/web.js.map +1 -1
- package/lib/module/core/AuthManager.js +399 -0
- package/lib/module/core/AuthManager.js.map +1 -0
- package/lib/module/core/HttpService.js +39 -1
- package/lib/module/core/HttpService.js.map +1 -1
- package/lib/module/core/index.js +2 -0
- package/lib/module/core/index.js.map +1 -1
- package/lib/module/core/mixins/OxyServices.fedcm.js +38 -44
- package/lib/module/core/mixins/OxyServices.fedcm.js.map +1 -1
- package/lib/module/core/mixins/OxyServices.popup.js +9 -7
- package/lib/module/core/mixins/OxyServices.popup.js.map +1 -1
- package/lib/module/index.js +27 -2
- package/lib/module/index.js.map +1 -1
- package/lib/module/shared/index.js +37 -0
- package/lib/module/shared/index.js.map +1 -0
- package/lib/module/shared/utils/colorUtils.js +150 -0
- package/lib/module/shared/utils/colorUtils.js.map +1 -0
- package/lib/module/shared/utils/debugUtils.js +75 -0
- package/lib/module/shared/utils/debugUtils.js.map +1 -0
- package/lib/module/shared/utils/errorUtils.js +176 -0
- package/lib/module/shared/utils/errorUtils.js.map +1 -0
- package/lib/module/shared/utils/index.js +21 -0
- package/lib/module/shared/utils/index.js.map +1 -0
- package/lib/module/shared/utils/networkUtils.js +202 -0
- package/lib/module/shared/utils/networkUtils.js.map +1 -0
- package/lib/module/shared/utils/themeUtils.js +109 -0
- package/lib/module/shared/utils/themeUtils.js.map +1 -0
- package/lib/module/ui/components/BottomSheetRouter.js +1 -1
- package/lib/module/ui/components/BottomSheetRouter.js.map +1 -1
- package/lib/module/ui/components/FontLoader.js +1 -1
- package/lib/module/ui/components/FontLoader.js.map +1 -1
- package/lib/module/ui/components/GroupedItem.js +1 -1
- package/lib/module/ui/components/GroupedItem.js.map +1 -1
- package/lib/module/ui/components/Header.js +1 -1
- package/lib/module/ui/components/Header.js.map +1 -1
- package/lib/module/ui/components/OxyProvider.js +9 -1
- package/lib/module/ui/components/OxyProvider.js.map +1 -1
- package/lib/module/ui/components/OxySignInButton.js +20 -21
- 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/QuickActions.js +1 -1
- package/lib/module/ui/components/QuickActions.js.map +1 -1
- package/lib/module/ui/components/Section.js +1 -1
- package/lib/module/ui/components/Section.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/SignInModal.js +536 -0
- package/lib/module/ui/components/SignInModal.js.map +1 -0
- package/lib/module/ui/context/OxyContext.js +1 -1
- package/lib/module/ui/context/OxyContext.js.map +1 -1
- package/lib/module/ui/hooks/{use-color-scheme.js → useColorScheme.js} +1 -1
- package/lib/module/ui/hooks/useColorScheme.js.map +1 -0
- package/lib/module/ui/hooks/useSessionSocket.js +6 -12
- package/lib/module/ui/hooks/useSessionSocket.js.map +1 -1
- package/lib/module/ui/hooks/useThemeColors.js +1 -1
- package/lib/module/ui/hooks/useThemeColors.js.map +1 -1
- package/lib/module/ui/hooks/useThemeStyles.js +1 -1
- package/lib/module/ui/hooks/useThemeStyles.js.map +1 -1
- package/lib/module/ui/navigation/bottomSheetManager.js +5 -2
- package/lib/module/ui/navigation/bottomSheetManager.js.map +1 -1
- package/lib/module/ui/navigation/routes.js +7 -8
- package/lib/module/ui/navigation/routes.js.map +1 -1
- package/lib/module/ui/screens/AccountCenterScreen.js +7 -7
- package/lib/module/ui/screens/AccountCenterScreen.js.map +1 -1
- package/lib/module/ui/screens/AccountOverviewScreen.js +6 -6
- package/lib/module/ui/screens/AccountOverviewScreen.js.map +1 -1
- package/lib/module/ui/screens/AccountSettingsScreen.js +2 -2
- package/lib/module/ui/screens/AccountSettingsScreen.js.map +1 -1
- package/lib/module/ui/screens/AccountSwitcherScreen.js +4 -4
- package/lib/module/ui/screens/AccountSwitcherScreen.js.map +1 -1
- package/lib/module/ui/screens/AppInfoScreen.js +1 -1
- package/lib/module/ui/screens/AppInfoScreen.js.map +1 -1
- package/lib/module/ui/screens/EditProfileFieldScreen.js +1 -1
- package/lib/module/ui/screens/EditProfileFieldScreen.js.map +1 -1
- package/lib/module/ui/screens/FileManagementScreen.js +1 -1
- package/lib/module/ui/screens/FileManagementScreen.js.map +1 -1
- package/lib/module/ui/screens/FollowersListScreen.js +13 -0
- package/lib/module/ui/screens/FollowersListScreen.js.map +1 -0
- package/lib/module/ui/screens/FollowingListScreen.js +13 -0
- package/lib/module/ui/screens/FollowingListScreen.js.map +1 -0
- package/lib/module/ui/screens/HelpSupportScreen.js +1 -1
- package/lib/module/ui/screens/HelpSupportScreen.js.map +1 -1
- package/lib/module/ui/screens/HistoryViewScreen.js +1 -1
- package/lib/module/ui/screens/HistoryViewScreen.js.map +1 -1
- package/lib/module/ui/screens/LanguageSelectorScreen.js +1 -1
- package/lib/module/ui/screens/LanguageSelectorScreen.js.map +1 -1
- package/lib/module/ui/screens/LearnMoreUsernamesScreen.js +224 -0
- package/lib/module/ui/screens/LearnMoreUsernamesScreen.js.map +1 -0
- package/lib/module/ui/screens/LegalDocumentsScreen.js +1 -1
- package/lib/module/ui/screens/LegalDocumentsScreen.js.map +1 -1
- package/lib/module/ui/screens/OxyAuthScreen.js +9 -21
- package/lib/module/ui/screens/OxyAuthScreen.js.map +1 -1
- package/lib/module/ui/screens/PremiumSubscriptionScreen.js +1 -1
- package/lib/module/ui/screens/PremiumSubscriptionScreen.js.map +1 -1
- package/lib/module/ui/screens/ProfileScreen.js +1 -1
- package/lib/module/ui/screens/ProfileScreen.js.map +1 -1
- package/lib/module/ui/screens/SavesCollectionsScreen.js +1 -1
- package/lib/module/ui/screens/SavesCollectionsScreen.js.map +1 -1
- package/lib/module/ui/screens/UserListScreen.js +405 -0
- package/lib/module/ui/screens/UserListScreen.js.map +1 -0
- package/lib/module/ui/screens/karma/KarmaAboutScreen.js +1 -1
- package/lib/module/ui/screens/karma/KarmaAboutScreen.js.map +1 -1
- package/lib/module/ui/screens/karma/KarmaCenterScreen.js +1 -1
- package/lib/module/ui/screens/karma/KarmaCenterScreen.js.map +1 -1
- package/lib/module/ui/screens/karma/KarmaFAQScreen.js +1 -1
- package/lib/module/ui/screens/karma/KarmaFAQScreen.js.map +1 -1
- package/lib/module/ui/screens/karma/KarmaLeaderboardScreen.js +1 -1
- package/lib/module/ui/screens/karma/KarmaLeaderboardScreen.js.map +1 -1
- package/lib/module/ui/screens/karma/KarmaRewardsScreen.js +1 -1
- package/lib/module/ui/screens/karma/KarmaRewardsScreen.js.map +1 -1
- package/lib/module/ui/screens/karma/KarmaRulesScreen.js +1 -1
- package/lib/module/ui/screens/karma/KarmaRulesScreen.js.map +1 -1
- package/lib/module/ui/stores/authStore.js +4 -6
- package/lib/module/ui/stores/authStore.js.map +1 -1
- package/lib/module/ui/utils/colorUtils.js +7 -40
- package/lib/module/ui/utils/colorUtils.js.map +1 -1
- package/lib/module/ui/utils/themeUtils.js +7 -35
- package/lib/module/ui/utils/themeUtils.js.map +1 -1
- package/lib/module/ui/utils/{user-utils.js → userUtils.js} +1 -1
- package/lib/module/ui/utils/userUtils.js.map +1 -0
- package/lib/module/utils/errorUtils.js +0 -7
- package/lib/module/utils/errorUtils.js.map +1 -1
- package/lib/module/utils/hookUtils.js +8 -8
- package/lib/module/utils/hookUtils.js.map +1 -1
- package/lib/module/web/WebOxyContext.js +276 -72
- package/lib/module/web/WebOxyContext.js.map +1 -1
- package/lib/module/web/index.js +26 -5
- package/lib/module/web/index.js.map +1 -1
- package/lib/module/web.js +2 -1
- package/lib/module/web.js.map +1 -1
- package/lib/typescript/commonjs/core/AuthManager.d.ts +144 -0
- package/lib/typescript/commonjs/core/AuthManager.d.ts.map +1 -0
- package/lib/typescript/commonjs/core/HttpService.d.ts.map +1 -1
- package/lib/typescript/commonjs/core/index.d.ts +2 -0
- package/lib/typescript/commonjs/core/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/core/mixins/OxyServices.fedcm.d.ts.map +1 -1
- package/lib/typescript/commonjs/core/mixins/OxyServices.popup.d.ts.map +1 -1
- package/lib/typescript/commonjs/index.d.ts +16 -2
- package/lib/typescript/commonjs/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/models/session.d.ts +4 -0
- package/lib/typescript/commonjs/models/session.d.ts.map +1 -1
- package/lib/typescript/commonjs/shared/index.d.ts +29 -0
- package/lib/typescript/commonjs/shared/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/shared/utils/colorUtils.d.ts +105 -0
- package/lib/typescript/commonjs/shared/utils/colorUtils.d.ts.map +1 -0
- package/lib/typescript/commonjs/shared/utils/debugUtils.d.ts +49 -0
- package/lib/typescript/commonjs/shared/utils/debugUtils.d.ts.map +1 -0
- package/lib/typescript/commonjs/shared/utils/errorUtils.d.ts +98 -0
- package/lib/typescript/commonjs/shared/utils/errorUtils.d.ts.map +1 -0
- package/lib/typescript/commonjs/shared/utils/index.d.ts +14 -0
- package/lib/typescript/commonjs/shared/utils/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/shared/utils/networkUtils.d.ts +140 -0
- package/lib/typescript/commonjs/shared/utils/networkUtils.d.ts.map +1 -0
- package/lib/typescript/commonjs/shared/utils/themeUtils.d.ts +91 -0
- package/lib/typescript/commonjs/shared/utils/themeUtils.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/FontLoader.d.ts +1 -1
- package/lib/typescript/commonjs/ui/components/FontLoader.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/OxyProvider.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/OxySignInButton.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/SignInModal.d.ts +18 -0
- package/lib/typescript/commonjs/ui/components/SignInModal.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/context/OxyContext.d.ts +1 -2
- package/lib/typescript/commonjs/ui/context/OxyContext.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/{use-color-scheme.d.ts → useColorScheme.d.ts} +1 -1
- package/lib/typescript/commonjs/ui/hooks/useColorScheme.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/hooks/useSessionSocket.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/navigation/bottomSheetManager.d.ts +2 -0
- package/lib/typescript/commonjs/ui/navigation/bottomSheetManager.d.ts.map +1 -1
- 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/FollowersListScreen.d.ts +9 -0
- package/lib/typescript/commonjs/ui/screens/FollowersListScreen.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/screens/FollowingListScreen.d.ts +9 -0
- package/lib/typescript/commonjs/ui/screens/FollowingListScreen.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/screens/LearnMoreUsernamesScreen.d.ts +5 -0
- package/lib/typescript/commonjs/ui/screens/LearnMoreUsernamesScreen.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/screens/OxyAuthScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/UserListScreen.d.ts +11 -0
- package/lib/typescript/commonjs/ui/screens/UserListScreen.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/stores/authStore.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/utils/colorUtils.d.ts +7 -11
- package/lib/typescript/commonjs/ui/utils/colorUtils.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/utils/themeUtils.d.ts +6 -19
- package/lib/typescript/commonjs/ui/utils/themeUtils.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/utils/{user-utils.d.ts → userUtils.d.ts} +1 -1
- package/lib/typescript/commonjs/ui/utils/userUtils.d.ts.map +1 -0
- package/lib/typescript/commonjs/utils/errorUtils.d.ts +0 -6
- package/lib/typescript/commonjs/utils/errorUtils.d.ts.map +1 -1
- package/lib/typescript/commonjs/web/WebOxyContext.d.ts +113 -4
- package/lib/typescript/commonjs/web/WebOxyContext.d.ts.map +1 -1
- package/lib/typescript/commonjs/web/index.d.ts +20 -9
- package/lib/typescript/commonjs/web/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/web.d.ts +2 -1
- package/lib/typescript/commonjs/web.d.ts.map +1 -1
- package/lib/typescript/module/core/AuthManager.d.ts +144 -0
- package/lib/typescript/module/core/AuthManager.d.ts.map +1 -0
- package/lib/typescript/module/core/HttpService.d.ts.map +1 -1
- package/lib/typescript/module/core/index.d.ts +2 -0
- package/lib/typescript/module/core/index.d.ts.map +1 -1
- package/lib/typescript/module/core/mixins/OxyServices.fedcm.d.ts.map +1 -1
- package/lib/typescript/module/core/mixins/OxyServices.popup.d.ts.map +1 -1
- package/lib/typescript/module/index.d.ts +16 -2
- package/lib/typescript/module/index.d.ts.map +1 -1
- package/lib/typescript/module/models/session.d.ts +4 -0
- package/lib/typescript/module/models/session.d.ts.map +1 -1
- package/lib/typescript/module/shared/index.d.ts +29 -0
- package/lib/typescript/module/shared/index.d.ts.map +1 -0
- package/lib/typescript/module/shared/utils/colorUtils.d.ts +105 -0
- package/lib/typescript/module/shared/utils/colorUtils.d.ts.map +1 -0
- package/lib/typescript/module/shared/utils/debugUtils.d.ts +49 -0
- package/lib/typescript/module/shared/utils/debugUtils.d.ts.map +1 -0
- package/lib/typescript/module/shared/utils/errorUtils.d.ts +98 -0
- package/lib/typescript/module/shared/utils/errorUtils.d.ts.map +1 -0
- package/lib/typescript/module/shared/utils/index.d.ts +14 -0
- package/lib/typescript/module/shared/utils/index.d.ts.map +1 -0
- package/lib/typescript/module/shared/utils/networkUtils.d.ts +140 -0
- package/lib/typescript/module/shared/utils/networkUtils.d.ts.map +1 -0
- package/lib/typescript/module/shared/utils/themeUtils.d.ts +91 -0
- package/lib/typescript/module/shared/utils/themeUtils.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/FontLoader.d.ts +1 -1
- package/lib/typescript/module/ui/components/FontLoader.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/OxyProvider.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/OxySignInButton.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/SignInModal.d.ts +18 -0
- package/lib/typescript/module/ui/components/SignInModal.d.ts.map +1 -0
- package/lib/typescript/module/ui/context/OxyContext.d.ts +1 -2
- package/lib/typescript/module/ui/context/OxyContext.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/{use-color-scheme.d.ts → useColorScheme.d.ts} +1 -1
- package/lib/typescript/module/ui/hooks/useColorScheme.d.ts.map +1 -0
- package/lib/typescript/module/ui/hooks/useSessionSocket.d.ts.map +1 -1
- package/lib/typescript/module/ui/navigation/bottomSheetManager.d.ts +2 -0
- package/lib/typescript/module/ui/navigation/bottomSheetManager.d.ts.map +1 -1
- 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/FollowersListScreen.d.ts +9 -0
- package/lib/typescript/module/ui/screens/FollowersListScreen.d.ts.map +1 -0
- package/lib/typescript/module/ui/screens/FollowingListScreen.d.ts +9 -0
- package/lib/typescript/module/ui/screens/FollowingListScreen.d.ts.map +1 -0
- package/lib/typescript/module/ui/screens/LearnMoreUsernamesScreen.d.ts +5 -0
- package/lib/typescript/module/ui/screens/LearnMoreUsernamesScreen.d.ts.map +1 -0
- package/lib/typescript/module/ui/screens/OxyAuthScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/UserListScreen.d.ts +11 -0
- package/lib/typescript/module/ui/screens/UserListScreen.d.ts.map +1 -0
- package/lib/typescript/module/ui/stores/authStore.d.ts.map +1 -1
- package/lib/typescript/module/ui/utils/colorUtils.d.ts +7 -11
- package/lib/typescript/module/ui/utils/colorUtils.d.ts.map +1 -1
- package/lib/typescript/module/ui/utils/themeUtils.d.ts +6 -19
- package/lib/typescript/module/ui/utils/themeUtils.d.ts.map +1 -1
- package/lib/typescript/module/ui/utils/{user-utils.d.ts → userUtils.d.ts} +1 -1
- package/lib/typescript/module/ui/utils/userUtils.d.ts.map +1 -0
- package/lib/typescript/module/utils/errorUtils.d.ts +0 -6
- package/lib/typescript/module/utils/errorUtils.d.ts.map +1 -1
- package/lib/typescript/module/web/WebOxyContext.d.ts +113 -4
- package/lib/typescript/module/web/WebOxyContext.d.ts.map +1 -1
- package/lib/typescript/module/web/index.d.ts +20 -9
- package/lib/typescript/module/web/index.d.ts.map +1 -1
- package/lib/typescript/module/web.d.ts +2 -1
- package/lib/typescript/module/web.d.ts.map +1 -1
- package/package.json +8 -2
- package/src/core/AuthManager.ts +436 -0
- package/src/core/HttpService.ts +43 -1
- package/src/core/index.ts +4 -0
- package/src/core/mixins/OxyServices.fedcm.ts +37 -42
- package/src/core/mixins/OxyServices.popup.ts +10 -7
- package/src/index.ts +76 -11
- package/src/models/session.ts +4 -0
- package/src/shared/index.ts +82 -0
- package/src/shared/utils/colorUtils.ts +155 -0
- package/src/shared/utils/debugUtils.ts +73 -0
- package/src/shared/utils/errorUtils.ts +181 -0
- package/src/shared/utils/index.ts +59 -0
- package/src/shared/utils/networkUtils.ts +248 -0
- package/src/shared/utils/themeUtils.ts +115 -0
- package/src/ui/components/BottomSheetRouter.tsx +1 -1
- package/src/ui/components/FontLoader.tsx +1 -2
- package/src/ui/components/GroupedItem.tsx +1 -1
- package/src/ui/components/Header.tsx +1 -1
- package/src/ui/components/OxyProvider.tsx +10 -0
- package/src/ui/components/OxySignInButton.tsx +20 -22
- package/src/ui/components/ProfileCard.tsx +1 -1
- package/src/ui/components/QuickActions.tsx +1 -1
- package/src/ui/components/Section.tsx +1 -1
- package/src/ui/components/SectionTitle.tsx +1 -1
- package/src/ui/components/SignInModal.tsx +534 -0
- package/src/ui/context/OxyContext.tsx +1 -2
- package/src/ui/hooks/queries/queryKeys.ts +2 -2
- package/src/ui/hooks/useSessionSocket.ts +12 -17
- package/src/ui/hooks/useThemeColors.ts +1 -1
- package/src/ui/hooks/useThemeStyles.ts +1 -1
- package/src/ui/navigation/bottomSheetManager.ts +5 -1
- package/src/ui/navigation/routes.ts +8 -9
- package/src/ui/screens/AccountCenterScreen.tsx +7 -7
- package/src/ui/screens/AccountOverviewScreen.tsx +6 -6
- package/src/ui/screens/AccountSettingsScreen.tsx +2 -2
- package/src/ui/screens/AccountSwitcherScreen.tsx +4 -4
- package/src/ui/screens/AppInfoScreen.tsx +1 -1
- package/src/ui/screens/EditProfileFieldScreen.tsx +1 -1
- package/src/ui/screens/FileManagementScreen.tsx +1 -1
- package/src/ui/screens/FollowersListScreen.tsx +14 -0
- package/src/ui/screens/FollowingListScreen.tsx +14 -0
- package/src/ui/screens/HelpSupportScreen.tsx +1 -1
- package/src/ui/screens/HistoryViewScreen.tsx +1 -1
- package/src/ui/screens/LanguageSelectorScreen.tsx +1 -1
- package/src/ui/screens/LearnMoreUsernamesScreen.tsx +231 -0
- package/src/ui/screens/LegalDocumentsScreen.tsx +1 -1
- package/src/ui/screens/OxyAuthScreen.tsx +10 -21
- package/src/ui/screens/PremiumSubscriptionScreen.tsx +1 -1
- package/src/ui/screens/ProfileScreen.tsx +1 -1
- package/src/ui/screens/SavesCollectionsScreen.tsx +1 -1
- package/src/ui/screens/UserListScreen.tsx +416 -0
- package/src/ui/screens/karma/KarmaAboutScreen.tsx +1 -1
- package/src/ui/screens/karma/KarmaCenterScreen.tsx +1 -1
- package/src/ui/screens/karma/KarmaFAQScreen.tsx +1 -1
- package/src/ui/screens/karma/KarmaLeaderboardScreen.tsx +1 -1
- package/src/ui/screens/karma/KarmaRewardsScreen.tsx +1 -1
- package/src/ui/screens/karma/KarmaRulesScreen.tsx +1 -1
- package/src/ui/stores/authStore.ts +5 -6
- package/src/ui/utils/colorUtils.ts +15 -43
- package/src/ui/utils/themeUtils.ts +14 -39
- package/src/utils/errorUtils.ts +1 -6
- package/src/utils/hookUtils.ts +8 -8
- package/src/web/WebOxyContext.tsx +330 -72
- package/src/web/index.ts +77 -7
- package/src/web.ts +1 -1
- package/lib/commonjs/ui/hooks/use-color-scheme.js.map +0 -1
- package/lib/commonjs/ui/utils/user-utils.js.map +0 -1
- package/lib/module/ui/hooks/use-color-scheme.js.map +0 -1
- package/lib/module/ui/utils/user-utils.js.map +0 -1
- package/lib/typescript/commonjs/ui/hooks/use-color-scheme.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/utils/user-utils.d.ts.map +0 -1
- package/lib/typescript/module/ui/hooks/use-color-scheme.d.ts.map +0 -1
- package/lib/typescript/module/ui/utils/user-utils.d.ts.map +0 -1
- /package/src/ui/hooks/{use-color-scheme.ts → useColorScheme.ts} +0 -0
- /package/src/ui/utils/{user-utils.ts → userUtils.ts} +0 -0
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import type { OxyServicesBase } from '../OxyServices.base';
|
|
2
2
|
import { OxyAuthenticationError } from '../OxyServices.errors';
|
|
3
3
|
import type { SessionLoginResponse } from '../../models/session';
|
|
4
|
+
import { createDebugLogger } from '../../shared/utils/debugUtils';
|
|
5
|
+
|
|
6
|
+
const debug = createDebugLogger('FedCM');
|
|
4
7
|
|
|
5
8
|
export interface FedCMAuthOptions {
|
|
6
9
|
nonce?: string;
|
|
@@ -99,9 +102,7 @@ export function OxyServicesFedCMMixin<T extends typeof OxyServicesBase>(Base: T)
|
|
|
99
102
|
const nonce = options.nonce || this.generateNonce();
|
|
100
103
|
const clientId = this.getClientId();
|
|
101
104
|
|
|
102
|
-
|
|
103
|
-
console.log('[FedCM] Interactive sign-in: Requesting credential for', clientId);
|
|
104
|
-
}
|
|
105
|
+
debug.log('Interactive sign-in: Requesting credential for', clientId);
|
|
105
106
|
|
|
106
107
|
// Request credential from browser's native identity flow
|
|
107
108
|
const credential = await this.requestIdentityCredential({
|
|
@@ -115,9 +116,7 @@ export function OxyServicesFedCMMixin<T extends typeof OxyServicesBase>(Base: T)
|
|
|
115
116
|
throw new OxyAuthenticationError('No credential received from browser');
|
|
116
117
|
}
|
|
117
118
|
|
|
118
|
-
|
|
119
|
-
console.log('[FedCM] Interactive sign-in: Got credential, exchanging for session');
|
|
120
|
-
}
|
|
119
|
+
debug.log('Interactive sign-in: Got credential, exchanging for session');
|
|
121
120
|
|
|
122
121
|
// Exchange FedCM ID token for Oxy session
|
|
123
122
|
const session = await this.exchangeIdTokenForSession(credential.token);
|
|
@@ -127,15 +126,11 @@ export function OxyServicesFedCMMixin<T extends typeof OxyServicesBase>(Base: T)
|
|
|
127
126
|
this.httpService.setTokens((session as any).accessToken);
|
|
128
127
|
}
|
|
129
128
|
|
|
130
|
-
|
|
131
|
-
console.log('[FedCM] Interactive sign-in: Success!', { userId: (session as any)?.user?.id });
|
|
132
|
-
}
|
|
129
|
+
debug.log('Interactive sign-in: Success!', { userId: (session as any)?.user?.id });
|
|
133
130
|
|
|
134
131
|
return session;
|
|
135
132
|
} catch (error) {
|
|
136
|
-
|
|
137
|
-
console.log('[FedCM] Interactive sign-in failed:', error);
|
|
138
|
-
}
|
|
133
|
+
debug.log('Interactive sign-in failed:', error);
|
|
139
134
|
if ((error as any).name === 'AbortError') {
|
|
140
135
|
throw new OxyAuthenticationError('Sign-in was cancelled by user');
|
|
141
136
|
}
|
|
@@ -178,19 +173,19 @@ export function OxyServicesFedCMMixin<T extends typeof OxyServicesBase>(Base: T)
|
|
|
178
173
|
*/
|
|
179
174
|
async silentSignInWithFedCM(): Promise<SessionLoginResponse | null> {
|
|
180
175
|
if (!this.isFedCMSupported()) {
|
|
181
|
-
|
|
176
|
+
debug.log('Silent SSO: FedCM not supported in this browser');
|
|
182
177
|
return null;
|
|
183
178
|
}
|
|
184
179
|
|
|
185
180
|
const clientId = this.getClientId();
|
|
186
|
-
|
|
181
|
+
debug.log('Silent SSO: Starting for', clientId);
|
|
187
182
|
|
|
188
183
|
// First try silent mediation (no UI) - works if user previously consented
|
|
189
184
|
let credential: { token: string } | null = null;
|
|
190
185
|
|
|
191
186
|
try {
|
|
192
187
|
const nonce = this.generateNonce();
|
|
193
|
-
|
|
188
|
+
debug.log('Silent SSO: Attempting silent mediation...');
|
|
194
189
|
|
|
195
190
|
credential = await this.requestIdentityCredential({
|
|
196
191
|
configURL: (this.constructor as any).DEFAULT_CONFIG_URL,
|
|
@@ -199,19 +194,19 @@ export function OxyServicesFedCMMixin<T extends typeof OxyServicesBase>(Base: T)
|
|
|
199
194
|
mediation: 'silent',
|
|
200
195
|
});
|
|
201
196
|
|
|
202
|
-
|
|
197
|
+
debug.log('Silent SSO: Silent mediation result:', { hasCredential: !!credential, hasToken: !!credential?.token });
|
|
203
198
|
} catch (silentError) {
|
|
204
199
|
// Silent mediation failed - this is expected if user hasn't consented before or is in quiet period
|
|
205
200
|
const errorName = silentError instanceof Error ? silentError.name : 'Unknown';
|
|
206
201
|
const errorMessage = silentError instanceof Error ? silentError.message : String(silentError);
|
|
207
|
-
|
|
202
|
+
debug.log('Silent SSO: Silent mediation error (will try optional):', { name: errorName, message: errorMessage });
|
|
208
203
|
}
|
|
209
204
|
|
|
210
205
|
// If silent failed, try optional mediation which shows browser UI if needed
|
|
211
206
|
if (!credential || !credential.token) {
|
|
212
207
|
try {
|
|
213
208
|
const nonce = this.generateNonce();
|
|
214
|
-
|
|
209
|
+
debug.log('Silent SSO: Trying optional mediation (may show browser UI)...');
|
|
215
210
|
|
|
216
211
|
credential = await this.requestIdentityCredential({
|
|
217
212
|
configURL: (this.constructor as any).DEFAULT_CONFIG_URL,
|
|
@@ -220,55 +215,55 @@ export function OxyServicesFedCMMixin<T extends typeof OxyServicesBase>(Base: T)
|
|
|
220
215
|
mediation: 'optional',
|
|
221
216
|
});
|
|
222
217
|
|
|
223
|
-
|
|
218
|
+
debug.log('Silent SSO: Optional mediation result:', { hasCredential: !!credential, hasToken: !!credential?.token });
|
|
224
219
|
} catch (optionalError) {
|
|
225
220
|
const errorName = optionalError instanceof Error ? optionalError.name : 'Unknown';
|
|
226
221
|
const errorMessage = optionalError instanceof Error ? optionalError.message : String(optionalError);
|
|
227
|
-
|
|
222
|
+
debug.log('Silent SSO: Optional mediation also failed:', { name: errorName, message: errorMessage });
|
|
228
223
|
return null;
|
|
229
224
|
}
|
|
230
225
|
}
|
|
231
226
|
|
|
232
227
|
if (!credential || !credential.token) {
|
|
233
|
-
|
|
228
|
+
debug.log('Silent SSO: No credential returned (user may have dismissed prompt or is not logged in at IdP)');
|
|
234
229
|
return null;
|
|
235
230
|
}
|
|
236
231
|
|
|
237
|
-
|
|
232
|
+
debug.log('Silent SSO: Got credential, exchanging for session...');
|
|
238
233
|
|
|
239
234
|
let session: SessionLoginResponse;
|
|
240
235
|
try {
|
|
241
236
|
session = await this.exchangeIdTokenForSession(credential.token);
|
|
242
237
|
} catch (exchangeError) {
|
|
243
|
-
|
|
238
|
+
debug.error('Silent SSO: Token exchange failed:', exchangeError);
|
|
244
239
|
return null;
|
|
245
240
|
}
|
|
246
241
|
|
|
247
242
|
// Validate session response has required fields
|
|
248
243
|
if (!session) {
|
|
249
|
-
|
|
244
|
+
debug.error('Silent SSO: Exchange returned null session');
|
|
250
245
|
return null;
|
|
251
246
|
}
|
|
252
247
|
|
|
253
248
|
if (!session.sessionId) {
|
|
254
|
-
|
|
249
|
+
debug.error('Silent SSO: Exchange returned session without sessionId:', session);
|
|
255
250
|
return null;
|
|
256
251
|
}
|
|
257
252
|
|
|
258
253
|
if (!session.user) {
|
|
259
|
-
|
|
254
|
+
debug.error('Silent SSO: Exchange returned session without user:', session);
|
|
260
255
|
return null;
|
|
261
256
|
}
|
|
262
257
|
|
|
263
258
|
// Set the access token
|
|
264
259
|
if ((session as any).accessToken) {
|
|
265
260
|
this.httpService.setTokens((session as any).accessToken);
|
|
266
|
-
|
|
261
|
+
debug.log('Silent SSO: Access token set');
|
|
267
262
|
} else {
|
|
268
|
-
|
|
263
|
+
debug.warn('Silent SSO: No accessToken in session response');
|
|
269
264
|
}
|
|
270
265
|
|
|
271
|
-
|
|
266
|
+
debug.log('Silent SSO: Success!', {
|
|
272
267
|
sessionId: session.sessionId?.substring(0, 8) + '...',
|
|
273
268
|
userId: session.user?.id
|
|
274
269
|
});
|
|
@@ -296,7 +291,7 @@ export function OxyServicesFedCMMixin<T extends typeof OxyServicesBase>(Base: T)
|
|
|
296
291
|
const requestedMediation = options.mediation || 'optional';
|
|
297
292
|
const isInteractive = requestedMediation !== 'silent';
|
|
298
293
|
|
|
299
|
-
|
|
294
|
+
debug.log('requestIdentityCredential called:', {
|
|
300
295
|
mediation: requestedMediation,
|
|
301
296
|
clientId: options.clientId,
|
|
302
297
|
inProgress: fedCMRequestInProgress,
|
|
@@ -304,7 +299,7 @@ export function OxyServicesFedCMMixin<T extends typeof OxyServicesBase>(Base: T)
|
|
|
304
299
|
|
|
305
300
|
// If a request is already in progress...
|
|
306
301
|
if (fedCMRequestInProgress && fedCMRequestPromise) {
|
|
307
|
-
|
|
302
|
+
debug.log('Request already in progress, waiting...');
|
|
308
303
|
// If current request is silent and new request is interactive,
|
|
309
304
|
// wait for silent to finish, then make the interactive request
|
|
310
305
|
if (currentMediationMode === 'silent' && isInteractive) {
|
|
@@ -332,13 +327,13 @@ export function OxyServicesFedCMMixin<T extends typeof OxyServicesBase>(Base: T)
|
|
|
332
327
|
? (this.constructor as any).FEDCM_SILENT_TIMEOUT
|
|
333
328
|
: (this.constructor as any).FEDCM_TIMEOUT;
|
|
334
329
|
const timeout = setTimeout(() => {
|
|
335
|
-
|
|
330
|
+
debug.log('Request timed out after', timeoutMs, 'ms (mediation:', requestedMediation + ')');
|
|
336
331
|
controller.abort();
|
|
337
332
|
}, timeoutMs);
|
|
338
333
|
|
|
339
334
|
fedCMRequestPromise = (async () => {
|
|
340
335
|
try {
|
|
341
|
-
|
|
336
|
+
debug.log('Calling navigator.credentials.get with mediation:', requestedMediation);
|
|
342
337
|
// Type assertion needed as FedCM types may not be in all TypeScript versions
|
|
343
338
|
const credential = (await (navigator.credentials as any).get({
|
|
344
339
|
identity: {
|
|
@@ -359,23 +354,23 @@ export function OxyServicesFedCMMixin<T extends typeof OxyServicesBase>(Base: T)
|
|
|
359
354
|
signal: controller.signal,
|
|
360
355
|
})) as any;
|
|
361
356
|
|
|
362
|
-
|
|
357
|
+
debug.log('navigator.credentials.get returned:', {
|
|
363
358
|
hasCredential: !!credential,
|
|
364
359
|
type: credential?.type,
|
|
365
360
|
hasToken: !!credential?.token,
|
|
366
361
|
});
|
|
367
362
|
|
|
368
363
|
if (!credential || credential.type !== 'identity') {
|
|
369
|
-
|
|
364
|
+
debug.log('No valid identity credential returned');
|
|
370
365
|
return null;
|
|
371
366
|
}
|
|
372
367
|
|
|
373
|
-
|
|
368
|
+
debug.log('Got valid identity credential with token');
|
|
374
369
|
return { token: credential.token };
|
|
375
370
|
} catch (error) {
|
|
376
371
|
const errorName = error instanceof Error ? error.name : 'Unknown';
|
|
377
372
|
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
378
|
-
|
|
373
|
+
debug.log('navigator.credentials.get error:', { name: errorName, message: errorMessage });
|
|
379
374
|
throw error;
|
|
380
375
|
} finally {
|
|
381
376
|
clearTimeout(timeout);
|
|
@@ -397,9 +392,9 @@ export function OxyServicesFedCMMixin<T extends typeof OxyServicesBase>(Base: T)
|
|
|
397
392
|
* @private
|
|
398
393
|
*/
|
|
399
394
|
public async exchangeIdTokenForSession(idToken: string): Promise<SessionLoginResponse> {
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
395
|
+
debug.log('exchangeIdTokenForSession: Starting exchange...');
|
|
396
|
+
debug.log('exchangeIdTokenForSession: Token length:', idToken?.length);
|
|
397
|
+
debug.log('exchangeIdTokenForSession: Token preview:', idToken?.substring(0, 50) + '...');
|
|
403
398
|
|
|
404
399
|
try {
|
|
405
400
|
const response = await this.makeRequest<SessionLoginResponse>(
|
|
@@ -409,7 +404,7 @@ export function OxyServicesFedCMMixin<T extends typeof OxyServicesBase>(Base: T)
|
|
|
409
404
|
{ cache: false }
|
|
410
405
|
);
|
|
411
406
|
|
|
412
|
-
|
|
407
|
+
debug.log('exchangeIdTokenForSession: Response received:', {
|
|
413
408
|
hasResponse: !!response,
|
|
414
409
|
hasSessionId: !!(response as any)?.sessionId,
|
|
415
410
|
hasUser: !!(response as any)?.user,
|
|
@@ -421,7 +416,7 @@ export function OxyServicesFedCMMixin<T extends typeof OxyServicesBase>(Base: T)
|
|
|
421
416
|
|
|
422
417
|
return response;
|
|
423
418
|
} catch (error) {
|
|
424
|
-
|
|
419
|
+
debug.error('exchangeIdTokenForSession: Error:', {
|
|
425
420
|
name: error instanceof Error ? error.name : 'Unknown',
|
|
426
421
|
message: error instanceof Error ? error.message : String(error),
|
|
427
422
|
stack: error instanceof Error ? error.stack : undefined,
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import type { OxyServicesBase } from '../OxyServices.base';
|
|
2
2
|
import { OxyAuthenticationError } from '../OxyServices.errors';
|
|
3
3
|
import type { SessionLoginResponse } from '../../models/session';
|
|
4
|
+
import { createDebugLogger } from '../../shared/utils/debugUtils';
|
|
5
|
+
|
|
6
|
+
const debug = createDebugLogger('PopupAuth');
|
|
4
7
|
|
|
5
8
|
export interface PopupAuthOptions {
|
|
6
9
|
width?: number;
|
|
@@ -125,7 +128,7 @@ export function OxyServicesPopupAuthMixin<T extends typeof OxyServicesBase>(Base
|
|
|
125
128
|
(session as any).user = userData;
|
|
126
129
|
}
|
|
127
130
|
} catch (userError) {
|
|
128
|
-
|
|
131
|
+
debug.warn('Failed to fetch user data:', userError);
|
|
129
132
|
// Continue without user data - caller can fetch separately
|
|
130
133
|
}
|
|
131
134
|
}
|
|
@@ -261,7 +264,7 @@ export function OxyServicesPopupAuthMixin<T extends typeof OxyServicesBase>(Base
|
|
|
261
264
|
|
|
262
265
|
// Log all messages for debugging
|
|
263
266
|
if (event.data && typeof event.data === 'object' && event.data.type) {
|
|
264
|
-
|
|
267
|
+
debug.log('Message received:', {
|
|
265
268
|
origin: event.origin,
|
|
266
269
|
expectedOrigin: authUrl,
|
|
267
270
|
type: event.data.type,
|
|
@@ -281,12 +284,12 @@ export function OxyServicesPopupAuthMixin<T extends typeof OxyServicesBase>(Base
|
|
|
281
284
|
return;
|
|
282
285
|
}
|
|
283
286
|
|
|
284
|
-
|
|
287
|
+
debug.log('Valid auth response:', { state, expectedState, hasSession: !!session, error });
|
|
285
288
|
|
|
286
289
|
// Verify state parameter to prevent CSRF attacks
|
|
287
290
|
if (state !== expectedState) {
|
|
288
291
|
cleanup();
|
|
289
|
-
|
|
292
|
+
debug.error('State mismatch');
|
|
290
293
|
reject(new OxyAuthenticationError('Invalid state parameter. Possible CSRF attack.'));
|
|
291
294
|
return;
|
|
292
295
|
}
|
|
@@ -294,13 +297,13 @@ export function OxyServicesPopupAuthMixin<T extends typeof OxyServicesBase>(Base
|
|
|
294
297
|
cleanup();
|
|
295
298
|
|
|
296
299
|
if (error) {
|
|
297
|
-
|
|
300
|
+
debug.error('Auth error:', error);
|
|
298
301
|
reject(new OxyAuthenticationError(error));
|
|
299
302
|
} else if (session) {
|
|
300
|
-
|
|
303
|
+
debug.log('Session received successfully');
|
|
301
304
|
resolve(session);
|
|
302
305
|
} else {
|
|
303
|
-
|
|
306
|
+
debug.error('No session in response');
|
|
304
307
|
reject(new OxyAuthenticationError('No session received from authentication server'));
|
|
305
308
|
}
|
|
306
309
|
};
|
package/src/index.ts
CHANGED
|
@@ -39,6 +39,9 @@ export type { AuthState, AuthActions, UseAuthReturn } from './ui/hooks/useAuth';
|
|
|
39
39
|
// Streamlined provider with built-in bottom sheet
|
|
40
40
|
export { default as OxyProvider } from './ui/components/OxyProvider';
|
|
41
41
|
|
|
42
|
+
// Font loading utility
|
|
43
|
+
export { FontLoader } from './ui/components/FontLoader';
|
|
44
|
+
|
|
42
45
|
// Web-only provider (no React Native dependencies)
|
|
43
46
|
export { default as WebOxyProvider } from './ui/components/WebOxyProvider';
|
|
44
47
|
|
|
@@ -114,7 +117,7 @@ export type {
|
|
|
114
117
|
SecurityEventType,
|
|
115
118
|
SecurityEventSeverity,
|
|
116
119
|
SecurityActivity,
|
|
117
|
-
SecurityActivityResponse
|
|
120
|
+
SecurityActivityResponse,
|
|
118
121
|
} from './models/interfaces';
|
|
119
122
|
|
|
120
123
|
// Export security constants
|
|
@@ -145,6 +148,7 @@ export {
|
|
|
145
148
|
export { useSessionSocket } from './ui/hooks/useSessionSocket';
|
|
146
149
|
export { useAssets, setOxyAssetInstance } from './ui/hooks/useAssets';
|
|
147
150
|
export { useFileDownloadUrl, setOxyFileUrlInstance } from './ui/hooks/useFileDownloadUrl';
|
|
151
|
+
export { useFollow, useFollowerCounts } from './ui/hooks/useFollow';
|
|
148
152
|
|
|
149
153
|
// UI hooks - Query hooks (TanStack Query)
|
|
150
154
|
export {
|
|
@@ -204,6 +208,10 @@ export {
|
|
|
204
208
|
} from './ui/utils/authHelpers';
|
|
205
209
|
export type { HandleApiErrorOptions } from './ui/utils/authHelpers';
|
|
206
210
|
|
|
211
|
+
// Error handlers
|
|
212
|
+
export { handleAuthError, isInvalidSessionError, isTimeoutOrNetworkError, extractErrorMessage } from './ui/utils/errorHandlers';
|
|
213
|
+
export type { HandleAuthErrorOptions } from './ui/utils/errorHandlers';
|
|
214
|
+
|
|
207
215
|
// File filtering hook
|
|
208
216
|
export { useFileFiltering } from './ui/hooks/useFileFiltering';
|
|
209
217
|
export type { ViewMode, SortBy, SortOrder } from './ui/hooks/useFileFiltering';
|
|
@@ -212,19 +220,69 @@ export type { ViewMode, SortBy, SortOrder } from './ui/hooks/useFileFiltering';
|
|
|
212
220
|
export { OxySignInButton } from './ui/components/OxySignInButton';
|
|
213
221
|
export { OxyLogo, FollowButton } from './ui';
|
|
214
222
|
|
|
215
|
-
//
|
|
223
|
+
// Shared utilities (platform-agnostic)
|
|
224
|
+
export {
|
|
225
|
+
// Color utilities
|
|
226
|
+
darkenColor,
|
|
227
|
+
lightenColor,
|
|
228
|
+
hexToRgb,
|
|
229
|
+
rgbToHex,
|
|
230
|
+
withOpacity,
|
|
231
|
+
isLightColor,
|
|
232
|
+
getContrastTextColor,
|
|
233
|
+
} from './shared/utils/colorUtils';
|
|
234
|
+
|
|
235
|
+
export {
|
|
236
|
+
// Theme utilities
|
|
237
|
+
normalizeTheme,
|
|
238
|
+
normalizeColorScheme,
|
|
239
|
+
getOppositeTheme,
|
|
240
|
+
systemPrefersDarkMode,
|
|
241
|
+
getSystemColorScheme,
|
|
242
|
+
} from './shared/utils/themeUtils';
|
|
243
|
+
export type { ThemeValue } from './shared/utils/themeUtils';
|
|
244
|
+
|
|
245
|
+
export {
|
|
246
|
+
// Error utilities
|
|
247
|
+
HttpStatus,
|
|
248
|
+
getErrorStatus,
|
|
249
|
+
getErrorMessage,
|
|
250
|
+
isAlreadyRegisteredError,
|
|
251
|
+
isUnauthorizedError,
|
|
252
|
+
isForbiddenError,
|
|
253
|
+
isNotFoundError,
|
|
254
|
+
isRateLimitError,
|
|
255
|
+
isServerError,
|
|
256
|
+
isNetworkError,
|
|
257
|
+
isRetryableError,
|
|
258
|
+
} from './shared/utils/errorUtils';
|
|
259
|
+
|
|
260
|
+
export {
|
|
261
|
+
// Network utilities
|
|
262
|
+
DEFAULT_CIRCUIT_BREAKER_CONFIG,
|
|
263
|
+
createCircuitBreakerState,
|
|
264
|
+
calculateBackoffInterval,
|
|
265
|
+
recordFailure,
|
|
266
|
+
recordSuccess,
|
|
267
|
+
shouldAllowRequest,
|
|
268
|
+
delay,
|
|
269
|
+
withRetry,
|
|
270
|
+
} from './shared/utils/networkUtils';
|
|
271
|
+
export type { CircuitBreakerState, CircuitBreakerConfig } from './shared/utils/networkUtils';
|
|
272
|
+
|
|
273
|
+
// Other utilities
|
|
216
274
|
export * from './utils/apiUtils';
|
|
217
|
-
export {
|
|
218
|
-
ErrorCodes,
|
|
219
|
-
createApiError,
|
|
220
|
-
handleHttpError,
|
|
275
|
+
export {
|
|
276
|
+
ErrorCodes,
|
|
277
|
+
createApiError,
|
|
278
|
+
handleHttpError,
|
|
221
279
|
validateRequiredFields,
|
|
222
|
-
retryWithBackoff
|
|
223
280
|
} from './utils/errorUtils';
|
|
281
|
+
export { retryAsync } from './utils/asyncUtils';
|
|
224
282
|
export * from './utils/validationUtils';
|
|
225
|
-
export {
|
|
226
|
-
logger,
|
|
227
|
-
LogLevel,
|
|
283
|
+
export {
|
|
284
|
+
logger,
|
|
285
|
+
LogLevel,
|
|
228
286
|
LogContext,
|
|
229
287
|
logAuth,
|
|
230
288
|
logApi,
|
|
@@ -235,4 +293,11 @@ export {
|
|
|
235
293
|
logPerformance
|
|
236
294
|
} from './utils/loggerUtils';
|
|
237
295
|
export * from './utils/asyncUtils';
|
|
238
|
-
export * from './utils/hookUtils';
|
|
296
|
+
export * from './utils/hookUtils';
|
|
297
|
+
|
|
298
|
+
// Bottom sheet navigation
|
|
299
|
+
export { showBottomSheet, closeBottomSheet } from './ui/navigation/bottomSheetManager';
|
|
300
|
+
export type { RouteName } from './ui/navigation/routes';
|
|
301
|
+
|
|
302
|
+
// Sign-in modal
|
|
303
|
+
export { showSignInModal, hideSignInModal } from './ui/components/SignInModal';
|
package/src/models/session.ts
CHANGED
|
@@ -23,4 +23,8 @@ export interface SessionLoginResponse {
|
|
|
23
23
|
deviceId: string;
|
|
24
24
|
expiresAt: string;
|
|
25
25
|
user: MinimalUserData;
|
|
26
|
+
/** JWT access token for API authentication */
|
|
27
|
+
accessToken?: string;
|
|
28
|
+
/** Refresh token for obtaining new access tokens */
|
|
29
|
+
refreshToken?: string;
|
|
26
30
|
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OxyServices Shared Module
|
|
3
|
+
*
|
|
4
|
+
* Platform-agnostic utilities and helpers that work everywhere:
|
|
5
|
+
* - Browser (Web, Expo Web)
|
|
6
|
+
* - React Native (iOS, Android)
|
|
7
|
+
* - Node.js (Backend)
|
|
8
|
+
*
|
|
9
|
+
* This module contains NO React Native or browser-specific dependencies.
|
|
10
|
+
*
|
|
11
|
+
* @module shared
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```ts
|
|
15
|
+
* import { darkenColor, normalizeTheme, withRetry } from '@oxyhq/services/shared';
|
|
16
|
+
*
|
|
17
|
+
* const darkBlue = darkenColor('#0066FF', 0.3);
|
|
18
|
+
* const theme = normalizeTheme(userPreference);
|
|
19
|
+
* const data = await withRetry(() => fetchData(), { maxRetries: 3 });
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
// Color utilities
|
|
24
|
+
export {
|
|
25
|
+
darkenColor,
|
|
26
|
+
lightenColor,
|
|
27
|
+
hexToRgb,
|
|
28
|
+
rgbToHex,
|
|
29
|
+
withOpacity,
|
|
30
|
+
isLightColor,
|
|
31
|
+
getContrastTextColor,
|
|
32
|
+
} from './utils/colorUtils';
|
|
33
|
+
|
|
34
|
+
// Theme utilities
|
|
35
|
+
export {
|
|
36
|
+
normalizeTheme,
|
|
37
|
+
normalizeColorScheme,
|
|
38
|
+
getOppositeTheme,
|
|
39
|
+
systemPrefersDarkMode,
|
|
40
|
+
getSystemColorScheme,
|
|
41
|
+
} from './utils/themeUtils';
|
|
42
|
+
export type { ThemeValue } from './utils/themeUtils';
|
|
43
|
+
|
|
44
|
+
// Error utilities
|
|
45
|
+
export {
|
|
46
|
+
HttpStatus,
|
|
47
|
+
getErrorStatus,
|
|
48
|
+
getErrorMessage,
|
|
49
|
+
isAlreadyRegisteredError,
|
|
50
|
+
isUnauthorizedError,
|
|
51
|
+
isForbiddenError,
|
|
52
|
+
isNotFoundError,
|
|
53
|
+
isRateLimitError,
|
|
54
|
+
isServerError,
|
|
55
|
+
isNetworkError,
|
|
56
|
+
isRetryableError,
|
|
57
|
+
} from './utils/errorUtils';
|
|
58
|
+
|
|
59
|
+
// Network utilities
|
|
60
|
+
export {
|
|
61
|
+
DEFAULT_CIRCUIT_BREAKER_CONFIG,
|
|
62
|
+
createCircuitBreakerState,
|
|
63
|
+
calculateBackoffInterval,
|
|
64
|
+
recordFailure,
|
|
65
|
+
recordSuccess,
|
|
66
|
+
shouldAllowRequest,
|
|
67
|
+
delay,
|
|
68
|
+
withRetry,
|
|
69
|
+
} from './utils/networkUtils';
|
|
70
|
+
export type {
|
|
71
|
+
CircuitBreakerState,
|
|
72
|
+
CircuitBreakerConfig,
|
|
73
|
+
} from './utils/networkUtils';
|
|
74
|
+
|
|
75
|
+
// Debug utilities
|
|
76
|
+
export {
|
|
77
|
+
isDev,
|
|
78
|
+
debugLog,
|
|
79
|
+
debugWarn,
|
|
80
|
+
debugError,
|
|
81
|
+
createDebugLogger,
|
|
82
|
+
} from './utils/debugUtils';
|