@oxyhq/services 5.10.4 → 5.10.5

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 (114) hide show
  1. package/README.md +62 -14
  2. package/lib/commonjs/core/OxyServices.js +796 -4
  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/ui/screens/FileManagementScreen.js +12 -12
  7. package/lib/commonjs/ui/screens/FileManagementScreen.js.map +1 -1
  8. package/lib/commonjs/ui/screens/ProfileScreen.js +2 -2
  9. package/lib/commonjs/ui/screens/ProfileScreen.js.map +1 -1
  10. package/lib/commonjs/ui/screens/SignInScreen.js +1 -1
  11. package/lib/commonjs/ui/screens/SignInScreen.js.map +1 -1
  12. package/lib/commonjs/ui/screens/karma/KarmaCenterScreen.js +1 -1
  13. package/lib/commonjs/ui/screens/karma/KarmaCenterScreen.js.map +1 -1
  14. package/lib/commonjs/ui/screens/karma/KarmaLeaderboardScreen.js +1 -1
  15. package/lib/commonjs/ui/screens/karma/KarmaLeaderboardScreen.js.map +1 -1
  16. package/lib/commonjs/ui/screens/karma/KarmaRulesScreen.js +1 -1
  17. package/lib/commonjs/ui/screens/karma/KarmaRulesScreen.js.map +1 -1
  18. package/lib/commonjs/ui/stores/followStore.js +4 -4
  19. package/lib/commonjs/ui/stores/followStore.js.map +1 -1
  20. package/lib/module/core/OxyServices.js +795 -3
  21. package/lib/module/core/OxyServices.js.map +1 -1
  22. package/lib/module/core/index.js +9 -24
  23. package/lib/module/core/index.js.map +1 -1
  24. package/lib/module/ui/screens/FileManagementScreen.js +12 -12
  25. package/lib/module/ui/screens/FileManagementScreen.js.map +1 -1
  26. package/lib/module/ui/screens/ProfileScreen.js +2 -2
  27. package/lib/module/ui/screens/ProfileScreen.js.map +1 -1
  28. package/lib/module/ui/screens/SignInScreen.js +1 -1
  29. package/lib/module/ui/screens/SignInScreen.js.map +1 -1
  30. package/lib/module/ui/screens/karma/KarmaCenterScreen.js +1 -1
  31. package/lib/module/ui/screens/karma/KarmaCenterScreen.js.map +1 -1
  32. package/lib/module/ui/screens/karma/KarmaLeaderboardScreen.js +1 -1
  33. package/lib/module/ui/screens/karma/KarmaLeaderboardScreen.js.map +1 -1
  34. package/lib/module/ui/screens/karma/KarmaRulesScreen.js +1 -1
  35. package/lib/module/ui/screens/karma/KarmaRulesScreen.js.map +1 -1
  36. package/lib/module/ui/stores/followStore.js +4 -4
  37. package/lib/module/ui/stores/followStore.js.map +1 -1
  38. package/lib/typescript/core/OxyServices.d.ts +290 -1
  39. package/lib/typescript/core/OxyServices.d.ts.map +1 -1
  40. package/lib/typescript/core/index.d.ts +7 -16
  41. package/lib/typescript/core/index.d.ts.map +1 -1
  42. package/package.json +1 -1
  43. package/src/core/OxyServices.ts +881 -46
  44. package/src/core/index.ts +9 -24
  45. package/src/ui/screens/FileManagementScreen.tsx +12 -12
  46. package/src/ui/screens/ProfileScreen.tsx +3 -3
  47. package/src/ui/screens/SignInScreen.tsx +1 -1
  48. package/src/ui/screens/karma/KarmaCenterScreen.tsx +2 -2
  49. package/src/ui/screens/karma/KarmaLeaderboardScreen.tsx +1 -1
  50. package/src/ui/screens/karma/KarmaRulesScreen.tsx +1 -1
  51. package/src/ui/stores/followStore.ts +4 -4
  52. package/lib/commonjs/core/OxyServicesMain.js +0 -51
  53. package/lib/commonjs/core/OxyServicesMain.js.map +0 -1
  54. package/lib/commonjs/core/analytics/AnalyticsService.js +0 -67
  55. package/lib/commonjs/core/analytics/AnalyticsService.js.map +0 -1
  56. package/lib/commonjs/core/auth/AuthService.js +0 -538
  57. package/lib/commonjs/core/auth/AuthService.js.map +0 -1
  58. package/lib/commonjs/core/devices/DeviceService.js +0 -61
  59. package/lib/commonjs/core/devices/DeviceService.js.map +0 -1
  60. package/lib/commonjs/core/files/FileService.js +0 -180
  61. package/lib/commonjs/core/files/FileService.js.map +0 -1
  62. package/lib/commonjs/core/karma/KarmaService.js +0 -100
  63. package/lib/commonjs/core/karma/KarmaService.js.map +0 -1
  64. package/lib/commonjs/core/locations/LocationService.js +0 -131
  65. package/lib/commonjs/core/locations/LocationService.js.map +0 -1
  66. package/lib/commonjs/core/payments/PaymentService.js +0 -124
  67. package/lib/commonjs/core/payments/PaymentService.js.map +0 -1
  68. package/lib/commonjs/core/users/UserService.js +0 -234
  69. package/lib/commonjs/core/users/UserService.js.map +0 -1
  70. package/lib/module/core/OxyServicesMain.js +0 -47
  71. package/lib/module/core/OxyServicesMain.js.map +0 -1
  72. package/lib/module/core/analytics/AnalyticsService.js +0 -62
  73. package/lib/module/core/analytics/AnalyticsService.js.map +0 -1
  74. package/lib/module/core/auth/AuthService.js +0 -533
  75. package/lib/module/core/auth/AuthService.js.map +0 -1
  76. package/lib/module/core/devices/DeviceService.js +0 -57
  77. package/lib/module/core/devices/DeviceService.js.map +0 -1
  78. package/lib/module/core/files/FileService.js +0 -175
  79. package/lib/module/core/files/FileService.js.map +0 -1
  80. package/lib/module/core/karma/KarmaService.js +0 -95
  81. package/lib/module/core/karma/KarmaService.js.map +0 -1
  82. package/lib/module/core/locations/LocationService.js +0 -127
  83. package/lib/module/core/locations/LocationService.js.map +0 -1
  84. package/lib/module/core/payments/PaymentService.js +0 -119
  85. package/lib/module/core/payments/PaymentService.js.map +0 -1
  86. package/lib/module/core/users/UserService.js +0 -230
  87. package/lib/module/core/users/UserService.js.map +0 -1
  88. package/lib/typescript/core/OxyServicesMain.d.ts +0 -33
  89. package/lib/typescript/core/OxyServicesMain.d.ts.map +0 -1
  90. package/lib/typescript/core/analytics/AnalyticsService.d.ts +0 -26
  91. package/lib/typescript/core/analytics/AnalyticsService.d.ts.map +0 -1
  92. package/lib/typescript/core/auth/AuthService.d.ts +0 -165
  93. package/lib/typescript/core/auth/AuthService.d.ts.map +0 -1
  94. package/lib/typescript/core/devices/DeviceService.d.ts +0 -20
  95. package/lib/typescript/core/devices/DeviceService.d.ts.map +0 -1
  96. package/lib/typescript/core/files/FileService.d.ts +0 -59
  97. package/lib/typescript/core/files/FileService.d.ts.map +0 -1
  98. package/lib/typescript/core/karma/KarmaService.d.ts +0 -50
  99. package/lib/typescript/core/karma/KarmaService.d.ts.map +0 -1
  100. package/lib/typescript/core/locations/LocationService.d.ts +0 -39
  101. package/lib/typescript/core/locations/LocationService.d.ts.map +0 -1
  102. package/lib/typescript/core/payments/PaymentService.d.ts +0 -50
  103. package/lib/typescript/core/payments/PaymentService.d.ts.map +0 -1
  104. package/lib/typescript/core/users/UserService.d.ts +0 -111
  105. package/lib/typescript/core/users/UserService.d.ts.map +0 -1
  106. package/src/core/OxyServicesMain.ts +0 -57
  107. package/src/core/analytics/AnalyticsService.ts +0 -64
  108. package/src/core/auth/AuthService.ts +0 -560
  109. package/src/core/devices/DeviceService.ts +0 -55
  110. package/src/core/files/FileService.ts +0 -198
  111. package/src/core/karma/KarmaService.ts +0 -104
  112. package/src/core/locations/LocationService.ts +0 -141
  113. package/src/core/payments/PaymentService.ts +0 -133
  114. package/src/core/users/UserService.ts +0 -241
