@internxt/sdk 1.4.77 → 1.5.25

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