Skip to content
Open
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
4 changes: 4 additions & 0 deletions components/adversus/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

Adversus is a powerful dialer and CRM platform tailored to streamline outbound call center operations and enhance sales processes. Leveraging the Adversus API with Pipedream opens up immense possibilities for automating call workflows, syncing lead data, and crafting custom triggers based on call outcomes or performance metrics. By creating serverless workflows on Pipedream, you can connect Adversus to a myriad of other apps and services to optimize lead management, automate repetitive tasks, and gain real-time insights into your sales funnel.

# API Documentation

For detailed API documentation, please refer to: https://solutions.adversus.io/api

# Example Use Cases

- **Automated Lead Syncing with CRM**: Whenever a new lead is added to Adversus, the workflow automatically syncs this lead to your chosen CRM, such as Salesforce or HubSpot. It ensures that any updates made by the sales team in Adversus reflect in the CRM, keeping both systems in harmony and up-to-date.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
import adversus from "../../adversus.app.mjs";

export default {
key: "adversus-add-note-activity",
name: "Add Note or Activity",
description: "Add a note or activity to a lead in Adversus. [See the API documentation](https://solutions.adversus.io/api).",
version: "0.0.1",
annotations: {
destructiveHint: false,
openWorldHint: true,
readOnlyHint: false,
},
type: "action",
props: {
adversus,
leadId: {
propDefinition: [
adversus,
"leadId",
],
},
note: {
type: "string",
label: "Note",
description: "The note text to add to the lead",
optional: true,
},
activityType: {
type: "string",
label: "Activity Type",
description: "The type of activity (e.g., 'call', 'email', 'meeting')",
optional: true,
},
activityDescription: {
type: "string",
label: "Activity Description",
description: "The description of the activity",
optional: true,
},
additionalFields: {
type: "object",
label: "Additional Fields",
description: "Additional fields to include in the note or activity",
optional: true,
},
},
/**
* Execute the action to add a note or activity to a lead
* @param {Object} $ - Pipedream context
* @returns {Promise} The response from adding note/activity
*/
async run({ $ }) {
const promises = [];

if (this.note) {
promises.push(
this.adversus.addNoteToLead(this.leadId, {
data: {
note: this.note,
...(this.additionalFields || {}),
},
})

Check failure on line 62 in components/adversus/actions/add-note-activity/add-note-activity.mjs

View workflow job for this annotation

GitHub Actions / Lint Code Base

Missing trailing comma
);
}

if (this.activityType || this.activityDescription) {
promises.push(
this.adversus.addActivityToLead(this.leadId, {
data: {
...(this.activityType && { type: this.activityType }),

Check failure on line 70 in components/adversus/actions/add-note-activity/add-note-activity.mjs

View workflow job for this annotation

GitHub Actions / Lint Code Base

Expected a line break before this closing brace

Check failure on line 70 in components/adversus/actions/add-note-activity/add-note-activity.mjs

View workflow job for this annotation

GitHub Actions / Lint Code Base

Expected a line break after this opening brace
...(this.activityDescription && { description: this.activityDescription }),

Check failure on line 71 in components/adversus/actions/add-note-activity/add-note-activity.mjs

View workflow job for this annotation

GitHub Actions / Lint Code Base

Expected a line break before this closing brace

Check failure on line 71 in components/adversus/actions/add-note-activity/add-note-activity.mjs

View workflow job for this annotation

GitHub Actions / Lint Code Base

Expected a line break after this opening brace
...(this.additionalFields || {}),
},
})

Check failure on line 74 in components/adversus/actions/add-note-activity/add-note-activity.mjs

View workflow job for this annotation

GitHub Actions / Lint Code Base

Missing trailing comma
);
}

if (promises.length === 0) {
throw new Error("Either 'Note' or 'Activity Type'/'Activity Description' must be provided");
}

const results = await Promise.all(promises);

$.export("$summary", `Successfully added ${promises.length} item(s) to lead ${this.leadId}`);

return results.length === 1 ? results[0] : results;

Check failure on line 86 in components/adversus/actions/add-note-activity/add-note-activity.mjs

View workflow job for this annotation

GitHub Actions / Lint Code Base

Expected newline between consequent and alternate of ternary expression

Check failure on line 86 in components/adversus/actions/add-note-activity/add-note-activity.mjs

View workflow job for this annotation

GitHub Actions / Lint Code Base

Expected newline between test and consequent of ternary expression
},
};

Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import adversus from "../../adversus.app.mjs";

