Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
key: "zoho_crm-download-attachment",
name: "Download Attachment",
description: "Downloads an attachment file from Zoho CRM, saves it in the temporary file system and exports the file path for use in a future step.",
version: "0.2.1",
version: "0.2.2",
type: "action",
props: {
zohoCrm,
Expand Down Expand Up @@ -34,6 +34,16 @@ export default {
}),
],
},
// This prop indicates that the otherwise ephemeral /tmp directory is automatically synced to a
// remote directory (if configured for the execution context), making files written by this
// action accessible for future executions. Only files located in STASH_DIR or, for legacy
// action support, whose /tmp file paths are explicitly returned by `run` will be synced.
syncDir: {
type: "dir",
accessMode: "write",
sync: true,
optional: true,
},
},
async run({ $ }) {
const file = await this.zohoCrm.downloadAttachment(
Expand All @@ -43,7 +53,7 @@ export default {
$,
);

const filePath = "/tmp/" + this.attachmentId;
const filePath = (process.env.STASH_DIR || "/tmp") + "/" + this.attachmentId;
fs.writeFileSync(filePath, file);

$.export("$summary", "Successfully downloaded attachment");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default {
key: "zoho_crm-upload-attachment",
name: "Upload Attachment",
description: "Uploads an attachment file to Zoho CRM from a URL or file path. [See the documentation](https://www.zoho.com/crm/developer/docs/api/v3/upload-attachment.html)",
version: "0.1.0",
version: "0.1.1",
type: "action",
props: {
zohoCrm,
Expand All @@ -30,6 +30,15 @@ export default {
label: "File Path or URL",
description: "The file to upload. Provide either a file URL or a path to a file in the `/tmp` directory (for example, `/tmp/myFile.txt`)",
},
// This prop indicates that a remote directory (if configured for the execution context) is
// automatically synced to the /tmp directory before the action runs, making files in that
// directory accessible for use in this action via the file system.
syncDir: {
type: "dir",
accessMode: "read",
sync: true,
optional: true,
},
},
async run({ $ }) {
const data = new FormData();
Expand Down
2 changes: 1 addition & 1 deletion components/zoho_crm/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pipedream/zoho_crm",
"version": "0.6.0",
"version": "0.6.1",
"description": "Pipedream Zoho CRM Components",
"main": "zoho_crm.app.mjs",
"keywords": [
Expand Down
Loading