@internxt/sdk 1.4.76 → 1.4.77

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.
@@ -1,3 +1,5 @@
1
+ /// <reference types="node" />
2
+ import { FolderChild } from '../storage/types';
1
3
  export interface GenerateShareLinkPayload {
2
4
  itemId: string;
3
5
  type: string;
@@ -64,6 +66,9 @@ export interface SharedDirectoryFile {
64
66
  size: number;
65
67
  encryptionKey: string;
66
68
  }
69
+ export interface ShareDomainsResponse {
70
+ list: string[];
71
+ }
67
72
  export declare type ListShareLinksItem = Pick<ShareLink, 'id' | 'token' | 'views' | 'timesValid' | 'active' | 'isFolder' | 'createdAt' | 'updatedAt' | 'fileSize'> & {
68
73
  item: unknown;
69
74
  };
@@ -76,3 +81,278 @@ export declare type ListShareLinksResponse = {
76
81
  orderBy?: string;
77
82
  };
78
83
  };
84
+ export declare type ListPrivateSharedFoldersResponse = {
85
+ folders: FolderChild[];
86
+ };
87
+ export declare type SharedFolders = {
88
+ bucket: string | null;
89
+ createdAt: string;
90
+ dateShared: string;
91
+ deleted: boolean;
92
+ deletedAt: string | null;
93
+ encryptVersion: string;
94
+ encryptionKey: string;
95
+ id: number;
96
+ name: string;
97
+ parent: {
98
+ id: string;
99
+ size: number;
100
+ type: string;
101
+ uuid: string;
102
+ } | null;
103
+ parentId: number;
104
+ plainName: string;
105
+ removed: boolean;
106
+ removedAt: string | null;
107
+ sharedWithMe: boolean;
108
+ size: number;
109
+ type: string;
110
+ updatedAt: string;
111
+ user: {
112
+ avatar: string | null;
113
+ email: string;
114
+ lastname: string;
115
+ name: string;
116
+ uuid: string;
117
+ };
118
+ userId: number;
119
+ uuid: string;
120
+ };
121
+ export declare type SharedFiles = {
122
+ bucket: string | null;
123
+ createdAt: string;
124
+ deleted: boolean;
125
+ deletedAt: string | null;
126
+ encryptVersion: string;
127
+ fileiId: number;
128
+ folder: string | null;
129
+ folderId: number;
130
+ folderUuid: string;
131
+ id: number;
132
+ modificationTime: string;
133
+ name: string;
134
+ plainName: string;
135
+ removed: boolean;
136
+ removedAt: string | null;
137
+ shares: [];
138
+ size: string;
139
+ status: string;
140
+ thumbnails: [];
141
+ type: string;
142
+ updatedAt: string;
143
+ userId: number;
144
+ uuid: string;
145
+ };
146
+ export declare type ListSharedItemsResponse = {
147
+ credentials: {
148
+ networkPass: string;
149
+ networkUser: string;
150
+ };
151
+ items: SharedFiles[] | SharedFolders[];
152
+ token: string;
153
+ };
154
+ export declare type ListAllSharedFoldersResponse = {
155
+ credentials: {
156
+ networkPass: string;
157
+ networkUser: string;
158
+ };
159
+ files: SharedFiles[];
160
+ folders: SharedFolders[];
161
+ token: string;
162
+ };
163
+ export declare type ShareFolderWithUserPayload = {
164
+ itemId: string;
165
+ itemType: 'folder' | 'file';
166
+ notifyUser: boolean;
167
+ notificationMessage?: string;
168
+ sharedWith: string;
169
+ encryptionKey?: string;
170
+ encryptionAlgorithm?: string;
171
+ roleId: string;
172
+ persistPreviousSharing?: boolean;
173
+ };
174
+ export declare type CreateSharingPayload = {
175
+ itemId: string;
176
+ itemType: 'folder' | 'file';
177
+ encryptionKey: string;
178
+ encryptionAlgorithm: string;
179
+ encryptedCode: string;
180
+ persistPreviousSharing?: boolean;
181
+ encryptedPassword?: string;
182
+ };
183
+ export declare type PublicSharedItemInfo = {
184
+ plainName: string;
185
+ size: number;
186
+ type: string;
187
+ };
188
+ export declare type AcceptInvitationToSharedFolderPayload = {
189
+ encryptionKey: string;
190
+ encryptionAlgorithm: string;
191
+ };
192
+ export declare type PrivateSharingRole = {
193
+ id: string;
194
+ name: string;
195
+ createdAt: Date;
196
+ updatedAt: Date;
197
+ };
198
+ export declare type PrivateSharingRolesResponse = {
199
+ roles: PrivateSharingRole[];
200
+ };
201
+ export declare type GrantSharePrivilegesToUserResponse = {
202
+ message: string;
203
+ };
204
+ export declare type UpdateUserRoleResponse = {
205
+ message: string;
206
+ };
207
+ export declare type UpdateUserRolePayload = {
208
+ sharingId: string;
209
+ newRoleId: string;
210
+ };
211
+ export declare type RemoveUserRolePayload = {
212
+ itemType: string;
213
+ itemId: string;
214
+ userId: string;
215
+ };
216
+ export declare type SharedFolderUser = {
217
+ avatar: string | null;
218
+ email: string;
219
+ grantedFrom: string;
220
+ grantedFromPlainName: string;
221
+ id: number;
222
+ lastname: string;
223
+ name: string;
224
+ roleId: string;
225
+ roleName: string;
226
+ uuid: string;
227
+ };
228
+ export declare type Role = {
229
+ id: string;
230
+ name: string;
231
+ createdAt: Date;
232
+ updatedAt: Date;
233
+ };
234
+ export declare type getSharedFolderUsersResponse = {
235
+ users: SharedFolderUser[];
236
+ };
237
+ export declare type SharedFoldersInvitationsAsInvitedUserResponse = {
238
+ createdAt: Date;
239
+ encryptionAlgorithm: string;
240
+ encryptionKey: string;
241
+ id: string;
242
+ invited: {
243
+ avatar: string | null;
244
+ email: string;
245
+ lastname: string;
246
+ name: string;
247
+ uuid: string;
248
+ };
249
+ item: ItemInvitation;
250
+ itemId: string;
251
+ itemType: string;
252
+ roleId: string;
253
+ sharedWith: string;
254
+ type: string;
255
+ updatedAt: Date;
256
+ };
257
+ declare type ItemInvitation = {
258
+ bucket: string | null;
259
+ createdAt: Date;
260
+ deleted: boolean;
261
+ deletedAt: Date | null;
262
+ encryptVersion: string;
263
+ id: number;
264
+ name: string;
265
+ parent: null;
266
+ parentId: number;
267
+ plainName: string;
268
+ removed: boolean;
269
+ removedAt: Date | null;
270
+ size: number;
271
+ type: string;
272
+ updatedAt: Date;
273
+ user: {
274
+ avatar: string | null;
275
+ email: string;
276
+ lastname: string;
277
+ name: string;
278
+ uuid: string;
279
+ } | null;
280
+ userId: number;
281
+ uuid: string;
282
+ };
283
+ export declare type FolderUserInfo = {
284
+ avatar: string | null;
285
+ email: string;
286
+ grantedFrom: string;
287
+ grantedFromPlainName: string;
288
+ id: number;
289
+ lastname: string;
290
+ name: string;
291
+ roleId: string;
292
+ roleName: string;
293
+ uuid: string;
294
+ };
295
+ export declare type SharingInvitation = {
296
+ id: number;
297
+ userId: string;
298
+ name: string;
299
+ lastname: string;
300
+ email: string;
301
+ username: string;
302
+ bridgeUser: string;
303
+ password: string;
304
+ mnemonic: string;
305
+ rootFolderId: number;
306
+ hKey: Buffer | string;
307
+ secret_2FA: string;
308
+ errorLoginCount: number;
309
+ isEmailActivitySended: number;
310
+ referralCode: string;
311
+ referrer: string;
312
+ syncDate: Date;
313
+ uuid: string;
314
+ lastResend: Date;
315
+ credit: number;
316
+ welcomePack: boolean;
317
+ registerCompleted: boolean;
318
+ backupsBucket: string;
319
+ sharedWorkspace: boolean;
320
+ tempKey: string;
321
+ avatar: string;
322
+ };
323
+ export declare type SharingInvite = {
324
+ id: string;
325
+ itemId: string;
326
+ itemType: 'file' | 'folder';
327
+ sharedWith: string;
328
+ encryptionKey: string;
329
+ encryptionAlgorithm: string;
330
+ type: 'SELF' | 'OWNER';
331
+ roleId: string;
332
+ createdAt: Date;
333
+ updatedAt: Date;
334
+ };
335
+ export declare type SharingMeta = {
336
+ id: string;
337
+ itemId: string;
338
+ itemType: 'file' | 'folder';
339
+ ownerId: string;
340
+ sharedWith: string;
341
+ encryptionKey: string;
342
+ encryptedCode: string;
343
+ encryptedPassword: string | null;
344
+ encryptionAlgorithm: string;
345
+ createdAt: Date;
346
+ updatedAt: Date;
347
+ type: 'public' | 'private';
348
+ item: SharedFiles | SharedFolders;
349
+ itemToken: string;
350
+ };
351
+ export declare type Sharing = {
352
+ type: string;
353
+ id: string;
354
+ };
355
+ export declare type SharedFolderSize = {
356
+ size: number;
357
+ };
358
+ export {};
@@ -1,6 +1,8 @@
1
- import { CreateFolderPayload, CreateFolderResponse, DeleteFilePayload, DriveFileData, FetchFolderContentResponse, FileEntry, MoveFilePayload, MoveFileResponse, MoveFolderPayload, MoveFolderResponse, UpdateFilePayload, UpdateFolderMetadataPayload, FetchLimitResponse, UsageResponse, AddItemsToTrashPayload, ThumbnailEntry, Thumbnail } from './types';
1
+ import { CreateFolderPayload, CreateFolderResponse, DeleteFilePayload, DriveFileData, FetchFolderContentResponse, FileEntry, MoveFilePayload, MoveFileResponse, MoveFolderPayload, MoveFolderResponse, UpdateFilePayload, UpdateFolderMetadataPayload, FetchLimitResponse, UsageResponse, AddItemsToTrashPayload, ThumbnailEntry, Thumbnail, FetchPaginatedFolderContentResponse, FileMeta, SearchResultData, FolderAncestor, FolderMeta, ReplaceFile, FetchPaginatedFilesContent, FetchPaginatedFoldersContent, MoveFolderUuidPayload, MoveFileUuidPayload } from './types';
2
2
  import { ApiSecurity, ApiUrl, AppDetails } from '../../shared';
