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