-
Notifications
You must be signed in to change notification settings - Fork 39
Closed
Description
The response type for the listFIiles API is only valid for file objects, but if the API is used to fetch folders the response will be different, for example:
{
type: 'folder',
name: 'folder-name',
createdAt: '2024-12-02T20:54:59.433Z',
updatedAt: '2024-12-02T20:54:59.433Z',
folderId: '674e1ea3e375273f609c',
folderPath: '/path/to/folder'
}Unfortunately this is not even documented in the official API documentation of ImageKit. And there might even be a third response type for file-version. All available types according to the docs are:
filefile-versionfolderall
From the top of my head a solution to this would be making the response type dependent on the input type parameter (with all returning a union of all types). This should be quite clean and users can easily narrow down type using type in each object.
imagekitio and ahnv
Metadata
Metadata
Assignees
Labels
No labels