@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
|
@@ -2,49 +2,156 @@
|
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Web-Only Oxy Context
|
|
5
|
-
*
|
|
5
|
+
*
|
|
6
|
+
* Clean implementation with ZERO React Native dependencies.
|
|
7
|
+
* Provides FedCM, popup, and redirect authentication methods.
|
|
8
|
+
* Uses centralized AuthManager for token and session management.
|
|
9
|
+
*
|
|
10
|
+
* @module web/WebOxyContext
|
|
6
11
|
*/
|
|
7
12
|
|
|
8
|
-
import { createContext, useCallback, useContext, useEffect, useState } from 'react';
|
|
9
|
-
import { OxyServices } from "../core/
|
|
13
|
+
import { createContext, useCallback, useContext, useEffect, useMemo, useState } from 'react';
|
|
14
|
+
import { OxyServices } from "../core/OxyServices.js";
|
|
15
|
+
import { CrossDomainAuth } from "../core/CrossDomainAuth.js";
|
|
16
|
+
import { createAuthManager } from "../core/AuthManager.js";
|
|
10
17
|
import { QueryClientProvider } from '@tanstack/react-query';
|
|
11
18
|
import { createQueryClient } from "../ui/hooks/queryClient.js";
|
|
12
19
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
20
|
const WebOxyContext = /*#__PURE__*/createContext(null);
|
|
14
21
|
/**
|
|
15
22
|
* Web-only Oxy Provider
|
|
16
|
-
*
|
|
23
|
+
*
|
|
24
|
+
* Provides authentication context for pure web applications (React, Next.js, Vite).
|
|
25
|
+
* Supports FedCM, popup, and redirect authentication methods.
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```tsx
|
|
29
|
+
* import { WebOxyProvider, useAuth } from '@oxyhq/services/web';
|
|
30
|
+
*
|
|
31
|
+
* function App() {
|
|
32
|
+
* return (
|
|
33
|
+
* <WebOxyProvider baseURL="https://api.oxy.so">
|
|
34
|
+
* <YourApp />
|
|
35
|
+
* </WebOxyProvider>
|
|
36
|
+
* );
|
|
37
|
+
* }
|
|
38
|
+
*
|
|
39
|
+
* function LoginButton() {
|
|
40
|
+
* const { signIn, isLoading, isFedCMSupported } = useAuth();
|
|
41
|
+
* return (
|
|
42
|
+
* <button onClick={signIn} disabled={isLoading}>
|
|
43
|
+
* {isFedCMSupported() ? 'Sign in with Oxy' : 'Sign in'}
|
|
44
|
+
* </button>
|
|
45
|
+
* );
|
|
46
|
+
* }
|
|
47
|
+
* ```
|
|
17
48
|
*/
|
|
18
49
|
export function WebOxyProvider({
|
|
19
50
|
children,
|
|
20
51
|
baseURL,
|
|
21
52
|
authWebUrl,
|
|
22
|
-
onAuthStateChange
|
|
53
|
+
onAuthStateChange,
|
|
54
|
+
onError,
|
|
55
|
+
preferredAuthMethod = 'auto',
|
|
56
|
+
skipAutoCheck = false
|
|
23
57
|
}) {
|
|
58
|
+
// Initialize services with centralized AuthManager
|
|
24
59
|
const [oxyServices] = useState(() => new OxyServices({
|
|
25
60
|
baseURL,
|
|
26
61
|
authWebUrl
|
|
27
62
|
}));
|
|
63
|
+
const [crossDomainAuth] = useState(() => new CrossDomainAuth(oxyServices));
|
|
64
|
+
const [authManager] = useState(() => createAuthManager(oxyServices, {
|
|
65
|
+
autoRefresh: true
|
|
66
|
+
}));
|
|
67
|
+
const [queryClient] = useState(() => createQueryClient());
|
|
68
|
+
|
|
69
|
+
// Auth state
|
|
28
70
|
const [user, setUser] = useState(null);
|
|
29
|
-
const [isLoading, setIsLoading] = useState(
|
|
71
|
+
const [isLoading, setIsLoading] = useState(!skipAutoCheck);
|
|
30
72
|
const [error, setError] = useState(null);
|
|
31
|
-
const [queryClient] = useState(() => createQueryClient());
|
|
32
73
|
const isAuthenticated = !!user;
|
|
33
74
|
|
|
34
|
-
|
|
75
|
+
/**
|
|
76
|
+
* Handles successful authentication via AuthManager
|
|
77
|
+
*/
|
|
78
|
+
const handleAuthSuccess = useCallback(async (session, method = 'credentials') => {
|
|
79
|
+
// Use centralized AuthManager for token/session storage
|
|
80
|
+
await authManager.handleAuthSuccess(session, method);
|
|
81
|
+
|
|
82
|
+
// Fetch full user profile (session.user only contains MinimalUserData)
|
|
83
|
+
try {
|
|
84
|
+
const fullUser = await oxyServices.getCurrentUser();
|
|
85
|
+
if (fullUser) {
|
|
86
|
+
setUser(fullUser);
|
|
87
|
+
} else {
|
|
88
|
+
// Fallback to minimal data if full profile unavailable
|
|
89
|
+
setUser(session.user);
|
|
90
|
+
}
|
|
91
|
+
} catch {
|
|
92
|
+
// Fallback to minimal data on error
|
|
93
|
+
setUser(session.user);
|
|
94
|
+
}
|
|
95
|
+
setError(null);
|
|
96
|
+
setIsLoading(false);
|
|
97
|
+
}, [authManager, oxyServices]);
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Handles authentication errors
|
|
101
|
+
*/
|
|
102
|
+
const handleAuthError = useCallback(err => {
|
|
103
|
+
const errorMessage = err instanceof Error ? err.message : 'Authentication failed';
|
|
104
|
+
setError(errorMessage);
|
|
105
|
+
setIsLoading(false);
|
|
106
|
+
onError?.(err instanceof Error ? err : new Error(errorMessage));
|
|
107
|
+
}, [onError]);
|
|
108
|
+
|
|
109
|
+
// Initialize - check for existing session or redirect callback
|
|
35
110
|
useEffect(() => {
|
|
111
|
+
if (skipAutoCheck) return;
|
|
36
112
|
let mounted = true;
|
|
37
113
|
const initAuth = async () => {
|
|
38
114
|
try {
|
|
39
|
-
//
|
|
40
|
-
const
|
|
41
|
-
if (
|
|
42
|
-
|
|
115
|
+
// 1. Check for redirect callback (user returning from auth.oxy.so)
|
|
116
|
+
const callbackSession = crossDomainAuth.handleRedirectCallback();
|
|
117
|
+
if (callbackSession && mounted) {
|
|
118
|
+
await handleAuthSuccess(callbackSession, 'redirect');
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
// 2. Try to restore session from AuthManager (handles token refresh automatically)
|
|
123
|
+
const restoredUser = await authManager.initialize();
|
|
124
|
+
if (restoredUser && mounted) {
|
|
125
|
+
// Verify token is still valid by fetching current user
|
|
126
|
+
try {
|
|
127
|
+
const currentUser = await oxyServices.getCurrentUser();
|
|
128
|
+
if (mounted && currentUser) {
|
|
129
|
+
setUser(currentUser);
|
|
130
|
+
setIsLoading(false);
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
133
|
+
} catch {
|
|
134
|
+
// Token invalid, AuthManager will handle clearing
|
|
135
|
+
await authManager.signOut();
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
// 3. Try silent sign-in (FedCM or iframe-based SSO)
|
|
140
|
+
try {
|
|
141
|
+
const session = await crossDomainAuth.silentSignIn();
|
|
142
|
+
if (mounted && session?.user) {
|
|
143
|
+
await handleAuthSuccess(session, 'fedcm');
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
} catch {
|
|
147
|
+
// Silent sign-in failed, that's fine
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
// No session found
|
|
151
|
+
if (mounted) {
|
|
152
|
+
setIsLoading(false);
|
|
43
153
|
}
|
|
44
154
|
} catch (err) {
|
|
45
|
-
// No active session - this is fine
|
|
46
|
-
console.log('[WebOxy] No active session');
|
|
47
|
-
} finally {
|
|
48
155
|
if (mounted) {
|
|
49
156
|
setIsLoading(false);
|
|
50
157
|
}
|
|
@@ -54,86 +161,127 @@ export function WebOxyProvider({
|
|
|
54
161
|
return () => {
|
|
55
162
|
mounted = false;
|
|
56
163
|
};
|
|
57
|
-
}, [oxyServices]);
|
|
164
|
+
}, [oxyServices, crossDomainAuth, authManager, skipAutoCheck, handleAuthSuccess]);
|
|
58
165
|
|
|
59
166
|
// Notify parent of auth state changes
|
|
60
167
|
useEffect(() => {
|
|
61
168
|
onAuthStateChange?.(user);
|
|
62
169
|
}, [user, onAuthStateChange]);
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* Sign in with automatic method selection
|
|
173
|
+
*/
|
|
63
174
|
const signIn = useCallback(async () => {
|
|
64
175
|
setError(null);
|
|
65
176
|
setIsLoading(true);
|
|
177
|
+
let selectedMethod = 'popup';
|
|
66
178
|
try {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
179
|
+
const session = await crossDomainAuth.signIn({
|
|
180
|
+
method: preferredAuthMethod,
|
|
181
|
+
onMethodSelected: method => {
|
|
182
|
+
selectedMethod = method;
|
|
183
|
+
}
|
|
184
|
+
});
|
|
185
|
+
if (session) {
|
|
186
|
+
await handleAuthSuccess(session, selectedMethod);
|
|
187
|
+
} else {
|
|
188
|
+
// Redirect method - page will reload
|
|
189
|
+
setIsLoading(false);
|
|
71
190
|
}
|
|
191
|
+
} catch (err) {
|
|
192
|
+
handleAuthError(err);
|
|
193
|
+
}
|
|
194
|
+
}, [crossDomainAuth, preferredAuthMethod, handleAuthSuccess, handleAuthError]);
|
|
72
195
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
popup.close();
|
|
97
|
-
}
|
|
98
|
-
};
|
|
99
|
-
window.addEventListener('message', handleMessage);
|
|
100
|
-
|
|
101
|
-
// Check if popup was closed
|
|
102
|
-
const checkClosed = setInterval(() => {
|
|
103
|
-
if (popup.closed) {
|
|
104
|
-
clearInterval(checkClosed);
|
|
105
|
-
window.removeEventListener('message', handleMessage);
|
|
106
|
-
setIsLoading(false);
|
|
107
|
-
}
|
|
108
|
-
}, 500);
|
|
196
|
+
/**
|
|
197
|
+
* Sign in with FedCM specifically
|
|
198
|
+
*/
|
|
199
|
+
const signInWithFedCM = useCallback(async () => {
|
|
200
|
+
setError(null);
|
|
201
|
+
setIsLoading(true);
|
|
202
|
+
try {
|
|
203
|
+
const session = await crossDomainAuth.signInWithFedCM();
|
|
204
|
+
await handleAuthSuccess(session, 'fedcm');
|
|
205
|
+
} catch (err) {
|
|
206
|
+
handleAuthError(err);
|
|
207
|
+
}
|
|
208
|
+
}, [crossDomainAuth, handleAuthSuccess, handleAuthError]);
|
|
209
|
+
|
|
210
|
+
/**
|
|
211
|
+
* Sign in with popup specifically
|
|
212
|
+
*/
|
|
213
|
+
const signInWithPopup = useCallback(async () => {
|
|
214
|
+
setError(null);
|
|
215
|
+
setIsLoading(true);
|
|
216
|
+
try {
|
|
217
|
+
const session = await crossDomainAuth.signInWithPopup();
|
|
218
|
+
await handleAuthSuccess(session, 'popup');
|
|
109
219
|
} catch (err) {
|
|
110
|
-
|
|
111
|
-
setError(err instanceof Error ? err.message : 'Sign in failed');
|
|
112
|
-
setIsLoading(false);
|
|
220
|
+
handleAuthError(err);
|
|
113
221
|
}
|
|
114
|
-
}, [
|
|
222
|
+
}, [crossDomainAuth, handleAuthSuccess, handleAuthError]);
|
|
223
|
+
|
|
224
|
+
/**
|
|
225
|
+
* Sign in with redirect specifically
|
|
226
|
+
*/
|
|
227
|
+
const signInWithRedirect = useCallback(() => {
|
|
228
|
+
setError(null);
|
|
229
|
+
crossDomainAuth.signInWithRedirect({
|
|
230
|
+
redirectUri: typeof window !== 'undefined' ? window.location.href : undefined
|
|
231
|
+
});
|
|
232
|
+
}, [crossDomainAuth]);
|
|
233
|
+
|
|
234
|
+
/**
|
|
235
|
+
* Check if FedCM is supported
|
|
236
|
+
*/
|
|
237
|
+
const isFedCMSupported = useCallback(() => {
|
|
238
|
+
return crossDomainAuth.isFedCMSupported();
|
|
239
|
+
}, [crossDomainAuth]);
|
|
240
|
+
|
|
241
|
+
/**
|
|
242
|
+
* Sign out via AuthManager (handles FedCM revocation and storage cleanup)
|
|
243
|
+
*/
|
|
115
244
|
const signOut = useCallback(async () => {
|
|
116
245
|
setError(null);
|
|
117
246
|
try {
|
|
118
|
-
//
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
247
|
+
// Use centralized AuthManager for sign out (handles FedCM, storage cleanup)
|
|
248
|
+
await authManager.signOut();
|
|
249
|
+
|
|
250
|
+
// Clear user state
|
|
122
251
|
setUser(null);
|
|
123
252
|
} catch (err) {
|
|
124
|
-
|
|
125
|
-
setError(
|
|
253
|
+
const errorMessage = err instanceof Error ? err.message : 'Sign out failed';
|
|
254
|
+
setError(errorMessage);
|
|
255
|
+
onError?.(err instanceof Error ? err : new Error(errorMessage));
|
|
126
256
|
}
|
|
127
|
-
}, []);
|
|
128
|
-
|
|
257
|
+
}, [authManager, onError]);
|
|
258
|
+
|
|
259
|
+
// Cleanup on unmount
|
|
260
|
+
useEffect(() => {
|
|
261
|
+
return () => {
|
|
262
|
+
authManager.destroy();
|
|
263
|
+
};
|
|
264
|
+
}, [authManager]);
|
|
265
|
+
|
|
266
|
+
// Memoize context value to prevent unnecessary re-renders
|
|
267
|
+
const contextValue = useMemo(() => ({
|
|
268
|
+
// State
|
|
129
269
|
user,
|
|
130
270
|
isAuthenticated,
|
|
131
271
|
isLoading,
|
|
132
272
|
error,
|
|
273
|
+
// Services
|
|
274
|
+
oxyServices,
|
|
275
|
+
crossDomainAuth,
|
|
276
|
+
authManager,
|
|
277
|
+
// Actions
|
|
133
278
|
signIn,
|
|
279
|
+
signInWithFedCM,
|
|
280
|
+
signInWithPopup,
|
|
281
|
+
signInWithRedirect,
|
|
134
282
|
signOut,
|
|
135
|
-
|
|
136
|
-
};
|
|
283
|
+
isFedCMSupported
|
|
284
|
+
}), [user, isAuthenticated, isLoading, error, oxyServices, crossDomainAuth, authManager, signIn, signInWithFedCM, signInWithPopup, signInWithRedirect, signOut, isFedCMSupported]);
|
|
137
285
|
return /*#__PURE__*/_jsx(QueryClientProvider, {
|
|
138
286
|
client: queryClient,
|
|
139
287
|
children: /*#__PURE__*/_jsx(WebOxyContext.Provider, {
|
|
@@ -142,6 +290,13 @@ export function WebOxyProvider({
|
|
|
142
290
|
})
|
|
143
291
|
});
|
|
144
292
|
}
|
|
293
|
+
|
|
294
|
+
/**
|
|
295
|
+
* Hook to access the full Web Oxy context.
|
|
296
|
+
*
|
|
297
|
+
* @returns Full context value including oxyServices and crossDomainAuth
|
|
298
|
+
* @throws Error if used outside WebOxyProvider
|
|
299
|
+
*/
|
|
145
300
|
export function useWebOxy() {
|
|
146
301
|
const context = useContext(WebOxyContext);
|
|
147
302
|
if (!context) {
|
|
@@ -149,6 +304,39 @@ export function useWebOxy() {
|
|
|
149
304
|
}
|
|
150
305
|
return context;
|
|
151
306
|
}
|
|
307
|
+
|
|
308
|
+
/**
|
|
309
|
+
* Hook for authentication in web apps.
|
|
310
|
+
*
|
|
311
|
+
* Provides a simplified interface for common auth operations.
|
|
312
|
+
*
|
|
313
|
+
* @returns Auth state and actions
|
|
314
|
+
* @throws Error if used outside WebOxyProvider
|
|
315
|
+
*
|
|
316
|
+
* @example
|
|
317
|
+
* ```tsx
|
|
318
|
+
* function LoginPage() {
|
|
319
|
+
* const { user, isAuthenticated, isLoading, signIn, signOut, isFedCMSupported } = useAuth();
|
|
320
|
+
*
|
|
321
|
+
* if (isLoading) return <Spinner />;
|
|
322
|
+
*
|
|
323
|
+
* if (isAuthenticated) {
|
|
324
|
+
* return (
|
|
325
|
+
* <div>
|
|
326
|
+
* <p>Welcome, {user.username}!</p>
|
|
327
|
+
* <button onClick={signOut}>Sign Out</button>
|
|
328
|
+
* </div>
|
|
329
|
+
* );
|
|
330
|
+
* }
|
|
331
|
+
*
|
|
332
|
+
* return (
|
|
333
|
+
* <button onClick={signIn}>
|
|
334
|
+
* {isFedCMSupported() ? 'Sign in with Oxy' : 'Sign in'}
|
|
335
|
+
* </button>
|
|
336
|
+
* );
|
|
337
|
+
* }
|
|
338
|
+
* ```
|
|
339
|
+
*/
|
|
152
340
|
export function useAuth() {
|
|
153
341
|
const {
|
|
154
342
|
user,
|
|
@@ -156,18 +344,34 @@ export function useAuth() {
|
|
|
156
344
|
isLoading,
|
|
157
345
|
error,
|
|
158
346
|
signIn,
|
|
347
|
+
signInWithFedCM,
|
|
348
|
+
signInWithPopup,
|
|
349
|
+
signInWithRedirect,
|
|
159
350
|
signOut,
|
|
160
|
-
|
|
351
|
+
isFedCMSupported,
|
|
352
|
+
oxyServices,
|
|
353
|
+
authManager
|
|
161
354
|
} = useWebOxy();
|
|
162
355
|
return {
|
|
356
|
+
// State
|
|
163
357
|
user,
|
|
164
358
|
isAuthenticated,
|
|
165
359
|
isLoading,
|
|
166
360
|
isReady: !isLoading,
|
|
167
361
|
error,
|
|
362
|
+
// Actions
|
|
168
363
|
signIn,
|
|
364
|
+
signInWithFedCM,
|
|
365
|
+
signInWithPopup,
|
|
366
|
+
signInWithRedirect,
|
|
169
367
|
signOut,
|
|
170
|
-
|
|
368
|
+
// Utilities
|
|
369
|
+
isFedCMSupported,
|
|
370
|
+
oxyServices,
|
|
371
|
+
authManager
|
|
171
372
|
};
|
|
172
373
|
}
|
|
374
|
+
|
|
375
|
+
// Default export for convenience
|
|
376
|
+
export default WebOxyProvider;
|
|
173
377
|
//# sourceMappingURL=WebOxyContext.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createContext","useCallback","useContext","useEffect","useState","OxyServices","QueryClientProvider","createQueryClient","jsx","_jsx","WebOxyContext","WebOxyProvider","children","baseURL","authWebUrl","onAuthStateChange","oxyServices","user","setUser","isLoading","setIsLoading","error","setError","
|
|
1
|
+
{"version":3,"names":["createContext","useCallback","useContext","useEffect","useMemo","useState","OxyServices","CrossDomainAuth","createAuthManager","QueryClientProvider","createQueryClient","jsx","_jsx","WebOxyContext","WebOxyProvider","children","baseURL","authWebUrl","onAuthStateChange","onError","preferredAuthMethod","skipAutoCheck","oxyServices","crossDomainAuth","authManager","autoRefresh","queryClient","user","setUser","isLoading","setIsLoading","error","setError","isAuthenticated","handleAuthSuccess","session","method","fullUser","getCurrentUser","handleAuthError","err","errorMessage","Error","message","mounted","initAuth","callbackSession","handleRedirectCallback","restoredUser","initialize","currentUser","signOut","silentSignIn","signIn","selectedMethod","onMethodSelected","signInWithFedCM","signInWithPopup","signInWithRedirect","redirectUri","window","location","href","undefined","isFedCMSupported","destroy","contextValue","client","Provider","value","useWebOxy","context","useAuth","isReady"],"sourceRoot":"../../../src","sources":["web/WebOxyContext.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SACEA,aAAa,EACbC,WAAW,EACXC,UAAU,EACVC,SAAS,EACTC,OAAO,EACPC,QAAQ,QAEH,OAAO;AACd,SAASC,WAAW,QAAQ,wBAAqB;AACjD,SAASC,eAAe,QAAQ,4BAAyB;A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AC,GAAG8C,SAAS,CAAC,CAAC;EAEf,OAAO;IACL;IACA3C,IAAI;IACJM,eAAe;IACfJ,SAAS;IACT4C,OAAO,EAAE,CAAC5C,SAAS;IACnBE,KAAK;IACL;IACAsB,MAAM;IACNG,eAAe;IACfC,eAAe;IACfC,kBAAkB;IAClBP,OAAO;IACP;IACAa,gBAAgB;IAChB1C,WAAW;IACXE;EACF,CAAC;AACH;;AAEA;AACA,eAAeV,cAAc","ignoreList":[]}
|
package/lib/module/web/index.js
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* Features:
|
|
10
10
|
* - WebOxyProvider for React context
|
|
11
11
|
* - useAuth hook for authentication
|
|
12
|
-
* - Cross-domain SSO via FedCM
|
|
12
|
+
* - Cross-domain SSO via FedCM, popup, or redirect
|
|
13
13
|
* - Full TypeScript support
|
|
14
14
|
* - Zero bundler configuration needed
|
|
15
15
|
*
|
|
@@ -26,24 +26,45 @@
|
|
|
26
26
|
* }
|
|
27
27
|
*
|
|
28
28
|
* function YourApp() {
|
|
29
|
-
* const { user, isAuthenticated, signIn, signOut } = useAuth();
|
|
30
|
-
*
|
|
29
|
+
* const { user, isAuthenticated, signIn, signOut, isFedCMSupported } = useAuth();
|
|
30
|
+
*
|
|
31
|
+
* return (
|
|
32
|
+
* <button onClick={signIn}>
|
|
33
|
+
* {isFedCMSupported() ? 'Sign in with Oxy' : 'Sign in'}
|
|
34
|
+
* </button>
|
|
35
|
+
* );
|
|
31
36
|
* }
|
|
32
37
|
* ```
|
|
33
38
|
*/
|
|
34
39
|
|
|
35
40
|
// ==================== Core API ====================
|
|
36
41
|
// Re-export core services (zero React Native deps)
|
|
37
|
-
export { OxyServices, OxyAuthenticationError, OxyAuthenticationTimeoutError, OXY_CLOUD_URL, oxyClient, CrossDomainAuth, createCrossDomainAuth, DeviceManager
|
|
42
|
+
export { OxyServices, OxyAuthenticationError, OxyAuthenticationTimeoutError, OXY_CLOUD_URL, oxyClient, CrossDomainAuth, createCrossDomainAuth, DeviceManager,
|
|
43
|
+
// Centralized auth management
|
|
44
|
+
AuthManager, createAuthManager } from "../core/index.js";
|
|
38
45
|
// ==================== Web Components ====================
|
|
39
46
|
export { WebOxyProvider, useWebOxy, useAuth } from "./WebOxyContext.js";
|
|
47
|
+
// ==================== Shared Utilities ====================
|
|
48
|
+
// Re-export shared utilities that work everywhere
|
|
49
|
+
export {
|
|
50
|
+
// Color utilities
|
|
51
|
+
darkenColor, lightenColor, hexToRgb, rgbToHex, withOpacity, isLightColor, getContrastTextColor } from "../shared/utils/colorUtils.js";
|
|
52
|
+
export {
|
|
53
|
+
// Theme utilities
|
|
54
|
+
normalizeTheme, normalizeColorScheme, getOppositeTheme, systemPrefersDarkMode, getSystemColorScheme } from "../shared/utils/themeUtils.js";
|
|
55
|
+
export {
|
|
56
|
+
// Error utilities
|
|
57
|
+
HttpStatus, getErrorStatus, getErrorMessage, isAlreadyRegisteredError, isUnauthorizedError, isForbiddenError, isNotFoundError, isRateLimitError, isServerError, isNetworkError, isRetryableError } from "../shared/utils/errorUtils.js";
|
|
58
|
+
export {
|
|
59
|
+
// Network utilities
|
|
60
|
+
delay, withRetry } from "../shared/utils/networkUtils.js";
|
|
40
61
|
|
|
41
62
|
// ==================== Models & Types ====================
|
|
42
63
|
// Re-export commonly used types
|
|
43
64
|
|
|
44
65
|
// Re-export session types
|
|
45
66
|
|
|
46
|
-
// ==================== Utilities ====================
|
|
67
|
+
// ==================== Language Utilities ====================
|
|
47
68
|
export { SUPPORTED_LANGUAGES, getLanguageMetadata, getLanguageName, getNativeLanguageName, normalizeLanguageCode } from "../utils/languageUtils.js";
|
|
48
69
|
// Default export for convenience
|
|
49
70
|
import { WebOxyProvider } from "./WebOxyContext.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["OxyServices","OxyAuthenticationError","OxyAuthenticationTimeoutError","OXY_CLOUD_URL","oxyClient","CrossDomainAuth","createCrossDomainAuth","DeviceManager","WebOxyProvider","useWebOxy","useAuth","SUPPORTED_LANGUAGES","getLanguageMetadata","getLanguageName","getNativeLanguageName","normalizeLanguageCode"],"sourceRoot":"../../../src","sources":["web/index.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,SACEA,WAAW,EACXC,sBAAsB,EACtBC,6BAA6B,EAC7BC,aAAa,EACbC,SAAS,EACTC,eAAe,EACfC,qBAAqB,EACrBC,aAAa,
|
|
1
|
+
{"version":3,"names":["OxyServices","OxyAuthenticationError","OxyAuthenticationTimeoutError","OXY_CLOUD_URL","oxyClient","CrossDomainAuth","createCrossDomainAuth","DeviceManager","AuthManager","createAuthManager","WebOxyProvider","useWebOxy","useAuth","darkenColor","lightenColor","hexToRgb","rgbToHex","withOpacity","isLightColor","getContrastTextColor","normalizeTheme","normalizeColorScheme","getOppositeTheme","systemPrefersDarkMode","getSystemColorScheme","HttpStatus","getErrorStatus","getErrorMessage","isAlreadyRegisteredError","isUnauthorizedError","isForbiddenError","isNotFoundError","isRateLimitError","isServerError","isNetworkError","isRetryableError","delay","withRetry","SUPPORTED_LANGUAGES","getLanguageMetadata","getLanguageName","getNativeLanguageName","normalizeLanguageCode"],"sourceRoot":"../../../src","sources":["web/index.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,SACEA,WAAW,EACXC,sBAAsB,EACtBC,6BAA6B,EAC7BC,aAAa,EACbC,SAAS,EACTC,eAAe,EACfC,qBAAqB,EACrBC,aAAa;AACb;AACAC,WAAW,EACXC,iBAAiB,QACZ,kBAAS;AAahB;AACA,SACEC,cAAc,EACdC,SAAS,EACTC,OAAO,QACF,oBAAiB;AASxB;AACA;AACA;AACE;AACAC,WAAW,EACXC,YAAY,EACZC,QAAQ,EACRC,QAAQ,EACRC,WAAW,EACXC,YAAY,EACZC,oBAAoB,QACf,+BAA4B;AAEnC;AACE;AACAC,cAAc,EACdC,oBAAoB,EACpBC,gBAAgB,EAChBC,qBAAqB,EACrBC,oBAAoB,QACf,+BAA4B;AAGnC;AACE;AACAC,UAAU,EACVC,cAAc,EACdC,eAAe,EACfC,wBAAwB,EACxBC,mBAAmB,EACnBC,gBAAgB,EAChBC,eAAe,EACfC,gBAAgB,EAChBC,aAAa,EACbC,cAAc,EACdC,gBAAgB,QACX,+BAA4B;AAEnC;AACE;AACAC,KAAK,EACLC,SAAS,QACJ,iCAA8B;;AAErC;AACA;;AAiBA;;AAGA;AACA,SACEC,mBAAmB,EACnBC,mBAAmB,EACnBC,eAAe,EACfC,qBAAqB,EACrBC,qBAAqB,QAChB,2BAAwB;AAI/B;AACA,SAAShC,cAAc,QAAQ,oBAAiB;AAChD,eAAeA,cAAc","ignoreList":[]}
|
package/lib/module/web.js
CHANGED
|
@@ -67,7 +67,8 @@ export { useFileFiltering } from "./ui/hooks/useFileFiltering.js";
|
|
|
67
67
|
|
|
68
68
|
// Utilities
|
|
69
69
|
export * from "./utils/apiUtils.js";
|
|
70
|
-
export { ErrorCodes, createApiError, handleHttpError, validateRequiredFields
|
|
70
|
+
export { ErrorCodes, createApiError, handleHttpError, validateRequiredFields } from "./utils/errorUtils.js";
|
|
71
|
+
export { retryAsync } from "./utils/asyncUtils.js";
|
|
71
72
|
export * from "./utils/validationUtils.js";
|
|
72
73
|
export { logger, LogLevel, logAuth, logApi, logSession, logUser, logDevice, logPayment, logPerformance } from "./utils/loggerUtils.js";
|
|
73
74
|
export * from "./utils/asyncUtils.js";
|
package/lib/module/web.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["OxyServices","OxyAuthenticationError","OxyAuthenticationTimeoutError","OXY_CLOUD_URL","oxyClient","CrossDomainAuth","createCrossDomainAuth","KeyManager","SignatureService","RecoveryPhraseService","useOxy","useAuth","default","WebOxyProvider","DeviceManager","SUPPORTED_LANGUAGES","getLanguageMetadata","getLanguageName","getNativeLanguageName","normalizeLanguageCode","SECURITY_EVENT_SEVERITY_MAP","useAuthStore","useAssetStore","useAssets","useAssetsStore","useAsset","useUploadProgress","useAssetLoading","useAssetErrors","useAssetsByApp","useAssetsByEntity","useAssetUsageCount","useIsAssetLinked","useSessionSocket","setOxyAssetInstance","useFileDownloadUrl","setOxyFileUrlInstance","useUserProfile","useUserProfiles","useCurrentUser","useUserById","useUserByUsername","useUsersBySessions","usePrivacySettings","useSessions","useSession","useDeviceSessions","useUserDevices","useSecurityInfo","useSecurityActivity","useRecentSecurityActivity","useUpdateProfile","useUploadAvatar","useUpdateAccountSettings","useUpdatePrivacySettings","useUploadFile","useSwitchSession","useLogoutSession","useLogoutAll","useUpdateDeviceName","useRemoveDevice","createProfileMutation","createGenericMutation","ensureValidToken","withAuthErrorHandling","authenticatedApiCall","isAuthenticationError","SessionSyncRequiredError","AuthenticationFailedError","useFileFiltering","ErrorCodes","createApiError","handleHttpError","validateRequiredFields","
|
|
1
|
+
{"version":3,"names":["OxyServices","OxyAuthenticationError","OxyAuthenticationTimeoutError","OXY_CLOUD_URL","oxyClient","CrossDomainAuth","createCrossDomainAuth","KeyManager","SignatureService","RecoveryPhraseService","useOxy","useAuth","default","WebOxyProvider","DeviceManager","SUPPORTED_LANGUAGES","getLanguageMetadata","getLanguageName","getNativeLanguageName","normalizeLanguageCode","SECURITY_EVENT_SEVERITY_MAP","useAuthStore","useAssetStore","useAssets","useAssetsStore","useAsset","useUploadProgress","useAssetLoading","useAssetErrors","useAssetsByApp","useAssetsByEntity","useAssetUsageCount","useIsAssetLinked","useSessionSocket","setOxyAssetInstance","useFileDownloadUrl","setOxyFileUrlInstance","useUserProfile","useUserProfiles","useCurrentUser","useUserById","useUserByUsername","useUsersBySessions","usePrivacySettings","useSessions","useSession","useDeviceSessions","useUserDevices","useSecurityInfo","useSecurityActivity","useRecentSecurityActivity","useUpdateProfile","useUploadAvatar","useUpdateAccountSettings","useUpdatePrivacySettings","useUploadFile","useSwitchSession","useLogoutSession","useLogoutAll","useUpdateDeviceName","useRemoveDevice","createProfileMutation","createGenericMutation","ensureValidToken","withAuthErrorHandling","authenticatedApiCall","isAuthenticationError","SessionSyncRequiredError","AuthenticationFailedError","useFileFiltering","ErrorCodes","createApiError","handleHttpError","validateRequiredFields","retryAsync","logger","LogLevel","logAuth","logApi","logSession","logUser","logDevice","logPayment","logPerformance"],"sourceRoot":"../../src","sources":["web.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,OAAO,sBAAmB;;AAE1B;AACA,SAASA,WAAW,EAAEC,sBAAsB,EAAEC,6BAA6B,QAAQ,iBAAQ;AAC3F,SAASC,aAAa,EAAEC,SAAS,QAAQ,iBAAQ;;AAEjD;AACA,SAASC,eAAe,EAAEC,qBAAqB,QAAQ,iBAAQ;AAG/D;AACA,SACEC,UAAU,EACVC,gBAAgB,EAChBC,qBAAqB,QAChB,mBAAU;AAQjB;AACA,SAASC,MAAM,QAAQ,4BAAyB;AAChD,SAASC,OAAO,QAAQ,uBAAoB;AAG5C;AACA,SAASC,OAAO,IAAIC,cAAc,QAAQ,mCAAgC;;AAE1E;AACA,SAASC,aAAa,QAAQ,0BAAuB;AAGrD;AACA,SACEC,mBAAmB,EACnBC,mBAAmB,EACnBC,eAAe,EACfC,qBAAqB,EACrBC,qBAAqB,QAChB,0BAAuB;;AAG9B;;AAwDA,SAASC,2BAA2B,QAAQ,wBAAqB;AAQjE;AACA,SAASC,YAAY,QAAQ,0BAAuB;AACpD,SACEC,aAAa,EACbC,SAAS,IAAIC,cAAc,EAC3BC,QAAQ,EACRC,iBAAiB,EACjBC,eAA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