-
Notifications
You must be signed in to change notification settings - Fork 5.4k
New Components - instantly #15228
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
Merged
Merged
New Components - instantly #15228
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
377a65b
instantly init
luancazarine 6bb1388
[Components] instantly #15226
luancazarine afbe1ee
pnpm update
luancazarine 8d82ebe
Merge branch 'master' into issue-15226
luancazarine d13254a
pnpm update
luancazarine 0774d94
Merge branch 'master' into issue-15226
luancazarine 93a73f4
fix description
luancazarine 6971622
add documentation URL
luancazarine b9e964d
Merge branch 'master' into issue-15226
luancazarine 3367a34
pnpm update
luancazarine 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
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 |
---|---|---|
|
@@ -8,4 +8,4 @@ export default { | |
console.log(Object.keys(this.$auth)); | ||
}, | ||
}, | ||
}; | ||
}; |
50 changes: 50 additions & 0 deletions
50
components/instantly/actions/add-lead-campaign/add-lead-campaign.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,50 @@ | ||
import { parseObject } from "../../common/utils.mjs"; | ||
import instantly from "../../instantly.app.mjs"; | ||
|
||
export default { | ||
key: "instantly-add-lead-campaign", | ||
name: "Add Lead to Campaign", | ||
description: "Adds a lead to a campaign for tracking or further actions. [See the documentation](https://developer.instantly.ai/lead/add-leads-to-a-campaign)", | ||
version: "0.0.1", | ||
type: "action", | ||
props: { | ||
instantly, | ||
leads: { | ||
propDefinition: [ | ||
instantly, | ||
"leads", | ||
], | ||
}, | ||
campaignId: { | ||
propDefinition: [ | ||
instantly, | ||
"campaignId", | ||
], | ||
}, | ||
skipIfInWorkspace: { | ||
type: "boolean", | ||
label: "Skip if in Workspace", | ||
description: "Skip lead if it exists in any campaigns in the workspace", | ||
optional: true, | ||
}, | ||
skipIfInCampaign: { | ||
type: "boolean", | ||
label: "Skip if in Campaign", | ||
description: "Skip lead if it exists in the campaign", | ||
optional: true, | ||
}, | ||
}, | ||
async run({ $ }) { | ||
const response = await this.instantly.addLeadsToCampaign({ | ||
$, | ||
data: { | ||
leads: parseObject(this.leads), | ||
campaign_id: this.campaignId, | ||
skip_if_in_workspace: this.skipIfInWorkspace, | ||
skip_if_in_campaign: this.skipIfInCampaign, | ||
}, | ||
}); | ||
$.export("$summary", `Added ${response.leads_uploaded} leads to campaign ${this.campaignId}`); | ||
return response; | ||
}, | ||
}; |
40 changes: 40 additions & 0 deletions
40
components/instantly/actions/add-tags-campaign/add-tags-campaign.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,40 @@ | ||
import { parseObject } from "../../common/utils.mjs"; | ||
import instantly from "../../instantly.app.mjs"; | ||
|
||
export default { | ||
key: "instantly-add-tags-campaign", | ||
name: "Add Tags to Campaign", | ||
description: "Adds tags to a specific campaign. [See the documentation](https://developer.instantly.ai/tags/assign-or-unassign-a-tag)", | ||
version: "0.0.1", | ||
type: "action", | ||
props: { | ||
instantly, | ||
campaignIds: { | ||
propDefinition: [ | ||
instantly, | ||
"campaignId", | ||
], | ||
type: "string[]", | ||
}, | ||
luancazarine marked this conversation as resolved.
Show resolved
Hide resolved
|
||
tagIds: { | ||
propDefinition: [ | ||
instantly, | ||
"tagIds", | ||
], | ||
}, | ||
}, | ||
async run({ $ }) { | ||
const response = await this.instantly.addTagsToCampaign({ | ||
$, | ||
data: { | ||
campaign_id: this.campaignId, | ||
tag_ids: parseObject(this.tagIds), | ||
resource_type: 2, | ||
assign: true, | ||
resource_ids: parseObject(this.campaignIds), | ||
}, | ||
}); | ||
$.export("$summary", response.message); | ||
return response; | ||
}, | ||
}; |
47 changes: 47 additions & 0 deletions
47
components/instantly/actions/update-lead-status/update-lead-status.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,47 @@ | ||
import { ConfigurationError } from "@pipedream/platform"; | ||
import instantly from "../../instantly.app.mjs"; | ||
|
||
export default { | ||
key: "instantly-update-lead-status", | ||
name: "Update Lead Status", | ||
description: "Updates the status of a lead in a campaign. [See the documentation](https://developer.instantly.ai/lead/update-lead-status)", | ||
version: "0.0.1", | ||
type: "action", | ||
props: { | ||
instantly, | ||
campaignId: { | ||
propDefinition: [ | ||
instantly, | ||
"campaignId", | ||
], | ||
}, | ||
email: { | ||
propDefinition: [ | ||
instantly, | ||
"email", | ||
], | ||
}, | ||
newStatus: { | ||
propDefinition: [ | ||
instantly, | ||
"newStatus", | ||
], | ||
}, | ||
}, | ||
async run({ $ }) { | ||
try { | ||
const response = await this.instantly.updateLeadStatus({ | ||
$, | ||
data: { | ||
email: this.email, | ||
new_status: this.newStatus, | ||
campaign_id: this.campaignId, | ||
}, | ||
}); | ||
$.export("$summary", `Updated lead ${this.email} to status '${this.newStatus}'`); | ||
return response; | ||
} catch ({ response }) { | ||
throw new ConfigurationError(response.data.error); | ||
} | ||
}, | ||
}; |
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,77 @@ | ||
export const LIMIT = 100; | ||
|
||
export const EVENT_TYPE_OPTIONS = [ | ||
{ | ||
label: "Email Sent", | ||
value: "email_sent", | ||
}, | ||
{ | ||
label: "Email Bounced", | ||
value: "email_bounced", | ||
}, | ||
{ | ||
label: "Email Opened", | ||
value: "email_opened", | ||
}, | ||
{ | ||
label: "Email Link Clicked", | ||
value: "email_link_clicked", | ||
}, | ||
{ | ||
label: "Reply Received", | ||
value: "reply_received", | ||
}, | ||
{ | ||
label: "Lead Unsubscribed", | ||
value: "lead_unsubscribed", | ||
}, | ||
{ | ||
label: "Campaign Completed", | ||
value: "campaign_completed", | ||
}, | ||
{ | ||
label: "Account Error", | ||
value: "account_error", | ||
}, | ||
{ | ||
label: "Lead Not Interested", | ||
value: "lead_not_interested", | ||
}, | ||
{ | ||
label: "Lead Neutral", | ||
value: "lead_neutral", | ||
}, | ||
{ | ||
label: "Lead Meeting Booked", | ||
value: "lead_meeting_booked", | ||
}, | ||
{ | ||
label: "Lead Meeting Completed", | ||
value: "lead_meeting_completed", | ||
}, | ||
{ | ||
label: "Lead Closed", | ||
value: "lead_closed", | ||
}, | ||
{ | ||
label: "Lead Out of Office", | ||
value: "lead_out_of_office", | ||
}, | ||
{ | ||
label: "Lead Wrong Person", | ||
value: "lead_wrong_person", | ||
}, | ||
]; | ||
|
||
export const NEW_STATUS_OPTIONS = [ | ||
"Active", | ||
"Completed", | ||
"Unsubscribed", | ||
"Interested", | ||
"Meeting Booked", | ||
"Meeting Completed", | ||
"Closed", | ||
"Out of Office", | ||
"Not Interested", | ||
"Wrong Person", | ||
]; |
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,24 @@ | ||
export const parseObject = (obj) => { | ||
if (!obj) return undefined; | ||
|
||
if (Array.isArray(obj)) { | ||
return obj.map((item) => { | ||
if (typeof item === "string") { | ||
try { | ||
return JSON.parse(item); | ||
} catch (e) { | ||
return item; | ||
} | ||
} | ||
return item; | ||
}); | ||
} | ||
if (typeof obj === "string") { | ||
try { | ||
return JSON.parse(obj); | ||
} catch (e) { | ||
return obj; | ||
} | ||
} | ||
return obj; | ||
}; |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.