files.com 1.2.284 → 1.2.286

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 CHANGED
@@ -1 +1 @@
1
- 1.2.284
1
+ 1.2.286
@@ -98,6 +98,7 @@ await Folder.listFor(path, {
98
98
  'search_all': false,
99
99
  'with_previews': false,
100
100
  'with_priority_color': false,
101
+ 'type': "file",
101
102
  })
102
103
  ```
103
104
 
@@ -114,6 +115,8 @@ await Folder.listFor(path, {
114
115
  * `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 web UI when running 'Search All Files'. 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.
115
116
  * `with_previews` (boolean): Include file previews?
116
117
  * `with_priority_color` (boolean): Include file priority color information?
118
+ * `type` (string): Type of objects to return. Can be `folder` or `file`.
119
+ * `modified_at_datetime` (string): If provided, will only return files/folders modified after this time. Can be used only in combination with `type` filter.
117
120
 
118
121
  ---
119
122
 
@@ -149,15 +149,6 @@ await Sync.create({
149
149
  * `schedule_days_of_week` (array(int64)): If trigger is `custom_schedule`, Custom schedule description for when the sync should be run. 0-based days of the week. 0 is Sunday, 1 is Monday, etc.
150
150
  * `schedule_times_of_day` (array(string)): If trigger is `custom_schedule`, Custom schedule description for when the sync should be run. Times of day in HH:MM format.
151
151
 
152
- ---
153
-
154
- ## Migrate Legacy Syncs to Syncs
155
-
156
- ```
157
- await Sync.createMigrateTo
158
- ```
159
-
160
-
161
152
  ---
162
153
 
163
154
  ## Manually Run Sync
package/lib/Files.js CHANGED
@@ -12,7 +12,7 @@ var apiKey;
12
12
  var baseUrl = 'https://app.files.com';
13
13
  var sessionId = null;
14
14
  var language = null;
15
- var version = '1.2.284';
15
+ var version = '1.2.286';
16
16
  var userAgent = "Files.com JavaScript SDK v".concat(version);
17
17
  var logLevel = _Logger.LogLevel.INFO;
18
18
  var debugRequest = false;
@@ -320,6 +320,8 @@ var Folder = /*#__PURE__*/(0, _createClass2.default)(function Folder() {
320
320
  // 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 web UI when running 'Search All Files'. 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.
321
321
  // with_previews - boolean - Include file previews?
322
322
  // with_priority_color - boolean - Include file priority color information?
323
+ // type - string - Type of objects to return. Can be `folder` or `file`.
324
+ // modified_at_datetime - string - If provided, will only return files/folders modified after this time. Can be used only in combination with `type` filter.
323
325
  (0, _defineProperty2.default)(Folder, "listFor", /*#__PURE__*/function () {
324
326
  var _ref4 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee2(path) {
325
327
  var _response$data;
@@ -382,15 +384,27 @@ var Folder = /*#__PURE__*/(0, _createClass2.default)(function Folder() {
382
384
  }
383
385
  throw new errors.InvalidParameterError("Bad parameter: search_custom_metadata_key must be of type String, received ".concat((0, _utils.getType)(params.search_custom_metadata_key)));
384
386
  case 8:
385
- _context2.next = 9;
386
- return _Api.default.sendRequest("/folders/".concat(encodeURIComponent(params.path)), 'GET', params, options);
387
+ if (!(params.type && !(0, _utils.isString)(params.type))) {
388
+ _context2.next = 9;
389
+ break;
390
+ }
391
+ throw new errors.InvalidParameterError("Bad parameter: type must be of type String, received ".concat((0, _utils.getType)(params.type)));
387
392
  case 9:
393
+ if (!(params.modified_at_datetime && !(0, _utils.isString)(params.modified_at_datetime))) {
394
+ _context2.next = 10;
395
+ break;
396
+ }
397
+ throw new errors.InvalidParameterError("Bad parameter: modified_at_datetime must be of type String, received ".concat((0, _utils.getType)(params.modified_at_datetime)));
398
+ case 10:
399
+ _context2.next = 11;
400
+ return _Api.default.sendRequest("/folders/".concat(encodeURIComponent(params.path)), 'GET', params, options);
401
+ case 11:
388
402
  response = _context2.sent;
389
403
  File = require('./File.js').default;
390
404
  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) {
391
405
  return new File(obj, options);
392
406
  })) || []);
393
- case 10:
407
+ case 12:
394
408
  case "end":
395
409
  return _context2.stop();
396
410
  }
@@ -740,21 +740,6 @@ _Sync = Sync;
740
740
  }
741
741
  }, _callee7);
