-
-
Notifications
You must be signed in to change notification settings - Fork 202
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
V6: Major rewrite using Saloon #643
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* Flatten the majority of Authentication.php into Configuration.php * Rename Credentials class to AccessToken and remove AWS-related code * Stop caching grantless access tokens * Set up static Configuration::$accessToken array for caching multiple access tokens * Remove AuthorizationSigner class and AuthorizationSignerContract interface * Replace Endpoint class with Endpoint enum * Create GrantlessScope enum * Update minimum PHP version in composer.json to 8.1
* Create AbstractAuthenticator class * Refactor LWAAuthenticator to use AbstractAuthenticator * Create GrantlessAuthenticator class * Add grantlessAuth method on SellingPartnerApi to make it easy to create GrantlessAuthenticator instances * Add scopes.json to resources/schemas/metadata with per-endpoint, per-method scope values for all grantless operations
* Add optional $dataElements parameter to SellingPartnerApi class * Create RestrictedDataTokenAuthenticator class * Call SellingPartnerApi::restrictedAuth for restricted endpoints * Add restricted.json schema to track restricted endpoints
Via the resources/metadata/modifications.json file, we can now make direct schema modifications that will be reproduced properly when the schemas are re-fetched/regenerated. The supported actions are merge, replace, and delete. The merge action only works with arrays and objects.
* Create middleware.json file for tracking which middleware goes with which operation * Create RestrictedReport middleware for checking report types and removing the extra reportType parameter from the request before sending it * Insert middleware into generated files via RequestGenerator
Create Grantless and RestrictedDataToken middleware classes. These are, in essence, passthrough middleware classes that access the connector instance to get the necessary authentication data for the actual GrantlessAuthenticator and RestrictedDataTokenAuthenticator classes.
* Create unique schema version ID for tracking which version of which schema is being generated at a given time * Add resources/metadata/traits.json for applying per-component traits * Add resources/feeds.json to track feed content types * Override ResourceGenerator to insert traits during generation * Add UploadsDocument and DownloadsDocument traits for uploading and downloading documents
Sometimes, there are response types that are also used as normal DTOs in other response types. The ResponseGenerator was incorrectly importing those response types from the Dto\ namespace.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
WIP.
I'm cleaning up this library by rewriting the generation code entirely, making the minimum PHP version 8.1, and making the generation process part of the SDK (until now it's been in a separate private repo, because it was super messy, but that made it hard to fork). I've done a bunch of custom development on top of https://github.com/crescat-io/saloon-sdk-generator (see https://github.com/highsidelabs/saloon-sdk-generator) to get it to work for the needs of this library.
This PR is just so others can see where I'm at with progress. As of writing this, I have auto-generation of GET requests and all responses working, as well as deserialization of requests, responses, and other DTOs.