@oxyhq/services 5.10.4 → 5.10.6

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.
Files changed (142) hide show
  1. package/README.md +62 -14
  2. package/lib/commonjs/core/OxyServices.js +797 -5
  3. package/lib/commonjs/core/OxyServices.js.map +1 -1
  4. package/lib/commonjs/core/index.js +8 -83
  5. package/lib/commonjs/core/index.js.map +1 -1
  6. package/lib/commonjs/index.js +31 -1
  7. package/lib/commonjs/index.js.map +1 -1
  8. package/lib/commonjs/ui/screens/FileManagementScreen.js +12 -12
  9. package/lib/commonjs/ui/screens/FileManagementScreen.js.map +1 -1
  10. package/lib/commonjs/ui/screens/ProfileScreen.js +2 -2
  11. package/lib/commonjs/ui/screens/ProfileScreen.js.map +1 -1
  12. package/lib/commonjs/ui/screens/SignInScreen.js +1 -1
  13. package/lib/commonjs/ui/screens/SignInScreen.js.map +1 -1
  14. package/lib/commonjs/ui/screens/karma/KarmaCenterScreen.js +1 -1
  15. package/lib/commonjs/ui/screens/karma/KarmaCenterScreen.js.map +1 -1
  16. package/lib/commonjs/ui/screens/karma/KarmaLeaderboardScreen.js +1 -1
  17. package/lib/commonjs/ui/screens/karma/KarmaLeaderboardScreen.js.map +1 -1
  18. package/lib/commonjs/ui/screens/karma/KarmaRulesScreen.js +1 -1
  19. package/lib/commonjs/ui/screens/karma/KarmaRulesScreen.js.map +1 -1
  20. package/lib/commonjs/ui/stores/followStore.js +4 -4
  21. package/lib/commonjs/ui/stores/followStore.js.map +1 -1
  22. package/lib/commonjs/utils/s3FileManager.js +243 -0
  23. package/lib/commonjs/utils/s3FileManager.js.map +1 -0
  24. package/lib/commonjs/utils/s3FileManagerExample.js +407 -0
  25. package/lib/commonjs/utils/s3FileManagerExample.js.map +1 -0
  26. package/lib/commonjs/utils/s3FileManagerRN.js +274 -0
  27. package/lib/commonjs/utils/s3FileManagerRN.js.map +1 -0
  28. package/lib/module/core/OxyServices.js +796 -4
  29. package/lib/module/core/OxyServices.js.map +1 -1
  30. package/lib/module/core/index.js +9 -24
  31. package/lib/module/core/index.js.map +1 -1
  32. package/lib/module/index.js +4 -0
  33. package/lib/module/index.js.map +1 -1
  34. package/lib/module/ui/screens/FileManagementScreen.js +12 -12
  35. package/lib/module/ui/screens/FileManagementScreen.js.map +1 -1
  36. package/lib/module/ui/screens/ProfileScreen.js +2 -2
  37. package/lib/module/ui/screens/ProfileScreen.js.map +1 -1
  38. package/lib/module/ui/screens/SignInScreen.js +1 -1
  39. package/lib/module/ui/screens/SignInScreen.js.map +1 -1
  40. package/lib/module/ui/screens/karma/KarmaCenterScreen.js +1 -1
  41. package/lib/module/ui/screens/karma/KarmaCenterScreen.js.map +1 -1
  42. package/lib/module/ui/screens/karma/KarmaLeaderboardScreen.js +1 -1
  43. package/lib/module/ui/screens/karma/KarmaLeaderboardScreen.js.map +1 -1
  44. package/lib/module/ui/screens/karma/KarmaRulesScreen.js +1 -1
  45. package/lib/module/ui/screens/karma/KarmaRulesScreen.js.map +1 -1
  46. package/lib/module/ui/stores/followStore.js +4 -4
  47. package/lib/module/ui/stores/followStore.js.map +1 -1
  48. package/lib/module/utils/s3FileManager.js +237 -0
  49. package/lib/module/utils/s3FileManager.js.map +1 -0
  50. package/lib/module/utils/s3FileManagerExample.js +400 -0
  51. package/lib/module/utils/s3FileManagerExample.js.map +1 -0
  52. package/lib/module/utils/s3FileManagerRN.js +268 -0
  53. package/lib/module/utils/s3FileManagerRN.js.map +1 -0
  54. package/lib/typescript/core/OxyServices.d.ts +292 -3
  55. package/lib/typescript/core/OxyServices.d.ts.map +1 -1
  56. package/lib/typescript/core/index.d.ts +7 -16
  57. package/lib/typescript/core/index.d.ts.map +1 -1
  58. package/lib/typescript/index.d.ts +4 -0
  59. package/lib/typescript/index.d.ts.map +1 -1
  60. package/lib/typescript/utils/s3FileManager.d.ts +81 -0
  61. package/lib/typescript/utils/s3FileManager.d.ts.map +1 -0
  62. package/lib/typescript/utils/s3FileManagerExample.d.ts +87 -0
  63. package/lib/typescript/utils/s3FileManagerExample.d.ts.map +1 -0
  64. package/lib/typescript/utils/s3FileManagerRN.d.ts +104 -0
  65. package/lib/typescript/utils/s3FileManagerRN.d.ts.map +1 -0
  66. package/package.json +3 -1
  67. package/src/core/OxyServices.ts +881 -46
  68. package/src/core/index.ts +9 -24
  69. package/src/index.ts +17 -1
  70. package/src/ui/screens/FileManagementScreen.tsx +12 -12
  71. package/src/ui/screens/ProfileScreen.tsx +3 -3
  72. package/src/ui/screens/SignInScreen.tsx +1 -1
  73. package/src/ui/screens/karma/KarmaCenterScreen.tsx +2 -2
  74. package/src/ui/screens/karma/KarmaLeaderboardScreen.tsx +1 -1
  75. package/src/ui/screens/karma/KarmaRulesScreen.tsx +1 -1
  76. package/src/ui/stores/followStore.ts +4 -4
  77. package/src/utils/s3FileManager.ts +281 -0
  78. package/src/utils/s3FileManagerExample.ts +432 -0
  79. package/src/utils/s3FileManagerRN.ts +322 -0
  80. package/lib/commonjs/core/OxyServicesMain.js +0 -51
  81. package/lib/commonjs/core/OxyServicesMain.js.map +0 -1
  82. package/lib/commonjs/core/analytics/AnalyticsService.js +0 -67
  83. package/lib/commonjs/core/analytics/AnalyticsService.js.map +0 -1
  84. package/lib/commonjs/core/auth/AuthService.js +0 -538
  85. package/lib/commonjs/core/auth/AuthService.js.map +0 -1
  86. package/lib/commonjs/core/devices/DeviceService.js +0 -61
  87. package/lib/commonjs/core/devices/DeviceService.js.map +0 -1
  88. package/lib/commonjs/core/files/FileService.js +0 -180
  89. package/lib/commonjs/core/files/FileService.js.map +0 -1
  90. package/lib/commonjs/core/karma/KarmaService.js +0 -100
  91. package/lib/commonjs/core/karma/KarmaService.js.map +0 -1
  92. package/lib/commonjs/core/locations/LocationService.js +0 -131
  93. package/lib/commonjs/core/locations/LocationService.js.map +0 -1
  94. package/lib/commonjs/core/payments/PaymentService.js +0 -124
  95. package/lib/commonjs/core/payments/PaymentService.js.map +0 -1
  96. package/lib/commonjs/core/users/UserService.js +0 -234
  97. package/lib/commonjs/core/users/UserService.js.map +0 -1
  98. package/lib/module/core/OxyServicesMain.js +0 -47
  99. package/lib/module/core/OxyServicesMain.js.map +0 -1
  100. package/lib/module/core/analytics/AnalyticsService.js +0 -62
  101. package/lib/module/core/analytics/AnalyticsService.js.map +0 -1
  102. package/lib/module/core/auth/AuthService.js +0 -533
  103. package/lib/module/core/auth/AuthService.js.map +0 -1
  104. package/lib/module/core/devices/DeviceService.js +0 -57
  105. package/lib/module/core/devices/DeviceService.js.map +0 -1
  106. package/lib/module/core/files/FileService.js +0 -175
  107. package/lib/module/core/files/FileService.js.map +0 -1
  108. package/lib/module/core/karma/KarmaService.js +0 -95
  109. package/lib/module/core/karma/KarmaService.js.map +0 -1
  110. package/lib/module/core/locations/LocationService.js +0 -127
  111. package/lib/module/core/locations/LocationService.js.map +0 -1
  112. package/lib/module/core/payments/PaymentService.js +0 -119
  113. package/lib/module/core/payments/PaymentService.js.map +0 -1
  114. package/lib/module/core/users/UserService.js +0 -230
  115. package/lib/module/core/users/UserService.js.map +0 -1
  116. package/lib/typescript/core/OxyServicesMain.d.ts +0 -33
  117. package/lib/typescript/core/OxyServicesMain.d.ts.map +0 -1
  118. package/lib/typescript/core/analytics/AnalyticsService.d.ts +0 -26
  119. package/lib/typescript/core/analytics/AnalyticsService.d.ts.map +0 -1
  120. package/lib/typescript/core/auth/AuthService.d.ts +0 -165
  121. package/lib/typescript/core/auth/AuthService.d.ts.map +0 -1
  122. package/lib/typescript/core/devices/DeviceService.d.ts +0 -20
  123. package/lib/typescript/core/devices/DeviceService.d.ts.map +0 -1
  124. package/lib/typescript/core/files/FileService.d.ts +0 -59
  125. package/lib/typescript/core/files/FileService.d.ts.map +0 -1
  126. package/lib/typescript/core/karma/KarmaService.d.ts +0 -50
  127. package/lib/typescript/core/karma/KarmaService.d.ts.map +0 -1
  128. package/lib/typescript/core/locations/LocationService.d.ts +0 -39
  129. package/lib/typescript/core/locations/LocationService.d.ts.map +0 -1
  130. package/lib/typescript/core/payments/PaymentService.d.ts +0 -50
  131. package/lib/typescript/core/payments/PaymentService.d.ts.map +0 -1
  132. package/lib/typescript/core/users/UserService.d.ts +0 -111
  133. package/lib/typescript/core/users/UserService.d.ts.map +0 -1
  134. package/src/core/OxyServicesMain.ts +0 -57
  135. package/src/core/analytics/AnalyticsService.ts +0 -64
  136. package/src/core/auth/AuthService.ts +0 -560
  137. package/src/core/devices/DeviceService.ts +0 -55
  138. package/src/core/files/FileService.ts +0 -198
  139. package/src/core/karma/KarmaService.ts +0 -104
  140. package/src/core/locations/LocationService.ts +0 -141
  141. package/src/core/payments/PaymentService.ts +0 -133
  142. package/src/core/users/UserService.ts +0 -241