export default {
key: "adversus-assign-to-campaign",
name: "Assign Lead to Campaign",
description: "Assign a lead to a campaign in Adversus. [See the API documentation](https://solutions.adversus.io/api).",
version: "0.0.1",
annotations: {
destructiveHint: true,
openWorldHint: true,
readOnlyHint: false,
},
type: "action",
props: {
adversus,
leadId: {
propDefinition: [
adversus,
"leadId",
],
},
campaignId: {
propDefinition: [
adversus,
"campaignId",
],
},
additionalFields: {
type: "object",
label: "Additional Fields",
description: "Additional fields to include when assigning to campaign",
optional: true,
},
},
/**
* Execute the action to assign a lead to a campaign
* @param {Object} $ - Pipedream context
* @returns {Promise} The response from assigning the lead to campaign
*/
async run({ $ }) {
const response = await this.adversus.assignLeadToCampaign(this.leadId, this.campaignId, {
data: {
...(this.additionalFields || {}),
},
});

$.export("$summary", `Successfully assigned lead ${this.leadId} to campaign ${this.campaignId}`);

return response;
},
};

Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import adversus from "../../adversus.app.mjs";

export default {
key: "adversus-change-lead-status",
name: "Change Lead Status",
description: "Change the status of a lead in Adversus. [See the API documentation](https://solutions.adversus.io/api).",
version: "0.0.1",
annotations: {
destructiveHint: true,
openWorldHint: true,
readOnlyHint: false,
},
type: "action",
props: {
adversus,
leadId: {
propDefinition: [
adversus,
"leadId",
],
},
statusId: {
propDefinition: [
adversus,
"statusId",
],
},
additionalFields: {
type: "object",
label: "Additional Fields",
description: "Additional fields to include when changing the status",
optional: true,
},
},
/**
* Execute the action to change a lead's status
* @param {Object} $ - Pipedream context
* @returns {Promise} The response from changing the lead status
*/
async run({ $ }) {
const response = await this.adversus.changeLeadStatus(this.leadId, this.statusId, {
data: {
...(this.additionalFields || {}),
},
});

$.export("$summary", `Successfully changed status of lead ${this.leadId} to status ${this.statusId}`);

return response;
},
};

Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
import adversus from "../../adversus.app.mjs";

export default {
key: "adversus-create-or-update-lead",
name: "Create or Update Lead",
description: "Create a new lead or update an existing lead in Adversus. [See the API documentation](https://solutions.adversus.io/api).",
version: "0.0.1",
annotations: {
destructiveHint: true,
openWorldHint: true,
readOnlyHint: false,
},
type: "action",
props: {
adversus,
firstName: {
type: "string",
label: "First Name",
description: "The first name of the lead",
optional: true,
},
lastName: {
type: "string",
label: "Last Name",
description: "The last name of the lead",
optional: true,
},
email: {
type: "string",
label: "Email",
description: "The email address of the lead",
optional: true,
},
phone: {
type: "string",
label: "Phone",
description: "The phone number of the lead",
optional: true,
},
leadId: {
propDefinition: [
adversus,
"leadId",
],
description: "The ID of the lead to update (leave empty to create a new lead)",
optional: true,
},
additionalFields: {
type: "object",
label: "Additional Fields",
description: "Additional fields to include in the lead data",
optional: true,
},
},
/**
* Execute the action to create or update a lead
* @param {Object} $ - Pipedream context
* @returns {Promise} The created or updated lead response
*/
async run({ $ }) {
const data = {
...(this.firstName && { firstName: this.firstName }),

Check failure on line 62 in components/adversus/actions/create-or-update-lead/create-or-update-lead.mjs

View workflow job for this annotation

GitHub Actions / Lint Code Base

Expected a line break before this closing brace

Check failure on line 62 in components/adversus/actions/create-or-update-lead/create-or-update-lead.mjs

View workflow job for this annotation

GitHub Actions / Lint Code Base

Expected a line break after this opening brace
...(this.lastName && { lastName: this.lastName }),
...(this.email && { email: this.email }),
...(this.phone && { phone: this.phone }),
...(this.additionalFields || {}),
};

if (!Object.keys(data).length) {
throw new Error("At least one field must be provided to create or update a lead. Please provide firstName, lastName, email, phone, or additionalFields.");
}

const response = this.leadId
? await this.adversus.updateLead(this.leadId, { data })
: await this.adversus.createLead({ data });

$.export("$summary", this.leadId
? `Successfully updated lead ${this.leadId}`
: "Successfully created new lead");

return response;
},
};

Loading
Loading