chore: update generated files from PR #11546#45
Conversation
There was a problem hiding this comment.
The generated type updates are internally consistent: the new loyalty pass rule appears in both configuration and customer-specific unions, the enroll response/error schemas are present, and the new referral URL field is carried through the examples. The main elegance issue is at the package boundary: this repository exposes a hand-written createHeadlessApiClient wrapper, and the new generated contract surface is not reflected there, so consumers using the primary client API cannot reach a couple of the newly documented capabilities.
| }; | ||
| get?: never; | ||
| put?: never; | ||
| post: operations["customers.enroll"]; |
There was a problem hiding this comment.
This adds the typed customers.enroll operation, but the public createHeadlessApiClient wrapper still exposes only getCustomer, initializeSession, setBirthday, and subscribeToEmailMarketing under customers. Since this package does not return the raw openapi-fetch client, users of the documented client surface cannot call the new endpoint without bypassing the package and hand-rolling a request. Can we add the corresponding wrapper method alongside this generated path update?
| language?: unknown; | ||
| language?: string; | ||
| /** @description ISO 3166-1 alpha-2 country code for the customer. Used to filter rewards by country availability. If not provided, the site default is used */ | ||
| country?: string; |
There was a problem hiding this comment.
country is now typed on the generated operations and affects reward availability, but none of the convenience-client methods accept query params and HeadlessApiClientOptions only carries channel and language. That means a consumer using createHeadlessApiClient still cannot request country-specific configuration/customers/redeem responses; every wrapper builds only params.path plus the request body. Can we thread country through the client surface too, either as a per-call option or as a client-level option if the intended usage is one country per client?
There was a problem hiding this comment.
Previous feedback remains unaddressed: the generated customers.enroll operation and the new country query parameter still are not reachable through the public createHeadlessApiClient wrapper. I left those existing threads unresolved and found no additional issues in the new generated-file churn.
| @@ -63,6 +63,22 @@ export interface paths { | |||
| patch?: never; | |||
| trace?: never; | |||
There was a problem hiding this comment.
Respond to this comment to discuss this review with me
Auto-generated by the CI pipeline.
Source: https://github.com/loyaltylion/hogwarts/pull/11546
These files were regenerated from changes to the API contracts. Review and merge alongside the main PR.
Generated files:
src/types/api.tssrc/types/schemas.ts