package/README.md CHANGED
@@ -23,6 +23,7 @@ A TypeScript client library for the Oxy API providing authentication, user manag
23
23
  - 📱 **Cross-Platform**: Works in React Native and web applications
24
24
  - 🔧 **TypeScript**: Full type safety and IntelliSense support
25
25
  - 🚀 **Performance**: Optimized with automatic caching and state management
26
+ - ✨ **Simple API**: All functionality in one unified class - no need to manage multiple service instances
26
27
 
27
28
  ## Quick Start
28
29
 
@@ -30,6 +31,44 @@ A TypeScript client library for the Oxy API providing authentication, user manag
30
31
  npm install @oxyhq/services
31
32
  ```
32
33
 
34
+ ### Simple & Unified API
35
+
36
+ The new OxyServices provides all functionality in one simple class:
37
+
38
+ ```typescript
39
+ import { OxyServices } from '@oxyhq/services';
40
+
41
+ const oxy = new OxyServices({ baseURL: 'https://api.example.com' });
42
+
43
+ // Authentication
44
+ await oxy.signIn('username', 'password');
45
+ await oxy.signUp('username', 'email', 'password');
46
+
47
+ // User operations
48
+ const user = await oxy.getCurrentUser();
49
+ await oxy.updateProfile({ name: 'John Doe' });
50
+ await oxy.followUser('user123');
51
+
52
+ // Social features
53
+ const followers = await oxy.getUserFollowers('user123');
54
+ const notifications = await oxy.getNotifications();
55
+
56
+ // File uploads
57
+ const fileData = await oxy.uploadFile(file);
58
+
59
+ // Payments
60
+ const payment = await oxy.createPayment(paymentData);
61
+
62
+ // Location services
63
+ await oxy.updateLocation(40.7128, -74.0060);
64
+ const nearby = await oxy.getNearbyUsers();
65
+
66
+ // Analytics
67
+ await oxy.trackEvent('user_action', { action: 'click' });
68
+
69
+ // Everything in one place - no more managing multiple service instances!
70
+ ```
71
+
33
72
  ### Streamlined Authentication (Recommended)
34
73
 
35
74
  ```typescript
