rozod 6.3.0 → 6.4.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.
Files changed (54) hide show
  1. package/lib/endpoints/accountsettingsv1.d.ts +27 -33
  2. package/lib/endpoints/accountsettingsv1.js +11 -22
  3. package/lib/endpoints/adconfigurationv2.d.ts +104 -119
  4. package/lib/endpoints/adconfigurationv2.js +32 -48
  5. package/lib/endpoints/assetdeliveryv1.d.ts +25 -24
  6. package/lib/endpoints/assetdeliveryv1.js +25 -24
  7. package/lib/endpoints/assetdeliveryv2.d.ts +25 -24
  8. package/lib/endpoints/assetdeliveryv2.js +25 -24
  9. package/lib/endpoints/authv1.d.ts +84 -84
  10. package/lib/endpoints/authv1.js +69 -62
  11. package/lib/endpoints/authv2.d.ts +56 -56
  12. package/lib/endpoints/authv2.js +57 -50
  13. package/lib/endpoints/authv3.d.ts +11 -11
  14. package/lib/endpoints/authv3.js +11 -11
  15. package/lib/endpoints/badgesv1.d.ts +6 -2
  16. package/lib/endpoints/badgesv1.js +2 -2
  17. package/lib/endpoints/catalogv1.d.ts +37 -43
  18. package/lib/endpoints/catalogv1.js +37 -37
  19. package/lib/endpoints/catalogv2.d.ts +11 -11
  20. package/lib/endpoints/catalogv2.js +11 -11
  21. package/lib/endpoints/clientsettingsv2.d.ts +7 -7
  22. package/lib/endpoints/clientsettingsv2.js +8 -1
  23. package/lib/endpoints/developv1.d.ts +31 -31
  24. package/lib/endpoints/developv1.js +26 -26
  25. package/lib/endpoints/developv2.d.ts +27 -27
  26. package/lib/endpoints/developv2.js +22 -22
  27. package/lib/endpoints/economycreatorstatsv1.d.ts +1 -1
  28. package/lib/endpoints/economycreatorstatsv1.js +1 -1
  29. package/lib/endpoints/followingsv2.d.ts +2 -2
  30. package/lib/endpoints/followingsv2.js +2 -2
  31. package/lib/endpoints/friendsv1.d.ts +24 -23
  32. package/lib/endpoints/friendsv1.js +24 -23
  33. package/lib/endpoints/gamesv1.d.ts +27 -615
  34. package/lib/endpoints/gamesv1.js +28 -608
  35. package/lib/endpoints/gamesv2.d.ts +187 -260
  36. package/lib/endpoints/gamesv2.js +130 -190
  37. package/lib/endpoints/groupsv1.d.ts +26 -26
  38. package/lib/endpoints/groupsv1.js +28 -16
  39. package/lib/endpoints/groupsv2.d.ts +92 -92
  40. package/lib/endpoints/groupsv2.js +93 -87
  41. package/lib/endpoints/inventoryv1.d.ts +9 -21
  42. package/lib/endpoints/inventoryv1.js +4 -4
  43. package/lib/endpoints/inventoryv2.d.ts +91 -91
  44. package/lib/endpoints/inventoryv2.js +86 -86
  45. package/lib/endpoints/itemconfigurationv1.d.ts +1 -1
  46. package/lib/endpoints/itemconfigurationv1.js +1 -1
  47. package/lib/endpoints/tradesv1.d.ts +10 -16
  48. package/lib/endpoints/tradesv1.js +10 -10
  49. package/lib/endpoints/twostepverificationv1.d.ts +59 -60
  50. package/lib/endpoints/twostepverificationv1.js +59 -60
  51. package/lib/endpoints/usersv1.d.ts +1 -1
  52. package/lib/endpoints/usersv1.js +1 -1
  53. package/lib/index.js +29 -3
  54. package/package.json +1 -1
@@ -34,18 +34,17 @@ const Roblox_TwoStepVerification_Api_MetadataResponse = zod_1.z.object({
34
34
  maskedUserEmail: zod_1.z.string(),
35
35
  isUserU13: zod_1.z.boolean(),
36
36
  isDelayedUiEnabled: zod_1.z.boolean(),
37
- is2svRecoveryEnabled: zod_1.z.boolean(),
38
37
  });