@@ -1,241 +0,0 @@
1
- import { OxyServices } from '../OxyServices';
2
- import { User, Notification } from '../../models/interfaces';
3
- import { buildSearchParams, buildPaginationParams, PaginationParams } from '../../utils/apiUtils';
4
-
5
- /**
6
- * User service for handling user operations, profiles, and social features
7
- */
8
- export class UserService extends OxyServices {
9
- /**
10
- * Get profile by username
11
- */
12
- async getProfileByUsername(username: string): Promise<User> {
13
- try {
14
- const res = await this.getClient().get(`/api/profiles/username/${username}`);
15
- return res.data;
16
- } catch (error) {
17
- throw this.handleError(error);
18
- }
19
- }
20
-
21
- /**
22
- * Search user profiles
23
- */
24
- async searchProfiles(query: string, pagination?: PaginationParams): Promise<User[]> {
25
- try {
26
- const params = { query, ...pagination };
27
- const searchParams = buildSearchParams(params);
28
-
29
- const res = await this.getClient().get(`/api/profiles/search?${searchParams.toString()}`);
30
- return res.data;
31
- } catch (error) {
32
- throw this.handleError(error);
33
- }
34
- }
35
-
36
- /**
37
- * Get profile recommendations
38
- */
39
- async getProfileRecommendations(): Promise<Array<{
40
- id: string;
41
- username: string;
42
- name?: { first?: string; last?: string; full?: string };
43
- description?: string;
44
- _count?: { followers: number; following: number };
45
- [key: string]: any;
46
- }>> {
47
- try {
48
- const res = await this.getClient().get('/api/profiles/recommendations');
49
- return res.data;
50
- } catch (error) {
51
- throw this.handleError(error);
52
- }
53
- }
54
-
55
- /**
56
- * Get user by ID
57
- */
58
- async getUserById(userId: string): Promise<User> {
59
- try {
60
- const res = await this.getClient().get(`/api/users/${userId}`);
61
- return res.data;
62
- } catch (error) {
63
- throw this.handleError(error);
64
- }
65
- }
66
-
67
- /**
68
- * Get current user
69
- */
70
- async getCurrentUser(): Promise<User> {
71
- try {
72
- const res = await this.getClient().get('/api/users/me');
73
- return res.data;
74
- } catch (error) {
75
- throw this.handleError(error);
76
- }
77
- }
78
-
79
- /**
80
- * Update user profile
81
- */
82
- async updateProfile(updates: Record<string, any>): Promise<User> {
83
- try {
84
- const res = await this.getClient().put('/api/users/me', updates);
85
- return res.data;
86
- } catch (error) {
87
- throw this.handleError(error);
88
- }
89
- }
90
-
91
- /**
92
- * Update user by ID (admin function)
93
- */
94
- async updateUser(userId: string, updates: Record<string, any>): Promise<User> {
95
- try {
96
- const res = await this.getClient().put(`/api/users/${userId}`, updates);
97
- return res.data;
98
- } catch (error) {
99
- throw this.handleError(error);
100
- }
101
- }
102
-
103
- /**
104
- * Follow a user
105
- */
106
- async followUser(userId: string): Promise<{ success: boolean; message: string }> {
107
- try {
108
- const res = await this.getClient().post(`/api/users/${userId}/follow`);
109
- return res.data;
110
- } catch (error) {
111
- throw this.handleError(error);
112
- }
113
- }
114
-
115
- /**
116
- * Unfollow a user
117
- */
118
- async unfollowUser(userId: string): Promise<{ success: boolean; message: string }> {
119
- try {
120
- const res = await this.getClient().delete(`/api/users/${userId}/follow`);
121
- return res.data;
122
- } catch (error) {
123
- throw this.handleError(error);
124
- }
125
- }
126
-
127
- /**
128
- * Get follow status
129
- */
130
- async getFollowStatus(userId: string): Promise<{ isFollowing: boolean }> {
131
- try {
132
- const res = await this.getClient().get(`/api/users/${userId}/following-status`);
133
- return res.data;
134
- } catch (error) {
135
- throw this.handleError(error);
136
- }
137
- }
138
-
139
- /**
140
- * Get user followers
141
- */
142
- async getUserFollowers(
143
- userId: string,
144
- pagination?: PaginationParams
145
- ): Promise<{ followers: User[]; total: number; hasMore: boolean }> {
146
- try {
147
- const searchParams = buildPaginationParams(pagination || {});
148
-
149
- const res = await this.getClient().get(`/api/users/${userId}/followers?${searchParams.toString()}`);
150
- return res.data;
151
- } catch (error) {
152
- throw this.handleError(error);
153
- }
154
- }
155
-
156
- /**
157
- * Get user following
158
- */
159
- async getUserFollowing(
160
- userId: string,
161
- pagination?: PaginationParams
162
- ): Promise<{ following: User[]; total: number; hasMore: boolean }> {
163
- try {
164
- const searchParams = buildPaginationParams(pagination || {});
165
-
166
- const res = await this.getClient().get(`/api/users/${userId}/following?${searchParams.toString()}`);
167
- return res.data;
168
- } catch (error) {
169
- throw this.handleError(error);
170
- }
171
- }
172
-
173
- /**
174
- * Get notifications
175
- */
176
- async getNotifications(): Promise<Notification[]> {
177
- try {
178
- const res = await this.getClient().get('/api/notifications');
179
- return res.data;
180
- } catch (error) {
181
- throw this.handleError(error);
182
- }
183
- }
184
-
185
- /**
186
- * Get unread notification count
187
- */
188
- async getUnreadCount(): Promise<number> {
189
- try {
190
- const res = await this.getClient().get('/api/notifications/unread-count');
191
- return res.data.count;
192
- } catch (error) {
193
- throw this.handleError(error);
194
- }
195
- }
196
-
197
- /**
198
- * Create notification
199
- */
200
- async createNotification(data: Partial<Notification>): Promise<Notification> {
201
- try {
202
- const res = await this.getClient().post('/api/notifications', data);
203
- return res.data;
204
- } catch (error) {
205
- throw this.handleError(error);
206
- }
207
- }
208
-
209
- /**
210
- * Mark notification as read
211
- */
212
- async markNotificationAsRead(notificationId: string): Promise<void> {
213
- try {
214
- await this.getClient().put(`/api/notifications/${notificationId}/read`);
215
- } catch (error) {
216
- throw this.handleError(error);
217
- }
218
- }
219
-
220
- /**
221
- * Mark all notifications as read
222
- */
223
- async markAllNotificationsAsRead(): Promise<void> {
224
- try {
225
- await this.getClient().put('/api/notifications/read-all');
226
- } catch (error) {
227
- throw this.handleError(error);
228
- }
229
- }
230
-
231
- /**
232
- * Delete notification
233
- */
234
- async deleteNotification(notificationId: string): Promise<void> {
235
- try {
236
- await this.getClient().delete(`/api/notifications/${notificationId}`);
237
- } catch (error) {
238
- throw this.handleError(error);
239
- }
240
- }
241
- }