files.com 1.0.474 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/_VERSION +1 -1
- package/lib/Files.js +1 -1
- package/lib/models/ActionNotificationExport.js +63 -49
- package/lib/models/ActionWebhookFailure.js +1 -1
- package/lib/models/ApiKey.js +113 -94
- package/lib/models/As2Partner.js +81 -62
- package/lib/models/As2Station.js +79 -60
- package/lib/models/Automation.js +90 -71
- package/lib/models/Behavior.js +114 -95
- package/lib/models/Bundle.js +90 -71
- package/lib/models/BundleNotification.js +75 -56
- package/lib/models/BundleRecipient.js +61 -47
- package/lib/models/Clickwrap.js +77 -58
- package/lib/models/ExternalEvent.js +71 -57
- package/lib/models/File.js +166 -154
- package/lib/models/FileComment.js +65 -46
- package/lib/models/FileCommentReaction.js +44 -30
- package/lib/models/Folder.js +58 -46
- package/lib/models/FormFieldSet.js +76 -57
- package/lib/models/GpgKey.js +79 -60
- package/lib/models/Group.js +78 -59
- package/lib/models/GroupUser.js +63 -44
- package/lib/models/HistoryExport.js +76 -62
- package/lib/models/InboxRecipient.js +61 -47
- package/lib/models/Lock.js +56 -44
- package/lib/models/Message.js +82 -63
- package/lib/models/MessageComment.js +78 -59
- package/lib/models/MessageCommentReaction.js +73 -59
- package/lib/models/MessageReaction.js +73 -59
- package/lib/models/Notification.js +84 -65
- package/lib/models/Permission.js +60 -46
- package/lib/models/Project.js +74 -55
- package/lib/models/PublicKey.js +78 -59
- package/lib/models/RemoteServer.js +147 -128
- package/lib/models/Request.js +76 -62
- package/lib/models/Session.js +53 -39
- package/lib/models/SftpHostKey.js +74 -55
- package/lib/models/ShareGroup.js +79 -60
- package/lib/models/Snapshot.js +75 -56
- package/lib/models/SsoStrategy.js +1 -1
- package/lib/models/Style.js +37 -23
- package/lib/models/User.js +104 -85
- package/lib/models/UserRequest.js +73 -59
- package/lib/models/WebhookTest.js +46 -32
- package/package.json +1 -1
- package/src/Files.js +1 -1
- package/src/models/ActionNotificationExport.js +2 -2
- package/src/models/ActionWebhookFailure.js +1 -1
- package/src/models/ApiKey.js +7 -5
- package/src/models/As2Partner.js +6 -4
- package/src/models/As2Station.js +6 -4
- package/src/models/Automation.js +7 -5
- package/src/models/Behavior.js +7 -5
- package/src/models/Bundle.js +7 -5
- package/src/models/BundleNotification.js +6 -4
- package/src/models/BundleRecipient.js +2 -2
- package/src/models/Clickwrap.js +6 -4
- package/src/models/ExternalEvent.js +2 -2
- package/src/models/File.js +3 -3
- package/src/models/FileComment.js +6 -4
- package/src/models/FileCommentReaction.js +3 -3
- package/src/models/Folder.js +2 -2
- package/src/models/FormFieldSet.js +6 -4
- package/src/models/GpgKey.js +6 -4
- package/src/models/Group.js +6 -4
- package/src/models/GroupUser.js +6 -4
- package/src/models/HistoryExport.js +2 -2
- package/src/models/InboxRecipient.js +2 -2
- package/src/models/Lock.js +3 -3
- package/src/models/Message.js +6 -4
- package/src/models/MessageComment.js +6 -4
- package/src/models/MessageCommentReaction.js +3 -3
- package/src/models/MessageReaction.js +3 -3
- package/src/models/Notification.js +6 -4
- package/src/models/Permission.js +3 -3
- package/src/models/Project.js +6 -4
- package/src/models/PublicKey.js +6 -4
- package/src/models/RemoteServer.js +6 -4
- package/src/models/Request.js +3 -3
- package/src/models/Session.js +3 -3
- package/src/models/SftpHostKey.js +6 -4
- package/src/models/ShareGroup.js +6 -4
- package/src/models/Snapshot.js +6 -4
- package/src/models/SsoStrategy.js +1 -1
- package/src/models/Style.js +6 -3
- package/src/models/User.js +9 -7
- package/src/models/UserRequest.js +3 -3
- package/src/models/WebhookTest.js +2 -2
package/lib/models/PublicKey.js
CHANGED
@@ -198,7 +198,7 @@ var PublicKey = /*#__PURE__*/(0, _createClass2.default)(function PublicKey() {
|
|
198
198
|
return _Api.default.sendRequest("/public_keys/".concat(encodeURIComponent(params['id'])), 'DELETE', params, _this.options);
|
199
199
|
case 16:
|
200
200
|
response = _context2.sent;
|
201
|
-
return _context2.abrupt("return"
|
201
|
+
return _context2.abrupt("return");
|
202
202
|
case 18:
|
203
203
|
case "end":
|
204
204
|
return _context2.stop();
|
@@ -209,19 +209,38 @@ var PublicKey = /*#__PURE__*/(0, _createClass2.default)(function PublicKey() {
|
|
209
209
|
var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
210
210
|
return _this.delete(params);
|
211
211
|
});
|
212
|
-
(0, _defineProperty2.default)(this, "save", function () {
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
212
|
+
(0, _defineProperty2.default)(this, "save", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
|
213
|
+
var newObject, _newObject;
|
214
|
+
return _regenerator.default.wrap(function _callee3$(_context3) {
|
215
|
+
while (1) switch (_context3.prev = _context3.next) {
|
216
|
+
case 0:
|
217
|
+
if (!_this.attributes['id']) {
|
218
|
+
_context3.next = 8;
|
219
|
+
break;
|
220
|
+
}
|
221
|
+
_context3.next = 3;
|
222
|
+
return _this.update(_this.attributes);
|
223
|
+
case 3:
|
224
|
+
newObject = _context3.sent;
|
225
|
+
_this.attributes = _objectSpread({}, newObject.attributes);
|
226
|
+
return _context3.abrupt("return", true);
|
227
|
+
case 8:
|
228
|
+
_context3.next = 10;
|
229
|
+
return PublicKey.create(_this.attributes, _this.options);
|
230
|
+
case 10:
|
231
|
+
_newObject = _context3.sent;
|
232
|
+
_this.attributes = _objectSpread({}, _newObject.attributes);
|
233
|
+
return _context3.abrupt("return", true);
|
234
|
+
case 13:
|
235
|
+
case "end":
|
236
|
+
return _context3.stop();
|
237
|
+
}
|
238
|
+
}, _callee3);
|
239
|
+
})));
|
240
|
+
Object.entries(attributes).forEach(function (_ref4) {
|
241
|
+
var _ref5 = (0, _slicedToArray2.default)(_ref4, 2),
|
242
|
+
key = _ref5[0],
|
243
|
+
value = _ref5[1];
|
225
244
|
var normalizedKey = key.replace('?', '');
|
226
245
|
_this.attributes[normalizedKey] = value;
|
227
246
|
Object.defineProperty(_this, normalizedKey, {
|
@@ -236,47 +255,47 @@ _class = PublicKey;
|
|
236
255
|
// user_id - int64 - User ID. Provide a value of `0` to operate the current session's user.
|
237
256
|
// 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.
|
238
257
|
// per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
|
239
|
-
(0, _defineProperty2.default)(PublicKey, "list", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
258
|
+
(0, _defineProperty2.default)(PublicKey, "list", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4() {
|
240
259
|
var _response$data;
|
241
260
|
var params,
|
242
261
|
options,
|
243
262
|
response,
|
244
|
-
|
245
|
-
return _regenerator.default.wrap(function
|
246
|
-
while (1) switch (
|
263
|
+
_args4 = arguments;
|
264
|
+
return _regenerator.default.wrap(function _callee4$(_context4) {
|
265
|
+
while (1) switch (_context4.prev = _context4.next) {
|
247
266
|
case 0:
|
248
|
-
params =
|
249
|
-
options =
|
267
|
+
params = _args4.length > 0 && _args4[0] !== undefined ? _args4[0] : {};
|
268
|
+
options = _args4.length > 1 && _args4[1] !== undefined ? _args4[1] : {};
|
250
269
|
if (!(params['user_id'] && !(0, _utils.isInt)(params['user_id']))) {
|
251
|
-
|
270
|
+
_context4.next = 4;
|
252
271
|
break;
|
253
272
|
}
|
254
273
|
throw new errors.InvalidParameterError("Bad parameter: user_id must be of type Int, received ".concat((0, _utils.getType)(params['user_id'])));
|
255
274
|
case 4:
|
256
275
|
if (!(params['cursor'] && !(0, _utils.isString)(params['cursor']))) {
|
257
|
-
|
276
|
+
_context4.next = 6;
|
258
277
|
break;
|
259
278
|
}
|
260
279
|
throw new errors.InvalidParameterError("Bad parameter: cursor must be of type String, received ".concat((0, _utils.getType)(params['cursor'])));
|
261
280
|
case 6:
|
262
281
|
if (!(params['per_page'] && !(0, _utils.isInt)(params['per_page']))) {
|
263
|
-
|
282
|
+
_context4.next = 8;
|
264
283
|
break;
|
265
284
|
}
|
266
285
|
throw new errors.InvalidParameterError("Bad parameter: per_page must be of type Int, received ".concat((0, _utils.getType)(params['per_page'])));
|
267
286
|
case 8:
|
268
|
-
|
287
|
+
_context4.next = 10;
|
269
288
|
return _Api.default.sendRequest("/public_keys", 'GET', params, options);
|
270
289
|
case 10:
|
271
|
-
response =
|
272
|
-
return
|
290
|
+
response = _context4.sent;
|
291
|
+
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) {
|
273
292
|
return new _class(obj, options);
|
274
293
|
})) || []);
|
275
294
|
case 12:
|
276
295
|
case "end":
|
277
|
-
return
|
296
|
+
return _context4.stop();
|
278
297
|
}
|
279
|
-
},
|
298
|
+
}, _callee4);
|
280
299
|
})));
|
281
300
|
(0, _defineProperty2.default)(PublicKey, "all", function () {
|
282
301
|
var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
@@ -286,48 +305,48 @@ _class = PublicKey;
|
|
286
305
|
// Parameters:
|
287
306
|
// id (required) - int64 - Public Key ID.
|
288
307
|
(0, _defineProperty2.default)(PublicKey, "find", /*#__PURE__*/function () {
|
289
|
-
var
|
308
|
+
var _ref7 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5(id) {
|
290
309
|
var params,
|
291
310
|
options,
|
292
311
|
response,
|
293
|
-
|
294
|
-
return _regenerator.default.wrap(function
|
295
|
-
while (1) switch (
|
312
|
+
_args5 = arguments;
|
313
|
+
return _regenerator.default.wrap(function _callee5$(_context5) {
|
314
|
+
while (1) switch (_context5.prev = _context5.next) {
|
296
315
|
case 0:
|
297
|
-
params =
|
298
|
-
options =
|
316
|
+
params = _args5.length > 1 && _args5[1] !== undefined ? _args5[1] : {};
|
317
|
+
options = _args5.length > 2 && _args5[2] !== undefined ? _args5[2] : {};
|
299
318
|
if ((0, _utils.isObject)(params)) {
|
300
|
-
|
319
|
+
_context5.next = 4;
|
301
320
|
break;
|
302
321
|
}
|
303
322
|
throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
|
304
323
|
case 4:
|
305
324
|
params['id'] = id;
|
306
325
|
if (params['id']) {
|
307
|
-
|
326
|
+
_context5.next = 7;
|
308
327
|
break;
|
309
328
|
}
|
310
329
|
throw new errors.MissingParameterError('Parameter missing: id');
|
311
330
|
case 7:
|
312
331
|
if (!(params['id'] && !(0, _utils.isInt)(params['id']))) {
|
313
|
-
|
332
|
+
_context5.next = 9;
|
314
333
|
break;
|
315
334
|
}
|
316
335
|
throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params['id'])));
|
317
336
|
case 9:
|
318
|
-
|
337
|
+
_context5.next = 11;
|
319
338
|
return _Api.default.sendRequest("/public_keys/".concat(encodeURIComponent(params['id'])), 'GET', params, options);
|
320
339
|
case 11:
|
321
|
-
response =
|
322
|
-
return
|
340
|
+
response = _context5.sent;
|
341
|
+
return _context5.abrupt("return", new _class(response === null || response === void 0 ? void 0 : response.data, options));
|
323
342
|
case 13:
|
324
343
|
case "end":
|
325
|
-
return
|
344
|
+
return _context5.stop();
|
326
345
|
}
|
327
|
-
},
|
346
|
+
}, _callee5);
|
328
347
|
}));
|
329
348
|
return function (_x) {
|
330
|
-
return
|
349
|
+
return _ref7.apply(this, arguments);
|
331
350
|
};
|
332
351
|
}());
|
333
352
|
(0, _defineProperty2.default)(PublicKey, "get", function (id) {
|
@@ -339,56 +358,56 @@ _class = PublicKey;
|
|
339
358
|
// user_id - int64 - User ID. Provide a value of `0` to operate the current session's user.
|
340
359
|
// title (required) - string - Internal reference for key.
|
341
360
|
// public_key (required) - string - Actual contents of SSH key.
|
342
|
-
(0, _defineProperty2.default)(PublicKey, "create", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
361
|
+
(0, _defineProperty2.default)(PublicKey, "create", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6() {
|
343
362
|
var params,
|
344
363
|
options,
|
345
364
|
response,
|
346
|
-
|
347
|
-
return _regenerator.default.wrap(function
|
348
|
-
while (1) switch (
|
365
|
+
_args6 = arguments;
|
366
|
+
return _regenerator.default.wrap(function _callee6$(_context6) {
|
367
|
+
while (1) switch (_context6.prev = _context6.next) {
|
349
368
|
case 0:
|
350
|
-
params =
|
351
|
-
options =
|
369
|
+
params = _args6.length > 0 && _args6[0] !== undefined ? _args6[0] : {};
|
370
|
+
options = _args6.length > 1 && _args6[1] !== undefined ? _args6[1] : {};
|
352
371
|
if (params['title']) {
|
353
|
-
|
372
|
+
_context6.next = 4;
|
354
373
|
break;
|
355
374
|
}
|
356
375
|
throw new errors.MissingParameterError('Parameter missing: title');
|
357
376
|
case 4:
|
358
377
|
if (params['public_key']) {
|
359
|
-
|
378
|
+
_context6.next = 6;
|
360
379
|
break;
|
361
380
|
}
|
362
381
|
throw new errors.MissingParameterError('Parameter missing: public_key');
|
363
382
|
case 6:
|
364
383
|
if (!(params['user_id'] && !(0, _utils.isInt)(params['user_id']))) {
|
365
|
-
|
384
|
+
_context6.next = 8;
|
366
385
|
break;
|
367
386
|
}
|
368
387
|
throw new errors.InvalidParameterError("Bad parameter: user_id must be of type Int, received ".concat((0, _utils.getType)(params['user_id'])));
|
369
388
|
case 8:
|
370
389
|
if (!(params['title'] && !(0, _utils.isString)(params['title']))) {
|
371
|
-
|
390
|
+
_context6.next = 10;
|
372
391
|
break;
|
373
392
|
}
|
374
393
|
throw new errors.InvalidParameterError("Bad parameter: title must be of type String, received ".concat((0, _utils.getType)(params['title'])));
|
375
394
|
case 10:
|
376
395
|
if (!(params['public_key'] && !(0, _utils.isString)(params['public_key']))) {
|
377
|
-
|
396
|
+
_context6.next = 12;
|
378
397
|
break;
|
379
398
|
}
|
380
399
|
throw new errors.InvalidParameterError("Bad parameter: public_key must be of type String, received ".concat((0, _utils.getType)(params['public_key'])));
|
381
400
|
case 12:
|
382
|
-
|
401
|
+
_context6.next = 14;
|
383
402
|
return _Api.default.sendRequest("/public_keys", 'POST', params, options);
|
384
403
|
case 14:
|
385
|
-
response =
|
386
|
-
return
|
404
|
+
response = _context6.sent;
|
405
|
+
return _context6.abrupt("return", new _class(response === null || response === void 0 ? void 0 : response.data, options));
|
387
406
|
case 16:
|
388
407
|
case "end":
|
389
|
-
return
|
408
|
+
return _context6.stop();
|
390
409
|
}
|
391
|
-
},
|
410
|
+
}, _callee6);
|
392
411
|
})));
|
393
412
|
var _default = exports.default = PublicKey;
|
394
413
|
module.exports = PublicKey;
|