files.com 1.0.235 → 1.0.237

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. package/_VERSION +1 -1
  2. package/docs/models/Bundle.md +9 -2
  3. package/docs/models/BundleNotification.md +35 -0
  4. package/docs/models/BundleRegistration.md +3 -1
  5. package/docs/models/InboxRegistration.md +3 -1
  6. package/docs/models/Site.md +2 -0
  7. package/lib/Api.js +153 -159
  8. package/lib/isomorphic/File.node.js +24 -28
  9. package/lib/models/ActionNotificationExport.js +97 -101
  10. package/lib/models/ActionNotificationExportResult.js +44 -46
  11. package/lib/models/ActionWebhookFailure.js +42 -44
  12. package/lib/models/ApiKey.js +271 -287
  13. package/lib/models/App.js +26 -28
  14. package/lib/models/As2IncomingMessage.js +32 -34
  15. package/lib/models/As2OutgoingMessage.js +32 -34
  16. package/lib/models/As2Partner.js +231 -241
  17. package/lib/models/As2Station.js +219 -229
  18. package/lib/models/Automation.js +333 -343
  19. package/lib/models/AutomationRun.js +75 -79
  20. package/lib/models/BandwidthSnapshot.js +26 -28
  21. package/lib/models/Behavior.js +323 -337
  22. package/lib/models/Bundle.js +381 -387
  23. package/lib/models/BundleDownload.js +38 -40
  24. package/lib/models/BundleNotification.js +223 -173
  25. package/lib/models/BundleRecipient.js +104 -108
  26. package/lib/models/BundleRegistration.js +41 -40
  27. package/lib/models/Clickwrap.js +213 -223
  28. package/lib/models/DnsRecord.js +26 -28
  29. package/lib/models/ExternalEvent.js +93 -99
  30. package/lib/models/File.js +726 -766
  31. package/lib/models/FileComment.js +180 -188
  32. package/lib/models/FileCommentReaction.js +84 -88
  33. package/lib/models/FileMigration.js +31 -33
  34. package/lib/models/Folder.js +94 -98
  35. package/lib/models/FormFieldSet.js +189 -199
  36. package/lib/models/Group.js +207 -217
  37. package/lib/models/GroupUser.js +230 -238
  38. package/lib/models/History.js +266 -276
  39. package/lib/models/HistoryExport.js +175 -179
  40. package/lib/models/HistoryExportResult.js +44 -46
  41. package/lib/models/InboxRecipient.js +104 -108
  42. package/lib/models/InboxRegistration.js +35 -34
  43. package/lib/models/InboxUpload.js +38 -40
  44. package/lib/models/Invoice.js +57 -61
  45. package/lib/models/IpAddress.js +78 -84
  46. package/lib/models/Lock.js +148 -154
  47. package/lib/models/Message.js +267 -277
  48. package/lib/models/MessageComment.js +207 -217
  49. package/lib/models/MessageCommentReaction.js +147 -155
  50. package/lib/models/MessageReaction.js +147 -155
  51. package/lib/models/Notification.js +255 -265
  52. package/lib/models/Payment.js +57 -61
  53. package/lib/models/Permission.js +128 -134
  54. package/lib/models/Priority.js +45 -47
  55. package/lib/models/Project.js +183 -193
  56. package/lib/models/PublicKey.js +207 -217
  57. package/lib/models/RemoteBandwidthSnapshot.js +26 -28
  58. package/lib/models/RemoteServer.js +805 -819
  59. package/lib/models/Request.js +166 -174
  60. package/lib/models/Session.js +47 -51
  61. package/lib/models/SettingsChange.js +26 -28
  62. package/lib/models/SftpHostKey.js +177 -187
  63. package/lib/models/Site.js +415 -418
  64. package/lib/models/SsoStrategy.js +99 -105
  65. package/lib/models/Style.js +127 -133
  66. package/lib/models/UsageDailySnapshot.js +26 -28
  67. package/lib/models/UsageSnapshot.js +26 -28
  68. package/lib/models/User.js +587 -603
  69. package/lib/models/UserCipherUse.js +32 -34
  70. package/lib/models/UserRequest.js +147 -155
  71. package/lib/models/WebhookTest.js +54 -56
  72. package/package.json +1 -1
  73. package/src/models/Bundle.js +10 -1
  74. package/src/models/BundleNotification.js +39 -1
  75. package/src/models/BundleRegistration.js +3 -0
  76. package/src/models/InboxRegistration.js +3 -0
  77. package/src/models/Site.js +3 -0
