@internxt/sdk 1.5.25 → 1.6.3

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.
Files changed (93) hide show
  1. package/dist/auth/index.d.ts +127 -122
  2. package/dist/auth/index.js +378 -310
  3. package/dist/auth/types.d.ts +67 -54
  4. package/dist/auth/types.js +26 -26
  5. package/dist/drive/backups/index.d.ts +18 -18
  6. package/dist/drive/backups/index.js +40 -40
  7. package/dist/drive/backups/types.d.ts +27 -27
  8. package/dist/drive/backups/types.js +2 -2
  9. package/dist/drive/index.d.ts +7 -7
  10. package/dist/drive/index.js +23 -19
  11. package/dist/drive/payments/index.d.ts +66 -71
  12. package/dist/drive/payments/index.js +206 -208
  13. package/dist/drive/payments/types.d.ts +180 -176
  14. package/dist/drive/payments/types.js +37 -37
  15. package/dist/drive/referrals/index.d.ts +19 -19
  16. package/dist/drive/referrals/index.js +54 -50
  17. package/dist/drive/referrals/types.d.ts +21 -21
  18. package/dist/drive/referrals/types.js +18 -18
  19. package/dist/drive/share/index.d.ts +319 -319
  20. package/dist/drive/share/index.js +544 -540
  21. package/dist/drive/share/types.d.ts +360 -360
  22. package/dist/drive/share/types.js +2 -2
  23. package/dist/drive/storage/index.d.ts +315 -315
  24. package/dist/drive/storage/index.js +634 -630
  25. package/dist/drive/storage/types.d.ts +480 -473
  26. package/dist/drive/storage/types.js +13 -13
  27. package/dist/drive/trash/index.d.ts +75 -75
  28. package/dist/drive/trash/index.js +184 -180
  29. package/dist/drive/trash/types.d.ts +29 -29
  30. package/dist/drive/trash/types.js +2 -2
  31. package/dist/drive/users/index.d.ts +135 -135
  32. package/dist/drive/users/index.js +208 -204
  33. package/dist/drive/users/types.d.ts +53 -51
  34. package/dist/drive/users/types.js +2 -2
  35. package/dist/index.d.ts +6 -6
  36. package/dist/index.js +35 -31
  37. package/dist/network/download.d.ts +8 -8
  38. package/dist/network/download.js +123 -123
  39. package/dist/network/errors/codes.d.ts +24 -24
  40. package/dist/network/errors/codes.js +48 -48
  41. package/dist/network/errors/context.d.ts +35 -35
  42. package/dist/network/errors/context.js +39 -39
  43. package/dist/network/errors/download.d.ts +4 -4
  44. package/dist/network/errors/download.js +52 -48
  45. package/dist/network/errors/index.d.ts +3 -3
  46. package/dist/network/errors/index.js +19 -15
  47. package/dist/network/errors/upload.d.ts +13 -13
  48. package/dist/network/errors/upload.js +82 -78
  49. package/dist/network/index.d.ts +70 -70
  50. package/dist/network/index.js +315 -311
  51. package/dist/network/types.d.ts +102 -102
  52. package/dist/network/types.js +18 -18
  53. package/dist/network/upload.d.ts +4 -4
  54. package/dist/network/upload.js +158 -159
  55. package/dist/photos/devices/index.d.ts +10 -10
  56. package/dist/photos/devices/index.js +79 -79
  57. package/dist/photos/index.d.ts +17 -17
  58. package/dist/photos/index.js +56 -52
  59. package/dist/photos/photos/index.d.ts +60 -60
  60. package/dist/photos/photos/index.js +225 -225
  61. package/dist/photos/shares/index.d.ts +8 -8
  62. package/dist/photos/shares/index.js +34 -34
  63. package/dist/photos/types.d.ts +154 -154
  64. package/dist/photos/types.js +19 -19
  65. package/dist/photos/users/index.d.ts +7 -7
  66. package/dist/photos/users/index.js +46 -46
  67. package/dist/shared/headers/index.d.ts +21 -21
  68. package/dist/shared/headers/index.js +78 -79
  69. package/dist/shared/http/client.d.ts +85 -85
  70. package/dist/shared/http/client.js +172 -172
  71. package/dist/shared/http/types.d.ts +7 -7
  72. package/dist/shared/http/types.js +2 -2
  73. package/dist/shared/index.d.ts +1 -1
  74. package/dist/shared/index.js +17 -13
  75. package/dist/shared/types/apiConnection.d.ts +12 -12
  76. package/dist/shared/types/apiConnection.js +2 -2
  77. package/dist/shared/types/appsumo.d.ts +16 -16
  78. package/dist/shared/types/appsumo.js +12 -12
  79. package/dist/shared/types/errors.d.ts +5 -5
  80. package/dist/shared/types/errors.js +28 -28
  81. package/dist/shared/types/teams.d.ts +9 -9
  82. package/dist/shared/types/teams.js +2 -2
  83. package/dist/shared/types/userSettings.d.ts +43 -29
  84. package/dist/shared/types/userSettings.js +2 -2
  85. package/dist/utils.d.ts +3 -3
  86. package/dist/utils.js +24 -25
  87. package/dist/workspaces/index.d.ts +176 -176
  88. package/dist/workspaces/index.js +419 -415
  89. package/dist/workspaces/index.test.d.ts +1 -1
  90. package/dist/workspaces/index.test.js +908 -903
  91. package/dist/workspaces/types.d.ts +294 -291
  92. package/dist/workspaces/types.js +2 -2
  93. package/package.json +13 -13
