From 83dfeed5f4dfdab9a1e1be0ee38d5b243699cef1 Mon Sep 17 00:00:00 2001 From: darthmaim Date: Fri, 1 Nov 2024 15:10:29 +0100 Subject: [PATCH] Allow specifying `page_size` without `page` for paginated endpoints --- .changeset/chilly-snakes-behave.md | 5 +++++ packages/types/endpoints.ts | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/chilly-snakes-behave.md diff --git a/.changeset/chilly-snakes-behave.md b/.changeset/chilly-snakes-behave.md new file mode 100644 index 0000000..0e3754a --- /dev/null +++ b/.changeset/chilly-snakes-behave.md @@ -0,0 +1,5 @@ +--- +"@gw2api/types": patch +--- + +Allow specifying `page_size` without `page` for paginated endpoints diff --git a/packages/types/endpoints.ts b/packages/types/endpoints.ts index f208c8d..985dc32 100644 --- a/packages/types/endpoints.ts +++ b/packages/types/endpoints.ts @@ -339,7 +339,7 @@ type WithParameters; +type PaginationParameters = `page=${number}` | `page_size=${number}` | CombineParameters<`page=${number}`, `page_size=${number}`>; type PaginatedEndpointUrl = Endpoint | WithParameters // helper types for bulk requests