@@ -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
- switch (_context.prev = _context.next) {
95
- case 0:
96
- params = _args.length > 0 && _args[0] !== undefined ? _args[0] : {};
97
- if (_this.attributes.id) {
98
- _context.next = 3;
99
- break;
100
- }
101
- throw new errors.EmptyPropertyError('Current object has no id');
102
- case 3:
103
- if ((0, _utils.isObject)(params)) {
104
- _context.next = 5;
105
- break;
106
- }
107
- throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
108
- case 5:
109
- params.id = _this.attributes.id;
110
- if (!(params['id'] && !(0, _utils.isInt)(params['id']))) {
111
- _context.next = 8;
112
- break;
113
- }
114
- throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(id)));
115
- case 8:
116
- if (!(params['value'] && !(0, _utils.isString)(params['value']))) {
117
- _context.next = 10;
118
- break;
119
- }
120
- throw new errors.InvalidParameterError("Bad parameter: value must be of type String, received ".concat((0, _utils.getType)(value)));
121
- case 10:
122
- if (!(params['name'] && !(0, _utils.isString)(params['name']))) {
123
- _context.next = 12;
124
- break;
125
- }
126
- throw new errors.InvalidParameterError("Bad parameter: name must be of type String, received ".concat((0, _utils.getType)(name)));
127
- case 12:
128
- if (!(params['description'] && !(0, _utils.isString)(params['description']))) {
129
- _context.next = 14;
130
- break;
131
- }
132
- throw new errors.InvalidParameterError("Bad parameter: description must be of type String, received ".concat((0, _utils.getType)(description)));
133
- case 14:
134
- if (!(params['behavior'] && !(0, _utils.isString)(params['behavior']))) {
135
- _context.next = 16;
136
- break;
137
- }
138
- throw new errors.InvalidParameterError("Bad parameter: behavior must be of type String, received ".concat((0, _utils.getType)(behavior)));
139
- case 16:
140
- if (!(params['path'] && !(0, _utils.isString)(params['path']))) {
141
- _context.next = 18;
142
- break;
143
- }
144
- throw new errors.InvalidParameterError("Bad parameter: path must be of type String, received ".concat((0, _utils.getType)(path)));
145
- case 18:
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
- case 23:
158
- throw new errors.MissingParameterError('Parameter missing: id');
159
- case 24:
160
- _context.next = 26;
161
- return _Api.default.sendRequest("/behaviors/".concat(encodeURIComponent(params['id'])), 'PATCH', params, _this.options);
162
- case 26:
163
- response = _context.sent;
164
- return _context.abrupt("return", new Behavior(response === null || response === void 0 ? void 0 : response.data, _this.options));
165
- case 28:
166
- case "end":
167
- return _context.stop();
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
- switch (_context2.prev = _context2.next) {
179
- case 0:
180
- params = _args2.length > 0 && _args2[0] !== undefined ? _args2[0] : {};
181
- if (_this.attributes.id) {
182
- _context2.next = 3;
183
- break;
184
- }
185
- throw new errors.EmptyPropertyError('Current object has no id');
186
- case 3:
187
- if ((0, _utils.isObject)(params)) {
188
- _context2.next = 5;
189
- break;
190
- }
191
- throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
192
- case 5:
193
- params.id = _this.attributes.id;
194
- if (!(params['id'] && !(0, _utils.isInt)(params['id']))) {
195
- _context2.next = 8;
196
- break;
197
- }
198
- throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(id)));
199
- case 8:
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
- case 13:
212
- throw new errors.MissingParameterError('Parameter missing: id');
213
- case 14:
214
- _context2.next = 16;
215
- return _Api.default.sendRequest("/behaviors/".concat(encodeURIComponent(params['id'])), 'DELETE', params, _this.options);
216
- case 16:
217
- response = _context2.sent;
218
- return _context2.abrupt("return", response === null || response === void 0 ? void 0 : response.data);
219
- case 18:
220
- case "end":
221
- return _context2.stop();
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
- switch (_context3.prev = _context3.next) {
261
- case 0:
262
- params = _args3.length > 0 && _args3[0] !== undefined ? _args3[0] : {};
263
- options = _args3.length > 1 && _args3[1] !== undefined ? _args3[1] : {};
264
- if (!(params['cursor'] && !(0, _utils.isString)(params['cursor']))) {
265
- _context3.next = 4;
266
- break;
267
- }
268
- throw new errors.InvalidParameterError("Bad parameter: cursor must be of type String, received ".concat((0, _utils.getType)(params['cursor'])));
269
- case 4:
270
- if (!(params['per_page'] && !(0, _utils.isInt)(params['per_page']))) {
271
- _context3.next = 6;
272
- break;
273
- }
274
- throw new errors.InvalidParameterError("Bad parameter: per_page must be of type Int, received ".concat((0, _utils.getType)(params['per_page'])));
275
- case 6:
276
- if (!(params['behavior'] && !(0, _utils.isString)(params['behavior']))) {
277
- _context3.next = 8;
278
- break;
279
- }
280
- throw new errors.InvalidParameterError("Bad parameter: behavior must be of type String, received ".concat((0, _utils.getType)(params['behavior'])));
281
- case 8:
282
- _context3.next = 10;
283
- return _Api.default.sendRequest("/behaviors", 'GET', params, options);
284
- case 10:
285
- response = _context3.sent;
286
- 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) {
287
- return new Behavior(obj, options);
288
- })) || []);
289
- case 12:
290
- case "end":
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
- switch (_context4.prev = _context4.next) {
310
- case 0:
311
- params = _args4.length > 1 && _args4[1] !== undefined ? _args4[1] : {};
312
- options = _args4.length > 2 && _args4[2] !== undefined ? _args4[2] : {};
313
- if ((0, _utils.isObject)(params)) {
314
- _context4.next = 4;
315
- break;
316
- }
317
- throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
318
- case 4:
319
- params['id'] = id;
320
- if (params['id']) {
321
- _context4.next = 7;
322
- break;
323
- }
324
- throw new errors.MissingParameterError('Parameter missing: id');
325
- case 7:
326
- if (!(params['id'] && !(0, _utils.isInt)(params['id']))) {
327
- _context4.next = 9;
328
- break;
329
- }
330
- throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params['id'])));
331
- case 9:
332
- _context4.next = 11;
333
- return _Api.default.sendRequest("/behaviors/".concat(encodeURIComponent(params['id'])), 'GET', params, options);
334
- case 11:
335
- response = _context4.sent;
336
- return _context4.abrupt("return", new Behavior(response === null || response === void 0 ? void 0 : response.data, options));
337
- case 13:
338
- case "end":
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 = _args6.length > 0 && _args6[0] !== undefined ? _args6[0] : {};
437
- options = _args6.length > 1 && _args6[1] !== undefined ? _args6[1] : {};
438
- if (params['path']) {
439
- _context6.next = 4;
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.MissingParameterError('Parameter missing: path');
361
+ throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
443
362
  case 4:
444
- if (params['behavior']) {
445
- _context6.next = 6;
446
- break;
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.InvalidParameterError("Bad parameter: value must be of type String, received ".concat((0, _utils.getType)(params['value'])));
455
- case 8:
456
- if (!(params['name'] && !(0, _utils.isString)(params['name']))) {
457
- _context6.next = 10;
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: name must be of type String, received ".concat((0, _utils.getType)(params['name'])));
461
- case 10:
462
- if (!(params['description'] && !(0, _utils.isString)(params['description']))) {
463
- _context6.next = 12;
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: description must be of type String, received ".concat((0, _utils.getType)(params['description'])));
467
- case 12:
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
- _context6.next = 14;
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 14:
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
- _context6.next = 16;
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 16:
480
- _context6.next = 18;
481
- return _Api.default.sendRequest("/behaviors", 'POST', params, options);
482
- case 18:
483
- response = _context6.sent;
484
- return _context6.abrupt("return", new Behavior(response === null || response === void 0 ? void 0 : response.data, options));
485
- case 20:
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 _context6.stop();
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
- switch (_context7.prev = _context7.next) {
500
- case 0:
501
- params = _args7.length > 0 && _args7[0] !== undefined ? _args7[0] : {};
502
- options = _args7.length > 1 && _args7[1] !== undefined ? _args7[1] : {};
503
- if (params['url']) {
504
- _context7.next = 4;
505
- break;
506
- }
507
- throw new errors.MissingParameterError('Parameter missing: url');
508
- case 4:
509
- if (!(params['url'] && !(0, _utils.isString)(params['url']))) {
510
- _context7.next = 6;
511
- break;
512
- }
513
- throw new errors.InvalidParameterError("Bad parameter: url must be of type String, received ".concat((0, _utils.getType)(params['url'])));
514
- case 6:
515
- if (!(params['method'] && !(0, _utils.isString)(params['method']))) {
516
- _context7.next = 8;
517
- break;
518
- }
519
- throw new errors.InvalidParameterError("Bad parameter: method must be of type String, received ".concat((0, _utils.getType)(params['method'])));
520
- case 8:
521
- if (!(params['encoding'] && !(0, _utils.isString)(params['encoding']))) {
522
- _context7.next = 10;
523
- break;
524
- }
525
- throw new errors.InvalidParameterError("Bad parameter: encoding must be of type String, received ".concat((0, _utils.getType)(params['encoding'])));
526
- case 10:
527
- if (!(params['action'] && !(0, _utils.isString)(params['action']))) {
528
- _context7.next = 12;
529
- break;
530
- }
531
- throw new errors.InvalidParameterError("Bad parameter: action must be of type String, received ".concat((0, _utils.getType)(params['action'])));
532
- case 12:
533
- _context7.next = 14;
534
- return _Api.default.sendRequest("/behaviors/webhook/test", 'POST', params, options);
535
- case 14:
536
- response = _context7.sent;
537
- return _context7.abrupt("return", response === null || response === void 0 ? void 0 : response.data);
538
- case 16:
539
- case "end":
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
  })));