Skip to content

feat(api-client): update adminApiTypes.d.ts based on the latest API release#2261

Merged
Patryk Tomczyk (patzick) merged 6 commits intomainfrom
fix/oauth-scope-definition
Feb 10, 2026
Merged

feat(api-client): update adminApiTypes.d.ts based on the latest API release#2261
Patryk Tomczyk (patzick) merged 6 commits intomainfrom
fix/oauth-scope-definition

Conversation

@mkucmus
Copy link
Copy Markdown
Contributor

@mkucmus Maciek Kucmus (mkucmus) commented Jan 28, 2026

Description

closes: #1728

backend issue created: shopware/shopware#14570

the issue evolved because it turned out that the backend logic was already fixed and the only thing needed was to update openapi schema definition -> then naturally was to regenerate the types in our api client package to adjust the oauth requests.

Type of change

ToDo's

Screenshots (if applicable)

Additional context

@vercel
Copy link
Copy Markdown

vercel Bot commented Jan 28, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
frontends-starter-template-extended Ready Ready Preview, Comment Jan 28, 2026 10:22am
frontends-vue-starter-template Building Building Preview, Comment Jan 28, 2026 10:22am
old-frontends-demo Ready Ready Preview, Comment Jan 28, 2026 10:22am
shopware-frontends-docs Ready Ready Preview, Comment Jan 28, 2026 10:22am

Request Review

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a bug where the scopes parameter in OAuth token requests for AdminApiClient was not being transformed to scope as expected by the League OAuth2 server backend. The fix adds a transformation step in the automatic authentication flow that converts scopes to scope before sending credentials to the /oauth/token endpoint.

Changes:

  • Modified the authentication logic in createAdminAPIClient.ts to transform scopes to scope in OAuth token requests
  • Updated test to verify the scopes-to-scope transformation works correctly

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
packages/api-client/src/createAdminAPIClient.ts Added logic to destructure scopes from credentials and rename it to scope when making OAuth token requests
packages/api-client/src/adminApiClientCredentials.test.ts Updated test name and expectations to verify scopes is transformed to scope

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/api-client/src/createAdminAPIClient.ts Outdated
Comment thread packages/api-client/src/createAdminAPIClient.ts Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 8 out of 10 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@mkucmus Maciek Kucmus (mkucmus) changed the title feat(api-client): update adminApiTypes.d.ts based on the latest API release feat(api-client): update adminApiTypes.d.ts based on the latest API release Jan 28, 2026
@patzick Patryk Tomczyk (patzick) merged commit 9604f22 into main Feb 10, 2026
18 checks passed
@patzick Patryk Tomczyk (patzick) deleted the fix/oauth-scope-definition branch February 10, 2026 12:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] AdminApiClient unable to properly define scopes

3 participants