Skip to content

chore: update generated files from PR #11506#42

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

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

Conversation

@loyaltylion-bot

Copy link
Copy Markdown
Collaborator

Auto-generated by the CI pipeline.

Source: https://github.com/loyaltylion/hogwarts/pull/11506

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 schema changes are mostly coherent: the loyalty-pass rule is mirrored in both the component and named schema surfaces, the history rule title is carried through consistently, and narrowing language from unknown to string makes the contract more useful.

The main elegance gap is that this package has two public surfaces: raw OpenAPI types and the createHeadlessApiClient wrapper. This PR updates the raw generated surface, but the wrapper now lags behind the contract for the new enroll endpoint and country-aware filtering. If this branch is intentionally raw-types-only, that is worth making explicit; otherwise the hand-written client needs the same surface area.

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 exposes the new customers.enroll operation in the generated contract, but createHeadlessApiClient still has no customers.enroll wrapper method. Every existing operation in this API file is represented in the high-level client, so users following the advertised client surface cannot call the new endpoint without dropping to raw fetch/paths types. Please add the wrapper method as part of the same change, or make it explicit that this endpoint is intentionally raw-OpenAPI-only.

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 part of the generated query contract, but the exported client cannot pass it: HeadlessApiClientOptions only accepts channel/language, and each wrapper request only supplies path params. That means consumers using createHeadlessApiClient still cannot use the country-based reward filtering this contract advertises. Please thread a country option through the wrapper requests, or use the supported country header if the API accepts one.

@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 contract still exposes customers.enroll and country query parameters, but the high-level client wrapper still does not. I did not find any additional issues in the new generated schema changes.

Comment thread src/types/api.ts
@@ -63,6 +63,22 @@ export interface paths {
patch?: never;
trace?: never;
};
"/headless/2025-06/{site_id}/customers/{merchant_id}/enroll": {
parameters: {

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