files.com 1.0.166 → 1.0.167

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 (62) hide show
  1. package/README.md +9 -5
  2. package/_VERSION +1 -1
  3. package/lib/models/ActionWebhookFailure.js +8 -2
  4. package/lib/models/ApiKey.js +16 -4
  5. package/lib/models/As2Partner.js +16 -4
  6. package/lib/models/As2Station.js +16 -4
  7. package/lib/models/Automation.js +16 -4
  8. package/lib/models/Behavior.js +16 -4
  9. package/lib/models/Bundle.js +24 -6
  10. package/lib/models/Clickwrap.js +16 -4
  11. package/lib/models/File.js +309 -311
  12. package/lib/models/FileComment.js +16 -4
  13. package/lib/models/FileCommentReaction.js +8 -2
  14. package/lib/models/FormFieldSet.js +16 -4
  15. package/lib/models/Group.js +16 -4
  16. package/lib/models/GroupUser.js +16 -4
  17. package/lib/models/Lock.js +8 -2
  18. package/lib/models/Message.js +16 -4
  19. package/lib/models/MessageComment.js +16 -4
  20. package/lib/models/MessageCommentReaction.js +8 -2
  21. package/lib/models/MessageReaction.js +8 -2
  22. package/lib/models/Notification.js +16 -4
  23. package/lib/models/Permission.js +8 -2
  24. package/lib/models/Project.js +16 -4
  25. package/lib/models/PublicKey.js +16 -4
  26. package/lib/models/RemoteServer.js +16 -4
  27. package/lib/models/Request.js +8 -2
  28. package/lib/models/SsoStrategy.js +8 -2
  29. package/lib/models/Style.js +16 -4
  30. package/lib/models/User.js +40 -10
  31. package/lib/models/UserRequest.js +8 -2
  32. package/package.json +1 -1
  33. package/src/models/ActionWebhookFailure.js +3 -1
  34. package/src/models/ApiKey.js +6 -2
  35. package/src/models/As2Partner.js +6 -2
  36. package/src/models/As2Station.js +6 -2
  37. package/src/models/Automation.js +6 -2
  38. package/src/models/Behavior.js +6 -2
  39. package/src/models/Bundle.js +9 -3
  40. package/src/models/Clickwrap.js +6 -2
  41. package/src/models/File.js +26 -19
  42. package/src/models/FileComment.js +6 -2
  43. package/src/models/FileCommentReaction.js +3 -1
  44. package/src/models/FormFieldSet.js +6 -2
  45. package/src/models/Group.js +6 -2
  46. package/src/models/GroupUser.js +6 -2
  47. package/src/models/Lock.js +3 -1
  48. package/src/models/Message.js +6 -2
  49. package/src/models/MessageComment.js +6 -2
  50. package/src/models/MessageCommentReaction.js +3 -1
  51. package/src/models/MessageReaction.js +3 -1
  52. package/src/models/Notification.js +6 -2
  53. package/src/models/Permission.js +3 -1
  54. package/src/models/Project.js +6 -2
  55. package/src/models/PublicKey.js +6 -2
  56. package/src/models/RemoteServer.js +6 -2
  57. package/src/models/Request.js +3 -1
  58. package/src/models/SsoStrategy.js +3 -1
  59. package/src/models/Style.js +6 -2
  60. package/src/models/User.js +15 -5
  61. package/src/models/UserRequest.js +3 -1
  62. package/test/src/index.js +7 -3
@@ -172,6 +172,7 @@ var SsoStrategy = /*#__PURE__*/(0, _createClass2.default)(function SsoStrategy()
172
172
  });
