-
Notifications
You must be signed in to change notification settings - Fork 5.7k
feat(apollo_io_oauth): add all actions to match API key component #20506
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,76 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import app from "../../apollo_io_oauth.app.mjs"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| export default { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| key: "apollo_io_oauth-add-contacts-to-sequence", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| name: "Add Contacts to Sequence", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| description: "Adds one or more contacts to a sequence in Apollo.io. [See the documentation](https://apolloio.github.io/apollo-api-docs/?shell#add-contacts-to-sequence)", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| type: "action", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| version: "0.0.1", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| annotations: { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| destructiveHint: false, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| openWorldHint: true, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| readOnlyHint: false, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| props: { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| app, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| sequenceId: { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| propDefinition: [ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| app, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "sequenceId", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| contactIds: { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| propDefinition: [ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| app, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "contactId", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| type: "string[]", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| label: "Contact IDs", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| description: "Identifiers of the contacts to add to sequence", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| emailAccountId: { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| propDefinition: [ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| app, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "emailAccountId", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| sequenceNoEmail: { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| type: "boolean", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| label: "Sequence No Email", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| description: " Whether to still sequence the contact if he/she does not have an email address", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| optional: true, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| sequenceActiveInOtherCampaigns: { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| type: "boolean", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| label: "Sequence Active in Other Campaigns", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| description: "Whether to still sequence the contact if he/she is active or paused in another sequence", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| optional: true, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| sequenceFinishedInOtherCampaigns: { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| type: "boolean", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| label: "Sequence Finished in Other Campaigns", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| description: "Whether to still sequence the contact if he/she already finished another sequence", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| optional: true, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| async run({ $ }) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const { contacts } = await this.app.addContactsToSequence({ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| $, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| sequenceId: this.sequenceId, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| data: { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| contact_ids: this.contactIds, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| emailer_campaign_id: this.sequenceId, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| send_email_from_email_account_id: this.emailAccountId, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| sequence_no_email: this.sequenceNoEmail, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| sequence_active_in_other_campaigns: this.sequenceActiveInOtherCampaigns, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| sequence_finished_in_other_campaigns: this.sequenceFinishedInOtherCampaigns, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| $.export("$summary", `Successfully added ${contacts.length} contact${contacts.length === 1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ? "" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| : "s"} to sequence.`); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| return contacts; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+57
to
+75
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Guard summary construction against missing If the API response shape changes or omits Suggested fix- const { contacts } = await this.app.addContactsToSequence({
+ const { contacts = [] } = await this.app.addContactsToSequence({
$,
sequenceId: this.sequenceId,
data: {
contact_ids: this.contactIds,
emailer_campaign_id: this.sequenceId,
send_email_from_email_account_id: this.emailAccountId,
sequence_no_email: this.sequenceNoEmail,
sequence_active_in_other_campaigns: this.sequenceActiveInOtherCampaigns,
sequence_finished_in_other_campaigns: this.sequenceFinishedInOtherCampaigns,
},
});📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| import app from "../../apollo_io_oauth.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "apollo_io_oauth-create-account", | ||
| name: "Create Account", | ||
| description: "Creates a new account in Apollo.io. [See the documentation](https://apolloio.github.io/apollo-api-docs/?shell#create-an-account)", | ||
| type: "action", | ||
| version: "0.0.1", | ||
| annotations: { | ||
| destructiveHint: false, | ||
| openWorldHint: true, | ||
| readOnlyHint: false, | ||
| }, | ||
| props: { | ||
| app, | ||
| name: { | ||
| propDefinition: [ | ||
| app, | ||
| "name", | ||
| ], | ||
| }, | ||
| domain: { | ||
| propDefinition: [ | ||
| app, | ||
| "domain", | ||
| ], | ||
| }, | ||
| address: { | ||
| propDefinition: [ | ||
| app, | ||
| "address", | ||
| ], | ||
| description: "The address string for this account, Apollo will intelligently infer the city, state, country, and time zone from your address", | ||
| }, | ||
| phone: { | ||
| propDefinition: [ | ||
| app, | ||
| "phone", | ||
| ], | ||
| description: "The corporate phone for this account", | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const { account } = await this.app.createAccount({ | ||
| $, | ||
| data: { | ||
| name: this.name, | ||
| domain: this.domain, | ||
| raw_address: this.address, | ||
| phone_number: this.phone, | ||
| }, | ||
| }); | ||
|
|
||
| $.export("$summary", `Successfully created account with ID ${account.id}`); | ||
|
|
||
| return account; | ||
| }, | ||
| }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,100 @@ | ||
| import app from "../../apollo_io_oauth.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "apollo_io_oauth-create-contact", | ||
| name: "Create Contact", | ||
| description: "Creates a new contact in Apollo.io. [See the documentation](https://apolloio.github.io/apollo-api-docs/?shell#create-a-contact)", | ||
| type: "action", | ||
| version: "0.0.1", | ||
| annotations: { | ||
| destructiveHint: false, | ||
| openWorldHint: true, | ||
| readOnlyHint: false, | ||
| }, | ||
| props: { | ||
| app, | ||
| email: { | ||
| propDefinition: [ | ||
| app, | ||
| "email", | ||
| ], | ||
| }, | ||
| firstName: { | ||
| propDefinition: [ | ||
| app, | ||
| "firstName", | ||
| ], | ||
| }, | ||
| lastName: { | ||
| propDefinition: [ | ||
| app, | ||
| "lastName", | ||
| ], | ||
| }, | ||
| title: { | ||
| propDefinition: [ | ||
| app, | ||
| "title", | ||
| ], | ||
| }, | ||
| accountId: { | ||
| propDefinition: [ | ||
| app, | ||
| "accountId", | ||
| ], | ||
| optional: true, | ||
| }, | ||
| websiteUrl: { | ||
| propDefinition: [ | ||
| app, | ||
| "websiteUrl", | ||
| ], | ||
| }, | ||
| labelNames: { | ||
| propDefinition: [ | ||
| app, | ||
| "labelNames", | ||
| ], | ||
| }, | ||
| contactStageId: { | ||
| propDefinition: [ | ||
| app, | ||
| "contactStageId", | ||
| ], | ||
| optional: true, | ||
| }, | ||
| address: { | ||
| propDefinition: [ | ||
| app, | ||
| "address", | ||
| ], | ||
| }, | ||
| phone: { | ||
| propDefinition: [ | ||
| app, | ||
| "phone", | ||
| ], | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const { contact } = await this.app.createContact({ | ||
| $, | ||
| data: { | ||
| email: this.email, | ||
| first_name: this.firstName, | ||
| last_name: this.lastName, | ||
| title: this.title, | ||
| account_id: this.accountId, | ||
| website_url: this.websiteUrl, | ||
| label_names: this.labelNames, | ||
| contact_stage_id: this.contactStageId, | ||
| present_raw_address: this.address, | ||
| direct_phone: this.phone, | ||
| }, | ||
| }); | ||
|
volcano303 marked this conversation as resolved.
|
||
|
|
||
| $.export("$summary", `Successfully created contact with ID ${contact.id}`); | ||
|
|
||
| return contact; | ||
| }, | ||
| }; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,71 @@ | ||
| import app from "../../apollo_io_oauth.app.mjs"; | ||
|
|
||
| export default { | ||
| key: "apollo_io_oauth-create-opportunity", | ||
| name: "Create Opportunity", | ||
| description: "Creates a new opportunity in Apollo.io. [See the documentation](https://apolloio.github.io/apollo-api-docs/?shell#create-opportunity)", | ||
| type: "action", | ||
| version: "0.0.1", | ||
| annotations: { | ||
| destructiveHint: false, | ||
| openWorldHint: true, | ||
| readOnlyHint: false, | ||
| }, | ||
| props: { | ||
| app, | ||
| ownerId: { | ||
| propDefinition: [ | ||
| app, | ||
| "ownerId", | ||
| ], | ||
| optional: true, | ||
| }, | ||
| name: { | ||
| propDefinition: [ | ||
| app, | ||
| "name", | ||
| ], | ||
| description: "The name of the opportunity.", | ||
| }, | ||
| amount: { | ||
| type: "integer", | ||
| label: "Amount", | ||
| description: "The amount of money involved in the opportunity/deal.", | ||
| optional: true, | ||
| }, | ||
| opportunityStageId: { | ||
| propDefinition: [ | ||
| app, | ||
| "opportunityStageId", | ||
| ], | ||
| }, | ||
| closedDate: { | ||
| type: "string", | ||
| label: "Closed Date", | ||
| description: "The date the opportunity was closed.", | ||
| }, | ||
| accountId: { | ||
| propDefinition: [ | ||
| app, | ||
| "accountId", | ||
| ], | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const { opportunity } = await this.app.createOpportunity({ | ||
| $, | ||
| data: { | ||
| owner_id: this.ownerId, | ||
| name: this.name, | ||
| amount: this.amount, | ||
| opportunity_stage_id: this.opportunityStageId, | ||
| closed_date: this.closedDate, | ||
| account_id: this.accountId, | ||
| }, | ||
| }); | ||
|
|
||
| $.export("$summary", `Successfully created opportunity with ID ${opportunity.id}`); | ||
|
|
||
| return opportunity; | ||
| }, | ||
| }; |
Uh oh!
There was an error while loading. Please reload this page.