files.com 1.0.236 → 1.0.238
Sign up to get free protection for your applications and to get access to all the features.
- package/_VERSION +1 -1
- package/docs/Errors.md +1 -0
- package/docs/models/BundleNotification.md +35 -0
- package/lib/Api.js +153 -159
- package/lib/Errors.js +680 -666
- package/lib/isomorphic/File.node.js +24 -28
- package/lib/models/ActionNotificationExport.js +97 -101
- package/lib/models/ActionNotificationExportResult.js +44 -46
- package/lib/models/ActionWebhookFailure.js +42 -44
- package/lib/models/ApiKey.js +271 -287
- package/lib/models/App.js +26 -28
- package/lib/models/As2IncomingMessage.js +32 -34
- package/lib/models/As2OutgoingMessage.js +32 -34
- package/lib/models/As2Partner.js +231 -241
- package/lib/models/As2Station.js +219 -229
- package/lib/models/Automation.js +333 -343
- package/lib/models/AutomationRun.js +75 -79
- package/lib/models/BandwidthSnapshot.js +26 -28
- package/lib/models/Behavior.js +323 -337
- package/lib/models/Bundle.js +375 -387
- package/lib/models/BundleDownload.js +38 -40
- package/lib/models/BundleNotification.js +223 -173
- package/lib/models/BundleRecipient.js +104 -108
- package/lib/models/BundleRegistration.js +38 -40
- package/lib/models/Clickwrap.js +213 -223
- package/lib/models/DnsRecord.js +26 -28
- package/lib/models/ExternalEvent.js +93 -99
- package/lib/models/File.js +726 -766
- package/lib/models/FileComment.js +180 -188
- package/lib/models/FileCommentReaction.js +84 -88
- package/lib/models/FileMigration.js +31 -33
- package/lib/models/Folder.js +94 -98
- package/lib/models/FormFieldSet.js +189 -199
- package/lib/models/Group.js +207 -217
- package/lib/models/GroupUser.js +230 -238
- package/lib/models/History.js +266 -276
- package/lib/models/HistoryExport.js +175 -179
- package/lib/models/HistoryExportResult.js +44 -46
- package/lib/models/InboxRecipient.js +104 -108
- package/lib/models/InboxRegistration.js +32 -34
- package/lib/models/InboxUpload.js +38 -40
- package/lib/models/Invoice.js +57 -61
- package/lib/models/IpAddress.js +78 -84
- package/lib/models/Lock.js +148 -154
- package/lib/models/Message.js +267 -277
- package/lib/models/MessageComment.js +207 -217
- package/lib/models/MessageCommentReaction.js +147 -155
- package/lib/models/MessageReaction.js +147 -155
- package/lib/models/Notification.js +255 -265
- package/lib/models/Payment.js +57 -61
- package/lib/models/Permission.js +128 -134
- package/lib/models/Priority.js +45 -47
- package/lib/models/Project.js +183 -193
- package/lib/models/PublicKey.js +207 -217
- package/lib/models/RemoteBandwidthSnapshot.js +26 -28
- package/lib/models/RemoteServer.js +805 -819
- package/lib/models/Request.js +166 -174
- package/lib/models/Session.js +47 -51
- package/lib/models/SettingsChange.js +26 -28
- package/lib/models/SftpHostKey.js +177 -187
- package/lib/models/Site.js +412 -418
- package/lib/models/SsoStrategy.js +99 -105
- package/lib/models/Style.js +127 -133
- package/lib/models/UsageDailySnapshot.js +26 -28
- package/lib/models/UsageSnapshot.js +26 -28
- package/lib/models/User.js +587 -603
- package/lib/models/UserCipherUse.js +32 -34
- package/lib/models/UserRequest.js +147 -155
- package/lib/models/WebhookTest.js +54 -56
- package/package.json +1 -1
- package/src/Errors.js +1 -0
- package/src/models/BundleNotification.js +39 -1
package/lib/models/Behavior.js
CHANGED
@@ -90,82 +90,80 @@ var Behavior = /*#__PURE__*/(0, _createClass2.default)(function Behavior() {
|
|
90
90
|
response,
|
91
91
|
_args = arguments;
|
92
92
|
return _regenerator.default.wrap(function _callee$(_context) {
|
93
|
-
while (1) {
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
if (params['id']) {
|
147
|
-
_context.next = 24;
|
148
|
-
break;
|
149
|
-
}
|
150
|
-
if (!_this.attributes.id) {
|
151
|
-
_context.next = 23;
|
152
|
-
break;
|
153
|
-
}
|
154
|
-
params['id'] = _this.id;
|
93
|
+
while (1) switch (_context.prev = _context.next) {
|
94
|
+
case 0:
|
95
|
+
params = _args.length > 0 && _args[0] !== undefined ? _args[0] : {};
|
96
|
+
if (_this.attributes.id) {
|
97
|
+
_context.next = 3;
|
98
|
+
break;
|
99
|
+
}
|
100
|
+
throw new errors.EmptyPropertyError('Current object has no id');
|
101
|
+
case 3:
|
102
|
+
if ((0, _utils.isObject)(params)) {
|
103
|
+
_context.next = 5;
|
104
|
+
break;
|
105
|
+
}
|
106
|
+
throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
|
107
|
+
case 5:
|
108
|
+
params.id = _this.attributes.id;
|
109
|
+
if (!(params['id'] && !(0, _utils.isInt)(params['id']))) {
|
110
|
+
_context.next = 8;
|
111
|
+
break;
|
112
|
+
}
|
113
|
+
throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(id)));
|
114
|
+
case 8:
|
115
|
+
if (!(params['value'] && !(0, _utils.isString)(params['value']))) {
|
116
|
+
_context.next = 10;
|
117
|
+
break;
|
118
|
+
}
|
119
|
+
throw new errors.InvalidParameterError("Bad parameter: value must be of type String, received ".concat((0, _utils.getType)(value)));
|
120
|
+
case 10:
|
121
|
+
if (!(params['name'] && !(0, _utils.isString)(params['name']))) {
|
122
|
+
_context.next = 12;
|
123
|
+
break;
|
124
|
+
}
|
125
|
+
throw new errors.InvalidParameterError("Bad parameter: name must be of type String, received ".concat((0, _utils.getType)(name)));
|
126
|
+
case 12:
|
127
|
+
if (!(params['description'] && !(0, _utils.isString)(params['description']))) {
|
128
|
+
_context.next = 14;
|
129
|
+
break;
|
130
|
+
}
|
131
|
+
throw new errors.InvalidParameterError("Bad parameter: description must be of type String, received ".concat((0, _utils.getType)(description)));
|
132
|
+
case 14:
|
133
|
+
if (!(params['behavior'] && !(0, _utils.isString)(params['behavior']))) {
|
134
|
+
_context.next = 16;
|
135
|
+
break;
|
136
|
+
}
|
137
|
+
throw new errors.InvalidParameterError("Bad parameter: behavior must be of type String, received ".concat((0, _utils.getType)(behavior)));
|
138
|
+
case 16:
|
139
|
+
if (!(params['path'] && !(0, _utils.isString)(params['path']))) {
|
140
|
+
_context.next = 18;
|
141
|
+
break;
|
142
|
+
}
|
143
|
+
throw new errors.InvalidParameterError("Bad parameter: path must be of type String, received ".concat((0, _utils.getType)(path)));
|
144
|
+
case 18:
|
145
|
+
if (params['id']) {
|
155
146
|
_context.next = 24;
|
156
147
|
break;
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
148
|
+
}
|
149
|
+
if (!_this.attributes.id) {
|
150
|
+
_context.next = 23;
|
151
|
+
break;
|
152
|
+
}
|
153
|
+
params['id'] = _this.id;
|
154
|
+
_context.next = 24;
|
155
|
+
break;
|
156
|
+
case 23:
|
157
|
+
throw new errors.MissingParameterError('Parameter missing: id');
|
158
|
+
case 24:
|
159
|
+
_context.next = 26;
|
160
|
+
return _Api.default.sendRequest("/behaviors/".concat(encodeURIComponent(params['id'])), 'PATCH', params, _this.options);
|
161
|
+
case 26:
|
162
|
+
response = _context.sent;
|
163
|
+
return _context.abrupt("return", new Behavior(response === null || response === void 0 ? void 0 : response.data, _this.options));
|
164
|
+
case 28:
|
165
|
+
case "end":
|
166
|
+
return _context.stop();
|
169
167
|
}
|
170
168
|
}, _callee);
|
171
169
|
})));
|
@@ -174,52 +172,50 @@ var Behavior = /*#__PURE__*/(0, _createClass2.default)(function Behavior() {
|
|
174
172
|
response,
|
175
173
|
_args2 = arguments;
|
176
174
|
return _regenerator.default.wrap(function _callee2$(_context2) {
|
177
|
-
while (1) {
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
if (params['id']) {
|
201
|
-
_context2.next = 14;
|
202
|
-
break;
|
203
|
-
}
|
204
|
-
if (!_this.attributes.id) {
|
205
|
-
_context2.next = 13;
|
206
|
-
break;
|
207
|
-
}
|
208
|
-
params['id'] = _this.id;
|
175
|
+
while (1) switch (_context2.prev = _context2.next) {
|
176
|
+
case 0:
|
177
|
+
params = _args2.length > 0 && _args2[0] !== undefined ? _args2[0] : {};
|
178
|
+
if (_this.attributes.id) {
|
179
|
+
_context2.next = 3;
|
180
|
+
break;
|
181
|
+
}
|
182
|
+
throw new errors.EmptyPropertyError('Current object has no id');
|
183
|
+
case 3:
|
184
|
+
if ((0, _utils.isObject)(params)) {
|
185
|
+
_context2.next = 5;
|
186
|
+
break;
|
187
|
+
}
|
188
|
+
throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
|
189
|
+
case 5:
|
190
|
+
params.id = _this.attributes.id;
|
191
|
+
if (!(params['id'] && !(0, _utils.isInt)(params['id']))) {
|
192
|
+
_context2.next = 8;
|
193
|
+
break;
|
194
|
+
}
|
195
|
+
throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(id)));
|
196
|
+
case 8:
|
197
|
+
if (params['id']) {
|
209
198
|
_context2.next = 14;
|
210
199
|
break;
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
200
|
+
}
|
201
|
+
if (!_this.attributes.id) {
|
202
|
+
_context2.next = 13;
|
203
|
+
break;
|
204
|
+
}
|
205
|
+
params['id'] = _this.id;
|
206
|
+
_context2.next = 14;
|
207
|
+
break;
|
208
|
+
case 13:
|
209
|
+
throw new errors.MissingParameterError('Parameter missing: id');
|
210
|
+
case 14:
|
211
|
+
_context2.next = 16;
|
212
|
+
return _Api.default.sendRequest("/behaviors/".concat(encodeURIComponent(params['id'])), 'DELETE', params, _this.options);
|
213
|
+
case 16:
|
214
|
+
response = _context2.sent;
|
215
|
+
return _context2.abrupt("return", response === null || response === void 0 ? void 0 : response.data);
|
216
|
+
case 18:
|
217
|
+
case "end":
|
218
|
+
return _context2.stop();
|
223
219
|
}
|
224
220
|
}, _callee2);
|
225
221
|
})));
|
@@ -256,40 +252,38 @@ var Behavior = /*#__PURE__*/(0, _createClass2.default)(function Behavior() {
|
|
256
252
|
response,
|
257
253
|
_args3 = arguments;
|
258
254
|
return _regenerator.default.wrap(function _callee3$(_context3) {
|
259
|
-
while (1) {
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
return
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
return _context3.stop();
|
292
|
-
}
|
255
|
+
while (1) switch (_context3.prev = _context3.next) {
|
256
|
+
case 0:
|
257
|
+
params = _args3.length > 0 && _args3[0] !== undefined ? _args3[0] : {};
|
258
|
+
options = _args3.length > 1 && _args3[1] !== undefined ? _args3[1] : {};
|
259
|
+
if (!(params['cursor'] && !(0, _utils.isString)(params['cursor']))) {
|
260
|
+
_context3.next = 4;
|
261
|
+
break;
|
262
|
+
}
|
263
|
+
throw new errors.InvalidParameterError("Bad parameter: cursor must be of type String, received ".concat((0, _utils.getType)(params['cursor'])));
|
264
|
+
case 4:
|
265
|
+
if (!(params['per_page'] && !(0, _utils.isInt)(params['per_page']))) {
|
266
|
+
_context3.next = 6;
|
267
|
+
break;
|
268
|
+
}
|
269
|
+
throw new errors.InvalidParameterError("Bad parameter: per_page must be of type Int, received ".concat((0, _utils.getType)(params['per_page'])));
|
270
|
+
case 6:
|
271
|
+
if (!(params['behavior'] && !(0, _utils.isString)(params['behavior']))) {
|
272
|
+
_context3.next = 8;
|
273
|
+
break;
|
274
|
+
}
|
275
|
+
throw new errors.InvalidParameterError("Bad parameter: behavior must be of type String, received ".concat((0, _utils.getType)(params['behavior'])));
|
276
|
+
case 8:
|
277
|
+
_context3.next = 10;
|
278
|
+
return _Api.default.sendRequest("/behaviors", 'GET', params, options);
|
279
|
+
case 10:
|
280
|
+
response = _context3.sent;
|
281
|
+
return _context3.abrupt("return", (response === null || response === void 0 ? void 0 : (_response$data = response.data) === null || _response$data === void 0 ? void 0 : _response$data.map(function (obj) {
|
282
|
+
return new Behavior(obj, options);
|
283
|
+
})) || []);
|
284
|
+
case 12:
|
285
|
+
case "end":
|
286
|
+
return _context3.stop();
|
293
287
|
}
|
294
288
|
}, _callee3);
|
295
289
|
})));
|
@@ -305,39 +299,37 @@ var Behavior = /*#__PURE__*/(0, _createClass2.default)(function Behavior() {
|
|
305
299
|
response,
|
306
300
|
_args4 = arguments;
|
307
301
|
return _regenerator.default.wrap(function _callee4$(_context4) {
|
308
|
-
while (1) {
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
return _context4.stop();
|
340
|
-
}
|
302
|
+
while (1) switch (_context4.prev = _context4.next) {
|
303
|
+
case 0:
|
304
|
+
params = _args4.length > 1 && _args4[1] !== undefined ? _args4[1] : {};
|
305
|
+
options = _args4.length > 2 && _args4[2] !== undefined ? _args4[2] : {};
|
306
|
+
if ((0, _utils.isObject)(params)) {
|
307
|
+
_context4.next = 4;
|
308
|
+
break;
|
309
|
+
}
|
310
|
+
throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
|
311
|
+
case 4:
|
312
|
+
params['id'] = id;
|
313
|
+
if (params['id']) {
|
314
|
+
_context4.next = 7;
|
315
|
+
break;
|
316
|
+
}
|
317
|
+
throw new errors.MissingParameterError('Parameter missing: id');
|
318
|
+
case 7:
|
319
|
+
if (!(params['id'] && !(0, _utils.isInt)(params['id']))) {
|
320
|
+
_context4.next = 9;
|
321
|
+
break;
|
322
|
+
}
|
323
|
+
throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params['id'])));
|
324
|
+
case 9:
|
325
|
+
_context4.next = 11;
|
326
|
+
return _Api.default.sendRequest("/behaviors/".concat(encodeURIComponent(params['id'])), 'GET', params, options);
|
327
|
+
case 11:
|
328
|
+
response = _context4.sent;
|
329
|
+
return _context4.abrupt("return", new Behavior(response === null || response === void 0 ? void 0 : response.data, options));
|
330
|
+
case 13:
|
331
|
+
case "end":
|
332
|
+
return _context4.stop();
|
341
333
|
}
|
342
334
|
}, _callee4);
|
343
335
|
}));
|
@@ -358,134 +350,130 @@ var Behavior = /*#__PURE__*/(0, _createClass2.default)(function Behavior() {
|
|
358
350
|
response,
|
359
351
|
_args5 = arguments;
|
360
352
|
return _regenerator.default.wrap(function _callee5$(_context5) {
|
361
|
-
while (1) {
|
362
|
-
switch (_context5.prev = _context5.next) {
|
363
|
-
case 0:
|
364
|
-
params = _args5.length > 1 && _args5[1] !== undefined ? _args5[1] : {};
|
365
|
-
options = _args5.length > 2 && _args5[2] !== undefined ? _args5[2] : {};
|
366
|
-
if ((0, _utils.isObject)(params)) {
|
367
|
-
_context5.next = 4;
|
368
|
-
break;
|
369
|
-
}
|
370
|
-
throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
|
371
|
-
case 4:
|
372
|
-
params['path'] = path;
|
373
|
-
if (params['path']) {
|
374
|
-
_context5.next = 7;
|
375
|
-
break;
|
376
|
-
}
|
377
|
-
throw new errors.MissingParameterError('Parameter missing: path');
|
378
|
-
case 7:
|
379
|
-
if (!(params['cursor'] && !(0, _utils.isString)(params['cursor']))) {
|
380
|
-
_context5.next = 9;
|
381
|
-
break;
|
382
|
-
}
|
383
|
-
throw new errors.InvalidParameterError("Bad parameter: cursor must be of type String, received ".concat((0, _utils.getType)(params['cursor'])));
|
384
|
-
case 9:
|
385
|
-
if (!(params['per_page'] && !(0, _utils.isInt)(params['per_page']))) {
|
386
|
-
_context5.next = 11;
|
387
|
-
break;
|
388
|
-
}
|
389
|
-
throw new errors.InvalidParameterError("Bad parameter: per_page must be of type Int, received ".concat((0, _utils.getType)(params['per_page'])));
|
390
|
-
case 11:
|
391
|
-
if (!(params['path'] && !(0, _utils.isString)(params['path']))) {
|
392
|
-
_context5.next = 13;
|
393
|
-
break;
|
394
|
-
}
|
395
|
-
throw new errors.InvalidParameterError("Bad parameter: path must be of type String, received ".concat((0, _utils.getType)(params['path'])));
|
396
|
-
case 13:
|
397
|
-
if (!(params['recursive'] && !(0, _utils.isString)(params['recursive']))) {
|
398
|
-
_context5.next = 15;
|
399
|
-
break;
|
400
|
-
}
|
401
|
-
throw new errors.InvalidParameterError("Bad parameter: recursive must be of type String, received ".concat((0, _utils.getType)(params['recursive'])));
|
402
|
-
case 15:
|
403
|
-
if (!(params['behavior'] && !(0, _utils.isString)(params['behavior']))) {
|
404
|
-
_context5.next = 17;
|
405
|
-
break;
|
406
|
-
}
|
407
|
-
throw new errors.InvalidParameterError("Bad parameter: behavior must be of type String, received ".concat((0, _utils.getType)(params['behavior'])));
|
408
|
-
case 17:
|
409
|
-
_context5.next = 19;
|
410
|
-
return _Api.default.sendRequest("/behaviors/folders/".concat(encodeURIComponent(params['path'])), 'GET', params, options);
|
411
|
-
case 19:
|
412
|
-
response = _context5.sent;
|
413
|
-
return _context5.abrupt("return", (response === null || response === void 0 ? void 0 : (_response$data2 = response.data) === null || _response$data2 === void 0 ? void 0 : _response$data2.map(function (obj) {
|
414
|
-
return new Behavior(obj, options);
|
415
|
-
})) || []);
|
416
|
-
case 21:
|
417
|
-
case "end":
|
418
|
-
return _context5.stop();
|
419
|
-
}
|
420
|
-
}
|
421
|
-
}, _callee5);
|
422
|
-
}));
|
423
|
-
return function (_x2) {
|
424
|
-
return _ref7.apply(this, arguments);
|
425
|
-
};
|
426
|
-
}());
|
427
|
-
(0, _defineProperty2.default)(Behavior, "create", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6() {
|
428
|
-
var params,
|
429
|
-
options,
|
430
|
-
response,
|
431
|
-
_args6 = arguments;
|
432
|
-
return _regenerator.default.wrap(function _callee6$(_context6) {
|
433
|
-
while (1) {
|
434
|
-
switch (_context6.prev = _context6.next) {
|
353
|
+
while (1) switch (_context5.prev = _context5.next) {
|
435
354
|
case 0:
|
436
|
-
params =
|
437
|
-
options =
|
438
|
-
if (params
|
439
|
-
|
355
|
+
params = _args5.length > 1 && _args5[1] !== undefined ? _args5[1] : {};
|
356
|
+
options = _args5.length > 2 && _args5[2] !== undefined ? _args5[2] : {};
|
357
|
+
if ((0, _utils.isObject)(params)) {
|
358
|
+
_context5.next = 4;
|
440
359
|
break;
|
441
360
|
}
|
442
|
-
throw new errors.
|
361
|
+
throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
|
443
362
|
case 4:
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
}
|
448
|
-
throw new errors.MissingParameterError('Parameter missing: behavior');
|
449
|
-
case 6:
|
450
|
-
if (!(params['value'] && !(0, _utils.isString)(params['value']))) {
|
451
|
-
_context6.next = 8;
|
363
|
+
params['path'] = path;
|
364
|
+
if (params['path']) {
|
365
|
+
_context5.next = 7;
|
452
366
|
break;
|
453
367
|
}
|
454
|
-
throw new errors.
|
455
|
-
case
|
456
|
-
if (!(params['
|
457
|
-
|
368
|
+
throw new errors.MissingParameterError('Parameter missing: path');
|
369
|
+
case 7:
|
370
|
+
if (!(params['cursor'] && !(0, _utils.isString)(params['cursor']))) {
|
371
|
+
_context5.next = 9;
|
458
372
|
break;
|
459
373
|
}
|
460
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
461
|
-
case
|
462
|
-
if (!(params['
|
463
|
-
|
374
|
+
throw new errors.InvalidParameterError("Bad parameter: cursor must be of type String, received ".concat((0, _utils.getType)(params['cursor'])));
|
375
|
+
case 9:
|
376
|
+
if (!(params['per_page'] && !(0, _utils.isInt)(params['per_page']))) {
|
377
|
+
_context5.next = 11;
|
464
378
|
break;
|
465
379
|
}
|
466
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
467
|
-
case
|
380
|
+
throw new errors.InvalidParameterError("Bad parameter: per_page must be of type Int, received ".concat((0, _utils.getType)(params['per_page'])));
|
381
|
+
case 11:
|
468
382
|
if (!(params['path'] && !(0, _utils.isString)(params['path']))) {
|
469
|
-
|
383
|
+
_context5.next = 13;
|
470
384
|
break;
|
471
385
|
}
|
472
386
|
throw new errors.InvalidParameterError("Bad parameter: path must be of type String, received ".concat((0, _utils.getType)(params['path'])));
|
473
|
-
case
|
387
|
+
case 13:
|
388
|
+
if (!(params['recursive'] && !(0, _utils.isString)(params['recursive']))) {
|
389
|
+
_context5.next = 15;
|
390
|
+
break;
|
391
|
+
}
|
392
|
+
throw new errors.InvalidParameterError("Bad parameter: recursive must be of type String, received ".concat((0, _utils.getType)(params['recursive'])));
|
393
|
+
case 15:
|
474
394
|
if (!(params['behavior'] && !(0, _utils.isString)(params['behavior']))) {
|
475
|
-
|
395
|
+
_context5.next = 17;
|
476
396
|
break;
|
477
397
|
}
|
478
398
|
throw new errors.InvalidParameterError("Bad parameter: behavior must be of type String, received ".concat((0, _utils.getType)(params['behavior'])));
|
479
|
-
case
|
480
|
-
|
481
|
-
return _Api.default.sendRequest("/behaviors", '
|
482
|
-
case
|
483
|
-
response =
|
484
|
-
return
|
485
|
-
|
399
|
+
case 17:
|
400
|
+
_context5.next = 19;
|
401
|
+
return _Api.default.sendRequest("/behaviors/folders/".concat(encodeURIComponent(params['path'])), 'GET', params, options);
|
402
|
+
case 19:
|
403
|
+
response = _context5.sent;
|
404
|
+
return _context5.abrupt("return", (response === null || response === void 0 ? void 0 : (_response$data2 = response.data) === null || _response$data2 === void 0 ? void 0 : _response$data2.map(function (obj) {
|
405
|
+
return new Behavior(obj, options);
|
406
|
+
})) || []);
|
407
|
+
case 21:
|
486
408
|
case "end":
|
487
|
-
return
|
409
|
+
return _context5.stop();
|
488
410
|
}
|
411
|
+
}, _callee5);
|
412
|
+
}));
|
413
|
+
return function (_x2) {
|
414
|
+
return _ref7.apply(this, arguments);
|
415
|
+
};
|
416
|
+
}());
|
417
|
+
(0, _defineProperty2.default)(Behavior, "create", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6() {
|
418
|
+
var params,
|
419
|
+
options,
|
420
|
+
response,
|
421
|
+
_args6 = arguments;
|
422
|
+
return _regenerator.default.wrap(function _callee6$(_context6) {
|
423
|
+
while (1) switch (_context6.prev = _context6.next) {
|
424
|
+
case 0:
|
425
|
+
params = _args6.length > 0 && _args6[0] !== undefined ? _args6[0] : {};
|
426
|
+
options = _args6.length > 1 && _args6[1] !== undefined ? _args6[1] : {};
|
427
|
+
if (params['path']) {
|
428
|
+
_context6.next = 4;
|
429
|
+
break;
|
430
|
+
}
|
431
|
+
throw new errors.MissingParameterError('Parameter missing: path');
|
432
|
+
case 4:
|
433
|
+
if (params['behavior']) {
|
434
|
+
_context6.next = 6;
|
435
|
+
break;
|
436
|
+
}
|
437
|
+
throw new errors.MissingParameterError('Parameter missing: behavior');
|
438
|
+
case 6:
|
439
|
+
if (!(params['value'] && !(0, _utils.isString)(params['value']))) {
|
440
|
+
_context6.next = 8;
|
441
|
+
break;
|
442
|
+
}
|
443
|
+
throw new errors.InvalidParameterError("Bad parameter: value must be of type String, received ".concat((0, _utils.getType)(params['value'])));
|
444
|
+
case 8:
|
445
|
+
if (!(params['name'] && !(0, _utils.isString)(params['name']))) {
|
446
|
+
_context6.next = 10;
|
447
|
+
break;
|
448
|
+
}
|
449
|
+
throw new errors.InvalidParameterError("Bad parameter: name must be of type String, received ".concat((0, _utils.getType)(params['name'])));
|
450
|
+
case 10:
|
451
|
+
if (!(params['description'] && !(0, _utils.isString)(params['description']))) {
|
452
|
+
_context6.next = 12;
|
453
|
+
break;
|
454
|
+
}
|
455
|
+
throw new errors.InvalidParameterError("Bad parameter: description must be of type String, received ".concat((0, _utils.getType)(params['description'])));
|
456
|
+
case 12:
|
457
|
+
if (!(params['path'] && !(0, _utils.isString)(params['path']))) {
|
458
|
+
_context6.next = 14;
|
459
|
+
break;
|
460
|
+
}
|
461
|
+
throw new errors.InvalidParameterError("Bad parameter: path must be of type String, received ".concat((0, _utils.getType)(params['path'])));
|
462
|
+
case 14:
|
463
|
+
if (!(params['behavior'] && !(0, _utils.isString)(params['behavior']))) {
|
464
|
+
_context6.next = 16;
|
465
|
+
break;
|
466
|
+
}
|
467
|
+
throw new errors.InvalidParameterError("Bad parameter: behavior must be of type String, received ".concat((0, _utils.getType)(params['behavior'])));
|
468
|
+
case 16:
|
469
|
+
_context6.next = 18;
|
470
|
+
return _Api.default.sendRequest("/behaviors", 'POST', params, options);
|
471
|
+
case 18:
|
472
|
+
response = _context6.sent;
|
473
|
+
return _context6.abrupt("return", new Behavior(response === null || response === void 0 ? void 0 : response.data, options));
|
474
|
+
case 20:
|
475
|
+
case "end":
|
476
|
+
return _context6.stop();
|
489
477
|
}
|
490
478
|
}, _callee6);
|
491
479
|
})));
|
@@ -495,50 +483,48 @@ var Behavior = /*#__PURE__*/(0, _createClass2.default)(function Behavior() {
|
|
495
483
|
response,
|
496
484
|
_args7 = arguments;
|
497
485
|
return _regenerator.default.wrap(function _callee7$(_context7) {
|
498
|
-
while (1) {
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
|
520
|
-
|
521
|
-
|
522
|
-
|
523
|
-
|
524
|
-
|
525
|
-
|
526
|
-
|
527
|
-
|
528
|
-
|
529
|
-
|
530
|
-
|
531
|
-
|
532
|
-
|
533
|
-
|
534
|
-
|
535
|
-
|
536
|
-
|
537
|
-
|
538
|
-
|
539
|
-
|
540
|
-
return _context7.stop();
|
541
|
-
}
|
486
|
+
while (1) switch (_context7.prev = _context7.next) {
|
487
|
+
case 0:
|
488
|
+
params = _args7.length > 0 && _args7[0] !== undefined ? _args7[0] : {};
|
489
|
+
options = _args7.length > 1 && _args7[1] !== undefined ? _args7[1] : {};
|
490
|
+
if (params['url']) {
|
491
|
+
_context7.next = 4;
|
492
|
+
break;
|
493
|
+
}
|
494
|
+
throw new errors.MissingParameterError('Parameter missing: url');
|
495
|
+
case 4:
|
496
|
+
if (!(params['url'] && !(0, _utils.isString)(params['url']))) {
|
497
|
+
_context7.next = 6;
|
498
|
+
break;
|
499
|
+
}
|
500
|
+
throw new errors.InvalidParameterError("Bad parameter: url must be of type String, received ".concat((0, _utils.getType)(params['url'])));
|
501
|
+
case 6:
|
502
|
+
if (!(params['method'] && !(0, _utils.isString)(params['method']))) {
|
503
|
+
_context7.next = 8;
|
504
|
+
break;
|
505
|
+
}
|
506
|
+
throw new errors.InvalidParameterError("Bad parameter: method must be of type String, received ".concat((0, _utils.getType)(params['method'])));
|
507
|
+
case 8:
|
508
|
+
if (!(params['encoding'] && !(0, _utils.isString)(params['encoding']))) {
|
509
|
+
_context7.next = 10;
|
510
|
+
break;
|
511
|
+
}
|
512
|
+
throw new errors.InvalidParameterError("Bad parameter: encoding must be of type String, received ".concat((0, _utils.getType)(params['encoding'])));
|
513
|
+
case 10:
|
514
|
+
if (!(params['action'] && !(0, _utils.isString)(params['action']))) {
|
515
|
+
_context7.next = 12;
|
516
|
+
break;
|
517
|
+
}
|
518
|
+
throw new errors.InvalidParameterError("Bad parameter: action must be of type String, received ".concat((0, _utils.getType)(params['action'])));
|
519
|
+
case 12:
|
520
|
+
_context7.next = 14;
|
521
|
+
return _Api.default.sendRequest("/behaviors/webhook/test", 'POST', params, options);
|
522
|
+
case 14:
|
523
|
+
response = _context7.sent;
|
524
|
+
return _context7.abrupt("return", response === null || response === void 0 ? void 0 : response.data);
|
525
|
+
case 16:
|
526
|
+
case "end":
|
527
|
+
return _context7.stop();
|
542
528
|
}
|
543
529
|
}, _callee7);
|
544
530
|
})));
|