rozod 6.4.0 → 6.4.2
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/lib/endpoints/avatarv2.d.ts +22 -0
- package/lib/endpoints/avatarv2.js +24 -1
- package/lib/endpoints/friendsv1.d.ts +42 -0
- package/lib/endpoints/friendsv1.js +37 -1
- package/lib/endpoints/gamesv1.d.ts +333 -0
- package/lib/endpoints/gamesv1.js +368 -1
- package/lib/endpoints/gamesv2.d.ts +188 -141
- package/lib/endpoints/gamesv2.js +41 -1
- package/lib/endpoints/itemconfigurationv1.d.ts +42 -0
- package/lib/endpoints/itemconfigurationv1.js +39 -1
- package/lib/index.js +18 -4
- package/package.json +1 -1
|
@@ -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_Web_Responses_Games_GameMediaItemResponseV2 = z.object({
|
|
5
5
|
assetTypeId: z.number().int(),
|
|
@@ -11,134 +11,143 @@ const Roblox_Web_Responses_Games_GameMediaItemResponseV2 = z.object({
|
|
|
11
11
|
altText: z.string(),
|
|
12
12
|
videoId: z.string(),
|
|
13
13
|
});
|
|
14
|
-
const Roblox_Web_WebAPI_Models_ApiArrayResponse_Roblox_Web_Responses_Games_GameMediaItemResponseV2_ =
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
14
|
+
const Roblox_Web_WebAPI_Models_ApiArrayResponse_Roblox_Web_Responses_Games_GameMediaItemResponseV2_ =
|
|
15
|
+
z.object({
|
|
16
|
+
data: z.array(Roblox_Web_Responses_Games_GameMediaItemResponseV2),
|
|
17
|
+
});
|
|
18
|
+
const Roblox_Web_Responses_RelatedEntityTypeResponse_Roblox_Platform_Core_CreatorType_ =
|
|
19
|
+
z.object({
|
|
20
|
+
id: z.number().int(),
|
|
21
|
+
type: z.enum(["User", "Group"]),
|
|
22
|
+
name: z.string(),
|
|
23
|
+
});
|
|
24
|
+
const Roblox_Web_Responses_RelatedEntityTypeResponse_Roblox_Platform_Assets_AssetType_ =
|
|
25
|
+
z.object({
|
|
26
|
+
id: z.number().int(),
|
|
27
|
+
type: z.enum([
|
|
28
|
+
"Image",
|
|
29
|
+
"TShirt",
|
|
30
|
+
"Audio",
|
|
31
|
+
"Mesh",
|
|
32
|
+
"Lua",
|
|
33
|
+
"HTML",
|
|
34
|
+
"Text",
|
|
35
|
+
"Hat",
|
|
36
|
+
"Place",
|
|
37
|
+
"Model",
|
|
38
|
+
"Shirt",
|
|
39
|
+
"Pants",
|
|
40
|
+
"Decal",
|
|
41
|
+
"Avatar",
|
|
42
|
+
"Head",
|
|
43
|
+
"Face",
|
|
44
|
+
"Gear",
|
|
45
|
+
"Badge",
|
|
46
|
+
"GroupEmblem",
|
|
47
|
+
"Animation",
|
|
48
|
+
"Arms",
|
|
49
|
+
"Legs",
|
|
50
|
+
"Torso",
|
|
51
|
+
"RightArm",
|
|
52
|
+
"LeftArm",
|
|
53
|
+
"LeftLeg",
|
|
54
|
+
"RightLeg",
|
|
55
|
+
"Package",
|
|
56
|
+
"YouTubeVideo",
|
|
57
|
+
"GamePass",
|
|
58
|
+
"App",
|
|
59
|
+
"Code",
|
|
60
|
+
"Plugin",
|
|
61
|
+
"SolidModel",
|
|
62
|
+
"MeshPart",
|
|
63
|
+
"HairAccessory",
|
|
64
|
+
"FaceAccessory",
|
|
65
|
+
"NeckAccessory",
|
|
66
|
+
"ShoulderAccessory",
|
|
67
|
+
"FrontAccessory",
|
|
68
|
+
"BackAccessory",
|
|
69
|
+
"WaistAccessory",
|
|
70
|
+
"ClimbAnimation",
|
|
71
|
+
"DeathAnimation",
|
|
72
|
+
"FallAnimation",
|
|
73
|
+
"IdleAnimation",
|
|
74
|
+
"JumpAnimation",
|
|
75
|
+
"RunAnimation",
|
|
76
|
+
"SwimAnimation",
|
|
77
|
+
"WalkAnimation",
|
|
78
|
+
"PoseAnimation",
|
|
79
|
+
"LocalizationTableManifest",
|
|
80
|
+
"LocalizationTableTranslation",
|
|
81
|
+
"EmoteAnimation",
|
|
82
|
+
"Video",
|
|
83
|
+
"TexturePack",
|
|
84
|
+
"TShirtAccessory",
|
|
85
|
+
"ShirtAccessory",
|
|
86
|
+
"PantsAccessory",
|
|
87
|
+
"JacketAccessory",
|
|
88
|
+
"SweaterAccessory",
|
|
89
|
+
"ShortsAccessory",
|
|
90
|
+
"LeftShoeAccessory",
|
|
91
|
+
"RightShoeAccessory",
|
|
92
|
+
"DressSkirtAccessory",
|
|
93
|
+
"FontFamily",
|
|
94
|
+
"FontFace",
|
|
95
|
+
"MeshHiddenSurfaceRemoval",
|
|
96
|
+
"EyebrowAccessory",
|
|
97
|
+
"EyelashAccessory",
|
|
98
|
+
"MoodAnimation",
|
|
99
|
+
"DynamicHead",
|
|
100
|
+
"CodeSnippet",
|
|
101
|
+
"AdsVideo",
|
|
102
|
+
"OtaUpdate",
|
|
103
|
+
"Screenshot",
|
|
104
|
+
"RuntimePropertySet",
|
|
105
|
+
"StorePreviewVideo",
|
|
106
|
+
"GamePreviewVideo",
|
|
107
|
+
"CreatorExperienceConfig",
|
|
108
|
+
"FaceMakeup",
|
|
109
|
+
"LipMakeup",
|
|
110
|
+
"EyeMakeup",
|
|
111
|
+
]),
|
|
112
|
+
name: z.string(),
|
|
113
|
+
});
|
|
111
114
|
const Roblox_Web_Responses_Games_GameFavoriteResponseModel = z.object({
|
|
112
115
|
price: z.number().int(),
|
|
113
116
|
id: z.number().int(),
|
|
114
117
|
name: z.string(),
|
|
115
118
|
description: z.string(),
|
|
116
|
-
creator:
|
|
117
|
-
|
|
119
|
+
creator:
|
|
120
|
+
Roblox_Web_Responses_RelatedEntityTypeResponse_Roblox_Platform_Core_CreatorType_,
|
|
121
|
+
rootPlace:
|
|
122
|
+
Roblox_Web_Responses_RelatedEntityTypeResponse_Roblox_Platform_Assets_AssetType_,
|
|
118
123
|
created: z.string().datetime({ offset: true }),
|
|
119
124
|
updated: z.string().datetime({ offset: true }),
|
|
120
125
|
placeVisits: z.number().int(),
|
|
121
126
|
});
|
|
122
|
-
const Roblox_Web_WebAPI_Models_ApiPageResponse_Roblox_Web_Responses_Games_GameFavoriteResponseModel_ =
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
+
const Roblox_Web_WebAPI_Models_ApiPageResponse_Roblox_Web_Responses_Games_GameFavoriteResponseModel_ =
|
|
128
|
+
z.object({
|
|
129
|
+
previousPageCursor: z.string(),
|
|
130
|
+
nextPageCursor: z.string(),
|
|
131
|
+
data: z.array(Roblox_Web_Responses_Games_GameFavoriteResponseModel),
|
|
132
|
+
});
|
|
127
133
|
const Roblox_Web_Responses_Games_GameResponseV2 = z.object({
|
|
128
134
|
id: z.number().int(),
|
|
129
135
|
name: z.string(),
|
|
130
136
|
description: z.string(),
|
|
131
|
-
creator:
|
|
132
|
-
|
|
137
|
+
creator:
|
|
138
|
+
Roblox_Web_Responses_RelatedEntityTypeResponse_Roblox_Platform_Core_CreatorType_,
|
|
139
|
+
rootPlace:
|
|
140
|
+
Roblox_Web_Responses_RelatedEntityTypeResponse_Roblox_Platform_Assets_AssetType_,
|
|
133
141
|
created: z.string().datetime({ offset: true }),
|
|
134
142
|
updated: z.string().datetime({ offset: true }),
|
|
135
143
|
placeVisits: z.number().int(),
|
|
136
144
|
});
|
|
137
|
-
const Roblox_Web_WebAPI_Models_ApiPageResponse_Roblox_Web_Responses_Games_GameResponseV2_ =
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
145
|
+
const Roblox_Web_WebAPI_Models_ApiPageResponse_Roblox_Web_Responses_Games_GameResponseV2_ =
|
|
146
|
+
z.object({
|
|
147
|
+
previousPageCursor: z.string(),
|
|
148
|
+
nextPageCursor: z.string(),
|
|
149
|
+
data: z.array(Roblox_Web_Responses_Games_GameResponseV2),
|
|
150
|
+
});
|
|
142
151
|
|
|
143
152
|
/**
|
|
144
153
|
* @api GET https://games.roblox.com/v2/games/:universeId/media
|
|
@@ -147,16 +156,16 @@ const Roblox_Web_WebAPI_Models_ApiPageResponse_Roblox_Web_Responses_Games_GameRe
|
|
|
147
156
|
* @param fetchAllExperienceRelatedMedia to tell if the API query is to fetch all related media for this experience
|
|
148
157
|
*/
|
|
149
158
|
export const getGamesUniverseidMedia = endpoint({
|
|
150
|
-
method:
|
|
151
|
-
path:
|
|
152
|
-
baseUrl:
|
|
153
|
-
requestFormat:
|
|
159
|
+
method: "GET",
|
|
160
|
+
path: "/v2/games/:universeId/media",
|
|
161
|
+
baseUrl: "https://games.roblox.com",
|
|
162
|
+
requestFormat: "json",
|
|
154
163
|
serializationMethod: {
|
|
155
164
|
universeId: {
|
|
156
|
-
style:
|
|
165
|
+
style: "simple",
|
|
157
166
|
},
|
|
158
167
|
fetchAllExperienceRelatedMedia: {
|
|
159
|
-
style:
|
|
168
|
+
style: "form",
|
|
160
169
|
explode: true,
|
|
161
170
|
},
|
|
162
171
|
},
|
|
@@ -164,7 +173,8 @@ export const getGamesUniverseidMedia = endpoint({
|
|
|
164
173
|
universeId: z.number().int(),
|
|
165
174
|
fetchAllExperienceRelatedMedia: z.boolean().optional(),
|
|
166
175
|
},
|
|
167
|
-
response:
|
|
176
|
+
response:
|
|
177
|
+
Roblox_Web_WebAPI_Models_ApiArrayResponse_Roblox_Web_Responses_Games_GameMediaItemResponseV2_,
|
|
168
178
|
errors: [
|
|
169
179
|
{
|
|
170
180
|
status: 400,
|
|
@@ -186,28 +196,28 @@ export const getGamesUniverseidMedia = endpoint({
|
|
|
186
196
|
* @param sortOrder The order the results are sorted in.
|
|
187
197
|
*/
|
|
188
198
|
export const getUsersUseridFavoriteGames = endpoint({
|
|
189
|
-
method:
|
|
190
|
-
path:
|
|
191
|
-
baseUrl:
|
|
192
|
-
requestFormat:
|
|
199
|
+
method: "GET",
|
|
200
|
+
path: "/v2/users/:userId/favorite/games",
|
|
201
|
+
baseUrl: "https://games.roblox.com",
|
|
202
|
+
requestFormat: "json",
|
|
193
203
|
serializationMethod: {
|
|
194
204
|
userId: {
|
|
195
|
-
style:
|
|
205
|
+
style: "simple",
|
|
196
206
|
},
|
|
197
207
|
accessFilter: {
|
|
198
|
-
style:
|
|
208
|
+
style: "form",
|
|
199
209
|
explode: true,
|
|
200
210
|
},
|
|
201
211
|
limit: {
|
|
202
|
-
style:
|
|
212
|
+
style: "form",
|
|
203
213
|
explode: true,
|
|
204
214
|
},
|
|
205
215
|
cursor: {
|
|
206
|
-
style:
|
|
216
|
+
style: "form",
|
|
207
217
|
explode: true,
|
|
208
218
|
},
|
|
209
219
|
sortOrder: {
|
|
210
|
-
style:
|
|
220
|
+
style: "form",
|
|
211
221
|
explode: true,
|
|
212
222
|
},
|
|
213
223
|
},
|
|
@@ -222,9 +232,10 @@ export const getUsersUseridFavoriteGames = endpoint({
|
|
|
222
232
|
.optional()
|
|
223
233
|
.default(10),
|
|
224
234
|
cursor: z.string().optional(),
|
|
225
|
-
sortOrder: z.enum([
|
|
235
|
+
sortOrder: z.enum(["Asc", "Desc"]).optional().default("Desc"),
|
|
226
236
|
},
|
|
227
|
-
response:
|
|
237
|
+
response:
|
|
238
|
+
Roblox_Web_WebAPI_Models_ApiPageResponse_Roblox_Web_Responses_Games_GameFavoriteResponseModel_,
|
|
228
239
|
errors: [],
|
|
229
240
|
});
|
|
230
241
|
/**
|
|
@@ -237,28 +248,28 @@ export const getUsersUseridFavoriteGames = endpoint({
|
|
|
237
248
|
* @param sortOrder The order the results are sorted in.
|
|
238
249
|
*/
|
|
239
250
|
export const getUsersUseridGames = endpoint({
|
|
240
|
-
method:
|
|
241
|
-
path:
|
|
242
|
-
baseUrl:
|
|
243
|
-
requestFormat:
|
|
251
|
+
method: "GET",
|
|
252
|
+
path: "/v2/users/:userId/games",
|
|
253
|
+
baseUrl: "https://games.roblox.com",
|
|
254
|
+
requestFormat: "json",
|
|
244
255
|
serializationMethod: {
|
|
245
256
|
userId: {
|
|
246
|
-
style:
|
|
257
|
+
style: "simple",
|
|
247
258
|
},
|
|
248
259
|
accessFilter: {
|
|
249
|
-
style:
|
|
260
|
+
style: "form",
|
|
250
261
|
explode: true,
|
|
251
262
|
},
|
|
252
263
|
limit: {
|
|
253
|
-
style:
|
|
264
|
+
style: "form",
|
|
254
265
|
explode: true,
|
|
255
266
|
},
|
|
256
267
|
cursor: {
|
|
257
|
-
style:
|
|
268
|
+
style: "form",
|
|
258
269
|
explode: true,
|
|
259
270
|
},
|
|
260
271
|
sortOrder: {
|
|
261
|
-
style:
|
|
272
|
+
style: "form",
|
|
262
273
|
explode: true,
|
|
263
274
|
},
|
|
264
275
|
},
|
|
@@ -273,10 +284,46 @@ export const getUsersUseridGames = endpoint({
|
|
|
273
284
|
.optional()
|
|
274
285
|
.default(10),
|
|
275
286
|
cursor: z.string().optional(),
|
|
287
|
+
sortOrder: z.enum(["Asc", "Desc"]).optional().default("Asc"),
|
|
288
|
+
},
|
|
289
|
+
response:
|
|
290
|
+
Roblox_Web_WebAPI_Models_ApiPageResponse_Roblox_Web_Responses_Games_GameResponseV2_,
|
|
291
|
+
errors: [],
|
|
292
|
+
});
|
|
293
|
+
|
|
294
|
+
/**
|
|
295
|
+
* @api GET https://games.roblox.com/v2/groups/:groupId/gamesV2
|
|
296
|
+
* @summary Gets games created by the specified group. (gamesV2 path - removed from docs)
|
|
297
|
+
* @param groupId The group Id.
|
|
298
|
+
* @param accessFilter Filtering option via access level.
|
|
299
|
+
* @param limit The number of results per request.
|
|
300
|
+
* @param cursor The paging cursor for the previous or next page.
|
|
301
|
+
* @param sortOrder The order the results are sorted in.
|
|
302
|
+
*/
|
|
303
|
+
export const getGroupsGroupidGamesv2 = endpoint({
|
|
304
|
+
method: 'GET',
|
|
305
|
+
path: '/v2/groups/:groupId/gamesV2',
|
|
306
|
+
baseUrl: 'https://games.roblox.com',
|
|
307
|
+
requestFormat: 'json',
|
|
308
|
+
serializationMethod: {
|
|
309
|
+
groupId: { style: 'simple' },
|
|
310
|
+
accessFilter: { style: 'form', explode: true },
|
|
311
|
+
limit: { style: 'form', explode: true },
|
|
312
|
+
cursor: { style: 'form', explode: true },
|
|
313
|
+
sortOrder: { style: 'form', explode: true },
|
|
314
|
+
},
|
|
315
|
+
parameters: {
|
|
316
|
+
groupId: z.number().int(),
|
|
317
|
+
accessFilter: z.union([z.literal(1), z.literal(2), z.literal(4)]).optional().default(1),
|
|
318
|
+
limit: z.union([z.literal(10), z.literal(25), z.literal(50), z.literal(100)]).optional().default(10),
|
|
319
|
+
cursor: z.string().optional(),
|
|
276
320
|
sortOrder: z.enum(['Asc', 'Desc']).optional().default('Asc'),
|
|
277
321
|
},
|
|
278
322
|
response: Roblox_Web_WebAPI_Models_ApiPageResponse_Roblox_Web_Responses_Games_GameResponseV2_,
|
|
279
|
-
errors: [
|
|
323
|
+
errors: [
|
|
324
|
+
{ status: 500, description: `0: Compliance Context service is unavailable.` },
|
|
325
|
+
{ status: 501, description: `1: Code path is not Implemented.` },
|
|
326
|
+
],
|
|
280
327
|
});
|
|
281
328
|
|
|
282
329
|
/**
|
package/lib/endpoints/gamesv2.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getGroupsGroupidGames = exports.getUsersUseridGames = exports.getUsersUseridFavoriteGames = exports.getGamesUniverseidMedia = void 0;
|
|
3
|
+
exports.getGroupsGroupidGames = exports.getGroupsGroupidGamesv2 = exports.getUsersUseridGames = exports.getUsersUseridFavoriteGames = exports.getGamesUniverseidMedia = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const __1 = require("..");
|
|
6
6
|
const Roblox_Web_Responses_Games_GameMediaItemResponseV2 = zod_1.z.object({
|
|
@@ -279,6 +279,46 @@ exports.getUsersUseridGames = (0, __1.endpoint)({
|
|
|
279
279
|
response: Roblox_Web_WebAPI_Models_ApiPageResponse_Roblox_Web_Responses_Games_GameResponseV2_,
|
|
280
280
|
errors: [],
|
|
281
281
|
});
|
|
282
|
+
/**
|
|
283
|
+
* @api GET https://games.roblox.com/v2/groups/:groupId/gamesV2
|
|
284
|
+
* @summary Gets games created by the specified group. (gamesV2 path - removed from docs)
|
|
285
|
+
* @param groupId The group Id.
|
|
286
|
+
* @param accessFilter Filtering option via access level.
|
|
287
|
+
* @param limit The number of results per request.
|
|
288
|
+
* @param cursor The paging cursor for the previous or next page.
|
|
289
|
+
* @param sortOrder The order the results are sorted in.
|
|
290
|
+
*/
|
|
291
|
+
exports.getGroupsGroupidGamesv2 = (0, __1.endpoint)({
|
|
292
|
+
method: 'GET',
|
|
293
|
+
path: '/v2/groups/:groupId/gamesV2',
|
|
294
|
+
baseUrl: 'https://games.roblox.com',
|
|
295
|
+
requestFormat: 'json',
|
|
296
|
+
serializationMethod: {
|
|
297
|
+
groupId: { style: 'simple' },
|
|
298
|
+
accessFilter: { style: 'form', explode: true },
|
|
299
|
+
limit: { style: 'form', explode: true },
|
|
300
|
+
cursor: { style: 'form', explode: true },
|
|
301
|
+
sortOrder: { style: 'form', explode: true },
|
|
302
|
+
},
|
|
303
|
+
parameters: {
|
|
304
|
+
groupId: zod_1.z.number().int(),
|
|
305
|
+
accessFilter: zod_1.z
|
|
306
|
+
.union([zod_1.z.literal(1), zod_1.z.literal(2), zod_1.z.literal(4)])
|
|
307
|
+
.optional()
|
|
308
|
+
.default(1),
|
|
309
|
+
limit: zod_1.z
|
|
310
|
+
.union([zod_1.z.literal(10), zod_1.z.literal(25), zod_1.z.literal(50), zod_1.z.literal(100)])
|
|
311
|
+
.optional()
|
|
312
|
+
.default(10),
|
|
313
|
+
cursor: zod_1.z.string().optional(),
|
|
314
|
+
sortOrder: zod_1.z.enum(['Asc', 'Desc']).optional().default('Asc'),
|
|
315
|
+
},
|
|
316
|
+
response: Roblox_Web_WebAPI_Models_ApiPageResponse_Roblox_Web_Responses_Games_GameResponseV2_,
|
|
317
|
+
errors: [
|
|
318
|
+
{ status: 500, description: `0: Compliance Context service is unavailable.` },
|
|
319
|
+
{ status: 501, description: `1: Code path is not Implemented.` },
|
|
320
|
+
],
|
|
321
|
+
});
|
|
282
322
|
/**
|
|
283
323
|
* @api GET https://games.roblox.com/v2/groups/:groupId/games
|
|
284
324
|
* @summary Gets games created by the specified group.
|
|
@@ -336,3 +336,45 @@ export const getItemTagsMetadata = endpoint({
|
|
|
336
336
|
},
|
|
337
337
|
],
|
|
338
338
|
});
|
|
339
|
+
|
|
340
|
+
// Patched endpoints removed from Roblox API docs (v6.1.0 compat)
|
|
341
|
+
|
|
342
|
+
const Patch_ApiArrayResponse_TagDetails = z.object({
|
|
343
|
+
data: z.array(Roblox_ItemConfiguration_Api_TagDetails),
|
|
344
|
+
});
|
|
345
|
+
|
|
346
|
+
export const getTags = endpoint({
|
|
347
|
+
method: 'GET',
|
|
348
|
+
path: '/v1/tags',
|
|
349
|
+
baseUrl: 'https://itemconfiguration.roblox.com',
|
|
350
|
+
requestFormat: 'json',
|
|
351
|
+
serializationMethod: { tagIds: { style: 'form' } },
|
|
352
|
+
parameters: { tagIds: z.array(z.string()) },
|
|
353
|
+
response: Patch_ApiArrayResponse_TagDetails,
|
|
354
|
+
errors: [
|
|
355
|
+
{ status: 400, description: `1: No tag Ids requested\n2: Too many tag Ids requested` },
|
|
356
|
+
{ status: 429, description: `3: Too many requests` },
|
|
357
|
+
],
|
|
358
|
+
});
|
|
359
|
+
|
|
360
|
+
export const getTagsPrefixSearch = endpoint({
|
|
361
|
+
method: 'GET',
|
|
362
|
+
path: '/v1/tags/prefix-search',
|
|
363
|
+
baseUrl: 'https://itemconfiguration.roblox.com',
|
|
364
|
+
requestFormat: 'json',
|
|
365
|
+
serializationMethod: {
|
|
366
|
+
prefix: { style: 'form', explode: true },
|
|
367
|
+
numberOfResults: { style: 'form', explode: true },
|
|
368
|
+
},
|
|
369
|
+
parameters: {
|
|
370
|
+
prefix: z.string(),
|
|
371
|
+
numberOfResults: z.number().int(),
|
|
372
|
+
},
|
|
373
|
+
response: Patch_ApiArrayResponse_TagDetails,
|
|
374
|
+
errors: [
|
|
375
|
+
{ status: 400, description: `5: The given prefix is invalid\n6: The number of results requested is invalid` },
|
|
376
|
+
{ status: 401, description: `0: Authorization has been denied for this request.` },
|
|
377
|
+
{ status: 403, description: `4: This endpoint is not yet enabled for the current user` },
|
|
378
|
+
{ status: 429, description: `3: Too many requests` },
|
|
379
|
+
],
|
|
380
|
+
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getItemTagsMetadata = exports.deleteItemTagsItemtagid = exports.postItemTags = exports.getItemTags = exports.getCreationsGetAssets = exports.postCreationsGetAssetDetails = void 0;
|
|
3
|
+
exports.getTagsPrefixSearch = exports.getTags = exports.getItemTagsMetadata = exports.deleteItemTagsItemtagid = exports.postItemTags = exports.getItemTags = exports.getCreationsGetAssets = exports.postCreationsGetAssetDetails = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const __1 = require("..");
|
|
6
6
|
const Roblox_ItemConfiguration_Api_AssetCreationsResponse = zod_1.z.object({
|
|
@@ -330,3 +330,41 @@ exports.getItemTagsMetadata = (0, __1.endpoint)({
|
|
|
330
330
|
},
|
|
331
331
|
],
|
|
332
332
|
});
|
|
333
|
+
// Patched endpoints removed from Roblox API docs (v6.1.0 compat)
|
|
334
|
+
const Patch_ApiArrayResponse_TagDetails = zod_1.z.object({
|
|
335
|
+
data: zod_1.z.array(Roblox_ItemConfiguration_Api_TagDetails),
|
|
336
|
+
});
|
|
337
|
+
exports.getTags = (0, __1.endpoint)({
|
|
338
|
+
method: 'GET',
|
|
339
|
+
path: '/v1/tags',
|
|
340
|
+
baseUrl: 'https://itemconfiguration.roblox.com',
|
|
341
|
+
requestFormat: 'json',
|
|
342
|
+
serializationMethod: { tagIds: { style: 'form' } },
|
|
343
|
+
parameters: { tagIds: zod_1.z.array(zod_1.z.string()) },
|
|
344
|
+
response: Patch_ApiArrayResponse_TagDetails,
|
|
345
|
+
errors: [
|
|
346
|
+
{ status: 400, description: `1: No tag Ids requested\n2: Too many tag Ids requested` },
|
|
347
|
+
{ status: 429, description: `3: Too many requests` },
|
|
348
|
+
],
|
|
349
|
+
});
|
|
350
|
+
exports.getTagsPrefixSearch = (0, __1.endpoint)({
|
|
351
|
+
method: 'GET',
|
|
352
|
+
path: '/v1/tags/prefix-search',
|
|
353
|
+
baseUrl: 'https://itemconfiguration.roblox.com',
|
|
354
|
+
requestFormat: 'json',
|
|
355
|
+
serializationMethod: {
|
|
356
|
+
prefix: { style: 'form', explode: true },
|
|
357
|
+
numberOfResults: { style: 'form', explode: true },
|
|
358
|
+
},
|
|
359
|
+
parameters: {
|
|
360
|
+
prefix: zod_1.z.string(),
|
|
361
|
+
numberOfResults: zod_1.z.number().int(),
|
|
362
|
+
},
|
|
363
|
+
response: Patch_ApiArrayResponse_TagDetails,
|
|
364
|
+
errors: [
|
|
365
|
+
{ status: 400, description: `5: The given prefix is invalid\n6: The number of results requested is invalid` },
|
|
366
|
+
{ status: 401, description: `0: Authorization has been denied for this request.` },
|
|
367
|
+
{ status: 403, description: `4: This endpoint is not yet enabled for the current user` },
|
|
368
|
+
{ status: 429, description: `3: Too many requests` },
|
|
369
|
+
],
|
|
370
|
+
});
|
package/lib/index.js
CHANGED
|
@@ -18,6 +18,7 @@ const zod_1 = require("zod");
|
|
|
18
18
|
const cache_1 = require("./cache");
|
|
19
19
|
const roblox_bat_1 = require("roblox-bat");
|
|
20
20
|
const parse_roblox_errors_1 = require("parse-roblox-errors");
|
|
21
|
+
const ROZOD_ERROR = Symbol.for('rozod.error');
|
|
21
22
|
const endpoint = (endpoint) => {
|
|
22
23
|
return endpoint;
|
|
23
24
|
};
|
|
@@ -779,8 +780,21 @@ async function fetchApi(endpoint, params, requestOptions = {}) {
|
|
|
779
780
|
const contentType = response.headers.get('content-type') ?? '';
|
|
780
781
|
if (contentType.includes('application/json')) {
|
|
781
782
|
const json = await response.json();
|
|
782
|
-
|
|
783
|
-
|
|
783
|
+
if (typeof json?.message === 'string') {
|
|
784
|
+
parsedError = { message: json.message };
|
|
785
|
+
}
|
|
786
|
+
else if (typeof json?.error === 'string') {
|
|
787
|
+
parsedError = { message: json.error };
|
|
788
|
+
}
|
|
789
|
+
else if (typeof json?.error_message === 'string') {
|
|
790
|
+
parsedError = { message: json.error_message };
|
|
791
|
+
}
|
|
792
|
+
else if (typeof json?.detail === 'string') {
|
|
793
|
+
parsedError = { message: json.detail };
|
|
794
|
+
}
|
|
795
|
+
else {
|
|
796
|
+
parsedError = { message: JSON.stringify(json) };
|
|
797
|
+
}
|
|
784
798
|
}
|
|
785
799
|
else {
|
|
786
800
|
const text = await response.text();
|
|
@@ -791,6 +805,7 @@ async function fetchApi(endpoint, params, requestOptions = {}) {
|
|
|
791
805
|
parsedError = { message: response.statusText || `HTTP ${response.status}` };
|
|
792
806
|
}
|
|
793
807
|
}
|
|
808
|
+
parsedError[ROZOD_ERROR] = true;
|
|
794
809
|
if (mergedRequestOptions.throwOnError === true) {
|
|
795
810
|
throw new Error(parsedError.userFacingMessage ?? parsedError.message);
|
|
796
811
|
}
|
|
@@ -813,8 +828,7 @@ async function fetchApi(endpoint, params, requestOptions = {}) {
|
|
|
813
828
|
function isAnyErrorResponse(value) {
|
|
814
829
|
if (!value || typeof value !== 'object' || Array.isArray(value))
|
|
815
830
|
return false;
|
|
816
|
-
|
|
817
|
-
return typeof candidate['message'] === 'string';
|
|
831
|
+
return value[ROZOD_ERROR] === true;
|
|
818
832
|
}
|
|
819
833
|
/**
|
|
820
834
|
* Fetches the data from the given endpoint, but splits the request into multiple requests if the specified parameter is larger than max specified.
|