3
3
  import { RequestCanceler } from '../../shared/http/client';
4
+ import { Token } from '../../auth';
5
+ import { UUID } from '../../shared/types/userSettings';
4
6
  export * as StorageTypes from './types';
5
7
  export declare class Storage {
6
8
  private readonly client;
@@ -18,6 +20,11 @@ export declare class Storage {
18
20
  * @param payload
19
21
  */
20
22
  moveFolder(payload: MoveFolderPayload): Promise<MoveFolderResponse>;
23
+ /**
24
+ * Moves a specific folder to a new location
25
+ * @param payload
26
+ */
27
+ moveFolderByUuid(payload: MoveFolderUuidPayload): Promise<FolderMeta>;
21
28
  /**
22
29
  * Updates the metadata of a folder
23
30
  * @param payload
@@ -28,6 +35,55 @@ export declare class Storage {
28
35
  * @param folderId
29
36
  */
30
37
  getFolderContent(folderId: number, trash?: boolean): [Promise<FetchFolderContentResponse>, RequestCanceler];
38
+ /**
39
+ * Returns metadata of a specific file
40
+ * @param fileId
41
+ */
42
+ getFile(fileId: string): [Promise<FileMeta>, RequestCanceler];
43
+ /**
44
+ * Gets the files in a folder.
45
+ *
46
+ * @param {number} folderId - The ID of the folder.
47
+ * @param {number} [offset=0] - The position of the first file to return.
48
+ * @param {number} [limit=50] - The max number of files to be returned.
49
+ * @param {string} [sort=plainName] - The reference column to sort it.
50
+ * @param {string} [order=ASC] - The order to be followed.
51
+ * @returns {[Promise<FetchPaginatedFolderContentResponse>, RequestCanceler]} An array containing a promise to get the API response and a function to cancel the request.
52
+ */
53
+ getFolderFiles(folderId: number, offset?: number, limit?: number, sort?: string, order?: string): [Promise<FetchPaginatedFolderContentResponse>, RequestCanceler];
54
+ /**
55
+ * Gets the files in a folder by its UUID.
56
+ *
57
+ * @param {UUID} folderUuid - The UUID of the folder.
58
+ * @param {number} [offset=0] - The position of the first file to return.
59
+ * @param {number} [limit=50] - The max number of files to be returned.
60
+ * @param {string} [sort=plainName] - The reference column to sort it.
61
+ * @param {string} [order=ASC] - The order to be followed.
62
+ * @returns {[Promise<FetchPaginatedFilesContent>, RequestCanceler]} An array containing a promise to get the API response and a function to cancel the request.
63
+ */
64
+ getFolderFilesByUuid(folderUuid: UUID, offset?: number, limit?: number, sort?: string, order?: string): [Promise<FetchPaginatedFilesContent>, RequestCanceler];
65
+ /**
66
+ * Gets the subfolders of a folder.
67
+ *
68
+ * @param {number} folderId - The ID of the folder.
69
+ * @param {number} [offset=0] - The position of the first subfolder to return.
70
+ * @param {number} [limit=50] - The max number of subfolders to return.
71
+ * @param {string} [sort=plainName] - The reference column to sort it.
72
+ * @param {string} [order=ASC] - The order to be followed.
73
+ * @returns {[Promise<FetchPaginatedFolderContentResponse>, RequestCanceler]} An array containing a promise to get the API response and a function to cancel the request.
74
+ */
75
+ getFolderFolders(folderId: number, offset?: number, limit?: number, sort?: string, order?: string): [Promise<FetchPaginatedFolderContentResponse>, RequestCanceler];
76
+ /**
77
+ * Gets the subfolders of a folder by its UUID.
78
+ *
79
+ * @param {UUID} folderUuid - The UUID of the folder.
80
+ * @param {number} [offset=0] - The position of the first subfolder to return.
81
+ * @param {number} [limit=50] - The max number of subfolders to return.
82
+ * @param {string} [sort=plainName] - The reference column to sort it.
83
+ * @param {string} [order=ASC] - The order to be followed.
84
+ * @returns {[Promise<FetchPaginatedFoldersContent>, RequestCanceler]} An array containing a promise to get the API response and a function to cancel the request.
85
+ */
86
+ getFolderFoldersByUuid(folderUuid: UUID, offset?: number, limit?: number, sort?: string, order?: string): [Promise<FetchPaginatedFoldersContent>, RequestCanceler];
31
87
  /**
32
88
  * Removes a specific folder from the centralized persistence
33
89
  * @param folderId
@@ -42,17 +98,17 @@ export declare class Storage {
42
98
  * Creates a new file entry
43
99
  * @param fileEntry
44
100
  */
45
- createFileEntry(fileEntry: FileEntry): Promise<DriveFileData>;
101
+ createFileEntry(fileEntry: FileEntry, resourcesToken?: Token): Promise<DriveFileData>;
46
102
  /**
47
103
  * Creates a new thumbnail entry
48
104
  * @param thumbnailEntry
49
105
  */
50
- createThumbnailEntry(thumbnailEntry: ThumbnailEntry): Promise<Thumbnail>;
106
+ createThumbnailEntry(thumbnailEntry: ThumbnailEntry, resourcesToken?: Token): Promise<Thumbnail>;
51
107
  /**
52
108
  * Updates the details of a file entry
53
109
  * @param payload
54
110
  */
55
- updateFile(payload: UpdateFilePayload): Promise<void>;
111
+ updateFile(payload: UpdateFilePayload, resourcesToken?: Token): Promise<void>;
56
112
  /**
57
113
  * Deletes a specific file entry
58
114
  * @param payload
@@ -63,6 +119,11 @@ export declare class Storage {
63
119
  * @param payload
64
120
  */
65
121
  moveFile(payload: MoveFilePayload): Promise<MoveFileResponse>;
122
+ /**
123
+ * Moves a specific file to a new location
124
+ * @param payload
125
+ */
126
+ moveFileByUuid(payload: MoveFileUuidPayload): Promise<FileMeta>;
66
127
  /**
67
128
  * Returns a list of the n most recent files
68
129
  * @param limit
@@ -76,7 +137,12 @@ export declare class Storage {
76
137
  * Add Items to Trash
77
138
  * @param payload
78
139
  */
79
- addItemsToTrash(payload: AddItemsToTrashPayload): Promise<unknown>;
140
+ addItemsToTrash(payload: AddItemsToTrashPayload): Promise<void>;
141
+ /**
142
+ * Returns a list of the n most recent files
143
+ * @param limit
144
+ */
145
+ searchItemsByName(plain_name: string): Promise<DriveFileData[]>;
80
146
  /**
81
147
  * Returns the current space usage of the user
82
148
  */
@@ -85,9 +151,45 @@ export declare class Storage {
85
151
  * Returns the current space limit for the user
86
152
  */
87
153
  spaceLimit(): Promise<FetchLimitResponse>;
154
+ /**
155
+ * Get global search items.
156
+ *
157
+ * @param {string} search - The name of the item.
158
+ * @returns {[Promise<SearchResultData>, RequestCanceler]} An array containing a promise to get the API response and a function to cancel the request.
159
+ */
160
+ getGlobalSearchItems(search: string): [Promise<SearchResultData>, RequestCanceler];
88
161
  /**
89
162
  * Returns the needed headers for the module requests
90
163
  * @private
91
164
  */
92
165
  private headers;
166
+ /**
167
+ * Gets the ancestors of a given folder UUID
168
+ *
169
+ * @param {string} folderUUID - UUID of the folder.
170
+ * @returns {Promise<FolderAncestor[]>}
171
+ */
172
+ getFolderAncestors(uuid: string): Promise<FolderAncestor[]>;
173
+ /**
174
+ * Gets the meta of a given folder UUID
175
+ *
176
+ * @param {string} folderUUID - UUID of the folder.
177
+ * @returns {Promise<FolderMeta>}
178
+ */
179
+ getFolderMeta(uuid: string): Promise<FolderMeta>;
180
+ /**
181
+ * Gets the meta of a given folder Id
182
+ *
183
+ * @param {number} folderId - Id of the folder.
184
+ * @returns {Promise<FolderMeta>}
185
+ */
186
+ getFolderMetaById(folderId: number): Promise<FolderMeta>;
187
+ /**
188
+ * Replaces a file with a new one.
189
+ *
190
+ * @param {string} uuid - UUID of the file.
191
+ * @param {ReplaceFile} payload
192
+ * @returns {Promise<DriveFileData>} - The replaced file data.
193
+ */
194
+ replaceFile(uuid: string, payload: ReplaceFile): Promise<DriveFileData>;
93
195
  }