@oxyhq/services 6.8.0 → 6.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/ui/components/ActivityIndicator.js +4 -4
- package/lib/commonjs/ui/components/ActivityIndicator.js.map +1 -1
- package/lib/commonjs/ui/components/BottomSheet.js +6 -6
- package/lib/commonjs/ui/components/BottomSheet.js.map +1 -1
- package/lib/commonjs/ui/components/BottomSheetRouter.js +70 -3
- package/lib/commonjs/ui/components/BottomSheetRouter.js.map +1 -1
- package/lib/commonjs/ui/components/CrossFadeIcon.js +1 -1
- package/lib/commonjs/ui/components/CrossFadeIcon.js.map +1 -1
- package/lib/commonjs/ui/components/FollowButton.js +3 -5
- package/lib/commonjs/ui/components/FollowButton.js.map +1 -1
- package/lib/commonjs/ui/components/FontLoader.js +1 -1
- package/lib/commonjs/ui/components/FontLoader.js.map +1 -1
- package/lib/commonjs/ui/components/GroupedItem.js +1 -4
- package/lib/commonjs/ui/components/GroupedItem.js.map +1 -1
- package/lib/commonjs/ui/components/GroupedSection.js +1 -2
- package/lib/commonjs/ui/components/GroupedSection.js.map +1 -1
- package/lib/commonjs/ui/components/Header.js.map +1 -1
- package/lib/commonjs/ui/components/HelperText.js +2 -2
- package/lib/commonjs/ui/components/HelperText.js.map +1 -1
- package/lib/commonjs/ui/components/Icon.js +5 -5
- package/lib/commonjs/ui/components/Icon.js.map +1 -1
- package/lib/commonjs/ui/components/IconButton/IconButton.js +0 -2
- package/lib/commonjs/ui/components/IconButton/IconButton.js.map +1 -1
- package/lib/commonjs/ui/components/OxyProvider.js +17 -11
- package/lib/commonjs/ui/components/OxyProvider.js.map +1 -1
- package/lib/commonjs/ui/components/SignInModal.js +1 -1
- package/lib/commonjs/ui/components/SignInModal.js.map +1 -1
- package/lib/commonjs/ui/components/TextField/Adornment/TextFieldAdornment.js +6 -8
- package/lib/commonjs/ui/components/TextField/Adornment/TextFieldAdornment.js.map +1 -1
- package/lib/commonjs/ui/components/TextField/Adornment/utils.js +3 -3
- package/lib/commonjs/ui/components/TextField/Adornment/utils.js.map +1 -1
- package/lib/commonjs/ui/components/TextField/helpers.js +2 -3
- package/lib/commonjs/ui/components/TextField/helpers.js.map +1 -1
- package/lib/commonjs/ui/components/TextField.js +6 -9
- package/lib/commonjs/ui/components/TextField.js.map +1 -1
- package/lib/commonjs/ui/components/TouchableRipple/TouchableRipple.js +3 -3
- package/lib/commonjs/ui/components/TouchableRipple/TouchableRipple.js.map +1 -1
- package/lib/commonjs/ui/components/Typography/AnimatedText.js +12 -15
- package/lib/commonjs/ui/components/Typography/AnimatedText.js.map +1 -1
- package/lib/commonjs/ui/components/feedback/FormInput.js +1 -1
- package/lib/commonjs/ui/components/feedback/FormInput.js.map +1 -1
- package/lib/commonjs/ui/components/fileManagement/AnimatedButton.js +1 -2
- package/lib/commonjs/ui/components/fileManagement/AnimatedButton.js.map +1 -1
- package/lib/commonjs/ui/components/fileManagement/FileDetailsModal.js +0 -2
- package/lib/commonjs/ui/components/fileManagement/FileDetailsModal.js.map +1 -1
- package/lib/commonjs/ui/components/fileManagement/FileViewer.js +1 -2
- package/lib/commonjs/ui/components/fileManagement/FileViewer.js.map +1 -1
- package/lib/commonjs/ui/components/fileManagement/UploadPreview.js +0 -2
- package/lib/commonjs/ui/components/fileManagement/UploadPreview.js.map +1 -1
- package/lib/commonjs/ui/components/internal/GroupedPillButtons.js +15 -18
- package/lib/commonjs/ui/components/internal/GroupedPillButtons.js.map +1 -1
- package/lib/commonjs/ui/components/modals/DeleteAccountModal.js +3 -4
- package/lib/commonjs/ui/components/modals/DeleteAccountModal.js.map +1 -1
- package/lib/commonjs/ui/components/payment/PaymentDetailsStep.js +1 -2
- package/lib/commonjs/ui/components/payment/PaymentDetailsStep.js.map +1 -1
- package/lib/commonjs/ui/components/payment/PaymentMethodStep.js +1 -2
- package/lib/commonjs/ui/components/payment/PaymentMethodStep.js.map +1 -1
- package/lib/commonjs/ui/components/payment/PaymentReviewStep.js +1 -2
- package/lib/commonjs/ui/components/payment/PaymentReviewStep.js.map +1 -1
- package/lib/commonjs/ui/components/payment/PaymentSuccessStep.js +1 -2
- package/lib/commonjs/ui/components/payment/PaymentSuccessStep.js.map +1 -1
- package/lib/commonjs/ui/components/payment/PaymentSummaryStep.js +1 -2
- package/lib/commonjs/ui/components/payment/PaymentSummaryStep.js.map +1 -1
- package/lib/commonjs/ui/components/payment/paymentStyles.js +2 -2
- package/lib/commonjs/ui/components/payment/paymentStyles.js.map +1 -1
- package/lib/commonjs/ui/components/styles/overlay.js +4 -4
- package/lib/commonjs/ui/components/styles/overlay.js.map +1 -1
- package/lib/commonjs/ui/components/styles/shadow.js +58 -63
- package/lib/commonjs/ui/components/styles/shadow.js.map +1 -1
- package/lib/commonjs/ui/components/theming.js +7 -7
- package/lib/commonjs/ui/components/theming.js.map +1 -1
- package/lib/commonjs/ui/context/OxyContext.js +1 -2
- package/lib/commonjs/ui/context/OxyContext.js.map +1 -1
- package/lib/commonjs/ui/context/ThemeContext.js.map +1 -1
- package/lib/commonjs/ui/hooks/queries/useSecurityQueries.js.map +1 -1
- package/lib/commonjs/ui/hooks/useAssets.js +11 -27
- package/lib/commonjs/ui/hooks/useAssets.js.map +1 -1
- package/lib/commonjs/ui/hooks/useFileFiltering.js +1 -1
- package/lib/commonjs/ui/hooks/useFileFiltering.js.map +1 -1
- package/lib/commonjs/ui/index.js +19 -19
- package/lib/commonjs/ui/index.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountSwitcherScreen.js +1 -1
- package/lib/commonjs/ui/screens/AccountSwitcherScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/FAQScreen.js +1 -2
- package/lib/commonjs/ui/screens/FAQScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/FeedbackScreen.js +2 -3
- package/lib/commonjs/ui/screens/FeedbackScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/FileManagementScreen.js +9 -9
- package/lib/commonjs/ui/screens/FileManagementScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/FollowersListScreen.js +0 -1
- package/lib/commonjs/ui/screens/FollowersListScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/FollowingListScreen.js +0 -1
- package/lib/commonjs/ui/screens/FollowingListScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/LearnMoreUsernamesScreen.js +3 -4
- package/lib/commonjs/ui/screens/LearnMoreUsernamesScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/PaymentGatewayScreen.js +2 -3
- package/lib/commonjs/ui/screens/PaymentGatewayScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/PremiumSubscriptionScreen.js +10 -11
- package/lib/commonjs/ui/screens/PremiumSubscriptionScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/ProfileScreen.js +1 -1
- package/lib/commonjs/ui/screens/ProfileScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/UserListScreen.js +1 -2
- package/lib/commonjs/ui/screens/UserListScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/WelcomeNewUserScreen.js +2 -2
- package/lib/commonjs/ui/screens/WelcomeNewUserScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/karma/KarmaCenterScreen.js +5 -5
- package/lib/commonjs/ui/screens/karma/KarmaCenterScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/karma/KarmaLeaderboardScreen.js +1 -1
- package/lib/commonjs/ui/screens/karma/KarmaLeaderboardScreen.js.map +1 -1
- package/lib/commonjs/ui/stores/followStore.js +2 -2
- package/lib/commonjs/ui/stores/followStore.js.map +1 -1
- package/lib/commonjs/ui/utils/avatarUtils.js +1 -1
- package/lib/commonjs/ui/utils/avatarUtils.js.map +1 -1
- package/lib/commonjs/ui/utils/fileManagement.js +2 -2
- package/lib/commonjs/ui/utils/fileManagement.js.map +1 -1
- package/lib/commonjs/ui/utils/userUtils.js +1 -1
- package/lib/commonjs/ui/utils/userUtils.js.map +1 -1
- package/lib/module/ui/components/ActivityIndicator.js +4 -4
- package/lib/module/ui/components/ActivityIndicator.js.map +1 -1
- package/lib/module/ui/components/BottomSheet.js +7 -7
- package/lib/module/ui/components/BottomSheet.js.map +1 -1
- package/lib/module/ui/components/BottomSheetRouter.js +72 -5
- package/lib/module/ui/components/BottomSheetRouter.js.map +1 -1
- package/lib/module/ui/components/CrossFadeIcon.js +1 -1
- package/lib/module/ui/components/CrossFadeIcon.js.map +1 -1
- package/lib/module/ui/components/ErrorBoundary.js.map +1 -1
- package/lib/module/ui/components/FollowButton.js +3 -5
- package/lib/module/ui/components/FollowButton.js.map +1 -1
- package/lib/module/ui/components/FontLoader.js +1 -1
- package/lib/module/ui/components/FontLoader.js.map +1 -1
- package/lib/module/ui/components/GroupedItem.js +1 -2
- package/lib/module/ui/components/GroupedItem.js.map +1 -1
- package/lib/module/ui/components/GroupedSection.js +1 -1
- package/lib/module/ui/components/GroupedSection.js.map +1 -1
- package/lib/module/ui/components/Header.js.map +1 -1
- package/lib/module/ui/components/HelperText.js +2 -2
- package/lib/module/ui/components/HelperText.js.map +1 -1
- package/lib/module/ui/components/Icon.js +5 -4
- package/lib/module/ui/components/Icon.js.map +1 -1
- package/lib/module/ui/components/IconButton/IconButton.js +0 -1
- package/lib/module/ui/components/IconButton/IconButton.js.map +1 -1
- package/lib/module/ui/components/OxyProvider.js +18 -12
- package/lib/module/ui/components/OxyProvider.js.map +1 -1
- package/lib/module/ui/components/SignInModal.js +1 -1
- package/lib/module/ui/components/SignInModal.js.map +1 -1
- package/lib/module/ui/components/TextField/Addons/Underline.js.map +1 -1
- package/lib/module/ui/components/TextField/Adornment/TextFieldAdornment.js +6 -8
- package/lib/module/ui/components/TextField/Adornment/TextFieldAdornment.js.map +1 -1
- package/lib/module/ui/components/TextField/Adornment/utils.js +3 -3
- package/lib/module/ui/components/TextField/Adornment/utils.js.map +1 -1
- package/lib/module/ui/components/TextField/helpers.js +2 -3
- package/lib/module/ui/components/TextField/helpers.js.map +1 -1
- package/lib/module/ui/components/TextField.js +6 -9
- package/lib/module/ui/components/TextField.js.map +1 -1
- package/lib/module/ui/components/TouchableRipple/TouchableRipple.js +3 -3
- package/lib/module/ui/components/TouchableRipple/TouchableRipple.js.map +1 -1
- package/lib/module/ui/components/Typography/AnimatedText.js +12 -14
- package/lib/module/ui/components/Typography/AnimatedText.js.map +1 -1
- package/lib/module/ui/components/feedback/FormInput.js +1 -1
- package/lib/module/ui/components/feedback/FormInput.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 +0 -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 +0 -1
- package/lib/module/ui/components/fileManagement/UploadPreview.js.map +1 -1
- package/lib/module/ui/components/internal/GroupedPillButtons.js +15 -18
- package/lib/module/ui/components/internal/GroupedPillButtons.js.map +1 -1
- package/lib/module/ui/components/modals/DeleteAccountModal.js +3 -3
- 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/payment/paymentStyles.js +2 -2
- package/lib/module/ui/components/payment/paymentStyles.js.map +1 -1
- package/lib/module/ui/components/styles/overlay.js +4 -4
- package/lib/module/ui/components/styles/overlay.js.map +1 -1
- package/lib/module/ui/components/styles/shadow.js +58 -63
- package/lib/module/ui/components/styles/shadow.js.map +1 -1
- package/lib/module/ui/components/theming.js +7 -7
- package/lib/module/ui/components/theming.js.map +1 -1
- package/lib/module/ui/context/OxyContext.js +1 -1
- package/lib/module/ui/context/OxyContext.js.map +1 -1
- package/lib/module/ui/context/ThemeContext.js.map +1 -1
- package/lib/module/ui/hooks/queries/useSecurityQueries.js.map +1 -1
- package/lib/module/ui/hooks/useAssets.js +11 -27
- package/lib/module/ui/hooks/useAssets.js.map +1 -1
- package/lib/module/ui/hooks/useFileFiltering.js +1 -1
- package/lib/module/ui/hooks/useFileFiltering.js.map +1 -1
- package/lib/module/ui/index.js +19 -1
- package/lib/module/ui/index.js.map +1 -1
- package/lib/module/ui/screens/AccountSwitcherScreen.js +1 -1
- package/lib/module/ui/screens/AccountSwitcherScreen.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 +2 -2
- package/lib/module/ui/screens/FeedbackScreen.js.map +1 -1
- package/lib/module/ui/screens/FileManagementScreen.js +9 -9
- package/lib/module/ui/screens/FileManagementScreen.js.map +1 -1
- package/lib/module/ui/screens/FollowersListScreen.js +0 -1
- package/lib/module/ui/screens/FollowersListScreen.js.map +1 -1
- package/lib/module/ui/screens/FollowingListScreen.js +0 -1
- package/lib/module/ui/screens/FollowingListScreen.js.map +1 -1
- package/lib/module/ui/screens/LearnMoreUsernamesScreen.js +3 -3
- package/lib/module/ui/screens/LearnMoreUsernamesScreen.js.map +1 -1
- package/lib/module/ui/screens/PaymentGatewayScreen.js +2 -2
- package/lib/module/ui/screens/PaymentGatewayScreen.js.map +1 -1
- package/lib/module/ui/screens/PremiumSubscriptionScreen.js +10 -11
- 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 +2 -2
- package/lib/module/ui/screens/WelcomeNewUserScreen.js.map +1 -1
- package/lib/module/ui/screens/karma/KarmaCenterScreen.js +5 -5
- package/lib/module/ui/screens/karma/KarmaCenterScreen.js.map +1 -1
- package/lib/module/ui/screens/karma/KarmaLeaderboardScreen.js +1 -1
- package/lib/module/ui/screens/karma/KarmaLeaderboardScreen.js.map +1 -1
- package/lib/module/ui/stores/followStore.js +2 -2
- package/lib/module/ui/stores/followStore.js.map +1 -1
- package/lib/module/ui/utils/avatarUtils.js +1 -1
- package/lib/module/ui/utils/avatarUtils.js.map +1 -1
- package/lib/module/ui/utils/fileManagement.js +2 -2
- package/lib/module/ui/utils/fileManagement.js.map +1 -1
- package/lib/module/ui/utils/userUtils.js +1 -1
- package/lib/module/ui/utils/userUtils.js.map +1 -1
- package/lib/typescript/commonjs/ui/components/ActivityIndicator.d.ts +1 -1
- package/lib/typescript/commonjs/ui/components/ActivityIndicator.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/BottomSheet.d.ts +1 -1
- package/lib/typescript/commonjs/ui/components/BottomSheet.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/BottomSheetRouter.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/CrossFadeIcon.d.ts +1 -1
- package/lib/typescript/commonjs/ui/components/CrossFadeIcon.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/ErrorBoundary.d.ts +1 -1
- package/lib/typescript/commonjs/ui/components/ErrorBoundary.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/FollowButton.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/FontLoader.d.ts +1 -1
- package/lib/typescript/commonjs/ui/components/FontLoader.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/GroupedItem.d.ts +1 -1
- package/lib/typescript/commonjs/ui/components/GroupedItem.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/GroupedSection.d.ts +1 -1
- package/lib/typescript/commonjs/ui/components/GroupedSection.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/Header.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/HelperText.d.ts +1 -1
- package/lib/typescript/commonjs/ui/components/HelperText.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/Icon.d.ts +2 -2
- package/lib/typescript/commonjs/ui/components/Icon.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/IconButton/IconButton.d.ts +3 -3
- package/lib/typescript/commonjs/ui/components/IconButton/IconButton.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/OxyProvider.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/SignInModal.d.ts +1 -1
- package/lib/typescript/commonjs/ui/components/SignInModal.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/Surface.d.ts +1 -1
- package/lib/typescript/commonjs/ui/components/Surface.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/TextField/Addons/Outline.d.ts +2 -2
- package/lib/typescript/commonjs/ui/components/TextField/Addons/Outline.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/TextField/Addons/Underline.d.ts +1 -1
- package/lib/typescript/commonjs/ui/components/TextField/Addons/Underline.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/TextField/Adornment/TextFieldAdornment.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/TextField/Adornment/TextFieldAffix.d.ts +1 -1
- package/lib/typescript/commonjs/ui/components/TextField/Adornment/TextFieldAffix.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/TextField/Adornment/TextFieldIcon.d.ts +1 -1
- package/lib/typescript/commonjs/ui/components/TextField/Adornment/TextFieldIcon.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/TextField/helpers.d.ts +1 -1
- package/lib/typescript/commonjs/ui/components/TextField/helpers.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/TextField/types.d.ts +1 -1
- package/lib/typescript/commonjs/ui/components/TextField/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/TextField.d.ts +3 -3
- package/lib/typescript/commonjs/ui/components/TextField.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/TouchableRipple/TouchableRipple.d.ts +1 -1
- package/lib/typescript/commonjs/ui/components/TouchableRipple/TouchableRipple.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/TouchableRipple/TouchableRipple.native.d.ts +2 -2
- package/lib/typescript/commonjs/ui/components/TouchableRipple/TouchableRipple.native.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/Typography/AnimatedText.d.ts +2 -2
- package/lib/typescript/commonjs/ui/components/Typography/AnimatedText.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/fileManagement/AnimatedButton.d.ts +1 -1
- package/lib/typescript/commonjs/ui/components/fileManagement/AnimatedButton.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/fileManagement/FileDetailsModal.d.ts +1 -1
- package/lib/typescript/commonjs/ui/components/fileManagement/FileDetailsModal.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/fileManagement/FileViewer.d.ts +1 -1
- package/lib/typescript/commonjs/ui/components/fileManagement/FileViewer.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/fileManagement/UploadPreview.d.ts +1 -1
- package/lib/typescript/commonjs/ui/components/fileManagement/UploadPreview.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/internal/GroupedPillButtons.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/modals/DeleteAccountModal.d.ts +1 -1
- package/lib/typescript/commonjs/ui/components/modals/DeleteAccountModal.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/payment/PaymentDetailsStep.d.ts +1 -1
- package/lib/typescript/commonjs/ui/components/payment/PaymentDetailsStep.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/payment/PaymentMethodStep.d.ts +1 -1
- package/lib/typescript/commonjs/ui/components/payment/PaymentMethodStep.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/payment/PaymentReviewStep.d.ts +1 -1
- package/lib/typescript/commonjs/ui/components/payment/PaymentReviewStep.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/payment/PaymentSuccessStep.d.ts +1 -1
- package/lib/typescript/commonjs/ui/components/payment/PaymentSuccessStep.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/payment/PaymentSummaryStep.d.ts +1 -1
- package/lib/typescript/commonjs/ui/components/payment/PaymentSummaryStep.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/styles/overlay.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/styles/shadow.d.ts +1 -1
- package/lib/typescript/commonjs/ui/components/styles/shadow.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/context/OxyContext.d.ts +2 -1
- package/lib/typescript/commonjs/ui/context/OxyContext.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/context/ThemeContext.d.ts +1 -1
- package/lib/typescript/commonjs/ui/context/ThemeContext.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/mutations/mutationFactory.d.ts +1 -1
- package/lib/typescript/commonjs/ui/hooks/mutations/mutationFactory.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/queries/useSecurityQueries.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/useAssets.d.ts +2 -2
- package/lib/typescript/commonjs/ui/hooks/useAssets.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/useFileFiltering.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/index.d.ts +19 -1
- package/lib/typescript/commonjs/ui/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/FAQScreen.d.ts +1 -1
- package/lib/typescript/commonjs/ui/screens/FAQScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/FeedbackScreen.d.ts +1 -1
- package/lib/typescript/commonjs/ui/screens/FeedbackScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/FollowersListScreen.d.ts +1 -1
- package/lib/typescript/commonjs/ui/screens/FollowersListScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/FollowingListScreen.d.ts +1 -1
- package/lib/typescript/commonjs/ui/screens/FollowingListScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/LearnMoreUsernamesScreen.d.ts +1 -1
- package/lib/typescript/commonjs/ui/screens/LearnMoreUsernamesScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/PaymentGatewayScreen.d.ts +1 -1
- package/lib/typescript/commonjs/ui/screens/PaymentGatewayScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/PremiumSubscriptionScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/UserListScreen.d.ts +1 -1
- package/lib/typescript/commonjs/ui/screens/UserListScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/WelcomeNewUserScreen.d.ts +1 -1
- package/lib/typescript/commonjs/ui/screens/WelcomeNewUserScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/stores/assetStore.d.ts +1 -1
- package/lib/typescript/commonjs/ui/stores/assetStore.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/utils/avatarUtils.d.ts +1 -1
- package/lib/typescript/commonjs/ui/utils/avatarUtils.d.ts.map +1 -1
- 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/module/ui/components/ActivityIndicator.d.ts +1 -1
- package/lib/typescript/module/ui/components/ActivityIndicator.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/BottomSheet.d.ts +1 -1
- package/lib/typescript/module/ui/components/BottomSheet.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/BottomSheetRouter.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/CrossFadeIcon.d.ts +1 -1
- package/lib/typescript/module/ui/components/CrossFadeIcon.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/ErrorBoundary.d.ts +1 -1
- package/lib/typescript/module/ui/components/ErrorBoundary.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/FollowButton.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/FontLoader.d.ts +1 -1
- package/lib/typescript/module/ui/components/FontLoader.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/GroupedItem.d.ts +1 -1
- package/lib/typescript/module/ui/components/GroupedItem.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/GroupedSection.d.ts +1 -1
- package/lib/typescript/module/ui/components/GroupedSection.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/Header.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/HelperText.d.ts +1 -1
- package/lib/typescript/module/ui/components/HelperText.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/Icon.d.ts +2 -2
- package/lib/typescript/module/ui/components/Icon.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/IconButton/IconButton.d.ts +3 -3
- package/lib/typescript/module/ui/components/IconButton/IconButton.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/OxyProvider.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/SignInModal.d.ts +1 -1
- package/lib/typescript/module/ui/components/SignInModal.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/Surface.d.ts +1 -1
- package/lib/typescript/module/ui/components/Surface.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/TextField/Addons/Outline.d.ts +2 -2
- package/lib/typescript/module/ui/components/TextField/Addons/Outline.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/TextField/Addons/Underline.d.ts +1 -1
- package/lib/typescript/module/ui/components/TextField/Addons/Underline.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/TextField/Adornment/TextFieldAdornment.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/TextField/Adornment/TextFieldAffix.d.ts +1 -1
- package/lib/typescript/module/ui/components/TextField/Adornment/TextFieldAffix.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/TextField/Adornment/TextFieldIcon.d.ts +1 -1
- package/lib/typescript/module/ui/components/TextField/Adornment/TextFieldIcon.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/TextField/helpers.d.ts +1 -1
- package/lib/typescript/module/ui/components/TextField/helpers.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/TextField/types.d.ts +1 -1
- package/lib/typescript/module/ui/components/TextField/types.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/TextField.d.ts +3 -3
- package/lib/typescript/module/ui/components/TextField.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/TouchableRipple/TouchableRipple.d.ts +1 -1
- package/lib/typescript/module/ui/components/TouchableRipple/TouchableRipple.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/TouchableRipple/TouchableRipple.native.d.ts +2 -2
- package/lib/typescript/module/ui/components/TouchableRipple/TouchableRipple.native.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/Typography/AnimatedText.d.ts +2 -2
- package/lib/typescript/module/ui/components/Typography/AnimatedText.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/fileManagement/AnimatedButton.d.ts +1 -1
- package/lib/typescript/module/ui/components/fileManagement/AnimatedButton.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/fileManagement/FileDetailsModal.d.ts +1 -1
- package/lib/typescript/module/ui/components/fileManagement/FileDetailsModal.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/fileManagement/FileViewer.d.ts +1 -1
- package/lib/typescript/module/ui/components/fileManagement/FileViewer.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/fileManagement/UploadPreview.d.ts +1 -1
- package/lib/typescript/module/ui/components/fileManagement/UploadPreview.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/internal/GroupedPillButtons.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/modals/DeleteAccountModal.d.ts +1 -1
- package/lib/typescript/module/ui/components/modals/DeleteAccountModal.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/payment/PaymentDetailsStep.d.ts +1 -1
- package/lib/typescript/module/ui/components/payment/PaymentDetailsStep.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/payment/PaymentMethodStep.d.ts +1 -1
- package/lib/typescript/module/ui/components/payment/PaymentMethodStep.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/payment/PaymentReviewStep.d.ts +1 -1
- package/lib/typescript/module/ui/components/payment/PaymentReviewStep.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/payment/PaymentSuccessStep.d.ts +1 -1
- package/lib/typescript/module/ui/components/payment/PaymentSuccessStep.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/payment/PaymentSummaryStep.d.ts +1 -1
- package/lib/typescript/module/ui/components/payment/PaymentSummaryStep.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/styles/overlay.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/styles/shadow.d.ts +1 -1
- package/lib/typescript/module/ui/components/styles/shadow.d.ts.map +1 -1
- package/lib/typescript/module/ui/context/OxyContext.d.ts +2 -1
- package/lib/typescript/module/ui/context/OxyContext.d.ts.map +1 -1
- package/lib/typescript/module/ui/context/ThemeContext.d.ts +1 -1
- package/lib/typescript/module/ui/context/ThemeContext.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/mutations/mutationFactory.d.ts +1 -1
- package/lib/typescript/module/ui/hooks/mutations/mutationFactory.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/queries/useSecurityQueries.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/useAssets.d.ts +2 -2
- package/lib/typescript/module/ui/hooks/useAssets.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/useFileFiltering.d.ts.map +1 -1
- package/lib/typescript/module/ui/index.d.ts +19 -1
- package/lib/typescript/module/ui/index.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/FAQScreen.d.ts +1 -1
- package/lib/typescript/module/ui/screens/FAQScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/FeedbackScreen.d.ts +1 -1
- package/lib/typescript/module/ui/screens/FeedbackScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/FollowersListScreen.d.ts +1 -1
- package/lib/typescript/module/ui/screens/FollowersListScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/FollowingListScreen.d.ts +1 -1
- package/lib/typescript/module/ui/screens/FollowingListScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/LearnMoreUsernamesScreen.d.ts +1 -1
- package/lib/typescript/module/ui/screens/LearnMoreUsernamesScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/PaymentGatewayScreen.d.ts +1 -1
- package/lib/typescript/module/ui/screens/PaymentGatewayScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/PremiumSubscriptionScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/UserListScreen.d.ts +1 -1
- package/lib/typescript/module/ui/screens/UserListScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/WelcomeNewUserScreen.d.ts +1 -1
- package/lib/typescript/module/ui/screens/WelcomeNewUserScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/stores/assetStore.d.ts +1 -1
- package/lib/typescript/module/ui/stores/assetStore.d.ts.map +1 -1
- package/lib/typescript/module/ui/utils/avatarUtils.d.ts +1 -1
- package/lib/typescript/module/ui/utils/avatarUtils.d.ts.map +1 -1
- 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/types/expo-crypto.d.ts +1 -1
- package/lib/typescript/types/expo-secure-store.d.ts +4 -4
- package/package.json +1 -1
- package/src/types/expo-crypto.d.ts +1 -1
- package/src/types/expo-secure-store.d.ts +4 -4
- package/src/ui/components/ActivityIndicator.tsx +6 -6
- package/src/ui/components/BottomSheet.tsx +11 -12
- package/src/ui/components/BottomSheetRouter.tsx +69 -7
- package/src/ui/components/CrossFadeIcon.tsx +2 -2
- package/src/ui/components/ErrorBoundary.tsx +1 -1
- package/src/ui/components/FollowButton.tsx +3 -5
- package/src/ui/components/FontLoader.tsx +2 -1
- package/src/ui/components/GroupedItem.tsx +3 -3
- package/src/ui/components/GroupedSection.tsx +2 -1
- package/src/ui/components/Header.tsx +1 -1
- package/src/ui/components/HelperText.tsx +5 -5
- package/src/ui/components/Icon.tsx +5 -5
- package/src/ui/components/IconButton/IconButton.tsx +8 -8
- package/src/ui/components/OxyProvider.tsx +16 -10
- package/src/ui/components/SignInModal.tsx +2 -1
- package/src/ui/components/Surface.tsx +4 -4
- package/src/ui/components/TextField/Addons/Outline.tsx +4 -4
- package/src/ui/components/TextField/Addons/Underline.tsx +1 -1
- package/src/ui/components/TextField/Adornment/TextFieldAdornment.tsx +5 -8
- package/src/ui/components/TextField/Adornment/TextFieldAffix.tsx +6 -6
- package/src/ui/components/TextField/Adornment/TextFieldIcon.tsx +4 -4
- package/src/ui/components/TextField/Adornment/utils.ts +3 -3
- package/src/ui/components/TextField/Label/InputLabel.tsx +1 -1
- package/src/ui/components/TextField/TextFieldFlat.tsx +3 -3
- package/src/ui/components/TextField/TextFieldOutlined.tsx +5 -5
- package/src/ui/components/TextField/helpers.tsx +4 -5
- package/src/ui/components/TextField/types.tsx +1 -1
- package/src/ui/components/TextField.tsx +8 -11
- package/src/ui/components/TouchableRipple/TouchableRipple.native.tsx +6 -6
- package/src/ui/components/TouchableRipple/TouchableRipple.tsx +8 -8
- package/src/ui/components/Typography/AnimatedText.tsx +5 -6
- package/src/ui/components/feedback/FormInput.tsx +1 -1
- package/src/ui/components/fileManagement/AnimatedButton.tsx +2 -1
- package/src/ui/components/fileManagement/FileDetailsModal.tsx +1 -1
- package/src/ui/components/fileManagement/FileViewer.tsx +2 -1
- package/src/ui/components/fileManagement/UploadPreview.tsx +1 -1
- package/src/ui/components/internal/GroupedPillButtons.tsx +2 -6
- package/src/ui/components/modals/DeleteAccountModal.tsx +4 -3
- package/src/ui/components/payment/PaymentDetailsStep.tsx +2 -1
- package/src/ui/components/payment/PaymentMethodStep.tsx +2 -1
- package/src/ui/components/payment/PaymentReviewStep.tsx +2 -1
- package/src/ui/components/payment/PaymentSuccessStep.tsx +2 -1
- package/src/ui/components/payment/PaymentSummaryStep.tsx +2 -1
- package/src/ui/components/payment/paymentStyles.ts +2 -2
- package/src/ui/components/styles/overlay.tsx +6 -6
- package/src/ui/components/styles/shadow.tsx +9 -14
- package/src/ui/components/theming.tsx +7 -7
- package/src/ui/context/OxyContext.tsx +2 -1
- package/src/ui/context/ThemeContext.tsx +1 -1
- package/src/ui/hooks/mutations/mutationFactory.ts +1 -1
- package/src/ui/hooks/queries/useSecurityQueries.ts +1 -1
- package/src/ui/hooks/useAssets.ts +3 -23
- package/src/ui/hooks/useFileFiltering.ts +1 -2
- package/src/ui/index.ts +19 -1
- package/src/ui/screens/AccountSwitcherScreen.tsx +1 -1
- package/src/ui/screens/EditProfileFieldScreen.tsx +1 -1
- package/src/ui/screens/FAQScreen.tsx +2 -1
- package/src/ui/screens/FeedbackScreen.tsx +3 -2
- package/src/ui/screens/FileManagementScreen.tsx +10 -10
- package/src/ui/screens/FollowersListScreen.tsx +1 -1
- package/src/ui/screens/FollowingListScreen.tsx +1 -1
- package/src/ui/screens/LearnMoreUsernamesScreen.tsx +4 -3
- package/src/ui/screens/PaymentGatewayScreen.tsx +3 -2
- package/src/ui/screens/PremiumSubscriptionScreen.tsx +5 -7
- package/src/ui/screens/ProfileScreen.tsx +1 -1
- package/src/ui/screens/UserListScreen.tsx +2 -1
- package/src/ui/screens/WelcomeNewUserScreen.tsx +3 -2
- package/src/ui/screens/karma/KarmaCenterScreen.tsx +5 -5
- package/src/ui/screens/karma/KarmaLeaderboardScreen.tsx +1 -1
- package/src/ui/stores/assetStore.ts +1 -1
- package/src/ui/stores/followStore.ts +2 -2
- package/src/ui/utils/avatarUtils.ts +2 -2
- package/src/ui/utils/fileManagement.ts +4 -4
- package/src/ui/utils/userUtils.ts +1 -1
- package/lib/commonjs/ui/context/hooks/useDeviceManagement.js +0 -73
- package/lib/commonjs/ui/context/hooks/useDeviceManagement.js.map +0 -1
- package/lib/commonjs/ui/context/hooks/useLanguageManagement.js +0 -112
- package/lib/commonjs/ui/context/hooks/useLanguageManagement.js.map +0 -1
- package/lib/commonjs/ui/context/hooks/useSessionManagement.js +0 -279
- package/lib/commonjs/ui/context/hooks/useSessionManagement.js.map +0 -1
- package/lib/module/ui/context/hooks/useDeviceManagement.js +0 -68
- package/lib/module/ui/context/hooks/useDeviceManagement.js.map +0 -1
- package/lib/module/ui/context/hooks/useLanguageManagement.js +0 -107
- package/lib/module/ui/context/hooks/useLanguageManagement.js.map +0 -1
- package/lib/module/ui/context/hooks/useSessionManagement.js +0 -274
- package/lib/module/ui/context/hooks/useSessionManagement.js.map +0 -1
- package/lib/typescript/commonjs/ui/context/hooks/useDeviceManagement.d.ts +0 -27
- package/lib/typescript/commonjs/ui/context/hooks/useDeviceManagement.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/context/hooks/useLanguageManagement.d.ts +0 -25
- package/lib/typescript/commonjs/ui/context/hooks/useLanguageManagement.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/context/hooks/useSessionManagement.d.ts +0 -41
- package/lib/typescript/commonjs/ui/context/hooks/useSessionManagement.d.ts.map +0 -1
- package/lib/typescript/module/ui/context/hooks/useDeviceManagement.d.ts +0 -27
- package/lib/typescript/module/ui/context/hooks/useDeviceManagement.d.ts.map +0 -1
- package/lib/typescript/module/ui/context/hooks/useLanguageManagement.d.ts +0 -25
- package/lib/typescript/module/ui/context/hooks/useLanguageManagement.d.ts.map +0 -1
- package/lib/typescript/module/ui/context/hooks/useSessionManagement.d.ts +0 -41
- package/lib/typescript/module/ui/context/hooks/useSessionManagement.d.ts.map +0 -1
- package/src/ui/context/hooks/useDeviceManagement.ts +0 -108
- package/src/ui/context/hooks/useLanguageManagement.ts +0 -152
- package/src/ui/context/hooks/useSessionManagement.ts +0 -399
|
@@ -1,274 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import { useCallback, useMemo, useRef, useState } from 'react';
|
|
4
|
-
import { mergeSessions, normalizeAndSortSessions, sessionsArraysEqual } from '@oxyhq/core';
|
|
5
|
-
import { fetchSessionsWithFallback, validateSessionBatch } from "../../utils/sessionHelpers.js";
|
|
6
|
-
import { getStorageKeys } from "../../utils/storageHelpers.js";
|
|
7
|
-
import { handleAuthError, isInvalidSessionError } from "../../utils/errorHandlers.js";
|
|
8
|
-
import { clearQueryCache } from "../../hooks/queryClient.js";
|
|
9
|
-
const DEFAULT_SAVE_ERROR_MESSAGE = 'Failed to save session data';
|
|
10
|
-
const CLEAR_STORAGE_ERROR = 'Failed to clear storage';
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Manage session state, persistence, and high-level multi-session operations.
|
|
14
|
-
*
|
|
15
|
-
* @param options - Session management configuration
|
|
16
|
-
*/
|
|
17
|
-
export const useSessionManagement = ({
|
|
18
|
-
oxyServices,
|
|
19
|
-
storage,
|
|
20
|
-
storageKeyPrefix,
|
|
21
|
-
loginSuccess,
|
|
22
|
-
logoutStore,
|
|
23
|
-
applyLanguagePreference,
|
|
24
|
-
onAuthStateChange,
|
|
25
|
-
onError,
|
|
26
|
-
setAuthError,
|
|
27
|
-
logger,
|
|
28
|
-
setTokenReady,
|
|
29
|
-
queryClient
|
|
30
|
-
}) => {
|
|
31
|
-
const [sessions, setSessions] = useState([]);
|
|
32
|
-
const [activeSessionId, setActiveSessionId] = useState(null);
|
|
33
|
-
const refreshInFlightRef = useRef(null);
|
|
34
|
-
const removedSessionsRef = useRef(new Set());
|
|
35
|
-
const lastRefreshRef = useRef(0);
|
|
36
|
-
const storageKeys = useMemo(() => getStorageKeys(storageKeyPrefix), [storageKeyPrefix]);
|
|
37
|
-
const saveSessionIds = useCallback(async sessionIds => {
|
|
38
|
-
if (!storage) return;
|
|
39
|
-
try {
|
|
40
|
-
const uniqueIds = Array.from(new Set(sessionIds));
|
|
41
|
-
await storage.setItem(storageKeys.sessionIds, JSON.stringify(uniqueIds));
|
|
42
|
-
} catch (error) {
|
|
43
|
-
if (logger) {
|
|
44
|
-
logger(DEFAULT_SAVE_ERROR_MESSAGE, error);
|
|
45
|
-
} else if (__DEV__) {
|
|
46
|
-
console.warn('Failed to save session IDs:', error);
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
}, [logger, storage, storageKeys.sessionIds]);
|
|
50
|
-
const updateSessions = useCallback((incoming, options = {}) => {
|
|
51
|
-
setSessions(prevSessions => {
|
|
52
|
-
const processed = options.merge ? mergeSessions(prevSessions, incoming, activeSessionId, false) : normalizeAndSortSessions(incoming, activeSessionId, false);
|
|
53
|
-
if (storage) {
|
|
54
|
-
void saveSessionIds(processed.map(session => session.sessionId));
|
|
55
|
-
}
|
|
56
|
-
if (sessionsArraysEqual(prevSessions, processed)) {
|
|
57
|
-
return prevSessions;
|
|
58
|
-
}
|
|
59
|
-
return processed;
|
|
60
|
-
});
|
|
61
|
-
}, [activeSessionId, saveSessionIds, storage]);
|
|
62
|
-
const saveActiveSessionId = useCallback(async sessionId => {
|
|
63
|
-
if (!storage) return;
|
|
64
|
-
try {
|
|
65
|
-
await storage.setItem(storageKeys.activeSessionId, sessionId);
|
|
66
|
-
} catch (error) {
|
|
67
|
-
handleAuthError(error, {
|
|
68
|
-
defaultMessage: DEFAULT_SAVE_ERROR_MESSAGE,
|
|
69
|
-
code: 'SESSION_PERSISTENCE_ERROR',
|
|
70
|
-
onError,
|
|
71
|
-
setAuthError,
|
|
72
|
-
logger
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
}, [logger, onError, setAuthError, storage, storageKeys.activeSessionId]);
|
|
76
|
-
const removeActiveSessionId = useCallback(async () => {
|
|
77
|
-
if (!storage) return;
|
|
78
|
-
try {
|
|
79
|
-
await storage.removeItem(storageKeys.activeSessionId);
|
|
80
|
-
} catch (error) {
|
|
81
|
-
handleAuthError(error, {
|
|
82
|
-
defaultMessage: DEFAULT_SAVE_ERROR_MESSAGE,
|
|
83
|
-
code: 'SESSION_PERSISTENCE_ERROR',
|
|
84
|
-
onError,
|
|
85
|
-
setAuthError,
|
|
86
|
-
logger
|
|
87
|
-
});
|
|
88
|
-
}
|
|
89
|
-
}, [logger, onError, setAuthError, storage, storageKeys.activeSessionId]);
|
|
90
|
-
const clearSessionStorage = useCallback(async () => {
|
|
91
|
-
if (!storage) return;
|
|
92
|
-
try {
|
|
93
|
-
await storage.removeItem(storageKeys.activeSessionId);
|
|
94
|
-
await storage.removeItem(storageKeys.sessionIds);
|
|
95
|
-
} catch (error) {
|
|
96
|
-
handleAuthError(error, {
|
|
97
|
-
defaultMessage: CLEAR_STORAGE_ERROR,
|
|
98
|
-
code: 'STORAGE_ERROR',
|
|
99
|
-
onError,
|
|
100
|
-
setAuthError,
|
|
101
|
-
logger
|
|
102
|
-
});
|
|
103
|
-
}
|
|
104
|
-
}, [logger, onError, setAuthError, storage, storageKeys.activeSessionId, storageKeys.sessionIds]);
|
|
105
|
-
const clearSessionState = useCallback(async () => {
|
|
106
|
-
setSessions([]);
|
|
107
|
-
setActiveSessionId(null);
|
|
108
|
-
logoutStore();
|
|
109
|
-
|
|
110
|
-
// Clear TanStack Query cache (in-memory)
|
|
111
|
-
if (queryClient) {
|
|
112
|
-
queryClient.clear();
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
// Clear persisted query cache
|
|
116
|
-
if (storage) {
|
|
117
|
-
try {
|
|
118
|
-
await clearQueryCache(storage);
|
|
119
|
-
} catch (error) {
|
|
120
|
-
if (logger) {
|
|
121
|
-
logger('Failed to clear persisted query cache', error);
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
await clearSessionStorage();
|
|
126
|
-
onAuthStateChange?.(null);
|
|
127
|
-
}, [clearSessionStorage, logoutStore, onAuthStateChange, queryClient, storage, logger]);
|
|
128
|
-
const activateSession = useCallback(async (sessionId, user) => {
|
|
129
|
-
await oxyServices.getTokenBySession(sessionId);
|
|
130
|
-
setTokenReady?.(true);
|
|
131
|
-
setActiveSessionId(sessionId);
|
|
132
|
-
loginSuccess(user);
|
|
133
|
-
await saveActiveSessionId(sessionId);
|
|
134
|
-
await applyLanguagePreference(user);
|
|
135
|
-
onAuthStateChange?.(user);
|
|
136
|
-
}, [applyLanguagePreference, loginSuccess, onAuthStateChange, oxyServices, saveActiveSessionId, setTokenReady]);
|
|
137
|
-
const trackRemovedSession = useCallback(sessionId => {
|
|
138
|
-
removedSessionsRef.current.add(sessionId);
|
|
139
|
-
setTimeout(() => {
|
|
140
|
-
removedSessionsRef.current.delete(sessionId);
|
|
141
|
-
}, 5000);
|
|
142
|
-
}, []);
|
|
143
|
-
const findReplacementSession = useCallback(async sessionIds => {
|
|
144
|
-
if (!sessionIds.length) {
|
|
145
|
-
return null;
|
|
146
|
-
}
|
|
147
|
-
const validationResults = await validateSessionBatch(oxyServices, sessionIds, {
|
|
148
|
-
maxConcurrency: 3
|
|
149
|
-
});
|
|
150
|
-
const validSession = validationResults.find(result => result.valid);
|
|
151
|
-
if (!validSession) {
|
|
152
|
-
return null;
|
|
153
|
-
}
|
|
154
|
-
const validation = await oxyServices.validateSession(validSession.sessionId, {
|
|
155
|
-
useHeaderValidation: true
|
|
156
|
-
});
|
|
157
|
-
if (!validation?.valid || !validation.user) {
|
|
158
|
-
return null;
|
|
159
|
-
}
|
|
160
|
-
const user = validation.user;
|
|
161
|
-
await activateSession(validSession.sessionId, user);
|
|
162
|
-
return user;
|
|
163
|
-
}, [activateSession, oxyServices]);
|
|
164
|
-
const switchSession = useCallback(async sessionId => {
|
|
165
|
-
try {
|
|
166
|
-
const validation = await oxyServices.validateSession(sessionId, {
|
|
167
|
-
useHeaderValidation: true
|
|
168
|
-
});
|
|
169
|
-
if (!validation?.valid) {
|
|
170
|
-
throw new Error('Session is invalid or expired');
|
|
171
|
-
}
|
|
172
|
-
if (!validation.user) {
|
|
173
|
-
throw new Error('User data not available from session validation');
|
|
174
|
-
}
|
|
175
|
-
const user = validation.user;
|
|
176
|
-
await activateSession(sessionId, user);
|
|
177
|
-
try {
|
|
178
|
-
const deviceSessions = await fetchSessionsWithFallback(oxyServices, sessionId, {
|
|
179
|
-
fallbackUserId: user.id,
|
|
180
|
-
logger
|
|
181
|
-
});
|
|
182
|
-
updateSessions(deviceSessions, {
|
|
183
|
-
merge: true
|
|
184
|
-
});
|
|
185
|
-
} catch (error) {
|
|
186
|
-
if (__DEV__) {
|
|
187
|
-
console.warn('Failed to synchronize sessions after switch:', error);
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
return user;
|
|
191
|
-
} catch (error) {
|
|
192
|
-
const invalidSession = isInvalidSessionError(error);
|
|
193
|
-
if (invalidSession) {
|
|
194
|
-
updateSessions(sessions.filter(session => session.sessionId !== sessionId), {
|
|
195
|
-
merge: false
|
|
196
|
-
});
|
|
197
|
-
if (sessionId === activeSessionId) {
|
|
198
|
-
const otherSessionIds = sessions.filter(session => session.sessionId !== sessionId && !removedSessionsRef.current.has(session.sessionId)).map(session => session.sessionId);
|
|
199
|
-
const replacementUser = await findReplacementSession(otherSessionIds);
|
|
200
|
-
if (replacementUser) {
|
|
201
|
-
return replacementUser;
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
handleAuthError(error, {
|
|
206
|
-
defaultMessage: 'Failed to switch session',
|
|
207
|
-
code: invalidSession ? 'INVALID_SESSION' : 'SESSION_SWITCH_ERROR',
|
|
208
|
-
onError,
|
|
209
|
-
setAuthError,
|
|
210
|
-
logger
|
|
211
|
-
});
|
|
212
|
-
throw error instanceof Error ? error : new Error('Failed to switch session');
|
|
213
|
-
}
|
|
214
|
-
}, [activateSession, activeSessionId, findReplacementSession, logger, loginSuccess, onError, oxyServices, sessions, setAuthError, updateSessions]);
|
|
215
|
-
const refreshSessions = useCallback(async activeUserId => {
|
|
216
|
-
if (!activeSessionId) return;
|
|
217
|
-
if (refreshInFlightRef.current) {
|
|
218
|
-
await refreshInFlightRef.current;
|
|
219
|
-
return;
|
|
220
|
-
}
|
|
221
|
-
const now = Date.now();
|
|
222
|
-
if (now - lastRefreshRef.current < 500) {
|
|
223
|
-
return;
|
|
224
|
-
}
|
|
225
|
-
lastRefreshRef.current = now;
|
|
226
|
-
const refreshPromise = (async () => {
|
|
227
|
-
try {
|
|
228
|
-
const deviceSessions = await fetchSessionsWithFallback(oxyServices, activeSessionId, {
|
|
229
|
-
fallbackUserId: activeUserId,
|
|
230
|
-
logger
|
|
231
|
-
});
|
|
232
|
-
updateSessions(deviceSessions, {
|
|
233
|
-
merge: true
|
|
234
|
-
});
|
|
235
|
-
} catch (error) {
|
|
236
|
-
if (isInvalidSessionError(error)) {
|
|
237
|
-
const otherSessions = sessions.filter(session => session.sessionId !== activeSessionId && !removedSessionsRef.current.has(session.sessionId)).map(session => session.sessionId);
|
|
238
|
-
const replacementUser = await findReplacementSession(otherSessions);
|
|
239
|
-
if (!replacementUser) {
|
|
240
|
-
await clearSessionState();
|
|
241
|
-
}
|
|
242
|
-
return;
|
|
243
|
-
}
|
|
244
|
-
handleAuthError(error, {
|
|
245
|
-
defaultMessage: 'Failed to refresh sessions',
|
|
246
|
-
code: 'SESSION_REFRESH_ERROR',
|
|
247
|
-
onError,
|
|
248
|
-
setAuthError,
|
|
249
|
-
logger
|
|
250
|
-
});
|
|
251
|
-
} finally {
|
|
252
|
-
refreshInFlightRef.current = null;
|
|
253
|
-
lastRefreshRef.current = Date.now();
|
|
254
|
-
}
|
|
255
|
-
})();
|
|
256
|
-
refreshInFlightRef.current = refreshPromise;
|
|
257
|
-
await refreshPromise;
|
|
258
|
-
}, [activeSessionId, clearSessionState, findReplacementSession, logger, onError, oxyServices, sessions, setAuthError, updateSessions]);
|
|
259
|
-
const isRefreshInFlight = Boolean(refreshInFlightRef.current);
|
|
260
|
-
return {
|
|
261
|
-
sessions,
|
|
262
|
-
activeSessionId,
|
|
263
|
-
setActiveSessionId,
|
|
264
|
-
updateSessions,
|
|
265
|
-
switchSession,
|
|
266
|
-
refreshSessions,
|
|
267
|
-
clearSessionState,
|
|
268
|
-
saveActiveSessionId,
|
|
269
|
-
trackRemovedSession,
|
|
270
|
-
storageKeys,
|
|
271
|
-
isRefreshInFlight
|
|
272
|
-
};
|
|
273
|
-
};
|
|
274
|
-
//# sourceMappingURL=useSessionManagement.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["useCallback","useMemo","useRef","useState","mergeSessions","normalizeAndSortSessions","sessionsArraysEqual","fetchSessionsWithFallback","validateSessionBatch","getStorageKeys","handleAuthError","isInvalidSessionError","clearQueryCache","DEFAULT_SAVE_ERROR_MESSAGE","CLEAR_STORAGE_ERROR","useSessionManagement","oxyServices","storage","storageKeyPrefix","loginSuccess","logoutStore","applyLanguagePreference","onAuthStateChange","onError","setAuthError","logger","setTokenReady","queryClient","sessions","setSessions","activeSessionId","setActiveSessionId","refreshInFlightRef","removedSessionsRef","Set","lastRefreshRef","storageKeys","saveSessionIds","sessionIds","uniqueIds","Array","from","setItem","JSON","stringify","error","__DEV__","console","warn","updateSessions","incoming","options","prevSessions","processed","merge","map","session","sessionId","saveActiveSessionId","defaultMessage","code","removeActiveSessionId","removeItem","clearSessionStorage","clearSessionState","clear","activateSession","user","getTokenBySession","trackRemovedSession","current","add","setTimeout","delete","findReplacementSession","length","validationResults","maxConcurrency","validSession","find","result","valid","validation","validateSession","useHeaderValidation","switchSession","Error","deviceSessions","fallbackUserId","id","invalidSession","filter","otherSessionIds","has","replacementUser","refreshSessions","activeUserId","now","Date","refreshPromise","otherSessions","isRefreshInFlight","Boolean"],"sourceRoot":"../../../../../src","sources":["ui/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Aa,GAAGxE,QAAQ,CAC3B+D,MAAM,CACJnC,OAAO,IACNA,OAAO,CAACC,SAAS,KAAK3B,eAAe,IACrC,CAACG,kBAAkB,CAACqC,OAAO,CAACuB,GAAG,CAACrC,OAAO,CAACC,SAAS,CACrD,CAAC,CACAF,GAAG,CAAEC,OAAO,IAAKA,OAAO,CAACC,SAAS,CAAC;UAEtC,MAAMqC,eAAe,GAAG,MAAMpB,sBAAsB,CAAC0B,aAAa,CAAC;UACnE,IAAI,CAACN,eAAe,EAAE;YACpB,MAAM9B,iBAAiB,CAAC,CAAC;UAC3B;UACA;QACF;QAEAtD,eAAe,CAACmC,KAAK,EAAE;UACrBc,cAAc,EAAE,4BAA4B;UAC5CC,IAAI,EAAE,uBAAuB;UAC7BrC,OAAO;UACPC,YAAY;UACZC;QACF,CAAC,CAAC;MACJ,CAAC,SAAS;QACRO,kBAAkB,CAACsC,OAAO,GAAG,IAAI;QACjCnC,cAAc,CAACmC,OAAO,GAAG4B,IAAI,CAACD,GAAG,CAAC,CAAC;MACrC;IACF,CAAC,EAAE,CAAC;IAEJjE,kBAAkB,CAACsC,OAAO,GAAG6B,cAAc;IAC3C,MAAMA,cAAc;EACtB,CAAC,EACD,CACErE,eAAe,EACfkC,iBAAiB,EACjBU,sBAAsB,EACtBjD,MAAM,EACNF,OAAO,EACPP,WAAW,EACXY,QAAQ,EACRJ,YAAY,EACZyB,cAAc,CAElB,CAAC;EAED,MAAMoD,iBAAiB,GAAGC,OAAO,CAACtE,kBAAkB,CAACsC,OAAO,CAAC;EAE7D,OAAO;IACL1C,QAAQ;IACRE,eAAe;IACfC,kBAAkB;IAClBkB,cAAc;IACdoC,aAAa;IACbU,eAAe;IACf/B,iBAAiB;IACjBN,mBAAmB;IACnBW,mBAAmB;IACnBjC,WAAW;IACXiE;EACF,CAAC;AACH,CAAC","ignoreList":[]}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import type { ApiError } from '@oxyhq/core';
|
|
2
|
-
import type { OxyServices } from '@oxyhq/core';
|
|
3
|
-
export interface UseDeviceManagementOptions {
|
|
4
|
-
oxyServices: OxyServices;
|
|
5
|
-
activeSessionId: string | null;
|
|
6
|
-
onError?: (error: ApiError) => void;
|
|
7
|
-
clearSessionState: () => Promise<void>;
|
|
8
|
-
logger?: (message: string, error?: unknown) => void;
|
|
9
|
-
}
|
|
10
|
-
export interface UseDeviceManagementResult {
|
|
11
|
-
getDeviceSessions: () => Promise<Array<{
|
|
12
|
-
sessionId: string;
|
|
13
|
-
deviceId: string;
|
|
14
|
-
deviceName?: string;
|
|
15
|
-
lastActive?: string;
|
|
16
|
-
expiresAt?: string;
|
|
17
|
-
}>>;
|
|
18
|
-
logoutAllDeviceSessions: () => Promise<void>;
|
|
19
|
-
updateDeviceName: (deviceName: string) => Promise<void>;
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Provide device session management helpers tied to the current active session.
|
|
23
|
-
*
|
|
24
|
-
* @param options - Device management configuration
|
|
25
|
-
*/
|
|
26
|
-
export declare const useDeviceManagement: ({ oxyServices, activeSessionId, onError, clearSessionState, logger, }: UseDeviceManagementOptions) => UseDeviceManagementResult;
|
|
27
|
-
//# sourceMappingURL=useDeviceManagement.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useDeviceManagement.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/context/hooks/useDeviceManagement.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAE5C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAG/C,MAAM,WAAW,0BAA0B;IACzC,WAAW,EAAE,WAAW,CAAC;IACzB,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,QAAQ,KAAK,IAAI,CAAC;IACpC,iBAAiB,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACvC,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;CACrD;AAED,MAAM,WAAW,yBAAyB;IACxC,iBAAiB,EAAE,MAAM,OAAO,CAC9B,KAAK,CAAC;QACJ,SAAS,EAAE,MAAM,CAAC;QAClB,QAAQ,EAAE,MAAM,CAAC;QACjB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,CAAC,CACH,CAAC;IACF,uBAAuB,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7C,gBAAgB,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CACzD;AAED;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,GAAI,uEAMjC,0BAA0B,KAAG,yBAkE/B,CAAC"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import type { ApiError, User } from '@oxyhq/core';
|
|
2
|
-
import { type LanguageMetadata } from '@oxyhq/core';
|
|
3
|
-
import type { StorageInterface } from '../../utils/storageHelpers';
|
|
4
|
-
export interface UseLanguageManagementOptions {
|
|
5
|
-
storage: StorageInterface | null;
|
|
6
|
-
languageKey: string;
|
|
7
|
-
onError?: (error: ApiError) => void;
|
|
8
|
-
logger?: (message: string, error?: unknown) => void;
|
|
9
|
-
}
|
|
10
|
-
export interface UseLanguageManagementResult {
|
|
11
|
-
currentLanguage: string;
|
|
12
|
-
metadata: LanguageMetadata | null;
|
|
13
|
-
languageName: string;
|
|
14
|
-
nativeLanguageName: string;
|
|
15
|
-
setLanguage: (languageId: string) => Promise<void>;
|
|
16
|
-
applyLanguagePreference: (user: User | null) => Promise<void>;
|
|
17
|
-
hydrateLanguage: () => Promise<void>;
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Manage UI language state, persistence, and metadata derivation.
|
|
21
|
-
*
|
|
22
|
-
* @param options - Configuration for storage access and error reporting
|
|
23
|
-
*/
|
|
24
|
-
export declare const useLanguageManagement: ({ storage, languageKey, onError, logger, }: UseLanguageManagementOptions) => UseLanguageManagementResult;
|
|
25
|
-
//# sourceMappingURL=useLanguageManagement.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useLanguageManagement.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/context/hooks/useLanguageManagement.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAKL,KAAK,gBAAgB,EACtB,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAGnE,MAAM,WAAW,4BAA4B;IAC3C,OAAO,EAAE,gBAAgB,GAAG,IAAI,CAAC;IACjC,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,QAAQ,KAAK,IAAI,CAAC;IACpC,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;CACrD;AAED,MAAM,WAAW,2BAA2B;IAC1C,eAAe,EAAE,MAAM,CAAC;IACxB,QAAQ,EAAE,gBAAgB,GAAG,IAAI,CAAC;IAClC,YAAY,EAAE,MAAM,CAAC;IACrB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,WAAW,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACnD,uBAAuB,EAAE,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9D,eAAe,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CACtC;AAID;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,GAAI,4CAKnC,4BAA4B,KAAG,2BA4GjC,CAAC"}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import type { ApiError, User } from '@oxyhq/core';
|
|
2
|
-
import type { ClientSession } from '@oxyhq/core';
|
|
3
|
-
import { getStorageKeys, type StorageInterface } from '../../utils/storageHelpers';
|
|
4
|
-
import type { OxyServices } from '@oxyhq/core';
|
|
5
|
-
import type { QueryClient } from '@tanstack/react-query';
|
|
6
|
-
export interface UseSessionManagementOptions {
|
|
7
|
-
oxyServices: OxyServices;
|
|
8
|
-
storage: StorageInterface | null;
|
|
9
|
-
storageKeyPrefix?: string;
|
|
10
|
-
loginSuccess: (user: User) => void;
|
|
11
|
-
logoutStore: () => void;
|
|
12
|
-
applyLanguagePreference: (user: User) => Promise<void>;
|
|
13
|
-
onAuthStateChange?: (user: User | null) => void;
|
|
14
|
-
onError?: (error: ApiError) => void;
|
|
15
|
-
setAuthError?: (message: string | null) => void;
|
|
16
|
-
logger?: (message: string, error?: unknown) => void;
|
|
17
|
-
setTokenReady?: (ready: boolean) => void;
|
|
18
|
-
queryClient?: QueryClient | null;
|
|
19
|
-
}
|
|
20
|
-
export interface UseSessionManagementResult {
|
|
21
|
-
sessions: ClientSession[];
|
|
22
|
-
activeSessionId: string | null;
|
|
23
|
-
setActiveSessionId: (sessionId: string | null) => void;
|
|
24
|
-
updateSessions: (incoming: ClientSession[], options?: {
|
|
25
|
-
merge?: boolean;
|
|
26
|
-
}) => void;
|
|
27
|
-
switchSession: (sessionId: string) => Promise<User>;
|
|
28
|
-
refreshSessions: (activeUserId?: string) => Promise<void>;
|
|
29
|
-
clearSessionState: () => Promise<void>;
|
|
30
|
-
saveActiveSessionId: (sessionId: string) => Promise<void>;
|
|
31
|
-
trackRemovedSession: (sessionId: string) => void;
|
|
32
|
-
storageKeys: ReturnType<typeof getStorageKeys>;
|
|
33
|
-
isRefreshInFlight: boolean;
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Manage session state, persistence, and high-level multi-session operations.
|
|
37
|
-
*
|
|
38
|
-
* @param options - Session management configuration
|
|
39
|
-
*/
|
|
40
|
-
export declare const useSessionManagement: ({ oxyServices, storage, storageKeyPrefix, loginSuccess, logoutStore, applyLanguagePreference, onAuthStateChange, onError, setAuthError, logger, setTokenReady, queryClient, }: UseSessionManagementOptions) => UseSessionManagementResult;
|
|
41
|
-
//# sourceMappingURL=useSessionManagement.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useSessionManagement.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/context/hooks/useSessionManagement.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAGjD,OAAO,EAAE,cAAc,EAAE,KAAK,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAEnF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAGzD,MAAM,WAAW,2BAA2B;IAC1C,WAAW,EAAE,WAAW,CAAC;IACzB,OAAO,EAAE,gBAAgB,GAAG,IAAI,CAAC;IACjC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,YAAY,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;IACnC,WAAW,EAAE,MAAM,IAAI,CAAC;IACxB,uBAAuB,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACvD,iBAAiB,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,KAAK,IAAI,CAAC;IAChD,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,QAAQ,KAAK,IAAI,CAAC;IACpC,YAAY,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IAChD,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IACpD,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IACzC,WAAW,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;CAClC;AAED,MAAM,WAAW,0BAA0B;IACzC,QAAQ,EAAE,aAAa,EAAE,CAAC;IAC1B,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,kBAAkB,EAAE,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IACvD,cAAc,EAAE,CAAC,QAAQ,EAAE,aAAa,EAAE,EAAE,OAAO,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE,KAAK,IAAI,CAAC;IACnF,aAAa,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACpD,eAAe,EAAE,CAAC,YAAY,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1D,iBAAiB,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACvC,mBAAmB,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1D,mBAAmB,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IACjD,WAAW,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;IAC/C,iBAAiB,EAAE,OAAO,CAAC;CAC5B;AAKD;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,GAAI,+KAalC,2BAA2B,KAAG,0BA+UhC,CAAC"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import type { ApiError } from '@oxyhq/core';
|
|
2
|
-
import type { OxyServices } from '@oxyhq/core';
|
|
3
|
-
export interface UseDeviceManagementOptions {
|
|
4
|
-
oxyServices: OxyServices;
|
|
5
|
-
activeSessionId: string | null;
|
|
6
|
-
onError?: (error: ApiError) => void;
|
|
7
|
-
clearSessionState: () => Promise<void>;
|
|
8
|
-
logger?: (message: string, error?: unknown) => void;
|
|
9
|
-
}
|
|
10
|
-
export interface UseDeviceManagementResult {
|
|
11
|
-
getDeviceSessions: () => Promise<Array<{
|
|
12
|
-
sessionId: string;
|
|
13
|
-
deviceId: string;
|
|
14
|
-
deviceName?: string;
|
|
15
|
-
lastActive?: string;
|
|
16
|
-
expiresAt?: string;
|
|
17
|
-
}>>;
|
|
18
|
-
logoutAllDeviceSessions: () => Promise<void>;
|
|
19
|
-
updateDeviceName: (deviceName: string) => Promise<void>;
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Provide device session management helpers tied to the current active session.
|
|
23
|
-
*
|
|
24
|
-
* @param options - Device management configuration
|
|
25
|
-
*/
|
|
26
|
-
export declare const useDeviceManagement: ({ oxyServices, activeSessionId, onError, clearSessionState, logger, }: UseDeviceManagementOptions) => UseDeviceManagementResult;
|
|
27
|
-
//# sourceMappingURL=useDeviceManagement.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useDeviceManagement.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/context/hooks/useDeviceManagement.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAE5C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAG/C,MAAM,WAAW,0BAA0B;IACzC,WAAW,EAAE,WAAW,CAAC;IACzB,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,QAAQ,KAAK,IAAI,CAAC;IACpC,iBAAiB,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACvC,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;CACrD;AAED,MAAM,WAAW,yBAAyB;IACxC,iBAAiB,EAAE,MAAM,OAAO,CAC9B,KAAK,CAAC;QACJ,SAAS,EAAE,MAAM,CAAC;QAClB,QAAQ,EAAE,MAAM,CAAC;QACjB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,CAAC,CACH,CAAC;IACF,uBAAuB,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7C,gBAAgB,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CACzD;AAED;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,GAAI,uEAMjC,0BAA0B,KAAG,yBAkE/B,CAAC"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import type { ApiError, User } from '@oxyhq/core';
|
|
2
|
-
import { type LanguageMetadata } from '@oxyhq/core';
|
|
3
|
-
import type { StorageInterface } from '../../utils/storageHelpers';
|
|
4
|
-
export interface UseLanguageManagementOptions {
|
|
5
|
-
storage: StorageInterface | null;
|
|
6
|
-
languageKey: string;
|
|
7
|
-
onError?: (error: ApiError) => void;
|
|
8
|
-
logger?: (message: string, error?: unknown) => void;
|
|
9
|
-
}
|
|
10
|
-
export interface UseLanguageManagementResult {
|
|
11
|
-
currentLanguage: string;
|
|
12
|
-
metadata: LanguageMetadata | null;
|
|
13
|
-
languageName: string;
|
|
14
|
-
nativeLanguageName: string;
|
|
15
|
-
setLanguage: (languageId: string) => Promise<void>;
|
|
16
|
-
applyLanguagePreference: (user: User | null) => Promise<void>;
|
|
17
|
-
hydrateLanguage: () => Promise<void>;
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Manage UI language state, persistence, and metadata derivation.
|
|
21
|
-
*
|
|
22
|
-
* @param options - Configuration for storage access and error reporting
|
|
23
|
-
*/
|
|
24
|
-
export declare const useLanguageManagement: ({ storage, languageKey, onError, logger, }: UseLanguageManagementOptions) => UseLanguageManagementResult;
|
|
25
|
-
//# sourceMappingURL=useLanguageManagement.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useLanguageManagement.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/context/hooks/useLanguageManagement.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAKL,KAAK,gBAAgB,EACtB,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAGnE,MAAM,WAAW,4BAA4B;IAC3C,OAAO,EAAE,gBAAgB,GAAG,IAAI,CAAC;IACjC,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,QAAQ,KAAK,IAAI,CAAC;IACpC,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;CACrD;AAED,MAAM,WAAW,2BAA2B;IAC1C,eAAe,EAAE,MAAM,CAAC;IACxB,QAAQ,EAAE,gBAAgB,GAAG,IAAI,CAAC;IAClC,YAAY,EAAE,MAAM,CAAC;IACrB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,WAAW,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACnD,uBAAuB,EAAE,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9D,eAAe,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CACtC;AAID;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,GAAI,4CAKnC,4BAA4B,KAAG,2BA4GjC,CAAC"}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import type { ApiError, User } from '@oxyhq/core';
|
|
2
|
-
import type { ClientSession } from '@oxyhq/core';
|
|
3
|
-
import { getStorageKeys, type StorageInterface } from '../../utils/storageHelpers';
|
|
4
|
-
import type { OxyServices } from '@oxyhq/core';
|
|
5
|
-
import type { QueryClient } from '@tanstack/react-query';
|
|
6
|
-
export interface UseSessionManagementOptions {
|
|
7
|
-
oxyServices: OxyServices;
|
|
8
|
-
storage: StorageInterface | null;
|
|
9
|
-
storageKeyPrefix?: string;
|
|
10
|
-
loginSuccess: (user: User) => void;
|
|
11
|
-
logoutStore: () => void;
|
|
12
|
-
applyLanguagePreference: (user: User) => Promise<void>;
|
|
13
|
-
onAuthStateChange?: (user: User | null) => void;
|
|
14
|
-
onError?: (error: ApiError) => void;
|
|
15
|
-
setAuthError?: (message: string | null) => void;
|
|
16
|
-
logger?: (message: string, error?: unknown) => void;
|
|
17
|
-
setTokenReady?: (ready: boolean) => void;
|
|
18
|
-
queryClient?: QueryClient | null;
|
|
19
|
-
}
|
|
20
|
-
export interface UseSessionManagementResult {
|
|
21
|
-
sessions: ClientSession[];
|
|
22
|
-
activeSessionId: string | null;
|
|
23
|
-
setActiveSessionId: (sessionId: string | null) => void;
|
|
24
|
-
updateSessions: (incoming: ClientSession[], options?: {
|
|
25
|
-
merge?: boolean;
|
|
26
|
-
}) => void;
|
|
27
|
-
switchSession: (sessionId: string) => Promise<User>;
|
|
28
|
-
refreshSessions: (activeUserId?: string) => Promise<void>;
|
|
29
|
-
clearSessionState: () => Promise<void>;
|
|
30
|
-
saveActiveSessionId: (sessionId: string) => Promise<void>;
|
|
31
|
-
trackRemovedSession: (sessionId: string) => void;
|
|
32
|
-
storageKeys: ReturnType<typeof getStorageKeys>;
|
|
33
|
-
isRefreshInFlight: boolean;
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Manage session state, persistence, and high-level multi-session operations.
|
|
37
|
-
*
|
|
38
|
-
* @param options - Session management configuration
|
|
39
|
-
*/
|
|
40
|
-
export declare const useSessionManagement: ({ oxyServices, storage, storageKeyPrefix, loginSuccess, logoutStore, applyLanguagePreference, onAuthStateChange, onError, setAuthError, logger, setTokenReady, queryClient, }: UseSessionManagementOptions) => UseSessionManagementResult;
|
|
41
|
-
//# sourceMappingURL=useSessionManagement.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useSessionManagement.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/context/hooks/useSessionManagement.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAGjD,OAAO,EAAE,cAAc,EAAE,KAAK,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAEnF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAGzD,MAAM,WAAW,2BAA2B;IAC1C,WAAW,EAAE,WAAW,CAAC;IACzB,OAAO,EAAE,gBAAgB,GAAG,IAAI,CAAC;IACjC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,YAAY,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;IACnC,WAAW,EAAE,MAAM,IAAI,CAAC;IACxB,uBAAuB,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACvD,iBAAiB,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,KAAK,IAAI,CAAC;IAChD,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,QAAQ,KAAK,IAAI,CAAC;IACpC,YAAY,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IAChD,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IACpD,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IACzC,WAAW,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;CAClC;AAED,MAAM,WAAW,0BAA0B;IACzC,QAAQ,EAAE,aAAa,EAAE,CAAC;IAC1B,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,kBAAkB,EAAE,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IACvD,cAAc,EAAE,CAAC,QAAQ,EAAE,aAAa,EAAE,EAAE,OAAO,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE,KAAK,IAAI,CAAC;IACnF,aAAa,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACpD,eAAe,EAAE,CAAC,YAAY,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1D,iBAAiB,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACvC,mBAAmB,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1D,mBAAmB,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IACjD,WAAW,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;IAC/C,iBAAiB,EAAE,OAAO,CAAC;CAC5B;AAKD;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,GAAI,+KAalC,2BAA2B,KAAG,0BA+UhC,CAAC"}
|
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
import { useCallback } from 'react';
|
|
2
|
-
import type { ApiError } from '@oxyhq/core';
|
|
3
|
-
import { DeviceManager } from '@oxyhq/core';
|
|
4
|
-
import type { OxyServices } from '@oxyhq/core';
|
|
5
|
-
import { handleAuthError } from '../../utils/errorHandlers';
|
|
6
|
-
|
|
7
|
-
export interface UseDeviceManagementOptions {
|
|
8
|
-
oxyServices: OxyServices;
|
|
9
|
-
activeSessionId: string | null;
|
|
10
|
-
onError?: (error: ApiError) => void;
|
|
11
|
-
clearSessionState: () => Promise<void>;
|
|
12
|
-
logger?: (message: string, error?: unknown) => void;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export interface UseDeviceManagementResult {
|
|
16
|
-
getDeviceSessions: () => Promise<
|
|
17
|
-
Array<{
|
|
18
|
-
sessionId: string;
|
|
19
|
-
deviceId: string;
|
|
20
|
-
deviceName?: string;
|
|
21
|
-
lastActive?: string;
|
|
22
|
-
expiresAt?: string;
|
|
23
|
-
}>
|
|
24
|
-
>;
|
|
25
|
-
logoutAllDeviceSessions: () => Promise<void>;
|
|
26
|
-
updateDeviceName: (deviceName: string) => Promise<void>;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* Provide device session management helpers tied to the current active session.
|
|
31
|
-
*
|
|
32
|
-
* @param options - Device management configuration
|
|
33
|
-
*/
|
|
34
|
-
export const useDeviceManagement = ({
|
|
35
|
-
oxyServices,
|
|
36
|
-
activeSessionId,
|
|
37
|
-
onError,
|
|
38
|
-
clearSessionState,
|
|
39
|
-
logger,
|
|
40
|
-
}: UseDeviceManagementOptions): UseDeviceManagementResult => {
|
|
41
|
-
const getDeviceSessions = useCallback(async (): Promise<
|
|
42
|
-
Array<{
|
|
43
|
-
sessionId: string;
|
|
44
|
-
deviceId: string;
|
|
45
|
-
deviceName?: string;
|
|
46
|
-
lastActive?: string;
|
|
47
|
-
expiresAt?: string;
|
|
48
|
-
}>
|
|
49
|
-
> => {
|
|
50
|
-
if (!activeSessionId) throw new Error('No active session');
|
|
51
|
-
try {
|
|
52
|
-
return await oxyServices.getDeviceSessions(activeSessionId);
|
|
53
|
-
} catch (error) {
|
|
54
|
-
handleAuthError(error, {
|
|
55
|
-
defaultMessage: 'Failed to get device sessions',
|
|
56
|
-
code: 'GET_DEVICE_SESSIONS_ERROR',
|
|
57
|
-
onError,
|
|
58
|
-
logger,
|
|
59
|
-
});
|
|
60
|
-
throw error instanceof Error ? error : new Error('Failed to get device sessions');
|
|
61
|
-
}
|
|
62
|
-
}, [activeSessionId, logger, onError, oxyServices]);
|
|
63
|
-
|
|
64
|
-
const logoutAllDeviceSessions = useCallback(async (): Promise<void> => {
|
|
65
|
-
if (!activeSessionId) throw new Error('No active session');
|
|
66
|
-
|
|
67
|
-
try {
|
|
68
|
-
await oxyServices.logoutAllDeviceSessions(activeSessionId);
|
|
69
|
-
await clearSessionState();
|
|
70
|
-
} catch (error) {
|
|
71
|
-
handleAuthError(error, {
|
|
72
|
-
defaultMessage: 'Failed to logout all device sessions',
|
|
73
|
-
code: 'LOGOUT_ALL_DEVICES_ERROR',
|
|
74
|
-
onError,
|
|
75
|
-
logger,
|
|
76
|
-
});
|
|
77
|
-
throw error instanceof Error ? error : new Error('Failed to logout all device sessions');
|
|
78
|
-
}
|
|
79
|
-
}, [activeSessionId, clearSessionState, logger, onError, oxyServices]);
|
|
80
|
-
|
|
81
|
-
const updateDeviceName = useCallback(
|
|
82
|
-
async (deviceName: string): Promise<void> => {
|
|
83
|
-
if (!activeSessionId) throw new Error('No active session');
|
|
84
|
-
|
|
85
|
-
try {
|
|
86
|
-
await oxyServices.updateDeviceName(activeSessionId, deviceName);
|
|
87
|
-
await DeviceManager.updateDeviceName(deviceName);
|
|
88
|
-
} catch (error) {
|
|
89
|
-
handleAuthError(error, {
|
|
90
|
-
defaultMessage: 'Failed to update device name',
|
|
91
|
-
code: 'UPDATE_DEVICE_NAME_ERROR',
|
|
92
|
-
onError,
|
|
93
|
-
logger,
|
|
94
|
-
});
|
|
95
|
-
throw error instanceof Error ? error : new Error('Failed to update device name');
|
|
96
|
-
}
|
|
97
|
-
},
|
|
98
|
-
[activeSessionId, logger, onError, oxyServices],
|
|
99
|
-
);
|
|
100
|
-
|
|
101
|
-
return {
|
|
102
|
-
getDeviceSessions,
|
|
103
|
-
logoutAllDeviceSessions,
|
|
104
|
-
updateDeviceName,
|
|
105
|
-
};
|
|
106
|
-
};
|
|
107
|
-
|
|
108
|
-
|