@internxt/sdk 1.9.24 → 1.9.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -126,8 +126,16 @@ export declare class Storage {
126
126
  /**
127
127
  * Removes a specific folder from the centralized persistence
128
128
  * @param folderId
129
+ * @deprecated Use `deleteFolderByUuid` instead.
129
130
  */
130
131
  deleteFolder(folderId: number): Promise<unknown>;
132
+ /**
133
+ * Deletes a folder from the storage system using its unique identifier (UUID).
134
+ *
135
+ * @param folderId - The UUID of the folder to be deleted.
136
+ * @returns A promise that resolves with the response of the delete operation.
137
+ */
138
+ deleteFolderByUuid(folderId: string): Promise<void>;
131
139
  /**
132
140
  * Returns the total size of a folder
133
141
  * @param folderId
@@ -188,8 +196,18 @@ export declare class Storage {
188
196
  /**
189
197
  * Deletes a specific file entry
190
198
  * @param payload
199
+ * @deprecated Use `deleteFileByUuid` instead.
191
200
  */
192
201
  deleteFile(payload: DeleteFilePayload): Promise<unknown>;
202
+ /**
203
+ * Deletes a file from the storage system using its unique identifier (UUID).
204
+ *
205
+ * @param fileId - The UUID of the file to be deleted.
206
+ * @returns A promise that resolves with the response of the delete operation.
207
+ */
208
+ deleteFileByUuid(fileId: string): Promise<{
209
+ deleted: boolean;
210
+ }>;
193
211
  /**
194
212
  * Updates the persisted path of a file entry
195
213
  * @param payload
@@ -248,9 +266,10 @@ export declare class Storage {
248
266
  *
249
267
  * @param {string} search - The name of the item.
250
268
  * @param {string} workspaceId - The ID of the workspace (optional).
269
+ * @param {number} offset - The position of the first item to return (optional).
251
270
  * @returns {[Promise<SearchResultData>, RequestCanceler]} An array containing a promise to get the API response and a function to cancel the request.
252
271
  */
253
- getGlobalSearchItems(search: string, workspaceId?: string): [Promise<SearchResultData>, RequestCanceler];
272
+ getGlobalSearchItems(search: string, workspaceId?: string, offset?: number): [Promise<SearchResultData>, RequestCanceler];
254
273
  /**
255
274
  * Returns the needed headers for the module requests
256
275
  * @private
@@ -313,10 +313,20 @@ var Storage = /** @class */ (function () {
313
313
  /**
314
314
  * Removes a specific folder from the centralized persistence
315
315
  * @param folderId
316
+ * @deprecated Use `deleteFolderByUuid` instead.
316
317
  */
317
318
  Storage.prototype.deleteFolder = function (folderId) {
318
319
  return this.client.delete("/storage/folder/".concat(folderId), this.headers());
319
320
  };
321
+ /**
322
+ * Deletes a folder from the storage system using its unique identifier (UUID).
323
+ *
324
+ * @param folderId - The UUID of the folder to be deleted.
325
+ * @returns A promise that resolves with the response of the delete operation.
326
+ */
327
+ Storage.prototype.deleteFolderByUuid = function (folderId) {
328
+ return this.client.delete("/folders/".concat(folderId), this.headers());
329
+ };
320
330
  /**
321
331
  * Returns the total size of a folder
322
332
  * @param folderId
@@ -420,10 +430,20 @@ var Storage = /** @class */ (function () {
420
430
  /**
421
431
  * Deletes a specific file entry
422
432
  * @param payload
433
+ * @deprecated Use `deleteFileByUuid` instead.
423
434
  */
424
435
  Storage.prototype.deleteFile = function (payload) {
425
436
  return this.client.delete("/storage/folder/".concat(payload.folderId, "/file/").concat(payload.fileId), this.headers());
426
437
  };
438
+ /**
439
+ * Deletes a file from the storage system using its unique identifier (UUID).
440
+ *
441
+ * @param fileId - The UUID of the file to be deleted.
442
+ * @returns A promise that resolves with the response of the delete operation.
443
+ */
444
+ Storage.prototype.deleteFileByUuid = function (fileId) {
445
+ return this.client.delete("/files/".concat(fileId), this.headers());
446
+ };
427
447
  /**
428
448
  * Updates the persisted path of a file entry
429
449
  * @param payload
@@ -522,12 +542,16 @@ var Storage = /** @class */ (function () {
522
542
  *
523
543
  * @param {string} search - The name of the item.
524
544
  * @param {string} workspaceId - The ID of the workspace (optional).
545
+ * @param {number} offset - The position of the first item to return (optional).
525
546
  * @returns {[Promise<SearchResultData>, RequestCanceler]} An array containing a promise to get the API response and a function to cancel the request.
526
547
  */
527
- Storage.prototype.getGlobalSearchItems = function (search, workspaceId) {
548
+ Storage.prototype.getGlobalSearchItems = function (search, workspaceId, offset) {
549
+ var query = new URLSearchParams();
550
+ if (offset !== undefined)
551
+ query.set('offset', String(offset));
528
552
  var _a = workspaceId
529
- ? this.client.getCancellable("workspaces/".concat(workspaceId, "/fuzzy/").concat(search), this.headers())
530
- : this.client.getCancellable("fuzzy/".concat(search), this.headers()), promise = _a.promise, requestCanceler = _a.requestCanceler;
553
+ ? this.client.getCancellable("workspaces/".concat(workspaceId, "/fuzzy/").concat(search, "?").concat(query), this.headers())
554
+ : this.client.getCancellable("fuzzy/".concat(search, "?").concat(query), this.headers()), promise = _a.promise, requestCanceler = _a.requestCanceler;
531
555
  return [promise, requestCanceler];
532
556
  };
533
557
  /**
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@internxt/sdk",
3
3
  "author": "Internxt <hello@internxt.com>",
4
- "version": "1.9.24",
4
+ "version": "1.9.26",
5
5
  "description": "An sdk for interacting with Internxt's services",
6
6
  "repository": {
7
7
  "type": "git",