files.com 1.1.18 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- package/.eslintrc.js +0 -3
- package/_VERSION +1 -1
- package/docs/Errors.md +1 -0
- package/lib/Api.js +1 -1
- package/lib/Errors.js +957 -933
- package/lib/Files.js +1 -1
- package/lib/models/ActionNotificationExport.js +25 -25
- package/lib/models/ActionNotificationExportResult.js +10 -10
- package/lib/models/ActionWebhookFailure.js +5 -9
- package/lib/models/ApiKey.js +62 -70
- package/lib/models/App.js +5 -5
- package/lib/models/As2IncomingMessage.js +7 -7
- package/lib/models/As2OutgoingMessage.js +7 -7
- package/lib/models/As2Partner.js +54 -58
- package/lib/models/As2Station.js +51 -55
- package/lib/models/Automation.js +102 -110
- package/lib/models/AutomationRun.js +13 -13
- package/lib/models/BandwidthSnapshot.js +5 -5
- package/lib/models/Behavior.js +77 -85
- package/lib/models/Bundle.js +102 -110
- package/lib/models/BundleDownload.js +9 -9
- package/lib/models/BundleNotification.js +37 -41
- package/lib/models/BundleRecipient.js +22 -22
- package/lib/models/BundleRegistration.js +7 -7
- package/lib/models/Clickwrap.js +52 -56
- package/lib/models/DnsRecord.js +5 -5
- package/lib/models/EmailIncomingMessage.js +5 -5
- package/lib/models/ExternalEvent.js +18 -18
- package/lib/models/File.js +89 -93
- package/lib/models/FileComment.js +41 -45
- package/lib/models/FileCommentReaction.js +15 -19
- package/lib/models/FileMigration.js +5 -5
- package/lib/models/Folder.js +24 -24
- package/lib/models/FormFieldSet.js +44 -48
- package/lib/models/GpgKey.js +53 -57
- package/lib/models/Group.js +51 -55
- package/lib/models/GroupUser.js +53 -57
- package/lib/models/History.js +72 -72
- package/lib/models/HistoryExport.js +51 -51
- package/lib/models/HistoryExportResult.js +10 -10
- package/lib/models/InboxRecipient.js +22 -22
- package/lib/models/InboxRegistration.js +7 -7
- package/lib/models/InboxUpload.js +9 -9
- package/lib/models/Invoice.js +12 -12
- package/lib/models/IpAddress.js +17 -17
- package/lib/models/Lock.js +27 -31
- package/lib/models/Message.js +60 -64
- package/lib/models/MessageComment.js +46 -50
- package/lib/models/MessageCommentReaction.js +27 -31
- package/lib/models/MessageReaction.js +27 -31
- package/lib/models/Notification.js +66 -70
- package/lib/models/Payment.js +12 -12
- package/lib/models/Permission.js +28 -32
- package/lib/models/Priority.js +9 -9
- package/lib/models/Project.js +39 -43
- package/lib/models/PublicKey.js +46 -50
- package/lib/models/RemoteBandwidthSnapshot.js +5 -5
- package/lib/models/RemoteServer.js +306 -310
- package/lib/models/Request.js +33 -37
- package/lib/models/Session.js +11 -15
- package/lib/models/SettingsChange.js +5 -5
- package/lib/models/SftpHostKey.js +40 -44
- package/lib/models/ShareGroup.js +50 -54
- package/lib/models/Site.js +138 -138
- package/lib/models/Snapshot.js +44 -48
- package/lib/models/SsoStrategy.js +15 -19
- package/lib/models/Style.js +17 -21
- package/lib/models/UsageDailySnapshot.js +5 -5
- package/lib/models/UsageSnapshot.js +5 -5
- package/lib/models/User.js +156 -172
- package/lib/models/UserCipherUse.js +7 -7
- package/lib/models/UserRequest.js +26 -30
- package/lib/models/WebhookTest.js +15 -15
- package/package.json +6 -2
- package/src/Api.js +2 -1
- package/src/Errors.js +189 -177
- package/src/Files.js +1 -1
- package/src/models/AccountLineItem.js +5 -2
- package/src/models/Action.js +5 -2
- package/src/models/ActionNotificationExport.js +36 -35
- package/src/models/ActionNotificationExportResult.js +15 -13
- package/src/models/ActionWebhookFailure.js +9 -8
- package/src/models/ApiKey.js +69 -72
- package/src/models/App.js +10 -8
- package/src/models/As2IncomingMessage.js +12 -10
- package/src/models/As2OutgoingMessage.js +12 -10
- package/src/models/As2Partner.js +61 -60
- package/src/models/As2Station.js +58 -57
- package/src/models/Auto.js +5 -2
- package/src/models/Automation.js +121 -110
- package/src/models/AutomationRun.js +18 -17
- package/src/models/BandwidthSnapshot.js +10 -8
- package/src/models/Behavior.js +85 -86
- package/src/models/Bundle.js +121 -110
- package/src/models/BundleDownload.js +14 -12
- package/src/models/BundleNotification.js +40 -43
- package/src/models/BundleRecipient.js +33 -32
- package/src/models/BundleRegistration.js +12 -10
- package/src/models/Clickwrap.js +60 -58
- package/src/models/DnsRecord.js +10 -8
- package/src/models/EmailIncomingMessage.js +10 -8
- package/src/models/Errors.js +5 -2
- package/src/models/ExternalEvent.js +29 -29
- package/src/models/File.js +116 -108
- package/src/models/FileAction.js +5 -2
- package/src/models/FileComment.js +45 -46
- package/src/models/FileCommentReaction.js +26 -26
- package/src/models/FileMigration.js +10 -8
- package/src/models/FileUploadPart.js +5 -2
- package/src/models/Folder.js +32 -29
- package/src/models/FormField.js +5 -2
- package/src/models/FormFieldSet.js +49 -50
- package/src/models/GpgKey.js +60 -59
- package/src/models/Group.js +58 -57
- package/src/models/GroupUser.js +60 -58
- package/src/models/History.js +77 -74
- package/src/models/HistoryExport.js +62 -61
- package/src/models/HistoryExportResult.js +15 -13
- package/src/models/Image.js +5 -2
- package/src/models/InboxRecipient.js +33 -32
- package/src/models/InboxRegistration.js +12 -10
- package/src/models/InboxUpload.js +14 -12
- package/src/models/Invoice.js +17 -14
- package/src/models/InvoiceLineItem.js +5 -2
- package/src/models/IpAddress.js +22 -20
- package/src/models/Lock.js +36 -36
- package/src/models/Message.js +66 -66
- package/src/models/MessageComment.js +50 -52
- package/src/models/MessageCommentReaction.js +38 -40
- package/src/models/MessageReaction.js +38 -40
- package/src/models/Notification.js +74 -72
- package/src/models/Payment.js +17 -14
- package/src/models/PaymentLineItem.js +5 -2
- package/src/models/Permission.js +39 -40
- package/src/models/Preview.js +5 -2
- package/src/models/Priority.js +14 -12
- package/src/models/Project.js +43 -45
- package/src/models/PublicIpAddress.js +5 -2
- package/src/models/PublicKey.js +50 -52
- package/src/models/RemoteBandwidthSnapshot.js +10 -8
- package/src/models/RemoteServer.js +380 -312
- package/src/models/RemoteServerConfigurationFile.js +5 -2
- package/src/models/Request.js +44 -46
- package/src/models/Session.js +22 -22
- package/src/models/SettingsChange.js +10 -8
- package/src/models/SftpHostKey.js +45 -46
- package/src/models/ShareGroup.js +56 -56
- package/src/models/ShareGroupMember.js +5 -2
- package/src/models/Site.js +143 -142
- package/src/models/Snapshot.js +50 -50
- package/src/models/SsoStrategy.js +20 -21
- package/src/models/Status.js +5 -2
- package/src/models/Style.js +22 -23
- package/src/models/UsageDailySnapshot.js +10 -8
- package/src/models/UsageSnapshot.js +10 -8
- package/src/models/User.js +185 -168
- package/src/models/UserCipherUse.js +12 -10
- package/src/models/UserRequest.js +37 -39
- package/src/models/WebhookTest.js +26 -24
- package/test/Api.test.js +163 -0
- package/test/{package.json → integration/package.json} +1 -1
- package/test/{src → integration/src}/index.js +1 -1
- package/test.sh +2 -1
- /package/test/{.babelrc → integration/.babelrc} +0 -0
- /package/test/{index.js → integration/index.js} +0 -0
@@ -84,19 +84,19 @@ var FileComment = /*#__PURE__*/(0, _createClass2.default)(function FileComment()
|
|
84
84
|
throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
|
85
85
|
case 5:
|
86
86
|
params.id = _this.attributes.id;
|
87
|
-
if (!(params
|
87
|
+
if (!(params.id && !(0, _utils.isInt)(params.id))) {
|
88
88
|
_context.next = 8;
|
89
89
|
break;
|
90
90
|
}
|
91
|
-
throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params
|
91
|
+
throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params.id)));
|
92
92
|
case 8:
|
93
|
-
if (!(params
|
93
|
+
if (!(params.body && !(0, _utils.isString)(params.body))) {
|
94
94
|
_context.next = 10;
|
95
95
|
break;
|
96
96
|
}
|
97
|
-
throw new errors.InvalidParameterError("Bad parameter: body must be of type String, received ".concat((0, _utils.getType)(params
|
97
|
+
throw new errors.InvalidParameterError("Bad parameter: body must be of type String, received ".concat((0, _utils.getType)(params.body)));
|
98
98
|
case 10:
|
99
|
-
if (params
|
99
|
+
if (params.id) {
|
100
100
|
_context.next = 16;
|
101
101
|
break;
|
102
102
|
}
|
@@ -104,13 +104,13 @@ var FileComment = /*#__PURE__*/(0, _createClass2.default)(function FileComment()
|
|
104
104
|
_context.next = 15;
|
105
105
|
break;
|
106
106
|
}
|
107
|
-
params
|
107
|
+
params.id = _this.id;
|
108
108
|
_context.next = 16;
|
109
109
|
break;
|
110
110
|
case 15:
|
111
111
|
throw new errors.MissingParameterError('Parameter missing: id');
|
112
112
|
case 16:
|
113
|
-
if (params
|
113
|
+
if (params.body) {
|
114
114
|
_context.next = 22;
|
115
115
|
break;
|
116
116
|
}
|
@@ -118,14 +118,14 @@ var FileComment = /*#__PURE__*/(0, _createClass2.default)(function FileComment()
|
|
118
118
|
_context.next = 21;
|
119
119
|
break;
|
120
120
|
}
|
121
|
-
params
|
121
|
+
params.body = _this.body;
|
122
122
|
_context.next = 22;
|
123
123
|
break;
|
124
124
|
case 21:
|
125
125
|
throw new errors.MissingParameterError('Parameter missing: body');
|
126
126
|
case 22:
|
127
127
|
_context.next = 24;
|
128
|
-
return _Api.default.sendRequest("/file_comments/".concat(encodeURIComponent(params
|
128
|
+
return _Api.default.sendRequest("/file_comments/".concat(encodeURIComponent(params.id)), 'PATCH', params, _this.options);
|
129
129
|
case 24:
|
130
130
|
response = _context.sent;
|
131
131
|
return _context.abrupt("return", new FileComment(response === null || response === void 0 ? void 0 : response.data, _this.options));
|
@@ -137,7 +137,6 @@ var FileComment = /*#__PURE__*/(0, _createClass2.default)(function FileComment()
|
|
137
137
|
})));
|
138
138
|
(0, _defineProperty2.default)(this, "delete", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
|
139
139
|
var params,
|
140
|
-
response,
|
141
140
|
_args2 = arguments;
|
142
141
|
return _regenerator.default.wrap(function _callee2$(_context2) {
|
143
142
|
while (1) switch (_context2.prev = _context2.next) {
|
@@ -156,13 +155,13 @@ var FileComment = /*#__PURE__*/(0, _createClass2.default)(function FileComment()
|
|
156
155
|
throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
|
157
156
|
case 5:
|
158
157
|
params.id = _this.attributes.id;
|
159
|
-
if (!(params
|
158
|
+
if (!(params.id && !(0, _utils.isInt)(params.id))) {
|
160
159
|
_context2.next = 8;
|
161
160
|
break;
|
162
161
|
}
|
163
|
-
throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params
|
162
|
+
throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params.id)));
|
164
163
|
case 8:
|
165
|
-
if (params
|
164
|
+
if (params.id) {
|
166
165
|
_context2.next = 14;
|
167
166
|
break;
|
168
167
|
}
|
@@ -170,18 +169,15 @@ var FileComment = /*#__PURE__*/(0, _createClass2.default)(function FileComment()
|
|
170
169
|
_context2.next = 13;
|
171
170
|
break;
|
172
171
|
}
|
173
|
-
params
|
172
|
+
params.id = _this.id;
|
174
173
|
_context2.next = 14;
|
175
174
|
break;
|
176
175
|
case 13:
|
177
176
|
throw new errors.MissingParameterError('Parameter missing: id');
|
178
177
|
case 14:
|
179
178
|
_context2.next = 16;
|
180
|
-
return _Api.default.sendRequest("/file_comments/".concat(encodeURIComponent(params
|
179
|
+
return _Api.default.sendRequest("/file_comments/".concat(encodeURIComponent(params.id)), 'DELETE', params, _this.options);
|
181
180
|
case 16:
|
182
|
-
response = _context2.sent;
|
183
|
-
return _context2.abrupt("return");
|
184
|
-
case 18:
|
185
181
|
case "end":
|
186
182
|
return _context2.stop();
|
187
183
|
}
|
@@ -192,28 +188,28 @@ var FileComment = /*#__PURE__*/(0, _createClass2.default)(function FileComment()
|
|
192
188
|
return _this.delete(params);
|
193
189
|
});
|
194
190
|
(0, _defineProperty2.default)(this, "save", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
|
195
|
-
var
|
191
|
+
var _newObject, newObject;
|
196
192
|
return _regenerator.default.wrap(function _callee3$(_context3) {
|
197
193
|
while (1) switch (_context3.prev = _context3.next) {
|
198
194
|
case 0:
|
199
|
-
if (!_this.attributes
|
200
|
-
_context3.next =
|
195
|
+
if (!_this.attributes.id) {
|
196
|
+
_context3.next = 6;
|
201
197
|
break;
|
202
198
|
}
|
203
199
|
_context3.next = 3;
|
204
200
|
return _this.update(_this.attributes);
|
205
201
|
case 3:
|
206
|
-
newObject = _context3.sent;
|
207
|
-
_this.attributes = _objectSpread({}, newObject.attributes);
|
208
|
-
return _context3.abrupt("return", true);
|
209
|
-
case 8:
|
210
|
-
_context3.next = 10;
|
211
|
-
return FileComment.create(_this.attributes, _this.options);
|
212
|
-
case 10:
|
213
202
|
_newObject = _context3.sent;
|
214
203
|
_this.attributes = _objectSpread({}, _newObject.attributes);
|
215
204
|
return _context3.abrupt("return", true);
|
216
|
-
case
|
205
|
+
case 6:
|
206
|
+
_context3.next = 8;
|
207
|
+
return FileComment.create(_this.attributes, _this.options);
|
208
|
+
case 8:
|
209
|
+
newObject = _context3.sent;
|
210
|
+
_this.attributes = _objectSpread({}, newObject.attributes);
|
211
|
+
return _context3.abrupt("return", true);
|
212
|
+
case 11:
|
217
213
|
case "end":
|
218
214
|
return _context3.stop();
|
219
215
|
}
|
@@ -255,33 +251,33 @@ _class = FileComment;
|
|
255
251
|
}
|
256
252
|
throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
|
257
253
|
case 4:
|
258
|
-
params
|
259
|
-
if (params
|
254
|
+
params.path = path;
|
255
|
+
if (params.path) {
|
260
256
|
_context4.next = 7;
|
261
257
|
break;
|
262
258
|
}
|
263
259
|
throw new errors.MissingParameterError('Parameter missing: path');
|
264
260
|
case 7:
|
265
|
-
if (!(params
|
261
|
+
if (!(params.cursor && !(0, _utils.isString)(params.cursor))) {
|
266
262
|
_context4.next = 9;
|
267
263
|
break;
|
268
264
|
}
|
269
|
-
throw new errors.InvalidParameterError("Bad parameter: cursor must be of type String, received ".concat((0, _utils.getType)(params
|
265
|
+
throw new errors.InvalidParameterError("Bad parameter: cursor must be of type String, received ".concat((0, _utils.getType)(params.cursor)));
|
270
266
|
case 9:
|
271
|
-
if (!(params
|
267
|
+
if (!(params.per_page && !(0, _utils.isInt)(params.per_page))) {
|
272
268
|
_context4.next = 11;
|
273
269
|
break;
|
274
270
|
}
|
275
|
-
throw new errors.InvalidParameterError("Bad parameter: per_page must be of type Int, received ".concat((0, _utils.getType)(params
|
271
|
+
throw new errors.InvalidParameterError("Bad parameter: per_page must be of type Int, received ".concat((0, _utils.getType)(params.per_page)));
|
276
272
|
case 11:
|
277
|
-
if (!(params
|
273
|
+
if (!(params.path && !(0, _utils.isString)(params.path))) {
|
278
274
|
_context4.next = 13;
|
279
275
|
break;
|
280
276
|
}
|
281
|
-
throw new errors.InvalidParameterError("Bad parameter: path must be of type String, received ".concat((0, _utils.getType)(params
|
277
|
+
throw new errors.InvalidParameterError("Bad parameter: path must be of type String, received ".concat((0, _utils.getType)(params.path)));
|
282
278
|
case 13:
|
283
279
|
_context4.next = 15;
|
284
|
-
return _Api.default.sendRequest("/file_comments/files/".concat(encodeURIComponent(params
|
280
|
+
return _Api.default.sendRequest("/file_comments/files/".concat(encodeURIComponent(params.path)), 'GET', params, options);
|
285
281
|
case 15:
|
286
282
|
response = _context4.sent;
|
287
283
|
return _context4.abrupt("return", (response === null || response === void 0 || (_response$data = response.data) === null || _response$data === void 0 ? void 0 : _response$data.map(function (obj) {
|
@@ -310,32 +306,32 @@ _class = FileComment;
|
|
310
306
|
case 0:
|
311
307
|
params = _args5.length > 0 && _args5[0] !== undefined ? _args5[0] : {};
|
312
308
|
options = _args5.length > 1 && _args5[1] !== undefined ? _args5[1] : {};
|
313
|
-
if (params
|
309
|
+
if (params.body) {
|
314
310
|
_context5.next = 4;
|
315
311
|
break;
|
316
312
|
}
|
317
313
|
throw new errors.MissingParameterError('Parameter missing: body');
|
318
314
|
case 4:
|
319
|
-
if (params
|
315
|
+
if (params.path) {
|
320
316
|
_context5.next = 6;
|
321
317
|
break;
|
322
318
|
}
|
323
319
|
throw new errors.MissingParameterError('Parameter missing: path');
|
324
320
|
case 6:
|
325
|
-
if (!(params
|
321
|
+
if (!(params.body && !(0, _utils.isString)(params.body))) {
|
326
322
|
_context5.next = 8;
|
327
323
|
break;
|
328
324
|
}
|
329
|
-
throw new errors.InvalidParameterError("Bad parameter: body must be of type String, received ".concat((0, _utils.getType)(params
|
325
|
+
throw new errors.InvalidParameterError("Bad parameter: body must be of type String, received ".concat((0, _utils.getType)(params.body)));
|
330
326
|
case 8:
|
331
|
-
if (!(params
|
327
|
+
if (!(params.path && !(0, _utils.isString)(params.path))) {
|
332
328
|
_context5.next = 10;
|
333
329
|
break;
|
334
330
|
}
|
335
|
-
throw new errors.InvalidParameterError("Bad parameter: path must be of type String, received ".concat((0, _utils.getType)(params
|
331
|
+
throw new errors.InvalidParameterError("Bad parameter: path must be of type String, received ".concat((0, _utils.getType)(params.path)));
|
336
332
|
case 10:
|
337
333
|
_context5.next = 12;
|
338
|
-
return _Api.default.sendRequest(
|
334
|
+
return _Api.default.sendRequest('/file_comments', 'POST', params, options);
|
339
335
|
case 12:
|
340
336
|
response = _context5.sent;
|
341
337
|
return _context5.abrupt("return", new _class(response === null || response === void 0 ? void 0 : response.data, options));
|
@@ -63,7 +63,6 @@ var FileCommentReaction = /*#__PURE__*/(0, _createClass2.default)(function FileC
|
|
63
63
|
});
|
64
64
|
(0, _defineProperty2.default)(this, "delete", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
65
65
|
var params,
|
66
|
-
response,
|
67
66
|
_args = arguments;
|
68
67
|
return _regenerator.default.wrap(function _callee$(_context) {
|
69
68
|
while (1) switch (_context.prev = _context.next) {
|
@@ -82,13 +81,13 @@ var FileCommentReaction = /*#__PURE__*/(0, _createClass2.default)(function FileC
|
|
82
81
|
throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
|
83
82
|
case 5:
|
84
83
|
params.id = _this.attributes.id;
|
85
|
-
if (!(params
|
84
|
+
if (!(params.id && !(0, _utils.isInt)(params.id))) {
|
86
85
|
_context.next = 8;
|
87
86
|
break;
|
88
87
|
}
|
89
|
-
throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params
|
88
|
+
throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params.id)));
|
90
89
|
case 8:
|
91
|
-
if (params
|
90
|
+
if (params.id) {
|
92
91
|
_context.next = 14;
|
93
92
|
break;
|
94
93
|
}
|
@@ -96,18 +95,15 @@ var FileCommentReaction = /*#__PURE__*/(0, _createClass2.default)(function FileC
|
|
96
95
|
_context.next = 13;
|
97
96
|
break;
|
98
97
|
}
|
99
|
-
params
|
98
|
+
params.id = _this.id;
|
100
99
|
_context.next = 14;
|
101
100
|
break;
|
102
101
|
case 13:
|
103
102
|
throw new errors.MissingParameterError('Parameter missing: id');
|
104
103
|
case 14:
|
105
104
|
_context.next = 16;
|
106
|
-
return _Api.default.sendRequest("/file_comment_reactions/".concat(encodeURIComponent(params
|
105
|
+
return _Api.default.sendRequest("/file_comment_reactions/".concat(encodeURIComponent(params.id)), 'DELETE', params, _this.options);
|
107
106
|
case 16:
|
108
|
-
response = _context.sent;
|
109
|
-
return _context.abrupt("return");
|
110
|
-
case 18:
|
111
107
|
case "end":
|
112
108
|
return _context.stop();
|
113
109
|
}
|
@@ -122,7 +118,7 @@ var FileCommentReaction = /*#__PURE__*/(0, _createClass2.default)(function FileC
|
|
122
118
|
return _regenerator.default.wrap(function _callee2$(_context2) {
|
123
119
|
while (1) switch (_context2.prev = _context2.next) {
|
124
120
|
case 0:
|
125
|
-
if (!_this.attributes
|
121
|
+
if (!_this.attributes.id) {
|
126
122
|
_context2.next = 4;
|
127
123
|
break;
|
128
124
|
}
|
@@ -168,38 +164,38 @@ _class = FileCommentReaction;
|
|
168
164
|
case 0:
|
169
165
|
params = _args3.length > 0 && _args3[0] !== undefined ? _args3[0] : {};
|
170
166
|
options = _args3.length > 1 && _args3[1] !== undefined ? _args3[1] : {};
|
171
|
-
if (params
|
167
|
+
if (params.file_comment_id) {
|
172
168
|
_context3.next = 4;
|
173
169
|
break;
|
174
170
|
}
|
175
171
|
throw new errors.MissingParameterError('Parameter missing: file_comment_id');
|
176
172
|
case 4:
|
177
|
-
if (params
|
173
|
+
if (params.emoji) {
|
178
174
|
_context3.next = 6;
|
179
175
|
break;
|
180
176
|
}
|
181
177
|
throw new errors.MissingParameterError('Parameter missing: emoji');
|
182
178
|
case 6:
|
183
|
-
if (!(params
|
179
|
+
if (!(params.user_id && !(0, _utils.isInt)(params.user_id))) {
|
184
180
|
_context3.next = 8;
|
185
181
|
break;
|
186
182
|
}
|
187
|
-
throw new errors.InvalidParameterError("Bad parameter: user_id must be of type Int, received ".concat((0, _utils.getType)(params
|
183
|
+
throw new errors.InvalidParameterError("Bad parameter: user_id must be of type Int, received ".concat((0, _utils.getType)(params.user_id)));
|
188
184
|
case 8:
|
189
|
-
if (!(params
|
185
|
+
if (!(params.file_comment_id && !(0, _utils.isInt)(params.file_comment_id))) {
|
190
186
|
_context3.next = 10;
|
191
187
|
break;
|
192
188
|
}
|
193
|
-
throw new errors.InvalidParameterError("Bad parameter: file_comment_id must be of type Int, received ".concat((0, _utils.getType)(params
|
189
|
+
throw new errors.InvalidParameterError("Bad parameter: file_comment_id must be of type Int, received ".concat((0, _utils.getType)(params.file_comment_id)));
|
194
190
|
case 10:
|
195
|
-
if (!(params
|
191
|
+
if (!(params.emoji && !(0, _utils.isString)(params.emoji))) {
|
196
192
|
_context3.next = 12;
|
197
193
|
break;
|
198
194
|
}
|
199
|
-
throw new errors.InvalidParameterError("Bad parameter: emoji must be of type String, received ".concat((0, _utils.getType)(params
|
195
|
+
throw new errors.InvalidParameterError("Bad parameter: emoji must be of type String, received ".concat((0, _utils.getType)(params.emoji)));
|
200
196
|
case 12:
|
201
197
|
_context3.next = 14;
|
202
|
-
return _Api.default.sendRequest(
|
198
|
+
return _Api.default.sendRequest('/file_comment_reactions', 'POST', params, options);
|
203
199
|
case 14:
|
204
200
|
response = _context3.sent;
|
205
201
|
return _context3.abrupt("return", new _class(response === null || response === void 0 ? void 0 : response.data, options));
|
@@ -102,21 +102,21 @@ _class = FileMigration;
|
|
102
102
|
}
|
103
103
|
throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
|
104
104
|
case 4:
|
105
|
-
params
|
106
|
-
if (params
|
105
|
+
params.id = id;
|
106
|
+
if (params.id) {
|
107
107
|
_context.next = 7;
|
108
108
|
break;
|
109
109
|
}
|
110
110
|
throw new errors.MissingParameterError('Parameter missing: id');
|
111
111
|
case 7:
|
112
|
-
if (!(params
|
112
|
+
if (!(params.id && !(0, _utils.isInt)(params.id))) {
|
113
113
|
_context.next = 9;
|
114
114
|
break;
|
115
115
|
}
|
116
|
-
throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params
|
116
|
+
throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params.id)));
|
117
117
|
case 9:
|
118
118
|
_context.next = 11;
|
119
|
-
return _Api.default.sendRequest("/file_migrations/".concat(encodeURIComponent(params
|
119
|
+
return _Api.default.sendRequest("/file_migrations/".concat(encodeURIComponent(params.id)), 'GET', params, options);
|
120
120
|
case 11:
|
121
121
|
response = _context.sent;
|
122
122
|
return _context.abrupt("return", new _class(response === null || response === void 0 ? void 0 : response.data, options));
|
package/lib/models/Folder.js
CHANGED
@@ -221,54 +221,54 @@ var Folder = /*#__PURE__*/(0, _createClass2.default)(function Folder() {
|
|
221
221
|
}
|
222
222
|
throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
|
223
223
|
case 4:
|
224
|
-
params
|
225
|
-
if (params
|
224
|
+
params.path = path;
|
225
|
+
if (params.path) {
|
226
226
|
_context2.next = 7;
|
227
227
|
break;
|
228
228
|
}
|
229
229
|
throw new errors.MissingParameterError('Parameter missing: path');
|
230
230
|
case 7:
|
231
|
-
if (!(params
|
231
|
+
if (!(params.cursor && !(0, _utils.isString)(params.cursor))) {
|
232
232
|
_context2.next = 9;
|
233
233
|
break;
|
234
234
|
}
|
235
|
-
throw new errors.InvalidParameterError("Bad parameter: cursor must be of type String, received ".concat((0, _utils.getType)(params
|
235
|
+
throw new errors.InvalidParameterError("Bad parameter: cursor must be of type String, received ".concat((0, _utils.getType)(params.cursor)));
|
236
236
|
case 9:
|
237
|
-
if (!(params
|
237
|
+
if (!(params.per_page && !(0, _utils.isInt)(params.per_page))) {
|
238
238
|
_context2.next = 11;
|
239
239
|
break;
|
240
240
|
}
|
241
|
-
throw new errors.InvalidParameterError("Bad parameter: per_page must be of type Int, received ".concat((0, _utils.getType)(params
|
241
|
+
throw new errors.InvalidParameterError("Bad parameter: per_page must be of type Int, received ".concat((0, _utils.getType)(params.per_page)));
|
242
242
|
case 11:
|
243
|
-
if (!(params
|
243
|
+
if (!(params.path && !(0, _utils.isString)(params.path))) {
|
244
244
|
_context2.next = 13;
|
245
245
|
break;
|
246
246
|
}
|
247
|
-
throw new errors.InvalidParameterError("Bad parameter: path must be of type String, received ".concat((0, _utils.getType)(params
|
247
|
+
throw new errors.InvalidParameterError("Bad parameter: path must be of type String, received ".concat((0, _utils.getType)(params.path)));
|
248
248
|
case 13:
|
249
|
-
if (!(params
|
249
|
+
if (!(params.filter && !(0, _utils.isString)(params.filter))) {
|
250
250
|
_context2.next = 15;
|
251
251
|
break;
|
252
252
|
}
|
253
|
-
throw new errors.InvalidParameterError("Bad parameter: filter must be of type String, received ".concat((0, _utils.getType)(params
|
253
|
+
throw new errors.InvalidParameterError("Bad parameter: filter must be of type String, received ".concat((0, _utils.getType)(params.filter)));
|
254
254
|
case 15:
|
255
|
-
if (!(params
|
255
|
+
if (!(params.preview_size && !(0, _utils.isString)(params.preview_size))) {
|
256
256
|
_context2.next = 17;
|
257
257
|
break;
|
258
258
|
}
|
259
|
-
throw new errors.InvalidParameterError("Bad parameter: preview_size must be of type String, received ".concat((0, _utils.getType)(params
|
259
|
+
throw new errors.InvalidParameterError("Bad parameter: preview_size must be of type String, received ".concat((0, _utils.getType)(params.preview_size)));
|
260
260
|
case 17:
|
261
|
-
if (!(params
|
261
|
+
if (!(params.search && !(0, _utils.isString)(params.search))) {
|
262
262
|
_context2.next = 19;
|
263
263
|
break;
|
264
264
|
}
|
265
|
-
throw new errors.InvalidParameterError("Bad parameter: search must be of type String, received ".concat((0, _utils.getType)(params
|
265
|
+
throw new errors.InvalidParameterError("Bad parameter: search must be of type String, received ".concat((0, _utils.getType)(params.search)));
|
266
266
|
case 19:
|
267
267
|
_context2.next = 21;
|
268
|
-
return _Api.default.sendRequest("/folders/".concat(encodeURIComponent(params
|
268
|
+
return _Api.default.sendRequest("/folders/".concat(encodeURIComponent(params.path)), 'GET', params, options);
|
269
269
|
case 21:
|
270
270
|
response = _context2.sent;
|
271
|
-
File = require(
|
271
|
+
File = require('./File.js').default;
|
272
272
|
return _context2.abrupt("return", (response === null || response === void 0 || (_response$data = response.data) === null || _response$data === void 0 ? void 0 : _response$data.map(function (obj) {
|
273
273
|
return new File(obj, options);
|
274
274
|
})) || []);
|
@@ -304,30 +304,30 @@ var Folder = /*#__PURE__*/(0, _createClass2.default)(function Folder() {
|
|
304
304
|
}
|
305
305
|
throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
|
306
306
|
case 4:
|
307
|
-
params
|
308
|
-
if (params
|
307
|
+
params.path = path;
|
308
|
+
if (params.path) {
|
309
309
|
_context3.next = 7;
|
310
310
|
break;
|
311
311
|
}
|
312
312
|
throw new errors.MissingParameterError('Parameter missing: path');
|
313
313
|
case 7:
|
314
|
-
if (!(params
|
314
|
+
if (!(params.path && !(0, _utils.isString)(params.path))) {
|
315
315
|
_context3.next = 9;
|
316
316
|
break;
|
317
317
|
}
|
318
|
-
throw new errors.InvalidParameterError("Bad parameter: path must be of type String, received ".concat((0, _utils.getType)(params
|
318
|
+
throw new errors.InvalidParameterError("Bad parameter: path must be of type String, received ".concat((0, _utils.getType)(params.path)));
|
319
319
|
case 9:
|
320
|
-
if (!(params
|
320
|
+
if (!(params.provided_mtime && !(0, _utils.isString)(params.provided_mtime))) {
|
321
321
|
_context3.next = 11;
|
322
322
|
break;
|
323
323
|
}
|
324
|
-
throw new errors.InvalidParameterError("Bad parameter: provided_mtime must be of type String, received ".concat((0, _utils.getType)(params
|
324
|
+
throw new errors.InvalidParameterError("Bad parameter: provided_mtime must be of type String, received ".concat((0, _utils.getType)(params.provided_mtime)));
|
325
325
|
case 11:
|
326
326
|
_context3.next = 13;
|
327
|
-
return _Api.default.sendRequest("/folders/".concat(encodeURIComponent(params
|
327
|
+
return _Api.default.sendRequest("/folders/".concat(encodeURIComponent(params.path)), 'POST', params, options);
|
328
328
|
case 13:
|
329
329
|
response = _context3.sent;
|
330
|
-
File = require(
|
330
|
+
File = require('./File.js').default;
|
331
331
|
return _context3.abrupt("return", new File(response === null || response === void 0 ? void 0 : response.data, options));
|
332
332
|
case 16:
|
333
333
|
case "end":
|