@internxt/sdk 1.11.4 → 1.11.6

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.
@@ -24,13 +24,14 @@ export declare class Storage {
24
24
  /**
25
25
  * Moves a specific folder to a new location
26
26
  * @param payload
27
+ * @deprecated Use `moveFolderByUuid` instead.
27
28
  */
28
29
  moveFolder(payload: MoveFolderPayload): Promise<MoveFolderResponse>;
29
30
  /**
30
31
  * Moves a specific folder to a new location
31
32
  * @param payload
32
33
  */
33
- moveFolderByUuid(payload: MoveFolderUuidPayload): Promise<FolderMeta>;
34
+ moveFolderByUuid(uuid: string, payload: MoveFolderUuidPayload): Promise<FolderMeta>;
34
35
  /**
35
36
  * Updates the metadata of a folder
36
37
  * @param payload
@@ -144,6 +145,7 @@ export declare class Storage {
144
145
  /**
145
146
  * Creates a new file entry
146
147
  * @param fileEntry
148
+ * @deprecated Use `createFileEntryByUuid` instead.
147
149
  */
148
150
  createFileEntry(fileEntry: FileEntry, resourcesToken?: Token): Promise<DriveFileData>;
149
151
  /**
@@ -211,13 +213,14 @@ export declare class Storage {
211
213
  /**
212
214
  * Updates the persisted path of a file entry
213
215
  * @param payload
216
+ * @deprecated Use `moveFileByUuid` instead.
214
217
  */
215
218
  moveFile(payload: MoveFilePayload): Promise<MoveFileResponse>;
216
219
  /**
217
220
  * Moves a specific file to a new location
218
221
  * @param payload
219
222
  */
220
- moveFileByUuid(payload: MoveFileUuidPayload): Promise<FileMeta>;
223
+ moveFileByUuid(uuid: string, payload: MoveFileUuidPayload): Promise<FileMeta>;
221
224
  /**
222
225
  * Returns a list of the n most recent files
223
226
  * @param limit
@@ -118,6 +118,7 @@ var Storage = /** @class */ (function () {
118
118
  /**
119
119
  * Moves a specific folder to a new location
120
120
  * @param payload
121
+ * @deprecated Use `moveFolderByUuid` instead.
121
122
  */
122
123
  Storage.prototype.moveFolder = function (payload) {
123
124
  return __awaiter(this, void 0, void 0, function () {
@@ -133,12 +134,10 @@ var Storage = /** @class */ (function () {
133
134
  * Moves a specific folder to a new location
134
135
  * @param payload
135
136
  */
136
- Storage.prototype.moveFolderByUuid = function (payload) {
137
+ Storage.prototype.moveFolderByUuid = function (uuid, payload) {
137
138
  return __awaiter(this, void 0, void 0, function () {
138
139
  return __generator(this, function (_a) {
139
- return [2 /*return*/, this.client.patch("/folders/".concat(payload.folderUuid), {
140
- destinationFolder: payload.destinationFolderUuid,
141
- }, this.headers())];
140
+ return [2 /*return*/, this.client.patch("/folders/".concat(uuid), payload, this.headers())];
142
141
  });
143
142
  });
144
143
  };
@@ -351,6 +350,7 @@ var Storage = /** @class */ (function () {
351
350
  /**
352
351
  * Creates a new file entry
353
352
  * @param fileEntry
353
+ * @deprecated Use `createFileEntryByUuid` instead.
354
354
  */
355
355
  Storage.prototype.createFileEntry = function (fileEntry, resourcesToken) {
356
356
  return this.client.post('/storage/file', {
@@ -371,16 +371,7 @@ var Storage = /** @class */ (function () {
371
371
  * @param fileEntry
372
372
  */
373
373
  Storage.prototype.createFileEntryByUuid = function (fileEntry, resourcesToken) {
374
- return this.client.post('/files', {
375
- name: fileEntry.name,
376
- bucket: fileEntry.bucket,
377
- fileId: fileEntry.id,
378
- encryptVersion: fileEntry.encrypt_version,
379
- folderUuid: fileEntry.folder_id,
380
- size: fileEntry.size,
381
- plainName: fileEntry.plain_name,
382
- type: fileEntry.type,
383
- }, (0, headers_1.addResourcesTokenToHeaders)(this.headers(), resourcesToken));
374
+ return this.client.post('/files', fileEntry, (0, headers_1.addResourcesTokenToHeaders)(this.headers(), resourcesToken));
384
375
  };
385
376
  /**
386
377
  * Creates a new thumbnail entry
@@ -457,6 +448,7 @@ var Storage = /** @class */ (function () {
457
448
  /**
458
449
  * Updates the persisted path of a file entry
459
450
  * @param payload
451
+ * @deprecated Use `moveFileByUuid` instead.
460
452
  */
461
453
  Storage.prototype.moveFile = function (payload) {
462
454
  return this.client.post('/storage/move/file', {
@@ -470,12 +462,10 @@ var Storage = /** @class */ (function () {
470
462
  * Moves a specific file to a new location
471
463
  * @param payload
472
464
  */
473
- Storage.prototype.moveFileByUuid = function (payload) {
465
+ Storage.prototype.moveFileByUuid = function (uuid, payload) {
474
466
  return __awaiter(this, void 0, void 0, function () {
475
467
  return __generator(this, function (_a) {
476
- return [2 /*return*/, this.client.patch("/files/".concat(payload.fileUuid), {
477
- destinationFolder: payload.destinationFolderUuid,
478
- }, this.headers())];
468
+ return [2 /*return*/, this.client.patch("/files/".concat(uuid), payload, this.headers())];
479
469
  });
480
470
  });
481
471
  };
@@ -266,16 +266,7 @@ export interface FileEntry {
266
266
  folder_id: number;
267
267
  encrypt_version: EncryptionVersion;
268
268
  }
269
- export interface FileEntryByUuid {
270
- id: string;
271
- type: string;
272
- size: number;
273
- name: string;
274
- plain_name: string;
275
- bucket: string;
276
- folder_id: string;
277
- encrypt_version: EncryptionVersion;
278
- }
269
+ export type FileEntryByUuid = paths['/files']['post']['requestBody']['content']['application/json'];
279
270
  export interface ThumbnailEntry {
280
271
  file_id: number;
281
272
  max_width: number;
@@ -327,10 +318,7 @@ export interface MoveFolderPayload {
327
318
  folderId: number;
328
319
  destinationFolderId: number;
329
320
  }
330
- export interface MoveFolderUuidPayload {
331
- folderUuid: string;
332
- destinationFolderUuid: string;
333
- }
321
+ export type MoveFolderUuidPayload = paths['/folders/{uuid}']['patch']['requestBody']['content']['application/json'];
334
322
  export interface MoveFolderResponse {
335
323
  item: DriveFolderData;
336
324
  destination: number;
@@ -362,10 +350,7 @@ export interface MoveFilePayload {
362
350
  destinationPath: string;
363
351
  bucketId: string;
364
352
  }
365
- export interface MoveFileUuidPayload {
366
- fileUuid: string;
367
- destinationFolderUuid: string;
368
- }
353
+ export type MoveFileUuidPayload = paths['/files/{uuid}']['patch']['requestBody']['content']['application/json'];
369
354
  export interface MoveFileResponse {
370
355
  item: DriveFileData;
371
356
  destination: number;