files.com 1.0.473 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (88) hide show
  1. package/_VERSION +1 -1
  2. package/lib/Files.js +1 -1
  3. package/lib/models/ActionNotificationExport.js +63 -49
  4. package/lib/models/ActionWebhookFailure.js +1 -1
  5. package/lib/models/ApiKey.js +113 -94
  6. package/lib/models/As2Partner.js +81 -62
  7. package/lib/models/As2Station.js +79 -60
  8. package/lib/models/Automation.js +90 -71
  9. package/lib/models/Behavior.js +114 -95
  10. package/lib/models/Bundle.js +90 -71
  11. package/lib/models/BundleNotification.js +75 -56
  12. package/lib/models/BundleRecipient.js +61 -47
  13. package/lib/models/Clickwrap.js +77 -58
  14. package/lib/models/ExternalEvent.js +71 -57
  15. package/lib/models/File.js +166 -154
  16. package/lib/models/FileComment.js +65 -46
  17. package/lib/models/FileCommentReaction.js +44 -30
  18. package/lib/models/Folder.js +58 -46
  19. package/lib/models/FormFieldSet.js +76 -57
  20. package/lib/models/GpgKey.js +79 -60
  21. package/lib/models/Group.js +78 -59
  22. package/lib/models/GroupUser.js +63 -44
  23. package/lib/models/HistoryExport.js +76 -62
  24. package/lib/models/InboxRecipient.js +61 -47
  25. package/lib/models/Lock.js +56 -44
  26. package/lib/models/Message.js +82 -63
  27. package/lib/models/MessageComment.js +78 -59
  28. package/lib/models/MessageCommentReaction.js +73 -59
  29. package/lib/models/MessageReaction.js +73 -59
  30. package/lib/models/Notification.js +84 -65
  31. package/lib/models/Permission.js +60 -46
  32. package/lib/models/Project.js +74 -55
  33. package/lib/models/PublicKey.js +78 -59
  34. package/lib/models/RemoteServer.js +147 -128
  35. package/lib/models/Request.js +76 -62
  36. package/lib/models/Session.js +53 -39
  37. package/lib/models/SftpHostKey.js +74 -55
  38. package/lib/models/ShareGroup.js +79 -60
  39. package/lib/models/Snapshot.js +75 -56
  40. package/lib/models/SsoStrategy.js +1 -1
  41. package/lib/models/Style.js +37 -23
  42. package/lib/models/User.js +104 -85
  43. package/lib/models/UserRequest.js +73 -59
  44. package/lib/models/WebhookTest.js +46 -32
  45. package/package.json +1 -1
  46. package/src/Files.js +1 -1
  47. package/src/models/ActionNotificationExport.js +2 -2
  48. package/src/models/ActionWebhookFailure.js +1 -1
  49. package/src/models/ApiKey.js +7 -5
  50. package/src/models/As2Partner.js +6 -4
  51. package/src/models/As2Station.js +6 -4
  52. package/src/models/Automation.js +7 -5
  53. package/src/models/Behavior.js +7 -5
  54. package/src/models/Bundle.js +7 -5
  55. package/src/models/BundleNotification.js +6 -4
  56. package/src/models/BundleRecipient.js +2 -2
  57. package/src/models/Clickwrap.js +6 -4
  58. package/src/models/ExternalEvent.js +2 -2
  59. package/src/models/File.js +3 -3
  60. package/src/models/FileComment.js +6 -4
  61. package/src/models/FileCommentReaction.js +3 -3
  62. package/src/models/Folder.js +2 -2
  63. package/src/models/FormFieldSet.js +6 -4
  64. package/src/models/GpgKey.js +6 -4
  65. package/src/models/Group.js +6 -4
  66. package/src/models/GroupUser.js +6 -4
  67. package/src/models/HistoryExport.js +2 -2
  68. package/src/models/InboxRecipient.js +2 -2
  69. package/src/models/Lock.js +3 -3
  70. package/src/models/Message.js +6 -4
  71. package/src/models/MessageComment.js +6 -4
  72. package/src/models/MessageCommentReaction.js +3 -3
  73. package/src/models/MessageReaction.js +3 -3
  74. package/src/models/Notification.js +6 -4
  75. package/src/models/Permission.js +3 -3
  76. package/src/models/Project.js +6 -4
  77. package/src/models/PublicKey.js +6 -4
  78. package/src/models/RemoteServer.js +6 -4
  79. package/src/models/Request.js +3 -3
  80. package/src/models/Session.js +3 -3
  81. package/src/models/SftpHostKey.js +6 -4
  82. package/src/models/ShareGroup.js +6 -4
  83. package/src/models/Snapshot.js +6 -4
  84. package/src/models/SsoStrategy.js +1 -1
  85. package/src/models/Style.js +6 -3
  86. package/src/models/User.js +9 -7
  87. package/src/models/UserRequest.js +3 -3
  88. package/src/models/WebhookTest.js +2 -2
