@oxyhq/services 5.10.16 → 5.11.2
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 +78 -14
- 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 +238 -25
- package/lib/commonjs/core/OxyServices.js.map +1 -1
- package/lib/commonjs/index.js +86 -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/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/context/OxyContext.js +3 -1
- package/lib/commonjs/ui/context/OxyContext.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 +238 -25
- package/lib/module/core/OxyServices.js.map +1 -1
- package/lib/module/index.js +2 -0
- 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/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 +3 -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 +68 -12
- package/lib/typescript/core/OxyServices.d.ts.map +1 -1
- package/lib/typescript/index.d.ts +3 -1
- 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/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 +8 -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 +264 -40
- package/src/core/__tests__/OxyServices.test.ts +180 -0
- package/src/index.ts +15 -1
- package/src/lib/sonner-safe.ts +4 -1
- package/src/lib/sonner.ts +19 -2
- package/src/models/interfaces.ts +117 -6
- 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 +11 -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
package/README.md
CHANGED
|
@@ -44,6 +44,8 @@ For React Native and Expo projects, add the polyfill import at the very top of y
|
|
|
44
44
|
import 'react-native-url-polyfill/auto';
|
|
45
45
|
```
|
|
46
46
|
|
|
47
|
+
**Note**: This polyfill is already included in the package dependencies, but you need to import it to activate it.
|
|
48
|
+
|
|
47
49
|
## 🚀 Quick Start
|
|
48
50
|
|
|
49
51
|
### React Native/Expo
|
|
@@ -158,10 +160,14 @@ import { oxyClient } from '@oxyhq/services';
|
|
|
158
160
|
|
|
159
161
|
// utils/api.ts
|
|
160
162
|
export const userUtils = {
|
|
161
|
-
async
|
|
163
|
+
async fetchUserById(userId: string) {
|
|
162
164
|
return await oxyClient.getUserById(userId);
|
|
163
165
|
},
|
|
164
166
|
|
|
167
|
+
async fetchProfileByUsername(username: string) {
|
|
168
|
+
return await oxyClient.getProfileByUsername(username);
|
|
169
|
+
},
|
|
170
|
+
|
|
165
171
|
async updateUserProfile(updates: any) {
|
|
166
172
|
return await oxyClient.updateProfile(updates);
|
|
167
173
|
}
|
|
@@ -199,6 +205,17 @@ export const getUserProfile = async (req, res) => {
|
|
|
199
205
|
}
|
|
200
206
|
};
|
|
201
207
|
|
|
208
|
+
// routes/profiles.ts
|
|
209
|
+
export const getProfileByUsername = async (req, res) => {
|
|
210
|
+
try {
|
|
211
|
+
const { username } = req.params;
|
|
212
|
+
const profile = await oxyClient.getProfileByUsername(username);
|
|
213
|
+
res.json(profile);
|
|
214
|
+
} catch (error) {
|
|
215
|
+
res.status(500).json({ error: error.message });
|
|
216
|
+
}
|
|
217
|
+
};
|
|
218
|
+
|
|
202
219
|
// routes/social.ts
|
|
203
220
|
export const getFollowers = async (req, res) => {
|
|
204
221
|
try {
|
|
@@ -294,28 +311,71 @@ await oxyClient.signUp(username, email, password);
|
|
|
294
311
|
await oxyClient.logout();
|
|
295
312
|
|
|
296
313
|
// User Management
|
|
297
|
-
const user = await oxyClient.getCurrentUser();
|
|
298
|
-
await oxyClient.
|
|
299
|
-
const
|
|
314
|
+
const user = await oxyClient.getCurrentUser(); // Get current user
|
|
315
|
+
const userById = await oxyClient.getUserById('user123'); // Get user by ID
|
|
316
|
+
const profileByUsername = await oxyClient.getProfileByUsername('john_doe'); // Get profile by username
|
|
317
|
+
await oxyClient.updateProfile({ name: 'John Doe' }); // Update current user
|
|
318
|
+
await oxyClient.updateUser('user123', { name: 'John' }); // Update user by ID (admin)
|
|
319
|
+
|
|
320
|
+
// Session Management
|
|
321
|
+
const userBySession = await oxyClient.getUserBySession('session123'); // Get user by session
|
|
322
|
+
const sessions = await oxyClient.getSessionsBySessionId('session123'); // Get all sessions
|
|
323
|
+
await oxyClient.logoutSession('session123'); // Logout specific session
|
|
324
|
+
await oxyClient.logoutAllSessions('session123'); // Logout all sessions
|
|
300
325
|
|
|
301
326
|
// Social Features
|
|
302
|
-
await oxyClient.followUser('user123');
|
|
303
|
-
|
|
304
|
-
const
|
|
327
|
+
await oxyClient.followUser('user123'); // Follow user
|
|
328
|
+
await oxyClient.unfollowUser('user123'); // Unfollow user
|
|
329
|
+
const followStatus = await oxyClient.getFollowStatus('user123'); // Check follow status
|
|
330
|
+
const followers = await oxyClient.getUserFollowers('user123'); // Get user followers
|
|
331
|
+
const following = await oxyClient.getUserFollowing('user123'); // Get user following
|
|
332
|
+
|
|
333
|
+
// Notifications
|
|
334
|
+
const notifications = await oxyClient.getNotifications(); // Get notifications
|
|
335
|
+
const unreadCount = await oxyClient.getUnreadCount(); // Get unread count
|
|
336
|
+
await oxyClient.markNotificationAsRead('notification123'); // Mark as read
|
|
337
|
+
await oxyClient.markAllNotificationsAsRead(); // Mark all as read
|
|
338
|
+
await oxyClient.deleteNotification('notification123'); // Delete notification
|
|
305
339
|
|
|
306
340
|
// File Management
|
|
307
|
-
const fileData = await oxyClient.uploadFile(file);
|
|
308
|
-
const
|
|
341
|
+
const fileData = await oxyClient.uploadFile(file); // Upload file
|
|
342
|
+
const file = await oxyClient.getFile('file123'); // Get file info
|
|
343
|
+
await oxyClient.deleteFile('file123'); // Delete file
|
|
344
|
+
const downloadUrl = oxyClient.getFileDownloadUrl('file123'); // Get download URL
|
|
345
|
+
const streamUrl = oxyClient.getFileStreamUrl('file123'); // Get stream URL
|
|
346
|
+
const userFiles = await oxyClient.listUserFiles('user123'); // List user files
|
|
309
347
|
|
|
310
348
|
// Payments
|
|
311
|
-
const payment = await oxyClient.createPayment(paymentData);
|
|
349
|
+
const payment = await oxyClient.createPayment(paymentData); // Create payment
|
|
350
|
+
const paymentInfo = await oxyClient.getPayment('payment123'); // Get payment info
|
|
351
|
+
const userPayments = await oxyClient.getUserPayments(); // Get user payments
|
|
352
|
+
|
|
353
|
+
// Karma System
|
|
354
|
+
const karma = await oxyClient.getUserKarma('user123'); // Get user karma
|
|
355
|
+
await oxyClient.giveKarma('user123', 10, 'helpful comment'); // Give karma
|
|
356
|
+
const karmaTotal = await oxyClient.getUserKarmaTotal('user123'); // Get karma total
|
|
357
|
+
const karmaHistory = await oxyClient.getUserKarmaHistory('user123'); // Get karma history
|
|
358
|
+
const leaderboard = await oxyClient.getKarmaLeaderboard(); // Get leaderboard
|
|
359
|
+
const rules = await oxyClient.getKarmaRules(); // Get karma rules
|
|
312
360
|
|
|
313
361
|
// Location Services
|
|
314
|
-
await oxyClient.updateLocation(40.7128, -74.0060);
|
|
315
|
-
const nearby = await oxyClient.getNearbyUsers();
|
|
362
|
+
await oxyClient.updateLocation(40.7128, -74.0060); // Update location
|
|
363
|
+
const nearby = await oxyClient.getNearbyUsers(1000); // Get nearby users
|
|
316
364
|
|
|
317
365
|
// Analytics
|
|
318
|
-
await oxyClient.trackEvent('user_action', { action: 'click' });
|
|
366
|
+
await oxyClient.trackEvent('user_action', { action: 'click' }); // Track event
|
|
367
|
+
const analytics = await oxyClient.getAnalytics('2024-01-01', '2024-01-31'); // Get analytics
|
|
368
|
+
|
|
369
|
+
// Device Management
|
|
370
|
+
await oxyClient.registerDevice(deviceData); // Register device
|
|
371
|
+
const devices = await oxyClient.getUserDevices(); // Get user devices
|
|
372
|
+
await oxyClient.removeDevice('device123'); // Remove device
|
|
373
|
+
const deviceSessions = await oxyClient.getDeviceSessions('session123'); // Get device sessions
|
|
374
|
+
await oxyClient.logoutAllDeviceSessions('session123'); // Logout device sessions
|
|
375
|
+
await oxyClient.updateDeviceName('session123', 'iPhone 15'); // Update device name
|
|
376
|
+
|
|
377
|
+
// Utilities
|
|
378
|
+
const metadata = await oxyClient.fetchLinkMetadata('https://example.com'); // Fetch link metadata
|
|
319
379
|
```
|
|
320
380
|
|
|
321
381
|
### useOxy Hook
|
|
@@ -497,6 +557,8 @@ function App() {
|
|
|
497
557
|
import 'react-native-url-polyfill/auto';
|
|
498
558
|
```
|
|
499
559
|
|
|
560
|
+
**Why needed**: Your app uses file uploads which require `FormData`. React Native with Hermes engine doesn't include `FormData` natively, so it needs to be polyfilled.
|
|
561
|
+
|
|
500
562
|
#### 3. **Authentication Not Persisting**
|
|
501
563
|
|
|
502
564
|
**Solution**: Check storage configuration
|
|
@@ -540,9 +602,11 @@ try {
|
|
|
540
602
|
For React Native/Expo projects:
|
|
541
603
|
|
|
542
604
|
```bash
|
|
543
|
-
npm install axios jwt-decode invariant
|
|
605
|
+
npm install axios jwt-decode invariant
|
|
544
606
|
```
|
|
545
607
|
|
|
608
|
+
**Note**: `react-native-url-polyfill` is already included as a dependency in this package.
|
|
609
|
+
|
|
546
610
|
## 📚 Examples
|
|
547
611
|
|
|
548
612
|
### Complete React Native App
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import type React from 'react';
|
|
2
2
|
import Svg, { Circle, Path } from 'react-native-svg';
|
|
3
|
-
import { ViewStyle } from 'react-native';
|
|
3
|
+
import type { ViewStyle } from 'react-native';
|
|
4
4
|
import { useThemeColors } from '../../ui/styles/theme';
|
|
5
5
|
|
|
6
6
|
interface OxyLogoProps {
|
|
@@ -4,12 +4,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = exports.OxyServicesLogo = void 0;
|
|
7
|
-
var _react = _interopRequireDefault(require("react"));
|
|
8
7
|
var _reactNativeSvg = _interopRequireWildcard(require("react-native-svg"));
|
|
9
8
|
var _theme = require("../../ui/styles/theme");
|
|
10
9
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
10
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
12
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
11
|
/**
|
|
14
12
|
* SVG logo component for Oxy
|
|
15
13
|
* This component renders the Oxy logo as an SVG and uses theme colors by default
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["_reactNativeSvg","_interopRequireWildcard","require","_theme","_jsxRuntime","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","OxyServicesLogo","width","height","style","fillColor","secondaryFillColor","theme","themeColors","useThemeColors","primaryColor","primary","innerFillColor","background","jsxs","viewBox","children","jsx","Path","d","fill","exports","_default"],"sourceRoot":"../../../../src","sources":["assets/icons/OxyServices.tsx"],"mappings":";;;;;;AACA,IAAAA,eAAA,GAAAC,uBAAA,CAAAC,OAAA;AAEA,IAAAC,MAAA,GAAAD,OAAA;AAAuD,IAAAE,WAAA,GAAAF,OAAA;AAAA,SAAAD,wBAAAI,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAN,uBAAA,YAAAA,CAAAI,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,gBAAAP,CAAA,IAAAD,CAAA,gBAAAC,CAAA,OAAAa,cAAA,CAAAC,IAAA,CAAAf,CAAA,EAAAC,CAAA,OAAAM,CAAA,IAAAD,CAAA,GAAAU,MAAA,CAAAC,cAAA,KAAAD,MAAA,CAAAE,wBAAA,CAAAlB,CAAA,EAAAC,CAAA,OAAAM,CAAA,CAAAK,GAAA,IAAAL,CAAA,CAAAM,GAAA,IAAAP,CAAA,CAAAE,CAAA,EAAAP,CAAA,EAAAM,CAAA,IAAAC,CAAA,CAAAP,CAAA,IAAAD,CAAA,CAAAC,CAAA,WAAAO,CAAA,KAAAR,CAAA,EAAAC,CAAA;AAuBvD;AACA;AACA;AACA;AACO,MAAMkB,eAAuC,GAAGA,CAAC;EACpDC,KAAK,GAAG,EAAE;EACVC,MAAM,GAAG,EAAE;EACXC,KAAK;EACLC,SAAS;EACTC,kBAAkB;EAClBC,KAAK,GAAG;AACZ,CAAC,KAAK;EACF;EACA,MAAMC,WAAW,GAAG,IAAAC,qBAAc,EAACF,KAAK,CAAC;;EAEzC;EACA,MAAMG,YAAY,GAAGL,SAAS,IAAIG,WAAW,CAACG,OAAO;EAErD,MAAMC,cAAc,GAAGN,kBAAkB,IAAIE,WAAW,CAACK,UAAU;EAEnE,oBACI,IAAAhC,WAAA,CAAAiC,IAAA,EAACrC,eAAA,CAAAe,OAAG;IAACU,KAAK,EAAEA,KAAM;IAACC,MAAM,EAAEA,MAAO;IAACY,OAAO,EAAC,gBAAgB;IAACX,KAAK,EAAEA,KAAM;IAAAY,QAAA,gBACrE,IAAAnC,WAAA,CAAAoC,GAAA,EAACxC,eAAA,CAAAyC,IAAI;MACDC,CAAC,EAAC,4sBAA4sB;MAC9sBC,IAAI,EAAEV;IAAa,CACtB,CAAC,mBAAA7B,WAAA,CAAAoC,GAAA,EAACxC,eAAA,CAAAyC,IAAI;MACHC,CAAC,EAAC,qkBAAqkB;MACvkBC,IAAI,EAAER;IAAe,CACxB,CAAC,eACF,IAAA/B,WAAA,CAAAoC,GAAA,EAACxC,eAAA,CAAAyC,IAAI;MACDC,CAAC,EAAC,iqBAAiqB;MACnqBC,IAAI,EAAEV;IAAa,CACtB,CAAC,mBAAA7B,WAAA,CAAAoC,GAAA,EAACxC,eAAA,CAAAyC,IAAI;MACHC,CAAC,EAAC,mkBAAmkB;MACrkBC,IAAI,EAAER;IAAe,CACxB,CAAC;EAAA,CACD,CAAC;AAEd,CAAC;AAACS,OAAA,CAAApB,eAAA,GAAAA,eAAA;AAAA,IAAAqB,QAAA,GAAAD,OAAA,CAAA7B,OAAA,GAEaS,eAAe","ignoreList":[]}
|
|
@@ -4,11 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
var _react = _interopRequireDefault(require("react"));
|
|
8
7
|
var _reactNativeSvg = _interopRequireWildcard(require("react-native-svg"));
|
|
9
8
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
10
9
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
11
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
10
|
const HighFive = ({
|
|
13
11
|
width = 240,
|
|
14
12
|
height = 240,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["_reactNativeSvg","_interopRequireWildcard","require","_jsxRuntime","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","HighFive","width","height","color","jsxs","viewBox","children","jsx","Path","d","fill","_default","exports"],"sourceRoot":"../../../../src","sources":["assets/illustrations/HighFive.tsx"],"mappings":"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","ignoreList":[]}
|
|
@@ -202,6 +202,13 @@ class OxyServices {
|
|
|
202
202
|
return this.tokenStore.hasAccessToken();
|
|
203
203
|
}
|
|
204
204
|
|
|
205
|
+
/**
|
|
206
|
+
* Get the raw access token (for constructing anchor URLs when needed)
|
|
207
|
+
*/
|
|
208
|
+
getAccessToken() {
|
|
209
|
+
return this.tokenStore.getAccessToken();
|
|
210
|
+
}
|
|
211
|
+
|
|
205
212
|
/**
|
|
206
213
|
* Wait for authentication to be ready (public method)
|
|
207
214
|
* Useful for apps that want to ensure authentication is complete before proceeding
|
|
@@ -850,7 +857,8 @@ class OxyServices {
|
|
|
850
857
|
*/
|
|
851
858
|
async deleteFile(fileId) {
|
|
852
859
|
try {
|
|
853
|
-
|
|
860
|
+
// Central Asset Service delete with force=true behavior controlled by caller via assetDelete
|
|
861
|
+
const res = await this.client.delete(`/api/assets/${encodeURIComponent(fileId)}`);
|
|
854
862
|
return res.data;
|
|
855
863
|
} catch (error) {
|
|
856
864
|
throw this.handleError(error);
|
|
@@ -860,8 +868,16 @@ class OxyServices {
|
|
|
860
868
|
/**
|
|
861
869
|
* Get file download URL
|
|
862
870
|
*/
|
|
863
|
-
getFileDownloadUrl(fileId) {
|
|
864
|
-
|
|
871
|
+
getFileDownloadUrl(fileId, variant, expiresIn) {
|
|
872
|
+
// Default to streaming proxy to avoid ORB; attach token via query for <img src>
|
|
873
|
+
const base = this.getBaseURL();
|
|
874
|
+
const params = new URLSearchParams();
|
|
875
|
+
if (variant) params.set('variant', variant);
|
|
876
|
+
// Request a visible server-side placeholder if object is missing
|
|
877
|
+
params.set('fallback', 'placeholderVisible');
|
|
878
|
+
const token = this.tokenStore.getAccessToken();
|
|
879
|
+
if (token) params.set('token', token);
|
|
880
|
+
return `${base}/api/assets/${encodeURIComponent(fileId)}/stream${params.size ? `?${params.toString()}` : ''}`;
|
|
865
881
|
}
|
|
866
882
|
|
|
867
883
|
/**
|
|
@@ -874,17 +890,80 @@ class OxyServices {
|
|
|
874
890
|
/**
|
|
875
891
|
* List user files
|
|
876
892
|
*/
|
|
877
|
-
async listUserFiles(
|
|
893
|
+
async listUserFiles(limit, offset) {
|
|
878
894
|
try {
|
|
879
895
|
const params = new URLSearchParams();
|
|
880
|
-
if (limit) params.append('limit', limit
|
|
881
|
-
if (offset) params.append('offset', offset
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
896
|
+
if (limit) params.append('limit', String(limit));
|
|
897
|
+
if (offset) params.append('offset', String(offset));
|
|
898
|
+
const res = await this.client.get(`/api/assets${params.size ? `?${params.toString()}` : ''}`);
|
|
899
|
+
return res.data;
|
|
900
|
+
} catch (error) {
|
|
901
|
+
throw this.handleError(error);
|
|
902
|
+
}
|
|
903
|
+
}
|
|
904
|
+
|
|
905
|
+
// (removed legacy downloadFileContent; use getFileContentAsBlob/Text which resolve CAS URL first)
|
|
906
|
+
|
|
907
|
+
/**
|
|
908
|
+
* Get file content as text
|
|
909
|
+
*/
|
|
910
|
+
async getFileContentAsText(fileId, variant) {
|
|
911
|
+
try {
|
|
912
|
+
const urlRes = await this.client.get(`/api/assets/${encodeURIComponent(fileId)}/url${variant ? `?variant=${encodeURIComponent(variant)}` : ''}`);
|
|
913
|
+
const downloadUrl = urlRes.data?.url;
|
|
914
|
+
const response = await fetch(downloadUrl);
|
|
915
|
+
return await response.text();
|
|
916
|
+
} catch (error) {
|
|
917
|
+
throw this.handleError(error);
|
|
918
|
+
}
|
|
919
|
+
}
|
|
920
|
+
|
|
921
|
+
/**
|
|
922
|
+
* Get file content as blob
|
|
923
|
+
*/
|
|
924
|
+
async getFileContentAsBlob(fileId, variant) {
|
|
925
|
+
try {
|
|
926
|
+
const urlRes = await this.client.get(`/api/assets/${encodeURIComponent(fileId)}/url${variant ? `?variant=${encodeURIComponent(variant)}` : ''}`);
|
|
927
|
+
const downloadUrl = urlRes.data?.url;
|
|
928
|
+
const response = await fetch(downloadUrl);
|
|
929
|
+
return await response.blob();
|
|
930
|
+
} catch (error) {
|
|
931
|
+
throw this.handleError(error);
|
|
932
|
+
}
|
|
933
|
+
}
|
|
934
|
+
|
|
935
|
+
/**
|
|
936
|
+
* Upload raw file data
|
|
937
|
+
*/
|
|
938
|
+
async uploadRawFile(file, metadata) {
|
|
939
|
+
// Switch to Central Asset Service upload flow
|
|
940
|
+
return this.assetUpload(file, metadata);
|
|
941
|
+
}
|
|
942
|
+
|
|
943
|
+
// ============================================================================
|
|
944
|
+
// CENTRAL ASSET SERVICE METHODS
|
|
945
|
+
// ============================================================================
|
|
946
|
+
|
|
947
|
+
/**
|
|
948
|
+
* Calculate SHA256 hash of file content
|
|
949
|
+
*/
|
|
950
|
+
async calculateSHA256(file) {
|
|
951
|
+
const buffer = await file.arrayBuffer();
|
|
952
|
+
const hashBuffer = await crypto.subtle.digest('SHA-256', buffer);
|
|
953
|
+
const hashArray = Array.from(new Uint8Array(hashBuffer));
|
|
954
|
+
return hashArray.map(b => b.toString(16).padStart(2, '0')).join('');
|
|
955
|
+
}
|
|
956
|
+
|
|
957
|
+
/**
|
|
958
|
+
* Initialize asset upload - returns pre-signed URL and file ID
|
|
959
|
+
*/
|
|
960
|
+
async assetInit(sha256, size, mime) {
|
|
961
|
+
try {
|
|
962
|
+
const res = await this.client.post('/api/assets/init', {
|
|
963
|
+
sha256,
|
|
964
|
+
size,
|
|
965
|
+
mime
|
|
966
|
+
});
|
|
888
967
|
return res.data;
|
|
889
968
|
} catch (error) {
|
|
890
969
|
throw this.handleError(error);
|
|
@@ -892,12 +971,16 @@ class OxyServices {
|
|
|
892
971
|
}
|
|
893
972
|
|
|
894
973
|
/**
|
|
895
|
-
*
|
|
974
|
+
* Complete asset upload - commit metadata and trigger variant generation
|
|
896
975
|
*/
|
|
897
|
-
async
|
|
976
|
+
async assetComplete(fileId, originalName, size, mime, metadata) {
|
|
898
977
|
try {
|
|
899
|
-
const res = await this.client.
|
|
900
|
-
|
|
978
|
+
const res = await this.client.post('/api/assets/complete', {
|
|
979
|
+
fileId,
|
|
980
|
+
originalName,
|
|
981
|
+
size,
|
|
982
|
+
mime,
|
|
983
|
+
metadata
|
|
901
984
|
});
|
|
902
985
|
return res.data;
|
|
903
986
|
} catch (error) {
|
|
@@ -906,15 +989,75 @@ class OxyServices {
|
|
|
906
989
|
}
|
|
907
990
|
|
|
908
991
|
/**
|
|
909
|
-
*
|
|
992
|
+
* Upload file using Central Asset Service
|
|
910
993
|
*/
|
|
911
|
-
async
|
|
994
|
+
async assetUpload(file, metadata, onProgress) {
|
|
912
995
|
try {
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
996
|
+
// Calculate SHA256
|
|
997
|
+
const sha256 = await this.calculateSHA256(file);
|
|
998
|
+
|
|
999
|
+
// Initialize upload
|
|
1000
|
+
const initResponse = await this.assetInit(sha256, file.size, file.type);
|
|
1001
|
+
|
|
1002
|
+
// Try presigned URL first
|
|
1003
|
+
try {
|
|
1004
|
+
await this.uploadToPresignedUrl(initResponse.uploadUrl, file, onProgress);
|
|
1005
|
+
} catch (e) {
|
|
1006
|
+
// Fallback: direct upload via API to avoid CORS issues
|
|
1007
|
+
const fd = new FormData();
|
|
1008
|
+
fd.append('file', file);
|
|
1009
|
+
await this.client.post(`/api/assets/${encodeURIComponent(initResponse.fileId)}/upload-direct`, fd, {
|
|
1010
|
+
headers: {
|
|
1011
|
+
'Content-Type': 'multipart/form-data'
|
|
1012
|
+
}
|
|
1013
|
+
});
|
|
1014
|
+
}
|
|
1015
|
+
|
|
1016
|
+
// Complete upload
|
|
1017
|
+
return await this.assetComplete(initResponse.fileId, file.name, file.size, file.type, metadata);
|
|
1018
|
+
} catch (error) {
|
|
1019
|
+
throw this.handleError(error);
|
|
1020
|
+
}
|
|
1021
|
+
}
|
|
1022
|
+
|
|
1023
|
+
/**
|
|
1024
|
+
* Upload file to pre-signed URL
|
|
1025
|
+
*/
|
|
1026
|
+
async uploadToPresignedUrl(url, file, onProgress) {
|
|
1027
|
+
return new Promise((resolve, reject) => {
|
|
1028
|
+
const xhr = new XMLHttpRequest();
|
|
1029
|
+
xhr.upload.addEventListener('progress', event => {
|
|
1030
|
+
if (event.lengthComputable && onProgress) {
|
|
1031
|
+
const progress = event.loaded / event.total * 100;
|
|
1032
|
+
onProgress(progress);
|
|
1033
|
+
}
|
|
1034
|
+
});
|
|
1035
|
+
xhr.addEventListener('load', () => {
|
|
1036
|
+
if (xhr.status >= 200 && xhr.status < 300) {
|
|
1037
|
+
resolve();
|
|
1038
|
+
} else {
|
|
1039
|
+
reject(new Error(`Upload failed with status ${xhr.status}`));
|
|
916
1040
|
}
|
|
917
1041
|
});
|
|
1042
|
+
xhr.addEventListener('error', () => {
|
|
1043
|
+
reject(new Error('Upload failed'));
|
|
1044
|
+
});
|
|
1045
|
+
xhr.open('PUT', url);
|
|
1046
|
+
xhr.setRequestHeader('Content-Type', file.type);
|
|
1047
|
+
xhr.send(file);
|
|
1048
|
+
});
|
|
1049
|
+
}
|
|
1050
|
+
|
|
1051
|
+
/**
|
|
1052
|
+
* Link asset to an entity
|
|
1053
|
+
*/
|
|
1054
|
+
async assetLink(fileId, app, entityType, entityId) {
|
|
1055
|
+
try {
|
|
1056
|
+
const res = await this.client.post(`/api/assets/${fileId}/links`, {
|
|
1057
|
+
app,
|
|
1058
|
+
entityType,
|
|
1059
|
+
entityId
|
|
1060
|
+
});
|
|
918
1061
|
return res.data;
|
|
919
1062
|
} catch (error) {
|
|
920
1063
|
throw this.handleError(error);
|
|
@@ -922,12 +1065,16 @@ class OxyServices {
|
|
|
922
1065
|
}
|
|
923
1066
|
|
|
924
1067
|
/**
|
|
925
|
-
*
|
|
1068
|
+
* Unlink asset from an entity
|
|
926
1069
|
*/
|
|
927
|
-
async
|
|
1070
|
+
async assetUnlink(fileId, app, entityType, entityId) {
|
|
928
1071
|
try {
|
|
929
|
-
const res = await this.client.
|
|
930
|
-
|
|
1072
|
+
const res = await this.client.delete(`/api/assets/${fileId}/links`, {
|
|
1073
|
+
data: {
|
|
1074
|
+
app,
|
|
1075
|
+
entityType,
|
|
1076
|
+
entityId
|
|
1077
|
+
}
|
|
931
1078
|
});
|
|
932
1079
|
return res.data;
|
|
933
1080
|
} catch (error) {
|
|
@@ -935,6 +1082,72 @@ class OxyServices {
|
|
|
935
1082
|
}
|
|
936
1083
|
}
|
|
937
1084
|
|
|
1085
|
+
/**
|
|
1086
|
+
* Get asset metadata
|
|
1087
|
+
*/
|
|
1088
|
+
async assetGet(fileId) {
|
|
1089
|
+
try {
|
|
1090
|
+
const res = await this.client.get(`/api/assets/${fileId}`);
|
|
1091
|
+
return res.data;
|
|
1092
|
+
} catch (error) {
|
|
1093
|
+
throw this.handleError(error);
|
|
1094
|
+
}
|
|
1095
|
+
}
|
|
1096
|
+
|
|
1097
|
+
/**
|
|
1098
|
+
* Get asset URL (CDN or signed URL)
|
|
1099
|
+
*/
|
|
1100
|
+
async assetGetUrl(fileId, variant, expiresIn) {
|
|
1101
|
+
try {
|
|
1102
|
+
const params = new URLSearchParams();
|
|
1103
|
+
if (variant) params.set('variant', variant);
|
|
1104
|
+
if (expiresIn) params.set('expiresIn', expiresIn.toString());
|
|
1105
|
+
const queryString = params.toString();
|
|
1106
|
+
const url = `/api/assets/${fileId}/url${queryString ? `?${queryString}` : ''}`;
|
|
1107
|
+
const res = await this.client.get(url);
|
|
1108
|
+
return res.data;
|
|
1109
|
+
} catch (error) {
|
|
1110
|
+
throw this.handleError(error);
|
|
1111
|
+
}
|
|
1112
|
+
}
|
|
1113
|
+
|
|
1114
|
+
/**
|
|
1115
|
+
* Restore asset from trash
|
|
1116
|
+
*/
|
|
1117
|
+
async assetRestore(fileId) {
|
|
1118
|
+
try {
|
|
1119
|
+
const res = await this.client.post(`/api/assets/${fileId}/restore`);
|
|
1120
|
+
return res.data;
|
|
1121
|
+
} catch (error) {
|
|
1122
|
+
throw this.handleError(error);
|
|
1123
|
+
}
|
|
1124
|
+
}
|
|
1125
|
+
|
|
1126
|
+
/**
|
|
1127
|
+
* Delete asset with optional force
|
|
1128
|
+
*/
|
|
1129
|
+
async assetDelete(fileId, force = false) {
|
|
1130
|
+
try {
|
|
1131
|
+
const params = force ? '?force=true' : '';
|
|
1132
|
+
const res = await this.client.delete(`/api/assets/${fileId}${params}`);
|
|
1133
|
+
return res.data;
|
|
1134
|
+
} catch (error) {
|
|
1135
|
+
throw this.handleError(error);
|
|
1136
|
+
}
|
|
1137
|
+
}
|
|
1138
|
+
|
|
1139
|
+
/**
|
|
1140
|
+
* Get list of available variants for an asset
|
|
1141
|
+
*/
|
|
1142
|
+
async assetGetVariants(fileId) {
|
|
1143
|
+
try {
|
|
1144
|
+
const assetData = await this.assetGet(fileId);
|
|
1145
|
+
return assetData.file?.variants || [];
|
|
1146
|
+
} catch (error) {
|
|
1147
|
+
throw this.handleError(error);
|
|
1148
|
+
}
|
|
1149
|
+
}
|
|
1150
|
+
|
|
938
1151
|
// ============================================================================
|
|
939
1152
|
// LOCATION METHODS
|
|
940
1153
|
// ============================================================================
|