@oxyhq/services 5.10.15 → 5.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +604 -127
- package/lib/commonjs/assets/assets/icons/OxyServices.tsx +2 -2
- package/lib/commonjs/assets/assets/illustrations/HighFive.tsx +1 -1
- package/lib/commonjs/assets/icons/OxyServices.js +0 -2
- package/lib/commonjs/assets/icons/OxyServices.js.map +1 -1
- package/lib/commonjs/assets/illustrations/HighFive.js +0 -2
- package/lib/commonjs/assets/illustrations/HighFive.js.map +1 -1
- package/lib/commonjs/core/OxyServices.js +244 -26
- package/lib/commonjs/core/OxyServices.js.map +1 -1
- package/lib/commonjs/core/index.js +7 -0
- package/lib/commonjs/core/index.js.map +1 -1
- package/lib/commonjs/index.js +93 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/lib/sonner-safe.js +2 -0
- package/lib/commonjs/lib/sonner-safe.js.map +1 -1
- package/lib/commonjs/lib/sonner.js +2 -0
- package/lib/commonjs/lib/sonner.js.map +1 -1
- package/lib/commonjs/node/index.js +7 -0
- package/lib/commonjs/node/index.js.map +1 -1
- package/lib/commonjs/ui/components/Avatar.js +0 -2
- package/lib/commonjs/ui/components/Avatar.js.map +1 -1
- package/lib/commonjs/ui/components/FollowButton.js +4 -4
- package/lib/commonjs/ui/components/FollowButton.js.map +1 -1
- package/lib/commonjs/ui/components/FontLoader.js +3 -2
- package/lib/commonjs/ui/components/FontLoader.js.map +1 -1
- package/lib/commonjs/ui/components/GroupedItem.js +7 -4
- package/lib/commonjs/ui/components/GroupedItem.js.map +1 -1
- package/lib/commonjs/ui/components/GroupedSection.js +1 -1
- package/lib/commonjs/ui/components/GroupedSection.js.map +1 -1
- package/lib/commonjs/ui/components/Header.js +0 -1
- package/lib/commonjs/ui/components/Header.js.map +1 -1
- package/lib/commonjs/ui/components/OxyLogo.js +0 -2
- package/lib/commonjs/ui/components/OxyLogo.js.map +1 -1
- package/lib/commonjs/ui/components/OxyPayButton.js +4 -5
- package/lib/commonjs/ui/components/OxyPayButton.js.map +1 -1
- package/lib/commonjs/ui/components/OxyProvider.js +4 -3
- package/lib/commonjs/ui/components/OxyProvider.js.map +1 -1
- package/lib/commonjs/ui/components/OxySignInButton.js +0 -1
- package/lib/commonjs/ui/components/OxySignInButton.js.map +1 -1
- package/lib/commonjs/ui/components/ProfileCard.js +0 -1
- package/lib/commonjs/ui/components/ProfileCard.js.map +1 -1
- package/lib/commonjs/ui/components/QuickActions.js +0 -2
- package/lib/commonjs/ui/components/QuickActions.js.map +1 -1
- package/lib/commonjs/ui/components/Section.js +0 -1
- package/lib/commonjs/ui/components/Section.js.map +1 -1
- package/lib/commonjs/ui/components/SectionTitle.js +0 -2
- package/lib/commonjs/ui/components/SectionTitle.js.map +1 -1
- package/lib/commonjs/ui/components/icon/FAIRWalletIcon.js +0 -2
- package/lib/commonjs/ui/components/icon/FAIRWalletIcon.js.map +1 -1
- package/lib/commonjs/ui/components/icon/OxyIcon.js +0 -2
- package/lib/commonjs/ui/components/icon/OxyIcon.js.map +1 -1
- package/lib/commonjs/ui/components/internal/GroupedPillButtons.js +0 -2
- package/lib/commonjs/ui/components/internal/GroupedPillButtons.js.map +1 -1
- package/lib/commonjs/ui/components/internal/PinInput.js +4 -3
- package/lib/commonjs/ui/components/internal/PinInput.js.map +1 -1
- package/lib/commonjs/ui/components/internal/TextField.js +3 -3
- package/lib/commonjs/ui/components/internal/TextField.js.map +1 -1
- package/lib/commonjs/ui/hooks/useAssets.js +263 -0
- package/lib/commonjs/ui/hooks/useAssets.js.map +1 -0
- package/lib/commonjs/ui/navigation/OxyRouter.js +1 -2
- package/lib/commonjs/ui/navigation/OxyRouter.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountCenterScreen.js +0 -2
- package/lib/commonjs/ui/screens/AccountCenterScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountManagementDemo.js +0 -1
- package/lib/commonjs/ui/screens/AccountManagementDemo.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountSettingsScreen.js +2 -2
- package/lib/commonjs/ui/screens/AccountSettingsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountSwitcherScreen.js +5 -6
- package/lib/commonjs/ui/screens/AccountSwitcherScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AppInfoScreen.js +1 -2
- package/lib/commonjs/ui/screens/AppInfoScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/FileManagementScreen.js +631 -430
- package/lib/commonjs/ui/screens/FileManagementScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/PaymentGatewayScreen.js +2 -2
- package/lib/commonjs/ui/screens/PaymentGatewayScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/PremiumSubscriptionScreen.js +1 -2
- package/lib/commonjs/ui/screens/PremiumSubscriptionScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/ProfileScreen.js +1 -2
- package/lib/commonjs/ui/screens/ProfileScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/RecoverAccountScreen.js +1 -2
- package/lib/commonjs/ui/screens/RecoverAccountScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/SessionManagementScreen.js +1 -2
- package/lib/commonjs/ui/screens/SessionManagementScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/SignInScreen.js +1 -2
- package/lib/commonjs/ui/screens/SignInScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/UserLinksScreen.js +0 -2
- package/lib/commonjs/ui/screens/UserLinksScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/internal/SignInPasswordStep.js +1 -2
- package/lib/commonjs/ui/screens/internal/SignInPasswordStep.js.map +1 -1
- package/lib/commonjs/ui/screens/internal/SignInUsernameStep.js +1 -2
- package/lib/commonjs/ui/screens/internal/SignInUsernameStep.js.map +1 -1
- package/lib/commonjs/ui/screens/internal/SignUpIdentityStep.js +1 -2
- package/lib/commonjs/ui/screens/internal/SignUpIdentityStep.js.map +1 -1
- package/lib/commonjs/ui/screens/internal/SignUpSecurityStep.js +1 -2
- package/lib/commonjs/ui/screens/internal/SignUpSecurityStep.js.map +1 -1
- package/lib/commonjs/ui/screens/internal/SignUpSummaryStep.js +0 -1
- package/lib/commonjs/ui/screens/internal/SignUpSummaryStep.js.map +1 -1
- package/lib/commonjs/ui/screens/internal/SignUpWelcomeStep.js +0 -1
- package/lib/commonjs/ui/screens/internal/SignUpWelcomeStep.js.map +1 -1
- package/lib/commonjs/ui/screens/karma/KarmaAboutScreen.js +0 -2
- package/lib/commonjs/ui/screens/karma/KarmaAboutScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/karma/KarmaCenterScreen.js +1 -2
- package/lib/commonjs/ui/screens/karma/KarmaCenterScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/karma/KarmaLeaderboardScreen.js +1 -2
- package/lib/commonjs/ui/screens/karma/KarmaLeaderboardScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/karma/KarmaRewardsScreen.js +0 -2
- package/lib/commonjs/ui/screens/karma/KarmaRewardsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/karma/KarmaRulesScreen.js +1 -2
- package/lib/commonjs/ui/screens/karma/KarmaRulesScreen.js.map +1 -1
- package/lib/commonjs/ui/stores/assetStore.js +225 -0
- package/lib/commonjs/ui/stores/assetStore.js.map +1 -0
- package/lib/commonjs/ui/stores/authStore.js +1 -1
- package/lib/commonjs/ui/stores/authStore.js.map +1 -1
- package/lib/commonjs/ui/stores/fileStore.js +153 -0
- package/lib/commonjs/ui/stores/fileStore.js.map +1 -0
- package/lib/commonjs/ui/stores/followStore.js +2 -2
- package/lib/commonjs/ui/stores/followStore.js.map +1 -1
- package/lib/commonjs/utils/asyncUtils.js +1 -1
- package/lib/commonjs/utils/asyncUtils.js.map +1 -1
- package/lib/commonjs/utils/errorUtils.js +19 -11
- package/lib/commonjs/utils/errorUtils.js.map +1 -1
- package/lib/commonjs/utils/hookUtils.js +1 -1
- package/lib/commonjs/utils/hookUtils.js.map +1 -1
- package/lib/commonjs/utils/loggerUtils.js.map +1 -1
- package/lib/commonjs/utils/validationUtils.js +2 -2
- package/lib/commonjs/utils/validationUtils.js.map +1 -1
- package/lib/module/assets/assets/icons/OxyServices.tsx +2 -2
- package/lib/module/assets/assets/illustrations/HighFive.tsx +1 -1
- package/lib/module/assets/icons/OxyServices.js +0 -1
- package/lib/module/assets/icons/OxyServices.js.map +1 -1
- package/lib/module/assets/illustrations/HighFive.js +0 -1
- package/lib/module/assets/illustrations/HighFive.js.map +1 -1
- package/lib/module/core/OxyServices.js +243 -25
- package/lib/module/core/OxyServices.js.map +1 -1
- package/lib/module/core/index.js +1 -1
- package/lib/module/core/index.js.map +1 -1
- package/lib/module/index.js +3 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/lib/sonner-safe.js +2 -0
- package/lib/module/lib/sonner-safe.js.map +1 -1
- package/lib/module/lib/sonner.js +3 -0
- package/lib/module/lib/sonner.js.map +1 -1
- package/lib/module/node/index.js +2 -2
- package/lib/module/node/index.js.map +1 -1
- package/lib/module/ui/components/Avatar.js +0 -1
- package/lib/module/ui/components/Avatar.js.map +1 -1
- package/lib/module/ui/components/FollowButton.js +4 -3
- package/lib/module/ui/components/FollowButton.js.map +1 -1
- package/lib/module/ui/components/FontLoader.js +3 -2
- package/lib/module/ui/components/FontLoader.js.map +1 -1
- package/lib/module/ui/components/GroupedItem.js +7 -3
- 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 +0 -1
- package/lib/module/ui/components/Header.js.map +1 -1
- package/lib/module/ui/components/OxyLogo.js +0 -1
- package/lib/module/ui/components/OxyLogo.js.map +1 -1
- package/lib/module/ui/components/OxyPayButton.js +4 -4
- package/lib/module/ui/components/OxyPayButton.js.map +1 -1
- package/lib/module/ui/components/OxyProvider.js +4 -2
- package/lib/module/ui/components/OxyProvider.js.map +1 -1
- package/lib/module/ui/components/OxySignInButton.js +0 -1
- package/lib/module/ui/components/OxySignInButton.js.map +1 -1
- package/lib/module/ui/components/ProfileCard.js +0 -1
- package/lib/module/ui/components/ProfileCard.js.map +1 -1
- package/lib/module/ui/components/QuickActions.js +0 -1
- package/lib/module/ui/components/QuickActions.js.map +1 -1
- package/lib/module/ui/components/Section.js +0 -1
- package/lib/module/ui/components/Section.js.map +1 -1
- package/lib/module/ui/components/SectionTitle.js +0 -1
- package/lib/module/ui/components/SectionTitle.js.map +1 -1
- package/lib/module/ui/components/icon/FAIRWalletIcon.js +0 -1
- package/lib/module/ui/components/icon/FAIRWalletIcon.js.map +1 -1
- package/lib/module/ui/components/icon/OxyIcon.js +0 -1
- package/lib/module/ui/components/icon/OxyIcon.js.map +1 -1
- package/lib/module/ui/components/internal/GroupedPillButtons.js +0 -1
- package/lib/module/ui/components/internal/GroupedPillButtons.js.map +1 -1
- package/lib/module/ui/components/internal/PinInput.js +4 -2
- package/lib/module/ui/components/internal/PinInput.js.map +1 -1
- package/lib/module/ui/components/internal/TextField.js +3 -3
- package/lib/module/ui/components/internal/TextField.js.map +1 -1
- package/lib/module/ui/context/OxyContext.js.map +1 -1
- package/lib/module/ui/hooks/useAssets.js +257 -0
- package/lib/module/ui/hooks/useAssets.js.map +1 -0
- package/lib/module/ui/navigation/OxyRouter.js +1 -1
- package/lib/module/ui/navigation/OxyRouter.js.map +1 -1
- package/lib/module/ui/screens/AccountCenterScreen.js +0 -1
- package/lib/module/ui/screens/AccountCenterScreen.js.map +1 -1
- package/lib/module/ui/screens/AccountManagementDemo.js +0 -1
- package/lib/module/ui/screens/AccountManagementDemo.js.map +1 -1
- package/lib/module/ui/screens/AccountSettingsScreen.js +2 -2
- package/lib/module/ui/screens/AccountSettingsScreen.js.map +1 -1
- package/lib/module/ui/screens/AccountSwitcherScreen.js +5 -5
- package/lib/module/ui/screens/AccountSwitcherScreen.js.map +1 -1
- package/lib/module/ui/screens/AppInfoScreen.js +1 -1
- package/lib/module/ui/screens/AppInfoScreen.js.map +1 -1
- package/lib/module/ui/screens/FileManagementScreen.js +633 -432
- package/lib/module/ui/screens/FileManagementScreen.js.map +1 -1
- package/lib/module/ui/screens/PaymentGatewayScreen.js +1 -1
- package/lib/module/ui/screens/PaymentGatewayScreen.js.map +1 -1
- package/lib/module/ui/screens/PremiumSubscriptionScreen.js +1 -1
- package/lib/module/ui/screens/PremiumSubscriptionScreen.js.map +1 -1
- package/lib/module/ui/screens/ProfileScreen.js +1 -1
- package/lib/module/ui/screens/ProfileScreen.js.map +1 -1
- package/lib/module/ui/screens/RecoverAccountScreen.js +1 -1
- package/lib/module/ui/screens/RecoverAccountScreen.js.map +1 -1
- package/lib/module/ui/screens/SessionManagementScreen.js +1 -1
- package/lib/module/ui/screens/SessionManagementScreen.js.map +1 -1
- package/lib/module/ui/screens/SignInScreen.js +1 -1
- package/lib/module/ui/screens/SignInScreen.js.map +1 -1
- package/lib/module/ui/screens/UserLinksScreen.js +0 -1
- package/lib/module/ui/screens/UserLinksScreen.js.map +1 -1
- package/lib/module/ui/screens/internal/SignInPasswordStep.js +1 -1
- package/lib/module/ui/screens/internal/SignInPasswordStep.js.map +1 -1
- package/lib/module/ui/screens/internal/SignInUsernameStep.js +1 -1
- package/lib/module/ui/screens/internal/SignInUsernameStep.js.map +1 -1
- package/lib/module/ui/screens/internal/SignUpIdentityStep.js +1 -1
- package/lib/module/ui/screens/internal/SignUpIdentityStep.js.map +1 -1
- package/lib/module/ui/screens/internal/SignUpSecurityStep.js +1 -1
- package/lib/module/ui/screens/internal/SignUpSecurityStep.js.map +1 -1
- package/lib/module/ui/screens/internal/SignUpSummaryStep.js +0 -1
- package/lib/module/ui/screens/internal/SignUpSummaryStep.js.map +1 -1
- package/lib/module/ui/screens/internal/SignUpWelcomeStep.js +0 -1
- package/lib/module/ui/screens/internal/SignUpWelcomeStep.js.map +1 -1
- package/lib/module/ui/screens/karma/KarmaAboutScreen.js +0 -1
- package/lib/module/ui/screens/karma/KarmaAboutScreen.js.map +1 -1
- package/lib/module/ui/screens/karma/KarmaCenterScreen.js +1 -1
- package/lib/module/ui/screens/karma/KarmaCenterScreen.js.map +1 -1
- package/lib/module/ui/screens/karma/KarmaLeaderboardScreen.js +1 -1
- package/lib/module/ui/screens/karma/KarmaLeaderboardScreen.js.map +1 -1
- package/lib/module/ui/screens/karma/KarmaRewardsScreen.js +0 -1
- package/lib/module/ui/screens/karma/KarmaRewardsScreen.js.map +1 -1
- package/lib/module/ui/screens/karma/KarmaRulesScreen.js +1 -1
- package/lib/module/ui/screens/karma/KarmaRulesScreen.js.map +1 -1
- package/lib/module/ui/stores/assetStore.js +212 -0
- package/lib/module/ui/stores/assetStore.js.map +1 -0
- package/lib/module/ui/stores/authStore.js +1 -1
- package/lib/module/ui/stores/authStore.js.map +1 -1
- package/lib/module/ui/stores/fileStore.js +145 -0
- package/lib/module/ui/stores/fileStore.js.map +1 -0
- package/lib/module/ui/stores/followStore.js +2 -2
- package/lib/module/ui/stores/followStore.js.map +1 -1
- package/lib/module/ui/styles/fonts.js.map +1 -1
- package/lib/module/ui/styles/theme.js.map +1 -1
- package/lib/module/utils/asyncUtils.js +1 -1
- package/lib/module/utils/asyncUtils.js.map +1 -1
- package/lib/module/utils/errorUtils.js +19 -11
- package/lib/module/utils/errorUtils.js.map +1 -1
- package/lib/module/utils/hookUtils.js +1 -1
- package/lib/module/utils/hookUtils.js.map +1 -1
- package/lib/module/utils/loggerUtils.js.map +1 -1
- package/lib/module/utils/validationUtils.js +2 -2
- package/lib/module/utils/validationUtils.js.map +1 -1
- package/lib/typescript/assets/icons/OxyServices.d.ts +2 -2
- package/lib/typescript/assets/icons/OxyServices.d.ts.map +1 -1
- package/lib/typescript/assets/illustrations/HighFive.d.ts +1 -1
- package/lib/typescript/assets/illustrations/HighFive.d.ts.map +1 -1
- package/lib/typescript/core/OxyServices.d.ts +69 -12
- package/lib/typescript/core/OxyServices.d.ts.map +1 -1
- package/lib/typescript/core/index.d.ts +1 -1
- package/lib/typescript/core/index.d.ts.map +1 -1
- package/lib/typescript/index.d.ts +4 -2
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/lib/sonner-safe.d.ts +2 -1
- package/lib/typescript/lib/sonner-safe.d.ts.map +1 -1
- package/lib/typescript/lib/sonner.d.ts +11 -3
- package/lib/typescript/lib/sonner.d.ts.map +1 -1
- package/lib/typescript/models/interfaces.d.ts +105 -6
- package/lib/typescript/models/interfaces.d.ts.map +1 -1
- package/lib/typescript/node/index.d.ts +2 -2
- package/lib/typescript/node/index.d.ts.map +1 -1
- package/lib/typescript/types/expo-vector-icons.d.ts +8 -1
- package/lib/typescript/types/express.d.ts +22 -3
- package/lib/typescript/ui/components/Avatar.d.ts +2 -2
- package/lib/typescript/ui/components/Avatar.d.ts.map +1 -1
- package/lib/typescript/ui/components/FollowButton.d.ts +2 -2
- package/lib/typescript/ui/components/FollowButton.d.ts.map +1 -1
- package/lib/typescript/ui/components/FontLoader.d.ts +1 -1
- package/lib/typescript/ui/components/FontLoader.d.ts.map +1 -1
- package/lib/typescript/ui/components/GroupedItem.d.ts +2 -1
- package/lib/typescript/ui/components/GroupedItem.d.ts.map +1 -1
- package/lib/typescript/ui/components/GroupedSection.d.ts +2 -1
- package/lib/typescript/ui/components/GroupedSection.d.ts.map +1 -1
- package/lib/typescript/ui/components/Header.d.ts +1 -1
- package/lib/typescript/ui/components/Header.d.ts.map +1 -1
- package/lib/typescript/ui/components/OxyLogo.d.ts +2 -2
- package/lib/typescript/ui/components/OxyLogo.d.ts.map +1 -1
- package/lib/typescript/ui/components/OxyPayButton.d.ts +2 -2
- package/lib/typescript/ui/components/OxyPayButton.d.ts.map +1 -1
- package/lib/typescript/ui/components/OxyProvider.d.ts +2 -2
- package/lib/typescript/ui/components/OxyProvider.d.ts.map +1 -1
- package/lib/typescript/ui/components/OxySignInButton.d.ts +2 -2
- package/lib/typescript/ui/components/OxySignInButton.d.ts.map +1 -1
- package/lib/typescript/ui/components/ProfileCard.d.ts +1 -1
- package/lib/typescript/ui/components/ProfileCard.d.ts.map +1 -1
- package/lib/typescript/ui/components/QuickActions.d.ts +1 -1
- package/lib/typescript/ui/components/QuickActions.d.ts.map +1 -1
- package/lib/typescript/ui/components/Section.d.ts +1 -1
- package/lib/typescript/ui/components/Section.d.ts.map +1 -1
- package/lib/typescript/ui/components/SectionTitle.d.ts +1 -1
- package/lib/typescript/ui/components/SectionTitle.d.ts.map +1 -1
- package/lib/typescript/ui/components/icon/FAIRWalletIcon.d.ts +1 -1
- package/lib/typescript/ui/components/icon/FAIRWalletIcon.d.ts.map +1 -1
- package/lib/typescript/ui/components/icon/OxyIcon.d.ts +1 -1
- package/lib/typescript/ui/components/icon/OxyIcon.d.ts.map +1 -1
- package/lib/typescript/ui/components/internal/GroupedPillButtons.d.ts +1 -1
- package/lib/typescript/ui/components/internal/GroupedPillButtons.d.ts.map +1 -1
- package/lib/typescript/ui/components/internal/PinInput.d.ts +1 -1
- package/lib/typescript/ui/components/internal/PinInput.d.ts.map +1 -1
- package/lib/typescript/ui/components/internal/TextField.d.ts +1 -1
- package/lib/typescript/ui/components/internal/TextField.d.ts.map +1 -1
- package/lib/typescript/ui/context/OxyContext.d.ts +3 -3
- package/lib/typescript/ui/context/OxyContext.d.ts.map +1 -1
- package/lib/typescript/ui/hooks/useAssets.d.ts +35 -0
- package/lib/typescript/ui/hooks/useAssets.d.ts.map +1 -0
- package/lib/typescript/ui/navigation/OxyRouter.d.ts +2 -2
- package/lib/typescript/ui/navigation/OxyRouter.d.ts.map +1 -1
- package/lib/typescript/ui/navigation/types.d.ts +7 -7
- package/lib/typescript/ui/navigation/types.d.ts.map +1 -1
- package/lib/typescript/ui/screens/AccountCenterScreen.d.ts +2 -2
- package/lib/typescript/ui/screens/AccountCenterScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/AccountManagementDemo.d.ts +1 -1
- package/lib/typescript/ui/screens/AccountManagementDemo.d.ts.map +1 -1
- package/lib/typescript/ui/screens/AccountOverviewScreen.d.ts +1 -1
- package/lib/typescript/ui/screens/AccountOverviewScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/AccountSettingsScreen.d.ts +1 -1
- package/lib/typescript/ui/screens/AccountSettingsScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/AccountSwitcherScreen.d.ts +2 -2
- package/lib/typescript/ui/screens/AccountSwitcherScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/AppInfoScreen.d.ts +2 -2
- package/lib/typescript/ui/screens/AppInfoScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/FeedbackScreen.d.ts +1 -1
- package/lib/typescript/ui/screens/FeedbackScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/FileManagementScreen.d.ts +1 -1
- package/lib/typescript/ui/screens/FileManagementScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/PaymentGatewayScreen.d.ts +2 -2
- package/lib/typescript/ui/screens/PaymentGatewayScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/PremiumSubscriptionScreen.d.ts +2 -2
- package/lib/typescript/ui/screens/PremiumSubscriptionScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/ProfileScreen.d.ts +2 -2
- package/lib/typescript/ui/screens/ProfileScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/RecoverAccountScreen.d.ts +1 -1
- package/lib/typescript/ui/screens/RecoverAccountScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/SessionManagementScreen.d.ts +2 -2
- package/lib/typescript/ui/screens/SessionManagementScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/SignInScreen.d.ts +2 -2
- package/lib/typescript/ui/screens/SignInScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/SignUpScreen.d.ts +1 -1
- package/lib/typescript/ui/screens/SignUpScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/UserLinksScreen.d.ts +2 -2
- package/lib/typescript/ui/screens/UserLinksScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/internal/SignInPasswordStep.d.ts +1 -1
- package/lib/typescript/ui/screens/internal/SignInPasswordStep.d.ts.map +1 -1
- package/lib/typescript/ui/screens/internal/SignInUsernameStep.d.ts +1 -1
- package/lib/typescript/ui/screens/internal/SignInUsernameStep.d.ts.map +1 -1
- package/lib/typescript/ui/screens/internal/SignUpIdentityStep.d.ts +1 -1
- package/lib/typescript/ui/screens/internal/SignUpIdentityStep.d.ts.map +1 -1
- package/lib/typescript/ui/screens/internal/SignUpSecurityStep.d.ts +1 -1
- package/lib/typescript/ui/screens/internal/SignUpSecurityStep.d.ts.map +1 -1
- package/lib/typescript/ui/screens/internal/SignUpSummaryStep.d.ts +1 -1
- package/lib/typescript/ui/screens/internal/SignUpSummaryStep.d.ts.map +1 -1
- package/lib/typescript/ui/screens/internal/SignUpWelcomeStep.d.ts +1 -1
- package/lib/typescript/ui/screens/internal/SignUpWelcomeStep.d.ts.map +1 -1
- package/lib/typescript/ui/screens/karma/KarmaAboutScreen.d.ts +2 -2
- package/lib/typescript/ui/screens/karma/KarmaAboutScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/karma/KarmaCenterScreen.d.ts +2 -2
- package/lib/typescript/ui/screens/karma/KarmaCenterScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/karma/KarmaFAQScreen.d.ts +1 -1
- package/lib/typescript/ui/screens/karma/KarmaFAQScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/karma/KarmaLeaderboardScreen.d.ts +2 -2
- package/lib/typescript/ui/screens/karma/KarmaLeaderboardScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/karma/KarmaRewardsScreen.d.ts +2 -2
- package/lib/typescript/ui/screens/karma/KarmaRewardsScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/karma/KarmaRulesScreen.d.ts +2 -2
- package/lib/typescript/ui/screens/karma/KarmaRulesScreen.d.ts.map +1 -1
- package/lib/typescript/ui/stores/assetStore.d.ts +54 -0
- package/lib/typescript/ui/stores/assetStore.d.ts.map +1 -0
- package/lib/typescript/ui/stores/fileStore.d.ts +31 -0
- package/lib/typescript/ui/stores/fileStore.d.ts.map +1 -0
- package/lib/typescript/ui/stores/followStore.d.ts +1 -1
- package/lib/typescript/ui/stores/followStore.d.ts.map +1 -1
- package/lib/typescript/ui/styles/fonts.d.ts +1 -1
- package/lib/typescript/ui/styles/fonts.d.ts.map +1 -1
- package/lib/typescript/ui/styles/theme.d.ts +1 -1
- package/lib/typescript/ui/styles/theme.d.ts.map +1 -1
- package/lib/typescript/utils/asyncUtils.d.ts.map +1 -1
- package/lib/typescript/utils/errorUtils.d.ts +5 -5
- package/lib/typescript/utils/errorUtils.d.ts.map +1 -1
- package/lib/typescript/utils/hookUtils.d.ts +4 -4
- package/lib/typescript/utils/hookUtils.d.ts.map +1 -1
- package/lib/typescript/utils/loggerUtils.d.ts +18 -18
- package/lib/typescript/utils/loggerUtils.d.ts.map +1 -1
- package/lib/typescript/utils/validationUtils.d.ts +6 -6
- package/lib/typescript/utils/validationUtils.d.ts.map +1 -1
- package/package.json +149 -143
- package/src/assets/icons/OxyServices.tsx +2 -2
- package/src/assets/illustrations/HighFive.tsx +1 -1
- package/src/core/OxyServices.ts +268 -41
- package/src/core/__tests__/OxyServices.test.ts +180 -0
- package/src/core/index.ts +1 -1
- package/src/index.ts +16 -2
- package/src/lib/sonner-safe.ts +4 -1
- package/src/lib/sonner.ts +19 -2
- package/src/models/interfaces.ts +117 -6
- package/src/node/index.ts +2 -2
- package/src/types/expo-vector-icons.d.ts +8 -1
- package/src/types/express.d.ts +22 -3
- package/src/ui/components/Avatar.tsx +2 -2
- package/src/ui/components/FollowButton.tsx +10 -8
- package/src/ui/components/FontLoader.tsx +5 -3
- package/src/ui/components/GroupedItem.tsx +12 -2
- package/src/ui/components/GroupedSection.tsx +3 -1
- package/src/ui/components/Header.tsx +1 -1
- package/src/ui/components/OxyLogo.tsx +2 -2
- package/src/ui/components/OxyPayButton.tsx +6 -5
- package/src/ui/components/OxyProvider.tsx +7 -4
- package/src/ui/components/OxySignInButton.tsx +2 -2
- package/src/ui/components/ProfileCard.tsx +1 -1
- package/src/ui/components/QuickActions.tsx +1 -1
- package/src/ui/components/Section.tsx +1 -1
- package/src/ui/components/SectionTitle.tsx +1 -1
- package/src/ui/components/icon/FAIRWalletIcon.tsx +1 -1
- package/src/ui/components/icon/OxyIcon.tsx +1 -1
- package/src/ui/components/internal/GroupedPillButtons.tsx +1 -1
- package/src/ui/components/internal/PinInput.tsx +3 -2
- package/src/ui/components/internal/TextField.tsx +9 -11
- package/src/ui/context/OxyContext.tsx +3 -3
- package/src/ui/hooks/useAssets.ts +306 -0
- package/src/ui/navigation/OxyRouter.tsx +3 -2
- package/src/ui/navigation/types.ts +8 -8
- package/src/ui/screens/AccountCenterScreen.tsx +2 -2
- package/src/ui/screens/AccountManagementDemo.tsx +1 -1
- package/src/ui/screens/AccountOverviewScreen.tsx +1 -1
- package/src/ui/screens/AccountSettingsScreen.tsx +3 -3
- package/src/ui/screens/AccountSwitcherScreen.tsx +9 -8
- package/src/ui/screens/AppInfoScreen.tsx +3 -2
- package/src/ui/screens/FeedbackScreen.tsx +1 -1
- package/src/ui/screens/FileManagementScreen.tsx +619 -494
- package/src/ui/screens/PaymentGatewayScreen.tsx +3 -2
- package/src/ui/screens/PremiumSubscriptionScreen.tsx +3 -2
- package/src/ui/screens/ProfileScreen.tsx +3 -2
- package/src/ui/screens/RecoverAccountScreen.tsx +3 -2
- package/src/ui/screens/SessionManagementScreen.tsx +4 -3
- package/src/ui/screens/SignInScreen.tsx +3 -2
- package/src/ui/screens/SignUpScreen.tsx +1 -1
- package/src/ui/screens/UserLinksScreen.tsx +2 -2
- package/src/ui/screens/internal/SignInPasswordStep.tsx +3 -2
- package/src/ui/screens/internal/SignInUsernameStep.tsx +3 -2
- package/src/ui/screens/internal/SignUpIdentityStep.tsx +3 -2
- package/src/ui/screens/internal/SignUpSecurityStep.tsx +3 -2
- package/src/ui/screens/internal/SignUpSummaryStep.tsx +1 -1
- package/src/ui/screens/internal/SignUpWelcomeStep.tsx +1 -1
- package/src/ui/screens/karma/KarmaAboutScreen.tsx +2 -2
- package/src/ui/screens/karma/KarmaCenterScreen.tsx +3 -2
- package/src/ui/screens/karma/KarmaFAQScreen.tsx +1 -1
- package/src/ui/screens/karma/KarmaLeaderboardScreen.tsx +3 -2
- package/src/ui/screens/karma/KarmaRewardsScreen.tsx +2 -2
- package/src/ui/screens/karma/KarmaRulesScreen.tsx +3 -2
- package/src/ui/stores/assetStore.ts +281 -0
- package/src/ui/stores/authStore.ts +1 -1
- package/src/ui/stores/fileStore.ts +118 -0
- package/src/ui/stores/followStore.ts +4 -4
- package/src/ui/styles/fonts.ts +1 -1
- package/src/ui/styles/theme.ts +1 -1
- package/src/utils/__tests__/validationUtils.test.ts +236 -0
- package/src/utils/asyncUtils.ts +4 -4
- package/src/utils/errorUtils.ts +35 -23
- package/src/utils/hookUtils.ts +7 -7
- package/src/utils/loggerUtils.ts +18 -18
- package/src/utils/validationUtils.ts +8 -8
|
@@ -0,0 +1,306 @@
|
|
|
1
|
+
import { useCallback } from 'react';
|
|
2
|
+
import { useAssetStore } from '../stores/assetStore';
|
|
3
|
+
import { OxyServices } from '../../core/OxyServices';
|
|
4
|
+
import {
|
|
5
|
+
Asset,
|
|
6
|
+
AssetLinkRequest,
|
|
7
|
+
AssetUnlinkRequest,
|
|
8
|
+
AssetUploadProgress
|
|
9
|
+
} from '../../models/interfaces';
|
|
10
|
+
|
|
11
|
+
// Create a singleton instance for the hook
|
|
12
|
+
let oxyInstance: OxyServices | null = null;
|
|
13
|
+
|
|
14
|
+
export const setOxyAssetInstance = (instance: OxyServices) => {
|
|
15
|
+
oxyInstance = instance;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Hook for managing assets with Zustand store integration
|
|
20
|
+
*/
|
|
21
|
+
export const useAssets = () => {
|
|
22
|
+
const {
|
|
23
|
+
assets,
|
|
24
|
+
uploadProgress,
|
|
25
|
+
loading,
|
|
26
|
+
errors,
|
|
27
|
+
setAsset,
|
|
28
|
+
setAssets,
|
|
29
|
+
removeAsset,
|
|
30
|
+
setUploadProgress,
|
|
31
|
+
removeUploadProgress,
|
|
32
|
+
addLink,
|
|
33
|
+
removeLink,
|
|
34
|
+
setUploading,
|
|
35
|
+
setLinking,
|
|
36
|
+
setDeleting,
|
|
37
|
+
setUploadError,
|
|
38
|
+
setLinkError,
|
|
39
|
+
setDeleteError,
|
|
40
|
+
clearErrors,
|
|
41
|
+
getAssetsByApp,
|
|
42
|
+
getAssetsByEntity,
|
|
43
|
+
getAssetUsageCount,
|
|
44
|
+
isAssetLinked,
|
|
45
|
+
reset
|
|
46
|
+
} = useAssetStore();
|
|
47
|
+
|
|
48
|
+
// Upload asset with progress tracking
|
|
49
|
+
const upload = useCallback(async (
|
|
50
|
+
file: File,
|
|
51
|
+
metadata?: Record<string, any>
|
|
52
|
+
): Promise<Asset | null> => {
|
|
53
|
+
if (!oxyInstance) {
|
|
54
|
+
throw new Error('OxyServices instance not configured. Call setOxyAssetInstance first.');
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
try {
|
|
58
|
+
clearErrors();
|
|
59
|
+
setUploading(true);
|
|
60
|
+
|
|
61
|
+
// Calculate SHA256 for progress tracking
|
|
62
|
+
const sha256 = await oxyInstance.calculateSHA256(file);
|
|
63
|
+
|
|
64
|
+
// Initialize progress tracking
|
|
65
|
+
const initialProgress: AssetUploadProgress = {
|
|
66
|
+
fileId: '', // Will be set after init
|
|
67
|
+
uploaded: 0,
|
|
68
|
+
total: file.size,
|
|
69
|
+
percentage: 0,
|
|
70
|
+
status: 'uploading'
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
// Upload with progress callback
|
|
74
|
+
const result = await oxyInstance.assetUpload(file, metadata, (percentage) => {
|
|
75
|
+
if (initialProgress.fileId) {
|
|
76
|
+
setUploadProgress(initialProgress.fileId, {
|
|
77
|
+
...initialProgress,
|
|
78
|
+
uploaded: Math.round((percentage / 100) * file.size),
|
|
79
|
+
percentage,
|
|
80
|
+
status: percentage < 100 ? 'uploading' : 'processing'
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
// Update progress with final status
|
|
86
|
+
if (result.file && initialProgress.fileId) {
|
|
87
|
+
setUploadProgress(initialProgress.fileId, {
|
|
88
|
+
...initialProgress,
|
|
89
|
+
fileId: result.file.id,
|
|
90
|
+
uploaded: file.size,
|
|
91
|
+
percentage: 100,
|
|
92
|
+
status: 'complete'
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
// Remove progress after a short delay
|
|
96
|
+
setTimeout(() => {
|
|
97
|
+
removeUploadProgress(result.file.id);
|
|
98
|
+
}, 2000);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
// Add asset to store
|
|
102
|
+
if (result.file) {
|
|
103
|
+
setAsset(result.file);
|
|
104
|
+
return result.file;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
return null;
|
|
108
|
+
} catch (error: any) {
|
|
109
|
+
setUploadError(error.message || 'Upload failed');
|
|
110
|
+
throw error;
|
|
111
|
+
} finally {
|
|
112
|
+
setUploading(false);
|
|
113
|
+
}
|
|
114
|
+
}, [
|
|
115
|
+
clearErrors,
|
|
116
|
+
setUploading,
|
|
117
|
+
setUploadProgress,
|
|
118
|
+
removeUploadProgress,
|
|
119
|
+
setAsset,
|
|
120
|
+
setUploadError
|
|
121
|
+
]);
|
|
122
|
+
|
|
123
|
+
// Link asset to entity
|
|
124
|
+
const link = useCallback(async (
|
|
125
|
+
assetId: string,
|
|
126
|
+
app: string,
|
|
127
|
+
entityType: string,
|
|
128
|
+
entityId: string
|
|
129
|
+
): Promise<void> => {
|
|
130
|
+
if (!oxyInstance) {
|
|
131
|
+
throw new Error('OxyServices instance not configured. Call setOxyAssetInstance first.');
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
try {
|
|
135
|
+
clearErrors();
|
|
136
|
+
setLinking(true);
|
|
137
|
+
|
|
138
|
+
const result = await oxyInstance.assetLink(assetId, app, entityType, entityId);
|
|
139
|
+
|
|
140
|
+
if (result.file) {
|
|
141
|
+
setAsset(result.file);
|
|
142
|
+
} else {
|
|
143
|
+
// If API doesn't return full file, update store optimistically
|
|
144
|
+
addLink(assetId, {
|
|
145
|
+
app,
|
|
146
|
+
entityType,
|
|
147
|
+
entityId,
|
|
148
|
+
createdBy: '', // Will be filled by server
|
|
149
|
+
createdAt: new Date().toISOString()
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
} catch (error: any) {
|
|
153
|
+
setLinkError(error.message || 'Link failed');
|
|
154
|
+
throw error;
|
|
155
|
+
} finally {
|
|
156
|
+
setLinking(false);
|
|
157
|
+
}
|
|
158
|
+
}, [clearErrors, setLinking, setAsset, addLink, setLinkError]);
|
|
159
|
+
|
|
160
|
+
// Unlink asset from entity
|
|
161
|
+
const unlink = useCallback(async (
|
|
162
|
+
assetId: string,
|
|
163
|
+
app: string,
|
|
164
|
+
entityType: string,
|
|
165
|
+
entityId: string
|
|
166
|
+
): Promise<void> => {
|
|
167
|
+
if (!oxyInstance) {
|
|
168
|
+
throw new Error('OxyServices instance not configured. Call setOxyAssetInstance first.');
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
try {
|
|
172
|
+
clearErrors();
|
|
173
|
+
setLinking(true);
|
|
174
|
+
|
|
175
|
+
const result = await oxyInstance.assetUnlink(assetId, app, entityType, entityId);
|
|
176
|
+
|
|
177
|
+
if (result.file) {
|
|
178
|
+
setAsset(result.file);
|
|
179
|
+
} else {
|
|
180
|
+
// Update store optimistically
|
|
181
|
+
removeLink(assetId, app, entityType, entityId);
|
|
182
|
+
}
|
|
183
|
+
} catch (error: any) {
|
|
184
|
+
setLinkError(error.message || 'Unlink failed');
|
|
185
|
+
throw error;
|
|
186
|
+
} finally {
|
|
187
|
+
setLinking(false);
|
|
188
|
+
}
|
|
189
|
+
}, [clearErrors, setLinking, setAsset, removeLink, setLinkError]);
|
|
190
|
+
|
|
191
|
+
// Get asset URL
|
|
192
|
+
const getUrl = useCallback(async (
|
|
193
|
+
assetId: string,
|
|
194
|
+
variant?: string,
|
|
195
|
+
expiresIn?: number
|
|
196
|
+
): Promise<string> => {
|
|
197
|
+
if (!oxyInstance) {
|
|
198
|
+
throw new Error('OxyServices instance not configured. Call setOxyAssetInstance first.');
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
try {
|
|
202
|
+
const result = await oxyInstance.assetGetUrl(assetId, variant, expiresIn);
|
|
203
|
+
return result.url;
|
|
204
|
+
} catch (error: any) {
|
|
205
|
+
throw error;
|
|
206
|
+
}
|
|
207
|
+
}, []);
|
|
208
|
+
|
|
209
|
+
// Get asset metadata
|
|
210
|
+
const getAsset = useCallback(async (assetId: string): Promise<Asset> => {
|
|
211
|
+
if (!oxyInstance) {
|
|
212
|
+
throw new Error('OxyServices instance not configured. Call setOxyAssetInstance first.');
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
try {
|
|
216
|
+
const result = await oxyInstance.assetGet(assetId);
|
|
217
|
+
if (result.file) {
|
|
218
|
+
setAsset(result.file);
|
|
219
|
+
return result.file;
|
|
220
|
+
}
|
|
221
|
+
throw new Error('Asset not found');
|
|
222
|
+
} catch (error: any) {
|
|
223
|
+
throw error;
|
|
224
|
+
}
|
|
225
|
+
}, [setAsset]);
|
|
226
|
+
|
|
227
|
+
// Delete asset
|
|
228
|
+
const deleteAsset = useCallback(async (
|
|
229
|
+
assetId: string,
|
|
230
|
+
force: boolean = false
|
|
231
|
+
): Promise<void> => {
|
|
232
|
+
if (!oxyInstance) {
|
|
233
|
+
throw new Error('OxyServices instance not configured. Call setOxyAssetInstance first.');
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
try {
|
|
237
|
+
clearErrors();
|
|
238
|
+
setDeleting(true);
|
|
239
|
+
|
|
240
|
+
await oxyInstance.assetDelete(assetId, force);
|
|
241
|
+
removeAsset(assetId);
|
|
242
|
+
} catch (error: any) {
|
|
243
|
+
setDeleteError(error.message || 'Delete failed');
|
|
244
|
+
throw error;
|
|
245
|
+
} finally {
|
|
246
|
+
setDeleting(false);
|
|
247
|
+
}
|
|
248
|
+
}, [clearErrors, setDeleting, removeAsset, setDeleteError]);
|
|
249
|
+
|
|
250
|
+
// Restore asset from trash
|
|
251
|
+
const restore = useCallback(async (assetId: string): Promise<void> => {
|
|
252
|
+
if (!oxyInstance) {
|
|
253
|
+
throw new Error('OxyServices instance not configured. Call setOxyAssetInstance first.');
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
try {
|
|
257
|
+
const result = await oxyInstance.assetRestore(assetId);
|
|
258
|
+
if (result.file) {
|
|
259
|
+
setAsset(result.file);
|
|
260
|
+
}
|
|
261
|
+
} catch (error: any) {
|
|
262
|
+
throw error;
|
|
263
|
+
}
|
|
264
|
+
}, [setAsset]);
|
|
265
|
+
|
|
266
|
+
// Get variants
|
|
267
|
+
const getVariants = useCallback(async (assetId: string) => {
|
|
268
|
+
if (!oxyInstance) {
|
|
269
|
+
throw new Error('OxyServices instance not configured. Call setOxyAssetInstance first.');
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
try {
|
|
273
|
+
return await oxyInstance.assetGetVariants(assetId);
|
|
274
|
+
} catch (error: any) {
|
|
275
|
+
throw error;
|
|
276
|
+
}
|
|
277
|
+
}, []);
|
|
278
|
+
|
|
279
|
+
return {
|
|
280
|
+
// State
|
|
281
|
+
assets: Object.values(assets),
|
|
282
|
+
uploadProgress,
|
|
283
|
+
loading,
|
|
284
|
+
errors,
|
|
285
|
+
|
|
286
|
+
// Actions
|
|
287
|
+
upload,
|
|
288
|
+
link,
|
|
289
|
+
unlink,
|
|
290
|
+
getUrl,
|
|
291
|
+
getAsset,
|
|
292
|
+
deleteAsset,
|
|
293
|
+
restore,
|
|
294
|
+
getVariants,
|
|
295
|
+
|
|
296
|
+
// Utility methods
|
|
297
|
+
getAssetsByApp,
|
|
298
|
+
getAssetsByEntity,
|
|
299
|
+
getAssetUsageCount,
|
|
300
|
+
isAssetLinked,
|
|
301
|
+
|
|
302
|
+
// Store management
|
|
303
|
+
clearErrors,
|
|
304
|
+
reset
|
|
305
|
+
};
|
|
306
|
+
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import { useState, useEffect, useCallback } from 'react';
|
|
2
3
|
import { View, StyleSheet } from 'react-native';
|
|
3
4
|
import { OxyServices } from '../../core';
|
|
4
5
|
|
|
@@ -26,7 +27,7 @@ import RecoverAccountScreen from '../screens/RecoverAccountScreen';
|
|
|
26
27
|
import PaymentGatewayScreen from '../screens/PaymentGatewayScreen';
|
|
27
28
|
|
|
28
29
|
// Import types
|
|
29
|
-
import { OxyRouterProps, RouteConfig } from './types';
|
|
30
|
+
import type { OxyRouterProps, RouteConfig } from './types';
|
|
30
31
|
|
|
31
32
|
// Define route configuration with screen components and default snap points
|
|
32
33
|
const routes: Record<string, RouteConfig> = {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { OxyServices } from '../../core';
|
|
2
|
-
import { User } from '../../models/interfaces';
|
|
3
|
-
import { ComponentType, ReactNode } from 'react';
|
|
1
|
+
import type { OxyServices } from '../../core';
|
|
2
|
+
import type { User } from '../../models/interfaces';
|
|
3
|
+
import type { ComponentType, ReactNode } from 'react';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Base props for all screens in the Oxy UI system
|
|
7
7
|
*/
|
|
8
8
|
export interface BaseScreenProps {
|
|
9
9
|
oxyServices: OxyServices;
|
|
10
|
-
navigate: (screen: string, props?:
|
|
10
|
+
navigate: (screen: string, props?: Record<string, unknown>) => void;
|
|
11
11
|
goBack: () => void;
|
|
12
12
|
onClose?: () => void;
|
|
13
13
|
onAuthenticated?: (user: User) => void;
|
|
@@ -15,14 +15,14 @@ export interface BaseScreenProps {
|
|
|
15
15
|
containerWidth?: number;
|
|
16
16
|
initialStep?: number;
|
|
17
17
|
username?: string;
|
|
18
|
-
userProfile?:
|
|
18
|
+
userProfile?: User;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
/**
|
|
22
22
|
* Route configuration for OxyRouter
|
|
23
23
|
*/
|
|
24
24
|
export interface RouteConfig {
|
|
25
|
-
component: ComponentType<any>;
|
|
25
|
+
component: ComponentType<any>; // Allow any component type for flexibility
|
|
26
26
|
snapPoints: string[];
|
|
27
27
|
}
|
|
28
28
|
|
|
@@ -36,7 +36,7 @@ export interface OxyRouterProps {
|
|
|
36
36
|
onAuthenticated?: (user: User) => void;
|
|
37
37
|
theme: 'light' | 'dark';
|
|
38
38
|
adjustSnapPoints?: (snapPoints: string[]) => void;
|
|
39
|
-
navigationRef?: React.MutableRefObject<((screen: string, props?: Record<string,
|
|
39
|
+
navigationRef?: React.MutableRefObject<((screen: string, props?: Record<string, unknown>) => void) | null>;
|
|
40
40
|
containerWidth?: number;
|
|
41
41
|
}
|
|
42
42
|
|
|
@@ -82,7 +82,7 @@ export interface OxyProviderProps {
|
|
|
82
82
|
* @deprecated External bottom sheet ref is no longer required as OxyProvider handles the bottom sheet internally
|
|
83
83
|
* @hidden
|
|
84
84
|
*/
|
|
85
|
-
bottomSheetRef?: React.RefObject<
|
|
85
|
+
bottomSheetRef?: React.RefObject<unknown>;
|
|
86
86
|
|
|
87
87
|
/**
|
|
88
88
|
* Whether to automatically present the bottom sheet when component mounts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import type React from 'react';
|
|
2
2
|
import {
|
|
3
3
|
View,
|
|
4
4
|
Text,
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
Alert,
|
|
10
10
|
Platform,
|
|
11
11
|
} from 'react-native';
|
|
12
|
-
import { BaseScreenProps } from '../navigation/types';
|
|
12
|
+
import type { BaseScreenProps } from '../navigation/types';
|
|
13
13
|
import { useOxy } from '../context/OxyContext';
|
|
14
14
|
import { packageInfo } from '../../constants/version';
|
|
15
15
|
import { toast } from '../../lib/sonner';
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
Image,
|
|
12
12
|
TextStyle,
|
|
13
13
|
} from 'react-native';
|
|
14
|
-
import { BaseScreenProps } from '../navigation/types';
|
|
14
|
+
import type { BaseScreenProps } from '../navigation/types';
|
|
15
15
|
import { useOxy } from '../context/OxyContext';
|
|
16
16
|
import OxyLogo from '../components/OxyLogo';
|
|
17
17
|
import Avatar from '../components/Avatar';
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
Platform,
|
|
13
13
|
Image,
|
|
14
14
|
} from 'react-native';
|
|
15
|
-
import { BaseScreenProps } from '../navigation/types';
|
|
15
|
+
import type { BaseScreenProps } from '../navigation/types';
|
|
16
16
|
import { useOxy } from '../context/OxyContext';
|
|
17
17
|
import Avatar from '../components/Avatar';
|
|
18
18
|
import OxyIcon from '../components/icon/OxyIcon';
|
|
@@ -363,8 +363,8 @@ const AccountSettingsScreen: React.FC<BaseScreenProps> = ({
|
|
|
363
363
|
locationData.type === 'country' ? 'Country' :
|
|
364
364
|
locationData.type === 'state' ? 'State' : 'Location',
|
|
365
365
|
coordinates: {
|
|
366
|
-
lat: parseFloat(locationData.lat),
|
|
367
|
-
lon: parseFloat(locationData.lon)
|
|
366
|
+
lat: Number.parseFloat(locationData.lat),
|
|
367
|
+
lon: Number.parseFloat(locationData.lon)
|
|
368
368
|
}
|
|
369
369
|
};
|
|
370
370
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import { useState, useEffect } from 'react';
|
|
2
3
|
import {
|
|
3
4
|
View,
|
|
4
5
|
Text,
|
|
@@ -11,11 +12,11 @@ import {
|
|
|
11
12
|
Image,
|
|
12
13
|
Dimensions,
|
|
13
14
|
} from 'react-native';
|
|
14
|
-
import { BaseScreenProps } from '../navigation/types';
|
|
15
|
+
import type { BaseScreenProps } from '../navigation/types';
|
|
15
16
|
import { useOxy } from '../context/OxyContext';
|
|
16
|
-
import { ClientSession } from '../../models/session';
|
|
17
|
+
import type { ClientSession } from '../../models/session';
|
|
17
18
|
import { fontFamilies } from '../styles/fonts';
|
|
18
|
-
import { User } from '../../models/interfaces';
|
|
19
|
+
import type { User } from '../../models/interfaces';
|
|
19
20
|
import { toast } from '../../lib/sonner';
|
|
20
21
|
import { confirmAction } from '../utils/confirmAction';
|
|
21
22
|
import OxyIcon from '../components/icon/OxyIcon';
|
|
@@ -196,12 +197,12 @@ const ModernAccountSwitcherScreen: React.FC<BaseScreenProps> = ({
|
|
|
196
197
|
|
|
197
198
|
// Device session management functions
|
|
198
199
|
const loadAllDeviceSessions = async () => {
|
|
199
|
-
if (!oxyServices || !
|
|
200
|
+
if (!oxyServices || !activeSessionId) return;
|
|
200
201
|
|
|
201
202
|
setLoadingDeviceSessions(true);
|
|
202
203
|
try {
|
|
203
204
|
// This would call the API to get all device sessions for the current user
|
|
204
|
-
const allSessions = await oxyServices.getDeviceSessions(
|
|
205
|
+
const allSessions = await oxyServices.getDeviceSessions(activeSessionId);
|
|
205
206
|
setDeviceSessions(allSessions || []);
|
|
206
207
|
} catch (error) {
|
|
207
208
|
console.error('Failed to load device sessions:', error);
|
|
@@ -217,7 +218,7 @@ const ModernAccountSwitcherScreen: React.FC<BaseScreenProps> = ({
|
|
|
217
218
|
async () => {
|
|
218
219
|
setRemoteLogoutSessionId(sessionId);
|
|
219
220
|
try {
|
|
220
|
-
await oxyServices?.logoutSession(
|
|
221
|
+
await oxyServices?.logoutSession(activeSessionId || '', sessionId);
|
|
221
222
|
// Refresh device sessions list
|
|
222
223
|
await loadAllDeviceSessions();
|
|
223
224
|
toast.success(`Signed out from ${deviceName} successfully!`);
|
|
@@ -244,7 +245,7 @@ const ModernAccountSwitcherScreen: React.FC<BaseScreenProps> = ({
|
|
|
244
245
|
async () => {
|
|
245
246
|
setLoggingOutAllDevices(true);
|
|
246
247
|
try {
|
|
247
|
-
await oxyServices?.logoutAllDeviceSessions(
|
|
248
|
+
await oxyServices?.logoutAllDeviceSessions(activeSessionId || '');
|
|
248
249
|
// Refresh device sessions list
|
|
249
250
|
await loadAllDeviceSessions();
|
|
250
251
|
toast.success('Signed out from all other devices successfully!');
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import { useState, useEffect } from 'react';
|
|
2
3
|
import {
|
|
3
4
|
View,
|
|
4
5
|
Text,
|
|
@@ -12,7 +13,7 @@ import {
|
|
|
12
13
|
ScrollView,
|
|
13
14
|
ActivityIndicator,
|
|
14
15
|
} from 'react-native';
|
|
15
|
-
import { BaseScreenProps } from '../navigation/types';
|
|
16
|
+
import type { BaseScreenProps } from '../navigation/types';
|
|
16
17
|
import { useOxy } from '../context/OxyContext';
|
|
17
18
|
import { fontFamilies } from '../styles/fonts';
|
|
18
19
|
import { packageInfo } from '../../constants/version';
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
Alert,
|
|
15
15
|
Dimensions,
|
|
16
16
|
} from 'react-native';
|
|
17
|
-
import { BaseScreenProps } from '../navigation/types';
|
|
17
|
+
import type { BaseScreenProps } from '../navigation/types';
|
|
18
18
|
import { useOxy } from '../context/OxyContext';
|
|
19
19
|
import { useThemeColors } from '../styles';
|
|
20
20
|
import { Ionicons } from '@expo/vector-icons';
|