-
Notifications
You must be signed in to change notification settings - Fork 741
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: improve the fetch handling (and testing) of requests to the Clou…
…dflare API
- Loading branch information
1 parent
543ac27
commit 5ad907c
Showing
14 changed files
with
696 additions
and
226 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,17 @@ | ||
--- | ||
"wrangler": patch | ||
--- | ||
|
||
Refactor raw value extraction from Cloudflare APIs | ||
|
||
Most API responses are JSON of the form: | ||
|
||
``` | ||
{ result, success, errors, messages, result_info } | ||
``` | ||
|
||
where the `result` contains the actual response value. | ||
|
||
But some API responses only contain the result value. | ||
|
||
This change refactors the client-side fetch API to allow callers to specify what kind of response they expect. |
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,9 @@ | ||
--- | ||
"wrangler": patch | ||
--- | ||
|
||
Fix pagination handling of list requests to the Cloudflare API | ||
|
||
When doing a list request to the API, the server may respond with only a single page of results. | ||
In this case, it will also provide a `cursor` value in the `result_info` part of the response, which can be used to request the next page. | ||
This change implements this on the client-side so that we get all the results by requesting further pages when there is a cursor. |
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
Oops, something went wrong.