rozod 6.0.0 → 6.1.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/README.md +282 -17
- package/lib/cache.js +11 -1
- package/lib/endpoints/accountinformationv1.js +3 -67
- package/lib/endpoints/adconfigurationv2.d.ts +1 -1
- package/lib/endpoints/assetdeliveryv1.js +272 -6
- package/lib/endpoints/assetdeliveryv2.js +31 -5
- package/lib/endpoints/authv1.d.ts +5 -5
- package/lib/endpoints/authv1.js +28 -21
- package/lib/endpoints/authv2.js +2 -1
- package/lib/endpoints/avatarv1.js +74 -451
- package/lib/endpoints/avatarv2.js +39 -2
- package/lib/endpoints/avatarv3.js +39 -2
- package/lib/endpoints/badgesv1.js +1 -40
- package/lib/endpoints/catalogv1.d.ts +3 -3
- package/lib/endpoints/catalogv1.js +20 -4
- package/lib/endpoints/catalogv2.js +17 -1
- package/lib/endpoints/clientsettingsv1.js +6 -5
- package/lib/endpoints/clientsettingsv2.js +54 -1
- package/lib/endpoints/developv1.js +1 -1
- package/lib/endpoints/developv2.js +1 -0
- package/lib/endpoints/economycreatorstatsv1.d.ts +1 -1
- package/lib/endpoints/engagementpayoutsv1.d.ts +1 -1
- package/lib/endpoints/followingsv2.d.ts +1 -1
- package/lib/endpoints/friendsv1.js +9 -161
- package/lib/endpoints/gameinternationalizationv1.js +115 -72
- package/lib/endpoints/gameinternationalizationv2.js +4 -0
- package/lib/endpoints/gamesv1.js +8 -91
- package/lib/endpoints/gamesv2.js +1 -0
- package/lib/endpoints/groupsv1.js +610 -47
- package/lib/endpoints/groupsv2.js +163 -1
- package/lib/endpoints/inventoryv1.js +8 -4
- package/lib/endpoints/inventoryv2.js +5 -0
- package/lib/endpoints/localev1.js +43 -2
- package/lib/endpoints/localizationtablesv1.js +15 -0
- package/lib/endpoints/matchmakingv1.js +458 -0
- package/lib/endpoints/notificationsv2.js +4 -8
- package/lib/endpoints/presencev1.js +34 -17
- package/lib/endpoints/thumbnailsv1.js +2 -4
- package/lib/endpoints/tradesv2.js +72 -1
- package/lib/endpoints/twostepverificationv1.js +5 -0
- package/lib/endpoints/usersv1.js +4 -2
- package/lib/index.d.ts +84 -4
- package/lib/index.js +190 -21
- package/lib/opencloud/v1/asset-permissions.d.ts +25 -0
- package/lib/opencloud/v1/asset-permissions.js +75 -0
- package/lib/opencloud/v1/assets.d.ts +11 -0
- package/lib/opencloud/v1/assets.js +3 -0
- package/lib/opencloud/v1/datastores-ordered.d.ts +14 -14
- package/lib/opencloud/v1/datastores-ordered.js +14 -14
- package/lib/opencloud/v1/datastores.d.ts +15 -15
- package/lib/opencloud/v1/datastores.js +15 -15
- package/lib/opencloud/v1/developer-products.d.ts +108 -0
- package/lib/opencloud/v1/developer-products.js +249 -0
- package/lib/opencloud/v1/game-passes.d.ts +98 -0
- package/lib/opencloud/v1/game-passes.js +236 -0
- package/lib/opencloud/v1/open-eval.d.ts +57 -0
- package/lib/opencloud/v1/open-eval.js +91 -0
- package/lib/opencloud/v1/secrets-store.d.ts +148 -0
- package/lib/opencloud/v1/secrets-store.js +247 -0
- package/lib/opencloud/v1/toolbox.d.ts +167 -0
- package/lib/opencloud/v1/toolbox.js +236 -0
- package/lib/opencloud/v2/cloud.d.ts +292 -203
- package/lib/opencloud/v2/cloud.js +309 -215
- package/package.json +64 -63
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
<h4 align="center">Type-safe Roblox API and OpenCloud client for TypeScript</h4>
|
|
7
7
|
|
|
8
8
|
<p align="center">
|
|
9
|
-
<a href="https://www.npmjs.com/package/rozod"><img alt="npm bundle size" src="https://img.shields.io/bundlephobia/
|
|
9
|
+
<a href="https://www.npmjs.com/package/rozod"><img alt="npm bundle size" src="https://img.shields.io/bundlephobia/min/rozod?style=for-the-badge"></a>
|
|
10
10
|
<a href="https://www.npmjs.com/package/rozod"><img alt="npm" src="https://img.shields.io/npm/v/rozod?style=for-the-badge"></a>
|
|
11
11
|
<a href="https://www.npmjs.com/package/rozod"><img alt="npm" src="https://img.shields.io/npm/dt/rozod?style=for-the-badge"></a>
|
|
12
12
|
</p>
|
|
@@ -24,16 +24,22 @@
|
|
|
24
24
|
---
|
|
25
25
|
|
|
26
26
|
## About
|
|
27
|
-
|
|
27
|
+
|
|
28
|
+
`RoZod` makes working with Roblox APIs simple and type-safe in TypeScript. With **650+ classic Roblox web API endpoints** and **95+ OpenCloud endpoints** (all code-generated from official Roblox documentation), you get comprehensive coverage of virtually every available Roblox API with full type safety.
|
|
29
|
+
|
|
30
|
+
Perfect for everything from small one-time NodeJS/Bun/Deno scripts to large-scale production applications. RoZod powers [RoGold](https://rogold.live), a browser extension with **800,000+ active users**, handling millions of API requests daily across both frontend extensions and backend workflows.
|
|
28
31
|
|
|
29
32
|
## Features
|
|
30
33
|
|
|
31
34
|
- ✨ **Simple Interface** - Easy to understand API with minimal boilerplate
|
|
32
35
|
- 🔒 **Type Safety** - Complete TypeScript type safety for requests and responses
|
|
33
|
-
- 📚 **
|
|
36
|
+
- 📚 **750+ Total Endpoints** - 650+ classic web APIs + 95+ OpenCloud APIs, all code-generated from official docs
|
|
37
|
+
- 🚀 **Production Ready** - Battle-tested in applications serving 800,000+ users
|
|
34
38
|
- 🔄 **Pagination Helpers** - Easy tools for handling paginated responses
|
|
35
39
|
- 🔁 **Batch Processing** - Split large requests automatically to avoid API limits
|
|
40
|
+
- 🌐 **Universal Runtime Support** - Works seamlessly in NodeJS, Bun, Deno, and browsers
|
|
36
41
|
- 🔍 **Custom Endpoints** - Define your own endpoints with full type safety
|
|
42
|
+
- 🧩 **Smart Error Handling** - Choose between safe unions or throw-on-error
|
|
37
43
|
|
|
38
44
|
## Installation
|
|
39
45
|
|
|
@@ -53,6 +59,9 @@ import { getUsersUserdetails } from 'rozod/lib/endpoints/usersv1';
|
|
|
53
59
|
|
|
54
60
|
// Fetch user details with full type safety
|
|
55
61
|
const userInfo = await fetchApi(getUsersUserdetails, { userIds: [1, 123456] });
|
|
62
|
+
if (isAnyErrorResponse(userInfo)) {
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
56
65
|
console.log(userInfo.data[0].displayName); // Properly typed!
|
|
57
66
|
```
|
|
58
67
|
|
|
@@ -88,8 +97,8 @@ import { getGroupsGroupidWallPosts } from 'rozod/lib/endpoints/groupsv2';
|
|
|
88
97
|
// Process pages as they arrive
|
|
89
98
|
const pages = fetchApiPagesGenerator(getGroupsGroupidWallPosts, { groupId: 11479637 });
|
|
90
99
|
for await (const page of pages) {
|
|
91
|
-
|
|
92
|
-
|
|
100
|
+
console.log(`Processing page with ${page.data.length} posts`);
|
|
101
|
+
// Do something with this page
|
|
93
102
|
}
|
|
94
103
|
```
|
|
95
104
|
|
|
@@ -101,13 +110,47 @@ import { getGamesIcons } from 'rozod/lib/endpoints/gamesv1';
|
|
|
101
110
|
|
|
102
111
|
// Will automatically split into smaller batches of 100 universeIds per request
|
|
103
112
|
const data = await fetchApiSplit(
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
113
|
+
getGamesIcons,
|
|
114
|
+
{ universeIds: [1, 2, 3, 4, 5 /* many more IDs */] },
|
|
115
|
+
{ universeIds: 100 },
|
|
107
116
|
);
|
|
108
117
|
console.log(data);
|
|
109
118
|
```
|
|
110
119
|
|
|
120
|
+
### Handling Errors
|
|
121
|
+
|
|
122
|
+
By default, requests return either the success type or a simple `AnyError`. Use the tiny helper to check:
|
|
123
|
+
|
|
124
|
+
```ts
|
|
125
|
+
import { fetchApi, isAnyErrorResponse } from 'rozod';
|
|
126
|
+
import { getGamesIcons } from 'rozod/lib/endpoints/gamesv1';
|
|
127
|
+
|
|
128
|
+
const res = await fetchApi(getGamesIcons, { universeIds: [1534453623] });
|
|
129
|
+
if (isAnyErrorResponse(res)) {
|
|
130
|
+
console.error(res.message);
|
|
131
|
+
} else {
|
|
132
|
+
console.log(res.data);
|
|
133
|
+
}
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
Prefer a straight try/catch? Enable throwing:
|
|
137
|
+
|
|
138
|
+
```ts
|
|
139
|
+
try {
|
|
140
|
+
const res = await fetchApi(getGamesIcons, { universeIds: [1534453623] }, { throwOnError: true });
|
|
141
|
+
console.log(res.data);
|
|
142
|
+
} catch (err) {
|
|
143
|
+
console.error((err as Error).message);
|
|
144
|
+
}
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
Need the raw Response? Use `returnRaw: true`:
|
|
148
|
+
|
|
149
|
+
```ts
|
|
150
|
+
const resp = await fetchApi(getGamesIcons, { universeIds: [1534453623] }, { returnRaw: true });
|
|
151
|
+
const json = await resp.json();
|
|
152
|
+
```
|
|
153
|
+
|
|
111
154
|
## OpenCloud
|
|
112
155
|
|
|
113
156
|
RoZod supports Roblox's newer OpenCloud APIs with the same easy interface:
|
|
@@ -117,8 +160,8 @@ import { fetchApi } from 'rozod';
|
|
|
117
160
|
import { v2 } from 'rozod/lib/opencloud';
|
|
118
161
|
|
|
119
162
|
// Get universe details through OpenCloud
|
|
120
|
-
const universeInfo = await fetchApi(v2.getCloudV2UniversesUniverseId, {
|
|
121
|
-
|
|
163
|
+
const universeInfo = await fetchApi(v2.getCloudV2UniversesUniverseId, {
|
|
164
|
+
universe_id: '123456789',
|
|
122
165
|
});
|
|
123
166
|
|
|
124
167
|
// Access typed properties
|
|
@@ -133,12 +176,232 @@ import { fetchApi } from 'rozod';
|
|
|
133
176
|
import { getCloudV2UniversesUniverseIdDataStoresDataStoreIdEntries } from 'rozod/lib/opencloud/v2/cloud';
|
|
134
177
|
|
|
135
178
|
// Get DataStore entries with type safety
|
|
136
|
-
const dataStoreEntries = await fetchApi(
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
179
|
+
const dataStoreEntries = await fetchApi(getCloudV2UniversesUniverseIdDataStoresDataStoreIdEntries, {
|
|
180
|
+
universe_id: '123456789',
|
|
181
|
+
data_store_id: 'MyStore',
|
|
182
|
+
});
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
## Authentication
|
|
186
|
+
|
|
187
|
+
RoZod handles Roblox authentication automatically with comprehensive security features:
|
|
188
|
+
|
|
189
|
+
### Browser Environments
|
|
190
|
+
|
|
191
|
+
In browsers, authentication works automatically when users are logged into Roblox:
|
|
192
|
+
|
|
193
|
+
```ts
|
|
194
|
+
import { fetchApi } from 'rozod';
|
|
195
|
+
import { getUsersUserdetails } from 'rozod/lib/endpoints/usersv1';
|
|
196
|
+
|
|
197
|
+
// Cookies are sent automatically - no setup required!
|
|
198
|
+
const userInfo = await fetchApi(getUsersUserdetails, { userIds: [123456] });
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
### Server Environments (Node.js/Bun/Deno)
|
|
202
|
+
|
|
203
|
+
For server environments, use `configureServer()` to set up authentication once:
|
|
204
|
+
|
|
205
|
+
```ts
|
|
206
|
+
import { configureServer, fetchApi } from 'rozod';
|
|
207
|
+
import { getUsersUserdetails } from 'rozod/lib/endpoints/usersv1';
|
|
208
|
+
|
|
209
|
+
// Configure once at startup
|
|
210
|
+
configureServer({ cookies: 'your_roblosecurity_cookie_here' });
|
|
211
|
+
|
|
212
|
+
// All subsequent requests automatically include the cookie
|
|
213
|
+
const userInfo = await fetchApi(getUsersUserdetails, { userIds: [123456] });
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
#### Multiple Accounts (Cookie Pool)
|
|
217
|
+
|
|
218
|
+
Use multiple Roblox accounts for load distribution or fallback:
|
|
219
|
+
|
|
220
|
+
```ts
|
|
221
|
+
import { configureServer } from 'rozod';
|
|
222
|
+
|
|
223
|
+
// Multiple accounts with round-robin rotation (default)
|
|
224
|
+
configureServer({
|
|
225
|
+
cookies: [
|
|
226
|
+
'account1_roblosecurity_cookie',
|
|
227
|
+
'account2_roblosecurity_cookie',
|
|
228
|
+
'account3_roblosecurity_cookie',
|
|
229
|
+
],
|
|
230
|
+
});
|
|
231
|
+
|
|
232
|
+
// Requests automatically cycle through accounts: 1 → 2 → 3 → 1 → 2 → ...
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
#### Rotation Modes
|
|
236
|
+
|
|
237
|
+
Control how cookies and user agents are selected:
|
|
238
|
+
|
|
239
|
+
```ts
|
|
240
|
+
import { configureServer } from 'rozod';
|
|
241
|
+
|
|
242
|
+
configureServer({
|
|
243
|
+
cookies: ['cookie1', 'cookie2', 'cookie3'],
|
|
244
|
+
cookieRotation: 'round-robin', // Cycle sequentially (default for multiple)
|
|
245
|
+
// cookieRotation: 'random', // Pick randomly per request
|
|
246
|
+
// cookieRotation: 'none', // Always use first cookie
|
|
247
|
+
|
|
248
|
+
userAgents: ['CustomBot/1.0', 'CustomBot/2.0'], // Optional custom UAs
|
|
249
|
+
userAgentRotation: 'none', // Consistent per session (default)
|
|
250
|
+
// userAgentRotation: 'random',
|
|
251
|
+
// userAgentRotation: 'round-robin',
|
|
252
|
+
});
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
#### User Agent Pool
|
|
256
|
+
|
|
257
|
+
RoZod includes built-in browser user agents applied automatically in server environments. Customize or disable:
|
|
258
|
+
|
|
259
|
+
```ts
|
|
260
|
+
// Use custom user agents
|
|
261
|
+
configureServer({
|
|
262
|
+
cookies: '...',
|
|
263
|
+
userAgents: ['MyBot/1.0', 'MyService/2.0'],
|
|
264
|
+
userAgentRotation: 'round-robin',
|
|
265
|
+
});
|
|
266
|
+
|
|
267
|
+
// Disable user agent injection
|
|
268
|
+
configureServer({ cookies: '...', userAgents: [] });
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
#### OpenCloud API Key
|
|
272
|
+
|
|
273
|
+
For OpenCloud endpoints (`apis.roblox.com`), set your API key once:
|
|
274
|
+
|
|
275
|
+
```ts
|
|
276
|
+
import { configureServer } from 'rozod';
|
|
277
|
+
import { v2 } from 'rozod/lib/opencloud';
|
|
278
|
+
|
|
279
|
+
// Configure OpenCloud API key
|
|
280
|
+
configureServer({ cloudKey: 'your_opencloud_api_key_here' });
|
|
281
|
+
|
|
282
|
+
// All OpenCloud requests automatically include x-api-key header
|
|
283
|
+
const universeInfo = await fetchApi(v2.getCloudV2UniversesUniverseId, {
|
|
284
|
+
universe_id: '123456789',
|
|
285
|
+
});
|
|
286
|
+
```
|
|
287
|
+
|
|
288
|
+
You can configure both classic API cookies and OpenCloud keys together:
|
|
289
|
+
|
|
290
|
+
```ts
|
|
291
|
+
configureServer({
|
|
292
|
+
cookies: ['account1', 'account2'], // For classic *.roblox.com APIs
|
|
293
|
+
cloudKey: 'your_opencloud_key', // For apis.roblox.com
|
|
294
|
+
});
|
|
295
|
+
```
|
|
296
|
+
|
|
297
|
+
> **Note:** The API key is only applied to OpenCloud endpoints (URLs containing `/cloud/`). Cookies are applied to all other Roblox APIs, including undocumented cookie-based APIs on `apis.roblox.com`.
|
|
298
|
+
|
|
299
|
+
#### Configuration Management
|
|
300
|
+
|
|
301
|
+
```ts
|
|
302
|
+
import { configureServer, clearServerConfig, getServerConfig } from 'rozod';
|
|
303
|
+
|
|
304
|
+
// Check current configuration
|
|
305
|
+
const config = getServerConfig();
|
|
306
|
+
console.log(config.cookies, config.cloudKey);
|
|
307
|
+
|
|
308
|
+
// Clear all server configuration
|
|
309
|
+
clearServerConfig();
|
|
310
|
+
```
|
|
311
|
+
|
|
312
|
+
#### Manual Headers (Legacy)
|
|
313
|
+
|
|
314
|
+
You can still pass headers manually per-request if needed:
|
|
315
|
+
|
|
316
|
+
```ts
|
|
317
|
+
const userInfo = await fetchApi(
|
|
318
|
+
getUsersUserdetails,
|
|
319
|
+
{ userIds: [123456] },
|
|
320
|
+
{
|
|
321
|
+
headers: {
|
|
322
|
+
'Cookie': '.ROBLOSECURITY=your_cookie_here'
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
);
|
|
326
|
+
```
|
|
327
|
+
|
|
328
|
+
> **Note:** Manual headers take precedence over `configureServer()` defaults.
|
|
329
|
+
|
|
330
|
+
### Security Features
|
|
331
|
+
|
|
332
|
+
RoZod automatically handles advanced Roblox security requirements:
|
|
333
|
+
|
|
334
|
+
- **✅ XCSRF Token Management** - Automatic CSRF token retrieval and caching
|
|
335
|
+
- **✅ Hardware-Backed Authentication** - Full HBA signature support
|
|
336
|
+
- **✅ Challenge Handling** - Captchas, 2FA, and other authentication challenges
|
|
337
|
+
- **✅ Cookie Security** - Secure cookie parsing and validation
|
|
338
|
+
|
|
339
|
+
### Challenge Handling
|
|
340
|
+
|
|
341
|
+
For advanced authentication challenges (captchas, 2FA), set up a global challenge handler:
|
|
342
|
+
|
|
343
|
+
```ts
|
|
344
|
+
import { setHandleGenericChallenge } from 'rozod';
|
|
345
|
+
|
|
346
|
+
setHandleGenericChallenge(async (challenge) => {
|
|
347
|
+
// Handle captcha, 2FA, or other challenges
|
|
348
|
+
// Return the challenge response or undefined to skip
|
|
349
|
+
if (challenge.challengeType === 'captcha') {
|
|
350
|
+
const solution = await solveCaptcha(challenge.challengeId);
|
|
351
|
+
return {
|
|
352
|
+
challengeType: challenge.challengeType,
|
|
353
|
+
challengeId: challenge.challengeId,
|
|
354
|
+
challengeBase64Metadata: solution
|
|
355
|
+
};
|
|
356
|
+
}
|
|
357
|
+
});
|
|
358
|
+
```
|
|
359
|
+
|
|
360
|
+
### Hardware-Backed Authentication (Advanced)
|
|
361
|
+
|
|
362
|
+
For Node.js environments requiring custom HBA keys:
|
|
363
|
+
|
|
364
|
+
```ts
|
|
365
|
+
import { changeHBAKeys } from 'rozod';
|
|
366
|
+
|
|
367
|
+
// Provide your own crypto key pair for HBA signatures
|
|
368
|
+
const keyPair = await crypto.subtle.generateKey(
|
|
369
|
+
{ name: 'ECDSA', namedCurve: 'P-256' },
|
|
370
|
+
true,
|
|
371
|
+
['sign', 'verify']
|
|
372
|
+
);
|
|
373
|
+
|
|
374
|
+
changeHBAKeys(keyPair);
|
|
375
|
+
```
|
|
376
|
+
|
|
377
|
+
### OpenCloud Authentication
|
|
378
|
+
|
|
379
|
+
OpenCloud APIs require API keys. Use `configureServer()` for automatic injection:
|
|
380
|
+
|
|
381
|
+
```ts
|
|
382
|
+
import { configureServer, fetchApi } from 'rozod';
|
|
383
|
+
import { v2 } from 'rozod/lib/opencloud';
|
|
384
|
+
|
|
385
|
+
// Configure once at startup
|
|
386
|
+
configureServer({ cloudKey: 'your_opencloud_api_key_here' });
|
|
387
|
+
|
|
388
|
+
// All OpenCloud requests automatically include x-api-key
|
|
389
|
+
const universeInfo = await fetchApi(v2.getCloudV2UniversesUniverseId, {
|
|
390
|
+
universe_id: '123456789',
|
|
391
|
+
});
|
|
392
|
+
```
|
|
393
|
+
|
|
394
|
+
Or pass headers manually per-request:
|
|
395
|
+
|
|
396
|
+
```ts
|
|
397
|
+
const universeInfo = await fetchApi(
|
|
398
|
+
v2.getCloudV2UniversesUniverseId,
|
|
399
|
+
{ universe_id: '123456789' },
|
|
400
|
+
{
|
|
401
|
+
headers: {
|
|
402
|
+
'x-api-key': 'your_opencloud_api_key_here'
|
|
141
403
|
}
|
|
404
|
+
}
|
|
142
405
|
);
|
|
143
406
|
```
|
|
144
407
|
|
|
@@ -156,11 +419,11 @@ const myCustomEndpoint = endpoint({
|
|
|
156
419
|
baseUrl: 'https://my-api.example.com',
|
|
157
420
|
parameters: {
|
|
158
421
|
customId: z.string(),
|
|
159
|
-
optional: z.string().optional()
|
|
422
|
+
optional: z.string().optional(),
|
|
160
423
|
},
|
|
161
424
|
response: z.object({
|
|
162
425
|
success: z.boolean(),
|
|
163
|
-
data: z.array(z.string())
|
|
426
|
+
data: z.array(z.string()),
|
|
164
427
|
}),
|
|
165
428
|
});
|
|
166
429
|
|
|
@@ -168,7 +431,9 @@ const response = await fetchApi(myCustomEndpoint, { customId: '123' });
|
|
|
168
431
|
```
|
|
169
432
|
|
|
170
433
|
## Credits
|
|
434
|
+
|
|
171
435
|
This repository is maintained by Alrovi ApS, the company behind RoGold.
|
|
172
436
|
|
|
173
437
|
## Disclaimer
|
|
438
|
+
|
|
174
439
|
RoZod is not affiliated with, maintained, authorized, endorsed, or sponsored by Roblox Corporation or any of its affiliates.
|
package/lib/cache.js
CHANGED
|
@@ -68,7 +68,17 @@ class ChromeStore {
|
|
|
68
68
|
return new Promise((resolve) => {
|
|
69
69
|
// @ts-ignore
|
|
70
70
|
chrome?.storage?.local?.get?.(null, (result) => {
|
|
71
|
-
|
|
71
|
+
if (!result) {
|
|
72
|
+
resolve({});
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
const filtered = {};
|
|
76
|
+
for (const key of Object.keys(result)) {
|
|
77
|
+
if (key.startsWith('rozod_cache:')) {
|
|
78
|
+
filtered[key] = result[key];
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
resolve(filtered);
|
|
72
82
|
});
|
|
73
83
|
});
|
|
74
84
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.getUsersUseridRobloxBadges = exports.getUsersUseridPromotionChannels = exports.deleteStarCodeAffiliates = exports.postStarCodeAffiliates = exports.getStarCodeAffiliates = exports.postPromotionChannels = exports.getPromotionChannels = exports.postPhoneVerify = exports.postPhoneResend = exports.postPhoneDelete = exports.postPhone = exports.getPhone = exports.getMetadata = exports.postGender = exports.getGender = exports.postEmailVerify = exports.postDescription = exports.getDescription = exports.getBirthdate = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const __1 = require("..");
|
|
6
6
|
const Roblox_AccountInformation_Api_Models_BirthdateResponse = zod_1.z.object({
|
|
@@ -8,13 +8,6 @@ const Roblox_AccountInformation_Api_Models_BirthdateResponse = zod_1.z.object({
|
|
|
8
8
|
birthDay: zod_1.z.number().int(),
|
|
9
9
|
birthYear: zod_1.z.number().int(),
|
|
10
10
|
});
|
|
11
|
-
const Roblox_AccountInformation_Api_Models_BirthdateRequest = zod_1.z.object({
|
|
12
|
-
birthMonth: zod_1.z.number().int(),
|
|
13
|
-
birthDay: zod_1.z.number().int(),
|
|
14
|
-
birthYear: zod_1.z.number().int(),
|
|
15
|
-
password: zod_1.z.string(),
|
|
16
|
-
});
|
|
17
|
-
const Roblox_Web_WebAPI_ApiEmptyResponseModel = zod_1.z.object({});
|
|
18
11
|
const Roblox_AccountInformation_Api_Models_DescriptionResponse = zod_1.z.object({
|
|
19
12
|
description: zod_1.z.string(),
|
|
20
13
|
});
|
|
@@ -27,6 +20,7 @@ const Roblox_AccountInformation_Api_Models_GenderResponse = zod_1.z.object({
|
|
|
27
20
|
const Roblox_AccountInformation_Api_Models_GenderRequest = zod_1.z.object({
|
|
28
21
|
gender: zod_1.z.string(),
|
|
29
22
|
});
|
|
23
|
+
const Roblox_Web_WebAPI_ApiEmptyResponseModel = zod_1.z.object({});
|
|
30
24
|
const Roblox_AccountInformation_Api_Models_MetadataResponse = zod_1.z.object({
|
|
31
25
|
isAllowedNotificationsEndpointDisabled: zod_1.z.boolean(),
|
|
32
26
|
isAccountSettingsPolicyEnabled: zod_1.z.boolean(),
|
|
@@ -34,9 +28,9 @@ const Roblox_AccountInformation_Api_Models_MetadataResponse = zod_1.z.object({
|
|
|
34
28
|
MaxUserDescriptionLength: zod_1.z.number().int(),
|
|
35
29
|
isUserDescriptionEnabled: zod_1.z.boolean(),
|
|
36
30
|
isUserBlockEndpointsUpdated: zod_1.z.boolean(),
|
|
37
|
-
isPasswordRequiredForAgingDown: zod_1.z.boolean(),
|
|
38
31
|
shouldUsePersonaForIdVerification: zod_1.z.boolean(),
|
|
39
32
|
shouldDisplaySessionManagement: zod_1.z.boolean(),
|
|
33
|
+
isPasswordRequiredForAgingDown: zod_1.z.boolean(),
|
|
40
34
|
});
|
|
41
35
|
const Roblox_AccountInformation_Api_Models_PhoneResponse = zod_1.z.object({
|
|
42
36
|
countryCode: zod_1.z.string(),
|
|
@@ -94,7 +88,6 @@ const Roblox_AccountInformation_Api_RobloxBadgeResponse = zod_1.z.object({
|
|
|
94
88
|
description: zod_1.z.string(),
|
|
95
89
|
imageUrl: zod_1.z.string(),
|
|
96
90
|
});
|
|
97
|
-
const Roblox_AccountInformation_Api_Models_ConsecutiveLoginDaysResponse = zod_1.z.object({ count: zod_1.z.number().int() });
|
|
98
91
|
const Roblox_AccountInformation_Api_Models_VerifyEmailRequest = zod_1.z.object({
|
|
99
92
|
ticket: zod_1.z.string(),
|
|
100
93
|
});
|
|
@@ -126,45 +119,6 @@ exports.getBirthdate = (0, __1.endpoint)({
|
|
|
126
119
|
},
|
|
127
120
|
],
|
|
128
121
|
});
|
|
129
|
-
/**
|
|
130
|
-
* @api POST https://accountinformation.roblox.com/v1/birthdate
|
|
131
|
-
* @summary Update the user's birthdate
|
|
132
|
-
* @param body The Roblox.AccountInformation.Api.Models.BirthdateRequest
|
|
133
|
-
*/
|
|
134
|
-
exports.postBirthdate = (0, __1.endpoint)({
|
|
135
|
-
method: 'POST',
|
|
136
|
-
path: '/v1/birthdate',
|
|
137
|
-
baseUrl: 'https://accountinformation.roblox.com',
|
|
138
|
-
requestFormat: 'json',
|
|
139
|
-
serializationMethod: {
|
|
140
|
-
body: {},
|
|
141
|
-
},
|
|
142
|
-
parameters: {},
|
|
143
|
-
body: Roblox_AccountInformation_Api_Models_BirthdateRequest,
|
|
144
|
-
response: zod_1.z.object({}),
|
|
145
|
-
errors: [
|
|
146
|
-
{
|
|
147
|
-
status: 400,
|
|
148
|
-
description: `1: User not found.
|
|
149
|
-
4: The birthdate provided is invalid.
|
|
150
|
-
8: Password is incorrect.`,
|
|
151
|
-
},
|
|
152
|
-
{
|
|
153
|
-
status: 401,
|
|
154
|
-
description: `0: Authorization has been denied for this request.`,
|
|
155
|
-
},
|
|
156
|
-
{
|
|
157
|
-
status: 403,
|
|
158
|
-
description: `0: Token Validation Failed
|
|
159
|
-
5: Invalid birthdate change.`,
|
|
160
|
-
},
|
|
161
|
-
{
|
|
162
|
-
status: 500,
|
|
163
|
-
description: `0: An unknown error occured.
|
|
164
|
-
5: Invalid birthdate change.`,
|
|
165
|
-
},
|
|
166
|
-
],
|
|
167
|
-
});
|
|
168
122
|
/**
|
|
169
123
|
* @api GET https://accountinformation.roblox.com/v1/description
|
|
170
124
|
* @summary Get the user's description
|
|
@@ -729,21 +683,3 @@ exports.getUsersUseridRobloxBadges = (0, __1.endpoint)({
|
|
|
729
683
|
response: zod_1.z.array(Roblox_AccountInformation_Api_RobloxBadgeResponse),
|
|
730
684
|
errors: [],
|
|
731
685
|
});
|
|
732
|
-
/**
|
|
733
|
-
* @api GET https://accountinformation.roblox.com/v1/xbox-live/consecutive-login-days
|
|
734
|
-
* @summary Returns number of consecutive login days for xbox users
|
|
735
|
-
*/
|
|
736
|
-
exports.getXboxLiveConsecutiveLoginDays = (0, __1.endpoint)({
|
|
737
|
-
method: 'GET',
|
|
738
|
-
path: '/v1/xbox-live/consecutive-login-days',
|
|
739
|
-
baseUrl: 'https://accountinformation.roblox.com',
|
|
740
|
-
requestFormat: 'json',
|
|
741
|
-
response: zod_1.z.object({ count: zod_1.z.number().int() }),
|
|
742
|
-
errors: [
|
|
743
|
-
{
|
|
744
|
-
status: 401,
|
|
745
|
-
description: `0: Authorization has been denied for this request.
|
|
746
|
-
7: The account is not connected to an Xbox Live account`,
|
|
747
|
-
},
|
|
748
|
-
],
|
|
749
|
-
});
|
|
@@ -344,7 +344,7 @@ export const getSponsoredCampaignsMultiGetCanUserSponsor = endpoint({
|
|
|
344
344
|
campaignTargetType: z.union([z.literal(0), z.literal(1), z.literal(2), z.literal(3)]),
|
|
345
345
|
campaignTargetIds: z.array(z.number()),
|
|
346
346
|
},
|
|
347
|
-
response: z.
|
|
347
|
+
response: z.boolean(),
|
|
348
348
|
errors: [
|
|
349
349
|
{
|
|
350
350
|
status: 400,
|