173
173
  (0, _defineProperty2.default)(this, "sync", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
174
174
  var params,
175
+ response,
175
176
  _args = arguments;
176
177
  return _regenerator.default.wrap(function _callee$(_context) {
177
178
  while (1) {
@@ -223,9 +224,14 @@ var SsoStrategy = /*#__PURE__*/(0, _createClass2.default)(function SsoStrategy()
223
224
  throw new Error('Parameter missing: id');
224
225
 
225
226
  case 14:
226
- return _context.abrupt("return", _Api.default.sendRequest("/sso_strategies/".concat(params['id'], "/sync"), 'POST', params, _this.options));
227
+ _context.next = 16;
228
+ return _Api.default.sendRequest("/sso_strategies/".concat(params['id'], "/sync"), 'POST', params, _this.options);
229
+
230
+ case 16:
231
+ response = _context.sent;
232
+ return _context.abrupt("return", response === null || response === void 0 ? void 0 : response.data);
227
233
 
228
- case 15:
234
+ case 18:
229
235
  case "end":
230
236
  return _context.stop();
231
237
  }
@@ -73,6 +73,7 @@ var Style = /*#__PURE__*/(0, _createClass2.default)(function Style() {
73
73
  });
74
74
  (0, _defineProperty2.default)(this, "update", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
75
75
  var params,
76
+ response,
76
77
  _args = arguments;
77
78
  return _regenerator.default.wrap(function _callee$(_context) {
78
79
  while (1) {
@@ -142,9 +143,14 @@ var Style = /*#__PURE__*/(0, _createClass2.default)(function Style() {
142
143
  throw new Error('Parameter missing: file');
143
144
 
144
145
  case 20:
145
- return _context.abrupt("return", _Api.default.sendRequest("/styles/".concat(params['path']), 'PATCH', params, _this.options));
146
+ _context.next = 22;
147
+ return _Api.default.sendRequest("/styles/".concat(params['path']), 'PATCH', params, _this.options);
148
+
149
+ case 22:
150
+ response = _context.sent;
151
+ return _context.abrupt("return", new Style(response === null || response === void 0 ? void 0 : response.data, _this.options));
146
152
 
147
- case 21:
153
+ case 24:
148
154
  case "end":
149
155
  return _context.stop();
150
156
  }
@@ -153,6 +159,7 @@ var Style = /*#__PURE__*/(0, _createClass2.default)(function Style() {
153
159
  })));
154
160
  (0, _defineProperty2.default)(this, "delete", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
155
161
  var params,
162
+ response,
156
163
  _args2 = arguments;
157
164
  return _regenerator.default.wrap(function _callee2$(_context2) {
158
165
  while (1) {
@@ -204,9 +211,14 @@ var Style = /*#__PURE__*/(0, _createClass2.default)(function Style() {
204
211
  throw new Error('Parameter missing: path');
205
212
 
206
213
  case 14:
207
- return _context2.abrupt("return", _Api.default.sendRequest("/styles/".concat(params['path']), 'DELETE', params, _this.options));
214
+ _context2.next = 16;
215
+ return _Api.default.sendRequest("/styles/".concat(params['path']), 'DELETE', params, _this.options);
216
+
217
+ case 16:
218
+ response = _context2.sent;
219
+ return _context2.abrupt("return", response === null || response === void 0 ? void 0 : response.data);
208
220
 
209
- case 15:
221
+ case 18:
210
222
  case "end":
211
223
  return _context2.stop();
212
224
  }
@@ -388,6 +388,7 @@ var User = /*#__PURE__*/(0, _createClass2.default)(function User() {
388
388
  });
389
389
  (0, _defineProperty2.default)(this, "unlock", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
390
390
  var params,
391
+ response,
391
392
  _args = arguments;
392
393
  return _regenerator.default.wrap(function _callee$(_context) {
393
394
  while (1) {
@@ -439,9 +440,14 @@ var User = /*#__PURE__*/(0, _createClass2.default)(function User() {
439
440
  throw new Error('Parameter missing: id');
440
441
 
441
442
  case 14:
442
- return _context.abrupt("return", _Api.default.sendRequest("/users/".concat(params['id'], "/unlock"), 'POST', params, _this.options));
443
+ _context.next = 16;
444
+ return _Api.default.sendRequest("/users/".concat(params['id'], "/unlock"), 'POST', params, _this.options);
445
+
446
+ case 16:
447
+ response = _context.sent;
448
+ return _context.abrupt("return", response === null || response === void 0 ? void 0 : response.data);
443
449
 
444
- case 15:
450
+ case 18:
445
451
  case "end":
446
452
  return _context.stop();
447
453
  }
@@ -450,6 +456,7 @@ var User = /*#__PURE__*/(0, _createClass2.default)(function User() {
450
456
  })));
451
457
  (0, _defineProperty2.default)(this, "resendWelcomeEmail", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
452
458
  var params,
459
+ response,
453
460
  _args2 = arguments;
454
461
  return _regenerator.default.wrap(function _callee2$(_context2) {
455
462
  while (1) {
@@ -501,9 +508,14 @@ var User = /*#__PURE__*/(0, _createClass2.default)(function User() {
501
508
  throw new Error('Parameter missing: id');
502
509
 
503
510
  case 14:
504
- return _context2.abrupt("return", _Api.default.sendRequest("/users/".concat(params['id'], "/resend_welcome_email"), 'POST', params, _this.options));
511
+ _context2.next = 16;
512
+ return _Api.default.sendRequest("/users/".concat(params['id'], "/resend_welcome_email"), 'POST', params, _this.options);
505
513
 
506
- case 15:
514
+ case 16:
515
+ response = _context2.sent;
516
+ return _context2.abrupt("return", response === null || response === void 0 ? void 0 : response.data);
517
+
518
+ case 18:
507
519
  case "end":
508
520
  return _context2.stop();
509
521
  }
@@ -512,6 +524,7 @@ var User = /*#__PURE__*/(0, _createClass2.default)(function User() {
512
524
  })));
513
525
  (0, _defineProperty2.default)(this, "user2faReset", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
514
526
  var params,
527
+ response,
515
528
  _args3 = arguments;
516
529
  return _regenerator.default.wrap(function _callee3$(_context3) {
517
530
  while (1) {
@@ -563,9 +576,14 @@ var User = /*#__PURE__*/(0, _createClass2.default)(function User() {
563
576
  throw new Error('Parameter missing: id');
564
577
 
565
578
  case 14:
566
- return _context3.abrupt("return", _Api.default.sendRequest("/users/".concat(params['id'], "/2fa/reset"), 'POST', params, _this.options));
579
+ _context3.next = 16;
580
+ return _Api.default.sendRequest("/users/".concat(params['id'], "/2fa/reset"), 'POST', params, _this.options);
567
581
 
568
- case 15:
582
+ case 16:
583
+ response = _context3.sent;
584
+ return _context3.abrupt("return", response === null || response === void 0 ? void 0 : response.data);
585
+
586
+ case 18:
569
587
  case "end":
570
588
  return _context3.stop();
571
589
  }
@@ -574,6 +592,7 @@ var User = /*#__PURE__*/(0, _createClass2.default)(function User() {
574
592
  })));
575
593
  (0, _defineProperty2.default)(this, "update", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4() {
576
594
  var params,
595
+ response,
577
596
  _args4 = arguments;
578
597
  return _regenerator.default.wrap(function _callee4$(_context4) {
579
598
  while (1) {
@@ -825,9 +844,14 @@ var User = /*#__PURE__*/(0, _createClass2.default)(function User() {
825
844
  throw new Error('Parameter missing: id');
826
845
 
827
846
  case 64:
828
- return _context4.abrupt("return", _Api.default.sendRequest("/users/".concat(params['id']), 'PATCH', params, _this.options));
847
+ _context4.next = 66;
848
+ return _Api.default.sendRequest("/users/".concat(params['id']), 'PATCH', params, _this.options);
849
+
850
+ case 66:
851
+ response = _context4.sent;
852
+ return _context4.abrupt("return", new User(response === null || response === void 0 ? void 0 : response.data, _this.options));
829
853
 
830
- case 65:
854
+ case 68:
831
855
  case "end":
832
856
  return _context4.stop();
833
857
  }
@@ -836,6 +860,7 @@ var User = /*#__PURE__*/(0, _createClass2.default)(function User() {
836
860
  })));
837
861
  (0, _defineProperty2.default)(this, "delete", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5() {
838
862
  var params,
863
+ response,
839
864
  _args5 = arguments;
840
865
  return _regenerator.default.wrap(function _callee5$(_context5) {
841
866
  while (1) {
@@ -887,9 +912,14 @@ var User = /*#__PURE__*/(0, _createClass2.default)(function User() {
887
912
  throw new Error('Parameter missing: id');
888
913
 
889
914
  case 14:
890
- return _context5.abrupt("return", _Api.default.sendRequest("/users/".concat(params['id']), 'DELETE', params, _this.options));
915
+ _context5.next = 16;
916
+ return _Api.default.sendRequest("/users/".concat(params['id']), 'DELETE', params, _this.options);
917
+
918
+ case 16:
919
+ response = _context5.sent;
920
+ return _context5.abrupt("return", response === null || response === void 0 ? void 0 : response.data);
891
921
 
892
- case 15:
922
+ case 18:
893
923
  case "end":
894
924
  return _context5.stop();
895
925
  }
@@ -67,6 +67,7 @@ var UserRequest = /*#__PURE__*/(0, _createClass2.default)(function UserRequest()
67
67
  });
68
68
  (0, _defineProperty2.default)(this, "delete", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
69
69
  var params,
70
+ response,
70
71
  _args = arguments;
71
72
  return _regenerator.default.wrap(function _callee$(_context) {
72
73
  while (1) {
@@ -118,9 +119,14 @@ var UserRequest = /*#__PURE__*/(0, _createClass2.default)(function UserRequest()
118
119
  throw new Error('Parameter missing: id');
119
120
 
120
121
  case 14:
121
- return _context.abrupt("return", _Api.default.sendRequest("/user_requests/".concat(params['id']), 'DELETE', params, _this.options));
122
+ _context.next = 16;
123
+ return _Api.default.sendRequest("/user_requests/".concat(params['id']), 'DELETE', params, _this.options);
124
+
125
+ case 16:
126
+ response = _context.sent;
127
+ return _context.abrupt("return", response === null || response === void 0 ? void 0 : response.data);
122
128
 
123
- case 15:
129
+ case 18:
124
130
  case "end":
125
131
  return _context.stop();
126
132
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "files.com",
3
- "version": "1.0.166",
3
+ "version": "1.0.167",
4
4
  "description": "Files.com SDK for JavaScript",
5
5
  "keywords": [
6
6
  "files.com",
@@ -46,7 +46,9 @@ class ActionWebhookFailure {
46
46
  }
47
47
  }
48
48
 
49
- return Api.sendRequest(`/action_webhook_failures/${params['id']}/retry`, 'POST', params, this.options)
49
+ const response = await Api.sendRequest(`/action_webhook_failures/${params['id']}/retry`, 'POST', params, this.options)
50
+
51
+ return response?.data
50
52
  }
51
53
  }
52
54
 
@@ -131,7 +131,9 @@ class ApiKey {
131
131
  }
132
132
  }
133
133
 
134
- return Api.sendRequest(`/api_keys/${params['id']}`, 'PATCH', params, this.options)
134
+ const response = await Api.sendRequest(`/api_keys/${params['id']}`, 'PATCH', params, this.options)
135
+
136
+ return new ApiKey(response?.data, this.options)
135
137
  }
136
138
 
137
139
  delete = async (params = {}) => {
@@ -156,7 +158,9 @@ class ApiKey {
156
158
  }
157
159
  }
158
160
 
159
- return Api.sendRequest(`/api_keys/${params['id']}`, 'DELETE', params, this.options)
161
+ const response = await Api.sendRequest(`/api_keys/${params['id']}`, 'DELETE', params, this.options)
162
+
163
+ return response?.data
160
164
  }
161
165
 
162
166
  destroy = (params = {}) =>
@@ -135,7 +135,9 @@ class As2Partner {
135
135
  }
136
136
  }
137
137
 
138
- return Api.sendRequest(`/as2_partners/${params['id']}`, 'PATCH', params, this.options)
138
+ const response = await Api.sendRequest(`/as2_partners/${params['id']}`, 'PATCH', params, this.options)
139
+
140
+ return new As2Partner(response?.data, this.options)
139
141
  }
140
142
 
141
143
  delete = async (params = {}) => {
@@ -160,7 +162,9 @@ class As2Partner {
160
162
  }
161
163
  }
162
164
 
163
- return Api.sendRequest(`/as2_partners/${params['id']}`, 'DELETE', params, this.options)
165
+ const response = await Api.sendRequest(`/as2_partners/${params['id']}`, 'DELETE', params, this.options)
166
+
167
+ return response?.data
164
168
  }
165
169
 
166
170
  destroy = (params = {}) =>
@@ -149,7 +149,9 @@ class As2Station {
149
149
  }
150
150
  }
151
151
 
152
- return Api.sendRequest(`/as2_stations/${params['id']}`, 'PATCH', params, this.options)
152
+ const response = await Api.sendRequest(`/as2_stations/${params['id']}`, 'PATCH', params, this.options)
153
+
154
+ return new As2Station(response?.data, this.options)
153
155
  }
154
156
 
155
157
  delete = async (params = {}) => {
@@ -174,7 +176,9 @@ class As2Station {
174
176
  }
175
177
  }
176
178
 
177
- return Api.sendRequest(`/as2_stations/${params['id']}`, 'DELETE', params, this.options)
179
+ const response = await Api.sendRequest(`/as2_stations/${params['id']}`, 'DELETE', params, this.options)
180
+
181
+ return response?.data
178
182
  }
179
183
 
180
184
  destroy = (params = {}) =>
@@ -245,7 +245,9 @@ class Automation {
245
245
  }
246
246
  }
247
247
 
248
- return Api.sendRequest(`/automations/${params['id']}`, 'PATCH', params, this.options)
248
+ const response = await Api.sendRequest(`/automations/${params['id']}`, 'PATCH', params, this.options)
249
+
250
+ return new Automation(response?.data, this.options)
249
251
  }
250
252
 
251
253
  delete = async (params = {}) => {
@@ -270,7 +272,9 @@ class Automation {
270
272
  }
271
273
  }
272
274
 
273
- return Api.sendRequest(`/automations/${params['id']}`, 'DELETE', params, this.options)
275
+ const response = await Api.sendRequest(`/automations/${params['id']}`, 'DELETE', params, this.options)
276
+
277
+ return response?.data
274
278
  }
275
279
 
276
280
  destroy = (params = {}) =>
@@ -131,7 +131,9 @@ class Behavior {
131
131
  }
132
132
  }
133
133
 
134
- return Api.sendRequest(`/behaviors/${params['id']}`, 'PATCH', params, this.options)
134
+ const response = await Api.sendRequest(`/behaviors/${params['id']}`, 'PATCH', params, this.options)
135
+
136
+ return new Behavior(response?.data, this.options)
135
137
  }
136
138
 
137
139
  delete = async (params = {}) => {
@@ -156,7 +158,9 @@ class Behavior {
156
158
  }
157
159
  }
158
160
 
159
- return Api.sendRequest(`/behaviors/${params['id']}`, 'DELETE', params, this.options)
161
+ const response = await Api.sendRequest(`/behaviors/${params['id']}`, 'DELETE', params, this.options)
162
+
163
+ return response?.data
160
164
  }
161
165
 
162
166
  destroy = (params = {}) =>
@@ -238,7 +238,9 @@ class Bundle {
238
238
  }
239
239
  }
240
240
 
241
- return Api.sendRequest(`/bundles/${params['id']}/share`, 'POST', params, this.options)
241
+ const response = await Api.sendRequest(`/bundles/${params['id']}/share`, 'POST', params, this.options)
242
+
243
+ return response?.data
242
244
  }
243
245
 
244
246
  // Parameters:
@@ -309,7 +311,9 @@ class Bundle {
309
311
  }
310
312
  }
311
313
 
312
- return Api.sendRequest(`/bundles/${params['id']}`, 'PATCH', params, this.options)
314
+ const response = await Api.sendRequest(`/bundles/${params['id']}`, 'PATCH', params, this.options)
315
+
316
+ return new Bundle(response?.data, this.options)
313
317
  }
314
318
 
315
319
  delete = async (params = {}) => {
@@ -334,7 +338,9 @@ class Bundle {
334
338
  }
335
339
  }
336
340
 
337
- return Api.sendRequest(`/bundles/${params['id']}`, 'DELETE', params, this.options)
341
+ const response = await Api.sendRequest(`/bundles/${params['id']}`, 'DELETE', params, this.options)
342
+
343
+ return response?.data
338
344
  }
339
345
 
340
346
  destroy = (params = {}) =>
@@ -108,7 +108,9 @@ class Clickwrap {
108
108
  }
109
109
  }
110
110
 
111
- return Api.sendRequest(`/clickwraps/${params['id']}`, 'PATCH', params, this.options)
111
+ const response = await Api.sendRequest(`/clickwraps/${params['id']}`, 'PATCH', params, this.options)
112
+
113
+ return new Clickwrap(response?.data, this.options)
112
114
  }
113
115
 
114
116
  delete = async (params = {}) => {
@@ -133,7 +135,9 @@ class Clickwrap {
133
135
  }
134
136
  }
135
137
 
136
- return Api.sendRequest(`/clickwraps/${params['id']}`, 'DELETE', params, this.options)
138
+ const response = await Api.sendRequest(`/clickwraps/${params['id']}`, 'DELETE', params, this.options)
139
+
140
+ return response?.data
137
141
  }
138
142
 
139
143
  destroy = (params = {}) =>
@@ -157,12 +157,14 @@ class File {
157
157
  throw new Error('Stream downloads are only available in a NodeJS environment')
158
158
  }
159
159
 
160
- if (!this.download_uri) {
160
+ const downloadUri = this.getDownloadUri()
161
+
162
+ if (!downloadUri) {
161
163
  throw new Error('Current object has no download URI')
162
164
  }
163
165
 
164
166
  const { saveUrlToStream } = require('../isomorphic/File.node.js')
165
- return saveUrlToStream(this.download_uri, writableStream)
167
+ return saveUrlToStream(downloadUri, writableStream)
166
168
  }
167
169
 
168
170
  downloadToFile = async destinationPath => {
@@ -170,21 +172,14 @@ class File {
170
172
  throw new Error('Disk file downloads are only available in a NodeJS environment')
171
173
  }
172
174
 
173
- if (!this.download_uri) {
175
+ const downloadUri = this.getDownloadUri()
176
+
177
+ if (!downloadUri) {
174
178
  throw new Error('Current object has no download URI')
175
179
  }
176
180
 
177
181
  const { saveUrlToFile } = require('../isomorphic/File.node.js')
178
- return saveUrlToFile(this.download_uri, destinationPath)
179
- }
180
-
181
- static findDownload = async path => {
182
- const response = await Api.sendRequest(`/files/${encodeURIComponent(path)}`, 'GET')
183
- return new File(response.data)
184
- }
185
-
186
- get = async path => {
187
- return File.find(path)
182
+ return saveUrlToFile(downloadUri, destinationPath)
188
183
  }
189
184
 
190
185
  copyTo = async destinationFilePath => {
@@ -408,7 +403,9 @@ class File {
408
403
  }
409
404
  }
410
405
 
411
- return Api.sendRequest(`/files/${params['path']}`, 'GET', params, this.options)
406
+ const response = await Api.sendRequest(`/files/${params['path']}`, 'GET', params, this.options)
407
+
408
+ return new File(response?.data, this.options)
412
409
  }
413
410
 
414
411
  // Parameters:
@@ -442,7 +439,9 @@ class File {
442
439
  }
443
440
  }
444
441
 
445
- return Api.sendRequest(`/files/${params['path']}`, 'PATCH', params, this.options)
442
+ const response = await Api.sendRequest(`/files/${params['path']}`, 'PATCH', params, this.options)
443
+
444
+ return new File(response?.data, this.options)
446
445
  }
447
446
 
448
447
  // Parameters:
@@ -469,7 +468,9 @@ class File {
469
468
  }
470
469
  }
471
470
 
472
- return Api.sendRequest(`/files/${params['path']}`, 'DELETE', params, this.options)
471
+ const response = await Api.sendRequest(`/files/${params['path']}`, 'DELETE', params, this.options)
472
+
473
+ return response?.data
473
474
  }
474
475
 
475
476
  destroy = (params = {}) =>
@@ -513,7 +514,9 @@ class File {
513
514
  }
514
515
  }
515
516
 
516
- return Api.sendRequest(`/file_actions/copy/${params['path']}`, 'POST', params, this.options)
517
+ const response = await Api.sendRequest(`/file_actions/copy/${params['path']}`, 'POST', params, this.options)
518
+
519
+ return new FileAction(response?.data, this.options)
517
520
  }
518
521
 
519
522
  // Move file/folder
@@ -553,7 +556,9 @@ class File {
553
556
  }
554
557
  }
555
558
 
556
- return Api.sendRequest(`/file_actions/move/${params['path']}`, 'POST', params, this.options)
559
+ const response = await Api.sendRequest(`/file_actions/move/${params['path']}`, 'POST', params, this.options)
560
+
561
+ return new FileAction(response?.data, this.options)
557
562
  }
558
563
 
559
564
  // Begin file upload
@@ -603,7 +608,9 @@ class File {
603
608
  }
604
609
  }
605
610
 
606
- return Api.sendRequest(`/file_actions/begin_upload/${params['path']}`, 'POST', params, this.options)
611
+ const response = await Api.sendRequest(`/file_actions/begin_upload/${params['path']}`, 'POST', params, this.options)
612
+
613
+ return response?.data?.map(obj => new FileUploadPart(obj, this.options)) || []
607
614
  }
