files.com 1.0.474 → 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
package/_VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.474
1
+ 1.1.0
package/lib/Files.js CHANGED
@@ -11,7 +11,7 @@ var endpointPrefix = '/api/rest/v1';
11
11
  var apiKey;
12
12
  var baseUrl = 'https://app.files.com';
13
13
  var sessionId = null;
14
- var version = '1.0.474';
14
+ var version = '1.1.0';
15
15
  var userAgent = "Files.com JavaScript SDK v".concat(version);
16
16
  var logLevel = _Logger.LogLevel.INFO;
17
17
  var debugRequest = false;
@@ -5,8 +5,8 @@ var _typeof = require("@babel/runtime/helpers/typeof");
5
5
  exports.__esModule = true;
6
6
  exports.default = void 0;
7
7
  var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
8
- var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
9
8
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
9
+ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
10
10
  var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
11
11
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
12
12
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
@@ -131,19 +131,33 @@ var ActionNotificationExport = /*#__PURE__*/(0, _createClass2.default)(function
131
131
  (0, _defineProperty2.default)(this, "setUserId", function (value) {
132
132
  _this.attributes.user_id = value;
133
133
  });
134
- (0, _defineProperty2.default)(this, "save", function () {
135
- if (_this.attributes['id']) {
136
- throw new errors.NotImplementedError('The ActionNotificationExport object doesn\'t support updates.');
137
- } else {
138
- var newObject = ActionNotificationExport.create(_this.attributes, _this.options);
139
- _this.attributes = _objectSpread({}, newObject.attributes);
140
- return true;
141
- }
142
- });
143
- Object.entries(attributes).forEach(function (_ref) {
144
- var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
145
- key = _ref2[0],
146
- value = _ref2[1];
134
+ (0, _defineProperty2.default)(this, "save", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
135
+ var newObject;
136
+ return _regenerator.default.wrap(function _callee$(_context) {
137
+ while (1) switch (_context.prev = _context.next) {
138
+ case 0:
139
+ if (!_this.attributes['id']) {
140
+ _context.next = 4;
141
+ break;
142
+ }
143
+ throw new errors.NotImplementedError('The ActionNotificationExport object doesn\'t support updates.');
144
+ case 4:
145
+ _context.next = 6;
146
+ return ActionNotificationExport.create(_this.attributes, _this.options);
147
+ case 6:
148
+ newObject = _context.sent;
149
+ _this.attributes = _objectSpread({}, newObject.attributes);
150
+ return _context.abrupt("return", true);
151
+ case 9:
152
+ case "end":
153
+ return _context.stop();
154
+ }
155
+ }, _callee);
156
+ })));
157
+ Object.entries(attributes).forEach(function (_ref2) {
158
+ var _ref3 = (0, _slicedToArray2.default)(_ref2, 2),
159
+ key = _ref3[0],
160
+ value = _ref3[1];
147
161
  var normalizedKey = key.replace('?', '');
148
162
  _this.attributes[normalizedKey] = value;
149
163
  Object.defineProperty(_this, normalizedKey, {
@@ -157,48 +171,48 @@ _class = ActionNotificationExport;
157
171
  // Parameters:
158
172
  // id (required) - int64 - Action Notification Export ID.
159
173
  (0, _defineProperty2.default)(ActionNotificationExport, "find", /*#__PURE__*/function () {
160
- var _ref3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(id) {
174
+ var _ref4 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(id) {
161
175
  var params,
162
176
  options,
163
177
  response,
164
- _args = arguments;
165
- return _regenerator.default.wrap(function _callee$(_context) {
166
- while (1) switch (_context.prev = _context.next) {
178
+ _args2 = arguments;
179
+ return _regenerator.default.wrap(function _callee2$(_context2) {
180
+ while (1) switch (_context2.prev = _context2.next) {
167
181
  case 0:
168
- params = _args.length > 1 && _args[1] !== undefined ? _args[1] : {};
169
- options = _args.length > 2 && _args[2] !== undefined ? _args[2] : {};
182
+ params = _args2.length > 1 && _args2[1] !== undefined ? _args2[1] : {};
183
+ options = _args2.length > 2 && _args2[2] !== undefined ? _args2[2] : {};
170
184
  if ((0, _utils.isObject)(params)) {
171
- _context.next = 4;
185
+ _context2.next = 4;
172
186
  break;
173
187
  }
174
188
  throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
175
189
  case 4:
176
190
  params['id'] = id;
177
191
  if (params['id']) {
178
- _context.next = 7;
192
+ _context2.next = 7;
179
193
  break;
180
194
  }
181
195
  throw new errors.MissingParameterError('Parameter missing: id');
182
196
  case 7:
183
197
  if (!(params['id'] && !(0, _utils.isInt)(params['id']))) {
184
- _context.next = 9;
198
+ _context2.next = 9;
185
199
  break;
186
200
  }
187
201
  throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params['id'])));
188
202
  case 9:
189
- _context.next = 11;
203
+ _context2.next = 11;
190
204
  return _Api.default.sendRequest("/action_notification_exports/".concat(encodeURIComponent(params['id'])), 'GET', params, options);
191
205
  case 11:
192
- response = _context.sent;
193
- return _context.abrupt("return", new _class(response === null || response === void 0 ? void 0 : response.data, options));
206
+ response = _context2.sent;
207
+ return _context2.abrupt("return", new _class(response === null || response === void 0 ? void 0 : response.data, options));
194
208
  case 13:
195
209
  case "end":
196
- return _context.stop();
210
+ return _context2.stop();
197
211
  }
198
- }, _callee);
212
+ }, _callee2);
199
213
  }));
200
214
  return function (_x) {
201
- return _ref3.apply(this, arguments);
215
+ return _ref4.apply(this, arguments);
202
216
  };
203
217
  }());
204
218
  (0, _defineProperty2.default)(ActionNotificationExport, "get", function (id) {
@@ -217,80 +231,80 @@ _class = ActionNotificationExport;
217
231
  // query_success - boolean - true if the webhook request succeeded (i.e. returned a 200 or 204 response status). false otherwise.
218
232
  // query_path - string - Return notifications that were triggered by actions on this specific path.
219
233
  // query_folder - string - Return notifications that were triggered by actions in this folder.
220
- (0, _defineProperty2.default)(ActionNotificationExport, "create", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
234
+ (0, _defineProperty2.default)(ActionNotificationExport, "create", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
221
235
  var params,
222
236
  options,
223
237
  response,
224
- _args2 = arguments;
225
- return _regenerator.default.wrap(function _callee2$(_context2) {
226
- while (1) switch (_context2.prev = _context2.next) {
238
+ _args3 = arguments;
239
+ return _regenerator.default.wrap(function _callee3$(_context3) {
240
+ while (1) switch (_context3.prev = _context3.next) {
227
241
  case 0:
228
- params = _args2.length > 0 && _args2[0] !== undefined ? _args2[0] : {};
229
- options = _args2.length > 1 && _args2[1] !== undefined ? _args2[1] : {};
242
+ params = _args3.length > 0 && _args3[0] !== undefined ? _args3[0] : {};
243
+ options = _args3.length > 1 && _args3[1] !== undefined ? _args3[1] : {};
230
244
  if (!(params['user_id'] && !(0, _utils.isInt)(params['user_id']))) {
231
- _context2.next = 4;
245
+ _context3.next = 4;
232
246
  break;
233
247
  }
234
248
  throw new errors.InvalidParameterError("Bad parameter: user_id must be of type Int, received ".concat((0, _utils.getType)(params['user_id'])));
235
249
  case 4:
236
250
  if (!(params['start_at'] && !(0, _utils.isString)(params['start_at']))) {
237
- _context2.next = 6;
251
+ _context3.next = 6;
238
252
  break;
239
253
  }
240
254
  throw new errors.InvalidParameterError("Bad parameter: start_at must be of type String, received ".concat((0, _utils.getType)(params['start_at'])));
241
255
  case 6:
242
256
  if (!(params['end_at'] && !(0, _utils.isString)(params['end_at']))) {
243
- _context2.next = 8;
257
+ _context3.next = 8;
244
258
  break;
245
259
  }
246
260
  throw new errors.InvalidParameterError("Bad parameter: end_at must be of type String, received ".concat((0, _utils.getType)(params['end_at'])));
247
261
  case 8:
248
262
  if (!(params['query_message'] && !(0, _utils.isString)(params['query_message']))) {
249
- _context2.next = 10;
263
+ _context3.next = 10;
250
264
  break;
251
265
  }
252
266
  throw new errors.InvalidParameterError("Bad parameter: query_message must be of type String, received ".concat((0, _utils.getType)(params['query_message'])));
253
267
  case 10:
254
268
  if (!(params['query_request_method'] && !(0, _utils.isString)(params['query_request_method']))) {
255
- _context2.next = 12;
269
+ _context3.next = 12;
256
270
  break;
257
271
  }
258
272
  throw new errors.InvalidParameterError("Bad parameter: query_request_method must be of type String, received ".concat((0, _utils.getType)(params['query_request_method'])));
259
273
  case 12:
260
274
  if (!(params['query_request_url'] && !(0, _utils.isString)(params['query_request_url']))) {
261
- _context2.next = 14;
275
+ _context3.next = 14;
262
276
  break;
263
277
  }
264
278
  throw new errors.InvalidParameterError("Bad parameter: query_request_url must be of type String, received ".concat((0, _utils.getType)(params['query_request_url'])));
265
279
  case 14:
266
280
  if (!(params['query_status'] && !(0, _utils.isString)(params['query_status']))) {
267
- _context2.next = 16;
281
+ _context3.next = 16;
268
282
  break;
269
283
  }
270
284
  throw new errors.InvalidParameterError("Bad parameter: query_status must be of type String, received ".concat((0, _utils.getType)(params['query_status'])));
271
285
  case 16:
272
286
  if (!(params['query_path'] && !(0, _utils.isString)(params['query_path']))) {
273
- _context2.next = 18;
287
+ _context3.next = 18;
274
288
  break;
275
289
  }
276
290
  throw new errors.InvalidParameterError("Bad parameter: query_path must be of type String, received ".concat((0, _utils.getType)(params['query_path'])));
277
291
  case 18:
278
292
  if (!(params['query_folder'] && !(0, _utils.isString)(params['query_folder']))) {
279
- _context2.next = 20;
293
+ _context3.next = 20;
280
294
  break;
281
295
  }
282
296
  throw new errors.InvalidParameterError("Bad parameter: query_folder must be of type String, received ".concat((0, _utils.getType)(params['query_folder'])));
283
297
  case 20:
284
- _context2.next = 22;
298
+ _context3.next = 22;
285
299
  return _Api.default.sendRequest("/action_notification_exports", 'POST', params, options);
286
300
  case 22:
287
- response = _context2.sent;
288
- return _context2.abrupt("return", new _class(response === null || response === void 0 ? void 0 : response.data, options));
301
+ response = _context3.sent;
302
+ return _context3.abrupt("return", new _class(response === null || response === void 0 ? void 0 : response.data, options));
289
303
  case 24:
290
304
  case "end":
291
- return _context2.stop();
305
+ return _context3.stop();
292
306
  }
293
- }, _callee2);
307
+ }, _callee3);
294
308
  })));
295
309
  var _default = exports.default = ActionNotificationExport;
296
310
  module.exports = ActionNotificationExport;
@@ -77,7 +77,7 @@ var ActionWebhookFailure = /*#__PURE__*/(0, _createClass2.default)(function Acti
77
77
  return _Api.default.sendRequest("/action_webhook_failures/".concat(encodeURIComponent(params['id']), "/retry"), 'POST', params, _this.options);
78
78
  case 16:
79
79
  response = _context.sent;
80
- return _context.abrupt("return", response === null || response === void 0 ? void 0 : response.data);
80
+ return _context.abrupt("return");
81
81
  case 18:
82
82
  case "end":
83
83
  return _context.stop();
@@ -247,7 +247,7 @@ var ApiKey = /*#__PURE__*/(0, _createClass2.default)(function ApiKey() {
247
247
  return _Api.default.sendRequest("/api_keys/".concat(encodeURIComponent(params['id'])), 'DELETE', params, _this.options);
248
248
  case 16:
249
249
  response = _context2.sent;
250
- return _context2.abrupt("return", response === null || response === void 0 ? void 0 : response.data);
250
+ return _context2.abrupt("return");
251
251
  case 18:
252
252
  case "end":
253
253
  return _context2.stop();
@@ -258,19 +258,38 @@ var ApiKey = /*#__PURE__*/(0, _createClass2.default)(function ApiKey() {
258
258
  var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
259
259
  return _this.delete(params);
260
260
  });
261
- (0, _defineProperty2.default)(this, "save", function () {
262
- if (_this.attributes['id']) {
263
- return _this.update(_this.attributes);
264
- } else {
265
- var newObject = ApiKey.create(_this.attributes, _this.options);
266
- _this.attributes = _objectSpread({}, newObject.attributes);
267
- return true;
268
- }
269
- });
270
- Object.entries(attributes).forEach(function (_ref3) {
271
- var _ref4 = (0, _slicedToArray2.default)(_ref3, 2),
272
- key = _ref4[0],
273
- value = _ref4[1];
261
+ (0, _defineProperty2.default)(this, "save", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
262
+ var newObject, _newObject;
263
+ return _regenerator.default.wrap(function _callee3$(_context3) {
264
+ while (1) switch (_context3.prev = _context3.next) {
265
+ case 0:
266
+ if (!_this.attributes['id']) {
267
+ _context3.next = 8;
268
+ break;
269
+ }
270
+ _context3.next = 3;
271
+ return _this.update(_this.attributes);
272
+ case 3:
273
+ newObject = _context3.sent;
274
+ _this.attributes = _objectSpread({}, newObject.attributes);
275
+ return _context3.abrupt("return", true);
276
+ case 8:
277
+ _context3.next = 10;
278
+ return ApiKey.create(_this.attributes, _this.options);
279
+ case 10:
280
+ _newObject = _context3.sent;
281
+ _this.attributes = _objectSpread({}, _newObject.attributes);
282
+ return _context3.abrupt("return", true);
283
+ case 13:
284
+ case "end":
285
+ return _context3.stop();
286
+ }
287
+ }, _callee3);
288
+ })));
289
+ Object.entries(attributes).forEach(function (_ref4) {
290
+ var _ref5 = (0, _slicedToArray2.default)(_ref4, 2),
291
+ key = _ref5[0],
292
+ value = _ref5[1];
274
293
  var normalizedKey = key.replace('?', '');
275
294
  _this.attributes[normalizedKey] = value;
276
295
  Object.defineProperty(_this, normalizedKey, {
@@ -291,117 +310,117 @@ _class = ApiKey;
291
310
  // filter_gteq - object - If set, return records where the specified field is greater than or equal the supplied value. Valid fields are `expires_at`.
292
311
  // filter_lt - object - If set, return records where the specified field is less than the supplied value. Valid fields are `expires_at`.
293
312
  // filter_lteq - object - If set, return records where the specified field is less than or equal the supplied value. Valid fields are `expires_at`.
294
- (0, _defineProperty2.default)(ApiKey, "list", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
313
+ (0, _defineProperty2.default)(ApiKey, "list", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4() {
295
314
  var _response$data;
296
315
  var params,
297
316
  options,
298
317
  response,
299
- _args3 = arguments;
300
- return _regenerator.default.wrap(function _callee3$(_context3) {
301
- while (1) switch (_context3.prev = _context3.next) {
318
+ _args4 = arguments;
319
+ return _regenerator.default.wrap(function _callee4$(_context4) {
320
+ while (1) switch (_context4.prev = _context4.next) {
302
321
  case 0:
303
- params = _args3.length > 0 && _args3[0] !== undefined ? _args3[0] : {};
304
- options = _args3.length > 1 && _args3[1] !== undefined ? _args3[1] : {};
322
+ params = _args4.length > 0 && _args4[0] !== undefined ? _args4[0] : {};
323
+ options = _args4.length > 1 && _args4[1] !== undefined ? _args4[1] : {};
305
324
  if (!(params['user_id'] && !(0, _utils.isInt)(params['user_id']))) {
306
- _context3.next = 4;
325
+ _context4.next = 4;
307
326
  break;
308
327
  }
309
328
  throw new errors.InvalidParameterError("Bad parameter: user_id must be of type Int, received ".concat((0, _utils.getType)(params['user_id'])));
310
329
  case 4:
311
330
  if (!(params['cursor'] && !(0, _utils.isString)(params['cursor']))) {
312
- _context3.next = 6;
331
+ _context4.next = 6;
313
332
  break;
314
333
  }
315
334
  throw new errors.InvalidParameterError("Bad parameter: cursor must be of type String, received ".concat((0, _utils.getType)(params['cursor'])));
316
335
  case 6:
317
336
  if (!(params['per_page'] && !(0, _utils.isInt)(params['per_page']))) {
318
- _context3.next = 8;
337
+ _context4.next = 8;
319
338
  break;
320
339
  }
321
340
  throw new errors.InvalidParameterError("Bad parameter: per_page must be of type Int, received ".concat((0, _utils.getType)(params['per_page'])));
322
341
  case 8:
323
- _context3.next = 10;
342
+ _context4.next = 10;
324
343
  return _Api.default.sendRequest("/api_keys", 'GET', params, options);
325
344
  case 10:
326
- response = _context3.sent;
327
- 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) {
345
+ response = _context4.sent;
346
+ 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) {
328
347
  return new _class(obj, options);
329
348
  })) || []);
330
349
  case 12:
331
350
  case "end":
332
- return _context3.stop();
351
+ return _context4.stop();
333
352
  }
334
- }, _callee3);
353
+ }, _callee4);
335
354
  })));
336
355
  (0, _defineProperty2.default)(ApiKey, "all", function () {
337
356
  var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
338
357
  var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
339
358
  return _class.list(params, options);
340
359
  });
341
- (0, _defineProperty2.default)(ApiKey, "findCurrent", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4() {
360
+ (0, _defineProperty2.default)(ApiKey, "findCurrent", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5() {
342
361
  var options,
343
362
  response,
344
- _args4 = arguments;
345
- return _regenerator.default.wrap(function _callee4$(_context4) {
346
- while (1) switch (_context4.prev = _context4.next) {
363
+ _args5 = arguments;
364
+ return _regenerator.default.wrap(function _callee5$(_context5) {
365
+ while (1) switch (_context5.prev = _context5.next) {
347
366
  case 0:
348
- options = _args4.length > 0 && _args4[0] !== undefined ? _args4[0] : {};
349
- _context4.next = 3;
367
+ options = _args5.length > 0 && _args5[0] !== undefined ? _args5[0] : {};
368
+ _context5.next = 3;
350
369
  return _Api.default.sendRequest("/api_key", 'GET', {}, options);
351
370
  case 3:
352
- response = _context4.sent;
353
- return _context4.abrupt("return", new _class(response === null || response === void 0 ? void 0 : response.data, options));
371
+ response = _context5.sent;
372
+ return _context5.abrupt("return", new _class(response === null || response === void 0 ? void 0 : response.data, options));
354
373
  case 5:
355
374
  case "end":
356
- return _context4.stop();
375
+ return _context5.stop();
357
376
  }
358
- }, _callee4);
377
+ }, _callee5);
359
378
  })));
360
379
  // Parameters:
361
380
  // id (required) - int64 - Api Key ID.
362
381
  (0, _defineProperty2.default)(ApiKey, "find", /*#__PURE__*/function () {
363
- var _ref7 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5(id) {
382
+ var _ref8 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6(id) {
364
383
  var params,
365
384
  options,
366
385
  response,
367
- _args5 = arguments;
368
- return _regenerator.default.wrap(function _callee5$(_context5) {
369
- while (1) switch (_context5.prev = _context5.next) {
386
+ _args6 = arguments;
387
+ return _regenerator.default.wrap(function _callee6$(_context6) {
388
+ while (1) switch (_context6.prev = _context6.next) {
370
389
  case 0:
371
- params = _args5.length > 1 && _args5[1] !== undefined ? _args5[1] : {};
372
- options = _args5.length > 2 && _args5[2] !== undefined ? _args5[2] : {};
390
+ params = _args6.length > 1 && _args6[1] !== undefined ? _args6[1] : {};
391
+ options = _args6.length > 2 && _args6[2] !== undefined ? _args6[2] : {};
373
392
  if ((0, _utils.isObject)(params)) {
374
- _context5.next = 4;
393
+ _context6.next = 4;
375
394
  break;
376
395
  }
377
396
  throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
378
397
  case 4:
379
398
  params['id'] = id;
380
399
  if (params['id']) {
381
- _context5.next = 7;
400
+ _context6.next = 7;
382
401
  break;
383
402
  }
384
403
  throw new errors.MissingParameterError('Parameter missing: id');
385
404
  case 7:
386
405
  if (!(params['id'] && !(0, _utils.isInt)(params['id']))) {
387
- _context5.next = 9;
406
+ _context6.next = 9;
388
407
  break;
389
408
  }
390
409
  throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params['id'])));
391
410
  case 9:
392
- _context5.next = 11;
411
+ _context6.next = 11;
393
412
  return _Api.default.sendRequest("/api_keys/".concat(encodeURIComponent(params['id'])), 'GET', params, options);
394
413
  case 11:
395
- response = _context5.sent;
396
- return _context5.abrupt("return", new _class(response === null || response === void 0 ? void 0 : response.data, options));
414
+ response = _context6.sent;
415
+ return _context6.abrupt("return", new _class(response === null || response === void 0 ? void 0 : response.data, options));
397
416
  case 13:
398
417
  case "end":
399
- return _context5.stop();
418
+ return _context6.stop();
400
419
  }
401
- }, _callee5);
420
+ }, _callee6);
402
421
  }));
403
422
  return function (_x) {
404
- return _ref7.apply(this, arguments);
423
+ return _ref8.apply(this, arguments);
405
424
  };
406
425
  }());
407
426
  (0, _defineProperty2.default)(ApiKey, "get", function (id) {
@@ -416,124 +435,124 @@ _class = ApiKey;
416
435
  // expires_at - string - API Key expiration date
417
436
  // permission_set - string - Permissions for this API Key. Keys with the `desktop_app` permission set only have the ability to do the functions provided in our Desktop App (File and Share Link operations). Additional permission sets may become available in the future, such as for a Site Admin to give a key with no administrator privileges. If you have ideas for permission sets, please let us know.
418
437
  // path - string - Folder path restriction for this api key.
419
- (0, _defineProperty2.default)(ApiKey, "create", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6() {
438
+ (0, _defineProperty2.default)(ApiKey, "create", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee7() {
420
439
  var params,
421
440
  options,
422
441
  response,
423
- _args6 = arguments;
424
- return _regenerator.default.wrap(function _callee6$(_context6) {
425
- while (1) switch (_context6.prev = _context6.next) {
442
+ _args7 = arguments;
443
+ return _regenerator.default.wrap(function _callee7$(_context7) {
444
+ while (1) switch (_context7.prev = _context7.next) {
426
445
  case 0:
427
- params = _args6.length > 0 && _args6[0] !== undefined ? _args6[0] : {};
428
- options = _args6.length > 1 && _args6[1] !== undefined ? _args6[1] : {};
446
+ params = _args7.length > 0 && _args7[0] !== undefined ? _args7[0] : {};
447
+ options = _args7.length > 1 && _args7[1] !== undefined ? _args7[1] : {};
429
448
  if (!(params['user_id'] && !(0, _utils.isInt)(params['user_id']))) {
430
- _context6.next = 4;
449
+ _context7.next = 4;
431
450
  break;
432
451
  }
433
452
  throw new errors.InvalidParameterError("Bad parameter: user_id must be of type Int, received ".concat((0, _utils.getType)(params['user_id'])));
434
453
  case 4:
435
454
  if (!(params['name'] && !(0, _utils.isString)(params['name']))) {
436
- _context6.next = 6;
455
+ _context7.next = 6;
437
456
  break;
438
457
  }
439
458
  throw new errors.InvalidParameterError("Bad parameter: name must be of type String, received ".concat((0, _utils.getType)(params['name'])));
440
459
  case 6:
441
460
  if (!(params['description'] && !(0, _utils.isString)(params['description']))) {
442
- _context6.next = 8;
461
+ _context7.next = 8;
443
462
  break;
444
463
  }
445
464
  throw new errors.InvalidParameterError("Bad parameter: description must be of type String, received ".concat((0, _utils.getType)(params['description'])));
446
465
  case 8:
447
466
  if (!(params['expires_at'] && !(0, _utils.isString)(params['expires_at']))) {
448
- _context6.next = 10;
467
+ _context7.next = 10;
449
468
  break;
450
469
  }
451
470
  throw new errors.InvalidParameterError("Bad parameter: expires_at must be of type String, received ".concat((0, _utils.getType)(params['expires_at'])));
452
471
  case 10:
453
472
  if (!(params['permission_set'] && !(0, _utils.isString)(params['permission_set']))) {
454
- _context6.next = 12;
473
+ _context7.next = 12;
455
474
  break;
456
475
  }
457
476
  throw new errors.InvalidParameterError("Bad parameter: permission_set must be of type String, received ".concat((0, _utils.getType)(params['permission_set'])));
458
477
  case 12:
459
478
  if (!(params['path'] && !(0, _utils.isString)(params['path']))) {
460
- _context6.next = 14;
479
+ _context7.next = 14;
461
480
  break;
462
481
  }
463
482
  throw new errors.InvalidParameterError("Bad parameter: path must be of type String, received ".concat((0, _utils.getType)(params['path'])));
464
483
  case 14:
465
- _context6.next = 16;
484
+ _context7.next = 16;
466
485
  return _Api.default.sendRequest("/api_keys", 'POST', params, options);
467
486
  case 16:
468
- response = _context6.sent;
469
- return _context6.abrupt("return", new _class(response === null || response === void 0 ? void 0 : response.data, options));
487
+ response = _context7.sent;
488
+ return _context7.abrupt("return", new _class(response === null || response === void 0 ? void 0 : response.data, options));
470
489
  case 18:
471
490
  case "end":
472
- return _context6.stop();
491
+ return _context7.stop();
473
492
  }
474
- }, _callee6);
493
+ }, _callee7);
475
494
  })));
476
495
  // Parameters:
477
496
  // expires_at - string - API Key expiration date
478
497
  // name - string - Internal name for the API Key. For your use.
479
498
  // permission_set - string - Permissions for this API Key. Keys with the `desktop_app` permission set only have the ability to do the functions provided in our Desktop App (File and Share Link operations). Additional permission sets may become available in the future, such as for a Site Admin to give a key with no administrator privileges. If you have ideas for permission sets, please let us know.
480
- (0, _defineProperty2.default)(ApiKey, "updateCurrent", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee7() {
499
+ (0, _defineProperty2.default)(ApiKey, "updateCurrent", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee8() {
481
500
  var params,
482
501
  options,
483
502
  response,
484
- _args7 = arguments;
485
- return _regenerator.default.wrap(function _callee7$(_context7) {
486
- while (1) switch (_context7.prev = _context7.next) {
503
+ _args8 = arguments;
504
+ return _regenerator.default.wrap(function _callee8$(_context8) {
505
+ while (1) switch (_context8.prev = _context8.next) {
487
506
  case 0:
488
- params = _args7.length > 0 && _args7[0] !== undefined ? _args7[0] : {};
489
- options = _args7.length > 1 && _args7[1] !== undefined ? _args7[1] : {};
507
+ params = _args8.length > 0 && _args8[0] !== undefined ? _args8[0] : {};
508
+ options = _args8.length > 1 && _args8[1] !== undefined ? _args8[1] : {};
490
509
  if (!(params['expires_at'] && !(0, _utils.isString)(params['expires_at']))) {
491
- _context7.next = 4;
510
+ _context8.next = 4;
492
511
  break;
493
512
  }
494
513
  throw new errors.InvalidParameterError("Bad parameter: expires_at must be of type String, received ".concat((0, _utils.getType)(params['expires_at'])));
495
514
  case 4:
496
515
  if (!(params['name'] && !(0, _utils.isString)(params['name']))) {
497
- _context7.next = 6;
516
+ _context8.next = 6;
498
517
  break;
499
518
  }
500
519
  throw new errors.InvalidParameterError("Bad parameter: name must be of type String, received ".concat((0, _utils.getType)(params['name'])));
501
520
  case 6:
502
521
  if (!(params['permission_set'] && !(0, _utils.isString)(params['permission_set']))) {
503
- _context7.next = 8;
522
+ _context8.next = 8;
504
523
  break;
505
524
  }
506
525
  throw new errors.InvalidParameterError("Bad parameter: permission_set must be of type String, received ".concat((0, _utils.getType)(params['permission_set'])));
507
526
  case 8:
508
- _context7.next = 10;
527
+ _context8.next = 10;
509
528
  return _Api.default.sendRequest("/api_key", 'PATCH', params, options);
510
529
  case 10:
511
- response = _context7.sent;
512
- return _context7.abrupt("return", new _class(response === null || response === void 0 ? void 0 : response.data, options));
530
+ response = _context8.sent;
531
+ return _context8.abrupt("return", new _class(response === null || response === void 0 ? void 0 : response.data, options));
513
532
  case 12:
514
533
  case "end":
515
- return _context7.stop();
534
+ return _context8.stop();
516
535
  }
517
- }, _callee7);
536
+ }, _callee8);
518
537
  })));
519
- (0, _defineProperty2.default)(ApiKey, "deleteCurrent", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee8() {
538
+ (0, _defineProperty2.default)(ApiKey, "deleteCurrent", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee9() {
520
539
  var options,
521
540
  response,
522
- _args8 = arguments;
523
- return _regenerator.default.wrap(function _callee8$(_context8) {
524
- while (1) switch (_context8.prev = _context8.next) {
541
+ _args9 = arguments;
542
+ return _regenerator.default.wrap(function _callee9$(_context9) {
543
+ while (1) switch (_context9.prev = _context9.next) {
525
544
  case 0:
526
- options = _args8.length > 0 && _args8[0] !== undefined ? _args8[0] : {};
527
- _context8.next = 3;
545
+ options = _args9.length > 0 && _args9[0] !== undefined ? _args9[0] : {};
546
+ _context9.next = 3;
528
547
  return _Api.default.sendRequest("/api_key", 'DELETE', {}, options);
529
548
  case 3:
530
- response = _context8.sent;
531
- return _context8.abrupt("return", response === null || response === void 0 ? void 0 : response.data);
549
+ response = _context9.sent;
550
+ return _context9.abrupt("return");
532
551
  case 5:
533
552
  case "end":
534
- return _context8.stop();
553
+ return _context9.stop();
535
554
  }
536
- }, _callee8);
555
+ }, _callee9);
537
556
  })));
538
557
  var _default = exports.default = ApiKey;
539
558
  module.exports = ApiKey;