@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
@@ -1,32 +1,37 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ProductPriceType = exports.StripeMemberTiers = exports.StripeSessionMode = exports.LifetimeTier = exports.RenewalPeriod = void 0;
3
+ exports.UserType = exports.ProductPriceType = exports.StripeMemberTiers = exports.StripeSessionMode = exports.LifetimeTier = exports.RenewalPeriod = void 0;
4
4
  var RenewalPeriod;
5
5
  (function (RenewalPeriod) {
6
6
  RenewalPeriod["Monthly"] = "monthly";
7
7
  RenewalPeriod["Annually"] = "annually";
8
8
  RenewalPeriod["Lifetime"] = "lifetime";
9
- })(RenewalPeriod = exports.RenewalPeriod || (exports.RenewalPeriod = {}));
9
+ })(RenewalPeriod || (exports.RenewalPeriod = RenewalPeriod = {}));
10
10
  var LifetimeTier;
11
11
  (function (LifetimeTier) {
12
12
  LifetimeTier["Lifetime"] = "lifetime";
13
13
  LifetimeTier["Exclusive"] = "exclusive-lifetime";
14
14
  LifetimeTier["Infinite"] = "infinite";
15
- })(LifetimeTier = exports.LifetimeTier || (exports.LifetimeTier = {}));
15
+ })(LifetimeTier || (exports.LifetimeTier = LifetimeTier = {}));
16
16
  var StripeSessionMode;
17
17
  (function (StripeSessionMode) {
18
18
  StripeSessionMode["Payment"] = "payment";
19
19
  StripeSessionMode["Setup"] = "setup";
20
20
  StripeSessionMode["Subscription"] = "subscription";
21
- })(StripeSessionMode = exports.StripeSessionMode || (exports.StripeSessionMode = {}));
21
+ })(StripeSessionMode || (exports.StripeSessionMode = StripeSessionMode = {}));
22
22
  var StripeMemberTiers;
23
23
  (function (StripeMemberTiers) {
24
24
  StripeMemberTiers[StripeMemberTiers["infinite"] = 0] = "infinite";
25
25
  StripeMemberTiers[StripeMemberTiers["lifetime"] = 1] = "lifetime";
26
26
  StripeMemberTiers[StripeMemberTiers["premium"] = 2] = "premium";
27
- })(StripeMemberTiers = exports.StripeMemberTiers || (exports.StripeMemberTiers = {}));
27
+ })(StripeMemberTiers || (exports.StripeMemberTiers = StripeMemberTiers = {}));
28
28
  var ProductPriceType;
29
29
  (function (ProductPriceType) {
30
30
  ProductPriceType["Recurring"] = "recurring";
31
31
  ProductPriceType["OneTime"] = "one_time";
32
- })(ProductPriceType = exports.ProductPriceType || (exports.ProductPriceType = {}));
32
+ })(ProductPriceType || (exports.ProductPriceType = ProductPriceType = {}));
33
+ var UserType;
34
+ (function (UserType) {
35
+ UserType["Individual"] = "individual";
36
+ UserType["Business"] = "business";
37
+ })(UserType || (exports.UserType = UserType = {}));
@@ -1,7 +1,11 @@
1
1
  "use strict";
2
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
3
  if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
5
9
  }) : (function(o, m, k, k2) {
6
10
  if (k2 === undefined) k2 = k;
7
11
  o[k2] = m[k];
@@ -4,7 +4,7 @@ exports.ReferralKey = exports.ReferralType = void 0;
4
4
  var ReferralType;
5
5
  (function (ReferralType) {
6
6
  ReferralType["Storage"] = "storage";
7
- })(ReferralType = exports.ReferralType || (exports.ReferralType = {}));
7
+ })(ReferralType || (exports.ReferralType = ReferralType = {}));
8
8
  var ReferralKey;