608
615
 
609
616
  save = () => {
@@ -86,7 +86,9 @@ class FileComment {
86
86
  }
87
87
  }
88
88
 
89
- return Api.sendRequest(`/file_comments/${params['id']}`, 'PATCH', params, this.options)
89
+ const response = await Api.sendRequest(`/file_comments/${params['id']}`, 'PATCH', params, this.options)
90
+
91
+ return new FileComment(response?.data, this.options)
90
92
  }
91
93
 
92
94
  delete = async (params = {}) => {
@@ -111,7 +113,9 @@ class FileComment {
111
113
  }
112
114
  }
113
115
 
114
- return Api.sendRequest(`/file_comments/${params['id']}`, 'DELETE', params, this.options)
116
+ const response = await Api.sendRequest(`/file_comments/${params['id']}`, 'DELETE', params, this.options)
117
+
118
+ return response?.data
115
119
  }
116
120
 
117
121
  destroy = (params = {}) =>
@@ -73,7 +73,9 @@ class FileCommentReaction {
73
73
  }
74
74
  }
75
75
 
76
- return Api.sendRequest(`/file_comment_reactions/${params['id']}`, 'DELETE', params, this.options)
76
+ const response = await Api.sendRequest(`/file_comment_reactions/${params['id']}`, 'DELETE', params, this.options)
77
+
78
+ return response?.data
77
79
  }
