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.
- 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/Snapshot.js
CHANGED
@@ -201,7 +201,7 @@ var Snapshot = /*#__PURE__*/(0, _createClass2.default)(function Snapshot() {
|
|
201
201
|
return _Api.default.sendRequest("/snapshots/".concat(encodeURIComponent(params['id'])), 'DELETE', params, _this.options);
|
202
202
|
case 16:
|
203
203
|
response = _context2.sent;
|
204
|
-
return _context2.abrupt("return"
|
204
|
+
return _context2.abrupt("return");
|
205
205
|
case 18:
|
206
206
|
case "end":
|
207
207
|
return _context2.stop();
|
@@ -212,19 +212,38 @@ var Snapshot = /*#__PURE__*/(0, _createClass2.default)(function Snapshot() {
|
|
212
212
|
var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
213
213
|
return _this.delete(params);
|
214
214
|
});
|
215
|
-
(0, _defineProperty2.default)(this, "save", function () {
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
215
|
+
(0, _defineProperty2.default)(this, "save", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
|
216
|
+
var newObject, _newObject;
|
217
|
+
return _regenerator.default.wrap(function _callee3$(_context3) {
|
218
|
+
while (1) switch (_context3.prev = _context3.next) {
|
219
|
+
case 0:
|
220
|
+
if (!_this.attributes['id']) {
|
221
|
+
_context3.next = 8;
|
222
|
+
break;
|
223
|
+
}
|
224
|
+
_context3.next = 3;
|
225
|
+
return _this.update(_this.attributes);
|
226
|
+
case 3:
|
227
|
+
newObject = _context3.sent;
|
228
|
+
_this.attributes = _objectSpread({}, newObject.attributes);
|
229
|
+
return _context3.abrupt("return", true);
|
230
|
+
case 8:
|
231
|
+
_context3.next = 10;
|
232
|
+
return Snapshot.create(_this.attributes, _this.options);
|
233
|
+
case 10:
|
234
|
+
_newObject = _context3.sent;
|
235
|
+
_this.attributes = _objectSpread({}, _newObject.attributes);
|
236
|
+
return _context3.abrupt("return", true);
|
237
|
+
case 13:
|
238
|
+
case "end":
|
239
|
+
return _context3.stop();
|
240
|
+
}
|
241
|
+
}, _callee3);
|
242
|
+
})));
|
243
|
+
Object.entries(attributes).forEach(function (_ref4) {
|
244
|
+
var _ref5 = (0, _slicedToArray2.default)(_ref4, 2),
|
245
|
+
key = _ref5[0],
|
246
|
+
value = _ref5[1];
|
228
247
|
var normalizedKey = key.replace('?', '');
|
229
248
|
_this.attributes[normalizedKey] = value;
|
230
249
|
Object.defineProperty(_this, normalizedKey, {
|
@@ -238,41 +257,41 @@ _class = Snapshot;
|
|
238
257
|
// Parameters:
|
239
258
|
// 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.
|
240
259
|
// per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
|
241
|
-
(0, _defineProperty2.default)(Snapshot, "list", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
260
|
+
(0, _defineProperty2.default)(Snapshot, "list", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4() {
|
242
261
|
var _response$data;
|
243
262
|
var params,
|
244
263
|
options,
|
245
264
|
response,
|
246
|
-
|
247
|
-
return _regenerator.default.wrap(function
|
248
|
-
while (1) switch (
|
265
|
+
_args4 = arguments;
|
266
|
+
return _regenerator.default.wrap(function _callee4$(_context4) {
|
267
|
+
while (1) switch (_context4.prev = _context4.next) {
|
249
268
|
case 0:
|
250
|
-
params =
|
251
|
-
options =
|
269
|
+
params = _args4.length > 0 && _args4[0] !== undefined ? _args4[0] : {};
|
270
|
+
options = _args4.length > 1 && _args4[1] !== undefined ? _args4[1] : {};
|
252
271
|
if (!(params['cursor'] && !(0, _utils.isString)(params['cursor']))) {
|
253
|
-
|
272
|
+
_context4.next = 4;
|
254
273
|
break;
|
255
274
|
}
|
256
275
|
throw new errors.InvalidParameterError("Bad parameter: cursor must be of type String, received ".concat((0, _utils.getType)(params['cursor'])));
|
257
276
|
case 4:
|
258
277
|
if (!(params['per_page'] && !(0, _utils.isInt)(params['per_page']))) {
|
259
|
-
|
278
|
+
_context4.next = 6;
|
260
279
|
break;
|
261
280
|
}
|
262
281
|
throw new errors.InvalidParameterError("Bad parameter: per_page must be of type Int, received ".concat((0, _utils.getType)(params['per_page'])));
|
263
282
|
case 6:
|
264
|
-
|
283
|
+
_context4.next = 8;
|
265
284
|
return _Api.default.sendRequest("/snapshots", 'GET', params, options);
|
266
285
|
case 8:
|
267
|
-
response =
|
268
|
-
return
|
286
|
+
response = _context4.sent;
|
287
|
+
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) {
|
269
288
|
return new _class(obj, options);
|
270
289
|
})) || []);
|
271
290
|
case 10:
|
272
291
|
case "end":
|
273
|
-
return
|
292
|
+
return _context4.stop();
|
274
293
|
}
|
275
|
-
},
|
294
|
+
}, _callee4);
|
276
295
|
})));
|
277
296
|
(0, _defineProperty2.default)(Snapshot, "all", function () {
|
278
297
|
var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
@@ -282,48 +301,48 @@ _class = Snapshot;
|
|
282
301
|
// Parameters:
|
283
302
|
// id (required) - int64 - Snapshot ID.
|
284
303
|
(0, _defineProperty2.default)(Snapshot, "find", /*#__PURE__*/function () {
|
285
|
-
var
|
304
|
+
var _ref7 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5(id) {
|
286
305
|
var params,
|
287
306
|
options,
|
288
307
|
response,
|
289
|
-
|
290
|
-
return _regenerator.default.wrap(function
|
291
|
-
while (1) switch (
|
308
|
+
_args5 = arguments;
|
309
|
+
return _regenerator.default.wrap(function _callee5$(_context5) {
|
310
|
+
while (1) switch (_context5.prev = _context5.next) {
|
292
311
|
case 0:
|
293
|
-
params =
|
294
|
-
options =
|
312
|
+
params = _args5.length > 1 && _args5[1] !== undefined ? _args5[1] : {};
|
313
|
+
options = _args5.length > 2 && _args5[2] !== undefined ? _args5[2] : {};
|
295
314
|
if ((0, _utils.isObject)(params)) {
|
296
|
-
|
315
|
+
_context5.next = 4;
|
297
316
|
break;
|
298
317
|
}
|
299
318
|
throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
|
300
319
|
case 4:
|
301
320
|
params['id'] = id;
|
302
321
|
if (params['id']) {
|
303
|
-
|
322
|
+
_context5.next = 7;
|
304
323
|
break;
|
305
324
|
}
|
306
325
|
throw new errors.MissingParameterError('Parameter missing: id');
|
307
326
|
case 7:
|
308
327
|
if (!(params['id'] && !(0, _utils.isInt)(params['id']))) {
|
309
|
-
|
328
|
+
_context5.next = 9;
|
310
329
|
break;
|
311
330
|
}
|
312
331
|
throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params['id'])));
|
313
332
|
case 9:
|
314
|
-
|
333
|
+
_context5.next = 11;
|
315
334
|
return _Api.default.sendRequest("/snapshots/".concat(encodeURIComponent(params['id'])), 'GET', params, options);
|
316
335
|
case 11:
|
317
|
-
response =
|
318
|
-
return
|
336
|
+
response = _context5.sent;
|
337
|
+
return _context5.abrupt("return", new _class(response === null || response === void 0 ? void 0 : response.data, options));
|
319
338
|
case 13:
|
320
339
|
case "end":
|
321
|
-
return
|
340
|
+
return _context5.stop();
|
322
341
|
}
|
323
|
-
},
|
342
|
+
}, _callee5);
|
324
343
|
}));
|
325
344
|
return function (_x) {
|
326
|
-
return
|
345
|
+
return _ref7.apply(this, arguments);
|
327
346
|
};
|
328
347
|
}());
|
329
348
|
(0, _defineProperty2.default)(Snapshot, "get", function (id) {
|
@@ -335,44 +354,44 @@ _class = Snapshot;
|
|
335
354
|
// expires_at - string - When the snapshot expires.
|
336
355
|
// name - string - A name for the snapshot.
|
337
356
|
// paths - array(string) - An array of paths to add to the snapshot.
|
338
|
-
(0, _defineProperty2.default)(Snapshot, "create", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
357
|
+
(0, _defineProperty2.default)(Snapshot, "create", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6() {
|
339
358
|
var params,
|
340
359
|
options,
|
341
360
|
response,
|
342
|
-
|
343
|
-
return _regenerator.default.wrap(function
|
344
|
-
while (1) switch (
|
361
|
+
_args6 = arguments;
|
362
|
+
return _regenerator.default.wrap(function _callee6$(_context6) {
|
363
|
+
while (1) switch (_context6.prev = _context6.next) {
|
345
364
|
case 0:
|
346
|
-
params =
|
347
|
-
options =
|
365
|
+
params = _args6.length > 0 && _args6[0] !== undefined ? _args6[0] : {};
|
366
|
+
options = _args6.length > 1 && _args6[1] !== undefined ? _args6[1] : {};
|
348
367
|
if (!(params['expires_at'] && !(0, _utils.isString)(params['expires_at']))) {
|
349
|
-
|
368
|
+
_context6.next = 4;
|
350
369
|
break;
|
351
370
|
}
|
352
371
|
throw new errors.InvalidParameterError("Bad parameter: expires_at must be of type String, received ".concat((0, _utils.getType)(params['expires_at'])));
|
353
372
|
case 4:
|
354
373
|
if (!(params['name'] && !(0, _utils.isString)(params['name']))) {
|
355
|
-
|
374
|
+
_context6.next = 6;
|
356
375
|
break;
|
357
376
|
}
|
358
377
|
throw new errors.InvalidParameterError("Bad parameter: name must be of type String, received ".concat((0, _utils.getType)(params['name'])));
|
359
378
|
case 6:
|
360
379
|
if (!(params['paths'] && !(0, _utils.isArray)(params['paths']))) {
|
361
|
-
|
380
|
+
_context6.next = 8;
|
362
381
|
break;
|
363
382
|
}
|
364
383
|
throw new errors.InvalidParameterError("Bad parameter: paths must be of type Array, received ".concat((0, _utils.getType)(params['paths'])));
|
365
384
|
case 8:
|
366
|
-
|
385
|
+
_context6.next = 10;
|
367
386
|
return _Api.default.sendRequest("/snapshots", 'POST', params, options);
|
368
387
|
case 10:
|
369
|
-
response =
|
370
|
-
return
|
388
|
+
response = _context6.sent;
|
389
|
+
return _context6.abrupt("return", new _class(response === null || response === void 0 ? void 0 : response.data, options));
|
371
390
|
case 12:
|
372
391
|
case "end":
|
373
|
-
return
|
392
|
+
return _context6.stop();
|
374
393
|
}
|
375
|
-
},
|
394
|
+
}, _callee6);
|
376
395
|
})));
|
377
396
|
var _default = exports.default = Snapshot;
|
378
397
|
module.exports = Snapshot;
|
@@ -255,7 +255,7 @@ var SsoStrategy = /*#__PURE__*/(0, _createClass2.default)(function SsoStrategy()
|
|
255
255
|
return _Api.default.sendRequest("/sso_strategies/".concat(encodeURIComponent(params['id']), "/sync"), 'POST', params, _this.options);
|
256
256
|
case 16:
|
257
257
|
response = _context.sent;
|
258
|
-
return _context.abrupt("return"
|
258
|
+
return _context.abrupt("return");
|
259
259
|
case 18:
|
260
260
|
case "end":
|
261
261
|
return _context.stop();
|
package/lib/models/Style.js
CHANGED
@@ -181,7 +181,7 @@ var Style = /*#__PURE__*/(0, _createClass2.default)(function Style() {
|
|
181
181
|
return _Api.default.sendRequest("/styles/".concat(encodeURIComponent(params['path'])), 'DELETE', params, _this.options);
|
182
182
|
case 16:
|
183
183
|
response = _context2.sent;
|
184
|
-
return _context2.abrupt("return"
|
184
|
+
return _context2.abrupt("return");
|
185
185
|
case 18:
|
186
186
|
case "end":
|
187
187
|
return _context2.stop();
|
@@ -192,13 +192,27 @@ var Style = /*#__PURE__*/(0, _createClass2.default)(function Style() {
|
|
192
192
|
var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
193
193
|
return _this.delete(params);
|
194
194
|
});
|
195
|
-
(0, _defineProperty2.default)(this, "save", function () {
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
195
|
+
(0, _defineProperty2.default)(this, "save", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
|
196
|
+
var newObject;
|
197
|
+
return _regenerator.default.wrap(function _callee3$(_context3) {
|
198
|
+
while (1) switch (_context3.prev = _context3.next) {
|
199
|
+
case 0:
|
200
|
+
_context3.next = 2;
|
201
|
+
return _this.update(_this.attributes);
|
202
|
+
case 2:
|
203
|
+
newObject = _context3.sent;
|
204
|
+
_this.attributes = _objectSpread({}, newObject.attributes);
|
205
|
+
return _context3.abrupt("return", true);
|
206
|
+
case 5:
|
207
|
+
case "end":
|
208
|
+
return _context3.stop();
|
209
|
+
}
|
210
|
+
}, _callee3);
|
211
|
+
})));
|
212
|
+
Object.entries(attributes).forEach(function (_ref4) {
|
213
|
+
var _ref5 = (0, _slicedToArray2.default)(_ref4, 2),
|
214
|
+
key = _ref5[0],
|
215
|
+
value = _ref5[1];
|
202
216
|
var normalizedKey = key.replace('?', '');
|
203
217
|
_this.attributes[normalizedKey] = value;
|
204
218
|
Object.defineProperty(_this, normalizedKey, {
|
@@ -212,48 +226,48 @@ _class = Style;
|
|
212
226
|
// Parameters:
|
213
227
|
// path (required) - string - Style path.
|
214
228
|
(0, _defineProperty2.default)(Style, "find", /*#__PURE__*/function () {
|
215
|
-
var
|
229
|
+
var _ref6 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4(path) {
|
216
230
|
var params,
|
217
231
|
options,
|
218
232
|
response,
|
219
|
-
|
220
|
-
return _regenerator.default.wrap(function
|
221
|
-
while (1) switch (
|
233
|
+
_args4 = arguments;
|
234
|
+
return _regenerator.default.wrap(function _callee4$(_context4) {
|
235
|
+
while (1) switch (_context4.prev = _context4.next) {
|
222
236
|
case 0:
|
223
|
-
params =
|
224
|
-
options =
|
237
|
+
params = _args4.length > 1 && _args4[1] !== undefined ? _args4[1] : {};
|
238
|
+
options = _args4.length > 2 && _args4[2] !== undefined ? _args4[2] : {};
|
225
239
|
if ((0, _utils.isObject)(params)) {
|
226
|
-
|
240
|
+
_context4.next = 4;
|
227
241
|
break;
|
228
242
|
}
|
229
243
|
throw new errors.InvalidParameterError("Bad parameter: params must be of type object, received ".concat((0, _utils.getType)(params)));
|
230
244
|
case 4:
|
231
245
|
params['path'] = path;
|
232
246
|
if (params['path']) {
|
233
|
-
|
247
|
+
_context4.next = 7;
|
234
248
|
break;
|
235
249
|
}
|
236
250
|
throw new errors.MissingParameterError('Parameter missing: path');
|
237
251
|
case 7:
|
238
252
|
if (!(params['path'] && !(0, _utils.isString)(params['path']))) {
|
239
|
-
|
253
|
+
_context4.next = 9;
|
240
254
|
break;
|
241
255
|
}
|
242
256
|
throw new errors.InvalidParameterError("Bad parameter: path must be of type String, received ".concat((0, _utils.getType)(params['path'])));
|
243
257
|
case 9:
|
244
|
-
|
258
|
+
_context4.next = 11;
|
245
259
|
return _Api.default.sendRequest("/styles/".concat(encodeURIComponent(params['path'])), 'GET', params, options);
|
246
260
|
case 11:
|
247
|
-
response =
|
248
|
-
return
|
261
|
+
response = _context4.sent;
|
262
|
+
return _context4.abrupt("return", new _class(response === null || response === void 0 ? void 0 : response.data, options));
|
249
263
|
case 13:
|
250
264
|
case "end":
|
251
|
-
return
|
265
|
+
return _context4.stop();
|
252
266
|
}
|
253
|
-
},
|
267
|
+
}, _callee4);
|
254
268
|
}));
|
255
269
|
return function (_x) {
|
256
|
-
return
|
270
|
+
return _ref6.apply(this, arguments);
|
257
271
|
};
|
258
272
|
}());
|
259
273
|
(0, _defineProperty2.default)(Style, "get", function (path) {
|