files.com 1.2.525 → 1.2.527
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 +1 -1
- package/docs/models/File.md +73 -0
- package/docs/models/ZipListEntry.md +13 -0
- package/lib/Files.js +1 -1
- package/lib/models/File.js +410 -215
- package/lib/models/ZipListEntry.js +54 -0
- package/package.json +1 -1
- package/src/Files.js +1 -1
- package/src/models/File.js +106 -0
- package/src/models/ZipListEntry.js +41 -0
package/_VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
1.2.
|
|
1
|
+
1.2.527
|
package/docs/models/File.md
CHANGED
|
@@ -154,6 +154,25 @@ await File.find(path, {
|
|
|
154
154
|
|
|
155
155
|
---
|
|
156
156
|
|
|
157
|
+
## Create a ZIP from one or more paths and save it to a destination path
|
|
158
|
+
|
|
159
|
+
```
|
|
160
|
+
await File.zip({
|
|
161
|
+
'paths': "paths",
|
|
162
|
+
'destination': "destination",
|
|
163
|
+
'overwrite': false,
|
|
164
|
+
})
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
### Parameters
|
|
169
|
+
|
|
170
|
+
* `paths` (array(string)): Required - Paths to include in the ZIP.
|
|
171
|
+
* `destination` (string): Required - Destination file path for the ZIP.
|
|
172
|
+
* `overwrite` (boolean): Overwrite existing file in the destination?
|
|
173
|
+
|
|
174
|
+
---
|
|
175
|
+
|
|
157
176
|
## Download File
|
|
158
177
|
|
|
159
178
|
```
|
|
@@ -312,6 +331,31 @@ await file.delete({
|
|
|
312
331
|
* `recursive` (boolean): If true, will recursively delete folders. Otherwise, will error on non-empty folders.
|
|
313
332
|
|
|
314
333
|
|
|
334
|
+
---
|
|
335
|
+
|
|
336
|
+
## List the contents of a ZIP file
|
|
337
|
+
|
|
338
|
+
```
|
|
339
|
+
const file = await File.find(path)
|
|
340
|
+
|
|
341
|
+
await file.zip_list_contents()
|
|
342
|
+
```
|
|
343
|
+
|
|
344
|
+
### Parameters
|
|
345
|
+
|
|
346
|
+
* `path` (string): Required - Path to operate on.
|
|
347
|
+
|
|
348
|
+
### Example Response
|
|
349
|
+
|
|
350
|
+
```json
|
|
351
|
+
[
|
|
352
|
+
{
|
|
353
|
+
"path": "example",
|
|
354
|
+
"size": 1
|
|
355
|
+
}
|
|
356
|
+
]
|
|
357
|
+
```
|
|
358
|
+
|
|
315
359
|
---
|
|
316
360
|
|
|
317
361
|
## Copy File/Folder
|
|
@@ -372,6 +416,35 @@ await file.move({
|
|
|
372
416
|
|
|
373
417
|
---
|
|
374
418
|
|
|
419
|
+
## Extract a ZIP file to a destination folder
|
|
420
|
+
|
|
421
|
+
```
|
|
422
|
+
const file = await File.find(path)
|
|
423
|
+
|
|
424
|
+
await file.unzip({
|
|
425
|
+
'destination': "destination",
|
|
426
|
+
'overwrite': false,
|
|
427
|
+
})
|
|
428
|
+
```
|
|
429
|
+
|
|
430
|
+
### Parameters
|
|
431
|
+
|
|
432
|
+
* `path` (string): Required - ZIP file path to extract.
|
|
433
|
+
* `destination` (string): Required - Destination folder path for extracted files.
|
|
434
|
+
* `filename` (string): Optional single entry filename to extract.
|
|
435
|
+
* `overwrite` (boolean): Overwrite existing files in the destination?
|
|
436
|
+
|
|
437
|
+
### Example Response
|
|
438
|
+
|
|
439
|
+
```json
|
|
440
|
+
{
|
|
441
|
+
"status": "pending",
|
|
442
|
+
"file_migration_id": 1
|
|
443
|
+
}
|
|
444
|
+
```
|
|
445
|
+
|
|
446
|
+
---
|
|
447
|
+
|
|
375
448
|
## Begin File Upload
|
|
376
449
|
|
|
377
450
|
```
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# ZipListEntry
|
|
2
|
+
|
|
3
|
+
## Example ZipListEntry Object
|
|
4
|
+
|
|
5
|
+
```
|
|
6
|
+
{
|
|
7
|
+
"path": "example",
|
|
8
|
+
"size": 1
|
|
9
|
+
}
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
* `path` (string): Entry path inside the ZIP. This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters.
|
|
13
|
+
* `size` (int64): Uncompressed size in bytes.
|
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.
|
|
15
|
+
var version = '1.2.527';
|
|
16
16
|
var userAgent = "Files.com JavaScript SDK v".concat(version);
|
|
17
17
|
var logLevel = _Logger.LogLevel.INFO;
|
|
18
18
|
var debugRequest = false;
|