Skip to content
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
merged 118 commits into from
Mar 22, 2024
Merged

V6: Major rewrite using Saloon #643

merged 118 commits into from
Mar 22, 2024

Conversation

jlevers
Copy link
Owner

@jlevers jlevers commented Dec 27, 2023

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.

jlevers added 30 commits July 3, 2023 13:42
* 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.
@jlevers jlevers marked this pull request as ready for review March 22, 2024 03:15
@jlevers
Copy link
Owner Author

jlevers commented Mar 22, 2024

Closes #660, #657, #652, #651, #650, #647, #637, #631, #628, #620, #617, #616, #520, and #512.

@jlevers jlevers merged commit 92365fc into main Mar 22, 2024
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.

1 participant