@oxyhq/services 22.12.4 → 22.12.7
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 +16 -46
- package/lib/commonjs/index.js +84 -10
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/notifications/deviceNotifications.js +380 -0
- package/lib/commonjs/notifications/deviceNotifications.js.map +1 -0
- package/lib/commonjs/ui/boot/runProviderColdBoot.js +51 -9
- package/lib/commonjs/ui/boot/runProviderColdBoot.js.map +1 -1
- package/lib/commonjs/ui/client.js +0 -13
- package/lib/commonjs/ui/client.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/OxyAccountDialogScreen.js +14 -3
- package/lib/commonjs/ui/components/OxyAccountDialogScreen.js.map +1 -1
- package/lib/commonjs/ui/components/OxyAuthChooser.js +70 -1121
- package/lib/commonjs/ui/components/OxyAuthChooser.js.map +1 -1
- package/lib/commonjs/ui/components/OxyConsentScreen.js +50 -12
- package/lib/commonjs/ui/components/OxyConsentScreen.js.map +1 -1
- package/lib/commonjs/ui/components/OxyProvider.js +4 -4
- package/lib/commonjs/ui/components/OxyProvider.js.map +1 -1
- package/lib/commonjs/ui/components/OxySignInButton.js +74 -40
- package/lib/commonjs/ui/components/OxySignInButton.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 +527 -0
- package/lib/commonjs/ui/components/authChooser/AccountsMenuView.js.map +1 -0
- package/lib/commonjs/ui/components/authChooser/SignInEntryView.js +90 -0
- package/lib/commonjs/ui/components/authChooser/SignInEntryView.js.map +1 -0
- package/lib/commonjs/ui/components/authChooser/SignInRequestView.js +106 -0
- package/lib/commonjs/ui/components/authChooser/SignInRequestView.js.map +1 -0
- package/lib/commonjs/ui/components/authChooser/SignUpView.js +188 -0
- package/lib/commonjs/ui/components/authChooser/SignUpView.js.map +1 -0
- package/lib/commonjs/ui/components/authChooser/TroubleDisclosure.js +61 -0
- package/lib/commonjs/ui/components/authChooser/TroubleDisclosure.js.map +1 -0
- package/lib/commonjs/ui/components/authChooser/primitives.js +170 -0
- package/lib/commonjs/ui/components/authChooser/primitives.js.map +1 -0
- package/lib/commonjs/ui/components/authChooser/requestSurfaces.js +153 -0
- package/lib/commonjs/ui/components/authChooser/requestSurfaces.js.map +1 -0
- package/lib/commonjs/ui/components/authChooser/signInProgress.js +54 -0
- package/lib/commonjs/ui/components/authChooser/signInProgress.js.map +1 -0
- package/lib/commonjs/ui/components/{oxyAuthChooserStyles.js → authChooser/styles.js} +19 -1
- package/lib/commonjs/ui/components/authChooser/styles.js.map +1 -0
- package/lib/commonjs/ui/components/authChooser/types.js +70 -0
- package/lib/commonjs/ui/components/authChooser/types.js.map +1 -0
- package/lib/commonjs/ui/components/authChooser/useUsernameAvailability.js +50 -0
- package/lib/commonjs/ui/components/authChooser/useUsernameAvailability.js.map +1 -0
- 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/context/OxyContext.js +200 -29
- package/lib/commonjs/ui/context/OxyContext.js.map +1 -1
- package/lib/commonjs/ui/context/commitSessionFlow.js +43 -0
- package/lib/commonjs/ui/context/commitSessionFlow.js.map +1 -1
- package/lib/commonjs/ui/context/useOxyAccountGraph.js +13 -5
- package/lib/commonjs/ui/context/useOxyAccountGraph.js.map +1 -1
- package/lib/commonjs/ui/hooks/useSwitchableAccounts.js +6 -1
- package/lib/commonjs/ui/hooks/useSwitchableAccounts.js.map +1 -1
- package/lib/commonjs/ui/index.js +0 -13
- package/lib/commonjs/ui/index.js.map +1 -1
- package/lib/commonjs/ui/oauth/browserAuthTransport.js +168 -0
- package/lib/commonjs/ui/oauth/browserAuthTransport.js.map +1 -0
- package/lib/commonjs/ui/oauth/completeOAuthCode.js +78 -0
- package/lib/commonjs/ui/oauth/completeOAuthCode.js.map +1 -0
- package/lib/commonjs/ui/oauth/legacyRedirectLanes.js +48 -0
- package/lib/commonjs/ui/oauth/legacyRedirectLanes.js.map +1 -0
- package/lib/commonjs/ui/oauth/oauthHandshake.js +53 -0
- package/lib/commonjs/ui/oauth/oauthHandshake.js.map +1 -0
- package/lib/commonjs/ui/oauth/oauthPopup.js +229 -0
- package/lib/commonjs/ui/oauth/oauthPopup.js.map +1 -0
- package/lib/commonjs/ui/oauth/oauthPopupMessages.js +141 -0
- package/lib/commonjs/ui/oauth/oauthPopupMessages.js.map +1 -0
- package/lib/commonjs/ui/oauth/types.js +2 -0
- package/lib/commonjs/ui/oauth/types.js.map +1 -0
- package/lib/commonjs/ui/screens/AccountMembersScreen.js +4 -3
- package/lib/commonjs/ui/screens/AccountMembersScreen.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 +11 -10
- 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/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 +9 -8
- package/lib/commonjs/ui/screens/PremiumSubscriptionScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/ProfileScreen.js +10 -10
- package/lib/commonjs/ui/screens/ProfileScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/UserListScreen.js +3 -3
- package/lib/commonjs/ui/screens/UserListScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/WelcomeNewUserScreen.js +3 -2
- 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 +4 -3
- 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 +4 -3
- 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/server.js +2 -5
- package/lib/commonjs/ui/server.js.map +1 -1
- package/lib/commonjs/ui/session/authStore.js +6 -75
- package/lib/commonjs/ui/session/authStore.js.map +1 -1
- package/lib/commonjs/ui/session/createSessionClient.js +11 -3
- package/lib/commonjs/ui/session/createSessionClient.js.map +1 -1
- package/lib/commonjs/ui/session/identityBinding.js +95 -0
- package/lib/commonjs/ui/session/identityBinding.js.map +1 -0
- package/lib/commonjs/ui/session/index.js +13 -0
- package/lib/commonjs/ui/session/index.js.map +1 -1
- package/lib/commonjs/ui/session/nativeSecureStorage.js +90 -0
- package/lib/commonjs/ui/session/nativeSecureStorage.js.map +1 -0
- package/lib/commonjs/ui/session/tokenTransport.js +11 -1
- package/lib/commonjs/ui/session/tokenTransport.js.map +1 -1
- package/lib/commonjs/ui/utils/crossOriginRestore.js +3 -2
- package/lib/commonjs/ui/utils/crossOriginRestore.js.map +1 -1
- package/lib/commonjs/ui/utils/deliveryPlatform.js +58 -0
- package/lib/commonjs/ui/utils/deliveryPlatform.js.map +1 -0
- package/lib/commonjs/ui/utils/oauthReturn.js +70 -46
- package/lib/commonjs/ui/utils/oauthReturn.js.map +1 -1
- package/lib/module/index.js +27 -4
- package/lib/module/index.js.map +1 -1
- package/lib/module/notifications/deviceNotifications.js +371 -0
- package/lib/module/notifications/deviceNotifications.js.map +1 -0
- package/lib/module/ui/boot/runProviderColdBoot.js +51 -9
- package/lib/module/ui/boot/runProviderColdBoot.js.map +1 -1
- package/lib/module/ui/client.js +0 -1
- package/lib/module/ui/client.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/OxyAccountDialogScreen.js +14 -3
- package/lib/module/ui/components/OxyAccountDialogScreen.js.map +1 -1
- package/lib/module/ui/components/OxyAuthChooser.js +74 -1126
- package/lib/module/ui/components/OxyAuthChooser.js.map +1 -1
- package/lib/module/ui/components/OxyConsentScreen.js +50 -12
- package/lib/module/ui/components/OxyConsentScreen.js.map +1 -1
- package/lib/module/ui/components/OxyProvider.js +4 -4
- package/lib/module/ui/components/OxyProvider.js.map +1 -1
- package/lib/module/ui/components/OxySignInButton.js +76 -42
- package/lib/module/ui/components/OxySignInButton.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 +523 -0
- package/lib/module/ui/components/authChooser/AccountsMenuView.js.map +1 -0
- package/lib/module/ui/components/authChooser/SignInEntryView.js +85 -0
- package/lib/module/ui/components/authChooser/SignInEntryView.js.map +1 -0
- package/lib/module/ui/components/authChooser/SignInRequestView.js +101 -0
- package/lib/module/ui/components/authChooser/SignInRequestView.js.map +1 -0
- package/lib/module/ui/components/authChooser/SignUpView.js +184 -0
- package/lib/module/ui/components/authChooser/SignUpView.js.map +1 -0
- package/lib/module/ui/components/authChooser/TroubleDisclosure.js +57 -0
- package/lib/module/ui/components/authChooser/TroubleDisclosure.js.map +1 -0
- package/lib/module/ui/components/authChooser/primitives.js +163 -0
- package/lib/module/ui/components/authChooser/primitives.js.map +1 -0
- package/lib/module/ui/components/authChooser/requestSurfaces.js +143 -0
- package/lib/module/ui/components/authChooser/requestSurfaces.js.map +1 -0
- package/lib/module/ui/components/authChooser/signInProgress.js +50 -0
- package/lib/module/ui/components/authChooser/signInProgress.js.map +1 -0
- package/lib/module/ui/components/{oxyAuthChooserStyles.js → authChooser/styles.js} +19 -1
- package/lib/module/ui/components/authChooser/styles.js.map +1 -0
- package/lib/module/ui/components/authChooser/types.js +66 -0
- package/lib/module/ui/components/authChooser/types.js.map +1 -0
- package/lib/module/ui/components/authChooser/useUsernameAvailability.js +46 -0
- package/lib/module/ui/components/authChooser/useUsernameAvailability.js.map +1 -0
- 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/context/OxyContext.js +203 -32
- package/lib/module/ui/context/OxyContext.js.map +1 -1
- package/lib/module/ui/context/commitSessionFlow.js +42 -0
- package/lib/module/ui/context/commitSessionFlow.js.map +1 -1
- package/lib/module/ui/context/useOxyAccountGraph.js +13 -5
- package/lib/module/ui/context/useOxyAccountGraph.js.map +1 -1
- package/lib/module/ui/hooks/useSwitchableAccounts.js +6 -1
- package/lib/module/ui/hooks/useSwitchableAccounts.js.map +1 -1
- package/lib/module/ui/index.js +0 -1
- package/lib/module/ui/index.js.map +1 -1
- package/lib/module/ui/oauth/browserAuthTransport.js +165 -0
- package/lib/module/ui/oauth/browserAuthTransport.js.map +1 -0
- package/lib/module/ui/oauth/completeOAuthCode.js +75 -0
- package/lib/module/ui/oauth/completeOAuthCode.js.map +1 -0
- package/lib/module/ui/oauth/legacyRedirectLanes.js +44 -0
- package/lib/module/ui/oauth/legacyRedirectLanes.js.map +1 -0
- package/lib/module/ui/oauth/oauthHandshake.js +50 -0
- package/lib/module/ui/oauth/oauthHandshake.js.map +1 -0
- package/lib/module/ui/oauth/oauthPopup.js +221 -0
- package/lib/module/ui/oauth/oauthPopup.js.map +1 -0
- package/lib/module/ui/oauth/oauthPopupMessages.js +135 -0
- package/lib/module/ui/oauth/oauthPopupMessages.js.map +1 -0
- package/lib/module/ui/oauth/types.js +2 -0
- package/lib/module/ui/oauth/types.js.map +1 -0
- package/lib/module/ui/screens/AccountMembersScreen.js +1 -1
- package/lib/module/ui/screens/AccountMembersScreen.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 +1 -1
- 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/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 +1 -1
- package/lib/module/ui/screens/PremiumSubscriptionScreen.js.map +1 -1
- package/lib/module/ui/screens/ProfileScreen.js +1 -1
- package/lib/module/ui/screens/ProfileScreen.js.map +1 -1
- package/lib/module/ui/screens/UserListScreen.js +1 -1
- package/lib/module/ui/screens/UserListScreen.js.map +1 -1
- package/lib/module/ui/screens/WelcomeNewUserScreen.js +1 -1
- 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 +2 -1
- 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 +1 -1
- 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/server.js +0 -2
- package/lib/module/ui/server.js.map +1 -1
- package/lib/module/ui/session/authStore.js +5 -75
- package/lib/module/ui/session/authStore.js.map +1 -1
- package/lib/module/ui/session/createSessionClient.js +11 -3
- package/lib/module/ui/session/createSessionClient.js.map +1 -1
- package/lib/module/ui/session/identityBinding.js +89 -0
- package/lib/module/ui/session/identityBinding.js.map +1 -0
- package/lib/module/ui/session/index.js +5 -2
- package/lib/module/ui/session/index.js.map +1 -1
- package/lib/module/ui/session/nativeSecureStorage.js +88 -0
- package/lib/module/ui/session/nativeSecureStorage.js.map +1 -0
- package/lib/module/ui/session/tokenTransport.js +11 -1
- package/lib/module/ui/session/tokenTransport.js.map +1 -1
- package/lib/module/ui/utils/crossOriginRestore.js +4 -3
- package/lib/module/ui/utils/crossOriginRestore.js.map +1 -1
- package/lib/module/ui/utils/deliveryPlatform.js +55 -0
- package/lib/module/ui/utils/deliveryPlatform.js.map +1 -0
- package/lib/module/ui/utils/oauthReturn.js +70 -46
- package/lib/module/ui/utils/oauthReturn.js.map +1 -1
- package/lib/typescript/commonjs/index.d.ts +9 -1
- package/lib/typescript/commonjs/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/notifications/deviceNotifications.d.ts +141 -0
- package/lib/typescript/commonjs/notifications/deviceNotifications.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/boot/runProviderColdBoot.d.ts +34 -2
- package/lib/typescript/commonjs/ui/boot/runProviderColdBoot.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/client.d.ts +0 -1
- package/lib/typescript/commonjs/ui/client.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/OxyAccountDialogScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/OxyAuthChooser.d.ts +16 -29
- package/lib/typescript/commonjs/ui/components/OxyAuthChooser.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/OxyConsentScreen.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 +17 -12
- package/lib/typescript/commonjs/ui/components/OxySignInButton.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/AccountsMenuView.d.ts +38 -0
- package/lib/typescript/commonjs/ui/components/authChooser/AccountsMenuView.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/authChooser/SignInEntryView.d.ts +32 -0
- package/lib/typescript/commonjs/ui/components/authChooser/SignInEntryView.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/authChooser/SignInRequestView.d.ts +34 -0
- package/lib/typescript/commonjs/ui/components/authChooser/SignInRequestView.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/authChooser/SignUpView.d.ts +34 -0
- package/lib/typescript/commonjs/ui/components/authChooser/SignUpView.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/authChooser/TroubleDisclosure.d.ts +36 -0
- package/lib/typescript/commonjs/ui/components/authChooser/TroubleDisclosure.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/authChooser/primitives.d.ts +55 -0
- package/lib/typescript/commonjs/ui/components/authChooser/primitives.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/authChooser/requestSurfaces.d.ts +58 -0
- package/lib/typescript/commonjs/ui/components/authChooser/requestSurfaces.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/authChooser/signInProgress.d.ts +26 -0
- package/lib/typescript/commonjs/ui/components/authChooser/signInProgress.d.ts.map +1 -0
- package/lib/typescript/{module/ui/components/oxyAuthChooserStyles.d.ts → commonjs/ui/components/authChooser/styles.d.ts} +19 -1
- package/lib/typescript/commonjs/ui/components/authChooser/styles.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/authChooser/types.d.ts +103 -0
- package/lib/typescript/commonjs/ui/components/authChooser/types.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/authChooser/useUsernameAvailability.d.ts +16 -0
- package/lib/typescript/commonjs/ui/components/authChooser/useUsernameAvailability.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/payment/types.d.ts +1 -1
- 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 +40 -0
- package/lib/typescript/commonjs/ui/context/commitSessionFlow.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/context/oxyContextTypes.d.ts +44 -1
- package/lib/typescript/commonjs/ui/context/oxyContextTypes.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/context/useOxyAccountGraph.d.ts +7 -1
- package/lib/typescript/commonjs/ui/context/useOxyAccountGraph.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/useSwitchableAccounts.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/index.d.ts +0 -1
- package/lib/typescript/commonjs/ui/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/oauth/browserAuthTransport.d.ts +56 -0
- package/lib/typescript/commonjs/ui/oauth/browserAuthTransport.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/oauth/completeOAuthCode.d.ts +49 -0
- package/lib/typescript/commonjs/ui/oauth/completeOAuthCode.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/oauth/legacyRedirectLanes.d.ts +40 -0
- package/lib/typescript/commonjs/ui/oauth/legacyRedirectLanes.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/oauth/oauthHandshake.d.ts +50 -0
- package/lib/typescript/commonjs/ui/oauth/oauthHandshake.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/oauth/oauthPopup.d.ts +77 -0
- package/lib/typescript/commonjs/ui/oauth/oauthPopup.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/oauth/oauthPopupMessages.d.ts +67 -0
- package/lib/typescript/commonjs/ui/oauth/oauthPopupMessages.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/oauth/types.d.ts +176 -0
- package/lib/typescript/commonjs/ui/oauth/types.d.ts.map +1 -0
- 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/fileManagement/PhotoPickerSection.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/server.d.ts +0 -2
- package/lib/typescript/commonjs/ui/server.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/session/authStore.d.ts +3 -7
- package/lib/typescript/commonjs/ui/session/authStore.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/session/createSessionClient.d.ts +8 -1
- package/lib/typescript/commonjs/ui/session/createSessionClient.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/session/identityBinding.d.ts +66 -0
- package/lib/typescript/commonjs/ui/session/identityBinding.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/session/index.d.ts +6 -2
- package/lib/typescript/commonjs/ui/session/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/session/nativeSecureStorage.d.ts +25 -0
- package/lib/typescript/commonjs/ui/session/nativeSecureStorage.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/session/tokenTransport.d.ts +8 -1
- package/lib/typescript/commonjs/ui/session/tokenTransport.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/types/navigation.d.ts +44 -0
- package/lib/typescript/commonjs/ui/types/navigation.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/utils/crossOriginRestore.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/utils/deliveryPlatform.d.ts +33 -0
- package/lib/typescript/commonjs/ui/utils/deliveryPlatform.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/utils/fileManagement.d.ts +1 -1
- package/lib/typescript/commonjs/ui/utils/fileManagement.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/utils/oauthReturn.d.ts +30 -16
- package/lib/typescript/commonjs/ui/utils/oauthReturn.d.ts.map +1 -1
- package/lib/typescript/module/index.d.ts +9 -1
- package/lib/typescript/module/index.d.ts.map +1 -1
- package/lib/typescript/module/notifications/deviceNotifications.d.ts +141 -0
- package/lib/typescript/module/notifications/deviceNotifications.d.ts.map +1 -0
- package/lib/typescript/module/ui/boot/runProviderColdBoot.d.ts +34 -2
- package/lib/typescript/module/ui/boot/runProviderColdBoot.d.ts.map +1 -1
- package/lib/typescript/module/ui/client.d.ts +0 -1
- package/lib/typescript/module/ui/client.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/OxyAccountDialogScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/OxyAuthChooser.d.ts +16 -29
- package/lib/typescript/module/ui/components/OxyAuthChooser.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/OxyConsentScreen.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 +17 -12
- package/lib/typescript/module/ui/components/OxySignInButton.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/AccountsMenuView.d.ts +38 -0
- package/lib/typescript/module/ui/components/authChooser/AccountsMenuView.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/authChooser/SignInEntryView.d.ts +32 -0
- package/lib/typescript/module/ui/components/authChooser/SignInEntryView.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/authChooser/SignInRequestView.d.ts +34 -0
- package/lib/typescript/module/ui/components/authChooser/SignInRequestView.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/authChooser/SignUpView.d.ts +34 -0
- package/lib/typescript/module/ui/components/authChooser/SignUpView.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/authChooser/TroubleDisclosure.d.ts +36 -0
- package/lib/typescript/module/ui/components/authChooser/TroubleDisclosure.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/authChooser/primitives.d.ts +55 -0
- package/lib/typescript/module/ui/components/authChooser/primitives.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/authChooser/requestSurfaces.d.ts +58 -0
- package/lib/typescript/module/ui/components/authChooser/requestSurfaces.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/authChooser/signInProgress.d.ts +26 -0
- package/lib/typescript/module/ui/components/authChooser/signInProgress.d.ts.map +1 -0
- package/lib/typescript/{commonjs/ui/components/oxyAuthChooserStyles.d.ts → module/ui/components/authChooser/styles.d.ts} +19 -1
- package/lib/typescript/module/ui/components/authChooser/styles.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/authChooser/types.d.ts +103 -0
- package/lib/typescript/module/ui/components/authChooser/types.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/authChooser/useUsernameAvailability.d.ts +16 -0
- package/lib/typescript/module/ui/components/authChooser/useUsernameAvailability.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/payment/types.d.ts +1 -1
- 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 +40 -0
- package/lib/typescript/module/ui/context/commitSessionFlow.d.ts.map +1 -1
- package/lib/typescript/module/ui/context/oxyContextTypes.d.ts +44 -1
- package/lib/typescript/module/ui/context/oxyContextTypes.d.ts.map +1 -1
- package/lib/typescript/module/ui/context/useOxyAccountGraph.d.ts +7 -1
- package/lib/typescript/module/ui/context/useOxyAccountGraph.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/useSwitchableAccounts.d.ts.map +1 -1
- package/lib/typescript/module/ui/index.d.ts +0 -1
- package/lib/typescript/module/ui/index.d.ts.map +1 -1
- package/lib/typescript/module/ui/oauth/browserAuthTransport.d.ts +56 -0
- package/lib/typescript/module/ui/oauth/browserAuthTransport.d.ts.map +1 -0
- package/lib/typescript/module/ui/oauth/completeOAuthCode.d.ts +49 -0
- package/lib/typescript/module/ui/oauth/completeOAuthCode.d.ts.map +1 -0
- package/lib/typescript/module/ui/oauth/legacyRedirectLanes.d.ts +40 -0
- package/lib/typescript/module/ui/oauth/legacyRedirectLanes.d.ts.map +1 -0
- package/lib/typescript/module/ui/oauth/oauthHandshake.d.ts +50 -0
- package/lib/typescript/module/ui/oauth/oauthHandshake.d.ts.map +1 -0
- package/lib/typescript/module/ui/oauth/oauthPopup.d.ts +77 -0
- package/lib/typescript/module/ui/oauth/oauthPopup.d.ts.map +1 -0
- package/lib/typescript/module/ui/oauth/oauthPopupMessages.d.ts +67 -0
- package/lib/typescript/module/ui/oauth/oauthPopupMessages.d.ts.map +1 -0
- package/lib/typescript/module/ui/oauth/types.d.ts +176 -0
- package/lib/typescript/module/ui/oauth/types.d.ts.map +1 -0
- 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/fileManagement/PhotoPickerSection.d.ts.map +1 -1
- package/lib/typescript/module/ui/server.d.ts +0 -2
- package/lib/typescript/module/ui/server.d.ts.map +1 -1
- package/lib/typescript/module/ui/session/authStore.d.ts +3 -7
- package/lib/typescript/module/ui/session/authStore.d.ts.map +1 -1
- package/lib/typescript/module/ui/session/createSessionClient.d.ts +8 -1
- package/lib/typescript/module/ui/session/createSessionClient.d.ts.map +1 -1
- package/lib/typescript/module/ui/session/identityBinding.d.ts +66 -0
- package/lib/typescript/module/ui/session/identityBinding.d.ts.map +1 -0
- package/lib/typescript/module/ui/session/index.d.ts +6 -2
- package/lib/typescript/module/ui/session/index.d.ts.map +1 -1
- package/lib/typescript/module/ui/session/nativeSecureStorage.d.ts +25 -0
- package/lib/typescript/module/ui/session/nativeSecureStorage.d.ts.map +1 -0
- package/lib/typescript/module/ui/session/tokenTransport.d.ts +8 -1
- package/lib/typescript/module/ui/session/tokenTransport.d.ts.map +1 -1
- package/lib/typescript/module/ui/types/navigation.d.ts +44 -0
- package/lib/typescript/module/ui/types/navigation.d.ts.map +1 -1
- package/lib/typescript/module/ui/utils/crossOriginRestore.d.ts.map +1 -1
- package/lib/typescript/module/ui/utils/deliveryPlatform.d.ts +33 -0
- package/lib/typescript/module/ui/utils/deliveryPlatform.d.ts.map +1 -0
- package/lib/typescript/module/ui/utils/fileManagement.d.ts +1 -1
- package/lib/typescript/module/ui/utils/fileManagement.d.ts.map +1 -1
- package/lib/typescript/module/ui/utils/oauthReturn.d.ts +30 -16
- package/lib/typescript/module/ui/utils/oauthReturn.d.ts.map +1 -1
- package/package.json +15 -7
- package/src/index.ts +50 -5
- package/src/notifications/deviceNotifications.ts +395 -0
- package/src/ui/boot/__tests__/coldBootWebAuthMode.test.ts +281 -0
- package/src/ui/boot/runProviderColdBoot.ts +83 -13
- package/src/ui/client.ts +0 -1
- package/src/ui/components/AvatarCameraBadge.tsx +1 -1
- package/src/ui/components/OxyAccountDialogScreen.tsx +20 -3
- package/src/ui/components/OxyAuthChooser.tsx +91 -1230
- package/src/ui/components/OxyConsentScreen.tsx +56 -13
- package/src/ui/components/OxyProvider.tsx +4 -4
- package/src/ui/components/OxySignInButton.tsx +119 -78
- 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/__tests__/OxyConsentScreen.test.tsx +27 -0
- package/src/ui/components/authChooser/AccountsMenuView.tsx +569 -0
- package/src/ui/components/authChooser/SignInEntryView.tsx +121 -0
- package/src/ui/components/authChooser/SignInRequestView.tsx +130 -0
- package/src/ui/components/authChooser/SignUpView.tsx +174 -0
- package/src/ui/components/authChooser/TroubleDisclosure.tsx +73 -0
- package/src/ui/components/authChooser/primitives.tsx +144 -0
- package/src/ui/components/authChooser/requestSurfaces.tsx +120 -0
- package/src/ui/components/authChooser/signInProgress.ts +54 -0
- package/src/ui/components/{oxyAuthChooserStyles.ts → authChooser/styles.ts} +18 -0
- package/src/ui/components/authChooser/types.ts +120 -0
- package/src/ui/components/authChooser/useUsernameAvailability.ts +60 -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 +1 -1
- package/src/ui/context/OxyContext.tsx +220 -24
- package/src/ui/context/__tests__/commitSessionFlow.test.ts +89 -0
- package/src/ui/context/commitSessionFlow.ts +61 -0
- package/src/ui/context/oxyContextTypes.ts +45 -1
- package/src/ui/context/useOxyAccountGraph.ts +19 -5
- package/src/ui/hooks/useSwitchableAccounts.ts +12 -1
- package/src/ui/index.ts +0 -1
- package/src/ui/oauth/__tests__/browserAuthTransport.test.ts +335 -0
- package/src/ui/oauth/__tests__/completeOAuthCode.test.ts +142 -0
- package/src/ui/oauth/__tests__/oauthPopup.test.ts +326 -0
- package/src/ui/oauth/__tests__/oauthPopupMessages.test.ts +189 -0
- package/src/ui/oauth/__tests__/sharedCompletionPath.test.ts +174 -0
- package/src/ui/oauth/browserAuthTransport.ts +187 -0
- package/src/ui/oauth/completeOAuthCode.ts +93 -0
- package/src/ui/oauth/legacyRedirectLanes.ts +43 -0
- package/src/ui/oauth/oauthHandshake.ts +74 -0
- package/src/ui/oauth/oauthPopup.ts +219 -0
- package/src/ui/oauth/oauthPopupMessages.ts +136 -0
- package/src/ui/oauth/types.ts +150 -0
- package/src/ui/screens/AccountMembersScreen.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 +2 -1
- package/src/ui/screens/FileManagementScreen.tsx +2 -1
- 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 +1 -1
- package/src/ui/screens/ProfileScreen.tsx +1 -1
- package/src/ui/screens/UserListScreen.tsx +1 -1
- package/src/ui/screens/WelcomeNewUserScreen.tsx +1 -1
- 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 +2 -1
- 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 +1 -1
- package/src/ui/screens/trust/TrustRewardsScreen.tsx +1 -1
- package/src/ui/server.ts +0 -2
- package/src/ui/session/__tests__/createSessionClient.test.ts +26 -0
- package/src/ui/session/__tests__/tokenTransport.test.ts +34 -0
- package/src/ui/session/authStore.ts +5 -89
- package/src/ui/session/createSessionClient.ts +15 -2
- package/src/ui/session/identityBinding.ts +116 -0
- package/src/ui/session/index.ts +6 -2
- package/src/ui/session/nativeSecureStorage.ts +98 -0
- package/src/ui/session/tokenTransport.ts +14 -1
- package/src/ui/types/navigation.ts +44 -1
- package/src/ui/utils/crossOriginRestore.ts +4 -7
- package/src/ui/utils/deliveryPlatform.ts +65 -0
- package/src/ui/utils/fileManagement.ts +1 -1
- package/src/ui/utils/oauthReturn.ts +74 -65
- package/lib/commonjs/assets/assets/fonts/Inter/Inter_18pt-Black.ttf +0 -0
- package/lib/commonjs/assets/assets/fonts/Inter/Inter_18pt-Bold.ttf +0 -0
- package/lib/commonjs/assets/assets/fonts/Inter/Inter_18pt-ExtraBold.ttf +0 -0
- package/lib/commonjs/assets/assets/fonts/Inter/Inter_18pt-Light.ttf +0 -0
- package/lib/commonjs/assets/assets/fonts/Inter/Inter_18pt-Medium.ttf +0 -0
- package/lib/commonjs/assets/assets/fonts/Inter/Inter_18pt-Regular.ttf +0 -0
- package/lib/commonjs/assets/assets/fonts/Inter/Inter_18pt-SemiBold.ttf +0 -0
- package/lib/commonjs/assets/fonts/Inter/Inter_18pt-Black.ttf +0 -0
- package/lib/commonjs/assets/fonts/Inter/Inter_18pt-Bold.ttf +0 -0
- package/lib/commonjs/assets/fonts/Inter/Inter_18pt-ExtraBold.ttf +0 -0
- package/lib/commonjs/assets/fonts/Inter/Inter_18pt-Light.ttf +0 -0
- package/lib/commonjs/assets/fonts/Inter/Inter_18pt-Medium.ttf +0 -0
- package/lib/commonjs/assets/fonts/Inter/Inter_18pt-Regular.ttf +0 -0
- package/lib/commonjs/assets/fonts/Inter/Inter_18pt-SemiBold.ttf +0 -0
- package/lib/commonjs/ui/components/FontLoader.js +0 -35
- package/lib/commonjs/ui/components/FontLoader.js.map +0 -1
- package/lib/commonjs/ui/components/FontLoader.native.js +0 -88
- package/lib/commonjs/ui/components/FontLoader.native.js.map +0 -1
- package/lib/commonjs/ui/components/oxyAuthChooserStyles.js.map +0 -1
- package/lib/module/assets/assets/fonts/Inter/Inter_18pt-Black.ttf +0 -0
- package/lib/module/assets/assets/fonts/Inter/Inter_18pt-Bold.ttf +0 -0
- package/lib/module/assets/assets/fonts/Inter/Inter_18pt-ExtraBold.ttf +0 -0
- package/lib/module/assets/assets/fonts/Inter/Inter_18pt-Light.ttf +0 -0
- package/lib/module/assets/assets/fonts/Inter/Inter_18pt-Medium.ttf +0 -0
- package/lib/module/assets/assets/fonts/Inter/Inter_18pt-Regular.ttf +0 -0
- package/lib/module/assets/assets/fonts/Inter/Inter_18pt-SemiBold.ttf +0 -0
- package/lib/module/assets/fonts/Inter/Inter_18pt-Black.ttf +0 -0
- package/lib/module/assets/fonts/Inter/Inter_18pt-Bold.ttf +0 -0
- package/lib/module/assets/fonts/Inter/Inter_18pt-ExtraBold.ttf +0 -0
- package/lib/module/assets/fonts/Inter/Inter_18pt-Light.ttf +0 -0
- package/lib/module/assets/fonts/Inter/Inter_18pt-Medium.ttf +0 -0
- package/lib/module/assets/fonts/Inter/Inter_18pt-Regular.ttf +0 -0
- package/lib/module/assets/fonts/Inter/Inter_18pt-SemiBold.ttf +0 -0
- package/lib/module/ui/components/FontLoader.js +0 -29
- package/lib/module/ui/components/FontLoader.js.map +0 -1
- package/lib/module/ui/components/FontLoader.native.js +0 -83
- package/lib/module/ui/components/FontLoader.native.js.map +0 -1
- package/lib/module/ui/components/oxyAuthChooserStyles.js.map +0 -1
- package/lib/typescript/commonjs/ui/components/FontLoader.d.ts +0 -24
- package/lib/typescript/commonjs/ui/components/FontLoader.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/components/FontLoader.native.d.ts +0 -13
- package/lib/typescript/commonjs/ui/components/FontLoader.native.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/components/oxyAuthChooserStyles.d.ts.map +0 -1
- package/lib/typescript/module/ui/components/FontLoader.d.ts +0 -24
- package/lib/typescript/module/ui/components/FontLoader.d.ts.map +0 -1
- package/lib/typescript/module/ui/components/FontLoader.native.d.ts +0 -13
- package/lib/typescript/module/ui/components/FontLoader.native.d.ts.map +0 -1
- package/lib/typescript/module/ui/components/oxyAuthChooserStyles.d.ts.map +0 -1
- package/src/assets/fonts/Inter/Inter_18pt-Black.ttf +0 -0
- package/src/assets/fonts/Inter/Inter_18pt-Bold.ttf +0 -0
- package/src/assets/fonts/Inter/Inter_18pt-ExtraBold.ttf +0 -0
- package/src/assets/fonts/Inter/Inter_18pt-Light.ttf +0 -0
- package/src/assets/fonts/Inter/Inter_18pt-Medium.ttf +0 -0
- package/src/assets/fonts/Inter/Inter_18pt-Regular.ttf +0 -0
- package/src/assets/fonts/Inter/Inter_18pt-SemiBold.ttf +0 -0
- package/src/ui/components/FontLoader.native.tsx +0 -88
- package/src/ui/components/FontLoader.tsx +0 -27
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.completeOAuthCode = completeOAuthCode;
|
|
7
|
+
var _core = require("@oxyhq/core");
|
|
8
|
+
/**
|
|
9
|
+
* The ONE path from an OAuth authorization code to a committed session.
|
|
10
|
+
*
|
|
11
|
+
* Both web transports end here — the popup with an in-memory handshake, the
|
|
12
|
+
* redirect lane with one read back from `sessionStorage` — so state validation,
|
|
13
|
+
* the PKCE exchange, the session commit, and handshake cleanup exist exactly
|
|
14
|
+
* once. Duplicating any of those per transport is how the two lanes would drift
|
|
15
|
+
* apart on the security-critical steps.
|
|
16
|
+
*
|
|
17
|
+
* Ordering is deliberate and load-bearing:
|
|
18
|
+
* 1. validate `state` BEFORE anything is sent to the token endpoint,
|
|
19
|
+
* 2. exchange the code for a session,
|
|
20
|
+
* 3. run `cleanup` (drop the persisted handshake / strip `?code=` from the
|
|
21
|
+
* URL) BEFORE the commit, so a stale code can never re-enter the exchange,
|
|
22
|
+
* 4. commit the session.
|
|
23
|
+
*
|
|
24
|
+
* `cleanup` runs exactly once on EVERY exit path, including a state mismatch
|
|
25
|
+
* and a failed exchange.
|
|
26
|
+
*/
|
|
27
|
+
|
|
28
|
+
/** Inputs for {@link completeOAuthCode}. */
|
|
29
|
+
|
|
30
|
+
async function completeOAuthCode(input) {
|
|
31
|
+
let cleaned = false;
|
|
32
|
+
const runCleanup = () => {
|
|
33
|
+
if (cleaned) return;
|
|
34
|
+
cleaned = true;
|
|
35
|
+
input.cleanup?.();
|
|
36
|
+
};
|
|
37
|
+
if (!input.handshake || !input.returnedState || input.handshake.state !== input.returnedState) {
|
|
38
|
+
_core.logger.warn('OAuth completion rejected: missing or mismatched state', {
|
|
39
|
+
component: 'completeOAuthCode'
|
|
40
|
+
});
|
|
41
|
+
runCleanup();
|
|
42
|
+
return {
|
|
43
|
+
ok: false,
|
|
44
|
+
reason: 'state-mismatch'
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
try {
|
|
48
|
+
const result = await input.oxyServices.exchangeOAuthCode({
|
|
49
|
+
code: input.code,
|
|
50
|
+
clientId: input.clientId,
|
|
51
|
+
redirectUri: input.redirectUri,
|
|
52
|
+
codeVerifier: input.handshake.codeVerifier
|
|
53
|
+
});
|
|
54
|
+
runCleanup();
|
|
55
|
+
await input.commitSession({
|
|
56
|
+
sessionId: result.sessionId,
|
|
57
|
+
accessToken: result.accessToken,
|
|
58
|
+
deviceId: result.deviceId,
|
|
59
|
+
deviceSecret: result.deviceSecret,
|
|
60
|
+
userId: result.user.id,
|
|
61
|
+
expiresAt: result.expiresAt,
|
|
62
|
+
user: result.user
|
|
63
|
+
});
|
|
64
|
+
return {
|
|
65
|
+
ok: true
|
|
66
|
+
};
|
|
67
|
+
} catch (error) {
|
|
68
|
+
_core.logger.warn('OAuth code exchange failed', {
|
|
69
|
+
component: 'completeOAuthCode'
|
|
70
|
+
}, error);
|
|
71
|
+
runCleanup();
|
|
72
|
+
return {
|
|
73
|
+
ok: false,
|
|
74
|
+
reason: 'exchange-failed'
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=completeOAuthCode.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_core","require","completeOAuthCode","input","cleaned","runCleanup","cleanup","handshake","returnedState","state","logger","warn","component","ok","reason","result","oxyServices","exchangeOAuthCode","code","clientId","redirectUri","codeVerifier","commitSession","sessionId","accessToken","deviceId","deviceSecret","userId","user","id","expiresAt","error"],"sourceRoot":"../../../../src","sources":["ui/oauth/completeOAuthCode.ts"],"mappings":";;;;;;AAqBA,IAAAA,KAAA,GAAAC,OAAA;AArBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAMA;;AA2BO,eAAeC,iBAAiBA,CACrCC,KAA6B,EACG;EAChC,IAAIC,OAAO,GAAG,KAAK;EACnB,MAAMC,UAAU,GAAGA,CAAA,KAAY;IAC7B,IAAID,OAAO,EAAE;IACbA,OAAO,GAAG,IAAI;IACdD,KAAK,CAACG,OAAO,GAAG,CAAC;EACnB,CAAC;EAED,IAAI,CAACH,KAAK,CAACI,SAAS,IAAI,CAACJ,KAAK,CAACK,aAAa,IAAIL,KAAK,CAACI,SAAS,CAACE,KAAK,KAAKN,KAAK,CAACK,aAAa,EAAE;IAC7FE,YAAM,CAACC,IAAI,CAAC,wDAAwD,EAAE;MACpEC,SAAS,EAAE;IACb,CAAC,CAAC;IACFP,UAAU,CAAC,CAAC;IACZ,OAAO;MAAEQ,EAAE,EAAE,KAAK;MAAEC,MAAM,EAAE;IAAiB,CAAC;EAChD;EAEA,IAAI;IACF,MAAMC,MAAM,GAAG,MAAMZ,KAAK,CAACa,WAAW,CAACC,iBAAiB,CAAC;MACvDC,IAAI,EAAEf,KAAK,CAACe,IAAI;MAChBC,QAAQ,EAAEhB,KAAK,CAACgB,QAAQ;MACxBC,WAAW,EAAEjB,KAAK,CAACiB,WAAW;MAC9BC,YAAY,EAAElB,KAAK,CAACI,SAAS,CAACc;IAChC,CAAC,CAAC;IACFhB,UAAU,CAAC,CAAC;IACZ,MAAMF,KAAK,CAACmB,aAAa,CAAC;MACxBC,SAAS,EAAER,MAAM,CAACQ,SAAS;MAC3BC,WAAW,EAAET,MAAM,CAACS,WAAW;MAC/BC,QAAQ,EAAEV,MAAM,CAACU,QAAQ;MACzBC,YAAY,EAAEX,MAAM,CAACW,YAAY;MACjCC,MAAM,EAAEZ,MAAM,CAACa,IAAI,CAACC,EAAE;MACtBC,SAAS,EAAEf,MAAM,CAACe,SAAS;MAC3BF,IAAI,EAAEb,MAAM,CAACa;IACf,CAAC,CAAC;IACF,OAAO;MAAEf,EAAE,EAAE;IAAK,CAAC;EACrB,CAAC,CAAC,OAAOkB,KAAK,EAAE;IACdrB,YAAM,CAACC,IAAI,CAAC,4BAA4B,EAAE;MAAEC,SAAS,EAAE;IAAoB,CAAC,EAAEmB,KAAK,CAAC;IACpF1B,UAAU,CAAC,CAAC;IACZ,OAAO;MAAEQ,EAAE,EAAE,KAAK;MAAEC,MAAM,EAAE;IAAkB,CAAC;EACjD;AACF","ignoreList":[]}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.allowsAutomaticIdpRedirect = allowsAutomaticIdpRedirect;
|
|
7
|
+
/**
|
|
8
|
+
* The legacy, redirect-mode-only lanes that navigate the RP's TOP-LEVEL window
|
|
9
|
+
* to the IdP without a user gesture.
|
|
10
|
+
*
|
|
11
|
+
* `webAuthMode: 'popup'` exists to guarantee exactly one thing: the relying
|
|
12
|
+
* party never leaves its route. Two mechanics in this SDK break that guarantee,
|
|
13
|
+
* because each replaces the whole document on its own initiative:
|
|
14
|
+
*
|
|
15
|
+
* 1. **Cold-boot silent restore** — a full-page `prompt=none` authorize bounce
|
|
16
|
+
* to `auth.oxy.so` when the device-secret mint finds no local session
|
|
17
|
+
* (`maybeStartSilentOAuthRestore`, called from `runProviderColdBoot`).
|
|
18
|
+
* 2. **Post-sign-in hub sync** — a full-page hop to `auth.oxy.so/sync` that
|
|
19
|
+
* plants this device's credential on the IdP hub so OTHER origins can later
|
|
20
|
+
* run lane 1 (`syncHubAfterSignIn`, called from the `commitSession` funnel).
|
|
21
|
+
*
|
|
22
|
+
* Both belong to the redirect transport and are kept only for the migration
|
|
23
|
+
* window (issue #691, "Cold boot and cross-domain behavior"). In popup mode a
|
|
24
|
+
* domain with no local credential simply resolves SIGNED OUT, and the user's
|
|
25
|
+
* next explicit "Continue with Oxy" opens the popup — from a real user gesture,
|
|
26
|
+
* never automatically.
|
|
27
|
+
*
|
|
28
|
+
* NOT covered here, and correctly enabled in BOTH modes: navigations the user
|
|
29
|
+
* asked for. When the browser blocks the popup, `startWebOAuthSignIn` still
|
|
30
|
+
* falls back to a full-page redirect rather than dead-ending the sign-in, and
|
|
31
|
+
* `tryCompleteOAuthReturn` still consumes a `?code=` that is already on the URL.
|
|
32
|
+
*
|
|
33
|
+
* PHASE 7b: once the pilot flips the default transport to `'popup'`, this
|
|
34
|
+
* predicate and BOTH lanes above are deleted outright. Grepping this symbol
|
|
35
|
+
* finds every site that has to go.
|
|
36
|
+
*/
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Whether a provider running `webAuthMode` may perform an SDK-initiated,
|
|
40
|
+
* non-gesture, full-page navigation to the IdP.
|
|
41
|
+
*
|
|
42
|
+
* `true` only for `'redirect'` — still the default and the compatibility path,
|
|
43
|
+
* whose behaviour must stay byte-for-byte unchanged.
|
|
44
|
+
*/
|
|
45
|
+
function allowsAutomaticIdpRedirect(webAuthMode) {
|
|
46
|
+
return webAuthMode === 'redirect';
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=legacyRedirectLanes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["allowsAutomaticIdpRedirect","webAuthMode"],"sourceRoot":"../../../../src","sources":["ui/oauth/legacyRedirectLanes.ts"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,0BAA0BA,CAACC,WAAwB,EAAW;EAC5E,OAAOA,WAAW,KAAK,UAAU;AACnC","ignoreList":[]}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.prepareAuthorizeRequest = prepareAuthorizeRequest;
|
|
7
|
+
var _core = require("@oxyhq/core");
|
|
8
|
+
/**
|
|
9
|
+
* The RP half of an OAuth authorize request: a fresh CSRF `state` + PKCE pair,
|
|
10
|
+
* and the authorize URL built from them.
|
|
11
|
+
*
|
|
12
|
+
* Both web transports start here, and the ONLY difference between them is one
|
|
13
|
+
* parameter: `popup` asks the IdP for `response_mode=web_message` so the result
|
|
14
|
+
* comes back to `window.opener` instead of navigating the RP's tab. Everything
|
|
15
|
+
* else — `S256` PKCE, exact registered `redirect_uri`, random `state` — is
|
|
16
|
+
* identical, which is what lets both lanes converge on one completion path.
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
/** Inputs for {@link prepareAuthorizeRequest}. */
|
|
20
|
+
|
|
21
|
+
/** A ready-to-use authorize request plus the secrets that finish it. */
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Generate a fresh handshake and build the authorize URL around it.
|
|
25
|
+
*
|
|
26
|
+
* The verifier is returned to the caller and never stored here: the popup
|
|
27
|
+
* transport keeps it in memory for the lifetime of the attempt, and the
|
|
28
|
+
* redirect transport persists it through `persistOAuthHandshake` because a
|
|
29
|
+
* full-page navigation destroys the running document.
|
|
30
|
+
*/
|
|
31
|
+
async function prepareAuthorizeRequest(params) {
|
|
32
|
+
const [pkce, state] = await Promise.all([(0, _core.generatePkcePair)(), (0, _core.generateOAuthState)()]);
|
|
33
|
+
const authorizeUrl = (0, _core.buildOAuthAuthorizeUrl)({
|
|
34
|
+
authorizeBaseUrl: params.authorizeBaseUrl,
|
|
35
|
+
clientId: params.clientId,
|
|
36
|
+
redirectUri: params.redirectUri,
|
|
37
|
+
scope: params.scope,
|
|
38
|
+
state,
|
|
39
|
+
codeChallenge: pkce.codeChallenge,
|
|
40
|
+
...(params.responseMode ? {
|
|
41
|
+
responseMode: params.responseMode
|
|
42
|
+
} : {})
|
|
43
|
+
});
|
|
44
|
+
return {
|
|
45
|
+
authorizeUrl,
|
|
46
|
+
authorizeOrigin: new URL(authorizeUrl).origin,
|
|
47
|
+
handshake: {
|
|
48
|
+
state,
|
|
49
|
+
codeVerifier: pkce.codeVerifier
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=oauthHandshake.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_core","require","prepareAuthorizeRequest","params","pkce","state","Promise","all","generatePkcePair","generateOAuthState","authorizeUrl","buildOAuthAuthorizeUrl","authorizeBaseUrl","clientId","redirectUri","scope","codeChallenge","responseMode","authorizeOrigin","URL","origin","handshake","codeVerifier"],"sourceRoot":"../../../../src","sources":["ui/oauth/oauthHandshake.ts"],"mappings":";;;;;;AAWA,IAAAA,KAAA,GAAAC,OAAA;AAXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAKA;;AAkBA;;AAaA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,eAAeC,uBAAuBA,CAC3CC,MAAqC,EACF;EACnC,MAAM,CAACC,IAAI,EAAEC,KAAK,CAAC,GAAG,MAAMC,OAAO,CAACC,GAAG,CAAC,CAAC,IAAAC,sBAAgB,EAAC,CAAC,EAAE,IAAAC,wBAAkB,EAAC,CAAC,CAAC,CAAC;EAEnF,MAAMC,YAAY,GAAG,IAAAC,4BAAsB,EAAC;IAC1CC,gBAAgB,EAAET,MAAM,CAACS,gBAAgB;IACzCC,QAAQ,EAAEV,MAAM,CAACU,QAAQ;IACzBC,WAAW,EAAEX,MAAM,CAACW,WAAW;IAC/BC,KAAK,EAAEZ,MAAM,CAACY,KAAK;IACnBV,KAAK;IACLW,aAAa,EAAEZ,IAAI,CAACY,aAAa;IACjC,IAAIb,MAAM,CAACc,YAAY,GAAG;MAAEA,YAAY,EAAEd,MAAM,CAACc;IAAa,CAAC,GAAG,CAAC,CAAC;EACtE,CAAC,CAAC;EAEF,OAAO;IACLP,YAAY;IACZQ,eAAe,EAAE,IAAIC,GAAG,CAACT,YAAY,CAAC,CAACU,MAAM;IAC7CC,SAAS,EAAE;MAAEhB,KAAK;MAAEiB,YAAY,EAAElB,IAAI,CAACkB;IAAa;EACtD,CAAC;AACH","ignoreList":[]}
|
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.OXY_OAUTH_POPUP_WINDOW_NAME = exports.DEFAULT_OAUTH_POPUP_TIMEOUT_MS = void 0;
|
|
7
|
+
exports.awaitOAuthPopupResult = awaitOAuthPopupResult;
|
|
8
|
+
exports.closeOAuthPopup = closeOAuthPopup;
|
|
9
|
+
exports.navigateOAuthPopup = navigateOAuthPopup;
|
|
10
|
+
exports.openOAuthPopup = openOAuthPopup;
|
|
11
|
+
var _core = require("@oxyhq/core");
|
|
12
|
+
var _oauthPopupMessages = require("./oauthPopupMessages.js");
|
|
13
|
+
/**
|
|
14
|
+
* Popup lifecycle for the web OAuth transport.
|
|
15
|
+
*
|
|
16
|
+
* Owns the window itself — opening it, navigating it, watching it, and tearing
|
|
17
|
+
* every listener and timer down — and nothing else: message validation lives in
|
|
18
|
+
* `oauthPopupMessages.ts`, and the code exchange in `completeOAuthCode.ts`.
|
|
19
|
+
*
|
|
20
|
+
* Three browser realities shape this module:
|
|
21
|
+
*
|
|
22
|
+
* - **Gesture attribution.** `window.open` only succeeds while the user's click
|
|
23
|
+
* is still being handled. Anything awaited first (resolving the application,
|
|
24
|
+
* generating PKCE) loses it and the popup is silently blocked. So the window
|
|
25
|
+
* is opened EMPTY up front and navigated once the authorize URL exists —
|
|
26
|
+
* the same shape as `passkeyHubPopup.ts`.
|
|
27
|
+
* - **No close event.** A cross-origin popup fires nothing when the user
|
|
28
|
+
* dismisses it; polling `closed` is the only mechanism (as in core's
|
|
29
|
+
* `AccountDialogController.watchPopup`).
|
|
30
|
+
* - **No cross-origin reads.** The popup's URL, title, and document are all
|
|
31
|
+
* opaque. The authorization result arrives ONLY as a `postMessage`.
|
|
32
|
+
*/
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Window name for the sign-in popup. Naming the target means a second press
|
|
36
|
+
* REUSES the same window instead of stacking a new one behind the first.
|
|
37
|
+
*/
|
|
38
|
+
const OXY_OAUTH_POPUP_WINDOW_NAME = exports.OXY_OAUTH_POPUP_WINDOW_NAME = 'oxy-oauth';
|
|
39
|
+
|
|
40
|
+
/** Chrome-free window roughly sized for the IdP's sign-in / QR surface. */
|
|
41
|
+
const POPUP_FEATURES = 'popup=yes,width=460,height=700,menubar=no,toolbar=no,location=no,status=no';
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* How long a popup sign-in may stay unanswered (ms).
|
|
45
|
+
*
|
|
46
|
+
* Generous on purpose: the IdP surface can involve scanning a QR and approving
|
|
47
|
+
* on a phone, so this tracks the authorize handle's own ~5-minute lifetime
|
|
48
|
+
* rather than a UI-scale timeout. It is a backstop against a wedged popup, not
|
|
49
|
+
* a pace-setter — a user who gives up closes the window and gets the faster
|
|
50
|
+
* `closed` outcome.
|
|
51
|
+
*/
|
|
52
|
+
const DEFAULT_OAUTH_POPUP_TIMEOUT_MS = exports.DEFAULT_OAUTH_POPUP_TIMEOUT_MS = 300_000;
|
|
53
|
+
|
|
54
|
+
/** How often the popup's `closed` flag is sampled (ms). */
|
|
55
|
+
const CLOSE_POLL_INTERVAL_MS = 1000;
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Grace period (ms) after `closed` flips before reporting cancellation.
|
|
59
|
+
*
|
|
60
|
+
* The IdP posts its result and THEN closes itself. Both land as separate tasks,
|
|
61
|
+
* so a poll tick that happens to fall between them would otherwise turn a
|
|
62
|
+
* successful sign-in into a "user cancelled". One short grace window lets the
|
|
63
|
+
* already-queued message win.
|
|
64
|
+
*/
|
|
65
|
+
const CLOSE_GRACE_MS = 400;
|
|
66
|
+
|
|
67
|
+
/** The `message` half of the DOM host, absent on native and during SSR. */
|
|
68
|
+
|
|
69
|
+
/** The `open` half of the DOM host, absent on native and during SSR. */
|
|
70
|
+
|
|
71
|
+
function messageEventHost() {
|
|
72
|
+
const win = globalThis.window;
|
|
73
|
+
if (!win || typeof win.addEventListener !== 'function' || typeof win.removeEventListener !== 'function') {
|
|
74
|
+
return null;
|
|
75
|
+
}
|
|
76
|
+
return win;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Open a new, EMPTY sign-in popup.
|
|
81
|
+
*
|
|
82
|
+
* MUST be called SYNCHRONOUSLY from a user-gesture handler, before any `await`.
|
|
83
|
+
* Returns `null` when the browser blocked it, when `window.open` threw, and on
|
|
84
|
+
* hosts with no DOM (native / SSR) — never throws, because "no popup" is an
|
|
85
|
+
* ordinary outcome the caller answers by falling back to a redirect.
|
|
86
|
+
*/
|
|
87
|
+
function openOAuthPopup() {
|
|
88
|
+
const win = globalThis.window;
|
|
89
|
+
if (!win || typeof win.open !== 'function') return null;
|
|
90
|
+
try {
|
|
91
|
+
return win.open('', OXY_OAUTH_POPUP_WINDOW_NAME, POPUP_FEATURES) ?? null;
|
|
92
|
+
} catch (error) {
|
|
93
|
+
_core.logger.warn('Could not open the OAuth sign-in popup', {
|
|
94
|
+
component: 'oauthPopup'
|
|
95
|
+
}, error);
|
|
96
|
+
return null;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Point an already-open popup at the authorize URL. Returns `false` when the
|
|
102
|
+
* assignment threw (a window closed between opening and navigating), so the
|
|
103
|
+
* caller can fall back to a redirect instead of waiting on a dead window.
|
|
104
|
+
*/
|
|
105
|
+
function navigateOAuthPopup(popup, url) {
|
|
106
|
+
try {
|
|
107
|
+
popup.location.href = url;
|
|
108
|
+
return true;
|
|
109
|
+
} catch (error) {
|
|
110
|
+
_core.logger.warn('Could not navigate the OAuth sign-in popup', {
|
|
111
|
+
component: 'oauthPopup'
|
|
112
|
+
}, error);
|
|
113
|
+
return false;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/** Close the popup if it is still open. Idempotent, null-safe, never throws. */
|
|
118
|
+
function closeOAuthPopup(popup) {
|
|
119
|
+
if (!popup || popup.closed) return;
|
|
120
|
+
try {
|
|
121
|
+
popup.close();
|
|
122
|
+
} catch (error) {
|
|
123
|
+
_core.logger.debug('OAuth popup close failed', {
|
|
124
|
+
component: 'oauthPopup'
|
|
125
|
+
}, error);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/** Inputs for {@link awaitOAuthPopupResult}. */
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Wait for the popup to deliver an authorization result.
|
|
133
|
+
*
|
|
134
|
+
* Settles EXACTLY once, with a typed outcome for every path — code, IdP error,
|
|
135
|
+
* state mismatch, user-closed, timeout — and removes its listener, its close
|
|
136
|
+
* poll, and both timers before resolving, whatever the outcome. Messages that
|
|
137
|
+
* arrive after settling reach nothing, so a duplicate delivery is inert.
|
|
138
|
+
*
|
|
139
|
+
* Never rejects: closing the window and running out of time are expected
|
|
140
|
+
* outcomes, not exceptions.
|
|
141
|
+
*/
|
|
142
|
+
function awaitOAuthPopupResult(options) {
|
|
143
|
+
const {
|
|
144
|
+
popup,
|
|
145
|
+
expectedOrigin,
|
|
146
|
+
expectedState,
|
|
147
|
+
timeoutMs = DEFAULT_OAUTH_POPUP_TIMEOUT_MS
|
|
148
|
+
} = options;
|
|
149
|
+
const host = messageEventHost();
|
|
150
|
+
if (!host) return Promise.resolve({
|
|
151
|
+
kind: 'unsupported'
|
|
152
|
+
});
|
|
153
|
+
return new Promise(resolve => {
|
|
154
|
+
let settled = false;
|
|
155
|
+
let timeoutTimer = null;
|
|
156
|
+
let closeGraceTimer = null;
|
|
157
|
+
let closePoll = null;
|
|
158
|
+
const onMessage = event => {
|
|
159
|
+
const verdict = (0, _oauthPopupMessages.readOAuthPopupMessage)(event, {
|
|
160
|
+
expectedOrigin,
|
|
161
|
+
expectedState,
|
|
162
|
+
popup
|
|
163
|
+
});
|
|
164
|
+
switch (verdict.kind) {
|
|
165
|
+
case 'ignore':
|
|
166
|
+
return;
|
|
167
|
+
case 'code':
|
|
168
|
+
settle({
|
|
169
|
+
kind: 'code',
|
|
170
|
+
code: verdict.code,
|
|
171
|
+
state: verdict.state
|
|
172
|
+
});
|
|
173
|
+
return;
|
|
174
|
+
case 'oauth-error':
|
|
175
|
+
settle({
|
|
176
|
+
kind: 'oauth-error',
|
|
177
|
+
error: verdict.error,
|
|
178
|
+
...(verdict.errorDescription ? {
|
|
179
|
+
errorDescription: verdict.errorDescription
|
|
180
|
+
} : {})
|
|
181
|
+
});
|
|
182
|
+
return;
|
|
183
|
+
case 'state-mismatch':
|
|
184
|
+
settle({
|
|
185
|
+
kind: 'state-mismatch'
|
|
186
|
+
});
|
|
187
|
+
return;
|
|
188
|
+
}
|
|
189
|
+
};
|
|
190
|
+
const cleanup = () => {
|
|
191
|
+
host.removeEventListener('message', onMessage);
|
|
192
|
+
if (timeoutTimer !== null) {
|
|
193
|
+
clearTimeout(timeoutTimer);
|
|
194
|
+
timeoutTimer = null;
|
|
195
|
+
}
|
|
196
|
+
if (closeGraceTimer !== null) {
|
|
197
|
+
clearTimeout(closeGraceTimer);
|
|
198
|
+
closeGraceTimer = null;
|
|
199
|
+
}
|
|
200
|
+
if (closePoll !== null) {
|
|
201
|
+
clearInterval(closePoll);
|
|
202
|
+
closePoll = null;
|
|
203
|
+
}
|
|
204
|
+
};
|
|
205
|
+
function settle(outcome) {
|
|
206
|
+
if (settled) return;
|
|
207
|
+
settled = true;
|
|
208
|
+
cleanup();
|
|
209
|
+
resolve(outcome);
|
|
210
|
+
}
|
|
211
|
+
host.addEventListener('message', onMessage);
|
|
212
|
+
timeoutTimer = setTimeout(() => settle({
|
|
213
|
+
kind: 'timed-out'
|
|
214
|
+
}), timeoutMs);
|
|
215
|
+
closePoll = setInterval(() => {
|
|
216
|
+
if (!popup.closed) return;
|
|
217
|
+
// Stop sampling immediately: the window is gone and only the in-flight
|
|
218
|
+
// message (if any) can still change the outcome.
|
|
219
|
+
if (closePoll !== null) {
|
|
220
|
+
clearInterval(closePoll);
|
|
221
|
+
closePoll = null;
|
|
222
|
+
}
|
|
223
|
+
closeGraceTimer = setTimeout(() => settle({
|
|
224
|
+
kind: 'closed'
|
|
225
|
+
}), CLOSE_GRACE_MS);
|
|
226
|
+
}, CLOSE_POLL_INTERVAL_MS);
|
|
227
|
+
});
|
|
228
|
+
}
|
|
229
|
+
//# sourceMappingURL=oauthPopup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_core","require","_oauthPopupMessages","OXY_OAUTH_POPUP_WINDOW_NAME","exports","POPUP_FEATURES","DEFAULT_OAUTH_POPUP_TIMEOUT_MS","CLOSE_POLL_INTERVAL_MS","CLOSE_GRACE_MS","messageEventHost","win","globalThis","window","addEventListener","removeEventListener","openOAuthPopup","open","error","logger","warn","component","navigateOAuthPopup","popup","url","location","href","closeOAuthPopup","closed","close","debug","awaitOAuthPopupResult","options","expectedOrigin","expectedState","timeoutMs","host","Promise","resolve","kind","settled","timeoutTimer","closeGraceTimer","closePoll","onMessage","event","verdict","readOAuthPopupMessage","settle","code","state","errorDescription","cleanup","clearTimeout","clearInterval","outcome","setTimeout","setInterval"],"sourceRoot":"../../../../src","sources":["ui/oauth/oauthPopup.ts"],"mappings":"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","ignoreList":[]}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.OXY_OAUTH_ERROR_MESSAGE_TYPE = exports.OXY_OAUTH_CODE_MESSAGE_TYPE = void 0;
|
|
7
|
+
exports.parseOAuthPopupMessage = parseOAuthPopupMessage;
|
|
8
|
+
exports.readOAuthPopupMessage = readOAuthPopupMessage;
|
|
9
|
+
var _core = require("@oxyhq/core");
|
|
10
|
+
/**
|
|
11
|
+
* Runtime validation for the popup OAuth `postMessage` channel.
|
|
12
|
+
*
|
|
13
|
+
* Everything arriving on `window`'s `message` event is untrusted: any frame on
|
|
14
|
+
* the page, any other popup, and any browser extension can post to us. This
|
|
15
|
+
* module is the ONLY place that decides whether an incoming event is a genuine
|
|
16
|
+
* authorization response, and it answers with a value — never a thrown error.
|
|
17
|
+
*
|
|
18
|
+
* A message is accepted only when ALL of these hold:
|
|
19
|
+
* 1. `event.origin` is EXACTLY the authorize endpoint's origin,
|
|
20
|
+
* 2. `event.source` is the exact `Window` reference we opened,
|
|
21
|
+
* 3. `event.data` matches one of the two frozen message shapes,
|
|
22
|
+
* 4. the `state` it carries matches the one this RP sent.
|
|
23
|
+
*
|
|
24
|
+
* Failing (1)–(3) is indistinguishable from unrelated page traffic, so the
|
|
25
|
+
* message is IGNORED and the flow keeps waiting. Failing (4) means our own
|
|
26
|
+
* popup answered a different request than the one in flight, which is terminal:
|
|
27
|
+
* it is reported as a mismatch rather than left to hang until the timeout.
|
|
28
|
+
*/
|
|
29
|
+
|
|
30
|
+
/** `postMessage` discriminator for a successful authorization. */
|
|
31
|
+
const OXY_OAUTH_CODE_MESSAGE_TYPE = exports.OXY_OAUTH_CODE_MESSAGE_TYPE = 'oxy:oauth:code';
|
|
32
|
+
|
|
33
|
+
/** `postMessage` discriminator for a typed OAuth failure. */
|
|
34
|
+
const OXY_OAUTH_ERROR_MESSAGE_TYPE = exports.OXY_OAUTH_ERROR_MESSAGE_TYPE = 'oxy:oauth:error';
|
|
35
|
+
|
|
36
|
+
/** Verdict for one incoming `message` event. */
|
|
37
|
+
|
|
38
|
+
/** What {@link readOAuthPopupMessage} validates an event against. */
|
|
39
|
+
|
|
40
|
+
function isNonEmptyString(value) {
|
|
41
|
+
return typeof value === 'string' && value.length > 0;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Reference equality across two `unknown` values.
|
|
46
|
+
*
|
|
47
|
+
* `event.source` is a `WindowProxy` and {@link OAuthPopupHandle} is a narrow
|
|
48
|
+
* structural type, so comparing them directly is a type error. Widening both to
|
|
49
|
+
* `unknown` keeps the check a plain identity comparison — which is exactly the
|
|
50
|
+
* security property we want — without a cast.
|
|
51
|
+
*/
|
|
52
|
+
function isSameWindowReference(a, b) {
|
|
53
|
+
return a === b;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Parse untrusted `event.data` into one of the two frozen message shapes, or
|
|
58
|
+
* `null` when it is anything else (including `null`, primitives, arrays, and
|
|
59
|
+
* objects with missing/wrong-typed fields).
|
|
60
|
+
*
|
|
61
|
+
* Unknown extra properties are tolerated but never read: only the fields below
|
|
62
|
+
* are ever surfaced, so a hostile sender cannot smuggle values past this point.
|
|
63
|
+
*/
|
|
64
|
+
function parseOAuthPopupMessage(data) {
|
|
65
|
+
if (typeof data !== 'object' || data === null || Array.isArray(data)) return null;
|
|
66
|
+
const record = data;
|
|
67
|
+
if (record.type === OXY_OAUTH_CODE_MESSAGE_TYPE) {
|
|
68
|
+
if (!isNonEmptyString(record.code) || !isNonEmptyString(record.state)) return null;
|
|
69
|
+
return {
|
|
70
|
+
type: OXY_OAUTH_CODE_MESSAGE_TYPE,
|
|
71
|
+
code: record.code,
|
|
72
|
+
state: record.state
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
if (record.type === OXY_OAUTH_ERROR_MESSAGE_TYPE) {
|
|
76
|
+
if (!isNonEmptyString(record.error)) return null;
|
|
77
|
+
return {
|
|
78
|
+
type: OXY_OAUTH_ERROR_MESSAGE_TYPE,
|
|
79
|
+
error: record.error,
|
|
80
|
+
...(isNonEmptyString(record.errorDescription) ? {
|
|
81
|
+
errorDescription: record.errorDescription
|
|
82
|
+
} : {}),
|
|
83
|
+
...(isNonEmptyString(record.state) ? {
|
|
84
|
+
state: record.state
|
|
85
|
+
} : {})
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
return null;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Classify one `message` event against the in-flight authorize request.
|
|
93
|
+
*
|
|
94
|
+
* Never throws. See the module header for the acceptance rules.
|
|
95
|
+
*/
|
|
96
|
+
function readOAuthPopupMessage(event, context) {
|
|
97
|
+
if (event.origin !== context.expectedOrigin) return {
|
|
98
|
+
kind: 'ignore'
|
|
99
|
+
};
|
|
100
|
+
if (!isSameWindowReference(event.source, context.popup)) return {
|
|
101
|
+
kind: 'ignore'
|
|
102
|
+
};
|
|
103
|
+
const message = parseOAuthPopupMessage(event.data);
|
|
104
|
+
if (!message) {
|
|
105
|
+
// Origin and source matched, so this came from the IdP window we opened —
|
|
106
|
+
// a shape we cannot read is worth a breadcrumb, unlike ordinary page noise.
|
|
107
|
+
_core.logger.debug('Ignored an unrecognised message from the OAuth popup', {
|
|
108
|
+
component: 'oauthPopupMessages'
|
|
109
|
+
});
|
|
110
|
+
return {
|
|
111
|
+
kind: 'ignore'
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
if (message.type === OXY_OAUTH_CODE_MESSAGE_TYPE) {
|
|
115
|
+
if (message.state !== context.expectedState) return {
|
|
116
|
+
kind: 'state-mismatch'
|
|
117
|
+
};
|
|
118
|
+
return {
|
|
119
|
+
kind: 'code',
|
|
120
|
+
code: message.code,
|
|
121
|
+
state: message.state
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
// An error MAY carry `state` (the IdP omits it when the request never got far
|
|
126
|
+
// enough to bind one). When present it must match: a foreign error must not be
|
|
127
|
+
// able to end an unrelated in-flight sign-in.
|
|
128
|
+
if (message.state !== undefined && message.state !== context.expectedState) {
|
|
129
|
+
return {
|
|
130
|
+
kind: 'state-mismatch'
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
return {
|
|
134
|
+
kind: 'oauth-error',
|
|
135
|
+
error: message.error,
|
|
136
|
+
...(message.errorDescription ? {
|
|
137
|
+
errorDescription: message.errorDescription
|
|
138
|
+
} : {})
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
//# sourceMappingURL=oauthPopupMessages.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_core","require","OXY_OAUTH_CODE_MESSAGE_TYPE","exports","OXY_OAUTH_ERROR_MESSAGE_TYPE","isNonEmptyString","value","length","isSameWindowReference","a","b","parseOAuthPopupMessage","data","Array","isArray","record","type","code","state","error","errorDescription","readOAuthPopupMessage","event","context","origin","expectedOrigin","kind","source","popup","message","logger","debug","component","expectedState","undefined"],"sourceRoot":"../../../../src","sources":["ui/oauth/oauthPopupMessages.ts"],"mappings":"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","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../src","sources":["ui/oauth/types.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _react = require("react");
|
|
8
8
|
var _reactNative = require("react-native");
|
|
9
|
-
var
|
|
9
|
+
var _Ionicons = _interopRequireDefault(require("@expo/vector-icons/Ionicons"));
|
|
10
10
|
var _reactQuery = require("@tanstack/react-query");
|
|
11
11
|
var _bloom = require("@oxyhq/bloom");
|
|
12
12
|
var _surfaces = require("@oxyhq/bloom/surfaces");
|
|
@@ -19,6 +19,7 @@ var _OxyContext = require("../context/OxyContext.js");
|
|
|
19
19
|
var _useI18n = require("../hooks/useI18n.js");
|
|
20
20
|
var _useSurfaceHeader = require("../hooks/useSurfaceHeader.js");
|
|
21
21
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
22
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
22
23
|
/** Roles assignable via invite / role change — everything except `owner`. */
|
|
23
24
|
|
|
24
25
|
const ASSIGNABLE_ROLES = ['admin', 'editor', 'developer', 'billing', 'viewer'];
|
|
@@ -362,7 +363,7 @@ const AccountMembersScreen = ({
|
|
|
362
363
|
onPress: () => confirmTransfer(member),
|
|
363
364
|
activeOpacity: 0.7,
|
|
364
365
|
className: "flex-row items-center gap-space-4",
|
|
365
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
366
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Ionicons.default, {
|
|
366
367
|
name: "swap-horizontal-outline",
|
|
367
368
|
size: 16,
|
|
368
369
|
color: colors.icon
|
|
@@ -376,7 +377,7 @@ const AccountMembersScreen = ({
|
|
|
376
377
|
onPress: () => confirmRemove(member),
|
|
377
378
|
activeOpacity: 0.7,
|
|
378
379
|
className: "flex-row items-center gap-space-4",
|
|
379
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
380
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Ionicons.default, {
|
|
380
381
|
name: "trash-outline",
|
|
381
382
|
size: 16,
|
|
382
383
|
color: colors.error
|