diff --git a/rest/nodejs/package-lock.json b/rest/nodejs/package-lock.json index e00bb021..c433defa 100644 --- a/rest/nodejs/package-lock.json +++ b/rest/nodejs/package-lock.json @@ -8,37 +8,23 @@ "dependencies": { "@hono/node-server": "^1.19.13", "@hono/zod-validator": "^0.7.6", + "@ucp-js/sdk": "0.4.1", "better-sqlite3": "^9.4.3", "hono": "^4.12.25", "pino": "^10.1.0", "pino-http": "^11.0.0", "pino-http-print": "^4.0.0", "uuid": "^14.0.0", - "zod": "^4.2.1" + "zod": "^3.23.8" }, "devDependencies": { "@types/better-sqlite3": "^7.6.9", "@types/node": "^20.11.17", "@types/uuid": "^9.0.8", - "json-schema-to-zod": "^2.6.0", - "quicktype": "^23.2.6", "tsx": "^4.22.4", "typescript": "^5.8.3" } }, - "node_modules/@cspotcode/source-map-support": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", - "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@jridgewell/trace-mapping": "0.3.9" - }, - "engines": { - "node": ">=12" - } - }, "node_modules/@esbuild/aix-ppc64": { "version": "0.28.1", "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.28.1.tgz", @@ -481,13 +467,6 @@ "node": ">=18" } }, - "node_modules/@glideapps/ts-necessities": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/@glideapps/ts-necessities/-/ts-necessities-2.4.0.tgz", - "integrity": "sha512-mDC+qosuNa4lxR3ioMBb6CD0XLRsQBplU+zRPUYiMLXKeVPZ6UYphdNG/EGReig0YyfnVlBKZEXl1wzTotYmPA==", - "dev": true, - "license": "MIT" - }, "node_modules/@hono/node-server": { "version": "1.19.13", "resolved": "https://registry.npmjs.org/@hono/node-server/-/node-server-1.19.13.tgz", @@ -510,109 +489,12 @@ "zod": "^3.25.0 || ^4.0.0" } }, - "node_modules/@jridgewell/resolve-uri": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", - "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/@jridgewell/sourcemap-codec": { - "version": "1.5.5", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz", - "integrity": "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==", - "dev": true, - "license": "MIT" - }, - "node_modules/@jridgewell/trace-mapping": { - "version": "0.3.9", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", - "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@jridgewell/resolve-uri": "^3.0.3", - "@jridgewell/sourcemap-codec": "^1.4.10" - } - }, - "node_modules/@mark.probst/typescript-json-schema": { - "version": "0.55.0", - "resolved": "https://registry.npmjs.org/@mark.probst/typescript-json-schema/-/typescript-json-schema-0.55.0.tgz", - "integrity": "sha512-jI48mSnRgFQxXiE/UTUCVCpX8lK3wCFKLF1Ss2aEreboKNuLQGt3e0/YFqWVHe/WENxOaqiJvwOz+L/SrN2+qQ==", - "dev": true, - "license": "BSD-3-Clause", - "dependencies": { - "@types/json-schema": "^7.0.9", - "@types/node": "^16.9.2", - "glob": "^7.1.7", - "path-equal": "^1.1.2", - "safe-stable-stringify": "^2.2.0", - "ts-node": "^10.9.1", - "typescript": "4.9.4", - "yargs": "^17.1.1" - }, - "bin": { - "typescript-json-schema": "bin/typescript-json-schema" - } - }, - "node_modules/@mark.probst/typescript-json-schema/node_modules/@types/node": { - "version": "16.18.126", - "resolved": "https://registry.npmjs.org/@types/node/-/node-16.18.126.tgz", - "integrity": "sha512-OTcgaiwfGFBKacvfwuHzzn1KLxH/er8mluiy8/uM3sGXHaRe73RrSIj01jow9t4kJEW633Ov+cOexXeiApTyAw==", - "dev": true, - "license": "MIT" - }, - "node_modules/@mark.probst/typescript-json-schema/node_modules/typescript": { - "version": "4.9.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.4.tgz", - "integrity": "sha512-Uz+dTXYzxXXbsFpM86Wh3dKCxrQqUcVMxwU54orwlJjOpO3ao8L7j5lH+dWfTwgCwIuM9GQ2kvVotzYJMXTBZg==", - "dev": true, - "license": "Apache-2.0", - "bin": { - "tsc": "bin/tsc", - "tsserver": "bin/tsserver" - }, - "engines": { - "node": ">=4.2.0" - } - }, "node_modules/@pinojs/redact": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/@pinojs/redact/-/redact-0.4.0.tgz", "integrity": "sha512-k2ENnmBugE/rzQfEcdWHcCY+/FM3VLzH9cYEsbdsoqrvzAKRhUZeRNhAZvB8OitQJ1TBed3yqWtdjzS6wJKBwg==", "license": "MIT" }, - "node_modules/@tsconfig/node10": { - "version": "1.0.12", - "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.12.tgz", - "integrity": "sha512-UCYBaeFvM11aU2y3YPZ//O5Rhj+xKyzy7mvcIoAjASbigy8mHMryP5cK7dgjlz2hWxh1g5pLw084E0a/wlUSFQ==", - "dev": true, - "license": "MIT" - }, - "node_modules/@tsconfig/node12": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.11.tgz", - "integrity": "sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==", - "dev": true, - "license": "MIT" - }, - "node_modules/@tsconfig/node14": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.3.tgz", - "integrity": "sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==", - "dev": true, - "license": "MIT" - }, - "node_modules/@tsconfig/node16": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.4.tgz", - "integrity": "sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==", - "dev": true, - "license": "MIT" - }, "node_modules/@types/better-sqlite3": { "version": "7.6.13", "resolved": "https://registry.npmjs.org/@types/better-sqlite3/-/better-sqlite3-7.6.13.tgz", @@ -623,13 +505,6 @@ "@types/node": "*" } }, - "node_modules/@types/json-schema": { - "version": "7.0.15", - "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", - "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", - "dev": true, - "license": "MIT" - }, "node_modules/@types/node": { "version": "20.19.27", "resolved": "https://registry.npmjs.org/@types/node/-/node-20.19.27.tgz", @@ -647,53 +522,13 @@ "dev": true, "license": "MIT" }, - "node_modules/abort-controller": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz", - "integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==", - "dev": true, - "license": "MIT", - "dependencies": { - "event-target-shim": "^5.0.0" - }, - "engines": { - "node": ">=6.5" - } - }, - "node_modules/acorn": { - "version": "8.15.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.15.0.tgz", - "integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==", - "dev": true, - "license": "MIT", - "bin": { - "acorn": "bin/acorn" - }, - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/acorn-walk": { - "version": "8.3.4", - "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.4.tgz", - "integrity": "sha512-ueEepnujpqee2o5aIYnvHU6C0A42MNdsIDeqy5BydrkuC5R1ZuUFnm27EeFJGoEHJQgn3uleRvmTXaJgfXbt4g==", - "dev": true, - "license": "MIT", + "node_modules/@ucp-js/sdk": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/@ucp-js/sdk/-/sdk-0.4.1.tgz", + "integrity": "sha512-giP/B/nYB/FZeMyKOuMkRHFrURcufPs9dfvliWlsx3L5xz8fWSMeGD3enOYQd07NdJsB3gpIy+wLy5Z4Fy80iA==", + "license": "Apache-2.0", "dependencies": { - "acorn": "^8.11.0" - }, - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" + "zod": "^3.23.8" } }, "node_modules/ansi-styles": { @@ -708,13 +543,6 @@ "node": ">=4" } }, - "node_modules/arg": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", - "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", - "dev": true, - "license": "MIT" - }, "node_modules/args": { "version": "5.0.3", "resolved": "https://registry.npmjs.org/args/-/args-5.0.3.tgz", @@ -730,16 +558,6 @@ "node": ">= 6.0.0" } }, - "node_modules/array-back": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/array-back/-/array-back-3.1.0.tgz", - "integrity": "sha512-TkuxA4UCOvxuDK6NZYXCalszEzj+TLszyASooky+i742l9TqsOdYCMJJupxRic61hwquNtppB3hgcuq9SVSH1Q==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6" - } - }, "node_modules/atomic-sleep": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/atomic-sleep/-/atomic-sleep-1.0.0.tgz", @@ -749,13 +567,6 @@ "node": ">=8.0.0" } }, - "node_modules/balanced-match": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - "dev": true, - "license": "MIT" - }, "node_modules/base64-js": { "version": "1.5.1", "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", @@ -807,24 +618,6 @@ "readable-stream": "^3.4.0" } }, - "node_modules/brace-expansion": { - "version": "1.1.12", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", - "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", - "dev": true, - "license": "MIT", - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "node_modules/browser-or-node": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/browser-or-node/-/browser-or-node-3.0.0.tgz", - "integrity": "sha512-iczIdVJzGEYhP5DqQxYM9Hh7Ztpqqi+CXZpSmX8ALFs9ecXkQIeqRyM6TfxEfMVpwhl3dSuDvxdzzo9sUOIVBQ==", - "dev": true, - "license": "MIT" - }, "node_modules/buffer": { "version": "5.7.1", "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", @@ -872,126 +665,12 @@ "node": ">=4" } }, - "node_modules/chalk-template": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/chalk-template/-/chalk-template-0.4.0.tgz", - "integrity": "sha512-/ghrgmhfY8RaSdeo43hNXxpoHAtxdbskUHjPpfqUWGttFgycUhYPGx3YZBCnUCvOa7Doivn1IZec3DEGFoMgLg==", - "dev": true, - "license": "MIT", - "dependencies": { - "chalk": "^4.1.2" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/chalk-template?sponsor=1" - } - }, - "node_modules/chalk-template/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "license": "MIT", - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/chalk-template/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/chalk-template/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/chalk-template/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true, - "license": "MIT" - }, - "node_modules/chalk-template/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/chalk-template/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "license": "MIT", - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/chownr": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz", "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==", "license": "ISC" }, - "node_modules/cliui": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", - "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", - "dev": true, - "license": "ISC", - "dependencies": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.1", - "wrap-ansi": "^7.0.0" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/collection-utils": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/collection-utils/-/collection-utils-1.0.1.tgz", - "integrity": "sha512-LA2YTIlR7biSpXkKYwwuzGjwL5rjWEZVOSnvdUc7gObvWe4WkjxOpfrdhoP7Hs09YWDVfg0Mal9BpAqLfVEzQg==", - "dev": true, - "license": "Apache-2.0" - }, "node_modules/color-convert": { "version": "1.9.3", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", @@ -1013,82 +692,6 @@ "integrity": "sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==", "license": "MIT" }, - "node_modules/command-line-args": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/command-line-args/-/command-line-args-5.2.1.tgz", - "integrity": "sha512-H4UfQhZyakIjC74I9d34fGYDwk3XpSr17QhEd0Q3I9Xq1CETHo4Hcuo87WyWHpAF1aSLjLRf5lD9ZGX2qStUvg==", - "dev": true, - "license": "MIT", - "dependencies": { - "array-back": "^3.1.0", - "find-replace": "^3.0.0", - "lodash.camelcase": "^4.3.0", - "typical": "^4.0.0" - }, - "engines": { - "node": ">=4.0.0" - } - }, - "node_modules/command-line-usage": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/command-line-usage/-/command-line-usage-7.0.3.tgz", - "integrity": "sha512-PqMLy5+YGwhMh1wS04mVG44oqDsgyLRSKJBdOo1bnYhMKBW65gZF1dRp2OZRhiTjgUHljy99qkO7bsctLaw35Q==", - "dev": true, - "license": "MIT", - "dependencies": { - "array-back": "^6.2.2", - "chalk-template": "^0.4.0", - "table-layout": "^4.1.0", - "typical": "^7.1.1" - }, - "engines": { - "node": ">=12.20.0" - } - }, - "node_modules/command-line-usage/node_modules/array-back": { - "version": "6.2.2", - "resolved": "https://registry.npmjs.org/array-back/-/array-back-6.2.2.tgz", - "integrity": "sha512-gUAZ7HPyb4SJczXAMUXMGAvI976JoK3qEx9v1FTmeYuJj0IBiaKttG1ydtGKdkfqWkIkouke7nG8ufGy77+Cvw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12.17" - } - }, - "node_modules/command-line-usage/node_modules/typical": { - "version": "7.3.0", - "resolved": "https://registry.npmjs.org/typical/-/typical-7.3.0.tgz", - "integrity": "sha512-ya4mg/30vm+DOWfBg4YK3j2WD6TWtRkCbasOJr40CseYENzCUby/7rIvXA99JGsQHeNxLbnXdyLLxKSv3tauFw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12.17" - } - }, - "node_modules/concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", - "dev": true, - "license": "MIT" - }, - "node_modules/create-require": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", - "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", - "dev": true, - "license": "MIT" - }, - "node_modules/cross-fetch": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-4.1.0.tgz", - "integrity": "sha512-uKm5PU+MHTootlWEY+mZ4vvXoCn4fLQxT9dSc1sXVMSFkINTJVN8cAQROpwcKm8bJ/c7rgZVIBWzH5T78sNZZw==", - "dev": true, - "license": "MIT", - "dependencies": { - "node-fetch": "^2.7.0" - } - }, "node_modules/dateformat": { "version": "4.6.3", "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-4.6.3.tgz", @@ -1131,23 +734,6 @@ "node": ">=8" } }, - "node_modules/diff": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", - "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", - "dev": true, - "license": "BSD-3-Clause", - "engines": { - "node": ">=0.3.1" - } - }, - "node_modules/emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true, - "license": "MIT" - }, "node_modules/end-of-stream": { "version": "1.4.5", "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.5.tgz", @@ -1199,16 +785,6 @@ "@esbuild/win32-x64": "0.28.1" } }, - "node_modules/escalade": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", - "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6" - } - }, "node_modules/escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", @@ -1218,26 +794,6 @@ "node": ">=0.8.0" } }, - "node_modules/event-target-shim": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz", - "integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6" - } - }, - "node_modules/events": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", - "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.8.x" - } - }, "node_modules/expand-template": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/expand-template/-/expand-template-2.0.3.tgz", @@ -1265,32 +821,12 @@ "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==", "license": "MIT" }, - "node_modules/find-replace": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/find-replace/-/find-replace-3.0.0.tgz", - "integrity": "sha512-6Tb2myMioCAgv5kfvP5/PkZZ/ntTpVK39fHY7WkWBgvbeE+VHd/tZuZ4mrC+bxh4cfOZeYKVPaJIZtZXV7GNCQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "array-back": "^3.0.1" - }, - "engines": { - "node": ">=4.0.0" - } - }, "node_modules/fs-constants": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==", "license": "MIT" }, - "node_modules/fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", - "dev": true, - "license": "ISC" - }, "node_modules/fsevents": { "version": "2.3.3", "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", @@ -1321,39 +857,6 @@ "integrity": "sha512-SyHy3T1v2NUXn29OsWdxmK6RwHD+vkj3v8en8AOBZ1wBQ/hCAQ5bAQTD02kW4W9tUp/3Qh6J8r9EvntiyCmOOw==", "license": "MIT" }, - "node_modules/glob": { - "version": "7.2.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", - "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", - "deprecated": "Glob versions prior to v9 are no longer supported", - "dev": true, - "license": "ISC", - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.1.1", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - }, - "engines": { - "node": "*" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/graphql": { - "version": "0.11.7", - "resolved": "https://registry.npmjs.org/graphql/-/graphql-0.11.7.tgz", - "integrity": "sha512-x7uDjyz8Jx+QPbpCFCMQ8lltnQa4p4vSYHx6ADe8rVYRTdsyhCJbvSty5DAsLVmU6cGakl+r8HQYolKHxk/tiw==", - "deprecated": "No longer supported; please update to a newer version. Details: https://github.com/graphql/graphql-js#version-support", - "dev": true, - "license": "MIT", - "dependencies": { - "iterall": "1.1.3" - } - }, "node_modules/has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", @@ -1398,18 +901,6 @@ ], "license": "BSD-3-Clause" }, - "node_modules/inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", - "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.", - "dev": true, - "license": "ISC", - "dependencies": { - "once": "^1.3.0", - "wrappy": "1" - } - }, "node_modules/inherits": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", @@ -1422,30 +913,6 @@ "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", "license": "ISC" }, - "node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/is-url": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/is-url/-/is-url-1.2.4.tgz", - "integrity": "sha512-ITvGim8FhRiYe4IQ5uHSkj7pVaPDrCTkNd3yq3cV7iZAcJdHTUMPMEHcqSOy9xZ9qFenQCvi+2wjH9a1nXqHww==", - "dev": true, - "license": "MIT" - }, - "node_modules/iterall": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/iterall/-/iterall-1.1.3.tgz", - "integrity": "sha512-Cu/kb+4HiNSejAPhSaN1VukdNTTi/r4/e+yykqjlG/IW+1gZH5b4+Bq3whDX4tvbYugta3r8KTMUiqT3fIGxuQ==", - "dev": true, - "license": "MIT" - }, "node_modules/joycon": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/joycon/-/joycon-3.1.1.tgz", @@ -1455,23 +922,6 @@ "node": ">=10" } }, - "node_modules/js-base64": { - "version": "3.7.8", - "resolved": "https://registry.npmjs.org/js-base64/-/js-base64-3.7.8.tgz", - "integrity": "sha512-hNngCeKxIUQiEUN3GPJOkz4wF/YvdUdbNL9hsBcMQTkKzboD7T/q3OYOuuPZLUE6dBxSGpwhk5mwuDud7JVAow==", - "dev": true, - "license": "BSD-3-Clause" - }, - "node_modules/json-schema-to-zod": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/json-schema-to-zod/-/json-schema-to-zod-2.7.0.tgz", - "integrity": "sha512-eW59l3NQ6sa3HcB+Ahf7pP6iGU7MY4we5JsPqXQ2ZcIPF8QxSg/lkY8lN0Js/AG0NjMbk+nZGUfHlceiHF+bwQ==", - "dev": true, - "license": "ISC", - "bin": { - "json-schema-to-zod": "dist/cjs/cli.js" - } - }, "node_modules/json-stringify-safe": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", @@ -1487,27 +937,6 @@ "node": ">=0.10.0" } }, - "node_modules/lodash": { - "version": "4.18.1", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.18.1.tgz", - "integrity": "sha512-dMInicTPVE8d1e5otfwmmjlxkZoUpiVLwyeTdUsi/Caj/gfzzblBcCE5sRHV/AsjuCmxWrte2TNGSYuCeCq+0Q==", - "dev": true, - "license": "MIT" - }, - "node_modules/lodash.camelcase": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz", - "integrity": "sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==", - "dev": true, - "license": "MIT" - }, - "node_modules/make-error": { - "version": "1.3.6", - "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", - "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", - "dev": true, - "license": "ISC" - }, "node_modules/mimic-response": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-3.1.0.tgz", @@ -1520,19 +949,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/minimatch": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz", - "integrity": "sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==", - "dev": true, - "license": "ISC", - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, "node_modules/minimist": { "version": "1.2.8", "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", @@ -1548,16 +964,6 @@ "integrity": "sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==", "license": "MIT" }, - "node_modules/moment": { - "version": "2.30.1", - "resolved": "https://registry.npmjs.org/moment/-/moment-2.30.1.tgz", - "integrity": "sha512-uEmtNhbDOrWPFS+hdjFCBfy9f2YoyzRpwcl+DqpC6taX21FzsTLQVbMV/W7PzNSX6x/bhC1zA3c2UQ5NzH6how==", - "dev": true, - "license": "MIT", - "engines": { - "node": "*" - } - }, "node_modules/mri": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/mri/-/mri-1.1.4.tgz", @@ -1613,27 +1019,6 @@ "node": ">=10" } }, - "node_modules/node-fetch": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", - "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", - "dev": true, - "license": "MIT", - "dependencies": { - "whatwg-url": "^5.0.0" - }, - "engines": { - "node": "4.x || >=6.0.0" - }, - "peerDependencies": { - "encoding": "^0.1.0" - }, - "peerDependenciesMeta": { - "encoding": { - "optional": true - } - } - }, "node_modules/on-exit-leak-free": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/on-exit-leak-free/-/on-exit-leak-free-2.1.2.tgz", @@ -1652,13 +1037,6 @@ "wrappy": "1" } }, - "node_modules/pako": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz", - "integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==", - "dev": true, - "license": "(MIT AND Zlib)" - }, "node_modules/parse-ms": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/parse-ms/-/parse-ms-2.1.0.tgz", @@ -1668,23 +1046,6 @@ "node": ">=6" } }, - "node_modules/path-equal": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/path-equal/-/path-equal-1.2.5.tgz", - "integrity": "sha512-i73IctDr3F2W+bsOWDyyVm/lqsXO47aY9nsFZUjTT/aljSbkxHxxCoyZ9UUrM8jK0JVod+An+rl48RCsvWM+9g==", - "dev": true, - "license": "MIT" - }, - "node_modules/path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/pino": { "version": "10.1.0", "resolved": "https://registry.npmjs.org/pino/-/pino-10.1.0.tgz", @@ -1807,16 +1168,6 @@ "integrity": "sha512-e906FRY0+tV27iq4juKzSYPbUj2do2X2JX4EzSca1631EB2QJQUqGbDuERal7LCtOpxl6x3+nvo9NPZcmjkiFA==", "license": "MIT" }, - "node_modules/pluralize": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-8.0.0.tgz", - "integrity": "sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=4" - } - }, "node_modules/prebuild-install": { "version": "7.1.3", "resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-7.1.3.tgz", @@ -1858,16 +1209,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/process": { - "version": "0.11.10", - "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", - "integrity": "sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.6.0" - } - }, "node_modules/process-warning": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/process-warning/-/process-warning-5.0.0.tgz", @@ -1900,285 +1241,6 @@ "integrity": "sha512-tYC1Q1hgyRuHgloV/YXs2w15unPVh8qfu/qCTfhTYamaw7fyhumKa2yGpdSo87vY32rIclj+4fWYQXUMs9EHvg==", "license": "MIT" }, - "node_modules/quicktype": { - "version": "23.2.6", - "resolved": "https://registry.npmjs.org/quicktype/-/quicktype-23.2.6.tgz", - "integrity": "sha512-rlD1jF71bOmDn6SQ/ToLuuRkMQ7maxo5oVTn5dPCl11ymqoJCFCvl7FzRfh+fkDFmWt2etl+JiIEdWImLxferA==", - "dev": true, - "license": "Apache-2.0", - "workspaces": [ - "./packages/quicktype-core", - "./packages/quicktype-graphql-input", - "./packages/quicktype-typescript-input", - "./packages/quicktype-vscode" - ], - "dependencies": { - "@glideapps/ts-necessities": "^2.2.3", - "chalk": "^4.1.2", - "collection-utils": "^1.0.1", - "command-line-args": "^5.2.1", - "command-line-usage": "^7.0.1", - "cross-fetch": "^4.0.0", - "graphql": "^0.11.7", - "lodash": "^4.17.21", - "moment": "^2.30.1", - "quicktype-core": "23.2.6", - "quicktype-graphql-input": "23.2.6", - "quicktype-typescript-input": "23.2.6", - "readable-stream": "^4.5.2", - "stream-json": "1.8.0", - "string-to-stream": "^3.0.1", - "typescript": "~5.8.3" - }, - "bin": { - "quicktype": "dist/index.js" - }, - "engines": { - "node": ">=18.12.0" - } - }, - "node_modules/quicktype-core": { - "version": "23.2.6", - "resolved": "https://registry.npmjs.org/quicktype-core/-/quicktype-core-23.2.6.tgz", - "integrity": "sha512-asfeSv7BKBNVb9WiYhFRBvBZHcRutPRBwJMxW0pefluK4kkKu4lv0IvZBwFKvw2XygLcL1Rl90zxWDHYgkwCmA==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@glideapps/ts-necessities": "2.2.3", - "browser-or-node": "^3.0.0", - "collection-utils": "^1.0.1", - "cross-fetch": "^4.0.0", - "is-url": "^1.2.4", - "js-base64": "^3.7.7", - "lodash": "^4.17.21", - "pako": "^1.0.6", - "pluralize": "^8.0.0", - "readable-stream": "4.5.2", - "unicode-properties": "^1.4.1", - "urijs": "^1.19.1", - "wordwrap": "^1.0.0", - "yaml": "^2.4.1" - } - }, - "node_modules/quicktype-core/node_modules/@glideapps/ts-necessities": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/@glideapps/ts-necessities/-/ts-necessities-2.2.3.tgz", - "integrity": "sha512-gXi0awOZLHk3TbW55GZLCPP6O+y/b5X1pBXKBVckFONSwF1z1E5ND2BGJsghQFah+pW7pkkyFb2VhUQI2qhL5w==", - "dev": true, - "license": "MIT" - }, - "node_modules/quicktype-core/node_modules/buffer": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", - "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "license": "MIT", - "dependencies": { - "base64-js": "^1.3.1", - "ieee754": "^1.2.1" - } - }, - "node_modules/quicktype-core/node_modules/readable-stream": { - "version": "4.5.2", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-4.5.2.tgz", - "integrity": "sha512-yjavECdqeZ3GLXNgRXgeQEdz9fvDDkNKyHnbHRFtOr7/LcfgBcmct7t/ET+HaCTqfh06OzoAxrkN/IfjJBVe+g==", - "dev": true, - "license": "MIT", - "dependencies": { - "abort-controller": "^3.0.0", - "buffer": "^6.0.3", - "events": "^3.3.0", - "process": "^0.11.10", - "string_decoder": "^1.3.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - } - }, - "node_modules/quicktype-graphql-input": { - "version": "23.2.6", - "resolved": "https://registry.npmjs.org/quicktype-graphql-input/-/quicktype-graphql-input-23.2.6.tgz", - "integrity": "sha512-jHQ8XrEaccZnWA7h/xqUQhfl+0mR5o91T6k3I4QhlnZSLdVnbycrMq4FHa9EaIFcai783JKwSUl1+koAdJq4pg==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "collection-utils": "^1.0.1", - "graphql": "^0.11.7", - "quicktype-core": "23.2.6" - } - }, - "node_modules/quicktype-typescript-input": { - "version": "23.2.6", - "resolved": "https://registry.npmjs.org/quicktype-typescript-input/-/quicktype-typescript-input-23.2.6.tgz", - "integrity": "sha512-dCNMxR+7PGs9/9Tsth9H6LOQV1G+Tv4sUGT8ZUfDRJ5Hq371qOYLma5BnLX6VxkPu8JT7mAMpQ9VFlxstX6Qaw==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@mark.probst/typescript-json-schema": "0.55.0", - "quicktype-core": "23.2.6", - "typescript": "4.9.5" - } - }, - "node_modules/quicktype-typescript-input/node_modules/typescript": { - "version": "4.9.5", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", - "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==", - "dev": true, - "license": "Apache-2.0", - "bin": { - "tsc": "bin/tsc", - "tsserver": "bin/tsserver" - }, - "engines": { - "node": ">=4.2.0" - } - }, - "node_modules/quicktype/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "license": "MIT", - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/quicktype/node_modules/buffer": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", - "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "license": "MIT", - "dependencies": { - "base64-js": "^1.3.1", - "ieee754": "^1.2.1" - } - }, - "node_modules/quicktype/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/quicktype/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/quicktype/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true, - "license": "MIT" - }, - "node_modules/quicktype/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/quicktype/node_modules/readable-stream": { - "version": "4.7.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-4.7.0.tgz", - "integrity": "sha512-oIGGmcpTLwPga8Bn6/Z75SVaH1z5dUut2ibSyAMVhmUggWpmDn2dapB0n7f8nwaSiRtepAsfJyfXIO5DCVAODg==", - "dev": true, - "license": "MIT", - "dependencies": { - "abort-controller": "^3.0.0", - "buffer": "^6.0.3", - "events": "^3.3.0", - "process": "^0.11.10", - "string_decoder": "^1.3.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - } - }, - "node_modules/quicktype/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "license": "MIT", - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/quicktype/node_modules/typescript": { - "version": "5.8.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.3.tgz", - "integrity": "sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==", - "dev": true, - "license": "Apache-2.0", - "bin": { - "tsc": "bin/tsc", - "tsserver": "bin/tsserver" - }, - "engines": { - "node": ">=14.17" - } - }, "node_modules/rc": { "version": "1.2.8", "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", @@ -2217,16 +1279,6 @@ "node": ">= 12.13.0" } }, - "node_modules/require-directory": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/safe-buffer": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", @@ -2347,23 +1399,6 @@ "node": ">= 10.x" } }, - "node_modules/stream-chain": { - "version": "2.2.5", - "resolved": "https://registry.npmjs.org/stream-chain/-/stream-chain-2.2.5.tgz", - "integrity": "sha512-1TJmBx6aSWqZ4tx7aTpBDXK0/e2hhcNSTV8+CbFJtDjbb+I1mZ8lHit0Grw9GRT+6JbIrrDd8esncgBi8aBXGA==", - "dev": true, - "license": "BSD-3-Clause" - }, - "node_modules/stream-json": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/stream-json/-/stream-json-1.8.0.tgz", - "integrity": "sha512-HZfXngYHUAr1exT4fxlbc1IOce1RYxp2ldeaf97LYCOPSoOqY/1Psp7iGvpb+6JIOgkra9zDYnPX01hGAHzEPw==", - "dev": true, - "license": "BSD-3-Clause", - "dependencies": { - "stream-chain": "^2.2.5" - } - }, "node_modules/string_decoder": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", @@ -2373,44 +1408,6 @@ "safe-buffer": "~5.2.0" } }, - "node_modules/string-to-stream": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/string-to-stream/-/string-to-stream-3.0.1.tgz", - "integrity": "sha512-Hl092MV3USJuUCC6mfl9sPzGloA3K5VwdIeJjYIkXY/8K+mUvaeEabWJgArp+xXrsWxCajeT2pc4axbVhIZJyg==", - "dev": true, - "license": "MIT", - "dependencies": { - "readable-stream": "^3.4.0" - } - }, - "node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, - "license": "MIT", - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/strip-json-comments": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", @@ -2432,30 +1429,6 @@ "node": ">=4" } }, - "node_modules/table-layout": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/table-layout/-/table-layout-4.1.1.tgz", - "integrity": "sha512-iK5/YhZxq5GO5z8wb0bY1317uDF3Zjpha0QFFLA8/trAoiLbQD0HUbMesEaxyzUgDxi2QlcbM8IvqOlEjgoXBA==", - "dev": true, - "license": "MIT", - "dependencies": { - "array-back": "^6.2.2", - "wordwrapjs": "^5.1.0" - }, - "engines": { - "node": ">=12.17" - } - }, - "node_modules/table-layout/node_modules/array-back": { - "version": "6.2.2", - "resolved": "https://registry.npmjs.org/array-back/-/array-back-6.2.2.tgz", - "integrity": "sha512-gUAZ7HPyb4SJczXAMUXMGAvI976JoK3qEx9v1FTmeYuJj0IBiaKttG1ydtGKdkfqWkIkouke7nG8ufGy77+Cvw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12.17" - } - }, "node_modules/tar-fs": { "version": "2.1.4", "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.4.tgz", @@ -2502,64 +1475,6 @@ "readable-stream": "3" } }, - "node_modules/tiny-inflate": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/tiny-inflate/-/tiny-inflate-1.0.3.tgz", - "integrity": "sha512-pkY1fj1cKHb2seWDy0B16HeWyczlJA9/WW3u3c4z/NiWDsO3DOU5D7nhTLE9CF0yXv/QZFY7sEJmj24dK+Rrqw==", - "dev": true, - "license": "MIT" - }, - "node_modules/tr46": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", - "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", - "dev": true, - "license": "MIT" - }, - "node_modules/ts-node": { - "version": "10.9.2", - "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.2.tgz", - "integrity": "sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@cspotcode/source-map-support": "^0.8.0", - "@tsconfig/node10": "^1.0.7", - "@tsconfig/node12": "^1.0.7", - "@tsconfig/node14": "^1.0.0", - "@tsconfig/node16": "^1.0.2", - "acorn": "^8.4.1", - "acorn-walk": "^8.1.1", - "arg": "^4.1.0", - "create-require": "^1.1.0", - "diff": "^4.0.1", - "make-error": "^1.1.1", - "v8-compile-cache-lib": "^3.0.1", - "yn": "3.1.1" - }, - "bin": { - "ts-node": "dist/bin.js", - "ts-node-cwd": "dist/bin-cwd.js", - "ts-node-esm": "dist/bin-esm.js", - "ts-node-script": "dist/bin-script.js", - "ts-node-transpile-only": "dist/bin-transpile.js", - "ts-script": "dist/bin-script-deprecated.js" - }, - "peerDependencies": { - "@swc/core": ">=1.2.50", - "@swc/wasm": ">=1.2.50", - "@types/node": "*", - "typescript": ">=2.7" - }, - "peerDependenciesMeta": { - "@swc/core": { - "optional": true - }, - "@swc/wasm": { - "optional": true - } - } - }, "node_modules/tsx": { "version": "4.22.4", "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.22.4.tgz", @@ -2605,16 +1520,6 @@ "node": ">=14.17" } }, - "node_modules/typical": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/typical/-/typical-4.0.0.tgz", - "integrity": "sha512-VAH4IvQ7BDFYglMd7BPRDfLgxZZX4O4TFcRDA6EN5X7erNJJq+McIEp8np9aVtxrCJ6qx4GTYVfOWNjcqwZgRw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, "node_modules/undici-types": { "version": "6.21.0", "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz", @@ -2622,42 +1527,6 @@ "dev": true, "license": "MIT" }, - "node_modules/unicode-properties": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/unicode-properties/-/unicode-properties-1.4.1.tgz", - "integrity": "sha512-CLjCCLQ6UuMxWnbIylkisbRj31qxHPAurvena/0iwSVbQ2G1VY5/HjV0IRabOEbDHlzZlRdCrD4NhB0JtU40Pg==", - "dev": true, - "license": "MIT", - "dependencies": { - "base64-js": "^1.3.0", - "unicode-trie": "^2.0.0" - } - }, - "node_modules/unicode-trie": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/unicode-trie/-/unicode-trie-2.0.0.tgz", - "integrity": "sha512-x7bc76x0bm4prf1VLg79uhAzKw8DVboClSN5VxJuQ+LKDOVEW9CdH+VY7SP+vX7xCYQqzzgQpFqz15zeLvAtZQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "pako": "^0.2.5", - "tiny-inflate": "^1.0.0" - } - }, - "node_modules/unicode-trie/node_modules/pako": { - "version": "0.2.9", - "resolved": "https://registry.npmjs.org/pako/-/pako-0.2.9.tgz", - "integrity": "sha512-NUcwaKxUxWrZLpDG+z/xZaCgQITkA/Dv4V/T6bw7VON6l1Xz/VnrBqrYjZQ12TamKHzITTfOEIYUj48y2KXImA==", - "dev": true, - "license": "MIT" - }, - "node_modules/urijs": { - "version": "1.19.11", - "resolved": "https://registry.npmjs.org/urijs/-/urijs-1.19.11.tgz", - "integrity": "sha512-HXgFDgDommxn5/bIv0cnQZsPhHDA90NPHD6+c/v21U5+Sx5hoP8+dP9IZXBU1gIfvdRfhG8cel9QNPeionfcCQ==", - "dev": true, - "license": "MIT" - }, "node_modules/util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", @@ -2677,177 +1546,16 @@ "uuid": "dist-node/bin/uuid" } }, - "node_modules/v8-compile-cache-lib": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", - "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", - "dev": true, - "license": "MIT" - }, - "node_modules/webidl-conversions": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", - "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==", - "dev": true, - "license": "BSD-2-Clause" - }, - "node_modules/whatwg-url": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", - "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", - "dev": true, - "license": "MIT", - "dependencies": { - "tr46": "~0.0.3", - "webidl-conversions": "^3.0.0" - } - }, - "node_modules/wordwrap": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", - "integrity": "sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==", - "dev": true, - "license": "MIT" - }, - "node_modules/wordwrapjs": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/wordwrapjs/-/wordwrapjs-5.1.1.tgz", - "integrity": "sha512-0yweIbkINJodk27gX9LBGMzyQdBDan3s/dEAiwBOj+Mf0PPyWL6/rikalkv8EeD0E8jm4o5RXEOrFTP3NXbhJg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12.17" - } - }, - "node_modules/wrap-ansi": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" - } - }, - "node_modules/wrap-ansi/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "license": "MIT", - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/wrap-ansi/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/wrap-ansi/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true, - "license": "MIT" - }, "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", "license": "ISC" }, - "node_modules/y18n": { - "version": "5.0.8", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", - "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", - "dev": true, - "license": "ISC", - "engines": { - "node": ">=10" - } - }, - "node_modules/yaml": { - "version": "2.8.2", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.8.2.tgz", - "integrity": "sha512-mplynKqc1C2hTVYxd0PU2xQAc22TI1vShAYGksCCfxbn/dFwnHTNi1bvYsBTkhdUNtGIf5xNOg938rrSSYvS9A==", - "dev": true, - "license": "ISC", - "bin": { - "yaml": "bin.mjs" - }, - "engines": { - "node": ">= 14.6" - }, - "funding": { - "url": "https://github.com/sponsors/eemeli" - } - }, - "node_modules/yargs": { - "version": "17.7.2", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", - "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", - "dev": true, - "license": "MIT", - "dependencies": { - "cliui": "^8.0.1", - "escalade": "^3.1.1", - "get-caller-file": "^2.0.5", - "require-directory": "^2.1.1", - "string-width": "^4.2.3", - "y18n": "^5.0.5", - "yargs-parser": "^21.1.1" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/yargs-parser": { - "version": "21.1.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", - "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", - "dev": true, - "license": "ISC", - "engines": { - "node": ">=12" - } - }, - "node_modules/yn": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", - "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6" - } - }, "node_modules/zod": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/zod/-/zod-4.2.1.tgz", - "integrity": "sha512-0wZ1IRqGGhMP76gLqz8EyfBXKk0J2qo2+H3fi4mcUP/KtTocoX08nmIAHl1Z2kJIZbZee8KOpBCSNPRgauucjw==", + "version": "3.25.76", + "resolved": "https://registry.npmjs.org/zod/-/zod-3.25.76.tgz", + "integrity": "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ==", "license": "MIT", "funding": { "url": "https://github.com/sponsors/colinhacks" diff --git a/rest/nodejs/package.json b/rest/nodejs/package.json index e49df6c8..1073f4ba 100644 --- a/rest/nodejs/package.json +++ b/rest/nodejs/package.json @@ -5,26 +5,24 @@ "dev": "tsx watch src/index.ts", "build": "tsc", "test": "tsx --test test/*.test.ts", - "start": "node dist/index.js", - "generate:models": "bash scripts/generate_models.sh" + "start": "node dist/index.js" }, "dependencies": { "@hono/node-server": "^1.19.13", "@hono/zod-validator": "^0.7.6", + "@ucp-js/sdk": "0.4.1", "better-sqlite3": "^9.4.3", "hono": "^4.12.25", "pino": "^10.1.0", "pino-http": "^11.0.0", "pino-http-print": "^4.0.0", "uuid": "^14.0.0", - "zod": "^4.2.1" + "zod": "^3.23.8" }, "devDependencies": { "@types/better-sqlite3": "^7.6.9", "@types/node": "^20.11.17", "@types/uuid": "^9.0.8", - "json-schema-to-zod": "^2.6.0", - "quicktype": "^23.2.6", "tsx": "^4.22.4", "typescript": "^5.8.3" } diff --git a/rest/nodejs/scripts/generate_models.sh b/rest/nodejs/scripts/generate_models.sh deleted file mode 100755 index ad13d536..00000000 --- a/rest/nodejs/scripts/generate_models.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash -quicktype \ - --lang typescript-zod \ - --src-lang schema \ - --src ../../../spec/discovery/*.json \ - --src ../../../spec/schemas/shopping/*.json \ - --src ../../../spec/schemas/shopping/types/*.json \ - --src '../../../spec/schemas/shopping/ap2_mandate.json#/$defs/complete_request_with_ap2' \ - --src '../../../spec/schemas/shopping/ap2_mandate.json#/$defs/checkout_response_with_ap2' \ - --src '../../../spec/schemas/shopping/buyer_consent.json#/$defs/checkout' \ - --src '../../../spec/schemas/shopping/discount.json#/$defs/checkout' \ - --src '../../../spec/schemas/shopping/fulfillment.create_req.json#/$defs/checkout' \ - --src '../../../spec/schemas/shopping/fulfillment.update_req.json#/$defs/checkout' \ - --src '../../../spec/schemas/shopping/fulfillment_resp.json#/$defs/checkout' \ - -o src/models/spec_generated.ts diff --git a/rest/nodejs/src/api/checkout.ts b/rest/nodejs/src/api/checkout.ts index d21a225d..b042a184 100644 --- a/rest/nodejs/src/api/checkout.ts +++ b/rest/nodejs/src/api/checkout.ts @@ -2,6 +2,7 @@ import { createHash } from "crypto"; import { type Context } from "hono"; import { v4 as uuidv4 } from "uuid"; import { z } from "zod"; +import { UCP_VERSION } from "../utils/config"; import { getCheckoutSession, @@ -18,6 +19,7 @@ import { } from "../data"; import { CheckoutResponseStatusSchema, + type Buyer, type Expectation, type ExpectationLineItem, type ExtendedCheckoutCreateRequest, @@ -26,7 +28,7 @@ import { ExtendedPaymentCredentialSchema, type FulfillmentDestinationRequest, type FulfillmentDestinationResponse, - type FulfillmentOptionResponse, + type FulfillmentOption, type FulfillmentRequest, type FulfillmentResponse, type LineItemCreateRequest, @@ -34,24 +36,13 @@ import { type Order, type OrderLineItem, type PaymentCreateRequest, - PaymentDataSchema, + CheckoutCompleteRequestSchema, + type CheckoutCompleteRequest, type PostalAddress, } from "../models"; import { type IdParamContext } from "../utils/validation"; -/** - * Schema for the request body when completing a checkout session. - */ -export const zCompleteCheckoutRequest = z - .object({ - risk_signals: z.record(z.string(), z.unknown()).optional(), - }) - .extend(PaymentDataSchema.shape); - -/** - * Type definition for the complete checkout request body. - */ -export type CompleteCheckoutRequest = z.infer; +// zCompleteCheckoutRequest and CompleteCheckoutRequest are now imported from SDK models /** * Service for managing checkout sessions. @@ -86,10 +77,13 @@ export class CheckoutService { let profileData: | { ucp?: { - capabilities?: Array<{ - name: string; - config?: { webhook_url?: string }; - }>; + capabilities?: Record< + string, + Array<{ + name: string; + config?: { webhook_url?: string }; + }> + >; }; } | undefined; @@ -108,11 +102,13 @@ export class CheckoutService { } if (profileData && profileData.ucp && profileData.ucp.capabilities) { - const orderCap = profileData.ucp.capabilities.find( - (c) => c.name === "dev.ucp.shopping.order" - ); - if (orderCap && orderCap.config && orderCap.config.webhook_url) { - return { webhook_url: orderCap.config.webhook_url }; + const orderCaps = + profileData.ucp.capabilities["dev.ucp.shopping.order"]; + if (orderCaps && orderCaps.length > 0) { + const orderCap = orderCaps[0]; + if (orderCap && orderCap.config && orderCap.config.webhook_url) { + return { webhook_url: orderCap.config.webhook_url }; + } } } } catch (e) { @@ -130,8 +126,8 @@ export class CheckoutService { } const webhookUrl = checkout.platform.webhook_url; let orderData: Order | undefined = undefined; - if (checkout.order_id) { - orderData = getOrder(checkout.order_id); + if (checkout.order) { + orderData = getOrder(checkout.order.id); } const payload = { @@ -151,56 +147,80 @@ export class CheckoutService { } } + private addressesMatch( + addr1: FulfillmentDestinationResponse, + addr2: FulfillmentDestinationRequest + ): boolean { + return ( + addr1.street_address === addr2.street_address && + addr1.address_locality === addr2.address_locality && + addr1.address_region === addr2.address_region && + addr1.address_country === addr2.address_country && + addr1.postal_code === addr2.postal_code + ); + } + private constructFulfillmentResponse( reqFulfillment: FulfillmentRequest | undefined, lineItems: LineItemResponse[], + buyer?: Buyer | null, existingFulfillment?: FulfillmentResponse ): FulfillmentResponse | undefined { if (!reqFulfillment) { return undefined; } - const mockDestinations: FulfillmentDestinationResponse[] = [ - { - id: "dest_1", - name: "Home (US)", - address_country: "US", - address: { - address_country: "US", - street_address: "1600 Amphitheatre Pkwy", - address_locality: "Mountain View", - address_region: "CA", - postal_code: "94043", - full_name: "John Doe", - }, - }, - { - id: "dest_2", - name: "Office (DE)", - address_country: "DE", - address: { - address_country: "DE", - street_address: "ABC Str. 1", - address_locality: "Berlin", - postal_code: "10115", - full_name: "Max Mustermann", - }, - }, - ]; + const isKnownCustomer = buyer?.email === "john.doe@example.com"; + const mockDestinations: FulfillmentDestinationResponse[] = isKnownCustomer + ? [ + { + id: "addr_1", + address_country: "US", + street_address: "123 Main St", + address_locality: "Springfield", + address_region: "IL", + postal_code: "62704", + first_name: "John", + last_name: "Doe", + }, + { + id: "addr_2", + address_country: "US", + street_address: "456 Oak Ave", + address_locality: "Metropolis", + address_region: "NY", + postal_code: "10012", + first_name: "John", + last_name: "Doe", + }, + ] + : []; return { methods: (reqFulfillment.methods || []).map((m) => { - // Use provided destinations or fallback to mock - let destinations: FulfillmentDestinationResponse[] = mockDestinations; + let destinations: FulfillmentDestinationResponse[] | undefined = + undefined; if (m.destinations && Array.isArray(m.destinations)) { destinations = m.destinations.map( - (d): FulfillmentDestinationResponse => ({ - ...d, - id: d.id || `dest_${uuidv4()}`, - }) + (d): FulfillmentDestinationResponse => { + if (!d.id) { + const matched = mockDestinations.find((md) => + this.addressesMatch(md, d) + ); + if (matched) { + return { + ...d, + id: matched.id, + } as FulfillmentDestinationResponse; + } + } + return { + ...d, + id: d.id || `dest_${uuidv4()}`, + } as FulfillmentDestinationResponse; + } ); } else if (existingFulfillment && existingFulfillment.methods) { - // Default to shipping if type is not provided in request const targetType = m.type || "shipping"; const existingMethod = existingFulfillment.methods.find( (em) => em.type === targetType @@ -208,9 +228,10 @@ export class CheckoutService { if (existingMethod && existingMethod.destinations) { destinations = existingMethod.destinations; } + } else if (isKnownCustomer) { + destinations = mockDestinations; } - // Initialize groups, preserving selection if provided const groups = (m.groups || []).map((g) => ({ id: `group_${uuidv4()}`, line_item_ids: lineItems.map((li) => li.id), @@ -222,7 +243,7 @@ export class CheckoutService { id: `method_${uuidv4()}`, type: m.type || "shipping", line_item_ids: lineItems.map((li) => li.id), - destinations, + ...(destinations ? { destinations } : {}), selected_destination_id: m.selected_destination_id, groups, }; @@ -274,25 +295,36 @@ export class CheckoutService { } if (dest && country) { - const options: FulfillmentOptionResponse[] = []; + const options: FulfillmentOption[] = []; if (country === "US") { + const hasRoses = checkout.line_items.some( + (li) => li.item.id === "bouquet_roses" + ); + const isExpensive = grandTotal >= 10000; + const stdShipCost = hasRoses || isExpensive ? 0 : 500; + options.push( { id: "std-ship", - title: "Standard Shipping", + title: + stdShipCost === 0 + ? "Free Standard Shipping" + : "Standard Shipping", description: "Arrives in 5-7 days", - total: 500, - subtotal: 500, - tax: 0, + totals: [ + { type: "subtotal", amount: stdShipCost }, + { type: "total", amount: stdShipCost }, + ], }, { id: "exp-ship-us", title: "Express Shipping (US)", description: "Arrives in 2 days", - total: 1500, - subtotal: 1500, - tax: 0, + totals: [ + { type: "subtotal", amount: 1500 }, + { type: "total", amount: 1500 }, + ], } ); } else { @@ -300,9 +332,10 @@ export class CheckoutService { id: "exp-ship-intl", title: "International Express", description: "Arrives in 5-10 days", - total: 3000, - subtotal: 3000, - tax: 0, + totals: [ + { type: "subtotal", amount: 3000 }, + { type: "total", amount: 3000 }, + ], }); } @@ -326,14 +359,17 @@ export class CheckoutService { for (const group of method.groups) { if (group.selected_option_id && group.options) { const selected = group.options.find( - (o: FulfillmentOptionResponse) => - o.id === group.selected_option_id + (o: FulfillmentOption) => o.id === group.selected_option_id ); if (selected) { - grandTotal += selected.total; + const totalObj = selected.totals.find( + (t) => t.type === "total" + ); + const totalAmount = totalObj ? totalObj.amount : 0; + grandTotal += totalAmount; checkout.totals.push({ type: "fulfillment", - amount: selected.total, + amount: totalAmount, display_text: selected.title, }); } @@ -351,7 +387,9 @@ export class CheckoutService { checkout.discounts.applied = []; if (checkout.discounts.codes) { for (const code of checkout.discounts.codes) { - if (typeof code === "string" && code.toUpperCase() === "10OFF") { + if (typeof code !== "string") continue; + const upperCode = code.toUpperCase(); + if (upperCode === "10OFF") { const discountAmount = Math.floor(grandTotal * 0.1); grandTotal -= discountAmount; checkout.discounts.applied.push({ @@ -360,10 +398,42 @@ export class CheckoutService { amount: discountAmount, allocations: [{ path: "subtotal", amount: discountAmount }], }); - // totals[] carries the signed effect on the receipt: negative for a - // discount (total.json exclusiveMaximum: 0). The applied[].amount - // above stays positive as the magnitude (discount.md). checkout.totals.push({ type: "discount", amount: -discountAmount }); + } else if (upperCode === "WELCOME20") { + const discountAmount = Math.floor(grandTotal * 0.2); + grandTotal -= discountAmount; + checkout.discounts.applied.push({ + code, + title: "Welcome 20% Off", + amount: discountAmount, + allocations: [{ path: "subtotal", amount: discountAmount }], + }); + checkout.totals.push({ type: "discount", amount: -discountAmount }); + } else if (upperCode === "FIXED500") { + const discountAmount = Math.min(grandTotal, 500); + grandTotal -= discountAmount; + checkout.discounts.applied.push({ + code, + title: "$5.00 Off", + amount: discountAmount, + allocations: [{ path: "subtotal", amount: discountAmount }], + }); + checkout.totals.push({ type: "discount", amount: -discountAmount }); + } + } + } + + // Enrich Buyer Consent if present + if (checkout.buyer?.consent) { + for (const [purpose, value] of Object.entries(checkout.buyer.consent)) { + if (value && typeof value === "object") { + const consentValue = value as any; + if (!consentValue.description) { + consentValue.description = `Consent for ${purpose}`; + } + if (!consentValue.source) { + consentValue.source = "platform"; + } } } } @@ -441,7 +511,8 @@ export class CheckoutService { const fulfillment = this.constructFulfillmentResponse( _reqFulfillment, - lineItems + lineItems, + request.buyer ); // Construct authoritative checkout @@ -451,27 +522,24 @@ export class CheckoutService { ...requestBody, // Copy other fields like ucp, etc. id: checkoutId, fulfillment, - ucp: { version: "2022-01-01", capabilities: [] }, + ucp: { + version: UCP_VERSION, + capabilities: { + "dev.ucp.shopping.checkout": [ + { + name: "dev.ucp.shopping.checkout", + version: UCP_VERSION, + }, + ], + }, + }, status: CheckoutResponseStatusSchema.enum.incomplete, - currency: request.currency || "USD", + currency: "USD", line_items: lineItems, totals: [], links: [], platform: platformConfig, - payment: { - ...request.payment, - handlers: [ - { - id: "google_pay", - name: "google.pay", - version: "2025-03-25", - spec: "https://example.com/spec", - config_schema: "https://example.com/schema", - instrument_schemas: ["https://example.com/instrument_schema"], - config: {}, - }, - ], - }, + payment: request.payment, }; // Calculate totals and validate inventory @@ -558,7 +626,6 @@ export class CheckoutService { if (platformConfig) { existing.platform = platformConfig; } - existing.currency = updateRequest.currency; // Simple merge for payment. In real world, this might be more complex. existing.payment = { @@ -602,6 +669,7 @@ export class CheckoutService { existing.fulfillment = this.constructFulfillmentResponse( updateRequest.fulfillment, existing.line_items, + existing.buyer, existing.fulfillment ); } @@ -634,7 +702,7 @@ export class CheckoutService { completeCheckout = async (c: IdParamContext) => { const { id } = c.req.valid("param"); const idempotencyKey = c.req.header("Idempotency-Key"); - const rawBody = await c.req.json(); + const rawBody = await c.req.json(); let requestHash = ""; // Idempotency check for payment data @@ -660,6 +728,20 @@ export class CheckoutService { return c.json({ detail: "Checkout session not found" }, 404); } + // Validate Fulfillment is complete + const hasFulfillment = checkout.fulfillment?.methods?.every( + (method) => + method.selected_destination_id && + method.groups?.every((group) => group.selected_option_id) + ); + + if (!hasFulfillment) { + return c.json( + { detail: "Fulfillment address and option must be selected" }, + 400 + ); + } + if ( checkout.status === CheckoutResponseStatusSchema.enum.completed || checkout.status === CheckoutResponseStatusSchema.enum.canceled @@ -669,11 +751,11 @@ export class CheckoutService { } // Process Payment - const selectedInstrument = rawBody.payment_data; - - if (!selectedInstrument) { + const payment = rawBody.payment; + if (!payment || !payment.instruments || payment.instruments.length === 0) { return c.json({ detail: "Missing payment data" }, 400); } + const selectedInstrument = payment.instruments[0]; if (selectedInstrument) { const handlerId = selectedInstrument.handler_id; @@ -777,7 +859,7 @@ export class CheckoutService { for (const group of method.groups) { if (group.selected_option_id && group.options) { const selected = group.options.find( - (opt: FulfillmentOptionResponse) => + (opt: FulfillmentOption) => opt.id === group.selected_option_id ); if (selected) { @@ -838,13 +920,16 @@ export class CheckoutService { fulfillment: { expectations, }, + currency: checkout.currency, }; saveOrder(order.id, order); // Save Checkout - checkout.order_id = orderId; - checkout.order_permalink_url = order.permalink_url; + checkout.order = { + id: orderId, + permalink_url: order.permalink_url, + }; saveCheckout(id, checkout.status, checkout); diff --git a/rest/nodejs/src/api/discovery.ts b/rest/nodejs/src/api/discovery.ts index dce811bc..c179166b 100644 --- a/rest/nodejs/src/api/discovery.ts +++ b/rest/nodejs/src/api/discovery.ts @@ -1,4 +1,5 @@ import { type Context } from "hono"; +import { UCP_VERSION } from "../utils/config"; type DiscoveryCapability = { version: string; @@ -15,10 +16,21 @@ type DiscoveryServiceBinding = { endpoint: string; }; +type DiscoveryPaymentHandler = { + id: string; + name: string; + version: string; + spec: string; + config_schema: string; + instrument_schemas: string[]; + config: Record; +}; + type UcpDiscoveryMetadata = { version: string; services: Record; capabilities: Record; + payment_handlers: Record; }; /** @@ -30,7 +42,7 @@ type UcpDiscoveryMetadata = { * capabilities (checkout, order, etc.), and supported payment handlers. */ export class DiscoveryService { - readonly ucpVersion = "2026-01-23"; + readonly ucpVersion = UCP_VERSION; /** * Returns the merchant profile, detailing the server's UCP configuration. @@ -44,15 +56,60 @@ export class DiscoveryService { * @returns A JSON response containing the merchant profile. */ getMerchantProfile = (c: Context) => { + const payment_handlers = { + "com.shopify.shop_pay": [ + { + id: "shop_pay", + name: "com.shopify.shop_pay", + version: this.ucpVersion, + spec: "https://shopify.dev/ucp/handlers/shop_pay", + config_schema: + "https://shopify.dev/ucp/handlers/shop_pay/config.json", + instrument_schemas: [ + "https://shopify.dev/ucp/handlers/shop_pay/instrument.json", + ], + config: { + shop_id: "test-shop-id", + }, + }, + ], + "google.pay": [ + { + id: "google_pay", + name: "google.pay", + version: "1.0", + spec: "https://example.com/spec", + config_schema: "https://example.com/schema", + instrument_schemas: [], + config: {}, + }, + ], + "dev.ucp.mock_payment": [ + { + id: "mock_payment_handler", + name: "dev.ucp.mock_payment", + version: "1.0", + spec: `https://ucp.dev/${this.ucpVersion}/specification/mock`, + config_schema: `https://ucp.dev/${this.ucpVersion}/schemas/mock.json`, + instrument_schemas: [ + `https://ucp.dev/${this.ucpVersion}/schemas/shopping/types/card_payment_instrument.json`, + ], + config: { + supported_tokens: ["success_token", "fail_token"], + }, + }, + ], + }; + const ucp = { version: this.ucpVersion, services: { "dev.ucp.shopping": [ { version: this.ucpVersion, - spec: "https://ucp.dev/2026-01-23/specification/shopping", + spec: `https://ucp.dev/${this.ucpVersion}/specification/shopping`, transport: "rest", - schema: "https://ucp.dev/2026-01-23/services/shopping/openapi.json", + schema: `https://ucp.dev/${this.ucpVersion}/services/shopping/openapi.json`, endpoint: "http://localhost:3000", }, ], @@ -61,110 +118,76 @@ export class DiscoveryService { "dev.ucp.shopping.checkout": [ { version: this.ucpVersion, - spec: "https://ucp.dev/2026-01-23/specification/shopping/checkout", - schema: "https://ucp.dev/2026-01-23/schemas/shopping/checkout.json", + spec: `https://ucp.dev/${this.ucpVersion}/specification/shopping/checkout`, + schema: `https://ucp.dev/${this.ucpVersion}/schemas/shopping/checkout.json`, }, ], "dev.ucp.shopping.order": [ { version: this.ucpVersion, - spec: "https://ucp.dev/2026-01-23/specification/shopping/order", - schema: "https://ucp.dev/2026-01-23/schemas/shopping/order.json", + spec: `https://ucp.dev/${this.ucpVersion}/specification/shopping/order`, + schema: `https://ucp.dev/${this.ucpVersion}/schemas/shopping/order.json`, }, ], "dev.ucp.shopping.refund": [ { version: this.ucpVersion, - spec: "https://ucp.dev/2026-01-23/specification/shopping/refund", - schema: "https://ucp.dev/2026-01-23/schemas/shopping/refund.json", + spec: `https://ucp.dev/${this.ucpVersion}/specification/shopping/refund`, + schema: `https://ucp.dev/${this.ucpVersion}/schemas/shopping/refund.json`, extends: "dev.ucp.shopping.order", }, ], "dev.ucp.shopping.return": [ { version: this.ucpVersion, - spec: "https://ucp.dev/2026-01-23/specification/shopping/return", - schema: "https://ucp.dev/2026-01-23/schemas/shopping/return.json", + spec: `https://ucp.dev/${this.ucpVersion}/specification/shopping/return`, + schema: `https://ucp.dev/${this.ucpVersion}/schemas/shopping/return.json`, extends: "dev.ucp.shopping.order", }, ], "dev.ucp.shopping.dispute": [ { version: this.ucpVersion, - spec: "https://ucp.dev/2026-01-23/specification/shopping/dispute", - schema: "https://ucp.dev/2026-01-23/schemas/shopping/dispute.json", + spec: `https://ucp.dev/${this.ucpVersion}/specification/shopping/dispute`, + schema: `https://ucp.dev/${this.ucpVersion}/schemas/shopping/dispute.json`, extends: "dev.ucp.shopping.order", }, ], "dev.ucp.shopping.discount": [ { version: this.ucpVersion, - spec: "https://ucp.dev/2026-01-23/specification/shopping/discount", - schema: "https://ucp.dev/2026-01-23/schemas/shopping/discount.json", + spec: `https://ucp.dev/${this.ucpVersion}/specification/shopping/discount`, + schema: `https://ucp.dev/${this.ucpVersion}/schemas/shopping/discount.json`, extends: "dev.ucp.shopping.checkout", }, ], "dev.ucp.shopping.fulfillment": [ { version: this.ucpVersion, - spec: "https://ucp.dev/2026-01-23/specification/shopping/fulfillment", - schema: - "https://ucp.dev/2026-01-23/schemas/shopping/fulfillment.json", + spec: `https://ucp.dev/${this.ucpVersion}/specification/shopping/fulfillment`, + schema: `https://ucp.dev/${this.ucpVersion}/schemas/shopping/fulfillment.json`, extends: "dev.ucp.shopping.checkout", }, ], "dev.ucp.shopping.buyer_consent": [ { version: this.ucpVersion, - spec: "https://ucp.dev/2026-01-23/specification/shopping/buyer_consent", - schema: - "https://ucp.dev/2026-01-23/schemas/shopping/buyer_consent.json", + spec: `https://ucp.dev/${this.ucpVersion}/specification/shopping/buyer_consent`, + schema: `https://ucp.dev/${this.ucpVersion}/schemas/shopping/buyer_consent.json`, extends: "dev.ucp.shopping.checkout", }, ], }, + payment_handlers, } satisfies UcpDiscoveryMetadata; const discoveryProfile = { ucp, payment: { handlers: [ - { - id: "shop_pay", - name: "com.shopify.shop_pay", - version: "2026-01-23", - spec: "https://shopify.dev/ucp/handlers/shop_pay", - config_schema: - "https://shopify.dev/ucp/handlers/shop_pay/config.json", - instrument_schemas: [ - "https://shopify.dev/ucp/handlers/shop_pay/instrument.json", - ], - config: { - shop_id: "test-shop-id", - }, - }, - { - id: "google_pay", - name: "google.pay", - version: "1.0", - spec: "https://example.com/spec", - config_schema: "https://example.com/schema", - instrument_schemas: [], - config: {}, - }, - { - id: "mock_payment_handler", - name: "dev.ucp.mock_payment", - version: "1.0", - spec: "https://ucp.dev/2026-01-23/specification/mock", - config_schema: "https://ucp.dev/2026-01-23/schemas/mock.json", - instrument_schemas: [ - "https://ucp.dev/2026-01-23/schemas/shopping/types/card_payment_instrument.json", - ], - config: { - supported_tokens: ["success_token", "fail_token"], - }, - }, + ...payment_handlers["com.shopify.shop_pay"], + ...payment_handlers["google.pay"], + ...payment_handlers["dev.ucp.mock_payment"], ], }, }; diff --git a/rest/nodejs/src/index.ts b/rest/nodejs/src/index.ts index 6e339d73..321ceaff 100644 --- a/rest/nodejs/src/index.ts +++ b/rest/nodejs/src/index.ts @@ -4,7 +4,7 @@ import { type Context, Hono } from "hono"; import { requestId } from "hono/request-id"; import { pinoHttp } from "pino-http"; -import { CheckoutService, zCompleteCheckoutRequest } from "./api/checkout"; +import { CheckoutService } from "./api/checkout"; import { DiscoveryService } from "./api/discovery"; import { OrderService } from "./api/order"; import { TestingService } from "./api/testing"; @@ -12,6 +12,7 @@ import { initDbs } from "./data/db"; import { ExtendedCheckoutCreateRequestSchema, ExtendedCheckoutUpdateRequestSchema, + CheckoutCompleteRequestSchema, OrderSchema, } from "./models"; import { IdParamSchema, prettyValidation } from "./utils/validation"; @@ -94,7 +95,7 @@ app.put( app.post( "/checkout-sessions/:id/complete", zValidator("param", IdParamSchema, prettyValidation), - zValidator("json", zCompleteCheckoutRequest, prettyValidation), + zValidator("json", CheckoutCompleteRequestSchema, prettyValidation), checkoutService.completeCheckout ); app.post( diff --git a/rest/nodejs/src/models/extensions.ts b/rest/nodejs/src/models/extensions.ts deleted file mode 100644 index 7c8da194..00000000 --- a/rest/nodejs/src/models/extensions.ts +++ /dev/null @@ -1,61 +0,0 @@ -import { z } from "zod"; - -import { - CheckoutCreateRequestSchema, - CheckoutUpdateRequestSchema, - CheckoutWithBuyerConsentSchema, - CheckoutWithDiscountSchema, - CheckoutWithFulfillmentCreateRequestSchema, - CheckoutWithFulfillmentResponseSchema, - CheckoutWithFulfillmentUpdateRequestSchema, - FulfillmentDestinationResponseSchema, - OrderSchema, - PaymentCredentialSchema, -} from "./spec_generated"; - -export const ExtendedPaymentCredentialSchema = PaymentCredentialSchema.extend({ - token: z.string().optional(), -}); -export type ExtendedPaymentCredential = z.infer< - typeof ExtendedPaymentCredentialSchema ->; - -export const PlatformConfigSchema = z.object({ - webhook_url: z.string().url().optional(), -}); -export type PlatformConfig = z.infer; - -export const ExtendedCheckoutResponseSchema = - CheckoutWithFulfillmentResponseSchema.extend(CheckoutWithDiscountSchema.shape) - .extend(CheckoutWithBuyerConsentSchema.shape) - .extend({ - order_id: z.string().optional(), - order_permalink_url: z.string().optional(), - platform: PlatformConfigSchema.optional(), - }); -export type ExtendedCheckoutResponse = z.infer< - typeof ExtendedCheckoutResponseSchema ->; - -export const ExtendedCheckoutCreateRequestSchema = - CheckoutCreateRequestSchema.extend( - CheckoutWithFulfillmentCreateRequestSchema.pick({ fulfillment: true }).shape - ) - .extend(CheckoutWithDiscountSchema.pick({ discounts: true }).shape) - .extend(CheckoutWithBuyerConsentSchema.pick({ buyer: true }).shape); -export type ExtendedCheckoutCreateRequest = z.infer< - typeof ExtendedCheckoutCreateRequestSchema ->; - -export const ExtendedCheckoutUpdateRequestSchema = - CheckoutUpdateRequestSchema.extend( - CheckoutWithFulfillmentUpdateRequestSchema.pick({ fulfillment: true }).shape - ) - .extend(CheckoutWithDiscountSchema.pick({ discounts: true }).shape) - .extend(CheckoutWithBuyerConsentSchema.pick({ buyer: true }).shape); -export type ExtendedCheckoutUpdateRequest = z.infer< - typeof ExtendedCheckoutUpdateRequestSchema ->; - -export const OrderUpdateSchema = OrderSchema; -export type OrderUpdate = z.infer; diff --git a/rest/nodejs/src/models/index.ts b/rest/nodejs/src/models/index.ts index 28e98807..572faade 100644 --- a/rest/nodejs/src/models/index.ts +++ b/rest/nodejs/src/models/index.ts @@ -1,2 +1 @@ -export * from "./extensions"; -export * from "./spec_generated"; +export * from "@ucp-js/sdk"; diff --git a/rest/nodejs/src/models/spec_generated.ts b/rest/nodejs/src/models/spec_generated.ts deleted file mode 100644 index 50920ce2..00000000 --- a/rest/nodejs/src/models/spec_generated.ts +++ /dev/null @@ -1,1016 +0,0 @@ -import * as z from "zod"; - -// Key usage. Should be 'sig' for signing keys. - -export const UseSchema = z.enum(["enc", "sig"]); -export type Use = z.infer; - -// The type of card number. Network tokens are preferred with fallback to FPAN. -// See PCI Scope for more details. - -export const CardNumberTypeSchema = z.enum(["dpan", "fpan", "network_token"]); -export type CardNumberType = z.infer; - -// A URI pointing to a schema definition (e.g., JSON Schema) used to validate -// the structure of the instrument object. - -export const CardPaymentInstrumentTypeSchema = z.enum(["card"]); -export type CardPaymentInstrumentType = z.infer< - typeof CardPaymentInstrumentTypeSchema ->; - -// Type of total categorization. - -export const TotalResponseTypeSchema = z.enum([ - "discount", - "fee", - "fulfillment", - "items_discount", - "subtotal", - "tax", - "total", -]); -export type TotalResponseType = z.infer; - -// Content format, default = plain. - -export const ContentTypeSchema = z.enum(["markdown", "plain"]); -export type ContentType = z.infer; - -// Declares who resolves this error. 'recoverable': agent can fix via API. -// 'requires_buyer_input': merchant requires information their API doesn't -// support collecting programmatically (checkout incomplete). -// 'requires_buyer_review': buyer must authorize before order placement due to -// policy, regulatory, or entitlement rules (checkout complete). Errors with -// 'requires_*' severity contribute to 'status: requires_escalation'. - -export const SeveritySchema = z.enum([ - "recoverable", - "requires_buyer_input", - "requires_buyer_review", -]); -export type Severity = z.infer; - -export const MessageTypeSchema = z.enum(["error", "info", "warning"]); -export type MessageType = z.infer; - -// Checkout state indicating the current phase and required action. See Checkout -// Status lifecycle documentation for state transition details. - -export const CheckoutResponseStatusSchema = z.enum([ - "canceled", - "complete_in_progress", - "completed", - "incomplete", - "ready_for_complete", - "requires_escalation", -]); -export type CheckoutResponseStatus = z.infer< - typeof CheckoutResponseStatusSchema ->; - -// Adjustment status. - -export const AdjustmentStatusSchema = z.enum([ - "completed", - "failed", - "pending", -]); -export type AdjustmentStatus = z.infer; - -// Delivery method type (shipping, pickup, digital). - -export const MethodTypeSchema = z.enum(["digital", "pickup", "shipping"]); -export type MethodType = z.infer; - -// Derived status: fulfilled if quantity.fulfilled == quantity.total, partial if -// quantity.fulfilled > 0, otherwise processing. - -export const OrderLineItemStatusSchema = z.enum([ - "fulfilled", - "partial", - "processing", -]); -export type OrderLineItemStatus = z.infer; - -// Fulfillment method type this availability applies to. -// -// Fulfillment method type. - -export const TypeElementSchema = z.enum(["pickup", "shipping"]); -export type TypeElement = z.infer; - -export const MessageErrorTypeSchema = z.enum(["error"]); -export type MessageErrorType = z.infer; - -export const MessageInfoTypeSchema = z.enum(["info"]); -export type MessageInfoType = z.infer; - -export const MessageWarningTypeSchema = z.enum(["warning"]); -export type MessageWarningType = z.infer; - -// Current fulfillment status. - -export const OrderFulfillmentDetailStatusSchema = z.enum([ - "canceled", - "delivered", - "failed_attempt", - "in_transit", - "out_for_delivery", - "processing", - "shipped", -]); -export type OrderFulfillmentDetailStatus = z.infer< - typeof OrderFulfillmentDetailStatusSchema ->; - -// Allocation method. 'each' = applied independently per item. 'across' = split -// proportionally by value. - -export const MethodSchema = z.enum(["across", "each"]); -export type Method = z.infer; - -export const PaymentHandlerResponseSchema = z.object({ - config: z.record(z.string(), z.any()), - config_schema: z.string(), - id: z.string(), - instrument_schemas: z.array(z.string()), - name: z.string(), - spec: z.string(), - version: z.string(), -}); -export type PaymentHandlerResponse = z.infer< - typeof PaymentHandlerResponseSchema ->; - -export const SigningKeySchema = z.object({ - alg: z.string().optional(), - crv: z.string().optional(), - e: z.string().optional(), - kid: z.string(), - kty: z.string(), - n: z.string().optional(), - use: UseSchema.optional(), - x: z.string().optional(), - y: z.string().optional(), -}); -export type SigningKey = z.infer; - -export const CapabilityDiscoverySchema = z.object({ - config: z.record(z.string(), z.any()).optional(), - extends: z.string().optional(), - name: z.string(), - schema: z.string(), - spec: z.string(), - version: z.string(), -}); -export type CapabilityDiscovery = z.infer; - -export const A2ASchema = z.object({ - endpoint: z.string(), -}); -export type A2A = z.infer; - -export const EmbeddedSchema = z.object({ - schema: z.string(), -}); -export type Embedded = z.infer; - -export const McpSchema = z.object({ - endpoint: z.string(), - schema: z.string(), -}); -export type Mcp = z.infer; - -export const RestSchema = z.object({ - endpoint: z.string(), - schema: z.string(), -}); -export type Rest = z.infer; - -export const BuyerSchema = z.object({ - email: z.string().optional(), - first_name: z.string().optional(), - full_name: z.string().optional(), - last_name: z.string().optional(), - phone_number: z.string().optional(), -}); -export type Buyer = z.infer; - -export const ItemCreateRequestSchema = z.object({ - id: z.string(), -}); -export type ItemCreateRequest = z.infer; - -export const PostalAddressSchema = z.object({ - address_country: z.string().optional(), - address_locality: z.string().optional(), - address_region: z.string().optional(), - extended_address: z.string().optional(), - first_name: z.string().optional(), - full_name: z.string().optional(), - last_name: z.string().optional(), - phone_number: z.string().optional(), - postal_code: z.string().optional(), - street_address: z.string().optional(), -}); -export type PostalAddress = z.infer; - -export const PaymentCredentialSchema = z.object({ - type: z.string(), - card_number_type: CardNumberTypeSchema.optional(), - cryptogram: z.string().optional(), - cvc: z.string().optional(), - eci_value: z.string().optional(), - expiry_month: z.number().optional(), - expiry_year: z.number().optional(), - name: z.string().optional(), - number: z.string().optional(), -}); -export type PaymentCredential = z.infer; - -export const ItemResponseSchema = z.object({ - id: z.string(), - image_url: z.string().optional(), - price: z.number(), - title: z.string(), -}); -export type ItemResponse = z.infer; - -export const TotalResponseSchema = z.object({ - amount: z.number(), - display_text: z.string().optional(), - type: TotalResponseTypeSchema, -}); -export type TotalResponse = z.infer; - -export const LinkSchema = z.object({ - title: z.string().optional(), - type: z.string(), - url: z.string(), -}); -export type Link = z.infer; - -export const MessageSchema = z.object({ - code: z.string().optional(), - content: z.string(), - content_type: ContentTypeSchema.optional(), - path: z.string().optional(), - severity: SeveritySchema.optional(), - type: MessageTypeSchema, -}); -export type Message = z.infer; - -export const CapabilityResponseSchema = z.object({ - config: z.record(z.string(), z.any()).optional(), - extends: z.string().optional(), - name: z.string(), - schema: z.string().optional(), - spec: z.string().optional(), - version: z.string(), -}); -export type CapabilityResponse = z.infer; - -export const ItemUpdateRequestSchema = z.object({ - id: z.string(), -}); -export type ItemUpdateRequest = z.infer; - -export const AdjustmentLineItemSchema = z.object({ - id: z.string(), - quantity: z.number(), -}); -export type AdjustmentLineItem = z.infer; - -export const FulfillmentEventLineItemSchema = z.object({ - id: z.string(), - quantity: z.number(), -}); -export type FulfillmentEventLineItem = z.infer< - typeof FulfillmentEventLineItemSchema ->; - -export const ExpectationLineItemSchema = z.object({ - id: z.string(), - quantity: z.number(), -}); -export type ExpectationLineItem = z.infer; - -export const QuantitySchema = z.object({ - fulfilled: z.number(), - total: z.number(), -}); -export type Quantity = z.infer; - -export const UcpOrderResponseSchema = z.object({ - capabilities: z.array(CapabilityResponseSchema), - version: z.string(), -}); -export type UcpOrderResponse = z.infer; - -export const PaymentAccountInfoSchema = z.object({ - payment_account_reference: z.string().optional(), -}); -export type PaymentAccountInfo = z.infer; - -export const IdentityClassSchema = z.object({ - access_token: z.string(), -}); -export type IdentityClass = z.infer; - -export const CardCredentialSchema = z.object({ - card_number_type: CardNumberTypeSchema, - cryptogram: z.string().optional(), - cvc: z.string().optional(), - eci_value: z.string().optional(), - expiry_month: z.number().optional(), - expiry_year: z.number().optional(), - name: z.string().optional(), - number: z.string().optional(), - type: CardPaymentInstrumentTypeSchema, -}); -export type CardCredential = z.infer; - -export const CardPaymentInstrumentSchema = z.object({ - billing_address: PostalAddressSchema.optional(), - credential: PaymentCredentialSchema.optional(), - handler_id: z.string(), - id: z.string(), - type: CardPaymentInstrumentTypeSchema, - brand: z.string(), - expiry_month: z.number().optional(), - expiry_year: z.number().optional(), - last_digits: z.string(), - rich_card_art: z.string().optional(), - rich_text_description: z.string().optional(), -}); -export type CardPaymentInstrument = z.infer; - -export const FulfillmentDestinationRequestSchema = z.object({ - address_country: z.string().optional(), - address_locality: z.string().optional(), - address_region: z.string().optional(), - extended_address: z.string().optional(), - first_name: z.string().optional(), - full_name: z.string().optional(), - last_name: z.string().optional(), - phone_number: z.string().optional(), - postal_code: z.string().optional(), - street_address: z.string().optional(), - id: z.string().optional(), - address: PostalAddressSchema.optional(), - name: z.string().optional(), -}); -export type FulfillmentDestinationRequest = z.infer< - typeof FulfillmentDestinationRequestSchema ->; - -export const FulfillmentGroupCreateRequestSchema = z.object({ - selected_option_id: z.union([z.null(), z.string()]).optional(), -}); -export type FulfillmentGroupCreateRequest = z.infer< - typeof FulfillmentGroupCreateRequestSchema ->; - -export const FulfillmentGroupUpdateRequestSchema = z.object({ - id: z.string(), - selected_option_id: z.union([z.null(), z.string()]).optional(), -}); -export type FulfillmentGroupUpdateRequest = z.infer< - typeof FulfillmentGroupUpdateRequestSchema ->; - -export const FulfillmentDestinationRequestElementSchema = z.object({ - address_country: z.string().optional(), - address_locality: z.string().optional(), - address_region: z.string().optional(), - extended_address: z.string().optional(), - first_name: z.string().optional(), - full_name: z.string().optional(), - last_name: z.string().optional(), - phone_number: z.string().optional(), - postal_code: z.string().optional(), - street_address: z.string().optional(), - id: z.string().optional(), - address: PostalAddressSchema.optional(), - name: z.string().optional(), -}); -export type FulfillmentDestinationRequestElement = z.infer< - typeof FulfillmentDestinationRequestElementSchema ->; - -export const GroupElementSchema = z.object({ - selected_option_id: z.union([z.null(), z.string()]).optional(), -}); -export type GroupElement = z.infer; - -export const GroupClassSchema = z.object({ - id: z.string(), - selected_option_id: z.union([z.null(), z.string()]).optional(), -}); -export type GroupClass = z.infer; - -export const AllowsMultiDestinationSchema = z.object({ - pickup: z.boolean().optional(), - shipping: z.boolean().optional(), -}); -export type AllowsMultiDestination = z.infer< - typeof AllowsMultiDestinationSchema ->; - -export const MessageErrorSchema = z.object({ - code: z.string(), - content: z.string(), - content_type: ContentTypeSchema.optional(), - path: z.string().optional(), - severity: SeveritySchema, - type: MessageErrorTypeSchema, -}); -export type MessageError = z.infer; - -export const MessageInfoSchema = z.object({ - code: z.string().optional(), - content: z.string(), - content_type: ContentTypeSchema.optional(), - path: z.string().optional(), - type: MessageInfoTypeSchema, -}); -export type MessageInfo = z.infer; - -export const MessageWarningSchema = z.object({ - code: z.string(), - content: z.string(), - content_type: ContentTypeSchema.optional(), - path: z.string().optional(), - type: MessageWarningTypeSchema, -}); -export type MessageWarning = z.infer; - -export const FulfillmentOptionResponseSchema = z.object({ - carrier: z.string().optional(), - description: z.string().optional(), - earliest_fulfillment_time: z.coerce.date().optional(), - id: z.string(), - latest_fulfillment_time: z.coerce.date().optional(), - subtotal: z.number().optional(), - tax: z.number().optional(), - title: z.string(), - total: z.number(), -}); -export type FulfillmentOptionResponse = z.infer< - typeof FulfillmentOptionResponseSchema ->; - -export const PaymentIdentitySchema = z.object({ - access_token: z.string(), -}); -export type PaymentIdentity = z.infer; - -export const PaymentInstrumentBaseSchema = z.object({ - billing_address: PostalAddressSchema.optional(), - credential: PaymentCredentialSchema.optional(), - handler_id: z.string(), - id: z.string(), - type: z.string(), -}); -export type PaymentInstrumentBase = z.infer; - -export const PlatformFulfillmentConfigSchema = z.object({ - supports_multi_group: z.boolean().optional(), -}); -export type PlatformFulfillmentConfig = z.infer< - typeof PlatformFulfillmentConfigSchema ->; - -export const RetailLocationRequestSchema = z.object({ - address: PostalAddressSchema.optional(), - name: z.string(), -}); -export type RetailLocationRequest = z.infer; - -export const RetailLocationResponseSchema = z.object({ - address: PostalAddressSchema.optional(), - id: z.string(), - name: z.string(), -}); -export type RetailLocationResponse = z.infer< - typeof RetailLocationResponseSchema ->; - -export const TokenCredentialCreateRequestSchema = z.object({ - token: z.string(), - type: z.string(), -}); -export type TokenCredentialCreateRequest = z.infer< - typeof TokenCredentialCreateRequestSchema ->; - -export const TokenCredentialResponseSchema = z.object({ - type: z.string(), -}); -export type TokenCredentialResponse = z.infer< - typeof TokenCredentialResponseSchema ->; - -export const TokenCredentialUpdateRequestSchema = z.object({ - token: z.string(), - type: z.string(), -}); -export type TokenCredentialUpdateRequest = z.infer< - typeof TokenCredentialUpdateRequestSchema ->; - -export const Ap2CompleteRequestObjectSchema = z.object({ - checkout_mandate: z.string(), -}); -export type Ap2CompleteRequestObject = z.infer< - typeof Ap2CompleteRequestObjectSchema ->; - -export const Ap2CheckoutResponseObjectSchema = z.object({ - merchant_authorization: z.string(), -}); -export type Ap2CheckoutResponseObject = z.infer< - typeof Ap2CheckoutResponseObjectSchema ->; - -export const ConsentSchema = z.object({ - analytics: z.boolean().optional(), - marketing: z.boolean().optional(), - preferences: z.boolean().optional(), - sale_of_data: z.boolean().optional(), -}); -export type Consent = z.infer; - -export const AllocationElementSchema = z.object({ - amount: z.number(), - path: z.string(), -}); -export type AllocationElement = z.infer; - -export const MethodElementSchema = z.object({ - destinations: z.array(FulfillmentDestinationRequestElementSchema).optional(), - groups: z.array(GroupElementSchema).optional(), - line_item_ids: z.array(z.string()).optional(), - selected_destination_id: z.union([z.null(), z.string()]).optional(), - type: TypeElementSchema, -}); -export type MethodElement = z.infer; - -export const FulfillmentAvailableMethodResponseSchema = z.object({ - description: z.string().optional(), - fulfillable_on: z.union([z.null(), z.string()]).optional(), - line_item_ids: z.array(z.string()), - type: TypeElementSchema, -}); -export type FulfillmentAvailableMethodResponse = z.infer< - typeof FulfillmentAvailableMethodResponseSchema ->; - -export const FulfillmentDestinationResponseSchema = z.object({ - address_country: z.string().optional(), - address_locality: z.string().optional(), - address_region: z.string().optional(), - extended_address: z.string().optional(), - first_name: z.string().optional(), - full_name: z.string().optional(), - last_name: z.string().optional(), - phone_number: z.string().optional(), - postal_code: z.string().optional(), - street_address: z.string().optional(), - id: z.string(), - address: PostalAddressSchema.optional(), - name: z.string().optional(), -}); -export type FulfillmentDestinationResponse = z.infer< - typeof FulfillmentDestinationResponseSchema ->; - -export const FulfillmentGroupResponseSchema = z.object({ - id: z.string(), - line_item_ids: z.array(z.string()), - options: z.array(FulfillmentOptionResponseSchema).optional(), - selected_option_id: z.union([z.null(), z.string()]).optional(), -}); -export type FulfillmentGroupResponse = z.infer< - typeof FulfillmentGroupResponseSchema ->; - -export const PaymentSchema = z.object({ - handlers: z.array(PaymentHandlerResponseSchema).optional(), -}); -export type Payment = z.infer; - -export const UcpServiceSchema = z.object({ - a2a: A2ASchema.optional(), - embedded: EmbeddedSchema.optional(), - mcp: McpSchema.optional(), - rest: RestSchema.optional(), - spec: z.string(), - version: z.string(), -}); -export type UcpService = z.infer; - -export const LineItemCreateRequestSchema = z.object({ - item: ItemCreateRequestSchema, - quantity: z.number(), -}); -export type LineItemCreateRequest = z.infer; - -export const PaymentInstrumentSchema = z.object({ - billing_address: PostalAddressSchema.optional(), - credential: PaymentCredentialSchema.optional(), - handler_id: z.string(), - id: z.string(), - type: CardPaymentInstrumentTypeSchema, - brand: z.string(), - expiry_month: z.number().optional(), - expiry_year: z.number().optional(), - last_digits: z.string(), - rich_card_art: z.string().optional(), - rich_text_description: z.string().optional(), -}); -export type PaymentInstrument = z.infer; - -export const LineItemResponseSchema = z.object({ - id: z.string(), - item: ItemResponseSchema, - parent_id: z.string().optional(), - quantity: z.number(), - totals: z.array(TotalResponseSchema), -}); -export type LineItemResponse = z.infer; - -export const PaymentResponseSchema = z.object({ - handlers: z.array(PaymentHandlerResponseSchema), - instruments: z.array(PaymentInstrumentSchema).optional(), - selected_instrument_id: z.string().optional(), -}); -export type PaymentResponse = z.infer; - -export const UcpCheckoutResponseSchema = z.object({ - capabilities: z.array(CapabilityResponseSchema), - version: z.string(), -}); -export type UcpCheckoutResponse = z.infer; - -export const LineItemUpdateRequestSchema = z.object({ - id: z.string().optional(), - item: ItemUpdateRequestSchema, - parent_id: z.string().optional(), - quantity: z.number(), -}); -export type LineItemUpdateRequest = z.infer; - -export const CheckoutUpdateRequestPaymentSchema = z.object({ - instruments: z.array(PaymentInstrumentSchema).optional(), - selected_instrument_id: z.string().optional(), -}); -export type CheckoutUpdateRequestPayment = z.infer< - typeof CheckoutUpdateRequestPaymentSchema ->; - -export const AdjustmentSchema = z.object({ - amount: z.number().optional(), - description: z.string().optional(), - id: z.string(), - line_items: z.array(AdjustmentLineItemSchema).optional(), - occurred_at: z.coerce.date(), - status: AdjustmentStatusSchema, - type: z.string(), -}); -export type Adjustment = z.infer; - -export const FulfillmentEventSchema = z.object({ - carrier: z.string().optional(), - description: z.string().optional(), - id: z.string(), - line_items: z.array(FulfillmentEventLineItemSchema), - occurred_at: z.coerce.date(), - tracking_number: z.string().optional(), - tracking_url: z.string().optional(), - type: z.string(), -}); -export type FulfillmentEvent = z.infer; - -export const ExpectationSchema = z.object({ - description: z.string().optional(), - destination: PostalAddressSchema, - fulfillable_on: z.string().optional(), - id: z.string(), - line_items: z.array(ExpectationLineItemSchema), - method_type: MethodTypeSchema, -}); -export type Expectation = z.infer; - -export const OrderLineItemSchema = z.object({ - id: z.string(), - item: ItemResponseSchema, - parent_id: z.string().optional(), - quantity: QuantitySchema, - status: OrderLineItemStatusSchema, - totals: z.array(TotalResponseSchema), -}); -export type OrderLineItem = z.infer; - -export const PaymentCreateRequestSchema = z.object({ - instruments: z.array(PaymentInstrumentSchema).optional(), - selected_instrument_id: z.string().optional(), -}); -export type PaymentCreateRequest = z.infer; - -export const PaymentDataSchema = z.object({ - payment_data: PaymentInstrumentSchema, -}); -export type PaymentData = z.infer; - -export const PaymentUpdateRequestSchema = z.object({ - instruments: z.array(PaymentInstrumentSchema).optional(), - selected_instrument_id: z.string().optional(), -}); -export type PaymentUpdateRequest = z.infer; - -export const BindingSchema = z.object({ - checkout_id: z.string(), - identity: IdentityClassSchema.optional(), -}); -export type Binding = z.infer; - -export const FulfillmentMethodCreateRequestSchema = z.object({ - destinations: z.array(FulfillmentDestinationRequestElementSchema).optional(), - groups: z.array(GroupElementSchema).optional(), - line_item_ids: z.array(z.string()).optional(), - selected_destination_id: z.union([z.null(), z.string()]).optional(), - type: TypeElementSchema, -}); -export type FulfillmentMethodCreateRequest = z.infer< - typeof FulfillmentMethodCreateRequestSchema ->; - -export const FulfillmentMethodUpdateRequestSchema = z.object({ - destinations: z.array(FulfillmentDestinationRequestElementSchema).optional(), - groups: z.array(GroupClassSchema).optional(), - id: z.string(), - line_item_ids: z.array(z.string()), - selected_destination_id: z.union([z.null(), z.string()]).optional(), -}); -export type FulfillmentMethodUpdateRequest = z.infer< - typeof FulfillmentMethodUpdateRequestSchema ->; - -export const MerchantFulfillmentConfigSchema = z.object({ - allows_method_combinations: z.array(z.array(TypeElementSchema)).optional(), - allows_multi_destination: AllowsMultiDestinationSchema.optional(), -}); -export type MerchantFulfillmentConfig = z.infer< - typeof MerchantFulfillmentConfigSchema ->; - -export const OrderFulfillmentDetailSchema = z.object({ - expected_fulfillment_time: z.string().optional(), - fulfillment_address: PostalAddressSchema.optional(), - fulfillment_option: FulfillmentOptionResponseSchema, - fulfillment_tracking_url: z.string().optional(), - id: z.string(), - status: OrderFulfillmentDetailStatusSchema, - tracking_identifier: z.string().optional(), -}); -export type OrderFulfillmentDetail = z.infer< - typeof OrderFulfillmentDetailSchema ->; - -export const CompleteCheckoutRequestWithAp2Schema = z.object({ - ap2: Ap2CompleteRequestObjectSchema.optional(), -}); -export type CompleteCheckoutRequestWithAp2 = z.infer< - typeof CompleteCheckoutRequestWithAp2Schema ->; - -export const CheckoutWithAp2MandateSchema = z.object({ - buyer: BuyerSchema.optional(), - continue_url: z.string().optional(), - currency: z.string(), - expires_at: z.coerce.date().optional(), - id: z.string(), - line_items: z.array(LineItemResponseSchema), - links: z.array(LinkSchema), - messages: z.array(MessageSchema).optional(), - order_id: z.string().optional(), - order_permalink_url: z.string().optional(), - payment: PaymentResponseSchema, - status: CheckoutResponseStatusSchema, - totals: z.array(TotalResponseSchema), - ucp: UcpCheckoutResponseSchema, - ap2: Ap2CheckoutResponseObjectSchema.optional(), -}); -export type CheckoutWithAp2Mandate = z.infer< - typeof CheckoutWithAp2MandateSchema ->; - -export const BuyerWithConsentSchema = z.object({ - email: z.string().optional(), - first_name: z.string().optional(), - full_name: z.string().optional(), - last_name: z.string().optional(), - phone_number: z.string().optional(), - consent: ConsentSchema.optional(), -}); -export type BuyerWithConsent = z.infer; - -export const AppliedElementSchema = z.object({ - allocations: z.array(AllocationElementSchema).optional(), - amount: z.number(), - automatic: z.boolean().optional(), - code: z.string().optional(), - method: MethodSchema.optional(), - priority: z.number().optional(), - title: z.string(), -}); -export type AppliedElement = z.infer; - -export const FulfillmentRequestSchema = z.object({ - methods: z.array(MethodElementSchema).optional(), -}); -export type FulfillmentRequest = z.infer; - -export const CheckoutWithFulfillmentUpdateRequestSchema = z.object({ - buyer: BuyerSchema.optional(), - currency: z.string(), - id: z.string(), - line_items: z.array(LineItemUpdateRequestSchema), - payment: CheckoutUpdateRequestPaymentSchema, - fulfillment: FulfillmentRequestSchema.optional(), -}); -export type CheckoutWithFulfillmentUpdateRequest = z.infer< - typeof CheckoutWithFulfillmentUpdateRequestSchema ->; - -export const FulfillmentMethodResponseSchema = z.object({ - destinations: z.array(FulfillmentDestinationResponseSchema).optional(), - groups: z.array(FulfillmentGroupResponseSchema).optional(), - id: z.string(), - line_item_ids: z.array(z.string()), - selected_destination_id: z.union([z.null(), z.string()]).optional(), - type: TypeElementSchema, -}); -export type FulfillmentMethodResponse = z.infer< - typeof FulfillmentMethodResponseSchema ->; - -export const UcpClassSchema = z.object({ - capabilities: z.array(CapabilityDiscoverySchema), - services: z.record(z.string(), UcpServiceSchema), - version: z.string(), -}); -export type UcpClass = z.infer; - -export const PaymentClassSchema = z.object({ - instruments: z.array(PaymentInstrumentSchema).optional(), - selected_instrument_id: z.string().optional(), -}); -export type PaymentClass = z.infer; - -export const CheckoutResponseSchema = z.object({ - buyer: BuyerSchema.optional(), - continue_url: z.string().optional(), - currency: z.string(), - expires_at: z.coerce.date().optional(), - id: z.string(), - line_items: z.array(LineItemResponseSchema), - links: z.array(LinkSchema), - messages: z.array(MessageSchema).optional(), - order_id: z.string().optional(), - order_permalink_url: z.string().optional(), - payment: PaymentResponseSchema, - status: CheckoutResponseStatusSchema, - totals: z.array(TotalResponseSchema), - ucp: UcpCheckoutResponseSchema, -}); -export type CheckoutResponse = z.infer; - -export const CheckoutUpdateRequestSchema = z.object({ - buyer: BuyerSchema.optional(), - currency: z.string(), - id: z.string(), - line_items: z.array(LineItemUpdateRequestSchema), - payment: CheckoutUpdateRequestPaymentSchema, -}); -export type CheckoutUpdateRequest = z.infer; - -export const FulfillmentSchema = z.object({ - events: z.array(FulfillmentEventSchema).optional(), - expectations: z.array(ExpectationSchema).optional(), -}); -export type Fulfillment = z.infer; - -export const CheckoutWithBuyerConsentSchema = z.object({ - buyer: BuyerWithConsentSchema.optional(), - continue_url: z.string().optional(), - currency: z.string(), - expires_at: z.coerce.date().optional(), - id: z.string(), - line_items: z.array(LineItemResponseSchema), - links: z.array(LinkSchema), - messages: z.array(MessageSchema).optional(), - order_id: z.string().optional(), - order_permalink_url: z.string().optional(), - payment: PaymentResponseSchema, - status: CheckoutResponseStatusSchema, - totals: z.array(TotalResponseSchema), - ucp: UcpCheckoutResponseSchema, -}); -export type CheckoutWithBuyerConsent = z.infer< - typeof CheckoutWithBuyerConsentSchema ->; - -export const DiscountsClassSchema = z.object({ - applied: z.array(AppliedElementSchema).optional(), - codes: z.array(z.string()).optional(), -}); -export type DiscountsClass = z.infer; - -export const CheckoutWithFulfillmentCreateRequestSchema = z.object({ - buyer: BuyerSchema.optional(), - currency: z.string(), - line_items: z.array(LineItemCreateRequestSchema), - payment: PaymentClassSchema, - fulfillment: FulfillmentRequestSchema.optional(), -}); -export type CheckoutWithFulfillmentCreateRequest = z.infer< - typeof CheckoutWithFulfillmentCreateRequestSchema ->; - -export const FulfillmentResponseSchema = z.object({ - available_methods: z - .array(FulfillmentAvailableMethodResponseSchema) - .optional(), - methods: z.array(FulfillmentMethodResponseSchema).optional(), -}); -export type FulfillmentResponse = z.infer; - -export const UcpDiscoveryProfileSchema = z.object({ - payment: PaymentSchema.optional(), - signing_keys: z.array(SigningKeySchema).optional(), - ucp: UcpClassSchema, -}); -export type UcpDiscoveryProfile = z.infer; - -export const CheckoutCreateRequestSchema = z.object({ - buyer: BuyerSchema.optional(), - currency: z.string(), - line_items: z.array(LineItemCreateRequestSchema), - payment: PaymentClassSchema, -}); -export type CheckoutCreateRequest = z.infer; - -export const OrderSchema = z.object({ - adjustments: z.array(AdjustmentSchema).optional(), - checkout_id: z.string(), - fulfillment: FulfillmentSchema, - id: z.string(), - line_items: z.array(OrderLineItemSchema), - permalink_url: z.string(), - totals: z.array(TotalResponseSchema), - ucp: UcpOrderResponseSchema, -}); -export type Order = z.infer; - -export const CheckoutWithDiscountSchema = z.object({ - buyer: BuyerSchema.optional(), - continue_url: z.string().optional(), - currency: z.string(), - expires_at: z.coerce.date().optional(), - id: z.string(), - line_items: z.array(LineItemResponseSchema), - links: z.array(LinkSchema), - messages: z.array(MessageSchema).optional(), - order_id: z.string().optional(), - order_permalink_url: z.string().optional(), - payment: PaymentResponseSchema, - status: CheckoutResponseStatusSchema, - totals: z.array(TotalResponseSchema), - ucp: UcpCheckoutResponseSchema, - discounts: DiscountsClassSchema.optional(), -}); -export type CheckoutWithDiscount = z.infer; - -export const CheckoutWithFulfillmentResponseSchema = z.object({ - buyer: BuyerSchema.optional(), - continue_url: z.string().optional(), - currency: z.string(), - expires_at: z.coerce.date().optional(), - id: z.string(), - line_items: z.array(LineItemResponseSchema), - links: z.array(LinkSchema), - messages: z.array(MessageSchema).optional(), - order_id: z.string().optional(), - order_permalink_url: z.string().optional(), - payment: PaymentResponseSchema, - status: CheckoutResponseStatusSchema, - totals: z.array(TotalResponseSchema), - ucp: UcpCheckoutResponseSchema, - fulfillment: FulfillmentResponseSchema.optional(), -}); -export type CheckoutWithFulfillmentResponse = z.infer< - typeof CheckoutWithFulfillmentResponseSchema ->; diff --git a/rest/nodejs/src/utils/config.ts b/rest/nodejs/src/utils/config.ts new file mode 100644 index 00000000..65444aca --- /dev/null +++ b/rest/nodejs/src/utils/config.ts @@ -0,0 +1 @@ +export const UCP_VERSION = "2026-04-08"; diff --git a/rest/nodejs/src/utils/validation.ts b/rest/nodejs/src/utils/validation.ts index 7a625b49..7d82a632 100644 --- a/rest/nodejs/src/utils/validation.ts +++ b/rest/nodejs/src/utils/validation.ts @@ -9,9 +9,19 @@ import * as z from "zod"; * @param c - The Hono context. * @returns A response object if validation fails, otherwise void (implied continuation). */ +const formatPath = (path: (string | number)[]) => { + return path.reduce((acc, val) => { + if (typeof val === "number") { + return `${acc}[${val}]`; + } + return acc ? `${acc}.${val}` : String(val); + }, ""); +}; + export function prettyValidation( result: - { success: true; data: T; target: string } | { success: false; error: any }, + | { success: true; data: T; target: string } + | { success: false; error: z.ZodError }, c: Context ) { if (result.success) { @@ -23,7 +33,12 @@ export function prettyValidation( c.var.logger.warn( `Request payload:\n${JSON.stringify(c.req.json(), null, 2)}` ); - const prettyError = z.prettifyError(result.error); + const prettyError = result.error.issues + .map((issue) => { + const path = formatPath(issue.path); + return `✖ ${issue.message}\n → at ${path}`; + }) + .join("\n"); c.var.logger.warn(prettyError); return c.text(prettyError, 422);