@oxyhq/services 5.9.2 → 5.9.3
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 +1 -33
- package/lib/commonjs/core/OxyServices.js +159 -0
- package/lib/commonjs/core/OxyServices.js.map +1 -0
- package/lib/commonjs/core/OxyServicesMain.js +51 -0
- package/lib/commonjs/core/OxyServicesMain.js.map +1 -0
- package/lib/commonjs/core/analytics/AnalyticsService.js +67 -0
- package/lib/commonjs/core/analytics/AnalyticsService.js.map +1 -0
- package/lib/commonjs/core/auth/AuthService.js +526 -0
- package/lib/commonjs/core/auth/AuthService.js.map +1 -0
- package/lib/commonjs/core/devices/DeviceService.js +61 -0
- package/lib/commonjs/core/devices/DeviceService.js.map +1 -0
- package/lib/commonjs/core/files/FileService.js +176 -0
- package/lib/commonjs/core/files/FileService.js.map +1 -0
- package/lib/commonjs/core/index.js +103 -1701
- package/lib/commonjs/core/index.js.map +1 -1
- package/lib/commonjs/core/karma/KarmaService.js +100 -0
- package/lib/commonjs/core/karma/KarmaService.js.map +1 -0
- package/lib/commonjs/core/locations/LocationService.js +131 -0
- package/lib/commonjs/core/locations/LocationService.js.map +1 -0
- package/lib/commonjs/core/payments/PaymentService.js +124 -0
- package/lib/commonjs/core/payments/PaymentService.js.map +1 -0
- package/lib/commonjs/core/users/UserService.js +234 -0
- package/lib/commonjs/core/users/UserService.js.map +1 -0
- package/lib/commonjs/index.js +164 -3
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/models/session.js +2 -0
- package/lib/commonjs/{types/middleware.js.map → models/session.js.map} +1 -1
- package/lib/commonjs/ui/context/OxyContext.js +28 -24
- package/lib/commonjs/ui/context/OxyContext.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountSwitcherScreen.js +2 -2
- package/lib/commonjs/ui/screens/AccountSwitcherScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/FileManagementScreen.js +12 -12
- package/lib/commonjs/ui/screens/FileManagementScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/ProfileScreen.js +2 -2
- package/lib/commonjs/ui/screens/ProfileScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/SessionManagementScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/SignInScreen.js +1 -1
- package/lib/commonjs/ui/screens/SignInScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/karma/KarmaCenterScreen.js +1 -1
- package/lib/commonjs/ui/screens/karma/KarmaCenterScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/karma/KarmaLeaderboardScreen.js +1 -1
- package/lib/commonjs/ui/screens/karma/KarmaLeaderboardScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/karma/KarmaRulesScreen.js +1 -1
- package/lib/commonjs/ui/screens/karma/KarmaRulesScreen.js.map +1 -1
- package/lib/commonjs/ui/stores/followStore.js +4 -4
- package/lib/commonjs/ui/stores/followStore.js.map +1 -1
- package/lib/commonjs/utils/apiUtils.js +93 -0
- package/lib/commonjs/utils/apiUtils.js.map +1 -0
- package/lib/commonjs/utils/asyncUtils.js +219 -0
- package/lib/commonjs/utils/asyncUtils.js.map +1 -0
- package/lib/commonjs/utils/errorUtils.js +148 -0
- package/lib/commonjs/utils/errorUtils.js.map +1 -0
- package/lib/commonjs/utils/hookUtils.js +399 -0
- package/lib/commonjs/utils/hookUtils.js.map +1 -0
- package/lib/commonjs/utils/loggerUtils.js +160 -0
- package/lib/commonjs/utils/loggerUtils.js.map +1 -0
- package/lib/commonjs/utils/validationUtils.js +174 -0
- package/lib/commonjs/utils/validationUtils.js.map +1 -0
- package/lib/module/core/OxyServices.js +153 -0
- package/lib/module/core/OxyServices.js.map +1 -0
- package/lib/module/core/OxyServicesMain.js +47 -0
- package/lib/module/core/OxyServicesMain.js.map +1 -0
- package/lib/module/core/analytics/AnalyticsService.js +62 -0
- package/lib/module/core/analytics/AnalyticsService.js.map +1 -0
- package/lib/module/core/auth/AuthService.js +521 -0
- package/lib/module/core/auth/AuthService.js.map +1 -0
- package/lib/module/core/devices/DeviceService.js +57 -0
- package/lib/module/core/devices/DeviceService.js.map +1 -0
- package/lib/module/core/files/FileService.js +171 -0
- package/lib/module/core/files/FileService.js.map +1 -0
- package/lib/module/core/index.js +25 -1690
- package/lib/module/core/index.js.map +1 -1
- package/lib/module/core/karma/KarmaService.js +95 -0
- package/lib/module/core/karma/KarmaService.js.map +1 -0
- package/lib/module/core/locations/LocationService.js +127 -0
- package/lib/module/core/locations/LocationService.js.map +1 -0
- package/lib/module/core/payments/PaymentService.js +119 -0
- package/lib/module/core/payments/PaymentService.js.map +1 -0
- package/lib/module/core/users/UserService.js +230 -0
- package/lib/module/core/users/UserService.js.map +1 -0
- package/lib/module/index.js +8 -4
- package/lib/module/index.js.map +1 -1
- package/lib/module/models/session.js +2 -0
- package/lib/module/{types/middleware.js.map → models/session.js.map} +1 -1
- package/lib/module/ui/context/OxyContext.js +28 -24
- package/lib/module/ui/context/OxyContext.js.map +1 -1
- package/lib/module/ui/screens/AccountSwitcherScreen.js +2 -2
- package/lib/module/ui/screens/AccountSwitcherScreen.js.map +1 -1
- package/lib/module/ui/screens/FileManagementScreen.js +12 -12
- package/lib/module/ui/screens/FileManagementScreen.js.map +1 -1
- package/lib/module/ui/screens/ProfileScreen.js +2 -2
- package/lib/module/ui/screens/ProfileScreen.js.map +1 -1
- package/lib/module/ui/screens/SessionManagementScreen.js.map +1 -1
- package/lib/module/ui/screens/SignInScreen.js +1 -1
- package/lib/module/ui/screens/SignInScreen.js.map +1 -1
- package/lib/module/ui/screens/karma/KarmaCenterScreen.js +1 -1
- package/lib/module/ui/screens/karma/KarmaCenterScreen.js.map +1 -1
- package/lib/module/ui/screens/karma/KarmaLeaderboardScreen.js +1 -1
- package/lib/module/ui/screens/karma/KarmaLeaderboardScreen.js.map +1 -1
- package/lib/module/ui/screens/karma/KarmaRulesScreen.js +1 -1
- package/lib/module/ui/screens/karma/KarmaRulesScreen.js.map +1 -1
- package/lib/module/ui/stores/followStore.js +4 -4
- package/lib/module/ui/stores/followStore.js.map +1 -1
- package/lib/module/utils/apiUtils.js +85 -0
- package/lib/module/utils/apiUtils.js.map +1 -0
- package/lib/module/utils/asyncUtils.js +202 -0
- package/lib/module/utils/asyncUtils.js.map +1 -0
- package/lib/module/utils/errorUtils.js +139 -0
- package/lib/module/utils/errorUtils.js.map +1 -0
- package/lib/module/utils/hookUtils.js +381 -0
- package/lib/module/utils/hookUtils.js.map +1 -0
- package/lib/module/utils/loggerUtils.js +149 -0
- package/lib/module/utils/loggerUtils.js.map +1 -0
- package/lib/module/utils/validationUtils.js +154 -0
- package/lib/module/utils/validationUtils.js.map +1 -0
- package/lib/typescript/core/OxyServices.d.ts +64 -0
- package/lib/typescript/core/OxyServices.d.ts.map +1 -0
- package/lib/typescript/core/OxyServicesMain.d.ts +33 -0
- package/lib/typescript/core/OxyServicesMain.d.ts.map +1 -0
- package/lib/typescript/core/analytics/AnalyticsService.d.ts +26 -0
- package/lib/typescript/core/analytics/AnalyticsService.d.ts.map +1 -0
- package/lib/typescript/core/auth/AuthService.d.ts +165 -0
- package/lib/typescript/core/auth/AuthService.d.ts.map +1 -0
- package/lib/typescript/core/devices/DeviceService.d.ts +20 -0
- package/lib/typescript/core/devices/DeviceService.d.ts.map +1 -0
- package/lib/typescript/core/files/FileService.d.ts +59 -0
- package/lib/typescript/core/files/FileService.d.ts.map +1 -0
- package/lib/typescript/core/index.d.ts +19 -656
- package/lib/typescript/core/index.d.ts.map +1 -1
- package/lib/typescript/core/karma/KarmaService.d.ts +50 -0
- package/lib/typescript/core/karma/KarmaService.d.ts.map +1 -0
- package/lib/typescript/core/locations/LocationService.d.ts +39 -0
- package/lib/typescript/core/locations/LocationService.d.ts.map +1 -0
- package/lib/typescript/core/payments/PaymentService.d.ts +50 -0
- package/lib/typescript/core/payments/PaymentService.d.ts.map +1 -0
- package/lib/typescript/core/users/UserService.d.ts +111 -0
- package/lib/typescript/core/users/UserService.d.ts.map +1 -0
- package/lib/typescript/index.d.ts +7 -3
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/models/{secureSession.d.ts → session.d.ts} +4 -4
- package/lib/typescript/models/session.d.ts.map +1 -0
- package/lib/typescript/ui/context/OxyContext.d.ts +2 -2
- package/lib/typescript/ui/context/OxyContext.d.ts.map +1 -1
- package/lib/typescript/utils/apiUtils.d.ts +61 -0
- package/lib/typescript/utils/apiUtils.d.ts.map +1 -0
- package/lib/typescript/utils/asyncUtils.d.ts +64 -0
- package/lib/typescript/utils/asyncUtils.d.ts.map +1 -0
- package/lib/typescript/utils/errorUtils.d.ts +45 -0
- package/lib/typescript/utils/errorUtils.d.ts.map +1 -0
- package/lib/typescript/utils/hookUtils.d.ts +102 -0
- package/lib/typescript/utils/hookUtils.d.ts.map +1 -0
- package/lib/typescript/utils/loggerUtils.d.ts +49 -0
- package/lib/typescript/utils/loggerUtils.d.ts.map +1 -0
- package/lib/typescript/utils/validationUtils.d.ts +80 -0
- package/lib/typescript/utils/validationUtils.d.ts.map +1 -0
- package/package.json +2 -8
- package/src/core/OxyServices.ts +168 -0
- package/src/core/OxyServicesMain.ts +57 -0
- package/src/core/analytics/AnalyticsService.ts +64 -0
- package/src/core/auth/AuthService.ts +544 -0
- package/src/core/devices/DeviceService.ts +55 -0
- package/src/core/files/FileService.ts +194 -0
- package/src/core/index.ts +27 -1765
- package/src/core/karma/KarmaService.ts +104 -0
- package/src/core/locations/LocationService.ts +141 -0
- package/src/core/payments/PaymentService.ts +133 -0
- package/src/core/users/UserService.ts +241 -0
- package/src/index.ts +29 -8
- package/src/models/{secureSession.ts → session.ts} +5 -5
- package/src/ui/context/OxyContext.tsx +34 -30
- package/src/ui/screens/AccountSwitcherScreen.tsx +4 -4
- package/src/ui/screens/FileManagementScreen.tsx +12 -12
- package/src/ui/screens/ProfileScreen.tsx +3 -3
- package/src/ui/screens/SessionManagementScreen.tsx +2 -2
- package/src/ui/screens/SignInScreen.tsx +1 -1
- package/src/ui/screens/karma/KarmaCenterScreen.tsx +2 -2
- package/src/ui/screens/karma/KarmaLeaderboardScreen.tsx +3 -3
- package/src/ui/screens/karma/KarmaRulesScreen.tsx +3 -3
- package/src/ui/stores/followStore.ts +4 -4
- package/src/utils/apiUtils.ts +102 -0
- package/src/utils/asyncUtils.ts +265 -0
- package/src/utils/errorUtils.ts +172 -0
- package/src/utils/hookUtils.ts +397 -0
- package/src/utils/loggerUtils.ts +153 -0
- package/src/utils/validationUtils.ts +158 -0
- package/lib/commonjs/middleware.js +0 -17
- package/lib/commonjs/middleware.js.map +0 -1
- package/lib/commonjs/models/secureSession.js +0 -2
- package/lib/commonjs/models/secureSession.js.map +0 -1
- package/lib/commonjs/types/middleware.js +0 -6
- package/lib/module/middleware.js +0 -12
- package/lib/module/middleware.js.map +0 -1
- package/lib/module/models/secureSession.js +0 -2
- package/lib/module/models/secureSession.js.map +0 -1
- package/lib/module/types/middleware.js +0 -4
- package/lib/typescript/middleware.d.ts +0 -9
- package/lib/typescript/middleware.d.ts.map +0 -1
- package/lib/typescript/models/secureSession.d.ts.map +0 -1
- package/lib/typescript/types/middleware.d.ts +0 -19
- package/lib/typescript/types/middleware.d.ts.map +0 -1
- package/src/middleware.ts +0 -11
- package/src/types/middleware.ts +0 -20
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.UserService = void 0;
|
|
7
|
+
var _OxyServices = require("../OxyServices");
|
|
8
|
+
var _apiUtils = require("../../utils/apiUtils");
|
|
9
|
+
/**
|
|
10
|
+
* User service for handling user operations, profiles, and social features
|
|
11
|
+
*/
|
|
12
|
+
class UserService extends _OxyServices.OxyServices {
|
|
13
|
+
/**
|
|
14
|
+
* Get profile by username
|
|
15
|
+
*/
|
|
16
|
+
async getProfileByUsername(username) {
|
|
17
|
+
try {
|
|
18
|
+
const res = await this.getClient().get(`/users/profile/${username}`);
|
|
19
|
+
return res.data;
|
|
20
|
+
} catch (error) {
|
|
21
|
+
throw this.handleError(error);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Search user profiles
|
|
27
|
+
*/
|
|
28
|
+
async searchProfiles(query, pagination) {
|
|
29
|
+
try {
|
|
30
|
+
const params = {
|
|
31
|
+
query,
|
|
32
|
+
...pagination
|
|
33
|
+
};
|
|
34
|
+
const searchParams = (0, _apiUtils.buildSearchParams)(params);
|
|
35
|
+
const res = await this.getClient().get(`/users/search?${searchParams.toString()}`);
|
|
36
|
+
return res.data;
|
|
37
|
+
} catch (error) {
|
|
38
|
+
throw this.handleError(error);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Get profile recommendations
|
|
44
|
+
*/
|
|
45
|
+
async getProfileRecommendations() {
|
|
46
|
+
try {
|
|
47
|
+
const res = await this.getClient().get('/users/recommendations');
|
|
48
|
+
return res.data;
|
|
49
|
+
} catch (error) {
|
|
50
|
+
throw this.handleError(error);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Get user by ID
|
|
56
|
+
*/
|
|
57
|
+
async getUserById(userId) {
|
|
58
|
+
try {
|
|
59
|
+
const res = await this.getClient().get(`/users/${userId}`);
|
|
60
|
+
return res.data;
|
|
61
|
+
} catch (error) {
|
|
62
|
+
throw this.handleError(error);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Get current user
|
|
68
|
+
*/
|
|
69
|
+
async getCurrentUser() {
|
|
70
|
+
try {
|
|
71
|
+
const res = await this.getClient().get('/users/me');
|
|
72
|
+
return res.data;
|
|
73
|
+
} catch (error) {
|
|
74
|
+
throw this.handleError(error);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Update user profile
|
|
80
|
+
*/
|
|
81
|
+
async updateProfile(updates) {
|
|
82
|
+
try {
|
|
83
|
+
const res = await this.getClient().put('/users/profile', updates);
|
|
84
|
+
return res.data;
|
|
85
|
+
} catch (error) {
|
|
86
|
+
throw this.handleError(error);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Update user by ID (admin function)
|
|
92
|
+
*/
|
|
93
|
+
async updateUser(userId, updates) {
|
|
94
|
+
try {
|
|
95
|
+
const res = await this.getClient().put(`/users/${userId}`, updates);
|
|
96
|
+
return res.data;
|
|
97
|
+
} catch (error) {
|
|
98
|
+
throw this.handleError(error);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Follow a user
|
|
104
|
+
*/
|
|
105
|
+
async followUser(userId) {
|
|
106
|
+
try {
|
|
107
|
+
const res = await this.getClient().post(`/users/${userId}/follow`);
|
|
108
|
+
return res.data;
|
|
109
|
+
} catch (error) {
|
|
110
|
+
throw this.handleError(error);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Unfollow a user
|
|
116
|
+
*/
|
|
117
|
+
async unfollowUser(userId) {
|
|
118
|
+
try {
|
|
119
|
+
const res = await this.getClient().delete(`/users/${userId}/follow`);
|
|
120
|
+
return res.data;
|
|
121
|
+
} catch (error) {
|
|
122
|
+
throw this.handleError(error);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Get follow status
|
|
128
|
+
*/
|
|
129
|
+
async getFollowStatus(userId) {
|
|
130
|
+
try {
|
|
131
|
+
const res = await this.getClient().get(`/users/${userId}/follow-status`);
|
|
132
|
+
return res.data;
|
|
133
|
+
} catch (error) {
|
|
134
|
+
throw this.handleError(error);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* Get user followers
|
|
140
|
+
*/
|
|
141
|
+
async getUserFollowers(userId, pagination) {
|
|
142
|
+
try {
|
|
143
|
+
const searchParams = (0, _apiUtils.buildPaginationParams)(pagination || {});
|
|
144
|
+
const res = await this.getClient().get(`/users/${userId}/followers?${searchParams.toString()}`);
|
|
145
|
+
return res.data;
|
|
146
|
+
} catch (error) {
|
|
147
|
+
throw this.handleError(error);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* Get user following
|
|
153
|
+
*/
|
|
154
|
+
async getUserFollowing(userId, pagination) {
|
|
155
|
+
try {
|
|
156
|
+
const searchParams = (0, _apiUtils.buildPaginationParams)(pagination || {});
|
|
157
|
+
const res = await this.getClient().get(`/users/${userId}/following?${searchParams.toString()}`);
|
|
158
|
+
return res.data;
|
|
159
|
+
} catch (error) {
|
|
160
|
+
throw this.handleError(error);
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* Get notifications
|
|
166
|
+
*/
|
|
167
|
+
async getNotifications() {
|
|
168
|
+
try {
|
|
169
|
+
const res = await this.getClient().get('/notifications');
|
|
170
|
+
return res.data;
|
|
171
|
+
} catch (error) {
|
|
172
|
+
throw this.handleError(error);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* Get unread notification count
|
|
178
|
+
*/
|
|
179
|
+
async getUnreadCount() {
|
|
180
|
+
try {
|
|
181
|
+
const res = await this.getClient().get('/notifications/unread-count');
|
|
182
|
+
return res.data.count;
|
|
183
|
+
} catch (error) {
|
|
184
|
+
throw this.handleError(error);
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* Create notification
|
|
190
|
+
*/
|
|
191
|
+
async createNotification(data) {
|
|
192
|
+
try {
|
|
193
|
+
const res = await this.getClient().post('/notifications', data);
|
|
194
|
+
return res.data;
|
|
195
|
+
} catch (error) {
|
|
196
|
+
throw this.handleError(error);
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* Mark notification as read
|
|
202
|
+
*/
|
|
203
|
+
async markNotificationAsRead(notificationId) {
|
|
204
|
+
try {
|
|
205
|
+
await this.getClient().put(`/notifications/${notificationId}/read`);
|
|
206
|
+
} catch (error) {
|
|
207
|
+
throw this.handleError(error);
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
/**
|
|
212
|
+
* Mark all notifications as read
|
|
213
|
+
*/
|
|
214
|
+
async markAllNotificationsAsRead() {
|
|
215
|
+
try {
|
|
216
|
+
await this.getClient().put('/notifications/read-all');
|
|
217
|
+
} catch (error) {
|
|
218
|
+
throw this.handleError(error);
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
/**
|
|
223
|
+
* Delete notification
|
|
224
|
+
*/
|
|
225
|
+
async deleteNotification(notificationId) {
|
|
226
|
+
try {
|
|
227
|
+
await this.getClient().delete(`/notifications/${notificationId}`);
|
|
228
|
+
} catch (error) {
|
|
229
|
+
throw this.handleError(error);
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
exports.UserService = UserService;
|
|
234
|
+
//# sourceMappingURL=UserService.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_OxyServices","require","_apiUtils","UserService","OxyServices","getProfileByUsername","username","res","getClient","get","data","error","handleError","searchProfiles","query","pagination","params","searchParams","buildSearchParams","toString","getProfileRecommendations","getUserById","userId","getCurrentUser","updateProfile","updates","put","updateUser","followUser","post","unfollowUser","delete","getFollowStatus","getUserFollowers","buildPaginationParams","getUserFollowing","getNotifications","getUnreadCount","count","createNotification","markNotificationAsRead","notificationId","markAllNotificationsAsRead","deleteNotification","exports"],"sourceRoot":"../../../../src","sources":["core/users/UserService.ts"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAEA,IA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IACjB,CAAC,CAAC,OAAOC,KAAK,EAAE;MACd,MAAM,IAAI,CAACC,WAAW,CAACD,KAAK,CAAC;IAC/B;EACF;;EAEA;AACF;AACA;EACE,MAAM6B,sBAAsBA,CAACC,cAAsB,EAAiB;IAClE,IAAI;MACF,MAAM,IAAI,CAACjC,SAAS,CAAC,CAAC,CAACkB,GAAG,CAAC,kBAAkBe,cAAc,OAAO,CAAC;IACrE,CAAC,CAAC,OAAO9B,KAAK,EAAE;MACd,MAAM,IAAI,CAACC,WAAW,CAACD,KAAK,CAAC;IAC/B;EACF;;EAEA;AACF;AACA;EACE,MAAM+B,0BAA0BA,CAAA,EAAkB;IAChD,IAAI;MACF,MAAM,IAAI,CAAClC,SAAS,CAAC,CAAC,CAACkB,GAAG,CAAC,yBAAyB,CAAC;IACvD,CAAC,CAAC,OAAOf,KAAK,EAAE;MACd,MAAM,IAAI,CAACC,WAAW,CAACD,KAAK,CAAC;IAC/B;EACF;;EAEA;AACF;AACA;EACE,MAAMgC,kBAAkBA,CAACF,cAAsB,EAAiB;IAC9D,IAAI;MACF,MAAM,IAAI,CAACjC,SAAS,CAAC,CAAC,CAACuB,MAAM,CAAC,kBAAkBU,cAAc,EAAE,CAAC;IACnE,CAAC,CAAC,OAAO9B,KAAK,EAAE;MACd,MAAM,IAAI,CAACC,WAAW,CAACD,KAAK,CAAC;IAC/B;EACF;AACF;AAACiC,OAAA,CAAAzC,WAAA,GAAAA,WAAA","ignoreList":[]}
|
package/lib/commonjs/index.js
CHANGED
|
@@ -3,18 +3,64 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
+
var _exportNames = {
|
|
7
|
+
OxyServices: true,
|
|
8
|
+
OXY_CLOUD_URL: true,
|
|
9
|
+
OxyContextProvider: true,
|
|
10
|
+
useOxy: true,
|
|
11
|
+
OxyProvider: true,
|
|
12
|
+
DeviceManager: true,
|
|
13
|
+
useAuthStore: true,
|
|
14
|
+
useSessionSocket: true,
|
|
15
|
+
OxySignInButton: true,
|
|
16
|
+
OxyLogo: true,
|
|
17
|
+
FollowButton: true,
|
|
18
|
+
ErrorCodes: true,
|
|
19
|
+
createApiError: true,
|
|
20
|
+
handleHttpError: true,
|
|
21
|
+
validateRequiredFields: true,
|
|
22
|
+
retryWithBackoff: true,
|
|
23
|
+
logger: true,
|
|
24
|
+
LogLevel: true,
|
|
25
|
+
LogContext: true,
|
|
26
|
+
logAuth: true,
|
|
27
|
+
logApi: true,
|
|
28
|
+
logSession: true,
|
|
29
|
+
logUser: true,
|
|
30
|
+
logDevice: true,
|
|
31
|
+
logPayment: true,
|
|
32
|
+
logPerformance: true
|
|
33
|
+
};
|
|
6
34
|
Object.defineProperty(exports, "DeviceManager", {
|
|
7
35
|
enumerable: true,
|
|
8
36
|
get: function () {
|
|
9
37
|
return _deviceManager.DeviceManager;
|
|
10
38
|
}
|
|
11
39
|
});
|
|
40
|
+
Object.defineProperty(exports, "ErrorCodes", {
|
|
41
|
+
enumerable: true,
|
|
42
|
+
get: function () {
|
|
43
|
+
return _errorUtils.ErrorCodes;
|
|
44
|
+
}
|
|
45
|
+
});
|
|
12
46
|
Object.defineProperty(exports, "FollowButton", {
|
|
13
47
|
enumerable: true,
|
|
14
48
|
get: function () {
|
|
15
49
|
return _ui.FollowButton;
|
|
16
50
|
}
|
|
17
51
|
});
|
|
52
|
+
Object.defineProperty(exports, "LogContext", {
|
|
53
|
+
enumerable: true,
|
|
54
|
+
get: function () {
|
|
55
|
+
return _loggerUtils.LogContext;
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
Object.defineProperty(exports, "LogLevel", {
|
|
59
|
+
enumerable: true,
|
|
60
|
+
get: function () {
|
|
61
|
+
return _loggerUtils.LogLevel;
|
|
62
|
+
}
|
|
63
|
+
});
|
|
18
64
|
Object.defineProperty(exports, "OXY_CLOUD_URL", {
|
|
19
65
|
enumerable: true,
|
|
20
66
|
get: function () {
|
|
@@ -51,10 +97,70 @@ Object.defineProperty(exports, "OxySignInButton", {
|
|
|
51
97
|
return _OxySignInButton.OxySignInButton;
|
|
52
98
|
}
|
|
53
99
|
});
|
|
54
|
-
Object.defineProperty(exports, "
|
|
100
|
+
Object.defineProperty(exports, "createApiError", {
|
|
101
|
+
enumerable: true,
|
|
102
|
+
get: function () {
|
|
103
|
+
return _errorUtils.createApiError;
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
Object.defineProperty(exports, "handleHttpError", {
|
|
107
|
+
enumerable: true,
|
|
108
|
+
get: function () {
|
|
109
|
+
return _errorUtils.handleHttpError;
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
Object.defineProperty(exports, "logApi", {
|
|
113
|
+
enumerable: true,
|
|
114
|
+
get: function () {
|
|
115
|
+
return _loggerUtils.logApi;
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
Object.defineProperty(exports, "logAuth", {
|
|
119
|
+
enumerable: true,
|
|
120
|
+
get: function () {
|
|
121
|
+
return _loggerUtils.logAuth;
|
|
122
|
+
}
|
|
123
|
+
});
|
|
124
|
+
Object.defineProperty(exports, "logDevice", {
|
|
125
|
+
enumerable: true,
|
|
126
|
+
get: function () {
|
|
127
|
+
return _loggerUtils.logDevice;
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
Object.defineProperty(exports, "logPayment", {
|
|
131
|
+
enumerable: true,
|
|
132
|
+
get: function () {
|
|
133
|
+
return _loggerUtils.logPayment;
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
Object.defineProperty(exports, "logPerformance", {
|
|
137
|
+
enumerable: true,
|
|
138
|
+
get: function () {
|
|
139
|
+
return _loggerUtils.logPerformance;
|
|
140
|
+
}
|
|
141
|
+
});
|
|
142
|
+
Object.defineProperty(exports, "logSession", {
|
|
143
|
+
enumerable: true,
|
|
144
|
+
get: function () {
|
|
145
|
+
return _loggerUtils.logSession;
|
|
146
|
+
}
|
|
147
|
+
});
|
|
148
|
+
Object.defineProperty(exports, "logUser", {
|
|
149
|
+
enumerable: true,
|
|
150
|
+
get: function () {
|
|
151
|
+
return _loggerUtils.logUser;
|
|
152
|
+
}
|
|
153
|
+
});
|
|
154
|
+
Object.defineProperty(exports, "logger", {
|
|
155
|
+
enumerable: true,
|
|
156
|
+
get: function () {
|
|
157
|
+
return _loggerUtils.logger;
|
|
158
|
+
}
|
|
159
|
+
});
|
|
160
|
+
Object.defineProperty(exports, "retryWithBackoff", {
|
|
55
161
|
enumerable: true,
|
|
56
162
|
get: function () {
|
|
57
|
-
return
|
|
163
|
+
return _errorUtils.retryWithBackoff;
|
|
58
164
|
}
|
|
59
165
|
});
|
|
60
166
|
Object.defineProperty(exports, "useAuthStore", {
|
|
@@ -75,8 +181,13 @@ Object.defineProperty(exports, "useSessionSocket", {
|
|
|
75
181
|
return _useSessionSocket.useSessionSocket;
|
|
76
182
|
}
|
|
77
183
|
});
|
|
184
|
+
Object.defineProperty(exports, "validateRequiredFields", {
|
|
185
|
+
enumerable: true,
|
|
186
|
+
get: function () {
|
|
187
|
+
return _errorUtils.validateRequiredFields;
|
|
188
|
+
}
|
|
189
|
+
});
|
|
78
190
|
var _core = require("./core");
|
|
79
|
-
var _middleware = require("./middleware");
|
|
80
191
|
var _OxyContext = require("./ui/context/OxyContext");
|
|
81
192
|
var _OxyProvider = _interopRequireDefault(require("./ui/components/OxyProvider"));
|
|
82
193
|
var _deviceManager = require("./utils/deviceManager");
|
|
@@ -84,5 +195,55 @@ var _authStore = require("./ui/stores/authStore");
|
|
|
84
195
|
var _useSessionSocket = require("./ui/hooks/useSessionSocket");
|
|
85
196
|
var _OxySignInButton = require("./ui/components/OxySignInButton");
|
|
86
197
|
var _ui = require("./ui");
|
|
198
|
+
var _apiUtils = require("./utils/apiUtils");
|
|
199
|
+
Object.keys(_apiUtils).forEach(function (key) {
|
|
200
|
+
if (key === "default" || key === "__esModule") return;
|
|
201
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
202
|
+
if (key in exports && exports[key] === _apiUtils[key]) return;
|
|
203
|
+
Object.defineProperty(exports, key, {
|
|
204
|
+
enumerable: true,
|
|
205
|
+
get: function () {
|
|
206
|
+
return _apiUtils[key];
|
|
207
|
+
}
|
|
208
|
+
});
|
|
209
|
+
});
|
|
210
|
+
var _errorUtils = require("./utils/errorUtils");
|
|
211
|
+
var _validationUtils = require("./utils/validationUtils");
|
|
212
|
+
Object.keys(_validationUtils).forEach(function (key) {
|
|
213
|
+
if (key === "default" || key === "__esModule") return;
|
|
214
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
215
|
+
if (key in exports && exports[key] === _validationUtils[key]) return;
|
|
216
|
+
Object.defineProperty(exports, key, {
|
|
217
|
+
enumerable: true,
|
|
218
|
+
get: function () {
|
|
219
|
+
return _validationUtils[key];
|
|
220
|
+
}
|
|
221
|
+
});
|
|
222
|
+
});
|
|
223
|
+
var _loggerUtils = require("./utils/loggerUtils");
|
|
224
|
+
var _asyncUtils = require("./utils/asyncUtils");
|
|
225
|
+
Object.keys(_asyncUtils).forEach(function (key) {
|
|
226
|
+
if (key === "default" || key === "__esModule") return;
|
|
227
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
228
|
+
if (key in exports && exports[key] === _asyncUtils[key]) return;
|
|
229
|
+
Object.defineProperty(exports, key, {
|
|
230
|
+
enumerable: true,
|
|
231
|
+
get: function () {
|
|
232
|
+
return _asyncUtils[key];
|
|
233
|
+
}
|
|
234
|
+
});
|
|
235
|
+
});
|
|
236
|
+
var _hookUtils = require("./utils/hookUtils");
|
|
237
|
+
Object.keys(_hookUtils).forEach(function (key) {
|
|
238
|
+
if (key === "default" || key === "__esModule") return;
|
|
239
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
240
|
+
if (key in exports && exports[key] === _hookUtils[key]) return;
|
|
241
|
+
Object.defineProperty(exports, key, {
|
|
242
|
+
enumerable: true,
|
|
243
|
+
get: function () {
|
|
244
|
+
return _hookUtils[key];
|
|
245
|
+
}
|
|
246
|
+
});
|
|
247
|
+
});
|
|
87
248
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
88
249
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_core","require","
|
|
1
|
+
{"version":3,"names":["_core","require","_OxyContext","_OxyProvider","_interopRequireDefault","_deviceManager","_authStore","_useSessionSocket","_OxySignInButton","_ui","_apiUtils","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_errorUtils","_validationUtils","_loggerUtils","_asyncUtils","_hookUtils","e","__esModule","default"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASA,IAAAA,KAAA,GAAAC,OAAA;AAIA,IAAAC,WAAA,GAAAD,OAAA;AAMA,IAAAE,YAAA,GAAAC,sBAAA,CAAAH,OAAA;AAGA,IAAAI,cAAA,GAAAJ,OAAA;AA4CA,IAAAK,UAAA,GAAAL,OAAA;AACA,IAAAM,iBAAA,GAAAN,OAAA;AAGA,IAAAO,gBAAA,GAAAP,OAAA;AACA,IAAAQ,GAAA,GAAAR,OAAA;AAGA,IAAAS,SAAA,GAAAT,OAAA;AAAAU,MAAA,CAAAC,IAAA,CAAAF,SAAA,EAAAG,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,O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A,EAAAd,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAa,UAAA,CAAAb,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAK,UAAA,CAAAb,GAAA;IAAA;EAAA;AAAA;AAAkC,SAAAV,uBAAAwB,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["models/session.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -61,15 +61,15 @@ const getStorage = async () => {
|
|
|
61
61
|
return new WebStorage();
|
|
62
62
|
};
|
|
63
63
|
|
|
64
|
-
// Storage keys for
|
|
65
|
-
const
|
|
64
|
+
// Storage keys for sessions
|
|
65
|
+
const getStorageKeys = (prefix = 'oxy_session') => ({
|
|
66
66
|
activeSessionId: `${prefix}_active_session_id` // Only store the active session ID
|
|
67
67
|
});
|
|
68
68
|
const OxyProvider = ({
|
|
69
69
|
children,
|
|
70
70
|
oxyServices: providedOxyServices,
|
|
71
71
|
baseURL,
|
|
72
|
-
storageKeyPrefix = '
|
|
72
|
+
storageKeyPrefix = 'oxy_session',
|
|
73
73
|
onAuthStateChange,
|
|
74
74
|
onError,
|
|
75
75
|
bottomSheetRef
|
|
@@ -107,7 +107,7 @@ const OxyProvider = ({
|
|
|
107
107
|
const [tokenReady, setTokenReady] = _react.default.useState(false);
|
|
108
108
|
|
|
109
109
|
// Storage keys (memoized to prevent infinite loops)
|
|
110
|
-
const keys = (0, _react.useMemo)(() =>
|
|
110
|
+
const keys = (0, _react.useMemo)(() => getStorageKeys(storageKeyPrefix), [storageKeyPrefix]);
|
|
111
111
|
|
|
112
112
|
// Clear all storage - defined before initAuth to avoid dependency issues
|
|
113
113
|
const clearAllStorage = (0, _react.useCallback)(async () => {
|
|
@@ -115,7 +115,7 @@ const OxyProvider = ({
|
|
|
115
115
|
try {
|
|
116
116
|
await storage.removeItem(keys.activeSessionId);
|
|
117
117
|
} catch (err) {
|
|
118
|
-
console.error('Clear
|
|
118
|
+
console.error('Clear storage error:', err);
|
|
119
119
|
}
|
|
120
120
|
}, [storage, keys]);
|
|
121
121
|
|
|
@@ -145,15 +145,17 @@ const OxyProvider = ({
|
|
|
145
145
|
try {
|
|
146
146
|
// Only load the active session ID from storage
|
|
147
147
|
const storedActiveSessionId = await storage.getItem(keys.activeSessionId);
|
|
148
|
-
console.log('
|
|
149
|
-
console.log('
|
|
150
|
-
console.log('
|
|
148
|
+
console.log('Auth - activeSessionId:', storedActiveSessionId);
|
|
149
|
+
console.log('Auth - storage available:', !!storage);
|
|
150
|
+
console.log('Auth - oxyServices available:', !!oxyServices);
|
|
151
151
|
if (storedActiveSessionId) {
|
|
152
152
|
// Validate the stored session with the backend
|
|
153
153
|
try {
|
|
154
|
-
const validation = await oxyServices.validateSession(storedActiveSessionId
|
|
154
|
+
const validation = await oxyServices.validateSession(storedActiveSessionId, {
|
|
155
|
+
useHeaderValidation: true
|
|
156
|
+
});
|
|
155
157
|
if (validation.valid) {
|
|
156
|
-
console.log('
|
|
158
|
+
console.log('Auth - session validated successfully');
|
|
157
159
|
setActiveSessionId(storedActiveSessionId);
|
|
158
160
|
|
|
159
161
|
// Get access token for API calls
|
|
@@ -182,18 +184,18 @@ const OxyProvider = ({
|
|
|
182
184
|
onAuthStateChange(fullUser);
|
|
183
185
|
}
|
|
184
186
|
} else {
|
|
185
|
-
console.log('
|
|
187
|
+
console.log('Auth - session invalid, clearing storage');
|
|
186
188
|
await clearAllStorage();
|
|
187
189
|
}
|
|
188
190
|
} catch (error) {
|
|
189
|
-
console.error('
|
|
191
|
+
console.error('Auth - session validation error:', error);
|
|
190
192
|
await clearAllStorage();
|
|
191
193
|
}
|
|
192
194
|
} else {
|
|
193
|
-
console.log('
|
|
195
|
+
console.log('Auth - no stored session found, user needs to login');
|
|
194
196
|
}
|
|
195
197
|
} catch (err) {
|
|
196
|
-
console.error('
|
|
198
|
+
console.error('Auth initialization error:', err);
|
|
197
199
|
await clearAllStorage();
|
|
198
200
|
} finally {
|
|
199
201
|
_authStore.useAuthStore.setState({
|
|
@@ -268,7 +270,7 @@ const OxyProvider = ({
|
|
|
268
270
|
}
|
|
269
271
|
}, [oxyServices, onAuthStateChange, loginSuccess, saveActiveSessionId]);
|
|
270
272
|
|
|
271
|
-
//
|
|
273
|
+
// Login method - only store session ID, retrieve data from backend
|
|
272
274
|
const login = (0, _react.useCallback)(async (username, password, deviceName) => {
|
|
273
275
|
if (!storage) throw new Error('Storage not initialized');
|
|
274
276
|
_authStore.useAuthStore.setState({
|
|
@@ -281,9 +283,9 @@ const OxyProvider = ({
|
|
|
281
283
|
|
|
282
284
|
// Get or generate persistent device info
|
|
283
285
|
const deviceInfo = await _deviceManager.DeviceManager.getDeviceInfo();
|
|
284
|
-
console.log('
|
|
285
|
-
console.log('
|
|
286
|
-
const response = await oxyServices.
|
|
286
|
+
console.log('Auth - Using device fingerprint:', deviceFingerprint);
|
|
287
|
+
console.log('Auth - Using device ID:', deviceInfo.deviceId);
|
|
288
|
+
const response = await oxyServices.signIn(username, password, deviceName || deviceInfo.deviceName || _deviceManager.DeviceManager.getDefaultDeviceName(), deviceFingerprint);
|
|
287
289
|
|
|
288
290
|
// Set as active session (only store session ID)
|
|
289
291
|
setActiveSessionId(response.sessionId);
|
|
@@ -326,7 +328,7 @@ const OxyProvider = ({
|
|
|
326
328
|
if (!activeSessionId) return;
|
|
327
329
|
try {
|
|
328
330
|
const sessionToLogout = targetSessionId || activeSessionId;
|
|
329
|
-
await oxyServices.
|
|
331
|
+
await oxyServices.logoutSession(activeSessionId, sessionToLogout);
|
|
330
332
|
|
|
331
333
|
// Remove session from local state
|
|
332
334
|
const filteredSessions = sessions.filter(s => s.sessionId !== sessionToLogout);
|
|
@@ -374,9 +376,9 @@ const OxyProvider = ({
|
|
|
374
376
|
throw new Error('Service not available');
|
|
375
377
|
}
|
|
376
378
|
try {
|
|
377
|
-
console.log('Calling oxyServices.
|
|
378
|
-
await oxyServices.
|
|
379
|
-
console.log('
|
|
379
|
+
console.log('Calling oxyServices.logoutAllSessions with sessionId:', activeSessionId);
|
|
380
|
+
await oxyServices.logoutAllSessions(activeSessionId);
|
|
381
|
+
console.log('logoutAllSessions completed successfully');
|
|
380
382
|
|
|
381
383
|
// Clear all local data
|
|
382
384
|
setSessions([]);
|
|
@@ -430,7 +432,7 @@ const OxyProvider = ({
|
|
|
430
432
|
const response = await oxyServices.signUp(username, email, password);
|
|
431
433
|
console.log('SignUp successful:', response);
|
|
432
434
|
|
|
433
|
-
// Now log the user in
|
|
435
|
+
// Now log the user in to create a session
|
|
434
436
|
// This will handle the session creation and device registration
|
|
435
437
|
const user = await login(username, password);
|
|
436
438
|
return user;
|
|
@@ -487,7 +489,9 @@ const OxyProvider = ({
|
|
|
487
489
|
for (const session of otherSessions) {
|
|
488
490
|
try {
|
|
489
491
|
// Try to validate this session
|
|
490
|
-
await oxyServices.validateSession(session.sessionId
|
|
492
|
+
await oxyServices.validateSession(session.sessionId, {
|
|
493
|
+
useHeaderValidation: true
|
|
494
|
+
});
|
|
491
495
|
console.log('Found valid session, switching to:', session.sessionId);
|
|
492
496
|
await switchToSession(session.sessionId);
|
|
493
497
|
return; // Successfully switched to another session
|