@@ -99,7 +99,7 @@ var MessageReaction = /*#__PURE__*/(0, _createClass2.default)(function MessageRe
99
99
  return _Api.default.sendRequest("/message_reactions/".concat(encodeURIComponent(params['id'])), 'DELETE', params, _this.options);
100
100
  case 16:
101
101
  response = _context.sent;
102
- return _context.abrupt("return", response === null || response === void 0 ? void 0 : response.data);
102
+ return _context.abrupt("return");
103
103
  case 18:
104
104
  case "end":
105
105
  return _context.stop();
@@ -110,19 +110,33 @@ var MessageReaction = /*#__PURE__*/(0, _createClass2.default)(function MessageRe
110
110
  var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
111
111
  return _this.delete(params);
112
112
  });
113
- (0, _defineProperty2.default)(this, "save", function () {
114
- if (_this.attributes['id']) {
115
- throw new errors.NotImplementedError('The MessageReaction object doesn\'t support updates.');
116
- } else {
117
- var newObject = MessageReaction.create(_this.attributes, _this.options);
118
- _this.attributes = _objectSpread({}, newObject.attributes);
119
- return true;
120
- }
121
- });
122
- Object.entries(attributes).forEach(function (_ref2) {
123
- var _ref3 = (0, _slicedToArray2.default)(_ref2, 2),
124
- key = _ref3[0],
125
- value = _ref3[1];
113
+ (0, _defineProperty2.default)(this, "save", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
114
+ var newObject;
115
+ return _regenerator.default.wrap(function _callee2$(_context2) {
116
+ while (1) switch (_context2.prev = _context2.next) {
117
+ case 0:
118
+ if (!_this.attributes['id']) {
119
+ _context2.next = 4;
120
+ break;
121
+ }
122
+ throw new errors.NotImplementedError('The MessageReaction object doesn\'t support updates.');
123
+ case 4:
124
+ _context2.next = 6;
125
+ return MessageReaction.create(_this.attributes, _this.options);
126
+ case 6:
127
+ newObject = _context2.sent;
128
+ _this.attributes = _objectSpread({}, newObject.attributes);
129
+ return _context2.abrupt("return", true);
130
+ case 9:
131
+ case "end":
132
+ return _context2.stop();
133
+ }
134
+ }, _callee2);
135
+ })));
136
+ Object.entries(attributes).forEach(function (_ref3) {
137
+ var _ref4 = (0, _slicedToArray2.default)(_ref3, 2),
138
+ key = _ref4[0],
139
+ value = _ref4[1];
126
140
  var normalizedKey = key.replace('?', '');
127
141
  _this.attributes[normalizedKey] = value;
128
142
  Object.defineProperty(_this, normalizedKey, {
@@ -138,59 +152,59 @@ _class = MessageReaction;
138
152
  // cursor - string - Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination.
139
153
  // per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
140
154
  // message_id (required) - int64 - Message to return reactions for.
141
- (0, _defineProperty2.default)(MessageReaction, "list", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
155
+ (0, _defineProperty2.default)(MessageReaction, "list", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
142
156
  var _response$data;
143
157
  var params,
144
158
  options,
145
159
  response,
146
- _args2 = arguments;
147
- return _regenerator.default.wrap(function _callee2$(_context2) {
148
- while (1) switch (_context2.prev = _context2.next) {
160
+ _args3 = arguments;
161
+ return _regenerator.default.wrap(function _callee3$(_context3) {
162
+ while (1) switch (_context3.prev = _context3.next) {
149
163
  case 0:
150
- params = _args2.length > 0 && _args2[0] !== undefined ? _args2[0] : {};
151
- options = _args2.length > 1 && _args2[1] !== undefined ? _args2[1] : {};
164
+ params = _args3.length > 0 && _args3[0] !== undefined ? _args3[0] : {};
165
+ options = _args3.length > 1 && _args3[1] !== undefined ? _args3[1] : {};
152
166
  if (params['message_id']) {
153
- _context2.next = 4;
167
+ _context3.next = 4;
154
168
  break;
155
169
  }
156
170
  throw new errors.MissingParameterError('Parameter missing: message_id');
157
171
  case 4:
158
172
  if (!(params['user_id'] && !(0, _utils.isInt)(params['user_id']))) {
159
- _context2.next = 6;
173
+ _context3.next = 6;
160
174
  break;
161
175
  }
162
176
  throw new errors.InvalidParameterError("Bad parameter: user_id must be of type Int, received ".concat((0, _utils.getType)(params['user_id'])));
163
177
  case 6:
164
178
  if (!(params['cursor'] && !(0, _utils.isString)(params['cursor']))) {
165
- _context2.next = 8;
179
+ _context3.next = 8;
166
180
  break;
167
181
  }
168
182
  throw new errors.InvalidParameterError("Bad parameter: cursor must be of type String, received ".concat((0, _utils.getType)(params['cursor'])));
169
183
  case 8:
170
184
  if (!(params['per_page'] && !(0, _utils.isInt)(params['per_page']))) {
171
- _context2.next = 10;
185
+ _context3.next = 10;
172
186
  break;
173
187
  }
174
188
  throw new errors.InvalidParameterError("Bad parameter: per_page must be of type Int, received ".concat((0, _utils.getType)(params['per_page'])));
175
189
  case 10:
176
190
  if (!(params['message_id'] && !(0, _utils.isInt)(params['message_id']))) {
177
- _context2.next = 12;
191
+ _context3.next = 12;
178
192
  break;
179
193
  }
180
194
  throw new errors.InvalidParameterError("Bad parameter: message_id must be of type Int, received ".concat((0, _utils.getType)(params['message_id'])));
181
195
  case 12:
182
- _context2.next = 14;
196
+ _context3.next = 14;
183
197
  return _Api.default.sendRequest("/message_reactions", 'GET', params, options);
184
198
  case 14:
185
- response = _context2.sent;
186
- return _context2.abrupt("return", (response === null || response === void 0 || (_response$data = response.data) === null || _response$data === void 0 ? void 0 : _response$data.map(function (obj) {
199
+ response = _context3.sent;
200
+ return _context3.abrupt("return", (response === null || response === void 0 || (_response$data = response.data) === null || _response$data === void 0 ? void 0 : _response$data.map(function (obj) {
187
201
  return new _class(obj, options);
188
202
  })) || []);
189
203
  case 16:
190
204
  case "end":
191
- return _context2.stop();
205
+ return _context3.stop();
192
206
  }
193
- }, _callee2);
207
+ }, _callee3);
194
208
  })));
195
209
  (0, _defineProperty2.default)(MessageReaction, "all", function () {
196
210
  var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
@@ -200,48 +214,48 @@ _class = MessageReaction;
200
214
  // Parameters:
201
215
  // id (required) - int64 - Message Reaction ID.
202
216
  (0, _defineProperty2.default)(MessageReaction, "find", /*#__PURE__*/function () {
203
- var _ref5 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(id) {
217
+ var _ref6 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4(id) {
204
218
  var params,
205
219
  options,
206
220
  response,
207
- _args3 = arguments;
208
- return _regenerator.default.wrap(function _callee3$(_context3) {
209
- while (1) switch (_context3.prev = _context3.next) {
221
+ _args4 = arguments;
222
+ return _regenerator.default.wrap(function _callee4$(_context4) {
223
+ while (1) switch (_context4.prev = _context4.next) {
210
224
  case 0:
211
- params = _args3.length > 1 && _args3[1] !== undefined ? _args3[1] : {};
212
- options = _args3.length > 2 && _args3[2] !== undefined ? _args3[2] : {};
225
+ params = _args4.length > 1 && _args4[1] !== undefined ? _args4[1] : {};
226
+ options = _args4.length > 2 && _args4[2] !== undefined ? _args4[2] : {};
213
227
  if ((0, _utils.isObject)(params)) {
214
- _context3.next = 4;
228
+ _context4.next = 4;
215
229
  break;
216
230
  }
217
231
  throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
218
232
  case 4:
219
233
  params['id'] = id;
220
234
  if (params['id']) {
221
- _context3.next = 7;
235
+ _context4.next = 7;
222
236
  break;
223
237
  }
224
238
  throw new errors.MissingParameterError('Parameter missing: id');
225
239
  case 7:
226
240
  if (!(params['id'] && !(0, _utils.isInt)(params['id']))) {
227
- _context3.next = 9;
241
+ _context4.next = 9;
228
242
  break;
229
243
  }
230
244
  throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params['id'])));
231
245
  case 9:
232
- _context3.next = 11;
246
+ _context4.next = 11;
233
247
  return _Api.default.sendRequest("/message_reactions/".concat(encodeURIComponent(params['id'])), 'GET', params, options);
234
248
  case 11:
235
- response = _context3.sent;
236
- return _context3.abrupt("return", new _class(response === null || response === void 0 ? void 0 : response.data, options));
249
+ response = _context4.sent;
250
+ return _context4.abrupt("return", new _class(response === null || response === void 0 ? void 0 : response.data, options));
237
251
  case 13:
238
252
  case "end":
239
- return _context3.stop();
253
+ return _context4.stop();
240
254
  }
241
- }, _callee3);
255
+ }, _callee4);
242
256
  }));
243
257
  return function (_x) {
244
- return _ref5.apply(this, arguments);
258
+ return _ref6.apply(this, arguments);
245
259
  };
246
260
  }());
247
261
  (0, _defineProperty2.default)(MessageReaction, "get", function (id) {
@@ -252,44 +266,44 @@ _class = MessageReaction;
252
266
  // Parameters:
253
267
  // user_id - int64 - User ID. Provide a value of `0` to operate the current session's user.
254
268
  // emoji (required) - string - Emoji to react with.
255
- (0, _defineProperty2.default)(MessageReaction, "create", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4() {
269
+ (0, _defineProperty2.default)(MessageReaction, "create", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5() {
256
270
  var params,
257
271
  options,
258
272
  response,
259
- _args4 = arguments;
260
- return _regenerator.default.wrap(function _callee4$(_context4) {
261
- while (1) switch (_context4.prev = _context4.next) {
273
+ _args5 = arguments;
274
+ return _regenerator.default.wrap(function _callee5$(_context5) {
275
+ while (1) switch (_context5.prev = _context5.next) {
262
276
  case 0:
263
- params = _args4.length > 0 && _args4[0] !== undefined ? _args4[0] : {};
264
- options = _args4.length > 1 && _args4[1] !== undefined ? _args4[1] : {};
277
+ params = _args5.length > 0 && _args5[0] !== undefined ? _args5[0] : {};
278
+ options = _args5.length > 1 && _args5[1] !== undefined ? _args5[1] : {};
265
279
  if (params['emoji']) {
266
- _context4.next = 4;
280
+ _context5.next = 4;
267
281
  break;
268
282
  }
269
283
  throw new errors.MissingParameterError('Parameter missing: emoji');
270
284
  case 4:
271
285
  if (!(params['user_id'] && !(0, _utils.isInt)(params['user_id']))) {
272
- _context4.next = 6;
286
+ _context5.next = 6;
273
287
  break;
274
288
  }
275
289
  throw new errors.InvalidParameterError("Bad parameter: user_id must be of type Int, received ".concat((0, _utils.getType)(params['user_id'])));
276
290
  case 6:
277
291
  if (!(params['emoji'] && !(0, _utils.isString)(params['emoji']))) {
278
- _context4.next = 8;
292
+ _context5.next = 8;
279
293
  break;
280
294
  }
281
295
  throw new errors.InvalidParameterError("Bad parameter: emoji must be of type String, received ".concat((0, _utils.getType)(params['emoji'])));
282
296
  case 8:
283
- _context4.next = 10;
297
+ _context5.next = 10;
284
298
  return _Api.default.sendRequest("/message_reactions", 'POST', params, options);
285
299
  case 10:
286
- response = _context4.sent;
287
- return _context4.abrupt("return", new _class(response === null || response === void 0 ? void 0 : response.data, options));
300
+ response = _context5.sent;
301
+ return _context5.abrupt("return", new _class(response === null || response === void 0 ? void 0 : response.data, options));
288
302
  case 12:
289
303
  case "end":
290
- return _context4.stop();
304
+ return _context5.stop();
291
305
  }
292
- }, _callee4);
306
+ }, _callee5);
293
307
  })));
294
308
  var _default = exports.default = MessageReaction;
295
309
  module.exports = MessageReaction;
@@ -328,7 +328,7 @@ var Notification = /*#__PURE__*/(0, _createClass2.default)(function Notification
328
328
  return _Api.default.sendRequest("/notifications/".concat(encodeURIComponent(params['id'])), 'DELETE', params, _this.options);
329
329
  case 16:
330
330
  response = _context2.sent;
331
- return _context2.abrupt("return", response === null || response === void 0 ? void 0 : response.data);
331
+ return _context2.abrupt("return");
332
332
  case 18:
333
333
  case "end":
334
334
  return _context2.stop();
@@ -339,19 +339,38 @@ var Notification = /*#__PURE__*/(0, _createClass2.default)(function Notification
339
339
  var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
340
340
  return _this.delete(params);
341
341
  });
342
- (0, _defineProperty2.default)(this, "save", function () {
343
- if (_this.attributes['id']) {
344
- return _this.update(_this.attributes);
345
- } else {
346
- var newObject = Notification.create(_this.attributes, _this.options);
347
- _this.attributes = _objectSpread({}, newObject.attributes);
348
- return true;
349
- }
350
- });
351
- Object.entries(attributes).forEach(function (_ref3) {
352
- var _ref4 = (0, _slicedToArray2.default)(_ref3, 2),
353
- key = _ref4[0],
354
- value = _ref4[1];
342
+ (0, _defineProperty2.default)(this, "save", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
343
+ var newObject, _newObject;
344
+ return _regenerator.default.wrap(function _callee3$(_context3) {
345
+ while (1) switch (_context3.prev = _context3.next) {
346
+ case 0:
347
+ if (!_this.attributes['id']) {
348
+ _context3.next = 8;
349
+ break;
350
+ }
351
+ _context3.next = 3;
352
+ return _this.update(_this.attributes);
353
+ case 3:
354
+ newObject = _context3.sent;
355
+ _this.attributes = _objectSpread({}, newObject.attributes);
356
+ return _context3.abrupt("return", true);
357
+ case 8:
358
+ _context3.next = 10;
359
+ return Notification.create(_this.attributes, _this.options);
360
+ case 10:
361
+ _newObject = _context3.sent;
362
+ _this.attributes = _objectSpread({}, _newObject.attributes);
363
+ return _context3.abrupt("return", true);
364
+ case 13:
365
+ case "end":
366
+ return _context3.stop();
367
+ }
368
+ }, _callee3);
369
+ })));
370
+ Object.entries(attributes).forEach(function (_ref4) {
371
+ var _ref5 = (0, _slicedToArray2.default)(_ref4, 2),
372
+ key = _ref5[0],
373
+ value = _ref5[1];
355
374
  var normalizedKey = key.replace('?', '');
356
375
  _this.attributes[normalizedKey] = value;
357
376
  Object.defineProperty(_this, normalizedKey, {
@@ -372,59 +391,59 @@ _class = Notification;
372
391
  // path - string - Show notifications for this Path.
373
392
  // include_ancestors - boolean - If `include_ancestors` is `true` and `path` is specified, include notifications for any parent paths. Ignored if `path` is not specified.
374
393
  // group_id - string
375
- (0, _defineProperty2.default)(Notification, "list", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
394
+ (0, _defineProperty2.default)(Notification, "list", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4() {
376
395
  var _response$data;
377
396
  var params,
378
397
  options,
379
398
  response,
380
- _args3 = arguments;
381
- return _regenerator.default.wrap(function _callee3$(_context3) {
382
- while (1) switch (_context3.prev = _context3.next) {
399
+ _args4 = arguments;
400
+ return _regenerator.default.wrap(function _callee4$(_context4) {
401
+ while (1) switch (_context4.prev = _context4.next) {
383
402
  case 0:
384
- params = _args3.length > 0 && _args3[0] !== undefined ? _args3[0] : {};
385
- options = _args3.length > 1 && _args3[1] !== undefined ? _args3[1] : {};
403
+ params = _args4.length > 0 && _args4[0] !== undefined ? _args4[0] : {};
404
+ options = _args4.length > 1 && _args4[1] !== undefined ? _args4[1] : {};
386
405
  if (!(params['user_id'] && !(0, _utils.isInt)(params['user_id']))) {
387
- _context3.next = 4;
406
+ _context4.next = 4;
388
407
  break;
389
408
  }
390
409
  throw new errors.InvalidParameterError("Bad parameter: user_id must be of type Int, received ".concat((0, _utils.getType)(params['user_id'])));
391
410
  case 4:
392
411
  if (!(params['cursor'] && !(0, _utils.isString)(params['cursor']))) {
393
- _context3.next = 6;
412
+ _context4.next = 6;
394
413
  break;
395
414
  }
396
415
  throw new errors.InvalidParameterError("Bad parameter: cursor must be of type String, received ".concat((0, _utils.getType)(params['cursor'])));
397
416
  case 6:
398
417
  if (!(params['per_page'] && !(0, _utils.isInt)(params['per_page']))) {
399
- _context3.next = 8;
418
+ _context4.next = 8;
400
419
  break;
401
420
  }
402
421
  throw new errors.InvalidParameterError("Bad parameter: per_page must be of type Int, received ".concat((0, _utils.getType)(params['per_page'])));
403
422
  case 8:
404
423
  if (!(params['path'] && !(0, _utils.isString)(params['path']))) {
405
- _context3.next = 10;
424
+ _context4.next = 10;
406
425
  break;
407
426
  }
408
427
  throw new errors.InvalidParameterError("Bad parameter: path must be of type String, received ".concat((0, _utils.getType)(params['path'])));
409
428
  case 10:
410
429
  if (!(params['group_id'] && !(0, _utils.isString)(params['group_id']))) {
411
- _context3.next = 12;
430
+ _context4.next = 12;
412
431
  break;
413
432
  }
414
433
  throw new errors.InvalidParameterError("Bad parameter: group_id must be of type String, received ".concat((0, _utils.getType)(params['group_id'])));
415
434
  case 12:
416
- _context3.next = 14;
435
+ _context4.next = 14;
417
436
  return _Api.default.sendRequest("/notifications", 'GET', params, options);
418
437
  case 14:
419
- response = _context3.sent;
420
- return _context3.abrupt("return", (response === null || response === void 0 || (_response$data = response.data) === null || _response$data === void 0 ? void 0 : _response$data.map(function (obj) {
438
+ response = _context4.sent;
439
+ 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) {
421
440
  return new _class(obj, options);
422
441
  })) || []);
423
442
  case 16:
424
443
  case "end":
425
- return _context3.stop();
444
+ return _context4.stop();
426
445
  }
427
- }, _callee3);
446
+ }, _callee4);
428
447
  })));
429
448
  (0, _defineProperty2.default)(Notification, "all", function () {
430
449
  var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
@@ -434,48 +453,48 @@ _class = Notification;
434
453
  // Parameters:
435
454
  // id (required) - int64 - Notification ID.
436
455
  (0, _defineProperty2.default)(Notification, "find", /*#__PURE__*/function () {
437
- var _ref6 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4(id) {
456
+ var _ref7 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5(id) {
438
457
  var params,
439
458
  options,
440
459
  response,
441
- _args4 = arguments;
442
- return _regenerator.default.wrap(function _callee4$(_context4) {
443
- while (1) switch (_context4.prev = _context4.next) {
460
+ _args5 = arguments;
461
+ return _regenerator.default.wrap(function _callee5$(_context5) {
462
+ while (1) switch (_context5.prev = _context5.next) {
444
463
  case 0:
445
- params = _args4.length > 1 && _args4[1] !== undefined ? _args4[1] : {};
446
- options = _args4.length > 2 && _args4[2] !== undefined ? _args4[2] : {};
464
+ params = _args5.length > 1 && _args5[1] !== undefined ? _args5[1] : {};
465
+ options = _args5.length > 2 && _args5[2] !== undefined ? _args5[2] : {};
447
466
  if ((0, _utils.isObject)(params)) {
448
- _context4.next = 4;
467
+ _context5.next = 4;
449
468
  break;
450
469
  }
451
470
  throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
452
471
  case 4:
453
472
  params['id'] = id;
454
473
  if (params['id']) {
455
- _context4.next = 7;
474
+ _context5.next = 7;
456
475
  break;
457
476
  }
458
477
  throw new errors.MissingParameterError('Parameter missing: id');
459
478
  case 7:
460
479
  if (!(params['id'] && !(0, _utils.isInt)(params['id']))) {
461
- _context4.next = 9;
480
+ _context5.next = 9;
462
481
  break;
463
482
  }
464
483
  throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params['id'])));
465
484
  case 9:
466
- _context4.next = 11;
485
+ _context5.next = 11;
467
486
  return _Api.default.sendRequest("/notifications/".concat(encodeURIComponent(params['id'])), 'GET', params, options);
468
487
  case 11:
469
- response = _context4.sent;
470
- return _context4.abrupt("return", new _class(response === null || response === void 0 ? void 0 : response.data, options));
488
+ response = _context5.sent;
489
+ return _context5.abrupt("return", new _class(response === null || response === void 0 ? void 0 : response.data, options));
471
490
  case 13:
472
491
  case "end":
473
- return _context4.stop();
492
+ return _context5.stop();
474
493
  }
475
- }, _callee4);
494
+ }, _callee5);
476
495
  }));
477
496
  return function (_x) {
478
- return _ref6.apply(this, arguments);
497
+ return _ref7.apply(this, arguments);
479
498
  };
480
499
  }());
481
500
  (0, _defineProperty2.default)(Notification, "get", function (id) {
@@ -501,80 +520,80 @@ _class = Notification;
501
520
  // group_id - int64 - The ID of the group to notify. Provide `user_id`, `username` or `group_id`.
502
521
  // path - string - Path
503
522
  // username - string - The username of the user to notify. Provide `user_id`, `username` or `group_id`.
504
- (0, _defineProperty2.default)(Notification, "create", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5() {
523
+ (0, _defineProperty2.default)(Notification, "create", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6() {
505
524
  var params,
506
525
  options,
507
526
  response,
508
- _args5 = arguments;
509
- return _regenerator.default.wrap(function _callee5$(_context5) {
510
- while (1) switch (_context5.prev = _context5.next) {
527
+ _args6 = arguments;
528
+ return _regenerator.default.wrap(function _callee6$(_context6) {
529
+ while (1) switch (_context6.prev = _context6.next) {
511
530
  case 0:
512
- params = _args5.length > 0 && _args5[0] !== undefined ? _args5[0] : {};
513
- options = _args5.length > 1 && _args5[1] !== undefined ? _args5[1] : {};
531
+ params = _args6.length > 0 && _args6[0] !== undefined ? _args6[0] : {};
532
+ options = _args6.length > 1 && _args6[1] !== undefined ? _args6[1] : {};
514
533
  if (!(params['user_id'] && !(0, _utils.isInt)(params['user_id']))) {
515
- _context5.next = 4;
534
+ _context6.next = 4;
516
535
  break;
517
536
  }
518
537
  throw new errors.InvalidParameterError("Bad parameter: user_id must be of type Int, received ".concat((0, _utils.getType)(params['user_id'])));
519
538
  case 4:
520
539
  if (!(params['send_interval'] && !(0, _utils.isString)(params['send_interval']))) {
521
- _context5.next = 6;
540
+ _context6.next = 6;
522
541
  break;
523
542
  }
524
543
  throw new errors.InvalidParameterError("Bad parameter: send_interval must be of type String, received ".concat((0, _utils.getType)(params['send_interval'])));
525
544
  case 6:
526
545
  if (!(params['message'] && !(0, _utils.isString)(params['message']))) {
527
- _context5.next = 8;
546
+ _context6.next = 8;
528
547
  break;
529
548
  }
530
549
  throw new errors.InvalidParameterError("Bad parameter: message must be of type String, received ".concat((0, _utils.getType)(params['message'])));
531
550
  case 8:
532
551
  if (!(params['triggering_filenames'] && !(0, _utils.isArray)(params['triggering_filenames']))) {
533
- _context5.next = 10;
552
+ _context6.next = 10;
534
553
  break;
535
554
  }
536
555
  throw new errors.InvalidParameterError("Bad parameter: triggering_filenames must be of type Array, received ".concat((0, _utils.getType)(params['triggering_filenames'])));
537
556
  case 10:
538
557
  if (!(params['triggering_group_ids'] && !(0, _utils.isArray)(params['triggering_group_ids']))) {
539
- _context5.next = 12;
558
+ _context6.next = 12;
540
559
  break;
541
560
  }
542
561
  throw new errors.InvalidParameterError("Bad parameter: triggering_group_ids must be of type Array, received ".concat((0, _utils.getType)(params['triggering_group_ids'])));
543
562
  case 12:
544
563
  if (!(params['triggering_user_ids'] && !(0, _utils.isArray)(params['triggering_user_ids']))) {
545
- _context5.next = 14;
564
+ _context6.next = 14;
546
565
  break;
547
566
  }
548
567
  throw new errors.InvalidParameterError("Bad parameter: triggering_user_ids must be of type Array, received ".concat((0, _utils.getType)(params['triggering_user_ids'])));
549
568
  case 14:
550
569
  if (!(params['group_id'] && !(0, _utils.isInt)(params['group_id']))) {
551
- _context5.next = 16;
570
+ _context6.next = 16;
552
571
  break;
553
572
  }
554
573
  throw new errors.InvalidParameterError("Bad parameter: group_id must be of type Int, received ".concat((0, _utils.getType)(params['group_id'])));
555
574
  case 16:
556
575
  if (!(params['path'] && !(0, _utils.isString)(params['path']))) {
557
- _context5.next = 18;
576
+ _context6.next = 18;
558
577
  break;
559
578
  }
560
579
  throw new errors.InvalidParameterError("Bad parameter: path must be of type String, received ".concat((0, _utils.getType)(params['path'])));
561
580
  case 18:
562
581
  if (!(params['username'] && !(0, _utils.isString)(params['username']))) {
563
- _context5.next = 20;
582
+ _context6.next = 20;
564
583
  break;
565
584
  }
566
585
  throw new errors.InvalidParameterError("Bad parameter: username must be of type String, received ".concat((0, _utils.getType)(params['username'])));
567
586
  case 20:
568
- _context5.next = 22;
587
+ _context6.next = 22;
569
588
  return _Api.default.sendRequest("/notifications", 'POST', params, options);
570
589
  case 22:
571
- response = _context5.sent;
572
- return _context5.abrupt("return", new _class(response === null || response === void 0 ? void 0 : response.data, options));
590
+ response = _context6.sent;
591
+ return _context6.abrupt("return", new _class(response === null || response === void 0 ? void 0 : response.data, options));
573
592
  case 24:
574
593
  case "end":
575
- return _context5.stop();
594
+ return _context6.stop();
576
595
  }
577
- }, _callee5);
596
+ }, _callee6);
578
597
  })));
579
598
  var _default = exports.default = Notification;
580
599
  module.exports = Notification;