@oxyhq/services 5.26.4 → 5.27.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/web/oxy-services.esm.js +2 -0
- package/dist/web/oxy-services.esm.js.map +1 -0
- package/dist/web/types/assets/icons/OxyServices.d.ts +28 -0
- package/dist/web/types/assets/illustrations/HighFive.d.ts +8 -0
- package/dist/web/types/constants/version.d.ts +13 -0
- package/dist/web/types/core/AuthManager.d.ts +143 -0
- package/dist/web/types/core/CrossDomainAuth.d.ts +160 -0
- package/dist/web/types/core/HttpService.d.ts +163 -0
- package/dist/web/types/core/OxyServices.base.d.ts +126 -0
- package/dist/web/types/core/OxyServices.d.ts +81 -0
- package/dist/web/types/core/OxyServices.errors.d.ts +11 -0
- package/dist/web/types/core/index.d.ts +20 -0
- package/dist/web/types/core/mixins/OxyServices.analytics.d.ts +66 -0
- package/dist/web/types/core/mixins/OxyServices.assets.d.ts +135 -0
- package/dist/web/types/core/mixins/OxyServices.auth.d.ts +186 -0
- package/dist/web/types/core/mixins/OxyServices.developer.d.ts +99 -0
- package/dist/web/types/core/mixins/OxyServices.devices.d.ts +96 -0
- package/dist/web/types/core/mixins/OxyServices.features.d.ts +228 -0
- package/dist/web/types/core/mixins/OxyServices.fedcm.d.ts +200 -0
- package/dist/web/types/core/mixins/OxyServices.karma.d.ts +85 -0
- package/dist/web/types/core/mixins/OxyServices.language.d.ts +81 -0
- package/dist/web/types/core/mixins/OxyServices.location.d.ts +64 -0
- package/dist/web/types/core/mixins/OxyServices.payment.d.ts +111 -0
- package/dist/web/types/core/mixins/OxyServices.popup.d.ts +205 -0
- package/dist/web/types/core/mixins/OxyServices.privacy.d.ts +122 -0
- package/dist/web/types/core/mixins/OxyServices.redirect.d.ts +245 -0
- package/dist/web/types/core/mixins/OxyServices.security.d.ts +78 -0
- package/dist/web/types/core/mixins/OxyServices.user.d.ts +184 -0
- package/dist/web/types/core/mixins/OxyServices.utility.d.ts +93 -0
- package/dist/web/types/core/mixins/index.d.ts +30 -0
- package/dist/web/types/core/mixins/mixinHelpers.d.ts +31 -0
- package/dist/web/types/crypto/index.d.ts +11 -0
- package/dist/web/types/crypto/keyManager.d.ts +189 -0
- package/dist/web/types/crypto/polyfill.d.ts +12 -0
- package/dist/web/types/crypto/recoveryPhrase.d.ts +58 -0
- package/dist/web/types/crypto/signatureService.d.ts +86 -0
- package/dist/web/types/i18n/index.d.ts +3 -0
- package/dist/web/types/index.d.ts +62 -0
- package/dist/web/types/lib/sonner-safe.d.ts +8 -0
- package/dist/web/types/lib/sonner.d.ts +11 -0
- package/dist/web/types/lib/sonner.web.d.ts +14 -0
- package/dist/web/types/models/interfaces.d.ts +415 -0
- package/dist/web/types/models/session.d.ts +27 -0
- package/dist/web/types/node/index.d.ts +9 -0
- package/dist/web/types/shared/index.d.ts +28 -0
- package/dist/web/types/shared/utils/colorUtils.d.ts +104 -0
- package/dist/web/types/shared/utils/debugUtils.d.ts +48 -0
- package/dist/web/types/shared/utils/errorUtils.d.ts +97 -0
- package/dist/web/types/shared/utils/index.d.ts +13 -0
- package/dist/web/types/shared/utils/networkUtils.d.ts +139 -0
- package/dist/web/types/shared/utils/themeUtils.d.ts +90 -0
- package/dist/web/types/ui/client.d.ts +33 -0
- package/dist/web/types/ui/components/ActivityIndicator.d.ts +44 -0
- package/dist/web/types/ui/components/AnimationExample.d.ts +3 -0
- package/dist/web/types/ui/components/AutoHeightScrollView.d.ts +22 -0
- package/dist/web/types/ui/components/Avatar.d.ts +60 -0
- package/dist/web/types/ui/components/BottomSheet.d.ts +28 -0
- package/dist/web/types/ui/components/BottomSheetRouter.d.ts +8 -0
- package/dist/web/types/ui/components/CrossFadeIcon.d.ts +26 -0
- package/dist/web/types/ui/components/EmptyState.d.ts +7 -0
- package/dist/web/types/ui/components/ErrorBoundary.d.ts +30 -0
- package/dist/web/types/ui/components/FollowButton.d.ts +17 -0
- package/dist/web/types/ui/components/FontLoader.d.ts +14 -0
- package/dist/web/types/ui/components/GroupedItem.d.ts +23 -0
- package/dist/web/types/ui/components/GroupedSection.d.ts +24 -0
- package/dist/web/types/ui/components/Header.d.ts +37 -0
- package/dist/web/types/ui/components/HelperText.d.ts +46 -0
- package/dist/web/types/ui/components/Icon.d.ts +59 -0
- package/dist/web/types/ui/components/IconButton/IconButton.d.ts +98 -0
- package/dist/web/types/ui/components/IconButton/utils.d.ts +18 -0
- package/dist/web/types/ui/components/LoadingState.d.ts +8 -0
- package/dist/web/types/ui/components/OxyLogo.d.ts +28 -0
- package/dist/web/types/ui/components/OxyPayButton.d.ts +28 -0
- package/dist/web/types/ui/components/OxyProvider.d.ts +33 -0
- package/dist/web/types/ui/components/OxySignInButton.d.ts +64 -0
- package/dist/web/types/ui/components/ProfileCard.d.ts +17 -0
- package/dist/web/types/ui/components/QuickActions.d.ts +14 -0
- package/dist/web/types/ui/components/Section.d.ts +11 -0
- package/dist/web/types/ui/components/SectionTitle.d.ts +9 -0
- package/dist/web/types/ui/components/SettingRow.d.ts +19 -0
- package/dist/web/types/ui/components/SignInModal.d.ts +17 -0
- package/dist/web/types/ui/components/StepBasedScreen.d.ts +25 -0
- package/dist/web/types/ui/components/Surface.d.ts +75 -0
- package/dist/web/types/ui/components/TextField/Addons/Outline.d.ts +15 -0
- package/dist/web/types/ui/components/TextField/Addons/Underline.d.ts +18 -0
- package/dist/web/types/ui/components/TextField/Adornment/TextFieldAdornment.d.ts +44 -0
- package/dist/web/types/ui/components/TextField/Adornment/TextFieldAffix.d.ts +72 -0
- package/dist/web/types/ui/components/TextField/Adornment/TextFieldIcon.d.ts +77 -0
- package/dist/web/types/ui/components/TextField/Adornment/enums.d.ts +12 -0
- package/dist/web/types/ui/components/TextField/Adornment/types.d.ts +11 -0
- package/dist/web/types/ui/components/TextField/Adornment/utils.d.ts +11 -0
- package/dist/web/types/ui/components/TextField/Label/InputLabel.d.ts +4 -0
- package/dist/web/types/ui/components/TextField/Label/LabelBackground.d.ts +3 -0
- package/dist/web/types/ui/components/TextField/TextFieldFlat.d.ts +3 -0
- package/dist/web/types/ui/components/TextField/TextFieldOutlined.d.ts +3 -0
- package/dist/web/types/ui/components/TextField/constants.d.ts +31 -0
- package/dist/web/types/ui/components/TextField/helpers.d.ts +96 -0
- package/dist/web/types/ui/components/TextField/types.d.ts +155 -0
- package/dist/web/types/ui/components/TextField.d.ts +191 -0
- package/dist/web/types/ui/components/TouchableRipple/Pressable.d.ts +12 -0
- package/dist/web/types/ui/components/TouchableRipple/TouchableRipple.d.ts +61 -0
- package/dist/web/types/ui/components/TouchableRipple/utils.d.ts +10 -0
- package/dist/web/types/ui/components/Typography/AnimatedText.d.ts +34 -0
- package/dist/web/types/ui/components/Typography/types.d.ts +18 -0
- package/dist/web/types/ui/components/WebOxyProvider.d.ts +51 -0
- package/dist/web/types/ui/components/feedback/FormInput.d.ts +19 -0
- package/dist/web/types/ui/components/feedback/ProgressIndicator.d.ts +10 -0
- package/dist/web/types/ui/components/feedback/constants.d.ts +4 -0
- package/dist/web/types/ui/components/feedback/feedbackStyles.d.ts +279 -0
- package/dist/web/types/ui/components/feedback/index.d.ts +6 -0
- package/dist/web/types/ui/components/feedback/types.d.ts +45 -0
- package/dist/web/types/ui/components/feedback/useFeedbackForm.d.ts +8 -0
- package/dist/web/types/ui/components/fileManagement/AnimatedButton.d.ts +15 -0
- package/dist/web/types/ui/components/fileManagement/FileDetailsModal.d.ts +14 -0
- package/dist/web/types/ui/components/fileManagement/FileViewer.d.ts +17 -0
- package/dist/web/types/ui/components/fileManagement/UploadPreview.d.ts +20 -0
- package/dist/web/types/ui/components/fileManagement/styles.d.ts +859 -0
- package/dist/web/types/ui/components/icon/FAIRWalletIcon.d.ts +8 -0
- package/dist/web/types/ui/components/icon/OxyIcon.d.ts +9 -0
- package/dist/web/types/ui/components/icon/index.d.ts +3 -0
- package/dist/web/types/ui/components/index.d.ts +16 -0
- package/dist/web/types/ui/components/internal/GroupedPillButtons.d.ts +17 -0
- package/dist/web/types/ui/components/internal/PinInput.d.ts +22 -0
- package/dist/web/types/ui/components/modals/DeleteAccountModal.d.ts +18 -0
- package/dist/web/types/ui/components/modals/index.d.ts +1 -0
- package/dist/web/types/ui/components/payment/PaymentDetailsStep.d.ts +20 -0
- package/dist/web/types/ui/components/payment/PaymentMethodStep.d.ts +13 -0
- package/dist/web/types/ui/components/payment/PaymentReviewStep.d.ts +15 -0
- package/dist/web/types/ui/components/payment/PaymentSuccessStep.d.ts +9 -0
- package/dist/web/types/ui/components/payment/PaymentSummaryStep.d.ts +14 -0
- package/dist/web/types/ui/components/payment/constants.d.ts +6 -0
- package/dist/web/types/ui/components/payment/index.d.ts +8 -0
- package/dist/web/types/ui/components/payment/paymentStyles.d.ts +395 -0
- package/dist/web/types/ui/components/payment/types.d.ts +39 -0
- package/dist/web/types/ui/components/photogrid/JustifiedPhotoGrid.d.ts +26 -0
- package/dist/web/types/ui/components/styles/overlay.d.ts +3 -0
- package/dist/web/types/ui/components/styles/shadow.d.ts +2 -0
- package/dist/web/types/ui/components/theming.d.ts +7 -0
- package/dist/web/types/ui/components/types.d.ts +79 -0
- package/dist/web/types/ui/components/utils/forwardRef.d.ts +11 -0
- package/dist/web/types/ui/components/utils/hasTouchHandler.d.ts +5 -0
- package/dist/web/types/ui/components/utils/roundLayoutSize.d.ts +1 -0
- package/dist/web/types/ui/components/utils/splitStyles.d.ts +19 -0
- package/dist/web/types/ui/constants/iconColors.d.ts +129 -0
- package/dist/web/types/ui/constants/spacing.d.ts +32 -0
- package/dist/web/types/ui/constants/theme.d.ts +96 -0
- package/dist/web/types/ui/context/OxyContext.d.ts +74 -0
- package/dist/web/types/ui/context/ThemeContext.d.ts +18 -0
- package/dist/web/types/ui/context/hooks/useAuthOperations.d.ts +39 -0
- package/dist/web/types/ui/context/hooks/useDeviceManagement.d.ts +26 -0
- package/dist/web/types/ui/context/hooks/useLanguageManagement.d.ts +24 -0
- package/dist/web/types/ui/context/hooks/useSessionManagement.d.ts +40 -0
- package/dist/web/types/ui/hooks/index.d.ts +6 -0
- package/dist/web/types/ui/hooks/mutations/index.d.ts +8 -0
- package/dist/web/types/ui/hooks/mutations/mutationFactory.d.ts +75 -0
- package/dist/web/types/ui/hooks/mutations/useAccountMutations.d.ts +68 -0
- package/dist/web/types/ui/hooks/mutations/useServicesMutations.d.ts +22 -0
- package/dist/web/types/ui/hooks/queries/index.d.ts +10 -0
- package/dist/web/types/ui/hooks/queries/queryKeys.d.ts +64 -0
- package/dist/web/types/ui/hooks/queries/useAccountQueries.d.ts +42 -0
- package/dist/web/types/ui/hooks/queries/useSecurityQueries.d.ts +14 -0
- package/dist/web/types/ui/hooks/queries/useServicesQueries.d.ts +31 -0
- package/dist/web/types/ui/hooks/queryClient.d.ts +18 -0
- package/dist/web/types/ui/hooks/useAssets.d.ts +34 -0
- package/dist/web/types/ui/hooks/useAsyncAction.d.ts +50 -0
- package/dist/web/types/ui/hooks/useAuth.d.ts +73 -0
- package/dist/web/types/ui/hooks/useColorScheme.d.ts +7 -0
- package/dist/web/types/ui/hooks/useDeviceManagement.d.ts +26 -0
- package/dist/web/types/ui/hooks/useFileDownloadUrl.d.ts +18 -0
- package/dist/web/types/ui/hooks/useFileFiltering.d.ts +28 -0
- package/dist/web/types/ui/hooks/useFollow.d.ts +61 -0
- package/dist/web/types/ui/hooks/useFollow.types.d.ts +32 -0
- package/dist/web/types/ui/hooks/useI18n.d.ts +4 -0
- package/dist/web/types/ui/hooks/useLanguageManagement.d.ts +24 -0
- package/dist/web/types/ui/hooks/useProfileEditing.d.ts +35 -0
- package/dist/web/types/ui/hooks/useQueryClient.d.ts +6 -0
- package/dist/web/types/ui/hooks/useSessionManagement.d.ts +40 -0
- package/dist/web/types/ui/hooks/useSessionSocket.d.ts +13 -0
- package/dist/web/types/ui/hooks/useSettingToggle.d.ts +56 -0
- package/dist/web/types/ui/hooks/useStorage.d.ts +15 -0
- package/dist/web/types/ui/hooks/useThemeColors.d.ts +93 -0
- package/dist/web/types/ui/hooks/useThemeStyles.d.ts +44 -0
- package/dist/web/types/ui/hooks/useWebSSO.d.ts +57 -0
- package/dist/web/types/ui/index.d.ts +7 -0
- package/dist/web/types/ui/isFrontend.d.ts +2 -0
- package/dist/web/types/ui/navigation/bottomSheetManager.d.ts +26 -0
- package/dist/web/types/ui/navigation/routes.d.ts +5 -0
- package/dist/web/types/ui/screens/AccountCenterScreen.d.ts +4 -0
- package/dist/web/types/ui/screens/AccountOverviewScreen.d.ts +4 -0
- package/dist/web/types/ui/screens/AccountSettingsScreen.d.ts +7 -0
- package/dist/web/types/ui/screens/AccountSwitcherScreen.d.ts +4 -0
- package/dist/web/types/ui/screens/AccountVerificationScreen.d.ts +4 -0
- package/dist/web/types/ui/screens/AppInfoScreen.d.ts +4 -0
- package/dist/web/types/ui/screens/EditProfileFieldScreen.d.ts +12 -0
- package/dist/web/types/ui/screens/FAQScreen.d.ts +4 -0
- package/dist/web/types/ui/screens/FeedbackScreen.d.ts +4 -0
- package/dist/web/types/ui/screens/FileManagementScreen.d.ts +4 -0
- package/dist/web/types/ui/screens/FollowersListScreen.d.ts +8 -0
- package/dist/web/types/ui/screens/FollowingListScreen.d.ts +8 -0
- package/dist/web/types/ui/screens/HelpSupportScreen.d.ts +4 -0
- package/dist/web/types/ui/screens/HistoryViewScreen.d.ts +4 -0
- package/dist/web/types/ui/screens/LanguageSelectorScreen.d.ts +6 -0
- package/dist/web/types/ui/screens/LearnMoreUsernamesScreen.d.ts +4 -0
- package/dist/web/types/ui/screens/LegalDocumentsScreen.d.ts +4 -0
- package/dist/web/types/ui/screens/OxyAuthScreen.d.ts +16 -0
- package/dist/web/types/ui/screens/PaymentGatewayScreen.d.ts +14 -0
- package/dist/web/types/ui/screens/PremiumSubscriptionScreen.d.ts +4 -0
- package/dist/web/types/ui/screens/PrivacySettingsScreen.d.ts +4 -0
- package/dist/web/types/ui/screens/ProfileScreen.d.ts +8 -0
- package/dist/web/types/ui/screens/SavesCollectionsScreen.d.ts +4 -0
- package/dist/web/types/ui/screens/SearchSettingsScreen.d.ts +4 -0
- package/dist/web/types/ui/screens/SessionManagementScreen.d.ts +4 -0
- package/dist/web/types/ui/screens/UserLinksScreen.d.ts +14 -0
- package/dist/web/types/ui/screens/UserListScreen.d.ts +10 -0
- package/dist/web/types/ui/screens/WelcomeNewUserScreen.d.ts +12 -0
- package/dist/web/types/ui/screens/karma/KarmaAboutScreen.d.ts +4 -0
- package/dist/web/types/ui/screens/karma/KarmaCenterScreen.d.ts +4 -0
- package/dist/web/types/ui/screens/karma/KarmaFAQScreen.d.ts +4 -0
- package/dist/web/types/ui/screens/karma/KarmaLeaderboardScreen.d.ts +4 -0
- package/dist/web/types/ui/screens/karma/KarmaRewardsScreen.d.ts +4 -0
- package/dist/web/types/ui/screens/karma/KarmaRulesScreen.d.ts +4 -0
- package/dist/web/types/ui/server.d.ts +42 -0
- package/dist/web/types/ui/stores/accountStore.d.ts +33 -0
- package/dist/web/types/ui/stores/assetStore.d.ts +53 -0
- package/dist/web/types/ui/stores/authStore.d.ts +16 -0
- package/dist/web/types/ui/stores/fileStore.d.ts +30 -0
- package/dist/web/types/ui/stores/followStore.d.ts +24 -0
- package/dist/web/types/ui/styles/authStyles.d.ts +331 -0
- package/dist/web/types/ui/styles/fonts.d.ts +20 -0
- package/dist/web/types/ui/styles/index.d.ts +4 -0
- package/dist/web/types/ui/styles/spacing.d.ts +48 -0
- package/dist/web/types/ui/styles/theme.d.ts +67 -0
- package/dist/web/types/ui/types/fileManagement.d.ts +40 -0
- package/dist/web/types/ui/types/navigation.d.ts +36 -0
- package/dist/web/types/ui/utils/authHelpers.d.ts +98 -0
- package/dist/web/types/ui/utils/avatarUtils.d.ts +33 -0
- package/dist/web/types/ui/utils/colorUtils.d.ts +9 -0
- package/dist/web/types/ui/utils/confirmAction.d.ts +6 -0
- package/dist/web/types/ui/utils/errorHandlers.d.ts +34 -0
- package/dist/web/types/ui/utils/fileManagement.d.ts +86 -0
- package/dist/web/types/ui/utils/iconNames.d.ts +111 -0
- package/dist/web/types/ui/utils/sessionHelpers.d.ts +63 -0
- package/dist/web/types/ui/utils/storageHelpers.d.ts +27 -0
- package/dist/web/types/ui/utils/themeUtils.d.ts +10 -0
- package/dist/web/types/ui/utils/userUtils.d.ts +28 -0
- package/dist/web/types/utils/apiUtils.d.ts +53 -0
- package/dist/web/types/utils/asyncUtils.d.ts +58 -0
- package/dist/web/types/utils/cache.d.ts +127 -0
- package/dist/web/types/utils/deviceManager.d.ts +65 -0
- package/dist/web/types/utils/errorUtils.d.ts +46 -0
- package/dist/web/types/utils/hookUtils.d.ts +101 -0
- package/dist/web/types/utils/index.d.ts +6 -0
- package/dist/web/types/utils/languageUtils.d.ts +37 -0
- package/dist/web/types/utils/loggerUtils.d.ts +48 -0
- package/dist/web/types/utils/platform.d.ts +40 -0
- package/dist/web/types/utils/platformInit.d.ts +8 -0
- package/dist/web/types/utils/requestUtils.d.ts +123 -0
- package/dist/web/types/utils/sessionUtils.d.ts +54 -0
- package/dist/web/types/utils/validationUtils.d.ts +85 -0
- package/dist/web/types/web/WebOxyContext.d.ts +151 -0
- package/dist/web/types/web/index.d.ts +52 -0
- package/dist/web/types/web.d.ts +53 -0
- package/package.json +20 -6
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Request utilities for HTTP clients
|
|
3
|
+
*
|
|
4
|
+
* Provides reusable components for request deduplication, queuing, and logging
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Request deduplication - prevents duplicate concurrent requests
|
|
8
|
+
*
|
|
9
|
+
* When multiple requests with the same key are made simultaneously,
|
|
10
|
+
* only one request is executed and all callers receive the same result.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```typescript
|
|
14
|
+
* const deduplicator = new RequestDeduplicator();
|
|
15
|
+
*
|
|
16
|
+
* // Multiple calls with same key will share the same promise
|
|
17
|
+
* const promise1 = deduplicator.deduplicate('user-123', () => fetchUser('123'));
|
|
18
|
+
* const promise2 = deduplicator.deduplicate('user-123', () => fetchUser('123'));
|
|
19
|
+
* // promise1 === promise2, only one API call is made
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
export declare class RequestDeduplicator {
|
|
23
|
+
private pendingRequests;
|
|
24
|
+
/**
|
|
25
|
+
* Deduplicate a request by key
|
|
26
|
+
* @param key Unique key for the request
|
|
27
|
+
* @param requestFn Function that returns a promise
|
|
28
|
+
* @returns Promise that will be shared if key already exists
|
|
29
|
+
*/
|
|
30
|
+
deduplicate<T>(key: string, requestFn: () => Promise<T>): Promise<T>;
|
|
31
|
+
/**
|
|
32
|
+
* Clear all pending requests
|
|
33
|
+
*/
|
|
34
|
+
clear(): void;
|
|
35
|
+
/**
|
|
36
|
+
* Get number of pending requests
|
|
37
|
+
*/
|
|
38
|
+
size(): number;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Request queue with concurrency control
|
|
42
|
+
*
|
|
43
|
+
* Limits the number of concurrent requests and queues excess requests.
|
|
44
|
+
* Useful for rate limiting and preventing request flooding.
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* ```typescript
|
|
48
|
+
* const queue = new RequestQueue(5, 100); // Max 5 concurrent, queue up to 100
|
|
49
|
+
*
|
|
50
|
+
* // All requests will be queued and processed with max 5 concurrent
|
|
51
|
+
* await queue.enqueue(() => fetchUser('1'));
|
|
52
|
+
* await queue.enqueue(() => fetchUser('2'));
|
|
53
|
+
* // ...
|
|
54
|
+
* ```
|
|
55
|
+
*/
|
|
56
|
+
export declare class RequestQueue {
|
|
57
|
+
private queue;
|
|
58
|
+
private running;
|
|
59
|
+
private maxConcurrent;
|
|
60
|
+
private maxQueueSize;
|
|
61
|
+
/**
|
|
62
|
+
* Create a new request queue
|
|
63
|
+
* @param maxConcurrent Maximum number of concurrent requests (default: 10)
|
|
64
|
+
* @param maxQueueSize Maximum queue size (default: 100)
|
|
65
|
+
*/
|
|
66
|
+
constructor(maxConcurrent?: number, maxQueueSize?: number);
|
|
67
|
+
/**
|
|
68
|
+
* Enqueue a request
|
|
69
|
+
* @param requestFn Function that returns a promise
|
|
70
|
+
* @returns Promise that resolves when request completes
|
|
71
|
+
*/
|
|
72
|
+
enqueue<T>(requestFn: () => Promise<T>): Promise<T>;
|
|
73
|
+
/**
|
|
74
|
+
* Process queued requests
|
|
75
|
+
*/
|
|
76
|
+
private process;
|
|
77
|
+
/**
|
|
78
|
+
* Clear all queued requests
|
|
79
|
+
*/
|
|
80
|
+
clear(): void;
|
|
81
|
+
/**
|
|
82
|
+
* Get queue size
|
|
83
|
+
*/
|
|
84
|
+
size(): number;
|
|
85
|
+
/**
|
|
86
|
+
* Get number of currently running requests
|
|
87
|
+
*/
|
|
88
|
+
runningCount(): number;
|
|
89
|
+
}
|
|
90
|
+
/** Log level type for SimpleLogger */
|
|
91
|
+
export type LogLevel = 'none' | 'error' | 'warn' | 'info' | 'debug';
|
|
92
|
+
/**
|
|
93
|
+
* Simple logger with level support
|
|
94
|
+
*
|
|
95
|
+
* Lightweight logger for HTTP clients and utilities.
|
|
96
|
+
* For more advanced logging, use loggerUtils.ts
|
|
97
|
+
*
|
|
98
|
+
* @example
|
|
99
|
+
* ```typescript
|
|
100
|
+
* const logger = new SimpleLogger(true, 'debug');
|
|
101
|
+
* logger.debug('Debug message');
|
|
102
|
+
* logger.info('Info message');
|
|
103
|
+
* logger.error('Error message');
|
|
104
|
+
* ```
|
|
105
|
+
*/
|
|
106
|
+
export declare class SimpleLogger {
|
|
107
|
+
private enabled;
|
|
108
|
+
private level;
|
|
109
|
+
private prefix;
|
|
110
|
+
/**
|
|
111
|
+
* Create a new simple logger
|
|
112
|
+
* @param enabled Whether logging is enabled
|
|
113
|
+
* @param level Minimum log level
|
|
114
|
+
* @param prefix Prefix for log messages (default: '')
|
|
115
|
+
*/
|
|
116
|
+
constructor(enabled?: boolean, level?: LogLevel, prefix?: string);
|
|
117
|
+
private shouldLog;
|
|
118
|
+
private formatMessage;
|
|
119
|
+
error(...args: any[]): void;
|
|
120
|
+
warn(...args: any[]): void;
|
|
121
|
+
info(...args: any[]): void;
|
|
122
|
+
debug(...args: any[]): void;
|
|
123
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Session management utilities
|
|
3
|
+
*
|
|
4
|
+
* Provides consistent session normalization, deduplication, and sorting
|
|
5
|
+
* to ensure sessions are always displayed in a predictable order.
|
|
6
|
+
*/
|
|
7
|
+
import type { ClientSession } from '../models/session';
|
|
8
|
+
/**
|
|
9
|
+
* Normalize a session to ensure all required fields are present
|
|
10
|
+
*/
|
|
11
|
+
export declare function normalizeSession(session: Partial<ClientSession> & {
|
|
12
|
+
sessionId: string;
|
|
13
|
+
}): ClientSession;
|
|
14
|
+
/**
|
|
15
|
+
* Compare two sessions for equality
|
|
16
|
+
*/
|
|
17
|
+
export declare function sessionsEqual(a: ClientSession, b: ClientSession): boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Sort sessions by lastActive (most recent first), then by sessionId for stability
|
|
20
|
+
*/
|
|
21
|
+
export declare function sortSessions(sessions: ClientSession[]): ClientSession[];
|
|
22
|
+
/**
|
|
23
|
+
* Deduplicate sessions by sessionId, keeping the most recent version
|
|
24
|
+
*/
|
|
25
|
+
export declare function deduplicateSessions(sessions: ClientSession[]): ClientSession[];
|
|
26
|
+
/**
|
|
27
|
+
* Deduplicate sessions by userId, keeping only one session per user
|
|
28
|
+
* Priority: 1) Active session (if provided), 2) Most recent session
|
|
29
|
+
* This prevents showing duplicate accounts for the same user
|
|
30
|
+
*/
|
|
31
|
+
export declare function deduplicateSessionsByUserId(sessions: ClientSession[], activeSessionId?: string | null): ClientSession[];
|
|
32
|
+
/**
|
|
33
|
+
* Normalize, deduplicate, and sort sessions
|
|
34
|
+
* This ensures consistent session ordering across the application
|
|
35
|
+
*
|
|
36
|
+
* @param sessions - Array of sessions to normalize
|
|
37
|
+
* @param activeSessionId - Optional active session ID to prioritize
|
|
38
|
+
* @param deduplicateByUserId - If true, deduplicate by userId (one account per user). Default: true
|
|
39
|
+
*/
|
|
40
|
+
export declare function normalizeAndSortSessions(sessions: ClientSession[], activeSessionId?: string | null, deduplicateByUserId?: boolean): ClientSession[];
|
|
41
|
+
/**
|
|
42
|
+
* Merge two session arrays, prioritizing newer data
|
|
43
|
+
* Returns normalized, deduplicated, and sorted sessions
|
|
44
|
+
*
|
|
45
|
+
* @param existing - Existing sessions array
|
|
46
|
+
* @param incoming - New sessions to merge in
|
|
47
|
+
* @param activeSessionId - Optional active session ID to prioritize
|
|
48
|
+
* @param deduplicateByUserId - If true, deduplicate by userId (one account per user). Default: true
|
|
49
|
+
*/
|
|
50
|
+
export declare function mergeSessions(existing: ClientSession[], incoming: ClientSession[], activeSessionId?: string | null, deduplicateByUserId?: boolean): ClientSession[];
|
|
51
|
+
/**
|
|
52
|
+
* Check if two session arrays are equal (same sessionIds in same order)
|
|
53
|
+
*/
|
|
54
|
+
export declare function sessionsArraysEqual(a: ClientSession[], b: ClientSession[]): boolean;
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Validation utilities for common data validation patterns
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Email validation regex
|
|
6
|
+
*/
|
|
7
|
+
export declare const EMAIL_REGEX: RegExp;
|
|
8
|
+
/**
|
|
9
|
+
* Username validation regex (alphanumeric, underscores, and hyphens, 3-30 chars)
|
|
10
|
+
*/
|
|
11
|
+
export declare const USERNAME_REGEX: RegExp;
|
|
12
|
+
/**
|
|
13
|
+
* Password validation regex (at least 8 chars, 1 uppercase, 1 lowercase, 1 number)
|
|
14
|
+
*/
|
|
15
|
+
export declare const PASSWORD_REGEX: RegExp;
|
|
16
|
+
/**
|
|
17
|
+
* Validate email format
|
|
18
|
+
*/
|
|
19
|
+
export declare function isValidEmail(email: string): boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Validate username format
|
|
22
|
+
*/
|
|
23
|
+
export declare function isValidUsername(username: string): boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Validate password strength
|
|
26
|
+
*/
|
|
27
|
+
export declare function isValidPassword(password: string): boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Validate required string
|
|
30
|
+
*/
|
|
31
|
+
export declare function isRequiredString(value: unknown): boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Validate required number
|
|
34
|
+
*/
|
|
35
|
+
export declare function isRequiredNumber(value: unknown): boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Validate required boolean
|
|
38
|
+
*/
|
|
39
|
+
export declare function isRequiredBoolean(value: unknown): boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Validate array
|
|
42
|
+
*/
|
|
43
|
+
export declare function isValidArray(value: unknown): boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Validate object
|
|
46
|
+
*/
|
|
47
|
+
export declare function isValidObject(value: unknown): boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Validate UUID format
|
|
50
|
+
*/
|
|
51
|
+
export declare function isValidUUID(uuid: string): boolean;
|
|
52
|
+
/**
|
|
53
|
+
* Validate URL format
|
|
54
|
+
*/
|
|
55
|
+
export declare function isValidURL(url: string): boolean;
|
|
56
|
+
/**
|
|
57
|
+
* Validate date string
|
|
58
|
+
*/
|
|
59
|
+
export declare function isValidDate(dateString: string): boolean;
|
|
60
|
+
/**
|
|
61
|
+
* Validate file size (in bytes)
|
|
62
|
+
*/
|
|
63
|
+
export declare function isValidFileSize(size: number, maxSize: number): boolean;
|
|
64
|
+
/**
|
|
65
|
+
* Validate file type
|
|
66
|
+
*/
|
|
67
|
+
export declare function isValidFileType(filename: string, allowedTypes: string[]): boolean;
|
|
68
|
+
/**
|
|
69
|
+
* Sanitize string input
|
|
70
|
+
*/
|
|
71
|
+
export declare function sanitizeString(input: string): string;
|
|
72
|
+
/**
|
|
73
|
+
* Sanitize HTML input
|
|
74
|
+
*/
|
|
75
|
+
export declare function sanitizeHTML(input: string): string;
|
|
76
|
+
/**
|
|
77
|
+
* Validate MongoDB ObjectId format
|
|
78
|
+
* Note: This is a basic format check. For full validation, use mongoose.Types.ObjectId.isValid()
|
|
79
|
+
* This function works in environments where mongoose may not be available (e.g., client-side)
|
|
80
|
+
*/
|
|
81
|
+
export declare function isValidObjectId(id: string): boolean;
|
|
82
|
+
/**
|
|
83
|
+
* Validate and sanitize user input
|
|
84
|
+
*/
|
|
85
|
+
export declare function validateAndSanitizeUserInput(input: unknown, type: 'string' | 'email' | 'username'): string | null;
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Web-Only Oxy Context
|
|
3
|
+
*
|
|
4
|
+
* Clean implementation with ZERO React Native dependencies.
|
|
5
|
+
* Provides FedCM, popup, and redirect authentication methods.
|
|
6
|
+
* Uses centralized AuthManager for token and session management.
|
|
7
|
+
*
|
|
8
|
+
* @module web/WebOxyContext
|
|
9
|
+
*/
|
|
10
|
+
import { type ReactNode } from 'react';
|
|
11
|
+
import { OxyServices } from '../core/OxyServices';
|
|
12
|
+
import { CrossDomainAuth } from '../core/CrossDomainAuth';
|
|
13
|
+
import { AuthManager } from '../core/AuthManager';
|
|
14
|
+
import type { User } from '../models/interfaces';
|
|
15
|
+
export interface WebAuthState {
|
|
16
|
+
user: User | null;
|
|
17
|
+
isAuthenticated: boolean;
|
|
18
|
+
isLoading: boolean;
|
|
19
|
+
error: string | null;
|
|
20
|
+
}
|
|
21
|
+
export interface WebAuthActions {
|
|
22
|
+
/**
|
|
23
|
+
* Sign in using the best available method (FedCM → Popup → Redirect)
|
|
24
|
+
*/
|
|
25
|
+
signIn: () => Promise<void>;
|
|
26
|
+
/**
|
|
27
|
+
* Sign in using FedCM (browser-native, Google-style)
|
|
28
|
+
* Falls back to popup if FedCM is not supported
|
|
29
|
+
*/
|
|
30
|
+
signInWithFedCM: () => Promise<void>;
|
|
31
|
+
/**
|
|
32
|
+
* Sign in using popup window
|
|
33
|
+
*/
|
|
34
|
+
signInWithPopup: () => Promise<void>;
|
|
35
|
+
/**
|
|
36
|
+
* Sign in using redirect (full page redirect to auth.oxy.so)
|
|
37
|
+
*/
|
|
38
|
+
signInWithRedirect: () => void;
|
|
39
|
+
/**
|
|
40
|
+
* Sign out and clear session
|
|
41
|
+
*/
|
|
42
|
+
signOut: () => Promise<void>;
|
|
43
|
+
/**
|
|
44
|
+
* Check if FedCM is supported in the current browser
|
|
45
|
+
*/
|
|
46
|
+
isFedCMSupported: () => boolean;
|
|
47
|
+
}
|
|
48
|
+
export interface WebOxyContextValue extends WebAuthState, WebAuthActions {
|
|
49
|
+
oxyServices: OxyServices;
|
|
50
|
+
crossDomainAuth: CrossDomainAuth;
|
|
51
|
+
authManager: AuthManager;
|
|
52
|
+
}
|
|
53
|
+
export interface WebOxyProviderProps {
|
|
54
|
+
children: ReactNode;
|
|
55
|
+
/** Base URL for the Oxy API (e.g., 'https://api.oxy.so') */
|
|
56
|
+
baseURL: string;
|
|
57
|
+
/** Optional auth web URL for popup/redirect (defaults to 'https://auth.oxy.so') */
|
|
58
|
+
authWebUrl?: string;
|
|
59
|
+
/** Callback when auth state changes */
|
|
60
|
+
onAuthStateChange?: (user: User | null) => void;
|
|
61
|
+
/** Callback when an error occurs */
|
|
62
|
+
onError?: (error: Error) => void;
|
|
63
|
+
/** Preferred auth method: 'auto' (default), 'fedcm', 'popup', or 'redirect' */
|
|
64
|
+
preferredAuthMethod?: 'auto' | 'fedcm' | 'popup' | 'redirect';
|
|
65
|
+
/** Skip automatic session check on mount */
|
|
66
|
+
skipAutoCheck?: boolean;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Web-only Oxy Provider
|
|
70
|
+
*
|
|
71
|
+
* Provides authentication context for pure web applications (React, Next.js, Vite).
|
|
72
|
+
* Supports FedCM, popup, and redirect authentication methods.
|
|
73
|
+
*
|
|
74
|
+
* @example
|
|
75
|
+
* ```tsx
|
|
76
|
+
* import { WebOxyProvider, useAuth } from '@oxyhq/services/web';
|
|
77
|
+
*
|
|
78
|
+
* function App() {
|
|
79
|
+
* return (
|
|
80
|
+
* <WebOxyProvider baseURL="https://api.oxy.so">
|
|
81
|
+
* <YourApp />
|
|
82
|
+
* </WebOxyProvider>
|
|
83
|
+
* );
|
|
84
|
+
* }
|
|
85
|
+
*
|
|
86
|
+
* function LoginButton() {
|
|
87
|
+
* const { signIn, isLoading, isFedCMSupported } = useAuth();
|
|
88
|
+
* return (
|
|
89
|
+
* <button onClick={signIn} disabled={isLoading}>
|
|
90
|
+
* {isFedCMSupported() ? 'Sign in with Oxy' : 'Sign in'}
|
|
91
|
+
* </button>
|
|
92
|
+
* );
|
|
93
|
+
* }
|
|
94
|
+
* ```
|
|
95
|
+
*/
|
|
96
|
+
export declare function WebOxyProvider({ children, baseURL, authWebUrl, onAuthStateChange, onError, preferredAuthMethod, skipAutoCheck, }: WebOxyProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
97
|
+
/**
|
|
98
|
+
* Hook to access the full Web Oxy context.
|
|
99
|
+
*
|
|
100
|
+
* @returns Full context value including oxyServices and crossDomainAuth
|
|
101
|
+
* @throws Error if used outside WebOxyProvider
|
|
102
|
+
*/
|
|
103
|
+
export declare function useWebOxy(): WebOxyContextValue;
|
|
104
|
+
/**
|
|
105
|
+
* Hook for authentication in web apps.
|
|
106
|
+
*
|
|
107
|
+
* Provides a simplified interface for common auth operations.
|
|
108
|
+
*
|
|
109
|
+
* @returns Auth state and actions
|
|
110
|
+
* @throws Error if used outside WebOxyProvider
|
|
111
|
+
*
|
|
112
|
+
* @example
|
|
113
|
+
* ```tsx
|
|
114
|
+
* function LoginPage() {
|
|
115
|
+
* const { user, isAuthenticated, isLoading, signIn, signOut, isFedCMSupported } = useAuth();
|
|
116
|
+
*
|
|
117
|
+
* if (isLoading) return <Spinner />;
|
|
118
|
+
*
|
|
119
|
+
* if (isAuthenticated) {
|
|
120
|
+
* return (
|
|
121
|
+
* <div>
|
|
122
|
+
* <p>Welcome, {user.username}!</p>
|
|
123
|
+
* <button onClick={signOut}>Sign Out</button>
|
|
124
|
+
* </div>
|
|
125
|
+
* );
|
|
126
|
+
* }
|
|
127
|
+
*
|
|
128
|
+
* return (
|
|
129
|
+
* <button onClick={signIn}>
|
|
130
|
+
* {isFedCMSupported() ? 'Sign in with Oxy' : 'Sign in'}
|
|
131
|
+
* </button>
|
|
132
|
+
* );
|
|
133
|
+
* }
|
|
134
|
+
* ```
|
|
135
|
+
*/
|
|
136
|
+
export declare function useAuth(): {
|
|
137
|
+
user: User | null;
|
|
138
|
+
isAuthenticated: boolean;
|
|
139
|
+
isLoading: boolean;
|
|
140
|
+
isReady: boolean;
|
|
141
|
+
error: string | null;
|
|
142
|
+
signIn: () => Promise<void>;
|
|
143
|
+
signInWithFedCM: () => Promise<void>;
|
|
144
|
+
signInWithPopup: () => Promise<void>;
|
|
145
|
+
signInWithRedirect: () => void;
|
|
146
|
+
signOut: () => Promise<void>;
|
|
147
|
+
isFedCMSupported: () => boolean;
|
|
148
|
+
oxyServices: OxyServices;
|
|
149
|
+
authManager: AuthManager;
|
|
150
|
+
};
|
|
151
|
+
export default WebOxyProvider;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @oxyhq/services/web - Web-Only Module
|
|
3
|
+
*
|
|
4
|
+
* Clean, professional web module with ZERO React Native dependencies.
|
|
5
|
+
* Perfect for Next.js, Vite, Create React App, and other pure React web apps.
|
|
6
|
+
*
|
|
7
|
+
* Features:
|
|
8
|
+
* - WebOxyProvider for React context
|
|
9
|
+
* - useAuth hook for authentication
|
|
10
|
+
* - Cross-domain SSO via FedCM, popup, or redirect
|
|
11
|
+
* - Full TypeScript support
|
|
12
|
+
* - Zero bundler configuration needed
|
|
13
|
+
*
|
|
14
|
+
* Usage:
|
|
15
|
+
* ```tsx
|
|
16
|
+
* import { WebOxyProvider, useAuth } from '@oxyhq/services/web';
|
|
17
|
+
*
|
|
18
|
+
* function App() {
|
|
19
|
+
* return (
|
|
20
|
+
* <WebOxyProvider baseURL="https://api.oxy.so">
|
|
21
|
+
* <YourApp />
|
|
22
|
+
* </WebOxyProvider>
|
|
23
|
+
* );
|
|
24
|
+
* }
|
|
25
|
+
*
|
|
26
|
+
* function YourApp() {
|
|
27
|
+
* const { user, isAuthenticated, signIn, signOut, isFedCMSupported } = useAuth();
|
|
28
|
+
*
|
|
29
|
+
* return (
|
|
30
|
+
* <button onClick={signIn}>
|
|
31
|
+
* {isFedCMSupported() ? 'Sign in with Oxy' : 'Sign in'}
|
|
32
|
+
* </button>
|
|
33
|
+
* );
|
|
34
|
+
* }
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
export { OxyServices, OxyAuthenticationError, OxyAuthenticationTimeoutError, OXY_CLOUD_URL, oxyClient, CrossDomainAuth, createCrossDomainAuth, DeviceManager, AuthManager, createAuthManager, } from '../core';
|
|
38
|
+
export type { CrossDomainAuthOptions, DeviceFingerprint, StoredDeviceInfo, StorageAdapter, AuthStateChangeCallback, AuthMethod, AuthManagerConfig, } from '../core';
|
|
39
|
+
export { WebOxyProvider, useWebOxy, useAuth, } from './WebOxyContext';
|
|
40
|
+
export type { WebOxyProviderProps, WebAuthState, WebAuthActions, WebOxyContextValue, } from './WebOxyContext';
|
|
41
|
+
export { darkenColor, lightenColor, hexToRgb, rgbToHex, withOpacity, isLightColor, getContrastTextColor, } from '../shared/utils/colorUtils';
|
|
42
|
+
export { normalizeTheme, normalizeColorScheme, getOppositeTheme, systemPrefersDarkMode, getSystemColorScheme, } from '../shared/utils/themeUtils';
|
|
43
|
+
export type { ThemeValue } from '../shared/utils/themeUtils';
|
|
44
|
+
export { HttpStatus, getErrorStatus, getErrorMessage, isAlreadyRegisteredError, isUnauthorizedError, isForbiddenError, isNotFoundError, isRateLimitError, isServerError, isNetworkError, isRetryableError, } from '../shared/utils/errorUtils';
|
|
45
|
+
export { delay, withRetry, } from '../shared/utils/networkUtils';
|
|
46
|
+
export type { User, ApiError, Notification, FileMetadata, AssetUploadProgress, PaymentMethod, KarmaLeaderboardEntry, KarmaRule, Transaction, DeviceSession, LoginResponse, } from '../models/interfaces';
|
|
47
|
+
export type { SessionLoginResponse } from '../models/session';
|
|
48
|
+
export type { ClientSession, MinimalUserData } from '../models/session';
|
|
49
|
+
export { SUPPORTED_LANGUAGES, getLanguageMetadata, getLanguageName, getNativeLanguageName, normalizeLanguageCode, } from '../utils/languageUtils';
|
|
50
|
+
export type { LanguageMetadata } from '../utils/languageUtils';
|
|
51
|
+
import { WebOxyProvider } from './WebOxyContext';
|
|
52
|
+
export default WebOxyProvider;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OxyHQServices Web Entry Point - Pure React/Next.js Apps
|
|
3
|
+
*
|
|
4
|
+
* This entry point is optimized for pure web applications without Expo or React Native.
|
|
5
|
+
* It excludes all React Native dependencies for a smaller bundle size.
|
|
6
|
+
*
|
|
7
|
+
* Use this for:
|
|
8
|
+
* - Pure React apps (Vite, Create React App)
|
|
9
|
+
* - Next.js apps
|
|
10
|
+
* - Any web-only application
|
|
11
|
+
*
|
|
12
|
+
* For Expo apps (native + web), use the main entry point instead:
|
|
13
|
+
* import { OxyProvider } from '@oxyhq/services';
|
|
14
|
+
*/
|
|
15
|
+
import './crypto/polyfill';
|
|
16
|
+
export { OxyServices, OxyAuthenticationError, OxyAuthenticationTimeoutError } from './core';
|
|
17
|
+
export { OXY_CLOUD_URL, oxyClient } from './core';
|
|
18
|
+
export { CrossDomainAuth, createCrossDomainAuth } from './core';
|
|
19
|
+
export type { CrossDomainAuthOptions } from './core';
|
|
20
|
+
export { KeyManager, SignatureService, RecoveryPhraseService } from './crypto';
|
|
21
|
+
export type { KeyPair, SignedMessage, AuthChallenge, RecoveryPhraseResult } from './crypto';
|
|
22
|
+
export { useOxy } from './ui/context/OxyContext';
|
|
23
|
+
export { useAuth } from './ui/hooks/useAuth';
|
|
24
|
+
export type { AuthState, AuthActions, UseAuthReturn } from './ui/hooks/useAuth';
|
|
25
|
+
export { default as WebOxyProvider } from './ui/components/WebOxyProvider';
|
|
26
|
+
export { DeviceManager } from './utils/deviceManager';
|
|
27
|
+
export type { DeviceFingerprint, StoredDeviceInfo } from './utils/deviceManager';
|
|
28
|
+
export { SUPPORTED_LANGUAGES, getLanguageMetadata, getLanguageName, getNativeLanguageName, normalizeLanguageCode } from './utils/languageUtils';
|
|
29
|
+
export type { LanguageMetadata } from './utils/languageUtils';
|
|
30
|
+
export type { OxyConfig, User, LoginResponse, Notification, Wallet, Transaction, TransferFundsRequest, PurchaseRequest, WithdrawalRequest, TransactionResponse, KarmaRule, KarmaHistory, KarmaLeaderboardEntry, KarmaAwardRequest, ApiError, PaymentMethod, PaymentRequest, PaymentResponse, AnalyticsData, FollowerDetails, ContentViewer, FileMetadata, FileUploadResponse, FileListResponse, FileUpdateRequest, FileDeleteResponse, DeviceSession, DeviceSessionsResponse, DeviceSessionLogoutResponse, UpdateDeviceNameResponse, BlockedUser, RestrictedUser, FileVisibility, AssetLink, AssetVariant, Asset, AssetInitRequest, AssetInitResponse, AssetCompleteRequest, AssetLinkRequest, AssetUnlinkRequest, AssetUrlResponse, AssetDeleteSummary, AssetUploadProgress, AssetUpdateVisibilityRequest, AssetUpdateVisibilityResponse, AccountStorageCategoryUsage, AccountStorageUsageResponse, SecurityEventType, SecurityEventSeverity, SecurityActivity, SecurityActivityResponse } from './models/interfaces';
|
|
31
|
+
export { SECURITY_EVENT_SEVERITY_MAP } from './models/interfaces';
|
|
32
|
+
export type { SessionLoginResponse, ClientSession, MinimalUserData } from './models/session';
|
|
33
|
+
export { useAuthStore } from './ui/stores/authStore';
|
|
34
|
+
export { useAssetStore, useAssets as useAssetsStore, useAsset, useUploadProgress, useAssetLoading, useAssetErrors, useAssetsByApp, useAssetsByEntity, useAssetUsageCount, useIsAssetLinked } from './ui/stores/assetStore';
|
|
35
|
+
export { useSessionSocket } from './ui/hooks/useSessionSocket';
|
|
36
|
+
export { useAssets, setOxyAssetInstance } from './ui/hooks/useAssets';
|
|
37
|
+
export { useFileDownloadUrl, setOxyFileUrlInstance } from './ui/hooks/useFileDownloadUrl';
|
|
38
|
+
export { useUserProfile, useUserProfiles, useCurrentUser, useUserById, useUserByUsername, useUsersBySessions, usePrivacySettings, useSessions, useSession, useDeviceSessions, useUserDevices, useSecurityInfo, useSecurityActivity, useRecentSecurityActivity, } from './ui/hooks/queries';
|
|
39
|
+
export { useUpdateProfile, useUploadAvatar, useUpdateAccountSettings, useUpdatePrivacySettings, useUploadFile, useSwitchSession, useLogoutSession, useLogoutAll, useUpdateDeviceName, useRemoveDevice, } from './ui/hooks/mutations';
|
|
40
|
+
export { createProfileMutation, createGenericMutation, } from './ui/hooks/mutations/mutationFactory';
|
|
41
|
+
export type { ProfileMutationConfig, GenericMutationConfig, } from './ui/hooks/mutations/mutationFactory';
|
|
42
|
+
export { ensureValidToken, withAuthErrorHandling, authenticatedApiCall, isAuthenticationError, SessionSyncRequiredError, AuthenticationFailedError, } from './ui/utils/authHelpers';
|
|
43
|
+
export type { HandleApiErrorOptions } from './ui/utils/authHelpers';
|
|
44
|
+
export { useFileFiltering } from './ui/hooks/useFileFiltering';
|
|
45
|
+
export type { ViewMode, SortBy, SortOrder } from './ui/hooks/useFileFiltering';
|
|
46
|
+
export * from './utils/apiUtils';
|
|
47
|
+
export { ErrorCodes, createApiError, handleHttpError, validateRequiredFields, } from './utils/errorUtils';
|
|
48
|
+
export { retryAsync } from './utils/asyncUtils';
|
|
49
|
+
export * from './utils/validationUtils';
|
|
50
|
+
export { logger, LogLevel, logAuth, logApi, logSession, logUser, logDevice, logPayment, logPerformance } from './utils/loggerUtils';
|
|
51
|
+
export type { LogContext } from './utils/loggerUtils';
|
|
52
|
+
export * from './utils/asyncUtils';
|
|
53
|
+
export * from './utils/hookUtils';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oxyhq/services",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.27.0",
|
|
4
4
|
"description": "Reusable OxyHQ module to handle authentication, user management, karma system, device-based session management and more 🚀",
|
|
5
5
|
"main": "lib/commonjs/index.js",
|
|
6
6
|
"module": "lib/module/index.js",
|
|
@@ -30,10 +30,15 @@
|
|
|
30
30
|
"default": "./lib/module/index.js"
|
|
31
31
|
},
|
|
32
32
|
"./web": {
|
|
33
|
-
"types": "./lib/typescript/module/web
|
|
34
|
-
"import": "./lib/module/web
|
|
35
|
-
"require": "./lib/commonjs/web
|
|
36
|
-
"default": "./lib/module/web
|
|
33
|
+
"types": "./lib/typescript/module/web.d.ts",
|
|
34
|
+
"import": "./lib/module/web.js",
|
|
35
|
+
"require": "./lib/commonjs/web.js",
|
|
36
|
+
"default": "./lib/module/web.js"
|
|
37
|
+
},
|
|
38
|
+
"./web/bundle": {
|
|
39
|
+
"types": "./dist/web/types/web.d.ts",
|
|
40
|
+
"import": "./dist/web/oxy-services.esm.js",
|
|
41
|
+
"default": "./dist/web/oxy-services.esm.js"
|
|
37
42
|
},
|
|
38
43
|
"./core": {
|
|
39
44
|
"types": "./lib/typescript/module/core/index.d.ts",
|
|
@@ -74,6 +79,7 @@
|
|
|
74
79
|
"files": [
|
|
75
80
|
"src",
|
|
76
81
|
"lib",
|
|
82
|
+
"dist",
|
|
77
83
|
"assets"
|
|
78
84
|
],
|
|
79
85
|
"keywords": [
|
|
@@ -99,7 +105,8 @@
|
|
|
99
105
|
"scripts": {
|
|
100
106
|
"typescript": "tsc --skipLibCheck --noEmit",
|
|
101
107
|
"lint": "biome lint --error-on-warnings ./src",
|
|
102
|
-
"build": "npx react-native-builder-bob build && npm run copy-assets && npm run copy-dts && npm run delete-dts.js && npm run delete-debug-view",
|
|
108
|
+
"build": "npx react-native-builder-bob build && npm run build:web && npm run copy-assets && npm run copy-dts && npm run delete-dts.js && npm run delete-debug-view",
|
|
109
|
+
"build:web": "rollup -c rollup.config.web.mjs",
|
|
103
110
|
"test": "jest",
|
|
104
111
|
"test:watch": "jest --watch",
|
|
105
112
|
"test:coverage": "jest --coverage",
|
|
@@ -128,6 +135,13 @@
|
|
|
128
135
|
"typescript": "^5.9.2"
|
|
129
136
|
},
|
|
130
137
|
"devDependencies": {
|
|
138
|
+
"@rollup/plugin-commonjs": "^28.0.0",
|
|
139
|
+
"@rollup/plugin-json": "^6.1.0",
|
|
140
|
+
"@rollup/plugin-node-resolve": "^16.0.0",
|
|
141
|
+
"@rollup/plugin-replace": "^6.0.0",
|
|
142
|
+
"@rollup/plugin-terser": "^0.4.4",
|
|
143
|
+
"@rollup/plugin-typescript": "^12.1.0",
|
|
144
|
+
"rollup": "^4.28.0",
|
|
131
145
|
"@biomejs/biome": "^1.9.4",
|
|
132
146
|
"@commitlint/cli": "^17.6.5",
|
|
133
147
|
"@commitlint/config-conventional": "^17.6.5",
|