rozod 6.5.0 → 6.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/README.md +35 -57
- package/lib/endpoints/catalogv1.d.ts +2 -0
- package/lib/endpoints/catalogv1.js +2 -0
- package/lib/endpoints/catalogv2.d.ts +1 -0
- package/lib/endpoints/catalogv2.js +1 -0
- package/lib/endpoints/friendsv1.d.ts +51 -1
- package/lib/endpoints/friendsv1.js +52 -2
- package/lib/endpoints/gameinternationalizationv1.d.ts +1 -0
- package/lib/endpoints/gameinternationalizationv1.js +1 -0
- package/lib/endpoints/groupsv1.d.ts +180 -1
- package/lib/endpoints/groupsv1.js +177 -3
- package/lib/endpoints/groupsv2.d.ts +21 -0
- package/lib/endpoints/groupsv2.js +21 -0
- package/lib/endpoints/itemconfigurationv1.d.ts +6 -164
- package/lib/endpoints/itemconfigurationv1.js +7 -165
- package/lib/index.js +26 -3
- package/lib/opencloud/v1/asset-permissions.d.ts +7 -7
- package/lib/opencloud/v1/asset-permissions.js +1 -1
- package/lib/opencloud/v1/assets.d.ts +3 -3
- package/lib/opencloud/v1/assets.js +1 -1
- package/lib/opencloud/v1/datastores-ordered.d.ts +1 -1
- package/lib/opencloud/v1/datastores-ordered.js +1 -1
- package/lib/opencloud/v1/developer-products.d.ts +7 -7
- package/lib/opencloud/v1/developer-products.js +1 -1
- package/lib/opencloud/v1/game-passes.d.ts +6 -6
- package/lib/opencloud/v1/game-passes.js +1 -1
- package/lib/opencloud/v1/secrets-store.d.ts +6 -6
- package/lib/opencloud/v1/secrets-store.js +1 -1
- package/lib/opencloud/v2/cloud.d.ts +121 -65
- package/lib/opencloud/v2/cloud.js +82 -14
- package/package.json +64 -63
package/README.md
CHANGED
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
|
|
26
26
|
## About
|
|
27
27
|
|
|
28
|
-
`RoZod` makes working with Roblox APIs simple and type-safe in TypeScript. With **
|
|
28
|
+
`RoZod` makes working with Roblox APIs simple and type-safe in TypeScript. With **695+ classic Roblox web API endpoints** and **115+ OpenCloud endpoints** (all code-generated from official Roblox documentation), you get comprehensive coverage of virtually every available Roblox API with full type safety.
|
|
29
29
|
|
|
30
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.
|
|
31
31
|
|
|
@@ -33,7 +33,7 @@ Perfect for everything from small one-time NodeJS/Bun/Deno scripts to large-scal
|
|
|
33
33
|
|
|
34
34
|
- ✨ **Simple Interface** - Easy to understand API with minimal boilerplate
|
|
35
35
|
- 🔒 **Type Safety** - Complete TypeScript type safety for requests and responses
|
|
36
|
-
- 📚 **
|
|
36
|
+
- 📚 **810+ Total Endpoints** - 695+ classic web APIs + 115+ OpenCloud APIs, all code-generated from official docs
|
|
37
37
|
- 🚀 **Production Ready** - Battle-tested in applications serving 800,000+ users
|
|
38
38
|
- 🔄 **Pagination Helpers** - Easy tools for handling paginated responses
|
|
39
39
|
- 🔁 **Batch Processing** - Split large requests automatically to avoid API limits
|
|
@@ -46,6 +46,8 @@ Perfect for everything from small one-time NodeJS/Bun/Deno scripts to large-scal
|
|
|
46
46
|
```bash
|
|
47
47
|
npm install rozod
|
|
48
48
|
# or
|
|
49
|
+
bun add rozod
|
|
50
|
+
# or
|
|
49
51
|
yarn add rozod
|
|
50
52
|
# or
|
|
51
53
|
pnpm add rozod
|
|
@@ -54,15 +56,15 @@ pnpm add rozod
|
|
|
54
56
|
## Quick Start
|
|
55
57
|
|
|
56
58
|
```ts
|
|
57
|
-
import { fetchApi } from 'rozod';
|
|
58
|
-
import {
|
|
59
|
+
import { fetchApi, isAnyErrorResponse } from 'rozod';
|
|
60
|
+
import { getUsersUserid } from 'rozod/lib/endpoints/usersv1';
|
|
59
61
|
|
|
60
62
|
// Fetch user details with full type safety
|
|
61
|
-
const userInfo = await fetchApi(
|
|
63
|
+
const userInfo = await fetchApi(getUsersUserid, { userId: 1 });
|
|
62
64
|
if (isAnyErrorResponse(userInfo)) {
|
|
63
65
|
return;
|
|
64
66
|
}
|
|
65
|
-
console.log(userInfo.
|
|
67
|
+
console.log(userInfo.displayName); // Properly typed!
|
|
66
68
|
```
|
|
67
69
|
|
|
68
70
|
## Usage
|
|
@@ -70,33 +72,38 @@ console.log(userInfo.data[0].displayName); // Properly typed!
|
|
|
70
72
|
### Fetch a Single Request
|
|
71
73
|
|
|
72
74
|
```ts
|
|
73
|
-
import { fetchApi } from 'rozod';
|
|
74
|
-
import { getGamesIcons } from 'rozod/lib/endpoints/
|
|
75
|
+
import { fetchApi, isAnyErrorResponse } from 'rozod';
|
|
76
|
+
import { getGamesIcons } from 'rozod/lib/endpoints/thumbnailsv1';
|
|
75
77
|
|
|
76
78
|
const response = await fetchApi(getGamesIcons, { universeIds: [1534453623, 65241] });
|
|
77
|
-
|
|
79
|
+
if (!isAnyErrorResponse(response)) {
|
|
80
|
+
console.log(response.data);
|
|
81
|
+
}
|
|
78
82
|
```
|
|
79
83
|
|
|
80
84
|
### Handle Paginated Responses
|
|
81
85
|
|
|
82
86
|
```ts
|
|
83
|
-
import { fetchApiPages } from 'rozod';
|
|
87
|
+
import { fetchApiPages, isAnyErrorResponse } from 'rozod';
|
|
84
88
|
import { getGroupsGroupidWallPosts } from 'rozod/lib/endpoints/groupsv2';
|
|
85
89
|
|
|
86
90
|
// Automatically fetches all pages
|
|
87
|
-
const
|
|
88
|
-
|
|
91
|
+
const pages = await fetchApiPages(getGroupsGroupidWallPosts, { groupId: 11479637 });
|
|
92
|
+
if (!isAnyErrorResponse(pages)) {
|
|
93
|
+
console.log(`Fetched ${pages.length} pages of wall posts`);
|
|
94
|
+
}
|
|
89
95
|
```
|
|
90
96
|
|
|
91
97
|
### Process Pages One at a Time
|
|
92
98
|
|
|
93
99
|
```ts
|
|
94
|
-
import { fetchApiPagesGenerator } from 'rozod';
|
|
100
|
+
import { fetchApiPagesGenerator, isAnyErrorResponse } from 'rozod';
|
|
95
101
|
import { getGroupsGroupidWallPosts } from 'rozod/lib/endpoints/groupsv2';
|
|
96
102
|
|
|
97
103
|
// Process pages as they arrive
|
|
98
104
|
const pages = fetchApiPagesGenerator(getGroupsGroupidWallPosts, { groupId: 11479637 });
|
|
99
105
|
for await (const page of pages) {
|
|
106
|
+
if (isAnyErrorResponse(page)) break;
|
|
100
107
|
console.log(`Processing page with ${page.data.length} posts`);
|
|
101
108
|
// Do something with this page
|
|
102
109
|
}
|
|
@@ -106,7 +113,7 @@ for await (const page of pages) {
|
|
|
106
113
|
|
|
107
114
|
```ts
|
|
108
115
|
import { fetchApiSplit } from 'rozod';
|
|
109
|
-
import { getGamesIcons } from 'rozod/lib/endpoints/
|
|
116
|
+
import { getGamesIcons } from 'rozod/lib/endpoints/thumbnailsv1';
|
|
110
117
|
|
|
111
118
|
// Will automatically split into smaller batches of 100 universeIds per request
|
|
112
119
|
const data = await fetchApiSplit(
|
|
@@ -123,7 +130,7 @@ By default, requests return either the success type or a simple `AnyError`. Use
|
|
|
123
130
|
|
|
124
131
|
```ts
|
|
125
132
|
import { fetchApi, isAnyErrorResponse } from 'rozod';
|
|
126
|
-
import { getGamesIcons } from 'rozod/lib/endpoints/
|
|
133
|
+
import { getGamesIcons } from 'rozod/lib/endpoints/thumbnailsv1';
|
|
127
134
|
|
|
128
135
|
const res = await fetchApi(getGamesIcons, { universeIds: [1534453623] });
|
|
129
136
|
if (isAnyErrorResponse(res)) {
|
|
@@ -156,7 +163,7 @@ const json = await resp.json();
|
|
|
156
163
|
RoZod supports Roblox's newer OpenCloud APIs with the same easy interface:
|
|
157
164
|
|
|
158
165
|
```ts
|
|
159
|
-
import { fetchApi } from 'rozod';
|
|
166
|
+
import { fetchApi, isAnyErrorResponse } from 'rozod';
|
|
160
167
|
import { v2 } from 'rozod/lib/opencloud';
|
|
161
168
|
|
|
162
169
|
// Get universe details through OpenCloud
|
|
@@ -164,9 +171,11 @@ const universeInfo = await fetchApi(v2.getCloudV2UniversesUniverseId, {
|
|
|
164
171
|
universe_id: '123456789',
|
|
165
172
|
});
|
|
166
173
|
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
console.log(universeInfo.
|
|
174
|
+
if (!isAnyErrorResponse(universeInfo)) {
|
|
175
|
+
// Access typed properties
|
|
176
|
+
console.log(universeInfo.displayName);
|
|
177
|
+
console.log(universeInfo.description);
|
|
178
|
+
}
|
|
170
179
|
```
|
|
171
180
|
|
|
172
181
|
### Access DataStores via OpenCloud
|
|
@@ -192,10 +201,10 @@ In browsers, authentication works automatically when users are logged into Roblo
|
|
|
192
201
|
|
|
193
202
|
```ts
|
|
194
203
|
import { fetchApi } from 'rozod';
|
|
195
|
-
import {
|
|
204
|
+
import { getUsersUserid } from 'rozod/lib/endpoints/usersv1';
|
|
196
205
|
|
|
197
206
|
// Cookies are sent automatically - no setup required!
|
|
198
|
-
const userInfo = await fetchApi(
|
|
207
|
+
const userInfo = await fetchApi(getUsersUserid, { userId: 123456 });
|
|
199
208
|
```
|
|
200
209
|
|
|
201
210
|
### Server Environments (Node.js/Bun/Deno)
|
|
@@ -204,13 +213,13 @@ For server environments, use `configureServer()` to set up authentication once:
|
|
|
204
213
|
|
|
205
214
|
```ts
|
|
206
215
|
import { configureServer, fetchApi } from 'rozod';
|
|
207
|
-
import {
|
|
216
|
+
import { getUsersUserid } from 'rozod/lib/endpoints/usersv1';
|
|
208
217
|
|
|
209
218
|
// Configure once at startup
|
|
210
219
|
configureServer({ cookies: 'your_roblosecurity_cookie_here' });
|
|
211
220
|
|
|
212
221
|
// All subsequent requests automatically include the cookie
|
|
213
|
-
const userInfo = await fetchApi(
|
|
222
|
+
const userInfo = await fetchApi(getUsersUserid, { userId: 123456 });
|
|
214
223
|
```
|
|
215
224
|
|
|
216
225
|
#### Multiple Accounts (Cookie Pool)
|
|
@@ -273,7 +282,7 @@ configureServer({ cookies: '...', userAgents: [] });
|
|
|
273
282
|
For OpenCloud endpoints (`apis.roblox.com`), set your API key once:
|
|
274
283
|
|
|
275
284
|
```ts
|
|
276
|
-
import { configureServer } from 'rozod';
|
|
285
|
+
import { configureServer, fetchApi } from 'rozod';
|
|
277
286
|
import { v2 } from 'rozod/lib/opencloud';
|
|
278
287
|
|
|
279
288
|
// Configure OpenCloud API key
|
|
@@ -315,8 +324,8 @@ You can still pass headers manually per-request if needed:
|
|
|
315
324
|
|
|
316
325
|
```ts
|
|
317
326
|
const userInfo = await fetchApi(
|
|
318
|
-
|
|
319
|
-
{
|
|
327
|
+
getUsersUserid,
|
|
328
|
+
{ userId: 123456 },
|
|
320
329
|
{
|
|
321
330
|
headers: {
|
|
322
331
|
'Cookie': '.ROBLOSECURITY=your_cookie_here'
|
|
@@ -408,37 +417,6 @@ const keyPair = await crypto.subtle.generateKey(
|
|
|
408
417
|
changeHBAKeys(keyPair);
|
|
409
418
|
```
|
|
410
419
|
|
|
411
|
-
### OpenCloud Authentication
|
|
412
|
-
|
|
413
|
-
OpenCloud APIs require API keys. Use `configureServer()` for automatic injection:
|
|
414
|
-
|
|
415
|
-
```ts
|
|
416
|
-
import { configureServer, fetchApi } from 'rozod';
|
|
417
|
-
import { v2 } from 'rozod/lib/opencloud';
|
|
418
|
-
|
|
419
|
-
// Configure once at startup
|
|
420
|
-
configureServer({ cloudKey: 'your_opencloud_api_key_here' });
|
|
421
|
-
|
|
422
|
-
// All OpenCloud requests automatically include x-api-key
|
|
423
|
-
const universeInfo = await fetchApi(v2.getCloudV2UniversesUniverseId, {
|
|
424
|
-
universe_id: '123456789',
|
|
425
|
-
});
|
|
426
|
-
```
|
|
427
|
-
|
|
428
|
-
Or pass headers manually per-request:
|
|
429
|
-
|
|
430
|
-
```ts
|
|
431
|
-
const universeInfo = await fetchApi(
|
|
432
|
-
v2.getCloudV2UniversesUniverseId,
|
|
433
|
-
{ universe_id: '123456789' },
|
|
434
|
-
{
|
|
435
|
-
headers: {
|
|
436
|
-
'x-api-key': 'your_opencloud_api_key_here'
|
|
437
|
-
}
|
|
438
|
-
}
|
|
439
|
-
);
|
|
440
|
-
```
|
|
441
|
-
|
|
442
420
|
## Custom Endpoints
|
|
443
421
|
|
|
444
422
|
You can define custom endpoints for your specific needs:
|
|
@@ -217,6 +217,7 @@ const Roblox_Catalog_Api_CatalogSearchDetailedResponseItem = z.object({
|
|
|
217
217
|
z.literal(88),
|
|
218
218
|
z.literal(89),
|
|
219
219
|
z.literal(90),
|
|
220
|
+
z.literal(91),
|
|
220
221
|
]),
|
|
221
222
|
bundleType: z.union([z.literal(1), z.literal(2), z.literal(3), z.literal(4)]),
|
|
222
223
|
isRecolorable: z.boolean(),
|
|
@@ -400,6 +401,7 @@ const Roblox_Catalog_Api_CatalogSearchDetailedResponseItemV2 = z.object({
|
|
|
400
401
|
z.literal(88),
|
|
401
402
|
z.literal(89),
|
|
402
403
|
z.literal(90),
|
|
404
|
+
z.literal(91),
|
|
403
405
|
]),
|
|
404
406
|
bundleType: z.union([z.literal(1), z.literal(2), z.literal(3), z.literal(4)]),
|
|
405
407
|
isRecolorable: z.boolean(),
|
|
@@ -217,6 +217,7 @@ const Roblox_Catalog_Api_CatalogSearchDetailedResponseItem = zod_1.z.object({
|
|
|
217
217
|
zod_1.z.literal(88),
|
|
218
218
|
zod_1.z.literal(89),
|
|
219
219
|
zod_1.z.literal(90),
|
|
220
|
+
zod_1.z.literal(91),
|
|
220
221
|
]),
|
|
221
222
|
bundleType: zod_1.z.union([zod_1.z.literal(1), zod_1.z.literal(2), zod_1.z.literal(3), zod_1.z.literal(4)]),
|
|
222
223
|
isRecolorable: zod_1.z.boolean(),
|
|
@@ -396,6 +397,7 @@ const Roblox_Catalog_Api_CatalogSearchDetailedResponseItemV2 = zod_1.z.object({
|
|
|
396
397
|
zod_1.z.literal(88),
|
|
397
398
|
zod_1.z.literal(89),
|
|
398
399
|
zod_1.z.literal(90),
|
|
400
|
+
zod_1.z.literal(91),
|
|
399
401
|
]),
|
|
400
402
|
bundleType: zod_1.z.union([zod_1.z.literal(1), zod_1.z.literal(2), zod_1.z.literal(3), zod_1.z.literal(4)]),
|
|
401
403
|
isRecolorable: zod_1.z.boolean(),
|
|
@@ -118,6 +118,7 @@ const Roblox_Catalog_Api_CatalogSearchDetailedResponseItemV2 = z.object({
|
|
|
118
118
|
z.literal(88),
|
|
119
119
|
z.literal(89),
|
|
120
120
|
z.literal(90),
|
|
121
|
+
z.literal(91),
|
|
121
122
|
]),
|
|
122
123
|
bundleType: z.union([z.literal(1), z.literal(2), z.literal(3), z.literal(4)]),
|
|
123
124
|
isRecolorable: z.boolean(),
|
|
@@ -120,6 +120,7 @@ const Roblox_Catalog_Api_CatalogSearchDetailedResponseItemV2 = zod_1.z.object({
|
|
|
120
120
|
zod_1.z.literal(88),
|
|
121
121
|
zod_1.z.literal(89),
|
|
122
122
|
zod_1.z.literal(90),
|
|
123
|
+
zod_1.z.literal(91),
|
|
123
124
|
]),
|
|
124
125
|
bundleType: zod_1.z.union([zod_1.z.literal(1), zod_1.z.literal(2), zod_1.z.literal(3), zod_1.z.literal(4)]),
|
|
125
126
|
isRecolorable: zod_1.z.boolean(),
|
|
@@ -29,6 +29,7 @@ const Roblox_Friends_Api_FriendRequest = z.object({
|
|
|
29
29
|
"ProfileShare",
|
|
30
30
|
"PhoneContactImporter",
|
|
31
31
|
"FriendRecommendations",
|
|
32
|
+
"UserCommunities",
|
|
32
33
|
]),
|
|
33
34
|
contactName: z.string(),
|
|
34
35
|
senderNickname: z.string(),
|
|
@@ -112,7 +113,6 @@ const Roblox_Friends_Api_Models_Response_UserPresenceResponseModel = z.object({
|
|
|
112
113
|
const Roblox_Friends_Api_Models_Response_UserPresenceResponse = z.object({
|
|
113
114
|
userPresence: Roblox_Friends_Api_Models_Response_UserPresenceResponseModel,
|
|
114
115
|
sortScore: z.number(),
|
|
115
|
-
loggingJoinKey: z.string(),
|
|
116
116
|
id: z.number().int(),
|
|
117
117
|
name: z.string(),
|
|
118
118
|
displayName: z.string(),
|
|
@@ -178,6 +178,7 @@ const Roblox_Friends_Api_FriendshipRequestModel = z.object({
|
|
|
178
178
|
"ProfileShare",
|
|
179
179
|
"PhoneContactImporter",
|
|
180
180
|
"FriendRecommendations",
|
|
181
|
+
"UserCommunities",
|
|
181
182
|
]),
|
|
182
183
|
senderNickname: z.string(),
|
|
183
184
|
});
|
|
@@ -317,6 +318,7 @@ export const postMyFriendsRefreshQrSession = endpoint({
|
|
|
317
318
|
* @summary Get all users that friend requests with targetUserId using exclusive start paging
|
|
318
319
|
* @param limit The number of results per request.
|
|
319
320
|
* @param cursor The paging cursor for the previous or next page.
|
|
321
|
+
* @param sessionId Optional session identifier.
|
|
320
322
|
* @param friendRequestSort
|
|
321
323
|
*/
|
|
322
324
|
export const getMyFriendsRequests = endpoint({
|
|
@@ -333,6 +335,10 @@ export const getMyFriendsRequests = endpoint({
|
|
|
333
335
|
style: "form",
|
|
334
336
|
explode: true,
|
|
335
337
|
},
|
|
338
|
+
sessionId: {
|
|
339
|
+
style: "form",
|
|
340
|
+
explode: true,
|
|
341
|
+
},
|
|
336
342
|
friendRequestSort: {
|
|
337
343
|
style: "form",
|
|
338
344
|
explode: true,
|
|
@@ -341,6 +347,7 @@ export const getMyFriendsRequests = endpoint({
|
|
|
341
347
|
parameters: {
|
|
342
348
|
limit: z.number().int().optional().default(10),
|
|
343
349
|
cursor: z.string().optional(),
|
|
350
|
+
sessionId: z.string().optional(),
|
|
344
351
|
friendRequestSort: z
|
|
345
352
|
.union([z.literal(0), z.literal(1), z.literal(2)])
|
|
346
353
|
.optional()
|
|
@@ -405,6 +412,23 @@ export const getMyNewFriendRequestsCount = endpoint({
|
|
|
405
412
|
},
|
|
406
413
|
],
|
|
407
414
|
});
|
|
415
|
+
/**
|
|
416
|
+
* @api GET https://friends.roblox.com/v1/my/trusted-friends/count
|
|
417
|
+
* @summary Get the number of trusted friends a user has
|
|
418
|
+
*/
|
|
419
|
+
export const getMyTrustedFriendsCount = endpoint({
|
|
420
|
+
method: "GET",
|
|
421
|
+
path: "/v1/my/trusted-friends/count",
|
|
422
|
+
baseUrl: "https://friends.roblox.com",
|
|
423
|
+
requestFormat: "json",
|
|
424
|
+
response: z.object({ count: z.number().int() }),
|
|
425
|
+
errors: [
|
|
426
|
+
{
|
|
427
|
+
status: 401,
|
|
428
|
+
description: `0: Authorization has been denied for this request.`,
|
|
429
|
+
},
|
|
430
|
+
],
|
|
431
|
+
});
|
|
408
432
|
/**
|
|
409
433
|
* @api POST https://friends.roblox.com/v1/user/:userId/multiget-are-friends
|
|
410
434
|
* @summary Check if the requesting user is friends with the specified users.
|
|
@@ -1249,6 +1273,32 @@ export const getUsersUseridFriendsStatuses = endpoint({
|
|
|
1249
1273
|
},
|
|
1250
1274
|
],
|
|
1251
1275
|
});
|
|
1276
|
+
/**
|
|
1277
|
+
* @api GET https://friends.roblox.com/v1/users/:userId/trusted-friends/count
|
|
1278
|
+
* @summary Get the number of trusted friends a user has
|
|
1279
|
+
* @param userId
|
|
1280
|
+
*/
|
|
1281
|
+
export const getUsersUseridTrustedFriendsCount = endpoint({
|
|
1282
|
+
method: "GET",
|
|
1283
|
+
path: "/v1/users/:userId/trusted-friends/count",
|
|
1284
|
+
baseUrl: "https://friends.roblox.com",
|
|
1285
|
+
requestFormat: "json",
|
|
1286
|
+
serializationMethod: {
|
|
1287
|
+
userId: {
|
|
1288
|
+
style: "simple",
|
|
1289
|
+
},
|
|
1290
|
+
},
|
|
1291
|
+
parameters: {
|
|
1292
|
+
userId: z.number().int(),
|
|
1293
|
+
},
|
|
1294
|
+
response: z.object({ count: z.number().int() }),
|
|
1295
|
+
errors: [
|
|
1296
|
+
{
|
|
1297
|
+
status: 401,
|
|
1298
|
+
description: `0: Authorization has been denied for this request.`,
|
|
1299
|
+
},
|
|
1300
|
+
],
|
|
1301
|
+
});
|
|
1252
1302
|
|
|
1253
1303
|
// Patched endpoints removed from Roblox API docs (v6.1.0 compat)
|
|
1254
1304
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getUserUseridMultigetAreTrustedFriends = exports.getMyTrustedFriendsUseridStatus = exports.getUsersUseridFriendsStatuses = exports.getUsersUseridFriendsSearch = exports.getUsersUseridFriendsOnline = exports.getUsersUseridFriendsInactive = exports.getUsersUseridFriendsFind = exports.getUsersUseridFriendsCount = exports.getUsersUseridFriends = exports.postUsersTargetuseridUnfriend = exports.postUsersTargetuseridUnfollow = exports.postUsersTargetuseridRequestFriendship = exports.getUsersTargetuseridFollowingsCount = exports.getUsersTargetuseridFollowings = exports.getUsersTargetuseridFollowersCount = exports.getUsersTargetuseridFollowers = exports.postUsersTargetuseridFollow = exports.postUsersSenderuseridAcceptFriendRequestWithToken = exports.postUsersRequesteruseridDeclineFriendRequest = exports.postUsersRequesteruseridAcceptFriendRequest = exports.postUserFriendRequestsDeclineAll = exports.getUserFriendRequestsCount = exports.postUserFollowingExists = exports.postUserUseridMultigetAreFriends = exports.getMyNewFriendRequestsCount = exports.deleteMyNewFriendRequests = exports.getMyFriendsRequests = exports.postMyFriendsRefreshQrSession = exports.getMyFriendsCount = exports.getMyFriendsUseridCheckQrSession = exports.getMetadata = exports.postContactsTargetcontactidRequestFriendship = void 0;
|
|
3
|
+
exports.getUserUseridMultigetAreTrustedFriends = exports.getMyTrustedFriendsUseridStatus = exports.getUsersUseridTrustedFriendsCount = exports.getUsersUseridFriendsStatuses = exports.getUsersUseridFriendsSearch = exports.getUsersUseridFriendsOnline = exports.getUsersUseridFriendsInactive = exports.getUsersUseridFriendsFind = exports.getUsersUseridFriendsCount = exports.getUsersUseridFriends = exports.postUsersTargetuseridUnfriend = exports.postUsersTargetuseridUnfollow = exports.postUsersTargetuseridRequestFriendship = exports.getUsersTargetuseridFollowingsCount = exports.getUsersTargetuseridFollowings = exports.getUsersTargetuseridFollowersCount = exports.getUsersTargetuseridFollowers = exports.postUsersTargetuseridFollow = exports.postUsersSenderuseridAcceptFriendRequestWithToken = exports.postUsersRequesteruseridDeclineFriendRequest = exports.postUsersRequesteruseridAcceptFriendRequest = exports.postUserFriendRequestsDeclineAll = exports.getUserFriendRequestsCount = exports.postUserFollowingExists = exports.postUserUseridMultigetAreFriends = exports.getMyTrustedFriendsCount = exports.getMyNewFriendRequestsCount = exports.deleteMyNewFriendRequests = exports.getMyFriendsRequests = exports.postMyFriendsRefreshQrSession = exports.getMyFriendsCount = exports.getMyFriendsUseridCheckQrSession = exports.getMetadata = exports.postContactsTargetcontactidRequestFriendship = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const __1 = require("..");
|
|
6
6
|
const Roblox_Friends_Api_Models_Response_FriendsPageMetadataResponse = zod_1.z.object({
|
|
@@ -29,6 +29,7 @@ const Roblox_Friends_Api_FriendRequest = zod_1.z.object({
|
|
|
29
29
|
'ProfileShare',
|
|
30
30
|
'PhoneContactImporter',
|
|
31
31
|
'FriendRecommendations',
|
|
32
|
+
'UserCommunities',
|
|
32
33
|
]),
|
|
33
34
|
contactName: zod_1.z.string(),
|
|
34
35
|
senderNickname: zod_1.z.string(),
|
|
@@ -103,7 +104,6 @@ const Roblox_Friends_Api_Models_Response_UserPresenceResponseModel = zod_1.z.obj
|
|
|
103
104
|
const Roblox_Friends_Api_Models_Response_UserPresenceResponse = zod_1.z.object({
|
|
104
105
|
userPresence: Roblox_Friends_Api_Models_Response_UserPresenceResponseModel,
|
|
105
106
|
sortScore: zod_1.z.number(),
|
|
106
|
-
loggingJoinKey: zod_1.z.string(),
|
|
107
107
|
id: zod_1.z.number().int(),
|
|
108
108
|
name: zod_1.z.string(),
|
|
109
109
|
displayName: zod_1.z.string(),
|
|
@@ -165,6 +165,7 @@ const Roblox_Friends_Api_FriendshipRequestModel = zod_1.z.object({
|
|
|
165
165
|
'ProfileShare',
|
|
166
166
|
'PhoneContactImporter',
|
|
167
167
|
'FriendRecommendations',
|
|
168
|
+
'UserCommunities',
|
|
168
169
|
]),
|
|
169
170
|
senderNickname: zod_1.z.string(),
|
|
170
171
|
});
|
|
@@ -302,6 +303,7 @@ exports.postMyFriendsRefreshQrSession = (0, __1.endpoint)({
|
|
|
302
303
|
* @summary Get all users that friend requests with targetUserId using exclusive start paging
|
|
303
304
|
* @param limit The number of results per request.
|
|
304
305
|
* @param cursor The paging cursor for the previous or next page.
|
|
306
|
+
* @param sessionId Optional session identifier.
|
|
305
307
|
* @param friendRequestSort
|
|
306
308
|
*/
|
|
307
309
|
exports.getMyFriendsRequests = (0, __1.endpoint)({
|
|
@@ -318,6 +320,10 @@ exports.getMyFriendsRequests = (0, __1.endpoint)({
|
|
|
318
320
|
style: 'form',
|
|
319
321
|
explode: true,
|
|
320
322
|
},
|
|
323
|
+
sessionId: {
|
|
324
|
+
style: 'form',
|
|
325
|
+
explode: true,
|
|
326
|
+
},
|
|
321
327
|
friendRequestSort: {
|
|
322
328
|
style: 'form',
|
|
323
329
|
explode: true,
|
|
@@ -326,6 +332,7 @@ exports.getMyFriendsRequests = (0, __1.endpoint)({
|
|
|
326
332
|
parameters: {
|
|
327
333
|
limit: zod_1.z.number().int().optional().default(10),
|
|
328
334
|
cursor: zod_1.z.string().optional(),
|
|
335
|
+
sessionId: zod_1.z.string().optional(),
|
|
329
336
|
friendRequestSort: zod_1.z
|
|
330
337
|
.union([zod_1.z.literal(0), zod_1.z.literal(1), zod_1.z.literal(2)])
|
|
331
338
|
.optional()
|
|
@@ -389,6 +396,23 @@ exports.getMyNewFriendRequestsCount = (0, __1.endpoint)({
|
|
|
389
396
|
},
|
|
390
397
|
],
|
|
391
398
|
});
|
|
399
|
+
/**
|
|
400
|
+
* @api GET https://friends.roblox.com/v1/my/trusted-friends/count
|
|
401
|
+
* @summary Get the number of trusted friends a user has
|
|
402
|
+
*/
|
|
403
|
+
exports.getMyTrustedFriendsCount = (0, __1.endpoint)({
|
|
404
|
+
method: 'GET',
|
|
405
|
+
path: '/v1/my/trusted-friends/count',
|
|
406
|
+
baseUrl: 'https://friends.roblox.com',
|
|
407
|
+
requestFormat: 'json',
|
|
408
|
+
response: zod_1.z.object({ count: zod_1.z.number().int() }),
|
|
409
|
+
errors: [
|
|
410
|
+
{
|
|
411
|
+
status: 401,
|
|
412
|
+
description: `0: Authorization has been denied for this request.`,
|
|
413
|
+
},
|
|
414
|
+
],
|
|
415
|
+
});
|
|
392
416
|
/**
|
|
393
417
|
* @api POST https://friends.roblox.com/v1/user/:userId/multiget-are-friends
|
|
394
418
|
* @summary Check if the requesting user is friends with the specified users.
|
|
@@ -1213,6 +1237,32 @@ exports.getUsersUseridFriendsStatuses = (0, __1.endpoint)({
|
|
|
1213
1237
|
},
|
|
1214
1238
|
],
|
|
1215
1239
|
});
|
|
1240
|
+
/**
|
|
1241
|
+
* @api GET https://friends.roblox.com/v1/users/:userId/trusted-friends/count
|
|
1242
|
+
* @summary Get the number of trusted friends a user has
|
|
1243
|
+
* @param userId
|
|
1244
|
+
*/
|
|
1245
|
+
exports.getUsersUseridTrustedFriendsCount = (0, __1.endpoint)({
|
|
1246
|
+
method: 'GET',
|
|
1247
|
+
path: '/v1/users/:userId/trusted-friends/count',
|
|
1248
|
+
baseUrl: 'https://friends.roblox.com',
|
|
1249
|
+
requestFormat: 'json',
|
|
1250
|
+
serializationMethod: {
|
|
1251
|
+
userId: {
|
|
1252
|
+
style: 'simple',
|
|
1253
|
+
},
|
|
1254
|
+
},
|
|
1255
|
+
parameters: {
|
|
1256
|
+
userId: zod_1.z.number().int(),
|
|
1257
|
+
},
|
|
1258
|
+
response: zod_1.z.object({ count: zod_1.z.number().int() }),
|
|
1259
|
+
errors: [
|
|
1260
|
+
{
|
|
1261
|
+
status: 401,
|
|
1262
|
+
description: `0: Authorization has been denied for this request.`,
|
|
1263
|
+
},
|
|
1264
|
+
],
|
|
1265
|
+
});
|
|
1216
1266
|
// Patched endpoints removed from Roblox API docs (v6.1.0 compat)
|
|
1217
1267
|
const Patch_TrustedFriendStatusResponse = zod_1.z.object({
|
|
1218
1268
|
status: zod_1.z.union([zod_1.z.literal(0), zod_1.z.literal(1), zod_1.z.literal(2), zod_1.z.literal(3), zod_1.z.literal(4), zod_1.z.literal(5), zod_1.z.literal(6)]),
|
|
@@ -357,6 +357,7 @@ const Roblox_GameLocalization_Client_UserUniverseLocalizationSettingValue =
|
|
|
357
357
|
"SourceOrTranslation",
|
|
358
358
|
]),
|
|
359
359
|
settingTargetId: z.number().int(),
|
|
360
|
+
settingTargetCode: z.string(),
|
|
360
361
|
});
|
|
361
362
|
const Roblox_GameInternationalization_Api_Models_Response_GetUserLocalizationSettingsForUniverseResponse =
|
|
362
363
|
z.object({
|
|
@@ -279,6 +279,7 @@ const Roblox_GameInternationalization_Api_Models_Response_GetPlayerChoiceUnivers
|
|
|
279
279
|
const Roblox_GameLocalization_Client_UserUniverseLocalizationSettingValue = zod_1.z.object({
|
|
280
280
|
settingType: zod_1.z.enum(['LanguageFamily', 'SupportedLocale', 'SourceOrTranslation']),
|
|
281
281
|
settingTargetId: zod_1.z.number().int(),
|
|
282
|
+
settingTargetCode: zod_1.z.string(),
|
|
282
283
|
});
|
|
283
284
|
const Roblox_GameInternationalization_Api_Models_Response_GetUserLocalizationSettingsForUniverseResponse = zod_1.z.object({
|
|
284
285
|
userUniverseLocalizationSettingValue: Roblox_GameLocalization_Client_UserUniverseLocalizationSettingValue,
|