Skip to content

Commit 3f5ff26

Browse files
feat(api): manual updates
1 parent 3dbf797 commit 3f5ff26

File tree

7 files changed

+214
-16
lines changed

7 files changed

+214
-16
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-967cd0e731df83a642ded194cacae3628050f679c600b1efd4e66cf269973531.yml
33
openapi_spec_hash: 98642308bee81ac776b7b1843089b888
4-
config_hash: 91cbeb97fdb75393dffd187ec25a4080
4+
config_hash: 734b211088fdf0d30e3d6c8788ac83bc

api.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ Methods:
8181

8282
Types:
8383

84+
- <code><a href="./src/resources/assets.ts">File</a></code>
85+
- <code><a href="./src/resources/assets.ts">Folder</a></code>
8486
- <code><a href="./src/resources/assets.ts">AssetListResponse</a></code>
8587

8688
Methods:

src/client.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import * as Errors from './core/error';
1616
import * as Uploads from './core/uploads';
1717
import * as API from './resources/index';
1818
import { APIPromise } from './core/api-promise';
19-
import { AssetListParams, AssetListResponse, Assets } from './resources/assets';
19+
import { AssetListParams, AssetListResponse, Assets, File, Folder } from './resources/assets';
2020
import {
2121
CustomMetadataField,
2222
CustomMetadataFieldCreateParams,
@@ -38,7 +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,
41+
File as FilesAPIFile,
4242
FileCopyParams,
4343
FileCopyResponse,
4444
FileMoveParams,
@@ -50,7 +50,7 @@ import {
5050
FileUploadParams,
5151
FileUploadResponse,
5252
Files,
53-
Folder,
53+
Folder as FilesAPIFolder,
5454
} from './resources/files/files';
5555
import {
5656
FolderCopyParams,
@@ -827,8 +827,8 @@ export declare namespace ImageKit {
827827

828828
export {
829829
Files as Files,
830-
type File as File,
831-
type Folder as Folder,
830+
type FilesAPIFile as File,
831+
type FilesAPIFolder as Folder,
832832
type FileUpdateResponse as FileUpdateResponse,
833833
type FileCopyResponse as FileCopyResponse,
834834
type FileMoveResponse as FileMoveResponse,
@@ -843,6 +843,8 @@ export declare namespace ImageKit {
843843

844844
export {
845845
Assets as Assets,
846+
type File as File,
847+
type Folder as Folder,
846848
type AssetListResponse as AssetListResponse,
847849
type AssetListParams as AssetListParams,
848850
};

src/resources/assets.ts

Lines changed: 196 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 FilesAPI from './files/files';
54
import { APIPromise } from '../core/api-promise';
65
import { RequestOptions } from '../internal/request-options';
76

@@ -20,7 +19,196 @@ export class Assets extends APIResource {
2019
}
2120
}
2221

23-
export type AssetListResponse = Array<FilesAPI.File | FilesAPI.Folder>;
22+
/**
23+
* Object containing details of a file or file version.
24+
*/
25+
export interface File {
26+
/**
27+
* An array of tags assigned to the file by auto tagging.
28+
*/
29+
AITags?: Array<File.AITag> | null;
30+
31+
/**
32+
* Date and time when the file was uploaded. The date and time is in ISO8601
33+
* format.
34+
*/
35+
createdAt?: string;
36+
37+
/**
38+
* An string with custom coordinates of the file.
39+
*/
40+
customCoordinates?: string | null;
41+
42+
/**
43+
* An object with custom metadata for the file.
44+
*/
45+
customMetadata?: { [key: string]: unknown };
46+
47+
/**
48+
* Unique identifier of the asset.
49+
*/
50+
fileId?: string;
51+
52+
/**
53+
* Path of the file. This is the path you would use in the URL to access the file.
54+
* For example, if the file is at the root of the media library, the path will be
55+
* `/file.jpg`. If the file is inside a folder named `images`, the path will be
56+
* `/images/file.jpg`.
57+
*/
58+
filePath?: string;
59+
60+
/**
61+
* Type of the file. Possible values are `image`, `non-image`.
62+
*/
63+
fileType?: string;
64+
65+
/**
66+
* Specifies if the image has an alpha channel.
67+
*/
68+
hasAlpha?: boolean;
69+
70+
/**
71+
* Height of the file.
72+
*/
73+
height?: number;
74+
75+
/**
76+
* Specifies if the file is private or not.
77+
*/
78+
isPrivateFile?: boolean;
79+
80+
/**
81+
* Specifies if the file is published or not.
82+
*/
83+
isPublished?: boolean;
84+
85+
/**
86+
* MIME type of the file.
87+
*/
88+
mime?: string;
89+
90+
/**
91+
* Name of the asset.
92+
*/
93+
name?: string;
94+
95+
/**
96+
* Size of the file in bytes.
97+
*/
98+
size?: number;
99+
100+
/**
101+
* An array of tags assigned to the file. Tags are used to search files in the
102+
* media library.
103+
*/
104+
tags?: Array<string> | null;
105+
106+
/**
107+
* URL of the thumbnail image. This URL is used to access the thumbnail image of
108+
* the file in the media library.
109+
*/
110+
thumbnail?: string;
111+
112+
/**
113+
* Type of the asset.
114+
*/
115+
type?: 'file' | 'file-version';
116+
117+
/**
118+
* Date and time when the file was last updated. The date and time is in ISO8601
119+
* format.
120+
*/
121+
updatedAt?: string;
122+
123+
/**
124+
* URL of the file.
125+
*/
126+
url?: string;
127+
128+
/**
129+
* An object with details of the file version.
130+
*/
131+
versionInfo?: File.VersionInfo;
132+
133+
/**
134+
* Width of the file.
135+
*/
136+
width?: number;
137+
}
138+
139+
export namespace File {
140+
export interface AITag {
141+
/**
142+
* Confidence score of the tag.
143+
*/
144+
confidence?: number;
145+
146+
/**
147+
* Name of the tag.
148+
*/
149+
name?: string;
150+
151+
/**
152+
* Source of the tag. Possible values are `google-auto-tagging` and
153+
* `aws-auto-tagging`.
154+
*/
155+
source?: string;
156+
}
157+
158+
/**
159+
* An object with details of the file version.
160+
*/
161+
export interface VersionInfo {
162+
/**
163+
* Unique identifier of the file version.
164+
*/
165+
id?: string;
166+
167+
/**
168+
* Name of the file version.
169+
*/
170+
name?: string;
171+
}
172+
}
173+
174+
export interface Folder {
175+
/**
176+
* Date and time when the folder was created. The date and time is in ISO8601
177+
* format.
178+
*/
179+
createdAt?: string;
180+
181+
/**
182+
* Unique identifier of the asset.
183+
*/
184+
folderId?: string;
185+
186+
/**
187+
* Path of the folder. This is the path you would use in the URL to access the
188+
* folder. For example, if the folder is at the root of the media library, the path
189+
* will be /folder. If the folder is inside another folder named images, the path
190+
* will be /images/folder.
191+
*/
192+
folderPath?: string;
193+
194+
/**
195+
* Name of the asset.
196+
*/
197+
name?: string;
198+
199+
/**
200+
* Type of the asset.
201+
*/
202+
type?: 'folder';
203+
204+
/**
205+
* Date and time when the folder was last updated. The date and time is in ISO8601
206+
* format.
207+
*/
208+
updatedAt?: string;
209+
}
210+
211+
export type AssetListResponse = Array<File | Folder>;
24212

25213
export interface AssetListParams {
26214
/**
@@ -101,5 +289,10 @@ export interface AssetListParams {
101289
}
102290

103291
export declare namespace Assets {
104-
export { type AssetListResponse as AssetListResponse, type AssetListParams as AssetListParams };
292+
export {
293+
type File as File,
294+
type Folder as Folder,
295+
type AssetListResponse as AssetListResponse,
296+
type AssetListParams as AssetListParams,
297+
};
105298
}

src/resources/files/files.ts

Lines changed: 3 additions & 2 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 AssetsAPI from '../assets';
45
import * as BulkAPI from './bulk';
56
import {
67
Bulk,
@@ -107,7 +108,7 @@ export class Files extends APIResource {
107108
* const file = await client.files.get('fileId');
108109
* ```
109110
*/
110-
get(fileID: string, options?: RequestOptions): APIPromise<File> {
111+
get(fileID: string, options?: RequestOptions): APIPromise<AssetsAPI.File> {
111112
return this._client.get(path`/v1/files/${fileID}/details`, options);
112113
}
113114

@@ -388,7 +389,7 @@ export interface Folder {
388389
/**
389390
* Object containing details of a file or file version.
390391
*/
391-
export interface FileUpdateResponse extends File {
392+
export interface FileUpdateResponse extends AssetsAPI.File {
392393
extensionStatus?: FileUpdateResponse.ExtensionStatus;
393394
}
394395

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 AssetsAPI from '../assets';
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<AssetsAPI.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<AssetsAPI.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<AssetsAPI.File>;
8282

8383
export interface VersionDeleteResponse {}
8484

src/resources/index.ts

Lines changed: 1 addition & 1 deletion
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
export { Accounts } from './accounts/accounts';
4-
export { Assets, type AssetListResponse, type AssetListParams } from './assets';
4+
export { Assets, type File, type Folder, type AssetListResponse, type AssetListParams } from './assets';
55
export { Beta } from './beta/beta';
66
export { Cache } from './cache/cache';
77
export {

0 commit comments

Comments
 (0)