-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GG-850 Update dependencies to fix vulnerabilities (#47)
* update dependencies to fix vulnerabilities * bump version * update dependencies * key fix in request param * update axios request/response property from body to data * update readme * fix vulnerabilities and update properties
- Loading branch information
Showing
22 changed files
with
1,150 additions
and
932 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -205,7 +205,7 @@ const options = { | |
|
||
client.listSubscribers(options) | ||
.then((response) => { | ||
// do something with the raw response object or with `response.body` | ||
// do something with the raw response object or with `response.data` | ||
}) | ||
.catch((error) => { | ||
// do something with the error | ||
|
@@ -215,7 +215,7 @@ client.listSubscribers(options) | |
* Using a callback | ||
*/ | ||
|
||
client.listSubscribers(options, (error, response, body) => { | ||
client.listSubscribers(options, (error, response, data) => { | ||
// do someting with the response or handle errors | ||
}); | ||
``` | ||
|
@@ -272,12 +272,53 @@ var batch = { | |
}] | ||
} | ||
|
||
client.recordBatchEvents(batch, function (error, response, body) { | ||
client.recordBatchEvents(batch, function (error, response, data) { | ||
// Do stuff | ||
} | ||
) | ||
``` | ||
|
||
## Changelog | ||
|
||
### [3.1.2] - 2024-09-12 | ||
|
||
**Breaking Changes:** | ||
|
||
- **Updated HTTP Client**: We have switched to a Axios client to improve performance and reliability. | ||
- **Property Name Change**: The `body` property in responses has been renamed to `data` to ensure compatibility with the new client and align with modern conventions. | ||
|
||
- Old: `response.body` | ||
- New: `response.data` | ||
|
||
Please update your code accordingly. Example update: | ||
|
||
```js | ||
// Old usage | ||
const result = response.body; | ||
|
||
// New usage | ||
const result = response.data; | ||
|
||
// EXAMPLE | ||
const client = require('drip-nodejs')({ token: YOUR_API_KEY, accountId: YOUR_ACCOUNT_ID }); | ||
const payload = { | ||
email: "[email protected]", | ||
time_zone: "America/Los_Angeles", | ||
custom_fields: { | ||
shirt_size: "Medium" | ||
} | ||
}; | ||
|
||
client.createUpdateSubscriber(payload) | ||
.then((response) => { | ||
console.log(response.data) | ||
}) | ||
.catch((error) => { | ||
// Handle errors | ||
}); | ||
|
||
``` | ||
|
||
## Contributing | ||
|
||
1. Fork it ( https://github.com/samudary/drip-nodejs/fork ) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
module.exports = '3.1.0'; | ||
module.exports = '3.1.2'; |
Oops, something went wrong.