Skip to content

chore: update generated files from PR #11278#31

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

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

Conversation

@loyaltylion-bot

Copy link
Copy Markdown
Collaborator

Auto-generated by the CI pipeline.

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

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.

This PR is auto-generated by CI from the OpenAPI contract changes in hogwarts PR #11278 — it adds a country?: string query parameter to 21 operations (configuration, customer session/state, all rewards.redeem*/refundProductCart, and all rules.complete*). The generated diff is mechanical and consistent: every change is the same two-line addition with the same JSDoc, applied in the same query? block on each operation. No removals, no schema/component changes. As a generated artifact, the regeneration faithfully reflects the upstream spec change and looks correct to merge alongside #11278.

Two upstream observations (worth flagging to the source PR rather than fixing here, since this file is generated):

  1. country is typed as string, which is broader than the JSDoc claim ("ISO 3166-1 alpha-2"). Defining this as a components["schemas"] enum or constrained string (e.g. pattern: "^[A-Z]{2}$") in the OpenAPI spec would give consumers compile-time / runtime safety and match how channel is modelled via components["schemas"]["SupportedChannel"]. The existing language?: unknown shows the same untyped-string drift, so this would be a small step in the right direction.
  2. The parameter is added to customers.setBirthday, customers.emailMarketingSubscribe, and the rules.complete* family. The JSDoc says "Used to filter rewards by country availability," which is intuitive for getConfiguration / getCustomer / redeem* but less obvious for birthday/email-subscribe/rule-completion endpoints. Worth confirming on the source PR that those responses really do include country-filtered reward state — and if so, tightening the JSDoc to say so. Otherwise the parameter is a no-op on those routes and adds confusion.

Neither blocks this PR — the codegen output is correct relative to the contract it was generated from.

Comment thread src/types/api.ts
channel?: components["schemas"]["SupportedChannel"];
/** @description The language to use for the request. If not provided, the site's default language will be used */
language?: unknown;
/** @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 */

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

@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.

New commit 7a04bc2 adds a small, unrelated regen on top of the previous diff: a required title: string field on the nested rule object inside the CustomerHistoryActionReceivedReward schema (mirrored in api.ts and schemas.ts). The JSDoc is clear about the localization/fallback semantics. This is purely additive and consistent across both generated files — no new issues. My prior country observations were upstream-only and don't apply to this delta.

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