@oxyhq/services 22.13.0 → 23.0.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 +1 -1
- package/lib/commonjs/index.js +74 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/notifications/deviceNotifications.js +424 -0
- package/lib/commonjs/notifications/deviceNotifications.js.map +1 -0
- package/lib/commonjs/ui/boot/runProviderColdBoot.js +20 -64
- package/lib/commonjs/ui/boot/runProviderColdBoot.js.map +1 -1
- package/lib/commonjs/ui/components/AvatarCameraBadge.js +3 -2
- package/lib/commonjs/ui/components/AvatarCameraBadge.js.map +1 -1
- package/lib/commonjs/ui/components/OxyAuthChooser.js +5 -4
- package/lib/commonjs/ui/components/OxyAuthChooser.js.map +1 -1
- package/lib/commonjs/ui/components/OxyProvider.js +5 -6
- package/lib/commonjs/ui/components/OxyProvider.js.map +1 -1
- package/lib/commonjs/ui/components/OxySignInRequestSurface.js +147 -0
- package/lib/commonjs/ui/components/OxySignInRequestSurface.js.map +1 -0
- package/lib/commonjs/ui/components/ProfileButton.js +4 -3
- package/lib/commonjs/ui/components/ProfileButton.js.map +1 -1
- package/lib/commonjs/ui/components/SettingsIcon.js +3 -2
- package/lib/commonjs/ui/components/SettingsIcon.js.map +1 -1
- package/lib/commonjs/ui/components/authChooser/AccountsMenuView.js +7 -7
- package/lib/commonjs/ui/components/authChooser/AccountsMenuView.js.map +1 -1
- package/lib/commonjs/ui/components/authChooser/SignInEntryView.js.map +1 -1
- package/lib/commonjs/ui/components/authChooser/SignInRequestView.js +65 -103
- package/lib/commonjs/ui/components/authChooser/SignInRequestView.js.map +1 -1
- package/lib/commonjs/ui/components/authChooser/TroubleDisclosure.js +0 -2
- package/lib/commonjs/ui/components/authChooser/TroubleDisclosure.js.map +1 -1
- package/lib/commonjs/ui/components/authChooser/primitives.js +5 -4
- package/lib/commonjs/ui/components/authChooser/primitives.js.map +1 -1
- package/lib/commonjs/ui/components/authChooser/requestSurfaces.js +14 -10
- package/lib/commonjs/ui/components/authChooser/requestSurfaces.js.map +1 -1
- package/lib/commonjs/ui/components/authChooser/types.js +11 -0
- package/lib/commonjs/ui/components/authChooser/types.js.map +1 -1
- package/lib/commonjs/ui/components/fileManagement/AnimatedButton.js +3 -2
- package/lib/commonjs/ui/components/fileManagement/AnimatedButton.js.map +1 -1
- package/lib/commonjs/ui/components/fileManagement/FileDetailsModal.js +3 -2
- package/lib/commonjs/ui/components/fileManagement/FileDetailsModal.js.map +1 -1
- package/lib/commonjs/ui/components/fileManagement/FileViewer.js +15 -14
- package/lib/commonjs/ui/components/fileManagement/FileViewer.js.map +1 -1
- package/lib/commonjs/ui/components/fileManagement/UploadPreview.js +6 -5
- package/lib/commonjs/ui/components/fileManagement/UploadPreview.js.map +1 -1
- package/lib/commonjs/ui/components/modals/DeleteAccountModal.js +3 -2
- package/lib/commonjs/ui/components/modals/DeleteAccountModal.js.map +1 -1
- package/lib/commonjs/ui/components/payment/PaymentDetailsStep.js +6 -6
- package/lib/commonjs/ui/components/payment/PaymentDetailsStep.js.map +1 -1
- package/lib/commonjs/ui/components/payment/PaymentMethodStep.js +5 -5
- package/lib/commonjs/ui/components/payment/PaymentMethodStep.js.map +1 -1
- package/lib/commonjs/ui/components/payment/PaymentReviewStep.js +10 -9
- package/lib/commonjs/ui/components/payment/PaymentReviewStep.js.map +1 -1
- package/lib/commonjs/ui/components/payment/PaymentSuccessStep.js +4 -3
- package/lib/commonjs/ui/components/payment/PaymentSuccessStep.js.map +1 -1
- package/lib/commonjs/ui/components/payment/PaymentSummaryStep.js +6 -5
- package/lib/commonjs/ui/components/payment/PaymentSummaryStep.js.map +1 -1
- package/lib/commonjs/ui/components/styles/shadow.js.map +1 -1
- package/lib/commonjs/ui/context/OxyContext.js +14 -45
- package/lib/commonjs/ui/context/OxyContext.js.map +1 -1
- package/lib/commonjs/ui/context/commitSessionFlow.js +0 -43
- package/lib/commonjs/ui/context/commitSessionFlow.js.map +1 -1
- package/lib/commonjs/ui/context/useOxyAccountGraph.js +3 -4
- package/lib/commonjs/ui/context/useOxyAccountGraph.js.map +1 -1
- package/lib/commonjs/ui/hooks/queries/userCache.js +17 -17
- package/lib/commonjs/ui/hooks/queries/userCache.js.map +1 -1
- package/lib/commonjs/ui/hooks/useAssets.js.map +1 -1
- package/lib/commonjs/ui/hooks/useAuth.js +4 -2
- package/lib/commonjs/ui/hooks/useAuth.js.map +1 -1
- package/lib/commonjs/ui/hooks/useOnlineStatus.js +3 -2
- package/lib/commonjs/ui/hooks/useOnlineStatus.js.map +1 -1
- package/lib/commonjs/ui/hooks/useSessionManagement.js +0 -2
- package/lib/commonjs/ui/hooks/useSessionManagement.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountMembersScreen.js +4 -3
- package/lib/commonjs/ui/screens/AccountMembersScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/ConnectedAppsScreen.js +1 -1
- package/lib/commonjs/ui/screens/ConnectedAppsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/CreateAccountScreen.js +7 -6
- package/lib/commonjs/ui/screens/CreateAccountScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/EditProfileFieldScreen.js +4 -3
- package/lib/commonjs/ui/screens/EditProfileFieldScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/FAQScreen.js +3 -2
- package/lib/commonjs/ui/screens/FAQScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/FeedbackScreen.js +96 -96
- package/lib/commonjs/ui/screens/FeedbackScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/FileManagementScreen.js +19 -18
- package/lib/commonjs/ui/screens/FileManagementScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/HistoryViewScreen.js +4 -29
- package/lib/commonjs/ui/screens/HistoryViewScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/LanguageSelectorScreen.js +4 -3
- package/lib/commonjs/ui/screens/LanguageSelectorScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/ManageAccountScreen.js +2 -2
- package/lib/commonjs/ui/screens/ManageAccountScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/PaymentGatewayScreen.js +3 -3
- package/lib/commonjs/ui/screens/PaymentGatewayScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/PremiumSubscriptionScreen.js +10 -9
- package/lib/commonjs/ui/screens/PremiumSubscriptionScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/PrivacySettingsScreen.js +1 -0
- package/lib/commonjs/ui/screens/PrivacySettingsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/ProfileScreen.js +12 -13
- package/lib/commonjs/ui/screens/ProfileScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/UserListScreen.js +4 -4
- package/lib/commonjs/ui/screens/UserListScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/WelcomeNewUserScreen.js +6 -6
- package/lib/commonjs/ui/screens/WelcomeNewUserScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/fileManagement/FileLibraryError.js +4 -3
- package/lib/commonjs/ui/screens/fileManagement/FileLibraryError.js.map +1 -1
- package/lib/commonjs/ui/screens/fileManagement/FileListSection.js +4 -3
- package/lib/commonjs/ui/screens/fileManagement/FileListSection.js.map +1 -1
- package/lib/commonjs/ui/screens/fileManagement/PhotoPickerSection.js +5 -7
- package/lib/commonjs/ui/screens/fileManagement/PhotoPickerSection.js.map +1 -1
- package/lib/commonjs/ui/screens/fileManagement/UploadBar.js +3 -2
- package/lib/commonjs/ui/screens/fileManagement/UploadBar.js.map +1 -1
- package/lib/commonjs/ui/screens/trust/TrustCenterScreen.js +3 -2
- package/lib/commonjs/ui/screens/trust/TrustCenterScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/trust/TrustLeaderboardScreen.js +5 -4
- package/lib/commonjs/ui/screens/trust/TrustLeaderboardScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/trust/TrustRewardsScreen.js +4 -3
- package/lib/commonjs/ui/screens/trust/TrustRewardsScreen.js.map +1 -1
- package/lib/commonjs/ui/utils/fileManagement.js +24 -24
- package/lib/commonjs/ui/utils/fileManagement.js.map +1 -1
- package/lib/commonjs/ui/utils/netConnectivity.js +28 -0
- package/lib/commonjs/ui/utils/netConnectivity.js.map +1 -0
- package/lib/commonjs/ui/utils/oauthReturn.js +15 -28
- package/lib/commonjs/ui/utils/oauthReturn.js.map +1 -1
- package/lib/module/index.js +18 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/notifications/deviceNotifications.js +414 -0
- package/lib/module/notifications/deviceNotifications.js.map +1 -0
- package/lib/module/ui/boot/runProviderColdBoot.js +21 -65
- package/lib/module/ui/boot/runProviderColdBoot.js.map +1 -1
- package/lib/module/ui/components/AvatarCameraBadge.js +1 -1
- package/lib/module/ui/components/AvatarCameraBadge.js.map +1 -1
- package/lib/module/ui/components/OxyAuthChooser.js +5 -4
- package/lib/module/ui/components/OxyAuthChooser.js.map +1 -1
- package/lib/module/ui/components/OxyProvider.js +5 -6
- package/lib/module/ui/components/OxyProvider.js.map +1 -1
- package/lib/module/ui/components/OxySignInRequestSurface.js +141 -0
- package/lib/module/ui/components/OxySignInRequestSurface.js.map +1 -0
- package/lib/module/ui/components/ProfileButton.js +1 -1
- package/lib/module/ui/components/ProfileButton.js.map +1 -1
- package/lib/module/ui/components/SettingsIcon.js +1 -1
- package/lib/module/ui/components/SettingsIcon.js.map +1 -1
- package/lib/module/ui/components/authChooser/AccountsMenuView.js +1 -1
- package/lib/module/ui/components/authChooser/AccountsMenuView.js.map +1 -1
- package/lib/module/ui/components/authChooser/SignInEntryView.js.map +1 -1
- package/lib/module/ui/components/authChooser/SignInRequestView.js +66 -104
- package/lib/module/ui/components/authChooser/SignInRequestView.js.map +1 -1
- package/lib/module/ui/components/authChooser/TroubleDisclosure.js +0 -2
- package/lib/module/ui/components/authChooser/TroubleDisclosure.js.map +1 -1
- package/lib/module/ui/components/authChooser/primitives.js +1 -1
- package/lib/module/ui/components/authChooser/primitives.js.map +1 -1
- package/lib/module/ui/components/authChooser/requestSurfaces.js +13 -9
- package/lib/module/ui/components/authChooser/requestSurfaces.js.map +1 -1
- package/lib/module/ui/components/authChooser/types.js +11 -0
- package/lib/module/ui/components/authChooser/types.js.map +1 -1
- package/lib/module/ui/components/fileManagement/AnimatedButton.js +1 -1
- package/lib/module/ui/components/fileManagement/AnimatedButton.js.map +1 -1
- package/lib/module/ui/components/fileManagement/FileDetailsModal.js +1 -1
- package/lib/module/ui/components/fileManagement/FileDetailsModal.js.map +1 -1
- package/lib/module/ui/components/fileManagement/FileViewer.js +1 -1
- package/lib/module/ui/components/fileManagement/FileViewer.js.map +1 -1
- package/lib/module/ui/components/fileManagement/UploadPreview.js +1 -1
- package/lib/module/ui/components/fileManagement/UploadPreview.js.map +1 -1
- package/lib/module/ui/components/modals/DeleteAccountModal.js +1 -1
- package/lib/module/ui/components/modals/DeleteAccountModal.js.map +1 -1
- 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/components/payment/PaymentMethodStep.js +1 -1
- package/lib/module/ui/components/payment/PaymentMethodStep.js.map +1 -1
- package/lib/module/ui/components/payment/PaymentReviewStep.js +1 -1
- package/lib/module/ui/components/payment/PaymentReviewStep.js.map +1 -1
- package/lib/module/ui/components/payment/PaymentSuccessStep.js +1 -1
- package/lib/module/ui/components/payment/PaymentSuccessStep.js.map +1 -1
- package/lib/module/ui/components/payment/PaymentSummaryStep.js +1 -1
- package/lib/module/ui/components/payment/PaymentSummaryStep.js.map +1 -1
- package/lib/module/ui/components/styles/shadow.js.map +1 -1
- package/lib/module/ui/context/OxyContext.js +16 -47
- package/lib/module/ui/context/OxyContext.js.map +1 -1
- package/lib/module/ui/context/commitSessionFlow.js +0 -42
- package/lib/module/ui/context/commitSessionFlow.js.map +1 -1
- package/lib/module/ui/context/useOxyAccountGraph.js +3 -4
- package/lib/module/ui/context/useOxyAccountGraph.js.map +1 -1
- package/lib/module/ui/hooks/queries/userCache.js +17 -17
- package/lib/module/ui/hooks/queries/userCache.js.map +1 -1
- package/lib/module/ui/hooks/useAssets.js.map +1 -1
- package/lib/module/ui/hooks/useAuth.js +4 -2
- package/lib/module/ui/hooks/useAuth.js.map +1 -1
- package/lib/module/ui/hooks/useOnlineStatus.js +3 -2
- package/lib/module/ui/hooks/useOnlineStatus.js.map +1 -1
- package/lib/module/ui/hooks/useSessionManagement.js +0 -2
- package/lib/module/ui/hooks/useSessionManagement.js.map +1 -1
- package/lib/module/ui/screens/AccountMembersScreen.js +1 -1
- package/lib/module/ui/screens/AccountMembersScreen.js.map +1 -1
- package/lib/module/ui/screens/ConnectedAppsScreen.js +1 -1
- package/lib/module/ui/screens/ConnectedAppsScreen.js.map +1 -1
- package/lib/module/ui/screens/CreateAccountScreen.js +1 -1
- package/lib/module/ui/screens/CreateAccountScreen.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/FAQScreen.js +1 -1
- package/lib/module/ui/screens/FAQScreen.js.map +1 -1
- package/lib/module/ui/screens/FeedbackScreen.js +91 -90
- package/lib/module/ui/screens/FeedbackScreen.js.map +1 -1
- package/lib/module/ui/screens/FileManagementScreen.js +2 -1
- package/lib/module/ui/screens/FileManagementScreen.js.map +1 -1
- package/lib/module/ui/screens/HistoryViewScreen.js +4 -29
- 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/ManageAccountScreen.js +1 -1
- package/lib/module/ui/screens/ManageAccountScreen.js.map +1 -1
- package/lib/module/ui/screens/PaymentGatewayScreen.js +1 -1
- package/lib/module/ui/screens/PaymentGatewayScreen.js.map +1 -1
- package/lib/module/ui/screens/PremiumSubscriptionScreen.js +2 -2
- package/lib/module/ui/screens/PremiumSubscriptionScreen.js.map +1 -1
- package/lib/module/ui/screens/PrivacySettingsScreen.js +1 -0
- package/lib/module/ui/screens/PrivacySettingsScreen.js.map +1 -1
- package/lib/module/ui/screens/ProfileScreen.js +4 -5
- package/lib/module/ui/screens/ProfileScreen.js.map +1 -1
- package/lib/module/ui/screens/UserListScreen.js +3 -3
- package/lib/module/ui/screens/UserListScreen.js.map +1 -1
- package/lib/module/ui/screens/WelcomeNewUserScreen.js +5 -6
- package/lib/module/ui/screens/WelcomeNewUserScreen.js.map +1 -1
- package/lib/module/ui/screens/fileManagement/FileLibraryError.js +1 -1
- package/lib/module/ui/screens/fileManagement/FileLibraryError.js.map +1 -1
- package/lib/module/ui/screens/fileManagement/FileListSection.js +1 -1
- package/lib/module/ui/screens/fileManagement/FileListSection.js.map +1 -1
- package/lib/module/ui/screens/fileManagement/PhotoPickerSection.js +3 -5
- package/lib/module/ui/screens/fileManagement/PhotoPickerSection.js.map +1 -1
- package/lib/module/ui/screens/fileManagement/UploadBar.js +1 -1
- package/lib/module/ui/screens/fileManagement/UploadBar.js.map +1 -1
- package/lib/module/ui/screens/trust/TrustCenterScreen.js +1 -1
- package/lib/module/ui/screens/trust/TrustCenterScreen.js.map +1 -1
- package/lib/module/ui/screens/trust/TrustLeaderboardScreen.js +3 -3
- package/lib/module/ui/screens/trust/TrustLeaderboardScreen.js.map +1 -1
- package/lib/module/ui/screens/trust/TrustRewardsScreen.js +1 -1
- package/lib/module/ui/screens/trust/TrustRewardsScreen.js.map +1 -1
- package/lib/module/ui/utils/fileManagement.js +25 -25
- package/lib/module/ui/utils/fileManagement.js.map +1 -1
- package/lib/module/ui/utils/netConnectivity.js +23 -0
- package/lib/module/ui/utils/netConnectivity.js.map +1 -0
- package/lib/module/ui/utils/oauthReturn.js +15 -27
- package/lib/module/ui/utils/oauthReturn.js.map +1 -1
- package/lib/typescript/commonjs/index.d.ts +5 -0
- package/lib/typescript/commonjs/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/notifications/deviceNotifications.d.ts +173 -0
- package/lib/typescript/commonjs/notifications/deviceNotifications.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/boot/runProviderColdBoot.d.ts +11 -30
- package/lib/typescript/commonjs/ui/boot/runProviderColdBoot.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/OxyAuthChooser.d.ts +5 -3
- package/lib/typescript/commonjs/ui/components/OxyAuthChooser.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/OxyProvider.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/OxySignInRequestSurface.d.ts +108 -0
- package/lib/typescript/commonjs/ui/components/OxySignInRequestSurface.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/SettingsIcon.d.ts +1 -1
- package/lib/typescript/commonjs/ui/components/SettingsIcon.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/authChooser/SignInEntryView.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/authChooser/SignInRequestView.d.ts +18 -18
- package/lib/typescript/commonjs/ui/components/authChooser/SignInRequestView.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/authChooser/TroubleDisclosure.d.ts +3 -10
- package/lib/typescript/commonjs/ui/components/authChooser/TroubleDisclosure.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/authChooser/requestSurfaces.d.ts +8 -4
- package/lib/typescript/commonjs/ui/components/authChooser/requestSurfaces.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/authChooser/types.d.ts +18 -0
- package/lib/typescript/commonjs/ui/components/authChooser/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/payment/types.d.ts +6 -6
- package/lib/typescript/commonjs/ui/components/payment/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/context/OxyContext.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/context/commitSessionFlow.d.ts +0 -40
- package/lib/typescript/commonjs/ui/context/commitSessionFlow.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/context/oxyContextTypes.d.ts +4 -7
- package/lib/typescript/commonjs/ui/context/oxyContextTypes.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/context/useOxyAccountGraph.d.ts +0 -1
- package/lib/typescript/commonjs/ui/context/useOxyAccountGraph.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/queries/userCache.d.ts +2 -2
- package/lib/typescript/commonjs/ui/hooks/queries/userCache.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/useAssets.d.ts +1 -1
- package/lib/typescript/commonjs/ui/hooks/useAssets.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/useAsyncAction.d.ts +2 -2
- package/lib/typescript/commonjs/ui/hooks/useAsyncAction.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/useAuth.d.ts +4 -2
- package/lib/typescript/commonjs/ui/hooks/useAuth.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/useOnlineStatus.d.ts +3 -2
- package/lib/typescript/commonjs/ui/hooks/useOnlineStatus.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/useSessionManagement.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/FeedbackScreen.d.ts +2 -2
- package/lib/typescript/commonjs/ui/screens/FeedbackScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/FileManagementScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/HistoryViewScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/PrivacySettingsScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/ProfileScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/WelcomeNewUserScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/fileManagement/PhotoPickerSection.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/trust/TrustLeaderboardScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/types/navigation.d.ts +20 -19
- package/lib/typescript/commonjs/ui/types/navigation.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/utils/fileManagement.d.ts +5 -5
- package/lib/typescript/commonjs/ui/utils/fileManagement.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/utils/netConnectivity.d.ts +17 -0
- package/lib/typescript/commonjs/ui/utils/netConnectivity.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/utils/oauthReturn.d.ts +15 -12
- package/lib/typescript/commonjs/ui/utils/oauthReturn.d.ts.map +1 -1
- package/lib/typescript/module/index.d.ts +5 -0
- package/lib/typescript/module/index.d.ts.map +1 -1
- package/lib/typescript/module/notifications/deviceNotifications.d.ts +173 -0
- package/lib/typescript/module/notifications/deviceNotifications.d.ts.map +1 -0
- package/lib/typescript/module/ui/boot/runProviderColdBoot.d.ts +11 -30
- package/lib/typescript/module/ui/boot/runProviderColdBoot.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/OxyAuthChooser.d.ts +5 -3
- package/lib/typescript/module/ui/components/OxyAuthChooser.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/OxyProvider.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/OxySignInRequestSurface.d.ts +108 -0
- package/lib/typescript/module/ui/components/OxySignInRequestSurface.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/SettingsIcon.d.ts +1 -1
- package/lib/typescript/module/ui/components/SettingsIcon.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/authChooser/SignInEntryView.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/authChooser/SignInRequestView.d.ts +18 -18
- package/lib/typescript/module/ui/components/authChooser/SignInRequestView.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/authChooser/TroubleDisclosure.d.ts +3 -10
- package/lib/typescript/module/ui/components/authChooser/TroubleDisclosure.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/authChooser/requestSurfaces.d.ts +8 -4
- package/lib/typescript/module/ui/components/authChooser/requestSurfaces.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/authChooser/types.d.ts +18 -0
- package/lib/typescript/module/ui/components/authChooser/types.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/payment/types.d.ts +6 -6
- package/lib/typescript/module/ui/components/payment/types.d.ts.map +1 -1
- package/lib/typescript/module/ui/context/OxyContext.d.ts.map +1 -1
- package/lib/typescript/module/ui/context/commitSessionFlow.d.ts +0 -40
- package/lib/typescript/module/ui/context/commitSessionFlow.d.ts.map +1 -1
- package/lib/typescript/module/ui/context/oxyContextTypes.d.ts +4 -7
- package/lib/typescript/module/ui/context/oxyContextTypes.d.ts.map +1 -1
- package/lib/typescript/module/ui/context/useOxyAccountGraph.d.ts +0 -1
- package/lib/typescript/module/ui/context/useOxyAccountGraph.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/queries/userCache.d.ts +2 -2
- package/lib/typescript/module/ui/hooks/queries/userCache.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/useAssets.d.ts +1 -1
- package/lib/typescript/module/ui/hooks/useAssets.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/useAsyncAction.d.ts +2 -2
- package/lib/typescript/module/ui/hooks/useAsyncAction.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/useAuth.d.ts +4 -2
- package/lib/typescript/module/ui/hooks/useAuth.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/useOnlineStatus.d.ts +3 -2
- package/lib/typescript/module/ui/hooks/useOnlineStatus.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/useSessionManagement.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/FeedbackScreen.d.ts +2 -2
- package/lib/typescript/module/ui/screens/FeedbackScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/FileManagementScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/HistoryViewScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/PrivacySettingsScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/ProfileScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/WelcomeNewUserScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/fileManagement/PhotoPickerSection.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/trust/TrustLeaderboardScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/types/navigation.d.ts +20 -19
- package/lib/typescript/module/ui/types/navigation.d.ts.map +1 -1
- package/lib/typescript/module/ui/utils/fileManagement.d.ts +5 -5
- package/lib/typescript/module/ui/utils/fileManagement.d.ts.map +1 -1
- package/lib/typescript/module/ui/utils/netConnectivity.d.ts +17 -0
- package/lib/typescript/module/ui/utils/netConnectivity.d.ts.map +1 -0
- package/lib/typescript/module/ui/utils/oauthReturn.d.ts +15 -12
- package/lib/typescript/module/ui/utils/oauthReturn.d.ts.map +1 -1
- package/package.json +18 -8
- package/src/index.ts +32 -0
- package/src/notifications/deviceNotifications.ts +458 -0
- package/src/ui/boot/__tests__/coldBootNoIdpRedirect.test.ts +215 -0
- package/src/ui/boot/runProviderColdBoot.ts +24 -101
- package/src/ui/components/AvatarCameraBadge.tsx +1 -1
- package/src/ui/components/OxyAuthChooser.tsx +5 -4
- package/src/ui/components/OxyProvider.tsx +5 -6
- package/src/ui/components/OxySignInRequestSurface.tsx +202 -0
- package/src/ui/components/ProfileButton.tsx +1 -1
- package/src/ui/components/SettingsIcon.tsx +1 -1
- package/src/ui/components/authChooser/AccountsMenuView.tsx +1 -1
- package/src/ui/components/authChooser/SignInEntryView.tsx +9 -3
- package/src/ui/components/authChooser/SignInRequestView.tsx +78 -111
- package/src/ui/components/authChooser/TroubleDisclosure.tsx +3 -11
- package/src/ui/components/authChooser/primitives.tsx +1 -1
- package/src/ui/components/authChooser/requestSurfaces.tsx +15 -11
- package/src/ui/components/authChooser/types.ts +19 -0
- package/src/ui/components/fileManagement/AnimatedButton.tsx +1 -1
- package/src/ui/components/fileManagement/FileDetailsModal.tsx +1 -1
- package/src/ui/components/fileManagement/FileViewer.tsx +1 -1
- package/src/ui/components/fileManagement/UploadPreview.tsx +1 -1
- package/src/ui/components/modals/DeleteAccountModal.tsx +1 -1
- package/src/ui/components/payment/PaymentDetailsStep.tsx +1 -1
- package/src/ui/components/payment/PaymentMethodStep.tsx +1 -1
- package/src/ui/components/payment/PaymentReviewStep.tsx +1 -1
- package/src/ui/components/payment/PaymentSuccessStep.tsx +1 -1
- package/src/ui/components/payment/PaymentSummaryStep.tsx +1 -1
- package/src/ui/components/payment/types.ts +24 -24
- package/src/ui/components/styles/shadow.tsx +2 -2
- package/src/ui/context/OxyContext.tsx +15 -46
- package/src/ui/context/__tests__/commitSessionFlow.test.ts +0 -89
- package/src/ui/context/commitSessionFlow.ts +0 -61
- package/src/ui/context/oxyContextTypes.ts +4 -7
- package/src/ui/context/useOxyAccountGraph.ts +4 -4
- package/src/ui/hooks/queries/userCache.ts +169 -148
- package/src/ui/hooks/useAssets.ts +1 -1
- package/src/ui/hooks/useAsyncAction.ts +2 -2
- package/src/ui/hooks/useAuth.ts +4 -2
- package/src/ui/hooks/useOnlineStatus.ts +3 -2
- package/src/ui/hooks/useSessionManagement.ts +0 -2
- package/src/ui/screens/AccountMembersScreen.tsx +1 -1
- package/src/ui/screens/ConnectedAppsScreen.tsx +1 -1
- package/src/ui/screens/CreateAccountScreen.tsx +1 -1
- package/src/ui/screens/EditProfileFieldScreen.tsx +1 -1
- package/src/ui/screens/FAQScreen.tsx +1 -1
- package/src/ui/screens/FeedbackScreen.tsx +740 -574
- package/src/ui/screens/FileManagementScreen.tsx +2 -1
- package/src/ui/screens/HistoryViewScreen.tsx +4 -19
- package/src/ui/screens/LanguageSelectorScreen.tsx +1 -1
- package/src/ui/screens/ManageAccountScreen.tsx +1 -1
- package/src/ui/screens/PaymentGatewayScreen.tsx +1 -1
- package/src/ui/screens/PremiumSubscriptionScreen.tsx +2 -2
- package/src/ui/screens/PrivacySettingsScreen.tsx +1 -0
- package/src/ui/screens/ProfileScreen.tsx +6 -4
- package/src/ui/screens/UserListScreen.tsx +3 -3
- package/src/ui/screens/WelcomeNewUserScreen.tsx +6 -6
- package/src/ui/screens/fileManagement/FileLibraryError.tsx +1 -1
- package/src/ui/screens/fileManagement/FileListSection.tsx +1 -1
- package/src/ui/screens/fileManagement/PhotoPickerSection.tsx +3 -2
- package/src/ui/screens/fileManagement/UploadBar.tsx +1 -1
- package/src/ui/screens/trust/TrustCenterScreen.tsx +1 -1
- package/src/ui/screens/trust/TrustLeaderboardScreen.tsx +4 -3
- package/src/ui/screens/trust/TrustRewardsScreen.tsx +1 -1
- package/src/ui/types/navigation.ts +20 -19
- package/src/ui/utils/fileManagement.ts +108 -92
- package/src/ui/utils/netConnectivity.ts +27 -0
- package/src/ui/utils/oauthReturn.ts +15 -30
- package/lib/commonjs/ui/oauth/legacyRedirectLanes.js +0 -48
- package/lib/commonjs/ui/oauth/legacyRedirectLanes.js.map +0 -1
- package/lib/commonjs/ui/utils/crossOriginRestore.js +0 -140
- package/lib/commonjs/ui/utils/crossOriginRestore.js.map +0 -1
- package/lib/module/ui/oauth/legacyRedirectLanes.js +0 -44
- package/lib/module/ui/oauth/legacyRedirectLanes.js.map +0 -1
- package/lib/module/ui/utils/crossOriginRestore.js +0 -131
- package/lib/module/ui/utils/crossOriginRestore.js.map +0 -1
- package/lib/typescript/commonjs/ui/oauth/legacyRedirectLanes.d.ts +0 -40
- package/lib/typescript/commonjs/ui/oauth/legacyRedirectLanes.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/utils/crossOriginRestore.d.ts +0 -43
- package/lib/typescript/commonjs/ui/utils/crossOriginRestore.d.ts.map +0 -1
- package/lib/typescript/module/ui/oauth/legacyRedirectLanes.d.ts +0 -40
- package/lib/typescript/module/ui/oauth/legacyRedirectLanes.d.ts.map +0 -1
- package/lib/typescript/module/ui/utils/crossOriginRestore.d.ts +0 -43
- package/lib/typescript/module/ui/utils/crossOriginRestore.d.ts.map +0 -1
- package/src/ui/boot/__tests__/coldBootWebAuthMode.test.ts +0 -281
- package/src/ui/oauth/legacyRedirectLanes.ts +0 -43
- package/src/ui/utils/__tests__/crossOriginRestore.test.ts +0 -160
- package/src/ui/utils/crossOriginRestore.ts +0 -168
|
@@ -0,0 +1,458 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The ONE place `@oxyhq/services` touches `expo-notifications`.
|
|
3
|
+
*
|
|
4
|
+
* Every Oxy app that receives push needs the identical adapter — native-only,
|
|
5
|
+
* dynamically imported, reading the OS permission and minting an EXPO push
|
|
6
|
+
* token — so it lives here instead of being copied into each app. The
|
|
7
|
+
* bearer-authenticated transport (`registerPushToken` / `unregisterPushToken`)
|
|
8
|
+
* already lives in `@oxyhq/core`; core may never import an `expo-*` module, and
|
|
9
|
+
* this adapter is the Expo-side half that closes that gap.
|
|
10
|
+
*
|
|
11
|
+
* ## Native-only by construction
|
|
12
|
+
*
|
|
13
|
+
* Every entry point resolves its null/no-op result from `Platform.OS` BEFORE the
|
|
14
|
+
* dynamic `import()`, so a web bundle never requests `expo-notifications` at all.
|
|
15
|
+
* `expo-notifications` and `expo-constants` are OPTIONAL peer dependencies: an
|
|
16
|
+
* app that does not use push never installs them, and a build without them
|
|
17
|
+
* degrades to "notifications unavailable" rather than throwing at
|
|
18
|
+
* module-evaluation time.
|
|
19
|
+
*
|
|
20
|
+
* ## The token is an EXPO push token — never a raw device token
|
|
21
|
+
*
|
|
22
|
+
* {@link getExpoPushToken} calls `getExpoPushTokenAsync()`, which returns the
|
|
23
|
+
* `ExponentPushToken[…]` handle Expo's push service delivers through — the only
|
|
24
|
+
* form it accepts. `getDevicePushTokenAsync()` — the raw APNs/FCM token — is
|
|
25
|
+
* deliberately NOT used anywhere: registering one of those looks entirely
|
|
26
|
+
* successful (the row is stored, the endpoint returns 200) and then every push
|
|
27
|
+
* silently fails at delivery time. `@oxyhq/core`'s `registerPushToken` rejects a
|
|
28
|
+
* raw device token before sending, and this module is the reason it never has to.
|
|
29
|
+
*
|
|
30
|
+
* ## The payload is untrusted
|
|
31
|
+
*
|
|
32
|
+
* Nothing here surfaces a notification's `title` / `body` / `subtitle`. The only
|
|
33
|
+
* payload that leaves this module is the raw `content.data` — the routing keys —
|
|
34
|
+
* typed `unknown`, so a caller has to validate it before acting on it and there
|
|
35
|
+
* is no exported shape that invites rendering push-delivered text. The
|
|
36
|
+
* foreground handler likewise answers with a visibility verdict and nothing else.
|
|
37
|
+
*/
|
|
38
|
+
|
|
39
|
+
import { createLogger } from '@oxyhq/core';
|
|
40
|
+
import type { PushTokenPlatform } from '@oxyhq/core';
|
|
41
|
+
import { Platform } from 'react-native';
|
|
42
|
+
|
|
43
|
+
const log = createLogger('deviceNotifications');
|
|
44
|
+
|
|
45
|
+
type NotificationsModule = typeof import('expo-notifications');
|
|
46
|
+
type ConstantsModule = typeof import('expo-constants');
|
|
47
|
+
|
|
48
|
+
function isRecord(value: unknown): value is Record<string, unknown> {
|
|
49
|
+
return typeof value === 'object' && value !== null;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Load `expo-notifications`, or `null` when it cannot serve this platform/build.
|
|
54
|
+
*
|
|
55
|
+
* The web guard runs before the `import()`, so a web bundle never reaches for the
|
|
56
|
+
* native module. The dynamic import is intentional: the module registry caches
|
|
57
|
+
* it, so repeated calls are cheap and no module-level mutable cache is
|
|
58
|
+
* introduced here.
|
|
59
|
+
*/
|
|
60
|
+
async function loadNotifications(): Promise<NotificationsModule | null> {
|
|
61
|
+
if (Platform.OS === 'web') {
|
|
62
|
+
return null;
|
|
63
|
+
}
|
|
64
|
+
try {
|
|
65
|
+
return await import('expo-notifications');
|
|
66
|
+
} catch (error) {
|
|
67
|
+
log.warn(
|
|
68
|
+
'expo-notifications is unavailable in this build — push is disabled',
|
|
69
|
+
{ method: 'loadNotifications' },
|
|
70
|
+
error,
|
|
71
|
+
);
|
|
72
|
+
return null;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* The EAS project id an Expo push token is minted against, or `null` when the
|
|
78
|
+
* app config carries none.
|
|
79
|
+
*
|
|
80
|
+
* Resolved exactly the way `expo-notifications` resolves it internally
|
|
81
|
+
* (`easConfig.projectId`, then `expoConfig.extra.eas.projectId`) and then handed
|
|
82
|
+
* BACK to `getExpoPushTokenAsync` explicitly, so the two can never disagree.
|
|
83
|
+
* Reading it here is what turns "no project id" from an opaque
|
|
84
|
+
* `ERR_NOTIFICATIONS_NO_EXPERIENCE_ID` rejection into a named, actionable state
|
|
85
|
+
* instead of one more entry in the indistinguishable "permission denied /
|
|
86
|
+
* offline" bucket.
|
|
87
|
+
*
|
|
88
|
+
* A missing `expo-constants` lands on the same `null` outcome — the single
|
|
89
|
+
* actionable warning is emitted once by the caller, so this path only records
|
|
90
|
+
* the extra detail at debug level rather than warning twice for one condition.
|
|
91
|
+
*/
|
|
92
|
+
async function easProjectId(): Promise<string | null> {
|
|
93
|
+
let constants: ConstantsModule['default'];
|
|
94
|
+
try {
|
|
95
|
+
constants = (await import('expo-constants')).default;
|
|
96
|
+
} catch (error) {
|
|
97
|
+
log.debug(
|
|
98
|
+
'expo-constants is unavailable in this build — no EAS project id can be resolved',
|
|
99
|
+
{ method: 'easProjectId' },
|
|
100
|
+
error,
|
|
101
|
+
);
|
|
102
|
+
return null;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
const fromEasConfig = constants.easConfig?.projectId;
|
|
106
|
+
if (typeof fromEasConfig === 'string' && fromEasConfig.length > 0) {
|
|
107
|
+
return fromEasConfig;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
const extra: unknown = constants.expoConfig?.extra;
|
|
111
|
+
const eas = isRecord(extra) ? extra.eas : undefined;
|
|
112
|
+
const projectId = isRecord(eas) ? eas.projectId : undefined;
|
|
113
|
+
return typeof projectId === 'string' && projectId.length > 0 ? projectId : null;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* The platform tag the push-token registry stores this installation under, or
|
|
118
|
+
* `null` on a platform Oxy does not deliver push to.
|
|
119
|
+
*
|
|
120
|
+
* Synchronous and import-free — the answer is a property of the bundle, not of
|
|
121
|
+
* any native module.
|
|
122
|
+
*
|
|
123
|
+
* Web is `null` on purpose: the registry accepts a `web` platform, but browser
|
|
124
|
+
* push needs a VAPID key + service-worker subscription no Oxy app has wired, so
|
|
125
|
+
* there is no token to register and claiming otherwise would store a row nothing
|
|
126
|
+
* can ever deliver to.
|
|
127
|
+
*/
|
|
128
|
+
export function pushTokenPlatform(): PushTokenPlatform | null {
|
|
129
|
+
return Platform.OS === 'ios' || Platform.OS === 'android' ? Platform.OS : null;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Whether the OS notification permission is ALREADY granted.
|
|
134
|
+
*
|
|
135
|
+
* Never prompts, so an app can re-check on every cold boot without ever asking
|
|
136
|
+
* the user twice. Use {@link requestNotificationPermission} for the one place
|
|
137
|
+
* that is allowed to show the system dialog.
|
|
138
|
+
*/
|
|
139
|
+
export async function hasNotificationPermission(): Promise<boolean> {
|
|
140
|
+
const notifications = await loadNotifications();
|
|
141
|
+
if (!notifications) {
|
|
142
|
+
return false;
|
|
143
|
+
}
|
|
144
|
+
try {
|
|
145
|
+
const permissions = await notifications.getPermissionsAsync();
|
|
146
|
+
return permissions.granted === true;
|
|
147
|
+
} catch (error) {
|
|
148
|
+
log.warn(
|
|
149
|
+
'could not read the notification permission',
|
|
150
|
+
{ method: 'hasNotificationPermission' },
|
|
151
|
+
error,
|
|
152
|
+
);
|
|
153
|
+
return false;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* Ensure the OS notification permission, prompting at most once.
|
|
159
|
+
*
|
|
160
|
+
* An installation that already answered the system dialog is never asked again:
|
|
161
|
+
* an already-granted permission resolves `true` without a second dialog, and a
|
|
162
|
+
* denial with `canAskAgain: false` resolves `false` without issuing a request
|
|
163
|
+
* the OS would silently ignore.
|
|
164
|
+
*
|
|
165
|
+
* @returns Whether notifications are granted once this call is done.
|
|
166
|
+
*/
|
|
167
|
+
export async function requestNotificationPermission(): Promise<boolean> {
|
|
168
|
+
const notifications = await loadNotifications();
|
|
169
|
+
if (!notifications) {
|
|
170
|
+
return false;
|
|
171
|
+
}
|
|
172
|
+
try {
|
|
173
|
+
const existing = await notifications.getPermissionsAsync();
|
|
174
|
+
if (existing.granted === true) {
|
|
175
|
+
return true;
|
|
176
|
+
}
|
|
177
|
+
if (existing.canAskAgain === false) {
|
|
178
|
+
return false;
|
|
179
|
+
}
|
|
180
|
+
const requested = await notifications.requestPermissionsAsync();
|
|
181
|
+
return requested.granted === true;
|
|
182
|
+
} catch (error) {
|
|
183
|
+
log.warn(
|
|
184
|
+
'the notification permission could not be resolved',
|
|
185
|
+
{ method: 'requestNotificationPermission' },
|
|
186
|
+
error,
|
|
187
|
+
);
|
|
188
|
+
return false;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
/**
|
|
193
|
+
* This installation's Expo push token (`ExponentPushToken[…]`), or `null` when
|
|
194
|
+
* one cannot be minted.
|
|
195
|
+
*
|
|
196
|
+
* Deliberately `getExpoPushTokenAsync` — see the module header for why the raw
|
|
197
|
+
* device-token variant is never used.
|
|
198
|
+
*
|
|
199
|
+
* Every `null` is logged with the reason it happened. A missing EAS project id
|
|
200
|
+
* in particular is a BUILD MISCONFIGURATION, not a user state: no token can ever
|
|
201
|
+
* be minted, so push is off for every install of that build until the config is
|
|
202
|
+
* fixed. It is reported as such rather than blending into the
|
|
203
|
+
* indistinguishable "permission denied / offline" bucket.
|
|
204
|
+
*/
|
|
205
|
+
export async function getExpoPushToken(): Promise<string | null> {
|
|
206
|
+
const notifications = await loadNotifications();
|
|
207
|
+
if (!notifications) {
|
|
208
|
+
return null;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
const projectId = await easProjectId();
|
|
212
|
+
if (!projectId) {
|
|
213
|
+
log.warn(
|
|
214
|
+
'no EAS project id in the app config (expo.extra.eas.projectId) — an Expo push token cannot be minted, so push is disabled for this build',
|
|
215
|
+
{ method: 'getExpoPushToken' },
|
|
216
|
+
);
|
|
217
|
+
return null;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
try {
|
|
221
|
+
const token = await notifications.getExpoPushTokenAsync({ projectId });
|
|
222
|
+
if (token.data.length === 0) {
|
|
223
|
+
log.warn('the Expo push service returned an empty token', { method: 'getExpoPushToken' });
|
|
224
|
+
return null;
|
|
225
|
+
}
|
|
226
|
+
return token.data;
|
|
227
|
+
} catch (error) {
|
|
228
|
+
log.warn('could not mint an Expo push token', { method: 'getExpoPushToken' }, error);
|
|
229
|
+
return null;
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
/**
|
|
234
|
+
* Take the payload of the notification that COLD-LAUNCHED the app, if any.
|
|
235
|
+
*
|
|
236
|
+
* "Take" is literal: the response is cleared from `expo-notifications` once
|
|
237
|
+
* read, so a listener attached later in the same launch is not handed the same
|
|
238
|
+
* tap again. Clearing is best-effort across OS/module versions, so a caller that
|
|
239
|
+
* must not act twice still needs its own idempotency ledger.
|
|
240
|
+
*
|
|
241
|
+
* @returns The raw, untrusted `content.data` of the launching notification, or
|
|
242
|
+
* `null`. Parsing/validation is the caller's job.
|
|
243
|
+
*/
|
|
244
|
+
export async function takeLaunchNotificationData(): Promise<unknown> {
|
|
245
|
+
const notifications = await loadNotifications();
|
|
246
|
+
if (!notifications) {
|
|
247
|
+
return null;
|
|
248
|
+
}
|
|
249
|
+
try {
|
|
250
|
+
const response = notifications.getLastNotificationResponse();
|
|
251
|
+
if (!response) {
|
|
252
|
+
return null;
|
|
253
|
+
}
|
|
254
|
+
const data: unknown = response.notification.request.content.data;
|
|
255
|
+
try {
|
|
256
|
+
notifications.clearLastNotificationResponse();
|
|
257
|
+
} catch (clearError) {
|
|
258
|
+
log.warn(
|
|
259
|
+
'could not clear the launching notification response',
|
|
260
|
+
{ method: 'takeLaunchNotificationData' },
|
|
261
|
+
clearError,
|
|
262
|
+
);
|
|
263
|
+
}
|
|
264
|
+
return data;
|
|
265
|
+
} catch (error) {
|
|
266
|
+
log.warn(
|
|
267
|
+
'could not read the launching notification',
|
|
268
|
+
{ method: 'takeLaunchNotificationData' },
|
|
269
|
+
error,
|
|
270
|
+
);
|
|
271
|
+
return null;
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
/**
|
|
276
|
+
* What the OS should do with a notification that arrives while the app is
|
|
277
|
+
* FOREGROUNDED.
|
|
278
|
+
*
|
|
279
|
+
* `'suppress'` is `expo-notifications`' own default for a foregrounded app, so a
|
|
280
|
+
* decision function that only ever returns `'show'` for the payloads it
|
|
281
|
+
* recognises leaves every other notification exactly as it behaves today.
|
|
282
|
+
*/
|
|
283
|
+
export type ForegroundPresentation = 'show' | 'suppress';
|
|
284
|
+
|
|
285
|
+
/**
|
|
286
|
+
* Whether the process-wide foreground handler has already been ATTEMPTED.
|
|
287
|
+
*
|
|
288
|
+
* `setNotificationHandler` is global, last-writer-wins process state, so this is
|
|
289
|
+
* a one-shot install rather than something a mount/unmount cycle owns. A failed
|
|
290
|
+
* attempt is deliberately not retried: the only failure modes are permanent for
|
|
291
|
+
* the life of the process (web, a build without the native module, a native
|
|
292
|
+
* module that threw on registration).
|
|
293
|
+
*
|
|
294
|
+
* Module-scoped and only ever touched from an async install call — never read
|
|
295
|
+
* during render, so the React Compiler has no memoizable position to freeze it
|
|
296
|
+
* into.
|
|
297
|
+
*/
|
|
298
|
+
let foregroundHandlerAttempted = false;
|
|
299
|
+
|
|
300
|
+
/** How prominently Android surfaces a channel's notifications. */
|
|
301
|
+
export type NotificationChannelImportance = 'default' | 'high';
|
|
302
|
+
|
|
303
|
+
/** An Android notification channel this app delivers on. */
|
|
304
|
+
export interface NotificationChannelSpec {
|
|
305
|
+
/**
|
|
306
|
+
* The channel id. It MUST match the id the sender attaches: Android 8+ drops
|
|
307
|
+
* a notification whose channel the app has not created, silently and with no
|
|
308
|
+
* error on either side, which is the hardest push symptom there is to
|
|
309
|
+
* diagnose. Ids that cross the wire belong in `@oxyhq/contracts`, not in a
|
|
310
|
+
* string typed on both sides.
|
|
311
|
+
*/
|
|
312
|
+
id: string;
|
|
313
|
+
/** User-visible channel name — app copy, so the caller localizes it. */
|
|
314
|
+
name: string;
|
|
315
|
+
/** User-visible description shown in Android's notification settings. */
|
|
316
|
+
description?: string;
|
|
317
|
+
importance?: NotificationChannelImportance;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
/**
|
|
321
|
+
* Create (or update) an Android notification channel.
|
|
322
|
+
*
|
|
323
|
+
* A no-op everywhere but Android: iOS has no channels, and web never loads the
|
|
324
|
+
* native module. Call it BEFORE registering a push token, so the very first
|
|
325
|
+
* notification the server sends already has a channel to land on.
|
|
326
|
+
*
|
|
327
|
+
* Failure is non-fatal and logged: a missing channel costs visibility, and
|
|
328
|
+
* refusing to register a token over it would cost the feature entirely.
|
|
329
|
+
*
|
|
330
|
+
* @returns Whether the channel was actually created (`false` off Android, or
|
|
331
|
+
* when the native module is unavailable, or when creation failed).
|
|
332
|
+
*/
|
|
333
|
+
export async function ensureNotificationChannel(
|
|
334
|
+
spec: NotificationChannelSpec,
|
|
335
|
+
): Promise<boolean> {
|
|
336
|
+
if (Platform.OS !== 'android') {
|
|
337
|
+
return false;
|
|
338
|
+
}
|
|
339
|
+
const notifications = await loadNotifications();
|
|
340
|
+
if (!notifications) {
|
|
341
|
+
return false;
|
|
342
|
+
}
|
|
343
|
+
try {
|
|
344
|
+
await notifications.setNotificationChannelAsync(spec.id, {
|
|
345
|
+
name: spec.name,
|
|
346
|
+
importance:
|
|
347
|
+
spec.importance === 'high'
|
|
348
|
+
? notifications.AndroidImportance.HIGH
|
|
349
|
+
: notifications.AndroidImportance.DEFAULT,
|
|
350
|
+
...(spec.description ? { description: spec.description } : {}),
|
|
351
|
+
});
|
|
352
|
+
return true;
|
|
353
|
+
} catch (error) {
|
|
354
|
+
log.warn(
|
|
355
|
+
'could not create the notification channel',
|
|
356
|
+
{ method: 'ensureNotificationChannel', channelId: spec.id },
|
|
357
|
+
error,
|
|
358
|
+
);
|
|
359
|
+
return false;
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
/**
|
|
364
|
+
* Install the ONE process-wide handler that decides whether an incoming
|
|
365
|
+
* notification is shown while the app is in the FOREGROUND.
|
|
366
|
+
*
|
|
367
|
+
* Without a handler, `expo-notifications` shows nothing at all while the app is
|
|
368
|
+
* open — which is exactly when a time-critical notification (a "Sign in with
|
|
369
|
+
* Oxy" approval request, say) matters most, because the user is already holding
|
|
370
|
+
* the phone.
|
|
371
|
+
*
|
|
372
|
+
* The handler ONLY decides visibility. It never navigates, never acts on the
|
|
373
|
+
* notification, and never reads the payload for display — `decide` is handed the
|
|
374
|
+
* raw, untrusted `content.data` and may answer nothing but `'show'` /
|
|
375
|
+
* `'suppress'`. Acting on a notification stays with a TAP, routed by
|
|
376
|
+
* {@link subscribeToNotificationResponses}. No notification actions/categories
|
|
377
|
+
* are registered here, so the banner cannot carry an action button.
|
|
378
|
+
*
|
|
379
|
+
* The one-shot latch is set BEFORE the first `await`, so concurrent callers
|
|
380
|
+
* cannot both reach `setNotificationHandler`.
|
|
381
|
+
*
|
|
382
|
+
* @param decide - Maps the raw, untrusted payload to a presentation verdict.
|
|
383
|
+
* Must not throw; a throw is reported by the OS as a handling error and the
|
|
384
|
+
* notification is dropped.
|
|
385
|
+
* @returns Whether a handler was installed by THIS call (`false` on a repeat
|
|
386
|
+
* call, on web, or when the native module is unavailable).
|
|
387
|
+
*/
|
|
388
|
+
export async function installForegroundNotificationHandler(
|
|
389
|
+
decide: (data: unknown) => ForegroundPresentation,
|
|
390
|
+
): Promise<boolean> {
|
|
391
|
+
if (foregroundHandlerAttempted) {
|
|
392
|
+
return false;
|
|
393
|
+
}
|
|
394
|
+
foregroundHandlerAttempted = true;
|
|
395
|
+
|
|
396
|
+
const notifications = await loadNotifications();
|
|
397
|
+
if (!notifications) {
|
|
398
|
+
return false;
|
|
399
|
+
}
|
|
400
|
+
try {
|
|
401
|
+
notifications.setNotificationHandler({
|
|
402
|
+
handleNotification: async (notification) => {
|
|
403
|
+
const data: unknown = notification.request.content.data;
|
|
404
|
+
const show = decide(data) === 'show';
|
|
405
|
+
return {
|
|
406
|
+
// Banner: the whole point — make the notification visible on screen.
|
|
407
|
+
shouldShowBanner: show,
|
|
408
|
+
// Notification centre: so the user can still review it after
|
|
409
|
+
// dismissing the banner.
|
|
410
|
+
shouldShowList: show,
|
|
411
|
+
// No sound: the app is foregrounded, so the user is already looking at
|
|
412
|
+
// the screen the banner appears on.
|
|
413
|
+
shouldPlaySound: false,
|
|
414
|
+
// Badging is an app-level unread concept this adapter has no view of.
|
|
415
|
+
shouldSetBadge: false,
|
|
416
|
+
};
|
|
417
|
+
},
|
|
418
|
+
});
|
|
419
|
+
return true;
|
|
420
|
+
} catch (error) {
|
|
421
|
+
log.warn(
|
|
422
|
+
'could not install the foreground notification handler',
|
|
423
|
+
{ method: 'installForegroundNotificationHandler' },
|
|
424
|
+
error,
|
|
425
|
+
);
|
|
426
|
+
return false;
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
/**
|
|
431
|
+
* Subscribe to notification TAPS (responses) while the app is running.
|
|
432
|
+
*
|
|
433
|
+
* @param listener - Receives the raw, untrusted `content.data` of the tapped
|
|
434
|
+
* notification. Parsing/validation is the caller's job.
|
|
435
|
+
* @returns An unsubscribe function. Safe to call even if the subscription could
|
|
436
|
+
* not be established.
|
|
437
|
+
*/
|
|
438
|
+
export async function subscribeToNotificationResponses(
|
|
439
|
+
listener: (data: unknown) => void,
|
|
440
|
+
): Promise<() => void> {
|
|
441
|
+
const notifications = await loadNotifications();
|
|
442
|
+
if (!notifications) {
|
|
443
|
+
return () => undefined;
|
|
444
|
+
}
|
|
445
|
+
try {
|
|
446
|
+
const subscription = notifications.addNotificationResponseReceivedListener((response) => {
|
|
447
|
+
listener(response.notification.request.content.data);
|
|
448
|
+
});
|
|
449
|
+
return () => subscription.remove();
|
|
450
|
+
} catch (error) {
|
|
451
|
+
log.warn(
|
|
452
|
+
'could not subscribe to notification taps',
|
|
453
|
+
{ method: 'subscribeToNotificationResponses' },
|
|
454
|
+
error,
|
|
455
|
+
);
|
|
456
|
+
return () => undefined;
|
|
457
|
+
}
|
|
458
|
+
}
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `runProviderColdBoot` — the boot NEVER navigates the top-level window (#691
|
|
3
|
+
* phase 7b).
|
|
4
|
+
*
|
|
5
|
+
* Phase 7b deleted the two SDK-initiated, gesture-less full-page hops to the
|
|
6
|
+
* IdP: the cold-boot `prompt=none` silent restore and the post-sign-in hub sync.
|
|
7
|
+
* A web origin with no local device credential now resolves SIGNED OUT and waits
|
|
8
|
+
* for the user's next explicit "Continue with Oxy".
|
|
9
|
+
*
|
|
10
|
+
* What must still work — and is asserted here — is everything the user actually
|
|
11
|
+
* asked for: an authorization code ALREADY on the URL is completed, which is how
|
|
12
|
+
* a browser-BLOCKED sign-in popup finishes after `startWebOAuthSignIn` falls
|
|
13
|
+
* back to a full-page redirect.
|
|
14
|
+
*
|
|
15
|
+
* Unlike `__tests__/boot/runProviderColdBoot.test.ts` (deadline + connectivity
|
|
16
|
+
* wiring), this suite keeps the real navigation primitive in view: every
|
|
17
|
+
* assertion below reaches `redirectToAuthorize`, the ONLY top-level-window
|
|
18
|
+
* navigation the boot could ever have performed.
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
import type { AuthStateStore, PersistedAuthState, SessionClient } from '@oxyhq/core';
|
|
22
|
+
|
|
23
|
+
jest.mock('@oxyhq/core', () => {
|
|
24
|
+
const actual = jest.requireActual('@oxyhq/core');
|
|
25
|
+
return {
|
|
26
|
+
__esModule: true,
|
|
27
|
+
...actual,
|
|
28
|
+
runSessionColdBoot: jest.fn(),
|
|
29
|
+
};
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
// The ONLY top-level-window navigation primitive the SDK has.
|
|
33
|
+
jest.mock('../../components/oauthNavigation', () => ({
|
|
34
|
+
redirectToAuthorize: jest.fn(),
|
|
35
|
+
}));
|
|
36
|
+
|
|
37
|
+
jest.mock('../../utils/oauthReturn', () => {
|
|
38
|
+
const actual = jest.requireActual('../../utils/oauthReturn');
|
|
39
|
+
return {
|
|
40
|
+
__esModule: true,
|
|
41
|
+
...actual,
|
|
42
|
+
tryCompleteOAuthReturn: jest.fn(async () => false),
|
|
43
|
+
};
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
import { runSessionColdBoot } from '@oxyhq/core';
|
|
47
|
+
import { redirectToAuthorize } from '../../components/oauthNavigation';
|
|
48
|
+
import { tryCompleteOAuthReturn } from '../../utils/oauthReturn';
|
|
49
|
+
import { runProviderColdBoot, type RunProviderColdBootOptions } from '../runProviderColdBoot';
|
|
50
|
+
|
|
51
|
+
const mockRunSessionColdBoot = runSessionColdBoot as jest.Mock;
|
|
52
|
+
const mockRedirectToAuthorize = redirectToAuthorize as jest.Mock;
|
|
53
|
+
const mockTryCompleteOAuthReturn = tryCompleteOAuthReturn as jest.Mock;
|
|
54
|
+
|
|
55
|
+
const CLIENT_ID = 'oxy_dk_test';
|
|
56
|
+
|
|
57
|
+
/** An auth store holding no device credential — the signed-out domain case. */
|
|
58
|
+
function makeEmptyAuthStore(): AuthStateStore {
|
|
59
|
+
return {
|
|
60
|
+
load: jest.fn(async (): Promise<PersistedAuthState | null> => null),
|
|
61
|
+
save: jest.fn(async () => undefined),
|
|
62
|
+
clear: jest.fn(async () => undefined),
|
|
63
|
+
} as unknown as AuthStateStore;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
interface Harness {
|
|
67
|
+
options: RunProviderColdBootOptions;
|
|
68
|
+
commitSession: jest.Mock;
|
|
69
|
+
markAuthResolved: jest.Mock;
|
|
70
|
+
setTokenReady: jest.Mock;
|
|
71
|
+
sessionClientStart: jest.Mock;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
function makeHarness(overrides: Partial<RunProviderColdBootOptions> = {}): Harness {
|
|
75
|
+
const commitSession = jest.fn(async () => undefined);
|
|
76
|
+
const markAuthResolved = jest.fn();
|
|
77
|
+
const setTokenReady = jest.fn();
|
|
78
|
+
const sessionClientStart = jest.fn(async () => undefined);
|
|
79
|
+
|
|
80
|
+
const options: RunProviderColdBootOptions = {
|
|
81
|
+
oxyServices: {} as RunProviderColdBootOptions['oxyServices'],
|
|
82
|
+
authStore: makeEmptyAuthStore(),
|
|
83
|
+
clientId: CLIENT_ID,
|
|
84
|
+
sessionClient: { start: sessionClientStart } as unknown as SessionClient,
|
|
85
|
+
syncDeviceCredentialToHost: jest.fn(async () => undefined),
|
|
86
|
+
commitSession,
|
|
87
|
+
markAuthResolved,
|
|
88
|
+
setTokenReady,
|
|
89
|
+
...overrides,
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
return { options, commitSession, markAuthResolved, setTokenReady, sessionClientStart };
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/** `runSessionColdBoot` finding no session at all — the signed-out domain. */
|
|
96
|
+
function stubSignedOutBoot(): void {
|
|
97
|
+
mockRunSessionColdBoot.mockImplementation(
|
|
98
|
+
async (opts: Parameters<typeof runSessionColdBoot>[0]) => {
|
|
99
|
+
await opts.onSignedOut?.('no_session');
|
|
100
|
+
return { kind: 'unauthenticated' } as const;
|
|
101
|
+
},
|
|
102
|
+
);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
describe('runProviderColdBoot — no SDK-initiated IdP navigation (#691 phase 7b)', () => {
|
|
106
|
+
beforeEach(() => {
|
|
107
|
+
mockRunSessionColdBoot.mockReset();
|
|
108
|
+
mockRedirectToAuthorize.mockClear();
|
|
109
|
+
mockTryCompleteOAuthReturn.mockClear();
|
|
110
|
+
mockTryCompleteOAuthReturn.mockImplementation(async () => false);
|
|
111
|
+
globalThis.sessionStorage?.clear();
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
it('resolves a domain with no local credential SIGNED OUT instead of bouncing to the IdP', async () => {
|
|
115
|
+
stubSignedOutBoot();
|
|
116
|
+
const { options, markAuthResolved, commitSession, sessionClientStart } = makeHarness();
|
|
117
|
+
|
|
118
|
+
await runProviderColdBoot(options);
|
|
119
|
+
|
|
120
|
+
// Auth resolution concluded (routing can settle), nothing was committed,
|
|
121
|
+
// and with no persisted credential the device socket is not started.
|
|
122
|
+
expect(markAuthResolved).toHaveBeenCalled();
|
|
123
|
+
expect(commitSession).not.toHaveBeenCalled();
|
|
124
|
+
expect(sessionClientStart).not.toHaveBeenCalled();
|
|
125
|
+
expect(mockRedirectToAuthorize).not.toHaveBeenCalled();
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
it('does not navigate even with a clientId configured and the mint finding nothing', async () => {
|
|
129
|
+
// The deleted silent-restore lane needed exactly this shape: a registered
|
|
130
|
+
// client id plus a signed-out mint outcome. It must now be inert.
|
|
131
|
+
stubSignedOutBoot();
|
|
132
|
+
const { options } = makeHarness({ clientId: CLIENT_ID, authRedirectUri: 'https://app.oxy.so' });
|
|
133
|
+
|
|
134
|
+
await runProviderColdBoot(options);
|
|
135
|
+
|
|
136
|
+
expect(mockRedirectToAuthorize).not.toHaveBeenCalled();
|
|
137
|
+
});
|
|
138
|
+
|
|
139
|
+
it('does not navigate when the mint already resolved a session', async () => {
|
|
140
|
+
mockRunSessionColdBoot.mockImplementation(
|
|
141
|
+
async (opts: Parameters<typeof runSessionColdBoot>[0]) => {
|
|
142
|
+
const session = {
|
|
143
|
+
sessionId: 's1',
|
|
144
|
+
userId: 'u1',
|
|
145
|
+
accessToken: 'at',
|
|
146
|
+
via: 'device-secret-mint',
|
|
147
|
+
};
|
|
148
|
+
await opts.onSession?.(session);
|
|
149
|
+
return { kind: 'session', via: session.via, session } as const;
|
|
150
|
+
},
|
|
151
|
+
);
|
|
152
|
+
const { options, commitSession } = makeHarness();
|
|
153
|
+
|
|
154
|
+
await runProviderColdBoot(options);
|
|
155
|
+
|
|
156
|
+
expect(commitSession).toHaveBeenCalledWith(
|
|
157
|
+
{ sessionId: 's1', accessToken: 'at', userId: 'u1' },
|
|
158
|
+
{ activate: false },
|
|
159
|
+
);
|
|
160
|
+
expect(mockRedirectToAuthorize).not.toHaveBeenCalled();
|
|
161
|
+
});
|
|
162
|
+
|
|
163
|
+
describe('the blocked-popup redirect fallback still completes', () => {
|
|
164
|
+
it('completes an authorization code already on the URL', async () => {
|
|
165
|
+
// A popup-mode app lands here whenever the browser blocked the popup and
|
|
166
|
+
// `startWebOAuthSignIn` fell back to a full-page redirect.
|
|
167
|
+
mockTryCompleteOAuthReturn.mockImplementation(async () => true);
|
|
168
|
+
const { options, markAuthResolved, setTokenReady } = makeHarness();
|
|
169
|
+
|
|
170
|
+
await runProviderColdBoot(options);
|
|
171
|
+
|
|
172
|
+
expect(mockTryCompleteOAuthReturn).toHaveBeenCalledTimes(1);
|
|
173
|
+
expect(setTokenReady).toHaveBeenLastCalledWith(true);
|
|
174
|
+
expect(markAuthResolved).toHaveBeenCalled();
|
|
175
|
+
// The device mint is short-circuited by the completed return leg.
|
|
176
|
+
expect(mockRunSessionColdBoot).not.toHaveBeenCalled();
|
|
177
|
+
expect(mockRedirectToAuthorize).not.toHaveBeenCalled();
|
|
178
|
+
});
|
|
179
|
+
|
|
180
|
+
it('runs the return leg even on a boot that finds no session', async () => {
|
|
181
|
+
stubSignedOutBoot();
|
|
182
|
+
const { options } = makeHarness();
|
|
183
|
+
|
|
184
|
+
await runProviderColdBoot(options);
|
|
185
|
+
|
|
186
|
+
expect(mockTryCompleteOAuthReturn).toHaveBeenCalledTimes(1);
|
|
187
|
+
});
|
|
188
|
+
|
|
189
|
+
it('commits the OAuth return as a deliberate sign-in', async () => {
|
|
190
|
+
mockTryCompleteOAuthReturn.mockImplementation(async () => true);
|
|
191
|
+
const { options } = makeHarness();
|
|
192
|
+
|
|
193
|
+
await runProviderColdBoot(options);
|
|
194
|
+
|
|
195
|
+
const commit = mockTryCompleteOAuthReturn.mock.calls[0][0] as {
|
|
196
|
+
commitSession: (input: unknown) => Promise<void>;
|
|
197
|
+
};
|
|
198
|
+
await commit.commitSession({ sessionId: 's1', userId: 'u1' });
|
|
199
|
+
expect(options.commitSession).toHaveBeenCalledWith(
|
|
200
|
+
{ sessionId: 's1', userId: 'u1' },
|
|
201
|
+
{ activate: true },
|
|
202
|
+
);
|
|
203
|
+
});
|
|
204
|
+
});
|
|
205
|
+
|
|
206
|
+
it('identity mode skips the web OAuth return leg entirely', async () => {
|
|
207
|
+
stubSignedOutBoot();
|
|
208
|
+
const { options } = makeHarness({ sessionMode: 'identity' });
|
|
209
|
+
|
|
210
|
+
await runProviderColdBoot(options);
|
|
211
|
+
|
|
212
|
+
expect(mockTryCompleteOAuthReturn).not.toHaveBeenCalled();
|
|
213
|
+
expect(mockRedirectToAuthorize).not.toHaveBeenCalled();
|
|
214
|
+
});
|
|
215
|
+
});
|