@pipedream/dropbox 1.0.1 → 1.1.1

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
@@ -1,6 +1,6 @@
1
1
  # Overview
2
2
 
3
- The Dropbox API on Pipedream enables you to automate file and folder operations, streamlining workflows that involve storing, syncing, and sharing content. With this API, you can programmatically manage files, set up event-driven triggers based on changes within Dropbox, and leverage Pipedream's capabilities to connect with hundreds of other apps for extended automation scenarios. It's ideal for building custom file management solutions, archiving systems, or collaborative content workflows without writing extensive code.
3
+ The Dropbox API on Pipedream enables you to automate file and folder operations, streamlining workflows that involve storing, syncing, and sharing content. With this API, you can programmatically manage files, set up event-driven triggers based on changes within Dropbox, and leverage Pipedream's capabilities to connect with 3,000+ other apps for extended automation scenarios. It's ideal for building custom file management solutions, archiving systems, or collaborative content workflows without writing extensive code.
4
4
 
5
5
  # Example Use Cases
6
6
 
@@ -4,7 +4,12 @@ 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.11",
7
+ version: "0.0.13",
8
+ annotations: {
9
+ destructiveHint: false,
10
+ openWorldHint: true,
11
+ readOnlyHint: false,
12
+ },
8
13
  type: "action",
