diff --git a/package.json b/package.json index 087c7596..4a574c1a 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@internxt/sdk", "author": "Internxt ", - "version": "1.23.3", + "version": "1.24.0", "description": "An sdk for interacting with Internxt's services", "repository": { "type": "git", diff --git a/src/drive/storage/index.ts b/src/drive/storage/index.ts index d41f0559..5adb8a35 100644 --- a/src/drive/storage/index.ts +++ b/src/drive/storage/index.ts @@ -9,7 +9,6 @@ import { CheckDuplicatedFilesPayload, CheckDuplicatedFilesResponse, CheckDuplicatedFolderPayload, - CheckDuplicatedFoldersResponse, CreateFolderByUuidPayload, CreateFolderPayload, CreateFolderResponse, @@ -24,6 +23,9 @@ import { FetchFolderContentResponse, FetchFolderFilesCursorResponse, FetchFolderFoldersCursorResponse, + FetchExistentFoldersResponse, + FetchFolderByPathResponse, + FetchFolderMetaResponse, FetchFoldersSyncResponse, FetchLimitResponse, FetchPaginatedFilesContent, @@ -831,16 +833,20 @@ export class Storage { * Gets the meta of a given folder UUID * * @param {string} folderUUID - UUID of the folder. - * @returns {Promise} + * @returns {Promise} */ - public getFolderMeta(uuid: string, workspacesToken?: string, resourcesToken?: string): Promise { + public getFolderMeta( + uuid: string, + workspacesToken?: string, + resourcesToken?: string, + ): Promise { const customHeaders = workspacesToken ? { 'x-internxt-workspace': workspacesToken, } : undefined; - return this.client.get( + return this.client.get( `folders/${uuid}/meta`, addResourcesTokenToHeaders(this.headers(customHeaders), resourcesToken), ); @@ -928,12 +934,12 @@ export class Storage { * Checks if the given folders names already exist in the given folder * * @param {CheckDuplicatedFolderPayload} payload - Payload containing the folder UUID and the list of folders to check. - * @return {Promise} - Promise that contains the duplicated folders in a list. + * @return {Promise} - Promise that contains the duplicated folders in a list. */ public checkDuplicatedFolders({ folderUuid, folderNamesList, - }: CheckDuplicatedFolderPayload): Promise { + }: CheckDuplicatedFolderPayload): Promise { return this.client.post( `/folders/content/${folderUuid}/folders/existence`, { @@ -947,11 +953,11 @@ export class Storage { * Gets the folder meta from a given path (e.g. "/folder1/folder2") * * @param {string} folderPath - The path of the folder. - * @returns {Promise} A promise that resolves the folder on that path. + * @returns {Promise} A promise that resolves the folder on that path. */ - public getFolderByPath(folderPath: string): Promise { + public getFolderByPath(folderPath: string): Promise { const query = new URLSearchParams({ path: folderPath }); - return this.client.get(`folders/meta?${query}`, this.headers()); + return this.client.get(`folders/meta?${query}`, this.headers()); } /** diff --git a/src/drive/storage/types.ts b/src/drive/storage/types.ts index 104dd061..190a01f0 100644 --- a/src/drive/storage/types.ts +++ b/src/drive/storage/types.ts @@ -193,6 +193,15 @@ export type FetchFolderFilesCursorResponse = export type FetchFolderFoldersCursorResponse = paths['/folders/v2/content/{uuid}/folders']['get']['responses']['200']['content']['application/json']; +export type FetchFolderMetaResponse = + paths['/folders/{uuid}/meta']['get']['responses']['200']['content']['application/json']; + +export type FetchFolderByPathResponse = + paths['/folders/meta']['get']['responses']['200']['content']['application/json']; + +export type FetchExistentFoldersResponse = + paths['/folders/content/{uuid}/folders/existence']['post']['responses']['200']['content']['application/json']; + export type FilesSyncQuery = NonNullable; export type FoldersSyncQuery = NonNullable;