From 16e9e53da75ae86fb9fc2f122a7d32375a8c87b9 Mon Sep 17 00:00:00 2001 From: Lucas Caresia Date: Mon, 24 Mar 2025 08:33:57 -0300 Subject: [PATCH 1/4] Added actions --- .../write-personalized-content.mjs | 64 ++++++++++++++++++ components/autobound/autobound.app.mjs | 67 +++++++++++++++++-- components/autobound/common/constants.mjs | 36 ++++++++++ components/autobound/package.json | 5 +- pnpm-lock.yaml | 6 +- 5 files changed, 172 insertions(+), 6 deletions(-) create mode 100644 components/autobound/actions/write-personalized-content/write-personalized-content.mjs create mode 100644 components/autobound/common/constants.mjs diff --git a/components/autobound/actions/write-personalized-content/write-personalized-content.mjs b/components/autobound/actions/write-personalized-content/write-personalized-content.mjs new file mode 100644 index 0000000000000..58eb7e1f03203 --- /dev/null +++ b/components/autobound/actions/write-personalized-content/write-personalized-content.mjs @@ -0,0 +1,64 @@ +import app from "../../autobound.app.mjs"; + +export default { + key: "autobound-write-personalized-content", + name: "Write Personalized Content", + description: "Write a personalized content using Autobound. [See the documentation](https://autobound-api.readme.io/docs/generate-personalized-content-copy)", + version: "0.0.1", + type: "action", + props: { + app, + contentType: { + propDefinition: [ + app, + "contentType", + ], + }, + contactEmail: { + propDefinition: [ + app, + "contactEmail", + ], + }, + userEmail: { + propDefinition: [ + app, + "userEmail", + ], + }, + writingStyle: { + propDefinition: [ + app, + "writingStyle", + ], + }, + additionalContext: { + propDefinition: [ + app, + "additionalContext", + ], + }, + wordCount: { + propDefinition: [ + app, + "wordCount", + ], + }, + }, + + async run({ $ }) { + const response = await this.app.writePersonalizedContent({ + $, + data: { + contactEmail: this.contactEmail, + userEmail: this.userEmail, + contentType: this.contentType, + writingStyle: this.writingStyle, + additionalContext: this.additionalContext, + wordCount: this.wordCount, + }, + }); + $.export("$summary", "Successfully generated personalized content"); + return response; + }, +}; diff --git a/components/autobound/autobound.app.mjs b/components/autobound/autobound.app.mjs index 4c9acaccef9dd..f7d8404352393 100644 --- a/components/autobound/autobound.app.mjs +++ b/components/autobound/autobound.app.mjs @@ -1,11 +1,70 @@ +import { axios } from "@pipedream/platform"; +import constants from "./common/constants.mjs"; + export default { type: "app", app: "autobound", - propDefinitions: {}, + propDefinitions: { + contactEmail: { + type: "string", + label: "Contact Email", + description: "The email address of the contact the user is reaching out to", + }, + userEmail: { + type: "string", + label: "User Email", + description: "The email address of the user the content is written on behalf of", + }, + contentType: { + type: "string", + label: "Content Type", + description: "Type of content to generate", + options: constants.CONTENT_TYPES, + }, + writingStyle: { + type: "string", + label: "Writing Style", + description: "Writing style for content generation", + options: constants.WRITING_STYLES, + }, + additionalContext: { + type: "string", + label: "Additional Context", + description: "Extra information for customizing generated content", + }, + wordCount: { + type: "integer", + label: "Word Count", + description: "Approximate word count for output", + }, + }, methods: { - // this.$auth contains connected account data - authKeys() { - console.log(Object.keys(this.$auth)); + _baseUrl() { + return "https://api.autobound.ai/api/external"; + }, + async _makeRequest(opts = {}) { + const { + $ = this, + path, + headers, + ...otherOpts + } = opts; + return axios($, { + ...otherOpts, + url: this._baseUrl() + path, + headers: { + "X-API-KEY": `${this.$auth.api_key}`, + "Content-Type": "application/json", + ...headers, + }, + }); + }, + async writePersonalizedContent(args = {}) { + return this._makeRequest({ + path: "/generate-content/v3.5", + method: "post", + ...args, + }); }, }, }; diff --git a/components/autobound/common/constants.mjs b/components/autobound/common/constants.mjs new file mode 100644 index 0000000000000..7e588125739e8 --- /dev/null +++ b/components/autobound/common/constants.mjs @@ -0,0 +1,36 @@ +export default { + CONTENT_TYPES: [ + "email", + "opener", + "sms", + "connectionRequest", + "callScript", + "sequence", + ], + WRITING_STYLES: [ + { + label: "For a conversational and insightful approach", + value: "challenger_sale", + }, + { + label: "To craft content with a creative, poetic twist", + value: "clever_poet", + }, + { + label: "For concise, executive- level pitches", + value: "cxo_pitch", + }, + { + label: "For content backed by data, statistics, and clear ROI", + value: "data_driven", + }, + { + label: "For short, personalized content that follow Basho protocol", + value: "basho", + }, + { + label: "Demonstrates a sense of urgency tied to the prospect's pain points", + value: "why_you_why_now", + }, + ], +}; diff --git a/components/autobound/package.json b/components/autobound/package.json index 38c4dedaf7f62..2241cc4837b03 100644 --- a/components/autobound/package.json +++ b/components/autobound/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/autobound", - "version": "0.0.1", + "version": "0.1.0", "description": "Pipedream Autobound Components", "main": "autobound.app.mjs", "keywords": [ @@ -11,5 +11,8 @@ "author": "Pipedream (https://pipedream.com/)", "publishConfig": { "access": "public" + }, + "dependencies": { + "@pipedream/platform": "^3.0.3" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index eb29df73dccb8..9882b43a8319a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1035,7 +1035,11 @@ importers: specifier: ^3.0.3 version: 3.0.3 - components/autobound: {} + components/autobound: + dependencies: + '@pipedream/platform': + specifier: ^3.0.3 + version: 3.0.3 components/autodesk: dependencies: From 2f6d2110334b9585f561cf69ad5329e3144a0f0c Mon Sep 17 00:00:00 2001 From: michelle0927 Date: Mon, 24 Mar 2025 13:53:17 -0400 Subject: [PATCH 2/4] Update components/autobound/actions/write-personalized-content/write-personalized-content.mjs --- .../write-personalized-content/write-personalized-content.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/autobound/actions/write-personalized-content/write-personalized-content.mjs b/components/autobound/actions/write-personalized-content/write-personalized-content.mjs index 58eb7e1f03203..6eecc80912882 100644 --- a/components/autobound/actions/write-personalized-content/write-personalized-content.mjs +++ b/components/autobound/actions/write-personalized-content/write-personalized-content.mjs @@ -3,7 +3,7 @@ import app from "../../autobound.app.mjs"; export default { key: "autobound-write-personalized-content", name: "Write Personalized Content", - description: "Write a personalized content using Autobound. [See the documentation](https://autobound-api.readme.io/docs/generate-personalized-content-copy)", + description: "Write personalized content using Autobound. [See the documentation](https://autobound-api.readme.io/docs/generate-personalized-content-copy)", version: "0.0.1", type: "action", props: { From 8be91570c11cec8362a0148796557a271afb7f10 Mon Sep 17 00:00:00 2001 From: michelle0927 Date: Mon, 24 Mar 2025 13:53:31 -0400 Subject: [PATCH 3/4] Update components/autobound/common/constants.mjs --- components/autobound/common/constants.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/autobound/common/constants.mjs b/components/autobound/common/constants.mjs index 7e588125739e8..22155f2b3e402 100644 --- a/components/autobound/common/constants.mjs +++ b/components/autobound/common/constants.mjs @@ -25,7 +25,7 @@ export default { value: "data_driven", }, { - label: "For short, personalized content that follow Basho protocol", + label: "For short, personalized content that follows Basho protocol", value: "basho", }, { From 235b6d2b1ed8636b29ffa8dc43e5b7a77f7777ef Mon Sep 17 00:00:00 2001 From: michelle0927 Date: Mon, 24 Mar 2025 14:04:21 -0400 Subject: [PATCH 4/4] Update components/autobound/common/constants.mjs --- components/autobound/common/constants.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/autobound/common/constants.mjs b/components/autobound/common/constants.mjs index 22155f2b3e402..abd58c83194a5 100644 --- a/components/autobound/common/constants.mjs +++ b/components/autobound/common/constants.mjs @@ -17,7 +17,7 @@ export default { value: "clever_poet", }, { - label: "For concise, executive- level pitches", + label: "For concise, executive-level pitches", value: "cxo_pitch", }, {