files.com 1.2.114 → 1.2.115
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/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.115
|
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
@@ -108,6 +108,7 @@ await Folder.listFor(path, {
|
|
108
108
|
* `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.
|
109
109
|
* `with_previews` (boolean): Include file previews?
|
110
110
|
* `with_priority_color` (boolean): Include file priority color information?
|
111
|
+
* `point_in_time` (string): Point in time to view the folder. Available only on remote server mounts for S3 with versioned buckets.
|
111
112
|
|
112
113
|
---
|
113
114
|
|
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.115';
|
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
@@ -307,6 +307,7 @@ var Folder = /*#__PURE__*/(0, _createClass2.default)(function Folder() {
|
|
307
307
|
// 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.
|
308
308
|
// with_previews - boolean - Include file previews?
|
309
309
|
// with_priority_color - boolean - Include file priority color information?
|
310
|
+
// point_in_time - string - Point in time to view the folder. Available only on remote server mounts for S3 with versioned buckets.
|
310
311
|
(0, _defineProperty2.default)(Folder, "listFor", /*#__PURE__*/function () {
|
311
312
|
var _ref4 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(path) {
|
312
313
|
var _response$data;
|
@@ -369,15 +370,21 @@ var Folder = /*#__PURE__*/(0, _createClass2.default)(function Folder() {
|
|
369
370
|
}
|
370
371
|
throw new errors.InvalidParameterError("Bad parameter: search must be of type String, received ".concat((0, _utils.getType)(params.search)));
|
371
372
|
case 19:
|
372
|
-
|
373
|
-
|
373
|
+
if (!(params.point_in_time && !(0, _utils.isString)(params.point_in_time))) {
|
374
|
+
_context2.next = 21;
|
375
|
+
break;
|
376
|
+
}
|
377
|
+
throw new errors.InvalidParameterError("Bad parameter: point_in_time must be of type String, received ".concat((0, _utils.getType)(params.point_in_time)));
|
374
378
|
case 21:
|
379
|
+
_context2.next = 23;
|
380
|
+
return _Api.default.sendRequest("/folders/".concat(encodeURIComponent(params.path)), 'GET', params, options);
|
381
|
+
case 23:
|
375
382
|
response = _context2.sent;
|
376
383
|
File = require('./File.js').default;
|
377
384
|
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) {
|
378
385
|
return new File(obj, options);
|
379
386
|
})) || []);
|
380
|
-
case
|
387
|
+
case 26:
|
381
388
|
case "end":
|
382
389
|
return _context2.stop();
|
383
390
|
}
|
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
@@ -279,6 +279,7 @@ class Folder {
|
|
279
279
|
// 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.
|
280
280
|
// with_previews - boolean - Include file previews?
|
281
281
|
// with_priority_color - boolean - Include file priority color information?
|
282
|
+
// point_in_time - string - Point in time to view the folder. Available only on remote server mounts for S3 with versioned buckets.
|
282
283
|
static listFor = async (path, params = {}, options = {}) => {
|
283
284
|
if (!isObject(params)) {
|
284
285
|
throw new errors.InvalidParameterError(`Bad parameter: params must be of type object, received ${getType(params)}`)
|
@@ -314,6 +315,10 @@ class Folder {
|
|
314
315
|
throw new errors.InvalidParameterError(`Bad parameter: search must be of type String, received ${getType(params.search)}`)
|
315
316
|
}
|
316
317
|
|
318
|
+
if (params.point_in_time && !isString(params.point_in_time)) {
|
319
|
+
throw new errors.InvalidParameterError(`Bad parameter: point_in_time must be of type String, received ${getType(params.point_in_time)}`)
|
320
|
+
}
|
321
|
+
|
317
322
|
const response = await Api.sendRequest(`/folders/${encodeURIComponent(params.path)}`, 'GET', params, options)
|
318
323
|
|
319
324
|
const File = require('./File.js').default
|