9
9
  (function (ReferralKey) {
10
10
  ReferralKey["CreateAccount"] = "create-account";
@@ -15,4 +15,4 @@ var ReferralKey;
15
15
  ReferralKey["InviteFriends"] = "invite-friends";
16
16
  ReferralKey["Invite2Friends"] = "invite-2-friends";
17
17
  ReferralKey["CompleteSurvey"] = "complete-survey";
18
- })(ReferralKey = exports.ReferralKey || (exports.ReferralKey = {}));
18
+ })(ReferralKey || (exports.ReferralKey = ReferralKey = {}));
@@ -1,5 +1,5 @@
1
- import { GenerateShareLinkPayload, GetSharedDirectoryPayload, GetShareLinkFolderSizePayload, ListAllSharedFoldersResponse, ListPrivateSharedFoldersResponse, ListShareLinksResponse, SharedFolderUser, ShareDomainsResponse, ShareLink, ShareFolderWithUserPayload, UpdateUserRolePayload, UpdateUserRoleResponse, UpdateShareLinkPayload, ListSharedItemsResponse, AcceptInvitationToSharedFolderPayload, RemoveUserRolePayload, Role, SharingInvite, SharedFoldersInvitationsAsInvitedUserResponse, CreateSharingPayload, SharingMeta, PublicSharedItemInfo, SharedFolderSize } from './types';
2
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
3
  export * as ShareTypes from './types';
4
4
  export declare class Share {
5
5
  private readonly client;
@@ -12,7 +12,11 @@ var __assign = (this && this.__assign) || function () {
12
12
  };
13
13
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
14
14
  if (k2 === undefined) k2 = k;
15
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[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);
16
20
  }) : (function(o, m, k, k2) {
17
21
  if (k2 === undefined) k2 = k;
18
22
  o[k2] = m[k];
@@ -39,12 +43,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
39
43
  });
40
44
  };
