@pipedream/dropbox 1.0.1 → 1.1.0
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/actions/create-a-text-file/create-a-text-file.mjs +1 -1
- package/actions/create-folder/create-folder.mjs +1 -1
- package/actions/create-or-append-to-a-text-file/create-or-append-to-a-text-file.mjs +1 -1
- package/actions/create-update-share-link/create-update-share-link.mjs +10 -1
- package/actions/delete-file-folder/delete-file-folder.mjs +1 -1
- package/actions/download-file-to-tmp/download-file-to-tmp.mjs +1 -1
- package/actions/get-shared-link-file/get-shared-link-file.mjs +32 -0
- package/actions/get-shared-link-metadata/get-shared-link-metadata.mjs +32 -0
- package/actions/list-file-folders-in-a-folder/list-file-folders-in-a-folder.mjs +1 -1
- package/actions/list-file-revisions/list-file-revisions.mjs +1 -1
- package/actions/list-shared-links/list-shared-links.mjs +50 -0
- package/actions/move-file-folder/move-file-folder.mjs +1 -1
- package/actions/rename-file-folder/rename-file-folder.mjs +1 -1
- package/actions/restore-a-file/restore-a-file.mjs +1 -1
- package/actions/search-files-folders/search-files-folders.mjs +1 -1
- package/actions/upload-file/upload-file.mjs +1 -1
- package/actions/upload-multiple-files/upload-multiple-files.mjs +1 -1
- package/common/consts.mjs +0 -3
- package/dropbox.app.mjs +59 -2
- package/package.json +1 -1
- package/sources/all-updates/all-updates.mjs +1 -1
- package/sources/new-file/new-file.mjs +1 -1
- package/sources/new-folder/new-folder.mjs +1 -1
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
name: "Create a Text File",
|
|
5
5
|
description: "Creates a brand new text file from plain text content you specify. [See the documentation](https://dropbox.github.io/dropbox-sdk-js/Dropbox.html#filesUpload__anchor)",
|
|
6
6
|
key: "dropbox-create-a-text-file",
|
|
7
|
-
version: "0.0.
|
|
7
|
+
version: "0.0.12",
|
|
8
8
|
type: "action",
|
|
9
9
|
props: {
|
|
10
10
|
dropbox,
|
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
name: "Create folder",
|
|
5
5
|
description: "Create a Folder. [See the documentation](https://dropbox.github.io/dropbox-sdk-js/Dropbox.html#filesCreateFolderV2__anchor)",
|
|
6
6
|
key: "dropbox-create-folder",
|
|
7
|
-
version: "0.0.
|
|
7
|
+
version: "0.0.12",
|
|
8
8
|
type: "action",
|
|
9
9
|
props: {
|
|
10
10
|
dropbox,
|
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
name: "Create or Append to a Text File",
|
|
5
5
|
description: "Adds a new line to an existing text file, or creates a file if it doesn't exist. [See the documentation](https://dropbox.github.io/dropbox-sdk-js/Dropbox.html#filesUpload__anchor)",
|
|
6
6
|
key: "dropbox-create-or-append-to-a-text-file",
|
|
7
|
-
version: "0.0.
|
|
7
|
+
version: "0.0.12",
|
|
8
8
|
type: "action",
|
|
9
9
|
props: {
|
|
10
10
|
dropbox,
|
|
@@ -5,7 +5,7 @@ export default {
|
|
|
5
5
|
name: "Create/Update a Share Link",
|
|
6
6
|
description: "Creates or updates a public share link to the file or folder (It allows you to share the file or folder with anyone). [See the documentation](https://dropbox.github.io/dropbox-sdk-js/Dropbox.html#sharingCreateSharedLinkWithSettings__anchor)",
|
|
7
7
|
key: "dropbox-create-update-share-link",
|
|
8
|
-
version: "0.0.
|
|
8
|
+
version: "0.0.12",
|
|
9
9
|
type: "action",
|
|
10
10
|
props: {
|
|
11
11
|
...common.props,
|
|
@@ -66,6 +66,13 @@ export default {
|
|
|
66
66
|
optional: true,
|
|
67
67
|
options: consts.CREATE_SHARED_LINK_ACCESS_OPTIONS,
|
|
68
68
|
};
|
|
69
|
+
props.audience = {
|
|
70
|
+
type: "string",
|
|
71
|
+
label: "Audience",
|
|
72
|
+
description: "The audience for the shared link",
|
|
73
|
+
optional: true,
|
|
74
|
+
options: consts.CREATE_SHARED_LINK_AUDIENCE_OPTIONS,
|
|
75
|
+
};
|
|
69
76
|
}
|
|
70
77
|
|
|
71
78
|
return props;
|
|
@@ -84,6 +91,7 @@ export default {
|
|
|
84
91
|
linkPassword,
|
|
85
92
|
expires,
|
|
86
93
|
access,
|
|
94
|
+
audience,
|
|
87
95
|
} = this;
|
|
88
96
|
|
|
89
97
|
const accountType = await this.getCurrentAccount();
|
|
@@ -107,6 +115,7 @@ export default {
|
|
|
107
115
|
expires,
|
|
108
116
|
access,
|
|
109
117
|
allow_download: allowDownload,
|
|
118
|
+
audience,
|
|
110
119
|
},
|
|
111
120
|
});
|
|
112
121
|
$.export("$summary", `Shared link for "${path?.label || path}" successfully created`);
|
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
name: "Delete a File/Folder",
|
|
5
5
|
description: "Permanently removes a file/folder from the server. [See documentation](https://dropbox.github.io/dropbox-sdk-js/Dropbox.html#filesDeleteV2__anchor)",
|
|
6
6
|
key: "dropbox-delete-file-folder",
|
|
7
|
-
version: "0.0.
|
|
7
|
+
version: "0.0.12",
|
|
8
8
|
type: "action",
|
|
9
9
|
props: {
|
|
10
10
|
dropbox,
|
|
@@ -9,7 +9,7 @@ export default {
|
|
|
9
9
|
name: "Download File to TMP",
|
|
10
10
|
description: "Download a specific file to the temporary directory. [See the documentation](https://dropbox.github.io/dropbox-sdk-js/Dropbox.html#filesDownload__anchor).",
|
|
11
11
|
key: "dropbox-download-file-to-tmp",
|
|
12
|
-
version: "0.0.
|
|
12
|
+
version: "0.0.9",
|
|
13
13
|
type: "action",
|
|
14
14
|
props: {
|
|
15
15
|
dropbox,
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import dropbox from "../../dropbox.app.mjs";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
name: "Get Shared Link File",
|
|
5
|
+
description: "Get a file from a shared link. [See the documentation](https://www.dropbox.com/developers/documentation/http/documentation#sharing-get_shared_link_file)",
|
|
6
|
+
key: "dropbox-get-shared-link-file",
|
|
7
|
+
version: "0.0.1",
|
|
8
|
+
type: "action",
|
|
9
|
+
props: {
|
|
10
|
+
dropbox,
|
|
11
|
+
sharedLinkUrl: {
|
|
12
|
+
propDefinition: [
|
|
13
|
+
dropbox,
|
|
14
|
+
"sharedLinkUrl",
|
|
15
|
+
],
|
|
16
|
+
},
|
|
17
|
+
linkPassword: {
|
|
18
|
+
propDefinition: [
|
|
19
|
+
dropbox,
|
|
20
|
+
"linkPassword",
|
|
21
|
+
],
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
async run({ $ }) {
|
|
25
|
+
const { result } = await this.dropbox.getSharedLinkFile({
|
|
26
|
+
url: this.sharedLinkUrl,
|
|
27
|
+
link_password: this.linkPassword,
|
|
28
|
+
});
|
|
29
|
+
$.export("$summary", "Successfully retrieved shared link file");
|
|
30
|
+
return result;
|
|
31
|
+
},
|
|
32
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import dropbox from "../../dropbox.app.mjs";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
name: "Get Shared Link Metadata",
|
|
5
|
+
description: "Retrieves the shared link metadata for a given shared link. [See the documentation](https://www.dropbox.com/developers/documentation/http/documentation#sharing-get_shared_link_metadata)",
|
|
6
|
+
key: "dropbox-get-shared-link-metadata",
|
|
7
|
+
version: "0.0.1",
|
|
8
|
+
type: "action",
|
|
9
|
+
props: {
|
|
10
|
+
dropbox,
|
|
11
|
+
sharedLinkUrl: {
|
|
12
|
+
propDefinition: [
|
|
13
|
+
dropbox,
|
|
14
|
+
"sharedLinkUrl",
|
|
15
|
+
],
|
|
16
|
+
},
|
|
17
|
+
linkPassword: {
|
|
18
|
+
propDefinition: [
|
|
19
|
+
dropbox,
|
|
20
|
+
"linkPassword",
|
|
21
|
+
],
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
async run({ $ }) {
|
|
25
|
+
const { result } = await this.dropbox.getSharedLinkMetadata({
|
|
26
|
+
url: this.sharedLinkUrl,
|
|
27
|
+
link_password: this.linkPassword,
|
|
28
|
+
});
|
|
29
|
+
$.export("$summary", "Successfully retrieved shared link metadata");
|
|
30
|
+
return result;
|
|
31
|
+
},
|
|
32
|
+
};
|
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
name: "List All Files/Subfolders in a Folder",
|
|
5
5
|
description: "Retrieves a list of files or subfolders in a specified folder [See the documentation](https://dropbox.github.io/dropbox-sdk-js/Dropbox.html#filesListFolder__anchor)",
|
|
6
6
|
key: "dropbox-list-file-folders-in-a-folder",
|
|
7
|
-
version: "0.0.
|
|
7
|
+
version: "0.0.12",
|
|
8
8
|
type: "action",
|
|
9
9
|
props: {
|
|
10
10
|
dropbox,
|
|
@@ -5,7 +5,7 @@ export default {
|
|
|
5
5
|
name: "List File Revisions",
|
|
6
6
|
description: "Retrieves a list of file revisions needed to recover previous content. [See the documentation](https://dropbox.github.io/dropbox-sdk-js/Dropbox.html#filesListRevisions__anchor)",
|
|
7
7
|
key: "dropbox-list-file-revisions",
|
|
8
|
-
version: "0.0.
|
|
8
|
+
version: "0.0.12",
|
|
9
9
|
type: "action",
|
|
10
10
|
props: {
|
|
11
11
|
dropbox,
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import dropbox from "../../dropbox.app.mjs";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
key: "dropbox-list-shared-links",
|
|
5
|
+
name: "List Shared Links",
|
|
6
|
+
description: "Retrieves a list of shared links for a given path. [See the documentation](https://www.dropbox.com/developers/documentation/http/documentation#sharing-list_shared_links)",
|
|
7
|
+
version: "0.0.1",
|
|
8
|
+
type: "action",
|
|
9
|
+
props: {
|
|
10
|
+
dropbox,
|
|
11
|
+
path: {
|
|
12
|
+
propDefinition: [
|
|
13
|
+
dropbox,
|
|
14
|
+
"path",
|
|
15
|
+
() => ({
|
|
16
|
+
initialOptions: [],
|
|
17
|
+
filter: ({ metadata: { metadata: { [".tag"]: type } } }) => [
|
|
18
|
+
"file",
|
|
19
|
+
"folder",
|
|
20
|
+
].includes(type),
|
|
21
|
+
}),
|
|
22
|
+
],
|
|
23
|
+
optional: true,
|
|
24
|
+
description: "Type the file or folder name to search for it in the user's Dropbox",
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
async run({ $ }) {
|
|
28
|
+
const sharedLinks = [];
|
|
29
|
+
let hasMore;
|
|
30
|
+
const args = {
|
|
31
|
+
path: this.path?.value || this.path,
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
do {
|
|
35
|
+
const {
|
|
36
|
+
result: {
|
|
37
|
+
links, cursor, has_more,
|
|
38
|
+
},
|
|
39
|
+
} = await this.dropbox.listSharedLinks(args);
|
|
40
|
+
sharedLinks.push(...links);
|
|
41
|
+
args.cursor = cursor;
|
|
42
|
+
hasMore = has_more;
|
|
43
|
+
} while (hasMore);
|
|
44
|
+
|
|
45
|
+
$.export("$summary", `Successfully retrieved ${sharedLinks.length} shared link${sharedLinks.length === 1
|
|
46
|
+
? ""
|
|
47
|
+
: "s"}.`);
|
|
48
|
+
return sharedLinks;
|
|
49
|
+
},
|
|
50
|
+
};
|
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
name: "Move a File/Folder",
|
|
5
5
|
description: "Moves a file or folder to a different location in the user's Dropbox [See the documentation](https://dropbox.github.io/dropbox-sdk-js/Dropbox.html#filesMoveV2__anchor)",
|
|
6
6
|
key: "dropbox-move-file-folder",
|
|
7
|
-
version: "0.0.
|
|
7
|
+
version: "0.0.13",
|
|
8
8
|
type: "action",
|
|
9
9
|
props: {
|
|
10
10
|
dropbox,
|
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
name: "Rename a File/Folder",
|
|
5
5
|
description: "Renames a file or folder in the user's Dropbox [See the documentation](https://dropbox.github.io/dropbox-sdk-js/Dropbox.html#filesMoveV2__anchor)",
|
|
6
6
|
key: "dropbox-rename-file-folder",
|
|
7
|
-
version: "0.0.
|
|
7
|
+
version: "0.0.12",
|
|
8
8
|
type: "action",
|
|
9
9
|
props: {
|
|
10
10
|
dropbox,
|
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
name: "Restore a File",
|
|
5
5
|
description: "Restores a previous file version. [See the documentation](https://dropbox.github.io/dropbox-sdk-js/Dropbox.html#filesRestore__anchor)",
|
|
6
6
|
key: "dropbox-restore-a-file",
|
|
7
|
-
version: "0.0.
|
|
7
|
+
version: "0.0.12",
|
|
8
8
|
type: "action",
|
|
9
9
|
props: {
|
|
10
10
|
dropbox,
|
|
@@ -6,7 +6,7 @@ export default {
|
|
|
6
6
|
name: "Search files and folders",
|
|
7
7
|
description: "Searches for files and folders by name. [See the documentation](https://dropbox.github.io/dropbox-sdk-js/Dropbox.html#filesSearchV2__anchor)",
|
|
8
8
|
key: "dropbox-search-files-folders",
|
|
9
|
-
version: "0.0.
|
|
9
|
+
version: "0.0.12",
|
|
10
10
|
type: "action",
|
|
11
11
|
props: {
|
|
12
12
|
dropbox,
|
|
@@ -6,7 +6,7 @@ export default {
|
|
|
6
6
|
name: "Upload a File",
|
|
7
7
|
description: "Uploads a file to a selected folder. [See the documentation](https://dropbox.github.io/dropbox-sdk-js/Dropbox.html#filesUpload__anchor)",
|
|
8
8
|
key: "dropbox-upload-file",
|
|
9
|
-
version: "1.0.
|
|
9
|
+
version: "1.0.2",
|
|
10
10
|
type: "action",
|
|
11
11
|
props: {
|
|
12
12
|
dropbox,
|
|
@@ -8,7 +8,7 @@ export default {
|
|
|
8
8
|
name: "Upload Multiple Files",
|
|
9
9
|
description: "Uploads multiple file to a selected folder. [See the documentation](https://dropbox.github.io/dropbox-sdk-js/Dropbox.html#filesUpload__anchor)",
|
|
10
10
|
key: "dropbox-upload-multiple-files",
|
|
11
|
-
version: "1.0.
|
|
11
|
+
version: "1.0.2",
|
|
12
12
|
type: "action",
|
|
13
13
|
props: {
|
|
14
14
|
dropbox,
|
package/common/consts.mjs
CHANGED
package/dropbox.app.mjs
CHANGED
|
@@ -96,6 +96,38 @@ export default {
|
|
|
96
96
|
}
|
|
97
97
|
},
|
|
98
98
|
},
|
|
99
|
+
sharedLinkUrl: {
|
|
100
|
+
type: "string",
|
|
101
|
+
label: "Shared Link URL",
|
|
102
|
+
description: "The URL of a shared link",
|
|
103
|
+
async options({ prevContext }) {
|
|
104
|
+
const {
|
|
105
|
+
result: {
|
|
106
|
+
links, cursor,
|
|
107
|
+
},
|
|
108
|
+
} = await this.listSharedLinks({
|
|
109
|
+
cursor: prevContext?.cursor,
|
|
110
|
+
});
|
|
111
|
+
const options = links?.map(({
|
|
112
|
+
url: value, name: label,
|
|
113
|
+
}) => ({
|
|
114
|
+
value,
|
|
115
|
+
label: `${label} - ${value}`,
|
|
116
|
+
})) || [];
|
|
117
|
+
return {
|
|
118
|
+
options,
|
|
119
|
+
context: {
|
|
120
|
+
cursor,
|
|
121
|
+
},
|
|
122
|
+
};
|
|
123
|
+
},
|
|
124
|
+
},
|
|
125
|
+
linkPassword: {
|
|
126
|
+
type: "string",
|
|
127
|
+
label: "Link Password",
|
|
128
|
+
description: "The password required to access the shared link",
|
|
129
|
+
optional: true,
|
|
130
|
+
},
|
|
99
131
|
fileRevision: {
|
|
100
132
|
type: "string",
|
|
101
133
|
label: "Revision",
|
|
@@ -363,11 +395,12 @@ export default {
|
|
|
363
395
|
const links = await dpx.sharingListSharedLinks({
|
|
364
396
|
path: args.path,
|
|
365
397
|
});
|
|
366
|
-
|
|
398
|
+
const link = links.result?.links.find((l) => l.path_lower === args.path);
|
|
399
|
+
if (link) {
|
|
367
400
|
return await dpx.sharingModifySharedLinkSettings({
|
|
368
401
|
...args,
|
|
369
402
|
path: undefined,
|
|
370
|
-
url:
|
|
403
|
+
url: link.url,
|
|
371
404
|
remove_expiration: isEmpty(args.remove_expiration)
|
|
372
405
|
? false
|
|
373
406
|
: args.remove_expiration,
|
|
@@ -382,6 +415,30 @@ export default {
|
|
|
382
415
|
this.normalizeError(err);
|
|
383
416
|
}
|
|
384
417
|
},
|
|
418
|
+
async listSharedLinks(args) {
|
|
419
|
+
try {
|
|
420
|
+
const dpx = await this.sdk();
|
|
421
|
+
return await dpx.sharingListSharedLinks(args);
|
|
422
|
+
} catch (err) {
|
|
423
|
+
this.normalizeError(err);
|
|
424
|
+
}
|
|
425
|
+
},
|
|
426
|
+
async getSharedLinkMetadata(args) {
|
|
427
|
+
try {
|
|
428
|
+
const dpx = await this.sdk();
|
|
429
|
+
return await dpx.sharingGetSharedLinkMetadata(args);
|
|
430
|
+
} catch (err) {
|
|
431
|
+
this.normalizeError(err);
|
|
432
|
+
}
|
|
433
|
+
},
|
|
434
|
+
async getSharedLinkFile(args) {
|
|
435
|
+
try {
|
|
436
|
+
const dpx = await this.sdk();
|
|
437
|
+
return await dpx.sharingGetSharedLinkFile(args);
|
|
438
|
+
} catch (err) {
|
|
439
|
+
this.normalizeError(err);
|
|
440
|
+
}
|
|
441
|
+
},
|
|
385
442
|
async deleteFileFolder(args) {
|
|
386
443
|
try {
|
|
387
444
|
const dpx = await this.sdk();
|
package/package.json
CHANGED
|
@@ -7,7 +7,7 @@ export default {
|
|
|
7
7
|
type: "source",
|
|
8
8
|
key: "dropbox-all-updates",
|
|
9
9
|
name: "New or Modified File or Folder",
|
|
10
|
-
version: "0.0.
|
|
10
|
+
version: "0.0.19",
|
|
11
11
|
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.",
|
|
12
12
|
props: {
|
|
13
13
|
...common.props,
|
|
@@ -7,7 +7,7 @@ export default {
|
|
|
7
7
|
type: "source",
|
|
8
8
|
key: "dropbox-new-file",
|
|
9
9
|
name: "New File",
|
|
10
|
-
version: "0.0.
|
|
10
|
+
version: "0.0.20",
|
|
11
11
|
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.",
|
|
12
12
|
props: {
|
|
13
13
|
...common.props,
|
|
@@ -7,7 +7,7 @@ export default {
|
|
|
7
7
|
type: "source",
|
|
8
8
|
key: "dropbox-new-folder",
|
|
9
9
|
name: "New Folder",
|
|
10
|
-
version: "0.0.
|
|
10
|
+
version: "0.0.19",
|
|
11
11
|
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.",
|
|
12
12
|
hooks: {
|
|
13
13
|
async activate() {
|