rozod 6.7.1 → 6.9.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/LICENSE +1 -1
- package/README.md +75 -451
- package/lib/endpoints/accountinformationv1.d.ts +92 -95
- package/lib/endpoints/accountsettingsv1.d.ts +88 -110
- package/lib/endpoints/adconfigurationv2.d.ts +108 -215
- package/lib/endpoints/assetdeliveryv1.d.ts +267 -230
- package/lib/endpoints/assetdeliveryv1.js +38 -0
- package/lib/endpoints/assetdeliveryv2.d.ts +201 -176
- package/lib/endpoints/assetdeliveryv2.js +26 -0
- package/lib/endpoints/authv1.d.ts +480 -517
- package/lib/endpoints/authv1.js +3 -1
- package/lib/endpoints/authv2.d.ts +210 -222
- package/lib/endpoints/authv2.js +1 -1
- package/lib/endpoints/authv3.d.ts +32 -35
- package/lib/endpoints/avatarv1.d.ts +112 -117
- package/lib/endpoints/avatarv2.d.ts +71 -76
- package/lib/endpoints/avatarv3.d.ts +27 -33
- package/lib/endpoints/badgesv1.d.ts +96 -99
- package/lib/endpoints/badgesv1.js +4 -0
- package/lib/endpoints/catalogv1.d.ts +209 -234
- package/lib/endpoints/catalogv1.js +2 -1
- package/lib/endpoints/catalogv2.d.ts +106 -136
- package/lib/endpoints/catalogv2.js +21 -17
- package/lib/endpoints/chatv2.d.ts +778 -778
- package/lib/endpoints/clientsettingsv1.d.ts +33 -35
- package/lib/endpoints/clientsettingsv2.d.ts +62 -68
- package/lib/endpoints/contactsv1.d.ts +18 -20
- package/lib/endpoints/developv1.d.ts +233 -293
- package/lib/endpoints/developv1.js +3 -0
- package/lib/endpoints/developv2.d.ts +87 -138
- package/lib/endpoints/developv2.js +3 -1
- package/lib/endpoints/economycreatorstatsv1.d.ts +12 -12
- package/lib/endpoints/economyv1.d.ts +6 -6
- package/lib/endpoints/engagementpayoutsv1.d.ts +9 -9
- package/lib/endpoints/followingsv1.d.ts +33 -34
- package/lib/endpoints/followingsv2.d.ts +9 -9
- package/lib/endpoints/friendsv1.d.ts +416 -545
- package/lib/endpoints/friendsv1.js +213 -313
- package/lib/endpoints/gameinternationalizationv1.d.ts +1509 -1642
- package/lib/endpoints/gameinternationalizationv2.d.ts +62 -64
- package/lib/endpoints/gamejoinv1.d.ts +458 -458
- package/lib/endpoints/gamesv1.d.ts +183 -143
- package/lib/endpoints/gamesv1.js +2 -0
- package/lib/endpoints/gamesv2.d.ts +161 -158
- package/lib/endpoints/gamesv2.js +9 -0
- package/lib/endpoints/groupsv1.d.ts +967 -976
- package/lib/endpoints/groupsv1.js +48 -4
- package/lib/endpoints/groupsv2.d.ts +259 -277
- package/lib/endpoints/groupsv2.js +1 -0
- package/lib/endpoints/inventoryv1.d.ts +93 -122
- package/lib/endpoints/inventoryv1.js +3 -1
- package/lib/endpoints/inventoryv2.d.ts +163 -178
- package/lib/endpoints/inventoryv2.js +2 -0
- package/lib/endpoints/itemconfigurationv1.d.ts +33 -40
- package/lib/endpoints/localev1.d.ts +47 -48
- package/lib/endpoints/localizationtablesv1.d.ts +315 -353
- package/lib/endpoints/matchmakingv1.d.ts +184 -190
- package/lib/endpoints/metricsv1.d.ts +88 -88
- package/lib/endpoints/notificationsv2.d.ts +144 -158
- package/lib/endpoints/premiumfeaturesv1.d.ts +14 -14
- package/lib/endpoints/presencev1.d.ts +7 -12
- package/lib/endpoints/privatemessagesv1.d.ts +56 -64
- package/lib/endpoints/publishv1.d.ts +32 -32
- package/lib/endpoints/thumbnailsresizerv1.d.ts +52 -53
- package/lib/endpoints/thumbnailsv1.d.ts +317 -361
- package/lib/endpoints/thumbnailsv1.js +25 -0
- package/lib/endpoints/tradesv1.d.ts +92 -104
- package/lib/endpoints/tradesv2.d.ts +81 -84
- package/lib/endpoints/translationrolesv1.d.ts +46 -51
- package/lib/endpoints/twostepverificationv1.d.ts +233 -237
- package/lib/endpoints/usersv1.d.ts +110 -114
- package/lib/index.d.ts +152 -4
- package/lib/index.js +273 -4
- package/lib/opencloud/v1/asset-permissions.d.ts +1 -1
- package/lib/opencloud/v1/assets.d.ts +9 -9
- package/lib/opencloud/v1/datastores-ordered.d.ts +6 -6
- package/lib/opencloud/v1/datastores.d.ts +8 -8
- package/lib/opencloud/v1/developer-products.d.ts +4 -4
- package/lib/opencloud/v1/game-passes.d.ts +4 -4
- package/lib/opencloud/v1/messaging.d.ts +1 -1
- package/lib/opencloud/v1/open-eval.d.ts +2 -2
- package/lib/opencloud/v1/secrets-store.d.ts +5 -5
- package/lib/opencloud/v1/toolbox.d.ts +2 -2
- package/lib/opencloud/v1/universes.d.ts +1 -1
- package/lib/opencloud/v2/cloud.d.ts +172 -84
- package/lib/opencloud/v2/cloud.js +25 -9
- package/package.json +2 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { z } from
|
|
2
|
-
import { endpoint } from
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { endpoint } from '..';
|
|
3
3
|
|
|
4
4
|
const Roblox_Users_Api_BirthdateResponse = z.object({
|
|
5
5
|
birthMonth: z.number().int(),
|
|
@@ -21,7 +21,7 @@ const Roblox_Users_Api_DescriptionRequest = z.object({
|
|
|
21
21
|
});
|
|
22
22
|
const Roblox_Users_Api_GenderResponse = z.object({ gender: z.number().int() });
|
|
23
23
|
const Roblox_Users_Api_GenderRequest = z.object({
|
|
24
|
-
gender: z.enum([
|
|
24
|
+
gender: z.enum(['Unknown', 'Male', 'Female']),
|
|
25
25
|
});
|
|
26
26
|
const Roblox_Users_Api_GetUserResponse = z.object({
|
|
27
27
|
description: z.string(),
|
|
@@ -34,12 +34,11 @@ const Roblox_Users_Api_GetUserResponse = z.object({
|
|
|
34
34
|
displayName: z.string(),
|
|
35
35
|
});
|
|
36
36
|
const Roblox_Users_Api_UsernameHistoryResponse = z.object({ name: z.string() });
|
|
37
|
-
const Roblox_Web_WebAPI_Models_ApiPageResponse_Roblox_Users_Api_UsernameHistoryResponse_ =
|
|
38
|
-
z.
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
});
|
|
37
|
+
const Roblox_Web_WebAPI_Models_ApiPageResponse_Roblox_Users_Api_UsernameHistoryResponse_ = z.object({
|
|
38
|
+
previousPageCursor: z.string(),
|
|
39
|
+
nextPageCursor: z.string(),
|
|
40
|
+
data: z.array(Roblox_Users_Api_UsernameHistoryResponse),
|
|
41
|
+
});
|
|
43
42
|
const Roblox_Users_Api_AuthenticatedGetUserResponse = z.object({
|
|
44
43
|
id: z.number().int(),
|
|
45
44
|
name: z.string(),
|
|
@@ -61,12 +60,11 @@ const Roblox_Users_Api_SearchGetUserResponse = z.object({
|
|
|
61
60
|
name: z.string(),
|
|
62
61
|
displayName: z.string(),
|
|
63
62
|
});
|
|
64
|
-
const Roblox_Web_WebAPI_Models_ApiPageResponse_Roblox_Users_Api_SearchGetUserResponse_ =
|
|
65
|
-
z.
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
});
|
|
63
|
+
const Roblox_Web_WebAPI_Models_ApiPageResponse_Roblox_Users_Api_SearchGetUserResponse_ = z.object({
|
|
64
|
+
previousPageCursor: z.string(),
|
|
65
|
+
nextPageCursor: z.string(),
|
|
66
|
+
data: z.array(Roblox_Users_Api_SearchGetUserResponse),
|
|
67
|
+
});
|
|
70
68
|
const Roblox_Users_Api_MultiGetByUsernameRequest = z.object({
|
|
71
69
|
usernames: z.array(z.string()),
|
|
72
70
|
excludeBannedUsers: z.boolean(),
|
|
@@ -78,8 +76,9 @@ const Roblox_Users_Api_MultiGetUserByNameResponse = z.object({
|
|
|
78
76
|
name: z.string(),
|
|
79
77
|
displayName: z.string(),
|
|
80
78
|
});
|
|
81
|
-
const Roblox_Web_WebAPI_Models_ApiArrayResponse_Roblox_Users_Api_MultiGetUserByNameResponse_ =
|
|
82
|
-
|
|
79
|
+
const Roblox_Web_WebAPI_Models_ApiArrayResponse_Roblox_Users_Api_MultiGetUserByNameResponse_ = z.object({
|
|
80
|
+
data: z.array(Roblox_Users_Api_MultiGetUserByNameResponse),
|
|
81
|
+
});
|
|
83
82
|
const Roblox_Users_Api_MultiGetByUserIdRequest = z.object({
|
|
84
83
|
userIds: z.array(z.number()),
|
|
85
84
|
excludeBannedUsers: z.boolean(),
|
|
@@ -90,8 +89,9 @@ const Roblox_Users_Api_MultiGetUserResponse = z.object({
|
|
|
90
89
|
name: z.string(),
|
|
91
90
|
displayName: z.string(),
|
|
92
91
|
});
|
|
93
|
-
const Roblox_Web_WebAPI_Models_ApiArrayResponse_Roblox_Users_Api_MultiGetUserResponse_ =
|
|
94
|
-
|
|
92
|
+
const Roblox_Web_WebAPI_Models_ApiArrayResponse_Roblox_Users_Api_MultiGetUserResponse_ = z.object({
|
|
93
|
+
data: z.array(Roblox_Users_Api_MultiGetUserResponse),
|
|
94
|
+
});
|
|
95
95
|
const Roblox_Users_Api_SetDisplayNameRequest = z.object({
|
|
96
96
|
newDisplayName: z.string(),
|
|
97
97
|
});
|
|
@@ -101,10 +101,10 @@ const Roblox_Users_Api_SetDisplayNameRequest = z.object({
|
|
|
101
101
|
* @summary Get the user's birthdate
|
|
102
102
|
*/
|
|
103
103
|
export const getBirthdate = endpoint({
|
|
104
|
-
method:
|
|
105
|
-
path:
|
|
106
|
-
baseUrl:
|
|
107
|
-
requestFormat:
|
|
104
|
+
method: 'GET',
|
|
105
|
+
path: '/v1/birthdate',
|
|
106
|
+
baseUrl: 'https://users.roblox.com',
|
|
107
|
+
requestFormat: 'json',
|
|
108
108
|
response: Roblox_Users_Api_BirthdateResponse,
|
|
109
109
|
errors: [
|
|
110
110
|
{
|
|
@@ -123,10 +123,10 @@ export const getBirthdate = endpoint({
|
|
|
123
123
|
* @param body The Roblox.Users.Api.BirthdateRequest
|
|
124
124
|
*/
|
|
125
125
|
export const postBirthdate = endpoint({
|
|
126
|
-
method:
|
|
127
|
-
path:
|
|
128
|
-
baseUrl:
|
|
129
|
-
requestFormat:
|
|
126
|
+
method: 'POST',
|
|
127
|
+
path: '/v1/birthdate',
|
|
128
|
+
baseUrl: 'https://users.roblox.com',
|
|
129
|
+
requestFormat: 'json',
|
|
130
130
|
serializationMethod: {
|
|
131
131
|
body: {},
|
|
132
132
|
},
|
|
@@ -162,10 +162,10 @@ export const postBirthdate = endpoint({
|
|
|
162
162
|
* @summary Get the user's description
|
|
163
163
|
*/
|
|
164
164
|
export const getDescription = endpoint({
|
|
165
|
-
method:
|
|
166
|
-
path:
|
|
167
|
-
baseUrl:
|
|
168
|
-
requestFormat:
|
|
165
|
+
method: 'GET',
|
|
166
|
+
path: '/v1/description',
|
|
167
|
+
baseUrl: 'https://users.roblox.com',
|
|
168
|
+
requestFormat: 'json',
|
|
169
169
|
response: z.object({ description: z.string() }),
|
|
170
170
|
errors: [
|
|
171
171
|
{
|
|
@@ -184,10 +184,10 @@ export const getDescription = endpoint({
|
|
|
184
184
|
* @param body The Roblox.Users.Api.DescriptionRequest
|
|
185
185
|
*/
|
|
186
186
|
export const postDescription = endpoint({
|
|
187
|
-
method:
|
|
188
|
-
path:
|
|
189
|
-
baseUrl:
|
|
190
|
-
requestFormat:
|
|
187
|
+
method: 'POST',
|
|
188
|
+
path: '/v1/description',
|
|
189
|
+
baseUrl: 'https://users.roblox.com',
|
|
190
|
+
requestFormat: 'json',
|
|
191
191
|
serializationMethod: {
|
|
192
192
|
body: {},
|
|
193
193
|
},
|
|
@@ -225,17 +225,17 @@ export const postDescription = endpoint({
|
|
|
225
225
|
* @param birthdate The new user's birthdate
|
|
226
226
|
*/
|
|
227
227
|
export const getDisplayNamesValidate = endpoint({
|
|
228
|
-
method:
|
|
229
|
-
path:
|
|
230
|
-
baseUrl:
|
|
231
|
-
requestFormat:
|
|
228
|
+
method: 'GET',
|
|
229
|
+
path: '/v1/display-names/validate',
|
|
230
|
+
baseUrl: 'https://users.roblox.com',
|
|
231
|
+
requestFormat: 'json',
|
|
232
232
|
serializationMethod: {
|
|
233
233
|
displayName: {
|
|
234
|
-
style:
|
|
234
|
+
style: 'form',
|
|
235
235
|
explode: true,
|
|
236
236
|
},
|
|
237
237
|
birthdate: {
|
|
238
|
-
style:
|
|
238
|
+
style: 'form',
|
|
239
239
|
explode: true,
|
|
240
240
|
},
|
|
241
241
|
},
|
|
@@ -265,10 +265,10 @@ export const getDisplayNamesValidate = endpoint({
|
|
|
265
265
|
* @summary Get the user's gender
|
|
266
266
|
*/
|
|
267
267
|
export const getGender = endpoint({
|
|
268
|
-
method:
|
|
269
|
-
path:
|
|
270
|
-
baseUrl:
|
|
271
|
-
requestFormat:
|
|
268
|
+
method: 'GET',
|
|
269
|
+
path: '/v1/gender',
|
|
270
|
+
baseUrl: 'https://users.roblox.com',
|
|
271
|
+
requestFormat: 'json',
|
|
272
272
|
response: z.object({ gender: z.number().int() }),
|
|
273
273
|
errors: [
|
|
274
274
|
{
|
|
@@ -287,10 +287,10 @@ export const getGender = endpoint({
|
|
|
287
287
|
* @param body The Roblox.Users.Api.GenderRequest
|
|
288
288
|
*/
|
|
289
289
|
export const postGender = endpoint({
|
|
290
|
-
method:
|
|
291
|
-
path:
|
|
292
|
-
baseUrl:
|
|
293
|
-
requestFormat:
|
|
290
|
+
method: 'POST',
|
|
291
|
+
path: '/v1/gender',
|
|
292
|
+
baseUrl: 'https://users.roblox.com',
|
|
293
|
+
requestFormat: 'json',
|
|
294
294
|
serializationMethod: {
|
|
295
295
|
body: {},
|
|
296
296
|
},
|
|
@@ -326,17 +326,16 @@ export const postGender = endpoint({
|
|
|
326
326
|
Does not require X-CSRF-Token protection because this is essentially a get request but as a POST to avoid URI limits.
|
|
327
327
|
*/
|
|
328
328
|
export const postUsernamesUsers = endpoint({
|
|
329
|
-
method:
|
|
330
|
-
path:
|
|
331
|
-
baseUrl:
|
|
332
|
-
requestFormat:
|
|
329
|
+
method: 'POST',
|
|
330
|
+
path: '/v1/usernames/users',
|
|
331
|
+
baseUrl: 'https://users.roblox.com',
|
|
332
|
+
requestFormat: 'json',
|
|
333
333
|
serializationMethod: {
|
|
334
334
|
body: {},
|
|
335
335
|
},
|
|
336
336
|
parameters: {},
|
|
337
337
|
body: Roblox_Users_Api_MultiGetByUsernameRequest,
|
|
338
|
-
response:
|
|
339
|
-
Roblox_Web_WebAPI_Models_ApiArrayResponse_Roblox_Users_Api_MultiGetUserByNameResponse_,
|
|
338
|
+
response: Roblox_Web_WebAPI_Models_ApiArrayResponse_Roblox_Users_Api_MultiGetUserByNameResponse_,
|
|
340
339
|
errors: [
|
|
341
340
|
{
|
|
342
341
|
status: 400,
|
|
@@ -351,17 +350,16 @@ export const postUsernamesUsers = endpoint({
|
|
|
351
350
|
* @description Does not require X-CSRF-Token protection because this is essentially a get request but as a POST to avoid URI limits.
|
|
352
351
|
*/
|
|
353
352
|
export const postUsers = endpoint({
|
|
354
|
-
method:
|
|
355
|
-
path:
|
|
356
|
-
baseUrl:
|
|
357
|
-
requestFormat:
|
|
353
|
+
method: 'POST',
|
|
354
|
+
path: '/v1/users',
|
|
355
|
+
baseUrl: 'https://users.roblox.com',
|
|
356
|
+
requestFormat: 'json',
|
|
358
357
|
serializationMethod: {
|
|
359
358
|
body: {},
|
|
360
359
|
},
|
|
361
360
|
parameters: {},
|
|
362
361
|
body: Roblox_Users_Api_MultiGetByUserIdRequest,
|
|
363
|
-
response:
|
|
364
|
-
Roblox_Web_WebAPI_Models_ApiArrayResponse_Roblox_Users_Api_MultiGetUserResponse_,
|
|
362
|
+
response: Roblox_Web_WebAPI_Models_ApiArrayResponse_Roblox_Users_Api_MultiGetUserResponse_,
|
|
365
363
|
errors: [
|
|
366
364
|
{
|
|
367
365
|
status: 400,
|
|
@@ -375,13 +373,13 @@ export const postUsers = endpoint({
|
|
|
375
373
|
* @param userId The user id.
|
|
376
374
|
*/
|
|
377
375
|
export const getUsersUserid = endpoint({
|
|
378
|
-
method:
|
|
379
|
-
path:
|
|
380
|
-
baseUrl:
|
|
381
|
-
requestFormat:
|
|
376
|
+
method: 'GET',
|
|
377
|
+
path: '/v1/users/:userId',
|
|
378
|
+
baseUrl: 'https://users.roblox.com',
|
|
379
|
+
requestFormat: 'json',
|
|
382
380
|
serializationMethod: {
|
|
383
381
|
userId: {
|
|
384
|
-
style:
|
|
382
|
+
style: 'simple',
|
|
385
383
|
},
|
|
386
384
|
},
|
|
387
385
|
parameters: {
|
|
@@ -402,14 +400,14 @@ export const getUsersUserid = endpoint({
|
|
|
402
400
|
* @param userId the user id
|
|
403
401
|
*/
|
|
404
402
|
export const patchUsersUseridDisplayNames = endpoint({
|
|
405
|
-
method:
|
|
406
|
-
path:
|
|
407
|
-
baseUrl:
|
|
408
|
-
requestFormat:
|
|
403
|
+
method: 'PATCH',
|
|
404
|
+
path: '/v1/users/:userId/display-names',
|
|
405
|
+
baseUrl: 'https://users.roblox.com',
|
|
406
|
+
requestFormat: 'json',
|
|
409
407
|
serializationMethod: {
|
|
410
408
|
body: {},
|
|
411
409
|
userId: {
|
|
412
|
-
style:
|
|
410
|
+
style: 'simple',
|
|
413
411
|
},
|
|
414
412
|
},
|
|
415
413
|
parameters: {
|
|
@@ -448,16 +446,16 @@ export const patchUsersUseridDisplayNames = endpoint({
|
|
|
448
446
|
* @param displayName The display name.
|
|
449
447
|
*/
|
|
450
448
|
export const getUsersUseridDisplayNamesValidate = endpoint({
|
|
451
|
-
method:
|
|
452
|
-
path:
|
|
453
|
-
baseUrl:
|
|
454
|
-
requestFormat:
|
|
449
|
+
method: 'GET',
|
|
450
|
+
path: '/v1/users/:userId/display-names/validate',
|
|
451
|
+
baseUrl: 'https://users.roblox.com',
|
|
452
|
+
requestFormat: 'json',
|
|
455
453
|
serializationMethod: {
|
|
456
454
|
userId: {
|
|
457
|
-
style:
|
|
455
|
+
style: 'simple',
|
|
458
456
|
},
|
|
459
457
|
displayName: {
|
|
460
|
-
style:
|
|
458
|
+
style: 'form',
|
|
461
459
|
explode: true,
|
|
462
460
|
},
|
|
463
461
|
},
|
|
@@ -498,24 +496,24 @@ export const getUsersUseridDisplayNamesValidate = endpoint({
|
|
|
498
496
|
* @param sortOrder The order the results are sorted in.
|
|
499
497
|
*/
|
|
500
498
|
export const getUsersUseridUsernameHistory = endpoint({
|
|
501
|
-
method:
|
|
502
|
-
path:
|
|
503
|
-
baseUrl:
|
|
504
|
-
requestFormat:
|
|
499
|
+
method: 'GET',
|
|
500
|
+
path: '/v1/users/:userId/username-history',
|
|
501
|
+
baseUrl: 'https://users.roblox.com',
|
|
502
|
+
requestFormat: 'json',
|
|
505
503
|
serializationMethod: {
|
|
506
504
|
userId: {
|
|
507
|
-
style:
|
|
505
|
+
style: 'simple',
|
|
508
506
|
},
|
|
509
507
|
limit: {
|
|
510
|
-
style:
|
|
508
|
+
style: 'form',
|
|
511
509
|
explode: true,
|
|
512
510
|
},
|
|
513
511
|
cursor: {
|
|
514
|
-
style:
|
|
512
|
+
style: 'form',
|
|
515
513
|
explode: true,
|
|
516
514
|
},
|
|
517
515
|
sortOrder: {
|
|
518
|
-
style:
|
|
516
|
+
style: 'form',
|
|
519
517
|
explode: true,
|
|
520
518
|
},
|
|
521
519
|
},
|
|
@@ -526,10 +524,9 @@ export const getUsersUseridUsernameHistory = endpoint({
|
|
|
526
524
|
.optional()
|
|
527
525
|
.default(10),
|
|
528
526
|
cursor: z.string().optional(),
|
|
529
|
-
sortOrder: z.enum([
|
|
527
|
+
sortOrder: z.enum(['Asc', 'Desc']).optional().default('Asc'),
|
|
530
528
|
},
|
|
531
|
-
response:
|
|
532
|
-
Roblox_Web_WebAPI_Models_ApiPageResponse_Roblox_Users_Api_UsernameHistoryResponse_,
|
|
529
|
+
response: Roblox_Web_WebAPI_Models_ApiPageResponse_Roblox_Users_Api_UsernameHistoryResponse_,
|
|
533
530
|
errors: [
|
|
534
531
|
{
|
|
535
532
|
status: 400,
|
|
@@ -542,10 +539,10 @@ export const getUsersUseridUsernameHistory = endpoint({
|
|
|
542
539
|
* @summary Gets the minimal authenticated user.
|
|
543
540
|
*/
|
|
544
541
|
export const getUsersAuthenticated = endpoint({
|
|
545
|
-
method:
|
|
546
|
-
path:
|
|
547
|
-
baseUrl:
|
|
548
|
-
requestFormat:
|
|
542
|
+
method: 'GET',
|
|
543
|
+
path: '/v1/users/authenticated',
|
|
544
|
+
baseUrl: 'https://users.roblox.com',
|
|
545
|
+
requestFormat: 'json',
|
|
549
546
|
response: Roblox_Users_Api_AuthenticatedGetUserResponse,
|
|
550
547
|
errors: [
|
|
551
548
|
{
|
|
@@ -559,10 +556,10 @@ export const getUsersAuthenticated = endpoint({
|
|
|
559
556
|
* @summary Gets the age bracket of the authenticated user.
|
|
560
557
|
*/
|
|
561
558
|
export const getUsersAuthenticatedAgeBracket = endpoint({
|
|
562
|
-
method:
|
|
563
|
-
path:
|
|
564
|
-
baseUrl:
|
|
565
|
-
requestFormat:
|
|
559
|
+
method: 'GET',
|
|
560
|
+
path: '/v1/users/authenticated/age-bracket',
|
|
561
|
+
baseUrl: 'https://users.roblox.com',
|
|
562
|
+
requestFormat: 'json',
|
|
566
563
|
response: z.object({ ageBracket: z.number().int() }),
|
|
567
564
|
errors: [
|
|
568
565
|
{
|
|
@@ -576,10 +573,10 @@ export const getUsersAuthenticatedAgeBracket = endpoint({
|
|
|
576
573
|
* @summary Gets the country code of the authenticated user.
|
|
577
574
|
*/
|
|
578
575
|
export const getUsersAuthenticatedCountryCode = endpoint({
|
|
579
|
-
method:
|
|
580
|
-
path:
|
|
581
|
-
baseUrl:
|
|
582
|
-
requestFormat:
|
|
576
|
+
method: 'GET',
|
|
577
|
+
path: '/v1/users/authenticated/country-code',
|
|
578
|
+
baseUrl: 'https://users.roblox.com',
|
|
579
|
+
requestFormat: 'json',
|
|
583
580
|
response: z.object({ countryCode: z.string() }),
|
|
584
581
|
errors: [
|
|
585
582
|
{
|
|
@@ -593,10 +590,10 @@ export const getUsersAuthenticatedCountryCode = endpoint({
|
|
|
593
590
|
* @summary Gets the (public) roles of the authenticated user, such as `"Soothsayer"` and `"BetaTester"`.
|
|
594
591
|
*/
|
|
595
592
|
export const getUsersAuthenticatedRoles = endpoint({
|
|
596
|
-
method:
|
|
597
|
-
path:
|
|
598
|
-
baseUrl:
|
|
599
|
-
requestFormat:
|
|
593
|
+
method: 'GET',
|
|
594
|
+
path: '/v1/users/authenticated/roles',
|
|
595
|
+
baseUrl: 'https://users.roblox.com',
|
|
596
|
+
requestFormat: 'json',
|
|
600
597
|
response: Roblox_Users_Api_UserRolesResponse,
|
|
601
598
|
errors: [
|
|
602
599
|
{
|
|
@@ -614,25 +611,25 @@ export const getUsersAuthenticatedRoles = endpoint({
|
|
|
614
611
|
* @param cursor The paging cursor for the previous or next page.
|
|
615
612
|
*/
|
|
616
613
|
export const getUsersSearch = endpoint({
|
|
617
|
-
method:
|
|
618
|
-
path:
|
|
619
|
-
baseUrl:
|
|
620
|
-
requestFormat:
|
|
614
|
+
method: 'GET',
|
|
615
|
+
path: '/v1/users/search',
|
|
616
|
+
baseUrl: 'https://users.roblox.com',
|
|
617
|
+
requestFormat: 'json',
|
|
621
618
|
serializationMethod: {
|
|
622
619
|
keyword: {
|
|
623
|
-
style:
|
|
620
|
+
style: 'form',
|
|
624
621
|
explode: true,
|
|
625
622
|
},
|
|
626
623
|
sessionId: {
|
|
627
|
-
style:
|
|
624
|
+
style: 'form',
|
|
628
625
|
explode: true,
|
|
629
626
|
},
|
|
630
627
|
limit: {
|
|
631
|
-
style:
|
|
628
|
+
style: 'form',
|
|
632
629
|
explode: true,
|
|
633
630
|
},
|
|
634
631
|
cursor: {
|
|
635
|
-
style:
|
|
632
|
+
style: 'form',
|
|
636
633
|
explode: true,
|
|
637
634
|
},
|
|
638
635
|
},
|
|
@@ -645,8 +642,7 @@ export const getUsersSearch = endpoint({
|
|
|
645
642
|
.default(10),
|
|
646
643
|
cursor: z.string().optional(),
|
|
647
644
|
},
|
|
648
|
-
response:
|
|
649
|
-
Roblox_Web_WebAPI_Models_ApiPageResponse_Roblox_Users_Api_SearchGetUserResponse_,
|
|
645
|
+
response: Roblox_Web_WebAPI_Models_ApiPageResponse_Roblox_Users_Api_SearchGetUserResponse_,
|
|
650
646
|
errors: [
|
|
651
647
|
{
|
|
652
648
|
status: 400,
|
package/lib/index.d.ts
CHANGED
|
@@ -24,15 +24,22 @@ export type EndpointSchema = EndpointBase & {
|
|
|
24
24
|
parameters?: any;
|
|
25
25
|
body?: any;
|
|
26
26
|
response: any;
|
|
27
|
+
/**
|
|
28
|
+
* For long-running-operation endpoints (response is an `Operation`), the schema of the
|
|
29
|
+
* completed operation's `response` payload. Lets {@link pollOperation}/{@link fetchApiOperation}
|
|
30
|
+
* validate and type the result without an explicit schema. Populated by codegen.
|
|
31
|
+
*/
|
|
32
|
+
resultResponse?: any;
|
|
27
33
|
};
|
|
28
34
|
/**
|
|
29
35
|
* This is a hack to allow us to show the parameters and response types of an endpoint
|
|
30
36
|
* as the inferred types of the parameters and response properties.
|
|
31
37
|
*/
|
|
32
|
-
export type EndpointGeneric<T, U, E> = EndpointBase & {
|
|
38
|
+
export type EndpointGeneric<T, U, E, RR = undefined> = EndpointBase & {
|
|
33
39
|
parameters?: T;
|
|
34
40
|
body?: E;
|
|
35
41
|
response: U;
|
|
42
|
+
resultResponse?: RR;
|
|
36
43
|
};
|
|
37
44
|
type InferZodObjectOptional<T extends z.ZodRawShape> = {
|
|
38
45
|
[K in keyof T]: T[K] extends z.ZodOptional<any> | z.ZodDefault<any> ? K : never;
|
|
@@ -48,7 +55,7 @@ type InferNonEmpty<T extends Record<string, z.Schema<any>>> = Merge<{
|
|
|
48
55
|
}, {
|
|
49
56
|
[K in InferZodObjectOptional<T>]?: z.infer<T[K]>;
|
|
50
57
|
}>;
|
|
51
|
-
declare const endpoint: <T extends Record<string, z.Schema<any>>, U extends z.ZodTypeAny, E extends z.ZodTypeAny | undefined = undefined>(endpoint: EndpointGeneric<T, U, E>) => EndpointGeneric<InferNonEmpty<T>, z.infer<U>, E extends z.ZodTypeAny ? z.infer<E> : undefined>;
|
|
58
|
+
declare const endpoint: <T extends Record<string, z.Schema<any>>, U extends z.ZodTypeAny, E extends z.ZodTypeAny | undefined = undefined, RR extends z.ZodTypeAny | undefined = undefined>(endpoint: EndpointGeneric<T, U, E, RR>) => EndpointGeneric<InferNonEmpty<T>, z.infer<U>, E extends z.ZodTypeAny ? z.infer<E> : undefined, RR extends z.ZodTypeAny ? z.infer<RR> : undefined>;
|
|
52
59
|
type IsExactlyUndefined<T> = [T] extends [undefined] ? ([undefined] extends [T] ? true : false) : false;
|
|
53
60
|
type ExtractParams<S extends EndpointGeneric<any, any, any>> = S['parameters'] extends undefined ? IsExactlyUndefined<S['body']> extends true ? undefined : {
|
|
54
61
|
body: S['body'];
|
|
@@ -56,6 +63,7 @@ type ExtractParams<S extends EndpointGeneric<any, any, any>> = S['parameters'] e
|
|
|
56
63
|
body: S['body'];
|
|
57
64
|
};
|
|
58
65
|
type ExtractResponse<S extends EndpointGeneric<any, any, any>> = S['response'];
|
|
66
|
+
type ExtractOperationResult<S extends EndpointSchema> = [S['resultResponse']] extends [undefined] ? unknown : NonNullable<S['resultResponse']>;
|
|
59
67
|
type RetryOptions = {
|
|
60
68
|
retries?: number;
|
|
61
69
|
retryDelay?: number;
|
|
@@ -71,7 +79,38 @@ type CacheOptions = {
|
|
|
71
79
|
type RequestOptions<R = boolean> = RequestInit & RetryOptions & ErrorOptions & CacheOptions & {
|
|
72
80
|
returnRaw?: R;
|
|
73
81
|
};
|
|
74
|
-
|
|
82
|
+
type TokenMetadata = Awaited<ReturnType<HBAClient['getTokenMetadata']>>;
|
|
83
|
+
/**
|
|
84
|
+
* HBAClient hardened for server (Node/Bun) usage:
|
|
85
|
+
*
|
|
86
|
+
* - `generateBaseHeaders` short-circuits when no crypto key source exists
|
|
87
|
+
* (no supplied key pair and no IndexedDB): a BAT can never be signed, so
|
|
88
|
+
* the token metadata page must not be fetched at all.
|
|
89
|
+
* - `getTokenMetadata` remembers failed lookups for a TTL. The base class
|
|
90
|
+
* only caches successes, so an unparseable metadata page (e.g. a bot
|
|
91
|
+
* challenge served to a datacenter IP) would otherwise be refetched on
|
|
92
|
+
* every request — unbounded network and memory churn on hot paths.
|
|
93
|
+
* - The metadata page fetch is bounded by a timeout and sent with the
|
|
94
|
+
* configured server user agent instead of the runtime default, which is
|
|
95
|
+
* far more likely to receive a challenge page.
|
|
96
|
+
*/
|
|
97
|
+
declare class ServerSafeHBAClient extends HBAClient {
|
|
98
|
+
private metadataFailureAt;
|
|
99
|
+
private metadataInFlight?;
|
|
100
|
+
private readonly metadataSource?;
|
|
101
|
+
constructor(props?: ConstructorParameters<typeof HBAClient>[0] & {
|
|
102
|
+
metadataSource?: ServerSafeHBAClient;
|
|
103
|
+
});
|
|
104
|
+
/**
|
|
105
|
+
* Forget a remembered metadata failure so the next lookup retries
|
|
106
|
+
* immediately. Called when HBA keys are (re)configured — a lookup that
|
|
107
|
+
* failed under the old configuration says nothing about the new one.
|
|
108
|
+
*/
|
|
109
|
+
resetMetadataFailure(): void;
|
|
110
|
+
generateBaseHeaders(requestUrl: string | URL, requestMethod?: string, includeCredentials?: boolean, body?: unknown): Promise<Record<string, string>>;
|
|
111
|
+
getTokenMetadata(uncached?: boolean): Promise<TokenMetadata>;
|
|
112
|
+
}
|
|
113
|
+
export declare const hbaClient: ServerSafeHBAClient;
|
|
75
114
|
export type PoolRotation = 'none' | 'random' | 'round-robin';
|
|
76
115
|
/**
|
|
77
116
|
* Event data passed to the cookie refresh callback when Roblox rotates a cookie.
|
|
@@ -157,6 +196,26 @@ export type ServerConfig = {
|
|
|
157
196
|
* ```
|
|
158
197
|
*/
|
|
159
198
|
onCookieRefresh?: CookieRefreshCallback;
|
|
199
|
+
/**
|
|
200
|
+
* ECDSA P-256 key pair(s) used to sign hardware-backed auth (BAT) tokens.
|
|
201
|
+
* Keys are bound to a session: Roblox validates signatures against the
|
|
202
|
+
* public key registered when the cookie's session was authenticated, so a
|
|
203
|
+
* freshly generated pair produces invalid tokens. Without keys, BAT
|
|
204
|
+
* generation is skipped entirely on the server (there is no IndexedDB to
|
|
205
|
+
* load browser-registered keys from).
|
|
206
|
+
*
|
|
207
|
+
* Pass an array to bind keys per cookie: entries align index-for-index
|
|
208
|
+
* with the `cookies` array (lengths must match), and `null` entries mark
|
|
209
|
+
* cookies whose sessions have no registered key — those requests send no
|
|
210
|
+
* BAT. A single (non-array) pair applies to all requests and is only
|
|
211
|
+
* sensible with a single cookie.
|
|
212
|
+
*
|
|
213
|
+
* Per-cookie keys are bound to the `cookies` array passed in the same
|
|
214
|
+
* call: a later `configureServer` call that omits `hbaKeys` drops them
|
|
215
|
+
* (requests then send no BAT). Re-pass the array together with the
|
|
216
|
+
* cookies whenever you reconfigure.
|
|
217
|
+
*/
|
|
218
|
+
hbaKeys?: CryptoKeyPair | Array<CryptoKeyPair | null>;
|
|
160
219
|
};
|
|
161
220
|
/**
|
|
162
221
|
* Configures RoZod for server/Node.js environments.
|
|
@@ -288,6 +347,10 @@ export declare function setHandleGenericChallenge(fn: typeof handleGenericChalle
|
|
|
288
347
|
/**
|
|
289
348
|
* Allows you to change the Crypto Key pair used by the internal hardware-based authentication signatures. This should only be used in a NodeJS context.
|
|
290
349
|
*
|
|
350
|
+
* The pair applies to every request: any per-cookie keys configured via
|
|
351
|
+
* `configureServer({ hbaKeys: [...] })` are discarded. To key individual
|
|
352
|
+
* cookies in a pool, use `configureServer` instead.
|
|
353
|
+
*
|
|
291
354
|
* @param keys The crypto key pair.
|
|
292
355
|
*/
|
|
293
356
|
export declare function changeHBAKeys(keys?: CryptoKeyPair): void;
|
|
@@ -386,4 +449,89 @@ declare function fetchApiPages<S extends EndpointSchema>(endpoint: S, initialPar
|
|
|
386
449
|
* ```
|
|
387
450
|
*/
|
|
388
451
|
declare function fetchApiPagesGenerator<S extends EndpointSchema, R extends boolean>(endpoint: S, initialParams: ExtractParams<S>, requestOptions?: RequestOptions<R>, limit?: number): AsyncGenerator<ExtractResponse<S> | AnyError, void, unknown>;
|
|
389
|
-
|
|
452
|
+
/**
|
|
453
|
+
* Roblox Open Cloud long-running operation envelope. Endpoints such as
|
|
454
|
+
* `generateThumbnail` / `generateAsset` return this instead of the final
|
|
455
|
+
* result: `done` is false until the work completes, at which point `response`
|
|
456
|
+
* holds the payload. Fields are optional because the API omits `response`
|
|
457
|
+
* (and sometimes `done`) while the operation is still in progress.
|
|
458
|
+
*/
|
|
459
|
+
export declare const OperationSchema: z.ZodObject<{
|
|
460
|
+
path: z.ZodString;
|
|
461
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
462
|
+
done: z.ZodOptional<z.ZodBoolean>;
|
|
463
|
+
error: z.ZodOptional<z.ZodObject<{
|
|
464
|
+
code: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
|
|
465
|
+
message: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
466
|
+
details: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodAny>>>;
|
|
467
|
+
}, z.core.$strip>>;
|
|
468
|
+
response: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
469
|
+
}, z.core.$strip>;
|
|
470
|
+
export type Operation = z.infer<typeof OperationSchema>;
|
|
471
|
+
/** Minimal shape accepted by {@link pollOperation} — assignable from any generated Operation response. */
|
|
472
|
+
type OperationLike = {
|
|
473
|
+
path: string;
|
|
474
|
+
done?: boolean;
|
|
475
|
+
response?: unknown;
|
|
476
|
+
error?: {
|
|
477
|
+
code?: number;
|
|
478
|
+
message?: string;
|
|
479
|
+
} | null;
|
|
480
|
+
};
|
|
481
|
+
type PollOperationOptions<R extends boolean = false> = {
|
|
482
|
+
/** Delay between polls in milliseconds. Default 1000. */
|
|
483
|
+
interval?: number;
|
|
484
|
+
/** Give up after this many milliseconds and throw. Default 30000. */
|
|
485
|
+
timeout?: number;
|
|
486
|
+
/** Abort the poll early; rejects with the signal's reason. */
|
|
487
|
+
signal?: AbortSignal;
|
|
488
|
+
/** Override the base URL the operation path is resolved against. Defaults to the originating endpoint's `baseUrl`. */
|
|
489
|
+
baseUrl?: string;
|
|
490
|
+
/**
|
|
491
|
+
* Override the API-version prefix inserted between the base URL and the
|
|
492
|
+
* operation path (e.g. `/assets/v1`). By default it is derived from the
|
|
493
|
+
* originating endpoint's path, which works for operations whose path is
|
|
494
|
+
* relative to the endpoint's own version (e.g. `users/123/operations/…`).
|
|
495
|
+
*/
|
|
496
|
+
pathPrefix?: string;
|
|
497
|
+
/** Forwarded to each poll request (headers such as the API key, retries, credentials, …). */
|
|
498
|
+
requestOptions?: RequestOptions<R>;
|
|
499
|
+
};
|
|
500
|
+
/**
|
|
501
|
+
* Polls a Roblox Open Cloud long-running {@link Operation} until it completes,
|
|
502
|
+
* then returns its final `response` payload.
|
|
503
|
+
*
|
|
504
|
+
* Generate-style endpoints (e.g. `getCloudV2UsersUserIdGenerateThumbnail`)
|
|
505
|
+
* return an {@link Operation} rather than the result itself. When the result
|
|
506
|
+
* isn't cached, `done` is false and you must GET the operation's `path` until
|
|
507
|
+
* it flips true. This helper does that, resolving the path against the
|
|
508
|
+
* originating endpoint's base URL and version prefix.
|
|
509
|
+
*
|
|
510
|
+
* The result is validated against `resultSchema` if given; otherwise it falls
|
|
511
|
+
* back to the endpoint's codegen'd `resultResponse` schema (so generated
|
|
512
|
+
* operation endpoints need no explicit schema). With neither, the raw payload
|
|
513
|
+
* is returned as `unknown`.
|
|
514
|
+
*
|
|
515
|
+
* @example
|
|
516
|
+
* // Typed automatically from the endpoint's result schema:
|
|
517
|
+
* const { imageUri } = await pollOperation(getCloudV2UsersUserIdGenerateThumbnail, op);
|
|
518
|
+
* // Or with an explicit schema for custom/unknown payloads:
|
|
519
|
+
* const result = await pollOperation(customEndpoint, op, z.object({ imageUri: z.string() }));
|
|
520
|
+
*/
|
|
521
|
+
declare function pollOperation<S extends EndpointSchema, T extends z.ZodTypeAny>(endpoint: S, operation: OperationLike, resultSchema: T, options?: PollOperationOptions): Promise<z.infer<T>>;
|
|
522
|
+
declare function pollOperation<S extends EndpointSchema>(endpoint: S, operation: OperationLike, options?: PollOperationOptions): Promise<ExtractOperationResult<S>>;
|
|
523
|
+
/**
|
|
524
|
+
* Fires a long-running-operation endpoint and waits for its result in one call —
|
|
525
|
+
* `fetchApi` followed by {@link pollOperation}, using a single endpoint reference.
|
|
526
|
+
*
|
|
527
|
+
* The result is typed from the endpoint's codegen'd `resultResponse` schema when
|
|
528
|
+
* present; pass an explicit `resultSchema` for custom endpoints or to override it.
|
|
529
|
+
*
|
|
530
|
+
* @example
|
|
531
|
+
* const { imageUri } = await fetchApiOperation(getCloudV2UsersUserIdGenerateThumbnail, {
|
|
532
|
+
* user_id: robloxId, shape: 'SQUARE', format: 'PNG',
|
|
533
|
+
* });
|
|
534
|
+
*/
|
|
535
|
+
declare function fetchApiOperation<S extends EndpointSchema, T extends z.ZodTypeAny>(endpoint: S, params: ExtractParams<S>, resultSchema: T, options?: PollOperationOptions): Promise<z.infer<T>>;
|
|
536
|
+
declare function fetchApiOperation<S extends EndpointSchema>(endpoint: S, params: ExtractParams<S>, options?: PollOperationOptions): Promise<ExtractOperationResult<S>>;
|
|
537
|
+
export { fetchApi, fetchApiSplit, fetchApiPages, fetchApiPagesGenerator, pollOperation, fetchApiOperation, ExtractResponse, ExtractParams, endpoint, };
|