Skip to content

Commit

Permalink
Merge branch 'master' into security-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
narayana-plivo authored Apr 4, 2024
2 parents bc7c110 + 61ea55e commit 9877f6d
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 1 deletion.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,14 @@
**Vulnerabilities Fix**
- Axios Cross-Site Request Forgery Vulnerability Fix.

## [v4.61.0](https://github.com/plivo/plivo-node/tree/v4.61.0) (2024-03-13)
**Feature - Import Campaign API**
- Import Campaign API endpoint added

## [v4.60.2](https://github.com/plivo/plivo-node/tree/v4.60.2) (2024-02-29)
**Feature - Log Redaction Enhancement**
- Added log attribute in GET and List MDR response
- Change log field from bool to string in send SMS
- Change log field from bool to string in send SMS

## [v4.60.1](https://github.com/plivo/plivo-node/tree/v4.60.1) (2023-11-28)
**Bug Fix - JWT Token Creation Issues**
Expand Down
14 changes: 14 additions & 0 deletions lib/resources/campaign.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,20 @@ export class LinkUnlinkNumberResponse {
});
}

/**
* import Campaign
* @method
* @param {string} campaign_id
* @param {string} campaign_alias
* @promise {object} return {@link PlivoGenericResponse} object
* @fail {Error} return Error
*/
import_campaign(campaign_id, campaign_alias, params = {}) {
params.campaign_id=campaign_id;
params.campaign_alias=campaign_alias;
return super.customexecuteAction(action + 'Import/', 'POST', params);
}

/**
* update Campaign
* @method
Expand Down
10 changes: 10 additions & 0 deletions lib/rest/request-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1982,6 +1982,16 @@ export function Request(config) {
}
});
}
else if (action == '10dlc/Campaign/Import/' && method == 'POST'){
resolve({
response: {},
body: {
apiId: "2c6c5e16-090a-11ed-bb48-0242ac110004",
campaignId: "CNTQ0OD",
message: "Request to import campaign was received and is being processed."
}
});
}
else if (action == 'Powerpack/5ec4c8c9-cd74-42b5-9e41-0d7670d6bb46/' && method == 'GET'){
resolve({
response: {},
Expand Down
6 changes: 6 additions & 0 deletions test/campaign.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ import {
assert.equal(campaign.campaignId, 'CFSOBZQ')
})
});
if('import campaign', function (){
return client.campaign.import_campaign('CNTQ0OD','New Contact by vinay for ct')
.then(function(campaign){
assert.equal(campaign.campaignId, 'CNTQ0OD')
})
})

it('should delete campaign', function() {
return client.campaign.deleteCampaign("CMPT4EP")
Expand Down

0 comments on commit 9877f6d

Please sign in to comment.