78
80
 
79
81
  destroy = (params = {}) =>
@@ -113,7 +113,9 @@ class FormFieldSet {
113
113
  }
114
114
  }
115
115
 
116
- return Api.sendRequest(`/form_field_sets/${params['id']}`, 'PATCH', params, this.options)
116
+ const response = await Api.sendRequest(`/form_field_sets/${params['id']}`, 'PATCH', params, this.options)
117
+
118
+ return new FormFieldSet(response?.data, this.options)
117
119
  }
118
120
 
119
121
  delete = async (params = {}) => {
@@ -138,7 +140,9 @@ class FormFieldSet {
138
140
  }
139
141
  }
140
142
 
141
- return Api.sendRequest(`/form_field_sets/${params['id']}`, 'DELETE', params, this.options)
143
+ const response = await Api.sendRequest(`/form_field_sets/${params['id']}`, 'DELETE', params, this.options)
144
+
145
+ return response?.data
142
146
  }
143
147
 
144
148
  destroy = (params = {}) =>
@@ -104,7 +104,9 @@ class Group {
104
104
  }
105
105
  }
106
106
 
107
- return Api.sendRequest(`/groups/${params['id']}`, 'PATCH', params, this.options)
107
+ const response = await Api.sendRequest(`/groups/${params['id']}`, 'PATCH', params, this.options)
108
+
109
+ return new Group(response?.data, this.options)
108
110
  }
