@oxyhq/services 5.17.17 → 5.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +32 -38
- package/lib/commonjs/core/CrossDomainAuth.js +277 -0
- package/lib/commonjs/core/CrossDomainAuth.js.map +1 -0
- package/lib/commonjs/core/HttpService.js +82 -15
- package/lib/commonjs/core/HttpService.js.map +1 -1
- package/lib/commonjs/core/OxyServices.base.js +11 -3
- package/lib/commonjs/core/OxyServices.base.js.map +1 -1
- package/lib/commonjs/core/OxyServices.js +4 -1
- package/lib/commonjs/core/OxyServices.js.map +1 -1
- package/lib/commonjs/core/index.js +30 -0
- package/lib/commonjs/core/index.js.map +1 -1
- package/lib/commonjs/core/mixins/OxyServices.assets.js +16 -3
- package/lib/commonjs/core/mixins/OxyServices.assets.js.map +1 -1
- package/lib/commonjs/core/mixins/OxyServices.auth.js +73 -32
- package/lib/commonjs/core/mixins/OxyServices.auth.js.map +1 -1
- package/lib/commonjs/core/mixins/OxyServices.features.js +372 -0
- package/lib/commonjs/core/mixins/OxyServices.features.js.map +1 -0
- package/lib/commonjs/core/mixins/OxyServices.fedcm.js +289 -0
- package/lib/commonjs/core/mixins/OxyServices.fedcm.js.map +1 -0
- package/lib/commonjs/core/mixins/OxyServices.popup.js +352 -0
- package/lib/commonjs/core/mixins/OxyServices.popup.js.map +1 -0
- package/lib/commonjs/core/mixins/OxyServices.redirect.js +378 -0
- package/lib/commonjs/core/mixins/OxyServices.redirect.js.map +1 -0
- package/lib/commonjs/core/mixins/OxyServices.user.js +35 -24
- package/lib/commonjs/core/mixins/OxyServices.user.js.map +1 -1
- package/lib/commonjs/core/mixins/index.js +28 -15
- package/lib/commonjs/core/mixins/index.js.map +1 -1
- package/lib/commonjs/crypto/index.js +30 -0
- package/lib/commonjs/crypto/index.js.map +1 -1
- package/lib/commonjs/crypto/keyManager.js +902 -0
- package/lib/commonjs/crypto/keyManager.js.map +1 -0
- package/lib/commonjs/crypto/polyfill.js +14 -5
- package/lib/commonjs/crypto/polyfill.js.map +1 -1
- package/lib/commonjs/crypto/recoveryPhrase.js +152 -0
- package/lib/commonjs/crypto/recoveryPhrase.js.map +1 -0
- package/lib/commonjs/crypto/signatureService.js +289 -0
- package/lib/commonjs/crypto/signatureService.js.map +1 -0
- package/lib/commonjs/i18n/locales/en-US.json +1 -1
- package/lib/commonjs/index.js +40 -26
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/models/interfaces.js +0 -15
- package/lib/commonjs/models/interfaces.js.map +1 -1
- package/lib/commonjs/ui/components/BottomSheetRouter.js +9 -1
- package/lib/commonjs/ui/components/BottomSheetRouter.js.map +1 -1
- package/lib/commonjs/ui/components/GroupedItem.js +11 -1
- package/lib/commonjs/ui/components/GroupedItem.js.map +1 -1
- package/lib/commonjs/ui/components/Icon.js.map +1 -1
- package/lib/commonjs/ui/components/IconButton/utils.js.map +1 -1
- package/lib/commonjs/ui/components/OxyProvider.js +41 -11
- package/lib/commonjs/ui/components/OxyProvider.js.map +1 -1
- package/lib/commonjs/ui/components/SettingRow.js +17 -4
- package/lib/commonjs/ui/components/SettingRow.js.map +1 -1
- package/lib/commonjs/ui/components/TextField/Adornment/utils.js.map +1 -1
- package/lib/commonjs/ui/components/TextField/helpers.js.map +1 -1
- package/lib/commonjs/ui/components/TouchableRipple/utils.js.map +1 -1
- package/lib/commonjs/ui/components/Typography/AnimatedText.js.map +1 -1
- package/lib/commonjs/ui/components/feedback/FormInput.js +72 -0
- package/lib/commonjs/ui/components/feedback/FormInput.js.map +1 -0
- package/lib/commonjs/ui/components/feedback/ProgressIndicator.js +33 -0
- package/lib/commonjs/ui/components/feedback/ProgressIndicator.js.map +1 -0
- package/lib/commonjs/ui/components/feedback/constants.js +59 -0
- package/lib/commonjs/ui/components/feedback/constants.js.map +1 -0
- package/lib/commonjs/ui/components/feedback/feedbackStyles.js +262 -0
- package/lib/commonjs/ui/components/feedback/feedbackStyles.js.map +1 -0
- package/lib/commonjs/ui/components/feedback/index.js +54 -0
- package/lib/commonjs/ui/components/feedback/index.js.map +1 -0
- package/lib/commonjs/ui/components/feedback/types.js +6 -0
- package/lib/commonjs/ui/components/feedback/types.js.map +1 -0
- package/lib/commonjs/ui/components/feedback/useFeedbackForm.js +52 -0
- package/lib/commonjs/ui/components/feedback/useFeedbackForm.js.map +1 -0
- package/lib/commonjs/ui/components/modals/DeleteAccountModal.js +282 -0
- package/lib/commonjs/ui/components/modals/DeleteAccountModal.js.map +1 -0
- package/lib/commonjs/ui/components/modals/index.js +14 -0
- package/lib/commonjs/ui/components/modals/index.js.map +1 -0
- package/lib/commonjs/ui/components/payment/PaymentDetailsStep.js +309 -0
- package/lib/commonjs/ui/components/payment/PaymentDetailsStep.js.map +1 -0
- package/lib/commonjs/ui/components/payment/PaymentMethodStep.js +79 -0
- package/lib/commonjs/ui/components/payment/PaymentMethodStep.js.map +1 -0
- package/lib/commonjs/ui/components/payment/PaymentReviewStep.js +108 -0
- package/lib/commonjs/ui/components/payment/PaymentReviewStep.js.map +1 -0
- package/lib/commonjs/ui/components/payment/PaymentSuccessStep.js +79 -0
- package/lib/commonjs/ui/components/payment/PaymentSuccessStep.js.map +1 -0
- package/lib/commonjs/ui/components/payment/PaymentSummaryStep.js +176 -0
- package/lib/commonjs/ui/components/payment/PaymentSummaryStep.js.map +1 -0
- package/lib/commonjs/ui/components/payment/constants.js +53 -0
- package/lib/commonjs/ui/components/payment/constants.js.map +1 -0
- package/lib/commonjs/ui/components/payment/index.js +80 -0
- package/lib/commonjs/ui/components/payment/index.js.map +1 -0
- package/lib/commonjs/ui/components/payment/paymentStyles.js +409 -0
- package/lib/commonjs/ui/components/payment/paymentStyles.js.map +1 -0
- package/lib/commonjs/ui/components/payment/types.js +6 -0
- package/lib/commonjs/ui/components/payment/types.js.map +1 -0
- package/lib/commonjs/ui/context/OxyContext.js +110 -199
- package/lib/commonjs/ui/context/OxyContext.js.map +1 -1
- package/lib/commonjs/ui/context/hooks/useAuthOperations.js +150 -19
- package/lib/commonjs/ui/context/hooks/useAuthOperations.js.map +1 -1
- package/lib/commonjs/ui/context/hooks/useSessionManagement.js +279 -0
- package/lib/commonjs/ui/context/hooks/useSessionManagement.js.map +1 -0
- package/lib/commonjs/ui/hooks/index.js +26 -0
- package/lib/commonjs/ui/hooks/index.js.map +1 -1
- package/lib/commonjs/ui/hooks/mutations/useAccountMutations.js +79 -72
- package/lib/commonjs/ui/hooks/mutations/useAccountMutations.js.map +1 -1
- package/lib/commonjs/ui/hooks/queries/useAccountQueries.js +38 -51
- package/lib/commonjs/ui/hooks/queries/useAccountQueries.js.map +1 -1
- package/lib/commonjs/ui/hooks/queries/useSecurityQueries.js +3 -3
- package/lib/commonjs/ui/hooks/queries/useSecurityQueries.js.map +1 -1
- package/lib/commonjs/ui/hooks/queries/useServicesQueries.js +18 -12
- package/lib/commonjs/ui/hooks/queries/useServicesQueries.js.map +1 -1
- package/lib/commonjs/ui/hooks/useAsyncAction.js +95 -0
- package/lib/commonjs/ui/hooks/useAsyncAction.js.map +1 -0
- package/lib/commonjs/ui/hooks/useProfileEditing.js +3 -5
- package/lib/commonjs/ui/hooks/useProfileEditing.js.map +1 -1
- package/lib/commonjs/ui/hooks/useSessionManagement.js +4 -8
- package/lib/commonjs/ui/hooks/useSessionManagement.js.map +1 -1
- package/lib/commonjs/ui/hooks/useSessionSocket.js +162 -315
- package/lib/commonjs/ui/hooks/useSessionSocket.js.map +1 -1
- package/lib/commonjs/ui/hooks/useSettingToggle.js +126 -0
- package/lib/commonjs/ui/hooks/useSettingToggle.js.map +1 -0
- package/lib/commonjs/ui/hooks/useStorage.js +24 -58
- package/lib/commonjs/ui/hooks/useStorage.js.map +1 -1
- package/lib/commonjs/ui/index.js +50 -21
- package/lib/commonjs/ui/index.js.map +1 -1
- package/lib/commonjs/ui/navigation/routes.js +6 -1
- package/lib/commonjs/ui/navigation/routes.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountCenterScreen.js +6 -4
- package/lib/commonjs/ui/screens/AccountCenterScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountOverviewScreen.js +33 -30
- package/lib/commonjs/ui/screens/AccountOverviewScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountSettingsScreen.js +29 -24
- package/lib/commonjs/ui/screens/AccountSettingsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountSwitcherScreen.js +3 -3
- package/lib/commonjs/ui/screens/AccountSwitcherScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/FAQScreen.js +315 -0
- package/lib/commonjs/ui/screens/FAQScreen.js.map +1 -0
- package/lib/commonjs/ui/screens/FeedbackScreen.js +73 -590
- package/lib/commonjs/ui/screens/FeedbackScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/HelpSupportScreen.js +8 -7
- package/lib/commonjs/ui/screens/HelpSupportScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/OxyAuthScreen.js +134 -66
- package/lib/commonjs/ui/screens/OxyAuthScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/PaymentGatewayScreen.js +67 -1395
- package/lib/commonjs/ui/screens/PaymentGatewayScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/PrivacySettingsScreen.js +6 -13
- package/lib/commonjs/ui/screens/PrivacySettingsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/ProfileScreen.js +13 -5
- package/lib/commonjs/ui/screens/ProfileScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/SavesCollectionsScreen.js +16 -10
- package/lib/commonjs/ui/screens/SavesCollectionsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/karma/KarmaCenterScreen.js +23 -11
- package/lib/commonjs/ui/screens/karma/KarmaCenterScreen.js.map +1 -1
- package/lib/commonjs/ui/stores/accountStore.js +2 -4
- package/lib/commonjs/ui/stores/accountStore.js.map +1 -1
- package/lib/commonjs/ui/stores/authStore.js +45 -32
- package/lib/commonjs/ui/stores/authStore.js.map +1 -1
- package/lib/commonjs/ui/styles/spacing.js +54 -2
- package/lib/commonjs/ui/styles/spacing.js.map +1 -1
- package/lib/commonjs/ui/utils/avatarUtils.js +37 -41
- package/lib/commonjs/ui/utils/avatarUtils.js.map +1 -1
- package/lib/commonjs/ui/utils/storageHelpers.js.map +1 -1
- package/lib/commonjs/utils/errorUtils.js +13 -0
- package/lib/commonjs/utils/errorUtils.js.map +1 -1
- package/lib/commonjs/utils/validationUtils.js +15 -1
- package/lib/commonjs/utils/validationUtils.js.map +1 -1
- package/lib/module/core/CrossDomainAuth.js +271 -0
- package/lib/module/core/CrossDomainAuth.js.map +1 -0
- package/lib/module/core/HttpService.js +82 -15
- package/lib/module/core/HttpService.js.map +1 -1
- package/lib/module/core/OxyServices.base.js +11 -4
- package/lib/module/core/OxyServices.base.js.map +1 -1
- package/lib/module/core/OxyServices.js +4 -1
- package/lib/module/core/OxyServices.js.map +1 -1
- package/lib/module/core/index.js +6 -1
- package/lib/module/core/index.js.map +1 -1
- package/lib/module/core/mixins/OxyServices.assets.js +16 -3
- package/lib/module/core/mixins/OxyServices.assets.js.map +1 -1
- package/lib/module/core/mixins/OxyServices.auth.js +73 -32
- package/lib/module/core/mixins/OxyServices.auth.js.map +1 -1
- package/lib/module/core/mixins/OxyServices.features.js +369 -0
- package/lib/module/core/mixins/OxyServices.features.js.map +1 -0
- package/lib/module/core/mixins/OxyServices.fedcm.js +286 -0
- package/lib/module/core/mixins/OxyServices.fedcm.js.map +1 -0
- package/lib/module/core/mixins/OxyServices.popup.js +349 -0
- package/lib/module/core/mixins/OxyServices.popup.js.map +1 -0
- package/lib/module/core/mixins/OxyServices.redirect.js +375 -0
- package/lib/module/core/mixins/OxyServices.redirect.js.map +1 -0
- package/lib/module/core/mixins/OxyServices.user.js +35 -24
- package/lib/module/core/mixins/OxyServices.user.js.map +1 -1
- package/lib/module/core/mixins/index.js +16 -3
- package/lib/module/core/mixins/index.js.map +1 -1
- package/lib/module/crypto/index.js +8 -4
- package/lib/module/crypto/index.js.map +1 -1
- package/lib/module/crypto/keyManager.js +899 -0
- package/lib/module/crypto/keyManager.js.map +1 -0
- package/lib/module/crypto/polyfill.js +6 -5
- package/lib/module/crypto/polyfill.js.map +1 -1
- package/lib/module/crypto/recoveryPhrase.js +147 -0
- package/lib/module/crypto/recoveryPhrase.js.map +1 -0
- package/lib/module/crypto/signatureService.js +286 -0
- package/lib/module/crypto/signatureService.js.map +1 -0
- package/lib/module/i18n/locales/en-US.json +1 -1
- package/lib/module/index.js +6 -9
- package/lib/module/index.js.map +1 -1
- package/lib/module/models/interfaces.js +0 -15
- package/lib/module/models/interfaces.js.map +1 -1
- package/lib/module/ui/components/BottomSheetRouter.js +6 -2
- package/lib/module/ui/components/BottomSheetRouter.js.map +1 -1
- package/lib/module/ui/components/GroupedItem.js +11 -1
- package/lib/module/ui/components/GroupedItem.js.map +1 -1
- package/lib/module/ui/components/Icon.js.map +1 -1
- package/lib/module/ui/components/IconButton/utils.js.map +1 -1
- package/lib/module/ui/components/OxyProvider.js +41 -11
- package/lib/module/ui/components/OxyProvider.js.map +1 -1
- package/lib/module/ui/components/SettingRow.js +17 -4
- package/lib/module/ui/components/SettingRow.js.map +1 -1
- package/lib/module/ui/components/TextField/Adornment/utils.js.map +1 -1
- package/lib/module/ui/components/TextField/helpers.js.map +1 -1
- package/lib/module/ui/components/TouchableRipple/utils.js.map +1 -1
- package/lib/module/ui/components/Typography/AnimatedText.js.map +1 -1
- package/lib/module/ui/components/feedback/FormInput.js +67 -0
- package/lib/module/ui/components/feedback/FormInput.js.map +1 -0
- package/lib/module/ui/components/feedback/ProgressIndicator.js +28 -0
- package/lib/module/ui/components/feedback/ProgressIndicator.js.map +1 -0
- package/lib/module/ui/components/feedback/constants.js +55 -0
- package/lib/module/ui/components/feedback/constants.js.map +1 -0
- package/lib/module/ui/components/feedback/feedbackStyles.js +257 -0
- package/lib/module/ui/components/feedback/feedbackStyles.js.map +1 -0
- package/lib/module/ui/components/feedback/index.js +8 -0
- package/lib/module/ui/components/feedback/index.js.map +1 -0
- package/lib/module/ui/components/feedback/types.js +4 -0
- package/lib/module/ui/components/feedback/types.js.map +1 -0
- package/lib/module/ui/components/feedback/useFeedbackForm.js +47 -0
- package/lib/module/ui/components/feedback/useFeedbackForm.js.map +1 -0
- package/lib/module/ui/components/modals/DeleteAccountModal.js +276 -0
- package/lib/module/ui/components/modals/DeleteAccountModal.js.map +1 -0
- package/lib/module/ui/components/modals/index.js +4 -0
- package/lib/module/ui/components/modals/index.js.map +1 -0
- package/lib/module/ui/components/payment/PaymentDetailsStep.js +303 -0
- package/lib/module/ui/components/payment/PaymentDetailsStep.js.map +1 -0
- package/lib/module/ui/components/payment/PaymentMethodStep.js +73 -0
- package/lib/module/ui/components/payment/PaymentMethodStep.js.map +1 -0
- package/lib/module/ui/components/payment/PaymentReviewStep.js +102 -0
- package/lib/module/ui/components/payment/PaymentReviewStep.js.map +1 -0
- package/lib/module/ui/components/payment/PaymentSuccessStep.js +73 -0
- package/lib/module/ui/components/payment/PaymentSuccessStep.js.map +1 -0
- package/lib/module/ui/components/payment/PaymentSummaryStep.js +170 -0
- package/lib/module/ui/components/payment/PaymentSummaryStep.js.map +1 -0
- package/lib/module/ui/components/payment/constants.js +47 -0
- package/lib/module/ui/components/payment/constants.js.map +1 -0
- package/lib/module/ui/components/payment/index.js +10 -0
- package/lib/module/ui/components/payment/index.js.map +1 -0
- package/lib/module/ui/components/payment/paymentStyles.js +404 -0
- package/lib/module/ui/components/payment/paymentStyles.js.map +1 -0
- package/lib/module/ui/components/payment/types.js +4 -0
- package/lib/module/ui/components/payment/types.js.map +1 -0
- package/lib/module/ui/context/OxyContext.js +112 -191
- package/lib/module/ui/context/OxyContext.js.map +1 -1
- package/lib/module/ui/context/hooks/useAuthOperations.js +150 -19
- package/lib/module/ui/context/hooks/useAuthOperations.js.map +1 -1
- package/lib/module/ui/context/hooks/useSessionManagement.js +274 -0
- package/lib/module/ui/context/hooks/useSessionManagement.js.map +1 -0
- package/lib/module/ui/hooks/index.js +2 -0
- package/lib/module/ui/hooks/index.js.map +1 -1
- package/lib/module/ui/hooks/mutations/useAccountMutations.js +80 -72
- package/lib/module/ui/hooks/mutations/useAccountMutations.js.map +1 -1
- package/lib/module/ui/hooks/queries/useAccountQueries.js +31 -44
- package/lib/module/ui/hooks/queries/useAccountQueries.js.map +1 -1
- package/lib/module/ui/hooks/queries/useSecurityQueries.js +1 -1
- package/lib/module/ui/hooks/queries/useSecurityQueries.js.map +1 -1
- package/lib/module/ui/hooks/queries/useServicesQueries.js +13 -7
- package/lib/module/ui/hooks/queries/useServicesQueries.js.map +1 -1
- package/lib/module/ui/hooks/useAsyncAction.js +89 -0
- package/lib/module/ui/hooks/useAsyncAction.js.map +1 -0
- package/lib/module/ui/hooks/useProfileEditing.js +3 -5
- package/lib/module/ui/hooks/useProfileEditing.js.map +1 -1
- package/lib/module/ui/hooks/useSessionManagement.js +4 -8
- package/lib/module/ui/hooks/useSessionManagement.js.map +1 -1
- package/lib/module/ui/hooks/useSessionSocket.js +162 -315
- package/lib/module/ui/hooks/useSessionSocket.js.map +1 -1
- package/lib/module/ui/hooks/useSettingToggle.js +120 -0
- package/lib/module/ui/hooks/useSettingToggle.js.map +1 -0
- package/lib/module/ui/hooks/useStorage.js +25 -59
- package/lib/module/ui/hooks/useStorage.js.map +1 -1
- package/lib/module/ui/index.js +15 -10
- package/lib/module/ui/index.js.map +1 -1
- package/lib/module/ui/navigation/routes.js +6 -1
- package/lib/module/ui/navigation/routes.js.map +1 -1
- package/lib/module/ui/screens/AccountCenterScreen.js +6 -4
- package/lib/module/ui/screens/AccountCenterScreen.js.map +1 -1
- package/lib/module/ui/screens/AccountOverviewScreen.js +33 -30
- package/lib/module/ui/screens/AccountOverviewScreen.js.map +1 -1
- package/lib/module/ui/screens/AccountSettingsScreen.js +29 -24
- package/lib/module/ui/screens/AccountSettingsScreen.js.map +1 -1
- package/lib/module/ui/screens/AccountSwitcherScreen.js +3 -3
- package/lib/module/ui/screens/AccountSwitcherScreen.js.map +1 -1
- package/lib/module/ui/screens/FAQScreen.js +310 -0
- package/lib/module/ui/screens/FAQScreen.js.map +1 -0
- package/lib/module/ui/screens/FeedbackScreen.js +64 -581
- package/lib/module/ui/screens/FeedbackScreen.js.map +1 -1
- package/lib/module/ui/screens/HelpSupportScreen.js +8 -7
- package/lib/module/ui/screens/HelpSupportScreen.js.map +1 -1
- package/lib/module/ui/screens/OxyAuthScreen.js +135 -68
- package/lib/module/ui/screens/OxyAuthScreen.js.map +1 -1
- package/lib/module/ui/screens/PaymentGatewayScreen.js +67 -1397
- package/lib/module/ui/screens/PaymentGatewayScreen.js.map +1 -1
- package/lib/module/ui/screens/PrivacySettingsScreen.js +6 -13
- package/lib/module/ui/screens/PrivacySettingsScreen.js.map +1 -1
- package/lib/module/ui/screens/ProfileScreen.js +13 -5
- package/lib/module/ui/screens/ProfileScreen.js.map +1 -1
- package/lib/module/ui/screens/SavesCollectionsScreen.js +16 -10
- package/lib/module/ui/screens/SavesCollectionsScreen.js.map +1 -1
- package/lib/module/ui/screens/karma/KarmaCenterScreen.js +23 -11
- package/lib/module/ui/screens/karma/KarmaCenterScreen.js.map +1 -1
- package/lib/module/ui/stores/accountStore.js +2 -4
- package/lib/module/ui/stores/accountStore.js.map +1 -1
- package/lib/module/ui/stores/authStore.js +45 -32
- package/lib/module/ui/stores/authStore.js.map +1 -1
- package/lib/module/ui/styles/spacing.js +6 -2
- package/lib/module/ui/styles/spacing.js.map +1 -1
- package/lib/module/ui/utils/avatarUtils.js +37 -40
- package/lib/module/ui/utils/avatarUtils.js.map +1 -1
- package/lib/module/ui/utils/storageHelpers.js.map +1 -1
- package/lib/module/utils/errorUtils.js +7 -0
- package/lib/module/utils/errorUtils.js.map +1 -1
- package/lib/module/utils/validationUtils.js +13 -0
- package/lib/module/utils/validationUtils.js.map +1 -1
- package/lib/typescript/core/CrossDomainAuth.d.ts +161 -0
- package/lib/typescript/core/CrossDomainAuth.d.ts.map +1 -0
- package/lib/typescript/core/HttpService.d.ts +1 -1
- package/lib/typescript/core/HttpService.d.ts.map +1 -1
- package/lib/typescript/core/OxyServices.base.d.ts +0 -6
- package/lib/typescript/core/OxyServices.base.d.ts.map +1 -1
- package/lib/typescript/core/OxyServices.d.ts +5 -36
- package/lib/typescript/core/OxyServices.d.ts.map +1 -1
- package/lib/typescript/core/index.d.ts +4 -0
- package/lib/typescript/core/index.d.ts.map +1 -1
- package/lib/typescript/core/mixins/OxyServices.analytics.d.ts.map +1 -1
- package/lib/typescript/core/mixins/OxyServices.assets.d.ts.map +1 -1
- package/lib/typescript/core/mixins/OxyServices.auth.d.ts +40 -20
- package/lib/typescript/core/mixins/OxyServices.auth.d.ts.map +1 -1
- package/lib/typescript/core/mixins/OxyServices.developer.d.ts.map +1 -1
- package/lib/typescript/core/mixins/OxyServices.devices.d.ts.map +1 -1
- package/lib/typescript/core/mixins/OxyServices.features.d.ts +229 -0
- package/lib/typescript/core/mixins/OxyServices.features.d.ts.map +1 -0
- package/lib/typescript/core/mixins/OxyServices.fedcm.d.ts +195 -0
- package/lib/typescript/core/mixins/OxyServices.fedcm.d.ts.map +1 -0
- package/lib/typescript/core/mixins/OxyServices.karma.d.ts.map +1 -1
- package/lib/typescript/core/mixins/OxyServices.language.d.ts.map +1 -1
- package/lib/typescript/core/mixins/OxyServices.location.d.ts.map +1 -1
- package/lib/typescript/core/mixins/OxyServices.payment.d.ts.map +1 -1
- package/lib/typescript/core/mixins/OxyServices.popup.d.ts +206 -0
- package/lib/typescript/core/mixins/OxyServices.popup.d.ts.map +1 -0
- package/lib/typescript/core/mixins/OxyServices.privacy.d.ts.map +1 -1
- package/lib/typescript/core/mixins/OxyServices.redirect.d.ts +246 -0
- package/lib/typescript/core/mixins/OxyServices.redirect.d.ts.map +1 -0
- package/lib/typescript/core/mixins/OxyServices.security.d.ts.map +1 -1
- package/lib/typescript/core/mixins/OxyServices.user.d.ts +6 -4
- package/lib/typescript/core/mixins/OxyServices.user.d.ts.map +1 -1
- package/lib/typescript/core/mixins/OxyServices.utility.d.ts.map +1 -1
- package/lib/typescript/core/mixins/index.d.ts +291 -9
- package/lib/typescript/core/mixins/index.d.ts.map +1 -1
- package/lib/typescript/crypto/index.d.ts +6 -3
- package/lib/typescript/crypto/index.d.ts.map +1 -1
- package/lib/typescript/crypto/keyManager.d.ts +190 -0
- package/lib/typescript/crypto/keyManager.d.ts.map +1 -0
- package/lib/typescript/crypto/polyfill.d.ts +4 -3
- package/lib/typescript/crypto/polyfill.d.ts.map +1 -1
- package/lib/typescript/crypto/recoveryPhrase.d.ts +59 -0
- package/lib/typescript/crypto/recoveryPhrase.d.ts.map +1 -0
- package/lib/typescript/crypto/signatureService.d.ts +87 -0
- package/lib/typescript/crypto/signatureService.d.ts.map +1 -0
- package/lib/typescript/index.d.ts +5 -6
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/models/interfaces.d.ts +2 -14
- package/lib/typescript/models/interfaces.d.ts.map +1 -1
- package/lib/typescript/models/session.d.ts +0 -9
- package/lib/typescript/models/session.d.ts.map +1 -1
- package/lib/typescript/types/bip39.d.ts +32 -0
- package/lib/typescript/ui/components/BottomSheetRouter.d.ts +5 -0
- package/lib/typescript/ui/components/BottomSheetRouter.d.ts.map +1 -1
- package/lib/typescript/ui/components/GroupedItem.d.ts +5 -1
- package/lib/typescript/ui/components/GroupedItem.d.ts.map +1 -1
- package/lib/typescript/ui/components/IconButton/utils.d.ts +1 -1
- package/lib/typescript/ui/components/OxyProvider.d.ts.map +1 -1
- package/lib/typescript/ui/components/SettingRow.d.ts +6 -0
- package/lib/typescript/ui/components/SettingRow.d.ts.map +1 -1
- package/lib/typescript/ui/components/TextField/Addons/Outline.d.ts +2 -2
- package/lib/typescript/ui/components/TextField/Adornment/utils.d.ts +1 -1
- package/lib/typescript/ui/components/TextField/Adornment/utils.d.ts.map +1 -1
- package/lib/typescript/ui/components/TextField/helpers.d.ts +8 -8
- package/lib/typescript/ui/components/TextField/types.d.ts +1 -0
- package/lib/typescript/ui/components/TextField/types.d.ts.map +1 -1
- package/lib/typescript/ui/components/feedback/FormInput.d.ts +20 -0
- package/lib/typescript/ui/components/feedback/FormInput.d.ts.map +1 -0
- package/lib/typescript/ui/components/feedback/ProgressIndicator.d.ts +11 -0
- package/lib/typescript/ui/components/feedback/ProgressIndicator.d.ts.map +1 -0
- package/lib/typescript/ui/components/feedback/constants.d.ts +5 -0
- package/lib/typescript/ui/components/feedback/constants.d.ts.map +1 -0
- package/lib/typescript/ui/components/feedback/feedbackStyles.d.ts +280 -0
- package/lib/typescript/ui/components/feedback/feedbackStyles.d.ts.map +1 -0
- package/lib/typescript/ui/components/feedback/index.d.ts +7 -0
- package/lib/typescript/ui/components/feedback/index.d.ts.map +1 -0
- package/lib/typescript/ui/components/feedback/types.d.ts +46 -0
- package/lib/typescript/ui/components/feedback/types.d.ts.map +1 -0
- package/lib/typescript/ui/components/feedback/useFeedbackForm.d.ts +9 -0
- package/lib/typescript/ui/components/feedback/useFeedbackForm.d.ts.map +1 -0
- package/lib/typescript/ui/components/modals/DeleteAccountModal.d.ts +19 -0
- package/lib/typescript/ui/components/modals/DeleteAccountModal.d.ts.map +1 -0
- package/lib/typescript/ui/components/modals/index.d.ts +2 -0
- package/lib/typescript/ui/components/modals/index.d.ts.map +1 -0
- package/lib/typescript/ui/components/payment/PaymentDetailsStep.d.ts +21 -0
- package/lib/typescript/ui/components/payment/PaymentDetailsStep.d.ts.map +1 -0
- package/lib/typescript/ui/components/payment/PaymentMethodStep.d.ts +14 -0
- package/lib/typescript/ui/components/payment/PaymentMethodStep.d.ts.map +1 -0
- package/lib/typescript/ui/components/payment/PaymentReviewStep.d.ts +16 -0
- package/lib/typescript/ui/components/payment/PaymentReviewStep.d.ts.map +1 -0
- package/lib/typescript/ui/components/payment/PaymentSuccessStep.d.ts +10 -0
- package/lib/typescript/ui/components/payment/PaymentSuccessStep.d.ts.map +1 -0
- package/lib/typescript/ui/components/payment/PaymentSummaryStep.d.ts +15 -0
- package/lib/typescript/ui/components/payment/PaymentSummaryStep.d.ts.map +1 -0
- package/lib/typescript/ui/components/payment/constants.d.ts +7 -0
- package/lib/typescript/ui/components/payment/constants.d.ts.map +1 -0
- package/lib/typescript/ui/components/payment/index.d.ts +9 -0
- package/lib/typescript/ui/components/payment/index.d.ts.map +1 -0
- package/lib/typescript/ui/components/payment/paymentStyles.d.ts +396 -0
- package/lib/typescript/ui/components/payment/paymentStyles.d.ts.map +1 -0
- package/lib/typescript/ui/components/payment/types.d.ts +40 -0
- package/lib/typescript/ui/components/payment/types.d.ts.map +1 -0
- package/lib/typescript/ui/components/types.d.ts +4 -0
- package/lib/typescript/ui/components/types.d.ts.map +1 -1
- package/lib/typescript/ui/context/OxyContext.d.ts +57 -3
- package/lib/typescript/ui/context/OxyContext.d.ts.map +1 -1
- package/lib/typescript/ui/context/hooks/useAuthOperations.d.ts +10 -3
- package/lib/typescript/ui/context/hooks/useAuthOperations.d.ts.map +1 -1
- package/lib/typescript/ui/context/hooks/useSessionManagement.d.ts +41 -0
- package/lib/typescript/ui/context/hooks/useSessionManagement.d.ts.map +1 -0
- package/lib/typescript/ui/hooks/index.d.ts +2 -0
- package/lib/typescript/ui/hooks/index.d.ts.map +1 -1
- package/lib/typescript/ui/hooks/mutations/useAccountMutations.d.ts.map +1 -1
- package/lib/typescript/ui/hooks/queries/useAccountQueries.d.ts.map +1 -1
- package/lib/typescript/ui/hooks/queries/useServicesQueries.d.ts.map +1 -1
- package/lib/typescript/ui/hooks/useAsyncAction.d.ts +51 -0
- package/lib/typescript/ui/hooks/useAsyncAction.d.ts.map +1 -0
- package/lib/typescript/ui/hooks/useProfileEditing.d.ts.map +1 -1
- package/lib/typescript/ui/hooks/useSessionManagement.d.ts.map +1 -1
- package/lib/typescript/ui/hooks/useSessionSocket.d.ts +1 -2
- package/lib/typescript/ui/hooks/useSessionSocket.d.ts.map +1 -1
- package/lib/typescript/ui/hooks/useSettingToggle.d.ts +55 -0
- package/lib/typescript/ui/hooks/useSettingToggle.d.ts.map +1 -0
- package/lib/typescript/ui/hooks/useStorage.d.ts +3 -9
- package/lib/typescript/ui/hooks/useStorage.d.ts.map +1 -1
- package/lib/typescript/ui/index.d.ts +6 -2
- package/lib/typescript/ui/index.d.ts.map +1 -1
- package/lib/typescript/ui/navigation/routes.d.ts +1 -1
- package/lib/typescript/ui/navigation/routes.d.ts.map +1 -1
- package/lib/typescript/ui/screens/AccountOverviewScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/AccountSettingsScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/FAQScreen.d.ts +5 -0
- package/lib/typescript/ui/screens/FAQScreen.d.ts.map +1 -0
- package/lib/typescript/ui/screens/FeedbackScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/HelpSupportScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/OxyAuthScreen.d.ts +1 -1
- package/lib/typescript/ui/screens/OxyAuthScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/PaymentGatewayScreen.d.ts +3 -15
- package/lib/typescript/ui/screens/PaymentGatewayScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/PrivacySettingsScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/ProfileScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/SavesCollectionsScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/karma/KarmaCenterScreen.d.ts.map +1 -1
- package/lib/typescript/ui/stores/accountStore.d.ts.map +1 -1
- package/lib/typescript/ui/stores/authStore.d.ts +8 -7
- package/lib/typescript/ui/stores/authStore.d.ts.map +1 -1
- package/lib/typescript/ui/styles/spacing.d.ts +5 -0
- package/lib/typescript/ui/styles/spacing.d.ts.map +1 -1
- package/lib/typescript/ui/types/navigation.d.ts +2 -1
- package/lib/typescript/ui/types/navigation.d.ts.map +1 -1
- package/lib/typescript/ui/utils/avatarUtils.d.ts +2 -13
- package/lib/typescript/ui/utils/avatarUtils.d.ts.map +1 -1
- package/lib/typescript/ui/utils/storageHelpers.d.ts +0 -3
- package/lib/typescript/ui/utils/storageHelpers.d.ts.map +1 -1
- package/lib/typescript/utils/errorUtils.d.ts +6 -0
- package/lib/typescript/utils/errorUtils.d.ts.map +1 -1
- package/lib/typescript/utils/validationUtils.d.ts +8 -0
- package/lib/typescript/utils/validationUtils.d.ts.map +1 -1
- package/package.json +8 -7
- package/src/core/CrossDomainAuth.ts +307 -0
- package/src/core/HttpService.ts +99 -16
- package/src/core/OxyServices.base.ts +20 -3
- package/src/core/OxyServices.ts +7 -3
- package/src/core/index.ts +9 -1
- package/src/core/mixins/OxyServices.assets.ts +14 -3
- package/src/core/mixins/OxyServices.auth.ts +105 -36
- package/src/core/mixins/OxyServices.features.ts +428 -0
- package/src/core/mixins/OxyServices.fedcm.ts +315 -0
- package/src/core/mixins/OxyServices.popup.ts +402 -0
- package/src/core/mixins/OxyServices.redirect.ts +397 -0
- package/src/core/mixins/OxyServices.user.ts +39 -24
- package/src/core/mixins/index.ts +33 -14
- package/src/crypto/index.ts +16 -5
- package/src/crypto/keyManager.ts +966 -0
- package/src/crypto/polyfill.ts +6 -5
- package/src/crypto/recoveryPhrase.ts +166 -0
- package/src/crypto/signatureService.ts +323 -0
- package/src/i18n/locales/en-US.json +1 -1
- package/src/index.ts +19 -15
- package/src/models/interfaces.ts +4 -16
- package/src/models/session.ts +2 -11
- package/src/types/bip39.d.ts +32 -0
- package/src/ui/components/BottomSheetRouter.tsx +6 -1
- package/src/ui/components/GroupedItem.tsx +19 -1
- package/src/ui/components/Icon.tsx +1 -1
- package/src/ui/components/IconButton/utils.ts +1 -1
- package/src/ui/components/OxyProvider.tsx +44 -12
- package/src/ui/components/SettingRow.tsx +26 -4
- package/src/ui/components/TextField/Addons/Outline.tsx +2 -2
- package/src/ui/components/TextField/Adornment/utils.ts +2 -2
- package/src/ui/components/TextField/helpers.tsx +10 -10
- package/src/ui/components/TextField/types.tsx +1 -1
- package/src/ui/components/TouchableRipple/utils.ts +2 -2
- package/src/ui/components/Typography/AnimatedText.tsx +2 -2
- package/src/ui/components/feedback/FormInput.tsx +84 -0
- package/src/ui/components/feedback/ProgressIndicator.tsx +35 -0
- package/src/ui/components/feedback/constants.ts +22 -0
- package/src/ui/components/feedback/feedbackStyles.ts +247 -0
- package/src/ui/components/feedback/index.ts +6 -0
- package/src/ui/components/feedback/types.ts +52 -0
- package/src/ui/components/feedback/useFeedbackForm.ts +44 -0
- package/src/ui/components/modals/DeleteAccountModal.tsx +294 -0
- package/src/ui/components/modals/index.ts +1 -0
- package/src/ui/components/payment/PaymentDetailsStep.tsx +222 -0
- package/src/ui/components/payment/PaymentMethodStep.tsx +89 -0
- package/src/ui/components/payment/PaymentReviewStep.tsx +126 -0
- package/src/ui/components/payment/PaymentSuccessStep.tsx +71 -0
- package/src/ui/components/payment/PaymentSummaryStep.tsx +159 -0
- package/src/ui/components/payment/constants.ts +39 -0
- package/src/ui/components/payment/index.ts +9 -0
- package/src/ui/components/payment/paymentStyles.ts +397 -0
- package/src/ui/components/payment/types.ts +45 -0
- package/src/ui/components/types.tsx +6 -0
- package/src/ui/context/OxyContext.tsx +173 -195
- package/src/ui/context/hooks/useAuthOperations.ts +177 -36
- package/src/ui/context/hooks/useSessionManagement.ts +399 -0
- package/src/ui/hooks/index.ts +3 -1
- package/src/ui/hooks/mutations/useAccountMutations.ts +83 -76
- package/src/ui/hooks/queries/useAccountQueries.ts +29 -35
- package/src/ui/hooks/queries/useSecurityQueries.ts +1 -1
- package/src/ui/hooks/queries/useServicesQueries.ts +14 -6
- package/src/ui/hooks/useAsyncAction.ts +129 -0
- package/src/ui/hooks/useProfileEditing.ts +3 -3
- package/src/ui/hooks/useSessionManagement.ts +5 -10
- package/src/ui/hooks/useSessionSocket.ts +46 -175
- package/src/ui/hooks/useSettingToggle.ts +147 -0
- package/src/ui/hooks/useStorage.ts +24 -76
- package/src/ui/index.ts +22 -13
- package/src/ui/navigation/routes.ts +8 -2
- package/src/ui/screens/AccountCenterScreen.tsx +4 -4
- package/src/ui/screens/AccountOverviewScreen.tsx +36 -38
- package/src/ui/screens/AccountSettingsScreen.tsx +34 -37
- package/src/ui/screens/AccountSwitcherScreen.tsx +4 -4
- package/src/ui/screens/FAQScreen.tsx +332 -0
- package/src/ui/screens/FeedbackScreen.tsx +91 -626
- package/src/ui/screens/HelpSupportScreen.tsx +7 -5
- package/src/ui/screens/OxyAuthScreen.tsx +138 -64
- package/src/ui/screens/PaymentGatewayScreen.tsx +96 -1275
- package/src/ui/screens/PrivacySettingsScreen.tsx +6 -12
- package/src/ui/screens/ProfileScreen.tsx +11 -6
- package/src/ui/screens/SavesCollectionsScreen.tsx +19 -10
- package/src/ui/screens/karma/KarmaCenterScreen.tsx +10 -10
- package/src/ui/stores/accountStore.ts +1 -11
- package/src/ui/stores/authStore.ts +43 -44
- package/src/ui/styles/spacing.ts +15 -2
- package/src/ui/types/navigation.ts +2 -2
- package/src/ui/utils/avatarUtils.ts +39 -46
- package/src/ui/utils/storageHelpers.ts +0 -4
- package/src/utils/__tests__/validationUtils.test.ts +16 -1
- package/src/utils/errorUtils.ts +8 -1
- package/src/utils/validationUtils.ts +12 -0
- package/lib/commonjs/core/services/SessionService.js +0 -163
- package/lib/commonjs/core/services/SessionService.js.map +0 -1
- package/lib/commonjs/core/services/TokenService.js +0 -220
- package/lib/commonjs/core/services/TokenService.js.map +0 -1
- package/lib/commonjs/crypto/types.js +0 -2
- package/lib/commonjs/crypto/types.js.map +0 -1
- package/lib/commonjs/ui/context/OxyContextBase.js +0 -21
- package/lib/commonjs/ui/context/OxyContextBase.js.map +0 -1
- package/lib/commonjs/ui/context/hooks/useStorage.js +0 -79
- package/lib/commonjs/ui/context/hooks/useStorage.js.map +0 -1
- package/lib/commonjs/ui/hooks/useAvatarPicker.js +0 -56
- package/lib/commonjs/ui/hooks/useAvatarPicker.js.map +0 -1
- package/lib/module/core/services/SessionService.js +0 -159
- package/lib/module/core/services/SessionService.js.map +0 -1
- package/lib/module/core/services/TokenService.js +0 -217
- package/lib/module/core/services/TokenService.js.map +0 -1
- package/lib/module/crypto/types.js +0 -2
- package/lib/module/crypto/types.js.map +0 -1
- package/lib/module/ui/context/OxyContextBase.js +0 -16
- package/lib/module/ui/context/OxyContextBase.js.map +0 -1
- package/lib/module/ui/context/hooks/useStorage.js +0 -74
- package/lib/module/ui/context/hooks/useStorage.js.map +0 -1
- package/lib/module/ui/hooks/useAvatarPicker.js +0 -50
- package/lib/module/ui/hooks/useAvatarPicker.js.map +0 -1
- package/lib/typescript/core/services/SessionService.d.ts +0 -78
- package/lib/typescript/core/services/SessionService.d.ts.map +0 -1
- package/lib/typescript/core/services/TokenService.d.ts +0 -72
- package/lib/typescript/core/services/TokenService.d.ts.map +0 -1
- package/lib/typescript/crypto/types.d.ts +0 -22
- package/lib/typescript/crypto/types.d.ts.map +0 -1
- package/lib/typescript/ui/context/OxyContextBase.d.ts +0 -63
- package/lib/typescript/ui/context/OxyContextBase.d.ts.map +0 -1
- package/lib/typescript/ui/context/hooks/useStorage.d.ts +0 -22
- package/lib/typescript/ui/context/hooks/useStorage.d.ts.map +0 -1
- package/lib/typescript/ui/hooks/useAvatarPicker.d.ts +0 -19
- package/lib/typescript/ui/hooks/useAvatarPicker.d.ts.map +0 -1
- package/src/core/services/SessionService.ts +0 -173
- package/src/core/services/TokenService.ts +0 -237
- package/src/crypto/types.ts +0 -23
- package/src/ui/context/OxyContextBase.tsx +0 -78
- package/src/ui/context/hooks/useStorage.ts +0 -104
- package/src/ui/hooks/useAvatarPicker.ts +0 -61
|
@@ -8,7 +8,6 @@ var _react = require("react");
|
|
|
8
8
|
var _socket = _interopRequireDefault(require("socket.io-client"));
|
|
9
9
|
var _sonner = require("../../lib/sonner");
|
|
10
10
|
var _loggerUtils = require("../../utils/loggerUtils");
|
|
11
|
-
var _TokenService = require("../../core/services/TokenService");
|
|
12
11
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
12
|
function useSessionSocket({
|
|
14
13
|
userId,
|
|
@@ -18,16 +17,13 @@ function useSessionSocket({
|
|
|
18
17
|
logout,
|
|
19
18
|
clearSessionState,
|
|
20
19
|
baseURL,
|
|
21
|
-
getAccessToken,
|
|
22
20
|
onRemoteSignOut,
|
|
23
21
|
onSessionRemoved
|
|
24
22
|
}) {
|
|
25
23
|
const socketRef = (0, _react.useRef)(null);
|
|
26
24
|
const joinedRoomRef = (0, _react.useRef)(null);
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
const lastRegisteredSocketIdRef = (0, _react.useRef)(null);
|
|
30
|
-
const getAccessTokenRef = (0, _react.useRef)(getAccessToken);
|
|
25
|
+
|
|
26
|
+
// Store callbacks in refs to avoid re-joining when they change
|
|
31
27
|
const refreshSessionsRef = (0, _react.useRef)(refreshSessions);
|
|
32
28
|
const logoutRef = (0, _react.useRef)(logout);
|
|
33
29
|
const clearSessionStateRef = (0, _react.useRef)(clearSessionState);
|
|
@@ -35,6 +31,8 @@ function useSessionSocket({
|
|
|
35
31
|
const onSessionRemovedRef = (0, _react.useRef)(onSessionRemoved);
|
|
36
32
|
const activeSessionIdRef = (0, _react.useRef)(activeSessionId);
|
|
37
33
|
const currentDeviceIdRef = (0, _react.useRef)(currentDeviceId);
|
|
34
|
+
|
|
35
|
+
// Update refs when callbacks change
|
|
38
36
|
(0, _react.useEffect)(() => {
|
|
39
37
|
refreshSessionsRef.current = refreshSessions;
|
|
40
38
|
logoutRef.current = logout;
|
|
@@ -43,363 +41,212 @@ function useSessionSocket({
|
|
|
43
41
|
onSessionRemovedRef.current = onSessionRemoved;
|
|
44
42
|
activeSessionIdRef.current = activeSessionId;
|
|
45
43
|
currentDeviceIdRef.current = currentDeviceId;
|
|
46
|
-
|
|
47
|
-
}, [refreshSessions, logout, clearSessionState, onRemoteSignOut, onSessionRemoved, activeSessionId, currentDeviceId, getAccessToken]);
|
|
44
|
+
}, [refreshSessions, logout, clearSessionState, onRemoteSignOut, onSessionRemoved, activeSessionId, currentDeviceId]);
|
|
48
45
|
(0, _react.useEffect)(() => {
|
|
49
46
|
if (!userId || !baseURL) {
|
|
50
|
-
if
|
|
51
|
-
|
|
52
|
-
socketRef.current
|
|
47
|
+
// Clean up if userId or baseURL becomes invalid
|
|
48
|
+
if (socketRef.current && joinedRoomRef.current) {
|
|
49
|
+
socketRef.current.emit('leave', {
|
|
50
|
+
userId: joinedRoomRef.current
|
|
51
|
+
});
|
|
53
52
|
joinedRoomRef.current = null;
|
|
54
53
|
}
|
|
55
54
|
return;
|
|
56
55
|
}
|
|
57
|
-
const
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
56
|
+
const roomId = `user:${userId}`;
|
|
57
|
+
|
|
58
|
+
// Only create socket if it doesn't exist
|
|
59
|
+
if (!socketRef.current) {
|
|
60
|
+
socketRef.current = (0, _socket.default)(baseURL, {
|
|
61
|
+
transports: ['websocket']
|
|
62
62
|
});
|
|
63
|
-
if (socketRef.current) {
|
|
64
|
-
socketRef.current.disconnect();
|
|
65
|
-
socketRef.current = null;
|
|
66
|
-
joinedRoomRef.current = null;
|
|
67
|
-
}
|
|
68
|
-
return;
|
|
69
63
|
}
|
|
70
|
-
const
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
64
|
+
const socket = socketRef.current;
|
|
65
|
+
|
|
66
|
+
// Only join if we haven't already joined this room
|
|
67
|
+
if (joinedRoomRef.current !== roomId) {
|
|
68
|
+
// Leave previous room if switching users
|
|
69
|
+
if (joinedRoomRef.current) {
|
|
70
|
+
socket.emit('leave', {
|
|
71
|
+
userId: joinedRoomRef.current
|
|
78
72
|
});
|
|
79
73
|
}
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
}
|
|
87
|
-
const socketOptions = {
|
|
88
|
-
transports: ['websocket']
|
|
89
|
-
};
|
|
90
|
-
const freshToken = getAccessTokenRef.current();
|
|
91
|
-
if (freshToken) {
|
|
92
|
-
socketOptions.auth = {
|
|
93
|
-
token: freshToken
|
|
94
|
-
};
|
|
95
|
-
} else {
|
|
96
|
-
_loggerUtils.logger.debug('No access token available for socket authentication', {
|
|
97
|
-
component: 'useSessionSocket',
|
|
98
|
-
userId
|
|
99
|
-
});
|
|
100
|
-
return;
|
|
101
|
-
}
|
|
102
|
-
socketRef.current = (0, _socket.default)(baseURL, socketOptions);
|
|
103
|
-
accessTokenRef.current = freshToken;
|
|
104
|
-
joinedRoomRef.current = null;
|
|
105
|
-
handlersSetupRef.current = false;
|
|
74
|
+
socket.emit('join', {
|
|
75
|
+
userId: roomId
|
|
76
|
+
});
|
|
77
|
+
joinedRoomRef.current = roomId;
|
|
78
|
+
if (__DEV__) {
|
|
79
|
+
console.log('Emitting join for room:', roomId);
|
|
106
80
|
}
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
// Set up event handlers (only once per socket instance)
|
|
84
|
+
const handleConnect = () => {
|
|
85
|
+
if (__DEV__) {
|
|
86
|
+
console.log('Socket connected:', socket.id);
|
|
111
87
|
}
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
});
|
|
126
|
-
}
|
|
127
|
-
// Server auto-joins room on connection when authenticated
|
|
128
|
-
// Just track that we're connected
|
|
129
|
-
if (userId) {
|
|
130
|
-
joinedRoomRef.current = `user:${userId}`;
|
|
88
|
+
};
|
|
89
|
+
const handleSessionUpdate = async data => {
|
|
90
|
+
if (__DEV__) {
|
|
91
|
+
console.log('Received session_update:', data);
|
|
92
|
+
}
|
|
93
|
+
const currentActiveSessionId = activeSessionIdRef.current;
|
|
94
|
+
const currentDeviceId = currentDeviceIdRef.current;
|
|
95
|
+
|
|
96
|
+
// Handle different event types
|
|
97
|
+
if (data.type === 'session_removed') {
|
|
98
|
+
// Track removed session
|
|
99
|
+
if (data.sessionId && onSessionRemovedRef.current) {
|
|
100
|
+
onSessionRemovedRef.current(data.sessionId);
|
|
131
101
|
}
|
|
132
|
-
};
|
|
133
|
-
const handleDisconnect = async reason => {
|
|
134
|
-
_loggerUtils.logger.debug('Socket disconnected', {
|
|
135
|
-
component: 'useSessionSocket',
|
|
136
|
-
reason,
|
|
137
|
-
userId
|
|
138
|
-
});
|
|
139
|
-
joinedRoomRef.current = null;
|
|
140
102
|
|
|
141
|
-
// If
|
|
142
|
-
if (
|
|
103
|
+
// If the removed sessionId matches the current activeSessionId, immediately clear state
|
|
104
|
+
if (data.sessionId === currentActiveSessionId) {
|
|
105
|
+
if (onRemoteSignOutRef.current) {
|
|
106
|
+
onRemoteSignOutRef.current();
|
|
107
|
+
} else {
|
|
108
|
+
_sonner.toast.info('You have been signed out remotely.');
|
|
109
|
+
}
|
|
110
|
+
// Use clearSessionState since session was already removed server-side
|
|
111
|
+
// Await to ensure storage cleanup completes before continuing
|
|
143
112
|
try {
|
|
144
|
-
|
|
145
|
-
await _TokenService.tokenService.refreshTokenIfNeeded();
|
|
146
|
-
const freshToken = getAccessTokenRef.current();
|
|
147
|
-
if (freshToken && socketRef.current) {
|
|
148
|
-
// Update auth and reconnect
|
|
149
|
-
socketRef.current.auth = {
|
|
150
|
-
token: freshToken
|
|
151
|
-
};
|
|
152
|
-
socketRef.current.connect();
|
|
153
|
-
}
|
|
113
|
+
await clearSessionStateRef.current();
|
|
154
114
|
} catch (error) {
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
}
|
|
115
|
+
if (__DEV__) {
|
|
116
|
+
_loggerUtils.logger.error('Failed to clear session state after session_removed', error instanceof Error ? error : new Error(String(error)), {
|
|
117
|
+
component: 'useSessionSocket'
|
|
118
|
+
});
|
|
119
|
+
}
|
|
160
120
|
}
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
const handleConnectError = async error => {
|
|
170
|
-
_loggerUtils.logger.debug('Socket connection error', {
|
|
171
|
-
component: 'useSessionSocket',
|
|
172
|
-
userId,
|
|
173
|
-
error: error.message
|
|
174
|
-
});
|
|
175
|
-
|
|
176
|
-
// If error is due to expired/invalid token, try to refresh and reconnect
|
|
177
|
-
if (error.message.includes('Authentication') || error.message.includes('expired') || error.message.includes('token')) {
|
|
178
|
-
try {
|
|
179
|
-
await _TokenService.tokenService.refreshTokenIfNeeded();
|
|
180
|
-
const freshToken = getAccessTokenRef.current();
|
|
181
|
-
if (freshToken && socketRef.current) {
|
|
182
|
-
// Update auth and reconnect
|
|
183
|
-
socketRef.current.auth = {
|
|
184
|
-
token: freshToken
|
|
185
|
-
};
|
|
186
|
-
socketRef.current.connect();
|
|
121
|
+
} else {
|
|
122
|
+
// Otherwise, just refresh the sessions list (with error handling)
|
|
123
|
+
refreshSessionsRef.current().catch(error => {
|
|
124
|
+
// Silently handle errors from refresh - they're expected if sessions were removed
|
|
125
|
+
if (__DEV__) {
|
|
126
|
+
_loggerUtils.logger.debug('Failed to refresh sessions after session_removed', {
|
|
127
|
+
component: 'useSessionSocket'
|
|
128
|
+
}, error);
|
|
187
129
|
}
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
} else if (data.type === 'device_removed') {
|
|
133
|
+
// Track all removed sessions from this device
|
|
134
|
+
if (data.sessionIds && onSessionRemovedRef.current) {
|
|
135
|
+
for (const sessionId of data.sessionIds) {
|
|
136
|
+
onSessionRemovedRef.current(sessionId);
|
|
194
137
|
}
|
|
195
138
|
}
|
|
196
|
-
};
|
|
197
|
-
const handleSessionUpdate = async data => {
|
|
198
|
-
_loggerUtils.logger.debug('Received session_update event', {
|
|
199
|
-
component: 'useSessionSocket',
|
|
200
|
-
type: data.type,
|
|
201
|
-
socketId: socket.id,
|
|
202
|
-
socketConnected: socket.connected,
|
|
203
|
-
roomId: joinedRoomRef.current
|
|
204
|
-
});
|
|
205
|
-
const currentActiveSessionId = activeSessionIdRef.current;
|
|
206
|
-
const currentDeviceId = currentDeviceIdRef.current;
|
|
207
139
|
|
|
208
|
-
//
|
|
209
|
-
if (data.
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
140
|
+
// If the removed deviceId matches the current device, immediately clear state
|
|
141
|
+
if (data.deviceId && data.deviceId === currentDeviceId) {
|
|
142
|
+
if (onRemoteSignOutRef.current) {
|
|
143
|
+
onRemoteSignOutRef.current();
|
|
144
|
+
} else {
|
|
145
|
+
_sonner.toast.info('This device has been removed. You have been signed out.');
|
|
213
146
|
}
|
|
214
|
-
|
|
215
|
-
//
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
// Await to ensure storage cleanup completes before continuing
|
|
224
|
-
try {
|
|
225
|
-
await clearSessionStateRef.current();
|
|
226
|
-
} catch (error) {
|
|
227
|
-
if (__DEV__) {
|
|
228
|
-
_loggerUtils.logger.error('Failed to clear session state after session_removed', error instanceof Error ? error : new Error(String(error)), {
|
|
229
|
-
component: 'useSessionSocket'
|
|
230
|
-
});
|
|
231
|
-
}
|
|
147
|
+
// Use clearSessionState since sessions were already removed server-side
|
|
148
|
+
// Await to ensure storage cleanup completes before continuing
|
|
149
|
+
try {
|
|
150
|
+
await clearSessionStateRef.current();
|
|
151
|
+
} catch (error) {
|
|
152
|
+
if (__DEV__) {
|
|
153
|
+
_loggerUtils.logger.error('Failed to clear session state after device_removed', error instanceof Error ? error : new Error(String(error)), {
|
|
154
|
+
component: 'useSessionSocket'
|
|
155
|
+
});
|
|
232
156
|
}
|
|
233
|
-
} else {
|
|
234
|
-
// Otherwise, just refresh the sessions list (with error handling)
|
|
235
|
-
refreshSessionsRef.current().catch(error => {
|
|
236
|
-
// Silently handle errors from refresh - they're expected if sessions were removed
|
|
237
|
-
if (__DEV__) {
|
|
238
|
-
_loggerUtils.logger.debug('Failed to refresh sessions after session_removed', {
|
|
239
|
-
component: 'useSessionSocket'
|
|
240
|
-
}, error);
|
|
241
|
-
}
|
|
242
|
-
});
|
|
243
157
|
}
|
|
244
|
-
} else
|
|
245
|
-
//
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
158
|
+
} else {
|
|
159
|
+
// Otherwise, refresh sessions and device list (with error handling)
|
|
160
|
+
refreshSessionsRef.current().catch(error => {
|
|
161
|
+
// Silently handle errors from refresh - they're expected if sessions were removed
|
|
162
|
+
if (__DEV__) {
|
|
163
|
+
_loggerUtils.logger.debug('Failed to refresh sessions after device_removed', {
|
|
164
|
+
component: 'useSessionSocket'
|
|
165
|
+
}, error);
|
|
249
166
|
}
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
} else if (data.type === 'sessions_removed') {
|
|
170
|
+
// Track all removed sessions
|
|
171
|
+
if (data.sessionIds && onSessionRemovedRef.current) {
|
|
172
|
+
for (const sessionId of data.sessionIds) {
|
|
173
|
+
onSessionRemovedRef.current(sessionId);
|
|
250
174
|
}
|
|
175
|
+
}
|
|
251
176
|
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
} else {
|
|
257
|
-
_sonner.toast.info('This device has been removed. You have been signed out.');
|
|
258
|
-
}
|
|
259
|
-
// Use clearSessionState since sessions were already removed server-side
|
|
260
|
-
// Await to ensure storage cleanup completes before continuing
|
|
261
|
-
try {
|
|
262
|
-
await clearSessionStateRef.current();
|
|
263
|
-
} catch (error) {
|
|
264
|
-
if (__DEV__) {
|
|
265
|
-
_loggerUtils.logger.error('Failed to clear session state after device_removed', error instanceof Error ? error : new Error(String(error)), {
|
|
266
|
-
component: 'useSessionSocket'
|
|
267
|
-
});
|
|
268
|
-
}
|
|
269
|
-
}
|
|
177
|
+
// If the current activeSessionId is in the removed sessionIds list, immediately clear state
|
|
178
|
+
if (data.sessionIds && currentActiveSessionId && data.sessionIds.includes(currentActiveSessionId)) {
|
|
179
|
+
if (onRemoteSignOutRef.current) {
|
|
180
|
+
onRemoteSignOutRef.current();
|
|
270
181
|
} else {
|
|
271
|
-
|
|
272
|
-
refreshSessionsRef.current().catch(error => {
|
|
273
|
-
// Silently handle errors from refresh - they're expected if sessions were removed
|
|
274
|
-
if (__DEV__) {
|
|
275
|
-
_loggerUtils.logger.debug('Failed to refresh sessions after device_removed', {
|
|
276
|
-
component: 'useSessionSocket'
|
|
277
|
-
}, error);
|
|
278
|
-
}
|
|
279
|
-
});
|
|
280
|
-
}
|
|
281
|
-
} else if (data.type === 'sessions_removed') {
|
|
282
|
-
// Track all removed sessions
|
|
283
|
-
if (data.sessionIds && onSessionRemovedRef.current) {
|
|
284
|
-
for (const sessionId of data.sessionIds) {
|
|
285
|
-
onSessionRemovedRef.current(sessionId);
|
|
286
|
-
}
|
|
182
|
+
_sonner.toast.info('You have been signed out remotely.');
|
|
287
183
|
}
|
|
288
|
-
|
|
289
|
-
//
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
// Await to ensure storage cleanup completes before continuing
|
|
298
|
-
try {
|
|
299
|
-
await clearSessionStateRef.current();
|
|
300
|
-
} catch (error) {
|
|
301
|
-
if (__DEV__) {
|
|
302
|
-
_loggerUtils.logger.error('Failed to clear session state after sessions_removed', error instanceof Error ? error : new Error(String(error)), {
|
|
303
|
-
component: 'useSessionSocket'
|
|
304
|
-
});
|
|
305
|
-
}
|
|
184
|
+
// Use clearSessionState since sessions were already removed server-side
|
|
185
|
+
// Await to ensure storage cleanup completes before continuing
|
|
186
|
+
try {
|
|
187
|
+
await clearSessionStateRef.current();
|
|
188
|
+
} catch (error) {
|
|
189
|
+
if (__DEV__) {
|
|
190
|
+
_loggerUtils.logger.error('Failed to clear session state after sessions_removed', error instanceof Error ? error : new Error(String(error)), {
|
|
191
|
+
component: 'useSessionSocket'
|
|
192
|
+
});
|
|
306
193
|
}
|
|
307
|
-
} else {
|
|
308
|
-
// Otherwise, refresh sessions list (with error handling)
|
|
309
|
-
refreshSessionsRef.current().catch(error => {
|
|
310
|
-
// Silently handle errors from refresh - they're expected if sessions were removed
|
|
311
|
-
if (__DEV__) {
|
|
312
|
-
_loggerUtils.logger.debug('Failed to refresh sessions after sessions_removed', {
|
|
313
|
-
component: 'useSessionSocket'
|
|
314
|
-
}, error);
|
|
315
|
-
}
|
|
316
|
-
});
|
|
317
194
|
}
|
|
318
195
|
} else {
|
|
319
|
-
//
|
|
196
|
+
// Otherwise, refresh sessions list (with error handling)
|
|
320
197
|
refreshSessionsRef.current().catch(error => {
|
|
321
|
-
//
|
|
198
|
+
// Silently handle errors from refresh - they're expected if sessions were removed
|
|
322
199
|
if (__DEV__) {
|
|
323
|
-
_loggerUtils.logger.debug('Failed to refresh sessions after
|
|
200
|
+
_loggerUtils.logger.debug('Failed to refresh sessions after sessions_removed', {
|
|
324
201
|
component: 'useSessionSocket'
|
|
325
202
|
}, error);
|
|
326
203
|
}
|
|
327
204
|
});
|
|
328
|
-
|
|
329
|
-
// If the current session was logged out (legacy behavior), handle it specially
|
|
330
|
-
if (data.sessionId === currentActiveSessionId) {
|
|
331
|
-
if (onRemoteSignOutRef.current) {
|
|
332
|
-
onRemoteSignOutRef.current();
|
|
333
|
-
} else {
|
|
334
|
-
_sonner.toast.info('You have been signed out remotely.');
|
|
335
|
-
}
|
|
336
|
-
// Use clearSessionState since session was already removed server-side
|
|
337
|
-
// Await to ensure storage cleanup completes before continuing
|
|
338
|
-
try {
|
|
339
|
-
await clearSessionStateRef.current();
|
|
340
|
-
} catch (error) {
|
|
341
|
-
_loggerUtils.logger.error('Failed to clear session state after session_update', error instanceof Error ? error : new Error(String(error)), {
|
|
342
|
-
component: 'useSessionSocket'
|
|
343
|
-
});
|
|
344
|
-
}
|
|
345
|
-
}
|
|
346
205
|
}
|
|
347
|
-
}
|
|
206
|
+
} else {
|
|
207
|
+
// For other event types (e.g., session_created), refresh sessions (with error handling)
|
|
208
|
+
refreshSessionsRef.current().catch(error => {
|
|
209
|
+
// Log but don't throw - refresh errors shouldn't break the socket handler
|
|
210
|
+
if (__DEV__) {
|
|
211
|
+
_loggerUtils.logger.debug('Failed to refresh sessions after session_update', {
|
|
212
|
+
component: 'useSessionSocket'
|
|
213
|
+
}, error);
|
|
214
|
+
}
|
|
215
|
+
});
|
|
348
216
|
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
217
|
+
// If the current session was logged out (legacy behavior), handle it specially
|
|
218
|
+
if (data.sessionId === currentActiveSessionId) {
|
|
219
|
+
if (onRemoteSignOutRef.current) {
|
|
220
|
+
onRemoteSignOutRef.current();
|
|
221
|
+
} else {
|
|
222
|
+
_sonner.toast.info('You have been signed out remotely.');
|
|
223
|
+
}
|
|
224
|
+
// Use clearSessionState since session was already removed server-side
|
|
225
|
+
// Await to ensure storage cleanup completes before continuing
|
|
355
226
|
try {
|
|
356
|
-
|
|
357
|
-
socketRef.current.off('disconnect', handleDisconnect);
|
|
358
|
-
socketRef.current.off('error', handleError);
|
|
359
|
-
socketRef.current.off('session_update', handleSessionUpdate);
|
|
227
|
+
await clearSessionStateRef.current();
|
|
360
228
|
} catch (error) {
|
|
361
|
-
|
|
229
|
+
if (__DEV__) {
|
|
230
|
+
console.error('Failed to clear session state after session_update:', error);
|
|
231
|
+
}
|
|
362
232
|
}
|
|
363
233
|
}
|
|
364
|
-
|
|
365
|
-
// Register handlers on current socket
|
|
366
|
-
socket.on('connect', handleConnect);
|
|
367
|
-
socket.on('disconnect', handleDisconnect);
|
|
368
|
-
socket.on('error', handleError);
|
|
369
|
-
socket.on('connect_error', handleConnectError);
|
|
370
|
-
socket.on('session_update', handleSessionUpdate);
|
|
371
|
-
handlersSetupRef.current = true;
|
|
372
|
-
lastRegisteredSocketIdRef.current = currentSocketId;
|
|
373
|
-
_loggerUtils.logger.debug('Event handlers set up', {
|
|
374
|
-
component: 'useSessionSocket',
|
|
375
|
-
socketId: socket.id,
|
|
376
|
-
userId
|
|
377
|
-
});
|
|
378
|
-
}
|
|
379
|
-
if (!socket.connected) {
|
|
380
|
-
_loggerUtils.logger.debug('Socket not connected, connecting...', {
|
|
381
|
-
component: 'useSessionSocket',
|
|
382
|
-
userId
|
|
383
|
-
});
|
|
384
|
-
socket.connect();
|
|
385
234
|
}
|
|
386
235
|
};
|
|
387
|
-
|
|
236
|
+
socket.on('connect', handleConnect);
|
|
237
|
+
socket.on('session_update', handleSessionUpdate);
|
|
388
238
|
return () => {
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
// Ignore errors when removing handlers
|
|
399
|
-
}
|
|
400
|
-
handlersSetupRef.current = false;
|
|
239
|
+
socket.off('connect', handleConnect);
|
|
240
|
+
socket.off('session_update', handleSessionUpdate);
|
|
241
|
+
|
|
242
|
+
// Only leave on unmount if we're still in this room
|
|
243
|
+
if (joinedRoomRef.current === roomId) {
|
|
244
|
+
socket.emit('leave', {
|
|
245
|
+
userId: roomId
|
|
246
|
+
});
|
|
247
|
+
joinedRoomRef.current = null;
|
|
401
248
|
}
|
|
402
249
|
};
|
|
403
|
-
}, [userId, baseURL]); // Only depend on userId and baseURL -
|
|
250
|
+
}, [userId, baseURL]); // Only depend on userId and baseURL - callbacks are in refs
|
|
404
251
|
}
|
|
405
252
|
//# sourceMappingURL=useSessionSocket.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","require","_socket","_interopRequireDefault","_sonner","_loggerUtils","_TokenService","e","__esModule","default","useSessionSocket","userId","activeSessionId","currentDeviceId","refreshSessions","logout","clearSessionState","baseURL","getAccessToken","onRemoteSignOut","onSessionRemoved","socketRef","useRef","joinedRoomRef","accessTokenRef","handlersSetupRef","lastRegisteredSocketIdRef","getAccessTokenRef","refreshSessionsRef","logoutRef","clearSessionStateRef","onRemoteSignOutRef","onSessionRemovedRef","activeSessionIdRef","currentDeviceIdRef","useEffect","current","disconnect","freshToken","logger","debug","component","initializeSocket","tokenService","refreshTokenIfNeeded","error","accessToken","tokenChanged","socketOptions","transports","auth","token","io","socket","connected","handleConnect","currentToken","__DEV__","console","log","socketId","id","room","hasAuth","handleDisconnect","reason","includes","connect","handleError","handleConnectError","message","refreshError","handleSessionUpdate","data","type","socketConnected","roomId","currentActiveSessionId","sessionId","toast","info","Error","String","catch","sessionIds","deviceId","currentSocketId","off","on"],"sourceRoot":"../../../../src","sources":["ui/hooks/useSessionSocket.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AACA,IAAAK,aAAA,GAAAL,OAAA;AAAgE,SAAAE,uBAAAI,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAezD,SAASG,gBAAgBA,CAAC;EAAEC,MAAM;EAAEC,eAAe;EAAEC,eAAe;EAAEC,eAAe;EAAEC,MAAM;EAAEC,iBAAiB;EAAEC,OAAO;EAAEC,cAAc;EAAEC,eAAe;EAAEC;AAAwC,CAAC,EAAE;EAC5M,MAAMC,SAAS,GAAG,IAAAC,aAAM,EAAM,IAAI,CAAC;EACnC,MAAMC,aAAa,GAAG,IAAAD,aAAM,EAAgB,IAAI,CAAC;EACjD,MAAME,cAAc,GAAG,IAAAF,aAAM,EAAgB,IAAI,CAAC;EAClD,MAAMG,gBAAgB,GAAG,IAAAH,aAAM,EAAU,KAAK,CAAC;EAC/C,MAAMI,yBAA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CAAC,qCAAqC,EAAE;UAAEC,SAAS,EAAE,kBAAkB;UAAE9B;QAAO,CAAC,CAAC;QAC9F0C,MAAM,CAACc,OAAO,CAAC,CAAC;MAClB;IACF,CAAC;IAEDzB,gBAAgB,CAAC,CAAC;IAElB,OAAO,MAAM;MACX;MACA,IAAIrB,SAAS,CAACe,OAAO,IAAIX,gBAAgB,CAACW,OAAO,EAAE;QACjD,IAAI;UACFf,SAAS,CAACe,OAAO,CAACmD,GAAG,CAAC,SAAS,CAAC;UAChClE,SAAS,CAACe,OAAO,CAACmD,GAAG,CAAC,YAAY,CAAC;UACnClE,SAAS,CAACe,OAAO,CAACmD,GAAG,CAAC,OAAO,CAAC;UAC9BlE,SAAS,CAACe,OAAO,CAACmD,GAAG,CAAC,eAAe,CAAC;UACtClE,SAAS,CAACe,OAAO,CAACmD,GAAG,CAAC,gBAAgB,CAAC;QACzC,CAAC,CAAC,OAAO1C,KAAK,EAAE;UACd;QAAA;QAEFpB,gBAAgB,CAACW,OAAO,GAAG,KAAK;MAClC;IACF,CAAC;EACH,CAAC,EAAE,CAACzB,MAAM,EAAEM,OAAO,CAAC,CAAC,CAAC,CAAC;AACzB","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_react","require","_socket","_interopRequireDefault","_sonner","_loggerUtils","e","__esModule","default","useSessionSocket","userId","activeSessionId","currentDeviceId","refreshSessions","logout","clearSessionState","baseURL","onRemoteSignOut","onSessionRemoved","socketRef","useRef","joinedRoomRef","refreshSessionsRef","logoutRef","clearSessionStateRef","onRemoteSignOutRef","onSessionRemovedRef","activeSessionIdRef","currentDeviceIdRef","useEffect","current","emit","roomId","io","transports","socket","__DEV__","console","log","handleConnect","id","handleSessionUpdate","data","currentActiveSessionId","type","sessionId","toast","info","error","logger","Error","String","component","catch","debug","sessionIds","deviceId","includes","on","off"],"sourceRoot":"../../../../src","sources":["ui/hooks/useSessionSocket.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAA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