@oxyhq/services 5.25.0 → 5.26.1
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/crypto/keyManager.js +16 -21
- package/lib/commonjs/crypto/keyManager.js.map +1 -1
- package/lib/commonjs/index.js +386 -18
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/lib/sonner.js +13 -17
- package/lib/commonjs/lib/sonner.js.map +1 -1
- package/lib/commonjs/lib/sonner.native.js +24 -0
- package/lib/commonjs/lib/sonner.native.js.map +1 -0
- package/lib/commonjs/lib/sonner.web.js +24 -0
- package/lib/commonjs/lib/sonner.web.js.map +1 -0
- 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/client.js +1 -1
- package/lib/commonjs/ui/components/BottomSheetRouter.js +1 -1
- package/lib/commonjs/ui/components/FollowButton.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 +10 -2
- 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/components/payment/PaymentDetailsStep.js +1 -1
- package/lib/commonjs/ui/context/OxyContext.js +3 -2
- package/lib/commonjs/ui/context/OxyContext.js.map +1 -1
- package/lib/commonjs/ui/hooks/mutations/mutationFactory.js +1 -1
- package/lib/commonjs/ui/hooks/mutations/useAccountMutations.js +1 -1
- package/lib/commonjs/ui/hooks/mutations/useServicesMutations.js +1 -1
- package/lib/commonjs/ui/hooks/useAsyncAction.js +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 +7 -13
- package/lib/commonjs/ui/hooks/useSessionSocket.js.map +1 -1
- package/lib/commonjs/ui/hooks/useSettingToggle.js +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 +8 -8
- package/lib/commonjs/ui/screens/AccountCenterScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountOverviewScreen.js +7 -7
- package/lib/commonjs/ui/screens/AccountOverviewScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountSettingsScreen.js +3 -3
- package/lib/commonjs/ui/screens/AccountSwitcherScreen.js +5 -5
- package/lib/commonjs/ui/screens/AccountSwitcherScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountVerificationScreen.js +1 -1
- package/lib/commonjs/ui/screens/AppInfoScreen.js +2 -2
- package/lib/commonjs/ui/screens/EditProfileFieldScreen.js +2 -2
- package/lib/commonjs/ui/screens/FAQScreen.js +1 -1
- package/lib/commonjs/ui/screens/FeedbackScreen.js +1 -1
- package/lib/commonjs/ui/screens/FileManagementScreen.js +2 -2
- 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 +2 -2
- package/lib/commonjs/ui/screens/HelpSupportScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/HistoryViewScreen.js +2 -2
- package/lib/commonjs/ui/screens/LanguageSelectorScreen.js +2 -2
- 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 +2 -2
- 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 +2 -2
- package/lib/commonjs/ui/screens/PrivacySettingsScreen.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 +2 -2
- package/lib/commonjs/ui/screens/SessionManagementScreen.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/WelcomeNewUserScreen.js +1 -1
- 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/fileManagement.js +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/utils/platform.js +129 -0
- package/lib/commonjs/utils/platform.js.map +1 -0
- package/lib/commonjs/web/WebOxyContext.js +273 -41
- 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/crypto/keyManager.js +16 -21
- package/lib/module/crypto/keyManager.js.map +1 -1
- package/lib/module/index.js +34 -3
- package/lib/module/index.js.map +1 -1
- package/lib/module/lib/sonner.js +11 -16
- package/lib/module/lib/sonner.js.map +1 -1
- package/lib/module/lib/sonner.native.js +19 -0
- package/lib/module/lib/sonner.native.js.map +1 -0
- package/lib/module/lib/sonner.web.js +19 -0
- package/lib/module/lib/sonner.web.js.map +1 -0
- 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/client.js +1 -1
- package/lib/module/ui/client.js.map +1 -1
- package/lib/module/ui/components/BottomSheetRouter.js +1 -1
- package/lib/module/ui/components/BottomSheetRouter.js.map +1 -1
- package/lib/module/ui/components/FollowButton.js +1 -1
- package/lib/module/ui/components/FollowButton.js.map +1 -1
- package/lib/module/ui/components/FontLoader.js +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 +10 -2
- 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/components/payment/PaymentDetailsStep.js +1 -1
- package/lib/module/ui/components/payment/PaymentDetailsStep.js.map +1 -1
- package/lib/module/ui/context/OxyContext.js +2 -2
- package/lib/module/ui/context/OxyContext.js.map +1 -1
- package/lib/module/ui/hooks/mutations/mutationFactory.js +1 -1
- package/lib/module/ui/hooks/mutations/mutationFactory.js.map +1 -1
- package/lib/module/ui/hooks/mutations/useAccountMutations.js +1 -1
- package/lib/module/ui/hooks/mutations/useAccountMutations.js.map +1 -1
- package/lib/module/ui/hooks/mutations/useServicesMutations.js +1 -1
- package/lib/module/ui/hooks/mutations/useServicesMutations.js.map +1 -1
- package/lib/module/ui/hooks/useAsyncAction.js +1 -1
- package/lib/module/ui/hooks/useAsyncAction.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 +7 -13
- package/lib/module/ui/hooks/useSessionSocket.js.map +1 -1
- package/lib/module/ui/hooks/useSettingToggle.js +1 -1
- package/lib/module/ui/hooks/useSettingToggle.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 +8 -8
- package/lib/module/ui/screens/AccountCenterScreen.js.map +1 -1
- package/lib/module/ui/screens/AccountOverviewScreen.js +7 -7
- package/lib/module/ui/screens/AccountOverviewScreen.js.map +1 -1
- package/lib/module/ui/screens/AccountSettingsScreen.js +3 -3
- package/lib/module/ui/screens/AccountSettingsScreen.js.map +1 -1
- package/lib/module/ui/screens/AccountSwitcherScreen.js +5 -5
- package/lib/module/ui/screens/AccountSwitcherScreen.js.map +1 -1
- package/lib/module/ui/screens/AccountVerificationScreen.js +1 -1
- package/lib/module/ui/screens/AccountVerificationScreen.js.map +1 -1
- package/lib/module/ui/screens/AppInfoScreen.js +2 -2
- package/lib/module/ui/screens/AppInfoScreen.js.map +1 -1
- package/lib/module/ui/screens/EditProfileFieldScreen.js +2 -2
- package/lib/module/ui/screens/EditProfileFieldScreen.js.map +1 -1
- package/lib/module/ui/screens/FAQScreen.js +1 -1
- package/lib/module/ui/screens/FAQScreen.js.map +1 -1
- package/lib/module/ui/screens/FeedbackScreen.js +1 -1
- package/lib/module/ui/screens/FeedbackScreen.js.map +1 -1
- package/lib/module/ui/screens/FileManagementScreen.js +2 -2
- 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 +2 -2
- package/lib/module/ui/screens/HelpSupportScreen.js.map +1 -1
- package/lib/module/ui/screens/HistoryViewScreen.js +2 -2
- package/lib/module/ui/screens/HistoryViewScreen.js.map +1 -1
- package/lib/module/ui/screens/LanguageSelectorScreen.js +2 -2
- 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 +2 -2
- 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 +2 -2
- package/lib/module/ui/screens/PremiumSubscriptionScreen.js.map +1 -1
- package/lib/module/ui/screens/PrivacySettingsScreen.js +1 -1
- package/lib/module/ui/screens/PrivacySettingsScreen.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 +2 -2
- package/lib/module/ui/screens/SavesCollectionsScreen.js.map +1 -1
- package/lib/module/ui/screens/SessionManagementScreen.js +1 -1
- package/lib/module/ui/screens/SessionManagementScreen.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/WelcomeNewUserScreen.js +1 -1
- package/lib/module/ui/screens/WelcomeNewUserScreen.js.map +1 -1
- 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/fileManagement.js +1 -1
- package/lib/module/ui/utils/fileManagement.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/utils/platform.js +118 -0
- package/lib/module/utils/platform.js.map +1 -0
- package/lib/module/web/WebOxyContext.js +272 -41
- 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/crypto/keyManager.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/lib/sonner.d.ts +11 -14
- package/lib/typescript/commonjs/lib/sonner.d.ts.map +1 -1
- package/lib/typescript/commonjs/lib/sonner.native.d.ts +15 -0
- package/lib/typescript/commonjs/lib/sonner.native.d.ts.map +1 -0
- package/lib/typescript/commonjs/lib/sonner.web.d.ts +15 -0
- package/lib/typescript/commonjs/lib/sonner.web.d.ts.map +1 -0
- 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/utils/platform.d.ts +41 -0
- package/lib/typescript/commonjs/utils/platform.d.ts.map +1 -0
- package/lib/typescript/commonjs/web/WebOxyContext.d.ts +117 -9
- package/lib/typescript/commonjs/web/WebOxyContext.d.ts.map +1 -1
- package/lib/typescript/commonjs/web/index.d.ts +19 -8
- 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/crypto/keyManager.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/lib/sonner.d.ts +11 -14
- package/lib/typescript/module/lib/sonner.d.ts.map +1 -1
- package/lib/typescript/module/lib/sonner.native.d.ts +15 -0
- package/lib/typescript/module/lib/sonner.native.d.ts.map +1 -0
- package/lib/typescript/module/lib/sonner.web.d.ts +15 -0
- package/lib/typescript/module/lib/sonner.web.d.ts.map +1 -0
- 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/utils/platform.d.ts +41 -0
- package/lib/typescript/module/utils/platform.d.ts.map +1 -0
- package/lib/typescript/module/web/WebOxyContext.d.ts +117 -9
- package/lib/typescript/module/web/WebOxyContext.d.ts.map +1 -1
- package/lib/typescript/module/web/index.d.ts +19 -8
- 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/crypto/keyManager.ts +16 -21
- package/src/index.ts +83 -12
- package/src/lib/sonner.native.ts +28 -0
- package/src/lib/sonner.ts +11 -28
- package/src/lib/sonner.web.ts +28 -0
- 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/utils/platform.ts +117 -0
- package/src/web/WebOxyContext.tsx +331 -41
- package/src/web/index.ts +76 -6
- 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/crypto/keyManager.ts
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
import { ec as EC } from 'elliptic';
|
|
9
9
|
import type { ECKeyPair } from 'elliptic';
|
|
10
|
-
import {
|
|
10
|
+
import { isWeb, isIOS, isAndroid } from '../utils/platform';
|
|
11
11
|
import { logger } from '../utils/loggerUtils';
|
|
12
12
|
|
|
13
13
|
// Lazy imports for React Native specific modules
|
|
@@ -80,12 +80,7 @@ function isNodeJS(): boolean {
|
|
|
80
80
|
* Identity storage is only available on native platforms (iOS/Android)
|
|
81
81
|
*/
|
|
82
82
|
function isWebPlatform(): boolean {
|
|
83
|
-
|
|
84
|
-
return Platform.OS === 'web';
|
|
85
|
-
} catch {
|
|
86
|
-
// Fallback if Platform is not available
|
|
87
|
-
return typeof window !== 'undefined' && typeof navigator !== 'undefined' && navigator.product !== 'ReactNative';
|
|
88
|
-
}
|
|
83
|
+
return isWeb();
|
|
89
84
|
}
|
|
90
85
|
|
|
91
86
|
async function initExpoCrypto(): Promise<typeof import('expo-crypto')> {
|
|
@@ -212,7 +207,7 @@ export class KeyManager {
|
|
|
212
207
|
const store = await initSecureStore();
|
|
213
208
|
const { privateKey, publicKey } = await KeyManager.generateKeyPair();
|
|
214
209
|
|
|
215
|
-
if (
|
|
210
|
+
if (isIOS()) {
|
|
216
211
|
// iOS: Store in shared keychain group
|
|
217
212
|
// Note: keychainAccessGroup requires Keychain Sharing capability in Xcode
|
|
218
213
|
try {
|
|
@@ -229,7 +224,7 @@ export class KeyManager {
|
|
|
229
224
|
`Failed to create shared identity on iOS. Ensure your app has the Keychain Sharing capability enabled with access group "${IOS_KEYCHAIN_GROUP}". Error: ${error}`
|
|
230
225
|
);
|
|
231
226
|
}
|
|
232
|
-
} else if (
|
|
227
|
+
} else if (isAndroid()) {
|
|
233
228
|
// Android: Store in secure store (accessible via sharedUserId)
|
|
234
229
|
// Note: All Oxy apps must have the same sharedUserId in AndroidManifest.xml
|
|
235
230
|
await store.setItemAsync(STORAGE_KEYS.SHARED_PRIVATE_KEY, privateKey, {
|
|
@@ -269,11 +264,11 @@ export class KeyManager {
|
|
|
269
264
|
const store = await initSecureStore();
|
|
270
265
|
let publicKey: string | null = null;
|
|
271
266
|
|
|
272
|
-
if (
|
|
267
|
+
if (isIOS()) {
|
|
273
268
|
publicKey = await store.getItemAsync(STORAGE_KEYS.SHARED_PUBLIC_KEY, {
|
|
274
269
|
keychainAccessGroup: IOS_KEYCHAIN_GROUP,
|
|
275
270
|
} as any);
|
|
276
|
-
} else if (
|
|
271
|
+
} else if (isAndroid()) {
|
|
277
272
|
publicKey = await store.getItemAsync(STORAGE_KEYS.SHARED_PUBLIC_KEY);
|
|
278
273
|
}
|
|
279
274
|
|
|
@@ -307,11 +302,11 @@ export class KeyManager {
|
|
|
307
302
|
const store = await initSecureStore();
|
|
308
303
|
let privateKey: string | null = null;
|
|
309
304
|
|
|
310
|
-
if (
|
|
305
|
+
if (isIOS()) {
|
|
311
306
|
privateKey = await store.getItemAsync(STORAGE_KEYS.SHARED_PRIVATE_KEY, {
|
|
312
307
|
keychainAccessGroup: IOS_KEYCHAIN_GROUP,
|
|
313
308
|
} as any);
|
|
314
|
-
} else if (
|
|
309
|
+
} else if (isAndroid()) {
|
|
315
310
|
privateKey = await store.getItemAsync(STORAGE_KEYS.SHARED_PRIVATE_KEY);
|
|
316
311
|
}
|
|
317
312
|
|
|
@@ -376,7 +371,7 @@ export class KeyManager {
|
|
|
376
371
|
const keyPair = ec.keyFromPrivate(privateKey);
|
|
377
372
|
const publicKey = keyPair.getPublic('hex');
|
|
378
373
|
|
|
379
|
-
if (
|
|
374
|
+
if (isIOS()) {
|
|
380
375
|
await store.setItemAsync(STORAGE_KEYS.SHARED_PRIVATE_KEY, privateKey, {
|
|
381
376
|
keychainAccessible: store.WHEN_UNLOCKED_THIS_DEVICE_ONLY,
|
|
382
377
|
keychainAccessGroup: IOS_KEYCHAIN_GROUP,
|
|
@@ -385,7 +380,7 @@ export class KeyManager {
|
|
|
385
380
|
await store.setItemAsync(STORAGE_KEYS.SHARED_PUBLIC_KEY, publicKey, {
|
|
386
381
|
keychainAccessGroup: IOS_KEYCHAIN_GROUP,
|
|
387
382
|
} as any);
|
|
388
|
-
} else if (
|
|
383
|
+
} else if (isAndroid()) {
|
|
389
384
|
await store.setItemAsync(STORAGE_KEYS.SHARED_PRIVATE_KEY, privateKey, {
|
|
390
385
|
keychainAccessible: store.WHEN_UNLOCKED_THIS_DEVICE_ONLY,
|
|
391
386
|
});
|
|
@@ -422,7 +417,7 @@ export class KeyManager {
|
|
|
422
417
|
try {
|
|
423
418
|
const store = await initSecureStore();
|
|
424
419
|
|
|
425
|
-
if (
|
|
420
|
+
if (isIOS()) {
|
|
426
421
|
await store.setItemAsync(STORAGE_KEYS.SHARED_SESSION_ID, sessionId, {
|
|
427
422
|
keychainAccessGroup: IOS_KEYCHAIN_GROUP,
|
|
428
423
|
} as any);
|
|
@@ -431,7 +426,7 @@ export class KeyManager {
|
|
|
431
426
|
keychainAccessible: store.WHEN_UNLOCKED,
|
|
432
427
|
keychainAccessGroup: IOS_KEYCHAIN_GROUP,
|
|
433
428
|
} as any);
|
|
434
|
-
} else if (
|
|
429
|
+
} else if (isAndroid()) {
|
|
435
430
|
await store.setItemAsync(STORAGE_KEYS.SHARED_SESSION_ID, sessionId);
|
|
436
431
|
await store.setItemAsync(STORAGE_KEYS.SHARED_SESSION_TOKEN, accessToken);
|
|
437
432
|
}
|
|
@@ -465,7 +460,7 @@ export class KeyManager {
|
|
|
465
460
|
let sessionId: string | null = null;
|
|
466
461
|
let accessToken: string | null = null;
|
|
467
462
|
|
|
468
|
-
if (
|
|
463
|
+
if (isIOS()) {
|
|
469
464
|
sessionId = await store.getItemAsync(STORAGE_KEYS.SHARED_SESSION_ID, {
|
|
470
465
|
keychainAccessGroup: IOS_KEYCHAIN_GROUP,
|
|
471
466
|
} as any);
|
|
@@ -473,7 +468,7 @@ export class KeyManager {
|
|
|
473
468
|
accessToken = await store.getItemAsync(STORAGE_KEYS.SHARED_SESSION_TOKEN, {
|
|
474
469
|
keychainAccessGroup: IOS_KEYCHAIN_GROUP,
|
|
475
470
|
} as any);
|
|
476
|
-
} else if (
|
|
471
|
+
} else if (isAndroid()) {
|
|
477
472
|
sessionId = await store.getItemAsync(STORAGE_KEYS.SHARED_SESSION_ID);
|
|
478
473
|
accessToken = await store.getItemAsync(STORAGE_KEYS.SHARED_SESSION_TOKEN);
|
|
479
474
|
}
|
|
@@ -505,14 +500,14 @@ export class KeyManager {
|
|
|
505
500
|
try {
|
|
506
501
|
const store = await initSecureStore();
|
|
507
502
|
|
|
508
|
-
if (
|
|
503
|
+
if (isIOS()) {
|
|
509
504
|
await store.deleteItemAsync(STORAGE_KEYS.SHARED_SESSION_ID, {
|
|
510
505
|
keychainAccessGroup: IOS_KEYCHAIN_GROUP,
|
|
511
506
|
} as any);
|
|
512
507
|
await store.deleteItemAsync(STORAGE_KEYS.SHARED_SESSION_TOKEN, {
|
|
513
508
|
keychainAccessGroup: IOS_KEYCHAIN_GROUP,
|
|
514
509
|
} as any);
|
|
515
|
-
} else if (
|
|
510
|
+
} else if (isAndroid()) {
|
|
516
511
|
await store.deleteItemAsync(STORAGE_KEYS.SHARED_SESSION_ID);
|
|
517
512
|
await store.deleteItemAsync(STORAGE_KEYS.SHARED_SESSION_TOKEN);
|
|
518
513
|
}
|
package/src/index.ts
CHANGED
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* OxyHQServices Main Export File - Universal (Frontend + Backend)
|
|
3
|
-
*
|
|
3
|
+
*
|
|
4
4
|
* This exports everything but uses environment detection to avoid crashes.
|
|
5
5
|
* - Frontend: Full UI + Core functionality
|
|
6
6
|
* - Backend: Core functionality only (UI components are no-ops)
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
+
// IMPORTANT: Initialize platform detection first (before any other imports that may use it)
|
|
10
|
+
// This allows core modules to detect the platform without importing react-native directly
|
|
11
|
+
import { setPlatformOS, type PlatformOS } from './utils/platform';
|
|
12
|
+
import { Platform } from 'react-native';
|
|
13
|
+
setPlatformOS(Platform.OS as PlatformOS);
|
|
14
|
+
|
|
9
15
|
// IMPORTANT: Import crypto module first to ensure polyfills are loaded
|
|
10
16
|
// before any other code that might use Buffer or other polyfilled APIs
|
|
11
17
|
import './crypto/polyfill';
|
|
@@ -39,6 +45,9 @@ export type { AuthState, AuthActions, UseAuthReturn } from './ui/hooks/useAuth';
|
|
|
39
45
|
// Streamlined provider with built-in bottom sheet
|
|
40
46
|
export { default as OxyProvider } from './ui/components/OxyProvider';
|
|
41
47
|
|
|
48
|
+
// Font loading utility
|
|
49
|
+
export { FontLoader } from './ui/components/FontLoader';
|
|
50
|
+
|
|
42
51
|
// Web-only provider (no React Native dependencies)
|
|
43
52
|
export { default as WebOxyProvider } from './ui/components/WebOxyProvider';
|
|
44
53
|
|
|
@@ -114,7 +123,7 @@ export type {
|
|
|
114
123
|
SecurityEventType,
|
|
115
124
|
SecurityEventSeverity,
|
|
116
125
|
SecurityActivity,
|
|
117
|
-
SecurityActivityResponse
|
|
126
|
+
SecurityActivityResponse,
|
|
118
127
|
} from './models/interfaces';
|
|
119
128
|
|
|
120
129
|
// Export security constants
|
|
@@ -145,6 +154,7 @@ export {
|
|
|
145
154
|
export { useSessionSocket } from './ui/hooks/useSessionSocket';
|
|
146
155
|
export { useAssets, setOxyAssetInstance } from './ui/hooks/useAssets';
|
|
147
156
|
export { useFileDownloadUrl, setOxyFileUrlInstance } from './ui/hooks/useFileDownloadUrl';
|
|
157
|
+
export { useFollow, useFollowerCounts } from './ui/hooks/useFollow';
|
|
148
158
|
|
|
149
159
|
// UI hooks - Query hooks (TanStack Query)
|
|
150
160
|
export {
|
|
@@ -204,6 +214,10 @@ export {
|
|
|
204
214
|
} from './ui/utils/authHelpers';
|
|
205
215
|
export type { HandleApiErrorOptions } from './ui/utils/authHelpers';
|
|
206
216
|
|
|
217
|
+
// Error handlers
|
|
218
|
+
export { handleAuthError, isInvalidSessionError, isTimeoutOrNetworkError, extractErrorMessage } from './ui/utils/errorHandlers';
|
|
219
|
+
export type { HandleAuthErrorOptions } from './ui/utils/errorHandlers';
|
|
220
|
+
|
|
207
221
|
// File filtering hook
|
|
208
222
|
export { useFileFiltering } from './ui/hooks/useFileFiltering';
|
|
209
223
|
export type { ViewMode, SortBy, SortOrder } from './ui/hooks/useFileFiltering';
|
|
@@ -212,19 +226,69 @@ export type { ViewMode, SortBy, SortOrder } from './ui/hooks/useFileFiltering';
|
|
|
212
226
|
export { OxySignInButton } from './ui/components/OxySignInButton';
|
|
213
227
|
export { OxyLogo, FollowButton } from './ui';
|
|
214
228
|
|
|
215
|
-
//
|
|
229
|
+
// Shared utilities (platform-agnostic)
|
|
230
|
+
export {
|
|
231
|
+
// Color utilities
|
|
232
|
+
darkenColor,
|
|
233
|
+
lightenColor,
|
|
234
|
+
hexToRgb,
|
|
235
|
+
rgbToHex,
|
|
236
|
+
withOpacity,
|
|
237
|
+
isLightColor,
|
|
238
|
+
getContrastTextColor,
|
|
239
|
+
} from './shared/utils/colorUtils';
|
|
240
|
+
|
|
241
|
+
export {
|
|
242
|
+
// Theme utilities
|
|
243
|
+
normalizeTheme,
|
|
244
|
+
normalizeColorScheme,
|
|
245
|
+
getOppositeTheme,
|
|
246
|
+
systemPrefersDarkMode,
|
|
247
|
+
getSystemColorScheme,
|
|
248
|
+
} from './shared/utils/themeUtils';
|
|
249
|
+
export type { ThemeValue } from './shared/utils/themeUtils';
|
|
250
|
+
|
|
251
|
+
export {
|
|
252
|
+
// Error utilities
|
|
253
|
+
HttpStatus,
|
|
254
|
+
getErrorStatus,
|
|
255
|
+
getErrorMessage,
|
|
256
|
+
isAlreadyRegisteredError,
|
|
257
|
+
isUnauthorizedError,
|
|
258
|
+
isForbiddenError,
|
|
259
|
+
isNotFoundError,
|
|
260
|
+
isRateLimitError,
|
|
261
|
+
isServerError,
|
|
262
|
+
isNetworkError,
|
|
263
|
+
isRetryableError,
|
|
264
|
+
} from './shared/utils/errorUtils';
|
|
265
|
+
|
|
266
|
+
export {
|
|
267
|
+
// Network utilities
|
|
268
|
+
DEFAULT_CIRCUIT_BREAKER_CONFIG,
|
|
269
|
+
createCircuitBreakerState,
|
|
270
|
+
calculateBackoffInterval,
|
|
271
|
+
recordFailure,
|
|
272
|
+
recordSuccess,
|
|
273
|
+
shouldAllowRequest,
|
|
274
|
+
delay,
|
|
275
|
+
withRetry,
|
|
276
|
+
} from './shared/utils/networkUtils';
|
|
277
|
+
export type { CircuitBreakerState, CircuitBreakerConfig } from './shared/utils/networkUtils';
|
|
278
|
+
|
|
279
|
+
// Other utilities
|
|
216
280
|
export * from './utils/apiUtils';
|
|
217
|
-
export {
|
|
218
|
-
ErrorCodes,
|
|
219
|
-
createApiError,
|
|
220
|
-
handleHttpError,
|
|
281
|
+
export {
|
|
282
|
+
ErrorCodes,
|
|
283
|
+
createApiError,
|
|
284
|
+
handleHttpError,
|
|
221
285
|
validateRequiredFields,
|
|
222
|
-
retryWithBackoff
|
|
223
286
|
} from './utils/errorUtils';
|
|
287
|
+
export { retryAsync } from './utils/asyncUtils';
|
|
224
288
|
export * from './utils/validationUtils';
|
|
225
|
-
export {
|
|
226
|
-
logger,
|
|
227
|
-
LogLevel,
|
|
289
|
+
export {
|
|
290
|
+
logger,
|
|
291
|
+
LogLevel,
|
|
228
292
|
LogContext,
|
|
229
293
|
logAuth,
|
|
230
294
|
logApi,
|
|
@@ -235,4 +299,11 @@ export {
|
|
|
235
299
|
logPerformance
|
|
236
300
|
} from './utils/loggerUtils';
|
|
237
301
|
export * from './utils/asyncUtils';
|
|
238
|
-
export * from './utils/hookUtils';
|
|
302
|
+
export * from './utils/hookUtils';
|
|
303
|
+
|
|
304
|
+
// Bottom sheet navigation
|
|
305
|
+
export { showBottomSheet, closeBottomSheet } from './ui/navigation/bottomSheetManager';
|
|
306
|
+
export type { RouteName } from './ui/navigation/routes';
|
|
307
|
+
|
|
308
|
+
// Sign-in modal
|
|
309
|
+
export { showSignInModal, hideSignInModal } from './ui/components/SignInModal';
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sonner Toast - Native Implementation
|
|
3
|
+
*
|
|
4
|
+
* This file is resolved by React Native bundlers (Metro)
|
|
5
|
+
* Only imports 'sonner-native', not 'sonner'
|
|
6
|
+
*/
|
|
7
|
+
import * as NativeSonner from 'sonner-native';
|
|
8
|
+
|
|
9
|
+
// Define proper types for the toast components
|
|
10
|
+
interface ToastFunction {
|
|
11
|
+
(message: string, options?: Record<string, unknown>): void;
|
|
12
|
+
success: (message: string, options?: Record<string, unknown>) => void;
|
|
13
|
+
error: (message: string, options?: Record<string, unknown>) => void;
|
|
14
|
+
info: (message: string, options?: Record<string, unknown>) => void;
|
|
15
|
+
warning: (message: string, options?: Record<string, unknown>) => void;
|
|
16
|
+
loading: (message: string, options?: Record<string, unknown>) => void;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
type ToasterComponent = (props?: Record<string, unknown>) => React.ReactElement | null;
|
|
20
|
+
|
|
21
|
+
const { toast: nativeToast, Toaster: NativeToaster } = NativeSonner as {
|
|
22
|
+
toast: ToastFunction;
|
|
23
|
+
Toaster: ToasterComponent;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export const toast = nativeToast;
|
|
27
|
+
export const Toaster = NativeToaster;
|
|
28
|
+
export type ToastT = typeof nativeToast;
|
package/src/lib/sonner.ts
CHANGED
|
@@ -1,28 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
loading: (message: string, options?: Record<string, unknown>) => void;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
type ToasterComponent = (props?: Record<string, unknown>) => React.ReactElement | null;
|
|
16
|
-
|
|
17
|
-
const { toast: webToast, Toaster: WebToaster } = WebSonner as {
|
|
18
|
-
toast: ToastFunction;
|
|
19
|
-
Toaster: ToasterComponent;
|
|
20
|
-
};
|
|
21
|
-
const { toast: nativeToast, Toaster: NativeToaster } = NativeSonner as {
|
|
22
|
-
toast: ToastFunction;
|
|
23
|
-
Toaster: ToasterComponent;
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
export const toast = Platform.OS === 'web' ? webToast : nativeToast;
|
|
27
|
-
export const Toaster = Platform.OS === 'web' ? WebToaster : NativeToaster;
|
|
28
|
-
export type ToastT = typeof webToast;
|
|
1
|
+
/**
|
|
2
|
+
* Sonner Toast - Platform-Agnostic Entry Point
|
|
3
|
+
*
|
|
4
|
+
* Bundlers resolve platform-specific implementations:
|
|
5
|
+
* - Metro (React Native): resolves to sonner.native.ts
|
|
6
|
+
* - Vite/Webpack (Web): resolves to sonner.web.ts
|
|
7
|
+
* - Node.js/SSR: uses this file (web fallback)
|
|
8
|
+
*
|
|
9
|
+
* This file exports web as the default for /core and /web entry points.
|
|
10
|
+
*/
|
|
11
|
+
export { toast, Toaster, type ToastT } from './sonner.web';
|