@@ -89,7 +128,7 @@ function Component() {
89
128
  }
90
129
  ```
91
130
 
92
- ### Traditional Usage
131
+ ### Simple & Unified API
93
132
 
94
133
  ```typescript
95
134
  import { OxyServices } from '@oxyhq/services';
@@ -98,14 +137,23 @@ const oxy = new OxyServices({
98
137
  baseURL: 'http://localhost:3000'
99
138
  });
100
139
 
101
- // Authenticate
102
- const response = await oxy.auth.login({
103
- email: 'user@example.com',
104
- password: 'password'
105
- });
140
+ // Authentication
141
+ const response = await oxy.signIn('username', 'password');
106
142
 
107
- // Get current user
108
- const user = await oxy.users.getCurrentUser();
143
+ // User operations
144
+ const user = await oxy.getCurrentUser();
145
+ await oxy.updateProfile({ name: 'John Doe' });
146
+ await oxy.followUser('user123');
147
+
148
+ // Social features
149
+ const followers = await oxy.getUserFollowers('user123');
150
+ const notifications = await oxy.getNotifications();
151
+
152
+ // File operations
153
+ const fileData = await oxy.uploadFile(file);
154
+ const downloadUrl = oxy.getFileDownloadUrl(fileId);
155
+
156
+ // Everything is available directly on the oxy instance!
109
157
  ```
110
158
 
111
159
  ## Documentation
@@ -122,17 +170,17 @@ import { OxyProvider, Avatar, FollowButton } from '@oxyhq/services/ui';
122
170
 
123
171
  ## Package Exports
124
172
 
125
- The library provides multiple entry points:
173
+ The library provides a unified API:
126
174
 
127
175
  ```typescript
128
- // Core services only (Node.js/Express)
176
+ // Unified OxyServices class (recommended)
129
177
  import { OxyServices } from '@oxyhq/services';
130
178
 
131
- // UI components only (React/React Native)
132
- import { OxyProvider, Avatar } from '@oxyhq/services/ui';
179
+ // All functionality is available directly on the OxyServices instance
180
+ const oxy = new OxyServices({ baseURL: 'https://api.example.com' });
133
181
 
134
- // Full package (Core + UI)
135
- import { OxyServices, OxyProvider } from '@oxyhq/services/full';
182
+ // UI components (React/React Native)
183
+ import { OxyProvider, Avatar } from '@oxyhq/services/ui';
136
184
  ```
137
185
 
138
186