-
Notifications
You must be signed in to change notification settings - Fork 5.8k
SetSmart - new components #21776
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
setsmart-git
wants to merge
1
commit into
PipedreamHQ:master
Choose a base branch
from
setsmart-git:setsmart-new-components
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
SetSmart - new components #21776
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
60 changes: 60 additions & 0 deletions
60
components/setsmart/actions/add-notes-to-contact/add-notes-to-contact.mjs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| import { ConfigurationError } from "@pipedream/platform"; | ||
| import setsmart from "../../setsmart.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "setsmart-add-notes-to-contact", | ||
| name: "Add Notes To Contact", | ||
| description: "Append a note to a contact so your team sees the context in the inbox. [See the documentation](https://setsmart.io/api-documentation)", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| annotations: { | ||
| destructiveHint: false, | ||
| openWorldHint: true, | ||
| readOnlyHint: false, | ||
| }, | ||
| props: { | ||
| setsmart, | ||
| contactId: { | ||
| propDefinition: [ | ||
| setsmart, | ||
| "contactId", | ||
| ], | ||
| }, | ||
| phone: { | ||
| propDefinition: [ | ||
| setsmart, | ||
| "phone", | ||
| ], | ||
| }, | ||
| email: { | ||
| propDefinition: [ | ||
| setsmart, | ||
| "email", | ||
| ], | ||
| }, | ||
| notes: { | ||
| propDefinition: [ | ||
| setsmart, | ||
| "notes", | ||
| ], | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| if (!this.contactId && !this.phone && !this.email) { | ||
| throw new ConfigurationError("You must provide at least one of **Contact ID**, **Phone** or **Email** to identify the contact."); | ||
| } | ||
|
|
||
| const response = await this.setsmart.addNotes({ | ||
| $, | ||
| data: { | ||
| contact_id: this.contactId, | ||
| phone: this.phone, | ||
| email: this.email, | ||
| notes: this.notes, | ||
| }, | ||
| }); | ||
|
|
||
| $.export("$summary", "Successfully added the note to the contact"); | ||
| return response; | ||
| }, | ||
| }; |
60 changes: 60 additions & 0 deletions
60
components/setsmart/actions/add-tag-to-contact/add-tag-to-contact.mjs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| import { ConfigurationError } from "@pipedream/platform"; | ||
| import setsmart from "../../setsmart.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "setsmart-add-tag-to-contact", | ||
| name: "Add Tag To Contact", | ||
| description: "Add a tag to an existing contact. [See the documentation](https://setsmart.io/api-documentation)", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| annotations: { | ||
| destructiveHint: false, | ||
| openWorldHint: true, | ||
| readOnlyHint: false, | ||
| }, | ||
| props: { | ||
| setsmart, | ||
| contactId: { | ||
| propDefinition: [ | ||
| setsmart, | ||
| "contactId", | ||
| ], | ||
| }, | ||
| phone: { | ||
| propDefinition: [ | ||
| setsmart, | ||
| "phone", | ||
| ], | ||
| }, | ||
| email: { | ||
| propDefinition: [ | ||
| setsmart, | ||
| "email", | ||
| ], | ||
| }, | ||
| tag: { | ||
| propDefinition: [ | ||
| setsmart, | ||
| "tag", | ||
| ], | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| if (!this.contactId && !this.phone && !this.email) { | ||
| throw new ConfigurationError("You must provide at least one of **Contact ID**, **Phone** or **Email** to identify the contact."); | ||
| } | ||
|
|
||
| const response = await this.setsmart.addTag({ | ||
| $, | ||
| data: { | ||
| conversation_id: this.contactId, | ||
| phone: this.phone, | ||
| email: this.email, | ||
| tag: this.tag, | ||
| }, | ||
| }); | ||
|
|
||
| $.export("$summary", `Successfully added the tag ${this.tag}`); | ||
| return response; | ||
| }, | ||
| }; |
33 changes: 33 additions & 0 deletions
33
components/setsmart/actions/cancel-scheduled-message/cancel-scheduled-message.mjs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| import setsmart from "../../setsmart.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "setsmart-cancel-scheduled-message", | ||
| name: "Cancel Scheduled Message", | ||
| description: "Cancel a message that is scheduled but not sent yet. [See the documentation](https://setsmart.io/api-documentation)", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| annotations: { | ||
| destructiveHint: true, | ||
| openWorldHint: true, | ||
| readOnlyHint: false, | ||
| }, | ||
| props: { | ||
| setsmart, | ||
| scheduledMessageId: { | ||
| type: "string", | ||
| label: "Scheduled Message ID", | ||
| description: "The ID of the scheduled message, as returned by the **List Scheduled Messages** action", | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const response = await this.setsmart.cancelScheduledMessage({ | ||
| $, | ||
| data: { | ||
| id: this.scheduledMessageId, | ||
| }, | ||
| }); | ||
|
|
||
| $.export("$summary", `Successfully cancelled the scheduled message ${this.scheduledMessageId}`); | ||
| return response; | ||
| }, | ||
| }; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,69 @@ | ||
| import { ConfigurationError } from "@pipedream/platform"; | ||
| import setsmart from "../../setsmart.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "setsmart-find-contact", | ||
| name: "Find Contact", | ||
| description: "Find a contact and its conversation history by ID, phone number, email address, Instagram username or tag. [See the documentation](https://setsmart.io/api-documentation)", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| annotations: { | ||
| destructiveHint: false, | ||
| openWorldHint: true, | ||
| readOnlyHint: true, | ||
| }, | ||
| props: { | ||
| setsmart, | ||
| contactId: { | ||
| propDefinition: [ | ||
| setsmart, | ||
| "contactId", | ||
| ], | ||
| }, | ||
| phone: { | ||
| propDefinition: [ | ||
| setsmart, | ||
| "phone", | ||
| ], | ||
| }, | ||
| email: { | ||
| propDefinition: [ | ||
| setsmart, | ||
| "email", | ||
| ], | ||
| }, | ||
| instagramUsername: { | ||
| propDefinition: [ | ||
| setsmart, | ||
| "instagramUsername", | ||
| ], | ||
| }, | ||
| tag: { | ||
| propDefinition: [ | ||
| setsmart, | ||
| "tag", | ||
| ], | ||
| description: "Return the contacts carrying this tag", | ||
| optional: true, | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| if (!this.contactId && !this.phone && !this.email && !this.instagramUsername && !this.tag) { | ||
| throw new ConfigurationError("You must provide at least one of **Contact ID**, **Phone**, **Email**, **Instagram Username** or **Tag**."); | ||
| } | ||
|
|
||
| const response = await this.setsmart.findContact({ | ||
| $, | ||
| params: { | ||
| contact_id: this.contactId, | ||
| phone: this.phone, | ||
| email: this.email, | ||
| instagram_username: this.instagramUsername, | ||
| tag: this.tag, | ||
| }, | ||
| }); | ||
|
|
||
| $.export("$summary", "Successfully searched for the contact"); | ||
| return response; | ||
| }, | ||
| }; |
83 changes: 83 additions & 0 deletions
83
components/setsmart/actions/import-contact/import-contact.mjs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,83 @@ | ||
| import { ConfigurationError } from "@pipedream/platform"; | ||
| import setsmart from "../../setsmart.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "setsmart-import-contact", | ||
| name: "Import Contact", | ||
| description: "Create a contact in the workspace and optionally hand it over to an AI assistant. [See the documentation](https://setsmart.io/api-documentation)", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| annotations: { | ||
| destructiveHint: false, | ||
| openWorldHint: true, | ||
| readOnlyHint: false, | ||
| }, | ||
| props: { | ||
| setsmart, | ||
| phone: { | ||
| propDefinition: [ | ||
| setsmart, | ||
| "phone", | ||
| ], | ||
| }, | ||
| email: { | ||
| propDefinition: [ | ||
| setsmart, | ||
| "email", | ||
| ], | ||
| }, | ||
| firstName: { | ||
| type: "string", | ||
| label: "First Name", | ||
| description: "First name of the contact", | ||
| optional: true, | ||
| }, | ||
| lastName: { | ||
| type: "string", | ||
| label: "Last Name", | ||
| description: "Last name of the contact", | ||
| optional: true, | ||
| }, | ||
| tag: { | ||
| propDefinition: [ | ||
| setsmart, | ||
| "tag", | ||
| ], | ||
| optional: true, | ||
| }, | ||
| notes: { | ||
| propDefinition: [ | ||
| setsmart, | ||
| "notes", | ||
| ], | ||
| optional: true, | ||
| }, | ||
| assistantId: { | ||
| propDefinition: [ | ||
| setsmart, | ||
| "assistantId", | ||
| ], | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| if (!this.phone && !this.email) { | ||
| throw new ConfigurationError("You must provide at least a **Phone** or an **Email** to import a contact."); | ||
| } | ||
|
|
||
| const response = await this.setsmart.importContact({ | ||
| $, | ||
| data: { | ||
| number: this.phone, | ||
| email: this.email, | ||
| name: this.firstName, | ||
| last: this.lastName, | ||
| tag: this.tag, | ||
| notes: this.notes, | ||
| assistant_id: this.assistantId, | ||
| }, | ||
| }); | ||
|
|
||
| $.export("$summary", `Successfully imported the contact ${this.phone || this.email}`); | ||
| return response; | ||
| }, | ||
| }; |
25 changes: 25 additions & 0 deletions
25
components/setsmart/actions/list-answered-leads/list-answered-leads.mjs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| import setsmart from "../../setsmart.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "setsmart-list-answered-leads", | ||
| name: "List Answered Leads", | ||
| description: "List the leads who replied to the AI assistant. [See the documentation](https://setsmart.io/api-documentation)", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| annotations: { | ||
| destructiveHint: false, | ||
| openWorldHint: true, | ||
| readOnlyHint: true, | ||
| }, | ||
| props: { | ||
| setsmart, | ||
| }, | ||
| async run({ $ }) { | ||
| const response = await this.setsmart.listAnsweredLeads({ | ||
| $, | ||
| }); | ||
|
|
||
| $.export("$summary", `Successfully retrieved ${response?.length ?? 0} answered lead(s)`); | ||
| return response; | ||
| }, | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| import setsmart from "../../setsmart.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "setsmart-list-leads", | ||
| name: "List Leads", | ||
| description: "List every lead in the workspace. [See the documentation](https://setsmart.io/api-documentation)", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| annotations: { | ||
| destructiveHint: false, | ||
| openWorldHint: true, | ||
| readOnlyHint: true, | ||
| }, | ||
| props: { | ||
| setsmart, | ||
| }, | ||
| async run({ $ }) { | ||
| const response = await this.setsmart.listLeads({ | ||
| $, | ||
| }); | ||
|
|
||
| $.export("$summary", `Successfully retrieved ${response?.length ?? 0} lead(s)`); | ||
| return response; | ||
| }, | ||
| }; |
25 changes: 25 additions & 0 deletions
25
components/setsmart/actions/list-qualified-leads/list-qualified-leads.mjs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| import setsmart from "../../setsmart.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "setsmart-list-qualified-leads", | ||
| name: "List Qualified Leads", | ||
| description: "List the leads the AI assistant qualified as ready to book a call. [See the documentation](https://setsmart.io/api-documentation)", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| annotations: { | ||
| destructiveHint: false, | ||
| openWorldHint: true, | ||
| readOnlyHint: true, | ||
| }, | ||
| props: { | ||
| setsmart, | ||
| }, | ||
| async run({ $ }) { | ||
| const response = await this.setsmart.listQualifiedLeads({ | ||
| $, | ||
| }); | ||
|
|
||
| $.export("$summary", `Successfully retrieved ${response?.length ?? 0} qualified lead(s)`); | ||
| return response; | ||
| }, | ||
| }; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Specify the scheduled-message ID format.
Line 19 states where to obtain the ID, but it does not state the expected format or include a valid example. Document the API ID format and add an inline example.
As per path instructions, non-obvious ID descriptions must include concrete inline examples.
🤖 Prompt for AI Agents
Source: Path instructions