@oxyhq/services 5.7.5 → 5.8.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 +76 -76
- package/lib/commonjs/core/index.js +177 -102
- package/lib/commonjs/core/index.js.map +1 -1
- package/lib/commonjs/index.js +69 -28
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/ui/components/Avatar.js +15 -6
- package/lib/commonjs/ui/components/Avatar.js.map +1 -1
- package/lib/commonjs/ui/components/FollowButton.js +100 -12
- package/lib/commonjs/ui/components/FollowButton.js.map +1 -1
- package/lib/commonjs/ui/components/GroupedItem.js +58 -13
- package/lib/commonjs/ui/components/GroupedItem.js.map +1 -1
- package/lib/commonjs/ui/components/GroupedSection.js +7 -1
- package/lib/commonjs/ui/components/GroupedSection.js.map +1 -1
- package/lib/commonjs/ui/components/Header.js +356 -0
- package/lib/commonjs/ui/components/Header.js.map +1 -0
- package/lib/commonjs/ui/components/OxyProvider.js +28 -7
- package/lib/commonjs/ui/components/OxyProvider.js.map +1 -1
- package/lib/commonjs/ui/components/index.js +7 -0
- package/lib/commonjs/ui/components/index.js.map +1 -1
- package/lib/commonjs/ui/components/internal/GroupedPillButtons.js +1 -1
- package/lib/commonjs/ui/components/internal/GroupedPillButtons.js.map +1 -1
- package/lib/commonjs/ui/components/internal/TextField.js +606 -546
- package/lib/commonjs/ui/components/internal/TextField.js.map +1 -1
- package/lib/commonjs/ui/components/internal/TextField.md +436 -0
- package/lib/commonjs/ui/context/OxyContext.js +181 -199
- package/lib/commonjs/ui/context/OxyContext.js.map +1 -1
- package/lib/commonjs/ui/hooks/index.js +6 -0
- package/lib/commonjs/ui/hooks/index.js.map +1 -1
- package/lib/commonjs/ui/hooks/useFollow.js +59 -2
- package/lib/commonjs/ui/hooks/useFollow.js.map +1 -1
- package/lib/commonjs/ui/hooks/useSessionSocket.js +5 -2
- package/lib/commonjs/ui/hooks/useSessionSocket.js.map +1 -1
- package/lib/commonjs/ui/navigation/OxyRouter.js +11 -1
- package/lib/commonjs/ui/navigation/OxyRouter.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountCenterScreen.js +6 -6
- package/lib/commonjs/ui/screens/AccountCenterScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountManagementDemo.js +3 -3
- package/lib/commonjs/ui/screens/AccountManagementDemo.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountOverviewScreen.js +241 -598
- package/lib/commonjs/ui/screens/AccountOverviewScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountSettingsScreen.js +1160 -406
- package/lib/commonjs/ui/screens/AccountSettingsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountSwitcherScreen.js +135 -237
- package/lib/commonjs/ui/screens/AccountSwitcherScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AppInfoScreen.js +246 -463
- package/lib/commonjs/ui/screens/AppInfoScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/FeedbackScreen.js +3 -3
- package/lib/commonjs/ui/screens/FeedbackScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/PaymentGatewayScreen.js +808 -650
- package/lib/commonjs/ui/screens/PaymentGatewayScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/ProfileScreen.js +214 -37
- package/lib/commonjs/ui/screens/ProfileScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/RecoverAccountScreen.js +51 -72
- package/lib/commonjs/ui/screens/RecoverAccountScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/SessionManagementScreen.js +11 -29
- package/lib/commonjs/ui/screens/SessionManagementScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/SignInScreen.js +30 -303
- package/lib/commonjs/ui/screens/SignInScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/SignUpScreen.js +4 -4
- package/lib/commonjs/ui/screens/SignUpScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/UserLinksScreen.js +90 -0
- package/lib/commonjs/ui/screens/UserLinksScreen.js.map +1 -0
- package/lib/commonjs/ui/screens/internal/SignInPasswordStep.js +19 -31
- package/lib/commonjs/ui/screens/internal/SignInPasswordStep.js.map +1 -1
- package/lib/commonjs/ui/screens/internal/SignInUsernameStep.js +7 -10
- package/lib/commonjs/ui/screens/internal/SignInUsernameStep.js.map +1 -1
- package/lib/commonjs/ui/screens/internal/SignUpIdentityStep.js +11 -5
- package/lib/commonjs/ui/screens/internal/SignUpIdentityStep.js.map +1 -1
- package/lib/commonjs/ui/screens/internal/SignUpSecurityStep.js +11 -4
- package/lib/commonjs/ui/screens/internal/SignUpSecurityStep.js.map +1 -1
- package/lib/commonjs/ui/screens/karma/KarmaAboutScreen.js +9 -6
- package/lib/commonjs/ui/screens/karma/KarmaAboutScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/karma/KarmaCenterScreen.js +3 -30
- package/lib/commonjs/ui/screens/karma/KarmaCenterScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/karma/KarmaFAQScreen.js +37 -46
- package/lib/commonjs/ui/screens/karma/KarmaFAQScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/karma/KarmaLeaderboardScreen.js +9 -12
- package/lib/commonjs/ui/screens/karma/KarmaLeaderboardScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/karma/KarmaRewardsScreen.js +9 -12
- package/lib/commonjs/ui/screens/karma/KarmaRewardsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/karma/KarmaRulesScreen.js +9 -12
- package/lib/commonjs/ui/screens/karma/KarmaRulesScreen.js.map +1 -1
- package/lib/commonjs/ui/stores/authStore.js +36 -6
- package/lib/commonjs/ui/stores/authStore.js.map +1 -1
- package/lib/commonjs/ui/stores/followStore.js +106 -1
- package/lib/commonjs/ui/stores/followStore.js.map +1 -1
- package/lib/commonjs/ui/styles/authStyles.js +337 -0
- package/lib/commonjs/ui/styles/authStyles.js.map +1 -0
- package/lib/commonjs/ui/styles/index.js +11 -0
- package/lib/commonjs/ui/styles/index.js.map +1 -1
- package/lib/module/core/index.js +177 -41
- package/lib/module/core/index.js.map +1 -1
- package/lib/module/index.js +24 -4
- package/lib/module/index.js.map +1 -1
- package/lib/module/ui/components/Avatar.js +15 -6
- package/lib/module/ui/components/Avatar.js.map +1 -1
- package/lib/module/ui/components/FollowButton.js +101 -13
- package/lib/module/ui/components/FollowButton.js.map +1 -1
- package/lib/module/ui/components/GroupedItem.js +59 -14
- package/lib/module/ui/components/GroupedItem.js.map +1 -1
- package/lib/module/ui/components/GroupedSection.js +7 -1
- package/lib/module/ui/components/GroupedSection.js.map +1 -1
- package/lib/module/ui/components/Header.js +351 -0
- package/lib/module/ui/components/Header.js.map +1 -0
- package/lib/module/ui/components/OxyProvider.js +30 -9
- package/lib/module/ui/components/OxyProvider.js.map +1 -1
- package/lib/module/ui/components/index.js +1 -0
- package/lib/module/ui/components/index.js.map +1 -1
- package/lib/module/ui/components/internal/GroupedPillButtons.js +1 -1
- package/lib/module/ui/components/internal/GroupedPillButtons.js.map +1 -1
- package/lib/module/ui/components/internal/TextField.js +607 -547
- package/lib/module/ui/components/internal/TextField.js.map +1 -1
- package/lib/module/ui/components/internal/TextField.md +436 -0
- package/lib/module/ui/context/OxyContext.js +180 -198
- package/lib/module/ui/context/OxyContext.js.map +1 -1
- package/lib/module/ui/hooks/index.js +1 -1
- package/lib/module/ui/hooks/index.js.map +1 -1
- package/lib/module/ui/hooks/useFollow.js +57 -1
- package/lib/module/ui/hooks/useFollow.js.map +1 -1
- package/lib/module/ui/hooks/useSessionSocket.js +5 -2
- package/lib/module/ui/hooks/useSessionSocket.js.map +1 -1
- package/lib/module/ui/navigation/OxyRouter.js +11 -1
- package/lib/module/ui/navigation/OxyRouter.js.map +1 -1
- package/lib/module/ui/screens/AccountCenterScreen.js +6 -6
- package/lib/module/ui/screens/AccountCenterScreen.js.map +1 -1
- package/lib/module/ui/screens/AccountManagementDemo.js +3 -3
- package/lib/module/ui/screens/AccountManagementDemo.js.map +1 -1
- package/lib/module/ui/screens/AccountOverviewScreen.js +242 -597
- package/lib/module/ui/screens/AccountOverviewScreen.js.map +1 -1
- package/lib/module/ui/screens/AccountSettingsScreen.js +1161 -407
- package/lib/module/ui/screens/AccountSettingsScreen.js.map +1 -1
- package/lib/module/ui/screens/AccountSwitcherScreen.js +135 -237
- package/lib/module/ui/screens/AccountSwitcherScreen.js.map +1 -1
- package/lib/module/ui/screens/AppInfoScreen.js +248 -465
- package/lib/module/ui/screens/AppInfoScreen.js.map +1 -1
- package/lib/module/ui/screens/FeedbackScreen.js +3 -3
- package/lib/module/ui/screens/FeedbackScreen.js.map +1 -1
- package/lib/module/ui/screens/PaymentGatewayScreen.js +809 -651
- package/lib/module/ui/screens/PaymentGatewayScreen.js.map +1 -1
- package/lib/module/ui/screens/ProfileScreen.js +214 -37
- package/lib/module/ui/screens/ProfileScreen.js.map +1 -1
- package/lib/module/ui/screens/RecoverAccountScreen.js +53 -74
- package/lib/module/ui/screens/RecoverAccountScreen.js.map +1 -1
- package/lib/module/ui/screens/SessionManagementScreen.js +11 -29
- package/lib/module/ui/screens/SessionManagementScreen.js.map +1 -1
- package/lib/module/ui/screens/SignInScreen.js +32 -305
- package/lib/module/ui/screens/SignInScreen.js.map +1 -1
- package/lib/module/ui/screens/SignUpScreen.js +5 -5
- package/lib/module/ui/screens/SignUpScreen.js.map +1 -1
- package/lib/module/ui/screens/UserLinksScreen.js +85 -0
- package/lib/module/ui/screens/UserLinksScreen.js.map +1 -0
- package/lib/module/ui/screens/internal/SignInPasswordStep.js +19 -31
- package/lib/module/ui/screens/internal/SignInPasswordStep.js.map +1 -1
- package/lib/module/ui/screens/internal/SignInUsernameStep.js +7 -10
- package/lib/module/ui/screens/internal/SignInUsernameStep.js.map +1 -1
- package/lib/module/ui/screens/internal/SignUpIdentityStep.js +11 -5
- package/lib/module/ui/screens/internal/SignUpIdentityStep.js.map +1 -1
- package/lib/module/ui/screens/internal/SignUpSecurityStep.js +11 -4
- package/lib/module/ui/screens/internal/SignUpSecurityStep.js.map +1 -1
- package/lib/module/ui/screens/karma/KarmaAboutScreen.js +9 -6
- package/lib/module/ui/screens/karma/KarmaAboutScreen.js.map +1 -1
- package/lib/module/ui/screens/karma/KarmaCenterScreen.js +3 -30
- package/lib/module/ui/screens/karma/KarmaCenterScreen.js.map +1 -1
- package/lib/module/ui/screens/karma/KarmaFAQScreen.js +37 -46
- package/lib/module/ui/screens/karma/KarmaFAQScreen.js.map +1 -1
- package/lib/module/ui/screens/karma/KarmaLeaderboardScreen.js +9 -12
- package/lib/module/ui/screens/karma/KarmaLeaderboardScreen.js.map +1 -1
- package/lib/module/ui/screens/karma/KarmaRewardsScreen.js +9 -12
- package/lib/module/ui/screens/karma/KarmaRewardsScreen.js.map +1 -1
- package/lib/module/ui/screens/karma/KarmaRulesScreen.js +9 -12
- package/lib/module/ui/screens/karma/KarmaRulesScreen.js.map +1 -1
- package/lib/module/ui/stores/authStore.js +36 -6
- package/lib/module/ui/stores/authStore.js.map +1 -1
- package/lib/module/ui/stores/followStore.js +106 -1
- package/lib/module/ui/stores/followStore.js.map +1 -1
- package/lib/module/ui/styles/authStyles.js +332 -0
- package/lib/module/ui/styles/authStyles.js.map +1 -0
- package/lib/module/ui/styles/index.js +1 -0
- package/lib/module/ui/styles/index.js.map +1 -1
- package/lib/typescript/core/index.d.ts +68 -24
- package/lib/typescript/core/index.d.ts.map +1 -1
- package/lib/typescript/index.d.ts +13 -3
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/ui/components/Avatar.d.ts.map +1 -1
- package/lib/typescript/ui/components/FollowButton.d.ts +1 -0
- package/lib/typescript/ui/components/FollowButton.d.ts.map +1 -1
- package/lib/typescript/ui/components/GroupedItem.d.ts +6 -0
- package/lib/typescript/ui/components/GroupedItem.d.ts.map +1 -1
- package/lib/typescript/ui/components/GroupedSection.d.ts +6 -0
- package/lib/typescript/ui/components/GroupedSection.d.ts.map +1 -1
- package/lib/typescript/ui/components/Header.d.ts +24 -0
- package/lib/typescript/ui/components/Header.d.ts.map +1 -0
- package/lib/typescript/ui/components/OxyProvider.d.ts.map +1 -1
- package/lib/typescript/ui/components/index.d.ts +1 -0
- package/lib/typescript/ui/components/index.d.ts.map +1 -1
- package/lib/typescript/ui/components/internal/TextField.d.ts +31 -16
- package/lib/typescript/ui/components/internal/TextField.d.ts.map +1 -1
- package/lib/typescript/ui/context/OxyContext.d.ts +5 -2
- package/lib/typescript/ui/context/OxyContext.d.ts.map +1 -1
- package/lib/typescript/ui/hooks/index.d.ts +1 -1
- package/lib/typescript/ui/hooks/index.d.ts.map +1 -1
- package/lib/typescript/ui/hooks/useFollow.d.ts +20 -0
- package/lib/typescript/ui/hooks/useFollow.d.ts.map +1 -1
- package/lib/typescript/ui/hooks/useSessionSocket.d.ts.map +1 -1
- package/lib/typescript/ui/navigation/OxyRouter.d.ts.map +1 -1
- package/lib/typescript/ui/navigation/types.d.ts +9 -2
- package/lib/typescript/ui/navigation/types.d.ts.map +1 -1
- package/lib/typescript/ui/screens/AccountOverviewScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/AccountSettingsScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/AccountSwitcherScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/AppInfoScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/PaymentGatewayScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/ProfileScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/RecoverAccountScreen.d.ts +5 -1
- package/lib/typescript/ui/screens/RecoverAccountScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/SessionManagementScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/SignInScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/UserLinksScreen.d.ts +15 -0
- package/lib/typescript/ui/screens/UserLinksScreen.d.ts.map +1 -0
- 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 +0 -1
- package/lib/typescript/ui/screens/internal/SignInUsernameStep.d.ts.map +1 -1
- package/lib/typescript/ui/screens/internal/SignUpIdentityStep.d.ts.map +1 -1
- package/lib/typescript/ui/screens/internal/SignUpSecurityStep.d.ts.map +1 -1
- package/lib/typescript/ui/screens/karma/KarmaAboutScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/karma/KarmaCenterScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/karma/KarmaFAQScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/karma/KarmaLeaderboardScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/karma/KarmaRewardsScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/karma/KarmaRulesScreen.d.ts.map +1 -1
- package/lib/typescript/ui/stores/authStore.d.ts +3 -1
- package/lib/typescript/ui/stores/authStore.d.ts.map +1 -1
- package/lib/typescript/ui/stores/followStore.d.ts +10 -0
- package/lib/typescript/ui/stores/followStore.d.ts.map +1 -1
- package/lib/typescript/ui/styles/authStyles.d.ts +326 -0
- package/lib/typescript/ui/styles/authStyles.d.ts.map +1 -0
- package/lib/typescript/ui/styles/index.d.ts +1 -0
- package/lib/typescript/ui/styles/index.d.ts.map +1 -1
- package/package.json +1 -4
- package/src/core/index.ts +195 -41
- package/src/index.ts +64 -4
- package/src/ui/components/Avatar.tsx +11 -5
- package/src/ui/components/FollowButton.tsx +95 -11
- package/src/ui/components/GroupedItem.tsx +57 -9
- package/src/ui/components/GroupedSection.tsx +12 -0
- package/src/ui/components/Header.tsx +405 -0
- package/src/ui/components/OxyProvider.tsx +37 -15
- package/src/ui/components/index.ts +1 -0
- package/src/ui/components/internal/GroupedPillButtons.tsx +1 -1
- package/src/ui/components/internal/TextField.md +436 -0
- package/src/ui/components/internal/TextField.tsx +720 -620
- package/src/ui/context/OxyContext.tsx +211 -195
- package/src/ui/hooks/index.ts +1 -1
- package/src/ui/hooks/useFollow.ts +63 -0
- package/src/ui/hooks/useSessionSocket.ts +5 -2
- package/src/ui/navigation/OxyRouter.tsx +11 -1
- package/src/ui/navigation/types.ts +10 -2
- package/src/ui/screens/AccountCenterScreen.tsx +5 -5
- package/src/ui/screens/AccountManagementDemo.tsx +9 -9
- package/src/ui/screens/AccountOverviewScreen.tsx +265 -414
- package/src/ui/screens/AccountSettingsScreen.tsx +1173 -403
- package/src/ui/screens/AccountSwitcherScreen.tsx +158 -202
- package/src/ui/screens/AppInfoScreen.tsx +270 -497
- package/src/ui/screens/FeedbackScreen.tsx +3 -3
- package/src/ui/screens/PaymentGatewayScreen.tsx +668 -365
- package/src/ui/screens/ProfileScreen.tsx +196 -33
- package/src/ui/screens/RecoverAccountScreen.tsx +46 -74
- package/src/ui/screens/SessionManagementScreen.tsx +14 -22
- package/src/ui/screens/SignInScreen.tsx +27 -294
- package/src/ui/screens/SignUpScreen.tsx +5 -5
- package/src/ui/screens/UserLinksScreen.tsx +96 -0
- package/src/ui/screens/internal/SignInPasswordStep.tsx +11 -22
- package/src/ui/screens/internal/SignInUsernameStep.tsx +3 -10
- package/src/ui/screens/internal/SignUpIdentityStep.tsx +2 -5
- package/src/ui/screens/internal/SignUpSecurityStep.tsx +3 -4
- package/src/ui/screens/karma/KarmaAboutScreen.tsx +9 -2
- package/src/ui/screens/karma/KarmaCenterScreen.tsx +1 -20
- package/src/ui/screens/karma/KarmaFAQScreen.tsx +40 -24
- package/src/ui/screens/karma/KarmaLeaderboardScreen.tsx +9 -3
- package/src/ui/screens/karma/KarmaRewardsScreen.tsx +9 -3
- package/src/ui/screens/karma/KarmaRulesScreen.tsx +9 -3
- package/src/ui/stores/authStore.ts +34 -7
- package/src/ui/stores/followStore.ts +102 -1
- package/src/ui/styles/authStyles.ts +352 -0
- package/src/ui/styles/index.ts +1 -0
- package/lib/commonjs/core/auth-manager.js +0 -440
- package/lib/commonjs/core/auth-manager.js.map +0 -1
- package/lib/commonjs/core/use-auth.js +0 -244
- package/lib/commonjs/core/use-auth.js.map +0 -1
- package/lib/module/core/auth-manager.js +0 -432
- package/lib/module/core/auth-manager.js.map +0 -1
- package/lib/module/core/use-auth.js +0 -235
- package/lib/module/core/use-auth.js.map +0 -1
- package/lib/typescript/core/auth-manager.d.ts +0 -136
- package/lib/typescript/core/auth-manager.d.ts.map +0 -1
- package/lib/typescript/core/use-auth.d.ts +0 -79
- package/lib/typescript/core/use-auth.d.ts.map +0 -1
- package/src/__tests__/middleware.test.ts +0 -105
- package/src/__tests__/setup.ts +0 -10
- package/src/__tests__/zero-config-auth.test.ts +0 -607
- package/src/core/auth-manager.ts +0 -500
- package/src/core/use-auth.tsx +0 -245
package/README.md
CHANGED
|
@@ -1,100 +1,95 @@
|
|
|
1
1
|
# OxyHQServices
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A TypeScript client library for the Oxy API providing authentication, user management, and UI components for React and React Native applications.
|
|
4
|
+
|
|
5
|
+
## Table of Contents
|
|
6
|
+
|
|
7
|
+
- [Features](#features)
|
|
8
|
+
- [Quick Start](#quick-start)
|
|
9
|
+
- [Documentation](#documentation)
|
|
10
|
+
- [UI Components](#ui-components)
|
|
11
|
+
- [Package Exports](#package-exports)
|
|
12
|
+
- [Requirements](#requirements)
|
|
13
|
+
- [Development](#development)
|
|
14
|
+
- [Integration](#integration)
|
|
15
|
+
- [License](#license)
|
|
4
16
|
|
|
5
|
-
##
|
|
17
|
+
## Features
|
|
6
18
|
|
|
7
|
-
|
|
19
|
+
- 🔐 **Streamlined Authentication**: Zero-config authentication with automatic token management
|
|
20
|
+
- 🔄 **Auto Token Refresh**: Seamless token lifecycle management behind the scenes
|
|
21
|
+
- 👥 **User Management**: Profile operations and social features
|
|
22
|
+
- 🎨 **UI Components**: Pre-built React components for common functionality
|
|
23
|
+
- 📱 **Cross-Platform**: Works in React Native and web applications
|
|
24
|
+
- 🔧 **TypeScript**: Full type safety and IntelliSense support
|
|
25
|
+
- 🚀 **Performance**: Optimized with automatic caching and state management
|
|
26
|
+
|
|
27
|
+
## Quick Start
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
npm install @oxyhq/services
|
|
31
|
+
```
|
|
8
32
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
33
|
+
### Streamlined Authentication (Recommended)
|
|
34
|
+
|
|
35
|
+
```typescript
|
|
36
|
+
import { OxyProvider, useOxy } from '@oxyhq/services';
|
|
12
37
|
|
|
13
|
-
// 1. Wrap your app (that's it for setup!)
|
|
14
38
|
function App() {
|
|
15
39
|
return (
|
|
16
|
-
<
|
|
17
|
-
<
|
|
18
|
-
</
|
|
40
|
+
<OxyProvider baseURL="https://api.example.com">
|
|
41
|
+
<YourApp />
|
|
42
|
+
</OxyProvider>
|
|
19
43
|
);
|
|
20
44
|
}
|
|
21
45
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
const { isAuthenticated, user, login, logout } = useAuth();
|
|
46
|
+
function UserProfile() {
|
|
47
|
+
const { oxyServices } = useOxy();
|
|
25
48
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
<div>
|
|
32
|
-
<h1>Welcome {user?.username}!</h1>
|
|
33
|
-
<button onClick={logout}>Logout</button>
|
|
34
|
-
</div>
|
|
35
|
-
);
|
|
49
|
+
const fetchData = async () => {
|
|
50
|
+
// No manual authentication needed - everything is automatic!
|
|
51
|
+
const user = await oxyServices.getCurrentUser();
|
|
52
|
+
const notifications = await oxyServices.getNotifications();
|
|
53
|
+
};
|
|
36
54
|
}
|
|
37
55
|
```
|
|
38
56
|
|
|
39
|
-
###
|
|
57
|
+
### With Built-in Bottom Sheet
|
|
58
|
+
|
|
59
|
+
The OxyProvider now includes a built-in gorhom bottom sheet - no manual setup required!
|
|
40
60
|
|
|
41
61
|
```typescript
|
|
42
|
-
import
|
|
43
|
-
import { authenticateRequest, OxyRequest } from '@oxyhq/services/api';
|
|
62
|
+
import { OxyProvider, useOxy, OxySignInButton } from '@oxyhq/services';
|
|
44
63
|
|
|
45
|
-
|
|
64
|
+
function App() {
|
|
65
|
+
return (
|
|
66
|
+
<OxyProvider
|
|
67
|
+
baseURL="https://api.example.com"
|
|
68
|
+
initialScreen="SignIn"
|
|
69
|
+
theme="light"
|
|
70
|
+
>
|
|
71
|
+
<YourApp />
|
|
72
|
+
</OxyProvider>
|
|
73
|
+
);
|
|
74
|
+
}
|
|
46
75
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
76
|
+
function Component() {
|
|
77
|
+
const { showBottomSheet } = useOxy();
|
|
78
|
+
|
|
79
|
+
const openSignIn = () => {
|
|
80
|
+
showBottomSheet('SignIn'); // Works automatically!
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
return (
|
|
84
|
+
<div>
|
|
85
|
+
<button onClick={openSignIn}>Sign In</button>
|
|
86
|
+
<OxySignInButton /> {/* Also works automatically! */}
|
|
87
|
+
</div>
|
|
88
|
+
);
|
|
89
|
+
}
|
|
55
90
|
```
|
|
56
91
|
|
|
57
|
-
|
|
58
|
-
- ✅ Automatic token management and refresh
|
|
59
|
-
- ✅ Secure storage across app restarts
|
|
60
|
-
- ✅ Built-in error handling and retry logic
|
|
61
|
-
- ✅ Cross-platform support (React Native + Web)
|
|
62
|
-
- ✅ TypeScript support throughout
|
|
63
|
-
|
|
64
|
-
## 📖 Documentation
|
|
65
|
-
|
|
66
|
-
- **[🚀 Zero-Config Authentication Guide](./packages/services/ZERO_CONFIG_AUTH.md)** - Complete setup guide
|
|
67
|
-
- **[🔧 Migration Guide](./packages/services/ZERO_CONFIG_AUTH.md#migration-from-legacy-authentication)** - Upgrade from legacy auth
|
|
68
|
-
- **[📚 Examples](./packages/services/examples/)** - Complete integration examples
|
|
69
|
-
- **[🔐 API Reference](./packages/services/ZERO_CONFIG_AUTH.md#complete-api-reference)** - All components and hooks
|
|
70
|
-
|
|
71
|
-
## Table of Contents
|
|
72
|
-
|
|
73
|
-
- [Legacy Features](#features)
|
|
74
|
-
- [Legacy Quick Start](#quick-start)
|
|
75
|
-
- [Package Exports](#package-exports)
|
|
76
|
-
- [Requirements](#requirements)
|
|
77
|
-
- [Development](#development)
|
|
78
|
-
- [Integration](#integration)
|
|
79
|
-
- [License](#license)
|
|
80
|
-
|
|
81
|
-
---
|
|
82
|
-
|
|
83
|
-
## Legacy Features (Still Supported)
|
|
84
|
-
|
|
85
|
-
A TypeScript client library for the Oxy API providing authentication, user management, and UI components for React and React Native applications.
|
|
86
|
-
|
|
87
|
-
- 🔐 **Authentication**: JWT-based auth with automatic token refresh
|
|
88
|
-
- 👥 **User Management**: Profile operations and social features
|
|
89
|
-
- 🎨 **UI Components**: Pre-built React components for common functionality
|
|
90
|
-
- 📱 **Cross-Platform**: Works in React Native and web applications
|
|
91
|
-
- 🔧 **TypeScript**: Full type safety and IntelliSense support
|
|
92
|
-
|
|
93
|
-
## Legacy Quick Start
|
|
94
|
-
|
|
95
|
-
```bash
|
|
96
|
-
npm install @oxyhq/services
|
|
97
|
-
```
|
|
92
|
+
### Traditional Usage
|
|
98
93
|
|
|
99
94
|
```typescript
|
|
100
95
|
import { OxyServices } from '@oxyhq/services';
|
|
@@ -113,9 +108,14 @@ const response = await oxy.auth.login({
|
|
|
113
108
|
const user = await oxy.users.getCurrentUser();
|
|
114
109
|
```
|
|
115
110
|
|
|
111
|
+
## Documentation
|
|
112
|
+
|
|
113
|
+
For comprehensive documentation, API reference, and examples:
|
|
114
|
+
|
|
116
115
|
- [📚 Full Documentation](./docs/README.md)
|
|
117
116
|
- [🚀 Quick Start Guide](./docs/quick-start.md)
|
|
118
117
|
- [🔐 Core API Reference](./docs/core-api.md)
|
|
118
|
+
- [⚡ Streamlined Authentication](./docs/core-api.md#streamlined-authentication) - **NEW!**
|
|
119
119
|
- [💼 Integration Examples](./docs/examples/)
|
|
120
120
|
|
|
121
121
|
## UI Components
|
|
@@ -6,29 +6,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
var _exportNames = {
|
|
7
7
|
OXY_CLOUD_URL: true,
|
|
8
8
|
OxyServices: true,
|
|
9
|
-
AuthenticationManager: true,
|
|
10
|
-
initializeAuth: true,
|
|
11
|
-
getAuthManager: true,
|
|
12
|
-
AuthProvider: true,
|
|
13
|
-
useAuth: true,
|
|
14
|
-
useOxyClient: true,
|
|
15
|
-
useAuthStatus: true,
|
|
16
|
-
useCurrentUser: true,
|
|
17
|
-
withAuth: true,
|
|
18
9
|
DeviceManager: true
|
|
19
10
|
};
|
|
20
|
-
Object.defineProperty(exports, "AuthProvider", {
|
|
21
|
-
enumerable: true,
|
|
22
|
-
get: function () {
|
|
23
|
-
return _useAuth.AuthProvider;
|
|
24
|
-
}
|
|
25
|
-
});
|
|
26
|
-
Object.defineProperty(exports, "AuthenticationManager", {
|
|
27
|
-
enumerable: true,
|
|
28
|
-
get: function () {
|
|
29
|
-
return _authManager.AuthenticationManager;
|
|
30
|
-
}
|
|
31
|
-
});
|
|
32
11
|
Object.defineProperty(exports, "DeviceManager", {
|
|
33
12
|
enumerable: true,
|
|
34
13
|
get: function () {
|
|
@@ -36,52 +15,8 @@ Object.defineProperty(exports, "DeviceManager", {
|
|
|
36
15
|
}
|
|
37
16
|
});
|
|
38
17
|
exports.default = exports.OxyServices = exports.OXY_CLOUD_URL = void 0;
|
|
39
|
-
Object.defineProperty(exports, "getAuthManager", {
|
|
40
|
-
enumerable: true,
|
|
41
|
-
get: function () {
|
|
42
|
-
return _authManager.getAuthManager;
|
|
43
|
-
}
|
|
44
|
-
});
|
|
45
|
-
Object.defineProperty(exports, "initializeAuth", {
|
|
46
|
-
enumerable: true,
|
|
47
|
-
get: function () {
|
|
48
|
-
return _authManager.initializeAuth;
|
|
49
|
-
}
|
|
50
|
-
});
|
|
51
|
-
Object.defineProperty(exports, "useAuth", {
|
|
52
|
-
enumerable: true,
|
|
53
|
-
get: function () {
|
|
54
|
-
return _useAuth.useAuth;
|
|
55
|
-
}
|
|
56
|
-
});
|
|
57
|
-
Object.defineProperty(exports, "useAuthStatus", {
|
|
58
|
-
enumerable: true,
|
|
59
|
-
get: function () {
|
|
60
|
-
return _useAuth.useAuthStatus;
|
|
61
|
-
}
|
|
62
|
-
});
|
|
63
|
-
Object.defineProperty(exports, "useCurrentUser", {
|
|
64
|
-
enumerable: true,
|
|
65
|
-
get: function () {
|
|
66
|
-
return _useAuth.useCurrentUser;
|
|
67
|
-
}
|
|
68
|
-
});
|
|
69
|
-
Object.defineProperty(exports, "useOxyClient", {
|
|
70
|
-
enumerable: true,
|
|
71
|
-
get: function () {
|
|
72
|
-
return _useAuth.useOxyClient;
|
|
73
|
-
}
|
|
74
|
-
});
|
|
75
|
-
Object.defineProperty(exports, "withAuth", {
|
|
76
|
-
enumerable: true,
|
|
77
|
-
get: function () {
|
|
78
|
-
return _useAuth.withAuth;
|
|
79
|
-
}
|
|
80
|
-
});
|
|
81
18
|
var _axios = _interopRequireDefault(require("axios"));
|
|
82
19
|
var _jwtDecode = require("jwt-decode");
|
|
83
|
-
var _authManager = require("./auth-manager");
|
|
84
|
-
var _useAuth = require("./use-auth");
|
|
85
20
|
var _deviceManager = require("../utils/deviceManager");
|
|
86
21
|
var _interfaces = require("../models/interfaces");
|
|
87
22
|
Object.keys(_interfaces).forEach(function (key) {
|
|
@@ -108,8 +43,6 @@ Object.keys(_secureSession).forEach(function (key) {
|
|
|
108
43
|
});
|
|
109
44
|
});
|
|
110
45
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
111
|
-
// Zero-Config Authentication Exports
|
|
112
|
-
|
|
113
46
|
// Remove all FormData, form-data, and polyfill logic. Delete uploadFile and uploadFiles methods. Add a comment to use the new raw upload approach instead.
|
|
114
47
|
|
|
115
48
|
// Import secure session types
|
|
@@ -124,54 +57,24 @@ const OXY_CLOUD_URL = exports.OXY_CLOUD_URL = 'https://cloud.oxy.so';
|
|
|
124
57
|
/**
|
|
125
58
|
* OxyServices - Client library for interacting with the Oxy API
|
|
126
59
|
*
|
|
127
|
-
*
|
|
128
|
-
* Use the new AuthProvider and useAuth hooks for automatic authentication management:
|
|
129
|
-
*
|
|
130
|
-
* import { AuthProvider, useAuth } from '@oxyhq/services';
|
|
131
|
-
*
|
|
132
|
-
* <AuthProvider baseURL="https://api.oxy.so">
|
|
133
|
-
* <App />
|
|
134
|
-
* </AuthProvider>
|
|
135
|
-
*
|
|
136
|
-
* Then in components:
|
|
137
|
-
* const { login, user, isAuthenticated } = useAuth();
|
|
138
|
-
*
|
|
139
|
-
* LEGACY MODE:
|
|
140
|
-
* The OxyServices class below is maintained for backward compatibility
|
|
141
|
-
* but we recommend migrating to the new zero-config approach.
|
|
142
|
-
*
|
|
143
|
-
* Note: For authentication status in UI components, use `isAuthenticated` from useAuth() context
|
|
60
|
+
* Note: For authentication status in UI components, use `isAuthenticated` from useOxy() context
|
|
144
61
|
* instead of checking token status directly on this service.
|
|
145
62
|
*/
|
|
146
63
|
class OxyServices {
|
|
147
64
|
accessToken = null;
|
|
148
65
|
refreshToken = null;
|
|
149
66
|
refreshPromise = null;
|
|
150
|
-
authManager = null;
|
|
151
67
|
|
|
152
68
|
/**
|
|
153
69
|
* Creates a new instance of the OxyServices client
|
|
154
70
|
* @param config - Configuration for the client
|
|
155
71
|
*/
|
|
156
72
|
constructor(config) {
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
} catch {
|
|
162
|
-
// Fall back to legacy implementation
|
|
163
|
-
this.client = _axios.default.create({
|
|
164
|
-
baseURL: config.baseURL,
|
|
165
|
-
timeout: 10000 // 10 second timeout
|
|
166
|
-
});
|
|
167
|
-
this.setupLegacyInterceptors();
|
|
168
|
-
}
|
|
169
|
-
}
|
|
73
|
+
this.client = _axios.default.create({
|
|
74
|
+
baseURL: config.baseURL,
|
|
75
|
+
timeout: 10000 // 10 second timeout
|
|
76
|
+
});
|
|
170
77
|
|
|
171
|
-
/**
|
|
172
|
-
* Setup legacy interceptors (only used if auth manager is not available)
|
|
173
|
-
*/
|
|
174
|
-
setupLegacyInterceptors() {
|
|
175
78
|
// Interceptor for adding auth header and handling token refresh
|
|
176
79
|
this.client.interceptors.request.use(async req => {
|
|
177
80
|
if (!this.accessToken) {
|
|
@@ -613,9 +516,17 @@ class OxyServices {
|
|
|
613
516
|
*/
|
|
614
517
|
async getCurrentUser() {
|
|
615
518
|
try {
|
|
519
|
+
console.log('OxyServices: Fetching current user...');
|
|
616
520
|
const res = await this.client.get('/users/me');
|
|
521
|
+
console.log('OxyServices: Current user response:', {
|
|
522
|
+
hasUser: !!res.data,
|
|
523
|
+
userLinksMetadata: res.data?.linksMetadata,
|
|
524
|
+
userLinks: res.data?.links,
|
|
525
|
+
userWebsite: res.data?.website
|
|
526
|
+
});
|
|
617
527
|
return res.data;
|
|
618
528
|
} catch (error) {
|
|
529
|
+
console.error('OxyServices: Error fetching current user:', error);
|
|
619
530
|
throw this.handleError(error);
|
|
620
531
|
}
|
|
621
532
|
}
|
|
@@ -627,9 +538,12 @@ class OxyServices {
|
|
|
627
538
|
*/
|
|
628
539
|
async updateProfile(updates) {
|
|
629
540
|
try {
|
|
541
|
+
console.log('OxyServices: Updating profile with:', updates);
|
|
630
542
|
const res = await this.client.put('/users/me', updates);
|
|
543
|
+
console.log('OxyServices: Profile update response:', res.data);
|
|
631
544
|
return res.data;
|
|
632
545
|
} catch (error) {
|
|
546
|
+
console.error('OxyServices: Error updating profile:', error);
|
|
633
547
|
throw this.handleError(error);
|
|
634
548
|
}
|
|
635
549
|
}
|
|
@@ -1343,10 +1257,13 @@ class OxyServices {
|
|
|
1343
1257
|
* @returns Array of user sessions
|
|
1344
1258
|
*/
|
|
1345
1259
|
async getSessionsBySessionId(sessionId) {
|
|
1260
|
+
console.log('getSessionsBySessionId called with sessionId:', sessionId);
|
|
1346
1261
|
try {
|
|
1347
1262
|
const res = await this.client.get(`/secure-session/sessions/${sessionId}`);
|
|
1263
|
+
console.log('getSessionsBySessionId response:', res.data);
|
|
1348
1264
|
return res.data.sessions;
|
|
1349
1265
|
} catch (error) {
|
|
1266
|
+
console.error('getSessionsBySessionId error:', error);
|
|
1350
1267
|
throw this.handleError(error);
|
|
1351
1268
|
}
|
|
1352
1269
|
}
|
|
@@ -1815,6 +1732,164 @@ class OxyServices {
|
|
|
1815
1732
|
throw this.handleError(error);
|
|
1816
1733
|
}
|
|
1817
1734
|
}
|
|
1735
|
+
|
|
1736
|
+
/**
|
|
1737
|
+
* Fetch metadata for a URL (title, description, image)
|
|
1738
|
+
* @param url - The URL to fetch metadata for
|
|
1739
|
+
* @returns Promise with metadata object
|
|
1740
|
+
*/
|
|
1741
|
+
async fetchLinkMetadata(url) {
|
|
1742
|
+
try {
|
|
1743
|
+
const response = await this.client.post('/link-metadata/fetch-metadata', {
|
|
1744
|
+
url
|
|
1745
|
+
});
|
|
1746
|
+
return response.data;
|
|
1747
|
+
} catch (error) {
|
|
1748
|
+
throw this.handleError(error);
|
|
1749
|
+
}
|
|
1750
|
+
}
|
|
1751
|
+
|
|
1752
|
+
/**
|
|
1753
|
+
* Search for locations using the enhanced location search API
|
|
1754
|
+
* @param query - Search query string
|
|
1755
|
+
* @param limit - Maximum number of results (default: 5)
|
|
1756
|
+
* @param countrycodes - Optional country codes filter (e.g., "us,ca")
|
|
1757
|
+
* @returns Promise with array of location results
|
|
1758
|
+
*/
|
|
1759
|
+
async searchLocations(query, limit = 5, countrycodes) {
|
|
1760
|
+
try {
|
|
1761
|
+
const params = new URLSearchParams({
|
|
1762
|
+
query,
|
|
1763
|
+
limit: limit.toString()
|
|
1764
|
+
});
|
|
1765
|
+
if (countrycodes) {
|
|
1766
|
+
params.append('countrycodes', countrycodes);
|
|
1767
|
+
}
|
|
1768
|
+
const res = await this.client.get(`/location-search/search?${params.toString()}`);
|
|
1769
|
+
return res.data.results;
|
|
1770
|
+
} catch (error) {
|
|
1771
|
+
throw this.handleError(error);
|
|
1772
|
+
}
|
|
1773
|
+
}
|
|
1774
|
+
|
|
1775
|
+
/**
|
|
1776
|
+
* Get detailed information about a specific location by coordinates
|
|
1777
|
+
* @param lat - Latitude
|
|
1778
|
+
* @param lon - Longitude
|
|
1779
|
+
* @returns Promise with detailed location information
|
|
1780
|
+
*/
|
|
1781
|
+
async getLocationDetails(lat, lon) {
|
|
1782
|
+
try {
|
|
1783
|
+
const res = await this.client.get(`/location-search/details?lat=${lat}&lon=${lon}`);
|
|
1784
|
+
return res.data.result;
|
|
1785
|
+
} catch (error) {
|
|
1786
|
+
throw this.handleError(error);
|
|
1787
|
+
}
|
|
1788
|
+
}
|
|
1789
|
+
|
|
1790
|
+
/**
|
|
1791
|
+
* Find locations near a point using geospatial queries
|
|
1792
|
+
* @param lat - Latitude
|
|
1793
|
+
* @param lon - Longitude
|
|
1794
|
+
* @param maxDistance - Maximum distance in meters (default: 10000)
|
|
1795
|
+
* @param limit - Maximum number of results (default: 10)
|
|
1796
|
+
* @param skip - Number of results to skip (default: 0)
|
|
1797
|
+
* @returns Promise with nearby locations
|
|
1798
|
+
*/
|
|
1799
|
+
async findLocationsNear(lat, lon, maxDistance = 10000, limit = 10, skip = 0) {
|
|
1800
|
+
try {
|
|
1801
|
+
const params = new URLSearchParams({
|
|
1802
|
+
lat: lat.toString(),
|
|
1803
|
+
lon: lon.toString(),
|
|
1804
|
+
maxDistance: maxDistance.toString(),
|
|
1805
|
+
limit: limit.toString(),
|
|
1806
|
+
skip: skip.toString()
|
|
1807
|
+
});
|
|
1808
|
+
const res = await this.client.get(`/location-search/near?${params.toString()}`);
|
|
1809
|
+
return res.data;
|
|
1810
|
+
} catch (error) {
|
|
1811
|
+
throw this.handleError(error);
|
|
1812
|
+
}
|
|
1813
|
+
}
|
|
1814
|
+
|
|
1815
|
+
/**
|
|
1816
|
+
* Search locations in database by text
|
|
1817
|
+
* @param query - Search query
|
|
1818
|
+
* @param limit - Maximum number of results (default: 10)
|
|
1819
|
+
* @param skip - Number of results to skip (default: 0)
|
|
1820
|
+
* @param type - Filter by location type
|
|
1821
|
+
* @param country - Filter by country
|
|
1822
|
+
* @param city - Filter by city
|
|
1823
|
+
* @returns Promise with search results
|
|
1824
|
+
*/
|
|
1825
|
+
async searchLocationsInDB(query, limit = 10, skip = 0, type, country, city) {
|
|
1826
|
+
try {
|
|
1827
|
+
const params = new URLSearchParams({
|
|
1828
|
+
query,
|
|
1829
|
+
limit: limit.toString(),
|
|
1830
|
+
skip: skip.toString()
|
|
1831
|
+
});
|
|
1832
|
+
if (type) params.append('type', type);
|
|
1833
|
+
if (country) params.append('country', country);
|
|
1834
|
+
if (city) params.append('city', city);
|
|
1835
|
+
const res = await this.client.get(`/location-search/db-search?${params.toString()}`);
|
|
1836
|
+
return res.data;
|
|
1837
|
+
} catch (error) {
|
|
1838
|
+
throw this.handleError(error);
|
|
1839
|
+
}
|
|
1840
|
+
}
|
|
1841
|
+
|
|
1842
|
+
/**
|
|
1843
|
+
* Get location statistics
|
|
1844
|
+
* @returns Promise with location statistics
|
|
1845
|
+
*/
|
|
1846
|
+
async getLocationStats() {
|
|
1847
|
+
try {
|
|
1848
|
+
const res = await this.client.get('/location-search/stats');
|
|
1849
|
+
return res.data.stats;
|
|
1850
|
+
} catch (error) {
|
|
1851
|
+
throw this.handleError(error);
|
|
1852
|
+
}
|
|
1853
|
+
}
|
|
1854
|
+
|
|
1855
|
+
/**
|
|
1856
|
+
* Get cache statistics
|
|
1857
|
+
* @returns Promise with cache statistics
|
|
1858
|
+
*/
|
|
1859
|
+
async getLocationCacheStats() {
|
|
1860
|
+
try {
|
|
1861
|
+
const res = await this.client.get('/location-search/cache/stats');
|
|
1862
|
+
return res.data.stats;
|
|
1863
|
+
} catch (error) {
|
|
1864
|
+
throw this.handleError(error);
|
|
1865
|
+
}
|
|
1866
|
+
}
|
|
1867
|
+
|
|
1868
|
+
/**
|
|
1869
|
+
* Clear location cache
|
|
1870
|
+
* @returns Promise with success status
|
|
1871
|
+
*/
|
|
1872
|
+
async clearLocationCache() {
|
|
1873
|
+
try {
|
|
1874
|
+
const res = await this.client.delete('/location-search/cache');
|
|
1875
|
+
return res.data;
|
|
1876
|
+
} catch (error) {
|
|
1877
|
+
throw this.handleError(error);
|
|
1878
|
+
}
|
|
1879
|
+
}
|
|
1880
|
+
|
|
1881
|
+
/**
|
|
1882
|
+
* Get performance statistics
|
|
1883
|
+
* @returns Promise with performance statistics
|
|
1884
|
+
*/
|
|
1885
|
+
async getLocationPerformanceStats() {
|
|
1886
|
+
try {
|
|
1887
|
+
const res = await this.client.get('/location-search/performance');
|
|
1888
|
+
return res.data;
|
|
1889
|
+
} catch (error) {
|
|
1890
|
+
throw this.handleError(error);
|
|
1891
|
+
}
|
|
1892
|
+
}
|
|
1818
1893
|
}
|
|
1819
1894
|
|
|
1820
1895
|
// Default export for backward compatibility
|