9
14
  props: {
10
15
  dropbox,
@@ -4,7 +4,12 @@ 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.11",
7
+ version: "0.0.13",
8
+ annotations: {
9
+ destructiveHint: false,
10
+ openWorldHint: true,
11
+ readOnlyHint: false,
12
+ },
8
13
  type: "action",
9
14
  props: {
10
15
  dropbox,
@@ -4,7 +4,12 @@ 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.11",
7
+ version: "0.0.13",
8
+ annotations: {
9
+ destructiveHint: false,
10
+ openWorldHint: true,
11
+ readOnlyHint: false,
12
+ },
8
13
  type: "action",
9
14
  props: {
10
15
  dropbox,
@@ -5,7 +5,12 @@ 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.11",
8
+ version: "0.0.13",
9
+ annotations: {
10
+ destructiveHint: true,
11
+ openWorldHint: true,
12
+ readOnlyHint: false,
13
+ },
9
14
  type: "action",
10
15
  props: {
11
16
  ...common.props,
@@ -66,6 +71,13 @@ export default {
66
71
  optional: true,
67
72
  options: consts.CREATE_SHARED_LINK_ACCESS_OPTIONS,
68
73
  };
74
+ props.audience = {
75
+ type: "string",
76
+ label: "Audience",
77
+ description: "The audience for the shared link",
78
+ optional: true,
79
+ options: consts.CREATE_SHARED_LINK_AUDIENCE_OPTIONS,
80
+ };
69
81
  }
70
82
 
71
83
  return props;
@@ -84,6 +96,7 @@ export default {
84
96
  linkPassword,
85
97
  expires,
86
98
  access,
99
+ audience,
87
100
  } = this;
88
101
 
89
102
  const accountType = await this.getCurrentAccount();
@@ -107,6 +120,7 @@ export default {
107
120
  expires,
108
121
  access,
109
122
  allow_download: allowDownload,
123
+ audience,
110
124
  },
111
125
  });
112
126
  $.export("$summary", `Shared link for "${path?.label || path}" successfully created`);
@@ -4,7 +4,12 @@ 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.11",
7
+ version: "0.0.13",
8
+ annotations: {
9
+ destructiveHint: true,
10
+ openWorldHint: true,
11
+ readOnlyHint: false,
12
+ },
8
13
  type: "action",
9
14
  props: {
10
15
  dropbox,
@@ -9,7 +9,12 @@ 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.8",
12
+ version: "0.0.10",
13
+ annotations: {
14
+ destructiveHint: false,
15
+ openWorldHint: true,
16
+ readOnlyHint: false,
17
+ },
13
18
  type: "action",
14
19
  props: {
15
20
  dropbox,
@@ -0,0 +1,37 @@
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.2",
8
+ annotations: {
9
+ destructiveHint: false,
10
+ openWorldHint: true,
11
+ readOnlyHint: true,
12
+ },
13
+ type: "action",
14
+ props: {
15
+ dropbox,
16
+ sharedLinkUrl: {
17
+ propDefinition: [
18
+ dropbox,
19
+ "sharedLinkUrl",
20
+ ],
21
+ },
22
+ linkPassword: {
23
+ propDefinition: [
24
+ dropbox,
25
+ "linkPassword",
26
+ ],
27
+ },
28
+ },
29
+ async run({ $ }) {
30
+ const { result } = await this.dropbox.getSharedLinkFile({
31
+ url: this.sharedLinkUrl,
32
+ link_password: this.linkPassword,
33
+ });
34
+ $.export("$summary", "Successfully retrieved shared link file");
35
+ return result;
36
+ },
37
+ };
@@ -0,0 +1,37 @@
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.2",
8
+ annotations: {
9
+ destructiveHint: false,
10
+ openWorldHint: true,
11
+ readOnlyHint: true,
12
+ },
13
+ type: "action",
14
+ props: {
15
+ dropbox,
16
+ sharedLinkUrl: {
17
+ propDefinition: [
18
+ dropbox,
19
+ "sharedLinkUrl",
20
+ ],
21
+ },
22
+ linkPassword: {
23
+ propDefinition: [
24
+ dropbox,
25
+ "linkPassword",
26
+ ],
27
+ },
28
+ },
29
+ async run({ $ }) {
30
+ const { result } = await this.dropbox.getSharedLinkMetadata({
31
+ url: this.sharedLinkUrl,
32
+ link_password: this.linkPassword,
33
+ });
34
+ $.export("$summary", "Successfully retrieved shared link metadata");
35
+ return result;
36
+ },
37
+ };
@@ -4,7 +4,12 @@ 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.11",
7
+ version: "0.0.13",
8
+ annotations: {
9
+ destructiveHint: false,
10
+ openWorldHint: true,
11
+ readOnlyHint: true,
12
+ },
8
13
  type: "action",
9
14
  props: {
10
15
  dropbox,
@@ -5,7 +5,12 @@ 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.11",
8
+ version: "0.0.13",
9
+ annotations: {
10
+ destructiveHint: false,
11
+ openWorldHint: true,
12
+ readOnlyHint: true,
13
+ },
9
14
  type: "action",
10
15
  props: {
11
16
  dropbox,
@@ -0,0 +1,55 @@
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.2",
8
+ annotations: {
9
+ destructiveHint: false,
10
+ openWorldHint: true,
11
+ readOnlyHint: true,
12
+ },
13
+ type: "action",
14
+ props: {
15
+ dropbox,
16
+ path: {
17
+ propDefinition: [
18
+ dropbox,
19
+ "path",
20
+ () => ({
21
+ initialOptions: [],
22
+ filter: ({ metadata: { metadata: { [".tag"]: type } } }) => [
23
+ "file",
24
+ "folder",
25
+ ].includes(type),
26
+ }),
27
+ ],
28
+ optional: true,
29
+ description: "Type the file or folder name to search for it in the user's Dropbox",
30
+ },
31
+ },
32
+ async run({ $ }) {
33
+ const sharedLinks = [];
34
+ let hasMore;
35
+ const args = {
36
+ path: this.path?.value || this.path,
37
+ };
38
+
39
+ do {
40
+ const {
41
+ result: {
42
+ links, cursor, has_more,
43
+ },
44
+ } = await this.dropbox.listSharedLinks(args);
45
+ sharedLinks.push(...links);
46
+ args.cursor = cursor;
47
+ hasMore = has_more;
48
+ } while (hasMore);
49
+
50
+ $.export("$summary", `Successfully retrieved ${sharedLinks.length} shared link${sharedLinks.length === 1
51
+ ? ""
52
+ : "s"}.`);
53
+ return sharedLinks;
54
+ },
55
+ };
@@ -4,7 +4,12 @@ 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.12",
7
+ version: "0.0.14",
8
+ annotations: {
9
+ destructiveHint: false,
10
+ openWorldHint: true,
11
+ readOnlyHint: false,
12
+ },
8
13
  type: "action",
9
14
  props: {
10
15
  dropbox,
@@ -4,7 +4,12 @@ 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.11",
7
+ version: "0.0.13",
8
+ annotations: {
9
+ destructiveHint: false,
10
+ openWorldHint: true,
11
+ readOnlyHint: false,
12
+ },
8
13
  type: "action",
9
14
  props: {
10
15
  dropbox,
@@ -4,7 +4,12 @@ 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.11",
7
+ version: "0.0.13",
8
+ annotations: {
9
+ destructiveHint: false,
10
+ openWorldHint: true,
11
+ readOnlyHint: false,
12
+ },
8
13
  type: "action",
9
14
  props: {
10
15
  dropbox,
@@ -6,7 +6,12 @@ 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.11",
9
+ version: "0.0.13",
10
+ annotations: {
11
+ destructiveHint: false,
12
+ openWorldHint: true,
13
+ readOnlyHint: true,
14
+ },
10
15
  type: "action",
11
16
  props: {
12
17
  dropbox,
@@ -6,7 +6,12 @@ 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.1",
9
+ version: "1.0.3",
10
+ annotations: {
11
+ destructiveHint: false,
12
+ openWorldHint: true,
13
+ readOnlyHint: false,
14
+ },
10
15
  type: "action",
11
16
  props: {
12
17
  dropbox,
@@ -8,7 +8,12 @@ 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.1",
11
+ version: "1.0.3",
12
+ annotations: {
13
+ destructiveHint: false,
14
+ openWorldHint: true,
15
+ readOnlyHint: false,
16
+ },
12
17
  type: "action",
13
18
  props: {
14
19
  dropbox,
package/common/consts.mjs CHANGED
@@ -28,9 +28,6 @@ export default {
28
28
  "public",
29
29
  "team",
30
30
  "no_one",
31
- "password",
32
- "members",
33
- "other",
34
31
  ],
35
32
  CREATE_SHARED_LINK_ACCESS_OPTIONS: [
36
33
  {
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
- if (links.result?.links.length > 0) {
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: links.result?.links[0].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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pipedream/dropbox",
3
- "version": "1.0.1",
3
+ "version": "1.1.1",
4
4
  "description": "Pipedream Dropbox Components",
5
5
  "main": "dropbox.app.mjs",
6
6
  "keywords": [
@@ -10,7 +10,7 @@
10
10
  "homepage": "https://pipedream.com/apps/dropbox",
11
11
  "author": "Pipedream <support@pipedream.com> (https://pipedream.com/)",
12
12
  "dependencies": {
13
- "@pipedream/platform": "^3.1.0",
13
+ "@pipedream/platform": "^3.1.1",
14
14
  "@types/node-fetch": "^2.5.7",
15
15
  "dropbox": "^10.34.0",
16
16
  "got": "^13.0.0",
@@ -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.18",
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.19",
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.18",
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() {