files.com 1.2.97 → 1.2.98

Sign up to get free protection for your applications and to get access to all the features.
package/_VERSION CHANGED
@@ -1 +1 @@
1
- 1.2.97
1
+ 1.2.98
@@ -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
 
@@ -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/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.97';
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;
@@ -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 = 18;
513
+ _context6.next = 20;
507
514
  break;
508
515
  }
509
516
  if (!_this.attributes.path) {
510
- _context6.next = 17;
517
+ _context6.next = 19;
511
518
  break;
512
519
  }
513
520
  params.path = _this.path;
514
- _context6.next = 18;
521
+ _context6.next = 20;
515
522
  break;
516
- case 17:
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 22:
531
+ case 24:
525
532
  case "end":
526
533
  return _context6.stop();
527
534
  }
@@ -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
- _context2.next = 23;
380
- return _Api.default.sendRequest("/folders/".concat(encodeURIComponent(params.path)), 'GET', params, options);
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 26:
394
+ case 28:
388
395
  case "end":
389
396
  return _context2.stop();
390
397
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "files.com",
3
- "version": "1.2.97",
3
+ "version": "1.2.98",
4
4
  "description": "Files.com SDK for JavaScript",
5
5
  "keywords": [
6
6
  "files.com",
package/src/Files.js CHANGED
@@ -5,7 +5,7 @@ const endpointPrefix = '/api/rest/v1'
5
5
  let apiKey
6
6
  let baseUrl = 'https://app.files.com'
7
7
  let sessionId = null
8
- const version = '1.2.97'
8
+ const version = '1.2.98'
9
9
  let userAgent = `Files.com JavaScript SDK v${version}`
10
10
 
11
11
  let logLevel = LogLevel.INFO
@@ -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
@@ -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