Skip to content

Commit

Permalink
better names. added metadata and link options for all-updates
Browse files Browse the repository at this point in the history
  • Loading branch information
danhsiung committed May 29, 2020

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 6cfa883 commit f7a0bb5
Showing 3 changed files with 27 additions and 3 deletions.
26 changes: 25 additions & 1 deletion components/dropbox/all-updates.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,21 @@
const dropbox = require('https://github.com/PipedreamHQ/pipedream/components/dropbox/dropbox.app.js')

module.exports = {
name: "all-updates",
name: "Dropbox - All File and Folder Updates",
props: {
dropbox,
path: { propDefinition: [dropbox, "path"]},
recursive: { propDefinition: [dropbox, "recursive"]},
includeMediaInfo: {
type: "boolean",
description: "Emit media info for photo and video files (incurs an additional API call)",
default: false,
},
includeLink: {
type: "boolean",
description: "Emit temporary download link for files (incurs an additional API call)",
default: false,
},
dropboxApphook: {
type: "$.interface.apphook",
appProp: "dropbox",
@@ -21,6 +31,20 @@ module.exports = {
async run(event) {
let updates = await this.dropbox.getUpdates(this)
for(update of updates) {
if (update[".tag"] == "file") {
if (this.includeMediaInfo) {
update = await this.dropbox.sdk().filesGetMetadata({
path: update.path_lower,
include_media_info: true,
})
}
if (this.includeLink) {
const { link, metadata } = await this.dropbox.sdk().filesGetTemporaryLink({
path: update.path_lower,
})
update.link = link
}
}
this.$emit(update)
}
},
2 changes: 1 addition & 1 deletion components/dropbox/new-file.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const dropbox = require('https://github.com/PipedreamHQ/pipedream/components/dropbox/dropbox.app.js')

module.exports = {
name: "new-file",
name: "Dropbox - New File Uploaded",
props: {
dropbox,
path: { propDefinition: [dropbox, "path"]},
2 changes: 1 addition & 1 deletion components/dropbox/new-folder.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const dropbox = require('https://github.com/PipedreamHQ/pipedream/components/dropbox/dropbox.app.js')

module.exports = {
name: "new-folder",
name: "Dropbox - New Folder Created",
props: {
dropbox,
path: { propDefinition: [dropbox, "path"]},

0 comments on commit f7a0bb5

Please sign in to comment.