files.com 1.2.96 → 1.2.98
Sign up to get free protection for your applications and to get access to all the features.
- package/_VERSION +1 -1
- package/docs/models/File.md +1 -0
- package/docs/models/Folder.md +1 -0
- package/lib/Api.js +3 -3
- package/lib/Files.js +1 -1
- package/lib/models/File.js +15 -8
- package/lib/models/Folder.js +10 -3
- package/package.json +1 -1
- package/src/Files.js +1 -1
- package/src/models/File.js +5 -0
- package/src/models/Folder.js +5 -0
package/_VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.2.
|
1
|
+
1.2.98
|
package/docs/models/File.md
CHANGED
@@ -165,6 +165,7 @@ await file.download({
|
|
165
165
|
* `preview_size` (string): Request a preview size. Can be `small` (default), `large`, `xlarge`, or `pdf`.
|
166
166
|
* `with_previews` (boolean): Include file preview information?
|
167
167
|
* `with_priority_color` (boolean): Include file priority color information?
|
168
|
+
* `point_in_time` (string): Point in time to view the folder. Available only on remote server mounts for S3 with versioned buckets.
|
168
169
|
|
169
170
|
### Example Response
|
170
171
|
|
package/docs/models/Folder.md
CHANGED
@@ -109,6 +109,7 @@ await Folder.listFor(path, {
|
|
109
109
|
* `search_all` (boolean): Search entire site? If set, we will ignore the folder path provided and search the entire site. This is the same API used by the search bar in the UI. Search results are a best effort, not real time, and not guaranteed to match every file. This field should only be used for ad-hoc (human) searching, and not as part of an automated process.
|
110
110
|
* `with_previews` (boolean): Include file previews?
|
111
111
|
* `with_priority_color` (boolean): Include file priority color information?
|
112
|
+
* `point_in_time` (string): Point in time to view the folder. Available only on remote server mounts for S3 with versioned buckets.
|
112
113
|
|
113
114
|
---
|
114
115
|
|
package/lib/Api.js
CHANGED
@@ -37,7 +37,7 @@ var fetchWithTimeout = function fetchWithTimeout(url) {
|
|
37
37
|
return clearTimeout(timeoutId);
|
38
38
|
});
|
39
39
|
};
|
40
|
-
var
|
40
|
+
var _fetchWithRetry = /*#__PURE__*/function () {
|
41
41
|
var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(url, options) {
|
42
42
|
var retries,
|
43
43
|
maxRetries,
|
@@ -76,7 +76,7 @@ var fetchWithRetry = /*#__PURE__*/function () {
|
|
76
76
|
setTimeout(resolve, delaySecs * 1000);
|
77
77
|
});
|
78
78
|
case 22:
|
79
|
-
return _context.abrupt("return",
|
79
|
+
return _context.abrupt("return", _fetchWithRetry(url, options, nextRetries));
|
80
80
|
case 23:
|
81
81
|
case "end":
|
82
82
|
return _context.stop();
|
@@ -118,7 +118,7 @@ _Api = Api;
|
|
118
118
|
_context2.prev = 8;
|
119
119
|
agent = (getAgentForUrl === null || getAgentForUrl === void 0 ? void 0 : getAgentForUrl(url)) || (options === null || options === void 0 ? void 0 : options.agent) || (options === null || options === void 0 ? void 0 : options.httpsAgent) || (options === null || options === void 0 ? void 0 : options.httpAgent);
|
120
120
|
_context2.next = 12;
|
121
|
-
return
|
121
|
+
return _fetchWithRetry(url, _objectSpread({
|
122
122
|
agent: agent,
|
123
123
|
method: verb,
|
124
124
|
timeoutSecs: _Files.default.getNetworkTimeout()
|
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.2.
|
14
|
+
var version = '1.2.98';
|
15
15
|
var userAgent = "Files.com JavaScript SDK v".concat(version);
|
16
16
|
var logLevel = _Logger.LogLevel.INFO;
|
17
17
|
var debugRequest = false;
|
package/lib/models/File.js
CHANGED
@@ -463,6 +463,7 @@ var File = /*#__PURE__*/(0, _createClass2.default)(function File() {
|
|
463
463
|
// preview_size - string - Request a preview size. Can be `small` (default), `large`, `xlarge`, or `pdf`.
|
464
464
|
// with_previews - boolean - Include file preview information?
|
465
465
|
// with_priority_color - boolean - Include file priority color information?
|
466
|
+
// point_in_time - string - Point in time to view the folder. Available only on remote server mounts for S3 with versioned buckets.
|
466
467
|
(0, _defineProperty2.default)(this, "download", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6() {
|
467
468
|
var params,
|
468
469
|
response,
|
@@ -502,26 +503,32 @@ var File = /*#__PURE__*/(0, _createClass2.default)(function File() {
|
|
502
503
|
}
|
503
504
|
throw new errors.InvalidParameterError("Bad parameter: preview_size must be of type String, received ".concat((0, _utils.getType)(params.preview_size)));
|
504
505
|
case 12:
|
506
|
+
if (!(params.point_in_time && !(0, _utils.isString)(params.point_in_time))) {
|
507
|
+
_context6.next = 14;
|
508
|
+
break;
|
509
|
+
}
|
510
|
+
throw new errors.InvalidParameterError("Bad parameter: point_in_time must be of type String, received ".concat((0, _utils.getType)(params.point_in_time)));
|
511
|
+
case 14:
|
505
512
|
if (params.path) {
|
506
|
-
_context6.next =
|
513
|
+
_context6.next = 20;
|
507
514
|
break;
|
508
515
|
}
|
509
516
|
if (!_this.attributes.path) {
|
510
|
-
_context6.next =
|
517
|
+
_context6.next = 19;
|
511
518
|
break;
|
512
519
|
}
|
513
520
|
params.path = _this.path;
|
514
|
-
_context6.next =
|
521
|
+
_context6.next = 20;
|
515
522
|
break;
|
516
|
-
case
|
523
|
+
case 19:
|
517
524
|
throw new errors.MissingParameterError('Parameter missing: path');
|
518
|
-
case 18:
|
519
|
-
_context6.next = 20;
|
520
|
-
return _Api.default.sendRequest("/files/".concat(encodeURIComponent(params.path)), 'GET', params, _this.options);
|
521
525
|
case 20:
|
526
|
+
_context6.next = 22;
|
527
|
+
return _Api.default.sendRequest("/files/".concat(encodeURIComponent(params.path)), 'GET', params, _this.options);
|
528
|
+
case 22:
|
522
529
|
response = _context6.sent;
|
523
530
|
return _context6.abrupt("return", new File(response === null || response === void 0 ? void 0 : response.data, _this.options));
|
524
|
-
case
|
531
|
+
case 24:
|
525
532
|
case "end":
|
526
533
|
return _context6.stop();
|
527
534
|
}
|
package/lib/models/Folder.js
CHANGED
@@ -308,6 +308,7 @@ var Folder = /*#__PURE__*/(0, _createClass2.default)(function Folder() {
|
|
308
308
|
// search_all - boolean - Search entire site? If set, we will ignore the folder path provided and search the entire site. This is the same API used by the search bar in the UI. Search results are a best effort, not real time, and not guaranteed to match every file. This field should only be used for ad-hoc (human) searching, and not as part of an automated process.
|
309
309
|
// with_previews - boolean - Include file previews?
|
310
310
|
// with_priority_color - boolean - Include file priority color information?
|
311
|
+
// point_in_time - string - Point in time to view the folder. Available only on remote server mounts for S3 with versioned buckets.
|
311
312
|
(0, _defineProperty2.default)(Folder, "listFor", /*#__PURE__*/function () {
|
312
313
|
var _ref4 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(path) {
|
313
314
|
var _response$data;
|
@@ -376,15 +377,21 @@ var Folder = /*#__PURE__*/(0, _createClass2.default)(function Folder() {
|
|
376
377
|
}
|
377
378
|
throw new errors.InvalidParameterError("Bad parameter: search must be of type String, received ".concat((0, _utils.getType)(params.search)));
|
378
379
|
case 21:
|
379
|
-
|
380
|
-
|
380
|
+
if (!(params.point_in_time && !(0, _utils.isString)(params.point_in_time))) {
|
381
|
+
_context2.next = 23;
|
382
|
+
break;
|
383
|
+
}
|
384
|
+
throw new errors.InvalidParameterError("Bad parameter: point_in_time must be of type String, received ".concat((0, _utils.getType)(params.point_in_time)));
|
381
385
|
case 23:
|
386
|
+
_context2.next = 25;
|
387
|
+
return _Api.default.sendRequest("/folders/".concat(encodeURIComponent(params.path)), 'GET', params, options);
|
388
|
+
case 25:
|
382
389
|
response = _context2.sent;
|
383
390
|
File = require('./File.js').default;
|
384
391
|
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) {
|
385
392
|
return new File(obj, options);
|
386
393
|
})) || []);
|
387
|
-
case
|
394
|
+
case 28:
|
388
395
|
case "end":
|
389
396
|
return _context2.stop();
|
390
397
|
}
|
package/package.json
CHANGED
package/src/Files.js
CHANGED
package/src/models/File.js
CHANGED
@@ -606,6 +606,7 @@ class File {
|
|
606
606
|
// preview_size - string - Request a preview size. Can be `small` (default), `large`, `xlarge`, or `pdf`.
|
607
607
|
// with_previews - boolean - Include file preview information?
|
608
608
|
// with_priority_color - boolean - Include file priority color information?
|
609
|
+
// point_in_time - string - Point in time to view the folder. Available only on remote server mounts for S3 with versioned buckets.
|
609
610
|
download = async (params = {}) => {
|
610
611
|
if (!this.attributes.path) {
|
611
612
|
throw new errors.EmptyPropertyError('Current object has no path')
|
@@ -628,6 +629,10 @@ class File {
|
|
628
629
|
throw new errors.InvalidParameterError(`Bad parameter: preview_size must be of type String, received ${getType(params.preview_size)}`)
|
629
630
|
}
|
630
631
|
|
632
|
+
if (params.point_in_time && !isString(params.point_in_time)) {
|
633
|
+
throw new errors.InvalidParameterError(`Bad parameter: point_in_time must be of type String, received ${getType(params.point_in_time)}`)
|
634
|
+
}
|
635
|
+
|
631
636
|
if (!params.path) {
|
632
637
|
if (this.attributes.path) {
|
633
638
|
params.path = this.path
|
package/src/models/Folder.js
CHANGED
@@ -280,6 +280,7 @@ class Folder {
|
|
280
280
|
// search_all - boolean - Search entire site? If set, we will ignore the folder path provided and search the entire site. This is the same API used by the search bar in the UI. Search results are a best effort, not real time, and not guaranteed to match every file. This field should only be used for ad-hoc (human) searching, and not as part of an automated process.
|
281
281
|
// with_previews - boolean - Include file previews?
|
282
282
|
// with_priority_color - boolean - Include file priority color information?
|
283
|
+
// point_in_time - string - Point in time to view the folder. Available only on remote server mounts for S3 with versioned buckets.
|
283
284
|
static listFor = async (path, params = {}, options = {}) => {
|
284
285
|
if (!isObject(params)) {
|
285
286
|
throw new errors.InvalidParameterError(`Bad parameter: params must be of type object, received ${getType(params)}`)
|
@@ -319,6 +320,10 @@ class Folder {
|
|
319
320
|
throw new errors.InvalidParameterError(`Bad parameter: search must be of type String, received ${getType(params.search)}`)
|
320
321
|
}
|
321
322
|
|
323
|
+
if (params.point_in_time && !isString(params.point_in_time)) {
|
324
|
+
throw new errors.InvalidParameterError(`Bad parameter: point_in_time must be of type String, received ${getType(params.point_in_time)}`)
|
325
|
+
}
|
326
|
+
|
322
327
|
const response = await Api.sendRequest(`/folders/${encodeURIComponent(params.path)}`, 'GET', params, options)
|
323
328
|
|
324
329
|
const File = require('./File.js').default
|