@internxt/sdk 1.5.25 → 1.6.4
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.
- package/dist/auth/index.d.ts +127 -122
- package/dist/auth/index.js +378 -310
- package/dist/auth/types.d.ts +65 -54
- package/dist/auth/types.js +26 -26
- package/dist/drive/backups/index.d.ts +18 -18
- package/dist/drive/backups/index.js +40 -40
- package/dist/drive/backups/types.d.ts +27 -27
- package/dist/drive/backups/types.js +2 -2
- package/dist/drive/index.d.ts +7 -7
- package/dist/drive/index.js +23 -19
- package/dist/drive/payments/index.d.ts +66 -71
- package/dist/drive/payments/index.js +206 -208
- package/dist/drive/payments/types.d.ts +180 -176
- package/dist/drive/payments/types.js +37 -37
- package/dist/drive/referrals/index.d.ts +19 -19
- package/dist/drive/referrals/index.js +54 -50
- package/dist/drive/referrals/types.d.ts +21 -21
- package/dist/drive/referrals/types.js +18 -18
- package/dist/drive/share/index.d.ts +319 -319
- package/dist/drive/share/index.js +544 -540
- package/dist/drive/share/types.d.ts +360 -360
- package/dist/drive/share/types.js +2 -2
- package/dist/drive/storage/index.d.ts +315 -315
- package/dist/drive/storage/index.js +634 -630
- package/dist/drive/storage/types.d.ts +480 -473
- package/dist/drive/storage/types.js +13 -13
- package/dist/drive/trash/index.d.ts +75 -75
- package/dist/drive/trash/index.js +184 -180
- package/dist/drive/trash/types.d.ts +29 -29
- package/dist/drive/trash/types.js +2 -2
- package/dist/drive/users/index.d.ts +135 -135
- package/dist/drive/users/index.js +208 -204
- package/dist/drive/users/types.d.ts +53 -51
- package/dist/drive/users/types.js +2 -2
- package/dist/index.d.ts +6 -6
- package/dist/index.js +35 -31
- package/dist/network/download.d.ts +8 -8
- package/dist/network/download.js +123 -123
- package/dist/network/errors/codes.d.ts +24 -24
- package/dist/network/errors/codes.js +48 -48
- package/dist/network/errors/context.d.ts +35 -35
- package/dist/network/errors/context.js +39 -39
- package/dist/network/errors/download.d.ts +4 -4
- package/dist/network/errors/download.js +52 -48
- package/dist/network/errors/index.d.ts +3 -3
- package/dist/network/errors/index.js +19 -15
- package/dist/network/errors/upload.d.ts +13 -13
- package/dist/network/errors/upload.js +82 -78
- package/dist/network/index.d.ts +70 -70
- package/dist/network/index.js +315 -311
- package/dist/network/types.d.ts +102 -102
- package/dist/network/types.js +18 -18
- package/dist/network/upload.d.ts +4 -4
- package/dist/network/upload.js +158 -159
- package/dist/photos/devices/index.d.ts +10 -10
- package/dist/photos/devices/index.js +79 -79
- package/dist/photos/index.d.ts +17 -17
- package/dist/photos/index.js +56 -52
- package/dist/photos/photos/index.d.ts +60 -60
- package/dist/photos/photos/index.js +225 -225
- package/dist/photos/shares/index.d.ts +8 -8
- package/dist/photos/shares/index.js +34 -34
- package/dist/photos/types.d.ts +154 -154
- package/dist/photos/types.js +19 -19
- package/dist/photos/users/index.d.ts +7 -7
- package/dist/photos/users/index.js +46 -46
- package/dist/shared/headers/index.d.ts +21 -21
- package/dist/shared/headers/index.js +78 -79
- package/dist/shared/http/client.d.ts +85 -85
- package/dist/shared/http/client.js +172 -172
- package/dist/shared/http/types.d.ts +7 -7
- package/dist/shared/http/types.js +2 -2
- package/dist/shared/index.d.ts +1 -1
- package/dist/shared/index.js +17 -13
- package/dist/shared/types/apiConnection.d.ts +12 -12
- package/dist/shared/types/apiConnection.js +2 -2
- package/dist/shared/types/appsumo.d.ts +16 -16
- package/dist/shared/types/appsumo.js +12 -12
- package/dist/shared/types/errors.d.ts +5 -5
- package/dist/shared/types/errors.js +28 -28
- package/dist/shared/types/teams.d.ts +9 -9
- package/dist/shared/types/teams.js +2 -2
- package/dist/shared/types/userSettings.d.ts +43 -29
- package/dist/shared/types/userSettings.js +2 -2
- package/dist/utils.d.ts +3 -3
- package/dist/utils.js +24 -25
- package/dist/workspaces/index.d.ts +176 -176
- package/dist/workspaces/index.js +419 -415
- package/dist/workspaces/index.test.d.ts +1 -1
- package/dist/workspaces/index.test.js +908 -903
- package/dist/workspaces/types.d.ts +294 -291
- package/dist/workspaces/types.js +2 -2
- package/package.json +13 -13
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -1,315 +1,315 @@
|
|
|
1
|
-
import { Token } from '../../auth';
|
|
2
|
-
import { ApiSecurity, ApiUrl, AppDetails } from '../../shared';
|
|
3
|
-
import { RequestCanceler } from '../../shared/http/client';
|
|
4
|
-
import { UUID } from '../../shared/types/userSettings';
|
|
5
|
-
import { AddItemsToTrashPayload, CheckDuplicatedFilesPayload, CheckDuplicatedFilesResponse, CheckDuplicatedFolderPayload, CheckDuplicatedFoldersResponse, CreateFolderByUuidPayload, CreateFolderPayload, CreateFolderResponse, DeleteFilePayload, DriveFileData, FetchFolderContentResponse, FetchLimitResponse, FetchPaginatedFilesContent, FetchPaginatedFolderContentResponse, FetchPaginatedFoldersContent, FileEntry, FileEntryByUuid, FileMeta, FolderAncestor, FolderMeta, FolderTreeResponse, MoveFilePayload, MoveFileResponse, MoveFileUuidPayload, MoveFolderPayload, MoveFolderResponse, MoveFolderUuidPayload, ReplaceFile, SearchResultData, Thumbnail, ThumbnailEntry, UpdateFilePayload, UpdateFolderMetadataPayload, UsageResponse } from './types';
|
|
6
|
-
export * as StorageTypes from './types';
|
|
7
|
-
export declare class Storage {
|
|
8
|
-
private readonly client;
|
|
9
|
-
private readonly appDetails;
|
|
10
|
-
private readonly apiSecurity;
|
|
11
|
-
static client(apiUrl: ApiUrl, appDetails: AppDetails, apiSecurity: ApiSecurity): Storage;
|
|
12
|
-
private constructor();
|
|
13
|
-
/**
|
|
14
|
-
* Creates a new folder
|
|
15
|
-
* @param payload
|
|
16
|
-
*/
|
|
17
|
-
createFolder(payload: CreateFolderPayload): [Promise<CreateFolderResponse>, RequestCanceler];
|
|
18
|
-
/**
|
|
19
|
-
* Creates a new folder
|
|
20
|
-
* @param payload
|
|
21
|
-
*/
|
|
22
|
-
createFolderByUuid(payload: CreateFolderByUuidPayload): [Promise<CreateFolderResponse>, RequestCanceler];
|
|
23
|
-
/**
|
|
24
|
-
* Moves a specific folder to a new location
|
|
25
|
-
* @param payload
|
|
26
|
-
*/
|
|
27
|
-
moveFolder(payload: MoveFolderPayload): Promise<MoveFolderResponse>;
|
|
28
|
-
/**
|
|
29
|
-
* Moves a specific folder to a new location
|
|
30
|
-
* @param payload
|
|
31
|
-
*/
|
|
32
|
-
moveFolderByUuid(payload: MoveFolderUuidPayload): Promise<FolderMeta>;
|
|
33
|
-
/**
|
|
34
|
-
* Updates the metadata of a folder
|
|
35
|
-
* @param payload
|
|
36
|
-
*/
|
|
37
|
-
updateFolder(payload: UpdateFolderMetadataPayload): Promise<void>;
|
|
38
|
-
/**
|
|
39
|
-
* Updates the name of a folder with the given UUID.
|
|
40
|
-
*
|
|
41
|
-
* @param {Object} payload - The payload containing the folder UUID and the new name.
|
|
42
|
-
* @param {string} payload.folderUuid - The UUID of the folder to update.
|
|
43
|
-
* @param {string} payload.name - The new name for the folder.
|
|
44
|
-
* @param {Token} [resourcesToken] - An optional token for authentication.
|
|
45
|
-
* @return {Promise<void>} A promise that resolves when the folder name is successfully updated.
|
|
46
|
-
*/
|
|
47
|
-
updateFolderNameWithUUID(payload: {
|
|
48
|
-
folderUuid: string;
|
|
49
|
-
name: string;
|
|
50
|
-
}, resourcesToken?: Token): Promise<void>;
|
|
51
|
-
/**
|
|
52
|
-
* Fetches & returns the contents of a specific folder
|
|
53
|
-
* @param folderId
|
|
54
|
-
*/
|
|
55
|
-
getFolderContent(folderId: number, trash?: boolean): [Promise<FetchFolderContentResponse>, RequestCanceler];
|
|
56
|
-
/**
|
|
57
|
-
* Fetches and returns the contents of a specific folder by its UUID.
|
|
58
|
-
*
|
|
59
|
-
* @param {string} folderUuid - The UUID of the folder.
|
|
60
|
-
* @param {boolean} [trash=false] - Whether to include trash items in the response.
|
|
61
|
-
* @param {boolean} [offset] - The position of the first file to return.
|
|
62
|
-
* @param {boolean} [limit] - The max number of files to be returned.
|
|
63
|
-
* @param {boolean} [workspacesToken] - Token for accessing workspaces.
|
|
64
|
-
* @return {[Promise<FetchFolderContentResponse>, RequestCanceler]} An array containing a promise to get the API response and a function to cancel the request.
|
|
65
|
-
*/
|
|
66
|
-
getFolderContentByUuid({ folderUuid, trash, offset, limit, workspacesToken, }: {
|
|
67
|
-
folderUuid: string;
|
|
68
|
-
trash?: boolean;
|
|
69
|
-
limit?: number;
|
|
70
|
-
offset?: number;
|
|
71
|
-
workspacesToken?: string;
|
|
72
|
-
}): [Promise<FetchFolderContentResponse>, RequestCanceler];
|
|
73
|
-
/**
|
|
74
|
-
* Retrieves a file with the specified fileId along with the associated workspacesToken.
|
|
75
|
-
*
|
|
76
|
-
* @param {string} fileId - The ID of the file to retrieve.
|
|
77
|
-
* @param {string} [workspacesToken] - Token for accessing workspaces.
|
|
78
|
-
* @return {[Promise<FileMeta>, RequestCanceler]} A promise with FileMeta and a canceler for the request.
|
|
79
|
-
*/
|
|
80
|
-
getFile(fileId: string, workspacesToken?: string): [Promise<FileMeta>, RequestCanceler];
|
|
81
|
-
/**
|
|
82
|
-
* Gets the files in a folder.
|
|
83
|
-
*
|
|
84
|
-
* @param {number} folderId - The ID of the folder.
|
|
85
|
-
* @param {number} [offset=0] - The position of the first file to return.
|
|
86
|
-
* @param {number} [limit=50] - The max number of files to be returned.
|
|
87
|
-
* @param {string} [sort=plainName] - The reference column to sort it.
|
|
88
|
-
* @param {string} [order=ASC] - The order to be followed.
|
|
89
|
-
* @returns {[Promise<FetchPaginatedFolderContentResponse>, RequestCanceler]} An array containing a promise to get the API response and a function to cancel the request.
|
|
90
|
-
*/
|
|
91
|
-
getFolderFiles(folderId: number, offset?: number, limit?: number, sort?: string, order?: string): [Promise<FetchPaginatedFolderContentResponse>, RequestCanceler];
|
|
92
|
-
/**
|
|
93
|
-
* Gets the files in a folder by its UUID.
|
|
94
|
-
*
|
|
95
|
-
* @param {UUID} folderUuid - The UUID of the folder.
|
|
96
|
-
* @param {number} [offset=0] - The position of the first file to return.
|
|
97
|
-
* @param {number} [limit=50] - The max number of files to be returned.
|
|
98
|
-
* @param {string} [sort=plainName] - The reference column to sort it.
|
|
99
|
-
* @param {string} [order=ASC] - The order to be followed.
|
|
100
|
-
* @returns {[Promise<FetchPaginatedFilesContent>, RequestCanceler]} An array containing a promise to get the API response and a function to cancel the request.
|
|
101
|
-
*/
|
|
102
|
-
getFolderFilesByUuid(folderUuid: UUID, offset?: number, limit?: number, sort?: string, order?: string): [Promise<FetchPaginatedFilesContent>, RequestCanceler];
|
|
103
|
-
/**
|
|
104
|
-
* Gets the subfolders of a folder.
|
|
105
|
-
*
|
|
106
|
-
* @param {number} folderId - The ID of the folder.
|
|
107
|
-
* @param {number} [offset=0] - The position of the first subfolder to return.
|
|
108
|
-
* @param {number} [limit=50] - The max number of subfolders to return.
|
|
109
|
-
* @param {string} [sort=plainName] - The reference column to sort it.
|
|
110
|
-
* @param {string} [order=ASC] - The order to be followed.
|
|
111
|
-
* @returns {[Promise<FetchPaginatedFolderContentResponse>, RequestCanceler]} An array containing a promise to get the API response and a function to cancel the request.
|
|
112
|
-
*/
|
|
113
|
-
getFolderFolders(folderId: number, offset?: number, limit?: number, sort?: string, order?: string): [Promise<FetchPaginatedFolderContentResponse>, RequestCanceler];
|
|
114
|
-
/**
|
|
115
|
-
* Gets the subfolders of a folder by its UUID.
|
|
116
|
-
*
|
|
117
|
-
* @param {UUID} folderUuid - The UUID of the folder.
|
|
118
|
-
* @param {number} [offset=0] - The position of the first subfolder to return.
|
|
119
|
-
* @param {number} [limit=50] - The max number of subfolders to return.
|
|
120
|
-
* @param {string} [sort=plainName] - The reference column to sort it.
|
|
121
|
-
* @param {string} [order=ASC] - The order to be followed.
|
|
122
|
-
* @returns {[Promise<FetchPaginatedFoldersContent>, RequestCanceler]} An array containing a promise to get the API response and a function to cancel the request.
|
|
123
|
-
*/
|
|
124
|
-
getFolderFoldersByUuid(folderUuid: UUID, offset?: number, limit?: number, sort?: string, order?: string): [Promise<FetchPaginatedFoldersContent>, RequestCanceler];
|
|
125
|
-
/**
|
|
126
|
-
* Removes a specific folder from the centralized persistence
|
|
127
|
-
* @param folderId
|
|
128
|
-
*/
|
|
129
|
-
deleteFolder(folderId: number): Promise<unknown>;
|
|
130
|
-
/**
|
|
131
|
-
* Returns the total size of a folder
|
|
132
|
-
* @param folderId
|
|
133
|
-
*/
|
|
134
|
-
getFolderSize(folderId: number): Promise<number>;
|
|
135
|
-
/**
|
|
136
|
-
* Creates a new file entry
|
|
137
|
-
* @param fileEntry
|
|
138
|
-
*/
|
|
139
|
-
createFileEntry(fileEntry: FileEntry, resourcesToken?: Token): Promise<DriveFileData>;
|
|
140
|
-
/**
|
|
141
|
-
* Creates a new file entry
|
|
142
|
-
* @param fileEntry
|
|
143
|
-
*/
|
|
144
|
-
createFileEntryByUuid(fileEntry: FileEntryByUuid, resourcesToken?: string): Promise<DriveFileData>;
|
|
145
|
-
/**
|
|
146
|
-
* Creates a new thumbnail entry
|
|
147
|
-
* @param thumbnailEntry
|
|
148
|
-
*/
|
|
149
|
-
createThumbnailEntry(thumbnailEntry: ThumbnailEntry, resourcesToken?: Token): Promise<Thumbnail>;
|
|
150
|
-
/**
|
|
151
|
-
* Updates the details of a file entry
|
|
152
|
-
* @param payload
|
|
153
|
-
*/
|
|
154
|
-
updateFile(payload: UpdateFilePayload, resourcesToken?: Token): Promise<void>;
|
|
155
|
-
/**
|
|
156
|
-
* Updates the name of a file with the given UUID.
|
|
157
|
-
*
|
|
158
|
-
* @param {Object} payload - The payload containing the UUID and new name of the file.
|
|
159
|
-
* @param {string} payload.fileUuid - The UUID of the file.
|
|
160
|
-
* @param {string} payload.name - The new name of the file.
|
|
161
|
-
* @param {string} [resourcesToken] - The token for accessing resources.
|
|
162
|
-
* @return {Promise<void>} - A Promise that resolves when the file name is successfully updated.
|
|
163
|
-
*/
|
|
164
|
-
updateFileNameWithUUID(payload: {
|
|
165
|
-
fileUuid: string;
|
|
166
|
-
name: string;
|
|
167
|
-
}, resourcesToken?: Token): Promise<void>;
|
|
168
|
-
/**
|
|
169
|
-
* Updates the name and the type from a given file UUID.
|
|
170
|
-
*
|
|
171
|
-
* @param {Object} payload - The payload containing the UUID and the new properties of the file.
|
|
172
|
-
* @param {string} payload.fileUuid - The UUID of the file.
|
|
173
|
-
* @param {string} payload.name - The new name of the file.
|
|
174
|
-
* @param {string} payload.type - The new type of the file.
|
|
175
|
-
* @param {string} [resourcesToken] - The token for accessing resources.
|
|
176
|
-
* @return {Promise<void>} - A Promise that resolves when the file name is successfully updated.
|
|
177
|
-
*/
|
|
178
|
-
updateFileMetaByUUID(fileUuid: string, payload: {
|
|
179
|
-
plainName?: string;
|
|
180
|
-
type?: string | null;
|
|
181
|
-
}, resourcesToken?: Token): Promise<void>;
|
|
182
|
-
/**
|
|
183
|
-
* Deletes a specific file entry
|
|
184
|
-
* @param payload
|
|
185
|
-
*/
|
|
186
|
-
deleteFile(payload: DeleteFilePayload): Promise<unknown>;
|
|
187
|
-
/**
|
|
188
|
-
* Updates the persisted path of a file entry
|
|
189
|
-
* @param payload
|
|
190
|
-
*/
|
|
191
|
-
moveFile(payload: MoveFilePayload): Promise<MoveFileResponse>;
|
|
192
|
-
/**
|
|
193
|
-
* Moves a specific file to a new location
|
|
194
|
-
* @param payload
|
|
195
|
-
*/
|
|
196
|
-
moveFileByUuid(payload: MoveFileUuidPayload): Promise<FileMeta>;
|
|
197
|
-
/**
|
|
198
|
-
* Returns a list of the n most recent files
|
|
199
|
-
* @param limit
|
|
200
|
-
* @deprecated use `getRecentFilesV2` call instead.
|
|
201
|
-
*/
|
|
202
|
-
getRecentFiles(limit: number): Promise<DriveFileData[]>;
|
|
203
|
-
/**
|
|
204
|
-
* Returns a list of the n most recent files
|
|
205
|
-
* @param limit
|
|
206
|
-
*/
|
|
207
|
-
getRecentFilesV2(limit: number): Promise<DriveFileData[]>;
|
|
208
|
-
/**
|
|
209
|
-
* Returns a list of items in trash
|
|
210
|
-
*/
|
|
211
|
-
getTrash(): [Promise<FetchFolderContentResponse>, RequestCanceler];
|
|
212
|
-
/**
|
|
213
|
-
* Add Items to Trash
|
|
214
|
-
* @param payload
|
|
215
|
-
*/
|
|
216
|
-
addItemsToTrash(payload: AddItemsToTrashPayload): Promise<void>;
|
|
217
|
-
/**
|
|
218
|
-
* Returns a list of the n most recent files
|
|
219
|
-
* @param limit
|
|
220
|
-
*/
|
|
221
|
-
searchItemsByName(plain_name: string): Promise<DriveFileData[]>;
|
|
222
|
-
/**
|
|
223
|
-
* Returns the current space usage of the user
|
|
224
|
-
*/
|
|
225
|
-
spaceUsage(): Promise<UsageResponse>;
|
|
226
|
-
/**
|
|
227
|
-
* Returns the current space limit for the user
|
|
228
|
-
*/
|
|
229
|
-
spaceLimit(): Promise<FetchLimitResponse>;
|
|
230
|
-
/**
|
|
231
|
-
* Get global search items.
|
|
232
|
-
*
|
|
233
|
-
* @param {string} search - The name of the item.
|
|
234
|
-
* @param {string} workspaceId - The ID of the workspace (optional).
|
|
235
|
-
* @returns {[Promise<SearchResultData>, RequestCanceler]} An array containing a promise to get the API response and a function to cancel the request.
|
|
236
|
-
*/
|
|
237
|
-
getGlobalSearchItems(search: string, workspaceId?: string): [Promise<SearchResultData>, RequestCanceler];
|
|
238
|
-
/**
|
|
239
|
-
* Returns the needed headers for the module requests
|
|
240
|
-
* @private
|
|
241
|
-
*/
|
|
242
|
-
private headers;
|
|
243
|
-
/**
|
|
244
|
-
* Gets the ancestors of a given folder UUID
|
|
245
|
-
*
|
|
246
|
-
* @param {string} uuid - UUID of the folder.
|
|
247
|
-
* @param {boolean} [isShared=false] - Whether the folder is a shared item or not.
|
|
248
|
-
* @returns {Promise<FolderAncestor[]>} A promise that resolves with an array of ancestors of the given folder.
|
|
249
|
-
*/
|
|
250
|
-
getFolderAncestors(uuid: string, isShared?: boolean): Promise<FolderAncestor[]>;
|
|
251
|
-
/**
|
|
252
|
-
* Gets the meta of a given folder UUID
|
|
253
|
-
*
|
|
254
|
-
* @param {string} folderUUID - UUID of the folder.
|
|
255
|
-
* @returns {Promise<FolderMeta>}
|
|
256
|
-
*/
|
|
257
|
-
getFolderMeta(uuid: string, workspacesToken?: string, resourcesToken?: string): Promise<FolderMeta>;
|
|
258
|
-
/**
|
|
259
|
-
* Gets the meta of a given folder Id
|
|
260
|
-
*
|
|
261
|
-
* @param {number} folderId - Id of the folder.
|
|
262
|
-
* @returns {Promise<FolderMeta>}
|
|
263
|
-
*/
|
|
264
|
-
getFolderMetaById(folderId: number): Promise<FolderMeta>;
|
|
265
|
-
/**
|
|
266
|
-
* Replaces a file with a new one.
|
|
267
|
-
*
|
|
268
|
-
* @param {string} uuid - UUID of the file.
|
|
269
|
-
* @param {ReplaceFile} payload
|
|
270
|
-
* @returns {Promise<DriveFileData>} - The replaced file data.
|
|
271
|
-
*/
|
|
272
|
-
replaceFile(uuid: string, payload: ReplaceFile): Promise<DriveFileData>;
|
|
273
|
-
/**
|
|
274
|
-
* Checks the size limit for a file.
|
|
275
|
-
*
|
|
276
|
-
* @param {number} size - The size of the file to check.
|
|
277
|
-
* @return {Promise<void>} - A promise that resolves when the size limit check is complete.
|
|
278
|
-
*/
|
|
279
|
-
checkSizeLimit(size: number): Promise<void>;
|
|
280
|
-
/**
|
|
281
|
-
* Retrieves the folder tree based on the UUID.
|
|
282
|
-
*
|
|
283
|
-
* @param {string} uuid - The UUID of the folder.
|
|
284
|
-
* @return {Promise<FolderTreeResponse>} The promise containing the folder tree response.
|
|
285
|
-
*/
|
|
286
|
-
getFolderTree(uuid: string): Promise<FolderTreeResponse>;
|
|
287
|
-
/**
|
|
288
|
-
* Checks if the given files already exist in the given folder.
|
|
289
|
-
*
|
|
290
|
-
* @param {CheckDuplicatedFilesPayload} payload - Payload containing the folder UUID and the list of files to check.
|
|
291
|
-
* @return {Promise<CheckDuplicatedFilesResponse>} - Promise that contains the duplicated files in a list.
|
|
292
|
-
*/
|
|
293
|
-
checkDuplicatedFiles({ folderUuid, filesList, }: CheckDuplicatedFilesPayload): Promise<CheckDuplicatedFilesResponse>;
|
|
294
|
-
/**
|
|
295
|
-
* Checks if the given folders names already exist in the given folder
|
|
296
|
-
*
|
|
297
|
-
* @param {CheckDuplicatedFolderPayload} payload - Payload containing the folder UUID and the list of folders to check.
|
|
298
|
-
* @return {Promise<CheckDuplicatedFoldersResponse>} - Promise that contains the duplicated folders in a list.
|
|
299
|
-
*/
|
|
300
|
-
checkDuplicatedFolders({ folderUuid, folderNamesList, }: CheckDuplicatedFolderPayload): Promise<CheckDuplicatedFoldersResponse>;
|
|
301
|
-
/**
|
|
302
|
-
* Gets the folder meta from a given path (e.g. "/folder1/folder2")
|
|
303
|
-
*
|
|
304
|
-
* @param {string} folderPath - The path of the folder.
|
|
305
|
-
* @returns {Promise<FolderMeta>} A promise that resolves the folder on that path.
|
|
306
|
-
*/
|
|
307
|
-
getFolderByPath(folderPath: string): Promise<FolderMeta>;
|
|
308
|
-
/**
|
|
309
|
-
* Gets the file meta from a given path (e.g. "/folder1/folder2/file.png")
|
|
310
|
-
*
|
|
311
|
-
* @param {string} filePath - The path of the file.
|
|
312
|
-
* @returns {Promise<FileMeta>} A promise that resolves the file on that path.
|
|
313
|
-
*/
|
|
314
|
-
getFileByPath(filePath: string): Promise<FileMeta>;
|
|
315
|
-
}
|
|
1
|
+
import { Token } from '../../auth';
|
|
2
|
+
import { ApiSecurity, ApiUrl, AppDetails } from '../../shared';
|
|
3
|
+
import { RequestCanceler } from '../../shared/http/client';
|
|
4
|
+
import { UUID } from '../../shared/types/userSettings';
|
|
5
|
+
import { AddItemsToTrashPayload, CheckDuplicatedFilesPayload, CheckDuplicatedFilesResponse, CheckDuplicatedFolderPayload, CheckDuplicatedFoldersResponse, CreateFolderByUuidPayload, CreateFolderPayload, CreateFolderResponse, DeleteFilePayload, DriveFileData, FetchFolderContentResponse, FetchLimitResponse, FetchPaginatedFilesContent, FetchPaginatedFolderContentResponse, FetchPaginatedFoldersContent, FileEntry, FileEntryByUuid, FileMeta, FolderAncestor, FolderMeta, FolderTreeResponse, MoveFilePayload, MoveFileResponse, MoveFileUuidPayload, MoveFolderPayload, MoveFolderResponse, MoveFolderUuidPayload, ReplaceFile, SearchResultData, Thumbnail, ThumbnailEntry, UpdateFilePayload, UpdateFolderMetadataPayload, UsageResponse } from './types';
|
|
6
|
+
export * as StorageTypes from './types';
|
|
7
|
+
export declare class Storage {
|
|
8
|
+
private readonly client;
|
|
9
|
+
private readonly appDetails;
|
|
10
|
+
private readonly apiSecurity;
|
|
11
|
+
static client(apiUrl: ApiUrl, appDetails: AppDetails, apiSecurity: ApiSecurity): Storage;
|
|
12
|
+
private constructor();
|
|
13
|
+
/**
|
|
14
|
+
* Creates a new folder
|
|
15
|
+
* @param payload
|
|
16
|
+
*/
|
|
17
|
+
createFolder(payload: CreateFolderPayload): [Promise<CreateFolderResponse>, RequestCanceler];
|
|
18
|
+
/**
|
|
19
|
+
* Creates a new folder
|
|
20
|
+
* @param payload
|
|
21
|
+
*/
|
|
22
|
+
createFolderByUuid(payload: CreateFolderByUuidPayload): [Promise<CreateFolderResponse>, RequestCanceler];
|
|
23
|
+
/**
|
|
24
|
+
* Moves a specific folder to a new location
|
|
25
|
+
* @param payload
|
|
26
|
+
*/
|
|
27
|
+
moveFolder(payload: MoveFolderPayload): Promise<MoveFolderResponse>;
|
|
28
|
+
/**
|
|
29
|
+
* Moves a specific folder to a new location
|
|
30
|
+
* @param payload
|
|
31
|
+
*/
|
|
32
|
+
moveFolderByUuid(payload: MoveFolderUuidPayload): Promise<FolderMeta>;
|
|
33
|
+
/**
|
|
34
|
+
* Updates the metadata of a folder
|
|
35
|
+
* @param payload
|
|
36
|
+
*/
|
|
37
|
+
updateFolder(payload: UpdateFolderMetadataPayload): Promise<void>;
|
|
38
|
+
/**
|
|
39
|
+
* Updates the name of a folder with the given UUID.
|
|
40
|
+
*
|
|
41
|
+
* @param {Object} payload - The payload containing the folder UUID and the new name.
|
|
42
|
+
* @param {string} payload.folderUuid - The UUID of the folder to update.
|
|
43
|
+
* @param {string} payload.name - The new name for the folder.
|
|
44
|
+
* @param {Token} [resourcesToken] - An optional token for authentication.
|
|
45
|
+
* @return {Promise<void>} A promise that resolves when the folder name is successfully updated.
|
|
46
|
+
*/
|
|
47
|
+
updateFolderNameWithUUID(payload: {
|
|
48
|
+
folderUuid: string;
|
|
49
|
+
name: string;
|
|
50
|
+
}, resourcesToken?: Token): Promise<void>;
|
|
51
|
+
/**
|
|
52
|
+
* Fetches & returns the contents of a specific folder
|
|
53
|
+
* @param folderId
|
|
54
|
+
*/
|
|
55
|
+
getFolderContent(folderId: number, trash?: boolean): [Promise<FetchFolderContentResponse>, RequestCanceler];
|
|
56
|
+
/**
|
|
57
|
+
* Fetches and returns the contents of a specific folder by its UUID.
|
|
58
|
+
*
|
|
59
|
+
* @param {string} folderUuid - The UUID of the folder.
|
|
60
|
+
* @param {boolean} [trash=false] - Whether to include trash items in the response.
|
|
61
|
+
* @param {boolean} [offset] - The position of the first file to return.
|
|
62
|
+
* @param {boolean} [limit] - The max number of files to be returned.
|
|
63
|
+
* @param {boolean} [workspacesToken] - Token for accessing workspaces.
|
|
64
|
+
* @return {[Promise<FetchFolderContentResponse>, RequestCanceler]} An array containing a promise to get the API response and a function to cancel the request.
|
|
65
|
+
*/
|
|
66
|
+
getFolderContentByUuid({ folderUuid, trash, offset, limit, workspacesToken, }: {
|
|
67
|
+
folderUuid: string;
|
|
68
|
+
trash?: boolean;
|
|
69
|
+
limit?: number;
|
|
70
|
+
offset?: number;
|
|
71
|
+
workspacesToken?: string;
|
|
72
|
+
}): [Promise<FetchFolderContentResponse>, RequestCanceler];
|
|
73
|
+
/**
|
|
74
|
+
* Retrieves a file with the specified fileId along with the associated workspacesToken.
|
|
75
|
+
*
|
|
76
|
+
* @param {string} fileId - The ID of the file to retrieve.
|
|
77
|
+
* @param {string} [workspacesToken] - Token for accessing workspaces.
|
|
78
|
+
* @return {[Promise<FileMeta>, RequestCanceler]} A promise with FileMeta and a canceler for the request.
|
|
79
|
+
*/
|
|
80
|
+
getFile(fileId: string, workspacesToken?: string): [Promise<FileMeta>, RequestCanceler];
|
|
81
|
+
/**
|
|
82
|
+
* Gets the files in a folder.
|
|
83
|
+
*
|
|
84
|
+
* @param {number} folderId - The ID of the folder.
|
|
85
|
+
* @param {number} [offset=0] - The position of the first file to return.
|
|
86
|
+
* @param {number} [limit=50] - The max number of files to be returned.
|
|
87
|
+
* @param {string} [sort=plainName] - The reference column to sort it.
|
|
88
|
+
* @param {string} [order=ASC] - The order to be followed.
|
|
89
|
+
* @returns {[Promise<FetchPaginatedFolderContentResponse>, RequestCanceler]} An array containing a promise to get the API response and a function to cancel the request.
|
|
90
|
+
*/
|
|
91
|
+
getFolderFiles(folderId: number, offset?: number, limit?: number, sort?: string, order?: string): [Promise<FetchPaginatedFolderContentResponse>, RequestCanceler];
|
|
92
|
+
/**
|
|
93
|
+
* Gets the files in a folder by its UUID.
|
|
94
|
+
*
|
|
95
|
+
* @param {UUID} folderUuid - The UUID of the folder.
|
|
96
|
+
* @param {number} [offset=0] - The position of the first file to return.
|
|
97
|
+
* @param {number} [limit=50] - The max number of files to be returned.
|
|
98
|
+
* @param {string} [sort=plainName] - The reference column to sort it.
|
|
99
|
+
* @param {string} [order=ASC] - The order to be followed.
|
|
100
|
+
* @returns {[Promise<FetchPaginatedFilesContent>, RequestCanceler]} An array containing a promise to get the API response and a function to cancel the request.
|
|
101
|
+
*/
|
|
102
|
+
getFolderFilesByUuid(folderUuid: UUID, offset?: number, limit?: number, sort?: string, order?: string): [Promise<FetchPaginatedFilesContent>, RequestCanceler];
|
|
103
|
+
/**
|
|
104
|
+
* Gets the subfolders of a folder.
|
|
105
|
+
*
|
|
106
|
+
* @param {number} folderId - The ID of the folder.
|
|
107
|
+
* @param {number} [offset=0] - The position of the first subfolder to return.
|
|
108
|
+
* @param {number} [limit=50] - The max number of subfolders to return.
|
|
109
|
+
* @param {string} [sort=plainName] - The reference column to sort it.
|
|
110
|
+
* @param {string} [order=ASC] - The order to be followed.
|
|
111
|
+
* @returns {[Promise<FetchPaginatedFolderContentResponse>, RequestCanceler]} An array containing a promise to get the API response and a function to cancel the request.
|
|
112
|
+
*/
|
|
113
|
+
getFolderFolders(folderId: number, offset?: number, limit?: number, sort?: string, order?: string): [Promise<FetchPaginatedFolderContentResponse>, RequestCanceler];
|
|
114
|
+
/**
|
|
115
|
+
* Gets the subfolders of a folder by its UUID.
|
|
116
|
+
*
|
|
117
|
+
* @param {UUID} folderUuid - The UUID of the folder.
|
|
118
|
+
* @param {number} [offset=0] - The position of the first subfolder to return.
|
|
119
|
+
* @param {number} [limit=50] - The max number of subfolders to return.
|
|
120
|
+
* @param {string} [sort=plainName] - The reference column to sort it.
|
|
121
|
+
* @param {string} [order=ASC] - The order to be followed.
|
|
122
|
+
* @returns {[Promise<FetchPaginatedFoldersContent>, RequestCanceler]} An array containing a promise to get the API response and a function to cancel the request.
|
|
123
|
+
*/
|
|
124
|
+
getFolderFoldersByUuid(folderUuid: UUID, offset?: number, limit?: number, sort?: string, order?: string): [Promise<FetchPaginatedFoldersContent>, RequestCanceler];
|
|
125
|
+
/**
|
|
126
|
+
* Removes a specific folder from the centralized persistence
|
|
127
|
+
* @param folderId
|
|
128
|
+
*/
|
|
129
|
+
deleteFolder(folderId: number): Promise<unknown>;
|
|
130
|
+
/**
|
|
131
|
+
* Returns the total size of a folder
|
|
132
|
+
* @param folderId
|
|
133
|
+
*/
|
|
134
|
+
getFolderSize(folderId: number): Promise<number>;
|
|
135
|
+
/**
|
|
136
|
+
* Creates a new file entry
|
|
137
|
+
* @param fileEntry
|
|
138
|
+
*/
|
|
139
|
+
createFileEntry(fileEntry: FileEntry, resourcesToken?: Token): Promise<DriveFileData>;
|
|
140
|
+
/**
|
|
141
|
+
* Creates a new file entry
|
|
142
|
+
* @param fileEntry
|
|
143
|
+
*/
|
|
144
|
+
createFileEntryByUuid(fileEntry: FileEntryByUuid, resourcesToken?: string): Promise<DriveFileData>;
|
|
145
|
+
/**
|
|
146
|
+
* Creates a new thumbnail entry
|
|
147
|
+
* @param thumbnailEntry
|
|
148
|
+
*/
|
|
149
|
+
createThumbnailEntry(thumbnailEntry: ThumbnailEntry, resourcesToken?: Token): Promise<Thumbnail>;
|
|
150
|
+
/**
|
|
151
|
+
* Updates the details of a file entry
|
|
152
|
+
* @param payload
|
|
153
|
+
*/
|
|
154
|
+
updateFile(payload: UpdateFilePayload, resourcesToken?: Token): Promise<void>;
|
|
155
|
+
/**
|
|
156
|
+
* Updates the name of a file with the given UUID.
|
|
157
|
+
*
|
|
158
|
+
* @param {Object} payload - The payload containing the UUID and new name of the file.
|
|
159
|
+
* @param {string} payload.fileUuid - The UUID of the file.
|
|
160
|
+
* @param {string} payload.name - The new name of the file.
|
|
161
|
+
* @param {string} [resourcesToken] - The token for accessing resources.
|
|
162
|
+
* @return {Promise<void>} - A Promise that resolves when the file name is successfully updated.
|
|
163
|
+
*/
|
|
164
|
+
updateFileNameWithUUID(payload: {
|
|
165
|
+
fileUuid: string;
|
|
166
|
+
name: string;
|
|
167
|
+
}, resourcesToken?: Token): Promise<void>;
|
|
168
|
+
/**
|
|
169
|
+
* Updates the name and the type from a given file UUID.
|
|
170
|
+
*
|
|
171
|
+
* @param {Object} payload - The payload containing the UUID and the new properties of the file.
|
|
172
|
+
* @param {string} payload.fileUuid - The UUID of the file.
|
|
173
|
+
* @param {string} payload.name - The new name of the file.
|
|
174
|
+
* @param {string} payload.type - The new type of the file.
|
|
175
|
+
* @param {string} [resourcesToken] - The token for accessing resources.
|
|
176
|
+
* @return {Promise<void>} - A Promise that resolves when the file name is successfully updated.
|
|
177
|
+
*/
|
|
178
|
+
updateFileMetaByUUID(fileUuid: string, payload: {
|
|
179
|
+
plainName?: string;
|
|
180
|
+
type?: string | null;
|
|
181
|
+
}, resourcesToken?: Token): Promise<void>;
|
|
182
|
+
/**
|
|
183
|
+
* Deletes a specific file entry
|
|
184
|
+
* @param payload
|
|
185
|
+
*/
|
|
186
|
+
deleteFile(payload: DeleteFilePayload): Promise<unknown>;
|
|
187
|
+
/**
|
|
188
|
+
* Updates the persisted path of a file entry
|
|
189
|
+
* @param payload
|
|
190
|
+
*/
|
|
191
|
+
moveFile(payload: MoveFilePayload): Promise<MoveFileResponse>;
|
|
192
|
+
/**
|
|
193
|
+
* Moves a specific file to a new location
|
|
194
|
+
* @param payload
|
|
195
|
+
*/
|
|
196
|
+
moveFileByUuid(payload: MoveFileUuidPayload): Promise<FileMeta>;
|
|
197
|
+
/**
|
|
198
|
+
* Returns a list of the n most recent files
|
|
199
|
+
* @param limit
|
|
200
|
+
* @deprecated use `getRecentFilesV2` call instead.
|
|
201
|
+
*/
|
|
202
|
+
getRecentFiles(limit: number): Promise<DriveFileData[]>;
|
|
203
|
+
/**
|
|
204
|
+
* Returns a list of the n most recent files
|
|
205
|
+
* @param limit
|
|
206
|
+
*/
|
|
207
|
+
getRecentFilesV2(limit: number): Promise<DriveFileData[]>;
|
|
208
|
+
/**
|
|
209
|
+
* Returns a list of items in trash
|
|
210
|
+
*/
|
|
211
|
+
getTrash(): [Promise<FetchFolderContentResponse>, RequestCanceler];
|
|
212
|
+
/**
|
|
213
|
+
* Add Items to Trash
|
|
214
|
+
* @param payload
|
|
215
|
+
*/
|
|
216
|
+
addItemsToTrash(payload: AddItemsToTrashPayload): Promise<void>;
|
|
217
|
+
/**
|
|
218
|
+
* Returns a list of the n most recent files
|
|
219
|
+
* @param limit
|
|
220
|
+
*/
|
|
221
|
+
searchItemsByName(plain_name: string): Promise<DriveFileData[]>;
|
|
222
|
+
/**
|
|
223
|
+
* Returns the current space usage of the user
|
|
224
|
+
*/
|
|
225
|
+
spaceUsage(): Promise<UsageResponse>;
|
|
226
|
+
/**
|
|
227
|
+
* Returns the current space limit for the user
|
|
228
|
+
*/
|
|
229
|
+
spaceLimit(): Promise<FetchLimitResponse>;
|
|
230
|
+
/**
|
|
231
|
+
* Get global search items.
|
|
232
|
+
*
|
|
233
|
+
* @param {string} search - The name of the item.
|
|
234
|
+
* @param {string} workspaceId - The ID of the workspace (optional).
|
|
235
|
+
* @returns {[Promise<SearchResultData>, RequestCanceler]} An array containing a promise to get the API response and a function to cancel the request.
|
|
236
|
+
*/
|
|
237
|
+
getGlobalSearchItems(search: string, workspaceId?: string): [Promise<SearchResultData>, RequestCanceler];
|
|
238
|
+
/**
|
|
239
|
+
* Returns the needed headers for the module requests
|
|
240
|
+
* @private
|
|
241
|
+
*/
|
|
242
|
+
private headers;
|
|
243
|
+
/**
|
|
244
|
+
* Gets the ancestors of a given folder UUID
|
|
245
|
+
*
|
|
246
|
+
* @param {string} uuid - UUID of the folder.
|
|
247
|
+
* @param {boolean} [isShared=false] - Whether the folder is a shared item or not.
|
|
248
|
+
* @returns {Promise<FolderAncestor[]>} A promise that resolves with an array of ancestors of the given folder.
|
|
249
|
+
*/
|
|
250
|
+
getFolderAncestors(uuid: string, isShared?: boolean): Promise<FolderAncestor[]>;
|
|
251
|
+
/**
|
|
252
|
+
* Gets the meta of a given folder UUID
|
|
253
|
+
*
|
|
254
|
+
* @param {string} folderUUID - UUID of the folder.
|
|
255
|
+
* @returns {Promise<FolderMeta>}
|
|
256
|
+
*/
|
|
257
|
+
getFolderMeta(uuid: string, workspacesToken?: string, resourcesToken?: string): Promise<FolderMeta>;
|
|
258
|
+
/**
|
|
259
|
+
* Gets the meta of a given folder Id
|
|
260
|
+
*
|
|
261
|
+
* @param {number} folderId - Id of the folder.
|
|
262
|
+
* @returns {Promise<FolderMeta>}
|
|
263
|
+
*/
|
|
264
|
+
getFolderMetaById(folderId: number): Promise<FolderMeta>;
|
|
265
|
+
/**
|
|
266
|
+
* Replaces a file with a new one.
|
|
267
|
+
*
|
|
268
|
+
* @param {string} uuid - UUID of the file.
|
|
269
|
+
* @param {ReplaceFile} payload
|
|
270
|
+
* @returns {Promise<DriveFileData>} - The replaced file data.
|
|
271
|
+
*/
|
|
272
|
+
replaceFile(uuid: string, payload: ReplaceFile): Promise<DriveFileData>;
|
|
273
|
+
/**
|
|
274
|
+
* Checks the size limit for a file.
|
|
275
|
+
*
|
|
276
|
+
* @param {number} size - The size of the file to check.
|
|
277
|
+
* @return {Promise<void>} - A promise that resolves when the size limit check is complete.
|
|
278
|
+
*/
|
|
279
|
+
checkSizeLimit(size: number): Promise<void>;
|
|
280
|
+
/**
|
|
281
|
+
* Retrieves the folder tree based on the UUID.
|
|
282
|
+
*
|
|
283
|
+
* @param {string} uuid - The UUID of the folder.
|
|
284
|
+
* @return {Promise<FolderTreeResponse>} The promise containing the folder tree response.
|
|
285
|
+
*/
|
|
286
|
+
getFolderTree(uuid: string): Promise<FolderTreeResponse>;
|
|
287
|
+
/**
|
|
288
|
+
* Checks if the given files already exist in the given folder.
|
|
289
|
+
*
|
|
290
|
+
* @param {CheckDuplicatedFilesPayload} payload - Payload containing the folder UUID and the list of files to check.
|
|
291
|
+
* @return {Promise<CheckDuplicatedFilesResponse>} - Promise that contains the duplicated files in a list.
|
|
292
|
+
*/
|
|
293
|
+
checkDuplicatedFiles({ folderUuid, filesList, }: CheckDuplicatedFilesPayload): Promise<CheckDuplicatedFilesResponse>;
|
|
294
|
+
/**
|
|
295
|
+
* Checks if the given folders names already exist in the given folder
|
|
296
|
+
*
|
|
297
|
+
* @param {CheckDuplicatedFolderPayload} payload - Payload containing the folder UUID and the list of folders to check.
|
|
298
|
+
* @return {Promise<CheckDuplicatedFoldersResponse>} - Promise that contains the duplicated folders in a list.
|
|
299
|
+
*/
|
|
300
|
+
checkDuplicatedFolders({ folderUuid, folderNamesList, }: CheckDuplicatedFolderPayload): Promise<CheckDuplicatedFoldersResponse>;
|
|
301
|
+
/**
|
|
302
|
+
* Gets the folder meta from a given path (e.g. "/folder1/folder2")
|
|
303
|
+
*
|
|
304
|
+
* @param {string} folderPath - The path of the folder.
|
|
305
|
+
* @returns {Promise<FolderMeta>} A promise that resolves the folder on that path.
|
|
306
|
+
*/
|
|
307
|
+
getFolderByPath(folderPath: string): Promise<FolderMeta>;
|
|
308
|
+
/**
|
|
309
|
+
* Gets the file meta from a given path (e.g. "/folder1/folder2/file.png")
|
|
310
|
+
*
|
|
311
|
+
* @param {string} filePath - The path of the file.
|
|
312
|
+
* @returns {Promise<FileMeta>} A promise that resolves the file on that path.
|
|
313
|
+
*/
|
|
314
|
+
getFileByPath(filePath: string): Promise<FileMeta>;
|
|
315
|
+
}
|