742
742
  })));
743
- (0, _defineProperty2.default)(Sync, "createMigrateTo", /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee8() {
744
- var options,
745
- _args8 = arguments;
746
- return _regenerator.default.wrap(function (_context8) {
747
- while (1) switch (_context8.prev = _context8.next) {
748
- case 0:
749
- options = _args8.length > 0 && _args8[0] !== undefined ? _args8[0] : {};
750
- _context8.next = 1;
751
- return _Api.default.sendRequest('/syncs/migrate_to_syncs', 'POST', {}, options);
752
- case 1:
753
- case "end":
754
- return _context8.stop();
755
- }
756
- }, _callee8);
757
- })));
758
743
  var _default = exports.default = Sync;
759
744
  module.exports = Sync;
760
745
  module.exports.default = Sync;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "files.com",
3
- "version": "1.2.284",
3
+ "version": "1.2.286",
4
4
  "description": "Files.com SDK for JavaScript",
5
5
  "keywords": [
6
6
  "files.com",
package/src/Files.js CHANGED
@@ -6,7 +6,7 @@ let apiKey
6
6
  let baseUrl = 'https://app.files.com'
7
7
  let sessionId = null
8
8
  let language = null
9
- const version = '1.2.284'
9
+ const version = '1.2.286'
10
10
  let userAgent = `Files.com JavaScript SDK v${version}`
11
11
 
12
12
  let logLevel = LogLevel.INFO
@@ -293,6 +293,8 @@ class Folder {
293
293
  // 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 web UI when running 'Search All Files'. 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.
294
294
  // with_previews - boolean - Include file previews?
295
295
  // with_priority_color - boolean - Include file priority color information?
296
+ // type - string - Type of objects to return. Can be `folder` or `file`.
297
+ // modified_at_datetime - string - If provided, will only return files/folders modified after this time. Can be used only in combination with `type` filter.
296
298
  static listFor = async (path, params = {}, options = {}) => {
297
299
  if (!isObject(params)) {
298
300
  throw new errors.InvalidParameterError(`Bad parameter: params must be of type object, received ${getType(params)}`)
@@ -328,6 +330,14 @@ class Folder {
328
330
  throw new errors.InvalidParameterError(`Bad parameter: search_custom_metadata_key must be of type String, received ${getType(params.search_custom_metadata_key)}`)
329
331
  }
330
332
 
333
+ if (params.type && !isString(params.type)) {
334
+ throw new errors.InvalidParameterError(`Bad parameter: type must be of type String, received ${getType(params.type)}`)
335
+ }
336
+
337
+ if (params.modified_at_datetime && !isString(params.modified_at_datetime)) {
338
+ throw new errors.InvalidParameterError(`Bad parameter: modified_at_datetime must be of type String, received ${getType(params.modified_at_datetime)}`)
339
+ }
340
+
331
341
  const response = await Api.sendRequest(`/folders/${encodeURIComponent(params.path)}`, 'GET', params, options)
332
342
 
333
343
  const File = require('./File.js').default
@@ -505,10 +505,6 @@ class Sync {
505
505
 
506
506
  return new Sync(response?.data, options)
507
507
  }
508
-
509
- static createMigrateTo = async (options = {}) => {
510
- await Api.sendRequest('/syncs/migrate_to_syncs', 'POST', {}, options)
511
- }
512
508
  }
513
509
 
514
510
  export default Sync