files.com 1.1.19 → 1.2.1
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/lib/Api.js +1 -1
- package/lib/Errors.js +354 -512
- 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 -178
- 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
package/lib/models/Message.js
CHANGED
@@ -100,31 +100,31 @@ var Message = /*#__PURE__*/(0, _createClass2.default)(function Message() {
|
|
100
100
|
throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
|
101
101
|
case 5:
|
102
102
|
params.id = _this.attributes.id;
|
103
|
-
if (!(params
|
103
|
+
if (!(params.id && !(0, _utils.isInt)(params.id))) {
|
104
104
|
_context.next = 8;
|
105
105
|
break;
|
106
106
|
}
|
107
|
-
throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params
|
107
|
+
throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params.id)));
|
108
108
|
case 8:
|
109
|
-
if (!(params
|
109
|
+
if (!(params.project_id && !(0, _utils.isInt)(params.project_id))) {
|
110
110
|
_context.next = 10;
|
111
111
|
break;
|
112
112
|
}
|
113
|
-
throw new errors.InvalidParameterError("Bad parameter: project_id must be of type Int, received ".concat((0, _utils.getType)(params
|
113
|
+
throw new errors.InvalidParameterError("Bad parameter: project_id must be of type Int, received ".concat((0, _utils.getType)(params.project_id)));
|
114
114
|
case 10:
|
115
|
-
if (!(params
|
115
|
+
if (!(params.subject && !(0, _utils.isString)(params.subject))) {
|
116
116
|
_context.next = 12;
|
117
117
|
break;
|
118
118
|
}
|
119
|
-
throw new errors.InvalidParameterError("Bad parameter: subject must be of type String, received ".concat((0, _utils.getType)(params
|
119
|
+
throw new errors.InvalidParameterError("Bad parameter: subject must be of type String, received ".concat((0, _utils.getType)(params.subject)));
|
120
120
|
case 12:
|
121
|
-
if (!(params
|
121
|
+
if (!(params.body && !(0, _utils.isString)(params.body))) {
|
122
122
|
_context.next = 14;
|
123
123
|
break;
|
124
124
|
}
|
125
|
-
throw new errors.InvalidParameterError("Bad parameter: body must be of type String, received ".concat((0, _utils.getType)(params
|
125
|
+
throw new errors.InvalidParameterError("Bad parameter: body must be of type String, received ".concat((0, _utils.getType)(params.body)));
|
126
126
|
case 14:
|
127
|
-
if (params
|
127
|
+
if (params.id) {
|
128
128
|
_context.next = 20;
|
129
129
|
break;
|
130
130
|
}
|
@@ -132,13 +132,13 @@ var Message = /*#__PURE__*/(0, _createClass2.default)(function Message() {
|
|
132
132
|
_context.next = 19;
|
133
133
|
break;
|
134
134
|
}
|
135
|
-
params
|
135
|
+
params.id = _this.id;
|
136
136
|
_context.next = 20;
|
137
137
|
break;
|
138
138
|
case 19:
|
139
139
|
throw new errors.MissingParameterError('Parameter missing: id');
|
140
140
|
case 20:
|
141
|
-
if (params
|
141
|
+
if (params.project_id) {
|
142
142
|
_context.next = 26;
|
143
143
|
break;
|
144
144
|
}
|
@@ -146,13 +146,13 @@ var Message = /*#__PURE__*/(0, _createClass2.default)(function Message() {
|
|
146
146
|
_context.next = 25;
|
147
147
|
break;
|
148
148
|
}
|
149
|
-
params
|
149
|
+
params.project_id = _this.project_id;
|
150
150
|
_context.next = 26;
|
151
151
|
break;
|
152
152
|
case 25:
|
153
153
|
throw new errors.MissingParameterError('Parameter missing: project_id');
|
154
154
|
case 26:
|
155
|
-
if (params
|
155
|
+
if (params.subject) {
|
156
156
|
_context.next = 32;
|
157
157
|
break;
|
158
158
|
}
|
@@ -160,13 +160,13 @@ var Message = /*#__PURE__*/(0, _createClass2.default)(function Message() {
|
|
160
160
|
_context.next = 31;
|
161
161
|
break;
|
162
162
|
}
|
163
|
-
params
|
163
|
+
params.subject = _this.subject;
|
164
164
|
_context.next = 32;
|
165
165
|
break;
|
166
166
|
case 31:
|
167
167
|
throw new errors.MissingParameterError('Parameter missing: subject');
|
168
168
|
case 32:
|
169
|
-
if (params
|
169
|
+
if (params.body) {
|
170
170
|
_context.next = 38;
|
171
171
|
break;
|
172
172
|
}
|
@@ -174,14 +174,14 @@ var Message = /*#__PURE__*/(0, _createClass2.default)(function Message() {
|
|
174
174
|
_context.next = 37;
|
175
175
|
break;
|
176
176
|
}
|
177
|
-
params
|
177
|
+
params.body = _this.body;
|
178
178
|
_context.next = 38;
|
179
179
|
break;
|
180
180
|
case 37:
|
181
181
|
throw new errors.MissingParameterError('Parameter missing: body');
|
182
182
|
case 38:
|
183
183
|
_context.next = 40;
|
184
|
-
return _Api.default.sendRequest("/messages/".concat(encodeURIComponent(params
|
184
|
+
return _Api.default.sendRequest("/messages/".concat(encodeURIComponent(params.id)), 'PATCH', params, _this.options);
|
185
185
|
case 40:
|
186
186
|
response = _context.sent;
|
187
187
|
return _context.abrupt("return", new Message(response === null || response === void 0 ? void 0 : response.data, _this.options));
|
@@ -193,7 +193,6 @@ var Message = /*#__PURE__*/(0, _createClass2.default)(function Message() {
|
|
193
193
|
})));
|
194
194
|
(0, _defineProperty2.default)(this, "delete", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
|
195
195
|
var params,
|
196
|
-
response,
|
197
196
|
_args2 = arguments;
|
198
197
|
return _regenerator.default.wrap(function _callee2$(_context2) {
|
199
198
|
while (1) switch (_context2.prev = _context2.next) {
|
@@ -212,13 +211,13 @@ var Message = /*#__PURE__*/(0, _createClass2.default)(function Message() {
|
|
212
211
|
throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
|
213
212
|
case 5:
|
214
213
|
params.id = _this.attributes.id;
|
215
|
-
if (!(params
|
214
|
+
if (!(params.id && !(0, _utils.isInt)(params.id))) {
|
216
215
|
_context2.next = 8;
|
217
216
|
break;
|
218
217
|
}
|
219
|
-
throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params
|
218
|
+
throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params.id)));
|
220
219
|
case 8:
|
221
|
-
if (params
|
220
|
+
if (params.id) {
|
222
221
|
_context2.next = 14;
|
223
222
|
break;
|
224
223
|
}
|
@@ -226,18 +225,15 @@ var Message = /*#__PURE__*/(0, _createClass2.default)(function Message() {
|
|
226
225
|
_context2.next = 13;
|
227
226
|
break;
|
228
227
|
}
|
229
|
-
params
|
228
|
+
params.id = _this.id;
|
230
229
|
_context2.next = 14;
|
231
230
|
break;
|
232
231
|
case 13:
|
233
232
|
throw new errors.MissingParameterError('Parameter missing: id');
|
234
233
|
case 14:
|
235
234
|
_context2.next = 16;
|
236
|
-
return _Api.default.sendRequest("/messages/".concat(encodeURIComponent(params
|
235
|
+
return _Api.default.sendRequest("/messages/".concat(encodeURIComponent(params.id)), 'DELETE', params, _this.options);
|
237
236
|
case 16:
|
238
|
-
response = _context2.sent;
|
239
|
-
return _context2.abrupt("return");
|
240
|
-
case 18:
|
241
237
|
case "end":
|
242
238
|
return _context2.stop();
|
243
239
|
}
|
@@ -248,28 +244,28 @@ var Message = /*#__PURE__*/(0, _createClass2.default)(function Message() {
|
|
248
244
|
return _this.delete(params);
|
249
245
|
});
|
250
246
|
(0, _defineProperty2.default)(this, "save", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
|
251
|
-
var
|
247
|
+
var _newObject, newObject;
|
252
248
|
return _regenerator.default.wrap(function _callee3$(_context3) {
|
253
249
|
while (1) switch (_context3.prev = _context3.next) {
|
254
250
|
case 0:
|
255
|
-
if (!_this.attributes
|
256
|
-
_context3.next =
|
251
|
+
if (!_this.attributes.id) {
|
252
|
+
_context3.next = 6;
|
257
253
|
break;
|
258
254
|
}
|
259
255
|
_context3.next = 3;
|
260
256
|
return _this.update(_this.attributes);
|
261
257
|
case 3:
|
262
|
-
newObject = _context3.sent;
|
263
|
-
_this.attributes = _objectSpread({}, newObject.attributes);
|
264
|
-
return _context3.abrupt("return", true);
|
265
|
-
case 8:
|
266
|
-
_context3.next = 10;
|
267
|
-
return Message.create(_this.attributes, _this.options);
|
268
|
-
case 10:
|
269
258
|
_newObject = _context3.sent;
|
270
259
|
_this.attributes = _objectSpread({}, _newObject.attributes);
|
271
260
|
return _context3.abrupt("return", true);
|
272
|
-
case
|
261
|
+
case 6:
|
262
|
+
_context3.next = 8;
|
263
|
+
return Message.create(_this.attributes, _this.options);
|
264
|
+
case 8:
|
265
|
+
newObject = _context3.sent;
|
266
|
+
_this.attributes = _objectSpread({}, newObject.attributes);
|
267
|
+
return _context3.abrupt("return", true);
|
268
|
+
case 11:
|
273
269
|
case "end":
|
274
270
|
return _context3.stop();
|
275
271
|
}
|
@@ -305,38 +301,38 @@ _class = Message;
|
|
305
301
|
case 0:
|
306
302
|
params = _args4.length > 0 && _args4[0] !== undefined ? _args4[0] : {};
|
307
303
|
options = _args4.length > 1 && _args4[1] !== undefined ? _args4[1] : {};
|
308
|
-
if (params
|
304
|
+
if (params.project_id) {
|
309
305
|
_context4.next = 4;
|
310
306
|
break;
|
311
307
|
}
|
312
308
|
throw new errors.MissingParameterError('Parameter missing: project_id');
|
313
309
|
case 4:
|
314
|
-
if (!(params
|
310
|
+
if (!(params.user_id && !(0, _utils.isInt)(params.user_id))) {
|
315
311
|
_context4.next = 6;
|
316
312
|
break;
|
317
313
|
}
|
318
|
-
throw new errors.InvalidParameterError("Bad parameter: user_id must be of type Int, received ".concat((0, _utils.getType)(params
|
314
|
+
throw new errors.InvalidParameterError("Bad parameter: user_id must be of type Int, received ".concat((0, _utils.getType)(params.user_id)));
|
319
315
|
case 6:
|
320
|
-
if (!(params
|
316
|
+
if (!(params.cursor && !(0, _utils.isString)(params.cursor))) {
|
321
317
|
_context4.next = 8;
|
322
318
|
break;
|
323
319
|
}
|
324
|
-
throw new errors.InvalidParameterError("Bad parameter: cursor must be of type String, received ".concat((0, _utils.getType)(params
|
320
|
+
throw new errors.InvalidParameterError("Bad parameter: cursor must be of type String, received ".concat((0, _utils.getType)(params.cursor)));
|
325
321
|
case 8:
|
326
|
-
if (!(params
|
322
|
+
if (!(params.per_page && !(0, _utils.isInt)(params.per_page))) {
|
327
323
|
_context4.next = 10;
|
328
324
|
break;
|
329
325
|
}
|
330
|
-
throw new errors.InvalidParameterError("Bad parameter: per_page must be of type Int, received ".concat((0, _utils.getType)(params
|
326
|
+
throw new errors.InvalidParameterError("Bad parameter: per_page must be of type Int, received ".concat((0, _utils.getType)(params.per_page)));
|
331
327
|
case 10:
|
332
|
-
if (!(params
|
328
|
+
if (!(params.project_id && !(0, _utils.isInt)(params.project_id))) {
|
333
329
|
_context4.next = 12;
|
334
330
|
break;
|
335
331
|
}
|
336
|
-
throw new errors.InvalidParameterError("Bad parameter: project_id must be of type Int, received ".concat((0, _utils.getType)(params
|
332
|
+
throw new errors.InvalidParameterError("Bad parameter: project_id must be of type Int, received ".concat((0, _utils.getType)(params.project_id)));
|
337
333
|
case 12:
|
338
334
|
_context4.next = 14;
|
339
|
-
return _Api.default.sendRequest(
|
335
|
+
return _Api.default.sendRequest('/messages', 'GET', params, options);
|
340
336
|
case 14:
|
341
337
|
response = _context4.sent;
|
342
338
|
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) {
|
@@ -372,21 +368,21 @@ _class = Message;
|
|
372
368
|
}
|
373
369
|
throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
|
374
370
|
case 4:
|
375
|
-
params
|
376
|
-
if (params
|
371
|
+
params.id = id;
|
372
|
+
if (params.id) {
|
377
373
|
_context5.next = 7;
|
378
374
|
break;
|
379
375
|
}
|
380
376
|
throw new errors.MissingParameterError('Parameter missing: id');
|
381
377
|
case 7:
|
382
|
-
if (!(params
|
378
|
+
if (!(params.id && !(0, _utils.isInt)(params.id))) {
|
383
379
|
_context5.next = 9;
|
384
380
|
break;
|
385
381
|
}
|
386
|
-
throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params
|
382
|
+
throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params.id)));
|
387
383
|
case 9:
|
388
384
|
_context5.next = 11;
|
389
|
-
return _Api.default.sendRequest("/messages/".concat(encodeURIComponent(params
|
385
|
+
return _Api.default.sendRequest("/messages/".concat(encodeURIComponent(params.id)), 'GET', params, options);
|
390
386
|
case 11:
|
391
387
|
response = _context5.sent;
|
392
388
|
return _context5.abrupt("return", new _class(response === null || response === void 0 ? void 0 : response.data, options));
|
@@ -420,50 +416,50 @@ _class = Message;
|
|
420
416
|
case 0:
|
421
417
|
params = _args6.length > 0 && _args6[0] !== undefined ? _args6[0] : {};
|
422
418
|
options = _args6.length > 1 && _args6[1] !== undefined ? _args6[1] : {};
|
423
|
-
if (params
|
419
|
+
if (params.project_id) {
|
424
420
|
_context6.next = 4;
|
425
421
|
break;
|
426
422
|
}
|
427
423
|
throw new errors.MissingParameterError('Parameter missing: project_id');
|
428
424
|
case 4:
|
429
|
-
if (params
|
425
|
+
if (params.subject) {
|
430
426
|
_context6.next = 6;
|
431
427
|
break;
|
432
428
|
}
|
433
429
|
throw new errors.MissingParameterError('Parameter missing: subject');
|
434
430
|
case 6:
|
435
|
-
if (params
|
431
|
+
if (params.body) {
|
436
432
|
_context6.next = 8;
|
437
433
|
break;
|
438
434
|
}
|
439
435
|
throw new errors.MissingParameterError('Parameter missing: body');
|
440
436
|
case 8:
|
441
|
-
if (!(params
|
437
|
+
if (!(params.user_id && !(0, _utils.isInt)(params.user_id))) {
|
442
438
|
_context6.next = 10;
|
443
439
|
break;
|
444
440
|
}
|
445
|
-
throw new errors.InvalidParameterError("Bad parameter: user_id must be of type Int, received ".concat((0, _utils.getType)(params
|
441
|
+
throw new errors.InvalidParameterError("Bad parameter: user_id must be of type Int, received ".concat((0, _utils.getType)(params.user_id)));
|
446
442
|
case 10:
|
447
|
-
if (!(params
|
443
|
+
if (!(params.project_id && !(0, _utils.isInt)(params.project_id))) {
|
448
444
|
_context6.next = 12;
|
449
445
|
break;
|
450
446
|
}
|
451
|
-
throw new errors.InvalidParameterError("Bad parameter: project_id must be of type Int, received ".concat((0, _utils.getType)(params
|
447
|
+
throw new errors.InvalidParameterError("Bad parameter: project_id must be of type Int, received ".concat((0, _utils.getType)(params.project_id)));
|
452
448
|
case 12:
|
453
|
-
if (!(params
|
449
|
+
if (!(params.subject && !(0, _utils.isString)(params.subject))) {
|
454
450
|
_context6.next = 14;
|
455
451
|
break;
|
456
452
|
}
|
457
|
-
throw new errors.InvalidParameterError("Bad parameter: subject must be of type String, received ".concat((0, _utils.getType)(params
|
453
|
+
throw new errors.InvalidParameterError("Bad parameter: subject must be of type String, received ".concat((0, _utils.getType)(params.subject)));
|
458
454
|
case 14:
|
459
|
-
if (!(params
|
455
|
+
if (!(params.body && !(0, _utils.isString)(params.body))) {
|
460
456
|
_context6.next = 16;
|
461
457
|
break;
|
462
458
|
}
|
463
|
-
throw new errors.InvalidParameterError("Bad parameter: body must be of type String, received ".concat((0, _utils.getType)(params
|
459
|
+
throw new errors.InvalidParameterError("Bad parameter: body must be of type String, received ".concat((0, _utils.getType)(params.body)));
|
464
460
|
case 16:
|
465
461
|
_context6.next = 18;
|
466
|
-
return _Api.default.sendRequest(
|
462
|
+
return _Api.default.sendRequest('/messages', 'POST', params, options);
|
467
463
|
case 18:
|
468
464
|
response = _context6.sent;
|
469
465
|
return _context6.abrupt("return", new _class(response === null || response === void 0 ? void 0 : response.data, options));
|
@@ -84,19 +84,19 @@ var MessageComment = /*#__PURE__*/(0, _createClass2.default)(function MessageCom
|
|
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 MessageComment = /*#__PURE__*/(0, _createClass2.default)(function MessageCom
|
|
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 MessageComment = /*#__PURE__*/(0, _createClass2.default)(function MessageCom
|
|
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("/message_comments/".concat(encodeURIComponent(params
|
128
|
+
return _Api.default.sendRequest("/message_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 MessageComment(response === null || response === void 0 ? void 0 : response.data, _this.options));
|
@@ -137,7 +137,6 @@ var MessageComment = /*#__PURE__*/(0, _createClass2.default)(function MessageCom
|
|
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 MessageComment = /*#__PURE__*/(0, _createClass2.default)(function MessageCom
|
|
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 MessageComment = /*#__PURE__*/(0, _createClass2.default)(function MessageCom
|
|
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("/message_comments/".concat(encodeURIComponent(params
|
179
|
+
return _Api.default.sendRequest("/message_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 MessageComment = /*#__PURE__*/(0, _createClass2.default)(function MessageCom
|
|
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 MessageComment.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 MessageComment.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
|
}
|
@@ -249,38 +245,38 @@ _class = MessageComment;
|
|
249
245
|
case 0:
|
250
246
|
params = _args4.length > 0 && _args4[0] !== undefined ? _args4[0] : {};
|
251
247
|
options = _args4.length > 1 && _args4[1] !== undefined ? _args4[1] : {};
|
252
|
-
if (params
|
248
|
+
if (params.message_id) {
|
253
249
|
_context4.next = 4;
|
254
250
|
break;
|
255
251
|
}
|
256
252
|
throw new errors.MissingParameterError('Parameter missing: message_id');
|
257
253
|
case 4:
|
258
|
-
if (!(params
|
254
|
+
if (!(params.user_id && !(0, _utils.isInt)(params.user_id))) {
|
259
255
|
_context4.next = 6;
|
260
256
|
break;
|
261
257
|
}
|
262
|
-
throw new errors.InvalidParameterError("Bad parameter: user_id must be of type Int, received ".concat((0, _utils.getType)(params
|
258
|
+
throw new errors.InvalidParameterError("Bad parameter: user_id must be of type Int, received ".concat((0, _utils.getType)(params.user_id)));
|
263
259
|
case 6:
|
264
|
-
if (!(params
|
260
|
+
if (!(params.cursor && !(0, _utils.isString)(params.cursor))) {
|
265
261
|
_context4.next = 8;
|
266
262
|
break;
|
267
263
|
}
|
268
|
-
throw new errors.InvalidParameterError("Bad parameter: cursor must be of type String, received ".concat((0, _utils.getType)(params
|
264
|
+
throw new errors.InvalidParameterError("Bad parameter: cursor must be of type String, received ".concat((0, _utils.getType)(params.cursor)));
|
269
265
|
case 8:
|
270
|
-
if (!(params
|
266
|
+
if (!(params.per_page && !(0, _utils.isInt)(params.per_page))) {
|
271
267
|
_context4.next = 10;
|
272
268
|
break;
|
273
269
|
}
|
274
|
-
throw new errors.InvalidParameterError("Bad parameter: per_page must be of type Int, received ".concat((0, _utils.getType)(params
|
270
|
+
throw new errors.InvalidParameterError("Bad parameter: per_page must be of type Int, received ".concat((0, _utils.getType)(params.per_page)));
|
275
271
|
case 10:
|
276
|
-
if (!(params
|
272
|
+
if (!(params.message_id && !(0, _utils.isInt)(params.message_id))) {
|
277
273
|
_context4.next = 12;
|
278
274
|
break;
|
279
275
|
}
|
280
|
-
throw new errors.InvalidParameterError("Bad parameter: message_id must be of type Int, received ".concat((0, _utils.getType)(params
|
276
|
+
throw new errors.InvalidParameterError("Bad parameter: message_id must be of type Int, received ".concat((0, _utils.getType)(params.message_id)));
|
281
277
|
case 12:
|
282
278
|
_context4.next = 14;
|
283
|
-
return _Api.default.sendRequest(
|
279
|
+
return _Api.default.sendRequest('/message_comments', 'GET', params, options);
|
284
280
|
case 14:
|
285
281
|
response = _context4.sent;
|
286
282
|
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) {
|
@@ -316,21 +312,21 @@ _class = MessageComment;
|
|
316
312
|
}
|
317
313
|
throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
|
318
314
|
case 4:
|
319
|
-
params
|
320
|
-
if (params
|
315
|
+
params.id = id;
|
316
|
+
if (params.id) {
|
321
317
|
_context5.next = 7;
|
322
318
|
break;
|
323
319
|
}
|
324
320
|
throw new errors.MissingParameterError('Parameter missing: id');
|
325
321
|
case 7:
|
326
|
-
if (!(params
|
322
|
+
if (!(params.id && !(0, _utils.isInt)(params.id))) {
|
327
323
|
_context5.next = 9;
|
328
324
|
break;
|
329
325
|
}
|
330
|
-
throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params
|
326
|
+
throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params.id)));
|
331
327
|
case 9:
|
332
328
|
_context5.next = 11;
|
333
|
-
return _Api.default.sendRequest("/message_comments/".concat(encodeURIComponent(params
|
329
|
+
return _Api.default.sendRequest("/message_comments/".concat(encodeURIComponent(params.id)), 'GET', params, options);
|
334
330
|
case 11:
|
335
331
|
response = _context5.sent;
|
336
332
|
return _context5.abrupt("return", new _class(response === null || response === void 0 ? void 0 : response.data, options));
|
@@ -362,26 +358,26 @@ _class = MessageComment;
|
|
362
358
|
case 0:
|
363
359
|
params = _args6.length > 0 && _args6[0] !== undefined ? _args6[0] : {};
|
364
360
|
options = _args6.length > 1 && _args6[1] !== undefined ? _args6[1] : {};
|
365
|
-
if (params
|
361
|
+
if (params.body) {
|
366
362
|
_context6.next = 4;
|
367
363
|
break;
|
368
364
|
}
|
369
365
|
throw new errors.MissingParameterError('Parameter missing: body');
|
370
366
|
case 4:
|
371
|
-
if (!(params
|
367
|
+
if (!(params.user_id && !(0, _utils.isInt)(params.user_id))) {
|
372
368
|
_context6.next = 6;
|
373
369
|
break;
|
374
370
|
}
|
375
|
-
throw new errors.InvalidParameterError("Bad parameter: user_id must be of type Int, received ".concat((0, _utils.getType)(params
|
371
|
+
throw new errors.InvalidParameterError("Bad parameter: user_id must be of type Int, received ".concat((0, _utils.getType)(params.user_id)));
|
376
372
|
case 6:
|
377
|
-
if (!(params
|
373
|
+
if (!(params.body && !(0, _utils.isString)(params.body))) {
|
378
374
|
_context6.next = 8;
|
379
375
|
break;
|
380
376
|
}
|
381
|
-
throw new errors.InvalidParameterError("Bad parameter: body must be of type String, received ".concat((0, _utils.getType)(params
|
377
|
+
throw new errors.InvalidParameterError("Bad parameter: body must be of type String, received ".concat((0, _utils.getType)(params.body)));
|
382
378
|
case 8:
|
383
379
|
_context6.next = 10;
|
384
|
-
return _Api.default.sendRequest(
|
380
|
+
return _Api.default.sendRequest('/message_comments', 'POST', params, options);
|
385
381
|
case 10:
|
386
382
|
response = _context6.sent;
|
387
383
|
return _context6.abrupt("return", new _class(response === null || response === void 0 ? void 0 : response.data, options));
|