Skip to content

Commit 467d77b

Browse files
feat(api): fix upload API request params
1 parent ba86045 commit 467d77b

File tree

9 files changed

+216
-185
lines changed

9 files changed

+216
-185
lines changed

.eslintcache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
[{"/home/tempuser-sb8jch/run/codegen-output/imagekit-inc/imagekit-typescript/packages/mcp-server/src/tools/custom-metadata-fields/create-custom-metadata-fields.ts":"1","/home/tempuser-sb8jch/run/codegen-output/imagekit-inc/imagekit-typescript/packages/mcp-server/src/tools/custom-metadata-fields/list-custom-metadata-fields.ts":"2","/home/tempuser-sb8jch/run/codegen-output/imagekit-inc/imagekit-typescript/packages/mcp-server/src/tools/custom-metadata-fields/update-custom-metadata-fields.ts":"3","/home/tempuser-sb8jch/run/codegen-output/imagekit-inc/imagekit-typescript/src/resources/custom-metadata-fields.ts":"4"},{"size":10544,"mtime":1759217929861},{"size":7341,"mtime":1759217929861},{"size":10154,"mtime":1759217929861},{"size":11807,"mtime":1759217929861}]
1+
[{"/home/tempuser-vr9scf/run/codegen-output/imagekit-inc/imagekit-typescript/packages/mcp-server/src/tools/beta/v2/files/upload-v2-beta-files.ts":"1","/home/tempuser-vr9scf/run/codegen-output/imagekit-inc/imagekit-typescript/packages/mcp-server/src/tools/files/upload-files.ts":"2","/home/tempuser-vr9scf/run/codegen-output/imagekit-inc/imagekit-typescript/src/resources/beta/v2/files.ts":"3","/home/tempuser-vr9scf/run/codegen-output/imagekit-inc/imagekit-typescript/src/resources/files/files.ts":"4","/home/tempuser-vr9scf/run/codegen-output/imagekit-inc/imagekit-typescript/src/resources/webhooks.ts":"5","/home/tempuser-vr9scf/run/codegen-output/imagekit-inc/imagekit-typescript/tests/api-resources/beta/v2/files.test.ts":"6","/home/tempuser-vr9scf/run/codegen-output/imagekit-inc/imagekit-typescript/tests/api-resources/files/files.test.ts":"7"},{"size":15178,"mtime":1759218546101},{"size":16142,"mtime":1759218546101},{"size":19090,"mtime":1759218546101},{"size":43513,"mtime":1759218546101},{"size":28582,"mtime":1759218546101},{"size":2119,"mtime":1759218546101},{"size":6193,"mtime":1759218546101}]

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 42
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-aa4c8e857ae03b12dabf168c83c62f759e2706d69fa4eb77d11519d45a5dada2.yml
3-
openapi_spec_hash: 6ea00242c4685fb6422328f0dd53f9b1
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-01aef94bd928f40b7209dc21df71e2312d4bee430119b30ee05d75cf5e1b4801.yml
3+
openapi_spec_hash: 054c332db88b23d362f72583dd24b2aa
44
config_hash: e42d7fc3a8c92c35099cc283f9a4467a

