From 38b27f33f9f5b9db373baa7147d68538cd42fb08 Mon Sep 17 00:00:00 2001 From: Lakhan Samani Date: Thu, 23 Jul 2026 22:45:40 +0530 Subject: [PATCH 1/2] fix!: match the backend's standardized single-level pagination shape BREAKING CHANGE: the Authorizer backend removed the PaginatedRequest wrapper type entirely (authorizerdev/authorizer, fix(graphql)! commit standardizing pagination on PaginationRequest directly, matching the proto/gRPC surface which never had a double-wrapper). This SDK's verificationRequests/webhooks/emailTemplates methods hardcoded PaginatedRequest in both their query strings and Types.PaginatedRequest parameter type - both now updated to PaginationRequest directly. Callers previously wrote e.g. `.webhooks({ pagination: { limit: 10 } })`; now write `.webhooks({ limit: 10 })` directly. The 6 List*Request types (Clients/TrustedIssuers/SAMLServiceProviders/ Organizations/OrgDomains/OrgMembers) needed no change here: their `pagination` field was already typed as PaginationRequest in this SDK, even though the old backend schema actually required the PaginatedRequest wrapper for those - meaning no strictly-typed caller of this SDK could have constructed the shape the old schema demanded for those 6 endpoints in the first place. This backend fix makes those types correct rather than accidentally correct. Verified against a locally built authorizer image running the backend fix: all 26 admin.test.ts integration tests pass (graphql + rest), full build and typecheck clean. --- __test__/admin.test.ts | 6 ++---- src/admin.ts | 12 ++++++------ src/types.ts | 5 ----- 3 files changed, 8 insertions(+), 15 deletions(-) diff --git a/__test__/admin.test.ts b/__test__/admin.test.ts index b436aca..47394ef 100644 --- a/__test__/admin.test.ts +++ b/__test__/admin.test.ts @@ -190,7 +190,7 @@ describe('Integration Tests - AuthorizerAdmin (graphql + rest)', () => { }); expect(addRes.errors).toHaveLength(0); - const listRes = await a.webhooks({ pagination: { limit: 50, page: 1 } }); + const listRes = await a.webhooks({ limit: 50, page: 1 }); expect(listRes.errors).toHaveLength(0); const created = listRes.data?.webhooks.find((w) => (w.event_name ?? '').startsWith(event), @@ -219,9 +219,7 @@ describe('Integration Tests - AuthorizerAdmin (graphql + rest)', () => { }); expect(addRes.errors).toHaveLength(0); - const listRes = await a.emailTemplates({ - pagination: { limit: 50, page: 1 }, - }); + const listRes = await a.emailTemplates({ limit: 50, page: 1 }); expect(listRes.errors).toHaveLength(0); const created = listRes.data?.email_templates.find( (t) => t.event_name === event, diff --git a/src/admin.ts b/src/admin.ts index b608103..82ba8a5 100644 --- a/src/admin.ts +++ b/src/admin.ts @@ -366,13 +366,13 @@ export class AuthorizerAdmin { // verificationRequests returns a paginated list of pending verification requests. verificationRequests = ( - params?: Types.PaginatedRequest, + params?: Types.PaginationRequest, ): Promise> => this.dispatch( 'VerificationRequests', ['graphql', 'rest'], { - query: `query _verification_requests($params: PaginatedRequest) { _verification_requests(params: $params) { pagination { ${paginationFragment} } verification_requests { id identifier token email expires created_at updated_at nonce redirect_uri } } }`, + query: `query _verification_requests($params: PaginationRequest) { _verification_requests(params: $params) { pagination { ${paginationFragment} } verification_requests { id identifier token email expires created_at updated_at nonce redirect_uri } } }`, operationName: '_verification_requests', op: '_verification_requests', }, @@ -515,13 +515,13 @@ export class AuthorizerAdmin { // webhooks returns a paginated list of webhooks. webhooks = ( - params?: Types.PaginatedRequest, + params?: Types.PaginationRequest, ): Promise> => this.dispatch( 'Webhooks', ['graphql', 'rest'], { - query: `query _webhooks($params: PaginatedRequest) { _webhooks(params: $params) { pagination { ${paginationFragment} } webhooks { ${webhookFragment} } } }`, + query: `query _webhooks($params: PaginationRequest) { _webhooks(params: $params) { pagination { ${paginationFragment} } webhooks { ${webhookFragment} } } }`, operationName: '_webhooks', op: '_webhooks', }, @@ -626,13 +626,13 @@ export class AuthorizerAdmin { // emailTemplates returns a paginated list of email templates. emailTemplates = ( - params?: Types.PaginatedRequest, + params?: Types.PaginationRequest, ): Promise> => this.dispatch( 'EmailTemplates', ['graphql', 'rest'], { - query: `query _email_templates($params: PaginatedRequest) { _email_templates(params: $params) { pagination { ${paginationFragment} } email_templates { ${emailTemplateFragment} } } }`, + query: `query _email_templates($params: PaginationRequest) { _email_templates(params: $params) { pagination { ${paginationFragment} } email_templates { ${emailTemplateFragment} } } }`, operationName: '_email_templates', op: '_email_templates', }, diff --git a/src/types.ts b/src/types.ts index c7f4430..a671067 100644 --- a/src/types.ts +++ b/src/types.ts @@ -643,11 +643,6 @@ export interface AdminMeta { is_multi_factor_auth_service_enabled: boolean; } -// PaginatedRequest wraps the pagination input for list queries. -export interface PaginatedRequest { - pagination?: PaginationRequest | null; -} - // ListUsersRequest is the admin _users query input. query is an optional // case-insensitive substring filter matched against email, given_name, // family_name and nickname. Empty/absent means no filter (full list). From 9f5cde5a1898b4cb6f737ed5ba3febb936ae1f45 Mon Sep 17 00:00:00 2001 From: Lakhan Samani Date: Fri, 24 Jul 2026 04:16:10 +0530 Subject: [PATCH 2/2] chore(ci): bump test image to 2.4.0-rc.9 Picks up the backend's pagination schema fix this PR targets. --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 33e674e..5511d1d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -32,4 +32,4 @@ jobs: - name: Run integration tests run: pnpm test # Make sure this command runs your integration tests env: - AUTHORIZER_IMAGE: quay.io/authorizer/authorizer:2.4.0-rc.7 + AUTHORIZER_IMAGE: quay.io/authorizer/authorizer:2.4.0-rc.9