From f13a9510cc101086315ebdcdc2bdba973ab2c5db Mon Sep 17 00:00:00 2001 From: Partouf Date: Mon, 7 Sep 2026 09:40:49 +0200 Subject: [PATCH] Send page size as `limit`, the parameter the API actually reads The server parses the page-size query parameter as `limit` (applicationListQuerySchema in bindist-terraform's validation.ts; default 20, max 100) and never looks at `pageSize`. Every request this client sent was therefore silently capped at the default 20 rows, with no error to indicate the requested size had been discarded. The public option keeps its existing name so callers are unaffected; only the wire parameter changes. A doc comment on the field records that the two names differ on purpose. The Rust client already sent `limit` and is unchanged. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_01GkhmPJLKvghmHZ5avEVQeN --- src/client.ts | 7 ++++++- src/types.ts | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/client.ts b/src/client.ts index c1b176d..4c93d12 100644 --- a/src/client.ts +++ b/src/client.ts @@ -130,7 +130,12 @@ export class BinDistClient { async listApplications( options: ListApplicationsOptions = {} ): Promise> { - const queryString = this.buildQueryString(options as Record); + // The API reads the page-size parameter as `limit`; `pageSize` is ignored. + const { pageSize, ...rest } = options; + const queryString = this.buildQueryString({ + ...rest, + ...(pageSize === undefined ? {} : { limit: pageSize }), + } as Record); return this.request( `/v1/applications${queryString}` ); diff --git a/src/types.ts b/src/types.ts index ae7f2dc..bf5d48e 100644 --- a/src/types.ts +++ b/src/types.ts @@ -130,6 +130,7 @@ export interface DownloadInfo { */ export interface ListApplicationsOptions { page?: number; + /** Items per page. Sent as the `limit` query parameter; the server caps it at 100. */ pageSize?: number; search?: string; tags?: string;