files.com 1.1.18 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.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
package/lib/models/Behavior.js
CHANGED
|
@@ -125,43 +125,43 @@ var Behavior = /*#__PURE__*/(0, _createClass2.default)(function Behavior() {
|
|
|
125
125
|
throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
|
|
126
126
|
case 5:
|
|
127
127
|
params.id = _this.attributes.id;
|
|
128
|
-
if (!(params
|
|
128
|
+
if (!(params.id && !(0, _utils.isInt)(params.id))) {
|
|
129
129
|
_context.next = 8;
|
|
130
130
|
break;
|
|
131
131
|
}
|
|
132
|
-
throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params
|
|
132
|
+
throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params.id)));
|
|
133
133
|
case 8:
|
|
134
|
-
if (!(params
|
|
134
|
+
if (!(params.value && !(0, _utils.isString)(params.value))) {
|
|
135
135
|
_context.next = 10;
|
|
136
136
|
break;
|
|
137
137
|
}
|
|
138
|
-
throw new errors.InvalidParameterError("Bad parameter: value must be of type String, received ".concat((0, _utils.getType)(params
|
|
138
|
+
throw new errors.InvalidParameterError("Bad parameter: value must be of type String, received ".concat((0, _utils.getType)(params.value)));
|
|
139
139
|
case 10:
|
|
140
|
-
if (!(params
|
|
140
|
+
if (!(params.name && !(0, _utils.isString)(params.name))) {
|
|
141
141
|
_context.next = 12;
|
|
142
142
|
break;
|
|
143
143
|
}
|
|
144
|
-
throw new errors.InvalidParameterError("Bad parameter: name must be of type String, received ".concat((0, _utils.getType)(params
|
|
144
|
+
throw new errors.InvalidParameterError("Bad parameter: name must be of type String, received ".concat((0, _utils.getType)(params.name)));
|
|
145
145
|
case 12:
|
|
146
|
-
if (!(params
|
|
146
|
+
if (!(params.description && !(0, _utils.isString)(params.description))) {
|
|
147
147
|
_context.next = 14;
|
|
148
148
|
break;
|
|
149
149
|
}
|
|
150
|
-
throw new errors.InvalidParameterError("Bad parameter: description must be of type String, received ".concat((0, _utils.getType)(params
|
|
150
|
+
throw new errors.InvalidParameterError("Bad parameter: description must be of type String, received ".concat((0, _utils.getType)(params.description)));
|
|
151
151
|
case 14:
|
|
152
|
-
if (!(params
|
|
152
|
+
if (!(params.behavior && !(0, _utils.isString)(params.behavior))) {
|
|
153
153
|
_context.next = 16;
|
|
154
154
|
break;
|
|
155
155
|
}
|
|
156
|
-
throw new errors.InvalidParameterError("Bad parameter: behavior must be of type String, received ".concat((0, _utils.getType)(params
|
|
156
|
+
throw new errors.InvalidParameterError("Bad parameter: behavior must be of type String, received ".concat((0, _utils.getType)(params.behavior)));
|
|
157
157
|
case 16:
|
|
158
|
-
if (!(params
|
|
158
|
+
if (!(params.path && !(0, _utils.isString)(params.path))) {
|
|
159
159
|
_context.next = 18;
|
|
160
160
|
break;
|
|
161
161
|
}
|
|
162
|
-
throw new errors.InvalidParameterError("Bad parameter: path must be of type String, received ".concat((0, _utils.getType)(params
|
|
162
|
+
throw new errors.InvalidParameterError("Bad parameter: path must be of type String, received ".concat((0, _utils.getType)(params.path)));
|
|
163
163
|
case 18:
|
|
164
|
-
if (params
|
|
164
|
+
if (params.id) {
|
|
165
165
|
_context.next = 24;
|
|
166
166
|
break;
|
|
167
167
|
}
|
|
@@ -169,14 +169,14 @@ var Behavior = /*#__PURE__*/(0, _createClass2.default)(function Behavior() {
|
|
|
169
169
|
_context.next = 23;
|
|
170
170
|
break;
|
|
171
171
|
}
|
|
172
|
-
params
|
|
172
|
+
params.id = _this.id;
|
|
173
173
|
_context.next = 24;
|
|
174
174
|
break;
|
|
175
175
|
case 23:
|
|
176
176
|
throw new errors.MissingParameterError('Parameter missing: id');
|
|
177
177
|
case 24:
|
|
178
178
|
_context.next = 26;
|
|
179
|
-
return _Api.default.sendRequest("/behaviors/".concat(encodeURIComponent(params
|
|
179
|
+
return _Api.default.sendRequest("/behaviors/".concat(encodeURIComponent(params.id)), 'PATCH', params, _this.options);
|
|
180
180
|
case 26:
|
|
181
181
|
response = _context.sent;
|
|
182
182
|
return _context.abrupt("return", new Behavior(response === null || response === void 0 ? void 0 : response.data, _this.options));
|
|
@@ -188,7 +188,6 @@ var Behavior = /*#__PURE__*/(0, _createClass2.default)(function Behavior() {
|
|
|
188
188
|
})));
|
|
189
189
|
(0, _defineProperty2.default)(this, "delete", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
|
|
190
190
|
var params,
|
|
191
|
-
response,
|
|
192
191
|
_args2 = arguments;
|
|
193
192
|
return _regenerator.default.wrap(function _callee2$(_context2) {
|
|
194
193
|
while (1) switch (_context2.prev = _context2.next) {
|
|
@@ -207,13 +206,13 @@ var Behavior = /*#__PURE__*/(0, _createClass2.default)(function Behavior() {
|
|
|
207
206
|
throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
|
|
208
207
|
case 5:
|
|
209
208
|
params.id = _this.attributes.id;
|
|
210
|
-
if (!(params
|
|
209
|
+
if (!(params.id && !(0, _utils.isInt)(params.id))) {
|
|
211
210
|
_context2.next = 8;
|
|
212
211
|
break;
|
|
213
212
|
}
|
|
214
|
-
throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params
|
|
213
|
+
throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params.id)));
|
|
215
214
|
case 8:
|
|
216
|
-
if (params
|
|
215
|
+
if (params.id) {
|
|
217
216
|
_context2.next = 14;
|
|
218
217
|
break;
|
|
219
218
|
}
|
|
@@ -221,18 +220,15 @@ var Behavior = /*#__PURE__*/(0, _createClass2.default)(function Behavior() {
|
|
|
221
220
|
_context2.next = 13;
|
|
222
221
|
break;
|
|
223
222
|
}
|
|
224
|
-
params
|
|
223
|
+
params.id = _this.id;
|
|
225
224
|
_context2.next = 14;
|
|
226
225
|
break;
|
|
227
226
|
case 13:
|
|
228
227
|
throw new errors.MissingParameterError('Parameter missing: id');
|
|
229
228
|
case 14:
|
|
230
229
|
_context2.next = 16;
|
|
231
|
-
return _Api.default.sendRequest("/behaviors/".concat(encodeURIComponent(params
|
|
230
|
+
return _Api.default.sendRequest("/behaviors/".concat(encodeURIComponent(params.id)), 'DELETE', params, _this.options);
|
|
232
231
|
case 16:
|
|
233
|
-
response = _context2.sent;
|
|
234
|
-
return _context2.abrupt("return");
|
|
235
|
-
case 18:
|
|
236
232
|
case "end":
|
|
237
233
|
return _context2.stop();
|
|
238
234
|
}
|
|
@@ -243,28 +239,28 @@ var Behavior = /*#__PURE__*/(0, _createClass2.default)(function Behavior() {
|
|
|
243
239
|
return _this.delete(params);
|
|
244
240
|
});
|
|
245
241
|
(0, _defineProperty2.default)(this, "save", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
|
|
246
|
-
var
|
|
242
|
+
var _newObject, newObject;
|
|
247
243
|
return _regenerator.default.wrap(function _callee3$(_context3) {
|
|
248
244
|
while (1) switch (_context3.prev = _context3.next) {
|
|
249
245
|
case 0:
|
|
250
|
-
if (!_this.attributes
|
|
251
|
-
_context3.next =
|
|
246
|
+
if (!_this.attributes.id) {
|
|
247
|
+
_context3.next = 6;
|
|
252
248
|
break;
|
|
253
249
|
}
|
|
254
250
|
_context3.next = 3;
|
|
255
251
|
return _this.update(_this.attributes);
|
|
256
252
|
case 3:
|
|
257
|
-
newObject = _context3.sent;
|
|
258
|
-
_this.attributes = _objectSpread({}, newObject.attributes);
|
|
259
|
-
return _context3.abrupt("return", true);
|
|
260
|
-
case 8:
|
|
261
|
-
_context3.next = 10;
|
|
262
|
-
return Behavior.create(_this.attributes, _this.options);
|
|
263
|
-
case 10:
|
|
264
253
|
_newObject = _context3.sent;
|
|
265
254
|
_this.attributes = _objectSpread({}, _newObject.attributes);
|
|
266
255
|
return _context3.abrupt("return", true);
|
|
267
|
-
case
|
|
256
|
+
case 6:
|
|
257
|
+
_context3.next = 8;
|
|
258
|
+
return Behavior.create(_this.attributes, _this.options);
|
|
259
|
+
case 8:
|
|
260
|
+
newObject = _context3.sent;
|
|
261
|
+
_this.attributes = _objectSpread({}, newObject.attributes);
|
|
262
|
+
return _context3.abrupt("return", true);
|
|
263
|
+
case 11:
|
|
268
264
|
case "end":
|
|
269
265
|
return _context3.stop();
|
|
270
266
|
}
|
|
@@ -301,20 +297,20 @@ _class = Behavior;
|
|
|
301
297
|
case 0:
|
|
302
298
|
params = _args4.length > 0 && _args4[0] !== undefined ? _args4[0] : {};
|
|
303
299
|
options = _args4.length > 1 && _args4[1] !== undefined ? _args4[1] : {};
|
|
304
|
-
if (!(params
|
|
300
|
+
if (!(params.cursor && !(0, _utils.isString)(params.cursor))) {
|
|
305
301
|
_context4.next = 4;
|
|
306
302
|
break;
|
|
307
303
|
}
|
|
308
|
-
throw new errors.InvalidParameterError("Bad parameter: cursor must be of type String, received ".concat((0, _utils.getType)(params
|
|
304
|
+
throw new errors.InvalidParameterError("Bad parameter: cursor must be of type String, received ".concat((0, _utils.getType)(params.cursor)));
|
|
309
305
|
case 4:
|
|
310
|
-
if (!(params
|
|
306
|
+
if (!(params.per_page && !(0, _utils.isInt)(params.per_page))) {
|
|
311
307
|
_context4.next = 6;
|
|
312
308
|
break;
|
|
313
309
|
}
|
|
314
|
-
throw new errors.InvalidParameterError("Bad parameter: per_page must be of type Int, received ".concat((0, _utils.getType)(params
|
|
310
|
+
throw new errors.InvalidParameterError("Bad parameter: per_page must be of type Int, received ".concat((0, _utils.getType)(params.per_page)));
|
|
315
311
|
case 6:
|
|
316
312
|
_context4.next = 8;
|
|
317
|
-
return _Api.default.sendRequest(
|
|
313
|
+
return _Api.default.sendRequest('/behaviors', 'GET', params, options);
|
|
318
314
|
case 8:
|
|
319
315
|
response = _context4.sent;
|
|
320
316
|
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) {
|
|
@@ -350,21 +346,21 @@ _class = Behavior;
|
|
|
350
346
|
}
|
|
351
347
|
throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
|
|
352
348
|
case 4:
|
|
353
|
-
params
|
|
354
|
-
if (params
|
|
349
|
+
params.id = id;
|
|
350
|
+
if (params.id) {
|
|
355
351
|
_context5.next = 7;
|
|
356
352
|
break;
|
|
357
353
|
}
|
|
358
354
|
throw new errors.MissingParameterError('Parameter missing: id');
|
|
359
355
|
case 7:
|
|
360
|
-
if (!(params
|
|
356
|
+
if (!(params.id && !(0, _utils.isInt)(params.id))) {
|
|
361
357
|
_context5.next = 9;
|
|
362
358
|
break;
|
|
363
359
|
}
|
|
364
|
-
throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params
|
|
360
|
+
throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params.id)));
|
|
365
361
|
case 9:
|
|
366
362
|
_context5.next = 11;
|
|
367
|
-
return _Api.default.sendRequest("/behaviors/".concat(encodeURIComponent(params
|
|
363
|
+
return _Api.default.sendRequest("/behaviors/".concat(encodeURIComponent(params.id)), 'GET', params, options);
|
|
368
364
|
case 11:
|
|
369
365
|
response = _context5.sent;
|
|
370
366
|
return _context5.abrupt("return", new _class(response === null || response === void 0 ? void 0 : response.data, options));
|
|
@@ -410,45 +406,45 @@ _class = Behavior;
|
|
|
410
406
|
}
|
|
411
407
|
throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
|
|
412
408
|
case 4:
|
|
413
|
-
params
|
|
414
|
-
if (params
|
|
409
|
+
params.path = path;
|
|
410
|
+
if (params.path) {
|
|
415
411
|
_context6.next = 7;
|
|
416
412
|
break;
|
|
417
413
|
}
|
|
418
414
|
throw new errors.MissingParameterError('Parameter missing: path');
|
|
419
415
|
case 7:
|
|
420
|
-
if (!(params
|
|
416
|
+
if (!(params.cursor && !(0, _utils.isString)(params.cursor))) {
|
|
421
417
|
_context6.next = 9;
|
|
422
418
|
break;
|
|
423
419
|
}
|
|
424
|
-
throw new errors.InvalidParameterError("Bad parameter: cursor must be of type String, received ".concat((0, _utils.getType)(params
|
|
420
|
+
throw new errors.InvalidParameterError("Bad parameter: cursor must be of type String, received ".concat((0, _utils.getType)(params.cursor)));
|
|
425
421
|
case 9:
|
|
426
|
-
if (!(params
|
|
422
|
+
if (!(params.per_page && !(0, _utils.isInt)(params.per_page))) {
|
|
427
423
|
_context6.next = 11;
|
|
428
424
|
break;
|
|
429
425
|
}
|
|
430
|
-
throw new errors.InvalidParameterError("Bad parameter: per_page must be of type Int, received ".concat((0, _utils.getType)(params
|
|
426
|
+
throw new errors.InvalidParameterError("Bad parameter: per_page must be of type Int, received ".concat((0, _utils.getType)(params.per_page)));
|
|
431
427
|
case 11:
|
|
432
|
-
if (!(params
|
|
428
|
+
if (!(params.path && !(0, _utils.isString)(params.path))) {
|
|
433
429
|
_context6.next = 13;
|
|
434
430
|
break;
|
|
435
431
|
}
|
|
436
|
-
throw new errors.InvalidParameterError("Bad parameter: path must be of type String, received ".concat((0, _utils.getType)(params
|
|
432
|
+
throw new errors.InvalidParameterError("Bad parameter: path must be of type String, received ".concat((0, _utils.getType)(params.path)));
|
|
437
433
|
case 13:
|
|
438
|
-
if (!(params
|
|
434
|
+
if (!(params.recursive && !(0, _utils.isString)(params.recursive))) {
|
|
439
435
|
_context6.next = 15;
|
|
440
436
|
break;
|
|
441
437
|
}
|
|
442
|
-
throw new errors.InvalidParameterError("Bad parameter: recursive must be of type String, received ".concat((0, _utils.getType)(params
|
|
438
|
+
throw new errors.InvalidParameterError("Bad parameter: recursive must be of type String, received ".concat((0, _utils.getType)(params.recursive)));
|
|
443
439
|
case 15:
|
|
444
|
-
if (!(params
|
|
440
|
+
if (!(params.behavior && !(0, _utils.isString)(params.behavior))) {
|
|
445
441
|
_context6.next = 17;
|
|
446
442
|
break;
|
|
447
443
|
}
|
|
448
|
-
throw new errors.InvalidParameterError("Bad parameter: behavior must be of type String, received ".concat((0, _utils.getType)(params
|
|
444
|
+
throw new errors.InvalidParameterError("Bad parameter: behavior must be of type String, received ".concat((0, _utils.getType)(params.behavior)));
|
|
449
445
|
case 17:
|
|
450
446
|
_context6.next = 19;
|
|
451
|
-
return _Api.default.sendRequest("/behaviors/folders/".concat(encodeURIComponent(params
|
|
447
|
+
return _Api.default.sendRequest("/behaviors/folders/".concat(encodeURIComponent(params.path)), 'GET', params, options);
|
|
452
448
|
case 19:
|
|
453
449
|
response = _context6.sent;
|
|
454
450
|
return _context6.abrupt("return", (response === null || response === void 0 || (_response$data2 = response.data) === null || _response$data2 === void 0 ? void 0 : _response$data2.map(function (obj) {
|
|
@@ -481,50 +477,50 @@ _class = Behavior;
|
|
|
481
477
|
case 0:
|
|
482
478
|
params = _args7.length > 0 && _args7[0] !== undefined ? _args7[0] : {};
|
|
483
479
|
options = _args7.length > 1 && _args7[1] !== undefined ? _args7[1] : {};
|
|
484
|
-
if (params
|
|
480
|
+
if (params.path) {
|
|
485
481
|
_context7.next = 4;
|
|
486
482
|
break;
|
|
487
483
|
}
|
|
488
484
|
throw new errors.MissingParameterError('Parameter missing: path');
|
|
489
485
|
case 4:
|
|
490
|
-
if (params
|
|
486
|
+
if (params.behavior) {
|
|
491
487
|
_context7.next = 6;
|
|
492
488
|
break;
|
|
493
489
|
}
|
|
494
490
|
throw new errors.MissingParameterError('Parameter missing: behavior');
|
|
495
491
|
case 6:
|
|
496
|
-
if (!(params
|
|
492
|
+
if (!(params.value && !(0, _utils.isString)(params.value))) {
|
|
497
493
|
_context7.next = 8;
|
|
498
494
|
break;
|
|
499
495
|
}
|
|
500
|
-
throw new errors.InvalidParameterError("Bad parameter: value must be of type String, received ".concat((0, _utils.getType)(params
|
|
496
|
+
throw new errors.InvalidParameterError("Bad parameter: value must be of type String, received ".concat((0, _utils.getType)(params.value)));
|
|
501
497
|
case 8:
|
|
502
|
-
if (!(params
|
|
498
|
+
if (!(params.name && !(0, _utils.isString)(params.name))) {
|
|
503
499
|
_context7.next = 10;
|
|
504
500
|
break;
|
|
505
501
|
}
|
|
506
|
-
throw new errors.InvalidParameterError("Bad parameter: name must be of type String, received ".concat((0, _utils.getType)(params
|
|
502
|
+
throw new errors.InvalidParameterError("Bad parameter: name must be of type String, received ".concat((0, _utils.getType)(params.name)));
|
|
507
503
|
case 10:
|
|
508
|
-
if (!(params
|
|
504
|
+
if (!(params.description && !(0, _utils.isString)(params.description))) {
|
|
509
505
|
_context7.next = 12;
|
|
510
506
|
break;
|
|
511
507
|
}
|
|
512
|
-
throw new errors.InvalidParameterError("Bad parameter: description must be of type String, received ".concat((0, _utils.getType)(params
|
|
508
|
+
throw new errors.InvalidParameterError("Bad parameter: description must be of type String, received ".concat((0, _utils.getType)(params.description)));
|
|
513
509
|
case 12:
|
|
514
|
-
if (!(params
|
|
510
|
+
if (!(params.path && !(0, _utils.isString)(params.path))) {
|
|
515
511
|
_context7.next = 14;
|
|
516
512
|
break;
|
|
517
513
|
}
|
|
518
|
-
throw new errors.InvalidParameterError("Bad parameter: path must be of type String, received ".concat((0, _utils.getType)(params
|
|
514
|
+
throw new errors.InvalidParameterError("Bad parameter: path must be of type String, received ".concat((0, _utils.getType)(params.path)));
|
|
519
515
|
case 14:
|
|
520
|
-
if (!(params
|
|
516
|
+
if (!(params.behavior && !(0, _utils.isString)(params.behavior))) {
|
|
521
517
|
_context7.next = 16;
|
|
522
518
|
break;
|
|
523
519
|
}
|
|
524
|
-
throw new errors.InvalidParameterError("Bad parameter: behavior must be of type String, received ".concat((0, _utils.getType)(params
|
|
520
|
+
throw new errors.InvalidParameterError("Bad parameter: behavior must be of type String, received ".concat((0, _utils.getType)(params.behavior)));
|
|
525
521
|
case 16:
|
|
526
522
|
_context7.next = 18;
|
|
527
|
-
return _Api.default.sendRequest(
|
|
523
|
+
return _Api.default.sendRequest('/behaviors', 'POST', params, options);
|
|
528
524
|
case 18:
|
|
529
525
|
response = _context7.sent;
|
|
530
526
|
return _context7.abrupt("return", new _class(response === null || response === void 0 ? void 0 : response.data, options));
|
|
@@ -544,49 +540,45 @@ _class = Behavior;
|
|
|
544
540
|
(0, _defineProperty2.default)(Behavior, "webhookTest", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee8() {
|
|
545
541
|
var params,
|
|
546
542
|
options,
|
|
547
|
-
response,
|
|
548
543
|
_args8 = arguments;
|
|
549
544
|
return _regenerator.default.wrap(function _callee8$(_context8) {
|
|
550
545
|
while (1) switch (_context8.prev = _context8.next) {
|
|
551
546
|
case 0:
|
|
552
547
|
params = _args8.length > 0 && _args8[0] !== undefined ? _args8[0] : {};
|
|
553
548
|
options = _args8.length > 1 && _args8[1] !== undefined ? _args8[1] : {};
|
|
554
|
-
if (params
|
|
549
|
+
if (params.url) {
|
|
555
550
|
_context8.next = 4;
|
|
556
551
|
break;
|
|
557
552
|
}
|
|
558
553
|
throw new errors.MissingParameterError('Parameter missing: url');
|
|
559
554
|
case 4:
|
|
560
|
-
if (!(params
|
|
555
|
+
if (!(params.url && !(0, _utils.isString)(params.url))) {
|
|
561
556
|
_context8.next = 6;
|
|
562
557
|
break;
|
|
563
558
|
}
|
|
564
|
-
throw new errors.InvalidParameterError("Bad parameter: url must be of type String, received ".concat((0, _utils.getType)(params
|
|
559
|
+
throw new errors.InvalidParameterError("Bad parameter: url must be of type String, received ".concat((0, _utils.getType)(params.url)));
|
|
565
560
|
case 6:
|
|
566
|
-
if (!(params
|
|
561
|
+
if (!(params.method && !(0, _utils.isString)(params.method))) {
|
|
567
562
|
_context8.next = 8;
|
|
568
563
|
break;
|
|
569
564
|
}
|
|
570
|
-
throw new errors.InvalidParameterError("Bad parameter: method must be of type String, received ".concat((0, _utils.getType)(params
|
|
565
|
+
throw new errors.InvalidParameterError("Bad parameter: method must be of type String, received ".concat((0, _utils.getType)(params.method)));
|
|
571
566
|
case 8:
|
|
572
|
-
if (!(params
|
|
567
|
+
if (!(params.encoding && !(0, _utils.isString)(params.encoding))) {
|
|
573
568
|
_context8.next = 10;
|
|
574
569
|
break;
|
|
575
570
|
}
|
|
576
|
-
throw new errors.InvalidParameterError("Bad parameter: encoding must be of type String, received ".concat((0, _utils.getType)(params
|
|
571
|
+
throw new errors.InvalidParameterError("Bad parameter: encoding must be of type String, received ".concat((0, _utils.getType)(params.encoding)));
|
|
577
572
|
case 10:
|
|
578
|
-
if (!(params
|
|
573
|
+
if (!(params.action && !(0, _utils.isString)(params.action))) {
|
|
579
574
|
_context8.next = 12;
|
|
580
575
|
break;
|
|
581
576
|
}
|
|
582
|
-
throw new errors.InvalidParameterError("Bad parameter: action must be of type String, received ".concat((0, _utils.getType)(params
|
|
577
|
+
throw new errors.InvalidParameterError("Bad parameter: action must be of type String, received ".concat((0, _utils.getType)(params.action)));
|
|
583
578
|
case 12:
|
|
584
579
|
_context8.next = 14;
|
|
585
|
-
return _Api.default.sendRequest(
|
|
580
|
+
return _Api.default.sendRequest('/behaviors/webhook/test', 'POST', params, options);
|
|
586
581
|
case 14:
|
|
587
|
-
response = _context8.sent;
|
|
588
|
-
return _context8.abrupt("return");
|
|
589
|
-
case 16:
|
|
590
582
|
case "end":
|
|
591
583
|
return _context8.stop();
|
|
592
584
|
}
|