@internxt/sdk 1.4.79 → 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 (64) hide show
  1. package/dist/auth/index.d.ts +5 -0
  2. package/dist/auth/index.js +80 -12
  3. package/dist/auth/types.d.ts +17 -4
  4. package/dist/drive/backups/index.js +3 -3
  5. package/dist/drive/index.js +5 -1
  6. package/dist/drive/payments/index.d.ts +30 -17
  7. package/dist/drive/payments/index.js +78 -25
  8. package/dist/drive/payments/types.d.ts +67 -1
  9. package/dist/drive/payments/types.js +11 -6
  10. package/dist/drive/referrals/index.js +5 -1
  11. package/dist/drive/referrals/types.js +2 -2
  12. package/dist/drive/share/index.d.ts +1 -1
  13. package/dist/drive/share/index.js +49 -44
  14. package/dist/drive/share/types.d.ts +31 -29
  15. package/dist/drive/storage/index.d.ts +130 -10
  16. package/dist/drive/storage/index.js +253 -53
  17. package/dist/drive/storage/types.d.ts +107 -21
  18. package/dist/drive/storage/types.js +2 -2
  19. package/dist/drive/trash/index.d.ts +22 -2
  20. package/dist/drive/trash/index.js +44 -9
  21. package/dist/drive/trash/types.d.ts +9 -0
  22. package/dist/drive/users/index.d.ts +30 -3
  23. package/dist/drive/users/index.js +40 -6
  24. package/dist/drive/users/types.d.ts +16 -6
  25. package/dist/index.d.ts +3 -2
  26. package/dist/index.js +12 -7
  27. package/dist/network/download.js +5 -5
  28. package/dist/network/errors/codes.d.ts +1 -1
  29. package/dist/network/errors/context.d.ts +4 -4
  30. package/dist/network/errors/context.js +2 -2
  31. package/dist/network/errors/download.js +5 -1
  32. package/dist/network/errors/index.js +5 -1
  33. package/dist/network/errors/upload.js +5 -1
  34. package/dist/network/index.d.ts +2 -3
  35. package/dist/network/index.js +14 -9
  36. package/dist/network/types.d.ts +16 -16
  37. package/dist/network/types.js +2 -2
  38. package/dist/network/upload.js +8 -9
  39. package/dist/photos/devices/index.js +8 -8
  40. package/dist/photos/index.js +5 -1
  41. package/dist/photos/photos/index.js +26 -26
  42. package/dist/photos/shares/index.js +3 -3
  43. package/dist/photos/types.d.ts +14 -14
  44. package/dist/photos/types.js +3 -3
  45. package/dist/photos/users/index.js +2 -2
  46. package/dist/shared/headers/index.d.ts +9 -6
  47. package/dist/shared/headers/index.js +27 -18
  48. package/dist/shared/http/client.d.ts +1 -1
  49. package/dist/shared/http/client.js +4 -13
  50. package/dist/shared/http/types.d.ts +4 -4
  51. package/dist/shared/index.js +5 -1
  52. package/dist/shared/types/apiConnection.d.ts +2 -1
  53. package/dist/shared/types/appsumo.js +1 -1
  54. package/dist/shared/types/errors.d.ts +2 -1
  55. package/dist/shared/types/errors.js +2 -1
  56. package/dist/shared/types/userSettings.d.ts +17 -1
  57. package/dist/utils.js +2 -3
  58. package/dist/workspaces/index.d.ts +176 -0
  59. package/dist/workspaces/index.js +419 -0
  60. package/dist/workspaces/index.test.d.ts +1 -0
  61. package/dist/workspaces/index.test.js +908 -0
  62. package/dist/workspaces/types.d.ts +294 -0
  63. package/dist/workspaces/types.js +2 -0
  64. package/package.json +13 -13
