Skip to content

Commit 2921e76

Browse files
feat(api): manual updates
1 parent 0e1e412 commit 2921e76

File tree

9 files changed

+217
-216
lines changed

9 files changed

+217
-216
lines changed

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 42
22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-53f7c35748f9b41bb07f888796c7417ea84e5e63ab0e9e2aa4a8d64e48713b24.yml
33
openapi_spec_hash: 098ce74bcff31c61870e3d0ce357814b
4-
config_hash: 90f5a16140d721a24bffafbc30abaf35
4+
config_hash: b8c48b915f11a452e84fafc0e851a772

api.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
# Shared
2+
3+
Types:
4+
5+
- <code><a href="./src/resources/shared.ts">File</a></code>
6+
- <code><a href="./src/resources/shared.ts">Folder</a></code>
7+
18
# CustomMetadataFields
29

310
Types:
@@ -17,8 +24,6 @@ Methods:
1724

1825
Types:
1926

20-
- <code><a href="./src/resources/files/files.ts">File</a></code>
21-
- <code><a href="./src/resources/files/files.ts">Folder</a></code>
2227
- <code><a href="./src/resources/files/files.ts">Metadata</a></code>
2328
- <code><a href="./src/resources/files/files.ts">FileUpdateResponse</a></code>
2429
- <code><a href="./src/resources/files/files.ts">FileCopyResponse</a></code>

