files.com 1.2.174 → 1.2.176
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 +16 -15
- package/_VERSION +1 -1
- package/docs/models/Automation.md +1 -1
- package/docs/models/Behavior.md +1 -1
- package/docs/models/DnsRecord.md +1 -1
- package/docs/models/File.md +7 -7
- package/docs/models/Folder.md +1 -1
- package/docs/models/Site.md +2 -2
- package/lib/Files.js +1 -1
- package/lib/models/Automation.js +1 -1
- package/lib/models/File.js +3 -3
- package/package.json +1 -1
- package/src/Files.js +1 -1
- package/src/models/Automation.js +1 -1
- package/src/models/File.js +3 -3
package/README.md
CHANGED
|
@@ -565,17 +565,7 @@ A README is available on the GitHub link.
|
|
|
565
565
|
|
|
566
566
|
## File/Folder Operations
|
|
567
567
|
|
|
568
|
-
###
|
|
569
|
-
|
|
570
|
-
#### List Root Folder
|
|
571
|
-
|
|
572
|
-
```javascript
|
|
573
|
-
import Folder from 'files.com/lib/models/Folder.js';
|
|
574
|
-
|
|
575
|
-
const dirFiles = await Folder.listFor('/');
|
|
576
|
-
```
|
|
577
|
-
|
|
578
|
-
#### Uploading a File
|
|
568
|
+
### Upload
|
|
579
569
|
|
|
580
570
|
```javascript
|
|
581
571
|
import File from 'files.com/lib/models/File.js';
|
|
@@ -584,15 +574,18 @@ import { isBrowser } from 'files.com/lib/utils.js';
|
|
|
584
574
|
// uploading raw file data
|
|
585
575
|
await File.uploadData(destinationFileName, data);
|
|
586
576
|
|
|
577
|
+
// upload readable stream
|
|
578
|
+
await File.uploadStream(destinationFileName, readableStream)
|
|
579
|
+
|
|
587
580
|
// uploading a file on disk (not available in browser)
|
|
588
581
|
if (!isBrowser()) {
|
|
589
582
|
await File.uploadFile(destinationFileName, sourceFilePath);
|
|
590
583
|
}
|
|
591
584
|
```
|
|
592
585
|
|
|
593
|
-
|
|
586
|
+
### Download
|
|
594
587
|
|
|
595
|
-
|
|
588
|
+
#### Get a Downloadable File Object by Path
|
|
596
589
|
|
|
597
590
|
```javascript
|
|
598
591
|
import File from 'files.com/lib/models/File.js';
|
|
@@ -601,7 +594,7 @@ const foundFile = await File.find(remoteFilePath);
|
|
|
601
594
|
const downloadableFile = await foundFile.download();
|
|
602
595
|
```
|
|
603
596
|
|
|
604
|
-
|
|
597
|
+
#### Download a File (not available in browser)
|
|
605
598
|
|
|
606
599
|
```javascript
|
|
607
600
|
import { isBrowser } from 'files.com/lib/utils.js';
|
|
@@ -618,7 +611,15 @@ if (!isBrowser()) {
|
|
|
618
611
|
}
|
|
619
612
|
```
|
|
620
613
|
|
|
621
|
-
|
|
614
|
+
### List
|
|
615
|
+
|
|
616
|
+
```javascript
|
|
617
|
+
import Folder from 'files.com/lib/models/Folder.js';
|
|
618
|
+
|
|
619
|
+
const dirFiles = await Folder.listFor('/');
|
|
620
|
+
```
|
|
621
|
+
|
|
622
|
+
### Comparing Case-Insensitive Files and Paths
|
|
622
623
|
|
|
623
624
|
For related documentation see [Case Sensitivity Documentation](https://www.files.com/docs/files-and-folders/file-system-semantics/case-sensitivity).
|
|
624
625
|
|
package/_VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
1.2.
|
|
1
|
+
1.2.176
|
package/docs/models/Behavior.md
CHANGED
package/docs/models/DnsRecord.md
CHANGED
package/docs/models/File.md
CHANGED
|
@@ -97,7 +97,7 @@
|
|
|
97
97
|
|
|
98
98
|
---
|
|
99
99
|
|
|
100
|
-
## Upload
|
|
100
|
+
## Upload File
|
|
101
101
|
|
|
102
102
|
```
|
|
103
103
|
await File.create(path, {
|
|
@@ -132,7 +132,7 @@ await File.create(path, {
|
|
|
132
132
|
|
|
133
133
|
---
|
|
134
134
|
|
|
135
|
-
## Find
|
|
135
|
+
## Find File/Folder by Path
|
|
136
136
|
|
|
137
137
|
```
|
|
138
138
|
await File.find(path, {
|
|
@@ -151,7 +151,7 @@ await File.find(path, {
|
|
|
151
151
|
|
|
152
152
|
---
|
|
153
153
|
|
|
154
|
-
## Download
|
|
154
|
+
## Download File
|
|
155
155
|
|
|
156
156
|
```
|
|
157
157
|
const file = await File.find(path)
|
|
@@ -222,7 +222,7 @@ await file.download({
|
|
|
222
222
|
|
|
223
223
|
---
|
|
224
224
|
|
|
225
|
-
## Update
|
|
225
|
+
## Update File/Folder Metadata
|
|
226
226
|
|
|
227
227
|
```
|
|
228
228
|
const file = await File.find(path)
|
|
@@ -293,7 +293,7 @@ await file.update({
|
|
|
293
293
|
|
|
294
294
|
---
|
|
295
295
|
|
|
296
|
-
## Delete
|
|
296
|
+
## Delete File/Folder
|
|
297
297
|
|
|
298
298
|
```
|
|
299
299
|
const file = await File.find(path)
|
|
@@ -311,7 +311,7 @@ await file.delete({
|
|
|
311
311
|
|
|
312
312
|
---
|
|
313
313
|
|
|
314
|
-
## Copy
|
|
314
|
+
## Copy File/Folder
|
|
315
315
|
|
|
316
316
|
```
|
|
317
317
|
const file = await File.find(path)
|
|
@@ -341,7 +341,7 @@ await file.copy({
|
|
|
341
341
|
|
|
342
342
|
---
|
|
343
343
|
|
|
344
|
-
## Move
|
|
344
|
+
## Move File/Folder
|
|
345
345
|
|
|
346
346
|
```
|
|
347
347
|
const file = await File.find(path)
|
package/docs/models/Folder.md
CHANGED
package/docs/models/Site.md
CHANGED
|
@@ -471,7 +471,7 @@
|
|
|
471
471
|
|
|
472
472
|
---
|
|
473
473
|
|
|
474
|
-
## Show
|
|
474
|
+
## Show Site Settings
|
|
475
475
|
|
|
476
476
|
```
|
|
477
477
|
await Site.get
|
|
@@ -489,7 +489,7 @@ await Site.getUsage
|
|
|
489
489
|
|
|
490
490
|
---
|
|
491
491
|
|
|
492
|
-
## Update
|
|
492
|
+
## Update Site Settings
|
|
493
493
|
|
|
494
494
|
```
|
|
495
495
|
await Site.update({
|
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.176';
|
|
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/Automation.js
CHANGED
|
@@ -271,7 +271,7 @@ var Automation = /*#__PURE__*/(0, _createClass2.default)(function Automation() {
|
|
|
271
271
|
(0, _defineProperty2.default)(this, "setWebhookUrl", function (value) {
|
|
272
272
|
_this.attributes.webhook_url = value;
|
|
273
273
|
});
|
|
274
|
-
// Manually
|
|
274
|
+
// Manually Run Automation
|
|
275
275
|
(0, _defineProperty2.default)(this, "manualRun", /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
276
276
|
var params,
|
|
277
277
|
_args = arguments;
|
package/lib/models/File.js
CHANGED
|
@@ -470,7 +470,7 @@ var File = /*#__PURE__*/(0, _createClass2.default)(function File() {
|
|
|
470
470
|
(0, _defineProperty2.default)(this, "setWithRename", function (value) {
|
|
471
471
|
_this.attributes.with_rename = value;
|
|
472
472
|
});
|
|
473
|
-
// Download
|
|
473
|
+
// Download File
|
|
474
474
|
//
|
|
475
475
|
// Parameters:
|
|
476
476
|
// action - string - Can be blank, `redirect` or `stat`. If set to `stat`, we will return file information but without a download URL, and without logging a download. If set to `redirect` we will serve a 302 redirect directly to the file. This is used for integrations with Zapier, and is not recommended for most integrations.
|
|
@@ -663,7 +663,7 @@ var File = /*#__PURE__*/(0, _createClass2.default)(function File() {
|
|
|
663
663
|
var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
664
664
|
return _this.delete(params);
|
|
665
665
|
});
|
|
666
|
-
// Copy
|
|
666
|
+
// Copy File/Folder
|
|
667
667
|
//
|
|
668
668
|
// Parameters:
|
|
669
669
|
// destination (required) - string - Copy destination path.
|
|
@@ -743,7 +743,7 @@ var File = /*#__PURE__*/(0, _createClass2.default)(function File() {
|
|
|
743
743
|
}
|
|
744
744
|
}, _callee9);
|
|
745
745
|
})));
|
|
746
|
-
// Move
|
|
746
|
+
// Move File/Folder
|
|
747
747
|
//
|
|
748
748
|
// Parameters:
|
|
749
749
|
// destination (required) - string - Move destination path.
|
package/package.json
CHANGED
package/src/Files.js
CHANGED
package/src/models/Automation.js
CHANGED
|
@@ -266,7 +266,7 @@ class Automation {
|
|
|
266
266
|
this.attributes.webhook_url = value
|
|
267
267
|
}
|
|
268
268
|
|
|
269
|
-
// Manually
|
|
269
|
+
// Manually Run Automation
|
|
270
270
|
manualRun = async (params = {}) => {
|
|
271
271
|
if (!this.attributes.id) {
|
|
272
272
|
throw new errors.EmptyPropertyError('Current object has no id')
|
package/src/models/File.js
CHANGED
|
@@ -613,7 +613,7 @@ class File {
|
|
|
613
613
|
this.attributes.with_rename = value
|
|
614
614
|
}
|
|
615
615
|
|
|
616
|
-
// Download
|
|
616
|
+
// Download File
|
|
617
617
|
//
|
|
618
618
|
// Parameters:
|
|
619
619
|
// action - string - Can be blank, `redirect` or `stat`. If set to `stat`, we will return file information but without a download URL, and without logging a download. If set to `redirect` we will serve a 302 redirect directly to the file. This is used for integrations with Zapier, and is not recommended for most integrations.
|
|
@@ -724,7 +724,7 @@ class File {
|
|
|
724
724
|
destroy = (params = {}) =>
|
|
725
725
|
this.delete(params)
|
|
726
726
|
|
|
727
|
-
// Copy
|
|
727
|
+
// Copy File/Folder
|
|
728
728
|
//
|
|
729
729
|
// Parameters:
|
|
730
730
|
// destination (required) - string - Copy destination path.
|
|
@@ -770,7 +770,7 @@ class File {
|
|
|
770
770
|
return new FileAction(response?.data, this.options)
|
|
771
771
|
}
|
|
772
772
|
|
|
773
|
-
// Move
|
|
773
|
+
// Move File/Folder
|
|
774
774
|
//
|
|
775
775
|
// Parameters:
|
|
776
776
|
// destination (required) - string - Move destination path.
|