-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add v3.0.0 upgrade notes and changelog
Signed-off-by: Bruno Vieira <[email protected]>
- Loading branch information
Bruno Vieira
committed
Sep 15, 2023
1 parent
2478378
commit 73730a7
Showing
3 changed files
with
47 additions
and
2 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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Upgrading to chartmogul-node 3.0.0 | ||
|
||
This new version replaces the existing pagination for the `.all()` endpoints that used a combination of `page` and `per_page` parameters, and instead uses a `cursor` based pagination. So to list (as an example) Plans you now can: | ||
|
||
```javascript | ||
const ChartMogul = require('chartmogul-node'); | ||
const config = new ChartMogul.Config('apiKey'); | ||
|
||
// Getting the first page | ||
plans = ChartMogul.Plan.all(config, { per_page: 10, cursor: 'cursor==' }) | ||
|
||
// This will return an array of plans (if available), and a cursor + has_more fields | ||
{ | ||
"plans": [ | ||
{ | ||
"uuid": "some_uuid", | ||
"data_source_uuid": "some_uuid", | ||
"name": "Master Plan" | ||
} | ||
], | ||
"has_more": true, | ||
"cursor": "MjAyMy0wNy0yOFQwODowOToyMi4xNTQyMDMwMDBaJjk0NDQ0Mg==" | ||
} | ||
|
||
if (plans.has_more) { | ||
more_plans = ChartMogul.Plan.all(config, { per_page: 10, cursor: plans.cursor }) | ||
} | ||
``` | ||
|
||
If you have existing code that relies on the `page` parameter, those requests will throw an error now alerting you of their deprecation. |
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Changelog | ||
|
||
All notable changes to this project will be documented in this file. | ||
|
||
The format is based on [Keep a Changelog], | ||
and this project adheres to [Semantic Versioning]. | ||
|
||
[Keep a Changelog]: https://keepachangelog.com/en/1.0.0/ | ||
[Semantic Versioning]: https://semver.org/spec/v2.0.0.html | ||
|
||
## [3.0.0] - 2023-09-15 | ||
|
||
### Added | ||
- Support for cursor based pagination to `.all()` endpoints. | ||
- Changelog and 3.0.0 upgrade instructions. |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.