diff --git a/platforms/web/package.json b/platforms/web/package.json index d86aa3f7..535a1089 100644 --- a/platforms/web/package.json +++ b/platforms/web/package.json @@ -72,6 +72,9 @@ "verify": "publint", "prepack": "pnpm run build" }, + "dependencies": { + "@shopify/checkout-kit-protocol": "workspace:*" + }, "devDependencies": { "@custom-elements-manifest/analyzer": "^0.10.4", "@types/node": "^22.10.0", diff --git a/platforms/web/pnpm-lock.yaml b/platforms/web/pnpm-lock.yaml index 97e8519d..f7129b83 100644 --- a/platforms/web/pnpm-lock.yaml +++ b/platforms/web/pnpm-lock.yaml @@ -7,6 +7,10 @@ settings: importers: .: + dependencies: + '@shopify/checkout-kit-protocol': + specifier: workspace:* + version: link:../../protocol/languages/typescript devDependencies: '@custom-elements-manifest/analyzer': specifier: ^0.10.4 @@ -42,6 +46,16 @@ importers: specifier: ^4.1.0 version: 4.1.7(@types/node@22.19.18)(@vitest/coverage-v8@4.1.7)(happy-dom@15.11.7)(vite@7.3.2(@types/node@22.19.18)) + ../../protocol/languages/typescript: + dependencies: + '@babel/runtime': + specifier: ^7.25.0 + version: 7.29.7 + devDependencies: + typescript: + specifier: ^5.9.2 + version: 5.9.3 + packages: '@babel/helper-string-parser@7.29.7': @@ -57,6 +71,10 @@ packages: engines: {node: '>=6.0.0'} hasBin: true + '@babel/runtime@7.29.7': + resolution: {integrity: sha512-Nq8OhGWiZIZGV6hLHoyAKLLcJihP/xFeBMGJoUrxTX2psI8dCifzLhZISFb+VWS3wFMRDmCGw5R+dOySCqPLhw==, tarball: https://registry.npmjs.org/@babel/runtime/-/runtime-7.29.7.tgz} + engines: {node: '>=6.9.0'} + '@babel/types@7.29.7': resolution: {integrity: sha512-4zBIxpPzowiZpusoFkyGVwakdRJUyuH5PxQ/PrqghfdFWWasvnCdPfQXHrenDai+gyLARulZjZowCOj6fjT4pA==} engines: {node: '>=6.9.0'} @@ -73,157 +91,157 @@ packages: resolution: {integrity: sha512-2iVksJ156XuaeeC6jB6oMG6k9ROHS3W1delwJLL804yQMri9NnQW78JDCYMtFfW8b4locUG+3+hrtAHxk+fNGg==} '@esbuild/aix-ppc64@0.27.7': - resolution: {integrity: sha512-EKX3Qwmhz1eMdEJokhALr0YiD0lhQNwDqkPYyPhiSwKrh7/4KRjQc04sZ8db+5DVVnZ1LmbNDI1uAMPEUBnQPg==} + resolution: {integrity: sha512-EKX3Qwmhz1eMdEJokhALr0YiD0lhQNwDqkPYyPhiSwKrh7/4KRjQc04sZ8db+5DVVnZ1LmbNDI1uAMPEUBnQPg==, tarball: https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.27.7.tgz} engines: {node: '>=18'} cpu: [ppc64] os: [aix] '@esbuild/android-arm64@0.27.7': - resolution: {integrity: sha512-62dPZHpIXzvChfvfLJow3q5dDtiNMkwiRzPylSCfriLvZeq0a1bWChrGx/BbUbPwOrsWKMn8idSllklzBy+dgQ==} + resolution: {integrity: sha512-62dPZHpIXzvChfvfLJow3q5dDtiNMkwiRzPylSCfriLvZeq0a1bWChrGx/BbUbPwOrsWKMn8idSllklzBy+dgQ==, tarball: https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.27.7.tgz} engines: {node: '>=18'} cpu: [arm64] os: [android] '@esbuild/android-arm@0.27.7': - resolution: {integrity: sha512-jbPXvB4Yj2yBV7HUfE2KHe4GJX51QplCN1pGbYjvsyCZbQmies29EoJbkEc+vYuU5o45AfQn37vZlyXy4YJ8RQ==} + resolution: {integrity: sha512-jbPXvB4Yj2yBV7HUfE2KHe4GJX51QplCN1pGbYjvsyCZbQmies29EoJbkEc+vYuU5o45AfQn37vZlyXy4YJ8RQ==, tarball: https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.27.7.tgz} engines: {node: '>=18'} cpu: [arm] os: [android] '@esbuild/android-x64@0.27.7': - resolution: {integrity: sha512-x5VpMODneVDb70PYV2VQOmIUUiBtY3D3mPBG8NxVk5CogneYhkR7MmM3yR/uMdITLrC1ml/NV1rj4bMJuy9MCg==} + resolution: {integrity: sha512-x5VpMODneVDb70PYV2VQOmIUUiBtY3D3mPBG8NxVk5CogneYhkR7MmM3yR/uMdITLrC1ml/NV1rj4bMJuy9MCg==, tarball: https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.27.7.tgz} engines: {node: '>=18'} cpu: [x64] os: [android] '@esbuild/darwin-arm64@0.27.7': - resolution: {integrity: sha512-5lckdqeuBPlKUwvoCXIgI2D9/ABmPq3Rdp7IfL70393YgaASt7tbju3Ac+ePVi3KDH6N2RqePfHnXkaDtY9fkw==} + resolution: {integrity: sha512-5lckdqeuBPlKUwvoCXIgI2D9/ABmPq3Rdp7IfL70393YgaASt7tbju3Ac+ePVi3KDH6N2RqePfHnXkaDtY9fkw==, tarball: https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.27.7.tgz} engines: {node: '>=18'} cpu: [arm64] os: [darwin] '@esbuild/darwin-x64@0.27.7': - resolution: {integrity: sha512-rYnXrKcXuT7Z+WL5K980jVFdvVKhCHhUwid+dDYQpH+qu+TefcomiMAJpIiC2EM3Rjtq0sO3StMV/+3w3MyyqQ==} + resolution: {integrity: sha512-rYnXrKcXuT7Z+WL5K980jVFdvVKhCHhUwid+dDYQpH+qu+TefcomiMAJpIiC2EM3Rjtq0sO3StMV/+3w3MyyqQ==, tarball: https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.27.7.tgz} engines: {node: '>=18'} cpu: [x64] os: [darwin] '@esbuild/freebsd-arm64@0.27.7': - resolution: {integrity: sha512-B48PqeCsEgOtzME2GbNM2roU29AMTuOIN91dsMO30t+Ydis3z/3Ngoj5hhnsOSSwNzS+6JppqWsuhTp6E82l2w==} + resolution: {integrity: sha512-B48PqeCsEgOtzME2GbNM2roU29AMTuOIN91dsMO30t+Ydis3z/3Ngoj5hhnsOSSwNzS+6JppqWsuhTp6E82l2w==, tarball: https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.27.7.tgz} engines: {node: '>=18'} cpu: [arm64] os: [freebsd] '@esbuild/freebsd-x64@0.27.7': - resolution: {integrity: sha512-jOBDK5XEjA4m5IJK3bpAQF9/Lelu/Z9ZcdhTRLf4cajlB+8VEhFFRjWgfy3M1O4rO2GQ/b2dLwCUGpiF/eATNQ==} + resolution: {integrity: sha512-jOBDK5XEjA4m5IJK3bpAQF9/Lelu/Z9ZcdhTRLf4cajlB+8VEhFFRjWgfy3M1O4rO2GQ/b2dLwCUGpiF/eATNQ==, tarball: https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.27.7.tgz} engines: {node: '>=18'} cpu: [x64] os: [freebsd] '@esbuild/linux-arm64@0.27.7': - resolution: {integrity: sha512-RZPHBoxXuNnPQO9rvjh5jdkRmVizktkT7TCDkDmQ0W2SwHInKCAV95GRuvdSvA7w4VMwfCjUiPwDi0ZO6Nfe9A==} + resolution: {integrity: sha512-RZPHBoxXuNnPQO9rvjh5jdkRmVizktkT7TCDkDmQ0W2SwHInKCAV95GRuvdSvA7w4VMwfCjUiPwDi0ZO6Nfe9A==, tarball: https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.27.7.tgz} engines: {node: '>=18'} cpu: [arm64] os: [linux] '@esbuild/linux-arm@0.27.7': - resolution: {integrity: sha512-RkT/YXYBTSULo3+af8Ib0ykH8u2MBh57o7q/DAs3lTJlyVQkgQvlrPTnjIzzRPQyavxtPtfg0EopvDyIt0j1rA==} + resolution: {integrity: sha512-RkT/YXYBTSULo3+af8Ib0ykH8u2MBh57o7q/DAs3lTJlyVQkgQvlrPTnjIzzRPQyavxtPtfg0EopvDyIt0j1rA==, tarball: https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.27.7.tgz} engines: {node: '>=18'} cpu: [arm] os: [linux] '@esbuild/linux-ia32@0.27.7': - resolution: {integrity: sha512-GA48aKNkyQDbd3KtkplYWT102C5sn/EZTY4XROkxONgruHPU72l+gW+FfF8tf2cFjeHaRbWpOYa/uRBz/Xq1Pg==} + resolution: {integrity: sha512-GA48aKNkyQDbd3KtkplYWT102C5sn/EZTY4XROkxONgruHPU72l+gW+FfF8tf2cFjeHaRbWpOYa/uRBz/Xq1Pg==, tarball: https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.27.7.tgz} engines: {node: '>=18'} cpu: [ia32] os: [linux] '@esbuild/linux-loong64@0.27.7': - resolution: {integrity: sha512-a4POruNM2oWsD4WKvBSEKGIiWQF8fZOAsycHOt6JBpZ+JN2n2JH9WAv56SOyu9X5IqAjqSIPTaJkqN8F7XOQ5Q==} + resolution: {integrity: sha512-a4POruNM2oWsD4WKvBSEKGIiWQF8fZOAsycHOt6JBpZ+JN2n2JH9WAv56SOyu9X5IqAjqSIPTaJkqN8F7XOQ5Q==, tarball: https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.27.7.tgz} engines: {node: '>=18'} cpu: [loong64] os: [linux] '@esbuild/linux-mips64el@0.27.7': - resolution: {integrity: sha512-KabT5I6StirGfIz0FMgl1I+R1H73Gp0ofL9A3nG3i/cYFJzKHhouBV5VWK1CSgKvVaG4q1RNpCTR2LuTVB3fIw==} + resolution: {integrity: sha512-KabT5I6StirGfIz0FMgl1I+R1H73Gp0ofL9A3nG3i/cYFJzKHhouBV5VWK1CSgKvVaG4q1RNpCTR2LuTVB3fIw==, tarball: https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.27.7.tgz} engines: {node: '>=18'} cpu: [mips64el] os: [linux] '@esbuild/linux-ppc64@0.27.7': - resolution: {integrity: sha512-gRsL4x6wsGHGRqhtI+ifpN/vpOFTQtnbsupUF5R5YTAg+y/lKelYR1hXbnBdzDjGbMYjVJLJTd2OFmMewAgwlQ==} + resolution: {integrity: sha512-gRsL4x6wsGHGRqhtI+ifpN/vpOFTQtnbsupUF5R5YTAg+y/lKelYR1hXbnBdzDjGbMYjVJLJTd2OFmMewAgwlQ==, tarball: https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.27.7.tgz} engines: {node: '>=18'} cpu: [ppc64] os: [linux] '@esbuild/linux-riscv64@0.27.7': - resolution: {integrity: sha512-hL25LbxO1QOngGzu2U5xeXtxXcW+/GvMN3ejANqXkxZ/opySAZMrc+9LY/WyjAan41unrR3YrmtTsUpwT66InQ==} + resolution: {integrity: sha512-hL25LbxO1QOngGzu2U5xeXtxXcW+/GvMN3ejANqXkxZ/opySAZMrc+9LY/WyjAan41unrR3YrmtTsUpwT66InQ==, tarball: https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.27.7.tgz} engines: {node: '>=18'} cpu: [riscv64] os: [linux] '@esbuild/linux-s390x@0.27.7': - resolution: {integrity: sha512-2k8go8Ycu1Kb46vEelhu1vqEP+UeRVj2zY1pSuPdgvbd5ykAw82Lrro28vXUrRmzEsUV0NzCf54yARIK8r0fdw==} + resolution: {integrity: sha512-2k8go8Ycu1Kb46vEelhu1vqEP+UeRVj2zY1pSuPdgvbd5ykAw82Lrro28vXUrRmzEsUV0NzCf54yARIK8r0fdw==, tarball: https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.27.7.tgz} engines: {node: '>=18'} cpu: [s390x] os: [linux] '@esbuild/linux-x64@0.27.7': - resolution: {integrity: sha512-hzznmADPt+OmsYzw1EE33ccA+HPdIqiCRq7cQeL1Jlq2gb1+OyWBkMCrYGBJ+sxVzve2ZJEVeePbLM2iEIZSxA==} + resolution: {integrity: sha512-hzznmADPt+OmsYzw1EE33ccA+HPdIqiCRq7cQeL1Jlq2gb1+OyWBkMCrYGBJ+sxVzve2ZJEVeePbLM2iEIZSxA==, tarball: https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.27.7.tgz} engines: {node: '>=18'} cpu: [x64] os: [linux] '@esbuild/netbsd-arm64@0.27.7': - resolution: {integrity: sha512-b6pqtrQdigZBwZxAn1UpazEisvwaIDvdbMbmrly7cDTMFnw/+3lVxxCTGOrkPVnsYIosJJXAsILG9XcQS+Yu6w==} + resolution: {integrity: sha512-b6pqtrQdigZBwZxAn1UpazEisvwaIDvdbMbmrly7cDTMFnw/+3lVxxCTGOrkPVnsYIosJJXAsILG9XcQS+Yu6w==, tarball: https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.27.7.tgz} engines: {node: '>=18'} cpu: [arm64] os: [netbsd] '@esbuild/netbsd-x64@0.27.7': - resolution: {integrity: sha512-OfatkLojr6U+WN5EDYuoQhtM+1xco+/6FSzJJnuWiUw5eVcicbyK3dq5EeV/QHT1uy6GoDhGbFpprUiHUYggrw==} + resolution: {integrity: sha512-OfatkLojr6U+WN5EDYuoQhtM+1xco+/6FSzJJnuWiUw5eVcicbyK3dq5EeV/QHT1uy6GoDhGbFpprUiHUYggrw==, tarball: https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.27.7.tgz} engines: {node: '>=18'} cpu: [x64] os: [netbsd] '@esbuild/openbsd-arm64@0.27.7': - resolution: {integrity: sha512-AFuojMQTxAz75Fo8idVcqoQWEHIXFRbOc1TrVcFSgCZtQfSdc1RXgB3tjOn/krRHENUB4j00bfGjyl2mJrU37A==} + resolution: {integrity: sha512-AFuojMQTxAz75Fo8idVcqoQWEHIXFRbOc1TrVcFSgCZtQfSdc1RXgB3tjOn/krRHENUB4j00bfGjyl2mJrU37A==, tarball: https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.27.7.tgz} engines: {node: '>=18'} cpu: [arm64] os: [openbsd] '@esbuild/openbsd-x64@0.27.7': - resolution: {integrity: sha512-+A1NJmfM8WNDv5CLVQYJ5PshuRm/4cI6WMZRg1by1GwPIQPCTs1GLEUHwiiQGT5zDdyLiRM/l1G0Pv54gvtKIg==} + resolution: {integrity: sha512-+A1NJmfM8WNDv5CLVQYJ5PshuRm/4cI6WMZRg1by1GwPIQPCTs1GLEUHwiiQGT5zDdyLiRM/l1G0Pv54gvtKIg==, tarball: https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.27.7.tgz} engines: {node: '>=18'} cpu: [x64] os: [openbsd] '@esbuild/openharmony-arm64@0.27.7': - resolution: {integrity: sha512-+KrvYb/C8zA9CU/g0sR6w2RBw7IGc5J2BPnc3dYc5VJxHCSF1yNMxTV5LQ7GuKteQXZtspjFbiuW5/dOj7H4Yw==} + resolution: {integrity: sha512-+KrvYb/C8zA9CU/g0sR6w2RBw7IGc5J2BPnc3dYc5VJxHCSF1yNMxTV5LQ7GuKteQXZtspjFbiuW5/dOj7H4Yw==, tarball: https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.27.7.tgz} engines: {node: '>=18'} cpu: [arm64] os: [openharmony] '@esbuild/sunos-x64@0.27.7': - resolution: {integrity: sha512-ikktIhFBzQNt/QDyOL580ti9+5mL/YZeUPKU2ivGtGjdTYoqz6jObj6nOMfhASpS4GU4Q/Clh1QtxWAvcYKamA==} + resolution: {integrity: sha512-ikktIhFBzQNt/QDyOL580ti9+5mL/YZeUPKU2ivGtGjdTYoqz6jObj6nOMfhASpS4GU4Q/Clh1QtxWAvcYKamA==, tarball: https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.27.7.tgz} engines: {node: '>=18'} cpu: [x64] os: [sunos] '@esbuild/win32-arm64@0.27.7': - resolution: {integrity: sha512-7yRhbHvPqSpRUV7Q20VuDwbjW5kIMwTHpptuUzV+AA46kiPze5Z7qgt6CLCK3pWFrHeNfDd1VKgyP4O+ng17CA==} + resolution: {integrity: sha512-7yRhbHvPqSpRUV7Q20VuDwbjW5kIMwTHpptuUzV+AA46kiPze5Z7qgt6CLCK3pWFrHeNfDd1VKgyP4O+ng17CA==, tarball: https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.27.7.tgz} engines: {node: '>=18'} cpu: [arm64] os: [win32] '@esbuild/win32-ia32@0.27.7': - resolution: {integrity: sha512-SmwKXe6VHIyZYbBLJrhOoCJRB/Z1tckzmgTLfFYOfpMAx63BJEaL9ExI8x7v0oAO3Zh6D/Oi1gVxEYr5oUCFhw==} + resolution: {integrity: sha512-SmwKXe6VHIyZYbBLJrhOoCJRB/Z1tckzmgTLfFYOfpMAx63BJEaL9ExI8x7v0oAO3Zh6D/Oi1gVxEYr5oUCFhw==, tarball: https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.27.7.tgz} engines: {node: '>=18'} cpu: [ia32] os: [win32] '@esbuild/win32-x64@0.27.7': - resolution: {integrity: sha512-56hiAJPhwQ1R4i+21FVF7V8kSD5zZTdHcVuRFMW0hn753vVfQN8xlx4uOPT4xoGH0Z/oVATuR82AiqSTDIpaHg==} + resolution: {integrity: sha512-56hiAJPhwQ1R4i+21FVF7V8kSD5zZTdHcVuRFMW0hn753vVfQN8xlx4uOPT4xoGH0Z/oVATuR82AiqSTDIpaHg==, tarball: https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.27.7.tgz} engines: {node: '>=18'} cpu: [x64] os: [win32] @@ -267,245 +285,245 @@ packages: engines: {node: '>= 8'} '@oxfmt/binding-android-arm-eabi@0.47.0': - resolution: {integrity: sha512-KrMQRdMi/upr81qT4ijK6X6BNp6jqpMY7FwILQnwIy9QLc3qpnhUx5rsCLGzn4ewsCQ0CNAspN2ogmP1GXLyLw==} + resolution: {integrity: sha512-KrMQRdMi/upr81qT4ijK6X6BNp6jqpMY7FwILQnwIy9QLc3qpnhUx5rsCLGzn4ewsCQ0CNAspN2ogmP1GXLyLw==, tarball: https://registry.npmjs.org/@oxfmt/binding-android-arm-eabi/-/binding-android-arm-eabi-0.47.0.tgz} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm] os: [android] '@oxfmt/binding-android-arm64@0.47.0': - resolution: {integrity: sha512-r4ixS/PeUpAFKgrpDoZ5pSkthjZzVzKd95525Aazj+aOv9H4ulK5zYHGb7wFY5n5kZxHK8TbOJUZgoEb1ohddQ==} + resolution: {integrity: sha512-r4ixS/PeUpAFKgrpDoZ5pSkthjZzVzKd95525Aazj+aOv9H4ulK5zYHGb7wFY5n5kZxHK8TbOJUZgoEb1ohddQ==, tarball: https://registry.npmjs.org/@oxfmt/binding-android-arm64/-/binding-android-arm64-0.47.0.tgz} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [android] '@oxfmt/binding-darwin-arm64@0.47.0': - resolution: {integrity: sha512-CLWxiKpMl+195cm09CuaWEhJK0CirRkoMa07aR9+9AFPat2LfIKtwx1JqxZM0MTvcMe6+adlJNdVL6jdInvq3g==} + resolution: {integrity: sha512-CLWxiKpMl+195cm09CuaWEhJK0CirRkoMa07aR9+9AFPat2LfIKtwx1JqxZM0MTvcMe6+adlJNdVL6jdInvq3g==, tarball: https://registry.npmjs.org/@oxfmt/binding-darwin-arm64/-/binding-darwin-arm64-0.47.0.tgz} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [darwin] '@oxfmt/binding-darwin-x64@0.47.0': - resolution: {integrity: sha512-Xq5fjTYDC50faUeLSm0rZdBqoTgleXEdD7NpJdARtQIczkCJn3xNjMUSQQkUmh4CtxkKTNL68lytcOK3e/osgg==} + resolution: {integrity: sha512-Xq5fjTYDC50faUeLSm0rZdBqoTgleXEdD7NpJdARtQIczkCJn3xNjMUSQQkUmh4CtxkKTNL68lytcOK3e/osgg==, tarball: https://registry.npmjs.org/@oxfmt/binding-darwin-x64/-/binding-darwin-x64-0.47.0.tgz} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [darwin] '@oxfmt/binding-freebsd-x64@0.47.0': - resolution: {integrity: sha512-QOU9ZIJ52p5askcEC0QJvvr8trHAWoonul8bgISo6gYUL3s50zkqafBYcNAr9LJZQbsZtPfIWHk9+5+nUp1qJQ==} + resolution: {integrity: sha512-QOU9ZIJ52p5askcEC0QJvvr8trHAWoonul8bgISo6gYUL3s50zkqafBYcNAr9LJZQbsZtPfIWHk9+5+nUp1qJQ==, tarball: https://registry.npmjs.org/@oxfmt/binding-freebsd-x64/-/binding-freebsd-x64-0.47.0.tgz} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [freebsd] '@oxfmt/binding-linux-arm-gnueabihf@0.47.0': - resolution: {integrity: sha512-oJxDM1aBhPvz9gmElBv8UpxyiqhwfjcbrSxT5F0xtuUzY6dQI27/AQPIt3eu3Z5Yvn0kQl5R7MA3Z+MbnRvCBw==} + resolution: {integrity: sha512-oJxDM1aBhPvz9gmElBv8UpxyiqhwfjcbrSxT5F0xtuUzY6dQI27/AQPIt3eu3Z5Yvn0kQl5R7MA3Z+MbnRvCBw==, tarball: https://registry.npmjs.org/@oxfmt/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-0.47.0.tgz} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm] os: [linux] '@oxfmt/binding-linux-arm-musleabihf@0.47.0': - resolution: {integrity: sha512-g8Lh50VS4ibGz2q6v7r9UZY4D0dM16SdrFYOMzhqIoCwGcai8VMIRUAcqn1/jlCsOOzUXJ741+kCeJt0cofakQ==} + resolution: {integrity: sha512-g8Lh50VS4ibGz2q6v7r9UZY4D0dM16SdrFYOMzhqIoCwGcai8VMIRUAcqn1/jlCsOOzUXJ741+kCeJt0cofakQ==, tarball: https://registry.npmjs.org/@oxfmt/binding-linux-arm-musleabihf/-/binding-linux-arm-musleabihf-0.47.0.tgz} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm] os: [linux] '@oxfmt/binding-linux-arm64-gnu@0.47.0': - resolution: {integrity: sha512-YrNT1vQ0asaXoRbrvYENPqmBfOQ9Xr8enPNOULeYfg44VjCcrUowFy5QZr+WawE0zyP8cH9e9Gxxg0fDEFzhcg==} + resolution: {integrity: sha512-YrNT1vQ0asaXoRbrvYENPqmBfOQ9Xr8enPNOULeYfg44VjCcrUowFy5QZr+WawE0zyP8cH9e9Gxxg0fDEFzhcg==, tarball: https://registry.npmjs.org/@oxfmt/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-0.47.0.tgz} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [linux] libc: [glibc] '@oxfmt/binding-linux-arm64-musl@0.47.0': - resolution: {integrity: sha512-IxtQC/sbBi4ubbY+MdwdanRWrG9InQJVZqyMsBa5IUaQcnSg86gQme574HxXMC1p4bo4YhV99zQ+wNnGCvEgzw==} + resolution: {integrity: sha512-IxtQC/sbBi4ubbY+MdwdanRWrG9InQJVZqyMsBa5IUaQcnSg86gQme574HxXMC1p4bo4YhV99zQ+wNnGCvEgzw==, tarball: https://registry.npmjs.org/@oxfmt/binding-linux-arm64-musl/-/binding-linux-arm64-musl-0.47.0.tgz} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [linux] libc: [musl] '@oxfmt/binding-linux-ppc64-gnu@0.47.0': - resolution: {integrity: sha512-EWXEhOMbWO0q6eJSbu0QLkU8cKi0ljlYLngeDs2Ocu/pm1rrLwyQiYzlFbdnMRURI4w9ndr1sI9rSbhlJ5o23Q==} + resolution: {integrity: sha512-EWXEhOMbWO0q6eJSbu0QLkU8cKi0ljlYLngeDs2Ocu/pm1rrLwyQiYzlFbdnMRURI4w9ndr1sI9rSbhlJ5o23Q==, tarball: https://registry.npmjs.org/@oxfmt/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-0.47.0.tgz} engines: {node: ^20.19.0 || >=22.12.0} cpu: [ppc64] os: [linux] libc: [glibc] '@oxfmt/binding-linux-riscv64-gnu@0.47.0': - resolution: {integrity: sha512-tZrjS11TUiDuEpRaqdk8K9F9xETRyKXfuZKmdeW+Gj7coBnm7+8sBEfyt033EAFEQSlkniAXvBLh+Qja2ioGBQ==} + resolution: {integrity: sha512-tZrjS11TUiDuEpRaqdk8K9F9xETRyKXfuZKmdeW+Gj7coBnm7+8sBEfyt033EAFEQSlkniAXvBLh+Qja2ioGBQ==, tarball: https://registry.npmjs.org/@oxfmt/binding-linux-riscv64-gnu/-/binding-linux-riscv64-gnu-0.47.0.tgz} engines: {node: ^20.19.0 || >=22.12.0} cpu: [riscv64] os: [linux] libc: [glibc] '@oxfmt/binding-linux-riscv64-musl@0.47.0': - resolution: {integrity: sha512-KBFy+2CFKUCZzYwX2ZOPQKck1vjQbz+hextuc19G4r0WRJwadfAeuQMQRQvB+Ivc8brlbOVg7et8K7E467440g==} + resolution: {integrity: sha512-KBFy+2CFKUCZzYwX2ZOPQKck1vjQbz+hextuc19G4r0WRJwadfAeuQMQRQvB+Ivc8brlbOVg7et8K7E467440g==, tarball: https://registry.npmjs.org/@oxfmt/binding-linux-riscv64-musl/-/binding-linux-riscv64-musl-0.47.0.tgz} engines: {node: ^20.19.0 || >=22.12.0} cpu: [riscv64] os: [linux] libc: [musl] '@oxfmt/binding-linux-s390x-gnu@0.47.0': - resolution: {integrity: sha512-REUPFKVGSiK99B+9eaPhluEVglzaoj/SMykNC5SUiV2RSsBfV5lWN7Y0iCIc251Wz3GaeAGZsJ/zj3gjarxdFg==} + resolution: {integrity: sha512-REUPFKVGSiK99B+9eaPhluEVglzaoj/SMykNC5SUiV2RSsBfV5lWN7Y0iCIc251Wz3GaeAGZsJ/zj3gjarxdFg==, tarball: https://registry.npmjs.org/@oxfmt/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-0.47.0.tgz} engines: {node: ^20.19.0 || >=22.12.0} cpu: [s390x] os: [linux] libc: [glibc] '@oxfmt/binding-linux-x64-gnu@0.47.0': - resolution: {integrity: sha512-KVftVSVEDeIfRW3TIeLe3aNI/iY4m1fu5mDwHcisKMZSCMKLkrhFsjowC7o9RoqNPxbbglm2+/6KAKBIts2t0Q==} + resolution: {integrity: sha512-KVftVSVEDeIfRW3TIeLe3aNI/iY4m1fu5mDwHcisKMZSCMKLkrhFsjowC7o9RoqNPxbbglm2+/6KAKBIts2t0Q==, tarball: https://registry.npmjs.org/@oxfmt/binding-linux-x64-gnu/-/binding-linux-x64-gnu-0.47.0.tgz} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [linux] libc: [glibc] '@oxfmt/binding-linux-x64-musl@0.47.0': - resolution: {integrity: sha512-DTsmGEaA2860Aq5VUyDO8/MT9NFxwVL93RnRYmpMwK6DsSkThmvEpqoUDDljziEpAedMRG19SCogrNbINSbLUQ==} + resolution: {integrity: sha512-DTsmGEaA2860Aq5VUyDO8/MT9NFxwVL93RnRYmpMwK6DsSkThmvEpqoUDDljziEpAedMRG19SCogrNbINSbLUQ==, tarball: https://registry.npmjs.org/@oxfmt/binding-linux-x64-musl/-/binding-linux-x64-musl-0.47.0.tgz} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [linux] libc: [musl] '@oxfmt/binding-openharmony-arm64@0.47.0': - resolution: {integrity: sha512-8r5BDro7fLOBoq1JXHLVSs55OlrxQhEso4HVo0TcY7OXJUPYfjPoOaYL5us+yIwqyP9rQwN+rxuiNFSmaxSuOQ==} + resolution: {integrity: sha512-8r5BDro7fLOBoq1JXHLVSs55OlrxQhEso4HVo0TcY7OXJUPYfjPoOaYL5us+yIwqyP9rQwN+rxuiNFSmaxSuOQ==, tarball: https://registry.npmjs.org/@oxfmt/binding-openharmony-arm64/-/binding-openharmony-arm64-0.47.0.tgz} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [openharmony] '@oxfmt/binding-win32-arm64-msvc@0.47.0': - resolution: {integrity: sha512-qtz/gzm8IjSPUlseZ0ofW8zyHLoZsuP5HTfcGGkWkUblB89JT8GNYH3ICqjbDsqsGqXum0/ZndXTFplSdXFIcg==} + resolution: {integrity: sha512-qtz/gzm8IjSPUlseZ0ofW8zyHLoZsuP5HTfcGGkWkUblB89JT8GNYH3ICqjbDsqsGqXum0/ZndXTFplSdXFIcg==, tarball: https://registry.npmjs.org/@oxfmt/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-0.47.0.tgz} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [win32] '@oxfmt/binding-win32-ia32-msvc@0.47.0': - resolution: {integrity: sha512-5vIcdcIDE7nCx+MXN6sm8kbC4zajDB31E86rez4i45iHNH/2NjdKlJ720xcHTr3eeiMcttCGPHPhE1TjtBDGZw==} + resolution: {integrity: sha512-5vIcdcIDE7nCx+MXN6sm8kbC4zajDB31E86rez4i45iHNH/2NjdKlJ720xcHTr3eeiMcttCGPHPhE1TjtBDGZw==, tarball: https://registry.npmjs.org/@oxfmt/binding-win32-ia32-msvc/-/binding-win32-ia32-msvc-0.47.0.tgz} engines: {node: ^20.19.0 || >=22.12.0} cpu: [ia32] os: [win32] '@oxfmt/binding-win32-x64-msvc@0.47.0': - resolution: {integrity: sha512-Sr59Y5ms54ONBjxFeWhVlGyQcHXxcl9DxC23f6yXlRkcos7LXBLoO+KDfxexjHIOZh7cWqrWduzvUjJ+pHp8cQ==} + resolution: {integrity: sha512-Sr59Y5ms54ONBjxFeWhVlGyQcHXxcl9DxC23f6yXlRkcos7LXBLoO+KDfxexjHIOZh7cWqrWduzvUjJ+pHp8cQ==, tarball: https://registry.npmjs.org/@oxfmt/binding-win32-x64-msvc/-/binding-win32-x64-msvc-0.47.0.tgz} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [win32] '@oxlint/binding-android-arm-eabi@1.63.0': - resolution: {integrity: sha512-A9xLtQt7i0OA1PoB/meog6kikXI9CdwEp7ZwQqmgnpKn3G3b1orvTDy8CQ6T7w1HvDrgWGB78PkFKcWgibcTCg==} + resolution: {integrity: sha512-A9xLtQt7i0OA1PoB/meog6kikXI9CdwEp7ZwQqmgnpKn3G3b1orvTDy8CQ6T7w1HvDrgWGB78PkFKcWgibcTCg==, tarball: https://registry.npmjs.org/@oxlint/binding-android-arm-eabi/-/binding-android-arm-eabi-1.63.0.tgz} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm] os: [android] '@oxlint/binding-android-arm64@1.63.0': - resolution: {integrity: sha512-SQo+ZMvdR9l3CxZp5W5gFNxSiDxclY6lOzzNpKYLF8asESpm3Pwumx0gER5T7aHLF1/2BAAtLD3DiDkdgy4V1A==} + resolution: {integrity: sha512-SQo+ZMvdR9l3CxZp5W5gFNxSiDxclY6lOzzNpKYLF8asESpm3Pwumx0gER5T7aHLF1/2BAAtLD3DiDkdgy4V1A==, tarball: https://registry.npmjs.org/@oxlint/binding-android-arm64/-/binding-android-arm64-1.63.0.tgz} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [android] '@oxlint/binding-darwin-arm64@1.63.0': - resolution: {integrity: sha512-6W82XjJDTmMnjg30427l0dufpnyLoq7wEukKdM6/g2VIybRVuQiBVh43EA4b+UxZ3+tLcKm+Or/pXGNgLCEU8g==} + resolution: {integrity: sha512-6W82XjJDTmMnjg30427l0dufpnyLoq7wEukKdM6/g2VIybRVuQiBVh43EA4b+UxZ3+tLcKm+Or/pXGNgLCEU8g==, tarball: https://registry.npmjs.org/@oxlint/binding-darwin-arm64/-/binding-darwin-arm64-1.63.0.tgz} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [darwin] '@oxlint/binding-darwin-x64@1.63.0': - resolution: {integrity: sha512-CnWd/YCuVG5W1BYkjJEVbJG11o526O9qAwBEQM+nh8K19CRFUkFdROXCyYkGmroHEYQe4vgQ6+lh3550Lp35Xw==} + resolution: {integrity: sha512-CnWd/YCuVG5W1BYkjJEVbJG11o526O9qAwBEQM+nh8K19CRFUkFdROXCyYkGmroHEYQe4vgQ6+lh3550Lp35Xw==, tarball: https://registry.npmjs.org/@oxlint/binding-darwin-x64/-/binding-darwin-x64-1.63.0.tgz} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [darwin] '@oxlint/binding-freebsd-x64@1.63.0': - resolution: {integrity: sha512-a4eZAqrmtajqcxfdAzC+l7g3PaE3V8hpAYqqeD3fTxLXOMFdK3eNTZrU80n4dDEVm0JXy1aL5PqvqWldBl6zYA==} + resolution: {integrity: sha512-a4eZAqrmtajqcxfdAzC+l7g3PaE3V8hpAYqqeD3fTxLXOMFdK3eNTZrU80n4dDEVm0JXy1aL5PqvqWldBl6zYA==, tarball: https://registry.npmjs.org/@oxlint/binding-freebsd-x64/-/binding-freebsd-x64-1.63.0.tgz} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [freebsd] '@oxlint/binding-linux-arm-gnueabihf@1.63.0': - resolution: {integrity: sha512-tYUtU9TdbU3uXF5D62g5zXJ13iniFGhXQx5vp9cyEjGdbSAY3VdFBSaldYvyoDmgMZ0ZYuwQP1Y4t2Fhejwa0w==} + resolution: {integrity: sha512-tYUtU9TdbU3uXF5D62g5zXJ13iniFGhXQx5vp9cyEjGdbSAY3VdFBSaldYvyoDmgMZ0ZYuwQP1Y4t2Fhejwa0w==, tarball: https://registry.npmjs.org/@oxlint/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-1.63.0.tgz} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm] os: [linux] '@oxlint/binding-linux-arm-musleabihf@1.63.0': - resolution: {integrity: sha512-I5r3twFf776UZg9dmRo2xbrKt00tTkORXEVe0ctg4vdTkQvJAjiCHxnbAU2HL1AiJ9cqADA76MAliuilsAWnvg==} + resolution: {integrity: sha512-I5r3twFf776UZg9dmRo2xbrKt00tTkORXEVe0ctg4vdTkQvJAjiCHxnbAU2HL1AiJ9cqADA76MAliuilsAWnvg==, tarball: https://registry.npmjs.org/@oxlint/binding-linux-arm-musleabihf/-/binding-linux-arm-musleabihf-1.63.0.tgz} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm] os: [linux] '@oxlint/binding-linux-arm64-gnu@1.63.0': - resolution: {integrity: sha512-t7ltUkg6FFh4b564QyGir8xIj/QZbXu8FlcRkcyW9+ztr/mfRHlvUOFd95pJCXi9s/L5DrUeWWgpXRS+V+6igQ==} + resolution: {integrity: sha512-t7ltUkg6FFh4b564QyGir8xIj/QZbXu8FlcRkcyW9+ztr/mfRHlvUOFd95pJCXi9s/L5DrUeWWgpXRS+V+6igQ==, tarball: https://registry.npmjs.org/@oxlint/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-1.63.0.tgz} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [linux] libc: [glibc] '@oxlint/binding-linux-arm64-musl@1.63.0': - resolution: {integrity: sha512-Q5mmZy/XWjuYFUuQyYjOvZ5U/JkKEwnpir6hGxhh6HcdP0V/BKxLo8dqkfF/t7r7AguB17dfS/8+go5AQDRR6g==} + resolution: {integrity: sha512-Q5mmZy/XWjuYFUuQyYjOvZ5U/JkKEwnpir6hGxhh6HcdP0V/BKxLo8dqkfF/t7r7AguB17dfS/8+go5AQDRR6g==, tarball: https://registry.npmjs.org/@oxlint/binding-linux-arm64-musl/-/binding-linux-arm64-musl-1.63.0.tgz} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [linux] libc: [musl] '@oxlint/binding-linux-ppc64-gnu@1.63.0': - resolution: {integrity: sha512-uBGtuZ0TzLB4x5wVa82HGNvYqY8buwDhyCnCP0R0gkk9szqVsP0MeTtD5HX7EsEuFIt+aYmYxuxeVxs3nTSwtQ==} + resolution: {integrity: sha512-uBGtuZ0TzLB4x5wVa82HGNvYqY8buwDhyCnCP0R0gkk9szqVsP0MeTtD5HX7EsEuFIt+aYmYxuxeVxs3nTSwtQ==, tarball: https://registry.npmjs.org/@oxlint/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-1.63.0.tgz} engines: {node: ^20.19.0 || >=22.12.0} cpu: [ppc64] os: [linux] libc: [glibc] '@oxlint/binding-linux-riscv64-gnu@1.63.0': - resolution: {integrity: sha512-h4s6FwxE+9MeA181o0dnDwHP32Y/bG8EiB/vrD6Ib+AMt6haigDc/0bUtI/sLmQDBMJnUfaCmtSSrEAqjtEVrA==} + resolution: {integrity: sha512-h4s6FwxE+9MeA181o0dnDwHP32Y/bG8EiB/vrD6Ib+AMt6haigDc/0bUtI/sLmQDBMJnUfaCmtSSrEAqjtEVrA==, tarball: https://registry.npmjs.org/@oxlint/binding-linux-riscv64-gnu/-/binding-linux-riscv64-gnu-1.63.0.tgz} engines: {node: ^20.19.0 || >=22.12.0} cpu: [riscv64] os: [linux] libc: [glibc] '@oxlint/binding-linux-riscv64-musl@1.63.0': - resolution: {integrity: sha512-2EaNcCBR8Mcjl5ARtuN3BdEpVkX7KpjSjMGZ/mJMIeaXgTtdz5ytg2VwygMSStA/k0ixfvZFoZOfjDEcouV5vQ==} + resolution: {integrity: sha512-2EaNcCBR8Mcjl5ARtuN3BdEpVkX7KpjSjMGZ/mJMIeaXgTtdz5ytg2VwygMSStA/k0ixfvZFoZOfjDEcouV5vQ==, tarball: https://registry.npmjs.org/@oxlint/binding-linux-riscv64-musl/-/binding-linux-riscv64-musl-1.63.0.tgz} engines: {node: ^20.19.0 || >=22.12.0} cpu: [riscv64] os: [linux] libc: [musl] '@oxlint/binding-linux-s390x-gnu@1.63.0': - resolution: {integrity: sha512-p4hlf/fd7TrYYl3QrWWD0GocqJefwMu3cHQhmi2FvEB/YOvFb5DZN3SMBaPi7B1TM5DeypkEtrVib674q1KKPg==} + resolution: {integrity: sha512-p4hlf/fd7TrYYl3QrWWD0GocqJefwMu3cHQhmi2FvEB/YOvFb5DZN3SMBaPi7B1TM5DeypkEtrVib674q1KKPg==, tarball: https://registry.npmjs.org/@oxlint/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-1.63.0.tgz} engines: {node: ^20.19.0 || >=22.12.0} cpu: [s390x] os: [linux] libc: [glibc] '@oxlint/binding-linux-x64-gnu@1.63.0': - resolution: {integrity: sha512-Vgq9rkRVcPcjbcH+ihYTfpeR7vCXfqpd+z5ItTGc0yYUV59L5ceHYN1iV4H9bKGV7Rn5hkVc7x3mSvHegduENA==} + resolution: {integrity: sha512-Vgq9rkRVcPcjbcH+ihYTfpeR7vCXfqpd+z5ItTGc0yYUV59L5ceHYN1iV4H9bKGV7Rn5hkVc7x3mSvHegduENA==, tarball: https://registry.npmjs.org/@oxlint/binding-linux-x64-gnu/-/binding-linux-x64-gnu-1.63.0.tgz} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [linux] libc: [glibc] '@oxlint/binding-linux-x64-musl@1.63.0': - resolution: {integrity: sha512-3/Lkq/ncooA61rorrC+ZQed1Bc4VpGj+WnGsp58zmxKgvZ2vhreu+dcVyr3mX8NUpq7mfZ4gDDTou/yrF1Pd7A==} + resolution: {integrity: sha512-3/Lkq/ncooA61rorrC+ZQed1Bc4VpGj+WnGsp58zmxKgvZ2vhreu+dcVyr3mX8NUpq7mfZ4gDDTou/yrF1Pd7A==, tarball: https://registry.npmjs.org/@oxlint/binding-linux-x64-musl/-/binding-linux-x64-musl-1.63.0.tgz} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [linux] libc: [musl] '@oxlint/binding-openharmony-arm64@1.63.0': - resolution: {integrity: sha512-0/EdD/6hDkx5Mfd769PTjvEM8mZ/6Dfukp1dBCL/2PjlIVGEtYdNZyok6ChqYPsT9JcFnlQnUeQzO0/1L/oC9w==} + resolution: {integrity: sha512-0/EdD/6hDkx5Mfd769PTjvEM8mZ/6Dfukp1dBCL/2PjlIVGEtYdNZyok6ChqYPsT9JcFnlQnUeQzO0/1L/oC9w==, tarball: https://registry.npmjs.org/@oxlint/binding-openharmony-arm64/-/binding-openharmony-arm64-1.63.0.tgz} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [openharmony] '@oxlint/binding-win32-arm64-msvc@1.63.0': - resolution: {integrity: sha512-wb0CUkN8ngwPiRQBjD1Cj0LsHeNvm+Xt6YBHDMtj2DVQVD6Oj8Ri7g6BD+KICf6LaBqZlmzOvy6nF9E/8yyGOg==} + resolution: {integrity: sha512-wb0CUkN8ngwPiRQBjD1Cj0LsHeNvm+Xt6YBHDMtj2DVQVD6Oj8Ri7g6BD+KICf6LaBqZlmzOvy6nF9E/8yyGOg==, tarball: https://registry.npmjs.org/@oxlint/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.63.0.tgz} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [win32] '@oxlint/binding-win32-ia32-msvc@1.63.0': - resolution: {integrity: sha512-BX5iq+ovdNlVYhSn5qPMUIT0uwAwt2lmEnCnzK+Gkhw4DovIvhGb96OFhV8yzQNUnQxn/xGkOR+X+BLrLDNm8w==} + resolution: {integrity: sha512-BX5iq+ovdNlVYhSn5qPMUIT0uwAwt2lmEnCnzK+Gkhw4DovIvhGb96OFhV8yzQNUnQxn/xGkOR+X+BLrLDNm8w==, tarball: https://registry.npmjs.org/@oxlint/binding-win32-ia32-msvc/-/binding-win32-ia32-msvc-1.63.0.tgz} engines: {node: ^20.19.0 || >=22.12.0} cpu: [ia32] os: [win32] '@oxlint/binding-win32-x64-msvc@1.63.0': - resolution: {integrity: sha512-QeN/WELOfsXMeYwxvfgQrl6CbVftYUCZsGXHjXQd5Trccm8+i4gmtxaOui4xbJQaiDlviF8F3yLSBloQUeFsfA==} + resolution: {integrity: sha512-QeN/WELOfsXMeYwxvfgQrl6CbVftYUCZsGXHjXQd5Trccm8+i4gmtxaOui4xbJQaiDlviF8F3yLSBloQUeFsfA==, tarball: https://registry.npmjs.org/@oxlint/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.63.0.tgz} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [win32] @@ -524,140 +542,140 @@ packages: optional: true '@rollup/rollup-android-arm-eabi@4.60.3': - resolution: {integrity: sha512-x35CNW/ANXG3hE/EZpRU8MXX1JDN86hBb2wMGAtltkz7pc6cxgjpy1OMMfDosOQ+2hWqIkag/fGok1Yady9nGw==} + resolution: {integrity: sha512-x35CNW/ANXG3hE/EZpRU8MXX1JDN86hBb2wMGAtltkz7pc6cxgjpy1OMMfDosOQ+2hWqIkag/fGok1Yady9nGw==, tarball: https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.60.3.tgz} cpu: [arm] os: [android] '@rollup/rollup-android-arm64@4.60.3': - resolution: {integrity: sha512-xw3xtkDApIOGayehp2+Rz4zimfkaX65r4t47iy+ymQB2G4iJCBBfj0ogVg5jpvjpn8UWn/+q9tprxleYeNp3Hw==} + resolution: {integrity: sha512-xw3xtkDApIOGayehp2+Rz4zimfkaX65r4t47iy+ymQB2G4iJCBBfj0ogVg5jpvjpn8UWn/+q9tprxleYeNp3Hw==, tarball: https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.60.3.tgz} cpu: [arm64] os: [android] '@rollup/rollup-darwin-arm64@4.60.3': - resolution: {integrity: sha512-vo6Y5Qfpx7/5EaamIwi0WqW2+zfiusVihKatLvtN1VFVy3D13uERk/6gZLU1UiHRL6fDXqj/ELIeVRGnvcTE1g==} + resolution: {integrity: sha512-vo6Y5Qfpx7/5EaamIwi0WqW2+zfiusVihKatLvtN1VFVy3D13uERk/6gZLU1UiHRL6fDXqj/ELIeVRGnvcTE1g==, tarball: https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.60.3.tgz} cpu: [arm64] os: [darwin] '@rollup/rollup-darwin-x64@4.60.3': - resolution: {integrity: sha512-D+0QGcZhBzTN82weOnsSlY7V7+RMmPuF1CkbxyMAGE8+ZHeUjyb76ZiWmBlCu//AQQONvxcqRbwZTajZKqjuOw==} + resolution: {integrity: sha512-D+0QGcZhBzTN82weOnsSlY7V7+RMmPuF1CkbxyMAGE8+ZHeUjyb76ZiWmBlCu//AQQONvxcqRbwZTajZKqjuOw==, tarball: https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.60.3.tgz} cpu: [x64] os: [darwin] '@rollup/rollup-freebsd-arm64@4.60.3': - resolution: {integrity: sha512-6HnvHCT7fDyj6R0Ph7A6x8dQS/S38MClRWeDLqc0MdfWkxjiu1HSDYrdPhqSILzjTIC/pnXbbJbo+ft+gy/9hQ==} + resolution: {integrity: sha512-6HnvHCT7fDyj6R0Ph7A6x8dQS/S38MClRWeDLqc0MdfWkxjiu1HSDYrdPhqSILzjTIC/pnXbbJbo+ft+gy/9hQ==, tarball: https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.60.3.tgz} cpu: [arm64] os: [freebsd] '@rollup/rollup-freebsd-x64@4.60.3': - resolution: {integrity: sha512-KHLgC3WKlUYW3ShFKnnosZDOJ0xjg9zp7au3sIm2bs/tGBeC2ipmvRh/N7JKi0t9Ue20C0dpEshi8WUubg+cnA==} + resolution: {integrity: sha512-KHLgC3WKlUYW3ShFKnnosZDOJ0xjg9zp7au3sIm2bs/tGBeC2ipmvRh/N7JKi0t9Ue20C0dpEshi8WUubg+cnA==, tarball: https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.60.3.tgz} cpu: [x64] os: [freebsd] '@rollup/rollup-linux-arm-gnueabihf@4.60.3': - resolution: {integrity: sha512-DV6fJoxEYWJOvaZIsok7KrYl0tPvga5OZ2yvKHNNYyk/2roMLqQAbGhr78EQ5YhHpnhLKJD3S1WFusAkmUuV5g==} + resolution: {integrity: sha512-DV6fJoxEYWJOvaZIsok7KrYl0tPvga5OZ2yvKHNNYyk/2roMLqQAbGhr78EQ5YhHpnhLKJD3S1WFusAkmUuV5g==, tarball: https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.60.3.tgz} cpu: [arm] os: [linux] libc: [glibc] '@rollup/rollup-linux-arm-musleabihf@4.60.3': - resolution: {integrity: sha512-mQKoJAzvuOs6F+TZybQO4GOTSMUu7v0WdxEk24krQ/uUxXoPTtHjuaUuPmFhtBcM4K0ons8nrE3JyhTuCFtT/w==} + resolution: {integrity: sha512-mQKoJAzvuOs6F+TZybQO4GOTSMUu7v0WdxEk24krQ/uUxXoPTtHjuaUuPmFhtBcM4K0ons8nrE3JyhTuCFtT/w==, tarball: https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.60.3.tgz} cpu: [arm] os: [linux] libc: [musl] '@rollup/rollup-linux-arm64-gnu@4.60.3': - resolution: {integrity: sha512-Whjj2qoiJ6+OOJMGptTYazaJvjOJm+iKHpXQM1P3LzGjt7Ff++Tp7nH4N8J/BUA7R9IHfDyx4DJIflifwnbmIA==} + resolution: {integrity: sha512-Whjj2qoiJ6+OOJMGptTYazaJvjOJm+iKHpXQM1P3LzGjt7Ff++Tp7nH4N8J/BUA7R9IHfDyx4DJIflifwnbmIA==, tarball: https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.60.3.tgz} cpu: [arm64] os: [linux] libc: [glibc] '@rollup/rollup-linux-arm64-musl@4.60.3': - resolution: {integrity: sha512-4YTNHKqGng5+yiZt3mg77nmyuCfmNfX4fPmyUapBcIk+BdwSwmCWGXOUxhXbBEkFHtoN5boLj/5NON+u5QC9tg==} + resolution: {integrity: sha512-4YTNHKqGng5+yiZt3mg77nmyuCfmNfX4fPmyUapBcIk+BdwSwmCWGXOUxhXbBEkFHtoN5boLj/5NON+u5QC9tg==, tarball: https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.60.3.tgz} cpu: [arm64] os: [linux] libc: [musl] '@rollup/rollup-linux-loong64-gnu@4.60.3': - resolution: {integrity: sha512-SU3kNlhkpI4UqlUc2VXPGK9o886ZsSeGfMAX2ba2b8DKmMXq4AL7KUrkSWVbb7koVqx41Yczx6dx5PNargIrEA==} + resolution: {integrity: sha512-SU3kNlhkpI4UqlUc2VXPGK9o886ZsSeGfMAX2ba2b8DKmMXq4AL7KUrkSWVbb7koVqx41Yczx6dx5PNargIrEA==, tarball: https://registry.npmjs.org/@rollup/rollup-linux-loong64-gnu/-/rollup-linux-loong64-gnu-4.60.3.tgz} cpu: [loong64] os: [linux] libc: [glibc] '@rollup/rollup-linux-loong64-musl@4.60.3': - resolution: {integrity: sha512-6lDLl5h4TXpB1mTf2rQWnAk/LcXrx9vBfu/DT5TIPhvMhRWaZ5MxkIc8u4lJAmBo6klTe1ywXIUHFjylW505sg==} + resolution: {integrity: sha512-6lDLl5h4TXpB1mTf2rQWnAk/LcXrx9vBfu/DT5TIPhvMhRWaZ5MxkIc8u4lJAmBo6klTe1ywXIUHFjylW505sg==, tarball: https://registry.npmjs.org/@rollup/rollup-linux-loong64-musl/-/rollup-linux-loong64-musl-4.60.3.tgz} cpu: [loong64] os: [linux] libc: [musl] '@rollup/rollup-linux-ppc64-gnu@4.60.3': - resolution: {integrity: sha512-BMo8bOw8evlup/8G+cj5xWtPyp93xPdyoSN16Zy90Q2QZ0ZYRhCt6ZJSwbrRzG9HApFabjwj2p25TUPDWrhzqQ==} + resolution: {integrity: sha512-BMo8bOw8evlup/8G+cj5xWtPyp93xPdyoSN16Zy90Q2QZ0ZYRhCt6ZJSwbrRzG9HApFabjwj2p25TUPDWrhzqQ==, tarball: https://registry.npmjs.org/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.60.3.tgz} cpu: [ppc64] os: [linux] libc: [glibc] '@rollup/rollup-linux-ppc64-musl@4.60.3': - resolution: {integrity: sha512-E0L8X1dZN1/Rph+5VPF6Xj2G7JJvMACVXtamTJIDrVI44Y3K+G8gQaMEAavbqCGTa16InptiVrX6eM6pmJ+7qA==} + resolution: {integrity: sha512-E0L8X1dZN1/Rph+5VPF6Xj2G7JJvMACVXtamTJIDrVI44Y3K+G8gQaMEAavbqCGTa16InptiVrX6eM6pmJ+7qA==, tarball: https://registry.npmjs.org/@rollup/rollup-linux-ppc64-musl/-/rollup-linux-ppc64-musl-4.60.3.tgz} cpu: [ppc64] os: [linux] libc: [musl] '@rollup/rollup-linux-riscv64-gnu@4.60.3': - resolution: {integrity: sha512-oZJ/WHaVfHUiRAtmTAeo3DcevNsVvH8mbvodjZy7D5QKvCefO371SiKRpxoDcCxB3PTRTLayWBkvmDQKTcX/sw==} + resolution: {integrity: sha512-oZJ/WHaVfHUiRAtmTAeo3DcevNsVvH8mbvodjZy7D5QKvCefO371SiKRpxoDcCxB3PTRTLayWBkvmDQKTcX/sw==, tarball: https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.60.3.tgz} cpu: [riscv64] os: [linux] libc: [glibc] '@rollup/rollup-linux-riscv64-musl@4.60.3': - resolution: {integrity: sha512-Dhbyh7j9FybM3YaTgaHmVALwA8AkUwTPccyCQ79TG9AJUsMQqgN1DDEZNr4+QUfwiWvLDumW5vdwzoeUF+TNxQ==} + resolution: {integrity: sha512-Dhbyh7j9FybM3YaTgaHmVALwA8AkUwTPccyCQ79TG9AJUsMQqgN1DDEZNr4+QUfwiWvLDumW5vdwzoeUF+TNxQ==, tarball: https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.60.3.tgz} cpu: [riscv64] os: [linux] libc: [musl] '@rollup/rollup-linux-s390x-gnu@4.60.3': - resolution: {integrity: sha512-cJd1X5XhHHlltkaypz1UcWLA8AcoIi1aWhsvaWDskD1oz2eKCypnqvTQ8ykMNI0RSmm7NkTdSqSSD7zM0xa6Ig==} + resolution: {integrity: sha512-cJd1X5XhHHlltkaypz1UcWLA8AcoIi1aWhsvaWDskD1oz2eKCypnqvTQ8ykMNI0RSmm7NkTdSqSSD7zM0xa6Ig==, tarball: https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.60.3.tgz} cpu: [s390x] os: [linux] libc: [glibc] '@rollup/rollup-linux-x64-gnu@4.60.3': - resolution: {integrity: sha512-DAZDBHQfG2oQuhY7mc6I3/qB4LU2fQCjRvxbDwd/Jdvb9fypP4IJ4qmtu6lNjes6B531AI8cg1aKC2di97bUxA==} + resolution: {integrity: sha512-DAZDBHQfG2oQuhY7mc6I3/qB4LU2fQCjRvxbDwd/Jdvb9fypP4IJ4qmtu6lNjes6B531AI8cg1aKC2di97bUxA==, tarball: https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.60.3.tgz} cpu: [x64] os: [linux] libc: [glibc] '@rollup/rollup-linux-x64-musl@4.60.3': - resolution: {integrity: sha512-cRxsE8c13mZOh3vP+wLDxpQBRrOHDIGOWyDL93Sy0Ga8y515fBcC2pjUfFwUe5T7tqvTvWbCpg1URM/AXdWIXA==} + resolution: {integrity: sha512-cRxsE8c13mZOh3vP+wLDxpQBRrOHDIGOWyDL93Sy0Ga8y515fBcC2pjUfFwUe5T7tqvTvWbCpg1URM/AXdWIXA==, tarball: https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.60.3.tgz} cpu: [x64] os: [linux] libc: [musl] '@rollup/rollup-openbsd-x64@4.60.3': - resolution: {integrity: sha512-QaWcIgRxqEdQdhJqW4DJctsH6HCmo5vHxY0krHSX4jMtOqfzC+dqDGuHM87bu4H8JBeibWx7jFz+h6/4C8wA5Q==} + resolution: {integrity: sha512-QaWcIgRxqEdQdhJqW4DJctsH6HCmo5vHxY0krHSX4jMtOqfzC+dqDGuHM87bu4H8JBeibWx7jFz+h6/4C8wA5Q==, tarball: https://registry.npmjs.org/@rollup/rollup-openbsd-x64/-/rollup-openbsd-x64-4.60.3.tgz} cpu: [x64] os: [openbsd] '@rollup/rollup-openharmony-arm64@4.60.3': - resolution: {integrity: sha512-AaXwSvUi3QIPtroAUw1t5yHGIyqKEXwH54WUocFolZhpGDruJcs8c+xPNDRn4XiQsS7MEwnYsHW2l0MBLDMkWg==} + resolution: {integrity: sha512-AaXwSvUi3QIPtroAUw1t5yHGIyqKEXwH54WUocFolZhpGDruJcs8c+xPNDRn4XiQsS7MEwnYsHW2l0MBLDMkWg==, tarball: https://registry.npmjs.org/@rollup/rollup-openharmony-arm64/-/rollup-openharmony-arm64-4.60.3.tgz} cpu: [arm64] os: [openharmony] '@rollup/rollup-win32-arm64-msvc@4.60.3': - resolution: {integrity: sha512-65LAKM/bAWDqKNEelHlcHvm2V+Vfb8C6INFxQXRHCvaVN1rJfwr4NvdP4FyzUaLqWfaCGaadf6UbTm8xJeYfEg==} + resolution: {integrity: sha512-65LAKM/bAWDqKNEelHlcHvm2V+Vfb8C6INFxQXRHCvaVN1rJfwr4NvdP4FyzUaLqWfaCGaadf6UbTm8xJeYfEg==, tarball: https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.60.3.tgz} cpu: [arm64] os: [win32] '@rollup/rollup-win32-ia32-msvc@4.60.3': - resolution: {integrity: sha512-EEM2gyhBF5MFnI6vMKdX1LAosE627RGBzIoGMdLloPZkXrUN0Ckqgr2Qi8+J3zip/8NVVro3/FjB+tjhZUgUHA==} + resolution: {integrity: sha512-EEM2gyhBF5MFnI6vMKdX1LAosE627RGBzIoGMdLloPZkXrUN0Ckqgr2Qi8+J3zip/8NVVro3/FjB+tjhZUgUHA==, tarball: https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.60.3.tgz} cpu: [ia32] os: [win32] '@rollup/rollup-win32-x64-gnu@4.60.3': - resolution: {integrity: sha512-E5Eb5H/DpxaoXH++Qkv28RcUJboMopmdDUALBczvHMf7hNIxaDZqwY5lK12UK1BHacSmvupoEWGu+n993Z0y1A==} + resolution: {integrity: sha512-E5Eb5H/DpxaoXH++Qkv28RcUJboMopmdDUALBczvHMf7hNIxaDZqwY5lK12UK1BHacSmvupoEWGu+n993Z0y1A==, tarball: https://registry.npmjs.org/@rollup/rollup-win32-x64-gnu/-/rollup-win32-x64-gnu-4.60.3.tgz} cpu: [x64] os: [win32] '@rollup/rollup-win32-x64-msvc@4.60.3': - resolution: {integrity: sha512-hPt/bgL5cE+Qp+/TPHBqptcAgPzgj46mPcg/16zNUmbQk0j+mOEQV/+Lqu8QRtDV3Ek95Q6FeFITpuhl6OTsAA==} + resolution: {integrity: sha512-hPt/bgL5cE+Qp+/TPHBqptcAgPzgj46mPcg/16zNUmbQk0j+mOEQV/+Lqu8QRtDV3Ek95Q6FeFITpuhl6OTsAA==, tarball: https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.60.3.tgz} cpu: [x64] os: [win32] @@ -784,55 +802,55 @@ packages: engines: {node: '>=10.0.0'} '@xn-sakina/rml-darwin-arm64@2.8.0': - resolution: {integrity: sha512-B8XpWn/t3vALCePi8DnbHQWVQnmKybwPIKbfzL1L75w2V/ELXn0OguFayujf2eZdmCIBPC+Drqxztn6fDV08Ww==} + resolution: {integrity: sha512-B8XpWn/t3vALCePi8DnbHQWVQnmKybwPIKbfzL1L75w2V/ELXn0OguFayujf2eZdmCIBPC+Drqxztn6fDV08Ww==, tarball: https://registry.npmjs.org/@xn-sakina/rml-darwin-arm64/-/rml-darwin-arm64-2.8.0.tgz} engines: {node: '>=14'} cpu: [arm64] os: [darwin] '@xn-sakina/rml-darwin-x64@2.8.0': - resolution: {integrity: sha512-02UG6vhkzoTgQwkPJH8cnz7Pmqs0BChv4dq13pYqUtSSJr9BgPkSA5U8lXXmD76HpUOdN1ZH4K1jr2NOhwbPCw==} + resolution: {integrity: sha512-02UG6vhkzoTgQwkPJH8cnz7Pmqs0BChv4dq13pYqUtSSJr9BgPkSA5U8lXXmD76HpUOdN1ZH4K1jr2NOhwbPCw==, tarball: https://registry.npmjs.org/@xn-sakina/rml-darwin-x64/-/rml-darwin-x64-2.8.0.tgz} engines: {node: '>=14'} cpu: [x64] os: [darwin] '@xn-sakina/rml-linux-arm-gnueabihf@2.8.0': - resolution: {integrity: sha512-T2S2aGm7mcyIUxkMAni+ClgWp4G8zDe6eApQRNK77G6D/6m25YDrMn+YmVs3TJOA9Qi4RoNaztihni6+B+IOHQ==} + resolution: {integrity: sha512-T2S2aGm7mcyIUxkMAni+ClgWp4G8zDe6eApQRNK77G6D/6m25YDrMn+YmVs3TJOA9Qi4RoNaztihni6+B+IOHQ==, tarball: https://registry.npmjs.org/@xn-sakina/rml-linux-arm-gnueabihf/-/rml-linux-arm-gnueabihf-2.8.0.tgz} engines: {node: '>=14'} cpu: [arm] os: [linux] '@xn-sakina/rml-linux-arm64-gnu@2.8.0': - resolution: {integrity: sha512-Vr9lz9vCXXDHaOzAChoxgPeCFn2vTLsZjmxJFBXXcUyN2ixoZacreHE2aro/XdOuX5yNClsIWsTrkZoBY3kAEw==} + resolution: {integrity: sha512-Vr9lz9vCXXDHaOzAChoxgPeCFn2vTLsZjmxJFBXXcUyN2ixoZacreHE2aro/XdOuX5yNClsIWsTrkZoBY3kAEw==, tarball: https://registry.npmjs.org/@xn-sakina/rml-linux-arm64-gnu/-/rml-linux-arm64-gnu-2.8.0.tgz} engines: {node: '>=14'} cpu: [arm64] os: [linux] '@xn-sakina/rml-linux-arm64-musl@2.8.0': - resolution: {integrity: sha512-GFDdj1+bzMwoyPhybM83f4aDrLLROYHVcC1+xHNa/zaRp/CI4j66fQwvw1YrTgs+Vk6ZLCm+HtKlA/BO8B9NjQ==} + resolution: {integrity: sha512-GFDdj1+bzMwoyPhybM83f4aDrLLROYHVcC1+xHNa/zaRp/CI4j66fQwvw1YrTgs+Vk6ZLCm+HtKlA/BO8B9NjQ==, tarball: https://registry.npmjs.org/@xn-sakina/rml-linux-arm64-musl/-/rml-linux-arm64-musl-2.8.0.tgz} engines: {node: '>=14'} cpu: [arm64] os: [linux] '@xn-sakina/rml-linux-x64-gnu@2.8.0': - resolution: {integrity: sha512-2Lha6vIfI5pdIE2Odqovs9KHuJT8S7ql313pYXhUjsxi+da965kLfK1xk0dWs9eo6aEFp4+9Ny+XIIjG2agDZw==} + resolution: {integrity: sha512-2Lha6vIfI5pdIE2Odqovs9KHuJT8S7ql313pYXhUjsxi+da965kLfK1xk0dWs9eo6aEFp4+9Ny+XIIjG2agDZw==, tarball: https://registry.npmjs.org/@xn-sakina/rml-linux-x64-gnu/-/rml-linux-x64-gnu-2.8.0.tgz} engines: {node: '>=14'} cpu: [x64] os: [linux] '@xn-sakina/rml-linux-x64-musl@2.8.0': - resolution: {integrity: sha512-F2/JCzyqOEfFe62WbSf+4/rcK7pyjYpABGmopUJon5GSUVGXRVQOfkkqg6ceufw1ipQUCWsU3Cj0vmd0yvzkmg==} + resolution: {integrity: sha512-F2/JCzyqOEfFe62WbSf+4/rcK7pyjYpABGmopUJon5GSUVGXRVQOfkkqg6ceufw1ipQUCWsU3Cj0vmd0yvzkmg==, tarball: https://registry.npmjs.org/@xn-sakina/rml-linux-x64-musl/-/rml-linux-x64-musl-2.8.0.tgz} engines: {node: '>=14'} cpu: [x64] os: [linux] '@xn-sakina/rml-win32-arm64-msvc@2.8.0': - resolution: {integrity: sha512-ikmzMj9OwRMMtFmE7D4aSi1K1G8C350orJz9ngLTj39p7l0NQeXQfQ0SOah5RQSNWV00XJriJBzVHkWS701xeA==} + resolution: {integrity: sha512-ikmzMj9OwRMMtFmE7D4aSi1K1G8C350orJz9ngLTj39p7l0NQeXQfQ0SOah5RQSNWV00XJriJBzVHkWS701xeA==, tarball: https://registry.npmjs.org/@xn-sakina/rml-win32-arm64-msvc/-/rml-win32-arm64-msvc-2.8.0.tgz} engines: {node: '>=14'} cpu: [arm64] os: [win32] '@xn-sakina/rml-win32-x64-msvc@2.8.0': - resolution: {integrity: sha512-xeyoBIfccb7prfiUVLv0K+1HlLT4vnDfXHSkLpsp4wI0LtYR7sYbiGaMVgNdgR2nDHC+W+65inUHvhY5m7pbnw==} + resolution: {integrity: sha512-xeyoBIfccb7prfiUVLv0K+1HlLT4vnDfXHSkLpsp4wI0LtYR7sYbiGaMVgNdgR2nDHC+W+65inUHvhY5m7pbnw==, tarball: https://registry.npmjs.org/@xn-sakina/rml-win32-x64-msvc/-/rml-win32-x64-msvc-2.8.0.tgz} engines: {node: '>=14'} cpu: [x64] os: [win32] @@ -1034,7 +1052,7 @@ packages: engines: {node: '>=14.14'} fsevents@2.3.3: - resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==} + resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==, tarball: https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz} engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} os: [darwin] @@ -1497,6 +1515,8 @@ snapshots: dependencies: '@babel/types': 7.29.7 + '@babel/runtime@7.29.7': {} + '@babel/types@7.29.7': dependencies: '@babel/helper-string-parser': 7.29.7 diff --git a/platforms/web/pnpm-workspace.yaml b/platforms/web/pnpm-workspace.yaml new file mode 100644 index 00000000..a9fd8205 --- /dev/null +++ b/platforms/web/pnpm-workspace.yaml @@ -0,0 +1,2 @@ +packages: + - '../../protocol/languages/typescript' diff --git a/platforms/web/src/checkout.test.ts b/platforms/web/src/checkout.test.ts index e392748e..ee36a87c 100644 --- a/platforms/web/src/checkout.test.ts +++ b/platforms/web/src/checkout.test.ts @@ -1,7 +1,7 @@ import { afterEach, describe, expect, it, vi } from "vitest"; import type { Checkout, CheckoutProtocolMessageMap, UcpErrorResponse } from "./checkout.types"; -import type { CheckoutMessageError } from "./ucp-embed-types"; +import type { CheckoutMessageError } from "@shopify/checkout-kit-protocol/web"; import "./checkout-web-component"; import { DEFAULT_POPUP_WIDTH, diff --git a/platforms/web/src/checkout.types.ts b/platforms/web/src/checkout.types.ts index e2a88889..3a6a171e 100644 --- a/platforms/web/src/checkout.types.ts +++ b/platforms/web/src/checkout.types.ts @@ -1,5 +1,6 @@ -// Types for this component are derived from the 2026-04-08 UCP embedded -// checkout protocol. Embed payload shapes live in `./ucp-embed-types.ts`. +// Types for this component are derived from the UCP embedded checkout +// protocol. Wire payload shapes are generated from the canonical JSON schemas +// in `@shopify/checkout-kit-protocol/web`. import type { Buyer, @@ -10,7 +11,7 @@ import type { OrderConfirmation, Total, UcpErrorResponse, -} from "./ucp-embed-types"; +} from "@shopify/checkout-kit-protocol/web"; // This component should follow the custom element conventions set out here: // https://github.com/Shopify/ui-api-design/tree/main/codex. In particular, @@ -262,4 +263,4 @@ export type { OrderConfirmation, Total, UcpErrorResponse, -} from "./ucp-embed-types"; +} from "@shopify/checkout-kit-protocol/web"; diff --git a/platforms/web/src/ucp-embed-types.ts b/platforms/web/src/ucp-embed-types.ts deleted file mode 100644 index 65d93ae6..00000000 --- a/platforms/web/src/ucp-embed-types.ts +++ /dev/null @@ -1,350 +0,0 @@ -/** - * UCP embedded-checkout wire payloads (`ec.*`, `checkout` resource, `ec.error`). - * Consolidated from checkout-web embed mapper / proposal-style shapes (2026-04-08). - */ - -// --- shared.ts (subset used by 2026-04-08 Checkout + EcReadyParams + messages) --- - -export type CheckoutStatus = - | "incomplete" - | "requires_escalation" - | "ready_for_complete" - | "complete_in_progress" - | "completed" - | "canceled"; - -export type TotalType = - | "items_discount" - | "subtotal" - | "discount" - | "fulfillment" - | "tax" - | "fee" - | "total"; - -export interface Total { - readonly type: TotalType; - readonly display_text?: string; - readonly amount: number; -} - -export interface CheckoutLineItemItem { - readonly id: string; - readonly title: string; - readonly price: number; - readonly image_url?: string; - readonly [key: string]: unknown; -} - -export interface CheckoutLineItem { - readonly id: string; - readonly item: CheckoutLineItemItem; - readonly quantity: number; - readonly totals: readonly Total[]; - readonly parent_id?: string; - readonly [key: string]: unknown; -} - -export type MessageContentType = "plain" | "markdown"; - -export type CheckoutMessageSeverity = - | "recoverable" - | "requires_buyer_input" - | "requires_buyer_review" - | "unrecoverable"; - -export interface CheckoutMessageError { - readonly type: "error"; - readonly code: string; - readonly path?: string; - readonly content: string; - readonly content_type?: MessageContentType; - readonly severity: CheckoutMessageSeverity; - readonly [key: string]: unknown; -} - -export interface CheckoutMessageWarning { - readonly type: "warning"; - readonly code: string; - readonly path?: string; - readonly content: string; - readonly content_type?: MessageContentType; - readonly [key: string]: unknown; -} - -export interface CheckoutMessageInfo { - readonly type: "info"; - readonly path?: string; - readonly code?: string; - readonly content: string; - readonly content_type?: MessageContentType; - readonly [key: string]: unknown; -} - -/** Resource-level messages on checkout (not the same as session `ec.error`). */ -export type CheckoutMessage = CheckoutMessageError | CheckoutMessageWarning | CheckoutMessageInfo; - -export type CheckoutLinkType = - | "privacy_policy" - | "terms_of_service" - | "refund_policy" - | "shipping_policy" - | "faq" - | (string & {}); - -export interface CheckoutLink { - readonly type: CheckoutLinkType; - readonly url: string; - readonly title?: string; - readonly [key: string]: unknown; -} - -export interface DiscountAllocation { - readonly path: string; - readonly amount: number; -} - -export interface AppliedDiscount { - readonly title: string; - readonly amount: number; - readonly code?: string; - readonly automatic?: boolean; - readonly method?: "each" | "across"; - readonly priority?: number; - readonly provisional?: boolean; - readonly eligibility?: string; - readonly allocations?: readonly DiscountAllocation[]; -} - -export interface CheckoutDiscounts { - readonly codes?: readonly string[]; - readonly applied?: readonly AppliedDiscount[]; -} - -export type FulfillmentMethodType = "shipping" | "pickup"; - -export interface FulfillmentOption { - readonly id: string; - readonly title: string; - readonly description?: string; - readonly carrier?: string; - readonly earliest_fulfillment_time?: string; - readonly latest_fulfillment_time?: string; - readonly totals: readonly Total[]; - readonly [key: string]: unknown; -} - -export interface FulfillmentGroup { - readonly id: string; - readonly line_item_ids: readonly string[]; - readonly options?: readonly FulfillmentOption[]; - readonly selected_option_id?: string; - readonly [key: string]: unknown; -} - -export interface FulfillmentAvailableMethod { - readonly type: FulfillmentMethodType; - readonly line_item_ids: readonly string[]; - readonly fulfillable_on: string | null; - readonly description?: string; - readonly [key: string]: unknown; -} - -/** `ec.ready` request params (handshake). */ -export interface EcReadyParams { - readonly delegate: readonly string[]; - readonly [key: string]: unknown; -} - -/** Populated on completed checkout (`checkout.order`). */ -export interface OrderConfirmation { - readonly id: string; - readonly permalink_url: string; - readonly [key: string]: unknown; -} - -// --- embed.ts (UcpPaymentRedemption only — rest is from mapper files) --- - -export interface UcpPaymentRedemption { - readonly source: string; - readonly amount: number; - readonly [key: string]: unknown; -} - -// --- proposal/types.ts (minimal payment + address for Payment + destinations) --- - -export interface UcpPostalAddress { - readonly extended_address?: string; - readonly street_address?: string; - readonly address_locality?: string; - readonly address_region?: string; - readonly address_country?: string; - readonly postal_code?: string; - readonly first_name?: string; - readonly last_name?: string; - readonly phone_number?: string; - readonly [key: string]: unknown; -} - -export interface UcpPaymentInstrumentDisplay { - readonly brand?: string; - readonly last_digits?: string; - readonly description?: string; - readonly card_art?: string; - readonly [key: string]: unknown; -} - -export type PaymentInstrument = UcpPaymentInstrument; - -export interface UcpPaymentInstrument { - readonly id: string; - readonly handler_id: string; - readonly type: string; - readonly selected?: boolean; - readonly display?: UcpPaymentInstrumentDisplay; - readonly cardholder_name?: string; - readonly expiry_month?: number; - readonly expiry_year?: number; - readonly credential?: Readonly>; - readonly billing_address?: UcpPostalAddress; - readonly [key: string]: unknown; -} - -// --- shared.ts: UcpMetadata base + service/capability (for checkout.ucp) --- - -export interface UcpPaymentHandler { - readonly id: string; - readonly name: string; - readonly version: string; - readonly spec?: string; - readonly schema?: string; - readonly config?: Readonly>; - readonly [key: string]: unknown; -} - -export interface UcpService { - readonly version: string; - readonly transport: "embedded"; - readonly schema?: string; - readonly endpoint?: string; - readonly config?: Readonly>; - readonly [key: string]: unknown; -} - -export interface UcpCapability { - readonly version: string; - readonly extends?: string | readonly string[]; - readonly spec?: string; - readonly schema?: string; - readonly config?: Readonly>; - readonly [key: string]: unknown; -} - -/** Base metadata (2026-01-23 legacy + 2026-04-08 services). */ -export interface UcpMetadataBase { - readonly version: string; - readonly transports?: { - readonly embedded: { - readonly schema: string; - readonly delegations: readonly string[]; - }; - }; - readonly services?: Readonly>; - readonly payment_handlers?: Readonly>; - readonly [key: string]: unknown; -} - -/** 2026-04-08: adds required `capabilities` registry. */ -export interface UcpMetadata extends UcpMetadataBase { - readonly capabilities: Readonly>; -} - -// --- 2026-04-08.ts (Checkout, ShopCash, UcpErrorResponse) --- - -export interface Buyer { - readonly email?: string; - readonly phone_number?: string; - readonly first_name?: string; - readonly last_name?: string; - readonly [key: string]: unknown; -} - -export interface Payment { - readonly instruments?: readonly PaymentInstrument[]; - readonly [key: string]: unknown; -} - -export interface ShippingDestination extends UcpPostalAddress { - readonly id: string; -} - -export interface RetailLocation { - readonly id: string; - readonly name: string; - readonly address?: UcpPostalAddress; - readonly [key: string]: unknown; -} - -export type FulfillmentDestination = ShippingDestination | RetailLocation; - -export interface FulfillmentMethod { - readonly id: string; - readonly type: FulfillmentMethodType; - readonly line_item_ids: readonly string[]; - readonly selected_destination_id?: string; - readonly destinations?: readonly FulfillmentDestination[]; - readonly groups?: readonly FulfillmentGroup[]; - readonly [key: string]: unknown; -} - -export interface Fulfillment { - readonly methods: readonly FulfillmentMethod[]; - readonly available_methods?: readonly FulfillmentAvailableMethod[]; - readonly [key: string]: unknown; -} - -/** Wire `checkout` object in `ec.*` notifications carrying full resource. */ -export interface Checkout { - readonly ucp: UcpMetadata; - readonly id: string; - readonly currency: string; - readonly line_items: readonly CheckoutLineItem[]; - readonly totals: readonly Total[]; - readonly buyer?: Buyer; - readonly payment?: Payment; - readonly status: CheckoutStatus; - readonly messages?: readonly CheckoutMessage[]; - readonly links: readonly CheckoutLink[]; - readonly continue_url?: string; - readonly expires_at?: string; - readonly fulfillment?: Fulfillment; - readonly order?: OrderConfirmation; - readonly redemptions?: readonly UcpPaymentRedemption[]; - readonly discounts?: CheckoutDiscounts; - readonly [key: string]: unknown; -} - -export interface ShopCash { - readonly balance: { - readonly status: "unavailable" | "pending" | "filled"; - readonly available_balance?: number; - }; - readonly expected_earnings?: number; -} - -export interface UcpEnvelope { - readonly version: string; - readonly status: "success" | "error"; - readonly [key: string]: unknown; -} - -export type UcpSuccessEnvelope = UcpEnvelope & { readonly status: "success" }; -export type UcpErrorEnvelope = UcpEnvelope & { readonly status: "error" }; - -/** Session-level fatal `ec.error` params / delegation error branch. */ -export interface UcpErrorResponse { - readonly ucp: UcpErrorEnvelope; - readonly messages: readonly CheckoutMessageError[]; - readonly continue_url?: string; - readonly [key: string]: unknown; -} diff --git a/protocol/languages/typescript/package.json b/protocol/languages/typescript/package.json index feb5b05c..60e841c2 100644 --- a/protocol/languages/typescript/package.json +++ b/protocol/languages/typescript/package.json @@ -7,8 +7,20 @@ "main": "src/index.ts", "react-native": "src/index.ts", "types": "src/index.d.ts", + "exports": { + ".": { + "types": "./src/index.d.ts", + "react-native": "./src/index.ts", + "default": "./src/index.ts" + }, + "./web": { + "types": "./src/web.d.ts", + "default": "./src/web.ts" + } + }, "scripts": { "codegen": "../../scripts/generate_models.sh --lang typescript", + "codegen:typescript-ucp": "../../scripts/generate_models.sh --lang typescript-ucp", "typecheck": "tsc --noEmit" }, "files": [ diff --git a/protocol/languages/typescript/src/generated/WebModels.d.ts b/protocol/languages/typescript/src/generated/WebModels.d.ts new file mode 100644 index 00000000..2e3337ca --- /dev/null +++ b/protocol/languages/typescript/src/generated/WebModels.d.ts @@ -0,0 +1,1603 @@ +export type UCPMetadata = any; +export type UCPService = any; +export type UCPCapability = any; +export type PaymentHandler = any; +/** + * Base checkout schema. Extensions compose onto this using allOf. + */ +export interface Checkout { + attribution?: { + [key: string]: string; + }; + /** + * Representation of the buyer. + */ + buyer?: Buyer; + context?: Context; + /** + * URL for checkout handoff and session recovery. MUST be provided when status is + * requires_escalation. See specification for format and availability requirements. + */ + continue_url?: string; + /** + * ISO 4217 currency code reflecting the merchant's market determination. Derived from + * address, context, and geo IP—buyers provide signals, merchants determine currency. + */ + currency: string; + discounts?: CheckoutDiscounts; + /** + * RFC 3339 expiry timestamp. Default TTL is 6 hours from creation if not sent. + */ + expires_at?: string; + /** + * Fulfillment details. + */ + fulfillment?: CheckoutFulfillment; + /** + * Unique identifier of the checkout session. + */ + id: string; + /** + * List of line items being checked out. + */ + line_items: CheckoutLineItem[]; + /** + * Links to be displayed by the platform (Privacy Policy, TOS). Mandatory for legal + * compliance. + */ + links: Link[]; + /** + * List of messages with error and info about the checkout session state. + */ + messages?: CheckoutMessage[]; + /** + * Details about an order created for this checkout session. + */ + order?: OrderConfirmation; + payment?: Payment; + signals?: Signals; + /** + * Checkout state indicating the current phase and required action. See Checkout Status + * lifecycle documentation for state transition details. + */ + status: CheckoutStatus; + /** + * Different cart totals. + */ + totals: Total[]; + ucp: UcpMetadata; + [property: string]: any; +} +/** + * Representation of the buyer. + */ +export interface Buyer { + /** + * Email of the buyer. + */ + email?: string; + /** + * First name of the buyer. + */ + first_name?: string; + /** + * Last name of the buyer. + */ + last_name?: string; + /** + * E.164 standard. + */ + phone_number?: string; + [property: string]: any; +} +/** + * Provisional buyer signals for relevance and localization—not authoritative data. + * Businesses SHOULD use these values when verified inputs (e.g., shipping address) are + * absent, and MAY ignore or down-rank them if inconsistent with higher-confidence signals + * (authenticated account, risk detection) or regulatory constraints (export controls). + * Eligibility and policy enforcement MUST occur at checkout time using binding transaction + * data. Context SHOULD be non-identifying and can be disclosed progressively—coarse signals + * early, finer resolution as the session progresses. Higher-resolution data (shipping + * address, billing address) supersedes context. + */ +export interface Context { + /** + * The country. Recommended to be in 2-letter ISO 3166-1 alpha-2 format, for example "US". + * For backward compatibility, a 3-letter ISO 3166-1 alpha-3 country code such as "SGP" or a + * full country name such as "Singapore" can also be used. Optional hint for market context + * (currency, availability, pricing)—higher-resolution data (e.g., shipping address) + * supersedes this value. + */ + address_country?: string; + /** + * The region in which the locality is, and which is in the country. For example, California + * or another appropriate first-level Administrative division. Optional hint for progressive + * localization—higher-resolution data (e.g., shipping address) supersedes this value. + */ + address_region?: string; + /** + * Preferred currency (ISO 4217, e.g., 'EUR', 'USD'). Businesses determine presentment + * currency from context and authoritative signals; this hint MAY inform selection in + * multi-currency markets. Also serves as the denomination for price filter values — + * platforms SHOULD include this field when sending price filters. Response prices include + * explicit currency confirming the resolution. + */ + currency?: string; + /** + * Buyer claims about eligible benefits such as loyalty membership, payment instrument + * perks, and similar. Recognized claims MAY inform the Business response (e.g., member-only + * product availability, adjusted pricing in catalog, provisional discounts at cart or + * checkout). Businesses MUST ignore unrecognized values without error. Values MUST use + * reverse-domain naming (e.g., 'com.example.loyalty_gold', 'org.school.student') and MUST + * be non-identifying. + */ + eligibility?: string[]; + /** + * Background context describing buyer's intent (e.g., 'looking for a gift under $50', 'need + * something durable for outdoor use'). Informs relevance, recommendations, and + * personalization. + */ + intent?: string; + /** + * Preferred language for content. Use IETF BCP 47 language tags (e.g., 'en', 'fr-CA', + * 'zh-Hans'). For REST, equivalent to Accept-Language header—platforms SHOULD fall back to + * Accept-Language when this field is absent; when provided, overrides Accept-Language. + * Businesses MAY return content in a different language if unavailable. + */ + language?: string; + /** + * The postal code. For example, 94043. Optional hint for regional + * refinement—higher-resolution data (e.g., shipping address) supersedes this value. + */ + postal_code?: string; + [property: string]: any; +} +/** + * Discount codes input and applied discounts output. + */ +export interface CheckoutDiscounts { + /** + * Discounts successfully applied (code-based and automatic). + */ + applied?: AppliedDiscount[]; + /** + * Discount codes to apply. Case-insensitive. Replaces previously submitted codes. Send + * empty array to clear. + */ + codes?: string[]; + [property: string]: any; +} +/** + * A discount that was successfully applied. + */ +export interface AppliedDiscount { + /** + * Breakdown of where this discount was allocated. Sum of allocation amounts equals total + * amount. + */ + allocations?: DiscountAllocation[]; + /** + * Total discount amount in ISO 4217 minor units. + */ + amount: number; + /** + * True if applied automatically by merchant rules (no code required). + */ + automatic?: boolean; + /** + * The discount code. Omitted for automatic discounts. + */ + code?: string; + /** + * The eligibility claim accepted by the Business for this discount. Corresponds to a value + * from context.eligibility. Omitted for code-based and non-eligibility automatic discounts. + */ + eligibility?: string; + /** + * Allocation method. 'each' = applied independently per item. 'across' = split + * proportionally by value. + */ + method?: DiscountMethod; + /** + * Stacking order for discount calculation. Lower numbers applied first (1 = first). + */ + priority?: number; + /** + * True if this discount requires additional verification. + */ + provisional?: boolean; + /** + * Human-readable discount name (e.g., 'Summer Sale 20% Off'). + */ + title: string; + [property: string]: any; +} +/** + * Breakdown of how a discount amount was allocated to a specific target. + */ +export interface DiscountAllocation { + /** + * Amount allocated to this target in ISO 4217 minor units. + */ + amount: number; + /** + * JSONPath to the allocation target (e.g., '$.line_items[0]', '$.totals.shipping'). + */ + path: string; + [property: string]: any; +} +/** + * Allocation method. 'each' = applied independently per item. 'across' = split + * proportionally by value. + */ +export type DiscountMethod = "each" | "across"; +/** + * Fulfillment details. + * + * Container for fulfillment methods and availability. + */ +export interface CheckoutFulfillment { + /** + * Inventory availability hints. + */ + available_methods?: FulfillmentAvailableMethod[]; + /** + * Fulfillment methods for cart items. + */ + methods?: FulfillmentMethod[]; + [property: string]: any; +} +/** + * Inventory availability hint for a fulfillment method type. + */ +export interface FulfillmentAvailableMethod { + /** + * Human-readable availability info (e.g., 'Available for pickup at Downtown Store today'). + */ + description?: string; + /** + * 'now' for immediate availability, or ISO 8601 date for future (preorders, transfers). + */ + fulfillable_on?: null | string; + /** + * Line items available for this fulfillment method. + */ + line_item_ids: string[]; + /** + * Fulfillment method type this availability applies to. + */ + type: FulfillmentMethodType; + [property: string]: any; +} +/** + * Fulfillment method type this availability applies to. + * + * Fulfillment method type. + */ +export type FulfillmentMethodType = "shipping" | "pickup"; +/** + * A fulfillment method (shipping or pickup) with destinations and groups. + */ +export interface FulfillmentMethod { + /** + * Available destinations. For shipping: addresses. For pickup: retail locations. + */ + destinations?: FulfillmentDestination[]; + /** + * Fulfillment groups for selecting options. Agent sets selected_option_id on groups to + * choose shipping method. + */ + groups?: FulfillmentGroup[]; + /** + * Unique fulfillment method identifier. + */ + id: string; + /** + * Line item IDs fulfilled via this method. + */ + line_item_ids: string[]; + /** + * ID of the selected destination. + */ + selected_destination_id?: null | string; + /** + * Fulfillment method type. + */ + type: FulfillmentMethodType; + [property: string]: any; +} +/** + * A destination for fulfillment. + * + * Shipping destination. + * + * Physical address of the location. + * + * The billing address associated with this payment method. + * + * Delivery destination address. + * + * A pickup location (retail store, locker, etc.). + */ +export interface FulfillmentDestination { + /** + * The country. Recommended to be in 2-letter ISO 3166-1 alpha-2 format, for example "US". + * For backward compatibility, a 3-letter ISO 3166-1 alpha-3 country code such as "SGP" or a + * full country name such as "Singapore" can also be used. + */ + address_country?: string; + /** + * The locality in which the street address is, and which is in the region. For example, + * Mountain View. + */ + address_locality?: string; + /** + * The region in which the locality is, and which is in the country. Required for applicable + * countries (i.e. state in US, province in CA). For example, California or another + * appropriate first-level Administrative division. + */ + address_region?: string; + /** + * An address extension such as an apartment number, C/O or alternative name. + */ + extended_address?: string; + /** + * Optional. First name of the contact associated with the address. + */ + first_name?: string; + /** + * Optional. Last name of the contact associated with the address. + */ + last_name?: string; + /** + * Optional. Phone number of the contact associated with the address. + */ + phone_number?: string; + /** + * The postal code. For example, 94043. + */ + postal_code?: string; + /** + * The street address. + */ + street_address?: string; + /** + * ID specific to this shipping destination. + * + * Unique location identifier. + */ + id: string; + /** + * Physical address of the location. + */ + address?: PostalAddress; + /** + * Location name (e.g., store name). + */ + name?: string; + [property: string]: any; +} +/** + * Physical address of the location. + * + * The billing address associated with this payment method. + * + * Delivery destination address. + */ +export interface PostalAddress { + /** + * The country. Recommended to be in 2-letter ISO 3166-1 alpha-2 format, for example "US". + * For backward compatibility, a 3-letter ISO 3166-1 alpha-3 country code such as "SGP" or a + * full country name such as "Singapore" can also be used. + */ + address_country?: string; + /** + * The locality in which the street address is, and which is in the region. For example, + * Mountain View. + */ + address_locality?: string; + /** + * The region in which the locality is, and which is in the country. Required for applicable + * countries (i.e. state in US, province in CA). For example, California or another + * appropriate first-level Administrative division. + */ + address_region?: string; + /** + * An address extension such as an apartment number, C/O or alternative name. + */ + extended_address?: string; + /** + * Optional. First name of the contact associated with the address. + */ + first_name?: string; + /** + * Optional. Last name of the contact associated with the address. + */ + last_name?: string; + /** + * Optional. Phone number of the contact associated with the address. + */ + phone_number?: string; + /** + * The postal code. For example, 94043. + */ + postal_code?: string; + /** + * The street address. + */ + street_address?: string; + [property: string]: any; +} +/** + * A merchant-generated package/group of line items with fulfillment options. + */ +export interface FulfillmentGroup { + /** + * Group identifier for referencing merchant-generated groups in updates. + */ + id: string; + /** + * Line item IDs included in this group/package. + */ + line_item_ids: string[]; + /** + * Available fulfillment options for this group. + */ + options?: FulfillmentOption[]; + /** + * ID of the selected fulfillment option for this group. + */ + selected_option_id?: null | string; + [property: string]: any; +} +/** + * A fulfillment option within a group (e.g., Standard Shipping $5, Express $15). + */ +export interface FulfillmentOption { + /** + * Carrier name (for shipping). + */ + carrier?: string; + /** + * Complete context for buyer decision (e.g., 'Arrives Dec 12-15 via FedEx'). + */ + description?: string; + /** + * Earliest fulfillment date. + */ + earliest_fulfillment_time?: string; + /** + * Unique fulfillment option identifier. + */ + id: string; + /** + * Latest fulfillment date. + */ + latest_fulfillment_time?: string; + /** + * Short label (e.g., 'Express Shipping', 'Curbside Pickup'). + */ + title: string; + /** + * Fulfillment option totals breakdown. + */ + totals: Total[]; + [property: string]: any; +} +/** + * A cost breakdown entry with a category, amount, and optional display text. + * + * Different cart totals. + * + * Pricing breakdown provided by the business. MUST contain exactly one subtotal and one + * total entry. Detail types (tax, fee, discount, fulfillment) may appear multiple times for + * itemization. Platforms MUST render all entries in order using display_text and amount. + */ +export interface Total { + amount: number; + /** + * Text to display against the amount. Should reflect appropriate method (e.g., 'Shipping', + * 'Delivery'). + */ + display_text?: string; + /** + * Cost category. Well-known values: subtotal, items_discount, discount, fulfillment, tax, + * fee, total. Businesses MAY use additional values. + */ + type: string; + [property: string]: any; +} +/** + * Line item object. Expected to use the currency of the parent object. + */ +export interface CheckoutLineItem { + id: string; + item: Item; + /** + * Parent line item identifier for any nested structures. + */ + parent_id?: string; + /** + * Quantity of the item being purchased. + */ + quantity: number; + /** + * Line item totals breakdown. + */ + totals: Total[]; + [property: string]: any; +} +/** + * Product data (id, title, price, image_url). + */ +export interface Item { + /** + * The product identifier, often the SKU, required to resolve the product details associated + * with this line item. Should be recognized by both the Platform, and the Business. + */ + id: string; + /** + * Product image URI. + */ + image_url?: string; + /** + * Unit price in ISO 4217 minor units. + */ + price: number; + /** + * Product title. + */ + title: string; + [property: string]: any; +} +export interface Link { + /** + * Optional display text for the link. When provided, use this instead of generating from + * type. + */ + title?: string; + /** + * Type of link. Well-known values: `privacy_policy`, `terms_of_service`, `refund_policy`, + * `shipping_policy`, `faq`. Consumers SHOULD handle unknown values gracefully by displaying + * them using the `title` field or omitting the link. + */ + type: string; + /** + * The actual URL pointing to the content to be displayed. + */ + url: string; + [property: string]: any; +} +/** + * Container for error, warning, or info messages. + */ +export interface CheckoutMessage { + code?: string; + /** + * Human-readable message. + * + * Human-readable warning message that MUST be displayed. + */ + content: string; + /** + * Content format, default = plain. + */ + content_type?: ContentType; + /** + * RFC 9535 JSONPath to the component the message refers to (e.g., $.items[1]). + * + * JSONPath (RFC 9535) to related field (e.g., $.line_items[0]). + * + * RFC 9535 JSONPath to the component the message refers to. + */ + path?: string; + /** + * Reflects the resource state and recommended action. 'recoverable': platform can resolve + * by modifying inputs and retrying 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. 'unrecoverable': no valid resource exists to act on, + * retry with new resource or inputs. Errors with 'requires_*' severity contribute to + * 'status: requires_escalation'. + */ + severity?: Severity; + /** + * Message type discriminator. + */ + type: MessageType; + /** + * URL to a required visual element (e.g., warning symbol, energy class label). + */ + image_url?: string; + /** + * Rendering contract for this warning. 'notice' (default): platform MUST display, MAY + * dismiss. 'disclosure': platform MUST display in proximity to the path-referenced + * component, MUST NOT hide or auto-dismiss. See specification for full contract. + */ + presentation?: string; + /** + * Reference URL for more information (e.g., regulatory site, registry entry, policy page). + */ + url?: string; + [property: string]: any; +} +/** + * Content format, default = plain. + */ +export type ContentType = "plain" | "markdown"; +/** + * Reflects the resource state and recommended action. 'recoverable': platform can resolve + * by modifying inputs and retrying 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. 'unrecoverable': no valid resource exists to act on, + * retry with new resource or inputs. Errors with 'requires_*' severity contribute to + * 'status: requires_escalation'. + */ +export type Severity = "recoverable" | "requires_buyer_input" | "requires_buyer_review" | "unrecoverable"; +export type MessageType = "error" | "warning" | "info"; +/** + * Details about an order created for this checkout session. + * + * Order details available at the time of checkout completion. + */ +export interface OrderConfirmation { + /** + * Unique order identifier. + */ + id: string; + /** + * Human-readable label for identifying the order. MUST only be provided by the business. + */ + label?: string; + /** + * Permalink to access the order on merchant site. + */ + permalink_url: string; + [property: string]: any; +} +/** + * Payment configuration containing handlers. + */ +export interface Payment { + /** + * The payment instruments available for this payment. Each instrument is associated with a + * specific handler via the handler_id field. Handlers can extend the base + * payment_instrument schema to add handler-specific fields. + */ + instruments?: SelectedPaymentInstrument[]; + [property: string]: any; +} +/** + * A payment instrument with selection state. + * + * The base definition for any payment instrument. It links the instrument to a specific + * payment handler. + */ +export interface SelectedPaymentInstrument { + /** + * The billing address associated with this payment method. + */ + billing_address?: PostalAddress; + credential?: PaymentCredential; + /** + * Display information for this payment instrument. Each payment instrument schema defines + * its specific display properties, as outlined by the payment handler. + */ + display?: { + [key: string]: any; + }; + /** + * The unique identifier for the handler instance that produced this instrument. This + * corresponds to the 'id' field in the Payment Handler definition. + */ + handler_id: string; + /** + * A unique identifier for this instrument instance, assigned by the platform. + */ + id: string; + /** + * The broad category of the instrument (e.g., 'card', 'tokenized_card'). Specific schemas + * will constrain this to a constant value. + */ + type: string; + /** + * Whether this instrument is selected by the user. + */ + selected?: boolean; + [property: string]: any; +} +/** + * The base definition for any payment credential. Handlers define specific credential types. + */ +export interface PaymentCredential { + /** + * The credential type discriminator. Specific schemas will constrain this to a constant + * value. + */ + type: string; + [property: string]: any; +} +/** + * Environment data provided by the platform to support authorization and abuse prevention. + * Values MUST NOT be buyer-asserted claims — platforms provide signals based on direct + * observation or independently verifiable third-party attestations. All signal keys MUST + * use reverse-domain naming to ensure provenance and prevent collisions when multiple + * extensions contribute to the shared namespace. + */ +export interface Signals { + /** + * Client's IP address (IPv4 or IPv6). + */ + "dev.ucp.buyer_ip"?: string; + /** + * Client's HTTP User-Agent header or equivalent. + */ + "dev.ucp.user_agent"?: string; + [property: string]: any; +} +/** + * Checkout state indicating the current phase and required action. See Checkout Status + * lifecycle documentation for state transition details. + */ +export type CheckoutStatus = "incomplete" | "requires_escalation" | "ready_for_complete" | "complete_in_progress" | "completed" | "canceled"; +/** + * UCP metadata for checkout responses. + * + * Base UCP metadata with shared properties for all schema types. + */ +export interface UcpMetadata { + /** + * Capability registry keyed by reverse-domain name. + */ + capabilities?: { + [key: string]: UcpCapability[]; + }; + /** + * Payment handler registry keyed by reverse-domain name. + */ + payment_handlers: { + [key: string]: UcpPaymentHandler[]; + }; + /** + * Service registry keyed by reverse-domain name. + */ + services?: { + [key: string]: UcpService[]; + }; + /** + * Application-level status of the UCP operation. + */ + status?: UcpMetadataStatus; + version: string; + [property: string]: any; +} +/** + * Capability reference in responses. Only name/version required to confirm active + * capabilities. + * + * Shared foundation for all UCP entities. + */ +export interface UcpCapability { + /** + * Entity-specific configuration. Structure defined by each entity's schema. + */ + config?: { + [key: string]: any; + }; + /** + * Unique identifier for this entity instance. Used to disambiguate when multiple instances + * exist. + */ + id?: string; + /** + * URL to JSON Schema defining this entity's structure and payloads. + */ + schema?: string; + /** + * URL to human-readable specification document. + */ + spec?: string; + /** + * Entity version in YYYY-MM-DD format. + */ + version: string; + /** + * Parent capability(s) this extends. Present for extensions, absent for root capabilities. + * Use array for multi-parent extensions. + */ + extends?: string[] | string; + [property: string]: any; +} +/** + * Handler reference in responses. May include full config state for runtime usage of the + * handler. + * + * Shared foundation for all UCP entities. + */ +export interface UcpPaymentHandler { + /** + * Entity-specific configuration. Structure defined by each entity's schema. + */ + config?: { + [key: string]: any; + }; + /** + * Unique identifier for this entity instance. Used to disambiguate when multiple instances + * exist. + */ + id: string; + /** + * URL to JSON Schema defining this entity's structure and payloads. + */ + schema?: string; + /** + * URL to human-readable specification document. + */ + spec?: string; + /** + * Entity version in YYYY-MM-DD format. + */ + version: string; + /** + * Instrument types this handler supports, with optional constraints. When absent, every + * instrument should be considered available. + */ + available_instruments?: UcpPaymentHandlerAvailableInstrument[]; + [property: string]: any; +} +/** + * An instrument type available from a payment handler with optional constraints. + */ +export interface UcpPaymentHandlerAvailableInstrument { + /** + * Constraints on this instrument type. Structure depends on instrument type and active + * capabilities. + */ + constraints?: { + [key: string]: any; + }; + /** + * The instrument type identifier (e.g., 'card', 'gift_card'). References an instrument + * schema's type constant. + */ + type: string; + [property: string]: any; +} +/** + * Service binding in API responses. Includes per-resource transport configuration via typed + * config. + * + * Shared foundation for all UCP entities. + */ +export interface UcpService { + /** + * Entity-specific configuration. Structure defined by each entity's schema. + */ + config?: EmbeddedTransportConfig; + /** + * Unique identifier for this entity instance. Used to disambiguate when multiple instances + * exist. + */ + id?: string; + /** + * URL to JSON Schema defining this entity's structure and payloads. + */ + schema?: string; + /** + * URL to human-readable specification document. + */ + spec?: string; + /** + * Entity version in YYYY-MM-DD format. + */ + version: string; + /** + * Endpoint URL for this transport binding. + */ + endpoint?: string; + /** + * Transport protocol for this service binding. + */ + transport: Transport; + [property: string]: any; +} +/** + * Entity-specific configuration. Structure defined by each entity's schema. + * + * Per-session configuration for embedded transport binding. Allows businesses to vary EP + * availability and delegations based on cart contents, agent authorization, or policy. + */ +export interface EmbeddedTransportConfig { + /** + * Color schemes the business supports. Hosts use ec_color_scheme query parameter to request + * a scheme from this list. + */ + color_scheme?: EmbeddedColorScheme[]; + /** + * Delegations the business allows. At service-level, declares available delegations. In UCP + * responses, confirms accepted delegations for this session. + */ + delegate?: string[]; + [property: string]: any; +} +export type EmbeddedColorScheme = "light" | "dark"; +/** + * Transport protocol for this service binding. + */ +export type Transport = "rest" | "mcp" | "a2a" | "embedded"; +/** + * Application-level status of the UCP operation. + */ +export type UcpMetadataStatus = "success" | "error"; +/** + * Order schema with line items, buyer-facing fulfillment expectations, and event logs. + */ +export interface Order { + /** + * Post-order events (refunds, returns, credits, disputes, cancellations, etc.) that exist + * independently of fulfillment. + */ + adjustments?: Adjustment[]; + /** + * Snapshot of the attribution associated with the originating checkout. Read-only on the + * order. + */ + attribution?: { + [key: string]: string; + }; + /** + * Associated checkout ID for reconciliation. + */ + checkout_id: string; + /** + * ISO 4217 currency code. MUST match the currency from the originating checkout session. + */ + currency: string; + /** + * Fulfillment data: buyer expectations and what actually happened. + */ + fulfillment: Fulfillment; + /** + * Unique order identifier. + */ + id: string; + /** + * Human-readable label for identifying the order. MUST only be provided by the business. + */ + label?: string; + /** + * Line items representing what was purchased — can change post-order via edits or exchanges. + */ + line_items: OrderLineItem[]; + /** + * Business outcome messages (errors, warnings, informational). Present when the business + * needs to communicate status or issues to the platform. + */ + messages?: CheckoutMessage[]; + /** + * Permalink to access the order on merchant site. + */ + permalink_url: string; + /** + * Different totals for the order. + */ + totals: Total[]; + ucp: UCPOrderResponseSchema; + [property: string]: any; +} +/** + * Post-order event that exists independently of fulfillment. Typically represents money + * movements but can be any post-order change. Polymorphic type that can optionally + * reference line items. + */ +export interface Adjustment { + /** + * Human-readable reason or description (e.g., 'Defective item', 'Customer requested'). + */ + description?: string; + /** + * Adjustment event identifier. + */ + id: string; + /** + * Which line items and quantities are affected (optional). + */ + line_items?: AdjustmentLineItem[]; + /** + * RFC 3339 timestamp when this adjustment occurred. + */ + occurred_at: string; + /** + * Adjustment status. + */ + status: AdjustmentStatus; + /** + * Adjustment totals breakdown. Signed values - negative for money returned to buyer + * (refunds, credits), positive for additional charges (exchanges). + */ + totals?: Total[]; + /** + * Type of adjustment (open string). Typically money-related like: refund, return, credit, + * price_adjustment, dispute, cancellation. Can be any value that makes sense for the + * merchant's business. + */ + type: string; + [property: string]: any; +} +export interface AdjustmentLineItem { + /** + * Line item ID reference. + */ + id: string; + /** + * Signed quantity affected by this adjustment. Negative values represent reductions (e.g. + * returns); positive values represent additions (e.g. exchanges). + */ + quantity: number; + [property: string]: any; +} +/** + * Adjustment status. + */ +export type AdjustmentStatus = "pending" | "completed" | "failed"; +/** + * Fulfillment data: buyer expectations and what actually happened. + */ +export interface Fulfillment { + /** + * Append-only event log of actual shipments. Each event references line items by ID. + */ + events?: FulfillmentEvent[]; + /** + * Buyer-facing groups representing when/how items will be delivered. Can be split, merged, + * or adjusted post-order. + */ + expectations?: Expectation[]; + [property: string]: any; +} +/** + * Append-only fulfillment event representing an actual shipment. References line items by + * ID. + */ +export interface FulfillmentEvent { + /** + * Carrier name (e.g., 'FedEx', 'USPS'). + */ + carrier?: string; + /** + * Human-readable description of the shipment status or delivery information (e.g., + * 'Delivered to front door', 'Out for delivery'). + */ + description?: string; + /** + * Fulfillment event identifier. + */ + id: string; + /** + * Which line items and quantities are fulfilled in this event. + */ + line_items: EventLineItem[]; + /** + * RFC 3339 timestamp when this fulfillment event occurred. + */ + occurred_at: string; + /** + * Carrier tracking number (required if type != processing). + */ + tracking_number?: string; + /** + * URL to track this shipment (required if type != processing). + */ + tracking_url?: string; + /** + * Fulfillment event type. Common values include: processing (preparing to ship), shipped + * (handed to carrier), in_transit (in delivery network), delivered (received by buyer), + * failed_attempt (delivery attempt failed), canceled (fulfillment canceled), undeliverable + * (cannot be delivered), returned_to_sender (returned to merchant). + */ + type: string; + [property: string]: any; +} +export interface EventLineItem { + /** + * Line item ID reference. + */ + id: string; + /** + * Quantity fulfilled in this event. + */ + quantity: number; + [property: string]: any; +} +/** + * Buyer-facing fulfillment expectation representing logical groupings of items (e.g., + * 'package'). Can be split, merged, or adjusted post-order to set buyer expectations for + * when/how items arrive. + */ +export interface Expectation { + /** + * Human-readable delivery description (e.g., 'Arrives in 5-8 business days'). + */ + description?: string; + /** + * Delivery destination address. + */ + destination: PostalAddress; + /** + * When this expectation can be fulfilled: 'now' or ISO 8601 timestamp for future date + * (backorder, pre-order). + */ + fulfillable_on?: string; + /** + * Expectation identifier. + */ + id: string; + /** + * Which line items and quantities are in this expectation. + */ + line_items: ExpectationLineItem[]; + /** + * Delivery method type (shipping, pickup, digital). + */ + method_type: MethodType; + [property: string]: any; +} +export interface ExpectationLineItem { + /** + * Line item ID reference. + */ + id: string; + /** + * Quantity of this item in this expectation. + */ + quantity: number; + [property: string]: any; +} +/** + * Delivery method type (shipping, pickup, digital). + */ +export type MethodType = "shipping" | "pickup" | "digital"; +export interface OrderLineItem { + /** + * Line item identifier. + */ + id: string; + /** + * Product data (id, title, price, image_url). + */ + item: Item; + /** + * Parent line item identifier for any nested structures. + */ + parent_id?: string; + /** + * Quantity tracking for the line item. + */ + quantity: LineItemQuantity; + /** + * Derived status: removed if quantity.total == 0, fulfilled if quantity.total > 0 and + * quantity.fulfilled == quantity.total, partial if quantity.total > 0 and + * quantity.fulfilled > 0, otherwise processing. + */ + status: LineItemStatus; + /** + * Line item totals breakdown. + */ + totals: Total[]; + [property: string]: any; +} +/** + * Quantity tracking for the line item. + */ +export interface LineItemQuantity { + /** + * Quantity fulfilled so far. + */ + fulfilled: number; + /** + * Quantity from the original checkout. + */ + original?: number; + /** + * Current total active quantity. May differ from original due to post-order modifications + * (e.g., returns or cancellations). + */ + total: number; + [property: string]: any; +} +/** + * Derived status: removed if quantity.total == 0, fulfilled if quantity.total > 0 and + * quantity.fulfilled == quantity.total, partial if quantity.total > 0 and + * quantity.fulfilled > 0, otherwise processing. + */ +export type LineItemStatus = "processing" | "partial" | "fulfilled" | "removed"; +/** + * UCP metadata for order responses. No payment handlers needed post-purchase. + * + * Base UCP metadata with shared properties for all schema types. + */ +export interface UCPOrderResponseSchema { + /** + * Capability registry keyed by reverse-domain name. + */ + capabilities?: { + [key: string]: UcpCapability[]; + }; + /** + * Payment handler registry keyed by reverse-domain name. + */ + payment_handlers?: { + [key: string]: UcpPaymentHandler[]; + }; + /** + * Service registry keyed by reverse-domain name. + */ + services?: { + [key: string]: UCPOrderResponseSchemaService[]; + }; + /** + * Application-level status of the UCP operation. + */ + status?: UcpMetadataStatus; + version: string; + [property: string]: any; +} +/** + * Shared foundation for all UCP entities. + */ +export interface UCPOrderResponseSchemaService { + /** + * Entity-specific configuration. Structure defined by each entity's schema. + */ + config?: { + [key: string]: any; + }; + /** + * Unique identifier for this entity instance. Used to disambiguate when multiple instances + * exist. + */ + id?: string; + /** + * URL to JSON Schema defining this entity's structure and payloads. + */ + schema?: string; + /** + * URL to human-readable specification document. + */ + spec?: string; + /** + * Entity version in YYYY-MM-DD format. + */ + version: string; + /** + * Endpoint URL for this transport binding. + */ + endpoint?: string; + /** + * Transport protocol for this service binding. + */ + transport: Transport; + [property: string]: any; +} +/** + * Generic error response when business logic prevents resource creation or failed to + * retrieve resource. Used when no valid resource can be established. + */ +export interface UcpErrorResponse { + /** + * URL for buyer handoff or session recovery. + */ + continue_url?: string; + /** + * Array of messages describing why the operation failed. + */ + messages: CheckoutMessage[]; + /** + * UCP protocol metadata. Status MUST be 'error' for error response. + */ + ucp: UcpErrorMetadata; +} +/** + * UCP protocol metadata. Status MUST be 'error' for error response. + * + * UCP metadata with status 'error'. Use for response branches that carry error + * information. + * + * Base UCP metadata with shared properties for all schema types. + */ +export interface UcpErrorMetadata { + /** + * Capability registry keyed by reverse-domain name. + */ + capabilities?: { + [key: string]: UcpCapability[]; + }; + /** + * Payment handler registry keyed by reverse-domain name. + */ + payment_handlers?: { + [key: string]: UcpPaymentHandler[]; + }; + /** + * Service registry keyed by reverse-domain name. + */ + services?: { + [key: string]: UCPOrderResponseSchemaService[]; + }; + /** + * Application-level status of the UCP operation. + */ + status: UcpErrorMetadataStatus; + version: string; + [property: string]: any; +} +/** + * Application-level status of the UCP operation. + */ +export type UcpErrorMetadataStatus = "error"; +/** + * Checkout state after instrument selection. + * + * Generic error response when business logic prevents resource creation or failed to + * retrieve resource. Used when no valid resource can be established. + */ +export interface InstrumentsChangeResult { + /** + * Partial checkout update with payment instrument selection. + */ + checkout?: InstrumentsChangeCheckout; + /** + * UCP protocol metadata. Status MUST be 'error' for error response. + */ + ucp: UcpObject; + /** + * URL for buyer handoff or session recovery. + */ + continue_url?: string; + /** + * Array of messages describing why the operation failed. + */ + messages?: CheckoutMessage[]; + [property: string]: any; +} +/** + * Partial checkout update with payment instrument selection. + */ +export interface InstrumentsChangeCheckout { + /** + * Payment instruments with selected instrument ID. + */ + payment?: InstrumentsChangePayment; + [property: string]: any; +} +/** + * Payment instruments with selected instrument ID. + * + * Payment configuration containing handlers. + */ +export interface InstrumentsChangePayment { + /** + * The payment instruments available for this payment. Each instrument is associated with a + * specific handler via the handler_id field. Handlers can extend the base + * payment_instrument schema to add handler-specific fields. + */ + instruments?: SelectedPaymentInstrument[]; + /** + * ID of the selected payment instrument. + */ + selected_instrument_id?: string; + [property: string]: any; +} +/** + * UCP metadata with status 'success'. Use for response branches that carry the expected + * payload. + * + * Base UCP metadata with shared properties for all schema types. + * + * UCP protocol metadata. Status MUST be 'error' for error response. + * + * UCP metadata with status 'error'. Use for response branches that carry error information. + */ +export interface UcpObject { + /** + * Capability registry keyed by reverse-domain name. + */ + capabilities?: { + [key: string]: CapabilityElement[]; + }; + /** + * Payment handler registry keyed by reverse-domain name. + */ + payment_handlers?: { + [key: string]: PaymentHandlerElement[]; + }; + /** + * Service registry keyed by reverse-domain name. + */ + services?: { + [key: string]: UcpServiceObject[]; + }; + /** + * Application-level status of the UCP operation. + */ + status: UcpMetadataStatus; + version: string; + [property: string]: any; +} +/** + * Shared foundation for all UCP entities. + * + * Capability reference in responses. Only name/version required to confirm active + * capabilities. + */ +export interface CapabilityElement { + /** + * Entity-specific configuration. Structure defined by each entity's schema. + */ + config?: { + [key: string]: any; + }; + /** + * Unique identifier for this entity instance. Used to disambiguate when multiple instances + * exist. + */ + id?: string; + /** + * URL to JSON Schema defining this entity's structure and payloads. + */ + schema?: string; + /** + * URL to human-readable specification document. + */ + spec?: string; + /** + * Entity version in YYYY-MM-DD format. + */ + version: string; + /** + * Parent capability(s) this extends. Present for extensions, absent for root capabilities. + * Use array for multi-parent extensions. + */ + extends?: string[] | string; + [property: string]: any; +} +/** + * Shared foundation for all UCP entities. + * + * Handler reference in responses. May include full config state for runtime usage of the + * handler. + */ +export interface PaymentHandlerElement { + /** + * Entity-specific configuration. Structure defined by each entity's schema. + */ + config?: { + [key: string]: any; + }; + /** + * Unique identifier for this entity instance. Used to disambiguate when multiple instances + * exist. + */ + id: string; + /** + * URL to JSON Schema defining this entity's structure and payloads. + */ + schema?: string; + /** + * URL to human-readable specification document. + */ + spec?: string; + /** + * Entity version in YYYY-MM-DD format. + */ + version: string; + /** + * Instrument types this handler supports, with optional constraints. When absent, every + * instrument should be considered available. + */ + available_instruments?: PaymentHandlerAvailableInstrument[]; + [property: string]: any; +} +/** + * An instrument type available from a payment handler with optional constraints. + */ +export interface PaymentHandlerAvailableInstrument { + /** + * Constraints on this instrument type. Structure depends on instrument type and active + * capabilities. + */ + constraints?: { + [key: string]: any; + }; + /** + * The instrument type identifier (e.g., 'card', 'gift_card'). References an instrument + * schema's type constant. + */ + type: string; + [property: string]: any; +} +/** + * Shared foundation for all UCP entities. + */ +export interface UcpServiceObject { + /** + * Entity-specific configuration. Structure defined by each entity's schema. + */ + config?: { + [key: string]: any; + }; + /** + * Unique identifier for this entity instance. Used to disambiguate when multiple instances + * exist. + */ + id?: string; + /** + * URL to JSON Schema defining this entity's structure and payloads. + */ + schema?: string; + /** + * URL to human-readable specification document. + */ + spec?: string; + /** + * Entity version in YYYY-MM-DD format. + */ + version: string; + /** + * Endpoint URL for this transport binding. + */ + endpoint?: string; + /** + * Transport protocol for this service binding. + */ + transport: Transport; + [property: string]: any; +} +/** + * Checkout state with payment credential ready for completion. + * + * Generic error response when business logic prevents resource creation or failed to + * retrieve resource. Used when no valid resource can be established. + */ +export interface CredentialResult { + /** + * Partial checkout update with payment credential. + */ + checkout?: CredentialCheckout; + /** + * UCP protocol metadata. Status MUST be 'error' for error response. + */ + ucp: UcpObject; + /** + * URL for buyer handoff or session recovery. + */ + continue_url?: string; + /** + * Array of messages describing why the operation failed. + */ + messages?: CheckoutMessage[]; + [property: string]: any; +} +/** + * Partial checkout update with payment credential. + */ +export interface CredentialCheckout { + payment?: Payment; + [property: string]: any; +} +/** + * Handshake from merchant to host + */ +export interface EcReadyParams { + auth?: Auth; + /** + * Delegation types the merchant accepts. Must be subset of checkout.embedded.delegations. + */ + delegate: string[]; + [property: string]: any; +} +export interface Auth { + type?: string; + [property: string]: any; +} diff --git a/protocol/languages/typescript/src/generated/WebModels.ts b/protocol/languages/typescript/src/generated/WebModels.ts new file mode 100644 index 00000000..ddce5555 --- /dev/null +++ b/protocol/languages/typescript/src/generated/WebModels.ts @@ -0,0 +1,1628 @@ +export type UCPMetadata = any; + +export type UCPService = any; + +export type UCPCapability = any; + +export type PaymentHandler = any; + +/** + * Base checkout schema. Extensions compose onto this using allOf. + */ +export interface Checkout { + attribution?: { [key: string]: string }; + /** + * Representation of the buyer. + */ + buyer?: Buyer; + context?: Context; + /** + * URL for checkout handoff and session recovery. MUST be provided when status is + * requires_escalation. See specification for format and availability requirements. + */ + continue_url?: string; + /** + * ISO 4217 currency code reflecting the merchant's market determination. Derived from + * address, context, and geo IP—buyers provide signals, merchants determine currency. + */ + currency: string; + discounts?: CheckoutDiscounts; + /** + * RFC 3339 expiry timestamp. Default TTL is 6 hours from creation if not sent. + */ + expires_at?: string; + /** + * Fulfillment details. + */ + fulfillment?: CheckoutFulfillment; + /** + * Unique identifier of the checkout session. + */ + id: string; + /** + * List of line items being checked out. + */ + line_items: CheckoutLineItem[]; + /** + * Links to be displayed by the platform (Privacy Policy, TOS). Mandatory for legal + * compliance. + */ + links: Link[]; + /** + * List of messages with error and info about the checkout session state. + */ + messages?: CheckoutMessage[]; + /** + * Details about an order created for this checkout session. + */ + order?: OrderConfirmation; + payment?: Payment; + signals?: Signals; + /** + * Checkout state indicating the current phase and required action. See Checkout Status + * lifecycle documentation for state transition details. + */ + status: CheckoutStatus; + /** + * Different cart totals. + */ + totals: Total[]; + ucp: UcpMetadata; + [property: string]: any; +} + +/** + * Representation of the buyer. + */ +export interface Buyer { + /** + * Email of the buyer. + */ + email?: string; + /** + * First name of the buyer. + */ + first_name?: string; + /** + * Last name of the buyer. + */ + last_name?: string; + /** + * E.164 standard. + */ + phone_number?: string; + [property: string]: any; +} + +/** + * Provisional buyer signals for relevance and localization—not authoritative data. + * Businesses SHOULD use these values when verified inputs (e.g., shipping address) are + * absent, and MAY ignore or down-rank them if inconsistent with higher-confidence signals + * (authenticated account, risk detection) or regulatory constraints (export controls). + * Eligibility and policy enforcement MUST occur at checkout time using binding transaction + * data. Context SHOULD be non-identifying and can be disclosed progressively—coarse signals + * early, finer resolution as the session progresses. Higher-resolution data (shipping + * address, billing address) supersedes context. + */ +export interface Context { + /** + * The country. Recommended to be in 2-letter ISO 3166-1 alpha-2 format, for example "US". + * For backward compatibility, a 3-letter ISO 3166-1 alpha-3 country code such as "SGP" or a + * full country name such as "Singapore" can also be used. Optional hint for market context + * (currency, availability, pricing)—higher-resolution data (e.g., shipping address) + * supersedes this value. + */ + address_country?: string; + /** + * The region in which the locality is, and which is in the country. For example, California + * or another appropriate first-level Administrative division. Optional hint for progressive + * localization—higher-resolution data (e.g., shipping address) supersedes this value. + */ + address_region?: string; + /** + * Preferred currency (ISO 4217, e.g., 'EUR', 'USD'). Businesses determine presentment + * currency from context and authoritative signals; this hint MAY inform selection in + * multi-currency markets. Also serves as the denomination for price filter values — + * platforms SHOULD include this field when sending price filters. Response prices include + * explicit currency confirming the resolution. + */ + currency?: string; + /** + * Buyer claims about eligible benefits such as loyalty membership, payment instrument + * perks, and similar. Recognized claims MAY inform the Business response (e.g., member-only + * product availability, adjusted pricing in catalog, provisional discounts at cart or + * checkout). Businesses MUST ignore unrecognized values without error. Values MUST use + * reverse-domain naming (e.g., 'com.example.loyalty_gold', 'org.school.student') and MUST + * be non-identifying. + */ + eligibility?: string[]; + /** + * Background context describing buyer's intent (e.g., 'looking for a gift under $50', 'need + * something durable for outdoor use'). Informs relevance, recommendations, and + * personalization. + */ + intent?: string; + /** + * Preferred language for content. Use IETF BCP 47 language tags (e.g., 'en', 'fr-CA', + * 'zh-Hans'). For REST, equivalent to Accept-Language header—platforms SHOULD fall back to + * Accept-Language when this field is absent; when provided, overrides Accept-Language. + * Businesses MAY return content in a different language if unavailable. + */ + language?: string; + /** + * The postal code. For example, 94043. Optional hint for regional + * refinement—higher-resolution data (e.g., shipping address) supersedes this value. + */ + postal_code?: string; + [property: string]: any; +} + +/** + * Discount codes input and applied discounts output. + */ +export interface CheckoutDiscounts { + /** + * Discounts successfully applied (code-based and automatic). + */ + applied?: AppliedDiscount[]; + /** + * Discount codes to apply. Case-insensitive. Replaces previously submitted codes. Send + * empty array to clear. + */ + codes?: string[]; + [property: string]: any; +} + +/** + * A discount that was successfully applied. + */ +export interface AppliedDiscount { + /** + * Breakdown of where this discount was allocated. Sum of allocation amounts equals total + * amount. + */ + allocations?: DiscountAllocation[]; + /** + * Total discount amount in ISO 4217 minor units. + */ + amount: number; + /** + * True if applied automatically by merchant rules (no code required). + */ + automatic?: boolean; + /** + * The discount code. Omitted for automatic discounts. + */ + code?: string; + /** + * The eligibility claim accepted by the Business for this discount. Corresponds to a value + * from context.eligibility. Omitted for code-based and non-eligibility automatic discounts. + */ + eligibility?: string; + /** + * Allocation method. 'each' = applied independently per item. 'across' = split + * proportionally by value. + */ + method?: DiscountMethod; + /** + * Stacking order for discount calculation. Lower numbers applied first (1 = first). + */ + priority?: number; + /** + * True if this discount requires additional verification. + */ + provisional?: boolean; + /** + * Human-readable discount name (e.g., 'Summer Sale 20% Off'). + */ + title: string; + [property: string]: any; +} + +/** + * Breakdown of how a discount amount was allocated to a specific target. + */ +export interface DiscountAllocation { + /** + * Amount allocated to this target in ISO 4217 minor units. + */ + amount: number; + /** + * JSONPath to the allocation target (e.g., '$.line_items[0]', '$.totals.shipping'). + */ + path: string; + [property: string]: any; +} + +/** + * Allocation method. 'each' = applied independently per item. 'across' = split + * proportionally by value. + */ +export type DiscountMethod = "each" | "across"; + +/** + * Fulfillment details. + * + * Container for fulfillment methods and availability. + */ +export interface CheckoutFulfillment { + /** + * Inventory availability hints. + */ + available_methods?: FulfillmentAvailableMethod[]; + /** + * Fulfillment methods for cart items. + */ + methods?: FulfillmentMethod[]; + [property: string]: any; +} + +/** + * Inventory availability hint for a fulfillment method type. + */ +export interface FulfillmentAvailableMethod { + /** + * Human-readable availability info (e.g., 'Available for pickup at Downtown Store today'). + */ + description?: string; + /** + * 'now' for immediate availability, or ISO 8601 date for future (preorders, transfers). + */ + fulfillable_on?: null | string; + /** + * Line items available for this fulfillment method. + */ + line_item_ids: string[]; + /** + * Fulfillment method type this availability applies to. + */ + type: FulfillmentMethodType; + [property: string]: any; +} + +/** + * Fulfillment method type this availability applies to. + * + * Fulfillment method type. + */ +export type FulfillmentMethodType = "shipping" | "pickup"; + +/** + * A fulfillment method (shipping or pickup) with destinations and groups. + */ +export interface FulfillmentMethod { + /** + * Available destinations. For shipping: addresses. For pickup: retail locations. + */ + destinations?: FulfillmentDestination[]; + /** + * Fulfillment groups for selecting options. Agent sets selected_option_id on groups to + * choose shipping method. + */ + groups?: FulfillmentGroup[]; + /** + * Unique fulfillment method identifier. + */ + id: string; + /** + * Line item IDs fulfilled via this method. + */ + line_item_ids: string[]; + /** + * ID of the selected destination. + */ + selected_destination_id?: null | string; + /** + * Fulfillment method type. + */ + type: FulfillmentMethodType; + [property: string]: any; +} + +/** + * A destination for fulfillment. + * + * Shipping destination. + * + * Physical address of the location. + * + * The billing address associated with this payment method. + * + * Delivery destination address. + * + * A pickup location (retail store, locker, etc.). + */ +export interface FulfillmentDestination { + /** + * The country. Recommended to be in 2-letter ISO 3166-1 alpha-2 format, for example "US". + * For backward compatibility, a 3-letter ISO 3166-1 alpha-3 country code such as "SGP" or a + * full country name such as "Singapore" can also be used. + */ + address_country?: string; + /** + * The locality in which the street address is, and which is in the region. For example, + * Mountain View. + */ + address_locality?: string; + /** + * The region in which the locality is, and which is in the country. Required for applicable + * countries (i.e. state in US, province in CA). For example, California or another + * appropriate first-level Administrative division. + */ + address_region?: string; + /** + * An address extension such as an apartment number, C/O or alternative name. + */ + extended_address?: string; + /** + * Optional. First name of the contact associated with the address. + */ + first_name?: string; + /** + * Optional. Last name of the contact associated with the address. + */ + last_name?: string; + /** + * Optional. Phone number of the contact associated with the address. + */ + phone_number?: string; + /** + * The postal code. For example, 94043. + */ + postal_code?: string; + /** + * The street address. + */ + street_address?: string; + /** + * ID specific to this shipping destination. + * + * Unique location identifier. + */ + id: string; + /** + * Physical address of the location. + */ + address?: PostalAddress; + /** + * Location name (e.g., store name). + */ + name?: string; + [property: string]: any; +} + +/** + * Physical address of the location. + * + * The billing address associated with this payment method. + * + * Delivery destination address. + */ +export interface PostalAddress { + /** + * The country. Recommended to be in 2-letter ISO 3166-1 alpha-2 format, for example "US". + * For backward compatibility, a 3-letter ISO 3166-1 alpha-3 country code such as "SGP" or a + * full country name such as "Singapore" can also be used. + */ + address_country?: string; + /** + * The locality in which the street address is, and which is in the region. For example, + * Mountain View. + */ + address_locality?: string; + /** + * The region in which the locality is, and which is in the country. Required for applicable + * countries (i.e. state in US, province in CA). For example, California or another + * appropriate first-level Administrative division. + */ + address_region?: string; + /** + * An address extension such as an apartment number, C/O or alternative name. + */ + extended_address?: string; + /** + * Optional. First name of the contact associated with the address. + */ + first_name?: string; + /** + * Optional. Last name of the contact associated with the address. + */ + last_name?: string; + /** + * Optional. Phone number of the contact associated with the address. + */ + phone_number?: string; + /** + * The postal code. For example, 94043. + */ + postal_code?: string; + /** + * The street address. + */ + street_address?: string; + [property: string]: any; +} + +/** + * A merchant-generated package/group of line items with fulfillment options. + */ +export interface FulfillmentGroup { + /** + * Group identifier for referencing merchant-generated groups in updates. + */ + id: string; + /** + * Line item IDs included in this group/package. + */ + line_item_ids: string[]; + /** + * Available fulfillment options for this group. + */ + options?: FulfillmentOption[]; + /** + * ID of the selected fulfillment option for this group. + */ + selected_option_id?: null | string; + [property: string]: any; +} + +/** + * A fulfillment option within a group (e.g., Standard Shipping $5, Express $15). + */ +export interface FulfillmentOption { + /** + * Carrier name (for shipping). + */ + carrier?: string; + /** + * Complete context for buyer decision (e.g., 'Arrives Dec 12-15 via FedEx'). + */ + description?: string; + /** + * Earliest fulfillment date. + */ + earliest_fulfillment_time?: string; + /** + * Unique fulfillment option identifier. + */ + id: string; + /** + * Latest fulfillment date. + */ + latest_fulfillment_time?: string; + /** + * Short label (e.g., 'Express Shipping', 'Curbside Pickup'). + */ + title: string; + /** + * Fulfillment option totals breakdown. + */ + totals: Total[]; + [property: string]: any; +} + +/** + * A cost breakdown entry with a category, amount, and optional display text. + * + * Different cart totals. + * + * Pricing breakdown provided by the business. MUST contain exactly one subtotal and one + * total entry. Detail types (tax, fee, discount, fulfillment) may appear multiple times for + * itemization. Platforms MUST render all entries in order using display_text and amount. + */ +export interface Total { + amount: number; + /** + * Text to display against the amount. Should reflect appropriate method (e.g., 'Shipping', + * 'Delivery'). + */ + display_text?: string; + /** + * Cost category. Well-known values: subtotal, items_discount, discount, fulfillment, tax, + * fee, total. Businesses MAY use additional values. + */ + type: string; + [property: string]: any; +} + +/** + * Line item object. Expected to use the currency of the parent object. + */ +export interface CheckoutLineItem { + id: string; + item: Item; + /** + * Parent line item identifier for any nested structures. + */ + parent_id?: string; + /** + * Quantity of the item being purchased. + */ + quantity: number; + /** + * Line item totals breakdown. + */ + totals: Total[]; + [property: string]: any; +} + +/** + * Product data (id, title, price, image_url). + */ +export interface Item { + /** + * The product identifier, often the SKU, required to resolve the product details associated + * with this line item. Should be recognized by both the Platform, and the Business. + */ + id: string; + /** + * Product image URI. + */ + image_url?: string; + /** + * Unit price in ISO 4217 minor units. + */ + price: number; + /** + * Product title. + */ + title: string; + [property: string]: any; +} + +export interface Link { + /** + * Optional display text for the link. When provided, use this instead of generating from + * type. + */ + title?: string; + /** + * Type of link. Well-known values: `privacy_policy`, `terms_of_service`, `refund_policy`, + * `shipping_policy`, `faq`. Consumers SHOULD handle unknown values gracefully by displaying + * them using the `title` field or omitting the link. + */ + type: string; + /** + * The actual URL pointing to the content to be displayed. + */ + url: string; + [property: string]: any; +} + +/** + * Container for error, warning, or info messages. + */ +export interface CheckoutMessage { + code?: string; + /** + * Human-readable message. + * + * Human-readable warning message that MUST be displayed. + */ + content: string; + /** + * Content format, default = plain. + */ + content_type?: ContentType; + /** + * RFC 9535 JSONPath to the component the message refers to (e.g., $.items[1]). + * + * JSONPath (RFC 9535) to related field (e.g., $.line_items[0]). + * + * RFC 9535 JSONPath to the component the message refers to. + */ + path?: string; + /** + * Reflects the resource state and recommended action. 'recoverable': platform can resolve + * by modifying inputs and retrying 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. 'unrecoverable': no valid resource exists to act on, + * retry with new resource or inputs. Errors with 'requires_*' severity contribute to + * 'status: requires_escalation'. + */ + severity?: Severity; + /** + * Message type discriminator. + */ + type: MessageType; + /** + * URL to a required visual element (e.g., warning symbol, energy class label). + */ + image_url?: string; + /** + * Rendering contract for this warning. 'notice' (default): platform MUST display, MAY + * dismiss. 'disclosure': platform MUST display in proximity to the path-referenced + * component, MUST NOT hide or auto-dismiss. See specification for full contract. + */ + presentation?: string; + /** + * Reference URL for more information (e.g., regulatory site, registry entry, policy page). + */ + url?: string; + [property: string]: any; +} + +/** + * Content format, default = plain. + */ +export type ContentType = "plain" | "markdown"; + +/** + * Reflects the resource state and recommended action. 'recoverable': platform can resolve + * by modifying inputs and retrying 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. 'unrecoverable': no valid resource exists to act on, + * retry with new resource or inputs. Errors with 'requires_*' severity contribute to + * 'status: requires_escalation'. + */ +export type Severity = "recoverable" | "requires_buyer_input" | "requires_buyer_review" | "unrecoverable"; + +export type MessageType = "error" | "warning" | "info"; + +/** + * Details about an order created for this checkout session. + * + * Order details available at the time of checkout completion. + */ +export interface OrderConfirmation { + /** + * Unique order identifier. + */ + id: string; + /** + * Human-readable label for identifying the order. MUST only be provided by the business. + */ + label?: string; + /** + * Permalink to access the order on merchant site. + */ + permalink_url: string; + [property: string]: any; +} + +/** + * Payment configuration containing handlers. + */ +export interface Payment { + /** + * The payment instruments available for this payment. Each instrument is associated with a + * specific handler via the handler_id field. Handlers can extend the base + * payment_instrument schema to add handler-specific fields. + */ + instruments?: SelectedPaymentInstrument[]; + [property: string]: any; +} + +/** + * A payment instrument with selection state. + * + * The base definition for any payment instrument. It links the instrument to a specific + * payment handler. + */ +export interface SelectedPaymentInstrument { + /** + * The billing address associated with this payment method. + */ + billing_address?: PostalAddress; + credential?: PaymentCredential; + /** + * Display information for this payment instrument. Each payment instrument schema defines + * its specific display properties, as outlined by the payment handler. + */ + display?: { [key: string]: any }; + /** + * The unique identifier for the handler instance that produced this instrument. This + * corresponds to the 'id' field in the Payment Handler definition. + */ + handler_id: string; + /** + * A unique identifier for this instrument instance, assigned by the platform. + */ + id: string; + /** + * The broad category of the instrument (e.g., 'card', 'tokenized_card'). Specific schemas + * will constrain this to a constant value. + */ + type: string; + /** + * Whether this instrument is selected by the user. + */ + selected?: boolean; + [property: string]: any; +} + +/** + * The base definition for any payment credential. Handlers define specific credential types. + */ +export interface PaymentCredential { + /** + * The credential type discriminator. Specific schemas will constrain this to a constant + * value. + */ + type: string; + [property: string]: any; +} + +/** + * Environment data provided by the platform to support authorization and abuse prevention. + * Values MUST NOT be buyer-asserted claims — platforms provide signals based on direct + * observation or independently verifiable third-party attestations. All signal keys MUST + * use reverse-domain naming to ensure provenance and prevent collisions when multiple + * extensions contribute to the shared namespace. + */ +export interface Signals { + /** + * Client's IP address (IPv4 or IPv6). + */ + "dev.ucp.buyer_ip"?: string; + /** + * Client's HTTP User-Agent header or equivalent. + */ + "dev.ucp.user_agent"?: string; + [property: string]: any; +} + +/** + * Checkout state indicating the current phase and required action. See Checkout Status + * lifecycle documentation for state transition details. + */ +export type CheckoutStatus = "incomplete" | "requires_escalation" | "ready_for_complete" | "complete_in_progress" | "completed" | "canceled"; + +/** + * UCP metadata for checkout responses. + * + * Base UCP metadata with shared properties for all schema types. + */ +export interface UcpMetadata { + /** + * Capability registry keyed by reverse-domain name. + */ + capabilities?: { [key: string]: UcpCapability[] }; + /** + * Payment handler registry keyed by reverse-domain name. + */ + payment_handlers: { [key: string]: UcpPaymentHandler[] }; + /** + * Service registry keyed by reverse-domain name. + */ + services?: { [key: string]: UcpService[] }; + /** + * Application-level status of the UCP operation. + */ + status?: UcpMetadataStatus; + version: string; + [property: string]: any; +} + +/** + * Capability reference in responses. Only name/version required to confirm active + * capabilities. + * + * Shared foundation for all UCP entities. + */ +export interface UcpCapability { + /** + * Entity-specific configuration. Structure defined by each entity's schema. + */ + config?: { [key: string]: any }; + /** + * Unique identifier for this entity instance. Used to disambiguate when multiple instances + * exist. + */ + id?: string; + /** + * URL to JSON Schema defining this entity's structure and payloads. + */ + schema?: string; + /** + * URL to human-readable specification document. + */ + spec?: string; + /** + * Entity version in YYYY-MM-DD format. + */ + version: string; + /** + * Parent capability(s) this extends. Present for extensions, absent for root capabilities. + * Use array for multi-parent extensions. + */ + extends?: string[] | string; + [property: string]: any; +} + +/** + * Handler reference in responses. May include full config state for runtime usage of the + * handler. + * + * Shared foundation for all UCP entities. + */ +export interface UcpPaymentHandler { + /** + * Entity-specific configuration. Structure defined by each entity's schema. + */ + config?: { [key: string]: any }; + /** + * Unique identifier for this entity instance. Used to disambiguate when multiple instances + * exist. + */ + id: string; + /** + * URL to JSON Schema defining this entity's structure and payloads. + */ + schema?: string; + /** + * URL to human-readable specification document. + */ + spec?: string; + /** + * Entity version in YYYY-MM-DD format. + */ + version: string; + /** + * Instrument types this handler supports, with optional constraints. When absent, every + * instrument should be considered available. + */ + available_instruments?: UcpPaymentHandlerAvailableInstrument[]; + [property: string]: any; +} + +/** + * An instrument type available from a payment handler with optional constraints. + */ +export interface UcpPaymentHandlerAvailableInstrument { + /** + * Constraints on this instrument type. Structure depends on instrument type and active + * capabilities. + */ + constraints?: { [key: string]: any }; + /** + * The instrument type identifier (e.g., 'card', 'gift_card'). References an instrument + * schema's type constant. + */ + type: string; + [property: string]: any; +} + +/** + * Service binding in API responses. Includes per-resource transport configuration via typed + * config. + * + * Shared foundation for all UCP entities. + */ +export interface UcpService { + /** + * Entity-specific configuration. Structure defined by each entity's schema. + */ + config?: EmbeddedTransportConfig; + /** + * Unique identifier for this entity instance. Used to disambiguate when multiple instances + * exist. + */ + id?: string; + /** + * URL to JSON Schema defining this entity's structure and payloads. + */ + schema?: string; + /** + * URL to human-readable specification document. + */ + spec?: string; + /** + * Entity version in YYYY-MM-DD format. + */ + version: string; + /** + * Endpoint URL for this transport binding. + */ + endpoint?: string; + /** + * Transport protocol for this service binding. + */ + transport: Transport; + [property: string]: any; +} + +/** + * Entity-specific configuration. Structure defined by each entity's schema. + * + * Per-session configuration for embedded transport binding. Allows businesses to vary EP + * availability and delegations based on cart contents, agent authorization, or policy. + */ +export interface EmbeddedTransportConfig { + /** + * Color schemes the business supports. Hosts use ec_color_scheme query parameter to request + * a scheme from this list. + */ + color_scheme?: EmbeddedColorScheme[]; + /** + * Delegations the business allows. At service-level, declares available delegations. In UCP + * responses, confirms accepted delegations for this session. + */ + delegate?: string[]; + [property: string]: any; +} + +export type EmbeddedColorScheme = "light" | "dark"; + +/** + * Transport protocol for this service binding. + */ +export type Transport = "rest" | "mcp" | "a2a" | "embedded"; + +/** + * Application-level status of the UCP operation. + */ +export type UcpMetadataStatus = "success" | "error"; + +/** + * Order schema with line items, buyer-facing fulfillment expectations, and event logs. + */ +export interface Order { + /** + * Post-order events (refunds, returns, credits, disputes, cancellations, etc.) that exist + * independently of fulfillment. + */ + adjustments?: Adjustment[]; + /** + * Snapshot of the attribution associated with the originating checkout. Read-only on the + * order. + */ + attribution?: { [key: string]: string }; + /** + * Associated checkout ID for reconciliation. + */ + checkout_id: string; + /** + * ISO 4217 currency code. MUST match the currency from the originating checkout session. + */ + currency: string; + /** + * Fulfillment data: buyer expectations and what actually happened. + */ + fulfillment: Fulfillment; + /** + * Unique order identifier. + */ + id: string; + /** + * Human-readable label for identifying the order. MUST only be provided by the business. + */ + label?: string; + /** + * Line items representing what was purchased — can change post-order via edits or exchanges. + */ + line_items: OrderLineItem[]; + /** + * Business outcome messages (errors, warnings, informational). Present when the business + * needs to communicate status or issues to the platform. + */ + messages?: CheckoutMessage[]; + /** + * Permalink to access the order on merchant site. + */ + permalink_url: string; + /** + * Different totals for the order. + */ + totals: Total[]; + ucp: UCPOrderResponseSchema; + [property: string]: any; +} + +/** + * Post-order event that exists independently of fulfillment. Typically represents money + * movements but can be any post-order change. Polymorphic type that can optionally + * reference line items. + */ +export interface Adjustment { + /** + * Human-readable reason or description (e.g., 'Defective item', 'Customer requested'). + */ + description?: string; + /** + * Adjustment event identifier. + */ + id: string; + /** + * Which line items and quantities are affected (optional). + */ + line_items?: AdjustmentLineItem[]; + /** + * RFC 3339 timestamp when this adjustment occurred. + */ + occurred_at: string; + /** + * Adjustment status. + */ + status: AdjustmentStatus; + /** + * Adjustment totals breakdown. Signed values - negative for money returned to buyer + * (refunds, credits), positive for additional charges (exchanges). + */ + totals?: Total[]; + /** + * Type of adjustment (open string). Typically money-related like: refund, return, credit, + * price_adjustment, dispute, cancellation. Can be any value that makes sense for the + * merchant's business. + */ + type: string; + [property: string]: any; +} + +export interface AdjustmentLineItem { + /** + * Line item ID reference. + */ + id: string; + /** + * Signed quantity affected by this adjustment. Negative values represent reductions (e.g. + * returns); positive values represent additions (e.g. exchanges). + */ + quantity: number; + [property: string]: any; +} + +/** + * Adjustment status. + */ +export type AdjustmentStatus = "pending" | "completed" | "failed"; + +/** + * Fulfillment data: buyer expectations and what actually happened. + */ +export interface Fulfillment { + /** + * Append-only event log of actual shipments. Each event references line items by ID. + */ + events?: FulfillmentEvent[]; + /** + * Buyer-facing groups representing when/how items will be delivered. Can be split, merged, + * or adjusted post-order. + */ + expectations?: Expectation[]; + [property: string]: any; +} + +/** + * Append-only fulfillment event representing an actual shipment. References line items by + * ID. + */ +export interface FulfillmentEvent { + /** + * Carrier name (e.g., 'FedEx', 'USPS'). + */ + carrier?: string; + /** + * Human-readable description of the shipment status or delivery information (e.g., + * 'Delivered to front door', 'Out for delivery'). + */ + description?: string; + /** + * Fulfillment event identifier. + */ + id: string; + /** + * Which line items and quantities are fulfilled in this event. + */ + line_items: EventLineItem[]; + /** + * RFC 3339 timestamp when this fulfillment event occurred. + */ + occurred_at: string; + /** + * Carrier tracking number (required if type != processing). + */ + tracking_number?: string; + /** + * URL to track this shipment (required if type != processing). + */ + tracking_url?: string; + /** + * Fulfillment event type. Common values include: processing (preparing to ship), shipped + * (handed to carrier), in_transit (in delivery network), delivered (received by buyer), + * failed_attempt (delivery attempt failed), canceled (fulfillment canceled), undeliverable + * (cannot be delivered), returned_to_sender (returned to merchant). + */ + type: string; + [property: string]: any; +} + +export interface EventLineItem { + /** + * Line item ID reference. + */ + id: string; + /** + * Quantity fulfilled in this event. + */ + quantity: number; + [property: string]: any; +} + +/** + * Buyer-facing fulfillment expectation representing logical groupings of items (e.g., + * 'package'). Can be split, merged, or adjusted post-order to set buyer expectations for + * when/how items arrive. + */ +export interface Expectation { + /** + * Human-readable delivery description (e.g., 'Arrives in 5-8 business days'). + */ + description?: string; + /** + * Delivery destination address. + */ + destination: PostalAddress; + /** + * When this expectation can be fulfilled: 'now' or ISO 8601 timestamp for future date + * (backorder, pre-order). + */ + fulfillable_on?: string; + /** + * Expectation identifier. + */ + id: string; + /** + * Which line items and quantities are in this expectation. + */ + line_items: ExpectationLineItem[]; + /** + * Delivery method type (shipping, pickup, digital). + */ + method_type: MethodType; + [property: string]: any; +} + +export interface ExpectationLineItem { + /** + * Line item ID reference. + */ + id: string; + /** + * Quantity of this item in this expectation. + */ + quantity: number; + [property: string]: any; +} + +/** + * Delivery method type (shipping, pickup, digital). + */ +export type MethodType = "shipping" | "pickup" | "digital"; + +export interface OrderLineItem { + /** + * Line item identifier. + */ + id: string; + /** + * Product data (id, title, price, image_url). + */ + item: Item; + /** + * Parent line item identifier for any nested structures. + */ + parent_id?: string; + /** + * Quantity tracking for the line item. + */ + quantity: LineItemQuantity; + /** + * Derived status: removed if quantity.total == 0, fulfilled if quantity.total > 0 and + * quantity.fulfilled == quantity.total, partial if quantity.total > 0 and + * quantity.fulfilled > 0, otherwise processing. + */ + status: LineItemStatus; + /** + * Line item totals breakdown. + */ + totals: Total[]; + [property: string]: any; +} + +/** + * Quantity tracking for the line item. + */ +export interface LineItemQuantity { + /** + * Quantity fulfilled so far. + */ + fulfilled: number; + /** + * Quantity from the original checkout. + */ + original?: number; + /** + * Current total active quantity. May differ from original due to post-order modifications + * (e.g., returns or cancellations). + */ + total: number; + [property: string]: any; +} + +/** + * Derived status: removed if quantity.total == 0, fulfilled if quantity.total > 0 and + * quantity.fulfilled == quantity.total, partial if quantity.total > 0 and + * quantity.fulfilled > 0, otherwise processing. + */ +export type LineItemStatus = "processing" | "partial" | "fulfilled" | "removed"; + +/** + * UCP metadata for order responses. No payment handlers needed post-purchase. + * + * Base UCP metadata with shared properties for all schema types. + */ +export interface UCPOrderResponseSchema { + /** + * Capability registry keyed by reverse-domain name. + */ + capabilities?: { [key: string]: UcpCapability[] }; + /** + * Payment handler registry keyed by reverse-domain name. + */ + payment_handlers?: { [key: string]: UcpPaymentHandler[] }; + /** + * Service registry keyed by reverse-domain name. + */ + services?: { [key: string]: UCPOrderResponseSchemaService[] }; + /** + * Application-level status of the UCP operation. + */ + status?: UcpMetadataStatus; + version: string; + [property: string]: any; +} + +/** + * Shared foundation for all UCP entities. + */ +export interface UCPOrderResponseSchemaService { + /** + * Entity-specific configuration. Structure defined by each entity's schema. + */ + config?: { [key: string]: any }; + /** + * Unique identifier for this entity instance. Used to disambiguate when multiple instances + * exist. + */ + id?: string; + /** + * URL to JSON Schema defining this entity's structure and payloads. + */ + schema?: string; + /** + * URL to human-readable specification document. + */ + spec?: string; + /** + * Entity version in YYYY-MM-DD format. + */ + version: string; + /** + * Endpoint URL for this transport binding. + */ + endpoint?: string; + /** + * Transport protocol for this service binding. + */ + transport: Transport; + [property: string]: any; +} + +/** + * Generic error response when business logic prevents resource creation or failed to + * retrieve resource. Used when no valid resource can be established. + */ +export interface UcpErrorResponse { + /** + * URL for buyer handoff or session recovery. + */ + continue_url?: string; + /** + * Array of messages describing why the operation failed. + */ + messages: CheckoutMessage[]; + /** + * UCP protocol metadata. Status MUST be 'error' for error response. + */ + ucp: UcpErrorMetadata; +} + +/** + * UCP protocol metadata. Status MUST be 'error' for error response. + * + * UCP metadata with status 'error'. Use for response branches that carry error + * information. + * + * Base UCP metadata with shared properties for all schema types. + */ +export interface UcpErrorMetadata { + /** + * Capability registry keyed by reverse-domain name. + */ + capabilities?: { [key: string]: UcpCapability[] }; + /** + * Payment handler registry keyed by reverse-domain name. + */ + payment_handlers?: { [key: string]: UcpPaymentHandler[] }; + /** + * Service registry keyed by reverse-domain name. + */ + services?: { [key: string]: UCPOrderResponseSchemaService[] }; + /** + * Application-level status of the UCP operation. + */ + status: UcpErrorMetadataStatus; + version: string; + [property: string]: any; +} + +/** + * Application-level status of the UCP operation. + */ +export type UcpErrorMetadataStatus = "error"; + +/** + * Checkout state after instrument selection. + * + * Generic error response when business logic prevents resource creation or failed to + * retrieve resource. Used when no valid resource can be established. + */ +export interface InstrumentsChangeResult { + /** + * Partial checkout update with payment instrument selection. + */ + checkout?: InstrumentsChangeCheckout; + /** + * UCP protocol metadata. Status MUST be 'error' for error response. + */ + ucp: UcpObject; + /** + * URL for buyer handoff or session recovery. + */ + continue_url?: string; + /** + * Array of messages describing why the operation failed. + */ + messages?: CheckoutMessage[]; + [property: string]: any; +} + +/** + * Partial checkout update with payment instrument selection. + */ +export interface InstrumentsChangeCheckout { + /** + * Payment instruments with selected instrument ID. + */ + payment?: InstrumentsChangePayment; + [property: string]: any; +} + +/** + * Payment instruments with selected instrument ID. + * + * Payment configuration containing handlers. + */ +export interface InstrumentsChangePayment { + /** + * The payment instruments available for this payment. Each instrument is associated with a + * specific handler via the handler_id field. Handlers can extend the base + * payment_instrument schema to add handler-specific fields. + */ + instruments?: SelectedPaymentInstrument[]; + /** + * ID of the selected payment instrument. + */ + selected_instrument_id?: string; + [property: string]: any; +} + +/** + * UCP metadata with status 'success'. Use for response branches that carry the expected + * payload. + * + * Base UCP metadata with shared properties for all schema types. + * + * UCP protocol metadata. Status MUST be 'error' for error response. + * + * UCP metadata with status 'error'. Use for response branches that carry error information. + */ +export interface UcpObject { + /** + * Capability registry keyed by reverse-domain name. + */ + capabilities?: { [key: string]: CapabilityElement[] }; + /** + * Payment handler registry keyed by reverse-domain name. + */ + payment_handlers?: { [key: string]: PaymentHandlerElement[] }; + /** + * Service registry keyed by reverse-domain name. + */ + services?: { [key: string]: UcpServiceObject[] }; + /** + * Application-level status of the UCP operation. + */ + status: UcpMetadataStatus; + version: string; + [property: string]: any; +} + +/** + * Shared foundation for all UCP entities. + * + * Capability reference in responses. Only name/version required to confirm active + * capabilities. + */ +export interface CapabilityElement { + /** + * Entity-specific configuration. Structure defined by each entity's schema. + */ + config?: { [key: string]: any }; + /** + * Unique identifier for this entity instance. Used to disambiguate when multiple instances + * exist. + */ + id?: string; + /** + * URL to JSON Schema defining this entity's structure and payloads. + */ + schema?: string; + /** + * URL to human-readable specification document. + */ + spec?: string; + /** + * Entity version in YYYY-MM-DD format. + */ + version: string; + /** + * Parent capability(s) this extends. Present for extensions, absent for root capabilities. + * Use array for multi-parent extensions. + */ + extends?: string[] | string; + [property: string]: any; +} + +/** + * Shared foundation for all UCP entities. + * + * Handler reference in responses. May include full config state for runtime usage of the + * handler. + */ +export interface PaymentHandlerElement { + /** + * Entity-specific configuration. Structure defined by each entity's schema. + */ + config?: { [key: string]: any }; + /** + * Unique identifier for this entity instance. Used to disambiguate when multiple instances + * exist. + */ + id: string; + /** + * URL to JSON Schema defining this entity's structure and payloads. + */ + schema?: string; + /** + * URL to human-readable specification document. + */ + spec?: string; + /** + * Entity version in YYYY-MM-DD format. + */ + version: string; + /** + * Instrument types this handler supports, with optional constraints. When absent, every + * instrument should be considered available. + */ + available_instruments?: PaymentHandlerAvailableInstrument[]; + [property: string]: any; +} + +/** + * An instrument type available from a payment handler with optional constraints. + */ +export interface PaymentHandlerAvailableInstrument { + /** + * Constraints on this instrument type. Structure depends on instrument type and active + * capabilities. + */ + constraints?: { [key: string]: any }; + /** + * The instrument type identifier (e.g., 'card', 'gift_card'). References an instrument + * schema's type constant. + */ + type: string; + [property: string]: any; +} + +/** + * Shared foundation for all UCP entities. + */ +export interface UcpServiceObject { + /** + * Entity-specific configuration. Structure defined by each entity's schema. + */ + config?: { [key: string]: any }; + /** + * Unique identifier for this entity instance. Used to disambiguate when multiple instances + * exist. + */ + id?: string; + /** + * URL to JSON Schema defining this entity's structure and payloads. + */ + schema?: string; + /** + * URL to human-readable specification document. + */ + spec?: string; + /** + * Entity version in YYYY-MM-DD format. + */ + version: string; + /** + * Endpoint URL for this transport binding. + */ + endpoint?: string; + /** + * Transport protocol for this service binding. + */ + transport: Transport; + [property: string]: any; +} + +/** + * Checkout state with payment credential ready for completion. + * + * Generic error response when business logic prevents resource creation or failed to + * retrieve resource. Used when no valid resource can be established. + */ +export interface CredentialResult { + /** + * Partial checkout update with payment credential. + */ + checkout?: CredentialCheckout; + /** + * UCP protocol metadata. Status MUST be 'error' for error response. + */ + ucp: UcpObject; + /** + * URL for buyer handoff or session recovery. + */ + continue_url?: string; + /** + * Array of messages describing why the operation failed. + */ + messages?: CheckoutMessage[]; + [property: string]: any; +} + +/** + * Partial checkout update with payment credential. + */ +export interface CredentialCheckout { + payment?: Payment; + [property: string]: any; +} + +/** + * Handshake from merchant to host + */ +export interface EcReadyParams { + auth?: Auth; + /** + * Delegation types the merchant accepts. Must be subset of checkout.embedded.delegations. + */ + delegate: string[]; + [property: string]: any; +} + +export interface Auth { + type?: string; + [property: string]: any; +} diff --git a/protocol/languages/typescript/src/web.d.ts b/protocol/languages/typescript/src/web.d.ts new file mode 100644 index 00000000..4aa681b4 --- /dev/null +++ b/protocol/languages/typescript/src/web.d.ts @@ -0,0 +1,5 @@ +export * from "./generated/WebModels"; +import type { CheckoutMessage } from "./generated/WebModels"; +export type CheckoutMessageError = CheckoutMessage & { + readonly type: "error"; +}; diff --git a/protocol/languages/typescript/src/web.ts b/protocol/languages/typescript/src/web.ts new file mode 100644 index 00000000..62c0cc91 --- /dev/null +++ b/protocol/languages/typescript/src/web.ts @@ -0,0 +1,9 @@ +export * from "./generated/WebModels"; + +import type {CheckoutMessage} from "./generated/WebModels"; + +// Narrowing alias for the `error` variant of the message union. The generated +// `CheckoutMessage` collapses the three message variants into a single +// interface, so consumers that need to talk specifically about errors get the +// discriminated subtype via this alias. +export type CheckoutMessageError = CheckoutMessage & {readonly type: "error"}; diff --git a/protocol/package.json b/protocol/package.json index cbdcc13b..702a1347 100644 --- a/protocol/package.json +++ b/protocol/package.json @@ -9,7 +9,8 @@ "check-tools": "./scripts/check_codegen_tools.sh", "codegen:kotlin": "./scripts/generate_models.sh --lang kotlin", "codegen:swift": "./scripts/generate_models.sh --lang swift", - "codegen:typescript": "./scripts/generate_models.sh --lang typescript" + "codegen:typescript": "./scripts/generate_models.sh --lang typescript", + "codegen:typescript-ucp": "./scripts/generate_models.sh --lang typescript-ucp" }, "devDependencies": { "quicktype": "23.2.6" diff --git a/protocol/scripts/generate_models.mjs b/protocol/scripts/generate_models.mjs index cf90f861..291e6755 100755 --- a/protocol/scripts/generate_models.mjs +++ b/protocol/scripts/generate_models.mjs @@ -39,7 +39,7 @@ const SCHEMA_SOURCE_DIR = path.join(PROTOCOL_DIR, "schemas"); const SERVICES_DIR = path.join(PROTOCOL_DIR, "services", "shopping"); function usage() { - console.error("Usage: generate_models.sh --lang [--output ]"); + console.error("Usage: generate_models.sh --lang [--output ]"); } function parseArgs(argv) { @@ -81,11 +81,12 @@ function normalizeLang(lang) { case "kotlin": case "swift": case "typescript": + case "typescript-ucp": return lang; case "ts": return "typescript"; default: - throw new Error(`Unsupported language: ${lang}. Use kotlin, swift, or typescript.`); + throw new Error(`Unsupported language: ${lang}. Use kotlin, swift, typescript, or typescript-ucp.`); } } @@ -175,10 +176,12 @@ async function prepareCodegenSchemas(tempDir) { // Message discriminators are defined across the message variant schemas. Give // each variant the same local title so quicktype emits a single MessageType symbol. + // PR #202 moved these files from `shopping/types/` into `common/types/`. + const commonTypesDir = path.join(schemaDir, "common", "types"); for (const messageSchema of ["message_error", "message_warning", "message_info"]) { - const schema = await readJson(path.join(specDir, "types", `${messageSchema}.json`)); + const schema = await readJson(path.join(commonTypesDir, `${messageSchema}.json`)); schema.properties.type.title = "MessageType"; - await writeJson(path.join(specDir, "types", `${messageSchema}.json`), schema); + await writeJson(path.join(commonTypesDir, `${messageSchema}.json`), schema); } // Extension schemas bring in repeated generic property names like `type` and @@ -226,6 +229,109 @@ async function extractResultSchema(specDir, methodName, outputFile, rootTitle, c await writeJson(path.join(specDir, outputFile), schema); } +// Synthesize a JSON Schema object from an OpenRPC method's `params` array so +// quicktype can emit a named type for the params payload. Used by the web +// target to give `EcReadyParams` a stable name without duplicating the OpenRPC +// definition by hand. +async function extractParamsSchema(specDir, methodName, outputFile, rootTitle) { + const service = await readJson(path.join(SERVICES_DIR, "embedded.openrpc.json")); + const method = service.methods.find((candidate) => candidate.name === methodName); + if (method === undefined) { + throw new Error(`Missing OpenRPC method ${methodName}`); + } + + const properties = {}; + const required = []; + for (const param of method.params ?? []) { + if (typeof param?.name !== "string" || param.schema === undefined) { + continue; + } + properties[param.name] = structuredClone(param.schema); + if (param.required === true) { + required.push(param.name); + } + } + + const schema = { + title: rootTitle, + description: method.summary ?? method.description ?? `Params for ${methodName}.`, + type: "object", + properties, + additionalProperties: true, + }; + if (required.length > 0) { + schema.required = required; + } + rewriteRefs(schema); + schema.components = service.components; + + await writeJson(path.join(specDir, outputFile), schema); +} + +// `typescript-ucp` target reuses every disambiguation prepared by +// `prepareCodegenSchemas` (which targets the shopping checkout/order surface) +// and adds local titles on the UCP transport schemas plus a handful of shopping +// types so the generated symbol names match the public surface of +// `@shopify/checkout-kit-protocol/web`. These overrides are scoped to the +// typescript-ucp target so existing kotlin/swift/typescript outputs are unchanged. +async function prepareTypescriptUcpTitles(schemaDir) { + const ucp = await readJson(path.join(schemaDir, "ucp.json")); + ucp.$defs.response_checkout_schema.title = "UcpMetadata"; + ucp.$defs.error.title = "UcpErrorMetadata"; + ucp.$defs.success.title = "UcpSuccessMetadata"; + await writeJson(path.join(schemaDir, "ucp.json"), ucp); + + const service = await readJson(path.join(schemaDir, "service.json")); + service.$defs.response_schema.title = "UcpService"; + await writeJson(path.join(schemaDir, "service.json"), service); + + const capability = await readJson(path.join(schemaDir, "capability.json")); + capability.$defs.response_schema.title = "UcpCapability"; + await writeJson(path.join(schemaDir, "capability.json"), capability); + + const paymentHandler = await readJson(path.join(schemaDir, "payment_handler.json")); + paymentHandler.$defs.response_schema.title = "UcpPaymentHandler"; + await writeJson(path.join(schemaDir, "payment_handler.json"), paymentHandler); + + // Align generated symbol names with the previously hand-written wire payload + // types exposed by the web component's public API (`Checkout`, `Buyer`, + // `CheckoutLineItem`, `CheckoutMessage`, `Total`, `OrderConfirmation`, + // `UcpErrorResponse`). The kotlin/swift/typescript targets keep their existing + // names because these overrides only run for `--lang web`. + const specDir = path.join(schemaDir, "shopping"); + const commonTypesDir = path.join(schemaDir, "common", "types"); + + const lineItem = await readJson(path.join(specDir, "types", "line_item.json")); + lineItem.title = "CheckoutLineItem"; + await writeJson(path.join(specDir, "types", "line_item.json"), lineItem); + + // `prepareCodegenSchemas` retitled these to `LineItemTotal`/`CheckoutTotal`. + // For web, both line-item totals and checkout totals collapse to a single + // `Total` type matching the previously hand-written shape. Replace the + // wrapping `allOf` in totals.json so the items become a plain ref to total.json + // — without this, quicktype keeps them as structurally distinct types (the + // checkout totals wrapper adds a `lines` field) and emits a fallback name. + const total = await readJson(path.join(specDir, "types", "total.json")); + total.title = "Total"; + await writeJson(path.join(specDir, "types", "total.json"), total); + + const totals = await readJson(path.join(specDir, "types", "totals.json")); + totals.items = {$ref: "total.json"}; + await writeJson(path.join(specDir, "types", "totals.json"), totals); + + const errorResponse = await readJson(path.join(commonTypesDir, "error_response.json")); + errorResponse.title = "UcpErrorResponse"; + await writeJson(path.join(commonTypesDir, "error_response.json"), errorResponse); + + const message = await readJson(path.join(commonTypesDir, "message.json")); + message.title = "CheckoutMessage"; + await writeJson(path.join(commonTypesDir, "message.json"), message); + + const messageError = await readJson(path.join(commonTypesDir, "message_error.json")); + messageError.title = "CheckoutMessageError"; + await writeJson(path.join(commonTypesDir, "message_error.json"), messageError); +} + async function runQuicktype(args) { await run(QUICKTYPE_BIN, args); } @@ -262,13 +368,16 @@ async function normalizeGeneratedFile(output, transform = (source) => source) { } function commonSchemaSources(specDir) { + // `error_response.json` lives under `common/types/` after PR #202; the rest + // are still under `shopping/`. + const schemaDir = path.join(specDir, ".."); return [ "--src", path.join(specDir, "checkout.json"), "--src", path.join(specDir, "order.json"), "--src", - path.join(specDir, "types", "error_response.json"), + path.join(schemaDir, "common", "types", "error_response.json"), "--src", path.join(specDir, "instruments_change_result.json"), "--src", @@ -378,6 +487,66 @@ async function generateTypescript(specDir, output) { return declarationOutput; } +function typescriptUcpSchemaSources(specDir, schemaDir) { + return [ + ...commonSchemaSources(specDir), + "--src", + path.join(schemaDir, "ucp.json"), + "--src", + path.join(schemaDir, "service.json"), + "--src", + path.join(schemaDir, "capability.json"), + "--src", + path.join(schemaDir, "payment_handler.json"), + "--src", + path.join(specDir, "ec_ready_params.json"), + ]; +} + +async function generateTypescriptUcp(specDir, schemaDir, output) { + await fs.mkdir(path.dirname(output), {recursive: true}); + // Drop `--nice-property-names` and `--acronym-style camel`: the web component + // reads raw postMessage JSON without key conversion, so the generated types + // must keep schema property names in their snake_case wire form. `--just-types` + // keeps the file declaration-only, matching the public surface previously + // held by the hand-written `ucp-embed-types.ts`. + await runQuicktype([ + "--lang", + "ts", + "--src-lang", + "schema", + "--just-types", + "--prefer-unions", + "--no-date-times", + ...typescriptUcpSchemaSources(specDir, schemaDir), + "-o", + output, + ]); + + await normalizeGeneratedFile(output, (source) => source.replace(/^type /gm, "export type ")); + + const declarationOutput = path.join(PROTOCOL_DIR, "languages", "typescript", "src", "web.d.ts"); + const tscBin = path.join(REPO_ROOT, "platforms", "react-native", "node_modules", "typescript", "bin", "tsc"); + const webEntry = path.join(PROTOCOL_DIR, "languages", "typescript", "src", "web.ts"); + + await run("node", [ + tscBin, + "--declaration", + "--emitDeclarationOnly", + "--noEmit", + "false", + "--rootDir", + path.join(PROTOCOL_DIR, "languages", "typescript", "src"), + "--declarationDir", + path.join(PROTOCOL_DIR, "languages", "typescript", "src"), + "--pretty", + "false", + webEntry, + ]); + + return declarationOutput; +} + async function main() { const {lang, output} = parseArgs(process.argv.slice(2)); await requireQuicktype(); @@ -437,8 +606,17 @@ async function main() { console.log(`Generated ${target}, TypeScript protocol notifications, and ${declarationOutput}`); break; } + case "typescript-ucp": { + const schemaDir = path.join(tempDir, "schemas"); + await extractParamsSchema(specDir, "ec.ready", "ec_ready_params.json", "EcReadyParams"); + await prepareTypescriptUcpTitles(schemaDir); + const target = output || path.join(PROTOCOL_DIR, "languages", "typescript", "src", "generated", "WebModels.ts"); + const declarationOutput = await generateTypescriptUcp(specDir, schemaDir, target); + console.log(`Generated ${target} and ${declarationOutput}`); + break; + } default: - throw new Error(`Unsupported language: ${lang}. Use kotlin, swift, or typescript.`); + throw new Error(`Unsupported language: ${lang}. Use kotlin, swift, typescript, or typescript-ucp.`); } } finally { await fs.rm(tempDir, {recursive: true, force: true});