From e4559e99e3bc3905c5e50d698e47f3589b3a4943 Mon Sep 17 00:00:00 2001 From: Francis Terrero Date: Thu, 8 Jan 2026 00:23:52 -0400 Subject: [PATCH] feat(storage): add folder stats endpoint - add FolderStatsResponse type and getFolderStats client - refresh OpenAPI schema and bump version to 1.11.27 --- package.json | 2 +- src/drive/storage/index.ts | 11 +++++++++++ src/drive/storage/types.ts | 2 ++ src/schema.ts | 8 ++++---- 4 files changed, 18 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index cbb24a3..75dd4ff 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@internxt/sdk", "author": "Internxt ", - "version": "1.11.26", + "version": "1.11.27", "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 2279e70..148befa 100644 --- a/src/drive/storage/index.ts +++ b/src/drive/storage/index.ts @@ -28,6 +28,7 @@ import { FolderAncestor, FolderAncestorWorkspace, FolderMeta, + FolderStatsResponse, FolderTreeResponse, FileLimitsResponse, MoveFilePayload, @@ -749,6 +750,16 @@ export class Storage { ); } + /** + * Gets the stats of a given folder UUID + * + * @param {string} uuid - UUID of the folder. + * @returns {Promise} + */ + public getFolderStats(uuid: string): Promise { + return this.client.get(`folders/${uuid}/stats`, this.headers()); + } + /** * Gets the meta of a given folder Id * diff --git a/src/drive/storage/types.ts b/src/drive/storage/types.ts index b83ec64..e86af12 100644 --- a/src/drive/storage/types.ts +++ b/src/drive/storage/types.ts @@ -114,6 +114,8 @@ export interface FetchFolderContentResponse { } export type FileMeta = paths['/files/{uuid}/meta']['get']['responses']['200']['content']['application/json']; +export type FolderStatsResponse = + paths['/folders/{uuid}/stats']['get']['responses']['200']['content']['application/json']; export interface ShareLink { id: string; diff --git a/src/schema.ts b/src/schema.ts index fad1e57..057de85 100644 --- a/src/schema.ts +++ b/src/schema.ts @@ -3062,7 +3062,7 @@ export interface components { */ bucket: string; /** - * @description The ID of the file (required when size > 0) + * @description The ID of the file (required when size > 0, must not be provided when size = 0) * @example file12345 */ fileId?: string; @@ -3168,7 +3168,7 @@ export interface components { }; ReplaceFileDto: { /** - * @description File id (required when size > 0) + * @description File id (required when size > 0, must not be provided when size = 0) * @example 651300a2da9b27001f63f384 */ fileId?: string; @@ -3904,7 +3904,7 @@ export interface components { */ bucket: string; /** - * @description The ID of the file (required when size > 0) + * @description The ID of the file (required when size > 0, must not be provided when size = 0) * @example file12345 */ fileId?: string; @@ -8697,7 +8697,7 @@ export interface operations { }; }; responses: { - /** @description Incomplete checkout email sent successfully */ + /** @description Incomplete checkout processed successfully */ 200: { headers: { [name: string]: unknown;