39
38
  const Roblox_TwoStepVerification_Api_UserConfigurationMethod = zod_1.z.object({
40
- mediaType: zod_1.z.union([
41
- zod_1.z.literal(0),
42
- zod_1.z.literal(1),
43
- zod_1.z.literal(2),
44
- zod_1.z.literal(3),
45
- zod_1.z.literal(4),
46
- zod_1.z.literal(5),
47
- zod_1.z.literal(6),
48
- zod_1.z.literal(7),
39
+ mediaType: zod_1.z.enum([
40
+ 'Email',
41
+ 'SMS',
42
+ 'Authenticator',
43
+ 'RecoveryCode',
44
+ 'SecurityKey',
45
+ 'CrossDevice',
46
+ 'Password',
47
+ 'Passkey',
49
48
  ]),
50
49
  enabled: zod_1.z.boolean(),
51
50
  updated: zod_1.z.string().datetime({ offset: true }),
@@ -69,16 +68,16 @@ const Roblox_TwoStepVerification_Api_RecoveryCodesStatusResponse = zod_1.z.objec
69
68
  });
70
69
  const Roblox_TwoStepVerification_Api_VerifyCodeRequest = zod_1.z.object({
71
70
  challengeId: zod_1.z.string(),
72
- actionType: zod_1.z.union([
73
- zod_1.z.literal(0),
74
- zod_1.z.literal(1),
75
- zod_1.z.literal(2),
76
- zod_1.z.literal(3),
77
- zod_1.z.literal(4),
78
- zod_1.z.literal(5),
79
- zod_1.z.literal(6),
80
- zod_1.z.literal(7),
81
- zod_1.z.literal(8),
71
+ actionType: zod_1.z.enum([
72
+ 'Unknown',
73
+ 'Login',
74
+ 'RobuxSpend',
75
+ 'ItemTrade',
76
+ 'Resale',
77
+ 'PasswordReset',
78
+ 'RevertAccount',
79
+ 'Generic',
80
+ 'GenericWithRecoveryCodes',
82
81
  ]),
83
82
  code: zod_1.z.string(),
84
83
  });
@@ -87,46 +86,46 @@ const Roblox_TwoStepVerification_Api_VerifyCodeResponse = zod_1.z.object({
87
86
  });
88
87
  const Roblox_TwoStepVerification_Api_RetractDialogRequest = zod_1.z.object({
89
88
  challengeId: zod_1.z.string(),
90
- actionType: zod_1.z.union([
91
- zod_1.z.literal(0),
92
- zod_1.z.literal(1),
93
- zod_1.z.literal(2),
94
- zod_1.z.literal(3),
95
- zod_1.z.literal(4),
96
- zod_1.z.literal(5),
97
- zod_1.z.literal(6),
98
- zod_1.z.literal(7),
99
- zod_1.z.literal(8),
89
+ actionType: zod_1.z.enum([
90
+ 'Unknown',
91
+ 'Login',
92
+ 'RobuxSpend',
93
+ 'ItemTrade',
94
+ 'Resale',
95
+ 'PasswordReset',
96
+ 'RevertAccount',
97
+ 'Generic',
98
+ 'GenericWithRecoveryCodes',
100
99
  ]),
101
100
  });
102
101
  const Roblox_TwoStepVerification_Api_RetractDialogResponse = zod_1.z.object({});
103
102
  const Roblox_TwoStepVerification_Api_RetryApprovalRequest = zod_1.z.object({
104
103
  challengeId: zod_1.z.string(),
105
- actionType: zod_1.z.union([
106
- zod_1.z.literal(0),
107
- zod_1.z.literal(1),
108
- zod_1.z.literal(2),
109
- zod_1.z.literal(3),
110
- zod_1.z.literal(4),
111
- zod_1.z.literal(5),
112
- zod_1.z.literal(6),
113
- zod_1.z.literal(7),
114
- zod_1.z.literal(8),
104
+ actionType: zod_1.z.enum([
105
+ 'Unknown',
106
+ 'Login',
107
+ 'RobuxSpend',
108
+ 'ItemTrade',
109
+ 'Resale',
110
+ 'PasswordReset',
111
+ 'RevertAccount',
112
+ 'Generic',
113
+ 'GenericWithRecoveryCodes',
115
114
  ]),
116
115
  });
117
116
  const Roblox_TwoStepVerification_Api_RetryApprovalResponse = zod_1.z.object({});
118
117
  const Roblox_TwoStepVerification_Api_VerifyApprovalRequest = zod_1.z.object({
119
118
  challengeId: zod_1.z.string(),
120
- actionType: zod_1.z.union([
121
- zod_1.z.literal(0),
122
- zod_1.z.literal(1),
123
- zod_1.z.literal(2),
124
- zod_1.z.literal(3),
125
- zod_1.z.literal(4),
126
- zod_1.z.literal(5),
127
- zod_1.z.literal(6),
128
- zod_1.z.literal(7),
129
- zod_1.z.literal(8),
119
+ actionType: zod_1.z.enum([
120
+ 'Unknown',
121
+ 'Login',
122
+ 'RobuxSpend',
123
+ 'ItemTrade',
124
+ 'Resale',
125
+ 'PasswordReset',
126
+ 'RevertAccount',
127
+ 'Generic',
128
+ 'GenericWithRecoveryCodes',
130
129
  ]),
131
130
  });
132
131
  const Roblox_TwoStepVerification_Api_VerifyApprovalResponse = zod_1.z.object({
@@ -134,16 +133,16 @@ const Roblox_TwoStepVerification_Api_VerifyApprovalResponse = zod_1.z.object({
134
133
  });
135
134
  const Roblox_TwoStepVerification_Api_SendCodeRequest = zod_1.z.object({
136
135
  challengeId: zod_1.z.string(),
137
- actionType: zod_1.z.union([
138
- zod_1.z.literal(0),
139
- zod_1.z.literal(1),
140
- zod_1.z.literal(2),
141
- zod_1.z.literal(3),
142
- zod_1.z.literal(4),
143
- zod_1.z.literal(5),
144
- zod_1.z.literal(6),
145
- zod_1.z.literal(7),
146
- zod_1.z.literal(8),
136
+ actionType: zod_1.z.enum([
137
+ 'Unknown',
138
+ 'Login',
139
+ 'RobuxSpend',
140
+ 'ItemTrade',
141
+ 'Resale',
142
+ 'PasswordReset',
143
+ 'RevertAccount',
144
+ 'Generic',
145
+ 'GenericWithRecoveryCodes',
147
146
  ]),
148
147
  });
149
148
  const Roblox_Web_WebAPI_ApiEmptyResponseModel = zod_1.z.object({});
@@ -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.union([z.literal(1), z.literal(2), z.literal(3)]),
24
+ gender: z.enum(["Unknown", "Male", "Female"]),
25
25
  });
26
26
  const Roblox_Users_Api_GetUserResponse = z.object({
27
27
  description: z.string(),
@@ -23,7 +23,7 @@ const Roblox_Users_Api_DescriptionRequest = zod_1.z.object({
23
23
  });
24
24
  const Roblox_Users_Api_GenderResponse = zod_1.z.object({ gender: zod_1.z.number().int() });
25
25
  const Roblox_Users_Api_GenderRequest = zod_1.z.object({
26
- gender: zod_1.z.union([zod_1.z.literal(1), zod_1.z.literal(2), zod_1.z.literal(3)]),
26
+ gender: zod_1.z.enum(['Unknown', 'Male', 'Female']),
27
27
  });
28
28
  const Roblox_Users_Api_GetUserResponse = zod_1.z.object({
29
29
  description: zod_1.z.string(),
package/lib/index.js CHANGED
@@ -95,9 +95,35 @@ function prepareRequestUrl(endpoint, extendedParams) {
95
95
  return endpoint.baseUrl + processedPath + query;
96
96
  }
97
97
  function prepareRequestBody(method, requestFormat, body, headers) {
98
- if (method !== 'GET' && requestFormat === 'json') {
99
- body = JSON.stringify(body);
100
- headers.set('content-type', 'application/json');
98
+ if (method !== 'GET') {
99
+ switch (requestFormat) {
100
+ case 'json':
101
+ body = JSON.stringify(body);
102
+ headers.set('content-type', 'application/json');
103
+ break;
104
+ case 'form-data': {
105
+ const formData = new FormData();
106
+ for (const [key, value] of Object.entries(body)) {
107
+ if (value instanceof Blob) {
108
+ formData.append(key, value);
109
+ }
110
+ else if (typeof value === 'string') {
111
+ formData.append(key, value);
112
+ }
113
+ else {
114
+ formData.append(key, JSON.stringify(value));
115
+ }
116
+ }
117
+ body = formData;
118
+ break;
119
+ }
120
+ case 'text':
121
+ headers.set('content-type', 'text/plain');
122
+ break;
123
+ default:
124
+ requestFormat;
125
+ throw new Error(`Unsupported request format: ${requestFormat}`);
126
+ }
101
127
  }
102
128
  return body;
103
129
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rozod",
3
- "version": "6.3.0",
3
+ "version": "6.4.0",
4
4
  "description": "A TypeScript wrapper for the Roblox API",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",