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 {
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.2",
version: "0.0.3",
props: {
app,
sequenceId: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
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.2",
version: "0.0.3",
props: {
app,
name: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
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.3",
version: "0.0.4",
props: {
app,
email: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
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",
version: "0.0.2",
props: {
app,
ownerId: {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
import app from "../../apollo_io.app.mjs";
import utils from "../../common/utils.mjs";

export default {
key: "apollo_io-create-update-contact",
name: "Create Or Update Contact",
description: "Creates or updates a specific contact. If the contact email already exists, it's updated. Otherwise, a new contact is created. [See the documentation](https://apolloio.github.io/apollo-api-docs/?shell#create-a-contact)",
type: "action",
version: "0.0.1",
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({ $: step }) {
let contact = {};
let action = "created";
let data = utils.cleanObject({
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,
});

const { contacts } = await this.app.listContacts({
params: {
q_keywords: this.email,
},
});

if (contacts.length) {
action = "updated";
contact = contacts[0];

await this.app.updateContact({
step,
contactId: contact.id,
data: {
...contact,
...data,
},
});
} else {
const response = await this.app.createContact({
step,
data,
});
contact = response.contact;
}

step.export("$summary", `Successfully ${action} contact with ID ${contact.id}`);

return contact;
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
name: "Get Opportunity",
description: "Gets a specific opportunity in Apollo.io. [See the documentation](https://apolloio.github.io/apollo-api-docs/?shell#view-opportunity)",
type: "action",
version: "0.0.1",
version: "0.0.2",
props: {
app,
opportunityId: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
name: "People Enrichment",
description: "Enriches a person's information, the more information you pass in, the more likely we can find a match. [See the documentation](https://apolloio.github.io/apollo-api-docs/?shell#people-enrichment)",
type: "action",
version: "0.0.3",
version: "0.0.4",
props: {
app,
firstName: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default {
name: "Search For Accounts",
description: "Search for accounts in Apollo.io. [See the documentation](https://apolloio.github.io/apollo-api-docs/?shell#search-for-accounts)",
type: "action",
version: "0.0.1",
version: "0.0.2",
props: {
app,
search: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default {
name: "Search For Contacts",
description: "Search for contacts in Apollo.io. [See the documentation](https://apolloio.github.io/apollo-api-docs/?shell#search-for-contacts)",
type: "action",
version: "0.0.1",
version: "0.0.2",
props: {
app,
search: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default {
name: "Search For Sequences",
description: "Search for sequences in Apollo.io. [See the documentation](https://apolloio.github.io/apollo-api-docs/?shell#search-for-sequences)",
type: "action",
version: "0.0.1",
version: "0.0.2",
props: {
app,
search: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
name: "Update Account Stage",
description: "Updates the stage of one or more accounts in Apollo.io. [See the documentation](https://apolloio.github.io/apollo-api-docs/?shell#update-account-stage)",
type: "action",
version: "0.0.2",
version: "0.0.3",
props: {
app,
accountIds: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default {
name: "Update Account",
description: "Updates an existing account in Apollo.io. [See the documentation](https://apolloio.github.io/apollo-api-docs/?shell#update-an-account)",
type: "action",
version: "0.0.2",
version: "0.0.3",
props: {
app,
accountId: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
name: "Update Contact Stage",
description: "Updates the stage of one or more contacts in Apollo.io. [See the documentation](https://apolloio.github.io/apollo-api-docs/?shell#update-contact-stage)",
type: "action",
version: "0.0.2",
version: "0.0.3",
props: {
app,
contactIds: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default {
name: "Update Contact",
description: "Updates an existing contact in Apollo.io. [See the documentation](https://apolloio.github.io/apollo-api-docs/?shell#update-a-contact)",
type: "action",
version: "0.0.3",
version: "0.0.4",
props: {
app,
contactId: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
name: "Update Opportunity",
description: "Updates a new opportunity in Apollo.io. [See the documentation](https://apolloio.github.io/apollo-api-docs/?shell#update-opportunity)",
type: "action",
version: "0.0.1",
version: "0.0.2",
props: {
app,
opportunityId: {
Expand Down
4 changes: 2 additions & 2 deletions components/apollo_io/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pipedream/apollo_io",
"version": "0.3.0",
"version": "0.4.0",
"description": "Pipedream Apollo.io Components",
"main": "apollo_io.app.mjs",
"keywords": [
Expand All @@ -13,7 +13,7 @@
"access": "public"
},
"dependencies": {
"@pipedream/platform": "^1.6.0",
"@pipedream/platform": "^3.0.3",
"md5": "^2.3.0"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default {
name: "Account Created",
description: "Triggers when an account is created. [See the documentation](https://apolloio.github.io/apollo-api-docs/?shell#search-for-accounts)",
type: "source",
version: "0.0.2",
version: "0.0.3",
dedupe: "unique",
props: {
...common.props,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export default {
name: "Account Updated",
description: "Triggers when an account is updated. [See the documentation](https://apolloio.github.io/apollo-api-docs/?shell#search-for-contacts)",
type: "source",
version: "0.0.2",
version: "0.0.3",
dedupe: "unique",
props: {
...common.props,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default {
name: "Contact Created",
description: "Triggers when a contact is created. [See the documentation](https://apolloio.github.io/apollo-api-docs/?shell#search-for-contacts)",
type: "source",
version: "0.0.4",
version: "0.0.5",
dedupe: "unique",
methods: {
...common.methods,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default {
name: "Contact Updated",
description: "Triggers when a contact is updated. [See the documentation](https://apolloio.github.io/apollo-api-docs/?shell#search-for-contacts)",
type: "source",
version: "0.0.4",
version: "0.0.5",
dedupe: "unique",
methods: {
...common.methods,
Expand Down
6 changes: 3 additions & 3 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading