Skip to content

Commit f5a7494

Browse files
Add Adversus actions: Create/Update Lead, Add Note/Activity, Change Lead Status, Assign to Campaign
- Added Create or Update Lead action - Added Add Note or Activity action - Added Change Lead Status action - Added Assign Lead to Campaign action - Updated adversus.app.mjs with API methods and authentication - Updated README.md with API documentation link (https://solutions.adversus.io/api) - Fixed data merging in changeLeadStatus and assignLeadToCampaign methods - Added proper annotations to all actions
1 parent ca39807 commit f5a7494

File tree

7 files changed

+528
-4
lines changed

7 files changed

+528
-4
lines changed

components/adversus/PR_STEPS.md

Lines changed: 180 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,180 @@
1+
# Steps to Raise a Pull Request for Adversus Components Contribution
2+
3+
## Summary of Changes
4+
5+
This contribution adds four new actions to the Adversus Pipedream component:
6+
7+
1. **Create or Update Lead** - Create a new lead or update an existing lead in Adversus
8+
2. **Add Note or Activity** - Add a note or activity to a lead in Adversus
9+
3. **Change Lead Status** - Change the status of a lead in Adversus
10+
4. **Assign Lead to Campaign** - Assign a lead to a campaign in Adversus
11+
12+
All actions include proper API documentation links pointing to: https://solutions.adversus.io/api
13+
14+
## Steps to Raise a Pull Request
15+
16+
### 0. Connect Your Local Repository to Your Fork
17+
18+
**If you already have the repository cloned locally** (like you do), you need to connect it to your fork:
19+
20+
#### Step 0.1: Fork the Repository on GitHub
21+
22+
1. Go to https://github.com/PipedreamHQ/pipedream
23+
2. Click the "Fork" button in the top right corner
24+
3. Wait for the fork to complete (this creates `https://github.com/<your-github-username>/pipedream`)
25+
26+
#### Step 0.2: Connect Your Local Repository to Your Fork
27+
28+
You have two options:
29+
30+
**Option A: Change origin to point to your fork** (Recommended for simplicity)
31+
32+
```bash
33+
cd /Users/nallellasiddartha/testingcursor/pipedream
34+
35+
# Remove current origin
36+
git remote remove origin
37+
38+
# Add your fork as origin
39+
git remote add origin https://github.com/<your-github-username>/pipedream.git
40+
41+
# Add upstream (original PipedreamHQ repo) for future updates
42+
git remote add upstream https://github.com/PipedreamHQ/pipedream.git
43+
44+
# Verify remotes
45+
git remote -v
46+
# Should show:
47+
# origin https://github.com/<your-github-username>/pipedream.git (fetch)
48+
# origin https://github.com/<your-github-username>/pipedream.git (push)
49+
# upstream https://github.com/PipedreamHQ/pipedream.git (fetch)
50+
# upstream https://github.com/PipedreamHQ/pipedream.git (push)
51+
```
52+
53+
**Option B: Keep upstream as origin, add fork as separate remote** (If you want to keep origin pointing to upstream)
54+
55+
```bash
56+
cd /Users/nallellasiddartha/testingcursor/pipedream
57+
58+
# Add your fork as a separate remote (you can name it 'fork' or 'myfork')
59+
git remote add fork https://github.com/<your-github-username>/pipedream.git
60+
61+
# Verify remotes
62+
git remote -v
63+
# Should show:
64+
# origin https://github.com/PipedreamHQ/pipedream.git (fetch)
65+
# origin https://github.com/PipedreamHQ/pipedream.git (push)
66+
# fork https://github.com/<your-github-username>/pipedream.git (fetch)
67+
# fork https://github.com/<your-github-username>/pipedream.git (push)
68+
```
69+
70+
**Note:** Replace `<your-github-username>` with your actual GitHub username in the commands above.
71+
72+
### 1. Fork and Clone the Repository (Skip if you already have it locally)
73+
74+
**If you don't have the repository cloned yet**, follow these steps:
75+
76+
```bash
77+
# Fork the Pipedream repository on GitHub first, then:
78+
git clone https://github.com/<your-github-username>/pipedream.git
79+
cd pipedream
80+
```
81+
82+
### 2. Create a New Branch
83+
84+
```bash
85+
git checkout -b adversus-actions-update
86+
```
87+
88+
### 3. Verify Your Changes
89+
90+
Ensure all files are properly created:
91+
- `components/adversus/adversus.app.mjs` (updated with API methods)
92+
- `components/adversus/README.md` (updated with API docs link)
93+
- `components/adversus/actions/create-or-update-lead/create-or-update-lead.mjs`
94+
- `components/adversus/actions/add-note-activity/add-note-activity.mjs`
95+
- `components/adversus/actions/change-lead-status/change-lead-status.mjs`
96+
- `components/adversus/actions/assign-to-campaign/assign-to-campaign.mjs`
97+
98+
### 4. Stage and Commit Changes
99+
100+
```bash
101+
git add components/adversus/
102+
git commit -m "Add Adversus actions: Create/Update Lead, Add Note/Activity, Change Lead Status, Assign to Campaign
103+
104+
- Added Create or Update Lead action
105+
- Added Add Note or Activity action
106+
- Added Change Lead Status action
107+
- Added Assign Lead to Campaign action
108+
- Updated adversus.app.mjs with API methods and authentication
109+
- Updated README.md with API documentation link (https://solutions.adversus.io/api)"
110+
```
111+
112+
### 5. Push to Your Fork
113+
114+
**If you used Option A (changed origin to your fork):**
115+
```bash
116+
git push origin adversus-actions-update
117+
```
118+
119+
**If you used Option B (kept upstream as origin, added fork as separate remote):**
120+
```bash
121+
# If you added it as 'origin':
122+
git push origin adversus-actions-update
123+
124+
# OR if you added it as 'fork':
125+
git push fork adversus-actions-update
126+
```
127+
128+
### 6. Create Pull Request on GitHub
129+
130+
1. Go to your forked repository on GitHub
131+
2. Click "Compare & pull request" button that appears after pushing
132+
3. Fill in the PR details:
133+
- **Title**: `Add Adversus Actions: Create/Update Lead, Add Note/Activity, Change Lead Status, Assign to Campaign`
134+
- **Description**:
135+
```
136+
This PR adds four new actions to the Adversus component:
137+
138+
- Create or Update Lead - Create a new lead or update an existing lead
139+
- Add Note or Activity - Add a note or activity to a lead
140+
- Change Lead Status - Change the status of a lead
141+
- Assign Lead to Campaign - Assign a lead to a campaign
142+
143+
All actions include API documentation references to https://solutions.adversus.io/api
144+
145+
The adversus.app.mjs file has been updated with:
146+
- Proper authentication methods
147+
- API methods for all actions
148+
- Prop definitions for reusable components (leadId, campaignId, statusId)
149+
```
150+
151+
### 7. Wait for Review
152+
153+
- A member of the Pipedream team will be automatically notified
154+
- Monitor your PR for comments or requested changes
155+
- Make any necessary adjustments based on feedback
156+
157+
### 8. Spellchecking Note
158+
159+
If the spellchecker fails on any Markdown files:
160+
- Check the output for misspelled words
161+
- Add technical words (like "Adversus") to `.wordlist.txt` if needed
162+
163+
## Alternative: Using Gitpod Workspace
164+
165+
You can also use the Gitpod workspace for development:
166+
167+
1. Fork the [Pipedream GitHub Repository](https://github.com/PipedreamHQ/pipedream)
168+
2. Add your PD API key to [Gitpod Variables](https://gitpod.io/variables) as `PD_API_KEY`
169+
3. Open a new Gitpod Workspace: `https://gitpod.io/#https://github.com/<your-github-username>/pipedream`
170+
4. Make your changes and commit them
171+
5. Push and create a PR as described above
172+
173+
## Additional Resources
174+
175+
- [Pipedream Component Guidelines](https://pipedream.com/docs/components/guidelines/)
176+
- [Pipedream Contributing Guide](https://github.com/PipedreamHQ/pipedream/blob/master/CONTRIBUTING.md)
177+
- [Adversus API Documentation](https://solutions.adversus.io/api)
178+
179+
180+

components/adversus/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
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.
44

5+
# API Documentation
6+
7+
For detailed API documentation, please refer to: https://solutions.adversus.io/api
8+
59
# Example Use Cases
610

711
- **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.
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
import adversus from "../../adversus.app.mjs";
2+
3+
export default {
4+
key: "adversus-add-note-activity",
5+
name: "Add Note or Activity",
6+
description: "Add a note or activity to a lead in Adversus. [See the API documentation](https://solutions.adversus.io/api).",
7+
version: "0.0.1",
8+
annotations: {
9+
destructiveHint: false,
10+
openWorldHint: true,
11+
readOnlyHint: false,
12+
},
13+
type: "action",
14+
props: {
15+
adversus,
16+
leadId: {
17+
propDefinition: [
18+
adversus,
19+
"leadId",
20+
],
21+
},
22+
note: {
23+
type: "string",
24+
label: "Note",
25+
description: "The note text to add to the lead",
26+
optional: true,
27+
},
28+
activityType: {
29+
type: "string",
30+
label: "Activity Type",
31+
description: "The type of activity (e.g., 'call', 'email', 'meeting')",
32+
optional: true,
33+
},
34+
activityDescription: {
35+
type: "string",
36+
label: "Activity Description",
37+
description: "The description of the activity",
38+
optional: true,
39+
},
40+
additionalFields: {
41+
type: "object",
42+
label: "Additional Fields",
43+
description: "Additional fields to include in the note or activity",
44+
optional: true,
45+
},
46+
},
47+
async run({ $ }) {
48+
const promises = [];
49+
50+
if (this.note) {
51+
promises.push(
52+
this.adversus.addNoteToLead(this.leadId, {
53+
data: {
54+
note: this.note,
55+
...(this.additionalFields || {}),
56+
},
57+
})
58+
);
59+
}
60+
61+
if (this.activityType || this.activityDescription) {
62+
promises.push(
63+
this.adversus.addActivityToLead(this.leadId, {
64+
data: {
65+
...(this.activityType && { type: this.activityType }),
66+
...(this.activityDescription && { description: this.activityDescription }),
67+
...(this.additionalFields || {}),
68+
},
69+
})
70+
);
71+
}
72+
73+
if (promises.length === 0) {
74+
throw new Error("Either 'Note' or 'Activity Type'/'Activity Description' must be provided");
75+
}
76+
77+
const results = await Promise.all(promises);
78+
79+
$.export("$summary", `Successfully added ${promises.length} item(s) to lead ${this.leadId}`);
80+
81+
return results.length === 1 ? results[0] : results;
82+
},
83+
};
84+
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
import adversus from "../../adversus.app.mjs";
2+
3+
export default {
4+
key: "adversus-assign-to-campaign",
5+
name: "Assign Lead to Campaign",
6+
description: "Assign a lead to a campaign in Adversus. [See the API documentation](https://solutions.adversus.io/api).",
7+
version: "0.0.1",
8+
annotations: {
9+
destructiveHint: true,
10+
openWorldHint: true,
11+
readOnlyHint: false,
12+
},
13+
type: "action",
14+
props: {
15+
adversus,
16+
leadId: {
17+
propDefinition: [
18+
adversus,
19+
"leadId",
20+
],
21+
},
22+
campaignId: {
23+
propDefinition: [
24+
adversus,
25+
"campaignId",
26+
],
27+
},
28+
additionalFields: {
29+
type: "object",
30+
label: "Additional Fields",
31+
description: "Additional fields to include when assigning to campaign",
32+
optional: true,
33+
},
34+
},
35+
async run({ $ }) {
36+
const response = await this.adversus.assignLeadToCampaign(this.leadId, this.campaignId, {
37+
data: {
38+
...(this.additionalFields || {}),
39+
},
40+
});
41+
42+
$.export("$summary", `Successfully assigned lead ${this.leadId} to campaign ${this.campaignId}`);
43+
44+
return response;
45+
},
46+
};
47+
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
import adversus from "../../adversus.app.mjs";
2+
3+
export default {
4+
key: "adversus-change-lead-status",
5+
name: "Change Lead Status",
6+
description: "Change the status of a lead in Adversus. [See the API documentation](https://solutions.adversus.io/api).",
7+
version: "0.0.1",
8+
annotations: {
9+
destructiveHint: true,
10+
openWorldHint: true,
11+
readOnlyHint: false,
12+
},
13+
type: "action",
14+
props: {
15+
adversus,
16+
leadId: {
17+
propDefinition: [
18+
adversus,
19+
"leadId",
20+
],
21+
},
22+
statusId: {
23+
propDefinition: [
24+
adversus,
25+
"statusId",
26+
],
27+
},
28+
additionalFields: {
29+
type: "object",
30+
label: "Additional Fields",
31+
description: "Additional fields to include when changing the status",
32+
optional: true,
33+
},
34+
},
35+
async run({ $ }) {
36+
const response = await this.adversus.changeLeadStatus(this.leadId, this.statusId, {
37+
data: {
38+
...(this.additionalFields || {}),
39+
},
40+
});
41+
42+
$.export("$summary", `Successfully changed status of lead ${this.leadId} to status ${this.statusId}`);
43+
44+
return response;
45+
},
46+
};
47+

0 commit comments

Comments
 (0)