Skip to content

feat(sdks): move sdks-pxm to generator 0.99.0 - #652

Merged
field123 merged 2 commits into
mainfrom
claude/pxm-sdk-generator-upgrade-8b991b
Oct 2, 2026
Merged

field123 merged 2 commits into
mainfrom
claude/pxm-sdk-generator-upgrade-8b991b

Conversation

@field123

@field123 field123 commented Oct 2, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #630. Part of #626.

What this does

This repo publishes TypeScript SDKs (client libraries) generated from Elastic Path's API specs. The Product Experience Manager SDK was still built with an old version of the code generator, @hey-api/openapi-ts 0.61, and depended on a deprecated HTTP client. This PR rebuilds it with version 0.99, the same setup as the SDKs already migrated in #635, #637, #642 and #648.

Package New client factory Version after
@epcc-sdk/sdks-pxm createPxmClient 0.2.0

The package now has:

  • a one-call client that fetches its own auth token and retries failed requests;
  • Zod validation schemas at @epcc-sdk/sdks-pxm/zod;
  • tests, an updated README and a changeset.

The spec file is unchanged, and no other package is touched.

What changes for people using this package

The changeset lists every type change, grouped by resource. The main ones:

  • Timestamps are now string. Thirty-two fields across jobs, products, files, variations, variation options, hierarchies, nodes, tags and custom relationships were typed Date, but the value was always a string.
  • Page parameters are now number. The page[offset] and page[limit] query parameters of the fifteen list operations were typed BigInt, but the value was always a number. The Zod schemas still parse them to bigint.
  • Six small enum type aliases are removed (CommodityType, Default, Locale, Owner, Status, Type). The changeset shows how to derive each instead.
  • _Error is renamed Error.
  • The default region is EU West, which the spec already listed first.

All 82 operations keep their names and their request, response and error types. No property is dropped or made read-only.

Known issues (not fixed here)

  • Cancelling a job without a body returns 415. The spec marks the request body optional, and the client sends no Content-Type header when there is no body, so the service rejects the request. Pass body: {} to work around it. The old client behaved the same.
  • Validating an empty 204 response fails. This affects every migrated SDK and is tracked in Generated z.void() schemas reject the data the client returns for a 204 #638.

How it was checked

  • Unit tests and the typecheck pass for every SDK package.
  • Two builds give identical output.
  • The packed package compiles in a fresh project under every TypeScript module-resolution mode, including the enum derive examples from the changeset.
  • Every request and response example in the spec parses with the package's own Zod schema.
  • sdks-shopper still generates identical output, and its tests pass.
  • Live calls were made against a test store from the packed package, and every response was validated with the package's own Zod schemas:
    • all 31 read operations;
    • the write operations whose types changed: products, hierarchies, nodes, node-product relationships, variations, variation options, modifiers and custom relationships were created, updated and deleted on throwaway data, and one export job was created and read.
  • A fresh clone, built the way the release job builds, leaves no unexpected changes.

Regenerate @epcc-sdk/sdks-pxm with @hey-api/openapi-ts 0.99.0 (previously
0.61.2), still straight from the checked-in pim specification.

- Replace the generator config with the four-plugin one: client-fetch with
  an EU West baseUrl, typescript, sdk and zod (compatibilityVersion 3). The
  transformers and generate-readme plugins are gone.
- Vendor the fetch client and drop @hey-api/client-fetch. Add
  createPxmClient over @epcc-sdk/sdks-runtime, re-export the runtime helpers
  from the root, and publish Zod schemas on ./zod with a typesVersions map
  and zod as an optional peer.
- Add a vitest suite beside the runtime entry: the bearer token, the replay
  after a 401, the EU West default, and the getAllProducts response in /zod,
  including a date-time field given a number; tsup leaves it out of dist.
- Replace the README's Authentication section by hand and add a Validation
  schemas section.
- Add a minor changeset listing every type change the old-against-new diff
  found: 32 date-time fields from Date to string grouped by resource, 32
  int64 fields from BigInt to number, _Error to Error, and six dropped
  inline enums with derive examples. All 82 operations keep their names and
  types; no property is dropped or made readonly.

Refs #630
@field123 field123 added this to the SDKs on generator 0.99.0 milestone Oct 2, 2026
@vercel

vercel Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

6 Skipped Deployments
Project Deployment Actions Updated
commerce-essentials Ignored Ignored Preview Oct 2, 2026 4:10pm UTC
composable-frontend-algolia Ignored Ignored Oct 2, 2026 4:10pm UTC
composable-frontend-core Ignored Ignored Preview Oct 2, 2026 4:10pm UTC
composable-frontend-docs Ignored Ignored Preview Oct 2, 2026 4:10pm UTC
composable-frontend-simple Ignored Ignored Preview Oct 2, 2026 4:10pm UTC
composable-frontend-subscriptions Ignored Ignored Preview Oct 2, 2026 4:10pm UTC

Request Review

@changeset-bot

changeset-bot Bot commented Oct 2, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: e4eea33

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@epcc-sdk/sdks-pxm Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@field123
field123 merged commit dad4d32 into main Oct 2, 2026
7 checks passed
@field123
field123 deleted the claude/pxm-sdk-generator-upgrade-8b991b branch October 2, 2026 16:11
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.

Migrate sdks-pxm to generator 0.99.0

1 participant