refactor(nodejs): use @ucp-js/sdk instead of local model generation#139
Merged
damaz91 merged 7 commits intoJul 22, 2026
Merged
Conversation
Refactors the Node.js sample to use the official @ucp-js/sdk dependency instead of generating models locally. Removes the obsolete generation script and local models. Addresses: Universal-Commerce-Protocol#62
damaz91
marked this pull request as draft
July 22, 2026 11:17
Update server implementation to use Zod schemas from the SDK for validation, fix fulfillment options mapping, support new discounts, implement free shipping logic, and add completion validation.
damaz91
marked this pull request as ready for review
July 22, 2026 12:08
ptiper
approved these changes
Jul 22, 2026
carolinerg1
approved these changes
Jul 22, 2026
vishkaty
pushed a commit
to vishkaty/samples
that referenced
this pull request
Jul 24, 2026
Adds behavioral coverage on the Node.js sample's CI lane, mirroring the Python server's suite, so a checkout-flow regression no longer ships green. Uses the existing node:test + app.request() conventions and the @ucp-js/sdk schemas (rest/nodejs consumes the SDK since Universal-Commerce-Protocol#139), no new dependencies. - lifecycle: create -> retrieve -> complete (order assigned), payment failure, cancel, and completed/canceled immutability - idempotency: same-key replay, same-key/different-body conflict, keyless - validation: unknown product and over-stock rejection - fulfillment: options are quoted, selecting one adds its cost to the receipt, and completing without a fulfillment selection is rejected - discount: case-insensitive match, empty codes clear, allocations reconcile
carolinerg1
pushed a commit
that referenced
this pull request
Jul 24, 2026
Adds behavioral coverage on the Node.js sample's CI lane, mirroring the Python server's suite, so a checkout-flow regression no longer ships green. Uses the existing node:test + app.request() conventions and the @ucp-js/sdk schemas (rest/nodejs consumes the SDK since #139), no new dependencies. - lifecycle: create -> retrieve -> complete (order assigned), payment failure, cancel, and completed/canceled immutability - idempotency: same-key replay, same-key/different-body conflict, keyless - validation: unknown product and over-stock rejection - fulfillment: options are quoted, selecting one adds its cost to the receipt, and completing without a fulfillment selection is rejected - discount: case-insensitive match, empty codes clear, allocations reconcile Authored-by: Vishal Katyal <vishal@katyal.ai>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Refactors the Node.js sample to use the official
@ucp-js/sdkdependency instead of generating models locally. Removes the obsolete generation script and local models.Category (Required)
ucp-schematool (resolver, linter, validator). (Requires Maintainer approval)Related Issues
Fixes #62 and #58
Checklist
!for breaking changes).