@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.
- package/README.md +62 -14
- package/lib/commonjs/core/OxyServices.js +796 -4
- package/lib/commonjs/core/OxyServices.js.map +1 -1
- package/lib/commonjs/core/index.js +8 -83
- package/lib/commonjs/core/index.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/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/module/core/OxyServices.js +795 -3
- package/lib/module/core/OxyServices.js.map +1 -1
- package/lib/module/core/index.js +9 -24
- package/lib/module/core/index.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/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/typescript/core/OxyServices.d.ts +290 -1
- package/lib/typescript/core/OxyServices.d.ts.map +1 -1
- package/lib/typescript/core/index.d.ts +7 -16
- package/lib/typescript/core/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/core/OxyServices.ts +881 -46
- package/src/core/index.ts +9 -24
- package/src/ui/screens/FileManagementScreen.tsx +12 -12
- package/src/ui/screens/ProfileScreen.tsx +3 -3
- package/src/ui/screens/SignInScreen.tsx +1 -1
- package/src/ui/screens/karma/KarmaCenterScreen.tsx +2 -2
- package/src/ui/screens/karma/KarmaLeaderboardScreen.tsx +1 -1
- package/src/ui/screens/karma/KarmaRulesScreen.tsx +1 -1
- package/src/ui/stores/followStore.ts +4 -4
- package/lib/commonjs/core/OxyServicesMain.js +0 -51
- package/lib/commonjs/core/OxyServicesMain.js.map +0 -1
- package/lib/commonjs/core/analytics/AnalyticsService.js +0 -67
- package/lib/commonjs/core/analytics/AnalyticsService.js.map +0 -1
- package/lib/commonjs/core/auth/AuthService.js +0 -538
- package/lib/commonjs/core/auth/AuthService.js.map +0 -1
- package/lib/commonjs/core/devices/DeviceService.js +0 -61
- package/lib/commonjs/core/devices/DeviceService.js.map +0 -1
- package/lib/commonjs/core/files/FileService.js +0 -180
- package/lib/commonjs/core/files/FileService.js.map +0 -1
- package/lib/commonjs/core/karma/KarmaService.js +0 -100
- package/lib/commonjs/core/karma/KarmaService.js.map +0 -1
- package/lib/commonjs/core/locations/LocationService.js +0 -131
- package/lib/commonjs/core/locations/LocationService.js.map +0 -1
- package/lib/commonjs/core/payments/PaymentService.js +0 -124
- package/lib/commonjs/core/payments/PaymentService.js.map +0 -1
- package/lib/commonjs/core/users/UserService.js +0 -234
- package/lib/commonjs/core/users/UserService.js.map +0 -1
- package/lib/module/core/OxyServicesMain.js +0 -47
- package/lib/module/core/OxyServicesMain.js.map +0 -1
- package/lib/module/core/analytics/AnalyticsService.js +0 -62
- package/lib/module/core/analytics/AnalyticsService.js.map +0 -1
- package/lib/module/core/auth/AuthService.js +0 -533
- package/lib/module/core/auth/AuthService.js.map +0 -1
- package/lib/module/core/devices/DeviceService.js +0 -57
- package/lib/module/core/devices/DeviceService.js.map +0 -1
- package/lib/module/core/files/FileService.js +0 -175
- package/lib/module/core/files/FileService.js.map +0 -1
- package/lib/module/core/karma/KarmaService.js +0 -95
- package/lib/module/core/karma/KarmaService.js.map +0 -1
- package/lib/module/core/locations/LocationService.js +0 -127
- package/lib/module/core/locations/LocationService.js.map +0 -1
- package/lib/module/core/payments/PaymentService.js +0 -119
- package/lib/module/core/payments/PaymentService.js.map +0 -1
- package/lib/module/core/users/UserService.js +0 -230
- package/lib/module/core/users/UserService.js.map +0 -1
- package/lib/typescript/core/OxyServicesMain.d.ts +0 -33
- package/lib/typescript/core/OxyServicesMain.d.ts.map +0 -1
- package/lib/typescript/core/analytics/AnalyticsService.d.ts +0 -26
- package/lib/typescript/core/analytics/AnalyticsService.d.ts.map +0 -1
- package/lib/typescript/core/auth/AuthService.d.ts +0 -165
- package/lib/typescript/core/auth/AuthService.d.ts.map +0 -1
- package/lib/typescript/core/devices/DeviceService.d.ts +0 -20
- package/lib/typescript/core/devices/DeviceService.d.ts.map +0 -1
- package/lib/typescript/core/files/FileService.d.ts +0 -59
- package/lib/typescript/core/files/FileService.d.ts.map +0 -1
- package/lib/typescript/core/karma/KarmaService.d.ts +0 -50
- package/lib/typescript/core/karma/KarmaService.d.ts.map +0 -1
- package/lib/typescript/core/locations/LocationService.d.ts +0 -39
- package/lib/typescript/core/locations/LocationService.d.ts.map +0 -1
- package/lib/typescript/core/payments/PaymentService.d.ts +0 -50
- package/lib/typescript/core/payments/PaymentService.d.ts.map +0 -1
- package/lib/typescript/core/users/UserService.d.ts +0 -111
- package/lib/typescript/core/users/UserService.d.ts.map +0 -1
- package/src/core/OxyServicesMain.ts +0 -57
- package/src/core/analytics/AnalyticsService.ts +0 -64
- package/src/core/auth/AuthService.ts +0 -560
- package/src/core/devices/DeviceService.ts +0 -55
- package/src/core/files/FileService.ts +0 -198
- package/src/core/karma/KarmaService.ts +0 -104
- package/src/core/locations/LocationService.ts +0 -141
- package/src/core/payments/PaymentService.ts +0 -133
- 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
|
-
###
|
|
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
|
-
//
|
|
102
|
-
const response = await oxy.
|
|
103
|
-
email: 'user@example.com',
|
|
104
|
-
password: 'password'
|
|
105
|
-
});
|
|
140
|
+
// Authentication
|
|
141
|
+
const response = await oxy.signIn('username', 'password');
|
|
106
142
|
|
|
107
|
-
//
|
|
108
|
-
const user = await oxy.
|
|
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
|
|
173
|
+
The library provides a unified API:
|
|
126
174
|
|
|
127
175
|
```typescript
|
|
128
|
-
//
|
|
176
|
+
// Unified OxyServices class (recommended)
|
|
129
177
|
import { OxyServices } from '@oxyhq/services';
|
|
130
178
|
|
|
131
|
-
//
|
|
132
|
-
|
|
179
|
+
// All functionality is available directly on the OxyServices instance
|
|
180
|
+
const oxy = new OxyServices({ baseURL: 'https://api.example.com' });
|
|
133
181
|
|
|
134
|
-
//
|
|
135
|
-
import {
|
|
182
|
+
// UI components (React/React Native)
|
|
183
|
+
import { OxyProvider, Avatar } from '@oxyhq/services/ui';
|
|
136
184
|
```
|
|
137
185
|
|
|
138
186
|
|