Skip to content

Commit 467f3fc

Browse files
feat(api): manual updates
1 parent 2921e76 commit 467f3fc

File tree

9 files changed

+216
-217
lines changed

9 files changed

+216
-217
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: b8c48b915f11a452e84fafc0e851a772
4+
config_hash: 90f5a16140d721a24bffafbc30abaf35

api.md

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
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-
81
# CustomMetadataFields
92

103
Types:
@@ -24,6 +17,8 @@ Methods:
2417

2518
Types:
2619

20+
- <code><a href="./src/resources/files/files.ts">File</a></code>
21+
- <code><a href="./src/resources/files/files.ts">Folder</a></code>
2722
- <code><a href="./src/resources/files/files.ts">Metadata</a></code>
2823
- <code><a href="./src/resources/files/files.ts">FileUpdateResponse</a></code>
2924
- <code><a href="./src/resources/files/files.ts">FileCopyResponse</a></code>

src/client.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ import { Accounts } from './resources/accounts/accounts';
3838
import { Beta } from './resources/beta/beta';
3939
import { Cache } from './resources/cache/cache';
4040
import {
41+
File,
4142
FileCopyParams,
4243
FileCopyResponse,
4344
FileMoveParams,
@@ -49,6 +50,7 @@ import {
4950
FileUploadParams,
5051
FileUploadResponse,
5152
Files,
53+
Folder,
5254
Metadata,
5355
} from './resources/files/files';
5456
import {
@@ -826,6 +828,8 @@ export declare namespace ImageKit {
826828

827829
export {
828830
Files as Files,
831+
type File as File,
832+
type Folder as Folder,
829833
type Metadata as Metadata,
830834
type FileUpdateResponse as FileUpdateResponse,
831835
type FileCopyResponse as FileCopyResponse,
@@ -873,7 +877,4 @@ export declare namespace ImageKit {
873877
type UnsafeUnwrapWebhookEvent as UnsafeUnwrapWebhookEvent,
874878
type UnwrapWebhookEvent as UnwrapWebhookEvent,
875879
};
876-
877-
export type File = API.File;
878-
export type Folder = API.Folder;
879880
}

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 Shared from './shared';
4+
import * as FilesAPI from './files/files';
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<Shared.File | Shared.Folder>;
23+
export type AssetListResponse = Array<FilesAPI.File | FilesAPI.Folder>;
2424

2525
export interface AssetListParams {
2626
/**

src/resources/files/files.ts

Lines changed: 199 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
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';
54
import * as BulkAPI from './bulk';
65
import {
76
Bulk,
@@ -103,7 +102,7 @@ export class Files extends APIResource {
103102
* const file = await client.files.get('fileId');
104103
* ```
105104
*/
106-
get(fileID: string, options?: RequestOptions): APIPromise<Shared.File> {
105+
get(fileID: string, options?: RequestOptions): APIPromise<File> {
107106
return this._client.get(path`/v1/files/${fileID}/details`, options);
108107
}
109108

@@ -192,6 +191,201 @@ export class Files extends APIResource {
192191
}
193192
}
194193

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+
195389
/**
196390
* JSON object containing metadata.
197391
*/
@@ -417,7 +611,7 @@ export namespace Metadata {
417611
/**
418612
* Object containing details of a file or file version.
419613
*/
420-
export interface FileUpdateResponse extends Shared.File {
614+
export interface FileUpdateResponse extends File {
421615
extensionStatus?: FileUpdateResponse.ExtensionStatus;
422616
}
423617

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

12431437
export declare namespace Files {
12441438
export {
1439+
type File as File,
1440+
type Folder as Folder,
12451441
type Metadata as Metadata,
12461442
type FileUpdateResponse as FileUpdateResponse,
12471443
type FileCopyResponse as FileCopyResponse,

src/resources/files/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ export {
1313
} from './bulk';
1414
export {
1515
Files,
16+
type File,
17+
type Folder,
1618
type Metadata,
1719
type FileUpdateResponse,
1820
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 Shared from '../shared';
4+
import * as FilesAPI from './files';
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<Shared.File> {
55+
get(versionID: string, params: VersionGetParams, options?: RequestOptions): APIPromise<FilesAPI.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<Shared.File> {
75+
): APIPromise<FilesAPI.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<Shared.File>;
81+
export type VersionListResponse = Array<FilesAPI.File>;
8282

8383
export interface VersionDeleteResponse {}
8484

src/resources/index.ts

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

3-
export * from './shared';
43
export { Accounts } from './accounts/accounts';
54
export { Assets, type AssetListResponse, type AssetListParams } from './assets';
65
export { Beta } from './beta/beta';
@@ -16,6 +15,8 @@ export {
1615
} from './custom-metadata-fields';
1716
export {
1817
Files,
18+
type File,
19+
type Folder,
1920
type Metadata,
2021
type FileUpdateResponse,
2122
type FileCopyResponse,

0 commit comments

Comments
 (0)