41
45
  var __generator = (this && this.__generator) || function (thisArg, body) {
42
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
43
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
46
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
47
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
44
48
  function verb(n) { return function (v) { return step([n, v]); }; }
45
49
  function step(op) {
46
50
  if (f) throw new TypeError("Generator is already executing.");
47
- while (_) try {
51
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
48
52
  if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
49
53
  if (y = 0, t) op = [op[0] & 2, t.value];
50
54
  switch (op[0]) {
@@ -94,8 +98,8 @@ var Share = /** @class */ (function () {
94
98
  Share.prototype.getShareLinks = function (page, perPage, orderBy) {
95
99
  if (page === void 0) { page = 0; }
96
100
  if (perPage === void 0) { perPage = 50; }
97
- var orderByQueryParam = orderBy ? "&orderBy=" + orderBy : '';
98
- return this.client.get("/storage/share/list?page=" + page + "&perPage=" + perPage + orderByQueryParam, this.headers());
101
+ var orderByQueryParam = orderBy ? "&orderBy=".concat(orderBy) : '';
102
+ return this.client.get("/storage/share/list?page=".concat(page, "&perPage=").concat(perPage).concat(orderByQueryParam), this.headers());
99
103
  };
100
104
  /**
101
105
  * Creates a new link to share a file or folder
@@ -106,7 +110,7 @@ var Share = /** @class */ (function () {
106
110
  if (!types.includes(payload.type)) {
107
111
  throw new Error('Invalid type');
108
112
  }
109
- return this.client.post("/storage/share/" + payload.type + "/" + payload.itemId, {
113
+ return this.client.post("/storage/share/".concat(payload.type, "/").concat(payload.itemId), {
110
114
  timesValid: payload.timesValid,
111
115
  encryptedMnemonic: payload.encryptedMnemonic,
112
116
  itemToken: payload.itemToken,
@@ -120,7 +124,7 @@ var Share = /** @class */ (function () {
120
124
  * @param payload
121
125
  */
122
126
  Share.prototype.updateShareLink = function (payload) {
123
- return this.client.put("/storage/share/" + payload.itemId, {
127
+ return this.client.put("/storage/share/".concat(payload.itemId), {
124
128
  plainPassword: payload.plainPassword,
125
129
  }, this.headers());
126
130
  };
@@ -129,14 +133,14 @@ var Share = /** @class */ (function () {
129
133
  * @param payload
130
134
  */
131
135
  Share.prototype.deleteShareLink = function (shareId) {
132
- return this.client.delete("/storage/share/" + shareId, this.headers());
136
+ return this.client.delete("/storage/share/".concat(shareId), this.headers());
133
137
  };
134
138
  /**
135
139
  * Increment share view by token
136
140
  * @param token
137
141
  */
138
142
  Share.prototype.incrementShareViewByToken = function (token) {
139
- return this.client.put("/storage/share/" + token + "/view", {}, this.headers());
143
+ return this.client.put("/storage/share/".concat(token, "/view"), {}, this.headers());
140
144
  };
141
145
  /**
142
146
  * Fetches data of a shared file
@@ -144,7 +148,7 @@ var Share = /** @class */ (function () {
144
148
  */
145
149
  Share.prototype.getShareLink = function (token, password) {
146
150
  var headers = password ? this.basicHeadersWithPassword(password) : this.basicHeaders();
147
- return this.client.get("/storage/share/" + token, headers);
151
+ return this.client.get("/storage/share/".concat(token), headers);
148
152
  };
149
153
  /**
150
154
  * Fetches paginated folders or files of a specific share link
@@ -159,7 +163,7 @@ var Share = /** @class */ (function () {
159
163
  if (payload.password) {
160
164
  headers = this.basicHeadersWithPassword(payload.password);
161
165
  }
162
- return this.client.get("/storage/share/down/" + payload.type + "s?token=" + payload.token + "&folderId=" + payload.folderId + "&parentId=" + payload.parentId + "&page=" + payload.page + "&perPage=" + payload.perPage + (payload.code ? '&code=' + payload.code : ''), headers);
166
+ return this.client.get("/storage/share/down/".concat(payload.type, "s?token=").concat(payload.token, "&folderId=").concat(payload.folderId, "&parentId=").concat(payload.parentId, "&page=").concat(payload.page, "&perPage=").concat(payload.perPage).concat(payload.code ? '&code=' + payload.code : ''), headers);
163
167
  };
164
168
  Share.prototype.getShareDomains = function () {
165
169
  return this.client.get('/storage/share/domains', this.headers());
@@ -169,7 +173,7 @@ var Share = /** @class */ (function () {
169
173
  * @param payload
170
174
  */
171
175
  Share.prototype.getShareLinkFolderSize = function (payload) {
172
- return this.client.get("/storage/share/" + payload.itemId + "/folder/" + payload.folderId + "/size", this.basicHeaders());
176
+ return this.client.get("/storage/share/".concat(payload.itemId, "/folder/").concat(payload.folderId, "/size"), this.basicHeaders());
173
177
  };
174
178
  /**
175
179
  * Fetches all folders shared by a user.
@@ -182,8 +186,8 @@ var Share = /** @class */ (function () {
182
186
  Share.prototype.getSentSharedFolders = function (page, perPage, orderBy) {
183
187
  if (page === void 0) { page = 0; }
184
188
  if (perPage === void 0) { perPage = 50; }
185
- var orderByQueryParam = orderBy ? "&orderBy=" + orderBy : '';
186
- return this.client.get("sharings/shared-by-me/folders?page=" + page + "&perPage=" + perPage + orderByQueryParam, this.headers());
189
+ var orderByQueryParam = orderBy ? "&orderBy=".concat(orderBy) : '';
190
+ return this.client.get("sharings/shared-by-me/folders?page=".concat(page, "&perPage=").concat(perPage).concat(orderByQueryParam), this.headers());
187
191
  };
188
192
  /**
189
193
  * Fetches folders shared with a user.
@@ -196,8 +200,8 @@ var Share = /** @class */ (function () {
196
200
  Share.prototype.getReceivedSharedFolders = function (page, perPage, orderBy) {
197
201
  if (page === void 0) { page = 0; }
198
202
  if (perPage === void 0) { perPage = 50; }
199
- var orderByQueryParam = orderBy ? "&orderBy=" + orderBy : '';
200
- return this.client.get("sharings/shared-with-me/folders?page=" + page + "&perPage=" + perPage + orderByQueryParam, this.headers());
203
+ var orderByQueryParam = orderBy ? "&orderBy=".concat(orderBy) : '';
204
+ return this.client.get("sharings/shared-with-me/folders?page=".concat(page, "&perPage=").concat(perPage).concat(orderByQueryParam), this.headers());
201
205
  };
202
206
  /**
203
207
  * Fetches all shared folders.
@@ -210,8 +214,8 @@ var Share = /** @class */ (function () {
210
214
  Share.prototype.getAllSharedFolders = function (page, perPage, orderBy) {
211
215
  if (page === void 0) { page = 0; }
212
216
  if (perPage === void 0) { perPage = 50; }
213
- var orderByQueryParam = orderBy ? "&orderBy=" + orderBy : '';
214
- return this.client.get("sharings/folders?page=" + page + "&perPage=" + perPage + orderByQueryParam, this.headers());
217
+ var orderByQueryParam = orderBy ? "&orderBy=".concat(orderBy) : '';
218
+ return this.client.get("sharings/folders?page=".concat(page, "&perPage=").concat(perPage).concat(orderByQueryParam), this.headers());
215
219
  };
216
220
  /**
217
221
  * Fetches all shared files.
@@ -224,8 +228,8 @@ var Share = /** @class */ (function () {
224
228
  Share.prototype.getAllSharedFiles = function (page, perPage, orderBy) {
225
229
  if (page === void 0) { page = 0; }
226
230
  if (perPage === void 0) { perPage = 50; }
227
- var orderByQueryParam = orderBy ? "&orderBy=" + orderBy : '';
228
- return this.client.get("sharings/files?page=" + page + "&perPage=" + perPage + orderByQueryParam, this.headers());
231
+ var orderByQueryParam = orderBy ? "&orderBy=".concat(orderBy) : '';
232
+ return this.client.get("sharings/files?page=".concat(page, "&perPage=").concat(perPage).concat(orderByQueryParam), this.headers());
229
233
  };
230
234
  /**
231
235
  * Get all users with access to a shared folder.
@@ -239,8 +243,8 @@ var Share = /** @class */ (function () {
239
243
  Share.prototype.getSharedFolderUsers = function (folderUUID, page, perPage, orderBy) {
240
244
  if (page === void 0) { page = 0; }
241
245
  if (perPage === void 0) { perPage = 50; }
242
- var orderByQueryParam = orderBy ? "&orderBy=" + orderBy : '';
243
- return this.client.get("sharings/shared-with/" + folderUUID + "?page=" + page + "&perPage=" + perPage + orderByQueryParam, this.headers());
246
+ var orderByQueryParam = orderBy ? "&orderBy=".concat(orderBy) : '';
247
+ return this.client.get("sharings/shared-with/".concat(folderUUID, "?page=").concat(page, "&perPage=").concat(perPage).concat(orderByQueryParam), this.headers());
244
248
  };
245
249
  /**
246
250
  * Get shared folder content
@@ -254,8 +258,8 @@ var Share = /** @class */ (function () {
254
258
  Share.prototype.getSharedFolderContent = function (sharedFolderId, type, token, page, perPage, orderBy) {
255
259
  if (page === void 0) { page = 0; }
256
260
  if (perPage === void 0) { perPage = 50; }
257
- var orderByQueryParam = orderBy ? "&orderBy=" + orderBy : '';
258
- return this.client.get("sharings/items/" + sharedFolderId + "/" + type + "?token=" + token + "&page=" + page + "&perPage=" + perPage + orderByQueryParam, this.headers());
261
+ var orderByQueryParam = orderBy ? "&orderBy=".concat(orderBy) : '';
262
+ return this.client.get("sharings/items/".concat(sharedFolderId, "/").concat(type, "?token=").concat(token, "&page=").concat(page, "&perPage=").concat(perPage).concat(orderByQueryParam), this.headers());
259
263
  };
260
264
  /**
261
265
  * Get public shared folder content
@@ -270,10 +274,10 @@ var Share = /** @class */ (function () {
270
274
  if (page === void 0) { page = 0; }
271
275
  if (perPage === void 0) { perPage = 50; }
272
276
  if (code === void 0) { code = ''; }
273
- var orderByQueryParam = orderBy ? "&orderBy=" + orderBy : '';
277
+ var orderByQueryParam = orderBy ? "&orderBy=".concat(orderBy) : '';
274
278
  return this.client.get(
275
279
  // eslint-disable-next-line max-len
276
- "sharings/public/items/" + sharedFolderId + "/" + type + "?token=" + token + "&code=" + code + "&page=" + page + "&perPage=" + perPage + orderByQueryParam, this.headers());
280
+ "sharings/public/items/".concat(sharedFolderId, "/").concat(type, "?token=").concat(token, "&code=").concat(code, "&page=").concat(page, "&perPage=").concat(perPage).concat(orderByQueryParam), this.headers());
277
281
  };
278
282
  /**
279
283
  * Get the role of a user on a folder.
@@ -282,7 +286,7 @@ var Share = /** @class */ (function () {
282
286
  * @returns {Promise<Role>} A promise containing the role of the current user in the sharing.
283
287
  */
284
288
  Share.prototype.getUserRole = function (sharingId) {
285
- return this.client.get("sharings/" + sharingId + "/role", this.headers());
289
+ return this.client.get("sharings/".concat(sharingId, "/role"), this.headers());
286
290
  };
287
291
  /**
288
292
  * Update the role of a user on a folder.
@@ -294,7 +298,7 @@ var Share = /** @class */ (function () {
294
298
  */
295
299
  Share.prototype.updateUserRole = function (_a) {
296
300
  var sharingId = _a.sharingId, newRoleId = _a.newRoleId;
297
- return this.client.put("sharings/" + sharingId + "/role", {
301
+ return this.client.put("sharings/".concat(sharingId, "/role"), {
298
302
  roleId: newRoleId,
299
303
  }, this.headers());
300
304
  };
@@ -309,7 +313,7 @@ var Share = /** @class */ (function () {
309
313
  */
310
314
  Share.prototype.removeUserRole = function (_a) {
311
315
  var itemType = _a.itemType, itemId = _a.itemId, userId = _a.userId;
312
- return this.client.delete("sharings/" + itemType + "/" + itemId + "/users/" + userId, this.headers());
316
+ return this.client.delete("sharings/".concat(itemType, "/").concat(itemId, "/users/").concat(userId), this.headers());
313
317
  };
314
318
  /**
315
319
  * Get private folder data.
@@ -320,7 +324,7 @@ var Share = /** @class */ (function () {
320
324
  */
321
325
  Share.prototype.getSharedFolderInvitations = function (_a) {
322
326
  var itemId = _a.itemId, itemType = _a.itemType;
323
- return this.client.get("sharings/" + itemType + "/" + itemId + "/invites", this.headers());
327
+ return this.client.get("sharings/".concat(itemType, "/").concat(itemId, "/invites"), this.headers());
324
328
  };
325
329
  /**
326
330
  * Get all invitations for a user.
@@ -330,7 +334,7 @@ var Share = /** @class */ (function () {
330
334
  */
331
335
  Share.prototype.getSharedFolderInvitationsAsInvitedUser = function (_a) {
332
336
  var limit = _a.limit, offset = _a.offset;
333
- return this.client.get("sharings/invites?limit=" + limit + "&offset=" + offset, this.headers());
337
+ return this.client.get("sharings/invites?limit=".concat(limit, "&offset=").concat(offset), this.headers());
334
338
  };
335
339
  /**
336
340
  * Share a private folder with a user.
@@ -363,7 +367,7 @@ var Share = /** @class */ (function () {
363
367
  */
364
368
  Share.prototype.getSharingMeta = function (sharingId, code, password) {
365
369
  var extraHeaders = password ? { 'x-share-password': password } : {};
366
- return this.client.get("sharings/" + sharingId + "/meta?code=" + code, __assign(__assign({}, this.headers()), extraHeaders));
370
+ return this.client.get("sharings/".concat(sharingId, "/meta?code=").concat(code), __assign(__assign({}, this.headers()), extraHeaders));
367
371
  };
368
372
  /**
369
373
  * Add/edit sharing Password
@@ -372,7 +376,7 @@ var Share = /** @class */ (function () {
372
376
  * @returns {Promise<SharingMeta>} A promise that returns the sharing info with the new encrypted password
373
377
  */
374
378
  Share.prototype.saveSharingPassword = function (sharingId, encryptedPassword) {
375
- return this.client.patch("sharings/" + sharingId + "/password", {
379
+ return this.client.patch("sharings/".concat(sharingId, "/password"), {
376
380
  encryptedPassword: encryptedPassword,
377
381
  }, this.headers());
378
382
  };
@@ -382,7 +386,7 @@ var Share = /** @class */ (function () {
382
386
  * @returns {Promise<void>} A promise that resolves when password was successfully deleted.
383
387
  */
384
388
  Share.prototype.removeSharingPassword = function (sharingId) {
385
- return this.client.delete("sharings/" + sharingId + "/password", this.headers());
389
+ return this.client.delete("sharings/".concat(sharingId, "/password"), this.headers());
386
390
  };
387
391
  /**
388
392
  * Get public information of the item shared.
@@ -390,7 +394,7 @@ var Share = /** @class */ (function () {
390
394
  * @returns {Promise<PublicSharedItemInfo>} A promise that returns data of the public shared item.
391
395
  */
392
396
  Share.prototype.getPublicSharedItemInfo = function (sharingId) {
393
- return this.client.get("sharings/public/" + sharingId + "/item", this.headers());
397
+ return this.client.get("sharings/public/".concat(sharingId, "/item"), this.headers());
394
398
  };
395
399
  /**
396
400
  * Request access to shared folder.
@@ -405,7 +409,7 @@ var Share = /** @class */ (function () {
405
409
  * @returns {Promise<{uuid: string}>} A promise returning the uuid of the invitation if valid.
406
410
  */
407
411
  Share.prototype.validateInviteExpiration = function (invitationId) {
408
- return this.client.get("sharings/invites/" + invitationId + "/validate", this.headers());
412
+ return this.client.get("sharings/invites/".concat(invitationId, "/validate"), this.headers());
409
413
  };
410
414
  /**
411
415
  * Share a private folder with a user.
@@ -419,7 +423,7 @@ var Share = /** @class */ (function () {
419
423
  Share.prototype.acceptSharedFolderInvite = function (_a) {
420
424
  var invitationId = _a.invitationId, acceptInvite = _a.acceptInvite, token = _a.token;
421
425
  var headers = this.getRequestHeaders(token);
422
- return this.client.post("sharings/invites/" + invitationId + "/accept", {
426
+ return this.client.post("sharings/invites/".concat(invitationId, "/accept"), {
423
427
  acceptInvite: acceptInvite,
424
428
  }, headers);
425
429
  };
@@ -434,7 +438,7 @@ var Share = /** @class */ (function () {
434
438
  Share.prototype.updateSharingType = function (_a) {
435
439
  var itemId = _a.itemId, itemType = _a.itemType, sharingType = _a.sharingType;
436
440
  var headers = this.headers();
437
- return this.client.put("sharings/" + itemType + "/" + itemId + "/type", {
441
+ return this.client.put("sharings/".concat(itemType, "/").concat(itemId, "/type"), {
438
442
  sharingType: sharingType,
439
443
  }, headers);
440
444
  };
@@ -447,11 +451,11 @@ var Share = /** @class */ (function () {
447
451
  Share.prototype.getSharingType = function (_a) {
448
452
  var itemId = _a.itemId, itemType = _a.itemType;
449
453
  var headers = this.headers();
450
- return this.client.get("sharings/" + itemType + "/" + itemId + "/type", headers);
454
+ return this.client.get("sharings/".concat(itemType, "/").concat(itemId, "/type"), headers);
451
455
  };
452
456
  Share.prototype.declineSharedFolderInvite = function (invitationId, token) {
453
457
  var headers = this.getRequestHeaders(token);
454
- return this.client.delete("sharings/invites/" + invitationId, headers);
458
+ return this.client.delete("sharings/invites/".concat(invitationId), headers);
455
459
  };
456
460
  /**
457
461
  * Fetches roles for sharing items.
@@ -463,7 +467,7 @@ var Share = /** @class */ (function () {
463
467
  };
464
468
  Share.prototype.getAllAccessUsers = function (_a) {
465
469
  var itemType = _a.itemType, folderId = _a.folderId;
466
- return this.client.get("sharings/shared-with/" + itemType + "/" + folderId, this.headers());
470
+ return this.client.get("sharings/shared-with/".concat(itemType, "/").concat(folderId), this.headers());
467
471
  };
468
472
  /**
469
473
  * Stop sharing folder
@@ -475,7 +479,7 @@ var Share = /** @class */ (function () {
475
479
  return __awaiter(this, void 0, void 0, function () {
476
480
  return __generator(this, function (_a) {
477
481
  switch (_a.label) {
478
- case 0: return [4 /*yield*/, this.client.delete("sharings/" + itemType + "/" + itemId, this.headers())];
482
+ case 0: return [4 /*yield*/, this.client.delete("sharings/".concat(itemType, "/").concat(itemId), this.headers())];
479
483
  case 1:
480
484
  _a.sent();
481
485
  return [2 /*return*/];
@@ -492,6 +496,7 @@ var Share = /** @class */ (function () {
492
496
  this.appDetails.clientName,
493
497
  this.appDetails.clientVersion,
494
498
  this.apiSecurity.token,
499
+ this.apiSecurity.workspaceToken,
495
500
  ];
496
501
  if (password) {
497
502
  return headers_1.headersWithTokenAndPassword.apply(void 0, __spreadArray(__spreadArray([], args, false), [password], false));
@@ -532,7 +537,7 @@ var Share = /** @class */ (function () {
532
537
  * @returns {Promise<SharedFolderSize>}
533
538
  */
534
539
  Share.prototype.getSharedFolderSize = function (id) {
535
- return this.client.get("sharings/public/" + id + "/folder/size", this.headers());
540
+ return this.client.get("sharings/public/".concat(id, "/folder/size"), this.headers());
536
541
  };
537
542
  return Share;
538
543
  }());
@@ -1,4 +1,3 @@
1
- /// <reference types="node" />
2
1
  import { FolderChild } from '../storage/types';
3
2
  export interface GenerateShareLinkPayload {
4
3
  itemId: string;
@@ -69,10 +68,10 @@ export interface SharedDirectoryFile {
69
68
  export interface ShareDomainsResponse {
70
69
  list: string[];
71
70
  }
72
- export declare type ListShareLinksItem = Pick<ShareLink, 'id' | 'token' | 'views' | 'timesValid' | 'active' | 'isFolder' | 'createdAt' | 'updatedAt' | 'fileSize'> & {
71
+ export type ListShareLinksItem = Pick<ShareLink, 'id' | 'token' | 'views' | 'timesValid' | 'active' | 'isFolder' | 'createdAt' | 'updatedAt' | 'fileSize'> & {
73
72
  item: unknown;
74
73
  };
75
- export declare type ListShareLinksResponse = {
74
+ export type ListShareLinksResponse = {
76
75
  items: ListShareLinksItem[];
77
76
  pagination: {
78
77
  page: number;
@@ -81,10 +80,10 @@ export declare type ListShareLinksResponse = {
81
80
  orderBy?: string;
82
81
  };
83
82
  };
84
- export declare type ListPrivateSharedFoldersResponse = {
83
+ export type ListPrivateSharedFoldersResponse = {
85
84
  folders: FolderChild[];
86
85
  };
87
- export declare type SharedFolders = {
86
+ export type SharedFolders = {
88
87
  bucket: string | null;
89
88
  createdAt: string;
90
89
  dateShared: string;
@@ -118,7 +117,7 @@ export declare type SharedFolders = {
118
117
  userId: number;
119
118
  uuid: string;
120
119
  };
121
- export declare type SharedFiles = {
120
+ export type SharedFiles = {
122
121
  bucket: string | null;
123
122
  createdAt: string;
124
123
  deleted: boolean;
@@ -143,15 +142,16 @@ export declare type SharedFiles = {
143
142
  userId: number;
144
143
  uuid: string;
145
144
  };
146
- export declare type ListSharedItemsResponse = {
145
+ export type ListSharedItemsResponse = {
147
146
  credentials: {
148
147
  networkPass: string;
149
148
  networkUser: string;
150
149
  };
151
150
  items: SharedFiles[] | SharedFolders[];
152
151
  token: string;
152
+ role: string;
153
153
  };
154
- export declare type ListAllSharedFoldersResponse = {
154
+ export type ListAllSharedFoldersResponse = {
155
155
  credentials: {
156
156
  networkPass: string;
157
157
  networkUser: string;
@@ -159,8 +159,9 @@ export declare type ListAllSharedFoldersResponse = {
159
159
  files: SharedFiles[];
160
160
  folders: SharedFolders[];
161
161
  token: string;
162
+ role: string;
162
163
  };
163
- export declare type ShareFolderWithUserPayload = {
164
+ export type ShareFolderWithUserPayload = {
164
165
  itemId: string;
165
166
  itemType: 'folder' | 'file';
166
167
  notifyUser: boolean;
@@ -170,8 +171,9 @@ export declare type ShareFolderWithUserPayload = {
170
171
  encryptionAlgorithm?: string;
171
172
  roleId: string;
172
173
  persistPreviousSharing?: boolean;
174
+ hybridModeEnabled: boolean;
173
175
  };
174
- export declare type CreateSharingPayload = {
176
+ export type CreateSharingPayload = {
175
177
  itemId: string;
176
178
  itemType: 'folder' | 'file';
177
179
  encryptionKey: string;
@@ -180,40 +182,40 @@ export declare type CreateSharingPayload = {
180
182
  persistPreviousSharing?: boolean;
181
183
  encryptedPassword?: string;
182
184
  };
183
- export declare type PublicSharedItemInfo = {
185
+ export type PublicSharedItemInfo = {
184
186
  plainName: string;
185
187
  size: number;
186
188
  type: string;
187
189
  };
188
- export declare type AcceptInvitationToSharedFolderPayload = {
190
+ export type AcceptInvitationToSharedFolderPayload = {
189
191
  encryptionKey: string;
190
192
  encryptionAlgorithm: string;
191
193
  };
192
- export declare type PrivateSharingRole = {
194
+ export type PrivateSharingRole = {
193
195
  id: string;
194
196
  name: string;
195
197
  createdAt: Date;
196
198
  updatedAt: Date;
197
199
  };
198
- export declare type PrivateSharingRolesResponse = {
200
+ export type PrivateSharingRolesResponse = {
199
201
  roles: PrivateSharingRole[];
200
202
  };
201
- export declare type GrantSharePrivilegesToUserResponse = {
203
+ export type GrantSharePrivilegesToUserResponse = {
202
204
  message: string;
203
205
  };
204
- export declare type UpdateUserRoleResponse = {
206
+ export type UpdateUserRoleResponse = {
205
207
  message: string;
206
208
  };
207
- export declare type UpdateUserRolePayload = {
209
+ export type UpdateUserRolePayload = {
208
210
  sharingId: string;
209
211
  newRoleId: string;
210
212
  };
211
- export declare type RemoveUserRolePayload = {
213
+ export type RemoveUserRolePayload = {
212
214
  itemType: string;
213
215
  itemId: string;
214
216
  userId: string;
215
217
  };
216
- export declare type SharedFolderUser = {
218
+ export type SharedFolderUser = {
217
219
  avatar: string | null;
218
220
  email: string;
219
221
  grantedFrom: string;
@@ -225,16 +227,16 @@ export declare type SharedFolderUser = {
225
227
  roleName: string;
226
228
  uuid: string;
227
229
  };
228
- export declare type Role = {
230
+ export type Role = {
229
231
  id: string;
230
232
  name: string;
231
233
  createdAt: Date;
232
234
  updatedAt: Date;
233
235
  };
234
- export declare type getSharedFolderUsersResponse = {
236
+ export type getSharedFolderUsersResponse = {
235
237
  users: SharedFolderUser[];
236
238
  };
237
- export declare type SharedFoldersInvitationsAsInvitedUserResponse = {
239
+ export type SharedFoldersInvitationsAsInvitedUserResponse = {
238
240
  createdAt: Date;
239
241
  encryptionAlgorithm: string;
240
242
  encryptionKey: string;
@@ -254,7 +256,7 @@ export declare type SharedFoldersInvitationsAsInvitedUserResponse = {
254
256
  type: string;
255
257
  updatedAt: Date;
256
258
  };
257
- declare type ItemInvitation = {
259
+ type ItemInvitation = {
258
260
  bucket: string | null;
259
261
  createdAt: Date;
260
262
  deleted: boolean;
@@ -280,7 +282,7 @@ declare type ItemInvitation = {
280
282
  userId: number;
281
283
  uuid: string;
282
284
  };
283
- export declare type FolderUserInfo = {
285
+ export type FolderUserInfo = {
284
286
  avatar: string | null;
285
287
  email: string;
286
288
  grantedFrom: string;
@@ -292,7 +294,7 @@ export declare type FolderUserInfo = {
292
294
  roleName: string;
293
295
  uuid: string;
294
296
  };
295
- export declare type SharingInvitation = {
297
+ export type SharingInvitation = {
296
298
  id: number;
297
299
  userId: string;
298
300
  name: string;
@@ -320,7 +322,7 @@ export declare type SharingInvitation = {
320
322
  tempKey: string;
321
323
  avatar: string;
322
324
  };
323
- export declare type SharingInvite = {
325
+ export type SharingInvite = {
324
326
  id: string;
325
327
  itemId: string;
326
328
  itemType: 'file' | 'folder';
@@ -332,7 +334,7 @@ export declare type SharingInvite = {
332
334
  createdAt: Date;
333
335
  updatedAt: Date;
334
336
  };
335
- export declare type SharingMeta = {
337
+ export type SharingMeta = {
336
338
  id: string;
337
339
  itemId: string;
338
340
  itemType: 'file' | 'folder';
@@ -348,11 +350,11 @@ export declare type SharingMeta = {
348
350
  item: SharedFiles | SharedFolders;
349
351
  itemToken: string;
350
352
  };
351
- export declare type Sharing = {
353
+ export type Sharing = {
352
354
  type: string;
353
355
  id: string;
354
356
  };
355
- export declare type SharedFolderSize = {
357
+ export type SharedFolderSize = {
356
358
  size: number;
357
359
  };
358
360
  export {};