@@ -1,319 +1,319 @@
1
- import { ApiSecurity, ApiUrl, AppDetails } from '../../shared';
2
- import { AcceptInvitationToSharedFolderPayload, CreateSharingPayload, GenerateShareLinkPayload, GetShareLinkFolderSizePayload, GetSharedDirectoryPayload, ListAllSharedFoldersResponse, ListPrivateSharedFoldersResponse, ListShareLinksResponse, ListSharedItemsResponse, PublicSharedItemInfo, RemoveUserRolePayload, Role, ShareDomainsResponse, ShareFolderWithUserPayload, ShareLink, SharedFolderSize, SharedFolderUser, SharedFoldersInvitationsAsInvitedUserResponse, SharingInvite, SharingMeta, UpdateShareLinkPayload, UpdateUserRolePayload, UpdateUserRoleResponse } from './types';
3
- export * as ShareTypes from './types';
4
- export declare class Share {
5
- private readonly client;
6
- private readonly appDetails;
7
- private readonly apiSecurity;
8
- static client(apiUrl: ApiUrl, appDetails: AppDetails, apiSecurity: ApiSecurity): Share;
9
- private constructor();
10
- /**
11
- * Fetches the list of shared items
12
- */
13
- getShareLinks(page?: number, perPage?: number, orderBy?: 'views:ASC' | 'views:DESC' | 'createdAt:ASC' | 'createdAt:DESC'): Promise<ListShareLinksResponse>;
14
- /**
15
- * Creates a new link to share a file or folder
16
- * @param payload
17
- */
18
- createShareLink(payload: GenerateShareLinkPayload): Promise<{
19
- created: boolean;
20
- token: string;
21
- code: string;
22
- }>;
23
- /**
24
- * Update share link
25
- * @param payload
26
- */
27
- updateShareLink(payload: UpdateShareLinkPayload): Promise<ShareLink>;
28
- /**
29
- * Delete share link by id
30
- * @param payload
31
- */
32
- deleteShareLink(shareId: string): Promise<{
33
- deleted: boolean;
34
- shareId: string;
35
- }>;
36
- /**
37
- * Increment share view by token
38
- * @param token
39
- */
40
- incrementShareViewByToken(token: string): Promise<{
41
- incremented: boolean;
42
- token: string;
43
- }>;
44
- /**
45
- * Fetches data of a shared file
46
- * @param token
47
- */
48
- getShareLink(token: string, password?: string): Promise<ShareLink>;
49
- /**
50
- * Fetches paginated folders or files of a specific share link
51
- * @param payload
52
- */
53
- getShareLinkDirectory(payload: GetSharedDirectoryPayload): Promise<any>;
54
- getShareDomains(): Promise<ShareDomainsResponse>;
55
- /**
56
- * Get size of folder in share links
57
- * @param payload
58
- */
59
- getShareLinkFolderSize(payload: GetShareLinkFolderSizePayload): Promise<any>;
60
- /**
61
- * Fetches all folders shared by a user.
62
- *
63
- * @param {number} page - The page number for pagination.
64
- * @param {number} perPage - The number of items per page for pagination.
65
- * @param {string} [orderBy] - The optional order criteria (e.g., 'views:ASC', 'createdAt:DESC').
66
- * @returns {Promise<ListPrivateSharedFoldersResponse>} A promise containing the list of shared folders.
67
- */
68
- getSentSharedFolders(page?: number, perPage?: number, orderBy?: 'views:ASC' | 'views:DESC' | 'createdAt:ASC' | 'createdAt:DESC'): Promise<ListPrivateSharedFoldersResponse>;
69
- /**
70
- * Fetches folders shared with a user.
71
- *
72
- * @param {number} page - The page number for pagination.
73
- * @param {number} perPage - The number of items per page for pagination.
74
- * @param {string} [orderBy] - The optional order criteria (e.g., 'views:ASC', 'createdAt:DESC').
75
- * @returns {Promise<ListPrivateSharedFoldersResponse>} A promise containing the list of shared folders.
76
- */
77
- getReceivedSharedFolders(page?: number, perPage?: number, orderBy?: 'views:ASC' | 'views:DESC' | 'createdAt:ASC' | 'createdAt:DESC'): Promise<ListPrivateSharedFoldersResponse>;
78
- /**
79
- * Fetches all shared folders.
80
- *
81
- * @param {number} page - The page number for pagination.
82
- * @param {number} perPage - The number of items per page for pagination.
83
- * @param {string} [orderBy] - The optional order criteria (e.g., 'views:ASC', 'createdAt:DESC').
84
- * @returns {Promise<ListAllSharedFoldersResponse>} A promise containing the list of shared folders.
85
- */
86
- getAllSharedFolders(page?: number, perPage?: number, orderBy?: 'views:ASC' | 'views:DESC' | 'createdAt:ASC' | 'createdAt:DESC'): Promise<ListAllSharedFoldersResponse>;
87
- /**
88
- * Fetches all shared files.
89
- *
90
- * @param {number} page - The page number for pagination.
91
- * @param {number} perPage - The number of items per page for pagination.
92
- * @param {string} [orderBy] - The optional order criteria (e.g., 'views:ASC', 'createdAt:DESC').
93
- * @returns {Promise<ListAllSharedFoldersResponse>} A promise containing the list of shared folders.
94
- */
95
- getAllSharedFiles(page?: number, perPage?: number, orderBy?: 'views:ASC' | 'views:DESC' | 'createdAt:ASC' | 'createdAt:DESC'): Promise<ListAllSharedFoldersResponse>;
96
- /**
97
- * Get all users with access to a shared folder.
98
- *
99
- * @param {string} folderUUID - The UUID of the folder.
100
- * @param {number} page - The page number for pagination.
101
- * @param {number} perPage - The number of items per page for pagination.
102
- * @param {string} [orderBy] - The optional order criteria (e.g., 'views:ASC', 'createdAt:DESC').
103
- * @returns {Promise<{ users: SharedFolderUser[] }>} A promise containing the list of users with access to the folder.
104
- */
105
- getSharedFolderUsers(folderUUID: string, page?: number, perPage?: number, orderBy?: 'views:ASC' | 'views:DESC' | 'createdAt:ASC' | 'createdAt:DESC'): Promise<{
106
- users: SharedFolderUser[];
107
- }>;
108
- /**
109
- * Get shared folder content
110
- * @param {string} sharedFolderId - The UUID of the shared folder.
111
- * @param {string} type - The item type for the query folders/files
112
- * @param {string} token - Key that enables invited users to navigate the folders
113
- * @param {number} page - The page number for pagination.
114
- * @param {number} perPage - The number of items per page for pagination.
115
- * @param {string} [orderBy] - The optional order criteria (e.g., 'views:ASC', 'createdAt:DESC').
116
- */
117
- getSharedFolderContent(sharedFolderId: string, type: 'folders' | 'files', token: string | null, page?: number, perPage?: number, orderBy?: 'views:ASC' | 'views:DESC' | 'createdAt:ASC' | 'createdAt:DESC'): Promise<ListSharedItemsResponse>;
118
- /**
119
- * Get public shared folder content
120
- * @param {string} sharedFolderId - The UUID of the shared folder.
121
- * @param {string} type - The item type for the query folders/files
122
- * @param {string} token - Key that enables invited users to navigate the folders
123
- * @param {number} page - The page number for pagination.
124
- * @param {number} perPage - The number of items per page for pagination.
125
- * @param {string} [orderBy] - The optional order criteria (e.g., 'views:ASC', 'createdAt:DESC').
126
- */
127
- getPublicSharedFolderContent(sharedFolderId: string, type: 'folders' | 'files', token: string | null, page?: number, perPage?: number, code?: string, orderBy?: 'views:ASC' | 'views:DESC' | 'createdAt:ASC' | 'createdAt:DESC'): Promise<ListSharedItemsResponse>;
128
- /**
129
- * Get the role of a user on a folder.
130
- *
131
- * @param {string} options.sharingId - The unique identifier of the sharing.
132
- * @returns {Promise<Role>} A promise containing the role of the current user in the sharing.
133
- */
134
- getUserRole(sharingId: string): Promise<Role>;
135
- /**
136
- * Update the role of a user on a folder.
137
- *
138
- * @param {UpdateUserRolePayload} options - The options for updating the user's role on the folder.
139
- * @param {string} options.sharingId - The unique identifier of the user to whom we will update the role.
140
- * @param {string} options.newRoleId - The new role Id.
141
- * @returns {Promise<UpdateRoleFolderResponse>} A promise that resolves when the user's role is updated.
142
- */
143
- updateUserRole({ sharingId, newRoleId }: UpdateUserRolePayload): Promise<UpdateUserRoleResponse>;
144
- /**
145
- * Remove user from shared folder.
146
- *
147
- * @param {UpdateUserRolePayload} options - The options for updating the user's role on the folder.
148
- * @param {string} options.itemType - The unique identifier of the folder.
149
- * @param {string} options.itemId - The identifier of the role to assign to the user.
150
- * @param {string} options.userId - The role Id how we want to delete.
151
- * @returns {Promise<UpdateRoleFolderResponse>} A promise that resolves when the user's role is updated.
152
- */
153
- removeUserRole({ itemType, itemId, userId }: RemoveUserRolePayload): Promise<UpdateUserRoleResponse>;
154
- /**
155
- * Get private folder data.
156
- *
157
- * @param {string} itemId - The itemId of the folder.
158
- * @param {string} itemType - The itemType of the folder (file | folder).
159
- * @returns {Promise<{ data: SharingInvite[] }>} A promise containing the private folder data.
160
- */
161
- getSharedFolderInvitations({ itemId, itemType, }: {
162
- itemId: string;
163
- itemType: 'folder' | 'file';
164
- }): Promise<any[]>;
165
- /**
166
- * Get all invitations for a user.
167
- * @param limit - The number of items per page for pagination.
168
- * @param offset - The page number for pagination.
169
- * @returns {Promise<invites: any>} A promise containing the list of invitations.
170
- */
171
- getSharedFolderInvitationsAsInvitedUser({ limit, offset, }: {
172
- limit?: number;
173
- offset?: number;
174
- }): Promise<{
175
- invites: SharedFoldersInvitationsAsInvitedUserResponse[];
176
- }>;
177
- /**
178
- * Share a private folder with a user.
179
- *
180
- * @param {ShareFolderWithUserPayload} options - The options for sharing the private folder with a user.
181
- * @param {string} options.itemId - The id of the item to share.
182
- * @param {string} options.itemType - The type of the item to share (folder | file).
183
- * @param {string} options.sharedWith - The email address of the user to share the folder with.
184
- * @param {string} options.encryptionKey - Owner\'s encryption key encrypted with the invited user\'s public key. This field should not be empty if the invitation type is "OWNER".
185
- * @param {string} options.encryptionAlgorithm - Encryption algorithm used to encrypt the encryption key. This field should not be empty if the invitation type is "OWNER".
186
- * @param {string} options.type - Owner's encryption key encrypted with the invited user's public key.
187
- * @param {string} options.roleId - The id of the role to assign to the user.
188
- * @param {string} options.notifyUser - If it has to notify the users
189
- * @param {string} options.notificationMessage - Message of the notificacion
190
- *
191
- *
192
- * @returns {Promise<SharingInvite>} A promise that resolves when the folder is shared with the user.
193
- */
194
- inviteUserToSharedFolder(createInviteDto: ShareFolderWithUserPayload): Promise<SharingInvite>;
195
- /**
196
- * Create a sharing.
197
- */
198
- createSharing(createSharingPayload: CreateSharingPayload): Promise<SharingMeta>;
199
- /**
200
- * Get sharing meta with code
201
- */
202
- getSharingMeta(sharingId: string, code: string, password?: string): Promise<SharingMeta>;
203
- /**
204
- * Add/edit sharing Password
205
- * @param {string} sharingId - id of sharing.
206
- * @param {string} encryptedPassword - password encrypted with CODE as key
207
- * @returns {Promise<SharingMeta>} A promise that returns the sharing info with the new encrypted password
208
- */
209
- saveSharingPassword(sharingId: string, encryptedPassword: string): Promise<SharingMeta>;
210
- /**
211
- * Remove password protection from sharing
212
- * @param {string} sharingId - id of sharing.
213
- * @returns {Promise<void>} A promise that resolves when password was successfully deleted.
214
- */
215
- removeSharingPassword(sharingId: string): Promise<void>;
216
- /**
217
- * Get public information of the item shared.
218
- * @param {string} sharingId - id of sharing.
219
- * @returns {Promise<PublicSharedItemInfo>} A promise that returns data of the public shared item.
220
- */
221
- getPublicSharedItemInfo(sharingId: string): Promise<PublicSharedItemInfo>;
222
- /**
223
- * Request access to shared folder.
224
- */
225
- requestUserToSharedFolder(createInviteDto: ShareFolderWithUserPayload): Promise<void>;
226
- /**
227
- * Check if the expirationDate of invite is valid.
228
- * @param {string} invitationId - The id of the invitation.
229
-
230
- * @returns {Promise<{uuid: string}>} A promise returning the uuid of the invitation if valid.
231
- */
232
- validateInviteExpiration(invitationId: string): Promise<{
233
- uuid: string;
234
- }>;
235
- /**
236
- * Share a private folder with a user.
237
- * @param {string} invitationId - The id of the invitation.
238
- * @param {ShareFolderWithUserPayload} options - The options for sharing the private folder with a user.
239
- * @param {string} options.encryptionKey - The encryption key (just in case the invitation is a request).
240
- * @param {string} options.itemType - The encryption algorithm (just in case the invitation is a request).
241
-
242
- * @returns {Promise<void>} A promise that resolves when the folder is shared with the user.
243
- */
244
- acceptSharedFolderInvite({ invitationId, acceptInvite, token, }: {
245
- invitationId: string;
246
- acceptInvite?: AcceptInvitationToSharedFolderPayload;
247
- token?: string;
248
- }): Promise<void>;
249
- /**
250
- * Change Sharing Mode.
251
- * @param {string} options.itemType - folder | file
252
- * @param {string} options.itemId - id of folder or file
253
- * @param {string} options.sharingType - New Sharing type.
254
-
255
- * @returns {Promise<void>} A promise that resolves when sharing mode has been updated.
256
- */
257
- updateSharingType({ itemId, itemType, sharingType, }: {
258
- itemId: string;
259
- itemType: string;
260
- sharingType: string;
261
- }): Promise<void>;
262
- /**
263
- * Get Sharing type
264
- * @param {string} options.itemType - folder | file
265
- * @param {string} options.itemId - id of folder or file
266
- * @returns {Promise<SharingMeta>} A promise that returns the sharing data.
267
- */
268
- getSharingType({ itemId, itemType }: {
269
- itemId: string;
270
- itemType: string;
271
- }): Promise<SharingMeta>;
272
- declineSharedFolderInvite(invitationId: string, token?: string): Promise<void>;
273
- /**
274
- * Fetches roles for sharing items.
275
- *
276
- * @returns {Promise<PrivateSharingRolesResponse>} A promise containing the list of sharing roles.
277
- */
278
- getSharingRoles(): Promise<Role[]>;
279
- getAllAccessUsers({ itemType, folderId, }: {
280
- itemType: string;
281
- folderId: string;
282
- }): Promise<Record<'users', any[]> | Record<'error', string>>;
283
- /**
284
- * Stop sharing folder
285
- * @param {string} itemType - Type of the sharing to delete
286
- * @param {string} itemId - Id of the sharing to delete
287
- * @returns
288
- */
289
- stopSharingFolder(itemType: string, itemId: string): Promise<void>;
290
- /**
291
- * Returns the needed headers for the module requests
292
- * @private
293
- */
294
- private headers;
295
- /**
296
- * Returns the needed headers for the module requests
297
- * @private
298
- */
299
- private basicHeaders;
300
- /**
301
- * Used to send the password in shares
302
- * @private
303
- */
304
- private basicHeadersWithPassword;
305
- /**
306
- * Get request headers with optional authorization token.
307
- *
308
- * @param {string} [token] - Optional authorization token.
309
- * @returns {Object} - Request headers object.
310
- */
311
- private getRequestHeaders;
312
- /**
313
- * Gets the size of a shared folder given sharing id
314
- *
315
- * @param {string} sharingId - Sharing ID.
316
- * @returns {Promise<SharedFolderSize>}
317
- */
318
- getSharedFolderSize(id: string): Promise<SharedFolderSize>;
319
- }
1
+ import { ApiSecurity, ApiUrl, AppDetails } from '../../shared';
2
+ import { AcceptInvitationToSharedFolderPayload, CreateSharingPayload, GenerateShareLinkPayload, GetShareLinkFolderSizePayload, GetSharedDirectoryPayload, ListAllSharedFoldersResponse, ListPrivateSharedFoldersResponse, ListShareLinksResponse, ListSharedItemsResponse, PublicSharedItemInfo, RemoveUserRolePayload, Role, ShareDomainsResponse, ShareFolderWithUserPayload, ShareLink, SharedFolderSize, SharedFolderUser, SharedFoldersInvitationsAsInvitedUserResponse, SharingInvite, SharingMeta, UpdateShareLinkPayload, UpdateUserRolePayload, UpdateUserRoleResponse } from './types';
3
+ export * as ShareTypes from './types';
4
+ export declare class Share {
5
+ private readonly client;
6
+ private readonly appDetails;
7
+ private readonly apiSecurity;
8
+ static client(apiUrl: ApiUrl, appDetails: AppDetails, apiSecurity: ApiSecurity): Share;
9
+ private constructor();
10
+ /**
11
+ * Fetches the list of shared items
12
+ */
13
+ getShareLinks(page?: number, perPage?: number, orderBy?: 'views:ASC' | 'views:DESC' | 'createdAt:ASC' | 'createdAt:DESC'): Promise<ListShareLinksResponse>;
14
+ /**
15
+ * Creates a new link to share a file or folder
16
+ * @param payload
17
+ */
18
+ createShareLink(payload: GenerateShareLinkPayload): Promise<{
19
+ created: boolean;
20
+ token: string;
21
+ code: string;
22
+ }>;
23
+ /**
24
+ * Update share link
25
+ * @param payload
26
+ */
27
+ updateShareLink(payload: UpdateShareLinkPayload): Promise<ShareLink>;
28
+ /**
29
+ * Delete share link by id
30
+ * @param payload
31
+ */
32
+ deleteShareLink(shareId: string): Promise<{
33
+ deleted: boolean;
34
+ shareId: string;
35
+ }>;
36
+ /**
37
+ * Increment share view by token
38
+ * @param token
39
+ */
40
+ incrementShareViewByToken(token: string): Promise<{
41
+ incremented: boolean;
42
+ token: string;
43
+ }>;
44
+ /**
45
+ * Fetches data of a shared file
46
+ * @param token
47
+ */
48
+ getShareLink(token: string, password?: string): Promise<ShareLink>;
49
+ /**
50
+ * Fetches paginated folders or files of a specific share link
51
+ * @param payload
52
+ */
53
+ getShareLinkDirectory(payload: GetSharedDirectoryPayload): Promise<any>;
54
+ getShareDomains(): Promise<ShareDomainsResponse>;
55
+ /**
56
+ * Get size of folder in share links
57
+ * @param payload
58
+ */
59
+ getShareLinkFolderSize(payload: GetShareLinkFolderSizePayload): Promise<any>;
60
+ /**
61
+ * Fetches all folders shared by a user.
62
+ *
63
+ * @param {number} page - The page number for pagination.
64
+ * @param {number} perPage - The number of items per page for pagination.
65
+ * @param {string} [orderBy] - The optional order criteria (e.g., 'views:ASC', 'createdAt:DESC').
66
+ * @returns {Promise<ListPrivateSharedFoldersResponse>} A promise containing the list of shared folders.
67
+ */
68
+ getSentSharedFolders(page?: number, perPage?: number, orderBy?: 'views:ASC' | 'views:DESC' | 'createdAt:ASC' | 'createdAt:DESC'): Promise<ListPrivateSharedFoldersResponse>;
69
+ /**
70
+ * Fetches folders shared with a user.
71
+ *
72
+ * @param {number} page - The page number for pagination.
73
+ * @param {number} perPage - The number of items per page for pagination.
74
+ * @param {string} [orderBy] - The optional order criteria (e.g., 'views:ASC', 'createdAt:DESC').
75
+ * @returns {Promise<ListPrivateSharedFoldersResponse>} A promise containing the list of shared folders.
76
+ */
77
+ getReceivedSharedFolders(page?: number, perPage?: number, orderBy?: 'views:ASC' | 'views:DESC' | 'createdAt:ASC' | 'createdAt:DESC'): Promise<ListPrivateSharedFoldersResponse>;
78
+ /**
79
+ * Fetches all shared folders.
80
+ *
81
+ * @param {number} page - The page number for pagination.
82
+ * @param {number} perPage - The number of items per page for pagination.
83
+ * @param {string} [orderBy] - The optional order criteria (e.g., 'views:ASC', 'createdAt:DESC').
84
+ * @returns {Promise<ListAllSharedFoldersResponse>} A promise containing the list of shared folders.
85
+ */
86
+ getAllSharedFolders(page?: number, perPage?: number, orderBy?: 'views:ASC' | 'views:DESC' | 'createdAt:ASC' | 'createdAt:DESC'): Promise<ListAllSharedFoldersResponse>;
87
+ /**
88
+ * Fetches all shared files.
89
+ *
90
+ * @param {number} page - The page number for pagination.
91
+ * @param {number} perPage - The number of items per page for pagination.
92
+ * @param {string} [orderBy] - The optional order criteria (e.g., 'views:ASC', 'createdAt:DESC').
93
+ * @returns {Promise<ListAllSharedFoldersResponse>} A promise containing the list of shared folders.
94
+ */
95
+ getAllSharedFiles(page?: number, perPage?: number, orderBy?: 'views:ASC' | 'views:DESC' | 'createdAt:ASC' | 'createdAt:DESC'): Promise<ListAllSharedFoldersResponse>;
96
+ /**
97
+ * Get all users with access to a shared folder.
98
+ *
99
+ * @param {string} folderUUID - The UUID of the folder.
100
+ * @param {number} page - The page number for pagination.
101
+ * @param {number} perPage - The number of items per page for pagination.
102
+ * @param {string} [orderBy] - The optional order criteria (e.g., 'views:ASC', 'createdAt:DESC').
103
+ * @returns {Promise<{ users: SharedFolderUser[] }>} A promise containing the list of users with access to the folder.
104
+ */
105
+ getSharedFolderUsers(folderUUID: string, page?: number, perPage?: number, orderBy?: 'views:ASC' | 'views:DESC' | 'createdAt:ASC' | 'createdAt:DESC'): Promise<{
106
+ users: SharedFolderUser[];
107
+ }>;
108
+ /**
109
+ * Get shared folder content
110
+ * @param {string} sharedFolderId - The UUID of the shared folder.
111
+ * @param {string} type - The item type for the query folders/files
112
+ * @param {string} token - Key that enables invited users to navigate the folders
113
+ * @param {number} page - The page number for pagination.
114
+ * @param {number} perPage - The number of items per page for pagination.
115
+ * @param {string} [orderBy] - The optional order criteria (e.g., 'views:ASC', 'createdAt:DESC').
116
+ */
117
+ getSharedFolderContent(sharedFolderId: string, type: 'folders' | 'files', token: string | null, page?: number, perPage?: number, orderBy?: 'views:ASC' | 'views:DESC' | 'createdAt:ASC' | 'createdAt:DESC'): Promise<ListSharedItemsResponse>;
118
+ /**
119
+ * Get public shared folder content
120
+ * @param {string} sharedFolderId - The UUID of the shared folder.
121
+ * @param {string} type - The item type for the query folders/files
122
+ * @param {string} token - Key that enables invited users to navigate the folders
123
+ * @param {number} page - The page number for pagination.
124
+ * @param {number} perPage - The number of items per page for pagination.
125
+ * @param {string} [orderBy] - The optional order criteria (e.g., 'views:ASC', 'createdAt:DESC').
126
+ */
127
+ getPublicSharedFolderContent(sharedFolderId: string, type: 'folders' | 'files', token: string | null, page?: number, perPage?: number, code?: string, orderBy?: 'views:ASC' | 'views:DESC' | 'createdAt:ASC' | 'createdAt:DESC'): Promise<ListSharedItemsResponse>;
128
+ /**
129
+ * Get the role of a user on a folder.
130
+ *
131
+ * @param {string} options.sharingId - The unique identifier of the sharing.
132
+ * @returns {Promise<Role>} A promise containing the role of the current user in the sharing.
133
+ */
134
+ getUserRole(sharingId: string): Promise<Role>;
135
+ /**
136
+ * Update the role of a user on a folder.
137
+ *
138
+ * @param {UpdateUserRolePayload} options - The options for updating the user's role on the folder.
139
+ * @param {string} options.sharingId - The unique identifier of the user to whom we will update the role.
140
+ * @param {string} options.newRoleId - The new role Id.
141
+ * @returns {Promise<UpdateRoleFolderResponse>} A promise that resolves when the user's role is updated.
142
+ */
143
+ updateUserRole({ sharingId, newRoleId }: UpdateUserRolePayload): Promise<UpdateUserRoleResponse>;
144
+ /**
145
+ * Remove user from shared folder.
146
+ *
147
+ * @param {UpdateUserRolePayload} options - The options for updating the user's role on the folder.
148
+ * @param {string} options.itemType - The unique identifier of the folder.
149
+ * @param {string} options.itemId - The identifier of the role to assign to the user.
150
+ * @param {string} options.userId - The role Id how we want to delete.
151
+ * @returns {Promise<UpdateRoleFolderResponse>} A promise that resolves when the user's role is updated.
152
+ */
153
+ removeUserRole({ itemType, itemId, userId }: RemoveUserRolePayload): Promise<UpdateUserRoleResponse>;
154
+ /**
155
+ * Get private folder data.
156
+ *
157
+ * @param {string} itemId - The itemId of the folder.
158
+ * @param {string} itemType - The itemType of the folder (file | folder).
159
+ * @returns {Promise<{ data: SharingInvite[] }>} A promise containing the private folder data.
160
+ */
161
+ getSharedFolderInvitations({ itemId, itemType, }: {
162
+ itemId: string;
163
+ itemType: 'folder' | 'file';
164
+ }): Promise<any[]>;
165
+ /**
166
+ * Get all invitations for a user.
167
+ * @param limit - The number of items per page for pagination.
168
+ * @param offset - The page number for pagination.
169
+ * @returns {Promise<invites: any>} A promise containing the list of invitations.
170
+ */
171
+ getSharedFolderInvitationsAsInvitedUser({ limit, offset, }: {
172
+ limit?: number;
173
+ offset?: number;
174
+ }): Promise<{
175
+ invites: SharedFoldersInvitationsAsInvitedUserResponse[];
176
+ }>;
177
+ /**
178
+ * Share a private folder with a user.
179
+ *
180
+ * @param {ShareFolderWithUserPayload} options - The options for sharing the private folder with a user.
181
+ * @param {string} options.itemId - The id of the item to share.
182
+ * @param {string} options.itemType - The type of the item to share (folder | file).
183
+ * @param {string} options.sharedWith - The email address of the user to share the folder with.
184
+ * @param {string} options.encryptionKey - Owner\'s encryption key encrypted with the invited user\'s public key. This field should not be empty if the invitation type is "OWNER".
185
+ * @param {string} options.encryptionAlgorithm - Encryption algorithm used to encrypt the encryption key. This field should not be empty if the invitation type is "OWNER".
186
+ * @param {string} options.type - Owner's encryption key encrypted with the invited user's public key.
187
+ * @param {string} options.roleId - The id of the role to assign to the user.
188
+ * @param {string} options.notifyUser - If it has to notify the users
189
+ * @param {string} options.notificationMessage - Message of the notificacion
190
+ *
191
+ *
192
+ * @returns {Promise<SharingInvite>} A promise that resolves when the folder is shared with the user.
193
+ */
194
+ inviteUserToSharedFolder(createInviteDto: ShareFolderWithUserPayload): Promise<SharingInvite>;
195
+ /**
196
+ * Create a sharing.
197
+ */
198
+ createSharing(createSharingPayload: CreateSharingPayload): Promise<SharingMeta>;
199
+ /**
200
+ * Get sharing meta with code
201
+ */
202
+ getSharingMeta(sharingId: string, code: string, password?: string): Promise<SharingMeta>;
203
+ /**
204
+ * Add/edit sharing Password
205
+ * @param {string} sharingId - id of sharing.
206
+ * @param {string} encryptedPassword - password encrypted with CODE as key
207
+ * @returns {Promise<SharingMeta>} A promise that returns the sharing info with the new encrypted password
208
+ */
209
+ saveSharingPassword(sharingId: string, encryptedPassword: string): Promise<SharingMeta>;
210
+ /**
211
+ * Remove password protection from sharing
212
+ * @param {string} sharingId - id of sharing.
213
+ * @returns {Promise<void>} A promise that resolves when password was successfully deleted.
214
+ */
215
+ removeSharingPassword(sharingId: string): Promise<void>;
216
+ /**
217
+ * Get public information of the item shared.
218
+ * @param {string} sharingId - id of sharing.
219
+ * @returns {Promise<PublicSharedItemInfo>} A promise that returns data of the public shared item.
220
+ */
221
+ getPublicSharedItemInfo(sharingId: string): Promise<PublicSharedItemInfo>;
222
+ /**
223
+ * Request access to shared folder.
224
+ */
225
+ requestUserToSharedFolder(createInviteDto: ShareFolderWithUserPayload): Promise<void>;
226
+ /**
227
+ * Check if the expirationDate of invite is valid.
228
+ * @param {string} invitationId - The id of the invitation.
229
+
230
+ * @returns {Promise<{uuid: string}>} A promise returning the uuid of the invitation if valid.
231
+ */
232
+ validateInviteExpiration(invitationId: string): Promise<{
233
+ uuid: string;
234
+ }>;
235
+ /**
236
+ * Share a private folder with a user.
237
+ * @param {string} invitationId - The id of the invitation.
238
+ * @param {ShareFolderWithUserPayload} options - The options for sharing the private folder with a user.
239
+ * @param {string} options.encryptionKey - The encryption key (just in case the invitation is a request).
240
+ * @param {string} options.itemType - The encryption algorithm (just in case the invitation is a request).
241
+
242
+ * @returns {Promise<void>} A promise that resolves when the folder is shared with the user.
243
+ */
244
+ acceptSharedFolderInvite({ invitationId, acceptInvite, token, }: {
245
+ invitationId: string;
246
+ acceptInvite?: AcceptInvitationToSharedFolderPayload;
247
+ token?: string;
248
+ }): Promise<void>;
249
+ /**
250
+ * Change Sharing Mode.
251
+ * @param {string} options.itemType - folder | file
252
+ * @param {string} options.itemId - id of folder or file
253
+ * @param {string} options.sharingType - New Sharing type.
254
+
255
+ * @returns {Promise<void>} A promise that resolves when sharing mode has been updated.
256
+ */
257
+ updateSharingType({ itemId, itemType, sharingType, }: {
258
+ itemId: string;
259
+ itemType: string;
260
+ sharingType: string;
261
+ }): Promise<void>;
262
+ /**
263
+ * Get Sharing type
264
+ * @param {string} options.itemType - folder | file
265
+ * @param {string} options.itemId - id of folder or file
266
+ * @returns {Promise<SharingMeta>} A promise that returns the sharing data.
267
+ */
268
+ getSharingType({ itemId, itemType }: {
269
+ itemId: string;
270
+ itemType: string;
271
+ }): Promise<SharingMeta>;
272
+ declineSharedFolderInvite(invitationId: string, token?: string): Promise<void>;
273
+ /**
274
+ * Fetches roles for sharing items.
275
+ *
276
+ * @returns {Promise<PrivateSharingRolesResponse>} A promise containing the list of sharing roles.
277
+ */
278
+ getSharingRoles(): Promise<Role[]>;
279
+ getAllAccessUsers({ itemType, folderId, }: {
280
+ itemType: string;
281
+ folderId: string;
282
+ }): Promise<Record<'users', any[]> | Record<'error', string>>;
283
+ /**
284
+ * Stop sharing folder
285
+ * @param {string} itemType - Type of the sharing to delete
286
+ * @param {string} itemId - Id of the sharing to delete
287
+ * @returns
288
+ */
289
+ stopSharingFolder(itemType: string, itemId: string): Promise<void>;
290
+ /**
291
+ * Returns the needed headers for the module requests
292
+ * @private
293
+ */
294
+ private headers;
295
+ /**
296
+ * Returns the needed headers for the module requests
297
+ * @private
298
+ */
299
+ private basicHeaders;
300
+ /**
301
+ * Used to send the password in shares
302
+ * @private
303
+ */
304
+ private basicHeadersWithPassword;
305
+ /**
306
+ * Get request headers with optional authorization token.
307
+ *
308
+ * @param {string} [token] - Optional authorization token.
309
+ * @returns {Object} - Request headers object.
310
+ */
311
+ private getRequestHeaders;
312
+ /**
313
+ * Gets the size of a shared folder given sharing id
314
+ *
315
+ * @param {string} sharingId - Sharing ID.
316
+ * @returns {Promise<SharedFolderSize>}
317
+ */
318
+ getSharedFolderSize(id: string): Promise<SharedFolderSize>;
319
+ }