Skip to content

feat: update js-sdk for v48 support#25

Merged
damaz91 merged 1 commit into
Universal-Commerce-Protocol:mainfrom
segiodongo:main
Jul 2, 2026
Merged

feat: update js-sdk for v48 support#25
damaz91 merged 1 commit into
Universal-Commerce-Protocol:mainfrom
segiodongo:main

Conversation

@segiodongo

Copy link
Copy Markdown
Contributor

Description

Category (Required)

Please select one or more categories that apply to this change.

  • Core Protocol: Changes to the base communication layer, global context, or breaking refactors. (Requires Technical Council approval)
  • Governance/Contributing: Updates to GOVERNANCE.md, CONTRIBUTING.md, or CODEOWNERS. (Requires Governance Council approval)
  • Capability: New schemas (Discovery, Cart, etc.) or extensions. (Requires Maintainer approval)
  • Documentation: Updates to README, or documentations regarding schema or capabilities. (Requires Maintainer approval)
  • Infrastructure: CI/CD, Linters, or build scripts. (Requires DevOps Maintainer approval)
  • Maintenance: Version bumps, lockfile updates, or minor bug fixes. (Requires DevOps Maintainer approval)
  • SDK: Language-specific SDK updates and releases. (Requires DevOps Maintainer approval)
  • Samples / Conformance: Maintaining samples and the conformance suite. (Requires Maintainer approval)
  • UCP Schema: Changes to the ucp-schema tool (resolver, linter, validator). (Requires Maintainer approval)
  • Community Health (.github): Updates to templates, workflows, or org-level configs. (Requires DevOps Maintainer approval)

Related Issues

Checklist

  • I have followed the Contributing Guide (including Conventional Commits title requirements and ! for breaking changes).
  • I have updated the documentation (if applicable).
  • My changes pass all local linting and formatting checks.
  • I have added tests that prove my fix is effective or that my feature works.
  • New and existing unit tests pass locally with my changes.
  • [N/A] (For Core/Capability) I have included/updated the relevant JSON schemas.
  • I have regenerated Python Pydantic models by running generate_models.sh under python_sdk.

Screenshots / Logs (if applicable)

@segiodongo segiodongo requested review from a team as code owners June 29, 2026 22:38
@ptiper ptiper requested review from damaz91 and removed request for aksbro-gpu, alexpark20, wry-ry and yanheChen June 30, 2026 08:44

@ptiper ptiper left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for the PR! I verified locally that the project compiles and builds successfully with no TypeScript errors after installing dependencies.

However, we need to address a few failing checks and do some cleanup before merging:

  1. Failing Checks:
    • Conventional Commits: The PR title and commit message need to follow the conventional commits format (e.g., feat: update js-sdk for v48 support or chore: update js-sdk for v48 support).
    • Formatting (Prettier): The pre-commit hook failed because many generated files and src/extensions.ts are not formatted.
  2. File hygiene: The temp_projected/ directory seems to have been committed accidentally? (we might also want to add it to .gitignore to prevent this in the future).

I've also left a couple inline comments.

Comment thread package.json
Comment thread src/extensions.ts Outdated
CheckoutWithFulfillmentResponseSchema,
CheckoutWithFulfillmentUpdateRequestSchema,
OrderSchema,
PaymentClassSchema,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

A quick AI-assisted review of this code leads me to think you should update normalize-generated-schemas.mjs as we have obsolete mappings and at least one duplication.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@segiodongo (AI finding) Naming Issue: PaymentClassSchema vs PaymentSchema

In src/spec_generated.ts (and used in src/extensions.ts), we have a schema named PaymentClassSchema (and associated type PaymentClass) representing the split payments configuration (defined in UCP schemas as split_payments.json which extends payment.json).