packages/mcp-server/src/tools/beta/v2/files/upload-v2-beta-files.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -110,12 +110,6 @@ export const tool: Tool = {
110110
],
111111
},
112112
},
113-
selectedFieldsSchema: {
114-
type: 'object',
115-
description:
116-
'This field is included in the response only if the Path policy feature is available in the plan.\nIt contains schema definitions for the custom metadata fields selected for the specified file path.\nField selection can only be done when the Path policy feature is enabled.\n\nKeys are the names of the custom metadata fields; the value object has details about the custom metadata schema.\n',
117-
additionalProperties: true,
118-
},
119113
tags: {
120114
type: 'array',
121115
description:

packages/mcp-server/src/tools/files/upload-files.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -121,12 +121,6 @@ export const tool: Tool = {
121121
],
122122
},
123123
},
124-
selectedFieldsSchema: {
125-
type: 'object',
126-
description:
127-
'This field is included in the response only if the Path policy feature is available in the plan.\nIt contains schema definitions for the custom metadata fields selected for the specified file path.\nField selection can only be done when the Path policy feature is enabled.\n\nKeys are the names of the custom metadata fields; the value object has details about the custom metadata schema.\n',
128-
additionalProperties: true,
129-
},
130124
signature: {
131125
type: 'string',
132126
description:

src/resources/beta/v2/files.ts

Lines changed: 71 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,17 @@ export interface FileUploadResponse {
174174
*/
175175
name?: string;
176176

177+
/**
178+
* This field is included in the response only if the Path policy feature is
179+
* available in the plan. It contains schema definitions for the custom metadata
180+
* fields selected for the specified file path. Field selection can only be done
181+
* when the Path policy feature is enabled.
182+
*
183+
* Keys are the names of the custom metadata fields; the value object has details
184+
* about the custom metadata schema.
185+
*/
186+
selectedFieldsSchema?: { [key: string]: FileUploadResponse.SelectedFieldsSchema };
187+
177188
/**
178189
* Size of the image file in Bytes.
179190
*/
@@ -253,6 +264,66 @@ export namespace FileUploadResponse {
253264
'remove-bg'?: 'success' | 'pending' | 'failed';
254265
}
255266

267+
export interface SelectedFieldsSchema {
268+
/**
269+
* Type of the custom metadata field.
270+
*/
271+
type: 'Text' | 'Textarea' | 'Number' | 'Date' | 'Boolean' | 'SingleSelect' | 'MultiSelect';
272+
273+
/**
274+
* The default value for this custom metadata field. The value should match the
275+
* `type` of custom metadata field.
276+
*/
277+
defaultValue?: string | number | boolean | Array<string | number | boolean>;
278+
279+
/**
280+
* Specifies if the custom metadata field is required or not.
281+
*/
282+
isValueRequired?: boolean;
283+
284+
/**
285+
* Maximum length of string. Only set if `type` is set to `Text` or `Textarea`.
286+
*/
287+
maxLength?: number;
288+
289+
/**
290+
* Maximum value of the field. Only set if field type is `Date` or `Number`. For
291+
* `Date` type field, the value will be in ISO8601 string format. For `Number` type
292+
* field, it will be a numeric value.
293+
*/
294+
maxValue?: string | number;
295+
296+
/**
297+
* Minimum length of string. Only set if `type` is set to `Text` or `Textarea`.
298+
*/
299+
minLength?: number;
300+
301+
/**
302+
* Minimum value of the field. Only set if field type is `Date` or `Number`. For
303+
* `Date` type field, the value will be in ISO8601 string format. For `Number` type
304+
* field, it will be a numeric value.
305+
*/
306+
minValue?: string | number;
307+
308+
/**
309+
* Indicates whether the custom metadata field is read only. A read only field
310+
* cannot be modified after being set. This field is configurable only via the
311+
* **Path policy** feature.
312+
*/
313+
readOnly?: boolean;
314+
315+
/**
316+
* An array of allowed values when field type is `SingleSelect` or `MultiSelect`.
317+
*/
318+
selectOptions?: Array<string | number | boolean>;
319+
320+
/**
321+
* Specifies if the selectOptions array is truncated. It is truncated when number
322+
* of options are > 100.
323+
*/
324+
selectOptionsTruncated?: boolean;
325+
}
326+
256327
/**
257328
* An object containing the file or file version's `id` (versionId) and `name`.
258329
*/
@@ -406,17 +477,6 @@ export interface FileUploadParams {
406477
| 'selectedFieldsSchema'
407478
>;
408479

409-
/**
410-
* This field is included in the response only if the Path policy feature is
411-
* available in the plan. It contains schema definitions for the custom metadata
412-
* fields selected for the specified file path. Field selection can only be done
413-
* when the Path policy feature is enabled.
414-
*
415-
* Keys are the names of the custom metadata fields; the value object has details
416-
* about the custom metadata schema.
417-
*/
418-
selectedFieldsSchema?: { [key: string]: FileUploadParams.SelectedFieldsSchema };
419-
420480
/**
421481
* Set the tags while uploading the file. Provide an array of tag strings (e.g.
422482
* `["tag1", "tag2", "tag3"]`). The combined length of all tag characters must not
@@ -461,66 +521,6 @@ export interface FileUploadParams {
461521
}
462522

463523
export namespace FileUploadParams {
464-
export interface SelectedFieldsSchema {
465-
/**
466-
* Type of the custom metadata field.
467-
*/
468-
type: 'Text' | 'Textarea' | 'Number' | 'Date' | 'Boolean' | 'SingleSelect' | 'MultiSelect';
469-
470-
/**
471-
* The default value for this custom metadata field. The value should match the
472-
* `type` of custom metadata field.
473-
*/
474-
defaultValue?: string | number | boolean | Array<string | number | boolean>;
475-
476-
/**
477-
* Specifies if the custom metadata field is required or not.
478-
*/
479-
isValueRequired?: boolean;
480-
481-
/**
482-
* Maximum length of string. Only set if `type` is set to `Text` or `Textarea`.
483-
*/
484-
maxLength?: number;
485-
486-
/**
487-
* Maximum value of the field. Only set if field type is `Date` or `Number`. For
488-
* `Date` type field, the value will be in ISO8601 string format. For `Number` type
489-
* field, it will be a numeric value.
490-
*/
491-
maxValue?: string | number;
492-
493-
/**
494-
* Minimum length of string. Only set if `type` is set to `Text` or `Textarea`.
495-
*/
496-
minLength?: number;
497-
498-
/**
499-
* Minimum value of the field. Only set if field type is `Date` or `Number`. For
500-
* `Date` type field, the value will be in ISO8601 string format. For `Number` type
501-
* field, it will be a numeric value.
502-
*/
503-
minValue?: string | number;
504-
505-
/**
506-
* Indicates whether the custom metadata field is read only. A read only field
507-
* cannot be modified after being set. This field is configurable only via the
508-
* **Path policy** feature.
509-
*/
510-
readOnly?: boolean;
511-
512-
/**
513-
* An array of allowed values when field type is `SingleSelect` or `MultiSelect`.
514-
*/
515-
selectOptions?: Array<string | number | boolean>;
516-
517-
/**
518-
* Specifies if the selectOptions array is truncated. It is truncated when number
519-
* of options are > 100.
520-
*/
521-
selectOptionsTruncated?: boolean;
522-
}
523-
524524
/**
525525
* Configure pre-processing (`pre`) and post-processing (`post`) transformations.
526526
*

src/resources/files/files.ts

Lines changed: 71 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -909,6 +909,17 @@ export interface FileUploadResponse {
909909
*/
910910
name?: string;
911911

912+
/**
913+
* This field is included in the response only if the Path policy feature is
914+
* available in the plan. It contains schema definitions for the custom metadata
915+
* fields selected for the specified file path. Field selection can only be done
916+
* when the Path policy feature is enabled.
917+
*
918+
* Keys are the names of the custom metadata fields; the value object has details
919+
* about the custom metadata schema.
920+
*/
921+
selectedFieldsSchema?: { [key: string]: FileUploadResponse.SelectedFieldsSchema };
922+
912923
/**
913924
* Size of the image file in Bytes.
914925
*/
@@ -988,6 +999,66 @@ export namespace FileUploadResponse {
988999
'remove-bg'?: 'success' | 'pending' | 'failed';
9891000
}
9901001

1002+
export interface SelectedFieldsSchema {
1003+
/**
1004+
* Type of the custom metadata field.
1005+
*/
1006+
type: 'Text' | 'Textarea' | 'Number' | 'Date' | 'Boolean' | 'SingleSelect' | 'MultiSelect';
1007+
1008+
/**
1009+
* The default value for this custom metadata field. The value should match the
1010+
* `type` of custom metadata field.
1011+
*/
1012+
defaultValue?: string | number | boolean | Array<string | number | boolean>;
1013+
1014+
/**
1015+
* Specifies if the custom metadata field is required or not.
1016+
*/
1017+
isValueRequired?: boolean;
1018+
1019+
/**
1020+
* Maximum length of string. Only set if `type` is set to `Text` or `Textarea`.
1021+
*/
1022+
maxLength?: number;
1023+
1024+
/**
1025+
* Maximum value of the field. Only set if field type is `Date` or `Number`. For
1026+
* `Date` type field, the value will be in ISO8601 string format. For `Number` type
1027+
* field, it will be a numeric value.
1028+
*/
1029+
maxValue?: string | number;
1030+
1031+
/**
1032+
* Minimum length of string. Only set if `type` is set to `Text` or `Textarea`.
1033+
*/
1034+
minLength?: number;
1035+
1036+
/**
1037+
* Minimum value of the field. Only set if field type is `Date` or `Number`. For
1038+
* `Date` type field, the value will be in ISO8601 string format. For `Number` type
1039+
* field, it will be a numeric value.
1040+
*/
1041+
minValue?: string | number;
1042+
1043+
/**
1044+
* Indicates whether the custom metadata field is read only. A read only field
1045+
* cannot be modified after being set. This field is configurable only via the
1046+
* **Path policy** feature.
1047+
*/
1048+
readOnly?: boolean;
1049+
1050+
/**
1051+
* An array of allowed values when field type is `SingleSelect` or `MultiSelect`.
1052+
*/
1053+
selectOptions?: Array<string | number | boolean>;
1054+
1055+
/**
1056+
* Specifies if the selectOptions array is truncated. It is truncated when number
1057+
* of options are > 100.
1058+
*/
1059+
selectOptionsTruncated?: boolean;
1060+
}
1061+
9911062
/**
9921063
* An object containing the file or file version's `id` (versionId) and `name`.
9931064
*/
@@ -1310,17 +1381,6 @@ export interface FileUploadParams {
13101381
| 'selectedFieldsSchema'
13111382
>;
13121383

1313-
/**
1314-
* This field is included in the response only if the Path policy feature is
1315-
* available in the plan. It contains schema definitions for the custom metadata
1316-
* fields selected for the specified file path. Field selection can only be done
1317-
* when the Path policy feature is enabled.
1318-
*
1319-
* Keys are the names of the custom metadata fields; the value object has details
1320-
* about the custom metadata schema.
1321-
*/
1322-
selectedFieldsSchema?: { [key: string]: FileUploadParams.SelectedFieldsSchema };
1323-
13241384
/**
13251385
* HMAC-SHA1 digest of the token+expire using your ImageKit.io private API key as a
13261386
* key. Learn how to create a signature on the page below. This should be in
@@ -1375,66 +1435,6 @@ export interface FileUploadParams {
13751435
}
13761436

13771437
export namespace FileUploadParams {
1378-
export interface SelectedFieldsSchema {
1379-
/**
1380-
* Type of the custom metadata field.
1381-
*/
1382-
type: 'Text' | 'Textarea' | 'Number' | 'Date' | 'Boolean' | 'SingleSelect' | 'MultiSelect';
1383-
1384-
/**
1385-
* The default value for this custom metadata field. The value should match the
1386-
* `type` of custom metadata field.
1387-
*/
1388-
defaultValue?: string | number | boolean | Array<string | number | boolean>;
1389-
1390-
/**
1391-
* Specifies if the custom metadata field is required or not.
1392-
*/
1393-
isValueRequired?: boolean;
1394-
1395-
/**
1396-
* Maximum length of string. Only set if `type` is set to `Text` or `Textarea`.
1397-
*/
1398-
maxLength?: number;
1399-
1400-
/**
1401-
* Maximum value of the field. Only set if field type is `Date` or `Number`. For
1402-
* `Date` type field, the value will be in ISO8601 string format. For `Number` type
1403-
* field, it will be a numeric value.
1404-
*/
1405-
maxValue?: string | number;
1406-
1407-
/**
1408-
* Minimum length of string. Only set if `type` is set to `Text` or `Textarea`.
1409-
*/
1410-
minLength?: number;
1411-
1412-
/**
1413-
* Minimum value of the field. Only set if field type is `Date` or `Number`. For
1414-
* `Date` type field, the value will be in ISO8601 string format. For `Number` type
1415-
* field, it will be a numeric value.
1416-
*/
1417-
minValue?: string | number;
1418-
1419-
/**
1420-
* Indicates whether the custom metadata field is read only. A read only field
1421-
* cannot be modified after being set. This field is configurable only via the
1422-
* **Path policy** feature.
1423-
*/
1424-
readOnly?: boolean;
1425-
1426-
/**
1427-
* An array of allowed values when field type is `SingleSelect` or `MultiSelect`.
1428-
*/
1429-
selectOptions?: Array<string | number | boolean>;
1430-
1431-
/**
1432-
* Specifies if the selectOptions array is truncated. It is truncated when number
1433-
* of options are > 100.
1434-
*/
1435-
selectOptionsTruncated?: boolean;
1436-
}
1437-
14381438
/**
14391439
* Configure pre-processing (`pre`) and post-processing (`post`) transformations.
14401440
*

0 commit comments

Comments
 (0)