@pipedream/dropbox 0.3.9 → 0.3.11
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.
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import dropbox from "../../dropbox.app.mjs";
|
|
2
|
+
import common from "../common/common.mjs";
|
|
3
|
+
import fs from "fs";
|
|
4
|
+
import { file } from "tmp-promise";
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
...common,
|
|
8
|
+
name: "Download File to TMP",
|
|
9
|
+
description: "Download a specific file to the temporary directory. [See the documentation](https://dropbox.github.io/dropbox-sdk-js/Dropbox.html#filesDownload__anchor).",
|
|
10
|
+
key: "dropbox-download-file-to-tmp",
|
|
11
|
+
version: "0.0.1",
|
|
12
|
+
type: "action",
|
|
13
|
+
props: {
|
|
14
|
+
dropbox,
|
|
15
|
+
path: {
|
|
16
|
+
propDefinition: [
|
|
17
|
+
dropbox,
|
|
18
|
+
"pathFile",
|
|
19
|
+
],
|
|
20
|
+
description: "The file path in the user's Dropbox to download.",
|
|
21
|
+
},
|
|
22
|
+
name: {
|
|
23
|
+
type: "string",
|
|
24
|
+
label: "File name",
|
|
25
|
+
description: "The new name of the file to be saved, including it's extension. e.g: `myFile.csv`",
|
|
26
|
+
optional: true,
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
async run({ $ }) {
|
|
30
|
+
const { result } = await this.dropbox.downloadFile({
|
|
31
|
+
path: this.getNormalizedPath(this.path, false),
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
const {
|
|
35
|
+
path, cleanup,
|
|
36
|
+
} = await file();
|
|
37
|
+
|
|
38
|
+
const tmpPath = this.name
|
|
39
|
+
? `/tmp/${this.name}`
|
|
40
|
+
: path;
|
|
41
|
+
|
|
42
|
+
await fs.promises.appendFile(tmpPath, Buffer.from(result.fileBinary));
|
|
43
|
+
await cleanup();
|
|
44
|
+
|
|
45
|
+
delete result.fileBinary;
|
|
46
|
+
|
|
47
|
+
$.export("$summary", `File successfully saved in "/tmp/${this.name}"`);
|
|
48
|
+
|
|
49
|
+
return {
|
|
50
|
+
tmpPath,
|
|
51
|
+
...result,
|
|
52
|
+
};
|
|
53
|
+
},
|
|
54
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pipedream/dropbox",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.11",
|
|
4
4
|
"description": "Pipedream Dropbox Components",
|
|
5
5
|
"main": "dropbox.app.mjs",
|
|
6
6
|
"keywords": [
|
|
@@ -10,8 +10,10 @@
|
|
|
10
10
|
"homepage": "https://pipedream.com/apps/dropbox",
|
|
11
11
|
"author": "Pipedream <support@pipedream.com> (https://pipedream.com/)",
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"dropbox": "^
|
|
14
|
-
"
|
|
13
|
+
"dropbox": "^10.34.0",
|
|
14
|
+
"tmp-promise": "^3.0.3",
|
|
15
|
+
"isomorphic-fetch": "^3.0.0",
|
|
16
|
+
"lodash": "^4.17.21"
|
|
15
17
|
},
|
|
16
18
|
"gitHead": "e12480b94cc03bed4808ebc6b13e7fdb3a1ba535",
|
|
17
19
|
"publishConfig": {
|
|
@@ -6,7 +6,7 @@ export default {
|
|
|
6
6
|
type: "source",
|
|
7
7
|
key: "dropbox-all-updates",
|
|
8
8
|
name: "New or Modified File or Folder",
|
|
9
|
-
version: "0.0.
|
|
9
|
+
version: "0.0.12",
|
|
10
10
|
description: "Emit new event when a file or folder is added or modified. Make sure the number of files/folders in the watched folder does not exceed 4000.",
|
|
11
11
|
props: {
|
|
12
12
|
...common.props,
|
|
@@ -40,6 +40,9 @@ export default {
|
|
|
40
40
|
if (!fileTypes.includes(file[".tag"])) {
|
|
41
41
|
continue;
|
|
42
42
|
}
|
|
43
|
+
if (this.includeLink) {
|
|
44
|
+
file.link = await this.getTemporaryLink(file);
|
|
45
|
+
}
|
|
43
46
|
this.$emit(file, this.getMeta(file.id, file.path_display || file.id));
|
|
44
47
|
count++;
|
|
45
48
|
if (count >= 25) {
|
|
@@ -6,7 +6,7 @@ export default {
|
|
|
6
6
|
type: "source",
|
|
7
7
|
key: "dropbox-new-file",
|
|
8
8
|
name: "New File",
|
|
9
|
-
version: "0.0.
|
|
9
|
+
version: "0.0.12",
|
|
10
10
|
description: "Emit new event when a new file is added to your account or a specific folder. Make sure the number of files/folders in the watched folder does not exceed 4000.",
|
|
11
11
|
props: {
|
|
12
12
|
...common.props,
|
|
@@ -6,7 +6,7 @@ export default {
|
|
|
6
6
|
type: "source",
|
|
7
7
|
key: "dropbox-new-folder",
|
|
8
8
|
name: "New Folder",
|
|
9
|
-
version: "0.0.
|
|
9
|
+
version: "0.0.12",
|
|
10
10
|
description: "Emit new event when a new folder is created. Make sure the number of files/folders in the watched folder does not exceed 4000.",
|
|
11
11
|
hooks: {
|
|
12
12
|
async activate() {
|