src/client.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ import { Accounts } from './resources/accounts/accounts';
3838
import { Beta } from './resources/beta/beta';
3939
import { Cache } from './resources/cache/cache';
4040
import {
41-
File,
4241
FileCopyParams,
4342
FileCopyResponse,
4443
FileMoveParams,
@@ -50,7 +49,6 @@ import {
5049
FileUploadParams,
5150
FileUploadResponse,
5251
Files,
53-
Folder,
5452
Metadata,
5553
} from './resources/files/files';
5654
import {
@@ -828,8 +826,6 @@ export declare namespace ImageKit {
828826

829827
export {
830828
Files as Files,
831-
type File as File,
832-
type Folder as Folder,
833829
type Metadata as Metadata,
834830
type FileUpdateResponse as FileUpdateResponse,
835831
type FileCopyResponse as FileCopyResponse,
@@ -877,4 +873,7 @@ export declare namespace ImageKit {
877873
type UnsafeUnwrapWebhookEvent as UnsafeUnwrapWebhookEvent,
878874
type UnwrapWebhookEvent as UnwrapWebhookEvent,
879875
};
876+
877+
export type File = API.File;
878+
export type Folder = API.Folder;
880879
}

src/resources/assets.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

33
import { APIResource } from '../core/resource';
4-
import * as FilesAPI from './files/files';
4+
import * as Shared from './shared';
55
import { APIPromise } from '../core/api-promise';
66
import { RequestOptions } from '../internal/request-options';
77

@@ -20,7 +20,7 @@ export class Assets extends APIResource {
2020
}
2121
}
2222

23-
export type AssetListResponse = Array<FilesAPI.File | FilesAPI.Folder>;
23+
export type AssetListResponse = Array<Shared.File | Shared.Folder>;
2424

2525
export interface AssetListParams {
2626
/**

src/resources/files/files.ts

Lines changed: 3 additions & 199 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

33
import { APIResource } from '../../core/resource';
4+
import * as Shared from '../shared';
45
import * as BulkAPI from './bulk';
56
import {
67
Bulk,
@@ -102,7 +103,7 @@ export class Files extends APIResource {
102103
* const file = await client.files.get('fileId');
103104
* ```
104105
*/
105-
get(fileID: string, options?: RequestOptions): APIPromise<File> {
106+
get(fileID: string, options?: RequestOptions): APIPromise<Shared.File> {
106107
return this._client.get(path`/v1/files/${fileID}/details`, options);
107108
}
108109

@@ -191,201 +192,6 @@ export class Files extends APIResource {
191192
}
192193
}
193194

194-
/**
195-
* Object containing details of a file or file version.
196-
*/
197-
export interface File {
198-
/**
199-
* An array of tags assigned to the file by auto tagging.
200-
*/
201-
AITags?: Array<File.AITag> | null;
202-
203-
/**
204-
* Date and time when the file was uploaded. The date and time is in ISO8601
205-
* format.
206-
*/
207-
createdAt?: string;
208-
209-
/**
210-
* An string with custom coordinates of the file.
211-
*/
212-
customCoordinates?: string | null;
213-
214-
/**
215-
* An object with custom metadata for the file.
216-
*/
217-
customMetadata?: { [key: string]: unknown };
218-
219-
/**
220-
* Optional text to describe the contents of the file. Can be set by the user or
221-
* the ai-auto-description extension.
222-
*/
223-
description?: string;
224-
225-
/**
226-
* Unique identifier of the asset.
227-
*/
228-
fileId?: string;
229-
230-
/**
231-
* Path of the file. This is the path you would use in the URL to access the file.
232-
* For example, if the file is at the root of the media library, the path will be
233-
* `/file.jpg`. If the file is inside a folder named `images`, the path will be
234-
* `/images/file.jpg`.
235-
*/
236-
filePath?: string;
237-
238-
/**
239-
* Type of the file. Possible values are `image`, `non-image`.
240-
*/
241-
fileType?: string;
242-
243-
/**
244-
* Specifies if the image has an alpha channel.
245-
*/
246-
hasAlpha?: boolean;
247-
248-
/**
249-
* Height of the file.
250-
*/
251-
height?: number;
252-
253-
/**
254-
* Specifies if the file is private or not.
255-
*/
256-
isPrivateFile?: boolean;
257-
258-
/**
259-
* Specifies if the file is published or not.
260-
*/
261-
isPublished?: boolean;
262-
263-
/**
264-
* MIME type of the file.
265-
*/
266-
mime?: string;
267-
268-
/**
269-
* Name of the asset.
270-
*/
271-
name?: string;
272-
273-
/**
274-
* Size of the file in bytes.
275-
*/
276-
size?: number;
277-
278-
/**
279-
* An array of tags assigned to the file. Tags are used to search files in the
280-
* media library.
281-
*/
282-
tags?: Array<string> | null;
283-
284-
/**
285-
* URL of the thumbnail image. This URL is used to access the thumbnail image of
286-
* the file in the media library.
287-
*/
288-
thumbnail?: string;
289-
290-
/**
291-
* Type of the asset.
292-
*/
293-
type?: 'file' | 'file-version';
294-
295-
/**
296-
* Date and time when the file was last updated. The date and time is in ISO8601
297-
* format.
298-
*/
299-
updatedAt?: string;
300-
301-
/**
302-
* URL of the file.
303-
*/
304-
url?: string;
305-
306-
/**
307-
* An object with details of the file version.
308-
*/
309-
versionInfo?: File.VersionInfo;
310-
311-
/**
312-
* Width of the file.
313-
*/
314-
width?: number;
315-
}
316-
317-
export namespace File {
318-
export interface AITag {
319-
/**
320-
* Confidence score of the tag.
321-
*/
322-
confidence?: number;
323-
324-
/**
325-
* Name of the tag.
326-
*/
327-
name?: string;
328-
329-
/**
330-
* Source of the tag. Possible values are `google-auto-tagging` and
331-
* `aws-auto-tagging`.
332-
*/
333-
source?: string;
334-
}
335-
336-
/**
337-
* An object with details of the file version.
338-
*/
339-
export interface VersionInfo {
340-
/**
341-
* Unique identifier of the file version.
342-
*/
343-
id?: string;
344-
345-
/**
346-
* Name of the file version.
347-
*/
348-
name?: string;
349-
}
350-
}
351-
352-
export interface Folder {
353-
/**
354-
* Date and time when the folder was created. The date and time is in ISO8601
355-
* format.
356-
*/
357-
createdAt?: string;
358-
359-
/**
360-
* Unique identifier of the asset.
361-
*/
362-
folderId?: string;
363-
364-
/**
365-
* Path of the folder. This is the path you would use in the URL to access the
366-
* folder. For example, if the folder is at the root of the media library, the path
367-
* will be /folder. If the folder is inside another folder named images, the path
368-
* will be /images/folder.
369-
*/
370-
folderPath?: string;
371-
372-
/**
373-
* Name of the asset.
374-
*/
375-
name?: string;
376-
377-
/**
378-
* Type of the asset.
379-
*/
380-
type?: 'folder';
381-
382-
/**
383-
* Date and time when the folder was last updated. The date and time is in ISO8601
384-
* format.
385-
*/
386-
updatedAt?: string;
387-
}
388-
389195
/**
390196
* JSON object containing metadata.
391197
*/
@@ -611,7 +417,7 @@ export namespace Metadata {
611417
/**
612418
* Object containing details of a file or file version.
613419
*/
614-
export interface FileUpdateResponse extends File {
420+
export interface FileUpdateResponse extends Shared.File {
615421
extensionStatus?: FileUpdateResponse.ExtensionStatus;
616422
}
617423

@@ -1436,8 +1242,6 @@ Files.Versions = Versions;
14361242

14371243
export declare namespace Files {
14381244
export {
1439-
type File as File,
1440-
type Folder as Folder,
14411245
type Metadata as Metadata,
14421246
type FileUpdateResponse as FileUpdateResponse,
14431247
type FileCopyResponse as FileCopyResponse,

src/resources/files/index.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ export {
1313
} from './bulk';
1414
export {
1515
Files,
16-
type File,
17-
type Folder,
1816
type Metadata,
1917
type FileUpdateResponse,
2018
type FileCopyResponse,

src/resources/files/versions.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

33
import { APIResource } from '../../core/resource';
4-
import * as FilesAPI from './files';
4+
import * as Shared from '../shared';
55
import { APIPromise } from '../../core/api-promise';
66
import { RequestOptions } from '../../internal/request-options';
77
import { path } from '../../internal/utils/path';
@@ -52,7 +52,7 @@ export class Versions extends APIResource {
5252
* });
5353
* ```
5454
*/
55-
get(versionID: string, params: VersionGetParams, options?: RequestOptions): APIPromise<FilesAPI.File> {
55+
get(versionID: string, params: VersionGetParams, options?: RequestOptions): APIPromise<Shared.File> {
5656
const { fileId } = params;
5757
return this._client.get(path`/v1/files/${fileId}/versions/${versionID}`, options);
5858
}
@@ -72,13 +72,13 @@ export class Versions extends APIResource {
7272
versionID: string,
7373
params: VersionRestoreParams,
7474
options?: RequestOptions,
75-
): APIPromise<FilesAPI.File> {
75+
): APIPromise<Shared.File> {
7676
const { fileId } = params;
7777
return this._client.put(path`/v1/files/${fileId}/versions/${versionID}/restore`, options);
7878
}
7979
}
8080

81-
export type VersionListResponse = Array<FilesAPI.File>;
81+
export type VersionListResponse = Array<Shared.File>;
8282

8383
export interface VersionDeleteResponse {}
8484

src/resources/index.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

3+
export * from './shared';
34
export { Accounts } from './accounts/accounts';
45
export { Assets, type AssetListResponse, type AssetListParams } from './assets';
56
export { Beta } from './beta/beta';
@@ -15,8 +16,6 @@ export {
1516
} from './custom-metadata-fields';
1617
export {
1718
Files,
18-
type File,
19-
type Folder,
2019
type Metadata,
2120
type FileUpdateResponse,
2221
type FileCopyResponse,

0 commit comments

Comments
 (0)