@@ -0,0 +1,419 @@
1
+ "use strict";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
13
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
14
+ if (k2 === undefined) k2 = k;
15
+ var desc = Object.getOwnPropertyDescriptor(m, k);
16
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
17
+ desc = { enumerable: true, get: function() { return m[k]; } };
18
+ }
19
+ Object.defineProperty(o, k2, desc);
20
+ }) : (function(o, m, k, k2) {
21
+ if (k2 === undefined) k2 = k;
22
+ o[k2] = m[k];
23
+ }));
24
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
25
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
26
+ };
27
+ var __rest = (this && this.__rest) || function (s, e) {
28
+ var t = {};
29
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
30
+ t[p] = s[p];
31
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
32
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
33
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
34
+ t[p[i]] = s[p[i]];
35
+ }
36
+ return t;
37
+ };
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.Workspaces = void 0;
40
+ var headers_1 = require("../shared/headers");
41
+ var client_1 = require("../shared/http/client");
42
+ var Workspaces = /** @class */ (function () {
43
+ function Workspaces(apiUrl, appDetails, apiSecurity) {
44
+ this.client = client_1.HttpClient.create(apiUrl, apiSecurity.unauthorizedCallback);
45
+ this.appDetails = appDetails;
46
+ this.apiSecurity = apiSecurity;
47
+ }
48
+ Workspaces.client = function (apiUrl, appDetails, apiSecurity) {
49
+ return new Workspaces(apiUrl, appDetails, apiSecurity);
50
+ };
51
+ /**
52
+ * Returns the needed headers for the module requests
53
+ * @private
54
+ */
55
+ Workspaces.prototype.headers = function () {
56
+ return (0, headers_1.headersWithToken)(this.appDetails.clientName, this.appDetails.clientVersion, this.apiSecurity.token, this.apiSecurity.workspaceToken);
57
+ };
58
+ Workspaces.prototype.getRequestHeaders = function (token) {
59
+ var headers = __assign({}, this.headers());
60
+ if (token) {
61
+ headers.Authorization = 'Bearer ' + token;
62
+ }
63
+ return headers;
64
+ };
65
+ Workspaces.prototype.getWorkspaces = function () {
66
+ return this.client.get('workspaces/', this.headers());
67
+ };
68
+ Workspaces.prototype.getPendingWorkspaces = function () {
69
+ return this.client.get('workspaces/pending-setup', this.headers());
70
+ };
71
+ Workspaces.prototype.getPendingInvites = function () {
72
+ var limitQuery = '?limit=25';
73
+ var offsetQuery = '&offset=0';
74
+ var query = "".concat(limitQuery).concat(offsetQuery);
75
+ return this.client.get("workspaces/invitations/".concat(query), this.headers());
76
+ };
77
+ Workspaces.prototype.validateWorkspaceInvite = function (inviteId) {
78
+ return this.client.get("workspaces/invitations/".concat(inviteId, "validate"), this.headers());
79
+ };
80
+ /**
81
+ * Uploads an avatar for a specific workspace.
82
+ * @param workspaceId The UUID of the workspace to upload the avatar for.
83
+ * @param avatar The avatar to upload.
84
+ * @returns The response from the server.
85
+ */
86
+ Workspaces.prototype.uploadWorkspaceAvatar = function (workspaceId, avatar) {
87
+ var formData = new FormData();
88
+ formData.append('file', avatar);
89
+ return this.client.post("workspaces/".concat(workspaceId, "/avatar"), formData, __assign(__assign({}, this.headers()), { 'content-type': 'multipart/form-data' }));
90
+ };
91
+ Workspaces.prototype.deleteWorkspaceAvatar = function (workspaceId) {
92
+ return this.client.delete("workspaces/".concat(workspaceId, "/avatar"), this.headers());
93
+ };
94
+ Workspaces.prototype.setupWorkspace = function (_a) {
95
+ var workspaceId = _a.workspaceId, name = _a.name, address = _a.address, description = _a.description, encryptedMnemonic = _a.encryptedMnemonic, hybridModeEnabled = _a.hybridModeEnabled;
96
+ return this.client.patch("workspaces/".concat(workspaceId, "/setup"), { name: name, address: address, description: description, encryptedMnemonic: encryptedMnemonic, hybridModeEnabled: hybridModeEnabled }, this.headers());
97
+ };
98
+ Workspaces.prototype.getWorkspaceUsage = function (workspaceId) {
99
+ return this.client.get("workspaces/".concat(workspaceId, "/usage"), this.headers());
100
+ };
101
+ Workspaces.prototype.editWorkspace = function (workspaceId, details) {
102
+ return this.client.patch("workspaces/".concat(workspaceId), details, this.headers());
103
+ };
104
+ Workspaces.prototype.updateAvatar = function (workspaceId, payload) {
105
+ var formData = new FormData();
106
+ formData.set('file', payload.avatar);
107
+ return this.client.post("workspaces/".concat(workspaceId, "/avatar"), formData, this.headers());
108
+ };
109
+ Workspaces.prototype.deleteAvatar = function (workspaceId) {
110
+ return this.client.delete("workspaces/".concat(workspaceId, "/avatar"), this.headers());
111
+ };
112
+ Workspaces.prototype.createTeam = function (_a) {
113
+ var workspaceId = _a.workspaceId, name = _a.name, managerId = _a.managerId;
114
+ return this.client.post("workspaces/".concat(workspaceId, "/teams"), {
115
+ name: name,
116
+ managerId: managerId,
117
+ }, this.headers());
118
+ };
119
+ Workspaces.prototype.getWorkspacesMembers = function (workspaceId) {
120
+ return this.client.get("workspaces/".concat(workspaceId, "/members"), this.headers());
121
+ };
122
+ Workspaces.prototype.getWorkspacesTeams = function (workspaceId) {
123
+ return this.client.get("workspaces/".concat(workspaceId, "/teams"), this.headers());
124
+ };
125
+ Workspaces.prototype.editTeam = function (_a) {
126
+ var teamId = _a.teamId, name = _a.name;
127
+ return this.client.patch("workspaces/teams/".concat(teamId), {
128
+ name: name,
129
+ }, this.headers());
130
+ };
131
+ Workspaces.prototype.deleteTeam = function (_a) {
132
+ var workspaceId = _a.workspaceId, teamId = _a.teamId;
133
+ return this.client.delete("workspaces/".concat(workspaceId, "/teams/").concat(teamId), this.headers());
134
+ };
135
+ Workspaces.prototype.getWorkspacesTeamMembers = function (teamId) {
136
+ return this.client.get("workspaces/teams/".concat(teamId, "/members"), this.headers());
137
+ };
138
+ Workspaces.prototype.addTeamUser = function (teamId, userUuid) {
139
+ return this.client.post("/workspaces/teams/".concat(teamId, "/user/").concat(userUuid), {}, this.headers());
140
+ };
141
+ Workspaces.prototype.removeTeamUser = function (teamId, userUuid) {
142
+ return this.client.delete("/workspaces/teams/".concat(teamId, "/user/").concat(userUuid), this.headers());
143
+ };
144
+ Workspaces.prototype.changeTeamManager = function (workspaceId, teamId, userUuid) {
145
+ return this.client.patch("/workspaces/".concat(workspaceId, "/teams/").concat(teamId, "/manager"), { managerId: userUuid }, this.headers());
146
+ };
147
+ Workspaces.prototype.getPersonalTrash = function (workspaceId, type, offset, limit) {
148
+ if (offset === void 0) { offset = 0; }
149
+ if (limit === void 0) { limit = 50; }
150
+ var offsetQuery = "?offset=".concat(offset);
151
+ var limitQuery = "&limit=".concat(limit);
152
+ var typeQuery = "&type=".concat(type);
153
+ var query = "".concat(offsetQuery).concat(limitQuery).concat(typeQuery);
154
+ return this.client.get("/workspaces/".concat(workspaceId, "/trash").concat(query), this.headers());
155
+ };
156
+ Workspaces.prototype.emptyPersonalTrash = function (workspaceId) {
157
+ return this.client.delete("/workspaces/".concat(workspaceId, "/trash"), this.headers());
158
+ };
159
+ Workspaces.prototype.changeUserRole = function (teamId, memberId, role) {
160
+ return this.client.patch("/api/workspaces/teams/".concat(teamId, "/members/").concat(memberId, "/role"), {
161
+ role: role,
162
+ }, this.headers());
163
+ };
164
+ Workspaces.prototype.inviteMemberToWorkspace = function (_a) {
165
+ var workspaceId = _a.workspaceId, invitedUserEmail = _a.invitedUserEmail, spaceLimitBytes = _a.spaceLimitBytes, encryptedMnemonicInBase64 = _a.encryptedMnemonicInBase64, _b = _a.encryptionAlgorithm, encryptionAlgorithm = _b === void 0 ? 'aes-256-gcm' : _b, message = _a.message;
166
+ return this.client.post("workspaces/".concat(workspaceId, "/members/invite"), {
167
+ invitedUser: invitedUserEmail,
168
+ spaceLimit: spaceLimitBytes,
169
+ encryptionKey: encryptedMnemonicInBase64,
170
+ encryptionAlgorithm: encryptionAlgorithm,
171
+ message: message,
172
+ }, this.headers());
173
+ };
174
+ Workspaces.prototype.leaveWorkspace = function (workspaceId) {
175
+ return this.client.delete("workspaces/".concat(workspaceId, "/members/leave"), this.headers());
176
+ };
177
+ Workspaces.prototype.getMemberDetails = function (workspaceId, memberId) {
178
+ return this.client.get("workspaces/".concat(workspaceId, "/members/").concat(memberId), this.headers());
179
+ };
180
+ Workspaces.prototype.modifyMemberUsage = function (workspaceId, memberId, spaceLimitBytes) {
181
+ return this.client.patch("workspaces/".concat(workspaceId, "/members/").concat(memberId, "/usage"), {
182
+ spaceLimit: spaceLimitBytes,
183
+ }, this.headers());
184
+ };
185
+ Workspaces.prototype.getMemberUsage = function (workspaceId) {
186
+ return this.client.get("workspaces/".concat(workspaceId, "/usage/member"), this.headers());
187
+ };
188
+ Workspaces.prototype.deactivateMember = function (workspaceId, memberId) {
189
+ return this.client.patch("workspaces/".concat(workspaceId, "/members/").concat(memberId, "/deactivate"), {}, this.headers());
190
+ };
191
+ Workspaces.prototype.activateMember = function (workspaceId, memberId) {
192
+ return this.client.patch("workspaces/".concat(workspaceId, "/members/").concat(memberId, "/activate"), {}, this.headers());
193
+ };
194
+ Workspaces.prototype.removeMember = function (workspaceId, memberId) {
195
+ return this.client.delete("workspaces/".concat(workspaceId, "/members/").concat(memberId), this.headers());
196
+ };
197
+ Workspaces.prototype.acceptInvitation = function (inviteId, token) {
198
+ return this.client.post('workspaces/invitations/accept', {
199
+ inviteId: inviteId,
200
+ }, this.getRequestHeaders(token));
201
+ };
202
+ Workspaces.prototype.declineInvitation = function (inviteId, token) {
203
+ return this.client.delete("workspaces/invitations/".concat(inviteId), this.getRequestHeaders(token));
204
+ };
205
+ Workspaces.prototype.getWorkspaceCredentials = function (workspaceId) {
206
+ return this.client.get("workspaces/".concat(workspaceId, "/credentials"), this.headers());
207
+ };
208
+ Workspaces.prototype.createFileEntry = function (fileEntry, workspaceId, resourcesToken) {
209
+ return this.client.post("/workspaces/".concat(workspaceId, "/files"), {
210
+ name: fileEntry.name,
211
+ bucket: fileEntry.bucket,
212
+ fileId: fileEntry.fileId,
213
+ encryptVersion: fileEntry.encryptVersion,
214
+ folderUuid: fileEntry.folderUuid,
215
+ size: fileEntry.size,
216
+ plainName: fileEntry.plainName,
217
+ type: fileEntry.type,
218
+ modificationTime: fileEntry.modificationTime,
219
+ date: fileEntry.date,
220
+ }, (0, headers_1.addResourcesTokenToHeaders)(this.headers(), resourcesToken));
221
+ };
222
+ /**
223
+ * Creates a new folder in the specified workspace.
224
+ *
225
+ * @param {CreateFolderPayload} options - The options for creating the folder.
226
+ * @param {string} options.workspaceId - The ID of the workspace.
227
+ * @param {string} options.plainName - The plain name of the folder.
228
+ * @param {string} options.parentFolderUuid - The UUID of the parent folder.
229
+ * @return {[Promise<CreateFolderResponse>, RequestCanceler]} A tuple containing a promise to get the API response and a function to cancel the request.
230
+ */
231
+ Workspaces.prototype.createFolder = function (_a) {
232
+ var workspaceId = _a.workspaceId, plainName = _a.plainName, parentFolderUuid = _a.parentFolderUuid;
233
+ var _b = this.client.postCancellable("/workspaces/".concat(workspaceId, "/folders"), {
234
+ name: plainName,
235
+ parentFolderUuid: parentFolderUuid,
236
+ }, this.headers()), promise = _b.promise, requestCanceler = _b.requestCanceler;
237
+ return [promise, requestCanceler];
238
+ };
239
+ /**
240
+ * Retrieves a paginated list of folders within a specific folder in a workspace.
241
+ *
242
+ * @param {string} workspaceId - The ID of the workspace.
243
+ * @param {string} folderUUID - The UUID of the folder.
244
+ * @param {number} [offset=0] - The position of the first file to return.
245
+ * @param {number} [limit=50] - The max number of files to be returned.
246
+ * @param {string} [sort=''] - The reference column to sort it.
247
+ * @param {string} [order=''] - The order to be followed.
248
+ * @return {[Promise<FetchPaginatedFolderContentResponse>, RequestCanceler]} An array containing a promise to get the API response and a function to cancel the request.
249
+ */
250
+ Workspaces.prototype.getFolders = function (workspaceId, folderUUID, offset, limit, sort, order) {
251
+ if (offset === void 0) { offset = 0; }
252
+ if (limit === void 0) { limit = 50; }
253
+ if (sort === void 0) { sort = ''; }
254
+ if (order === void 0) { order = ''; }
255
+ var offsetQuery = "?offset=".concat(offset);
256
+ var limitQuery = "&limit=".concat(limit);
257
+ var sortQuery = sort !== '' ? "&sort=".concat(sort) : '';
258
+ var orderQuery = order !== '' ? "&order=".concat(order) : '';
259
+ var query = "".concat(offsetQuery).concat(limitQuery).concat(sortQuery).concat(orderQuery);
260
+ var _a = this.client.getCancellable("workspaces/".concat(workspaceId, "/folders/").concat(folderUUID, "/folders/").concat(query), this.headers()), promise = _a.promise, requestCanceler = _a.requestCanceler;
261
+ return [promise, requestCanceler];
262
+ };
263
+ /**
264
+ * Retrieves a paginated list of files within a specific folder in a workspace.
265
+ *
266
+ * @param {string} workspaceId - The ID of the workspace.
267
+ * @param {string} folderUUID - The UUID of the folder.
268
+ * @param {number} [offset=0] - The position of the first file to return.
269
+ * @param {number} [limit=50] - The max number of files to be returned.
270
+ * @param {string} [sort=''] - The reference column to sort it.
271
+ * @param {string} [order=''] - The order to be followed.
272
+ * @return {[Promise<FetchPaginatedFolderContentResponse>, RequestCanceler]} An array containing a promise to get the API response and a function to cancel the request.
273
+ */
274
+ Workspaces.prototype.getFiles = function (workspaceId, folderUUID, offset, limit, sort, order) {
275
+ if (offset === void 0) { offset = 0; }
276
+ if (limit === void 0) { limit = 50; }
277
+ if (sort === void 0) { sort = ''; }
278
+ if (order === void 0) { order = ''; }
279
+ var offsetQuery = "?offset=".concat(offset);
280
+ var limitQuery = "&limit=".concat(limit);
281
+ var sortQuery = sort !== '' ? "&sort=".concat(sort) : '';
282
+ var orderQuery = order !== '' ? "&order=".concat(order) : '';
283
+ var query = "".concat(offsetQuery).concat(limitQuery).concat(sortQuery).concat(orderQuery);
284
+ var _a = this.client.getCancellable("workspaces/".concat(workspaceId, "/folders/").concat(folderUUID, "/files/").concat(query), this.headers()), promise = _a.promise, requestCanceler = _a.requestCanceler;
285
+ return [promise, requestCanceler];
286
+ };
287
+ Workspaces.prototype.getWorkspacePendingInvitations = function (workspaceId, limit, offset) {
288
+ var limitQuery = "?limit=".concat(limit);
289
+ var offsetQuery = "&offset=".concat(offset);
290
+ var query = "".concat(limitQuery).concat(offsetQuery);
291
+ return this.client.get("workspaces/".concat(workspaceId, "/invitations/").concat(query), this.headers());
292
+ };
293
+ /**
294
+ * Creates a new sharing for a workspace item.
295
+ *
296
+ * @param {CreateWorkspaceSharingPayload} options - The options for creating the sharing.
297
+ * @param {string} options.workspaceId - The ID of the workspace.
298
+ * @param {string} options.teamUUID - The UUID of the team.
299
+ * @param {...CreateSharingPayload} options.createSharingPayload - The payload for creating the sharing.
300
+ * @returns {Promise<SharingMeta>} A promise that resolves to the sharing metadata.
301
+ */
302
+ Workspaces.prototype.shareItem = function (_a) {
303
+ var workspaceId = _a.workspaceId, teamUUID = _a.teamUUID, createSharingPayload = __rest(_a, ["workspaceId", "teamUUID"]);
304
+ return this.client.post("workspaces/".concat(workspaceId, "/shared"), __assign(__assign({}, createSharingPayload), { sharedWith: teamUUID }), this.headers());
305
+ };
306
+ Workspaces.prototype.validateWorkspaceInvitation = function (inviteId) {
307
+ return this.client.get("workspaces/invitations/".concat(inviteId, "/validate"), this.headers());
308
+ };
309
+ /**
310
+ * Returns shared files in teams.
311
+ * @param orderBy
312
+ * @deprecated use `getWorkspaceTeamSharedFilesV2` call instead.
313
+ */
314
+ Workspaces.prototype.getWorkspaceTeamSharedFiles = function (workspaceId, teamId, orderBy) {
315
+ var orderByQueryParam = orderBy ? "?orderBy=".concat(orderBy) : '';
316
+ var _a = this.client.getCancellable("workspaces/".concat(workspaceId, "/teams/").concat(teamId, "/shared/files").concat(orderByQueryParam), this.headers()), promise = _a.promise, requestCanceler = _a.requestCanceler;
317
+ return [promise, requestCanceler];
318
+ };
319
+ /**
320
+ * Returns shared files in teams.
321
+ * @param orderBy
322
+ */
323
+ Workspaces.prototype.getWorkspaceTeamSharedFilesV2 = function (workspaceId, orderBy) {
324
+ var orderByQueryParam = orderBy ? "?orderBy=".concat(orderBy) : '';
325
+ var _a = this.client.getCancellable("workspaces/".concat(workspaceId, "/shared/files").concat(orderByQueryParam), this.headers()), promise = _a.promise, requestCanceler = _a.requestCanceler;
326
+ return [promise, requestCanceler];
327
+ };
328
+ /**
329
+ * Returns shared folders in teams.
330
+ * @param orderBy
331
+ * @deprecated use `getWorkspaceTeamSharedFoldersV2` call instead.
332
+ */
333
+ Workspaces.prototype.getWorkspaceTeamSharedFolders = function (workspaceId, teamId, orderBy) {
334
+ var orderByQueryParam = orderBy ? "?orderBy=".concat(orderBy) : '';
335
+ var _a = this.client.getCancellable("workspaces/".concat(workspaceId, "/teams/").concat(teamId, "/shared/folders").concat(orderByQueryParam), this.headers()), promise = _a.promise, requestCanceler = _a.requestCanceler;
336
+ return [promise, requestCanceler];
337
+ };
338
+ /**
339
+ * Returns shared folders in teams.
340
+ * @param orderBy
341
+ */
342
+ Workspaces.prototype.getWorkspaceTeamSharedFoldersV2 = function (workspaceId, orderBy) {
343
+ var orderByQueryParam = orderBy ? "?orderBy=".concat(orderBy) : '';
344
+ var _a = this.client.getCancellable("workspaces/".concat(workspaceId, "/shared/folders").concat(orderByQueryParam), this.headers()), promise = _a.promise, requestCanceler = _a.requestCanceler;
345
+ return [promise, requestCanceler];
346
+ };
347
+ /**
348
+ * Returns files inside a shared folders with teams.
349
+ * @param orderBy
350
+ * @deprecated use `getWorkspaceTeamSharedFolderFilesV2` call instead.
351
+ */
352
+ Workspaces.prototype.getWorkspaceTeamSharedFolderFiles = function (workspaceId, teamId, sharedFolderUUID, page, perPage, token, orderBy) {
353
+ if (page === void 0) { page = 0; }
354
+ if (perPage === void 0) { perPage = 50; }
355
+ var orderByQueryParam = orderBy ? "&orderBy=".concat(orderBy) : '';
356
+ var params = "?page=".concat(page, "&perPage=").concat(perPage);
357
+ if (token)
358
+ params = params + "&token=".concat(token);
359
+ var _a = this.client.getCancellable("workspaces/".concat(workspaceId, "/teams/").concat(teamId, "/shared/").concat(sharedFolderUUID, "/files").concat(params, "\n ").concat(orderByQueryParam), this.headers()), promise = _a.promise, requestCanceler = _a.requestCanceler;
360
+ return [promise, requestCanceler];
361
+ };
362
+ /**
363
+ * Returns files inside a shared folders with teams.
364
+ * @param orderBy
365
+ */
366
+ Workspaces.prototype.getWorkspaceTeamSharedFolderFilesV2 = function (workspaceId, sharedFolderUUID, page, perPage, token, orderBy) {
367
+ if (page === void 0) { page = 0; }
368
+ if (perPage === void 0) { perPage = 50; }
369
+ var orderByQueryParam = orderBy ? "&orderBy=".concat(orderBy) : '';
370
+ var params = "?page=".concat(page, "&perPage=").concat(perPage);
371
+ if (token)
372
+ params = params + "&token=".concat(token);
373
+ var _a = this.client.getCancellable("workspaces/".concat(workspaceId, "/shared/").concat(sharedFolderUUID, "/files").concat(params, "\n ").concat(orderByQueryParam), this.headers()), promise = _a.promise, requestCanceler = _a.requestCanceler;
374
+ return [promise, requestCanceler];
375
+ };
376
+ /**
377
+ * Returns folders inside a shared folders with teams.
378
+ * @param orderBy
379
+ * @deprecated use `getWorkspaceTeamSharedFolderFoldersV2` call instead.
380
+ */
381
+ Workspaces.prototype.getWorkspaceTeamSharedFolderFolders = function (workspaceId, teamId, sharedFolderUUID, page, perPage, token, orderBy) {
382
+ if (page === void 0) { page = 0; }
383
+ if (perPage === void 0) { perPage = 50; }
384
+ var orderByQueryParam = orderBy ? "&orderBy=".concat(orderBy) : '';
385
+ var params = "?page=".concat(page, "&perPage=").concat(perPage);
386
+ if (token)
387
+ params = params + "&token=".concat(token);
388
+ var _a = this.client.getCancellable("workspaces/".concat(workspaceId, "/teams/").concat(teamId, "/shared/").concat(sharedFolderUUID, "/folders").concat(params, "\n ").concat(orderByQueryParam), this.headers()), promise = _a.promise, requestCanceler = _a.requestCanceler;
389
+ return [promise, requestCanceler];
390
+ };
391
+ /**
392
+ * Returns folders inside a shared folders with teams.
393
+ * @param orderBy
394
+ */
395
+ Workspaces.prototype.getWorkspaceTeamSharedFolderFoldersV2 = function (workspaceId, sharedFolderUUID, page, perPage, token, orderBy) {
396
+ if (page === void 0) { page = 0; }
397
+ if (perPage === void 0) { perPage = 50; }
398
+ var orderByQueryParam = orderBy ? "&orderBy=".concat(orderBy) : '';
399
+ var params = "?page=".concat(page, "&perPage=").concat(perPage);
400
+ if (token)
401
+ params = params + "&token=".concat(token);
402
+ var _a = this.client.getCancellable("workspaces/".concat(workspaceId, "/shared/").concat(sharedFolderUUID, "/folders").concat(params, "\n ").concat(orderByQueryParam), this.headers()), promise = _a.promise, requestCanceler = _a.requestCanceler;
403
+ return [promise, requestCanceler];
404
+ };
405
+ /**
406
+ * Returns users and teams an item is shared with.
407
+ */
408
+ Workspaces.prototype.getUsersAndTeamsAnItemIsShareWidth = function (_a) {
409
+ var workspaceId = _a.workspaceId, itemType = _a.itemType, itemId = _a.itemId;
410
+ var _b = this.client.getCancellable("workspaces/".concat(workspaceId, "/shared/").concat(itemType, "/").concat(itemId, "/shared-with"), this.headers()), promise = _b.promise, requestCanceler = _b.requestCanceler;
411
+ return [promise, requestCanceler];
412
+ };
413
+ Workspaces.prototype.getWorkspace = function (workspaceId) {
414
+ return this.client.get("workspaces/".concat(workspaceId), this.headers());
415
+ };
416
+ return Workspaces;
417
+ }());
418
+ exports.Workspaces = Workspaces;
419
+ __exportStar(require("./types"), exports);
@@ -0,0 +1 @@
1
+ export {};