Why it is named PaymentClassSchema:

  • "Class" is a generic suffix appended by quicktype to resolve a name collision (see quicktype naming behavior).
  • The collision occurs because the name PaymentSchema was already assigned to the inline payment configuration inside the UCP discovery profile generated in scripts/project-current-ucp-schemas.mjs:L613-L621.
  • You can see the resulting PaymentSchema (which only contains handlers) at src/spec_generated.ts:L513.
  • Because the discovery profile's inline property claimed PaymentSchema first, the actual payment instruments schema was bumped to PaymentClassSchema.

Using PaymentClass in the SDK's public API is confusing for consumers. Also, the mapping ["PaymentClass", "PaymentSelection"] in normalize-generated-schemas.mjs is now obsolete because the schemas have structurally diverged in UCP v48 (one has amount, the other has selected).

Proposal:
Since 0.4.0 is a new major release, we should fix this naming issue now to avoid releasing a confusing API name that we will have to break later.

  1. Remove the obsolete ["PaymentClass", "PaymentSelection"] mapping in normalize-generated-schemas.mjs.
  2. Implement a post-processing renaming rule in normalize-generated-schemas.mjs to explicitly rename PaymentClass to PaymentSplitPayments (resulting in PaymentSplitPaymentsSchema and PaymentSplitPayments type).
  3. Update src/extensions.ts to use PaymentSplitPaymentsSchema instead of PaymentClassSchema.

@segiodongo segiodongo changed the title Update js-sdk for v48 support feat: update js-sdk for v48 support Jun 30, 2026
@segiodongo

Copy link
Copy Markdown
Contributor Author

added temp_projected/ to git ignore

udpated normalize-generate-schema.mjs to remove duplicates

also updated formatting to align with prettier checker

Comment thread src/extensions.ts Outdated
CheckoutWithFulfillmentResponseSchema,
CheckoutWithFulfillmentUpdateRequestSchema,
OrderSchema,
PaymentClassSchema,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@segiodongo (AI finding) Naming Issue: PaymentClassSchema vs PaymentSchema

In src/spec_generated.ts (and used in src/extensions.ts), we have a schema named PaymentClassSchema (and associated type PaymentClass) representing the split payments configuration (defined in UCP schemas as split_payments.json which extends payment.json).

Why it is named PaymentClassSchema:

  • "Class" is a generic suffix appended by quicktype to resolve a name collision (see quicktype naming behavior).
  • The collision occurs because the name PaymentSchema was already assigned to the inline payment configuration inside the UCP discovery profile generated in scripts/project-current-ucp-schemas.mjs:L613-L621.
  • You can see the resulting PaymentSchema (which only contains handlers) at src/spec_generated.ts:L513.
  • Because the discovery profile's inline property claimed PaymentSchema first, the actual payment instruments schema was bumped to PaymentClassSchema.

Using PaymentClass in the SDK's public API is confusing for consumers. Also, the mapping ["PaymentClass", "PaymentSelection"] in normalize-generated-schemas.mjs is now obsolete because the schemas have structurally diverged in UCP v48 (one has amount, the other has selected).

Proposal:
Since 0.4.0 is a new major release, we should fix this naming issue now to avoid releasing a confusing API name that we will have to break later.

  1. Remove the obsolete ["PaymentClass", "PaymentSelection"] mapping in normalize-generated-schemas.mjs.
  2. Implement a post-processing renaming rule in normalize-generated-schemas.mjs to explicitly rename PaymentClass to PaymentSplitPayments (resulting in PaymentSplitPaymentsSchema and PaymentSplitPayments type).
  3. Update src/extensions.ts to use PaymentSplitPaymentsSchema instead of PaymentClassSchema.

Comment thread src/spec_generated.ts Outdated
Address ptiper comments:
- Rename PaymentClass to PaymentSplitPayments
- Merge ConsentClassSchema and ConsentValueSchema by resolving aliases before duplicate detection
- Remove accidentally committed temp_projected directory
- Fix formatting issues

TAG=agy
CONV=6508c105-0a79-417a-90cd-97ec089641e9
@damaz91 damaz91 merged commit e53d22f into Universal-Commerce-Protocol:main Jul 2, 2026
9 checks passed
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.

3 participants