Skip to content

chore: update generated files from PR #11546#45

Open
loyaltylion-bot wants to merge 2 commits into
mainfrom
codegen/pr-11546
Open

chore: update generated files from PR #11546#45
loyaltylion-bot wants to merge 2 commits into
mainfrom
codegen/pr-11546

Conversation

@loyaltylion-bot

Copy link
Copy Markdown
Collaborator

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.ts
  • src/types/schemas.ts

@loyaltylion-minerva loyaltylion-minerva Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

Comment thread src/types/api.ts
};
get?: never;
put?: never;
post: operations["customers.enroll"];

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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?

Comment thread src/types/api.ts
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;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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?

@loyaltylion-minerva loyaltylion-minerva Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

Comment thread src/types/api.ts
@@ -63,6 +63,22 @@ export interface paths {
patch?: never;
trace?: never;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Respond to this comment to discuss this review with me

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