From a5414dd8c8141a3f8bdda81cf22e0d9694e21c9c Mon Sep 17 00:00:00 2001 From: Francis Terrero Date: Tue, 16 Dec 2025 09:45:09 -0400 Subject: [PATCH] fix: correct return type for restoreFileVersion method Updated restoreFileVersion method to return RestoreFileVersionResponse (FileDto) instead of FileVersion to match the actual API endpoint response type. --- package.json | 2 +- src/drive/storage/index.ts | 11 ++++++++--- src/drive/storage/types.ts | 3 +++ src/schema.ts | 7 ++++++- 4 files changed, 18 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 4ca6cd3..254b6c4 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@internxt/sdk", "author": "Internxt ", - "version": "1.11.21", + "version": "1.11.22", "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 e523d97..169d248 100644 --- a/src/drive/storage/index.ts +++ b/src/drive/storage/index.ts @@ -37,6 +37,7 @@ import { MoveFolderResponse, MoveFolderUuidPayload, ReplaceFile, + RestoreFileVersionResponse, SearchResultData, Thumbnail, ThumbnailEntry, @@ -881,10 +882,14 @@ export class Storage { * * @param {string} uuid - The UUID of the file. * @param {string} versionId - The UUID of the version to restore. - * @returns {Promise} A promise that resolves with the restored version. + * @returns {Promise} A promise that resolves with the restored file. */ - public restoreFileVersion(uuid: string, versionId: string): Promise { - return this.client.post(`/files/${uuid}/versions/${versionId}/restore`, {}, this.headers()); + public restoreFileVersion(uuid: string, versionId: string): Promise { + return this.client.post( + `/files/${uuid}/versions/${versionId}/restore`, + {}, + this.headers(), + ); } /** diff --git a/src/drive/storage/types.ts b/src/drive/storage/types.ts index 13a8327..ba701ca 100644 --- a/src/drive/storage/types.ts +++ b/src/drive/storage/types.ts @@ -469,4 +469,7 @@ export interface CheckDuplicatedFoldersResponse { export type FileVersion = paths['/files/{uuid}/versions']['get']['responses']['200']['content']['application/json'][0]; +export type RestoreFileVersionResponse = + paths['/files/{uuid}/versions/{versionId}/restore']['post']['responses']['200']['content']['application/json']; + export type GetFileLimitsResponse = paths['/files/limits']['get']['responses']['200']['content']['application/json']; diff --git a/src/schema.ts b/src/schema.ts index 931535c..b84b8d4 100644 --- a/src/schema.ts +++ b/src/schema.ts @@ -3160,6 +3160,11 @@ export interface components { createdAt: string; /** Format: date-time */ updatedAt: string; + /** + * Format: date-time + * @description Date when this version expires based on retention policy + */ + expiresAt: string; }; ReplaceFileDto: { /** @@ -5299,7 +5304,7 @@ export interface operations { [name: string]: unknown; }; content: { - 'application/json': components['schemas']['FileVersionDto']; + 'application/json': components['schemas']['FileDto']; }; }; };