109
111
 
110
112
  delete = async (params = {}) => {
@@ -129,7 +131,9 @@ class Group {
129
131
  }
130
132
  }
131
133
 
132
- return Api.sendRequest(`/groups/${params['id']}`, 'DELETE', params, this.options)
134
+ const response = await Api.sendRequest(`/groups/${params['id']}`, 'DELETE', params, this.options)
135
+
136
+ return response?.data
133
137
  }
134
138
 
135
139
  destroy = (params = {}) =>
@@ -113,7 +113,9 @@ class GroupUser {
113
113
  }
114
114
  }
115
115
 
116
- return Api.sendRequest(`/group_users/${params['id']}`, 'PATCH', params, this.options)
116
+ const response = await Api.sendRequest(`/group_users/${params['id']}`, 'PATCH', params, this.options)
117
+
118
+ return new GroupUser(response?.data, this.options)
117
119
  }
118
120
 
119
121
  // Parameters:
@@ -163,7 +165,9 @@ class GroupUser {
163
165
  }
164
166
  }
165
167
 
166
- return Api.sendRequest(`/group_users/${params['id']}`, 'DELETE', params, this.options)
168
+ const response = await Api.sendRequest(`/group_users/${params['id']}`, 'DELETE', params, this.options)
169
+
170
+ return response?.data
167
171
  }
