@oxyhq/services 5.7.5 → 5.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +76 -76
- package/lib/commonjs/core/index.js +177 -102
- package/lib/commonjs/core/index.js.map +1 -1
- package/lib/commonjs/index.js +88 -29
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/node/createAuth.js +585 -7
- package/lib/commonjs/node/createAuth.js.map +1 -1
- package/lib/commonjs/node/index.js +38 -1
- package/lib/commonjs/node/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/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 +322 -0
- package/lib/commonjs/ui/components/Header.js.map +1 -0
- package/lib/commonjs/ui/components/OxyProvider.js +23 -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 +122 -78
- package/lib/commonjs/ui/context/OxyContext.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 +1 -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 +1151 -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/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/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/stores/authStore.js +12 -0
- package/lib/commonjs/ui/stores/authStore.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 +26 -4
- package/lib/module/index.js.map +1 -1
- package/lib/module/node/createAuth.js +584 -7
- package/lib/module/node/createAuth.js.map +1 -1
- package/lib/module/node/index.js +7 -1
- package/lib/module/node/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/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 +317 -0
- package/lib/module/ui/components/Header.js.map +1 -0
- package/lib/module/ui/components/OxyProvider.js +25 -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 +121 -77
- package/lib/module/ui/context/OxyContext.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 +1 -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 +1152 -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/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/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/stores/authStore.js +12 -0
- package/lib/module/ui/stores/authStore.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/node/createAuth.d.ts +112 -0
- package/lib/typescript/node/createAuth.d.ts.map +1 -1
- package/lib/typescript/node/index.d.ts +2 -0
- package/lib/typescript/node/index.d.ts.map +1 -1
- package/lib/typescript/ui/components/Avatar.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 +22 -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/useSessionSocket.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/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/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/stores/authStore.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 +72 -4
- package/src/node/createAuth.ts +623 -7
- package/src/node/index.ts +19 -1
- package/src/ui/components/Avatar.tsx +11 -5
- package/src/ui/components/GroupedItem.tsx +57 -9
- package/src/ui/components/GroupedSection.tsx +12 -0
- package/src/ui/components/Header.tsx +364 -0
- package/src/ui/components/OxyProvider.tsx +31 -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 +150 -63
- package/src/ui/hooks/useSessionSocket.ts +5 -2
- package/src/ui/navigation/OxyRouter.tsx +1 -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 +1165 -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 +5 -5
- 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/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/stores/authStore.ts +12 -0
- 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
|
@@ -0,0 +1,326 @@
|
|
|
1
|
+
export interface AuthThemeColors {
|
|
2
|
+
text: string;
|
|
3
|
+
background: string;
|
|
4
|
+
inputBackground: string;
|
|
5
|
+
placeholder: string;
|
|
6
|
+
primary: string;
|
|
7
|
+
border: string;
|
|
8
|
+
error: string;
|
|
9
|
+
success: string;
|
|
10
|
+
warning: string;
|
|
11
|
+
secondaryText: string;
|
|
12
|
+
}
|
|
13
|
+
export declare const createAuthStyles: (colors: AuthThemeColors, theme: string) => {
|
|
14
|
+
container: {
|
|
15
|
+
flex: number;
|
|
16
|
+
};
|
|
17
|
+
scrollContent: {
|
|
18
|
+
flexGrow: number;
|
|
19
|
+
paddingHorizontal: number;
|
|
20
|
+
paddingTop: number;
|
|
21
|
+
paddingBottom: number;
|
|
22
|
+
};
|
|
23
|
+
stepContainer: {
|
|
24
|
+
flex: number;
|
|
25
|
+
justifyContent: "flex-start";
|
|
26
|
+
alignItems: "flex-start";
|
|
27
|
+
};
|
|
28
|
+
modernHeader: {
|
|
29
|
+
alignItems: "flex-start";
|
|
30
|
+
width: "100%";
|
|
31
|
+
marginBottom: number;
|
|
32
|
+
};
|
|
33
|
+
modernTitle: {
|
|
34
|
+
fontFamily: string;
|
|
35
|
+
fontWeight: "bold" | undefined;
|
|
36
|
+
fontSize: number;
|
|
37
|
+
lineHeight: number;
|
|
38
|
+
marginBottom: number;
|
|
39
|
+
textAlign: "left";
|
|
40
|
+
letterSpacing: number;
|
|
41
|
+
};
|
|
42
|
+
modernSubtitle: {
|
|
43
|
+
fontSize: number;
|
|
44
|
+
lineHeight: number;
|
|
45
|
+
textAlign: "left";
|
|
46
|
+
opacity: number;
|
|
47
|
+
};
|
|
48
|
+
welcomeTitle: {
|
|
49
|
+
fontFamily: string;
|
|
50
|
+
fontWeight: "bold" | undefined;
|
|
51
|
+
fontSize: number;
|
|
52
|
+
lineHeight: number;
|
|
53
|
+
marginBottom: number;
|
|
54
|
+
textAlign: "left";
|
|
55
|
+
letterSpacing: number;
|
|
56
|
+
};
|
|
57
|
+
stepTitle: {
|
|
58
|
+
fontFamily: string;
|
|
59
|
+
fontWeight: "bold" | undefined;
|
|
60
|
+
fontSize: number;
|
|
61
|
+
lineHeight: number;
|
|
62
|
+
marginBottom: number;
|
|
63
|
+
textAlign: "left";
|
|
64
|
+
letterSpacing: number;
|
|
65
|
+
};
|
|
66
|
+
modernInfoCard: {
|
|
67
|
+
flexDirection: "row";
|
|
68
|
+
alignItems: "center";
|
|
69
|
+
padding: number;
|
|
70
|
+
borderRadius: number;
|
|
71
|
+
marginBottom: number;
|
|
72
|
+
gap: number;
|
|
73
|
+
width: "100%";
|
|
74
|
+
};
|
|
75
|
+
modernInfoText: {
|
|
76
|
+
fontSize: number;
|
|
77
|
+
flex: number;
|
|
78
|
+
};
|
|
79
|
+
modernErrorCard: {
|
|
80
|
+
flexDirection: "row";
|
|
81
|
+
alignItems: "center";
|
|
82
|
+
padding: number;
|
|
83
|
+
borderRadius: number;
|
|
84
|
+
marginBottom: number;
|
|
85
|
+
gap: number;
|
|
86
|
+
width: "100%";
|
|
87
|
+
};
|
|
88
|
+
errorText: {
|
|
89
|
+
fontSize: number;
|
|
90
|
+
fontWeight: "500";
|
|
91
|
+
flex: number;
|
|
92
|
+
};
|
|
93
|
+
modernInputContainer: {
|
|
94
|
+
width: "100%";
|
|
95
|
+
marginBottom: number;
|
|
96
|
+
};
|
|
97
|
+
inputWrapper: {
|
|
98
|
+
flexDirection: "row";
|
|
99
|
+
alignItems: "center";
|
|
100
|
+
height: number;
|
|
101
|
+
borderRadius: number;
|
|
102
|
+
paddingHorizontal: number;
|
|
103
|
+
borderWidth: number;
|
|
104
|
+
backgroundColor: string;
|
|
105
|
+
};
|
|
106
|
+
premiumInputWrapper: {
|
|
107
|
+
flexDirection: "row";
|
|
108
|
+
alignItems: "center";
|
|
109
|
+
height: number;
|
|
110
|
+
borderRadius: number;
|
|
111
|
+
paddingHorizontal: number;
|
|
112
|
+
borderWidth: number;
|
|
113
|
+
backgroundColor: string;
|
|
114
|
+
};
|
|
115
|
+
inputIcon: {
|
|
116
|
+
marginRight: number;
|
|
117
|
+
};
|
|
118
|
+
inputContent: {
|
|
119
|
+
flex: number;
|
|
120
|
+
};
|
|
121
|
+
modernInput: {
|
|
122
|
+
flex: number;
|
|
123
|
+
fontSize: number;
|
|
124
|
+
height: "100%";
|
|
125
|
+
};
|
|
126
|
+
passwordToggle: {
|
|
127
|
+
padding: number;
|
|
128
|
+
};
|
|
129
|
+
validationIndicator: {
|
|
130
|
+
marginLeft: number;
|
|
131
|
+
};
|
|
132
|
+
validationSuccessCard: {
|
|
133
|
+
flexDirection: "row";
|
|
134
|
+
alignItems: "center";
|
|
135
|
+
padding: number;
|
|
136
|
+
borderRadius: number;
|
|
137
|
+
marginTop: number;
|
|
138
|
+
gap: number;
|
|
139
|
+
};
|
|
140
|
+
validationErrorCard: {
|
|
141
|
+
flexDirection: "row";
|
|
142
|
+
alignItems: "center";
|
|
143
|
+
padding: number;
|
|
144
|
+
borderRadius: number;
|
|
145
|
+
marginTop: number;
|
|
146
|
+
gap: number;
|
|
147
|
+
};
|
|
148
|
+
validationCard: {
|
|
149
|
+
flexDirection: "row";
|
|
150
|
+
alignItems: "center";
|
|
151
|
+
padding: number;
|
|
152
|
+
borderRadius: number;
|
|
153
|
+
marginTop: number;
|
|
154
|
+
gap: number;
|
|
155
|
+
};
|
|
156
|
+
validationText: {
|
|
157
|
+
fontSize: number;
|
|
158
|
+
fontWeight: "500";
|
|
159
|
+
};
|
|
160
|
+
belowInputMessage: {
|
|
161
|
+
flexDirection: "row";
|
|
162
|
+
alignItems: "center";
|
|
163
|
+
marginTop: number;
|
|
164
|
+
marginBottom: number;
|
|
165
|
+
gap: number;
|
|
166
|
+
};
|
|
167
|
+
belowInputText: {
|
|
168
|
+
fontSize: number;
|
|
169
|
+
fontWeight: "500";
|
|
170
|
+
};
|
|
171
|
+
modernButton: {
|
|
172
|
+
flexDirection: "row";
|
|
173
|
+
alignItems: "center";
|
|
174
|
+
justifyContent: "center";
|
|
175
|
+
paddingVertical: number;
|
|
176
|
+
paddingHorizontal: number;
|
|
177
|
+
borderRadius: number;
|
|
178
|
+
marginVertical: number;
|
|
179
|
+
shadowOffset: {
|
|
180
|
+
width: number;
|
|
181
|
+
height: number;
|
|
182
|
+
};
|
|
183
|
+
shadowOpacity: number;
|
|
184
|
+
shadowRadius: number;
|
|
185
|
+
elevation: number;
|
|
186
|
+
gap: number;
|
|
187
|
+
width: "100%";
|
|
188
|
+
};
|
|
189
|
+
modernButtonText: {
|
|
190
|
+
color: string;
|
|
191
|
+
fontSize: number;
|
|
192
|
+
fontWeight: "600";
|
|
193
|
+
letterSpacing: number;
|
|
194
|
+
};
|
|
195
|
+
buttonIcon: {
|
|
196
|
+
marginLeft: number;
|
|
197
|
+
};
|
|
198
|
+
modernLabel: {
|
|
199
|
+
fontSize: number;
|
|
200
|
+
fontWeight: "500";
|
|
201
|
+
marginBottom: number;
|
|
202
|
+
};
|
|
203
|
+
modernLinkText: {
|
|
204
|
+
fontSize: number;
|
|
205
|
+
lineHeight: number;
|
|
206
|
+
fontWeight: "600";
|
|
207
|
+
textDecorationLine: "underline";
|
|
208
|
+
};
|
|
209
|
+
footerTextContainer: {
|
|
210
|
+
flexDirection: "row";
|
|
211
|
+
justifyContent: "center";
|
|
212
|
+
marginTop: number;
|
|
213
|
+
};
|
|
214
|
+
footerText: {
|
|
215
|
+
fontSize: number;
|
|
216
|
+
};
|
|
217
|
+
modernUserProfileContainer: {
|
|
218
|
+
alignItems: "flex-start";
|
|
219
|
+
paddingVertical: number;
|
|
220
|
+
};
|
|
221
|
+
avatarContainer: {
|
|
222
|
+
position: "relative";
|
|
223
|
+
marginBottom: number;
|
|
224
|
+
};
|
|
225
|
+
modernUserAvatar: {
|
|
226
|
+
borderWidth: number;
|
|
227
|
+
borderColor: string;
|
|
228
|
+
};
|
|
229
|
+
statusIndicator: {
|
|
230
|
+
position: "absolute";
|
|
231
|
+
bottom: number;
|
|
232
|
+
right: number;
|
|
233
|
+
width: number;
|
|
234
|
+
height: number;
|
|
235
|
+
borderRadius: number;
|
|
236
|
+
borderWidth: number;
|
|
237
|
+
borderColor: string;
|
|
238
|
+
};
|
|
239
|
+
modernUserDisplayName: {
|
|
240
|
+
fontFamily: string;
|
|
241
|
+
fontWeight: "bold" | undefined;
|
|
242
|
+
fontSize: number;
|
|
243
|
+
marginBottom: number;
|
|
244
|
+
textAlign: "center";
|
|
245
|
+
letterSpacing: number;
|
|
246
|
+
};
|
|
247
|
+
modernUsernameSubtext: {
|
|
248
|
+
fontSize: number;
|
|
249
|
+
textAlign: "left";
|
|
250
|
+
marginBottom: number;
|
|
251
|
+
opacity: number;
|
|
252
|
+
};
|
|
253
|
+
welcomeBackBadge: {
|
|
254
|
+
flexDirection: "row";
|
|
255
|
+
alignItems: "center";
|
|
256
|
+
paddingHorizontal: number;
|
|
257
|
+
paddingVertical: number;
|
|
258
|
+
borderRadius: number;
|
|
259
|
+
gap: number;
|
|
260
|
+
};
|
|
261
|
+
welcomeBackText: {
|
|
262
|
+
fontSize: number;
|
|
263
|
+
fontWeight: "600";
|
|
264
|
+
textTransform: "uppercase";
|
|
265
|
+
letterSpacing: number;
|
|
266
|
+
};
|
|
267
|
+
modernNavigationButtons: {
|
|
268
|
+
flexDirection: "row";
|
|
269
|
+
justifyContent: "center";
|
|
270
|
+
marginTop: number;
|
|
271
|
+
marginBottom: number;
|
|
272
|
+
width: "100%";
|
|
273
|
+
gap: number;
|
|
274
|
+
};
|
|
275
|
+
modernBackButton: {
|
|
276
|
+
flexDirection: "row";
|
|
277
|
+
alignItems: "center";
|
|
278
|
+
paddingVertical: number;
|
|
279
|
+
paddingHorizontal: number;
|
|
280
|
+
borderRadius: number;
|
|
281
|
+
borderWidth: number;
|
|
282
|
+
gap: number;
|
|
283
|
+
};
|
|
284
|
+
modernBackButtonText: {
|
|
285
|
+
fontSize: number;
|
|
286
|
+
fontWeight: "500";
|
|
287
|
+
};
|
|
288
|
+
securityNotice: {
|
|
289
|
+
flexDirection: "row";
|
|
290
|
+
alignItems: "center";
|
|
291
|
+
justifyContent: "center";
|
|
292
|
+
marginTop: number;
|
|
293
|
+
gap: number;
|
|
294
|
+
};
|
|
295
|
+
securityText: {
|
|
296
|
+
fontSize: number;
|
|
297
|
+
fontWeight: "500";
|
|
298
|
+
};
|
|
299
|
+
welcomeImageContainer: {
|
|
300
|
+
alignItems: "center";
|
|
301
|
+
justifyContent: "center";
|
|
302
|
+
marginVertical: number;
|
|
303
|
+
};
|
|
304
|
+
welcomeText: {
|
|
305
|
+
fontSize: number;
|
|
306
|
+
lineHeight: number;
|
|
307
|
+
textAlign: "left";
|
|
308
|
+
opacity: number;
|
|
309
|
+
marginBottom: number;
|
|
310
|
+
};
|
|
311
|
+
successCard: {
|
|
312
|
+
flexDirection: "row";
|
|
313
|
+
alignItems: "center";
|
|
314
|
+
padding: number;
|
|
315
|
+
borderRadius: number;
|
|
316
|
+
marginBottom: number;
|
|
317
|
+
gap: number;
|
|
318
|
+
width: "100%";
|
|
319
|
+
};
|
|
320
|
+
successText: {
|
|
321
|
+
fontSize: number;
|
|
322
|
+
fontWeight: "500";
|
|
323
|
+
flex: number;
|
|
324
|
+
};
|
|
325
|
+
};
|
|
326
|
+
//# sourceMappingURL=authStyles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authStyles.d.ts","sourceRoot":"","sources":["../../../../src/ui/styles/authStyles.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,EAAE,MAAM,CAAC;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,eAAO,MAAM,gBAAgB,GAAI,QAAQ,eAAe,EAAE,OAAO,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+UrE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ui/styles/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ui/styles/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oxyhq/services",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.8.1",
|
|
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",
|
|
@@ -59,9 +59,6 @@
|
|
|
59
59
|
"typescript": "tsc --skipLibCheck --noEmit",
|
|
60
60
|
"lint": "biome lint --error-on-warnings ./src",
|
|
61
61
|
"build": "bob build && yarn copy-assets && yarn copy-dts && yarn delete-dts.js && yarn delete-debug-view",
|
|
62
|
-
"test": "jest",
|
|
63
|
-
"test:watch": "jest --watch",
|
|
64
|
-
"test:coverage": "jest --coverage",
|
|
65
62
|
"copy-assets": "copyfiles -u 1 \"src/assets/**/*\" lib/commonjs/assets && copyfiles -u 1 \"src/assets/**/*\" lib/module/assets",
|
|
66
63
|
"copy-dts": "copyfiles -u 1 \"src/**/*.d.ts\" lib/typescript",
|
|
67
64
|
"delete-debug-view": "rm -rf ./lib/commonjs/components/bottomSheetDebugView ./lib/module/components/bottomSheetDebugView ./lib/typescript/components/bottomSheetDebugView || true",
|
package/src/core/index.ts
CHANGED
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
import axios, { AxiosInstance, AxiosError, AxiosRequestConfig, InternalAxiosRequestConfig } from 'axios';
|
|
2
2
|
import { jwtDecode } from 'jwt-decode';
|
|
3
3
|
|
|
4
|
-
// Zero-Config Authentication Exports
|
|
5
|
-
export { AuthenticationManager, initializeAuth, getAuthManager } from './auth-manager';
|
|
6
|
-
export { AuthProvider, useAuth, useOxyClient, useAuthStatus, useCurrentUser, withAuth } from './use-auth';
|
|
7
|
-
|
|
8
4
|
// Remove all FormData, form-data, and polyfill logic. Delete uploadFile and uploadFiles methods. Add a comment to use the new raw upload approach instead.
|
|
9
5
|
|
|
10
6
|
import {
|
|
@@ -44,7 +40,6 @@ import {
|
|
|
44
40
|
|
|
45
41
|
// Import secure session types
|
|
46
42
|
import { SecureLoginResponse, SecureClientSession } from '../models/secureSession';
|
|
47
|
-
import { AuthenticationManager, initializeAuth } from './auth-manager';
|
|
48
43
|
|
|
49
44
|
/**
|
|
50
45
|
* Default cloud URL for Oxy services, cloud is where the user files are. (e.g. images, videos, etc.). Not the API.
|
|
@@ -64,23 +59,7 @@ interface JwtPayload {
|
|
|
64
59
|
/**
|
|
65
60
|
* OxyServices - Client library for interacting with the Oxy API
|
|
66
61
|
*
|
|
67
|
-
*
|
|
68
|
-
* Use the new AuthProvider and useAuth hooks for automatic authentication management:
|
|
69
|
-
*
|
|
70
|
-
* import { AuthProvider, useAuth } from '@oxyhq/services';
|
|
71
|
-
*
|
|
72
|
-
* <AuthProvider baseURL="https://api.oxy.so">
|
|
73
|
-
* <App />
|
|
74
|
-
* </AuthProvider>
|
|
75
|
-
*
|
|
76
|
-
* Then in components:
|
|
77
|
-
* const { login, user, isAuthenticated } = useAuth();
|
|
78
|
-
*
|
|
79
|
-
* LEGACY MODE:
|
|
80
|
-
* The OxyServices class below is maintained for backward compatibility
|
|
81
|
-
* but we recommend migrating to the new zero-config approach.
|
|
82
|
-
*
|
|
83
|
-
* Note: For authentication status in UI components, use `isAuthenticated` from useAuth() context
|
|
62
|
+
* Note: For authentication status in UI components, use `isAuthenticated` from useOxy() context
|
|
84
63
|
* instead of checking token status directly on this service.
|
|
85
64
|
*/
|
|
86
65
|
export class OxyServices {
|
|
@@ -88,31 +67,17 @@ export class OxyServices {
|
|
|
88
67
|
private accessToken: string | null = null;
|
|
89
68
|
private refreshToken: string | null = null;
|
|
90
69
|
private refreshPromise: Promise<{ accessToken: string; refreshToken: string }> | null = null;
|
|
91
|
-
private authManager: AuthenticationManager | null = null;
|
|
92
70
|
|
|
93
71
|
/**
|
|
94
72
|
* Creates a new instance of the OxyServices client
|
|
95
73
|
* @param config - Configuration for the client
|
|
96
74
|
*/
|
|
97
75
|
constructor(config: OxyConfig) {
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
// Fall back to legacy implementation
|
|
104
|
-
this.client = axios.create({
|
|
105
|
-
baseURL: config.baseURL,
|
|
106
|
-
timeout: 10000 // 10 second timeout
|
|
107
|
-
});
|
|
108
|
-
this.setupLegacyInterceptors();
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
/**
|
|
113
|
-
* Setup legacy interceptors (only used if auth manager is not available)
|
|
114
|
-
*/
|
|
115
|
-
private setupLegacyInterceptors(): void {
|
|
76
|
+
this.client = axios.create({
|
|
77
|
+
baseURL: config.baseURL,
|
|
78
|
+
timeout: 10000 // 10 second timeout
|
|
79
|
+
});
|
|
80
|
+
|
|
116
81
|
// Interceptor for adding auth header and handling token refresh
|
|
117
82
|
this.client.interceptors.request.use(async (req: InternalAxiosRequestConfig) => {
|
|
118
83
|
if (!this.accessToken) {
|
|
@@ -529,9 +494,17 @@ export class OxyServices {
|
|
|
529
494
|
*/
|
|
530
495
|
async getCurrentUser(): Promise<User> {
|
|
531
496
|
try {
|
|
497
|
+
console.log('OxyServices: Fetching current user...');
|
|
532
498
|
const res = await this.client.get('/users/me');
|
|
499
|
+
console.log('OxyServices: Current user response:', {
|
|
500
|
+
hasUser: !!res.data,
|
|
501
|
+
userLinksMetadata: res.data?.linksMetadata,
|
|
502
|
+
userLinks: res.data?.links,
|
|
503
|
+
userWebsite: res.data?.website
|
|
504
|
+
});
|
|
533
505
|
return res.data;
|
|
534
506
|
} catch (error) {
|
|
507
|
+
console.error('OxyServices: Error fetching current user:', error);
|
|
535
508
|
throw this.handleError(error);
|
|
536
509
|
}
|
|
537
510
|
}
|
|
@@ -543,9 +516,12 @@ export class OxyServices {
|
|
|
543
516
|
*/
|
|
544
517
|
async updateProfile(updates: Record<string, any>): Promise<User> {
|
|
545
518
|
try {
|
|
519
|
+
console.log('OxyServices: Updating profile with:', updates);
|
|
546
520
|
const res = await this.client.put('/users/me', updates);
|
|
521
|
+
console.log('OxyServices: Profile update response:', res.data);
|
|
547
522
|
return res.data;
|
|
548
523
|
} catch (error) {
|
|
524
|
+
console.error('OxyServices: Error updating profile:', error);
|
|
549
525
|
throw this.handleError(error);
|
|
550
526
|
}
|
|
551
527
|
}
|
|
@@ -1263,10 +1239,13 @@ export class OxyServices {
|
|
|
1263
1239
|
* @returns Array of user sessions
|
|
1264
1240
|
*/
|
|
1265
1241
|
async getSessionsBySessionId(sessionId: string): Promise<any[]> {
|
|
1242
|
+
console.log('getSessionsBySessionId called with sessionId:', sessionId);
|
|
1266
1243
|
try {
|
|
1267
1244
|
const res = await this.client.get(`/secure-session/sessions/${sessionId}`);
|
|
1245
|
+
console.log('getSessionsBySessionId response:', res.data);
|
|
1268
1246
|
return res.data.sessions;
|
|
1269
1247
|
} catch (error) {
|
|
1248
|
+
console.error('getSessionsBySessionId error:', error);
|
|
1270
1249
|
throw this.handleError(error);
|
|
1271
1250
|
}
|
|
1272
1251
|
}
|
|
@@ -1746,6 +1725,181 @@ export class OxyServices {
|
|
|
1746
1725
|
throw this.handleError(error);
|
|
1747
1726
|
}
|
|
1748
1727
|
}
|
|
1728
|
+
|
|
1729
|
+
/**
|
|
1730
|
+
* Fetch metadata for a URL (title, description, image)
|
|
1731
|
+
* @param url - The URL to fetch metadata for
|
|
1732
|
+
* @returns Promise with metadata object
|
|
1733
|
+
*/
|
|
1734
|
+
async fetchLinkMetadata(url: string): Promise<{
|
|
1735
|
+
url: string;
|
|
1736
|
+
title: string;
|
|
1737
|
+
description: string;
|
|
1738
|
+
image?: string;
|
|
1739
|
+
}> {
|
|
1740
|
+
try {
|
|
1741
|
+
const response = await this.client.post('/link-metadata/fetch-metadata', { url });
|
|
1742
|
+
return response.data;
|
|
1743
|
+
} catch (error) {
|
|
1744
|
+
throw this.handleError(error);
|
|
1745
|
+
}
|
|
1746
|
+
}
|
|
1747
|
+
|
|
1748
|
+
/**
|
|
1749
|
+
* Search for locations using the enhanced location search API
|
|
1750
|
+
* @param query - Search query string
|
|
1751
|
+
* @param limit - Maximum number of results (default: 5)
|
|
1752
|
+
* @param countrycodes - Optional country codes filter (e.g., "us,ca")
|
|
1753
|
+
* @returns Promise with array of location results
|
|
1754
|
+
*/
|
|
1755
|
+
async searchLocations(query: string, limit: number = 5, countrycodes?: string): Promise<any[]> {
|
|
1756
|
+
try {
|
|
1757
|
+
const params = new URLSearchParams({
|
|
1758
|
+
query,
|
|
1759
|
+
limit: limit.toString()
|
|
1760
|
+
});
|
|
1761
|
+
if (countrycodes) {
|
|
1762
|
+
params.append('countrycodes', countrycodes);
|
|
1763
|
+
}
|
|
1764
|
+
const res = await this.client.get(`/location-search/search?${params.toString()}`);
|
|
1765
|
+
return res.data.results;
|
|
1766
|
+
} catch (error) {
|
|
1767
|
+
throw this.handleError(error);
|
|
1768
|
+
}
|
|
1769
|
+
}
|
|
1770
|
+
|
|
1771
|
+
/**
|
|
1772
|
+
* Get detailed information about a specific location by coordinates
|
|
1773
|
+
* @param lat - Latitude
|
|
1774
|
+
* @param lon - Longitude
|
|
1775
|
+
* @returns Promise with detailed location information
|
|
1776
|
+
*/
|
|
1777
|
+
async getLocationDetails(lat: number, lon: number): Promise<any> {
|
|
1778
|
+
try {
|
|
1779
|
+
const res = await this.client.get(`/location-search/details?lat=${lat}&lon=${lon}`);
|
|
1780
|
+
return res.data.result;
|
|
1781
|
+
} catch (error) {
|
|
1782
|
+
throw this.handleError(error);
|
|
1783
|
+
}
|
|
1784
|
+
}
|
|
1785
|
+
|
|
1786
|
+
/**
|
|
1787
|
+
* Find locations near a point using geospatial queries
|
|
1788
|
+
* @param lat - Latitude
|
|
1789
|
+
* @param lon - Longitude
|
|
1790
|
+
* @param maxDistance - Maximum distance in meters (default: 10000)
|
|
1791
|
+
* @param limit - Maximum number of results (default: 10)
|
|
1792
|
+
* @param skip - Number of results to skip (default: 0)
|
|
1793
|
+
* @returns Promise with nearby locations
|
|
1794
|
+
*/
|
|
1795
|
+
async findLocationsNear(
|
|
1796
|
+
lat: number,
|
|
1797
|
+
lon: number,
|
|
1798
|
+
maxDistance: number = 10000,
|
|
1799
|
+
limit: number = 10,
|
|
1800
|
+
skip: number = 0
|
|
1801
|
+
): Promise<any> {
|
|
1802
|
+
try {
|
|
1803
|
+
const params = new URLSearchParams({
|
|
1804
|
+
lat: lat.toString(),
|
|
1805
|
+
lon: lon.toString(),
|
|
1806
|
+
maxDistance: maxDistance.toString(),
|
|
1807
|
+
limit: limit.toString(),
|
|
1808
|
+
skip: skip.toString()
|
|
1809
|
+
});
|
|
1810
|
+
const res = await this.client.get(`/location-search/near?${params.toString()}`);
|
|
1811
|
+
return res.data;
|
|
1812
|
+
} catch (error) {
|
|
1813
|
+
throw this.handleError(error);
|
|
1814
|
+
}
|
|
1815
|
+
}
|
|
1816
|
+
|
|
1817
|
+
/**
|
|
1818
|
+
* Search locations in database by text
|
|
1819
|
+
* @param query - Search query
|
|
1820
|
+
* @param limit - Maximum number of results (default: 10)
|
|
1821
|
+
* @param skip - Number of results to skip (default: 0)
|
|
1822
|
+
* @param type - Filter by location type
|
|
1823
|
+
* @param country - Filter by country
|
|
1824
|
+
* @param city - Filter by city
|
|
1825
|
+
* @returns Promise with search results
|
|
1826
|
+
*/
|
|
1827
|
+
async searchLocationsInDB(
|
|
1828
|
+
query: string,
|
|
1829
|
+
limit: number = 10,
|
|
1830
|
+
skip: number = 0,
|
|
1831
|
+
type?: string,
|
|
1832
|
+
country?: string,
|
|
1833
|
+
city?: string
|
|
1834
|
+
): Promise<any> {
|
|
1835
|
+
try {
|
|
1836
|
+
const params = new URLSearchParams({
|
|
1837
|
+
query,
|
|
1838
|
+
limit: limit.toString(),
|
|
1839
|
+
skip: skip.toString()
|
|
1840
|
+
});
|
|
1841
|
+
if (type) params.append('type', type);
|
|
1842
|
+
if (country) params.append('country', country);
|
|
1843
|
+
if (city) params.append('city', city);
|
|
1844
|
+
|
|
1845
|
+
const res = await this.client.get(`/location-search/db-search?${params.toString()}`);
|
|
1846
|
+
return res.data;
|
|
1847
|
+
} catch (error) {
|
|
1848
|
+
throw this.handleError(error);
|
|
1849
|
+
}
|
|
1850
|
+
}
|
|
1851
|
+
|
|
1852
|
+
/**
|
|
1853
|
+
* Get location statistics
|
|
1854
|
+
* @returns Promise with location statistics
|
|
1855
|
+
*/
|
|
1856
|
+
async getLocationStats(): Promise<any> {
|
|
1857
|
+
try {
|
|
1858
|
+
const res = await this.client.get('/location-search/stats');
|
|
1859
|
+
return res.data.stats;
|
|
1860
|
+
} catch (error) {
|
|
1861
|
+
throw this.handleError(error);
|
|
1862
|
+
}
|
|
1863
|
+
}
|
|
1864
|
+
|
|
1865
|
+
/**
|
|
1866
|
+
* Get cache statistics
|
|
1867
|
+
* @returns Promise with cache statistics
|
|
1868
|
+
*/
|
|
1869
|
+
async getLocationCacheStats(): Promise<any> {
|
|
1870
|
+
try {
|
|
1871
|
+
const res = await this.client.get('/location-search/cache/stats');
|
|
1872
|
+
return res.data.stats;
|
|
1873
|
+
} catch (error) {
|
|
1874
|
+
throw this.handleError(error);
|
|
1875
|
+
}
|
|
1876
|
+
}
|
|
1877
|
+
|
|
1878
|
+
/**
|
|
1879
|
+
* Clear location cache
|
|
1880
|
+
* @returns Promise with success status
|
|
1881
|
+
*/
|
|
1882
|
+
async clearLocationCache(): Promise<any> {
|
|
1883
|
+
try {
|
|
1884
|
+
const res = await this.client.delete('/location-search/cache');
|
|
1885
|
+
return res.data;
|
|
1886
|
+
} catch (error) {
|
|
1887
|
+
throw this.handleError(error);
|
|
1888
|
+
}
|
|
1889
|
+
}
|
|
1890
|
+
|
|
1891
|
+
/**
|
|
1892
|
+
* Get performance statistics
|
|
1893
|
+
* @returns Promise with performance statistics
|
|
1894
|
+
*/
|
|
1895
|
+
async getLocationPerformanceStats(): Promise<any> {
|
|
1896
|
+
try {
|
|
1897
|
+
const res = await this.client.get('/location-search/performance');
|
|
1898
|
+
return res.data;
|
|
1899
|
+
} catch (error) {
|
|
1900
|
+
throw this.handleError(error);
|
|
1901
|
+
}
|
|
1902
|
+
}
|
|
1749
1903
|
}
|
|
1750
1904
|
|
|
1751
1905
|
// Default export for backward compatibility
|