@oxyhq/core 1.4.0 → 1.6.0
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/dist/cjs/AuthManager.js +1 -1
- package/dist/cjs/HttpService.js +87 -69
- package/dist/cjs/OxyServices.base.js +5 -4
- package/dist/cjs/crypto/keyManager.js +1 -13
- package/dist/cjs/crypto/signatureService.js +7 -20
- package/dist/cjs/mixins/OxyServices.analytics.js +2 -2
- package/dist/cjs/mixins/OxyServices.assets.js +14 -14
- package/dist/cjs/mixins/OxyServices.auth.js +20 -18
- package/dist/cjs/mixins/OxyServices.developer.js +6 -6
- package/dist/cjs/mixins/OxyServices.devices.js +7 -7
- package/dist/cjs/mixins/OxyServices.features.js +23 -23
- package/dist/cjs/mixins/OxyServices.fedcm.js +1 -1
- package/dist/cjs/mixins/OxyServices.karma.js +6 -6
- package/dist/cjs/mixins/OxyServices.location.js +2 -2
- package/dist/cjs/mixins/OxyServices.payment.js +6 -6
- package/dist/cjs/mixins/OxyServices.popup.js +1 -1
- package/dist/cjs/mixins/OxyServices.privacy.js +6 -6
- package/dist/cjs/mixins/OxyServices.security.js +3 -3
- package/dist/cjs/mixins/OxyServices.user.js +22 -22
- package/dist/cjs/mixins/OxyServices.utility.js +16 -7
- package/dist/cjs/utils/asyncUtils.js +0 -1
- package/dist/cjs/utils/platform.js +14 -0
- package/dist/esm/AuthManager.js +1 -1
- package/dist/esm/HttpService.js +87 -69
- package/dist/esm/OxyServices.base.js +5 -4
- package/dist/esm/crypto/keyManager.js +1 -13
- package/dist/esm/crypto/signatureService.js +2 -15
- package/dist/esm/mixins/OxyServices.analytics.js +2 -2
- package/dist/esm/mixins/OxyServices.assets.js +14 -14
- package/dist/esm/mixins/OxyServices.auth.js +20 -18
- package/dist/esm/mixins/OxyServices.developer.js +6 -6
- package/dist/esm/mixins/OxyServices.devices.js +7 -7
- package/dist/esm/mixins/OxyServices.features.js +23 -23
- package/dist/esm/mixins/OxyServices.fedcm.js +1 -1
- package/dist/esm/mixins/OxyServices.karma.js +6 -6
- package/dist/esm/mixins/OxyServices.location.js +2 -2
- package/dist/esm/mixins/OxyServices.payment.js +6 -6
- package/dist/esm/mixins/OxyServices.popup.js +1 -1
- package/dist/esm/mixins/OxyServices.privacy.js +6 -6
- package/dist/esm/mixins/OxyServices.security.js +3 -3
- package/dist/esm/mixins/OxyServices.user.js +22 -22
- package/dist/esm/mixins/OxyServices.utility.js +16 -7
- package/dist/esm/utils/asyncUtils.js +0 -1
- package/dist/esm/utils/platform.js +12 -0
- package/dist/types/HttpService.d.ts +4 -1
- package/dist/types/OxyServices.base.d.ts +1 -1
- package/dist/types/mixins/OxyServices.analytics.d.ts +1 -1
- package/dist/types/mixins/OxyServices.assets.d.ts +1 -1
- package/dist/types/mixins/OxyServices.auth.d.ts +1 -1
- package/dist/types/mixins/OxyServices.developer.d.ts +1 -1
- package/dist/types/mixins/OxyServices.devices.d.ts +1 -1
- package/dist/types/mixins/OxyServices.features.d.ts +1 -1
- package/dist/types/mixins/OxyServices.fedcm.d.ts +1 -1
- package/dist/types/mixins/OxyServices.karma.d.ts +1 -1
- package/dist/types/mixins/OxyServices.language.d.ts +1 -1
- package/dist/types/mixins/OxyServices.location.d.ts +1 -1
- package/dist/types/mixins/OxyServices.payment.d.ts +1 -1
- package/dist/types/mixins/OxyServices.popup.d.ts +1 -1
- package/dist/types/mixins/OxyServices.privacy.d.ts +1 -1
- package/dist/types/mixins/OxyServices.redirect.d.ts +1 -1
- package/dist/types/mixins/OxyServices.security.d.ts +1 -1
- package/dist/types/mixins/OxyServices.user.d.ts +1 -1
- package/dist/types/mixins/OxyServices.utility.d.ts +7 -6
- package/dist/types/utils/platform.d.ts +8 -0
- package/package.json +1 -1
- package/src/AuthManager.ts +1 -1
- package/src/HttpService.ts +85 -67
- package/src/OxyServices.base.ts +5 -4
- package/src/crypto/keyManager.ts +1 -15
- package/src/crypto/signatureService.ts +2 -17
- package/src/mixins/OxyServices.analytics.ts +2 -2
- package/src/mixins/OxyServices.assets.ts +14 -14
- package/src/mixins/OxyServices.auth.ts +26 -24
- package/src/mixins/OxyServices.developer.ts +6 -6
- package/src/mixins/OxyServices.devices.ts +7 -7
- package/src/mixins/OxyServices.features.ts +23 -23
- package/src/mixins/OxyServices.fedcm.ts +1 -1
- package/src/mixins/OxyServices.karma.ts +6 -6
- package/src/mixins/OxyServices.location.ts +2 -2
- package/src/mixins/OxyServices.payment.ts +6 -6
- package/src/mixins/OxyServices.popup.ts +1 -1
- package/src/mixins/OxyServices.privacy.ts +6 -6
- package/src/mixins/OxyServices.security.ts +3 -3
- package/src/mixins/OxyServices.user.ts +22 -22
- package/src/mixins/OxyServices.utility.ts +18 -8
- package/src/utils/asyncUtils.ts +1 -2
- package/src/utils/platform.ts +14 -0
|
@@ -13,7 +13,7 @@ function OxyServicesDeveloperMixin(Base) {
|
|
|
13
13
|
*/
|
|
14
14
|
async getDeveloperApps() {
|
|
15
15
|
try {
|
|
16
|
-
const res = await this.makeRequest('GET', '/
|
|
16
|
+
const res = await this.makeRequest('GET', '/developer/apps', undefined, {
|
|
17
17
|
cache: true,
|
|
18
18
|
cacheTTL: mixinHelpers_1.CACHE_TIMES.MEDIUM,
|
|
19
19
|
});
|
|
@@ -30,7 +30,7 @@ function OxyServicesDeveloperMixin(Base) {
|
|
|
30
30
|
*/
|
|
31
31
|
async createDeveloperApp(data) {
|
|
32
32
|
try {
|
|
33
|
-
const res = await this.makeRequest('POST', '/
|
|
33
|
+
const res = await this.makeRequest('POST', '/developer/apps', data, { cache: false });
|
|
34
34
|
return res.app;
|
|
35
35
|
}
|
|
36
36
|
catch (error) {
|
|
@@ -42,7 +42,7 @@ function OxyServicesDeveloperMixin(Base) {
|
|
|
42
42
|
*/
|
|
43
43
|
async getDeveloperApp(appId) {
|
|
44
44
|
try {
|
|
45
|
-
const res = await this.makeRequest('GET', `/
|
|
45
|
+
const res = await this.makeRequest('GET', `/developer/apps/${appId}`, undefined, {
|
|
46
46
|
cache: true,
|
|
47
47
|
cacheTTL: mixinHelpers_1.CACHE_TIMES.LONG,
|
|
48
48
|
});
|
|
@@ -60,7 +60,7 @@ function OxyServicesDeveloperMixin(Base) {
|
|
|
60
60
|
*/
|
|
61
61
|
async updateDeveloperApp(appId, data) {
|
|
62
62
|
try {
|
|
63
|
-
const res = await this.makeRequest('PATCH', `/
|
|
63
|
+
const res = await this.makeRequest('PATCH', `/developer/apps/${appId}`, data, { cache: false });
|
|
64
64
|
return res.app;
|
|
65
65
|
}
|
|
66
66
|
catch (error) {
|
|
@@ -74,7 +74,7 @@ function OxyServicesDeveloperMixin(Base) {
|
|
|
74
74
|
*/
|
|
75
75
|
async regenerateDeveloperAppSecret(appId) {
|
|
76
76
|
try {
|
|
77
|
-
return await this.makeRequest('POST', `/
|
|
77
|
+
return await this.makeRequest('POST', `/developer/apps/${appId}/regenerate-secret`, undefined, { cache: false });
|
|
78
78
|
}
|
|
79
79
|
catch (error) {
|
|
80
80
|
throw this.handleError(error);
|
|
@@ -87,7 +87,7 @@ function OxyServicesDeveloperMixin(Base) {
|
|
|
87
87
|
*/
|
|
88
88
|
async deleteDeveloperApp(appId) {
|
|
89
89
|
try {
|
|
90
|
-
return await this.makeRequest('DELETE', `/
|
|
90
|
+
return await this.makeRequest('DELETE', `/developer/apps/${appId}`, undefined, { cache: false });
|
|
91
91
|
}
|
|
92
92
|
catch (error) {
|
|
93
93
|
throw this.handleError(error);
|
|
@@ -13,7 +13,7 @@ function OxyServicesDevicesMixin(Base) {
|
|
|
13
13
|
*/
|
|
14
14
|
async registerDevice(deviceData) {
|
|
15
15
|
try {
|
|
16
|
-
return await this.makeRequest('POST', '/
|
|
16
|
+
return await this.makeRequest('POST', '/devices', deviceData, { cache: false });
|
|
17
17
|
}
|
|
18
18
|
catch (error) {
|
|
19
19
|
throw this.handleError(error);
|
|
@@ -25,7 +25,7 @@ function OxyServicesDevicesMixin(Base) {
|
|
|
25
25
|
*/
|
|
26
26
|
async getUserDevices() {
|
|
27
27
|
try {
|
|
28
|
-
return await this.makeRequest('GET', '/
|
|
28
|
+
return await this.makeRequest('GET', '/devices', undefined, {
|
|
29
29
|
cache: false, // Don't cache device list - always get fresh data
|
|
30
30
|
});
|
|
31
31
|
}
|
|
@@ -39,7 +39,7 @@ function OxyServicesDevicesMixin(Base) {
|
|
|
39
39
|
*/
|
|
40
40
|
async removeDevice(deviceId) {
|
|
41
41
|
try {
|
|
42
|
-
await this.makeRequest('DELETE', `/
|
|
42
|
+
await this.makeRequest('DELETE', `/devices/${deviceId}`, undefined, { cache: false });
|
|
43
43
|
}
|
|
44
44
|
catch (error) {
|
|
45
45
|
throw this.handleError(error);
|
|
@@ -55,7 +55,7 @@ function OxyServicesDevicesMixin(Base) {
|
|
|
55
55
|
try {
|
|
56
56
|
// Use makeRequest for consistent error handling and optional caching
|
|
57
57
|
// Cache disabled by default to ensure fresh session data
|
|
58
|
-
return await this.makeRequest('GET', `/
|
|
58
|
+
return await this.makeRequest('GET', `/session/device/sessions/${sessionId}`, undefined, {
|
|
59
59
|
cache: false, // Don't cache sessions - always get fresh data
|
|
60
60
|
deduplicate: true, // Deduplicate concurrent requests for same sessionId
|
|
61
61
|
});
|
|
@@ -78,7 +78,7 @@ function OxyServicesDevicesMixin(Base) {
|
|
|
78
78
|
urlParams.deviceId = deviceId;
|
|
79
79
|
if (excludeCurrent)
|
|
80
80
|
urlParams.excludeCurrent = 'true';
|
|
81
|
-
return await this.makeRequest('POST', `/
|
|
81
|
+
return await this.makeRequest('POST', `/session/device/logout-all/${sessionId}`, urlParams, { cache: false });
|
|
82
82
|
}
|
|
83
83
|
catch (error) {
|
|
84
84
|
throw this.handleError(error);
|
|
@@ -92,7 +92,7 @@ function OxyServicesDevicesMixin(Base) {
|
|
|
92
92
|
*/
|
|
93
93
|
async updateDeviceName(sessionId, deviceName) {
|
|
94
94
|
try {
|
|
95
|
-
return await this.makeRequest('PUT', `/
|
|
95
|
+
return await this.makeRequest('PUT', `/session/device/name/${sessionId}`, { deviceName }, { cache: false });
|
|
96
96
|
}
|
|
97
97
|
catch (error) {
|
|
98
98
|
throw this.handleError(error);
|
|
@@ -104,7 +104,7 @@ function OxyServicesDevicesMixin(Base) {
|
|
|
104
104
|
*/
|
|
105
105
|
async getSecurityInfo() {
|
|
106
106
|
try {
|
|
107
|
-
return await this.makeRequest('GET', '/
|
|
107
|
+
return await this.makeRequest('GET', '/devices/security', undefined, {
|
|
108
108
|
cache: false,
|
|
109
109
|
});
|
|
110
110
|
}
|
|
@@ -15,7 +15,7 @@ function OxyServicesFeaturesMixin(Base) {
|
|
|
15
15
|
*/
|
|
16
16
|
async submitFeedback(payload) {
|
|
17
17
|
try {
|
|
18
|
-
return await this.makeRequest('POST', '/
|
|
18
|
+
return await this.makeRequest('POST', '/feedback', payload, {
|
|
19
19
|
cache: false,
|
|
20
20
|
});
|
|
21
21
|
}
|
|
@@ -31,7 +31,7 @@ function OxyServicesFeaturesMixin(Base) {
|
|
|
31
31
|
*/
|
|
32
32
|
async getSubscriptionPlans() {
|
|
33
33
|
try {
|
|
34
|
-
return await this.makeRequest('GET', '/
|
|
34
|
+
return await this.makeRequest('GET', '/subscriptions/plans', undefined, {
|
|
35
35
|
cache: true,
|
|
36
36
|
cacheTTL: mixinHelpers_1.CACHE_TIMES.LONG,
|
|
37
37
|
});
|
|
@@ -45,7 +45,7 @@ function OxyServicesFeaturesMixin(Base) {
|
|
|
45
45
|
*/
|
|
46
46
|
async getIndividualFeatures() {
|
|
47
47
|
try {
|
|
48
|
-
return await this.makeRequest('GET', '/
|
|
48
|
+
return await this.makeRequest('GET', '/subscriptions/features', undefined, {
|
|
49
49
|
cache: true,
|
|
50
50
|
cacheTTL: mixinHelpers_1.CACHE_TIMES.LONG,
|
|
51
51
|
});
|
|
@@ -59,7 +59,7 @@ function OxyServicesFeaturesMixin(Base) {
|
|
|
59
59
|
*/
|
|
60
60
|
async subscribe(planId, paymentMethodId) {
|
|
61
61
|
return this.withAuthRetry(async () => {
|
|
62
|
-
return await this.makeRequest('POST', '/
|
|
62
|
+
return await this.makeRequest('POST', '/subscriptions/subscribe', {
|
|
63
63
|
planId,
|
|
64
64
|
paymentMethodId,
|
|
65
65
|
}, { cache: false });
|
|
@@ -70,7 +70,7 @@ function OxyServicesFeaturesMixin(Base) {
|
|
|
70
70
|
*/
|
|
71
71
|
async subscribeToFeature(featureId, paymentMethodId) {
|
|
72
72
|
return this.withAuthRetry(async () => {
|
|
73
|
-
return await this.makeRequest('POST', '/
|
|
73
|
+
return await this.makeRequest('POST', '/subscriptions/features/subscribe', {
|
|
74
74
|
featureId,
|
|
75
75
|
paymentMethodId,
|
|
76
76
|
}, { cache: false });
|
|
@@ -81,7 +81,7 @@ function OxyServicesFeaturesMixin(Base) {
|
|
|
81
81
|
*/
|
|
82
82
|
async cancelSubscription(subscriptionId) {
|
|
83
83
|
return this.withAuthRetry(async () => {
|
|
84
|
-
await this.makeRequest('POST', `/
|
|
84
|
+
await this.makeRequest('POST', `/subscriptions/${subscriptionId}/cancel`, undefined, {
|
|
85
85
|
cache: false,
|
|
86
86
|
});
|
|
87
87
|
}, 'cancelSubscription');
|
|
@@ -91,7 +91,7 @@ function OxyServicesFeaturesMixin(Base) {
|
|
|
91
91
|
*/
|
|
92
92
|
async reactivateSubscription(subscriptionId) {
|
|
93
93
|
return this.withAuthRetry(async () => {
|
|
94
|
-
await this.makeRequest('POST', `/
|
|
94
|
+
await this.makeRequest('POST', `/subscriptions/${subscriptionId}/reactivate`, undefined, {
|
|
95
95
|
cache: false,
|
|
96
96
|
});
|
|
97
97
|
}, 'reactivateSubscription');
|
|
@@ -102,7 +102,7 @@ function OxyServicesFeaturesMixin(Base) {
|
|
|
102
102
|
async getCurrentSubscription() {
|
|
103
103
|
return this.withAuthRetry(async () => {
|
|
104
104
|
try {
|
|
105
|
-
return await this.makeRequest('GET', '/
|
|
105
|
+
return await this.makeRequest('GET', '/subscriptions/current', undefined, {
|
|
106
106
|
cache: true,
|
|
107
107
|
cacheTTL: mixinHelpers_1.CACHE_TIMES.SHORT,
|
|
108
108
|
});
|
|
@@ -122,7 +122,7 @@ function OxyServicesFeaturesMixin(Base) {
|
|
|
122
122
|
*/
|
|
123
123
|
async getSavedItems(userId) {
|
|
124
124
|
return this.withAuthRetry(async () => {
|
|
125
|
-
const endpoint = userId ? `/
|
|
125
|
+
const endpoint = userId ? `/users/${userId}/saves` : '/saves';
|
|
126
126
|
return await this.makeRequest('GET', endpoint, undefined, {
|
|
127
127
|
cache: true,
|
|
128
128
|
cacheTTL: mixinHelpers_1.CACHE_TIMES.SHORT,
|
|
@@ -134,7 +134,7 @@ function OxyServicesFeaturesMixin(Base) {
|
|
|
134
134
|
*/
|
|
135
135
|
async getCollections(userId) {
|
|
136
136
|
return this.withAuthRetry(async () => {
|
|
137
|
-
const endpoint = userId ? `/
|
|
137
|
+
const endpoint = userId ? `/users/${userId}/collections` : '/collections';
|
|
138
138
|
return await this.makeRequest('GET', endpoint, undefined, {
|
|
139
139
|
cache: true,
|
|
140
140
|
cacheTTL: mixinHelpers_1.CACHE_TIMES.SHORT,
|
|
@@ -146,7 +146,7 @@ function OxyServicesFeaturesMixin(Base) {
|
|
|
146
146
|
*/
|
|
147
147
|
async saveItem(itemId, itemType, collectionId) {
|
|
148
148
|
return this.withAuthRetry(async () => {
|
|
149
|
-
return await this.makeRequest('POST', '/
|
|
149
|
+
return await this.makeRequest('POST', '/saves', {
|
|
150
150
|
itemId,
|
|
151
151
|
itemType,
|
|
152
152
|
collectionId,
|
|
@@ -158,7 +158,7 @@ function OxyServicesFeaturesMixin(Base) {
|
|
|
158
158
|
*/
|
|
159
159
|
async removeSavedItem(saveId) {
|
|
160
160
|
return this.withAuthRetry(async () => {
|
|
161
|
-
await this.makeRequest('DELETE', `/
|
|
161
|
+
await this.makeRequest('DELETE', `/saves/${saveId}`, undefined, { cache: false });
|
|
162
162
|
}, 'removeSavedItem');
|
|
163
163
|
}
|
|
164
164
|
/**
|
|
@@ -166,7 +166,7 @@ function OxyServicesFeaturesMixin(Base) {
|
|
|
166
166
|
*/
|
|
167
167
|
async createCollection(name, description) {
|
|
168
168
|
return this.withAuthRetry(async () => {
|
|
169
|
-
return await this.makeRequest('POST', '/
|
|
169
|
+
return await this.makeRequest('POST', '/collections', {
|
|
170
170
|
name,
|
|
171
171
|
description,
|
|
172
172
|
}, { cache: false });
|
|
@@ -177,7 +177,7 @@ function OxyServicesFeaturesMixin(Base) {
|
|
|
177
177
|
*/
|
|
178
178
|
async deleteCollection(collectionId) {
|
|
179
179
|
return this.withAuthRetry(async () => {
|
|
180
|
-
await this.makeRequest('DELETE', `/
|
|
180
|
+
await this.makeRequest('DELETE', `/collections/${collectionId}`, undefined, { cache: false });
|
|
181
181
|
}, 'deleteCollection');
|
|
182
182
|
}
|
|
183
183
|
// ==================
|
|
@@ -188,7 +188,7 @@ function OxyServicesFeaturesMixin(Base) {
|
|
|
188
188
|
*/
|
|
189
189
|
async getUserStats(userId) {
|
|
190
190
|
try {
|
|
191
|
-
return await this.makeRequest('GET', `/
|
|
191
|
+
return await this.makeRequest('GET', `/users/${userId}/stats`, undefined, {
|
|
192
192
|
cache: true,
|
|
193
193
|
cacheTTL: mixinHelpers_1.CACHE_TIMES.MEDIUM,
|
|
194
194
|
});
|
|
@@ -210,7 +210,7 @@ function OxyServicesFeaturesMixin(Base) {
|
|
|
210
210
|
params.limit = limit;
|
|
211
211
|
if (offset)
|
|
212
212
|
params.offset = offset;
|
|
213
|
-
const endpoint = userId ? `/
|
|
213
|
+
const endpoint = userId ? `/users/${userId}/history` : '/history';
|
|
214
214
|
return await this.makeRequest('GET', endpoint, params, {
|
|
215
215
|
cache: true,
|
|
216
216
|
cacheTTL: mixinHelpers_1.CACHE_TIMES.SHORT,
|
|
@@ -222,7 +222,7 @@ function OxyServicesFeaturesMixin(Base) {
|
|
|
222
222
|
*/
|
|
223
223
|
async clearUserHistory() {
|
|
224
224
|
return this.withAuthRetry(async () => {
|
|
225
|
-
await this.makeRequest('DELETE', '/
|
|
225
|
+
await this.makeRequest('DELETE', '/history', undefined, { cache: false });
|
|
226
226
|
}, 'clearUserHistory');
|
|
227
227
|
}
|
|
228
228
|
/**
|
|
@@ -230,7 +230,7 @@ function OxyServicesFeaturesMixin(Base) {
|
|
|
230
230
|
*/
|
|
231
231
|
async deleteHistoryItem(itemId) {
|
|
232
232
|
return this.withAuthRetry(async () => {
|
|
233
|
-
await this.makeRequest('DELETE', `/
|
|
233
|
+
await this.makeRequest('DELETE', `/history/${itemId}`, undefined, { cache: false });
|
|
234
234
|
}, 'deleteHistoryItem');
|
|
235
235
|
}
|
|
236
236
|
// ==================
|
|
@@ -242,7 +242,7 @@ function OxyServicesFeaturesMixin(Base) {
|
|
|
242
242
|
async getFAQs(category) {
|
|
243
243
|
try {
|
|
244
244
|
const params = category ? { category } : undefined;
|
|
245
|
-
return await this.makeRequest('GET', '/
|
|
245
|
+
return await this.makeRequest('GET', '/faqs', params, {
|
|
246
246
|
cache: true,
|
|
247
247
|
cacheTTL: mixinHelpers_1.CACHE_TIMES.LONG,
|
|
248
248
|
});
|
|
@@ -256,7 +256,7 @@ function OxyServicesFeaturesMixin(Base) {
|
|
|
256
256
|
*/
|
|
257
257
|
async searchFAQs(query) {
|
|
258
258
|
try {
|
|
259
|
-
return await this.makeRequest('GET', '/
|
|
259
|
+
return await this.makeRequest('GET', '/faqs/search', { query }, {
|
|
260
260
|
cache: true,
|
|
261
261
|
cacheTTL: mixinHelpers_1.CACHE_TIMES.MEDIUM,
|
|
262
262
|
});
|
|
@@ -273,7 +273,7 @@ function OxyServicesFeaturesMixin(Base) {
|
|
|
273
273
|
*/
|
|
274
274
|
async getUserAchievements(userId) {
|
|
275
275
|
return this.withAuthRetry(async () => {
|
|
276
|
-
const endpoint = userId ? `/
|
|
276
|
+
const endpoint = userId ? `/users/${userId}/achievements` : '/achievements';
|
|
277
277
|
return await this.makeRequest('GET', endpoint, undefined, {
|
|
278
278
|
cache: true,
|
|
279
279
|
cacheTTL: mixinHelpers_1.CACHE_TIMES.MEDIUM,
|
|
@@ -285,7 +285,7 @@ function OxyServicesFeaturesMixin(Base) {
|
|
|
285
285
|
*/
|
|
286
286
|
async getAllAchievements() {
|
|
287
287
|
try {
|
|
288
|
-
return await this.makeRequest('GET', '/
|
|
288
|
+
return await this.makeRequest('GET', '/achievements/all', undefined, {
|
|
289
289
|
cache: true,
|
|
290
290
|
cacheTTL: mixinHelpers_1.CACHE_TIMES.LONG,
|
|
291
291
|
});
|
|
@@ -302,7 +302,7 @@ function OxyServicesFeaturesMixin(Base) {
|
|
|
302
302
|
*/
|
|
303
303
|
async deleteAccount(password) {
|
|
304
304
|
return this.withAuthRetry(async () => {
|
|
305
|
-
await this.makeRequest('DELETE', '/
|
|
305
|
+
await this.makeRequest('DELETE', '/account', { password }, { cache: false });
|
|
306
306
|
}, 'deleteAccount');
|
|
307
307
|
}
|
|
308
308
|
};
|
|
@@ -344,7 +344,7 @@ function OxyServicesFedCMMixin(Base) {
|
|
|
344
344
|
async exchangeIdTokenForSession(idToken) {
|
|
345
345
|
debug.log('Exchanging ID token for session...');
|
|
346
346
|
try {
|
|
347
|
-
const response = await this.makeRequest('POST', '/
|
|
347
|
+
const response = await this.makeRequest('POST', '/fedcm/exchange', { id_token: idToken }, { cache: false });
|
|
348
348
|
debug.log('Token exchange complete:', {
|
|
349
349
|
hasSession: !!response?.sessionId,
|
|
350
350
|
hasUser: !!response?.user,
|
|
@@ -12,7 +12,7 @@ function OxyServicesKarmaMixin(Base) {
|
|
|
12
12
|
*/
|
|
13
13
|
async getUserKarma(userId) {
|
|
14
14
|
try {
|
|
15
|
-
return await this.makeRequest('GET', `/
|
|
15
|
+
return await this.makeRequest('GET', `/karma/${userId}`, undefined, {
|
|
16
16
|
cache: true,
|
|
17
17
|
cacheTTL: 2 * 60 * 1000, // 2 minutes cache
|
|
18
18
|
});
|
|
@@ -26,7 +26,7 @@ function OxyServicesKarmaMixin(Base) {
|
|
|
26
26
|
*/
|
|
27
27
|
async giveKarma(userId, amount, reason) {
|
|
28
28
|
try {
|
|
29
|
-
return await this.makeRequest('POST', `/
|
|
29
|
+
return await this.makeRequest('POST', `/karma/${userId}/give`, {
|
|
30
30
|
amount,
|
|
31
31
|
reason
|
|
32
32
|
}, { cache: false });
|
|
@@ -42,7 +42,7 @@ function OxyServicesKarmaMixin(Base) {
|
|
|
42
42
|
*/
|
|
43
43
|
async getUserKarmaTotal(userId) {
|
|
44
44
|
try {
|
|
45
|
-
return await this.makeRequest('GET', `/
|
|
45
|
+
return await this.makeRequest('GET', `/karma/${userId}/total`, undefined, {
|
|
46
46
|
cache: true,
|
|
47
47
|
cacheTTL: mixinHelpers_1.CACHE_TIMES.MEDIUM,
|
|
48
48
|
});
|
|
@@ -65,7 +65,7 @@ function OxyServicesKarmaMixin(Base) {
|
|
|
65
65
|
params.limit = limit;
|
|
66
66
|
if (offset)
|
|
67
67
|
params.offset = offset;
|
|
68
|
-
return await this.makeRequest('GET', `/
|
|
68
|
+
return await this.makeRequest('GET', `/karma/${userId}/history`, params, {
|
|
69
69
|
cache: true,
|
|
70
70
|
cacheTTL: mixinHelpers_1.CACHE_TIMES.MEDIUM,
|
|
71
71
|
});
|
|
@@ -80,7 +80,7 @@ function OxyServicesKarmaMixin(Base) {
|
|
|
80
80
|
*/
|
|
81
81
|
async getKarmaLeaderboard() {
|
|
82
82
|
try {
|
|
83
|
-
return await this.makeRequest('GET', '/
|
|
83
|
+
return await this.makeRequest('GET', '/karma/leaderboard', undefined, {
|
|
84
84
|
cache: true,
|
|
85
85
|
cacheTTL: mixinHelpers_1.CACHE_TIMES.LONG,
|
|
86
86
|
});
|
|
@@ -95,7 +95,7 @@ function OxyServicesKarmaMixin(Base) {
|
|
|
95
95
|
*/
|
|
96
96
|
async getKarmaRules() {
|
|
97
97
|
try {
|
|
98
|
-
return await this.makeRequest('GET', '/
|
|
98
|
+
return await this.makeRequest('GET', '/karma/rules', undefined, {
|
|
99
99
|
cache: true,
|
|
100
100
|
cacheTTL: mixinHelpers_1.CACHE_TIMES.EXTRA_LONG, // Rules don't change often
|
|
101
101
|
});
|
|
@@ -14,7 +14,7 @@ function OxyServicesLocationMixin(Base) {
|
|
|
14
14
|
*/
|
|
15
15
|
async updateLocation(latitude, longitude) {
|
|
16
16
|
try {
|
|
17
|
-
return await this.makeRequest('POST', '/
|
|
17
|
+
return await this.makeRequest('POST', '/location', {
|
|
18
18
|
latitude,
|
|
19
19
|
longitude
|
|
20
20
|
}, { cache: false });
|
|
@@ -31,7 +31,7 @@ function OxyServicesLocationMixin(Base) {
|
|
|
31
31
|
async getNearbyUsers(radius) {
|
|
32
32
|
try {
|
|
33
33
|
const params = radius ? { radius } : undefined;
|
|
34
|
-
return await this.makeRequest('GET', '/
|
|
34
|
+
return await this.makeRequest('GET', '/location/nearby', params, {
|
|
35
35
|
cache: false, // Don't cache location data - always get fresh data
|
|
36
36
|
});
|
|
37
37
|
}
|
|
@@ -14,7 +14,7 @@ function OxyServicesPaymentMixin(Base) {
|
|
|
14
14
|
*/
|
|
15
15
|
async createPayment(data) {
|
|
16
16
|
try {
|
|
17
|
-
return await this.makeRequest('POST', '/
|
|
17
|
+
return await this.makeRequest('POST', '/payments', data, { cache: false });
|
|
18
18
|
}
|
|
19
19
|
catch (error) {
|
|
20
20
|
throw this.handleError(error);
|
|
@@ -27,7 +27,7 @@ function OxyServicesPaymentMixin(Base) {
|
|
|
27
27
|
*/
|
|
28
28
|
async getPayment(paymentId) {
|
|
29
29
|
try {
|
|
30
|
-
return await this.makeRequest('GET', `/
|
|
30
|
+
return await this.makeRequest('GET', `/payments/${paymentId}`, undefined, {
|
|
31
31
|
cache: true,
|
|
32
32
|
cacheTTL: mixinHelpers_1.CACHE_TIMES.LONG,
|
|
33
33
|
});
|
|
@@ -42,7 +42,7 @@ function OxyServicesPaymentMixin(Base) {
|
|
|
42
42
|
*/
|
|
43
43
|
async getUserPayments() {
|
|
44
44
|
try {
|
|
45
|
-
return await this.makeRequest('GET', '/
|
|
45
|
+
return await this.makeRequest('GET', '/payments/user', undefined, {
|
|
46
46
|
cache: false, // Don't cache user payments - always get fresh data
|
|
47
47
|
});
|
|
48
48
|
}
|
|
@@ -57,7 +57,7 @@ function OxyServicesPaymentMixin(Base) {
|
|
|
57
57
|
*/
|
|
58
58
|
async getSubscription(userId) {
|
|
59
59
|
try {
|
|
60
|
-
return await this.makeRequest('GET', `/
|
|
60
|
+
return await this.makeRequest('GET', `/subscription/${userId}`, undefined, {
|
|
61
61
|
cache: true,
|
|
62
62
|
cacheTTL: mixinHelpers_1.CACHE_TIMES.MEDIUM,
|
|
63
63
|
});
|
|
@@ -89,7 +89,7 @@ function OxyServicesPaymentMixin(Base) {
|
|
|
89
89
|
*/
|
|
90
90
|
async getWallet(userId) {
|
|
91
91
|
try {
|
|
92
|
-
return await this.makeRequest('GET', `/
|
|
92
|
+
return await this.makeRequest('GET', `/wallet/${userId}`, undefined, {
|
|
93
93
|
cache: true,
|
|
94
94
|
cacheTTL: mixinHelpers_1.CACHE_TIMES.SHORT, // Cache wallet for short time as balance changes frequently
|
|
95
95
|
});
|
|
@@ -128,7 +128,7 @@ function OxyServicesPaymentMixin(Base) {
|
|
|
128
128
|
if (options?.offset)
|
|
129
129
|
params.append('offset', options.offset.toString());
|
|
130
130
|
const queryString = params.toString();
|
|
131
|
-
const url = `/
|
|
131
|
+
const url = `/wallet/transactions/${userId}${queryString ? `?${queryString}` : ''}`;
|
|
132
132
|
return await this.makeRequest('GET', url, undefined, {
|
|
133
133
|
cache: false, // Don't cache transactions - always get fresh data
|
|
134
134
|
});
|
|
@@ -91,7 +91,7 @@ function OxyServicesPopupAuthMixin(Base) {
|
|
|
91
91
|
// The callback page only sends sessionId/accessToken, not user data
|
|
92
92
|
if (session && session.sessionId && !session.user) {
|
|
93
93
|
try {
|
|
94
|
-
const userData = await this.makeRequest('GET', `/
|
|
94
|
+
const userData = await this.makeRequest('GET', `/session/user/${session.sessionId}`, undefined, { cache: false });
|
|
95
95
|
if (userData) {
|
|
96
96
|
session.user = userData;
|
|
97
97
|
}
|
|
@@ -44,7 +44,7 @@ function OxyServicesPrivacyMixin(Base) {
|
|
|
44
44
|
*/
|
|
45
45
|
async getBlockedUsers() {
|
|
46
46
|
try {
|
|
47
|
-
return await this.makeRequest('GET', '/
|
|
47
|
+
return await this.makeRequest('GET', '/privacy/blocked', undefined, {
|
|
48
48
|
cache: true,
|
|
49
49
|
cacheTTL: 1 * 60 * 1000, // 1 minute cache
|
|
50
50
|
});
|
|
@@ -63,7 +63,7 @@ function OxyServicesPrivacyMixin(Base) {
|
|
|
63
63
|
if (!userId) {
|
|
64
64
|
throw new Error('User ID is required');
|
|
65
65
|
}
|
|
66
|
-
return await this.makeRequest('POST', `/
|
|
66
|
+
return await this.makeRequest('POST', `/privacy/blocked/${userId}`, undefined, {
|
|
67
67
|
cache: false,
|
|
68
68
|
});
|
|
69
69
|
}
|
|
@@ -81,7 +81,7 @@ function OxyServicesPrivacyMixin(Base) {
|
|
|
81
81
|
if (!userId) {
|
|
82
82
|
throw new Error('User ID is required');
|
|
83
83
|
}
|
|
84
|
-
return await this.makeRequest('DELETE', `/
|
|
84
|
+
return await this.makeRequest('DELETE', `/privacy/blocked/${userId}`, undefined, {
|
|
85
85
|
cache: false,
|
|
86
86
|
});
|
|
87
87
|
}
|
|
@@ -106,7 +106,7 @@ function OxyServicesPrivacyMixin(Base) {
|
|
|
106
106
|
*/
|
|
107
107
|
async getRestrictedUsers() {
|
|
108
108
|
try {
|
|
109
|
-
return await this.makeRequest('GET', '/
|
|
109
|
+
return await this.makeRequest('GET', '/privacy/restricted', undefined, {
|
|
110
110
|
cache: true,
|
|
111
111
|
cacheTTL: 1 * 60 * 1000, // 1 minute cache
|
|
112
112
|
});
|
|
@@ -125,7 +125,7 @@ function OxyServicesPrivacyMixin(Base) {
|
|
|
125
125
|
if (!userId) {
|
|
126
126
|
throw new Error('User ID is required');
|
|
127
127
|
}
|
|
128
|
-
return await this.makeRequest('POST', `/
|
|
128
|
+
return await this.makeRequest('POST', `/privacy/restricted/${userId}`, undefined, {
|
|
129
129
|
cache: false,
|
|
130
130
|
});
|
|
131
131
|
}
|
|
@@ -143,7 +143,7 @@ function OxyServicesPrivacyMixin(Base) {
|
|
|
143
143
|
if (!userId) {
|
|
144
144
|
throw new Error('User ID is required');
|
|
145
145
|
}
|
|
146
|
-
return await this.makeRequest('DELETE', `/
|
|
146
|
+
return await this.makeRequest('DELETE', `/privacy/restricted/${userId}`, undefined, {
|
|
147
147
|
cache: false,
|
|
148
148
|
});
|
|
149
149
|
}
|
|
@@ -23,7 +23,7 @@ function OxyServicesSecurityMixin(Base) {
|
|
|
23
23
|
params.offset = offset;
|
|
24
24
|
if (eventType)
|
|
25
25
|
params.eventType = eventType;
|
|
26
|
-
const response = await this.makeRequest('GET', '/
|
|
26
|
+
const response = await this.makeRequest('GET', '/security/activity', params, { cache: false });
|
|
27
27
|
return response;
|
|
28
28
|
}
|
|
29
29
|
catch (error) {
|
|
@@ -51,7 +51,7 @@ function OxyServicesSecurityMixin(Base) {
|
|
|
51
51
|
*/
|
|
52
52
|
async logPrivateKeyExported(deviceId) {
|
|
53
53
|
try {
|
|
54
|
-
await this.makeRequest('POST', '/
|
|
54
|
+
await this.makeRequest('POST', '/security/activity/private-key-exported', { deviceId }, { cache: false });
|
|
55
55
|
}
|
|
56
56
|
catch (error) {
|
|
57
57
|
// Don't throw - logging failures shouldn't break user flow
|
|
@@ -68,7 +68,7 @@ function OxyServicesSecurityMixin(Base) {
|
|
|
68
68
|
*/
|
|
69
69
|
async logBackupCreated(deviceId) {
|
|
70
70
|
try {
|
|
71
|
-
await this.makeRequest('POST', '/
|
|
71
|
+
await this.makeRequest('POST', '/security/activity/backup-created', { deviceId }, { cache: false });
|
|
72
72
|
}
|
|
73
73
|
catch (error) {
|
|
74
74
|
// Don't throw - logging failures shouldn't break user flow
|