files.com 1.0.161 → 1.0.162

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/README.md CHANGED
@@ -136,7 +136,7 @@ You can set the following global properties using static methods on the `Files`
136
136
  #### Getting a file record by path
137
137
 
138
138
  import File from 'files.com/lib/models/File'
139
- const foundFile = await File.find(remoteFilePath)
139
+ const foundFile = await File.findDownload(remoteFilePath)
140
140
 
141
141
  #### Download a file (not available in browser)
142
142
 
package/_VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.161
1
+ 1.0.162
@@ -1166,7 +1166,7 @@ var File = /*#__PURE__*/(0, _createClass2.default)(function File() {
1166
1166
  return _ref21.apply(this, arguments);
1167
1167
  };
1168
1168
  }());
1169
- (0, _defineProperty2.default)(File, "find", /*#__PURE__*/function () {
1169
+ (0, _defineProperty2.default)(File, "findDownload", /*#__PURE__*/function () {
1170
1170
  var _ref22 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee20(path) {
1171
1171
  var response;
1172
1172
  return _regenerator.default.wrap(function _callee20$(_context20) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "files.com",
3
- "version": "1.0.161",
3
+ "version": "1.0.162",
4
4
  "description": "Files.com SDK for JavaScript",
5
5
  "keywords": [
6
6
  "files.com",
@@ -178,7 +178,7 @@ class File {
178
178
  return saveUrlToFile(this.download_uri, destinationPath)
179
179
  }
180
180
 
181
- static find = async path => {
181
+ static findDownload = async path => {
182
182
  const response = await Api.sendRequest(`/files/${encodeURIComponent(path)}`, 'GET')
183
183
  return new File(response.data)
184
184
  }
package/test/src/index.js CHANGED
@@ -40,12 +40,16 @@ const testSuite = async () => {
40
40
  const nonce = new Date().getTime()
41
41
 
42
42
  const testFolderListAutoPagination = async () => {
43
- Files.setAutoPaginate(false)
43
+ Files.configureNetwork({
44
+ autoPaginate: false,
45
+ })
44
46
  const firstPageItems = await Folder.listFor('/', { per_page: 1 })
45
- assert(firstPageItems.length === 1)
46
47
 
47
- Files.setAutoPaginate(true)
48
+ assert(firstPageItems.length === 1)
48
49
 
50
+ Files.configureNetwork({
51
+ autoPaginate: true,
52
+ })
49
53
  // note: this test will fail if the root folder has <= 1 file or folder
50
54
  const allPageItems = await Folder.listFor('/', { per_page: 1 })
51
55
 
@@ -66,7 +70,7 @@ const testSuite = async () => {
66
70
  assert(!!file.path)
67
71
  assert(file.display_name === displayName)
68
72
 
69
- const foundFile = await File.find(destinationPath)
73
+ const foundFile = await File.findDownload(destinationPath)
70
74
 
71
75
  assert(foundFile.path === destinationPath)
72
76
  assert(foundFile.display_name === displayName)