Skip to content

Commit 0aeb6a8

Browse files
Add JSDoc comments to all API methods
- Added comprehensive JSDoc documentation to all methods - Improves docstring coverage to meet CodeRabbit requirements
1 parent e2fd090 commit 0aeb6a8

File tree

1 file changed

+54
-0
lines changed

1 file changed

+54
-0
lines changed

components/adversus/adversus.app.mjs

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,32 @@ export default {
2121
},
2222
},
2323
methods: {
24+
/**
25+
* Get authentication credentials for API requests
26+
* @returns {Object} Authentication object with username and password
27+
*/
2428
_auth() {
2529
return {
2630
username: this.$auth.username || this.$auth.api_key,
2731
password: this.$auth.password || this.$auth.api_secret,
2832
};
2933
},
34+
/**
35+
* Get the base URL for Adversus API
36+
* @returns {string} Base API URL
37+
*/
3038
_baseUrl() {
3139
return "https://solutions.adversus.io/api";
3240
},
41+
/**
42+
* Make an HTTP request to the Adversus API
43+
* @param {Object} opts - Request options
44+
* @param {Object} opts.$ - Pipedream context
45+
* @param {string} opts.path - API endpoint path
46+
* @param {string} [opts.method="GET"] - HTTP method
47+
* @param {...Object} opts - Additional axios options
48+
* @returns {Promise} API response
49+
*/
3350
async _makeRequest({
3451
$ = this, path, method = "GET", ...opts
3552
}) {
@@ -44,34 +61,64 @@ export default {
4461
...opts,
4562
});
4663
},
64+
/**
65+
* Create a new lead in Adversus
66+
* @param {Object} opts - Request options including data payload
67+
* @returns {Promise} The created lead response
68+
*/
4769
async createLead(opts) {
4870
return this._makeRequest({
4971
path: "/leads",
5072
method: "POST",
5173
...opts,
5274
});
5375
},
76+
/**
77+
* Update an existing lead in Adversus
78+
* @param {string} leadId - The ID of the lead to update
79+
* @param {Object} opts - Request options including data payload
80+
* @returns {Promise} The updated lead response
81+
*/
5482
async updateLead(leadId, opts) {
5583
return this._makeRequest({
5684
path: `/leads/${leadId}`,
5785
method: "PUT",
5886
...opts,
5987
});
6088
},
89+
/**
90+
* Add a note to a lead in Adversus
91+
* @param {string} leadId - The ID of the lead
92+
* @param {Object} opts - Request options including note data
93+
* @returns {Promise} The response from adding the note
94+
*/
6195
async addNoteToLead(leadId, opts) {
6296
return this._makeRequest({
6397
path: `/leads/${leadId}/notes`,
6498
method: "POST",
6599
...opts,
66100
});
67101
},
102+
/**
103+
* Add an activity to a lead in Adversus
104+
* @param {string} leadId - The ID of the lead
105+
* @param {Object} opts - Request options including activity data
106+
* @returns {Promise} The response from adding the activity
107+
*/
68108
async addActivityToLead(leadId, opts) {
69109
return this._makeRequest({
70110
path: `/leads/${leadId}/activities`,
71111
method: "POST",
72112
...opts,
73113
});
74114
},
115+
/**
116+
* Change the status of a lead in Adversus
117+
* @param {string} leadId - The ID of the lead
118+
* @param {string} statusId - The ID of the new status
119+
* @param {Object} [opts={}] - Additional request options
120+
* @returns {Promise} The response from changing the status
121+
*/
75122
async changeLeadStatus(leadId, statusId, opts = {}) {
76123
const { data: optsData, ...restOpts } = opts;
77124
return this._makeRequest({
@@ -84,6 +131,13 @@ export default {
84131
...restOpts,
85132
});
86133
},
134+
/**
135+
* Assign a lead to a campaign in Adversus
136+
* @param {string} leadId - The ID of the lead
137+
* @param {string} campaignId - The ID of the campaign
138+
* @param {Object} [opts={}] - Additional request options
139+
* @returns {Promise} The response from assigning the lead
140+
*/
87141
async assignLeadToCampaign(leadId, campaignId, opts = {}) {
88142
const { data: optsData, ...restOpts } = opts;
89143
return this._makeRequest({

0 commit comments

Comments
 (0)