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.
@@ -1,5 +1,5 @@
1
- import { z } from 'zod';
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_ = z.object({
15
- data: z.array(Roblox_Web_Responses_Games_GameMediaItemResponseV2),
16
- });
17
- const Roblox_Web_Responses_RelatedEntityTypeResponse_Roblox_Platform_Core_CreatorType_ = z.object({
18
- id: z.number().int(),
19
- type: z.enum(['User', 'Group']),
20
- name: z.string(),
21
- });
22
- const Roblox_Web_Responses_RelatedEntityTypeResponse_Roblox_Platform_Assets_AssetType_ = z.object({
23
- id: z.number().int(),
24
- type: z.enum([
25
- 'Image',
26
- 'TShirt',
27
- 'Audio',
28
- 'Mesh',
29
- 'Lua',
30
- 'HTML',
31
- 'Text',
32
- 'Hat',
33
- 'Place',
34
- 'Model',
35
- 'Shirt',
36
- 'Pants',
37
- 'Decal',
38
- 'Avatar',
39
- 'Head',
40
- 'Face',
41
- 'Gear',
42
- 'Badge',
43
- 'GroupEmblem',
44
- 'Animation',
45
- 'Arms',
46
- 'Legs',
47
- 'Torso',
48
- 'RightArm',
49
- 'LeftArm',
50
- 'LeftLeg',
51
- 'RightLeg',
52
- 'Package',
53
- 'YouTubeVideo',
54
- 'GamePass',
55
- 'App',
56
- 'Code',
57
- 'Plugin',
58
- 'SolidModel',
59
- 'MeshPart',
60
- 'HairAccessory',
61
- 'FaceAccessory',
62
- 'NeckAccessory',
63
- 'ShoulderAccessory',
64
- 'FrontAccessory',
65
- 'BackAccessory',
66
- 'WaistAccessory',
67
- 'ClimbAnimation',
68
- 'DeathAnimation',
69
- 'FallAnimation',
70
- 'IdleAnimation',
71
- 'JumpAnimation',
72
- 'RunAnimation',
73
- 'SwimAnimation',
74
- 'WalkAnimation',
75
- 'PoseAnimation',
76
- 'LocalizationTableManifest',
77
- 'LocalizationTableTranslation',
78
- 'EmoteAnimation',
79
- 'Video',
80
- 'TexturePack',
81
- 'TShirtAccessory',
82
- 'ShirtAccessory',
83
- 'PantsAccessory',
84
- 'JacketAccessory',
85
- 'SweaterAccessory',
86
- 'ShortsAccessory',
87
- 'LeftShoeAccessory',
88
- 'RightShoeAccessory',
89
- 'DressSkirtAccessory',
90
- 'FontFamily',
91
- 'FontFace',
92
- 'MeshHiddenSurfaceRemoval',
93
- 'EyebrowAccessory',
94
- 'EyelashAccessory',
95
- 'MoodAnimation',
96
- 'DynamicHead',
97
- 'CodeSnippet',
98
- 'AdsVideo',
99
- 'OtaUpdate',
100
- 'Screenshot',
101
- 'RuntimePropertySet',
102
- 'StorePreviewVideo',
103
- 'GamePreviewVideo',
104
- 'CreatorExperienceConfig',
105
- 'FaceMakeup',
106
- 'LipMakeup',
107
- 'EyeMakeup',
108
- ]),
109
- name: z.string(),
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: Roblox_Web_Responses_RelatedEntityTypeResponse_Roblox_Platform_Core_CreatorType_,
117
- rootPlace: Roblox_Web_Responses_RelatedEntityTypeResponse_Roblox_Platform_Assets_AssetType_,
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_ = z.object({
123
- previousPageCursor: z.string(),
124
- nextPageCursor: z.string(),
125
- data: z.array(Roblox_Web_Responses_Games_GameFavoriteResponseModel),
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: Roblox_Web_Responses_RelatedEntityTypeResponse_Roblox_Platform_Core_CreatorType_,
132
- rootPlace: Roblox_Web_Responses_RelatedEntityTypeResponse_Roblox_Platform_Assets_AssetType_,
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_ = z.object({
138
- previousPageCursor: z.string(),
139
- nextPageCursor: z.string(),
140
- data: z.array(Roblox_Web_Responses_Games_GameResponseV2),
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: 'GET',
151
- path: '/v2/games/:universeId/media',
152
- baseUrl: 'https://games.roblox.com',
153
- requestFormat: 'json',
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: 'simple',
165
+ style: "simple",
157
166
  },
158
167
  fetchAllExperienceRelatedMedia: {
159
- style: 'form',
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: Roblox_Web_WebAPI_Models_ApiArrayResponse_Roblox_Web_Responses_Games_GameMediaItemResponseV2_,
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: 'GET',
190
- path: '/v2/users/:userId/favorite/games',
191
- baseUrl: 'https://games.roblox.com',
192
- requestFormat: 'json',
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: 'simple',
205
+ style: "simple",
196
206
  },
197
207
  accessFilter: {
198
- style: 'form',
208
+ style: "form",
199
209
  explode: true,
200
210
  },
201
211
  limit: {
202
- style: 'form',
212
+ style: "form",
203
213
  explode: true,
204
214
  },
205
215
  cursor: {
206
- style: 'form',
216
+ style: "form",
207
217
  explode: true,
208
218
  },
209
219
  sortOrder: {
210
- style: 'form',
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(['Asc', 'Desc']).optional().default('Desc'),
235
+ sortOrder: z.enum(["Asc", "Desc"]).optional().default("Desc"),
226
236
  },
227
- response: Roblox_Web_WebAPI_Models_ApiPageResponse_Roblox_Web_Responses_Games_GameFavoriteResponseModel_,
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: 'GET',
241
- path: '/v2/users/:userId/games',
242
- baseUrl: 'https://games.roblox.com',
243
- requestFormat: 'json',
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: 'simple',
257
+ style: "simple",
247
258
  },
248
259
  accessFilter: {
249
- style: 'form',
260
+ style: "form",
250
261
  explode: true,
251
262
  },
252
263
  limit: {
253
- style: 'form',
264
+ style: "form",
254
265
  explode: true,
255
266
  },
256
267
  cursor: {
257
- style: 'form',
268
+ style: "form",
258
269
  explode: true,
259
270
  },
260
271
  sortOrder: {
261
- style: 'form',
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
  /**
@@ -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
- const jsonMessage = typeof json?.message === 'string' ? json.message : JSON.stringify(json);
783
- parsedError = { message: jsonMessage };
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
- const candidate = value;
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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rozod",
3
- "version": "6.4.0",
3
+ "version": "6.4.2",
4
4
  "description": "A TypeScript wrapper for the Roblox API",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",