-
Notifications
You must be signed in to change notification settings - Fork 72
feat: add Client Links API support #464
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this 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 adds comprehensive support for the Mollie Client Links API, which enables OAuth applications to onboard new organizations or link existing ones as clients. The implementation follows established patterns in the codebase and includes proper type definitions, documentation, and unit tests.
- Introduces complete Client Links API support with create endpoint
- Implements helper method to generate properly formatted OAuth redirect URLs
- Uses type composition with
PickRequired/PickOptionalfor flexible parameter definitions
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
tests/unit/resources/client-links.test.ts |
Adds comprehensive unit tests for client link creation and URL generation helper |
src/types.ts |
Exports ClientLink type and CreateParameters for public API |
src/data/client-links/data.ts |
Defines ClientLinkData interface and ClientLinkLinks with proper HAL+JSON structure |
src/data/client-links/ClientLinkHelper.ts |
Implements getClientLink() helper to build complete OAuth redirect URLs with query parameters |
src/data/client-links/ClientLink.ts |
Defines ClientLink type (omitting _links) and transform function following Seal pattern |
src/createMollieClient.ts |
Registers client-link transformer and ClientLinksBinder with the Mollie client |
src/binders/client-links/parameters.ts |
Defines CreateParameters using type composition from global Address type |
src/binders/client-links/ClientLinksBinder.ts |
Implements create() method for POST /v2/client-links endpoint |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
According to the docs various body params are of type |
edorivai
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Add support for the Client Links API which allows OAuth applications to link new or existing organizations as clients. The API provides a single POST endpoint to create client links. Key implementation details: - ClientLinksBinder with create() method for POST /v2/client-links - ClientLinkHelper with getClientLink() that builds the complete redirect URL with required OAuth query parameters (client_id, state, scope) - Parameter types derive from global Address using PickRequired/PickOptional - Response type omits _links to enforce using helper method instead This is part of the Mollie Connect APIs (issue #459).
d358606 to
c6e1552
Compare
Summary
Adds support for the Client Links API, enabling OAuth applications to link new or existing organizations as clients.
Changes
src/data/client-links/withClientLinkDataresponse type andClientLinkLinksClientLinksBinderwithcreate()method forPOST /v2/client-linksClientLinkHelperwithgetClientLink()that builds the complete redirect URL with required OAuth query parameters (client_id,state,scope, optionalapproval_prompt)AddressusingPickRequired/PickOptionalfor type reuse_linksto enforce using the helper method instead of accessing internal propertiestypes.tsand registered transformer increateMollieClient.tsAPI Details
The Client Links API provides:
POST /v2/client-links) - creates a link to onboard a new organization or link an existing oneThe
getClientLink()helper builds the complete redirect URL that customers should be sent to, including all required OAuth query parameters.Note
Unable to add integration tests as this endpoint requires OAuth authentication with
clients.writescope.This will be released as a beta first.
References