168
172
 
169
173
  destroy = (params = {}) =>
@@ -142,7 +142,9 @@ class Lock {
142
142
  }
143
143
  }
144
144
 
145
- return Api.sendRequest(`/locks/${params['path']}`, 'DELETE', params, this.options)
145
+ const response = await Api.sendRequest(`/locks/${params['path']}`, 'DELETE', params, this.options)
146
+
147
+ return response?.data
146
148
  }
147
149
 
148
150
  destroy = (params = {}) =>
@@ -124,7 +124,9 @@ class Message {
124
124
  }
125
125
  }
126
126
 
127
- return Api.sendRequest(`/messages/${params['id']}`, 'PATCH', params, this.options)
127
+ const response = await Api.sendRequest(`/messages/${params['id']}`, 'PATCH', params, this.options)
128
+
129
+ return new Message(response?.data, this.options)
128
130
  }
129
131
 
130
132
  delete = async (params = {}) => {
@@ -149,7 +151,9 @@ class Message {
149
151
  }
150
152
  }
151
153
 
152
- return Api.sendRequest(`/messages/${params['id']}`, 'DELETE', params, this.options)
154
+ const response = await Api.sendRequest(`/messages/${params['id']}`, 'DELETE', params, this.options)
155
+
156
+ return response?.data
153
157
  }
154
158
 
155
159
  destroy = (params = {}) =>