Skip to content

Commit 18c0f54

Browse files
Address CodeRabbit review feedback
- Use propDefinition for leadId in create-or-update-lead action for consistency - Remove PR_STEPS.md file (internal documentation) - Add JSDoc comments to all API methods in adversus.app.mjs
1 parent f5a7494 commit 18c0f54

File tree

3 files changed

+41
-182
lines changed

3 files changed

+41
-182
lines changed

components/adversus/PR_STEPS.md

Lines changed: 0 additions & 180 deletions
This file was deleted.

components/adversus/actions/create-or-update-lead/create-or-update-lead.mjs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,10 @@ export default {
3838
optional: true,
3939
},
4040
leadId: {
41-
type: "string",
42-
label: "Lead ID",
41+
propDefinition: [
42+
adversus,
43+
"leadId",
44+
],
4345
description: "The ID of the lead to update (leave empty to create a new lead)",
4446
optional: true,
4547
},

components/adversus/adversus.app.mjs

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,34 +44,64 @@ export default {
4444
...opts,
4545
});
4646
},
47+
/**
48+
* Create a new lead in Adversus
49+
* @param {Object} opts - Request options including data payload
50+
* @returns {Promise} The created lead response
51+
*/
4752
async createLead(opts) {
4853
return this._makeRequest({
4954
path: "/leads",
5055
method: "POST",
5156
...opts,
5257
});
5358
},
59+
/**
60+
* Update an existing lead in Adversus
61+
* @param {string} leadId - The ID of the lead to update
62+
* @param {Object} opts - Request options including data payload
63+
* @returns {Promise} The updated lead response
64+
*/
5465
async updateLead(leadId, opts) {
5566
return this._makeRequest({
5667
path: `/leads/${leadId}`,
5768
method: "PUT",
5869
...opts,
5970
});
6071
},
72+
/**
73+
* Add a note to a lead in Adversus
74+
* @param {string} leadId - The ID of the lead
75+
* @param {Object} opts - Request options including note data
76+
* @returns {Promise} The response from adding the note
77+
*/
6178
async addNoteToLead(leadId, opts) {
6279
return this._makeRequest({
6380
path: `/leads/${leadId}/notes`,
6481
method: "POST",
6582
...opts,
6683
});
6784
},
85+
/**
86+
* Add an activity to a lead in Adversus
87+
* @param {string} leadId - The ID of the lead
88+
* @param {Object} opts - Request options including activity data
89+
* @returns {Promise} The response from adding the activity
90+
*/
6891
async addActivityToLead(leadId, opts) {
6992
return this._makeRequest({
7093
path: `/leads/${leadId}/activities`,
7194
method: "POST",
7295
...opts,
7396
});
7497
},
98+
/**
99+
* Change the status of a lead in Adversus
100+
* @param {string} leadId - The ID of the lead
101+
* @param {string} statusId - The ID of the new status
102+
* @param {Object} opts - Additional request options
103+
* @returns {Promise} The response from changing the status
104+
*/
75105
async changeLeadStatus(leadId, statusId, opts = {}) {
76106
const { data: optsData, ...restOpts } = opts;
77107
return this._makeRequest({
@@ -84,6 +114,13 @@ export default {
84114
...restOpts,
85115
});
86116
},
117+
/**
118+
* Assign a lead to a campaign in Adversus
119+
* @param {string} leadId - The ID of the lead
120+
* @param {string} campaignId - The ID of the campaign
121+
* @param {Object} opts - Additional request options
122+
* @returns {Promise} The response from assigning the lead
123+
*/
87124
async assignLeadToCampaign(leadId, campaignId, opts = {}) {
88125
const { data: optsData, ...restOpts } = opts;
89126
return this._makeRequest({

0 commit comments

Comments
 (0)