From 09804c142752ab672150dda6a809c26d2cbbb31b Mon Sep 17 00:00:00 2001 From: Marius Ahsmus Date: Fri, 3 Jul 2026 16:14:51 +0200 Subject: [PATCH 01/19] feat: github basic actions get Repository, Issues & PRs --- actions/github-action/.gitignore | 3 + actions/github-action/Dockerfile | 13 + actions/github-action/README.md | 0 actions/github-action/package-lock.json | 3372 +++++++++++++++++ actions/github-action/package.json | 23 + .../src/data_types/githubCommon.ts | 72 + .../src/data_types/githubIssue.ts | 38 + .../src/data_types/githubPullRequest.ts | 61 + .../src/data_types/githubRepository.ts | 46 + .../src/functions/getIssuesFunction.ts | 74 + .../src/functions/getPullRequestsFunction.ts | 75 + .../src/functions/getRepositoryFunction.ts | 38 + actions/github-action/src/helpers.ts | 40 + actions/github-action/src/index.ts | 76 + actions/github-action/tsconfig.json | 19 + actions/github-action/vite.config.ts | 18 + 16 files changed, 3968 insertions(+) create mode 100644 actions/github-action/.gitignore create mode 100644 actions/github-action/Dockerfile create mode 100644 actions/github-action/README.md create mode 100644 actions/github-action/package-lock.json create mode 100644 actions/github-action/package.json create mode 100644 actions/github-action/src/data_types/githubCommon.ts create mode 100644 actions/github-action/src/data_types/githubIssue.ts create mode 100644 actions/github-action/src/data_types/githubPullRequest.ts create mode 100644 actions/github-action/src/data_types/githubRepository.ts create mode 100644 actions/github-action/src/functions/getIssuesFunction.ts create mode 100644 actions/github-action/src/functions/getPullRequestsFunction.ts create mode 100644 actions/github-action/src/functions/getRepositoryFunction.ts create mode 100644 actions/github-action/src/helpers.ts create mode 100644 actions/github-action/src/index.ts create mode 100644 actions/github-action/tsconfig.json create mode 100644 actions/github-action/vite.config.ts diff --git a/actions/github-action/.gitignore b/actions/github-action/.gitignore new file mode 100644 index 0000000..ddc3c2a --- /dev/null +++ b/actions/github-action/.gitignore @@ -0,0 +1,3 @@ +.env +node_modules/ +dist/ diff --git a/actions/github-action/Dockerfile b/actions/github-action/Dockerfile new file mode 100644 index 0000000..cbca323 --- /dev/null +++ b/actions/github-action/Dockerfile @@ -0,0 +1,13 @@ +FROM node:24-alpine + +WORKDIR /app + +COPY package.json package-lock.json* ./ + +RUN npm install + +COPY . . + +RUN npm run build + +CMD ["npm", "run", "start"] diff --git a/actions/github-action/README.md b/actions/github-action/README.md new file mode 100644 index 0000000..e69de29 diff --git a/actions/github-action/package-lock.json b/actions/github-action/package-lock.json new file mode 100644 index 0000000..ab1fd7a --- /dev/null +++ b/actions/github-action/package-lock.json @@ -0,0 +1,3372 @@ +{ + "name": "@code0-tech/github-action", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "@code0-tech/github-action", + "version": "1.0.0", + "dependencies": { + "@code0-tech/hercules": "^1.0.0", + "axios": "^1.7.7" + }, + "devDependencies": { + "@types/node": "^22.0.0", + "tsx": "^4.0.0", + "typescript": "^5.9.3", + "vite": "^8.0.3" + } + }, + "node_modules/@clack/core": { + "version": "1.0.0-alpha.4", + "resolved": "https://registry.npmjs.org/@clack/core/-/core-1.0.0-alpha.4.tgz", + "integrity": "sha512-VCtU+vjyKPMSakVrB9q1bOnXN7QW/w4+YQDQCOF59GrzydW+169i0fVx/qzRRXJgt8KGj/pZZ/JxXroFZIDByg==", + "license": "MIT", + "peer": true, + "dependencies": { + "picocolors": "^1.0.0", + "sisteransi": "^1.0.5" + } + }, + "node_modules/@clack/prompts": { + "version": "1.0.0-alpha.4", + "resolved": "https://registry.npmjs.org/@clack/prompts/-/prompts-1.0.0-alpha.4.tgz", + "integrity": "sha512-KnmtDF2xQGoI5AlBme9akHtvCRV0RKAARUXHBQO2tMwnY8B08/4zPWigT7uLK25UPrMCEqnyQPkKRjNdhPbf8g==", + "license": "MIT", + "peer": true, + "dependencies": { + "@clack/core": "1.0.0-alpha.4", + "picocolors": "^1.0.0", + "sisteransi": "^1.0.5" + } + }, + "node_modules/@code0-tech/hercules": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@code0-tech/hercules/-/hercules-1.0.2.tgz", + "integrity": "sha512-MXH310yKy6WtT3vSQlpw8YuxOGX5r7RxtNHGMkZE+uxF1/14sTUE0pOIgPlrs87ufIUZEsm1UpJeF+Pupdol3w==", + "license": "ISC", + "peerDependencies": { + "@code0-tech/tucana": "0.0.74", + "@grpc/grpc-js": "^1.14.3", + "@protobuf-ts/grpc-backend": "^2.11.1", + "@protobuf-ts/grpc-transport": "^2.11.1", + "@protobuf-ts/runtime": "^2.11.1", + "@protobuf-ts/runtime-rpc": "^2.11.1", + "reflect-metadata": "^0.2.2", + "ts-morph": "^28.0.0", + "ts-to-zod": "^5.1.0", + "zod": "^4.4.3", + "zod-to-ts": "^2.1.0" + } + }, + "node_modules/@code0-tech/tucana": { + "version": "0.0.74", + "resolved": "https://registry.npmjs.org/@code0-tech/tucana/-/tucana-0.0.74.tgz", + "integrity": "sha512-AgCl812Sn/MyY1+cRG0pdN0Uj7z93hDa4E9bclaf9hS5wc1PrlQSutDgePvJFR/VBWoeYQczne7MNP7RDu9NRg==", + "license": "MIT", + "peer": true + }, + "node_modules/@emnapi/core": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@emnapi/core/-/core-1.11.1.tgz", + "integrity": "sha512-RSvbQmHzdKzNsLYa/wHrbc3KN4sYLKAdPZxqiM2HATqv/SBk2/ENSHpvXGaLOMcsAyz0poEGqkmmKYG3OWiJEQ==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "@emnapi/wasi-threads": "1.2.2", + "tslib": "^2.4.0" + } + }, + "node_modules/@emnapi/runtime": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.11.1.tgz", + "integrity": "sha512-vgj7R3y3Wgx24IQaGPA/R6YFXLHVMOZ0uVEyIQPaWs+rd1AzfEMXlAC22FYwO1XkKR6NPsq7mUandH8oIRdZFw==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, + "node_modules/@emnapi/wasi-threads": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/@emnapi/wasi-threads/-/wasi-threads-1.2.2.tgz", + "integrity": "sha512-c95qOXkHdydNKhscBTebqEC1CVAZpyqOfVfBzQ1qgzyl3gfeldUjIggDbIZgDKsHLgnsM+igH7TJ/eAasaVuMA==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.28.1.tgz", + "integrity": "sha512-Svl7tq8k/08+p6CXPpRjQ1fKX+1odH/BQbb48fV6fj3CWHhsoIOoY87w1oHXm0qEpkIK3ZfVgp0hed3XBXzXMQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.28.1.tgz", + "integrity": "sha512-0k2F129Xdio1TdJfzJ8sy1Q47vUD2NnwdhiAf7drUN1EBTfPf4hsFCtmMgu/6m8JSzsBrlmVjudMBQqOfG8usQ==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm64": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.28.1.tgz", + "integrity": "sha512-34EGEbCIAgosYz6goLcopX6Mo7NyGv9tfwEM2/7Ce2VcVRk568iSvniGWcUXIy7wEDR1wzolcxcriFVrWYcwBg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-x64": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.28.1.tgz", + "integrity": "sha512-dbwY7ltSMDWsRatcRpCnES4F+im88OCUgGZjy52shC7GqHRE/cYlxNbB4Z4UpJswpcc4Qxd2oE/ufM0p61IKng==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.28.1.tgz", + "integrity": "sha512-TZbWkQY7kvTAXbXUT7uVACR5cMHsDiSz9z7ZKAX/RTq/WJEk3QyRr0wZpNhBDX+/0CtdqUIJlOiodQcta6tY3Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.28.1.tgz", + "integrity": "sha512-zfdzgK9ACBNZLI/CyHTOx81SyNbM6YXn7rxSgX97VjyiPl9W1i4Ka4fgKECEoFCKGpvBj5qArWIGgQjOwkgskQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.28.1.tgz", + "integrity": "sha512-wG2EA8ENdEI0qhkSZMjfqrdY+ziCYCPMmtZjjIwOmXFjmyzEHn+UUxk5of+SYsjtfs3VpnlC7QLzSI5hY/rOAw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.28.1.tgz", + "integrity": "sha512-i7dZ9vQgnvSCzi/rYCXNgtF/U+eKZNJBzu3eTQbRgHnM7tNSizLOkRFAl3qzVc/Op/u5YkHHa4pf/3DOYHthLQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.28.1.tgz", + "integrity": "sha512-qVXBOHQS+d5Y722GwJzJUtOLlX7km3CraOaGormF1pDtPd2C/l1SHRPgjLunLGe51Sh5YYWKMFDyV4SxgMQYTQ==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.28.1.tgz", + "integrity": "sha512-yHs+0uc8+nvEAfAfxrWQKK5peSNzBc4PegcMO0EJ2hT71uA7vB8Ihg2e77R2P7SG5uYjPbHlLLmve4LLLRCf0g==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.28.1.tgz", + "integrity": "sha512-d1z4ZuP0ajrfz/FhGT4vv278rX8KnPPJx8i5+AtK7TYbx9Le9F1hyzurZpkEyjkGa9dUGhQow4C1NmeGvqxN2w==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.28.1.tgz", + "integrity": "sha512-M5sRjUVZrkm1OAPR3dlOYzNmN+loZKGVi1VUQGrwuqLcbR6qeAz+famMhjASeH3YVKvZz+zT1jlh/keC3Rj/lg==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.28.1.tgz", + "integrity": "sha512-mRObBZeHh2OxcBFPWE/FjylkRgZdYuiTR3vaTozquCGOH14iP9oN4x4Ge81CoIDYQrXmIxpFumJBu5MtZpnQJQ==", + "cpu": [ + "mips64el" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.28.1.tgz", + "integrity": "sha512-slScBsMAb3GFDcdrCgLwZtPYRoH2H/youv10QiZyRjmsP48fznoveWytSgCI/R0ZcUgpc0ZhIUEx6LHts8yrfQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.28.1.tgz", + "integrity": "sha512-kw0owk1o0GFETUJyW0jc0G4Yzs0BHZn0JDZ8JRT088vjJYX777BAs1fDGxAC+q831qOs2DTC96mNsG2opdfyyQ==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.28.1.tgz", + "integrity": "sha512-/lAIjX8aYFRByhh6L5rYtPEDRqa9de/4V/juOXcta5frjvzXO4/sqEtyytse0g3zZFuWu5cDN0MkLz2qRDD2Ag==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.28.1.tgz", + "integrity": "sha512-u/anNYF2mmVOEDwLtnQ1wOr3EZ9sTNGLWrsYGYwHWzGA3Si84IOkHXlbWTD1NB+9/1lcnweYKO54uhxZydNzfA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-arm64": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.28.1.tgz", + "integrity": "sha512-oks0DYbLwWMmaakTsCb+zL4E+aHRVLom9IJZOAthMQEPiQmydXHkziYEsGYRx0uNV/IjEKGAV941JzH02pflqw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.28.1.tgz", + "integrity": "sha512-aeL6lAnN89Hz43Mlh1G8ARasbuoYvSITDEx0tHh5b7jJnHcssqgjy9Yx430GDpmCa6OyrKoS0aNRjKundRizGg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-arm64": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.28.1.tgz", + "integrity": "sha512-MEFJe5C3R8pwXdZ5Y21oo6m7ePiS0d9pWucn99O/wvyJZChoIQKrQDxKrGeW8F5+T0okTHesAmDeiHDTIq0V/Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.28.1.tgz", + "integrity": "sha512-i/ZLIOafE0Z8cI/XANJAixoJL/uRAoS2xOA3rb0xN+KK0K177cMAsQYkzHtBrtMXAKuAc7HGgcWiZ/sRC1Nxgw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openharmony-arm64": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.28.1.tgz", + "integrity": "sha512-ge+Z7EXFNt2BO1oAMsVpiQ8EwndV9i1xXerAeTIK7AtPs3bKFXQM7nlRxDSIUIMeueR1CNXxqztLzdNeReKBJg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.28.1.tgz", + "integrity": "sha512-BEjgtECkL3vY+SaSQ6nzVfiALUeFxpawyp8Jmf5PtYhf1Ug40N1h/hxlhts+f1FvSvarEigdxS3BlSMI2PJLcQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.28.1.tgz", + "integrity": "sha512-lCv9eK/H6ZJWbE7bh2nw54CZ9M2nupBxJcTsdk/QQnWkdSjKGuxmmH8/GWrlT1eMmZfn4dGcCjRte397WqfQXA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.28.1.tgz", + "integrity": "sha512-zvb/mB2bSCoJOpoCBgYKKpX6YM6mJBlBUVUtVj41DlZJVEB6/0CKlRYxP5wWl1C1ILiCoAU5wZZ4q1P3qeS6Eg==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.28.1.tgz", + "integrity": "sha512-bm4Mowrv+GXMlpWX++EcXw/iLyd1o3+bJkC2DkWXYVvgZCqD/bSj9ctZeAMC3cIxgjRVR2Dufaiu4YPxr5gW1A==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@grpc/grpc-js": { + "version": "1.14.4", + "resolved": "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-1.14.4.tgz", + "integrity": "sha512-k9Dj3DV/itK9D06Y8f190Qgop7/Ui+D0njFV3LHMPwPT75DpXLQohE9Wmz0QElrJnzsjB7KPWiKJbOl7IPDArQ==", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@grpc/proto-loader": "^0.8.0", + "@js-sdsl/ordered-map": "^4.4.2" + }, + "engines": { + "node": ">=12.10.0" + } + }, + "node_modules/@grpc/proto-loader": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/@grpc/proto-loader/-/proto-loader-0.8.1.tgz", + "integrity": "sha512-wtF6h+DY6M3YaDBPAmvuuA6jV8Sif9MjtOI5euKFWRgCDl5PeDpPsHR9u2l6St5ceY8AZgoNDww5+HvEsXFsGg==", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "lodash.camelcase": "^4.3.0", + "long": "^5.0.0", + "protobufjs": "^7.5.5", + "yargs": "^17.7.2" + }, + "bin": { + "proto-loader-gen-types": "build/bin/proto-loader-gen-types.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/@js-sdsl/ordered-map": { + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/@js-sdsl/ordered-map/-/ordered-map-4.4.2.tgz", + "integrity": "sha512-iUKgm52T8HOE/makSxjqoWhe95ZJA1/G1sYsGev2JDKUSS14KAgg1LHb+Ba+IPow0xflbnSkOsZcO08C7w1gYw==", + "license": "MIT", + "peer": true, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/js-sdsl" + } + }, + "node_modules/@napi-rs/wasm-runtime": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/@napi-rs/wasm-runtime/-/wasm-runtime-1.1.6.tgz", + "integrity": "sha512-ZLv/JdUfkvOy9eCnnBaGfiO+XimbjebAeO+MRQqD/B+FR1tnRN0tpKSJHRbE8sFfS6aqsXZ67TQjfwfsxULVbg==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "@tybys/wasm-util": "^0.10.3" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/Brooooooklyn" + }, + "peerDependencies": { + "@emnapi/core": "^1.7.1", + "@emnapi/runtime": "^1.7.1" + } + }, + "node_modules/@oclif/core": { + "version": "4.11.14", + "resolved": "https://registry.npmjs.org/@oclif/core/-/core-4.11.14.tgz", + "integrity": "sha512-cZ5Ktd+rT0PO+o7KBH4vRFTgg+xMLf8F41WK39p8MkXEViZA/Qqe+4lzZT6102zgUxMORET1HtF9t5w8CB3tnQ==", + "license": "MIT", + "peer": true, + "dependencies": { + "ansi-escapes": "^4.3.2", + "ansis": "^3.17.0", + "clean-stack": "^3.0.1", + "cli-spinners": "^2.9.2", + "debug": "^4.4.3", + "ejs": "^3.1.10", + "get-package-type": "^0.1.0", + "indent-string": "^4.0.0", + "is-wsl": "^2.2.0", + "lilconfig": "^3.1.3", + "minimatch": "^10.2.5", + "semver": "^7.8.1", + "string-width": "^4.2.3", + "supports-color": "^8", + "tinyglobby": "^0.2.17", + "widest-line": "^3.1.0", + "wordwrap": "^1.0.0", + "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@oxc-project/types": { + "version": "0.138.0", + "resolved": "https://registry.npmjs.org/@oxc-project/types/-/types-0.138.0.tgz", + "integrity": "sha512-1a7ZKmrRTCoN1XMZ4L0PyyqrMnrNlLyPuOkdSX2MZg7IiIGRUyurNhAm73ptDOraoBcIordsIGKNPKUzy3ZmfA==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/Boshen" + } + }, + "node_modules/@protobuf-ts/grpc-backend": { + "version": "2.11.1", + "resolved": "https://registry.npmjs.org/@protobuf-ts/grpc-backend/-/grpc-backend-2.11.1.tgz", + "integrity": "sha512-llAkJ03SlR/+p70YBTMOAQqdkXWghsTWwlPuGXC+Hj99hDQq6fa2CoVePPqbcn7A7/aLBcPG/9Ag3yqlltldxw==", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@protobuf-ts/runtime": "^2.11.1", + "@protobuf-ts/runtime-rpc": "^2.11.1" + }, + "peerDependencies": { + "@grpc/grpc-js": "^1.8.22" + } + }, + "node_modules/@protobuf-ts/grpc-transport": { + "version": "2.11.1", + "resolved": "https://registry.npmjs.org/@protobuf-ts/grpc-transport/-/grpc-transport-2.11.1.tgz", + "integrity": "sha512-l6wrcFffY+tuNnuyrNCkRM8hDIsAZVLA8Mn7PKdVyYxITosYh60qW663p9kL6TWXYuDCL3oxH8ih3vLKTDyhtg==", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@protobuf-ts/runtime": "^2.11.1", + "@protobuf-ts/runtime-rpc": "^2.11.1" + }, + "peerDependencies": { + "@grpc/grpc-js": "^1.6.0" + } + }, + "node_modules/@protobuf-ts/runtime": { + "version": "2.11.1", + "resolved": "https://registry.npmjs.org/@protobuf-ts/runtime/-/runtime-2.11.1.tgz", + "integrity": "sha512-KuDaT1IfHkugM2pyz+FwiY80ejWrkH1pAtOBOZFuR6SXEFTsnb/jiQWQ1rCIrcKx2BtyxnxW6BWwsVSA/Ie+WQ==", + "license": "(Apache-2.0 AND BSD-3-Clause)", + "peer": true + }, + "node_modules/@protobuf-ts/runtime-rpc": { + "version": "2.11.1", + "resolved": "https://registry.npmjs.org/@protobuf-ts/runtime-rpc/-/runtime-rpc-2.11.1.tgz", + "integrity": "sha512-4CqqUmNA+/uMz00+d3CYKgElXO9VrEbucjnBFEjqI4GuDrEQ32MaI3q+9qPBvIGOlL4PmHXrzM32vBPWRhQKWQ==", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "@protobuf-ts/runtime": "^2.11.1" + } + }, + "node_modules/@protobufjs/aspromise": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz", + "integrity": "sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ==", + "license": "BSD-3-Clause", + "peer": true + }, + "node_modules/@protobufjs/base64": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz", + "integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==", + "license": "BSD-3-Clause", + "peer": true + }, + "node_modules/@protobufjs/codegen": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.5.tgz", + "integrity": "sha512-zgXFLzW3Ap33e6d0Wlj4MGIm6Ce8O89n/apUaGNB/jx+hw+ruWEp7EwGUshdLKVRCxZW12fp9r40E1mQrf/34g==", + "license": "BSD-3-Clause", + "peer": true + }, + "node_modules/@protobufjs/eventemitter": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.1.tgz", + "integrity": "sha512-vW1GmwMZNnL+gMRaovlh9yZX74kc+TTU3FObkkurpMaRtBfLP3ldjS9KQWlwZgraRE0+dheEEoAxdzcJQ8eXZg==", + "license": "BSD-3-Clause", + "peer": true + }, + "node_modules/@protobufjs/fetch": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.1.tgz", + "integrity": "sha512-GpptLrs57adMSuHi3VNj0mAF8dwh36LMaYF6XyJ6JMWlVsc+t42tm1HSEDmOs3A8fC9yyeisgLhsTVQokOZ0zw==", + "license": "BSD-3-Clause", + "peer": true, + "dependencies": { + "@protobufjs/aspromise": "^1.1.1" + } + }, + "node_modules/@protobufjs/float": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz", + "integrity": "sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ==", + "license": "BSD-3-Clause", + "peer": true + }, + "node_modules/@protobufjs/path": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz", + "integrity": "sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA==", + "license": "BSD-3-Clause", + "peer": true + }, + "node_modules/@protobufjs/pool": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz", + "integrity": "sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw==", + "license": "BSD-3-Clause", + "peer": true + }, + "node_modules/@protobufjs/utf8": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.1.tgz", + "integrity": "sha512-oOAWABowe8EAbMyWKM0tYDKi8Yaox52D+HWZhAIJqQXbqe0xI/GV7FhLWqlEKreMkfDjshR5FKgi3mnle0h6Eg==", + "license": "BSD-3-Clause", + "peer": true + }, + "node_modules/@rolldown/binding-android-arm64": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm64/-/binding-android-arm64-1.1.4.tgz", + "integrity": "sha512-EZLpf/8y7GXkkra90ML47kzik/GMP3EMcE9bPyHmRfxLC6z9+aW5A8poCsoxjrT5GfEcNAAvWwUHjvP1pUQkfw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-darwin-arm64": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-arm64/-/binding-darwin-arm64-1.1.4.tgz", + "integrity": "sha512-aUi+HBvmYb7j8krl1+qJgkG8C17fO79gk3c+jPw4S8glRFc1DTija9S3EyaTSQUm5GJXYKDAsugBEhFHH2vYiQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-darwin-x64": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-x64/-/binding-darwin-x64-1.1.4.tgz", + "integrity": "sha512-F7hHC3gwY11+vByKPRWqwGbeXWVgKmL+pTGCinaEhdihzBV2aQ0fvZOch9cXYUOKuKKq429HeYXOqQLc7wFCEg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-freebsd-x64": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/@rolldown/binding-freebsd-x64/-/binding-freebsd-x64-1.1.4.tgz", + "integrity": "sha512-sI5yw+7s92SK6odiEhD5lKCBlWcpjHS5qyqpVQbZAJ0fIzEUXrmbl3DH2ybR3PZogulNJF+COLtmA8hUfvkCCQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-arm-gnueabihf": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-1.1.4.tgz", + "integrity": "sha512-mCi0OKgEieFircrtVYmQAFGszRtMnZ6fpZAXrxanXAu7lqZcsK1E1RAaZNG0uKAnxox3B1f4EyQNnoyMfN1vAA==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-arm64-gnu": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-1.1.4.tgz", + "integrity": "sha512-B9Ial3Kv5sh0SHnB1g/QWcUQCEvCF6QKGAl4zXypYj65mVI+B4AhFBwPtSN7pDrJeIx8Z7zdy4ntx+wQABom7w==", + "cpu": [ + "arm64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-arm64-musl": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-musl/-/binding-linux-arm64-musl-1.1.4.tgz", + "integrity": "sha512-lZVym0PuHE1KZ22gmFTC15lAkrg9iTszR617oYRB/iPY1A56ywoJzVKOJBKaot5RiikCObmur6pogpse3gRcng==", + "cpu": [ + "arm64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-ppc64-gnu": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-1.1.4.tgz", + "integrity": "sha512-t2DNiLJWNTbnEHyUzTumldML6ET4/g16467LZoDDJ3tSxGvguL5/NyC2lCsNKuyRycg9XeDQF5SSv+TNOhQEXg==", + "cpu": [ + "ppc64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-s390x-gnu": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-1.1.4.tgz", + "integrity": "sha512-0WIRnL1Uw4BvTZRLQt+PVgo6ZKTJadlC2btP+/EOXv2f/DWbY0rEgl+y834mIVwP1FkTlWVTrGGJXf12lru7EQ==", + "cpu": [ + "s390x" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-x64-gnu": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-gnu/-/binding-linux-x64-gnu-1.1.4.tgz", + "integrity": "sha512-JWtGshGfX+oENAKonoNkqEJX+7hC8yfhi9GUyPX1VX4mdh1y5r+ZiJLR5XzAB0aoP6s/PcILsGjKq8O0mm24bw==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-x64-musl": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-musl/-/binding-linux-x64-musl-1.1.4.tgz", + "integrity": "sha512-rT6yQcxUuXs4CnbofqwHRRV0iem349rLMYpTjkgQGLjrY4ado/eDzwPZPTCgTOlF6Nkp8NEv70yLMTn6qkWxsQ==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-openharmony-arm64": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/@rolldown/binding-openharmony-arm64/-/binding-openharmony-arm64-1.1.4.tgz", + "integrity": "sha512-KXMGoboq5cyaCQjDA4GLuRiOwBQ0EyFnJoVViLeZ45/3rFItRODEr+NdsBcVpll40hhNArlm/speWGRvj08LzA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-wasm32-wasi": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/@rolldown/binding-wasm32-wasi/-/binding-wasm32-wasi-1.1.4.tgz", + "integrity": "sha512-5K83rb36oJiY7BCyE9zLZtGcPV4g5wvq+xwdO0XPIwDVZI8cyB/AUjkNXGb92/rnmezEkjMOpgY61rtwjQtFwg==", + "cpu": [ + "wasm32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "@emnapi/core": "1.11.1", + "@emnapi/runtime": "1.11.1", + "@napi-rs/wasm-runtime": "^1.1.6" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-win32-arm64-msvc": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.1.4.tgz", + "integrity": "sha512-PnWBtw3TV5KOg69HQQDR0mnQuyCmSGR2pAB4DC1rPF808fgKeTUMj2EOEyKATpgiuxuR5APQmiDO7PDgEjTFSA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-win32-x64-msvc": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.1.4.tgz", + "integrity": "sha512-M1lpniBePobTfsa7Ks9a199e1akxsXn+GYBUKsEzv3YFzOm1HJAMNwKI3qr0Zq+mxwx9gOZoTdP1yXRYsZUocQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/pluginutils": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.0.1.tgz", + "integrity": "sha512-2j9bGt5Jh8hj+vPtgzPtl72j0yRxHAyumoo6TNfAjsLB04UtpSvPbPcDcBMxz7n+9CYB0c1GxQFxYRg2jimqGw==", + "dev": true, + "license": "MIT" + }, + "node_modules/@ts-morph/common": { + "version": "0.29.0", + "resolved": "https://registry.npmjs.org/@ts-morph/common/-/common-0.29.0.tgz", + "integrity": "sha512-35oUmphHbJvQ/+UTwFNme/t2p3FoKiGJ5auTjjpNTop2dyREspirjMy82PLSC1pnDJ8ah1GU98hwpVt64YXQsg==", + "license": "MIT", + "peer": true, + "dependencies": { + "minimatch": "^10.0.1", + "path-browserify": "^1.0.1", + "tinyglobby": "^0.2.14" + } + }, + "node_modules/@tybys/wasm-util": { + "version": "0.10.3", + "resolved": "https://registry.npmjs.org/@tybys/wasm-util/-/wasm-util-0.10.3.tgz", + "integrity": "sha512-F3fo1MYrRJYL3zER0OUOmkutjr1Vp23m7OsSgp7nq4SP6OqX6C/56XFIPAl5bt3zaBRjmW7SGz3u/6LwFpYcOg==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, + "node_modules/@types/node": { + "version": "22.20.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.20.0.tgz", + "integrity": "sha512-QWlFW2wf3nTjC13/DqRnBpR4ZO36VJH/JVBkA/vcnmbTBNQIlnObqyqZE1tUR7+Ni23Lda8R1BxMfbXRpCUx5g==", + "license": "MIT", + "dependencies": { + "undici-types": "~6.21.0" + } + }, + "node_modules/@typescript/vfs": { + "version": "1.6.4", + "resolved": "https://registry.npmjs.org/@typescript/vfs/-/vfs-1.6.4.tgz", + "integrity": "sha512-PJFXFS4ZJKiJ9Qiuix6Dz/OwEIqHD7Dme1UwZhTK11vR+5dqW2ACbdndWQexBzCx+CPuMe5WBYQWCsFyGlQLlQ==", + "license": "MIT", + "peer": true, + "dependencies": { + "debug": "^4.4.3" + }, + "peerDependencies": { + "typescript": "*" + } + }, + "node_modules/agent-base": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", + "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "license": "MIT", + "dependencies": { + "debug": "4" + }, + "engines": { + "node": ">= 6.0.0" + } + }, + "node_modules/ansi-escapes": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", + "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", + "license": "MIT", + "peer": true, + "dependencies": { + "type-fest": "^0.21.3" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ansi-regex": { + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.2.2.tgz", + "integrity": "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/ansi-styles": { + "version": "6.2.3", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.3.tgz", + "integrity": "sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg==", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/ansis": { + "version": "3.17.0", + "resolved": "https://registry.npmjs.org/ansis/-/ansis-3.17.0.tgz", + "integrity": "sha512-0qWUglt9JEqLFr3w1I1pbrChn1grhaiAR2ocX1PP/flRmxgtwTzPFFFnfIlD6aMOLQZgSuCRlidD70lvx8yhzg==", + "license": "ISC", + "peer": true, + "engines": { + "node": ">=14" + } + }, + "node_modules/async": { + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/async/-/async-3.2.6.tgz", + "integrity": "sha512-htCUDlxyyCLMgaM3xXg0C0LW2xqfuQ6p05pCEIsXuyQ+a1koYKTuBMzRNwmybfLgvJDMd0r1LTn4+E0Ti6C2AA==", + "license": "MIT", + "peer": true + }, + "node_modules/asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", + "license": "MIT" + }, + "node_modules/axios": { + "version": "1.18.1", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.18.1.tgz", + "integrity": "sha512-3nTvFlvpn9Zu/RkHUqtc7/+al4UpRW5az71ap5zccp6e8RAYEzhMTecX8Dz1wWDYrPpUoB1HAQEGEAEvUr7S9g==", + "license": "MIT", + "dependencies": { + "follow-redirects": "^1.16.0", + "form-data": "^4.0.5", + "https-proxy-agent": "^5.0.1", + "proxy-from-env": "^2.1.0" + } + }, + "node_modules/balanced-match": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz", + "integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==", + "license": "MIT", + "peer": true, + "engines": { + "node": "18 || 20 || >=22" + } + }, + "node_modules/brace-expansion": { + "version": "5.0.7", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.7.tgz", + "integrity": "sha512-7oFy703dxfY3/NLxC1fh2SUCQ0H9rmAY+5EpDVfXjUTTs+HEwR2nYaqLv+GWcTsumwxPfiz6CzCNkwXwBUwqCA==", + "license": "MIT", + "peer": true, + "dependencies": { + "balanced-match": "^4.0.2" + }, + "engines": { + "node": "18 || 20 || >=22" + } + }, + "node_modules/call-bind-apply-helpers": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", + "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/chokidar": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.3.tgz", + "integrity": "sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==", + "license": "MIT", + "peer": true, + "dependencies": { + "readdirp": "^4.0.1" + }, + "engines": { + "node": ">= 14.16.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/clean-stack": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-3.0.1.tgz", + "integrity": "sha512-lR9wNiMRcVQjSB3a7xXGLuz4cr4wJuuXlaAEbRutGowQTmlp7R72/DOgN21e8jdwblMWl9UOJMJXarX94pzKdg==", + "license": "MIT", + "peer": true, + "dependencies": { + "escape-string-regexp": "4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/cli-cursor": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-5.0.0.tgz", + "integrity": "sha512-aCj4O5wKyszjMmDT4tZj93kxyydN/K5zPWSCe6/0AV/AA1pqe5ZBIw0a2ZfPQV7lL5/yb5HsUreJ6UFAF1tEQw==", + "license": "MIT", + "peer": true, + "dependencies": { + "restore-cursor": "^5.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/cli-spinners": { + "version": "2.9.2", + "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.9.2.tgz", + "integrity": "sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg==", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/cli-truncate": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/cli-truncate/-/cli-truncate-5.2.0.tgz", + "integrity": "sha512-xRwvIOMGrfOAnM1JYtqQImuaNtDEv9v6oIYAs4LIHwTiKee8uwvIi363igssOC0O5U04i4AlENs79LQLu9tEMw==", + "license": "MIT", + "peer": true, + "dependencies": { + "slice-ansi": "^8.0.0", + "string-width": "^8.2.0" + }, + "engines": { + "node": ">=20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/cli-truncate/node_modules/string-width": { + "version": "8.2.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-8.2.1.tgz", + "integrity": "sha512-IIaP0g3iy9Cyy18w3M9YcaDudujEAVHKt3a3QJg1+sr/oX96TbaGUubG0hJyCjCBThFH+tFpcIyoUHUn1ogaLA==", + "license": "MIT", + "peer": true, + "dependencies": { + "get-east-asian-width": "^1.5.0", + "strip-ansi": "^7.1.2" + }, + "engines": { + "node": ">=20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/cliui": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "license": "ISC", + "peer": true, + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/cliui/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/cliui/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "license": "MIT", + "peer": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/code-block-writer": { + "version": "13.0.3", + "resolved": "https://registry.npmjs.org/code-block-writer/-/code-block-writer-13.0.3.tgz", + "integrity": "sha512-Oofo0pq3IKnsFtuHqSF7TqBfr71aeyZDVJ0HpmqB7FBM2qEigL0iPONSCZSO9pE9dZTAxANe5XHG9Uy0YMv8cg==", + "license": "MIT", + "peer": true + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "license": "MIT", + "peer": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "license": "MIT", + "peer": true + }, + "node_modules/colorette": { + "version": "2.0.20", + "resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.20.tgz", + "integrity": "sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==", + "license": "MIT", + "peer": true + }, + "node_modules/combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "license": "MIT", + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "license": "MIT", + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/detect-libc": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz", + "integrity": "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=8" + } + }, + "node_modules/dunder-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", + "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/ejs": { + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/ejs/-/ejs-3.1.10.tgz", + "integrity": "sha512-UeJmFfOrAQS8OJWPZ4qtgHyWExa088/MtK5UEyoJGFH67cDEXkZSviOiKRCZ4Xij0zxI3JECgYs3oKx+AizQBA==", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "jake": "^10.8.5" + }, + "bin": { + "ejs": "bin/cli.js" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "license": "MIT", + "peer": true + }, + "node_modules/environment": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/environment/-/environment-1.1.0.tgz", + "integrity": "sha512-xUtoPkMggbz0MPyPiIWr1Kp4aeWJjDZ6SMvURhimjdZgsRuDplF5/s9hcgGhyXMhs+6vpnuoiZ2kFiu3FMnS8Q==", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/es-define-property": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", + "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-object-atoms": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.2.tgz", + "integrity": "sha512-HWcBoN6NileqtSydK2FqHbS/LoDd2pqrnQHLyJzBj4kOp/ky2MWMN694xOfkK8/SnUsW2DH7EfyVlydKCsm1Zw==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-set-tostringtag": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz", + "integrity": "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.6", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/esbuild": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.28.1.tgz", + "integrity": "sha512-HrJrvZv5ayxBzPfwphOoNzkzOIIlifzk0KJrGK2c8R4+LKpMtpYLQeUdjnwjWv/LZlkH2laZk+4w78pi99D4Vw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=18" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.28.1", + "@esbuild/android-arm": "0.28.1", + "@esbuild/android-arm64": "0.28.1", + "@esbuild/android-x64": "0.28.1", + "@esbuild/darwin-arm64": "0.28.1", + "@esbuild/darwin-x64": "0.28.1", + "@esbuild/freebsd-arm64": "0.28.1", + "@esbuild/freebsd-x64": "0.28.1", + "@esbuild/linux-arm": "0.28.1", + "@esbuild/linux-arm64": "0.28.1", + "@esbuild/linux-ia32": "0.28.1", + "@esbuild/linux-loong64": "0.28.1", + "@esbuild/linux-mips64el": "0.28.1", + "@esbuild/linux-ppc64": "0.28.1", + "@esbuild/linux-riscv64": "0.28.1", + "@esbuild/linux-s390x": "0.28.1", + "@esbuild/linux-x64": "0.28.1", + "@esbuild/netbsd-arm64": "0.28.1", + "@esbuild/netbsd-x64": "0.28.1", + "@esbuild/openbsd-arm64": "0.28.1", + "@esbuild/openbsd-x64": "0.28.1", + "@esbuild/openharmony-arm64": "0.28.1", + "@esbuild/sunos-x64": "0.28.1", + "@esbuild/win32-arm64": "0.28.1", + "@esbuild/win32-ia32": "0.28.1", + "@esbuild/win32-x64": "0.28.1" + } + }, + "node_modules/escalade": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", + "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eventemitter3": { + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.4.tgz", + "integrity": "sha512-mlsTRyGaPBjPedk6Bvw+aqbsXDtoAyAzm5MO7JgU+yVRyMQ5O8bD4Kcci7BS85f93veegeCPkL8R4GLClnjLFw==", + "license": "MIT", + "peer": true + }, + "node_modules/fdir": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz", + "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==", + "license": "MIT", + "engines": { + "node": ">=12.0.0" + }, + "peerDependencies": { + "picomatch": "^3 || ^4" + }, + "peerDependenciesMeta": { + "picomatch": { + "optional": true + } + } + }, + "node_modules/filelist": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/filelist/-/filelist-1.0.6.tgz", + "integrity": "sha512-5giy2PkLYY1cP39p17Ech+2xlpTRL9HLspOfEgm0L6CwBXBTgsK5ou0JtzYuepxkaQ/tvhCFIJ5uXo0OrM2DxA==", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "minimatch": "^5.0.1" + } + }, + "node_modules/filelist/node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "license": "MIT", + "peer": true + }, + "node_modules/filelist/node_modules/brace-expansion": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.1.1.tgz", + "integrity": "sha512-WR1cURNjuvBLMZBMbqM0UoE+WAfdUcEV1ccD8PVBVOI+Z3ND4+SZbN8RsfT2bMuG1qwz5RFvPukSZm5fF2D5eA==", + "license": "MIT", + "peer": true, + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/filelist/node_modules/minimatch": { + "version": "5.1.9", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.9.tgz", + "integrity": "sha512-7o1wEA2RyMP7Iu7GNba9vc0RWWGACJOCZBJX2GJWip0ikV+wcOsgVuY9uE8CPiyQhkGFSlhuSkZPavN7u1c2Fw==", + "license": "ISC", + "peer": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/follow-redirects": { + "version": "1.16.0", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.16.0.tgz", + "integrity": "sha512-y5rN/uOsadFT/JfYwhxRS5R7Qce+g3zG97+JrtFZlC9klX/W5hD7iiLzScI4nZqUS7DNUdhPgw4xI8W2LuXlUw==", + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/RubenVerborgh" + } + ], + "license": "MIT", + "engines": { + "node": ">=4.0" + }, + "peerDependenciesMeta": { + "debug": { + "optional": true + } + } + }, + "node_modules/form-data": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.6.tgz", + "integrity": "sha512-vKatAh4SlVfgbv+YtmhiRjhEMJsYpsG1Y2rMQtR+SVSbytsSD1YGzDIcrAJmdFec88u/+VoGmxnl+80gL1tRCQ==", + "license": "MIT", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "es-set-tostringtag": "^2.1.0", + "hasown": "^2.0.4", + "mime-types": "^2.1.35" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "license": "ISC", + "peer": true, + "engines": { + "node": "6.* || 8.* || >= 10.*" + } + }, + "node_modules/get-east-asian-width": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/get-east-asian-width/-/get-east-asian-width-1.6.0.tgz", + "integrity": "sha512-QRbvDIbx6YklUe6RxeTeleMR0yv3cYH6PsPZHcnVn7xv7zO1BHN8r0XETu8n6Ye3Q+ahtSarc3WgtNWmehIBfA==", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/get-intrinsic": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", + "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.1.1", + "function-bind": "^1.1.2", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "math-intrinsics": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-package-type": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz", + "integrity": "sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/get-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", + "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", + "license": "MIT", + "dependencies": { + "dunder-proto": "^1.0.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/gopd": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/has-symbols": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-tostringtag": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", + "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", + "license": "MIT", + "dependencies": { + "has-symbols": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/hasown": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.4.tgz", + "integrity": "sha512-T2UbfbBEF32wiepXIsMlTW9+dDYC6wMh/t/vYA4tuOMKqWz/n3vr1NFSxQiyP+zk2mXsoMA/i/7qV6LKut1t1A==", + "license": "MIT", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/https-proxy-agent": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", + "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", + "license": "MIT", + "dependencies": { + "agent-base": "6", + "debug": "4" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/indent-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", + "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-docker": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.2.1.tgz", + "integrity": "sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==", + "license": "MIT", + "peer": true, + "bin": { + "is-docker": "cli.js" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-fullwidth-code-point": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-5.1.0.tgz", + "integrity": "sha512-5XHYaSyiqADb4RnZ1Bdad6cPp8Toise4TzEjcOYDHZkTCbKgiUl7WTUCpNWHuxmDt91wnsZBc9xinNzopv3JMQ==", + "license": "MIT", + "peer": true, + "dependencies": { + "get-east-asian-width": "^1.3.1" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-wsl": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz", + "integrity": "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==", + "license": "MIT", + "peer": true, + "dependencies": { + "is-docker": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/jake": { + "version": "10.9.4", + "resolved": "https://registry.npmjs.org/jake/-/jake-10.9.4.tgz", + "integrity": "sha512-wpHYzhxiVQL+IV05BLE2Xn34zW1S223hvjtqk0+gsPrwd/8JNLXJgZZM/iPFsYc1xyphF+6M6EvdE5E9MBGkDA==", + "license": "Apache-2.0", + "peer": true, + "dependencies": { + "async": "^3.2.6", + "filelist": "^1.0.4", + "picocolors": "^1.1.1" + }, + "bin": { + "jake": "bin/cli.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/lightningcss": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss/-/lightningcss-1.32.0.tgz", + "integrity": "sha512-NXYBzinNrblfraPGyrbPoD19C1h9lfI/1mzgWYvXUTe414Gz/X1FD2XBZSZM7rRTrMA8JL3OtAaGifrIKhQ5yQ==", + "dev": true, + "license": "MPL-2.0", + "dependencies": { + "detect-libc": "^2.0.3" + }, + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + }, + "optionalDependencies": { + "lightningcss-android-arm64": "1.32.0", + "lightningcss-darwin-arm64": "1.32.0", + "lightningcss-darwin-x64": "1.32.0", + "lightningcss-freebsd-x64": "1.32.0", + "lightningcss-linux-arm-gnueabihf": "1.32.0", + "lightningcss-linux-arm64-gnu": "1.32.0", + "lightningcss-linux-arm64-musl": "1.32.0", + "lightningcss-linux-x64-gnu": "1.32.0", + "lightningcss-linux-x64-musl": "1.32.0", + "lightningcss-win32-arm64-msvc": "1.32.0", + "lightningcss-win32-x64-msvc": "1.32.0" + } + }, + "node_modules/lightningcss-android-arm64": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-android-arm64/-/lightningcss-android-arm64-1.32.0.tgz", + "integrity": "sha512-YK7/ClTt4kAK0vo6w3X+Pnm0D2cf2vPHbhOXdoNti1Ga0al1P4TBZhwjATvjNwLEBCnKvjJc2jQgHXH0NEwlAg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-darwin-arm64": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-darwin-arm64/-/lightningcss-darwin-arm64-1.32.0.tgz", + "integrity": "sha512-RzeG9Ju5bag2Bv1/lwlVJvBE3q6TtXskdZLLCyfg5pt+HLz9BqlICO7LZM7VHNTTn/5PRhHFBSjk5lc4cmscPQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-darwin-x64": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-darwin-x64/-/lightningcss-darwin-x64-1.32.0.tgz", + "integrity": "sha512-U+QsBp2m/s2wqpUYT/6wnlagdZbtZdndSmut/NJqlCcMLTWp5muCrID+K5UJ6jqD2BFshejCYXniPDbNh73V8w==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-freebsd-x64": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-freebsd-x64/-/lightningcss-freebsd-x64-1.32.0.tgz", + "integrity": "sha512-JCTigedEksZk3tHTTthnMdVfGf61Fky8Ji2E4YjUTEQX14xiy/lTzXnu1vwiZe3bYe0q+SpsSH/CTeDXK6WHig==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-arm-gnueabihf": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm-gnueabihf/-/lightningcss-linux-arm-gnueabihf-1.32.0.tgz", + "integrity": "sha512-x6rnnpRa2GL0zQOkt6rts3YDPzduLpWvwAF6EMhXFVZXD4tPrBkEFqzGowzCsIWsPjqSK+tyNEODUBXeeVHSkw==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-arm64-gnu": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-gnu/-/lightningcss-linux-arm64-gnu-1.32.0.tgz", + "integrity": "sha512-0nnMyoyOLRJXfbMOilaSRcLH3Jw5z9HDNGfT/gwCPgaDjnx0i8w7vBzFLFR1f6CMLKF8gVbebmkUN3fa/kQJpQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-arm64-musl": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-musl/-/lightningcss-linux-arm64-musl-1.32.0.tgz", + "integrity": "sha512-UpQkoenr4UJEzgVIYpI80lDFvRmPVg6oqboNHfoH4CQIfNA+HOrZ7Mo7KZP02dC6LjghPQJeBsvXhJod/wnIBg==", + "cpu": [ + "arm64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-x64-gnu": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-gnu/-/lightningcss-linux-x64-gnu-1.32.0.tgz", + "integrity": "sha512-V7Qr52IhZmdKPVr+Vtw8o+WLsQJYCTd8loIfpDaMRWGUZfBOYEJeyJIkqGIDMZPwPx24pUMfwSxxI8phr/MbOA==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-x64-musl": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-musl/-/lightningcss-linux-x64-musl-1.32.0.tgz", + "integrity": "sha512-bYcLp+Vb0awsiXg/80uCRezCYHNg1/l3mt0gzHnWV9XP1W5sKa5/TCdGWaR/zBM2PeF/HbsQv/j2URNOiVuxWg==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-win32-arm64-msvc": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-win32-arm64-msvc/-/lightningcss-win32-arm64-msvc-1.32.0.tgz", + "integrity": "sha512-8SbC8BR40pS6baCM8sbtYDSwEVQd4JlFTOlaD3gWGHfThTcABnNDBda6eTZeqbofalIJhFx0qKzgHJmcPTnGdw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-win32-x64-msvc": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-win32-x64-msvc/-/lightningcss-win32-x64-msvc-1.32.0.tgz", + "integrity": "sha512-Amq9B/SoZYdDi1kFrojnoqPLxYhQ4Wo5XiL8EVJrVsB8ARoC1PWW6VGtT0WKCemjy8aC+louJnjS7U18x3b06Q==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lilconfig": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-3.1.3.tgz", + "integrity": "sha512-/vlFKAoH5Cgt3Ie+JLhRbwOsCQePABiU3tJ1egGvyQ+33R/vcwM2Zl2QR/LzjsBeItPt3oSVXapn+m4nQDvpzw==", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/antonk52" + } + }, + "node_modules/listr2": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/listr2/-/listr2-9.0.5.tgz", + "integrity": "sha512-ME4Fb83LgEgwNw96RKNvKV4VTLuXfoKudAmm2lP8Kk87KaMK0/Xrx/aAkMWmT8mDb+3MlFDspfbCs7adjRxA2g==", + "license": "MIT", + "peer": true, + "dependencies": { + "cli-truncate": "^5.0.0", + "colorette": "^2.0.20", + "eventemitter3": "^5.0.1", + "log-update": "^6.1.0", + "rfdc": "^1.4.1", + "wrap-ansi": "^9.0.0" + }, + "engines": { + "node": ">=20.0.0" + } + }, + "node_modules/listr2/node_modules/emoji-regex": { + "version": "10.6.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.6.0.tgz", + "integrity": "sha512-toUI84YS5YmxW219erniWD0CIVOo46xGKColeNQRgOzDorgBi1v4D71/OFzgD9GO2UGKIv1C3Sp8DAn0+j5w7A==", + "license": "MIT", + "peer": true + }, + "node_modules/listr2/node_modules/string-width": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-7.2.0.tgz", + "integrity": "sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==", + "license": "MIT", + "peer": true, + "dependencies": { + "emoji-regex": "^10.3.0", + "get-east-asian-width": "^1.0.0", + "strip-ansi": "^7.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/listr2/node_modules/wrap-ansi": { + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-9.0.2.tgz", + "integrity": "sha512-42AtmgqjV+X1VpdOfyTGOYRi0/zsoLqtXQckTmqTeybT+BDIbM/Guxo7x3pE2vtpr1ok6xRqM9OpBe+Jyoqyww==", + "license": "MIT", + "peer": true, + "dependencies": { + "ansi-styles": "^6.2.1", + "string-width": "^7.0.0", + "strip-ansi": "^7.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/lodash.camelcase": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz", + "integrity": "sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==", + "license": "MIT", + "peer": true + }, + "node_modules/log-update": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/log-update/-/log-update-6.1.0.tgz", + "integrity": "sha512-9ie8ItPR6tjY5uYJh8K/Zrv/RMZ5VOlOWvtZdEHYSTFKZfIBPQa9tOAEeAWhd+AnIneLJ22w5fjOYtoutpWq5w==", + "license": "MIT", + "peer": true, + "dependencies": { + "ansi-escapes": "^7.0.0", + "cli-cursor": "^5.0.0", + "slice-ansi": "^7.1.0", + "strip-ansi": "^7.1.0", + "wrap-ansi": "^9.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/log-update/node_modules/ansi-escapes": { + "version": "7.3.0", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-7.3.0.tgz", + "integrity": "sha512-BvU8nYgGQBxcmMuEeUEmNTvrMVjJNSH7RgW24vXexN4Ven6qCvy4TntnvlnwnMLTVlcRQQdbRY8NKnaIoeWDNg==", + "license": "MIT", + "peer": true, + "dependencies": { + "environment": "^1.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/log-update/node_modules/emoji-regex": { + "version": "10.6.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.6.0.tgz", + "integrity": "sha512-toUI84YS5YmxW219erniWD0CIVOo46xGKColeNQRgOzDorgBi1v4D71/OFzgD9GO2UGKIv1C3Sp8DAn0+j5w7A==", + "license": "MIT", + "peer": true + }, + "node_modules/log-update/node_modules/slice-ansi": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-7.1.2.tgz", + "integrity": "sha512-iOBWFgUX7caIZiuutICxVgX1SdxwAVFFKwt1EvMYYec/NWO5meOJ6K5uQxhrYBdQJne4KxiqZc+KptFOWFSI9w==", + "license": "MIT", + "peer": true, + "dependencies": { + "ansi-styles": "^6.2.1", + "is-fullwidth-code-point": "^5.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/chalk/slice-ansi?sponsor=1" + } + }, + "node_modules/log-update/node_modules/string-width": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-7.2.0.tgz", + "integrity": "sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==", + "license": "MIT", + "peer": true, + "dependencies": { + "emoji-regex": "^10.3.0", + "get-east-asian-width": "^1.0.0", + "strip-ansi": "^7.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/log-update/node_modules/wrap-ansi": { + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-9.0.2.tgz", + "integrity": "sha512-42AtmgqjV+X1VpdOfyTGOYRi0/zsoLqtXQckTmqTeybT+BDIbM/Guxo7x3pE2vtpr1ok6xRqM9OpBe+Jyoqyww==", + "license": "MIT", + "peer": true, + "dependencies": { + "ansi-styles": "^6.2.1", + "string-width": "^7.0.0", + "strip-ansi": "^7.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/long": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/long/-/long-5.3.2.tgz", + "integrity": "sha512-mNAgZ1GmyNhD7AuqnTG3/VQ26o760+ZYBPKjPvugO8+nLbYfX6TVpJPseBvopbdY+qpZ/lKUnmEc1LeZYS3QAA==", + "license": "Apache-2.0", + "peer": true + }, + "node_modules/math-intrinsics": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", + "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "license": "MIT", + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mimic-function": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/mimic-function/-/mimic-function-5.0.1.tgz", + "integrity": "sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA==", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/minimatch": { + "version": "10.2.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.5.tgz", + "integrity": "sha512-MULkVLfKGYDFYejP07QOurDLLQpcjk7Fw+7jXS2R2czRQzR56yHRveU5NDJEOviH+hETZKSkIk5c+T23GjFUMg==", + "license": "BlueOak-1.0.0", + "peer": true, + "dependencies": { + "brace-expansion": "^5.0.5" + }, + "engines": { + "node": "18 || 20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "license": "MIT" + }, + "node_modules/nanoid": { + "version": "3.3.15", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.15.tgz", + "integrity": "sha512-y7Wygv/7mEOvxTuEQDB8StXdMRBWf1kR/tlhAzBRUFkB2jfcLOAxO/SHmOO2zgz1pVgK29/kyupn059/bCHdjA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/onetime": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-7.0.0.tgz", + "integrity": "sha512-VXJjc87FScF88uafS3JllDgvAm+c/Slfz06lorj2uAY34rlUu0Nt+v8wreiImcrgAjjIHp1rXpTDlLOGw29WwQ==", + "license": "MIT", + "peer": true, + "dependencies": { + "mimic-function": "^5.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/path-browserify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-1.0.1.tgz", + "integrity": "sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==", + "license": "MIT", + "peer": true + }, + "node_modules/picocolors": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "license": "ISC" + }, + "node_modules/picomatch": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.5.tgz", + "integrity": "sha512-RvwwcruNjI1ncT5xRakeyS9Lf8lcItv34KD+aif+VH9kduAyfYBipGh12274xtenIPZ119/R9BdTBa8gAwSh0A==", + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/postcss": { + "version": "8.5.16", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.16.tgz", + "integrity": "sha512-vuwillviilfKZsg0VGj5R/YwwcHx4SLsIOI/7K6mQkWx+l5cUHTjj5g0AasTBcyXsbfTgrwsUNmVUb5xVwyPwg==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "nanoid": "^3.3.12", + "picocolors": "^1.1.1", + "source-map-js": "^1.2.1" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "node_modules/protobufjs": { + "version": "7.6.4", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.6.4.tgz", + "integrity": "sha512-RJJPTTpvFfHcWLkIa2JFWK4XvtSzS0yEWDmunqHXli1h3JlkbcQZXDZdcWxv+JK3Xsl5/UFDPZ0iGm7DAengYw==", + "hasInstallScript": true, + "license": "BSD-3-Clause", + "peer": true, + "dependencies": { + "@protobufjs/aspromise": "^1.1.2", + "@protobufjs/base64": "^1.1.2", + "@protobufjs/codegen": "^2.0.5", + "@protobufjs/eventemitter": "^1.1.1", + "@protobufjs/fetch": "^1.1.1", + "@protobufjs/float": "^1.0.2", + "@protobufjs/path": "^1.1.2", + "@protobufjs/pool": "^1.1.0", + "@protobufjs/utf8": "^1.1.1", + "@types/node": ">=13.7.0", + "long": "^5.3.2" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/proxy-from-env": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-2.1.0.tgz", + "integrity": "sha512-cJ+oHTW1VAEa8cJslgmUZrc+sjRKgAKl3Zyse6+PV38hZe/V6Z14TbCuXcan9F9ghlz4QrFr2c92TNF82UkYHA==", + "license": "MIT", + "engines": { + "node": ">=10" + } + }, + "node_modules/readdirp": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.1.2.tgz", + "integrity": "sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==", + "license": "MIT", + "peer": true, + "engines": { + "node": ">= 14.18.0" + }, + "funding": { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/reflect-metadata": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/reflect-metadata/-/reflect-metadata-0.2.2.tgz", + "integrity": "sha512-urBwgfrvVP/eAyXx4hluJivBKzuEbSQs9rKWCrCkbSxNv8mxPcUZKeuoF3Uy4mJl3Lwprp6yy5/39VWigZ4K6Q==", + "license": "Apache-2.0", + "peer": true + }, + "node_modules/require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/restore-cursor": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-5.1.0.tgz", + "integrity": "sha512-oMA2dcrw6u0YfxJQXm342bFKX/E4sG9rbTzO9ptUcR/e8A33cHuvStiYOwH7fszkZlZ1z/ta9AAoPk2F4qIOHA==", + "license": "MIT", + "peer": true, + "dependencies": { + "onetime": "^7.0.0", + "signal-exit": "^4.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/rfdc": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/rfdc/-/rfdc-1.4.1.tgz", + "integrity": "sha512-q1b3N5QkRUWUl7iyylaaj3kOpIT0N2i9MqIEQXP73GVsN9cw3fdx8X63cEmWhJGi2PPCF23Ijp7ktmd39rawIA==", + "license": "MIT", + "peer": true + }, + "node_modules/rolldown": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/rolldown/-/rolldown-1.1.4.tgz", + "integrity": "sha512-IjZYiLxZwpnhwhdBH2ugdTGVSdhCQUmLxLoqyjiL0JxYjyRst+5a0P3xfrTxJ5F638j4Mvvw5FAX5XE6eHpXbA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@oxc-project/types": "=0.138.0", + "@rolldown/pluginutils": "^1.0.0" + }, + "bin": { + "rolldown": "bin/cli.mjs" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "optionalDependencies": { + "@rolldown/binding-android-arm64": "1.1.4", + "@rolldown/binding-darwin-arm64": "1.1.4", + "@rolldown/binding-darwin-x64": "1.1.4", + "@rolldown/binding-freebsd-x64": "1.1.4", + "@rolldown/binding-linux-arm-gnueabihf": "1.1.4", + "@rolldown/binding-linux-arm64-gnu": "1.1.4", + "@rolldown/binding-linux-arm64-musl": "1.1.4", + "@rolldown/binding-linux-ppc64-gnu": "1.1.4", + "@rolldown/binding-linux-s390x-gnu": "1.1.4", + "@rolldown/binding-linux-x64-gnu": "1.1.4", + "@rolldown/binding-linux-x64-musl": "1.1.4", + "@rolldown/binding-openharmony-arm64": "1.1.4", + "@rolldown/binding-wasm32-wasi": "1.1.4", + "@rolldown/binding-win32-arm64-msvc": "1.1.4", + "@rolldown/binding-win32-x64-msvc": "1.1.4" + } + }, + "node_modules/semver": { + "version": "7.8.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.5.tgz", + "integrity": "sha512-Y7/KDsb8LjooZpwaqGyulO6DQlksgCncchHGk+sZIY4SBvUocMBEFH5Ur1fI4dV+Jvl0w6cjvucaIi40puRioA==", + "license": "ISC", + "peer": true, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "license": "ISC", + "peer": true, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/sisteransi": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz", + "integrity": "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==", + "license": "MIT", + "peer": true + }, + "node_modules/slash": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-5.1.0.tgz", + "integrity": "sha512-ZA6oR3T/pEyuqwMgAKT0/hAv8oAXckzbkmR0UkUosQ+Mc4RxGoJkRmwHgHufaenlyAgE1Mxgpdcrf75y6XcnDg==", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/slice-ansi": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-8.0.0.tgz", + "integrity": "sha512-stxByr12oeeOyY2BlviTNQlYV5xOj47GirPr4yA1hE9JCtxfQN0+tVbkxwCtYDQWhEKWFHsEK48ORg5jrouCAg==", + "license": "MIT", + "peer": true, + "dependencies": { + "ansi-styles": "^6.2.3", + "is-fullwidth-code-point": "^5.1.0" + }, + "engines": { + "node": ">=20" + }, + "funding": { + "url": "https://github.com/chalk/slice-ansi?sponsor=1" + } + }, + "node_modules/source-map-js": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", + "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "license": "MIT", + "peer": true, + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/string-width/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/string-width/node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/string-width/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "license": "MIT", + "peer": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.2.0.tgz", + "integrity": "sha512-yDPMNjp4WyfYBkHnjIRLfca1i6KMyGCtsVgoKe/z1+6vukgaENdgGBZt+ZmKPc4gavvEZ5OgHfHdrazhgNyG7w==", + "license": "MIT", + "peer": true, + "dependencies": { + "ansi-regex": "^6.2.2" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, + "node_modules/supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "license": "MIT", + "peer": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" + } + }, + "node_modules/text-camel-case": { + "version": "1.2.11", + "resolved": "https://registry.npmjs.org/text-camel-case/-/text-camel-case-1.2.11.tgz", + "integrity": "sha512-2ZsM/gOlB1tyza+8lGLvs6gtPuZ9qEYuKPa+gwo38m65wkY4k323SK4hT7ku8r5wIKyspUYIWSk1aB9/Jjxr7A==", + "license": "MIT", + "peer": true, + "dependencies": { + "text-pascal-case": "^1.2.11" + } + }, + "node_modules/text-capital-case": { + "version": "1.2.11", + "resolved": "https://registry.npmjs.org/text-capital-case/-/text-capital-case-1.2.11.tgz", + "integrity": "sha512-30A7B7+VUvevEmPE0xWK1Z2z0ncl/JTjSUBLfjpoXrkwuPpmNTVbjHShRTN3cX9GIuZn/P3jvR+TO9JiTZcl8A==", + "license": "MIT", + "peer": true, + "dependencies": { + "text-no-case": "^1.2.11", + "text-upper-case-first": "^1.2.11" + } + }, + "node_modules/text-case": { + "version": "1.2.11", + "resolved": "https://registry.npmjs.org/text-case/-/text-case-1.2.11.tgz", + "integrity": "sha512-LbdWNQeuXWbfav+pxBxvaefkziffMYeSA53BHp52cgJa9rjiC0dkjum9AKrH8iQWoQJ4InGPSGexLeerGFaZ1Q==", + "license": "MIT", + "peer": true, + "dependencies": { + "text-camel-case": "^1.2.11", + "text-capital-case": "^1.2.11", + "text-constant-case": "^1.2.11", + "text-dot-case": "^1.2.11", + "text-header-case": "^1.2.11", + "text-is-lower-case": "^1.2.11", + "text-is-upper-case": "^1.2.11", + "text-kebab-case": "^1.2.11", + "text-lower-case": "^1.2.11", + "text-lower-case-first": "^1.2.11", + "text-no-case": "^1.2.11", + "text-param-case": "^1.2.11", + "text-pascal-case": "^1.2.11", + "text-path-case": "^1.2.11", + "text-sentence-case": "^1.2.11", + "text-snake-case": "^1.2.11", + "text-swap-case": "^1.2.11", + "text-title-case": "^1.2.11", + "text-upper-case": "^1.2.11", + "text-upper-case-first": "^1.2.11" + } + }, + "node_modules/text-constant-case": { + "version": "1.2.11", + "resolved": "https://registry.npmjs.org/text-constant-case/-/text-constant-case-1.2.11.tgz", + "integrity": "sha512-XnTBILsa7UpMWncUCchqIybZlg15FUcrlyNaWIJ8ybPy54qcoN513EXFswueyizuAgyJFXPCwwSFbSji6kw/Uw==", + "license": "MIT", + "peer": true, + "dependencies": { + "text-no-case": "^1.2.11", + "text-upper-case": "^1.2.11" + } + }, + "node_modules/text-dot-case": { + "version": "1.2.11", + "resolved": "https://registry.npmjs.org/text-dot-case/-/text-dot-case-1.2.11.tgz", + "integrity": "sha512-7SLKiT45KZO0qad0+p+GvC0+F+6pZ851HJcTcBJiSF88HsK/e1qErlGLtVBT6hkTHIaAj48WfSyQr4lZRv1xJQ==", + "license": "MIT", + "peer": true, + "dependencies": { + "text-no-case": "^1.2.11" + } + }, + "node_modules/text-header-case": { + "version": "1.2.11", + "resolved": "https://registry.npmjs.org/text-header-case/-/text-header-case-1.2.11.tgz", + "integrity": "sha512-7OBHd2g7X+aH6rXMC3cANFh6yvhXjXkyumw2NaRwJRIk343pP2e1SQCTCfowPDmmi8wkZVqz1fdWNq5LwvcBOQ==", + "license": "MIT", + "peer": true, + "dependencies": { + "text-capital-case": "^1.2.11" + } + }, + "node_modules/text-is-lower-case": { + "version": "1.2.11", + "resolved": "https://registry.npmjs.org/text-is-lower-case/-/text-is-lower-case-1.2.11.tgz", + "integrity": "sha512-dBqPAkNmX7eTM7ZbS3D/UBCQ5i9EXt5tujF2wIGGbZ1+aN8bY7Qda4mDpxgd6Hbzf/z10uQWRNzupl99wFQ8CQ==", + "license": "MIT", + "peer": true + }, + "node_modules/text-is-upper-case": { + "version": "1.2.11", + "resolved": "https://registry.npmjs.org/text-is-upper-case/-/text-is-upper-case-1.2.11.tgz", + "integrity": "sha512-MZeUIYEYfKZ2FSeg0vnHCH4mHXLgGzes+iz2K+4BYnhnkEa2svKA1nNjQAqTUiVNHOPqPCuzmUr1LsyQZ73uyA==", + "license": "MIT", + "peer": true + }, + "node_modules/text-kebab-case": { + "version": "1.2.11", + "resolved": "https://registry.npmjs.org/text-kebab-case/-/text-kebab-case-1.2.11.tgz", + "integrity": "sha512-RIg9iN6VwH+JrX9dFdm1nd1efPGR9LjNc0CiQz496sQETeKGkDEzxES/ZzxbkerrAL2DFEMGdLXckzDz1OEDBQ==", + "license": "MIT", + "peer": true, + "dependencies": { + "text-no-case": "^1.2.11" + } + }, + "node_modules/text-lower-case": { + "version": "1.2.11", + "resolved": "https://registry.npmjs.org/text-lower-case/-/text-lower-case-1.2.11.tgz", + "integrity": "sha512-txTy6y0y8M23Lhf0mk8WcvXTqlf4OQ3AGnDsRB6o3uMNfIa0CJDol2s1PdKNa63rt5B2277zkZCCn6Xeq//big==", + "license": "MIT", + "peer": true + }, + "node_modules/text-lower-case-first": { + "version": "1.2.11", + "resolved": "https://registry.npmjs.org/text-lower-case-first/-/text-lower-case-first-1.2.11.tgz", + "integrity": "sha512-QR483XLyuyIpq8tKu1ds3Q1jfsgfaa/p9rtoQKHe6Rv5ah9ic/SUzTGN0MQ7UIS9APADd8SUPn5TTh1Z2/ACyg==", + "license": "MIT", + "peer": true + }, + "node_modules/text-no-case": { + "version": "1.2.11", + "resolved": "https://registry.npmjs.org/text-no-case/-/text-no-case-1.2.11.tgz", + "integrity": "sha512-wazS7FEq0Ct3aJzeE8MEMcSs0eW4+/X/fwdotv/rG66bLS+g1T0pa0gUsbBGjjLFs191AIXVIry+bYE0uaaBBQ==", + "license": "MIT", + "peer": true, + "dependencies": { + "text-lower-case": "^1.2.11" + } + }, + "node_modules/text-param-case": { + "version": "1.2.11", + "resolved": "https://registry.npmjs.org/text-param-case/-/text-param-case-1.2.11.tgz", + "integrity": "sha512-3EMMAMLSz/mJXOnATNnrS+dZAvghpq09VhOVYDOkUnbm5zlYc6iU5AZOKVDpiAVVllQ9P1h5IKVZzsEYrdIRGw==", + "license": "MIT", + "peer": true, + "dependencies": { + "text-dot-case": "^1.2.11" + } + }, + "node_modules/text-pascal-case": { + "version": "1.2.11", + "resolved": "https://registry.npmjs.org/text-pascal-case/-/text-pascal-case-1.2.11.tgz", + "integrity": "sha512-BNhQ1O/g/Q4dH5gPyLIJLDLDknl2dipBwV629ScsiZCKJaCLGXYhTXp23rp9Htg3O5OSSsiU3mqDKq+pBmwTSw==", + "license": "MIT", + "peer": true, + "dependencies": { + "text-no-case": "^1.2.11" + } + }, + "node_modules/text-path-case": { + "version": "1.2.11", + "resolved": "https://registry.npmjs.org/text-path-case/-/text-path-case-1.2.11.tgz", + "integrity": "sha512-FsJU4BmMdtLtmnBK/XRJPqTwLF8yFiTEClHjxlQjSAG5Xt9R4p6D1WNaM1CI2dG5Lr4rsFM4jiVC620m0AsRbw==", + "license": "MIT", + "peer": true, + "dependencies": { + "text-dot-case": "^1.2.11" + } + }, + "node_modules/text-sentence-case": { + "version": "1.2.11", + "resolved": "https://registry.npmjs.org/text-sentence-case/-/text-sentence-case-1.2.11.tgz", + "integrity": "sha512-ApiVsvdLy+Wb8x7mZRVuoy8VO12jJ22G2djVM3ZZbUhXVIkqGgHxmiXRwdhRPoWGojK9n53m7jviJgBVNdRn+g==", + "license": "MIT", + "peer": true, + "dependencies": { + "text-no-case": "^1.2.11", + "text-upper-case-first": "^1.2.11" + } + }, + "node_modules/text-snake-case": { + "version": "1.2.11", + "resolved": "https://registry.npmjs.org/text-snake-case/-/text-snake-case-1.2.11.tgz", + "integrity": "sha512-NOEQvjyyVABB41SS8dUx423Y6hWS+Z4TrAAJg1xzCkOD3q9y0JtdJjCvCA1FWI8oDu+HiIOp/N446uDM8j54XQ==", + "license": "MIT", + "peer": true, + "dependencies": { + "text-dot-case": "^1.2.11" + } + }, + "node_modules/text-swap-case": { + "version": "1.2.11", + "resolved": "https://registry.npmjs.org/text-swap-case/-/text-swap-case-1.2.11.tgz", + "integrity": "sha512-PBmC5xvZdDZ4suikydpeXH0s4JV2XHelMj9/OEXEbA3oLpdV2A+B4BspVDWVw7C2Gi5eCareqk/7EE8I1/WwgQ==", + "license": "MIT", + "peer": true + }, + "node_modules/text-title-case": { + "version": "1.2.11", + "resolved": "https://registry.npmjs.org/text-title-case/-/text-title-case-1.2.11.tgz", + "integrity": "sha512-V1GZy0XlqdkYUQm0tqm1jqtYlXJqFVMreBCTUReOaz8d/JbozTSpZrcakIeV8+1bN7LsvfhPFhA5zREiax6YIA==", + "license": "MIT", + "peer": true, + "dependencies": { + "text-no-case": "^1.2.11", + "text-upper-case-first": "^1.2.11" + } + }, + "node_modules/text-upper-case": { + "version": "1.2.11", + "resolved": "https://registry.npmjs.org/text-upper-case/-/text-upper-case-1.2.11.tgz", + "integrity": "sha512-BfTL7yB1YIRlVGNdZUvno013hOq2cRs07fDR2ApppOXRDuKrEmsLDEY82xXlDzQHELp0jexqkI+NeyPIl6MtMw==", + "license": "MIT", + "peer": true + }, + "node_modules/text-upper-case-first": { + "version": "1.2.11", + "resolved": "https://registry.npmjs.org/text-upper-case-first/-/text-upper-case-first-1.2.11.tgz", + "integrity": "sha512-vgfbwKo8TEJbRsapR9LWWvIJRnv8u9aXVa6cyYOAQQmurCx54Cnt59x5fKdiq+hFaBJ51AbzCgMpbP3p65/pHQ==", + "license": "MIT", + "peer": true + }, + "node_modules/tinyglobby": { + "version": "0.2.17", + "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.17.tgz", + "integrity": "sha512-wXR/dYpcqKmfWpEdZjiKJOwCNFndD0DMnrW/cYjVGttEkBfVgcLFHoNrlj47mjOVic9yyNu65alsgF4NQyTa2g==", + "license": "MIT", + "dependencies": { + "fdir": "^6.5.0", + "picomatch": "^4.0.4" + }, + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/SuperchupuDev" + } + }, + "node_modules/ts-morph": { + "version": "28.0.0", + "resolved": "https://registry.npmjs.org/ts-morph/-/ts-morph-28.0.0.tgz", + "integrity": "sha512-Wp3tnZ2bzwxyTZMtgWVzXDfm7lB1Drz+y9DmmYH/L702PQhPyVrp3pkou3yIz4qjS14GY9kcpmLiOOMvl8oG1g==", + "license": "MIT", + "peer": true, + "dependencies": { + "@ts-morph/common": "~0.29.0", + "code-block-writer": "^13.0.3" + } + }, + "node_modules/ts-to-zod": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/ts-to-zod/-/ts-to-zod-5.1.0.tgz", + "integrity": "sha512-giqqlvRHunlJqG9tBL/KAO3wWIVZGF//mZiWLKm/fdQnKnz4EN2mtiK5cugN9slytBkdMEXQIaLvMzIScbhhFw==", + "license": "MIT", + "peer": true, + "dependencies": { + "@clack/prompts": "1.0.0-alpha.4", + "@oclif/core": "^4.5.4", + "@typescript/vfs": "^1.5.0", + "chokidar": "^4.0.3", + "listr2": "^9.0.4", + "slash": "^5.1.0", + "text-case": "^1.2.4", + "tslib": "^2.3.1", + "tsutils": "^3.21.0", + "typescript": "^5.2.2", + "zod": "^4.1.5" + }, + "bin": { + "ts-to-zod": "bin/run" + } + }, + "node_modules/tslib": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", + "license": "0BSD" + }, + "node_modules/tsutils": { + "version": "3.21.0", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", + "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", + "license": "MIT", + "peer": true, + "dependencies": { + "tslib": "^1.8.1" + }, + "engines": { + "node": ">= 6" + }, + "peerDependencies": { + "typescript": ">=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta" + } + }, + "node_modules/tsutils/node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "license": "0BSD", + "peer": true + }, + "node_modules/tsx": { + "version": "4.22.5", + "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.22.5.tgz", + "integrity": "sha512-F7JnSfPl5ASt6LqwWyUQ3T8BwN3q0eQEbFMYa2iRWaVQmmudo0d7fRmwM4O002gsvW1bs0yBYioutsAjqLJMvQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "esbuild": "~0.28.0" + }, + "bin": { + "tsx": "dist/cli.mjs" + }, + "engines": { + "node": ">=18.0.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + } + }, + "node_modules/type-fest": { + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", + "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", + "license": "(MIT OR CC0-1.0)", + "peer": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/typescript": { + "version": "5.9.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", + "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/undici-types": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz", + "integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==", + "license": "MIT" + }, + "node_modules/vite": { + "version": "8.1.3", + "resolved": "https://registry.npmjs.org/vite/-/vite-8.1.3.tgz", + "integrity": "sha512-Ds+gBRbj0lwRO2Y5hwnUBdxSwlAve9LeRyU4sNnAr0ewW0gWF0n5bgXgUzbgZ49MV9BVUAQUFYVcDUcilUExMA==", + "dev": true, + "license": "MIT", + "dependencies": { + "lightningcss": "^1.32.0", + "picomatch": "^4.0.4", + "postcss": "^8.5.16", + "rolldown": "~1.1.3", + "tinyglobby": "^0.2.17" + }, + "bin": { + "vite": "bin/vite.js" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "funding": { + "url": "https://github.com/vitejs/vite?sponsor=1" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + }, + "peerDependencies": { + "@types/node": "^20.19.0 || >=22.12.0", + "@vitejs/devtools": "^0.3.0", + "esbuild": "^0.27.0 || ^0.28.0", + "jiti": ">=1.21.0", + "less": "^4.0.0", + "sass": "^1.70.0", + "sass-embedded": "^1.70.0", + "stylus": ">=0.54.8", + "sugarss": "^5.0.0", + "terser": "^5.16.0", + "tsx": "^4.8.1", + "yaml": "^2.4.2" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "@vitejs/devtools": { + "optional": true + }, + "esbuild": { + "optional": true + }, + "jiti": { + "optional": true + }, + "less": { + "optional": true + }, + "sass": { + "optional": true + }, + "sass-embedded": { + "optional": true + }, + "stylus": { + "optional": true + }, + "sugarss": { + "optional": true + }, + "terser": { + "optional": true + }, + "tsx": { + "optional": true + }, + "yaml": { + "optional": true + } + } + }, + "node_modules/widest-line": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/widest-line/-/widest-line-3.1.0.tgz", + "integrity": "sha512-NsmoXalsWVDMGupxZ5R08ka9flZjjiLvHVAWYOKtiKM8ujtZWr9cRffak+uSE48+Ob8ObalXpwyeUiyDD6QFgg==", + "license": "MIT", + "peer": true, + "dependencies": { + "string-width": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/wordwrap": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", + "integrity": "sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==", + "license": "MIT", + "peer": true + }, + "node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "license": "MIT", + "peer": true, + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrap-ansi/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/wrap-ansi/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "license": "MIT", + "peer": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/wrap-ansi/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "license": "MIT", + "peer": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "license": "ISC", + "peer": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/yargs": { + "version": "17.7.3", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.3.tgz", + "integrity": "sha512-GZtjxm/J/4TSxuL3FNYjCmLktBTnIw/rVmKSIyKeYAZpmJB2ig9VauCC5xsa82GNKVKDAqpOn3KVzNt0zmrU0g==", + "license": "MIT", + "peer": true, + "dependencies": { + "cliui": "^8.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.1.1" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "license": "ISC", + "peer": true, + "engines": { + "node": ">=12" + } + }, + "node_modules/zod": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/zod/-/zod-4.4.3.tgz", + "integrity": "sha512-ytENFjIJFl2UwYglde2jchW2Hwm4GJFLDiSXWdTrJQBIN9Fcyp7n4DhxJEiWNAJMV1/BqWfW/kkg71UDcHJyTQ==", + "license": "MIT", + "peer": true, + "funding": { + "url": "https://github.com/sponsors/colinhacks" + } + }, + "node_modules/zod-to-ts": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/zod-to-ts/-/zod-to-ts-2.1.0.tgz", + "integrity": "sha512-jZP1GokTqR99FLmtGU+B9acjD9u/R++b++Vxe1sWpBQDd82/9/j5LyLZZ7/Oy3h2nxcz5NihikgX4D0hhdu3+g==", + "license": "MIT", + "peer": true, + "peerDependencies": { + "typescript": "^5 || ^6", + "zod": "^3.25.0 || ^4.0.0" + } + } + } +} diff --git a/actions/github-action/package.json b/actions/github-action/package.json new file mode 100644 index 0000000..8c95b61 --- /dev/null +++ b/actions/github-action/package.json @@ -0,0 +1,23 @@ +{ + "name": "@code0-tech/github-action", + "version": "1.0.0", + "private": true, + "type": "module", + "main": "dist/index.js", + "scripts": { + "dev": "tsx watch src/index.ts", + "typecheck": "tsc --noEmit", + "build": "vite build", + "start": "node dist/index.js" + }, + "dependencies": { + "@code0-tech/hercules": "^1.0.0", + "axios": "^1.7.7" + }, + "devDependencies": { + "@types/node": "^22.0.0", + "tsx": "^4.0.0", + "typescript": "^5.9.3", + "vite": "^8.0.3" + } +} diff --git a/actions/github-action/src/data_types/githubCommon.ts b/actions/github-action/src/data_types/githubCommon.ts new file mode 100644 index 0000000..dd10ed0 --- /dev/null +++ b/actions/github-action/src/data_types/githubCommon.ts @@ -0,0 +1,72 @@ +import { z } from "zod" + +export const GitHubUserSchema = z.object({ + login: z.string(), + id: z.int(), + node_id: z.string(), + avatar_url: z.url(), + html_url: z.url(), + type: z.string(), + site_admin: z.boolean(), +}) +export type GitHubUser = z.infer + +export const GitHubLabelSchema = z.object({ + id: z.int(), + node_id: z.string(), + name: z.string(), + description: z.string().nullable(), + color: z.string(), + default: z.boolean(), +}) +export type GitHubLabel = z.infer + +export const GitHubTeamSchema = z.object({ + id: z.int(), + node_id: z.string(), + name: z.string(), + slug: z.string(), + description: z.string().nullable(), + privacy: z.string(), + html_url: z.url(), +}) +export type GitHubTeam = z.infer + +export const GitHubLicenseSchema = z.object({ + key: z.string(), + name: z.string(), + spdx_id: z.string().nullable(), + url: z.url().nullable(), + node_id: z.string(), +}) +export type GitHubLicense = z.infer + +export const GitHubMilestoneSchema = z.object({ + id: z.int(), + node_id: z.string(), + number: z.int(), + title: z.string(), + description: z.string().nullable(), + state: z.enum(["open", "closed"]), + open_issues: z.int(), + closed_issues: z.int(), + created_at: z.iso.datetime(), + updated_at: z.iso.datetime(), + closed_at: z.iso.datetime().nullable(), + due_on: z.iso.datetime().nullable(), +}) +export type GitHubMilestone = z.infer + +export const GitHubRepositoryReferenceSchema = z.object({ + id: z.int(), + node_id: z.string(), + name: z.string(), + full_name: z.string(), + private: z.boolean(), + owner: GitHubUserSchema, + html_url: z.url(), + description: z.string().nullable(), + fork: z.boolean(), + url: z.url(), +}) +export type GitHubRepositoryReference = z.infer diff --git a/actions/github-action/src/data_types/githubIssue.ts b/actions/github-action/src/data_types/githubIssue.ts new file mode 100644 index 0000000..40444b9 --- /dev/null +++ b/actions/github-action/src/data_types/githubIssue.ts @@ -0,0 +1,38 @@ +import { DisplayMessage, Identifier, Name, Schema } from "@code0-tech/hercules" +import { z } from "zod" +import { GitHubLabelSchema, GitHubMilestoneSchema, GitHubUserSchema } from "./githubCommon.js" + +export const GitHubIssueSchema = z.object({ + id: z.int(), + node_id: z.string(), + url: z.url(), + repository_url: z.url(), + labels_url: z.string(), + comments_url: z.url(), + events_url: z.url(), + html_url: z.url(), + number: z.int().positive(), + state: z.enum(["open", "closed"]), + state_reason: z.enum(["completed", "not_planned", "reopened"]).nullable(), + title: z.string(), + body: z.string().nullable(), + user: GitHubUserSchema.nullable(), + labels: z.array(GitHubLabelSchema), + assignee: GitHubUserSchema.nullable(), + assignees: z.array(GitHubUserSchema), + milestone: GitHubMilestoneSchema.nullable(), + locked: z.boolean(), + active_lock_reason: z.string().nullable().optional(), + comments: z.int().nonnegative(), + author_association: z.string(), + created_at: z.iso.datetime(), + updated_at: z.iso.datetime(), + closed_at: z.iso.datetime().nullable(), +}) +export type GitHubIssue = z.infer + +@Identifier("GITHUB_ISSUE") +@Name({ code: "en-US", content: "GitHub issue" }) +@DisplayMessage({ code: "en-US", content: "GitHub issue" }) +@Schema(GitHubIssueSchema) +export class GitHubIssueDataType {} diff --git a/actions/github-action/src/data_types/githubPullRequest.ts b/actions/github-action/src/data_types/githubPullRequest.ts new file mode 100644 index 0000000..58cd228 --- /dev/null +++ b/actions/github-action/src/data_types/githubPullRequest.ts @@ -0,0 +1,61 @@ +import { DisplayMessage, Identifier, Name, Schema } from "@code0-tech/hercules" +import { z } from "zod" +import { + GitHubLabelSchema, + GitHubMilestoneSchema, + GitHubRepositoryReferenceSchema, + GitHubTeamSchema, + GitHubUserSchema, +} from "./githubCommon.js" + +const GitHubPullRequestBranchSchema = z.object({ + label: z.string(), + ref: z.string(), + sha: z.string(), + user: GitHubUserSchema, + repo: GitHubRepositoryReferenceSchema.nullable(), +}) + +export const GitHubPullRequestSchema = z.object({ + id: z.int(), + node_id: z.string(), + url: z.url(), + html_url: z.url(), + diff_url: z.url(), + patch_url: z.url(), + issue_url: z.url(), + commits_url: z.url(), + review_comments_url: z.string(), + review_comment_url: z.string(), + comments_url: z.url(), + statuses_url: z.url(), + number: z.int().positive(), + state: z.enum(["open", "closed"]), + locked: z.boolean(), + title: z.string(), + body: z.string().nullable(), + user: GitHubUserSchema.nullable(), + labels: z.array(GitHubLabelSchema), + milestone: GitHubMilestoneSchema.nullable(), + active_lock_reason: z.string().nullable().optional(), + created_at: z.iso.datetime(), + updated_at: z.iso.datetime(), + closed_at: z.iso.datetime().nullable(), + merged_at: z.iso.datetime().nullable(), + merge_commit_sha: z.string().nullable(), + assignee: GitHubUserSchema.nullable(), + assignees: z.array(GitHubUserSchema), + requested_reviewers: z.array(GitHubUserSchema), + requested_teams: z.array(GitHubTeamSchema), + head: GitHubPullRequestBranchSchema, + base: GitHubPullRequestBranchSchema, + author_association: z.string(), + draft: z.boolean().nullable(), +}) +export type GitHubPullRequest = z.infer + +@Identifier("GITHUB_PULL_REQUEST") +@Name({ code: "en-US", content: "GitHub pull request" }) +@DisplayMessage({ code: "en-US", content: "GitHub pull request" }) +@Schema(GitHubPullRequestSchema) +export class GitHubPullRequestDataType {} diff --git a/actions/github-action/src/data_types/githubRepository.ts b/actions/github-action/src/data_types/githubRepository.ts new file mode 100644 index 0000000..7ec244a --- /dev/null +++ b/actions/github-action/src/data_types/githubRepository.ts @@ -0,0 +1,46 @@ +import { DisplayMessage, Identifier, Name, Schema } from "@code0-tech/hercules" +import { z } from "zod" +import { GitHubLicenseSchema, GitHubRepositoryReferenceSchema } from "./githubCommon.js" + +export const GitHubRepositorySchema = GitHubRepositoryReferenceSchema.extend({ + created_at: z.iso.datetime(), + updated_at: z.iso.datetime(), + pushed_at: z.iso.datetime().nullable(), + git_url: z.string(), + ssh_url: z.string(), + clone_url: z.url(), + svn_url: z.url(), + homepage: z.string().nullable(), + size: z.int().nonnegative(), + stargazers_count: z.int().nonnegative(), + watchers_count: z.int().nonnegative(), + language: z.string().nullable(), + has_issues: z.boolean(), + has_projects: z.boolean(), + has_downloads: z.boolean(), + has_wiki: z.boolean(), + has_pages: z.boolean(), + has_discussions: z.boolean(), + forks_count: z.int().nonnegative(), + mirror_url: z.string().nullable(), + archived: z.boolean(), + disabled: z.boolean(), + open_issues_count: z.int().nonnegative(), + license: GitHubLicenseSchema.nullable(), + allow_forking: z.boolean().optional(), + is_template: z.boolean().optional(), + web_commit_signoff_required: z.boolean().optional(), + topics: z.array(z.string()), + visibility: z.enum(["public", "private", "internal"]), + forks: z.int().nonnegative(), + open_issues: z.int().nonnegative(), + watchers: z.int().nonnegative(), + default_branch: z.string(), +}) +export type GitHubRepository = z.infer + +@Identifier("GITHUB_REPOSITORY") +@Name({ code: "en-US", content: "GitHub repository" }) +@DisplayMessage({ code: "en-US", content: "GitHub repository" }) +@Schema(GitHubRepositorySchema) +export class GitHubRepositoryDataType {} diff --git a/actions/github-action/src/functions/getIssuesFunction.ts b/actions/github-action/src/functions/getIssuesFunction.ts new file mode 100644 index 0000000..339f978 --- /dev/null +++ b/actions/github-action/src/functions/getIssuesFunction.ts @@ -0,0 +1,74 @@ +import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" +import { GitHubIssue, GitHubIssueSchema } from "../data_types/githubIssue.js" +import { createGitHubClient, handleGitHubError } from "../helpers.js" + +type GitHubIssueState = "open" | "closed" | "all" + +@Identifier("getIssues") +@Signature('(owner: string, repository: string, state?: "open"|"closed"|"all", page?: number, perPage?: number): GITHUB_ISSUE[]') +@Name({ code: "en-US", content: "Get issues" }) +@DisplayMessage({ code: "en-US", content: "Get GitHub issues" }) +@Documentation({ + code: "en-US", + content: "Returns a page of issues from a GitHub repository. Pull requests are excluded from the result.", +}) +@Description({ + code: "en-US", + content: "Returns issues from a GitHub repository.", +}) +@Parameter({ + runtimeName: "owner", + name: [{ code: "en-US", content: "Owner" }], + description: [{ code: "en-US", content: "Repository owner or organization." }], +}) +@Parameter({ + runtimeName: "repository", + name: [{ code: "en-US", content: "Repository" }], + description: [{ code: "en-US", content: "Repository name." }], +}) +@Parameter({ + runtimeName: "state", + name: [{ code: "en-US", content: "State" }], + description: [{ code: "en-US", content: "Filter by open, closed, or all issues. Defaults to open." }], +}) +@Parameter({ + runtimeName: "page", + name: [{ code: "en-US", content: "Page" }], + description: [{ code: "en-US", content: "Page number to return. Defaults to 1." }], +}) +@Parameter({ + runtimeName: "perPage", + name: [{ code: "en-US", content: "Results per page" }], + description: [{ code: "en-US", content: "Number of results per page, from 1 to 100. Defaults to 30." }], +}) +export class GetIssuesFunction { + async run(context: FunctionContext, owner: string, repository: string, state: GitHubIssueState = "open", page = 1, perPage = 30): Promise { + if (!Number.isInteger(page) || page < 1) { + throw new RuntimeError("GITHUB_INVALID_PAGE", "Page must be a positive integer.") + } + if (!Number.isInteger(perPage) || perPage < 1 || perPage > 100) { + throw new RuntimeError("GITHUB_INVALID_PER_PAGE", "Results per page must be an integer from 1 to 100.") + } + + try { + const client = createGitHubClient(context) + const response = await client.get(`/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repository)}/issues`, { + params: { + state, + page, + per_page: perPage, + }, + }) + + if (!Array.isArray(response.data)) { + throw new RuntimeError("GITHUB_INVALID_RESPONSE", "GitHub returned an invalid issues response.") + } + + const issues = response.data.filter((item: unknown) => typeof item === "object" && item !== null && !("pull_request" in item)) + + return GitHubIssueSchema.array().parse(issues) + } catch (error) { + return handleGitHubError(error) + } + } +} diff --git a/actions/github-action/src/functions/getPullRequestsFunction.ts b/actions/github-action/src/functions/getPullRequestsFunction.ts new file mode 100644 index 0000000..1252d44 --- /dev/null +++ b/actions/github-action/src/functions/getPullRequestsFunction.ts @@ -0,0 +1,75 @@ +import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" +import { GitHubPullRequest, GitHubPullRequestSchema } from "../data_types/githubPullRequest.js" +import { createGitHubClient, handleGitHubError } from "../helpers.js" + +type GitHubPullRequestState = "open" | "closed" | "all" + +@Identifier("getPullRequests") +@Signature('(owner: string, repository: string, state?: "open"|"closed"|"all", page?: number, perPage?: number): GITHUB_PULL_REQUEST[]') +@Name({ code: "en-US", content: "Get pull requests" }) +@DisplayMessage({ code: "en-US", content: "Get GitHub pull requests" }) +@Documentation({ + code: "en-US", + content: "Returns a page of pull requests from a GitHub repository.", +}) +@Description({ + code: "en-US", + content: "Returns pull requests from a GitHub repository.", +}) +@Parameter({ + runtimeName: "owner", + name: [{ code: "en-US", content: "Owner" }], + description: [{ code: "en-US", content: "Repository owner or organization." }], +}) +@Parameter({ + runtimeName: "repository", + name: [{ code: "en-US", content: "Repository" }], + description: [{ code: "en-US", content: "Repository name." }], +}) +@Parameter({ + runtimeName: "state", + name: [{ code: "en-US", content: "State" }], + description: [{ code: "en-US", content: "Filter by open, closed, or all pull requests. Defaults to open." }], +}) +@Parameter({ + runtimeName: "page", + name: [{ code: "en-US", content: "Page" }], + description: [{ code: "en-US", content: "Page number to return. Defaults to 1." }], +}) +@Parameter({ + runtimeName: "perPage", + name: [{ code: "en-US", content: "Results per page" }], + description: [{ code: "en-US", content: "Number of results per page, from 1 to 100. Defaults to 30." }], +}) +export class GetPullRequestsFunction { + async run( + context: FunctionContext, + owner: string, + repository: string, + state: GitHubPullRequestState = "open", + page = 1, + perPage = 30 + ): Promise { + if (!Number.isInteger(page) || page < 1) { + throw new RuntimeError("GITHUB_INVALID_PAGE", "Page must be a positive integer.") + } + if (!Number.isInteger(perPage) || perPage < 1 || perPage > 100) { + throw new RuntimeError("GITHUB_INVALID_PER_PAGE", "Results per page must be an integer from 1 to 100.") + } + + try { + const client = createGitHubClient(context) + const response = await client.get(`/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repository)}/pulls`, { + params: { + state, + page, + per_page: perPage, + }, + }) + + return GitHubPullRequestSchema.array().parse(response.data) + } catch (error) { + return handleGitHubError(error) + } + } +} diff --git a/actions/github-action/src/functions/getRepositoryFunction.ts b/actions/github-action/src/functions/getRepositoryFunction.ts new file mode 100644 index 0000000..b35b4f0 --- /dev/null +++ b/actions/github-action/src/functions/getRepositoryFunction.ts @@ -0,0 +1,38 @@ +import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, Signature } from "@code0-tech/hercules" +import { GitHubRepository, GitHubRepositorySchema } from "../data_types/githubRepository.js" +import { createGitHubClient, handleGitHubError } from "../helpers.js" + +@Identifier("getRepository") +@Signature("(owner: string, repository: string): GITHUB_REPOSITORY") +@Name({ code: "en-US", content: "Get repository" }) +@DisplayMessage({ code: "en-US", content: "Get GitHub repository" }) +@Documentation({ + code: "en-US", + content: "Returns information about a GitHub repository.", +}) +@Description({ + code: "en-US", + content: "Returns information about a GitHub repository.", +}) +@Parameter({ + runtimeName: "owner", + name: [{ code: "en-US", content: "Owner" }], + description: [{ code: "en-US", content: "Repository owner or organization." }], +}) +@Parameter({ + runtimeName: "repository", + name: [{ code: "en-US", content: "Repository" }], + description: [{ code: "en-US", content: "Repository name." }], +}) +export class GetRepositoryFunction { + async run(context: FunctionContext, owner: string, repository: string): Promise { + try { + const client = createGitHubClient(context) + const response = await client.get(`/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repository)}`) + + return GitHubRepositorySchema.parse(response.data) + } catch (error) { + return handleGitHubError(error) + } + } +} diff --git a/actions/github-action/src/helpers.ts b/actions/github-action/src/helpers.ts new file mode 100644 index 0000000..e69c5ab --- /dev/null +++ b/actions/github-action/src/helpers.ts @@ -0,0 +1,40 @@ +import axios, { AxiosError } from "axios" +import { FunctionContext, RuntimeError } from "@code0-tech/hercules" + +export function createGitHubClient(context: FunctionContext) { + const token = context.matchedConfig.findConfig("github_token") as string + const baseURL = context.matchedConfig.findConfig("github_api_url") as string + + return axios.create({ + baseURL, + headers: { + Authorization: `Bearer ${token}`, + Accept: "application/vnd.github+json", + "X-GitHub-Api-Version": "2026-03-10", + }, + }) +} + +export function handleGitHubError(error: unknown): never { + if (error instanceof AxiosError) { + const message = + typeof error.response?.data === "object" && error.response?.data !== null && "message" in error.response.data + ? String(error.response.data.message) + : error.message + + switch (error.response?.status) { + case 401: + throw new RuntimeError("GITHUB_AUTHENTICATION_FAILED", message) + case 403: + throw new RuntimeError("GITHUB_ACCESS_DENIED", message) + case 404: + throw new RuntimeError("GITHUB_REPOSITORY_NOT_FOUND", message) + case 422: + throw new RuntimeError("GITHUB_INVALID_REQUEST", message) + } + + throw new RuntimeError("GITHUB_API_ERROR", message) + } + + throw new RuntimeError("GITHUB_API_ERROR", String(error)) +} diff --git a/actions/github-action/src/index.ts b/actions/github-action/src/index.ts new file mode 100644 index 0000000..1ec05d0 --- /dev/null +++ b/actions/github-action/src/index.ts @@ -0,0 +1,76 @@ +import "reflect-metadata" +import { Action, CodeZeroEvent } from "@code0-tech/hercules" + +import { GitHubIssueDataType } from "./data_types/githubIssue.js" +import { GitHubPullRequestDataType } from "./data_types/githubPullRequest.js" +import { GitHubRepositoryDataType } from "./data_types/githubRepository.js" +import { GetIssuesFunction } from "./functions/getIssuesFunction.js" +import { GetPullRequestsFunction } from "./functions/getPullRequestsFunction.js" +import { GetRepositoryFunction } from "./functions/getRepositoryFunction.js" + +const action = new Action( + process.env.ACTION_ID ?? "github-action", + process.env.VERSION ?? "1.0.0", + process.env.AQUILA_URL ?? "127.0.0.1:8081", + "code0-tech", + "tabler:brand-github", + "GitHub integration for retrieving repositories, issues, and pull requests.", + [{ code: "en-US", content: "GitHub Action" }], + [ + { + identifier: "github_token", + type: "TEXT", + name: [{ code: "en-US", content: "GitHub token" }], + description: [ + { + code: "en-US", + content: "Fine-grained GitHub access token used to authenticate API requests.", + }, + ], + linkedDataTypes: ["TEXT"], + }, + { + identifier: "github_api_url", + type: "TEXT", + defaultValue: "https://api.github.com", + name: [{ code: "en-US", content: "GitHub API URL" }], + description: [ + { + code: "en-US", + content: "Base URL of the GitHub REST API.", + }, + ], + linkedDataTypes: ["TEXT"], + }, + ] +) + +action.registerDataTypeClass(GitHubRepositoryDataType) +action.registerDataTypeClass(GitHubIssueDataType) +action.registerDataTypeClass(GitHubPullRequestDataType) + +action.registerRuntimeFunction(GetRepositoryFunction) +action.registerRuntimeFunction(GetIssuesFunction) +action.registerRuntimeFunction(GetPullRequestsFunction) + +action.on(CodeZeroEvent.connected, () => { + console.log("Connected to Aquila") +}) + +action.on(CodeZeroEvent.error, (error: Error) => { + console.error("Stream error:", error.message) + console.log("Attempting to reconnect in 5s...") + + setTimeout(() => { + action.connect(process.env.AUTH_TOKEN ?? "your_auth_token_here").catch((reconnectError: unknown) => { + console.error("Reconnect failed:", reconnectError) + }) + }, 5000) +}) + +action.connect(process.env.AUTH_TOKEN ?? "your_auth_token_here").catch((error: unknown) => { + console.error("Failed to connect:", error) + process.exit(1) +}) + +export { action } diff --git a/actions/github-action/tsconfig.json b/actions/github-action/tsconfig.json new file mode 100644 index 0000000..7a5bd41 --- /dev/null +++ b/actions/github-action/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "target": "ES2020", + "module": "ESNext", + "moduleResolution": "Bundler", + "declaration": true, + "outDir": "dist", + "strict": true, + "esModuleInterop": true, + "skipLibCheck": true, + "allowImportingTsExtensions": true, + "noEmit": true, + "baseUrl": ".", + "experimentalDecorators": true, + "emitDecoratorMetadata": true, + "types": ["node", "vite/client"], + }, + "include": ["src/**/*"], +} diff --git a/actions/github-action/vite.config.ts b/actions/github-action/vite.config.ts new file mode 100644 index 0000000..dc45894 --- /dev/null +++ b/actions/github-action/vite.config.ts @@ -0,0 +1,18 @@ +import { defineConfig } from 'vite'; +import { resolve } from 'path'; + +export default defineConfig({ + build: { + target: "node18", + ssr: resolve(__dirname, 'src/index.ts'), + rollupOptions: { + external: (id) => + [ + 'fs', + 'path', + 'typescript', + '@code0-tech/hercules' + ].includes(id) || id.startsWith('node:') + } + } +}); From f0e619bc88f825b59ab9d979ce98943adb31afc5 Mon Sep 17 00:00:00 2001 From: Marius Ahsmus Date: Fri, 3 Jul 2026 21:34:52 +0200 Subject: [PATCH 02/19] feat: getIssue & Pr, update & create issue & pr functions --- .../src/data_types/githubIssueRequests.ts | 34 +++++++++++ .../data_types/githubPullRequestRequests.ts | 33 +++++++++++ .../src/functions/createIssueFunction.ts | 44 ++++++++++++++ .../functions/createPullRequestFunction.ts | 44 ++++++++++++++ .../src/functions/getIssueFunction.ts | 47 +++++++++++++++ .../src/functions/getPullRequestFunction.ts | 52 ++++++++++++++++ .../src/functions/updateIssueFunction.ts | 53 +++++++++++++++++ .../functions/updatePullRequestFunction.ts | 59 +++++++++++++++++++ actions/github-action/src/index.ts | 24 ++++++++ 9 files changed, 390 insertions(+) create mode 100644 actions/github-action/src/data_types/githubIssueRequests.ts create mode 100644 actions/github-action/src/data_types/githubPullRequestRequests.ts create mode 100644 actions/github-action/src/functions/createIssueFunction.ts create mode 100644 actions/github-action/src/functions/createPullRequestFunction.ts create mode 100644 actions/github-action/src/functions/getIssueFunction.ts create mode 100644 actions/github-action/src/functions/getPullRequestFunction.ts create mode 100644 actions/github-action/src/functions/updateIssueFunction.ts create mode 100644 actions/github-action/src/functions/updatePullRequestFunction.ts diff --git a/actions/github-action/src/data_types/githubIssueRequests.ts b/actions/github-action/src/data_types/githubIssueRequests.ts new file mode 100644 index 0000000..2ed3a00 --- /dev/null +++ b/actions/github-action/src/data_types/githubIssueRequests.ts @@ -0,0 +1,34 @@ +import { DisplayMessage, Identifier, Name, Schema } from "@code0-tech/hercules" +import { z } from "zod" + +export const GitHubCreateIssueRequestSchema = z.object({ + title: z.string().min(1), + body: z.string().optional(), + labels: z.array(z.string()).optional(), + assignees: z.array(z.string()).optional(), + milestone: z.int().positive().optional(), +}) +export type GitHubCreateIssueRequest = z.infer + +export const GitHubUpdateIssueRequestSchema = z.object({ + title: z.string().min(1).optional(), + body: z.string().nullable().optional(), + state: z.enum(["open", "closed"]).optional(), + state_reason: z.enum(["completed", "not_planned", "reopened"]).optional(), + labels: z.array(z.string()).optional(), + assignees: z.array(z.string()).optional(), + milestone: z.int().positive().nullable().optional(), +}) +export type GitHubUpdateIssueRequest = z.infer + +@Identifier("GITHUB_CREATE_ISSUE_REQUEST") +@Name({ code: "en-US", content: "Create GitHub issue request" }) +@DisplayMessage({ code: "en-US", content: "Create GitHub issue request" }) +@Schema(GitHubCreateIssueRequestSchema) +export class GitHubCreateIssueRequestDataType {} + +@Identifier("GITHUB_UPDATE_ISSUE_REQUEST") +@Name({ code: "en-US", content: "Update GitHub issue request" }) +@DisplayMessage({ code: "en-US", content: "Update GitHub issue request" }) +@Schema(GitHubUpdateIssueRequestSchema) +export class GitHubUpdateIssueRequestDataType {} diff --git a/actions/github-action/src/data_types/githubPullRequestRequests.ts b/actions/github-action/src/data_types/githubPullRequestRequests.ts new file mode 100644 index 0000000..2627259 --- /dev/null +++ b/actions/github-action/src/data_types/githubPullRequestRequests.ts @@ -0,0 +1,33 @@ +import { DisplayMessage, Identifier, Name, Schema } from "@code0-tech/hercules" +import { z } from "zod" + +export const GitHubCreatePullRequestRequestSchema = z.object({ + title: z.string().min(1), + head: z.string().min(1), + base: z.string().min(1), + body: z.string().optional(), + draft: z.boolean().optional(), + maintainer_can_modify: z.boolean().optional(), +}) +export type GitHubCreatePullRequestRequest = z.infer + +export const GitHubUpdatePullRequestRequestSchema = z.object({ + title: z.string().min(1).optional(), + body: z.string().nullable().optional(), + state: z.enum(["open", "closed"]).optional(), + base: z.string().min(1).optional(), + maintainer_can_modify: z.boolean().optional(), +}) +export type GitHubUpdatePullRequestRequest = z.infer + +@Identifier("GITHUB_CREATE_PULL_REQUEST_REQUEST") +@Name({ code: "en-US", content: "Create GitHub pull request request" }) +@DisplayMessage({ code: "en-US", content: "Create GitHub pull request request" }) +@Schema(GitHubCreatePullRequestRequestSchema) +export class GitHubCreatePullRequestRequestDataType {} + +@Identifier("GITHUB_UPDATE_PULL_REQUEST_REQUEST") +@Name({ code: "en-US", content: "Update GitHub pull request request" }) +@DisplayMessage({ code: "en-US", content: "Update GitHub pull request request" }) +@Schema(GitHubUpdatePullRequestRequestSchema) +export class GitHubUpdatePullRequestRequestDataType {} diff --git a/actions/github-action/src/functions/createIssueFunction.ts b/actions/github-action/src/functions/createIssueFunction.ts new file mode 100644 index 0000000..fdd5e12 --- /dev/null +++ b/actions/github-action/src/functions/createIssueFunction.ts @@ -0,0 +1,44 @@ +import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, Signature } from "@code0-tech/hercules" +import { GitHubIssue, GitHubIssueSchema } from "../data_types/githubIssue.js" +import { GitHubCreateIssueRequest } from "../data_types/githubIssueRequests.js" +import { createGitHubClient, handleGitHubError } from "../helpers.js" + +@Identifier("createIssue") +@Signature("(owner: string, repository: string, data: GITHUB_CREATE_ISSUE_REQUEST): GITHUB_ISSUE") +@Name({ code: "en-US", content: "Create issue" }) +@DisplayMessage({ code: "en-US", content: "Create GitHub issue" }) +@Documentation({ + code: "en-US", + content: "Creates an issue in a GitHub repository.", +}) +@Description({ + code: "en-US", + content: "Creates an issue in a GitHub repository.", +}) +@Parameter({ + runtimeName: "owner", + name: [{ code: "en-US", content: "Owner" }], + description: [{ code: "en-US", content: "Repository owner or organization." }], +}) +@Parameter({ + runtimeName: "repository", + name: [{ code: "en-US", content: "Repository" }], + description: [{ code: "en-US", content: "Repository name." }], +}) +@Parameter({ + runtimeName: "data", + name: [{ code: "en-US", content: "Issue" }], + description: [{ code: "en-US", content: "Issue fields to create." }], +}) +export class CreateIssueFunction { + async run(context: FunctionContext, owner: string, repository: string, data: GitHubCreateIssueRequest): Promise { + try { + const client = createGitHubClient(context) + const response = await client.post(`/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repository)}/issues`, data) + + return GitHubIssueSchema.parse(response.data) + } catch (error) { + return handleGitHubError(error) + } + } +} diff --git a/actions/github-action/src/functions/createPullRequestFunction.ts b/actions/github-action/src/functions/createPullRequestFunction.ts new file mode 100644 index 0000000..d41f5ca --- /dev/null +++ b/actions/github-action/src/functions/createPullRequestFunction.ts @@ -0,0 +1,44 @@ +import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, Signature } from "@code0-tech/hercules" +import { GitHubPullRequest, GitHubPullRequestSchema } from "../data_types/githubPullRequest.js" +import { GitHubCreatePullRequestRequest } from "../data_types/githubPullRequestRequests.js" +import { createGitHubClient, handleGitHubError } from "../helpers.js" + +@Identifier("createPullRequest") +@Signature("(owner: string, repository: string, data: GITHUB_CREATE_PULL_REQUEST_REQUEST): GITHUB_PULL_REQUEST") +@Name({ code: "en-US", content: "Create pull request" }) +@DisplayMessage({ code: "en-US", content: "Create GitHub pull request" }) +@Documentation({ + code: "en-US", + content: "Creates a pull request between two existing branches.", +}) +@Description({ + code: "en-US", + content: "Creates a pull request in a GitHub repository.", +}) +@Parameter({ + runtimeName: "owner", + name: [{ code: "en-US", content: "Owner" }], + description: [{ code: "en-US", content: "Repository owner or organization." }], +}) +@Parameter({ + runtimeName: "repository", + name: [{ code: "en-US", content: "Repository" }], + description: [{ code: "en-US", content: "Repository name." }], +}) +@Parameter({ + runtimeName: "data", + name: [{ code: "en-US", content: "Pull request" }], + description: [{ code: "en-US", content: "Pull request fields, including the head and base branches." }], +}) +export class CreatePullRequestFunction { + async run(context: FunctionContext, owner: string, repository: string, data: GitHubCreatePullRequestRequest): Promise { + try { + const client = createGitHubClient(context) + const response = await client.post(`/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repository)}/pulls`, data) + + return GitHubPullRequestSchema.parse(response.data) + } catch (error) { + return handleGitHubError(error) + } + } +} diff --git a/actions/github-action/src/functions/getIssueFunction.ts b/actions/github-action/src/functions/getIssueFunction.ts new file mode 100644 index 0000000..f806344 --- /dev/null +++ b/actions/github-action/src/functions/getIssueFunction.ts @@ -0,0 +1,47 @@ +import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" +import { GitHubIssue, GitHubIssueSchema } from "../data_types/githubIssue.js" +import { createGitHubClient, handleGitHubError } from "../helpers.js" + +@Identifier("getIssue") +@Signature("(owner: string, repository: string, issueNumber: number): GITHUB_ISSUE") +@Name({ code: "en-US", content: "Get issue" }) +@DisplayMessage({ code: "en-US", content: "Get GitHub issue" }) +@Documentation({ + code: "en-US", + content: "Returns a single issue from a GitHub repository by its repository-local issue number.", +}) +@Description({ + code: "en-US", + content: "Returns a single issue from a GitHub repository.", +}) +@Parameter({ + runtimeName: "owner", + name: [{ code: "en-US", content: "Owner" }], + description: [{ code: "en-US", content: "Repository owner or organization." }], +}) +@Parameter({ + runtimeName: "repository", + name: [{ code: "en-US", content: "Repository" }], + description: [{ code: "en-US", content: "Repository name." }], +}) +@Parameter({ + runtimeName: "issueNumber", + name: [{ code: "en-US", content: "Issue number" }], + description: [{ code: "en-US", content: "Repository-local issue number." }], +}) +export class GetIssueFunction { + async run(context: FunctionContext, owner: string, repository: string, issueNumber: number): Promise { + if (!Number.isInteger(issueNumber) || issueNumber < 1) { + throw new RuntimeError("GITHUB_INVALID_ISSUE_NUMBER", "Issue number must be a positive integer.") + } + + try { + const client = createGitHubClient(context) + const response = await client.get(`/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repository)}/issues/${issueNumber}`) + + return GitHubIssueSchema.parse(response.data) + } catch (error) { + return handleGitHubError(error) + } + } +} diff --git a/actions/github-action/src/functions/getPullRequestFunction.ts b/actions/github-action/src/functions/getPullRequestFunction.ts new file mode 100644 index 0000000..3e33239 --- /dev/null +++ b/actions/github-action/src/functions/getPullRequestFunction.ts @@ -0,0 +1,52 @@ +import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" +import { GitHubPullRequest, GitHubPullRequestSchema } from "../data_types/githubPullRequest.js" +import { createGitHubClient, handleGitHubError } from "../helpers.js" + +@Identifier("getPullRequest") +@Signature("(owner: string, repository: string, pullRequestNumber: number): GITHUB_PULL_REQUEST") +@Name({ code: "en-US", content: "Get pull request" }) +@DisplayMessage({ code: "en-US", content: "Get GitHub pull request" }) +@Documentation({ + code: "en-US", + content: "Returns a single pull request from a GitHub repository by its repository-local number.", +}) +@Description({ + code: "en-US", + content: "Returns a single pull request from a GitHub repository.", +}) +@Parameter({ + runtimeName: "owner", + name: [{ code: "en-US", content: "Owner" }], + description: [{ code: "en-US", content: "Repository owner or organization." }], +}) +@Parameter({ + runtimeName: "repository", + name: [{ code: "en-US", content: "Repository" }], + description: [{ code: "en-US", content: "Repository name." }], +}) +@Parameter({ + runtimeName: "pullRequestNumber", + name: [{ code: "en-US", content: "Pull request number" }], + description: [ + { + code: "en-US", + content: "Repository-local pull request number.", + }, + ], +}) +export class GetPullRequestFunction { + async run(context: FunctionContext, owner: string, repository: string, pullRequestNumber: number): Promise { + if (!Number.isInteger(pullRequestNumber) || pullRequestNumber < 1) { + throw new RuntimeError("GITHUB_INVALID_PULL_REQUEST_NUMBER", "Pull request number must be a positive integer.") + } + + try { + const client = createGitHubClient(context) + const response = await client.get(`/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repository)}/pulls/${pullRequestNumber}`) + + return GitHubPullRequestSchema.parse(response.data) + } catch (error) { + return handleGitHubError(error) + } + } +} diff --git a/actions/github-action/src/functions/updateIssueFunction.ts b/actions/github-action/src/functions/updateIssueFunction.ts new file mode 100644 index 0000000..b5e6e9a --- /dev/null +++ b/actions/github-action/src/functions/updateIssueFunction.ts @@ -0,0 +1,53 @@ +import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" +import { GitHubIssue, GitHubIssueSchema } from "../data_types/githubIssue.js" +import { GitHubUpdateIssueRequest } from "../data_types/githubIssueRequests.js" +import { createGitHubClient, handleGitHubError } from "../helpers.js" + +@Identifier("updateIssue") +@Signature("(owner: string, repository: string, issueNumber: number, data: GITHUB_UPDATE_ISSUE_REQUEST): GITHUB_ISSUE") +@Name({ code: "en-US", content: "Update issue" }) +@DisplayMessage({ code: "en-US", content: "Update GitHub issue" }) +@Documentation({ + code: "en-US", + content: "Updates or closes an issue in a GitHub repository.", +}) +@Description({ + code: "en-US", + content: "Updates an issue in a GitHub repository.", +}) +@Parameter({ + runtimeName: "owner", + name: [{ code: "en-US", content: "Owner" }], + description: [{ code: "en-US", content: "Repository owner or organization." }], +}) +@Parameter({ + runtimeName: "repository", + name: [{ code: "en-US", content: "Repository" }], + description: [{ code: "en-US", content: "Repository name." }], +}) +@Parameter({ + runtimeName: "issueNumber", + name: [{ code: "en-US", content: "Issue number" }], + description: [{ code: "en-US", content: "Repository-local issue number." }], +}) +@Parameter({ + runtimeName: "data", + name: [{ code: "en-US", content: "Issue updates" }], + description: [{ code: "en-US", content: "Issue fields to update." }], +}) +export class UpdateIssueFunction { + async run(context: FunctionContext, owner: string, repository: string, issueNumber: number, data: GitHubUpdateIssueRequest): Promise { + if (!Number.isInteger(issueNumber) || issueNumber < 1) { + throw new RuntimeError("GITHUB_INVALID_ISSUE_NUMBER", "Issue number must be a positive integer.") + } + + try { + const client = createGitHubClient(context) + const response = await client.patch(`/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repository)}/issues/${issueNumber}`, data) + + return GitHubIssueSchema.parse(response.data) + } catch (error) { + return handleGitHubError(error) + } + } +} diff --git a/actions/github-action/src/functions/updatePullRequestFunction.ts b/actions/github-action/src/functions/updatePullRequestFunction.ts new file mode 100644 index 0000000..ce76fe8 --- /dev/null +++ b/actions/github-action/src/functions/updatePullRequestFunction.ts @@ -0,0 +1,59 @@ +import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" +import { GitHubPullRequest, GitHubPullRequestSchema } from "../data_types/githubPullRequest.js" +import { GitHubUpdatePullRequestRequest } from "../data_types/githubPullRequestRequests.js" +import { createGitHubClient, handleGitHubError } from "../helpers.js" + +@Identifier("updatePullRequest") +@Signature("(owner: string, repository: string, pullRequestNumber: number, data: GITHUB_UPDATE_PULL_REQUEST_REQUEST): GITHUB_PULL_REQUEST") +@Name({ code: "en-US", content: "Update pull request" }) +@DisplayMessage({ code: "en-US", content: "Update GitHub pull request" }) +@Documentation({ + code: "en-US", + content: "Updates or closes a pull request in a GitHub repository.", +}) +@Description({ + code: "en-US", + content: "Updates a pull request in a GitHub repository.", +}) +@Parameter({ + runtimeName: "owner", + name: [{ code: "en-US", content: "Owner" }], + description: [{ code: "en-US", content: "Repository owner or organization." }], +}) +@Parameter({ + runtimeName: "repository", + name: [{ code: "en-US", content: "Repository" }], + description: [{ code: "en-US", content: "Repository name." }], +}) +@Parameter({ + runtimeName: "pullRequestNumber", + name: [{ code: "en-US", content: "Pull request number" }], + description: [{ code: "en-US", content: "Repository-local pull request number." }], +}) +@Parameter({ + runtimeName: "data", + name: [{ code: "en-US", content: "Pull request updates" }], + description: [{ code: "en-US", content: "Pull request fields to update." }], +}) +export class UpdatePullRequestFunction { + async run( + context: FunctionContext, + owner: string, + repository: string, + pullRequestNumber: number, + data: GitHubUpdatePullRequestRequest + ): Promise { + if (!Number.isInteger(pullRequestNumber) || pullRequestNumber < 1) { + throw new RuntimeError("GITHUB_INVALID_PULL_REQUEST_NUMBER", "Pull request number must be a positive integer.") + } + + try { + const client = createGitHubClient(context) + const response = await client.patch(`/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repository)}/pulls/${pullRequestNumber}`, data) + + return GitHubPullRequestSchema.parse(response.data) + } catch (error) { + return handleGitHubError(error) + } + } +} diff --git a/actions/github-action/src/index.ts b/actions/github-action/src/index.ts index 1ec05d0..cf15427 100644 --- a/actions/github-action/src/index.ts +++ b/actions/github-action/src/index.ts @@ -2,11 +2,25 @@ import "reflect-metadata" import { Action, CodeZeroEvent } from "@code0-tech/hercules" import { GitHubIssueDataType } from "./data_types/githubIssue.js" +import { + GitHubCreateIssueRequestDataType, + GitHubUpdateIssueRequestDataType, +} from "./data_types/githubIssueRequests.js" import { GitHubPullRequestDataType } from "./data_types/githubPullRequest.js" +import { + GitHubCreatePullRequestRequestDataType, + GitHubUpdatePullRequestRequestDataType, +} from "./data_types/githubPullRequestRequests.js" import { GitHubRepositoryDataType } from "./data_types/githubRepository.js" +import { CreateIssueFunction } from "./functions/createIssueFunction.js" +import { CreatePullRequestFunction } from "./functions/createPullRequestFunction.js" +import { GetIssueFunction } from "./functions/getIssueFunction.js" import { GetIssuesFunction } from "./functions/getIssuesFunction.js" +import { GetPullRequestFunction } from "./functions/getPullRequestFunction.js" import { GetPullRequestsFunction } from "./functions/getPullRequestsFunction.js" import { GetRepositoryFunction } from "./functions/getRepositoryFunction.js" +import { UpdateIssueFunction } from "./functions/updateIssueFunction.js" +import { UpdatePullRequestFunction } from "./functions/updatePullRequestFunction.js" const action = new Action( process.env.ACTION_ID ?? "github-action", @@ -47,11 +61,21 @@ const action = new Action( action.registerDataTypeClass(GitHubRepositoryDataType) action.registerDataTypeClass(GitHubIssueDataType) +action.registerDataTypeClass(GitHubCreateIssueRequestDataType) +action.registerDataTypeClass(GitHubUpdateIssueRequestDataType) action.registerDataTypeClass(GitHubPullRequestDataType) +action.registerDataTypeClass(GitHubCreatePullRequestRequestDataType) +action.registerDataTypeClass(GitHubUpdatePullRequestRequestDataType) action.registerRuntimeFunction(GetRepositoryFunction) +action.registerRuntimeFunction(GetIssueFunction) action.registerRuntimeFunction(GetIssuesFunction) +action.registerRuntimeFunction(GetPullRequestFunction) action.registerRuntimeFunction(GetPullRequestsFunction) +action.registerRuntimeFunction(CreateIssueFunction) +action.registerRuntimeFunction(UpdateIssueFunction) +action.registerRuntimeFunction(CreatePullRequestFunction) +action.registerRuntimeFunction(UpdatePullRequestFunction) action.on(CodeZeroEvent.connected, () => { console.log("Connected to Aquila") From ed524b133aad223eb9b40ab86b084a2c056ebf95 Mon Sep 17 00:00:00 2001 From: Marius Ahsmus Date: Wed, 8 Jul 2026 20:19:47 +0200 Subject: [PATCH 03/19] feat: github events --- actions/github-action/package-lock.json | 26 +++++++ actions/github-action/package.json | 2 + .../src/data_types/githubCommon.ts | 72 ------------------- .../src/data_types/githubIssue.ts | 30 +------- .../githubIssueClosedWebhookPayload.ts | 11 +++ .../githubIssueOpenedWebhookPayload.ts | 11 +++ .../src/data_types/githubIssueRequests.ts | 20 ++---- .../src/data_types/githubPullRequest.ts | 53 +------------- .../githubPullRequestClosedWebhookPayload.ts | 11 +++ .../githubPullRequestOpenedWebhookPayload.ts | 11 +++ .../data_types/githubPullRequestRequests.ts | 19 ++--- .../src/data_types/githubPush.ts | 11 +++ .../src/data_types/githubRepository.ts | 38 +--------- .../src/events/githubIssueClosedWebhook.ts | 46 ++++++++++++ .../src/events/githubIssueOpenedWebhook.ts | 44 ++++++++++++ .../events/githubPullRequestClosedWebhook.ts | 44 ++++++++++++ .../events/githubPullRequestOpenedWebhook.ts | 44 ++++++++++++ .../src/events/githubRepositoryPushWebhook.ts | 35 +++++++++ actions/github-action/src/index.ts | 37 +++++++--- 19 files changed, 338 insertions(+), 227 deletions(-) delete mode 100644 actions/github-action/src/data_types/githubCommon.ts create mode 100644 actions/github-action/src/data_types/githubIssueClosedWebhookPayload.ts create mode 100644 actions/github-action/src/data_types/githubIssueOpenedWebhookPayload.ts create mode 100644 actions/github-action/src/data_types/githubPullRequestClosedWebhookPayload.ts create mode 100644 actions/github-action/src/data_types/githubPullRequestOpenedWebhookPayload.ts create mode 100644 actions/github-action/src/data_types/githubPush.ts create mode 100644 actions/github-action/src/events/githubIssueClosedWebhook.ts create mode 100644 actions/github-action/src/events/githubIssueOpenedWebhook.ts create mode 100644 actions/github-action/src/events/githubPullRequestClosedWebhook.ts create mode 100644 actions/github-action/src/events/githubPullRequestOpenedWebhook.ts create mode 100644 actions/github-action/src/events/githubRepositoryPushWebhook.ts diff --git a/actions/github-action/package-lock.json b/actions/github-action/package-lock.json index ab1fd7a..beb8d86 100644 --- a/actions/github-action/package-lock.json +++ b/actions/github-action/package-lock.json @@ -12,6 +12,8 @@ "axios": "^1.7.7" }, "devDependencies": { + "@octokit/openapi-webhooks-types": "^12.1.0", + "@octokit/types": "^16.0.0", "@types/node": "^22.0.0", "tsx": "^4.0.0", "typescript": "^5.9.3", @@ -636,6 +638,30 @@ "node": ">=18.0.0" } }, + "node_modules/@octokit/openapi-types": { + "version": "27.0.0", + "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-27.0.0.tgz", + "integrity": "sha512-whrdktVs1h6gtR+09+QsNk2+FO+49j6ga1c55YZudfEG+oKJVvJLQi3zkOm5JjiUXAagWK2tI2kTGKJ2Ys7MGA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@octokit/openapi-webhooks-types": { + "version": "12.1.0", + "resolved": "https://registry.npmjs.org/@octokit/openapi-webhooks-types/-/openapi-webhooks-types-12.1.0.tgz", + "integrity": "sha512-WiuzhOsiOvb7W3Pvmhf8d2C6qaLHXrWiLBP4nJ/4kydu+wpagV5Fkz9RfQwV2afYzv3PB+3xYgp4mAdNGjDprA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@octokit/types": { + "version": "16.0.0", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-16.0.0.tgz", + "integrity": "sha512-sKq+9r1Mm4efXW1FCk7hFSeJo4QKreL/tTbR0rz/qx/r1Oa2VV83LTA/H/MuCOX7uCIJmQVRKBcbmWoySjAnSg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@octokit/openapi-types": "^27.0.0" + } + }, "node_modules/@oxc-project/types": { "version": "0.138.0", "resolved": "https://registry.npmjs.org/@oxc-project/types/-/types-0.138.0.tgz", diff --git a/actions/github-action/package.json b/actions/github-action/package.json index 8c95b61..f16f3bb 100644 --- a/actions/github-action/package.json +++ b/actions/github-action/package.json @@ -15,6 +15,8 @@ "axios": "^1.7.7" }, "devDependencies": { + "@octokit/openapi-webhooks-types": "^12.1.0", + "@octokit/types": "^16.0.0", "@types/node": "^22.0.0", "tsx": "^4.0.0", "typescript": "^5.9.3", diff --git a/actions/github-action/src/data_types/githubCommon.ts b/actions/github-action/src/data_types/githubCommon.ts deleted file mode 100644 index dd10ed0..0000000 --- a/actions/github-action/src/data_types/githubCommon.ts +++ /dev/null @@ -1,72 +0,0 @@ -import { z } from "zod" - -export const GitHubUserSchema = z.object({ - login: z.string(), - id: z.int(), - node_id: z.string(), - avatar_url: z.url(), - html_url: z.url(), - type: z.string(), - site_admin: z.boolean(), -}) -export type GitHubUser = z.infer - -export const GitHubLabelSchema = z.object({ - id: z.int(), - node_id: z.string(), - name: z.string(), - description: z.string().nullable(), - color: z.string(), - default: z.boolean(), -}) -export type GitHubLabel = z.infer - -export const GitHubTeamSchema = z.object({ - id: z.int(), - node_id: z.string(), - name: z.string(), - slug: z.string(), - description: z.string().nullable(), - privacy: z.string(), - html_url: z.url(), -}) -export type GitHubTeam = z.infer - -export const GitHubLicenseSchema = z.object({ - key: z.string(), - name: z.string(), - spdx_id: z.string().nullable(), - url: z.url().nullable(), - node_id: z.string(), -}) -export type GitHubLicense = z.infer - -export const GitHubMilestoneSchema = z.object({ - id: z.int(), - node_id: z.string(), - number: z.int(), - title: z.string(), - description: z.string().nullable(), - state: z.enum(["open", "closed"]), - open_issues: z.int(), - closed_issues: z.int(), - created_at: z.iso.datetime(), - updated_at: z.iso.datetime(), - closed_at: z.iso.datetime().nullable(), - due_on: z.iso.datetime().nullable(), -}) -export type GitHubMilestone = z.infer - -export const GitHubRepositoryReferenceSchema = z.object({ - id: z.int(), - node_id: z.string(), - name: z.string(), - full_name: z.string(), - private: z.boolean(), - owner: GitHubUserSchema, - html_url: z.url(), - description: z.string().nullable(), - fork: z.boolean(), - url: z.url(), -}) -export type GitHubRepositoryReference = z.infer diff --git a/actions/github-action/src/data_types/githubIssue.ts b/actions/github-action/src/data_types/githubIssue.ts index 40444b9..bf6bdc1 100644 --- a/actions/github-action/src/data_types/githubIssue.ts +++ b/actions/github-action/src/data_types/githubIssue.ts @@ -1,34 +1,8 @@ import { DisplayMessage, Identifier, Name, Schema } from "@code0-tech/hercules" +import type { Endpoints } from "@octokit/types" import { z } from "zod" -import { GitHubLabelSchema, GitHubMilestoneSchema, GitHubUserSchema } from "./githubCommon.js" -export const GitHubIssueSchema = z.object({ - id: z.int(), - node_id: z.string(), - url: z.url(), - repository_url: z.url(), - labels_url: z.string(), - comments_url: z.url(), - events_url: z.url(), - html_url: z.url(), - number: z.int().positive(), - state: z.enum(["open", "closed"]), - state_reason: z.enum(["completed", "not_planned", "reopened"]).nullable(), - title: z.string(), - body: z.string().nullable(), - user: GitHubUserSchema.nullable(), - labels: z.array(GitHubLabelSchema), - assignee: GitHubUserSchema.nullable(), - assignees: z.array(GitHubUserSchema), - milestone: GitHubMilestoneSchema.nullable(), - locked: z.boolean(), - active_lock_reason: z.string().nullable().optional(), - comments: z.int().nonnegative(), - author_association: z.string(), - created_at: z.iso.datetime(), - updated_at: z.iso.datetime(), - closed_at: z.iso.datetime().nullable(), -}) +export const GitHubIssueSchema = z.custom() export type GitHubIssue = z.infer @Identifier("GITHUB_ISSUE") diff --git a/actions/github-action/src/data_types/githubIssueClosedWebhookPayload.ts b/actions/github-action/src/data_types/githubIssueClosedWebhookPayload.ts new file mode 100644 index 0000000..6d3d390 --- /dev/null +++ b/actions/github-action/src/data_types/githubIssueClosedWebhookPayload.ts @@ -0,0 +1,11 @@ +import { DisplayMessage, Identifier, Name, Schema } from "@code0-tech/hercules" +import type { components } from "@octokit/openapi-webhooks-types" +import { z } from "zod" + +export const GitHubIssueClosedWebhookPayloadSchema = z.custom() + +@Identifier("GitHubIssueClosedWebhookPayload") +@Name({ code: "en-US", content: "GitHub issue closed webhook payload" }) +@DisplayMessage({ code: "en-US", content: "GitHub issue closed webhook payload" }) +@Schema(GitHubIssueClosedWebhookPayloadSchema) +export class GitHubIssueClosedWebhookPayloadDataType {} diff --git a/actions/github-action/src/data_types/githubIssueOpenedWebhookPayload.ts b/actions/github-action/src/data_types/githubIssueOpenedWebhookPayload.ts new file mode 100644 index 0000000..aa26718 --- /dev/null +++ b/actions/github-action/src/data_types/githubIssueOpenedWebhookPayload.ts @@ -0,0 +1,11 @@ +import { DisplayMessage, Identifier, Name, Schema } from "@code0-tech/hercules" +import type { components } from "@octokit/openapi-webhooks-types" +import { z } from "zod" + +export const GitHubIssueOpenedWebhookPayloadSchema = z.custom() + +@Identifier("GitHubIssueOpenedWebhookPayload") +@Name({ code: "en-US", content: "GitHub issue opened webhook payload" }) +@DisplayMessage({ code: "en-US", content: "GitHub issue opened webhook payload" }) +@Schema(GitHubIssueOpenedWebhookPayloadSchema) +export class GitHubIssueOpenedWebhookPayloadDataType {} diff --git a/actions/github-action/src/data_types/githubIssueRequests.ts b/actions/github-action/src/data_types/githubIssueRequests.ts index 2ed3a00..7ba9fbe 100644 --- a/actions/github-action/src/data_types/githubIssueRequests.ts +++ b/actions/github-action/src/data_types/githubIssueRequests.ts @@ -1,24 +1,12 @@ import { DisplayMessage, Identifier, Name, Schema } from "@code0-tech/hercules" +import type { Endpoints } from "@octokit/types" import { z } from "zod" -export const GitHubCreateIssueRequestSchema = z.object({ - title: z.string().min(1), - body: z.string().optional(), - labels: z.array(z.string()).optional(), - assignees: z.array(z.string()).optional(), - milestone: z.int().positive().optional(), -}) +export const GitHubCreateIssueRequestSchema = z.custom>() export type GitHubCreateIssueRequest = z.infer -export const GitHubUpdateIssueRequestSchema = z.object({ - title: z.string().min(1).optional(), - body: z.string().nullable().optional(), - state: z.enum(["open", "closed"]).optional(), - state_reason: z.enum(["completed", "not_planned", "reopened"]).optional(), - labels: z.array(z.string()).optional(), - assignees: z.array(z.string()).optional(), - milestone: z.int().positive().nullable().optional(), -}) +export const GitHubUpdateIssueRequestSchema = + z.custom>() export type GitHubUpdateIssueRequest = z.infer @Identifier("GITHUB_CREATE_ISSUE_REQUEST") diff --git a/actions/github-action/src/data_types/githubPullRequest.ts b/actions/github-action/src/data_types/githubPullRequest.ts index 58cd228..aa261bc 100644 --- a/actions/github-action/src/data_types/githubPullRequest.ts +++ b/actions/github-action/src/data_types/githubPullRequest.ts @@ -1,57 +1,8 @@ import { DisplayMessage, Identifier, Name, Schema } from "@code0-tech/hercules" +import type { Endpoints } from "@octokit/types" import { z } from "zod" -import { - GitHubLabelSchema, - GitHubMilestoneSchema, - GitHubRepositoryReferenceSchema, - GitHubTeamSchema, - GitHubUserSchema, -} from "./githubCommon.js" -const GitHubPullRequestBranchSchema = z.object({ - label: z.string(), - ref: z.string(), - sha: z.string(), - user: GitHubUserSchema, - repo: GitHubRepositoryReferenceSchema.nullable(), -}) - -export const GitHubPullRequestSchema = z.object({ - id: z.int(), - node_id: z.string(), - url: z.url(), - html_url: z.url(), - diff_url: z.url(), - patch_url: z.url(), - issue_url: z.url(), - commits_url: z.url(), - review_comments_url: z.string(), - review_comment_url: z.string(), - comments_url: z.url(), - statuses_url: z.url(), - number: z.int().positive(), - state: z.enum(["open", "closed"]), - locked: z.boolean(), - title: z.string(), - body: z.string().nullable(), - user: GitHubUserSchema.nullable(), - labels: z.array(GitHubLabelSchema), - milestone: GitHubMilestoneSchema.nullable(), - active_lock_reason: z.string().nullable().optional(), - created_at: z.iso.datetime(), - updated_at: z.iso.datetime(), - closed_at: z.iso.datetime().nullable(), - merged_at: z.iso.datetime().nullable(), - merge_commit_sha: z.string().nullable(), - assignee: GitHubUserSchema.nullable(), - assignees: z.array(GitHubUserSchema), - requested_reviewers: z.array(GitHubUserSchema), - requested_teams: z.array(GitHubTeamSchema), - head: GitHubPullRequestBranchSchema, - base: GitHubPullRequestBranchSchema, - author_association: z.string(), - draft: z.boolean().nullable(), -}) +export const GitHubPullRequestSchema = z.custom() export type GitHubPullRequest = z.infer @Identifier("GITHUB_PULL_REQUEST") diff --git a/actions/github-action/src/data_types/githubPullRequestClosedWebhookPayload.ts b/actions/github-action/src/data_types/githubPullRequestClosedWebhookPayload.ts new file mode 100644 index 0000000..90dee30 --- /dev/null +++ b/actions/github-action/src/data_types/githubPullRequestClosedWebhookPayload.ts @@ -0,0 +1,11 @@ +import { DisplayMessage, Identifier, Name, Schema } from "@code0-tech/hercules" +import type { components } from "@octokit/openapi-webhooks-types" +import { z } from "zod" + +export const GitHubPullRequestClosedWebhookPayloadSchema = z.custom() + +@Identifier("GitHubPullRequestClosedWebhookPayload") +@Name({ code: "en-US", content: "GitHub pull request closed webhook payload" }) +@DisplayMessage({ code: "en-US", content: "GitHub pull request closed webhook payload" }) +@Schema(GitHubPullRequestClosedWebhookPayloadSchema) +export class GitHubPullRequestClosedWebhookPayloadDataType {} diff --git a/actions/github-action/src/data_types/githubPullRequestOpenedWebhookPayload.ts b/actions/github-action/src/data_types/githubPullRequestOpenedWebhookPayload.ts new file mode 100644 index 0000000..f83dec7 --- /dev/null +++ b/actions/github-action/src/data_types/githubPullRequestOpenedWebhookPayload.ts @@ -0,0 +1,11 @@ +import { DisplayMessage, Identifier, Name, Schema } from "@code0-tech/hercules" +import type { components } from "@octokit/openapi-webhooks-types" +import { z } from "zod" + +export const GitHubPullRequestOpenedWebhookPayloadSchema = z.custom() + +@Identifier("GitHubPullRequestOpenedWebhookPayload") +@Name({ code: "en-US", content: "GitHub pull request opened webhook payload" }) +@DisplayMessage({ code: "en-US", content: "GitHub pull request opened webhook payload" }) +@Schema(GitHubPullRequestOpenedWebhookPayloadSchema) +export class GitHubPullRequestOpenedWebhookPayloadDataType {} diff --git a/actions/github-action/src/data_types/githubPullRequestRequests.ts b/actions/github-action/src/data_types/githubPullRequestRequests.ts index 2627259..8e78dc0 100644 --- a/actions/github-action/src/data_types/githubPullRequestRequests.ts +++ b/actions/github-action/src/data_types/githubPullRequestRequests.ts @@ -1,23 +1,12 @@ import { DisplayMessage, Identifier, Name, Schema } from "@code0-tech/hercules" +import type { Endpoints } from "@octokit/types" import { z } from "zod" -export const GitHubCreatePullRequestRequestSchema = z.object({ - title: z.string().min(1), - head: z.string().min(1), - base: z.string().min(1), - body: z.string().optional(), - draft: z.boolean().optional(), - maintainer_can_modify: z.boolean().optional(), -}) +export const GitHubCreatePullRequestRequestSchema = z.custom>() export type GitHubCreatePullRequestRequest = z.infer -export const GitHubUpdatePullRequestRequestSchema = z.object({ - title: z.string().min(1).optional(), - body: z.string().nullable().optional(), - state: z.enum(["open", "closed"]).optional(), - base: z.string().min(1).optional(), - maintainer_can_modify: z.boolean().optional(), -}) +export const GitHubUpdatePullRequestRequestSchema = + z.custom>() export type GitHubUpdatePullRequestRequest = z.infer @Identifier("GITHUB_CREATE_PULL_REQUEST_REQUEST") diff --git a/actions/github-action/src/data_types/githubPush.ts b/actions/github-action/src/data_types/githubPush.ts new file mode 100644 index 0000000..43035d9 --- /dev/null +++ b/actions/github-action/src/data_types/githubPush.ts @@ -0,0 +1,11 @@ +import { DisplayMessage, Identifier, Name, Schema } from "@code0-tech/hercules" +import type { components } from "@octokit/openapi-webhooks-types" +import { z } from "zod" + +export const GitHubPushWebhookPayloadSchema = z.custom() + +@Identifier("GitHubPushWebhookPayload") +@Name({ code: "en-US", content: "GitHub push webhook payload" }) +@DisplayMessage({ code: "en-US", content: "GitHub push webhook payload" }) +@Schema(GitHubPushWebhookPayloadSchema) +export class GitHubPushWebhookPayloadDataType {} diff --git a/actions/github-action/src/data_types/githubRepository.ts b/actions/github-action/src/data_types/githubRepository.ts index 7ec244a..86462fa 100644 --- a/actions/github-action/src/data_types/githubRepository.ts +++ b/actions/github-action/src/data_types/githubRepository.ts @@ -1,42 +1,8 @@ import { DisplayMessage, Identifier, Name, Schema } from "@code0-tech/hercules" +import type { Endpoints } from "@octokit/types" import { z } from "zod" -import { GitHubLicenseSchema, GitHubRepositoryReferenceSchema } from "./githubCommon.js" -export const GitHubRepositorySchema = GitHubRepositoryReferenceSchema.extend({ - created_at: z.iso.datetime(), - updated_at: z.iso.datetime(), - pushed_at: z.iso.datetime().nullable(), - git_url: z.string(), - ssh_url: z.string(), - clone_url: z.url(), - svn_url: z.url(), - homepage: z.string().nullable(), - size: z.int().nonnegative(), - stargazers_count: z.int().nonnegative(), - watchers_count: z.int().nonnegative(), - language: z.string().nullable(), - has_issues: z.boolean(), - has_projects: z.boolean(), - has_downloads: z.boolean(), - has_wiki: z.boolean(), - has_pages: z.boolean(), - has_discussions: z.boolean(), - forks_count: z.int().nonnegative(), - mirror_url: z.string().nullable(), - archived: z.boolean(), - disabled: z.boolean(), - open_issues_count: z.int().nonnegative(), - license: GitHubLicenseSchema.nullable(), - allow_forking: z.boolean().optional(), - is_template: z.boolean().optional(), - web_commit_signoff_required: z.boolean().optional(), - topics: z.array(z.string()), - visibility: z.enum(["public", "private", "internal"]), - forks: z.int().nonnegative(), - open_issues: z.int().nonnegative(), - watchers: z.int().nonnegative(), - default_branch: z.string(), -}) +export const GitHubRepositorySchema = z.custom() export type GitHubRepository = z.infer @Identifier("GITHUB_REPOSITORY") diff --git a/actions/github-action/src/events/githubIssueClosedWebhook.ts b/actions/github-action/src/events/githubIssueClosedWebhook.ts new file mode 100644 index 0000000..156473a --- /dev/null +++ b/actions/github-action/src/events/githubIssueClosedWebhook.ts @@ -0,0 +1,46 @@ +import { Description, DisplayIcon, DisplayMessage, EventSetting, Identifier, Name, Rest, Signature } from "@code0-tech/hercules" + +@Identifier("GitHubIssueClosedWebhook") +@DisplayIcon("tabler:brand-github") +@Name({ code: "en-US", content: "GitHub issue closed" }) +@Description({ code: "en-US", content: "Triggered when a GitHub issue is closed." }) +@DisplayMessage({ code: "en-US", content: "GitHub issue closed on ${httpURL}" }) +@Signature( + "(httpSchema: HTTP_SCHEMA, httpURL: HTTP_URL, httpMethod: HTTP_METHOD, httpAuth: A, httpAuthValue: REST_AUTH_VALUE, owner?: TEXT, repository?: TEXT, assignee?: TEXT, input_schema?: githubIssueClosedWebhookPayload): REST_ADAPTER_INPUT" +) +@EventSetting({ + identifier: "input_schema", + hidden: true, +}) +@EventSetting({ + identifier: "httpMethod", + hidden: true, + defaultValue: "POST", +}) +@EventSetting({ + identifier: "httpSchema", + hidden: true, + defaultValue: "application/json", +}) +@EventSetting({ + identifier: "owner", + linkedDataTypeIdentifiers: ["TEXT"], + name: [{ code: "en-US", content: "Repository owner" }], + description: [{ code: "en-US", content: "Optional GitHub user or organization that owns the repository." }], + optional: true, +}) +@EventSetting({ + identifier: "repository", + linkedDataTypeIdentifiers: ["TEXT"], + name: [{ code: "en-US", content: "Repository" }], + description: [{ code: "en-US", content: "Optional GitHub repository name." }], + optional: true, +}) +@EventSetting({ + identifier: "assignee", + linkedDataTypeIdentifiers: ["TEXT"], + name: [{ code: "en-US", content: "Assignee" }], + description: [{ code: "en-US", content: "Optional GitHub login assigned to issues that should trigger the event." }], + optional: true, +}) +export class GitHubIssueClosedWebhook extends Rest {} diff --git a/actions/github-action/src/events/githubIssueOpenedWebhook.ts b/actions/github-action/src/events/githubIssueOpenedWebhook.ts new file mode 100644 index 0000000..e6af2d1 --- /dev/null +++ b/actions/github-action/src/events/githubIssueOpenedWebhook.ts @@ -0,0 +1,44 @@ +import { Description, DisplayIcon, DisplayMessage, EventSetting, Identifier, Name, Rest, Signature } from "@code0-tech/hercules" + +@Identifier("GitHubIssueOpenedWebhook") +@DisplayIcon("tabler:brand-github") +@Name({ code: "en-US", content: "GitHub issue opened" }) +@Description({ code: "en-US", content: "Triggered when a GitHub issue is opened." }) +@DisplayMessage({ code: "en-US", content: "GitHub issue opened on ${httpURL}" }) +@Signature("(httpSchema: HTTP_SCHEMA, httpURL: HTTP_URL, httpMethod: HTTP_METHOD, httpAuth: A, httpAuthValue: REST_AUTH_VALUE, owner?: TEXT, repository?: TEXT, assignee?: TEXT, input_schema?: githubIssueOpenedWebhookPayload): REST_ADAPTER_INPUT") +@EventSetting({ + identifier: "input_schema", + hidden: true, +}) +@EventSetting({ + identifier: "httpMethod", + hidden: true, + defaultValue: "POST", +}) +@EventSetting({ + identifier: "httpSchema", + hidden: true, + defaultValue: "application/json", +}) +@EventSetting({ + identifier: "owner", + linkedDataTypeIdentifiers: ["TEXT"], + name: [{ code: "en-US", content: "Repository owner" }], + description: [{ code: "en-US", content: "Optional GitHub user or organization that owns the repository." }], + optional: true, +}) +@EventSetting({ + identifier: "repository", + linkedDataTypeIdentifiers: ["TEXT"], + name: [{ code: "en-US", content: "Repository" }], + description: [{ code: "en-US", content: "Optional GitHub repository name." }], + optional: true, +}) +@EventSetting({ + identifier: "assignee", + linkedDataTypeIdentifiers: ["TEXT"], + name: [{ code: "en-US", content: "Assignee" }], + description: [{ code: "en-US", content: "Optional GitHub login assigned to issues that should trigger the event." }], + optional: true, +}) +export class GitHubIssueOpenedWebhook extends Rest {} diff --git a/actions/github-action/src/events/githubPullRequestClosedWebhook.ts b/actions/github-action/src/events/githubPullRequestClosedWebhook.ts new file mode 100644 index 0000000..951c29b --- /dev/null +++ b/actions/github-action/src/events/githubPullRequestClosedWebhook.ts @@ -0,0 +1,44 @@ +import { Description, DisplayIcon, DisplayMessage, EventSetting, Identifier, Name, Rest, Signature } from "@code0-tech/hercules" + +@Identifier("GitHubPullRequestClosedWebhook") +@DisplayIcon("tabler:brand-github") +@Name({ code: "en-US", content: "GitHub pull request closed" }) +@Description({ code: "en-US", content: "Triggered when a GitHub pull request is closed." }) +@DisplayMessage({ code: "en-US", content: "GitHub pull request closed on ${httpURL}" }) +@Signature("(httpSchema: HTTP_SCHEMA, httpURL: HTTP_URL, httpMethod: HTTP_METHOD, httpAuth: A, httpAuthValue: REST_AUTH_VALUE, owner?: TEXT, repository?: TEXT, assignee?: TEXT, input_schema?: githubPullRequestClosedWebhookPayload): REST_ADAPTER_INPUT") +@EventSetting({ + identifier: "input_schema", + hidden: true, +}) +@EventSetting({ + identifier: "httpMethod", + hidden: true, + defaultValue: "POST", +}) +@EventSetting({ + identifier: "httpSchema", + hidden: true, + defaultValue: "application/json", +}) +@EventSetting({ + identifier: "owner", + linkedDataTypeIdentifiers: ["TEXT"], + name: [{ code: "en-US", content: "Repository owner" }], + description: [{ code: "en-US", content: "Optional GitHub user or organization that owns the repository." }], + optional: true, +}) +@EventSetting({ + identifier: "repository", + linkedDataTypeIdentifiers: ["TEXT"], + name: [{ code: "en-US", content: "Repository" }], + description: [{ code: "en-US", content: "Optional GitHub repository name." }], + optional: true, +}) +@EventSetting({ + identifier: "assignee", + linkedDataTypeIdentifiers: ["TEXT"], + name: [{ code: "en-US", content: "Assignee" }], + description: [{ code: "en-US", content: "Optional GitHub login assigned to pull requests that should trigger the event." }], + optional: true, +}) +export class GitHubPullRequestClosedWebhook extends Rest {} diff --git a/actions/github-action/src/events/githubPullRequestOpenedWebhook.ts b/actions/github-action/src/events/githubPullRequestOpenedWebhook.ts new file mode 100644 index 0000000..4168ca8 --- /dev/null +++ b/actions/github-action/src/events/githubPullRequestOpenedWebhook.ts @@ -0,0 +1,44 @@ +import { Description, DisplayIcon, DisplayMessage, EventSetting, Identifier, Name, Rest, Signature } from "@code0-tech/hercules" + +@Identifier("GitHubPullRequestOpenedWebhook") +@DisplayIcon("tabler:brand-github") +@Name({ code: "en-US", content: "GitHub pull request opened" }) +@Description({ code: "en-US", content: "Triggered when a GitHub pull request is opened." }) +@DisplayMessage({ code: "en-US", content: "GitHub pull request opened on ${httpURL}" }) +@Signature("(httpSchema: HTTP_SCHEMA, httpURL: HTTP_URL, httpMethod: HTTP_METHOD, httpAuth: A, httpAuthValue: REST_AUTH_VALUE, owner?: TEXT, repository?: TEXT, assignee?: TEXT, input_schema?: githubPullRequestOpenedWebhookPayload): REST_ADAPTER_INPUT") +@EventSetting({ + identifier: "input_schema", + hidden: true, +}) +@EventSetting({ + identifier: "httpMethod", + hidden: true, + defaultValue: "POST", +}) +@EventSetting({ + identifier: "httpSchema", + hidden: true, + defaultValue: "application/json", +}) +@EventSetting({ + identifier: "owner", + linkedDataTypeIdentifiers: ["TEXT"], + name: [{ code: "en-US", content: "Repository owner" }], + description: [{ code: "en-US", content: "Optional GitHub user or organization that owns the repository." }], + optional: true, +}) +@EventSetting({ + identifier: "repository", + linkedDataTypeIdentifiers: ["TEXT"], + name: [{ code: "en-US", content: "Repository" }], + description: [{ code: "en-US", content: "Optional GitHub repository name." }], + optional: true, +}) +@EventSetting({ + identifier: "assignee", + linkedDataTypeIdentifiers: ["TEXT"], + name: [{ code: "en-US", content: "Assignee" }], + description: [{ code: "en-US", content: "Optional GitHub login assigned to pull requests that should trigger the event." }], + optional: true, +}) +export class GitHubPullRequestOpenedWebhook extends Rest {} diff --git a/actions/github-action/src/events/githubRepositoryPushWebhook.ts b/actions/github-action/src/events/githubRepositoryPushWebhook.ts new file mode 100644 index 0000000..78efec6 --- /dev/null +++ b/actions/github-action/src/events/githubRepositoryPushWebhook.ts @@ -0,0 +1,35 @@ +import { Description, DisplayIcon, DisplayMessage, EventSetting, Identifier, Name, Rest, Signature } from "@code0-tech/hercules" + +@Identifier("GitHubRepositoryPushWebhook") +@DisplayIcon("tabler:brand-github") +@Name({ code: "en-US", content: "GitHub repository push" }) +@Description({ code: "en-US", content: "Triggered when commits or tags are pushed to a GitHub repository." }) +@DisplayMessage({ code: "en-US", content: "GitHub repository push on ${httpURL}" }) +@Signature("(httpSchema: HTTP_SCHEMA, httpURL: HTTP_URL, httpMethod: HTTP_METHOD, httpAuth: A, httpAuthValue: REST_AUTH_VALUE, owner: TEXT, repository: TEXT, input_schema?: githubPush): REST_ADAPTER_INPUT") +@EventSetting({ + identifier: "input_schema", + hidden: true, +}) +@EventSetting({ + identifier: "httpMethod", + hidden: true, + defaultValue: "POST", +}) +@EventSetting({ + identifier: "httpSchema", + hidden: true, + defaultValue: "application/json", +}) +@EventSetting({ + identifier: "owner", + linkedDataTypeIdentifiers: ["TEXT"], + name: [{ code: "en-US", content: "Repository owner" }], + description: [{ code: "en-US", content: "GitHub user or organization that owns the repository." }], +}) +@EventSetting({ + identifier: "repository", + linkedDataTypeIdentifiers: ["TEXT"], + name: [{ code: "en-US", content: "Repository" }], + description: [{ code: "en-US", content: "GitHub repository name." }], +}) +export class GitHubRepositoryPushWebhook extends Rest {} diff --git a/actions/github-action/src/index.ts b/actions/github-action/src/index.ts index cf15427..876e605 100644 --- a/actions/github-action/src/index.ts +++ b/actions/github-action/src/index.ts @@ -1,17 +1,15 @@ import "reflect-metadata" import { Action, CodeZeroEvent } from "@code0-tech/hercules" - import { GitHubIssueDataType } from "./data_types/githubIssue.js" -import { - GitHubCreateIssueRequestDataType, - GitHubUpdateIssueRequestDataType, -} from "./data_types/githubIssueRequests.js" +import { GitHubCreateIssueRequestDataType, GitHubUpdateIssueRequestDataType } from "./data_types/githubIssueRequests.js" import { GitHubPullRequestDataType } from "./data_types/githubPullRequest.js" -import { - GitHubCreatePullRequestRequestDataType, - GitHubUpdatePullRequestRequestDataType, -} from "./data_types/githubPullRequestRequests.js" +import { GitHubPushWebhookPayloadDataType } from "./data_types/githubPush.js" +import { GitHubCreatePullRequestRequestDataType, GitHubUpdatePullRequestRequestDataType } from "./data_types/githubPullRequestRequests.js" import { GitHubRepositoryDataType } from "./data_types/githubRepository.js" +import { GitHubIssueClosedWebhookPayloadDataType } from "./data_types/githubIssueClosedWebhookPayload.js" +import { GitHubIssueOpenedWebhookPayloadDataType } from "./data_types/githubIssueOpenedWebhookPayload.js" +import { GitHubPullRequestClosedWebhookPayloadDataType } from "./data_types/githubPullRequestClosedWebhookPayload.js" +import { GitHubPullRequestOpenedWebhookPayloadDataType } from "./data_types/githubPullRequestOpenedWebhookPayload.js" import { CreateIssueFunction } from "./functions/createIssueFunction.js" import { CreatePullRequestFunction } from "./functions/createPullRequestFunction.js" import { GetIssueFunction } from "./functions/getIssueFunction.js" @@ -21,6 +19,11 @@ import { GetPullRequestsFunction } from "./functions/getPullRequestsFunction.js" import { GetRepositoryFunction } from "./functions/getRepositoryFunction.js" import { UpdateIssueFunction } from "./functions/updateIssueFunction.js" import { UpdatePullRequestFunction } from "./functions/updatePullRequestFunction.js" +import { GitHubIssueClosedWebhook } from "./events/githubIssueClosedWebhook.js" +import { GitHubIssueOpenedWebhook } from "./events/githubIssueOpenedWebhook.js" +import { GitHubPullRequestClosedWebhook } from "./events/githubPullRequestClosedWebhook.js" +import { GitHubPullRequestOpenedWebhook } from "./events/githubPullRequestOpenedWebhook.js" +import { GitHubRepositoryPushWebhook } from "./events/githubRepositoryPushWebhook.js" const action = new Action( process.env.ACTION_ID ?? "github-action", @@ -64,8 +67,13 @@ action.registerDataTypeClass(GitHubIssueDataType) action.registerDataTypeClass(GitHubCreateIssueRequestDataType) action.registerDataTypeClass(GitHubUpdateIssueRequestDataType) action.registerDataTypeClass(GitHubPullRequestDataType) +action.registerDataTypeClass(GitHubPushWebhookPayloadDataType) action.registerDataTypeClass(GitHubCreatePullRequestRequestDataType) action.registerDataTypeClass(GitHubUpdatePullRequestRequestDataType) +action.registerDataTypeClass(GitHubIssueOpenedWebhookPayloadDataType) +action.registerDataTypeClass(GitHubIssueClosedWebhookPayloadDataType) +action.registerDataTypeClass(GitHubPullRequestOpenedWebhookPayloadDataType) +action.registerDataTypeClass(GitHubPullRequestClosedWebhookPayloadDataType) action.registerRuntimeFunction(GetRepositoryFunction) action.registerRuntimeFunction(GetIssueFunction) @@ -77,6 +85,12 @@ action.registerRuntimeFunction(UpdateIssueFunction) action.registerRuntimeFunction(CreatePullRequestFunction) action.registerRuntimeFunction(UpdatePullRequestFunction) +action.registerEventClass(GitHubRepositoryPushWebhook) +action.registerEventClass(GitHubPullRequestOpenedWebhook) +action.registerEventClass(GitHubPullRequestClosedWebhook) +action.registerEventClass(GitHubIssueOpenedWebhook) +action.registerEventClass(GitHubIssueClosedWebhook) + action.on(CodeZeroEvent.connected, () => { console.log("Connected to Aquila") }) @@ -97,4 +111,9 @@ action.connect(process.env.AUTH_TOKEN ?? "your_auth_token_here").catch((error: u process.exit(1) }) +action.on(CodeZeroEvent.moduleUpdated, (message: any) => { + console.dir(message, { depth: null }) + console.dir(action.configs.values(), { depth: null }) +}) + export { action } From 30bc5d278ebb407a305f8245f4e2d17170db4e9e Mon Sep 17 00:00:00 2001 From: Marius Ahsmus Date: Fri, 10 Jul 2026 07:29:14 +0200 Subject: [PATCH 04/19] feat: webhooks --- actions/github-action/package-lock.json | 8 ++-- actions/github-action/package.json | 2 +- .../src/data_types/githubIssue.ts | 4 +- .../githubIssueClosedWebhookPayload.ts | 7 ++- .../githubIssueOpenedWebhookPayload.ts | 7 ++- .../src/data_types/githubIssueRequests.ts | 19 ++++++-- .../src/data_types/githubPullRequest.ts | 4 +- .../githubPullRequestClosedWebhookPayload.ts | 7 ++- .../githubPullRequestOpenedWebhookPayload.ts | 7 ++- .../data_types/githubPullRequestRequests.ts | 18 ++++++-- .../src/data_types/githubPush.ts | 8 +++- .../src/data_types/githubRepository.ts | 2 +- .../src/events/githubIssueClosedWebhook.ts | 25 +---------- .../src/events/githubIssueOpenedWebhook.ts | 23 +--------- .../events/githubPullRequestClosedWebhook.ts | 23 +--------- .../events/githubPullRequestOpenedWebhook.ts | 23 +--------- .../src/events/githubRepositoryPushWebhook.ts | 14 +----- actions/github-action/src/index.ts | 44 +++++++++---------- 18 files changed, 101 insertions(+), 144 deletions(-) diff --git a/actions/github-action/package-lock.json b/actions/github-action/package-lock.json index beb8d86..fb5711e 100644 --- a/actions/github-action/package-lock.json +++ b/actions/github-action/package-lock.json @@ -8,7 +8,7 @@ "name": "@code0-tech/github-action", "version": "1.0.0", "dependencies": { - "@code0-tech/hercules": "^1.0.0", + "@code0-tech/hercules": "^1.0.3", "axios": "^1.7.7" }, "devDependencies": { @@ -44,9 +44,9 @@ } }, "node_modules/@code0-tech/hercules": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@code0-tech/hercules/-/hercules-1.0.2.tgz", - "integrity": "sha512-MXH310yKy6WtT3vSQlpw8YuxOGX5r7RxtNHGMkZE+uxF1/14sTUE0pOIgPlrs87ufIUZEsm1UpJeF+Pupdol3w==", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@code0-tech/hercules/-/hercules-1.0.3.tgz", + "integrity": "sha512-uHQkYv67J9+pKgjPlQ3aCJurzkitN05ZFdGvEWPJo6ayxExks3VCS3b5D1f2tndXLo6zAtwsoT7ETK7FphRNPw==", "license": "ISC", "peerDependencies": { "@code0-tech/tucana": "0.0.74", diff --git a/actions/github-action/package.json b/actions/github-action/package.json index f16f3bb..dc24a99 100644 --- a/actions/github-action/package.json +++ b/actions/github-action/package.json @@ -11,7 +11,7 @@ "start": "node dist/index.js" }, "dependencies": { - "@code0-tech/hercules": "^1.0.0", + "@code0-tech/hercules": "^1.0.3", "axios": "^1.7.7" }, "devDependencies": { diff --git a/actions/github-action/src/data_types/githubIssue.ts b/actions/github-action/src/data_types/githubIssue.ts index bf6bdc1..11e4d0f 100644 --- a/actions/github-action/src/data_types/githubIssue.ts +++ b/actions/github-action/src/data_types/githubIssue.ts @@ -2,7 +2,9 @@ import { DisplayMessage, Identifier, Name, Schema } from "@code0-tech/hercules" import type { Endpoints } from "@octokit/types" import { z } from "zod" -export const GitHubIssueSchema = z.custom() +export const GitHubIssueSchema = z.looseObject({}) as unknown as z.ZodType< + Endpoints["GET /repos/{owner}/{repo}/issues/{issue_number}"]["response"]["data"] +> export type GitHubIssue = z.infer @Identifier("GITHUB_ISSUE") diff --git a/actions/github-action/src/data_types/githubIssueClosedWebhookPayload.ts b/actions/github-action/src/data_types/githubIssueClosedWebhookPayload.ts index 6d3d390..d2ee44f 100644 --- a/actions/github-action/src/data_types/githubIssueClosedWebhookPayload.ts +++ b/actions/github-action/src/data_types/githubIssueClosedWebhookPayload.ts @@ -2,7 +2,12 @@ import { DisplayMessage, Identifier, Name, Schema } from "@code0-tech/hercules" import type { components } from "@octokit/openapi-webhooks-types" import { z } from "zod" -export const GitHubIssueClosedWebhookPayloadSchema = z.custom() +export const GitHubIssueClosedWebhookPayloadSchema = z.looseObject({ + action: z.literal("closed"), + issue: z.looseObject({}), + repository: z.looseObject({}), + sender: z.looseObject({}), +}) as unknown as z.ZodType @Identifier("GitHubIssueClosedWebhookPayload") @Name({ code: "en-US", content: "GitHub issue closed webhook payload" }) diff --git a/actions/github-action/src/data_types/githubIssueOpenedWebhookPayload.ts b/actions/github-action/src/data_types/githubIssueOpenedWebhookPayload.ts index aa26718..9637292 100644 --- a/actions/github-action/src/data_types/githubIssueOpenedWebhookPayload.ts +++ b/actions/github-action/src/data_types/githubIssueOpenedWebhookPayload.ts @@ -2,7 +2,12 @@ import { DisplayMessage, Identifier, Name, Schema } from "@code0-tech/hercules" import type { components } from "@octokit/openapi-webhooks-types" import { z } from "zod" -export const GitHubIssueOpenedWebhookPayloadSchema = z.custom() +export const GitHubIssueOpenedWebhookPayloadSchema = z.looseObject({ + action: z.literal("opened"), + issue: z.looseObject({}), + repository: z.looseObject({}), + sender: z.looseObject({}), +}) as unknown as z.ZodType @Identifier("GitHubIssueOpenedWebhookPayload") @Name({ code: "en-US", content: "GitHub issue opened webhook payload" }) diff --git a/actions/github-action/src/data_types/githubIssueRequests.ts b/actions/github-action/src/data_types/githubIssueRequests.ts index 7ba9fbe..0260788 100644 --- a/actions/github-action/src/data_types/githubIssueRequests.ts +++ b/actions/github-action/src/data_types/githubIssueRequests.ts @@ -2,11 +2,24 @@ import { DisplayMessage, Identifier, Name, Schema } from "@code0-tech/hercules" import type { Endpoints } from "@octokit/types" import { z } from "zod" -export const GitHubCreateIssueRequestSchema = z.custom>() +export const GitHubCreateIssueRequestSchema = z.object({ + title: z.string().min(1), + body: z.string().optional(), + labels: z.array(z.string()).optional(), + assignees: z.array(z.string()).optional(), + milestone: z.int().positive().optional(), +}) as unknown as z.ZodType> export type GitHubCreateIssueRequest = z.infer -export const GitHubUpdateIssueRequestSchema = - z.custom>() +export const GitHubUpdateIssueRequestSchema = z.object({ + title: z.string().min(1).optional(), + body: z.string().nullable().optional(), + state: z.enum(["open", "closed"]).optional(), + state_reason: z.enum(["completed", "not_planned", "reopened"]).optional(), + labels: z.array(z.string()).optional(), + assignees: z.array(z.string()).optional(), + milestone: z.int().positive().nullable().optional(), +}) as unknown as z.ZodType> export type GitHubUpdateIssueRequest = z.infer @Identifier("GITHUB_CREATE_ISSUE_REQUEST") diff --git a/actions/github-action/src/data_types/githubPullRequest.ts b/actions/github-action/src/data_types/githubPullRequest.ts index aa261bc..a1edb10 100644 --- a/actions/github-action/src/data_types/githubPullRequest.ts +++ b/actions/github-action/src/data_types/githubPullRequest.ts @@ -2,7 +2,9 @@ import { DisplayMessage, Identifier, Name, Schema } from "@code0-tech/hercules" import type { Endpoints } from "@octokit/types" import { z } from "zod" -export const GitHubPullRequestSchema = z.custom() +export const GitHubPullRequestSchema = z.looseObject({}) as unknown as z.ZodType< + Endpoints["GET /repos/{owner}/{repo}/pulls/{pull_number}"]["response"]["data"] +> export type GitHubPullRequest = z.infer @Identifier("GITHUB_PULL_REQUEST") diff --git a/actions/github-action/src/data_types/githubPullRequestClosedWebhookPayload.ts b/actions/github-action/src/data_types/githubPullRequestClosedWebhookPayload.ts index 90dee30..863a35f 100644 --- a/actions/github-action/src/data_types/githubPullRequestClosedWebhookPayload.ts +++ b/actions/github-action/src/data_types/githubPullRequestClosedWebhookPayload.ts @@ -2,7 +2,12 @@ import { DisplayMessage, Identifier, Name, Schema } from "@code0-tech/hercules" import type { components } from "@octokit/openapi-webhooks-types" import { z } from "zod" -export const GitHubPullRequestClosedWebhookPayloadSchema = z.custom() +export const GitHubPullRequestClosedWebhookPayloadSchema = z.looseObject({ + action: z.literal("closed"), + pull_request: z.looseObject({}), + repository: z.looseObject({}), + sender: z.looseObject({}), +}) as unknown as z.ZodType @Identifier("GitHubPullRequestClosedWebhookPayload") @Name({ code: "en-US", content: "GitHub pull request closed webhook payload" }) diff --git a/actions/github-action/src/data_types/githubPullRequestOpenedWebhookPayload.ts b/actions/github-action/src/data_types/githubPullRequestOpenedWebhookPayload.ts index f83dec7..9b97500 100644 --- a/actions/github-action/src/data_types/githubPullRequestOpenedWebhookPayload.ts +++ b/actions/github-action/src/data_types/githubPullRequestOpenedWebhookPayload.ts @@ -2,7 +2,12 @@ import { DisplayMessage, Identifier, Name, Schema } from "@code0-tech/hercules" import type { components } from "@octokit/openapi-webhooks-types" import { z } from "zod" -export const GitHubPullRequestOpenedWebhookPayloadSchema = z.custom() +export const GitHubPullRequestOpenedWebhookPayloadSchema = z.looseObject({ + action: z.literal("opened"), + pull_request: z.looseObject({}), + repository: z.looseObject({}), + sender: z.looseObject({}), +}) as unknown as z.ZodType @Identifier("GitHubPullRequestOpenedWebhookPayload") @Name({ code: "en-US", content: "GitHub pull request opened webhook payload" }) diff --git a/actions/github-action/src/data_types/githubPullRequestRequests.ts b/actions/github-action/src/data_types/githubPullRequestRequests.ts index 8e78dc0..aae1b61 100644 --- a/actions/github-action/src/data_types/githubPullRequestRequests.ts +++ b/actions/github-action/src/data_types/githubPullRequestRequests.ts @@ -2,11 +2,23 @@ import { DisplayMessage, Identifier, Name, Schema } from "@code0-tech/hercules" import type { Endpoints } from "@octokit/types" import { z } from "zod" -export const GitHubCreatePullRequestRequestSchema = z.custom>() +export const GitHubCreatePullRequestRequestSchema = z.object({ + title: z.string().min(1), + head: z.string().min(1), + base: z.string().min(1), + body: z.string().optional(), + draft: z.boolean().optional(), + maintainer_can_modify: z.boolean().optional(), +}) as unknown as z.ZodType> export type GitHubCreatePullRequestRequest = z.infer -export const GitHubUpdatePullRequestRequestSchema = - z.custom>() +export const GitHubUpdatePullRequestRequestSchema = z.object({ + title: z.string().min(1).optional(), + body: z.string().nullable().optional(), + state: z.enum(["open", "closed"]).optional(), + base: z.string().min(1).optional(), + maintainer_can_modify: z.boolean().optional(), +}) as unknown as z.ZodType> export type GitHubUpdatePullRequestRequest = z.infer @Identifier("GITHUB_CREATE_PULL_REQUEST_REQUEST") diff --git a/actions/github-action/src/data_types/githubPush.ts b/actions/github-action/src/data_types/githubPush.ts index 43035d9..1dc5d37 100644 --- a/actions/github-action/src/data_types/githubPush.ts +++ b/actions/github-action/src/data_types/githubPush.ts @@ -2,7 +2,13 @@ import { DisplayMessage, Identifier, Name, Schema } from "@code0-tech/hercules" import type { components } from "@octokit/openapi-webhooks-types" import { z } from "zod" -export const GitHubPushWebhookPayloadSchema = z.custom() +export const GitHubPushWebhookPayloadSchema = z.looseObject({ + ref: z.string(), + before: z.string(), + after: z.string(), + repository: z.looseObject({}), + sender: z.looseObject({}), +}) as unknown as z.ZodType @Identifier("GitHubPushWebhookPayload") @Name({ code: "en-US", content: "GitHub push webhook payload" }) diff --git a/actions/github-action/src/data_types/githubRepository.ts b/actions/github-action/src/data_types/githubRepository.ts index 86462fa..90e3653 100644 --- a/actions/github-action/src/data_types/githubRepository.ts +++ b/actions/github-action/src/data_types/githubRepository.ts @@ -2,7 +2,7 @@ import { DisplayMessage, Identifier, Name, Schema } from "@code0-tech/hercules" import type { Endpoints } from "@octokit/types" import { z } from "zod" -export const GitHubRepositorySchema = z.custom() +export const GitHubRepositorySchema = z.looseObject({}) as unknown as z.ZodType export type GitHubRepository = z.infer @Identifier("GITHUB_REPOSITORY") diff --git a/actions/github-action/src/events/githubIssueClosedWebhook.ts b/actions/github-action/src/events/githubIssueClosedWebhook.ts index 156473a..b8891b2 100644 --- a/actions/github-action/src/events/githubIssueClosedWebhook.ts +++ b/actions/github-action/src/events/githubIssueClosedWebhook.ts @@ -5,9 +5,7 @@ import { Description, DisplayIcon, DisplayMessage, EventSetting, Identifier, Nam @Name({ code: "en-US", content: "GitHub issue closed" }) @Description({ code: "en-US", content: "Triggered when a GitHub issue is closed." }) @DisplayMessage({ code: "en-US", content: "GitHub issue closed on ${httpURL}" }) -@Signature( - "(httpSchema: HTTP_SCHEMA, httpURL: HTTP_URL, httpMethod: HTTP_METHOD, httpAuth: A, httpAuthValue: REST_AUTH_VALUE, owner?: TEXT, repository?: TEXT, assignee?: TEXT, input_schema?: githubIssueClosedWebhookPayload): REST_ADAPTER_INPUT" -) +@Signature("(httpSchema: HTTP_SCHEMA, httpURL: HTTP_URL, httpMethod: HTTP_METHOD, httpAuth: A, httpAuthValue: REST_AUTH_VALUE, input_schema?: GitHubIssueClosedWebhookPayload): REST_ADAPTER_INPUT") @EventSetting({ identifier: "input_schema", hidden: true, @@ -22,25 +20,4 @@ import { Description, DisplayIcon, DisplayMessage, EventSetting, Identifier, Nam hidden: true, defaultValue: "application/json", }) -@EventSetting({ - identifier: "owner", - linkedDataTypeIdentifiers: ["TEXT"], - name: [{ code: "en-US", content: "Repository owner" }], - description: [{ code: "en-US", content: "Optional GitHub user or organization that owns the repository." }], - optional: true, -}) -@EventSetting({ - identifier: "repository", - linkedDataTypeIdentifiers: ["TEXT"], - name: [{ code: "en-US", content: "Repository" }], - description: [{ code: "en-US", content: "Optional GitHub repository name." }], - optional: true, -}) -@EventSetting({ - identifier: "assignee", - linkedDataTypeIdentifiers: ["TEXT"], - name: [{ code: "en-US", content: "Assignee" }], - description: [{ code: "en-US", content: "Optional GitHub login assigned to issues that should trigger the event." }], - optional: true, -}) export class GitHubIssueClosedWebhook extends Rest {} diff --git a/actions/github-action/src/events/githubIssueOpenedWebhook.ts b/actions/github-action/src/events/githubIssueOpenedWebhook.ts index e6af2d1..e7c4b53 100644 --- a/actions/github-action/src/events/githubIssueOpenedWebhook.ts +++ b/actions/github-action/src/events/githubIssueOpenedWebhook.ts @@ -5,7 +5,7 @@ import { Description, DisplayIcon, DisplayMessage, EventSetting, Identifier, Nam @Name({ code: "en-US", content: "GitHub issue opened" }) @Description({ code: "en-US", content: "Triggered when a GitHub issue is opened." }) @DisplayMessage({ code: "en-US", content: "GitHub issue opened on ${httpURL}" }) -@Signature("(httpSchema: HTTP_SCHEMA, httpURL: HTTP_URL, httpMethod: HTTP_METHOD, httpAuth: A, httpAuthValue: REST_AUTH_VALUE, owner?: TEXT, repository?: TEXT, assignee?: TEXT, input_schema?: githubIssueOpenedWebhookPayload): REST_ADAPTER_INPUT") +@Signature("(httpSchema: HTTP_SCHEMA, httpURL: HTTP_URL, httpMethod: HTTP_METHOD, httpAuth: A, httpAuthValue: REST_AUTH_VALUE, input_schema?: GitHubIssueOpenedWebhookPayload): REST_ADAPTER_INPUT") @EventSetting({ identifier: "input_schema", hidden: true, @@ -20,25 +20,4 @@ import { Description, DisplayIcon, DisplayMessage, EventSetting, Identifier, Nam hidden: true, defaultValue: "application/json", }) -@EventSetting({ - identifier: "owner", - linkedDataTypeIdentifiers: ["TEXT"], - name: [{ code: "en-US", content: "Repository owner" }], - description: [{ code: "en-US", content: "Optional GitHub user or organization that owns the repository." }], - optional: true, -}) -@EventSetting({ - identifier: "repository", - linkedDataTypeIdentifiers: ["TEXT"], - name: [{ code: "en-US", content: "Repository" }], - description: [{ code: "en-US", content: "Optional GitHub repository name." }], - optional: true, -}) -@EventSetting({ - identifier: "assignee", - linkedDataTypeIdentifiers: ["TEXT"], - name: [{ code: "en-US", content: "Assignee" }], - description: [{ code: "en-US", content: "Optional GitHub login assigned to issues that should trigger the event." }], - optional: true, -}) export class GitHubIssueOpenedWebhook extends Rest {} diff --git a/actions/github-action/src/events/githubPullRequestClosedWebhook.ts b/actions/github-action/src/events/githubPullRequestClosedWebhook.ts index 951c29b..39dda4d 100644 --- a/actions/github-action/src/events/githubPullRequestClosedWebhook.ts +++ b/actions/github-action/src/events/githubPullRequestClosedWebhook.ts @@ -5,7 +5,7 @@ import { Description, DisplayIcon, DisplayMessage, EventSetting, Identifier, Nam @Name({ code: "en-US", content: "GitHub pull request closed" }) @Description({ code: "en-US", content: "Triggered when a GitHub pull request is closed." }) @DisplayMessage({ code: "en-US", content: "GitHub pull request closed on ${httpURL}" }) -@Signature("(httpSchema: HTTP_SCHEMA, httpURL: HTTP_URL, httpMethod: HTTP_METHOD, httpAuth: A, httpAuthValue: REST_AUTH_VALUE, owner?: TEXT, repository?: TEXT, assignee?: TEXT, input_schema?: githubPullRequestClosedWebhookPayload): REST_ADAPTER_INPUT") +@Signature("(httpSchema: HTTP_SCHEMA, httpURL: HTTP_URL, httpMethod: HTTP_METHOD, httpAuth: A, httpAuthValue: REST_AUTH_VALUE, input_schema?: GitHubPullRequestClosedWebhookPayload): REST_ADAPTER_INPUT") @EventSetting({ identifier: "input_schema", hidden: true, @@ -20,25 +20,4 @@ import { Description, DisplayIcon, DisplayMessage, EventSetting, Identifier, Nam hidden: true, defaultValue: "application/json", }) -@EventSetting({ - identifier: "owner", - linkedDataTypeIdentifiers: ["TEXT"], - name: [{ code: "en-US", content: "Repository owner" }], - description: [{ code: "en-US", content: "Optional GitHub user or organization that owns the repository." }], - optional: true, -}) -@EventSetting({ - identifier: "repository", - linkedDataTypeIdentifiers: ["TEXT"], - name: [{ code: "en-US", content: "Repository" }], - description: [{ code: "en-US", content: "Optional GitHub repository name." }], - optional: true, -}) -@EventSetting({ - identifier: "assignee", - linkedDataTypeIdentifiers: ["TEXT"], - name: [{ code: "en-US", content: "Assignee" }], - description: [{ code: "en-US", content: "Optional GitHub login assigned to pull requests that should trigger the event." }], - optional: true, -}) export class GitHubPullRequestClosedWebhook extends Rest {} diff --git a/actions/github-action/src/events/githubPullRequestOpenedWebhook.ts b/actions/github-action/src/events/githubPullRequestOpenedWebhook.ts index 4168ca8..30f4b1a 100644 --- a/actions/github-action/src/events/githubPullRequestOpenedWebhook.ts +++ b/actions/github-action/src/events/githubPullRequestOpenedWebhook.ts @@ -5,7 +5,7 @@ import { Description, DisplayIcon, DisplayMessage, EventSetting, Identifier, Nam @Name({ code: "en-US", content: "GitHub pull request opened" }) @Description({ code: "en-US", content: "Triggered when a GitHub pull request is opened." }) @DisplayMessage({ code: "en-US", content: "GitHub pull request opened on ${httpURL}" }) -@Signature("(httpSchema: HTTP_SCHEMA, httpURL: HTTP_URL, httpMethod: HTTP_METHOD, httpAuth: A, httpAuthValue: REST_AUTH_VALUE, owner?: TEXT, repository?: TEXT, assignee?: TEXT, input_schema?: githubPullRequestOpenedWebhookPayload): REST_ADAPTER_INPUT") +@Signature("(httpSchema: HTTP_SCHEMA, httpURL: HTTP_URL, httpMethod: HTTP_METHOD, httpAuth: A, httpAuthValue: REST_AUTH_VALUE, input_schema?: GitHubPullRequestOpenedWebhookPayload): REST_ADAPTER_INPUT") @EventSetting({ identifier: "input_schema", hidden: true, @@ -20,25 +20,4 @@ import { Description, DisplayIcon, DisplayMessage, EventSetting, Identifier, Nam hidden: true, defaultValue: "application/json", }) -@EventSetting({ - identifier: "owner", - linkedDataTypeIdentifiers: ["TEXT"], - name: [{ code: "en-US", content: "Repository owner" }], - description: [{ code: "en-US", content: "Optional GitHub user or organization that owns the repository." }], - optional: true, -}) -@EventSetting({ - identifier: "repository", - linkedDataTypeIdentifiers: ["TEXT"], - name: [{ code: "en-US", content: "Repository" }], - description: [{ code: "en-US", content: "Optional GitHub repository name." }], - optional: true, -}) -@EventSetting({ - identifier: "assignee", - linkedDataTypeIdentifiers: ["TEXT"], - name: [{ code: "en-US", content: "Assignee" }], - description: [{ code: "en-US", content: "Optional GitHub login assigned to pull requests that should trigger the event." }], - optional: true, -}) export class GitHubPullRequestOpenedWebhook extends Rest {} diff --git a/actions/github-action/src/events/githubRepositoryPushWebhook.ts b/actions/github-action/src/events/githubRepositoryPushWebhook.ts index 78efec6..425520b 100644 --- a/actions/github-action/src/events/githubRepositoryPushWebhook.ts +++ b/actions/github-action/src/events/githubRepositoryPushWebhook.ts @@ -5,7 +5,7 @@ import { Description, DisplayIcon, DisplayMessage, EventSetting, Identifier, Nam @Name({ code: "en-US", content: "GitHub repository push" }) @Description({ code: "en-US", content: "Triggered when commits or tags are pushed to a GitHub repository." }) @DisplayMessage({ code: "en-US", content: "GitHub repository push on ${httpURL}" }) -@Signature("(httpSchema: HTTP_SCHEMA, httpURL: HTTP_URL, httpMethod: HTTP_METHOD, httpAuth: A, httpAuthValue: REST_AUTH_VALUE, owner: TEXT, repository: TEXT, input_schema?: githubPush): REST_ADAPTER_INPUT") +@Signature("(httpSchema: HTTP_SCHEMA, httpURL: HTTP_URL, httpMethod: HTTP_METHOD, httpAuth: A, httpAuthValue: REST_AUTH_VALUE, input_schema?: GitHubPushWebhookPayload): REST_ADAPTER_INPUT") @EventSetting({ identifier: "input_schema", hidden: true, @@ -20,16 +20,4 @@ import { Description, DisplayIcon, DisplayMessage, EventSetting, Identifier, Nam hidden: true, defaultValue: "application/json", }) -@EventSetting({ - identifier: "owner", - linkedDataTypeIdentifiers: ["TEXT"], - name: [{ code: "en-US", content: "Repository owner" }], - description: [{ code: "en-US", content: "GitHub user or organization that owns the repository." }], -}) -@EventSetting({ - identifier: "repository", - linkedDataTypeIdentifiers: ["TEXT"], - name: [{ code: "en-US", content: "Repository" }], - description: [{ code: "en-US", content: "GitHub repository name." }], -}) export class GitHubRepositoryPushWebhook extends Rest {} diff --git a/actions/github-action/src/index.ts b/actions/github-action/src/index.ts index 876e605..b096a80 100644 --- a/actions/github-action/src/index.ts +++ b/actions/github-action/src/index.ts @@ -3,13 +3,13 @@ import { Action, CodeZeroEvent } from "@code0-tech/hercules" import { GitHubIssueDataType } from "./data_types/githubIssue.js" import { GitHubCreateIssueRequestDataType, GitHubUpdateIssueRequestDataType } from "./data_types/githubIssueRequests.js" import { GitHubPullRequestDataType } from "./data_types/githubPullRequest.js" -import { GitHubPushWebhookPayloadDataType } from "./data_types/githubPush.js" +// import { GitHubPushWebhookPayloadDataType } from "./data_types/githubPush.js" import { GitHubCreatePullRequestRequestDataType, GitHubUpdatePullRequestRequestDataType } from "./data_types/githubPullRequestRequests.js" import { GitHubRepositoryDataType } from "./data_types/githubRepository.js" -import { GitHubIssueClosedWebhookPayloadDataType } from "./data_types/githubIssueClosedWebhookPayload.js" -import { GitHubIssueOpenedWebhookPayloadDataType } from "./data_types/githubIssueOpenedWebhookPayload.js" -import { GitHubPullRequestClosedWebhookPayloadDataType } from "./data_types/githubPullRequestClosedWebhookPayload.js" -import { GitHubPullRequestOpenedWebhookPayloadDataType } from "./data_types/githubPullRequestOpenedWebhookPayload.js" +// import { GitHubIssueClosedWebhookPayloadDataType } from "./data_types/githubIssueClosedWebhookPayload.js" +// import { GitHubIssueOpenedWebhookPayloadDataType } from "./data_types/githubIssueOpenedWebhookPayload.js" +// import { GitHubPullRequestClosedWebhookPayloadDataType } from "./data_types/githubPullRequestClosedWebhookPayload.js" +// import { GitHubPullRequestOpenedWebhookPayloadDataType } from "./data_types/githubPullRequestOpenedWebhookPayload.js" import { CreateIssueFunction } from "./functions/createIssueFunction.js" import { CreatePullRequestFunction } from "./functions/createPullRequestFunction.js" import { GetIssueFunction } from "./functions/getIssueFunction.js" @@ -19,11 +19,11 @@ import { GetPullRequestsFunction } from "./functions/getPullRequestsFunction.js" import { GetRepositoryFunction } from "./functions/getRepositoryFunction.js" import { UpdateIssueFunction } from "./functions/updateIssueFunction.js" import { UpdatePullRequestFunction } from "./functions/updatePullRequestFunction.js" -import { GitHubIssueClosedWebhook } from "./events/githubIssueClosedWebhook.js" -import { GitHubIssueOpenedWebhook } from "./events/githubIssueOpenedWebhook.js" -import { GitHubPullRequestClosedWebhook } from "./events/githubPullRequestClosedWebhook.js" -import { GitHubPullRequestOpenedWebhook } from "./events/githubPullRequestOpenedWebhook.js" -import { GitHubRepositoryPushWebhook } from "./events/githubRepositoryPushWebhook.js" +// import { GitHubIssueClosedWebhook } from "./events/githubIssueClosedWebhook.js" +// import { GitHubIssueOpenedWebhook } from "./events/githubIssueOpenedWebhook.js" +// import { GitHubPullRequestClosedWebhook } from "./events/githubPullRequestClosedWebhook.js" +// import { GitHubPullRequestOpenedWebhook } from "./events/githubPullRequestOpenedWebhook.js" +// import { GitHubRepositoryPushWebhook } from "./events/githubRepositoryPushWebhook.js" const action = new Action( process.env.ACTION_ID ?? "github-action", @@ -67,13 +67,13 @@ action.registerDataTypeClass(GitHubIssueDataType) action.registerDataTypeClass(GitHubCreateIssueRequestDataType) action.registerDataTypeClass(GitHubUpdateIssueRequestDataType) action.registerDataTypeClass(GitHubPullRequestDataType) -action.registerDataTypeClass(GitHubPushWebhookPayloadDataType) +// action.registerDataTypeClass(GitHubPushWebhookPayloadDataType) action.registerDataTypeClass(GitHubCreatePullRequestRequestDataType) action.registerDataTypeClass(GitHubUpdatePullRequestRequestDataType) -action.registerDataTypeClass(GitHubIssueOpenedWebhookPayloadDataType) -action.registerDataTypeClass(GitHubIssueClosedWebhookPayloadDataType) -action.registerDataTypeClass(GitHubPullRequestOpenedWebhookPayloadDataType) -action.registerDataTypeClass(GitHubPullRequestClosedWebhookPayloadDataType) +// action.registerDataTypeClass(GitHubIssueOpenedWebhookPayloadDataType) +// action.registerDataTypeClass(GitHubIssueClosedWebhookPayloadDataType) +// action.registerDataTypeClass(GitHubPullRequestOpenedWebhookPayloadDataType) +// action.registerDataTypeClass(GitHubPullRequestClosedWebhookPayloadDataType) action.registerRuntimeFunction(GetRepositoryFunction) action.registerRuntimeFunction(GetIssueFunction) @@ -85,11 +85,11 @@ action.registerRuntimeFunction(UpdateIssueFunction) action.registerRuntimeFunction(CreatePullRequestFunction) action.registerRuntimeFunction(UpdatePullRequestFunction) -action.registerEventClass(GitHubRepositoryPushWebhook) -action.registerEventClass(GitHubPullRequestOpenedWebhook) -action.registerEventClass(GitHubPullRequestClosedWebhook) -action.registerEventClass(GitHubIssueOpenedWebhook) -action.registerEventClass(GitHubIssueClosedWebhook) +// action.registerEventClass(GitHubRepositoryPushWebhook) +// action.registerEventClass(GitHubPullRequestOpenedWebhook) +// action.registerEventClass(GitHubPullRequestClosedWebhook) +// action.registerEventClass(GitHubIssueOpenedWebhook) +// action.registerEventClass(GitHubIssueClosedWebhook) action.on(CodeZeroEvent.connected, () => { console.log("Connected to Aquila") @@ -100,13 +100,13 @@ action.on(CodeZeroEvent.error, (error: Error) => { console.log("Attempting to reconnect in 5s...") setTimeout(() => { - action.connect(process.env.AUTH_TOKEN ?? "your_auth_token_here").catch((reconnectError: unknown) => { + action.connect(process.env.AUTH_TOKEN ?? "token_abc1234").catch((reconnectError: unknown) => { console.error("Reconnect failed:", reconnectError) }) }, 5000) }) -action.connect(process.env.AUTH_TOKEN ?? "your_auth_token_here").catch((error: unknown) => { +action.connect(process.env.AUTH_TOKEN ?? "token_abc1234").catch((error: unknown) => { console.error("Failed to connect:", error) process.exit(1) }) From 3dde9cea6f5abc5f246836055efa526ef67f6263 Mon Sep 17 00:00:00 2001 From: Marius Ahsmus Date: Fri, 10 Jul 2026 07:35:44 +0200 Subject: [PATCH 05/19] feat: improved function folder structure --- .../src/data_types/githubIssue.ts | 4 +--- .../src/data_types/githubPullRequest.ts | 4 +--- .../{ => issues}/createIssueFunction.ts | 6 +++--- .../functions/{ => issues}/getIssueFunction.ts | 4 ++-- .../{ => issues}/getIssuesFunction.ts | 4 ++-- .../{ => issues}/updateIssueFunction.ts | 6 +++--- .../createPullRequestFunction.ts | 6 +++--- .../getPullRequestFunction.ts | 4 ++-- .../getPullRequestsFunction.ts | 4 ++-- .../updatePullRequestFunction.ts | 6 +++--- .../getRepositoryFunction.ts | 4 ++-- actions/github-action/src/index.ts | 18 +++++++++--------- 12 files changed, 33 insertions(+), 37 deletions(-) rename actions/github-action/src/functions/{ => issues}/createIssueFunction.ts (87%) rename actions/github-action/src/functions/{ => issues}/getIssueFunction.ts (92%) rename actions/github-action/src/functions/{ => issues}/getIssuesFunction.ts (95%) rename actions/github-action/src/functions/{ => issues}/updateIssueFunction.ts (89%) rename actions/github-action/src/functions/{ => pullRequests}/createPullRequestFunction.ts (86%) rename actions/github-action/src/functions/{ => pullRequests}/getPullRequestFunction.ts (92%) rename actions/github-action/src/functions/{ => pullRequests}/getPullRequestsFunction.ts (94%) rename actions/github-action/src/functions/{ => pullRequests}/updatePullRequestFunction.ts (89%) rename actions/github-action/src/functions/{ => repositories}/getRepositoryFunction.ts (89%) diff --git a/actions/github-action/src/data_types/githubIssue.ts b/actions/github-action/src/data_types/githubIssue.ts index 11e4d0f..b2835cf 100644 --- a/actions/github-action/src/data_types/githubIssue.ts +++ b/actions/github-action/src/data_types/githubIssue.ts @@ -2,9 +2,7 @@ import { DisplayMessage, Identifier, Name, Schema } from "@code0-tech/hercules" import type { Endpoints } from "@octokit/types" import { z } from "zod" -export const GitHubIssueSchema = z.looseObject({}) as unknown as z.ZodType< - Endpoints["GET /repos/{owner}/{repo}/issues/{issue_number}"]["response"]["data"] -> +export const GitHubIssueSchema = z.looseObject({}) as unknown as z.ZodType export type GitHubIssue = z.infer @Identifier("GITHUB_ISSUE") diff --git a/actions/github-action/src/data_types/githubPullRequest.ts b/actions/github-action/src/data_types/githubPullRequest.ts index a1edb10..e4659c3 100644 --- a/actions/github-action/src/data_types/githubPullRequest.ts +++ b/actions/github-action/src/data_types/githubPullRequest.ts @@ -2,9 +2,7 @@ import { DisplayMessage, Identifier, Name, Schema } from "@code0-tech/hercules" import type { Endpoints } from "@octokit/types" import { z } from "zod" -export const GitHubPullRequestSchema = z.looseObject({}) as unknown as z.ZodType< - Endpoints["GET /repos/{owner}/{repo}/pulls/{pull_number}"]["response"]["data"] -> +export const GitHubPullRequestSchema = z.looseObject({}) as unknown as z.ZodType export type GitHubPullRequest = z.infer @Identifier("GITHUB_PULL_REQUEST") diff --git a/actions/github-action/src/functions/createIssueFunction.ts b/actions/github-action/src/functions/issues/createIssueFunction.ts similarity index 87% rename from actions/github-action/src/functions/createIssueFunction.ts rename to actions/github-action/src/functions/issues/createIssueFunction.ts index fdd5e12..8472117 100644 --- a/actions/github-action/src/functions/createIssueFunction.ts +++ b/actions/github-action/src/functions/issues/createIssueFunction.ts @@ -1,7 +1,7 @@ import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, Signature } from "@code0-tech/hercules" -import { GitHubIssue, GitHubIssueSchema } from "../data_types/githubIssue.js" -import { GitHubCreateIssueRequest } from "../data_types/githubIssueRequests.js" -import { createGitHubClient, handleGitHubError } from "../helpers.js" +import { GitHubIssue, GitHubIssueSchema } from "../../data_types/githubIssue.js" +import { GitHubCreateIssueRequest } from "../../data_types/githubIssueRequests.js" +import { createGitHubClient, handleGitHubError } from "../../helpers.js" @Identifier("createIssue") @Signature("(owner: string, repository: string, data: GITHUB_CREATE_ISSUE_REQUEST): GITHUB_ISSUE") diff --git a/actions/github-action/src/functions/getIssueFunction.ts b/actions/github-action/src/functions/issues/getIssueFunction.ts similarity index 92% rename from actions/github-action/src/functions/getIssueFunction.ts rename to actions/github-action/src/functions/issues/getIssueFunction.ts index f806344..e8e4654 100644 --- a/actions/github-action/src/functions/getIssueFunction.ts +++ b/actions/github-action/src/functions/issues/getIssueFunction.ts @@ -1,6 +1,6 @@ import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" -import { GitHubIssue, GitHubIssueSchema } from "../data_types/githubIssue.js" -import { createGitHubClient, handleGitHubError } from "../helpers.js" +import { GitHubIssue, GitHubIssueSchema } from "../../data_types/githubIssue.js" +import { createGitHubClient, handleGitHubError } from "../../helpers.js" @Identifier("getIssue") @Signature("(owner: string, repository: string, issueNumber: number): GITHUB_ISSUE") diff --git a/actions/github-action/src/functions/getIssuesFunction.ts b/actions/github-action/src/functions/issues/getIssuesFunction.ts similarity index 95% rename from actions/github-action/src/functions/getIssuesFunction.ts rename to actions/github-action/src/functions/issues/getIssuesFunction.ts index 339f978..beb497a 100644 --- a/actions/github-action/src/functions/getIssuesFunction.ts +++ b/actions/github-action/src/functions/issues/getIssuesFunction.ts @@ -1,6 +1,6 @@ import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" -import { GitHubIssue, GitHubIssueSchema } from "../data_types/githubIssue.js" -import { createGitHubClient, handleGitHubError } from "../helpers.js" +import { GitHubIssue, GitHubIssueSchema } from "../../data_types/githubIssue.js" +import { createGitHubClient, handleGitHubError } from "../../helpers.js" type GitHubIssueState = "open" | "closed" | "all" diff --git a/actions/github-action/src/functions/updateIssueFunction.ts b/actions/github-action/src/functions/issues/updateIssueFunction.ts similarity index 89% rename from actions/github-action/src/functions/updateIssueFunction.ts rename to actions/github-action/src/functions/issues/updateIssueFunction.ts index b5e6e9a..c97f664 100644 --- a/actions/github-action/src/functions/updateIssueFunction.ts +++ b/actions/github-action/src/functions/issues/updateIssueFunction.ts @@ -1,7 +1,7 @@ import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" -import { GitHubIssue, GitHubIssueSchema } from "../data_types/githubIssue.js" -import { GitHubUpdateIssueRequest } from "../data_types/githubIssueRequests.js" -import { createGitHubClient, handleGitHubError } from "../helpers.js" +import { GitHubIssue, GitHubIssueSchema } from "../../data_types/githubIssue.js" +import { GitHubUpdateIssueRequest } from "../../data_types/githubIssueRequests.js" +import { createGitHubClient, handleGitHubError } from "../../helpers.js" @Identifier("updateIssue") @Signature("(owner: string, repository: string, issueNumber: number, data: GITHUB_UPDATE_ISSUE_REQUEST): GITHUB_ISSUE") diff --git a/actions/github-action/src/functions/createPullRequestFunction.ts b/actions/github-action/src/functions/pullRequests/createPullRequestFunction.ts similarity index 86% rename from actions/github-action/src/functions/createPullRequestFunction.ts rename to actions/github-action/src/functions/pullRequests/createPullRequestFunction.ts index d41f5ca..babc67c 100644 --- a/actions/github-action/src/functions/createPullRequestFunction.ts +++ b/actions/github-action/src/functions/pullRequests/createPullRequestFunction.ts @@ -1,7 +1,7 @@ import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, Signature } from "@code0-tech/hercules" -import { GitHubPullRequest, GitHubPullRequestSchema } from "../data_types/githubPullRequest.js" -import { GitHubCreatePullRequestRequest } from "../data_types/githubPullRequestRequests.js" -import { createGitHubClient, handleGitHubError } from "../helpers.js" +import { GitHubPullRequest, GitHubPullRequestSchema } from "../../data_types/githubPullRequest.js" +import { GitHubCreatePullRequestRequest } from "../../data_types/githubPullRequestRequests.js" +import { createGitHubClient, handleGitHubError } from "../../helpers.js" @Identifier("createPullRequest") @Signature("(owner: string, repository: string, data: GITHUB_CREATE_PULL_REQUEST_REQUEST): GITHUB_PULL_REQUEST") diff --git a/actions/github-action/src/functions/getPullRequestFunction.ts b/actions/github-action/src/functions/pullRequests/getPullRequestFunction.ts similarity index 92% rename from actions/github-action/src/functions/getPullRequestFunction.ts rename to actions/github-action/src/functions/pullRequests/getPullRequestFunction.ts index 3e33239..e2e0d57 100644 --- a/actions/github-action/src/functions/getPullRequestFunction.ts +++ b/actions/github-action/src/functions/pullRequests/getPullRequestFunction.ts @@ -1,6 +1,6 @@ import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" -import { GitHubPullRequest, GitHubPullRequestSchema } from "../data_types/githubPullRequest.js" -import { createGitHubClient, handleGitHubError } from "../helpers.js" +import { GitHubPullRequest, GitHubPullRequestSchema } from "../../data_types/githubPullRequest.js" +import { createGitHubClient, handleGitHubError } from "../../helpers.js" @Identifier("getPullRequest") @Signature("(owner: string, repository: string, pullRequestNumber: number): GITHUB_PULL_REQUEST") diff --git a/actions/github-action/src/functions/getPullRequestsFunction.ts b/actions/github-action/src/functions/pullRequests/getPullRequestsFunction.ts similarity index 94% rename from actions/github-action/src/functions/getPullRequestsFunction.ts rename to actions/github-action/src/functions/pullRequests/getPullRequestsFunction.ts index 1252d44..b4363d2 100644 --- a/actions/github-action/src/functions/getPullRequestsFunction.ts +++ b/actions/github-action/src/functions/pullRequests/getPullRequestsFunction.ts @@ -1,6 +1,6 @@ import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" -import { GitHubPullRequest, GitHubPullRequestSchema } from "../data_types/githubPullRequest.js" -import { createGitHubClient, handleGitHubError } from "../helpers.js" +import { GitHubPullRequest, GitHubPullRequestSchema } from "../../data_types/githubPullRequest.js" +import { createGitHubClient, handleGitHubError } from "../../helpers.js" type GitHubPullRequestState = "open" | "closed" | "all" diff --git a/actions/github-action/src/functions/updatePullRequestFunction.ts b/actions/github-action/src/functions/pullRequests/updatePullRequestFunction.ts similarity index 89% rename from actions/github-action/src/functions/updatePullRequestFunction.ts rename to actions/github-action/src/functions/pullRequests/updatePullRequestFunction.ts index ce76fe8..83bebd1 100644 --- a/actions/github-action/src/functions/updatePullRequestFunction.ts +++ b/actions/github-action/src/functions/pullRequests/updatePullRequestFunction.ts @@ -1,7 +1,7 @@ import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" -import { GitHubPullRequest, GitHubPullRequestSchema } from "../data_types/githubPullRequest.js" -import { GitHubUpdatePullRequestRequest } from "../data_types/githubPullRequestRequests.js" -import { createGitHubClient, handleGitHubError } from "../helpers.js" +import { GitHubPullRequest, GitHubPullRequestSchema } from "../../data_types/githubPullRequest.js" +import { GitHubUpdatePullRequestRequest } from "../../data_types/githubPullRequestRequests.js" +import { createGitHubClient, handleGitHubError } from "../../helpers.js" @Identifier("updatePullRequest") @Signature("(owner: string, repository: string, pullRequestNumber: number, data: GITHUB_UPDATE_PULL_REQUEST_REQUEST): GITHUB_PULL_REQUEST") diff --git a/actions/github-action/src/functions/getRepositoryFunction.ts b/actions/github-action/src/functions/repositories/getRepositoryFunction.ts similarity index 89% rename from actions/github-action/src/functions/getRepositoryFunction.ts rename to actions/github-action/src/functions/repositories/getRepositoryFunction.ts index b35b4f0..2195411 100644 --- a/actions/github-action/src/functions/getRepositoryFunction.ts +++ b/actions/github-action/src/functions/repositories/getRepositoryFunction.ts @@ -1,6 +1,6 @@ import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, Signature } from "@code0-tech/hercules" -import { GitHubRepository, GitHubRepositorySchema } from "../data_types/githubRepository.js" -import { createGitHubClient, handleGitHubError } from "../helpers.js" +import { GitHubRepository, GitHubRepositorySchema } from "../../data_types/githubRepository.js" +import { createGitHubClient, handleGitHubError } from "../../helpers.js" @Identifier("getRepository") @Signature("(owner: string, repository: string): GITHUB_REPOSITORY") diff --git a/actions/github-action/src/index.ts b/actions/github-action/src/index.ts index b096a80..bb7d9be 100644 --- a/actions/github-action/src/index.ts +++ b/actions/github-action/src/index.ts @@ -10,15 +10,15 @@ import { GitHubRepositoryDataType } from "./data_types/githubRepository.js" // import { GitHubIssueOpenedWebhookPayloadDataType } from "./data_types/githubIssueOpenedWebhookPayload.js" // import { GitHubPullRequestClosedWebhookPayloadDataType } from "./data_types/githubPullRequestClosedWebhookPayload.js" // import { GitHubPullRequestOpenedWebhookPayloadDataType } from "./data_types/githubPullRequestOpenedWebhookPayload.js" -import { CreateIssueFunction } from "./functions/createIssueFunction.js" -import { CreatePullRequestFunction } from "./functions/createPullRequestFunction.js" -import { GetIssueFunction } from "./functions/getIssueFunction.js" -import { GetIssuesFunction } from "./functions/getIssuesFunction.js" -import { GetPullRequestFunction } from "./functions/getPullRequestFunction.js" -import { GetPullRequestsFunction } from "./functions/getPullRequestsFunction.js" -import { GetRepositoryFunction } from "./functions/getRepositoryFunction.js" -import { UpdateIssueFunction } from "./functions/updateIssueFunction.js" -import { UpdatePullRequestFunction } from "./functions/updatePullRequestFunction.js" +import { CreateIssueFunction } from "./functions/issues/createIssueFunction.js" +import { GetIssueFunction } from "./functions/issues/getIssueFunction.js" +import { GetIssuesFunction } from "./functions/issues/getIssuesFunction.js" +import { UpdateIssueFunction } from "./functions/issues/updateIssueFunction.js" +import { CreatePullRequestFunction } from "./functions/pullRequests/createPullRequestFunction.js" +import { GetPullRequestFunction } from "./functions/pullRequests/getPullRequestFunction.js" +import { GetPullRequestsFunction } from "./functions/pullRequests/getPullRequestsFunction.js" +import { UpdatePullRequestFunction } from "./functions/pullRequests/updatePullRequestFunction.js" +import { GetRepositoryFunction } from "./functions/repositories/getRepositoryFunction.js" // import { GitHubIssueClosedWebhook } from "./events/githubIssueClosedWebhook.js" // import { GitHubIssueOpenedWebhook } from "./events/githubIssueOpenedWebhook.js" // import { GitHubPullRequestClosedWebhook } from "./events/githubPullRequestClosedWebhook.js" From 5f58f9d4afc850616e2f36b84b77819021e52b01 Mon Sep 17 00:00:00 2001 From: Marius Ahsmus Date: Fri, 10 Jul 2026 10:49:26 +0200 Subject: [PATCH 06/19] feat: more functions --- .../ciAutomation/githubCiAutomation.ts | 21 ++ .../githubCiAutomationRequests.ts | 40 ++++ .../data_types/ciAutomation/githubWorkflow.ts | 23 +++ .../ciAutomation/githubWorkflowRequests.ts | 15 ++ .../issueComments/githubIssueComment.ts | 14 ++ .../githubIssueCommentRequests.ts | 25 +++ .../issues/githubAssigneesRequest.ts | 14 ++ .../data_types/{ => issues}/githubIssue.ts | 0 .../{ => issues}/githubIssueRequests.ts | 0 .../src/data_types/labels/githubLabel.ts | 12 ++ .../data_types/labels/githubLabelRequests.ts | 14 ++ .../data_types/milestones/githubMilestone.ts | 14 ++ .../milestones/githubMilestoneRequests.ts | 31 +++ .../githubPullRequestReviewComment.ts | 14 ++ .../githubPullRequestReviewCommentRequests.ts | 25 +++ .../githubPullRequestReview.ts | 14 ++ .../githubPullRequestReviewRequests.ts | 46 +++++ .../{ => pullRequests}/githubPullRequest.ts | 0 .../githubPullRequestMergeRequest.ts | 28 +++ .../githubPullRequestRequests.ts | 0 .../src/data_types/releases/githubRelease.ts | 12 ++ .../releases/githubReleaseRequests.ts | 37 ++++ .../repositories/githubBranchRequests.ts | 14 ++ .../data_types/repositories/githubCommit.ts | 12 ++ .../{ => repositories}/githubRepository.ts | 0 .../repositories/githubRepositoryBranch.ts | 14 ++ .../githubIssueClosedWebhookPayload.ts | 0 .../githubIssueOpenedWebhookPayload.ts | 0 .../githubPullRequestClosedWebhookPayload.ts | 0 .../githubPullRequestOpenedWebhookPayload.ts | 0 .../data_types/{ => webhooks}/githubPush.ts | 0 .../ciAutomation/cancelWorkflowRunFunction.ts | 23 +++ .../ciAutomation/createCheckRunFunction.ts | 25 +++ .../createCommitStatusFunction.ts | 29 +++ .../ciAutomation/dispatchWorkflowFunction.ts | 27 +++ .../ciAutomation/getCommitStatusesFunction.ts | 26 +++ .../ciAutomation/getWorkflowRunsFunction.ts | 30 +++ .../ciAutomation/getWorkflowsFunction.ts | 28 +++ .../ciAutomation/rerunWorkflowRunFunction.ts | 23 +++ .../ciAutomation/updateCheckRunFunction.ts | 27 +++ .../createIssueCommentFunction.ts | 35 ++++ .../deleteIssueCommentFunction.ts | 24 +++ .../issueComments/getIssueCommentsFunction.ts | 32 +++ .../updateIssueCommentFunction.ts | 35 ++++ .../issues/addAssigneeToIssueFunction.ts | 30 +++ .../issues/addAssigneesToIssueFunction.ts | 27 +++ .../functions/issues/closeIssueFunction.ts | 28 +++ .../functions/issues/createIssueFunction.ts | 4 +- .../src/functions/issues/getIssueFunction.ts | 2 +- .../src/functions/issues/getIssuesFunction.ts | 2 +- .../issues/removeAssigneeFromIssueFunction.ts | 28 +++ .../removeAssigneesFromIssueFunction.ts | 29 +++ .../functions/issues/reopenIssueFunction.ts | 28 +++ .../functions/issues/updateIssueFunction.ts | 4 +- .../labels/addLabelsToIssueFunction.ts | 27 +++ .../labels/getIssueLabelsFunction.ts | 25 +++ .../src/functions/labels/getLabelsFunction.ts | 28 +++ .../removeAllLabelsFromIssueFunction.ts | 23 +++ .../labels/removeLabelFromIssueFunction.ts | 28 +++ .../labels/setLabelsForIssueFunction.ts | 27 +++ .../milestones/createMilestoneFunction.ts | 25 +++ .../milestones/deleteMilestoneFunction.ts | 24 +++ .../milestones/getMilestoneFunction.ts | 26 +++ .../milestones/getMilestonesFunction.ts | 35 ++++ .../milestones/updateMilestoneFunction.ts | 34 +++ .../createPullRequestReviewCommentFunction.ts | 39 ++++ .../deletePullRequestReviewCommentFunction.ts | 23 +++ .../getPullRequestReviewCommentsFunction.ts | 38 ++++ .../updatePullRequestReviewCommentFunction.ts | 35 ++++ .../createPullRequestReviewFunction.ts | 35 ++++ .../dismissPullRequestReviewFunction.ts | 43 ++++ .../getPullRequestReviewsFunction.ts | 39 ++++ .../submitPullRequestReviewFunction.ts | 43 ++++ .../pullRequests/closePullRequestFunction.ts | 29 +++ .../pullRequests/createPullRequestFunction.ts | 4 +- .../pullRequests/getPullRequestFunction.ts | 2 +- .../pullRequests/getPullRequestsFunction.ts | 2 +- .../pullRequests/mergePullRequestFunction.ts | 36 ++++ .../pullRequests/reopenPullRequestFunction.ts | 29 +++ .../pullRequests/updatePullRequestFunction.ts | 4 +- .../releases/createReleaseFunction.ts | 25 +++ .../releases/deleteReleaseFunction.ts | 23 +++ .../functions/releases/getReleaseFunction.ts | 25 +++ .../functions/releases/getReleasesFunction.ts | 28 +++ .../releases/updateReleaseFunction.ts | 27 +++ .../repositories/createBranchFunction.ts | 26 +++ .../repositories/deleteBranchFunction.ts | 22 ++ .../repositories/getBranchFunction.ts | 24 +++ .../repositories/getCommitFunction.ts | 24 +++ .../repositories/getCommitsFunction.ts | 30 +++ .../getRepositoryBranchesFunction.ts | 29 +++ .../repositories/getRepositoryFunction.ts | 2 +- actions/github-action/src/index.ts | 193 +++++++++++++++++- actions/github-action/vite.config.ts | 20 +- 94 files changed, 2149 insertions(+), 37 deletions(-) create mode 100644 actions/github-action/src/data_types/ciAutomation/githubCiAutomation.ts create mode 100644 actions/github-action/src/data_types/ciAutomation/githubCiAutomationRequests.ts create mode 100644 actions/github-action/src/data_types/ciAutomation/githubWorkflow.ts create mode 100644 actions/github-action/src/data_types/ciAutomation/githubWorkflowRequests.ts create mode 100644 actions/github-action/src/data_types/issueComments/githubIssueComment.ts create mode 100644 actions/github-action/src/data_types/issueComments/githubIssueCommentRequests.ts create mode 100644 actions/github-action/src/data_types/issues/githubAssigneesRequest.ts rename actions/github-action/src/data_types/{ => issues}/githubIssue.ts (100%) rename actions/github-action/src/data_types/{ => issues}/githubIssueRequests.ts (100%) create mode 100644 actions/github-action/src/data_types/labels/githubLabel.ts create mode 100644 actions/github-action/src/data_types/labels/githubLabelRequests.ts create mode 100644 actions/github-action/src/data_types/milestones/githubMilestone.ts create mode 100644 actions/github-action/src/data_types/milestones/githubMilestoneRequests.ts create mode 100644 actions/github-action/src/data_types/pullRequestReviewComments/githubPullRequestReviewComment.ts create mode 100644 actions/github-action/src/data_types/pullRequestReviewComments/githubPullRequestReviewCommentRequests.ts create mode 100644 actions/github-action/src/data_types/pullRequestReviews/githubPullRequestReview.ts create mode 100644 actions/github-action/src/data_types/pullRequestReviews/githubPullRequestReviewRequests.ts rename actions/github-action/src/data_types/{ => pullRequests}/githubPullRequest.ts (100%) create mode 100644 actions/github-action/src/data_types/pullRequests/githubPullRequestMergeRequest.ts rename actions/github-action/src/data_types/{ => pullRequests}/githubPullRequestRequests.ts (100%) create mode 100644 actions/github-action/src/data_types/releases/githubRelease.ts create mode 100644 actions/github-action/src/data_types/releases/githubReleaseRequests.ts create mode 100644 actions/github-action/src/data_types/repositories/githubBranchRequests.ts create mode 100644 actions/github-action/src/data_types/repositories/githubCommit.ts rename actions/github-action/src/data_types/{ => repositories}/githubRepository.ts (100%) create mode 100644 actions/github-action/src/data_types/repositories/githubRepositoryBranch.ts rename actions/github-action/src/data_types/{ => webhooks}/githubIssueClosedWebhookPayload.ts (100%) rename actions/github-action/src/data_types/{ => webhooks}/githubIssueOpenedWebhookPayload.ts (100%) rename actions/github-action/src/data_types/{ => webhooks}/githubPullRequestClosedWebhookPayload.ts (100%) rename actions/github-action/src/data_types/{ => webhooks}/githubPullRequestOpenedWebhookPayload.ts (100%) rename actions/github-action/src/data_types/{ => webhooks}/githubPush.ts (100%) create mode 100644 actions/github-action/src/functions/ciAutomation/cancelWorkflowRunFunction.ts create mode 100644 actions/github-action/src/functions/ciAutomation/createCheckRunFunction.ts create mode 100644 actions/github-action/src/functions/ciAutomation/createCommitStatusFunction.ts create mode 100644 actions/github-action/src/functions/ciAutomation/dispatchWorkflowFunction.ts create mode 100644 actions/github-action/src/functions/ciAutomation/getCommitStatusesFunction.ts create mode 100644 actions/github-action/src/functions/ciAutomation/getWorkflowRunsFunction.ts create mode 100644 actions/github-action/src/functions/ciAutomation/getWorkflowsFunction.ts create mode 100644 actions/github-action/src/functions/ciAutomation/rerunWorkflowRunFunction.ts create mode 100644 actions/github-action/src/functions/ciAutomation/updateCheckRunFunction.ts create mode 100644 actions/github-action/src/functions/issueComments/createIssueCommentFunction.ts create mode 100644 actions/github-action/src/functions/issueComments/deleteIssueCommentFunction.ts create mode 100644 actions/github-action/src/functions/issueComments/getIssueCommentsFunction.ts create mode 100644 actions/github-action/src/functions/issueComments/updateIssueCommentFunction.ts create mode 100644 actions/github-action/src/functions/issues/addAssigneeToIssueFunction.ts create mode 100644 actions/github-action/src/functions/issues/addAssigneesToIssueFunction.ts create mode 100644 actions/github-action/src/functions/issues/closeIssueFunction.ts create mode 100644 actions/github-action/src/functions/issues/removeAssigneeFromIssueFunction.ts create mode 100644 actions/github-action/src/functions/issues/removeAssigneesFromIssueFunction.ts create mode 100644 actions/github-action/src/functions/issues/reopenIssueFunction.ts create mode 100644 actions/github-action/src/functions/labels/addLabelsToIssueFunction.ts create mode 100644 actions/github-action/src/functions/labels/getIssueLabelsFunction.ts create mode 100644 actions/github-action/src/functions/labels/getLabelsFunction.ts create mode 100644 actions/github-action/src/functions/labels/removeAllLabelsFromIssueFunction.ts create mode 100644 actions/github-action/src/functions/labels/removeLabelFromIssueFunction.ts create mode 100644 actions/github-action/src/functions/labels/setLabelsForIssueFunction.ts create mode 100644 actions/github-action/src/functions/milestones/createMilestoneFunction.ts create mode 100644 actions/github-action/src/functions/milestones/deleteMilestoneFunction.ts create mode 100644 actions/github-action/src/functions/milestones/getMilestoneFunction.ts create mode 100644 actions/github-action/src/functions/milestones/getMilestonesFunction.ts create mode 100644 actions/github-action/src/functions/milestones/updateMilestoneFunction.ts create mode 100644 actions/github-action/src/functions/pullRequestReviewComments/createPullRequestReviewCommentFunction.ts create mode 100644 actions/github-action/src/functions/pullRequestReviewComments/deletePullRequestReviewCommentFunction.ts create mode 100644 actions/github-action/src/functions/pullRequestReviewComments/getPullRequestReviewCommentsFunction.ts create mode 100644 actions/github-action/src/functions/pullRequestReviewComments/updatePullRequestReviewCommentFunction.ts create mode 100644 actions/github-action/src/functions/pullRequestReviews/createPullRequestReviewFunction.ts create mode 100644 actions/github-action/src/functions/pullRequestReviews/dismissPullRequestReviewFunction.ts create mode 100644 actions/github-action/src/functions/pullRequestReviews/getPullRequestReviewsFunction.ts create mode 100644 actions/github-action/src/functions/pullRequestReviews/submitPullRequestReviewFunction.ts create mode 100644 actions/github-action/src/functions/pullRequests/closePullRequestFunction.ts create mode 100644 actions/github-action/src/functions/pullRequests/mergePullRequestFunction.ts create mode 100644 actions/github-action/src/functions/pullRequests/reopenPullRequestFunction.ts create mode 100644 actions/github-action/src/functions/releases/createReleaseFunction.ts create mode 100644 actions/github-action/src/functions/releases/deleteReleaseFunction.ts create mode 100644 actions/github-action/src/functions/releases/getReleaseFunction.ts create mode 100644 actions/github-action/src/functions/releases/getReleasesFunction.ts create mode 100644 actions/github-action/src/functions/releases/updateReleaseFunction.ts create mode 100644 actions/github-action/src/functions/repositories/createBranchFunction.ts create mode 100644 actions/github-action/src/functions/repositories/deleteBranchFunction.ts create mode 100644 actions/github-action/src/functions/repositories/getBranchFunction.ts create mode 100644 actions/github-action/src/functions/repositories/getCommitFunction.ts create mode 100644 actions/github-action/src/functions/repositories/getCommitsFunction.ts create mode 100644 actions/github-action/src/functions/repositories/getRepositoryBranchesFunction.ts diff --git a/actions/github-action/src/data_types/ciAutomation/githubCiAutomation.ts b/actions/github-action/src/data_types/ciAutomation/githubCiAutomation.ts new file mode 100644 index 0000000..3354163 --- /dev/null +++ b/actions/github-action/src/data_types/ciAutomation/githubCiAutomation.ts @@ -0,0 +1,21 @@ +import { DisplayMessage, Identifier, Name, Schema } from "@code0-tech/hercules" +import type { Endpoints } from "@octokit/types" +import { z } from "zod" + +export const GitHubCommitStatusSchema = z.looseObject({}) as unknown as z.ZodType +export type GitHubCommitStatus = z.infer + +export const GitHubCheckRunSchema = z.looseObject({}) as unknown as z.ZodType +export type GitHubCheckRun = z.infer + +@Identifier("GITHUB_COMMIT_STATUS") +@Name({ code: "en-US", content: "GitHub commit status" }) +@DisplayMessage({ code: "en-US", content: "GitHub commit status" }) +@Schema(GitHubCommitStatusSchema) +export class GitHubCommitStatusDataType {} + +@Identifier("GITHUB_CHECK_RUN") +@Name({ code: "en-US", content: "GitHub check run" }) +@DisplayMessage({ code: "en-US", content: "GitHub check run" }) +@Schema(GitHubCheckRunSchema) +export class GitHubCheckRunDataType {} diff --git a/actions/github-action/src/data_types/ciAutomation/githubCiAutomationRequests.ts b/actions/github-action/src/data_types/ciAutomation/githubCiAutomationRequests.ts new file mode 100644 index 0000000..f6e6cee --- /dev/null +++ b/actions/github-action/src/data_types/ciAutomation/githubCiAutomationRequests.ts @@ -0,0 +1,40 @@ +import { DisplayMessage, Identifier, Name, Schema } from "@code0-tech/hercules" +import type { Endpoints } from "@octokit/types" +import { z } from "zod" + +export const GitHubCreateCommitStatusRequestSchema = z.object({ + state: z.enum(["error", "failure", "pending", "success"]), + target_url: z.string().optional(), + description: z.string().optional(), + context: z.string().optional(), +}) as unknown as z.ZodType> +export type GitHubCreateCommitStatusRequest = z.infer + +export const GitHubCreateCheckRunRequestSchema = z.looseObject({ + name: z.string().min(1), + head_sha: z.string().min(1), +}) as unknown as z.ZodType> +export type GitHubCreateCheckRunRequest = z.infer + +export const GitHubUpdateCheckRunRequestSchema = z.looseObject({}) as unknown as z.ZodType< + Omit +> +export type GitHubUpdateCheckRunRequest = z.infer + +@Identifier("GITHUB_CREATE_COMMIT_STATUS_REQUEST") +@Name({ code: "en-US", content: "Create GitHub commit status request" }) +@DisplayMessage({ code: "en-US", content: "Create GitHub commit status request" }) +@Schema(GitHubCreateCommitStatusRequestSchema) +export class GitHubCreateCommitStatusRequestDataType {} + +@Identifier("GITHUB_CREATE_CHECK_RUN_REQUEST") +@Name({ code: "en-US", content: "Create GitHub check run request" }) +@DisplayMessage({ code: "en-US", content: "Create GitHub check run request" }) +@Schema(GitHubCreateCheckRunRequestSchema) +export class GitHubCreateCheckRunRequestDataType {} + +@Identifier("GITHUB_UPDATE_CHECK_RUN_REQUEST") +@Name({ code: "en-US", content: "Update GitHub check run request" }) +@DisplayMessage({ code: "en-US", content: "Update GitHub check run request" }) +@Schema(GitHubUpdateCheckRunRequestSchema) +export class GitHubUpdateCheckRunRequestDataType {} diff --git a/actions/github-action/src/data_types/ciAutomation/githubWorkflow.ts b/actions/github-action/src/data_types/ciAutomation/githubWorkflow.ts new file mode 100644 index 0000000..26ed3d9 --- /dev/null +++ b/actions/github-action/src/data_types/ciAutomation/githubWorkflow.ts @@ -0,0 +1,23 @@ +import { DisplayMessage, Identifier, Name, Schema } from "@code0-tech/hercules" +import type { Endpoints } from "@octokit/types" +import { z } from "zod" + +export const GitHubWorkflowSchema = z.looseObject({}) as unknown as z.ZodType +export type GitHubWorkflow = z.infer + +export const GitHubWorkflowRunSchema = z.looseObject({}) as unknown as z.ZodType< + Endpoints["GET /repos/{owner}/{repo}/actions/runs"]["response"]["data"]["workflow_runs"][number] +> +export type GitHubWorkflowRun = z.infer + +@Identifier("GITHUB_WORKFLOW") +@Name({ code: "en-US", content: "GitHub workflow" }) +@DisplayMessage({ code: "en-US", content: "GitHub workflow" }) +@Schema(GitHubWorkflowSchema) +export class GitHubWorkflowDataType {} + +@Identifier("GITHUB_WORKFLOW_RUN") +@Name({ code: "en-US", content: "GitHub workflow run" }) +@DisplayMessage({ code: "en-US", content: "GitHub workflow run" }) +@Schema(GitHubWorkflowRunSchema) +export class GitHubWorkflowRunDataType {} diff --git a/actions/github-action/src/data_types/ciAutomation/githubWorkflowRequests.ts b/actions/github-action/src/data_types/ciAutomation/githubWorkflowRequests.ts new file mode 100644 index 0000000..88cdd18 --- /dev/null +++ b/actions/github-action/src/data_types/ciAutomation/githubWorkflowRequests.ts @@ -0,0 +1,15 @@ +import { DisplayMessage, Identifier, Name, Schema } from "@code0-tech/hercules" +import type { Endpoints } from "@octokit/types" +import { z } from "zod" + +export const GitHubDispatchWorkflowRequestSchema = z.object({ + ref: z.string().min(1), + inputs: z.record(z.string(), z.unknown()).optional(), +}) as unknown as z.ZodType> +export type GitHubDispatchWorkflowRequest = z.infer + +@Identifier("GITHUB_DISPATCH_WORKFLOW_REQUEST") +@Name({ code: "en-US", content: "Dispatch GitHub workflow request" }) +@DisplayMessage({ code: "en-US", content: "Dispatch GitHub workflow request" }) +@Schema(GitHubDispatchWorkflowRequestSchema) +export class GitHubDispatchWorkflowRequestDataType {} diff --git a/actions/github-action/src/data_types/issueComments/githubIssueComment.ts b/actions/github-action/src/data_types/issueComments/githubIssueComment.ts new file mode 100644 index 0000000..e2541e5 --- /dev/null +++ b/actions/github-action/src/data_types/issueComments/githubIssueComment.ts @@ -0,0 +1,14 @@ +import { DisplayMessage, Identifier, Name, Schema } from "@code0-tech/hercules" +import type { Endpoints } from "@octokit/types" +import { z } from "zod" + +export const GitHubIssueCommentSchema = z.looseObject({}) as unknown as z.ZodType< + Endpoints["GET /repos/{owner}/{repo}/issues/comments/{comment_id}"]["response"]["data"] +> +export type GitHubIssueComment = z.infer + +@Identifier("GITHUB_ISSUE_COMMENT") +@Name({ code: "en-US", content: "GitHub issue comment" }) +@DisplayMessage({ code: "en-US", content: "GitHub issue comment" }) +@Schema(GitHubIssueCommentSchema) +export class GitHubIssueCommentDataType {} diff --git a/actions/github-action/src/data_types/issueComments/githubIssueCommentRequests.ts b/actions/github-action/src/data_types/issueComments/githubIssueCommentRequests.ts new file mode 100644 index 0000000..64cb93c --- /dev/null +++ b/actions/github-action/src/data_types/issueComments/githubIssueCommentRequests.ts @@ -0,0 +1,25 @@ +import { DisplayMessage, Identifier, Name, Schema } from "@code0-tech/hercules" +import type { Endpoints } from "@octokit/types" +import { z } from "zod" + +export const GitHubCreateIssueCommentRequestSchema = z.object({ + body: z.string().min(1), +}) as unknown as z.ZodType> +export type GitHubCreateIssueCommentRequest = z.infer + +export const GitHubUpdateIssueCommentRequestSchema = z.object({ + body: z.string().min(1), +}) as unknown as z.ZodType> +export type GitHubUpdateIssueCommentRequest = z.infer + +@Identifier("GITHUB_CREATE_ISSUE_COMMENT_REQUEST") +@Name({ code: "en-US", content: "Create GitHub issue comment request" }) +@DisplayMessage({ code: "en-US", content: "Create GitHub issue comment request" }) +@Schema(GitHubCreateIssueCommentRequestSchema) +export class GitHubCreateIssueCommentRequestDataType {} + +@Identifier("GITHUB_UPDATE_ISSUE_COMMENT_REQUEST") +@Name({ code: "en-US", content: "Update GitHub issue comment request" }) +@DisplayMessage({ code: "en-US", content: "Update GitHub issue comment request" }) +@Schema(GitHubUpdateIssueCommentRequestSchema) +export class GitHubUpdateIssueCommentRequestDataType {} diff --git a/actions/github-action/src/data_types/issues/githubAssigneesRequest.ts b/actions/github-action/src/data_types/issues/githubAssigneesRequest.ts new file mode 100644 index 0000000..979092c --- /dev/null +++ b/actions/github-action/src/data_types/issues/githubAssigneesRequest.ts @@ -0,0 +1,14 @@ +import { DisplayMessage, Identifier, Name, Schema } from "@code0-tech/hercules" +import type { Endpoints } from "@octokit/types" +import { z } from "zod" + +export const GitHubAddAssigneesRequestSchema = z.object({ + assignees: z.array(z.string()).min(1), +}) as unknown as z.ZodType> +export type GitHubAddAssigneesRequest = z.infer + +@Identifier("GITHUB_ADD_ASSIGNEES_REQUEST") +@Name({ code: "en-US", content: "Add GitHub assignees request" }) +@DisplayMessage({ code: "en-US", content: "Add GitHub assignees request" }) +@Schema(GitHubAddAssigneesRequestSchema) +export class GitHubAddAssigneesRequestDataType {} diff --git a/actions/github-action/src/data_types/githubIssue.ts b/actions/github-action/src/data_types/issues/githubIssue.ts similarity index 100% rename from actions/github-action/src/data_types/githubIssue.ts rename to actions/github-action/src/data_types/issues/githubIssue.ts diff --git a/actions/github-action/src/data_types/githubIssueRequests.ts b/actions/github-action/src/data_types/issues/githubIssueRequests.ts similarity index 100% rename from actions/github-action/src/data_types/githubIssueRequests.ts rename to actions/github-action/src/data_types/issues/githubIssueRequests.ts diff --git a/actions/github-action/src/data_types/labels/githubLabel.ts b/actions/github-action/src/data_types/labels/githubLabel.ts new file mode 100644 index 0000000..e4ddb4c --- /dev/null +++ b/actions/github-action/src/data_types/labels/githubLabel.ts @@ -0,0 +1,12 @@ +import { DisplayMessage, Identifier, Name, Schema } from "@code0-tech/hercules" +import type { Endpoints } from "@octokit/types" +import { z } from "zod" + +export const GitHubLabelSchema = z.looseObject({}) as unknown as z.ZodType +export type GitHubLabel = z.infer + +@Identifier("GITHUB_LABEL") +@Name({ code: "en-US", content: "GitHub label" }) +@DisplayMessage({ code: "en-US", content: "GitHub label" }) +@Schema(GitHubLabelSchema) +export class GitHubLabelDataType {} diff --git a/actions/github-action/src/data_types/labels/githubLabelRequests.ts b/actions/github-action/src/data_types/labels/githubLabelRequests.ts new file mode 100644 index 0000000..8735299 --- /dev/null +++ b/actions/github-action/src/data_types/labels/githubLabelRequests.ts @@ -0,0 +1,14 @@ +import { DisplayMessage, Identifier, Name, Schema } from "@code0-tech/hercules" +import type { Endpoints } from "@octokit/types" +import { z } from "zod" + +export const GitHubIssueLabelsRequestSchema = z.object({ + labels: z.array(z.string()).min(1), +}) as unknown as z.ZodType> +export type GitHubIssueLabelsRequest = z.infer + +@Identifier("GITHUB_ISSUE_LABELS_REQUEST") +@Name({ code: "en-US", content: "GitHub issue labels request" }) +@DisplayMessage({ code: "en-US", content: "GitHub issue labels request" }) +@Schema(GitHubIssueLabelsRequestSchema) +export class GitHubIssueLabelsRequestDataType {} diff --git a/actions/github-action/src/data_types/milestones/githubMilestone.ts b/actions/github-action/src/data_types/milestones/githubMilestone.ts new file mode 100644 index 0000000..bf22c17 --- /dev/null +++ b/actions/github-action/src/data_types/milestones/githubMilestone.ts @@ -0,0 +1,14 @@ +import { DisplayMessage, Identifier, Name, Schema } from "@code0-tech/hercules" +import type { Endpoints } from "@octokit/types" +import { z } from "zod" + +export const GitHubMilestoneSchema = z.looseObject({}) as unknown as z.ZodType< + Endpoints["GET /repos/{owner}/{repo}/milestones/{milestone_number}"]["response"]["data"] +> +export type GitHubMilestone = z.infer + +@Identifier("GITHUB_MILESTONE") +@Name({ code: "en-US", content: "GitHub milestone" }) +@DisplayMessage({ code: "en-US", content: "GitHub milestone" }) +@Schema(GitHubMilestoneSchema) +export class GitHubMilestoneDataType {} diff --git a/actions/github-action/src/data_types/milestones/githubMilestoneRequests.ts b/actions/github-action/src/data_types/milestones/githubMilestoneRequests.ts new file mode 100644 index 0000000..b5ab0df --- /dev/null +++ b/actions/github-action/src/data_types/milestones/githubMilestoneRequests.ts @@ -0,0 +1,31 @@ +import { DisplayMessage, Identifier, Name, Schema } from "@code0-tech/hercules" +import type { Endpoints } from "@octokit/types" +import { z } from "zod" + +export const GitHubCreateMilestoneRequestSchema = z.object({ + title: z.string().min(1), + state: z.enum(["open", "closed"]).optional(), + description: z.string().optional(), + due_on: z.iso.datetime().optional(), +}) as unknown as z.ZodType> +export type GitHubCreateMilestoneRequest = z.infer + +export const GitHubUpdateMilestoneRequestSchema = z.object({ + title: z.string().min(1).optional(), + state: z.enum(["open", "closed"]).optional(), + description: z.string().optional(), + due_on: z.iso.datetime().nullable().optional(), +}) as unknown as z.ZodType> +export type GitHubUpdateMilestoneRequest = z.infer + +@Identifier("GITHUB_CREATE_MILESTONE_REQUEST") +@Name({ code: "en-US", content: "Create GitHub milestone request" }) +@DisplayMessage({ code: "en-US", content: "Create GitHub milestone request" }) +@Schema(GitHubCreateMilestoneRequestSchema) +export class GitHubCreateMilestoneRequestDataType {} + +@Identifier("GITHUB_UPDATE_MILESTONE_REQUEST") +@Name({ code: "en-US", content: "Update GitHub milestone request" }) +@DisplayMessage({ code: "en-US", content: "Update GitHub milestone request" }) +@Schema(GitHubUpdateMilestoneRequestSchema) +export class GitHubUpdateMilestoneRequestDataType {} diff --git a/actions/github-action/src/data_types/pullRequestReviewComments/githubPullRequestReviewComment.ts b/actions/github-action/src/data_types/pullRequestReviewComments/githubPullRequestReviewComment.ts new file mode 100644 index 0000000..9847192 --- /dev/null +++ b/actions/github-action/src/data_types/pullRequestReviewComments/githubPullRequestReviewComment.ts @@ -0,0 +1,14 @@ +import { DisplayMessage, Identifier, Name, Schema } from "@code0-tech/hercules" +import type { Endpoints } from "@octokit/types" +import { z } from "zod" + +export const GitHubPullRequestReviewCommentSchema = z.looseObject({}) as unknown as z.ZodType< + Endpoints["GET /repos/{owner}/{repo}/pulls/comments/{comment_id}"]["response"]["data"] +> +export type GitHubPullRequestReviewComment = z.infer + +@Identifier("GITHUB_PULL_REQUEST_REVIEW_COMMENT") +@Name({ code: "en-US", content: "GitHub pull request review comment" }) +@DisplayMessage({ code: "en-US", content: "GitHub pull request review comment" }) +@Schema(GitHubPullRequestReviewCommentSchema) +export class GitHubPullRequestReviewCommentDataType {} diff --git a/actions/github-action/src/data_types/pullRequestReviewComments/githubPullRequestReviewCommentRequests.ts b/actions/github-action/src/data_types/pullRequestReviewComments/githubPullRequestReviewCommentRequests.ts new file mode 100644 index 0000000..3c1e076 --- /dev/null +++ b/actions/github-action/src/data_types/pullRequestReviewComments/githubPullRequestReviewCommentRequests.ts @@ -0,0 +1,25 @@ +import { DisplayMessage, Identifier, Name, Schema } from "@code0-tech/hercules" +import type { Endpoints } from "@octokit/types" +import { z } from "zod" + +export const GitHubCreatePullRequestReviewCommentRequestSchema = z.looseObject({ + body: z.string().min(1), +}) as unknown as z.ZodType> +export type GitHubCreatePullRequestReviewCommentRequest = z.infer + +export const GitHubUpdatePullRequestReviewCommentRequestSchema = z.object({ + body: z.string().min(1), +}) as unknown as z.ZodType> +export type GitHubUpdatePullRequestReviewCommentRequest = z.infer + +@Identifier("GITHUB_CREATE_PULL_REQUEST_REVIEW_COMMENT_REQUEST") +@Name({ code: "en-US", content: "Create GitHub pull request review comment request" }) +@DisplayMessage({ code: "en-US", content: "Create GitHub pull request review comment request" }) +@Schema(GitHubCreatePullRequestReviewCommentRequestSchema) +export class GitHubCreatePullRequestReviewCommentRequestDataType {} + +@Identifier("GITHUB_UPDATE_PULL_REQUEST_REVIEW_COMMENT_REQUEST") +@Name({ code: "en-US", content: "Update GitHub pull request review comment request" }) +@DisplayMessage({ code: "en-US", content: "Update GitHub pull request review comment request" }) +@Schema(GitHubUpdatePullRequestReviewCommentRequestSchema) +export class GitHubUpdatePullRequestReviewCommentRequestDataType {} diff --git a/actions/github-action/src/data_types/pullRequestReviews/githubPullRequestReview.ts b/actions/github-action/src/data_types/pullRequestReviews/githubPullRequestReview.ts new file mode 100644 index 0000000..629e263 --- /dev/null +++ b/actions/github-action/src/data_types/pullRequestReviews/githubPullRequestReview.ts @@ -0,0 +1,14 @@ +import { DisplayMessage, Identifier, Name, Schema } from "@code0-tech/hercules" +import type { Endpoints } from "@octokit/types" +import { z } from "zod" + +export const GitHubPullRequestReviewSchema = z.looseObject({}) as unknown as z.ZodType< + Endpoints["GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews"]["response"]["data"][number] +> +export type GitHubPullRequestReview = z.infer + +@Identifier("GITHUB_PULL_REQUEST_REVIEW") +@Name({ code: "en-US", content: "GitHub pull request review" }) +@DisplayMessage({ code: "en-US", content: "GitHub pull request review" }) +@Schema(GitHubPullRequestReviewSchema) +export class GitHubPullRequestReviewDataType {} diff --git a/actions/github-action/src/data_types/pullRequestReviews/githubPullRequestReviewRequests.ts b/actions/github-action/src/data_types/pullRequestReviews/githubPullRequestReviewRequests.ts new file mode 100644 index 0000000..854c3e4 --- /dev/null +++ b/actions/github-action/src/data_types/pullRequestReviews/githubPullRequestReviewRequests.ts @@ -0,0 +1,46 @@ +import { DisplayMessage, Identifier, Name, Schema } from "@code0-tech/hercules" +import type { Endpoints } from "@octokit/types" +import { z } from "zod" + +export const GitHubCreatePullRequestReviewRequestSchema = z.object({ + body: z.string().optional(), + event: z.enum(["APPROVE", "REQUEST_CHANGES", "COMMENT"]).optional(), + comments: z.array(z.looseObject({})).optional(), +}) as unknown as z.ZodType> +export type GitHubCreatePullRequestReviewRequest = z.infer + +export const GitHubSubmitPullRequestReviewRequestSchema = z.object({ + body: z.string().optional(), + event: z.enum(["APPROVE", "REQUEST_CHANGES", "COMMENT"]), +}) as unknown as z.ZodType< + Omit +> +export type GitHubSubmitPullRequestReviewRequest = z.infer + +export const GitHubDismissPullRequestReviewRequestSchema = z.object({ + message: z.string().min(1), +}) as unknown as z.ZodType< + Omit< + Endpoints["PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/dismissals"]["parameters"], + "owner" | "repo" | "pull_number" | "review_id" + > +> +export type GitHubDismissPullRequestReviewRequest = z.infer + +@Identifier("GITHUB_CREATE_PULL_REQUEST_REVIEW_REQUEST") +@Name({ code: "en-US", content: "Create GitHub pull request review request" }) +@DisplayMessage({ code: "en-US", content: "Create GitHub pull request review request" }) +@Schema(GitHubCreatePullRequestReviewRequestSchema) +export class GitHubCreatePullRequestReviewRequestDataType {} + +@Identifier("GITHUB_SUBMIT_PULL_REQUEST_REVIEW_REQUEST") +@Name({ code: "en-US", content: "Submit GitHub pull request review request" }) +@DisplayMessage({ code: "en-US", content: "Submit GitHub pull request review request" }) +@Schema(GitHubSubmitPullRequestReviewRequestSchema) +export class GitHubSubmitPullRequestReviewRequestDataType {} + +@Identifier("GITHUB_DISMISS_PULL_REQUEST_REVIEW_REQUEST") +@Name({ code: "en-US", content: "Dismiss GitHub pull request review request" }) +@DisplayMessage({ code: "en-US", content: "Dismiss GitHub pull request review request" }) +@Schema(GitHubDismissPullRequestReviewRequestSchema) +export class GitHubDismissPullRequestReviewRequestDataType {} diff --git a/actions/github-action/src/data_types/githubPullRequest.ts b/actions/github-action/src/data_types/pullRequests/githubPullRequest.ts similarity index 100% rename from actions/github-action/src/data_types/githubPullRequest.ts rename to actions/github-action/src/data_types/pullRequests/githubPullRequest.ts diff --git a/actions/github-action/src/data_types/pullRequests/githubPullRequestMergeRequest.ts b/actions/github-action/src/data_types/pullRequests/githubPullRequestMergeRequest.ts new file mode 100644 index 0000000..0eab76c --- /dev/null +++ b/actions/github-action/src/data_types/pullRequests/githubPullRequestMergeRequest.ts @@ -0,0 +1,28 @@ +import { DisplayMessage, Identifier, Name, Schema } from "@code0-tech/hercules" +import type { Endpoints } from "@octokit/types" +import { z } from "zod" + +export const GitHubPullRequestMergeResultSchema = z.looseObject({}) as unknown as z.ZodType< + Endpoints["PUT /repos/{owner}/{repo}/pulls/{pull_number}/merge"]["response"]["data"] +> +export type GitHubPullRequestMergeResult = z.infer + +export const GitHubPullRequestMergeRequestSchema = z.object({ + commit_title: z.string().optional(), + commit_message: z.string().optional(), + sha: z.string().optional(), + merge_method: z.enum(["merge", "squash", "rebase"]).optional(), +}) as unknown as z.ZodType> +export type GitHubPullRequestMergeRequest = z.infer + +@Identifier("GITHUB_PULL_REQUEST_MERGE_RESULT") +@Name({ code: "en-US", content: "GitHub pull request merge result" }) +@DisplayMessage({ code: "en-US", content: "GitHub pull request merge result" }) +@Schema(GitHubPullRequestMergeResultSchema) +export class GitHubPullRequestMergeResultDataType {} + +@Identifier("GITHUB_PULL_REQUEST_MERGE_REQUEST") +@Name({ code: "en-US", content: "GitHub pull request merge request" }) +@DisplayMessage({ code: "en-US", content: "GitHub pull request merge request" }) +@Schema(GitHubPullRequestMergeRequestSchema) +export class GitHubPullRequestMergeRequestDataType {} diff --git a/actions/github-action/src/data_types/githubPullRequestRequests.ts b/actions/github-action/src/data_types/pullRequests/githubPullRequestRequests.ts similarity index 100% rename from actions/github-action/src/data_types/githubPullRequestRequests.ts rename to actions/github-action/src/data_types/pullRequests/githubPullRequestRequests.ts diff --git a/actions/github-action/src/data_types/releases/githubRelease.ts b/actions/github-action/src/data_types/releases/githubRelease.ts new file mode 100644 index 0000000..5ebefc0 --- /dev/null +++ b/actions/github-action/src/data_types/releases/githubRelease.ts @@ -0,0 +1,12 @@ +import { DisplayMessage, Identifier, Name, Schema } from "@code0-tech/hercules" +import type { Endpoints } from "@octokit/types" +import { z } from "zod" + +export const GitHubReleaseSchema = z.looseObject({}) as unknown as z.ZodType +export type GitHubRelease = z.infer + +@Identifier("GITHUB_RELEASE") +@Name({ code: "en-US", content: "GitHub release" }) +@DisplayMessage({ code: "en-US", content: "GitHub release" }) +@Schema(GitHubReleaseSchema) +export class GitHubReleaseDataType {} diff --git a/actions/github-action/src/data_types/releases/githubReleaseRequests.ts b/actions/github-action/src/data_types/releases/githubReleaseRequests.ts new file mode 100644 index 0000000..6a69aad --- /dev/null +++ b/actions/github-action/src/data_types/releases/githubReleaseRequests.ts @@ -0,0 +1,37 @@ +import { DisplayMessage, Identifier, Name, Schema } from "@code0-tech/hercules" +import type { Endpoints } from "@octokit/types" +import { z } from "zod" + +export const GitHubCreateReleaseRequestSchema = z.object({ + tag_name: z.string().min(1), + target_commitish: z.string().optional(), + name: z.string().optional(), + body: z.string().optional(), + draft: z.boolean().optional(), + prerelease: z.boolean().optional(), + generate_release_notes: z.boolean().optional(), +}) as unknown as z.ZodType> +export type GitHubCreateReleaseRequest = z.infer + +export const GitHubUpdateReleaseRequestSchema = z.object({ + tag_name: z.string().min(1).optional(), + target_commitish: z.string().optional(), + name: z.string().optional(), + body: z.string().optional(), + draft: z.boolean().optional(), + prerelease: z.boolean().optional(), + make_latest: z.enum(["true", "false", "legacy"]).optional(), +}) as unknown as z.ZodType> +export type GitHubUpdateReleaseRequest = z.infer + +@Identifier("GITHUB_CREATE_RELEASE_REQUEST") +@Name({ code: "en-US", content: "Create GitHub release request" }) +@DisplayMessage({ code: "en-US", content: "Create GitHub release request" }) +@Schema(GitHubCreateReleaseRequestSchema) +export class GitHubCreateReleaseRequestDataType {} + +@Identifier("GITHUB_UPDATE_RELEASE_REQUEST") +@Name({ code: "en-US", content: "Update GitHub release request" }) +@DisplayMessage({ code: "en-US", content: "Update GitHub release request" }) +@Schema(GitHubUpdateReleaseRequestSchema) +export class GitHubUpdateReleaseRequestDataType {} diff --git a/actions/github-action/src/data_types/repositories/githubBranchRequests.ts b/actions/github-action/src/data_types/repositories/githubBranchRequests.ts new file mode 100644 index 0000000..97dbfee --- /dev/null +++ b/actions/github-action/src/data_types/repositories/githubBranchRequests.ts @@ -0,0 +1,14 @@ +import { DisplayMessage, Identifier, Name, Schema } from "@code0-tech/hercules" +import { z } from "zod" + +export const GitHubCreateBranchRequestSchema = z.object({ + branch: z.string().min(1), + sha: z.string().min(1), +}) +export type GitHubCreateBranchRequest = z.infer + +@Identifier("GITHUB_CREATE_BRANCH_REQUEST") +@Name({ code: "en-US", content: "Create GitHub branch request" }) +@DisplayMessage({ code: "en-US", content: "Create GitHub branch request" }) +@Schema(GitHubCreateBranchRequestSchema) +export class GitHubCreateBranchRequestDataType {} diff --git a/actions/github-action/src/data_types/repositories/githubCommit.ts b/actions/github-action/src/data_types/repositories/githubCommit.ts new file mode 100644 index 0000000..f63f841 --- /dev/null +++ b/actions/github-action/src/data_types/repositories/githubCommit.ts @@ -0,0 +1,12 @@ +import { DisplayMessage, Identifier, Name, Schema } from "@code0-tech/hercules" +import type { Endpoints } from "@octokit/types" +import { z } from "zod" + +export const GitHubCommitSchema = z.looseObject({}) as unknown as z.ZodType +export type GitHubCommit = z.infer + +@Identifier("GITHUB_COMMIT") +@Name({ code: "en-US", content: "GitHub commit" }) +@DisplayMessage({ code: "en-US", content: "GitHub commit" }) +@Schema(GitHubCommitSchema) +export class GitHubCommitDataType {} diff --git a/actions/github-action/src/data_types/githubRepository.ts b/actions/github-action/src/data_types/repositories/githubRepository.ts similarity index 100% rename from actions/github-action/src/data_types/githubRepository.ts rename to actions/github-action/src/data_types/repositories/githubRepository.ts diff --git a/actions/github-action/src/data_types/repositories/githubRepositoryBranch.ts b/actions/github-action/src/data_types/repositories/githubRepositoryBranch.ts new file mode 100644 index 0000000..812c332 --- /dev/null +++ b/actions/github-action/src/data_types/repositories/githubRepositoryBranch.ts @@ -0,0 +1,14 @@ +import { DisplayMessage, Identifier, Name, Schema } from "@code0-tech/hercules" +import type { Endpoints } from "@octokit/types" +import { z } from "zod" + +export const GitHubRepositoryBranchSchema = z.looseObject({}) as unknown as z.ZodType< + Endpoints["GET /repos/{owner}/{repo}/branches/{branch}"]["response"]["data"] +> +export type GitHubRepositoryBranch = z.infer + +@Identifier("GITHUB_REPOSITORY_BRANCH") +@Name({ code: "en-US", content: "GitHub repository branch" }) +@DisplayMessage({ code: "en-US", content: "GitHub repository branch" }) +@Schema(GitHubRepositoryBranchSchema) +export class GitHubRepositoryBranchDataType {} diff --git a/actions/github-action/src/data_types/githubIssueClosedWebhookPayload.ts b/actions/github-action/src/data_types/webhooks/githubIssueClosedWebhookPayload.ts similarity index 100% rename from actions/github-action/src/data_types/githubIssueClosedWebhookPayload.ts rename to actions/github-action/src/data_types/webhooks/githubIssueClosedWebhookPayload.ts diff --git a/actions/github-action/src/data_types/githubIssueOpenedWebhookPayload.ts b/actions/github-action/src/data_types/webhooks/githubIssueOpenedWebhookPayload.ts similarity index 100% rename from actions/github-action/src/data_types/githubIssueOpenedWebhookPayload.ts rename to actions/github-action/src/data_types/webhooks/githubIssueOpenedWebhookPayload.ts diff --git a/actions/github-action/src/data_types/githubPullRequestClosedWebhookPayload.ts b/actions/github-action/src/data_types/webhooks/githubPullRequestClosedWebhookPayload.ts similarity index 100% rename from actions/github-action/src/data_types/githubPullRequestClosedWebhookPayload.ts rename to actions/github-action/src/data_types/webhooks/githubPullRequestClosedWebhookPayload.ts diff --git a/actions/github-action/src/data_types/githubPullRequestOpenedWebhookPayload.ts b/actions/github-action/src/data_types/webhooks/githubPullRequestOpenedWebhookPayload.ts similarity index 100% rename from actions/github-action/src/data_types/githubPullRequestOpenedWebhookPayload.ts rename to actions/github-action/src/data_types/webhooks/githubPullRequestOpenedWebhookPayload.ts diff --git a/actions/github-action/src/data_types/githubPush.ts b/actions/github-action/src/data_types/webhooks/githubPush.ts similarity index 100% rename from actions/github-action/src/data_types/githubPush.ts rename to actions/github-action/src/data_types/webhooks/githubPush.ts diff --git a/actions/github-action/src/functions/ciAutomation/cancelWorkflowRunFunction.ts b/actions/github-action/src/functions/ciAutomation/cancelWorkflowRunFunction.ts new file mode 100644 index 0000000..214bccf --- /dev/null +++ b/actions/github-action/src/functions/ciAutomation/cancelWorkflowRunFunction.ts @@ -0,0 +1,23 @@ +import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" +import { createGitHubClient, handleGitHubError } from "../../helpers.js" + +@Identifier("cancelWorkflowRun") +@Signature("(owner: string, repository: string, runId: number): void") +@Name({ code: "en-US", content: "Cancel workflow run" }) +@DisplayMessage({ code: "en-US", content: "Cancel GitHub workflow run" }) +@Documentation({ code: "en-US", content: "Cancels a GitHub Actions workflow run." }) +@Description({ code: "en-US", content: "Cancels a GitHub workflow run." }) +@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }] }) +@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }] }) +@Parameter({ runtimeName: "runId", name: [{ code: "en-US", content: "Run ID" }] }) +export class CancelWorkflowRunFunction { + async run(context: FunctionContext, owner: string, repository: string, runId: number): Promise { + if (!Number.isInteger(runId) || runId < 1) throw new RuntimeError("GITHUB_INVALID_WORKFLOW_RUN_ID", "Workflow run ID must be a positive integer.") + try { + const client = createGitHubClient(context) + await client.post(`/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repository)}/actions/runs/${runId}/cancel`) + } catch (error) { + return handleGitHubError(error) + } + } +} diff --git a/actions/github-action/src/functions/ciAutomation/createCheckRunFunction.ts b/actions/github-action/src/functions/ciAutomation/createCheckRunFunction.ts new file mode 100644 index 0000000..33bec4e --- /dev/null +++ b/actions/github-action/src/functions/ciAutomation/createCheckRunFunction.ts @@ -0,0 +1,25 @@ +import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, Signature } from "@code0-tech/hercules" +import { GitHubCheckRun, GitHubCheckRunSchema } from "../../data_types/ciAutomation/githubCiAutomation.js" +import { GitHubCreateCheckRunRequest } from "../../data_types/ciAutomation/githubCiAutomationRequests.js" +import { createGitHubClient, handleGitHubError } from "../../helpers.js" + +@Identifier("createCheckRun") +@Signature("(owner: string, repository: string, data: GITHUB_CREATE_CHECK_RUN_REQUEST): GITHUB_CHECK_RUN") +@Name({ code: "en-US", content: "Create check run" }) +@DisplayMessage({ code: "en-US", content: "Create GitHub check run" }) +@Documentation({ code: "en-US", content: "Creates a check run." }) +@Description({ code: "en-US", content: "Creates a GitHub check run." }) +@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }] }) +@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }] }) +@Parameter({ runtimeName: "data", name: [{ code: "en-US", content: "Check run" }] }) +export class CreateCheckRunFunction { + async run(context: FunctionContext, owner: string, repository: string, data: GitHubCreateCheckRunRequest): Promise { + try { + const client = createGitHubClient(context) + const response = await client.post(`/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repository)}/check-runs`, data) + return GitHubCheckRunSchema.parse(response.data) + } catch (error) { + return handleGitHubError(error) + } + } +} diff --git a/actions/github-action/src/functions/ciAutomation/createCommitStatusFunction.ts b/actions/github-action/src/functions/ciAutomation/createCommitStatusFunction.ts new file mode 100644 index 0000000..b472d38 --- /dev/null +++ b/actions/github-action/src/functions/ciAutomation/createCommitStatusFunction.ts @@ -0,0 +1,29 @@ +import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, Signature } from "@code0-tech/hercules" +import { GitHubCommitStatus, GitHubCommitStatusSchema } from "../../data_types/ciAutomation/githubCiAutomation.js" +import { GitHubCreateCommitStatusRequest } from "../../data_types/ciAutomation/githubCiAutomationRequests.js" +import { createGitHubClient, handleGitHubError } from "../../helpers.js" + +@Identifier("createCommitStatus") +@Signature("(owner: string, repository: string, sha: string, data: GITHUB_CREATE_COMMIT_STATUS_REQUEST): GITHUB_COMMIT_STATUS") +@Name({ code: "en-US", content: "Create commit status" }) +@DisplayMessage({ code: "en-US", content: "Create GitHub commit status" }) +@Documentation({ code: "en-US", content: "Creates a commit status." }) +@Description({ code: "en-US", content: "Creates a GitHub commit status." }) +@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }] }) +@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }] }) +@Parameter({ runtimeName: "sha", name: [{ code: "en-US", content: "SHA" }] }) +@Parameter({ runtimeName: "data", name: [{ code: "en-US", content: "Status" }] }) +export class CreateCommitStatusFunction { + async run(context: FunctionContext, owner: string, repository: string, sha: string, data: GitHubCreateCommitStatusRequest): Promise { + try { + const client = createGitHubClient(context) + const response = await client.post( + `/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repository)}/statuses/${encodeURIComponent(sha)}`, + data + ) + return GitHubCommitStatusSchema.parse(response.data) + } catch (error) { + return handleGitHubError(error) + } + } +} diff --git a/actions/github-action/src/functions/ciAutomation/dispatchWorkflowFunction.ts b/actions/github-action/src/functions/ciAutomation/dispatchWorkflowFunction.ts new file mode 100644 index 0000000..e1f7b73 --- /dev/null +++ b/actions/github-action/src/functions/ciAutomation/dispatchWorkflowFunction.ts @@ -0,0 +1,27 @@ +import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, Signature } from "@code0-tech/hercules" +import { GitHubDispatchWorkflowRequest } from "../../data_types/ciAutomation/githubWorkflowRequests.js" +import { createGitHubClient, handleGitHubError } from "../../helpers.js" + +@Identifier("dispatchWorkflow") +@Signature("(owner: string, repository: string, workflowId: string, data: GITHUB_DISPATCH_WORKFLOW_REQUEST): void") +@Name({ code: "en-US", content: "Dispatch workflow" }) +@DisplayMessage({ code: "en-US", content: "Dispatch GitHub workflow" }) +@Documentation({ code: "en-US", content: "Triggers a GitHub Actions workflow dispatch event." }) +@Description({ code: "en-US", content: "Dispatches a GitHub workflow." }) +@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }] }) +@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }] }) +@Parameter({ runtimeName: "workflowId", name: [{ code: "en-US", content: "Workflow ID or file name" }] }) +@Parameter({ runtimeName: "data", name: [{ code: "en-US", content: "Dispatch" }] }) +export class DispatchWorkflowFunction { + async run(context: FunctionContext, owner: string, repository: string, workflowId: string, data: GitHubDispatchWorkflowRequest): Promise { + try { + const client = createGitHubClient(context) + await client.post( + `/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repository)}/actions/workflows/${encodeURIComponent(workflowId)}/dispatches`, + data + ) + } catch (error) { + return handleGitHubError(error) + } + } +} diff --git a/actions/github-action/src/functions/ciAutomation/getCommitStatusesFunction.ts b/actions/github-action/src/functions/ciAutomation/getCommitStatusesFunction.ts new file mode 100644 index 0000000..90e6dfb --- /dev/null +++ b/actions/github-action/src/functions/ciAutomation/getCommitStatusesFunction.ts @@ -0,0 +1,26 @@ +import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, Signature } from "@code0-tech/hercules" +import { GitHubCommitStatus, GitHubCommitStatusSchema } from "../../data_types/ciAutomation/githubCiAutomation.js" +import { createGitHubClient, handleGitHubError } from "../../helpers.js" + +@Identifier("getCommitStatuses") +@Signature("(owner: string, repository: string, ref: string): GITHUB_COMMIT_STATUS[]") +@Name({ code: "en-US", content: "Get commit statuses" }) +@DisplayMessage({ code: "en-US", content: "Get GitHub commit statuses" }) +@Documentation({ code: "en-US", content: "Returns commit statuses for a ref." }) +@Description({ code: "en-US", content: "Returns GitHub commit statuses." }) +@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }] }) +@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }] }) +@Parameter({ runtimeName: "ref", name: [{ code: "en-US", content: "Ref" }] }) +export class GetCommitStatusesFunction { + async run(context: FunctionContext, owner: string, repository: string, ref: string): Promise { + try { + const client = createGitHubClient(context) + const response = await client.get( + `/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repository)}/commits/${encodeURIComponent(ref)}/statuses` + ) + return GitHubCommitStatusSchema.array().parse(response.data) + } catch (error) { + return handleGitHubError(error) + } + } +} diff --git a/actions/github-action/src/functions/ciAutomation/getWorkflowRunsFunction.ts b/actions/github-action/src/functions/ciAutomation/getWorkflowRunsFunction.ts new file mode 100644 index 0000000..9120073 --- /dev/null +++ b/actions/github-action/src/functions/ciAutomation/getWorkflowRunsFunction.ts @@ -0,0 +1,30 @@ +import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" +import { GitHubWorkflowRun, GitHubWorkflowRunSchema } from "../../data_types/ciAutomation/githubWorkflow.js" +import { createGitHubClient, handleGitHubError } from "../../helpers.js" + +@Identifier("getWorkflowRuns") +@Signature("(owner: string, repository: string, workflowId?: string, page?: number, perPage?: number): GITHUB_WORKFLOW_RUN[]") +@Name({ code: "en-US", content: "Get workflow runs" }) +@DisplayMessage({ code: "en-US", content: "Get GitHub workflow runs" }) +@Documentation({ code: "en-US", content: "Returns workflow runs for a repository or a specific workflow." }) +@Description({ code: "en-US", content: "Returns GitHub workflow runs." }) +@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }] }) +@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }] }) +@Parameter({ runtimeName: "workflowId", name: [{ code: "en-US", content: "Workflow ID or file name" }] }) +export class GetWorkflowRunsFunction { + async run(context: FunctionContext, owner: string, repository: string, workflowId?: string, page = 1, perPage = 30): Promise { + if (!Number.isInteger(page) || page < 1) throw new RuntimeError("GITHUB_INVALID_PAGE", "Page must be a positive integer.") + if (!Number.isInteger(perPage) || perPage < 1 || perPage > 100) + throw new RuntimeError("GITHUB_INVALID_PER_PAGE", "Results per page must be an integer from 1 to 100.") + try { + const client = createGitHubClient(context) + const path = workflowId + ? `/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repository)}/actions/workflows/${encodeURIComponent(workflowId)}/runs` + : `/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repository)}/actions/runs` + const response = await client.get(path, { params: { page, per_page: perPage } }) + return GitHubWorkflowRunSchema.array().parse(response.data.workflow_runs) + } catch (error) { + return handleGitHubError(error) + } + } +} diff --git a/actions/github-action/src/functions/ciAutomation/getWorkflowsFunction.ts b/actions/github-action/src/functions/ciAutomation/getWorkflowsFunction.ts new file mode 100644 index 0000000..8bbc83b --- /dev/null +++ b/actions/github-action/src/functions/ciAutomation/getWorkflowsFunction.ts @@ -0,0 +1,28 @@ +import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" +import { GitHubWorkflow, GitHubWorkflowSchema } from "../../data_types/ciAutomation/githubWorkflow.js" +import { createGitHubClient, handleGitHubError } from "../../helpers.js" + +@Identifier("getWorkflows") +@Signature("(owner: string, repository: string, page?: number, perPage?: number): GITHUB_WORKFLOW[]") +@Name({ code: "en-US", content: "Get workflows" }) +@DisplayMessage({ code: "en-US", content: "Get GitHub workflows" }) +@Documentation({ code: "en-US", content: "Returns GitHub Actions workflows for a repository." }) +@Description({ code: "en-US", content: "Returns GitHub workflows." }) +@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }] }) +@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }] }) +export class GetWorkflowsFunction { + async run(context: FunctionContext, owner: string, repository: string, page = 1, perPage = 30): Promise { + if (!Number.isInteger(page) || page < 1) throw new RuntimeError("GITHUB_INVALID_PAGE", "Page must be a positive integer.") + if (!Number.isInteger(perPage) || perPage < 1 || perPage > 100) + throw new RuntimeError("GITHUB_INVALID_PER_PAGE", "Results per page must be an integer from 1 to 100.") + try { + const client = createGitHubClient(context) + const response = await client.get(`/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repository)}/actions/workflows`, { + params: { page, per_page: perPage }, + }) + return GitHubWorkflowSchema.array().parse(response.data.workflows) + } catch (error) { + return handleGitHubError(error) + } + } +} diff --git a/actions/github-action/src/functions/ciAutomation/rerunWorkflowRunFunction.ts b/actions/github-action/src/functions/ciAutomation/rerunWorkflowRunFunction.ts new file mode 100644 index 0000000..3f7957d --- /dev/null +++ b/actions/github-action/src/functions/ciAutomation/rerunWorkflowRunFunction.ts @@ -0,0 +1,23 @@ +import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" +import { createGitHubClient, handleGitHubError } from "../../helpers.js" + +@Identifier("rerunWorkflowRun") +@Signature("(owner: string, repository: string, runId: number): void") +@Name({ code: "en-US", content: "Rerun workflow run" }) +@DisplayMessage({ code: "en-US", content: "Rerun GitHub workflow run" }) +@Documentation({ code: "en-US", content: "Reruns a GitHub Actions workflow run." }) +@Description({ code: "en-US", content: "Reruns a GitHub workflow run." }) +@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }] }) +@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }] }) +@Parameter({ runtimeName: "runId", name: [{ code: "en-US", content: "Run ID" }] }) +export class RerunWorkflowRunFunction { + async run(context: FunctionContext, owner: string, repository: string, runId: number): Promise { + if (!Number.isInteger(runId) || runId < 1) throw new RuntimeError("GITHUB_INVALID_WORKFLOW_RUN_ID", "Workflow run ID must be a positive integer.") + try { + const client = createGitHubClient(context) + await client.post(`/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repository)}/actions/runs/${runId}/rerun`) + } catch (error) { + return handleGitHubError(error) + } + } +} diff --git a/actions/github-action/src/functions/ciAutomation/updateCheckRunFunction.ts b/actions/github-action/src/functions/ciAutomation/updateCheckRunFunction.ts new file mode 100644 index 0000000..e51e2a7 --- /dev/null +++ b/actions/github-action/src/functions/ciAutomation/updateCheckRunFunction.ts @@ -0,0 +1,27 @@ +import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" +import { GitHubCheckRun, GitHubCheckRunSchema } from "../../data_types/ciAutomation/githubCiAutomation.js" +import { GitHubUpdateCheckRunRequest } from "../../data_types/ciAutomation/githubCiAutomationRequests.js" +import { createGitHubClient, handleGitHubError } from "../../helpers.js" + +@Identifier("updateCheckRun") +@Signature("(owner: string, repository: string, checkRunId: number, data: GITHUB_UPDATE_CHECK_RUN_REQUEST): GITHUB_CHECK_RUN") +@Name({ code: "en-US", content: "Update check run" }) +@DisplayMessage({ code: "en-US", content: "Update GitHub check run" }) +@Documentation({ code: "en-US", content: "Updates a check run." }) +@Description({ code: "en-US", content: "Updates a GitHub check run." }) +@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }] }) +@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }] }) +@Parameter({ runtimeName: "checkRunId", name: [{ code: "en-US", content: "Check run ID" }] }) +@Parameter({ runtimeName: "data", name: [{ code: "en-US", content: "Check run updates" }] }) +export class UpdateCheckRunFunction { + async run(context: FunctionContext, owner: string, repository: string, checkRunId: number, data: GitHubUpdateCheckRunRequest): Promise { + if (!Number.isInteger(checkRunId) || checkRunId < 1) throw new RuntimeError("GITHUB_INVALID_CHECK_RUN_ID", "Check run ID must be a positive integer.") + try { + const client = createGitHubClient(context) + const response = await client.patch(`/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repository)}/check-runs/${checkRunId}`, data) + return GitHubCheckRunSchema.parse(response.data) + } catch (error) { + return handleGitHubError(error) + } + } +} diff --git a/actions/github-action/src/functions/issueComments/createIssueCommentFunction.ts b/actions/github-action/src/functions/issueComments/createIssueCommentFunction.ts new file mode 100644 index 0000000..6ca440c --- /dev/null +++ b/actions/github-action/src/functions/issueComments/createIssueCommentFunction.ts @@ -0,0 +1,35 @@ +import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" +import { GitHubIssueComment, GitHubIssueCommentSchema } from "../../data_types/issueComments/githubIssueComment.js" +import { GitHubCreateIssueCommentRequest } from "../../data_types/issueComments/githubIssueCommentRequests.js" +import { createGitHubClient, handleGitHubError } from "../../helpers.js" + +@Identifier("createIssueComment") +@Signature("(owner: string, repository: string, issueNumber: number, data: GITHUB_CREATE_ISSUE_COMMENT_REQUEST): GITHUB_ISSUE_COMMENT") +@Name({ code: "en-US", content: "Create issue comment" }) +@DisplayMessage({ code: "en-US", content: "Create GitHub issue comment" }) +@Documentation({ code: "en-US", content: "Creates a comment on an issue or pull request conversation." }) +@Description({ code: "en-US", content: "Creates a GitHub issue comment." }) +@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }] }) +@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }] }) +@Parameter({ runtimeName: "issueNumber", name: [{ code: "en-US", content: "Issue number" }] }) +@Parameter({ runtimeName: "data", name: [{ code: "en-US", content: "Comment" }] }) +export class CreateIssueCommentFunction { + async run( + context: FunctionContext, + owner: string, + repository: string, + issueNumber: number, + data: GitHubCreateIssueCommentRequest + ): Promise { + if (!Number.isInteger(issueNumber) || issueNumber < 1) throw new RuntimeError("GITHUB_INVALID_ISSUE_NUMBER", "Issue number must be a positive integer.") + + try { + const client = createGitHubClient(context) + const response = await client.post(`/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repository)}/issues/${issueNumber}/comments`, data) + + return GitHubIssueCommentSchema.parse(response.data) + } catch (error) { + return handleGitHubError(error) + } + } +} diff --git a/actions/github-action/src/functions/issueComments/deleteIssueCommentFunction.ts b/actions/github-action/src/functions/issueComments/deleteIssueCommentFunction.ts new file mode 100644 index 0000000..4735199 --- /dev/null +++ b/actions/github-action/src/functions/issueComments/deleteIssueCommentFunction.ts @@ -0,0 +1,24 @@ +import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" +import { createGitHubClient, handleGitHubError } from "../../helpers.js" + +@Identifier("deleteIssueComment") +@Signature("(owner: string, repository: string, commentId: number): void") +@Name({ code: "en-US", content: "Delete issue comment" }) +@DisplayMessage({ code: "en-US", content: "Delete GitHub issue comment" }) +@Documentation({ code: "en-US", content: "Deletes an issue comment." }) +@Description({ code: "en-US", content: "Deletes a GitHub issue comment." }) +@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }] }) +@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }] }) +@Parameter({ runtimeName: "commentId", name: [{ code: "en-US", content: "Comment ID" }] }) +export class DeleteIssueCommentFunction { + async run(context: FunctionContext, owner: string, repository: string, commentId: number): Promise { + if (!Number.isInteger(commentId) || commentId < 1) throw new RuntimeError("GITHUB_INVALID_COMMENT_ID", "Comment ID must be a positive integer.") + + try { + const client = createGitHubClient(context) + await client.delete(`/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repository)}/issues/comments/${commentId}`) + } catch (error) { + return handleGitHubError(error) + } + } +} diff --git a/actions/github-action/src/functions/issueComments/getIssueCommentsFunction.ts b/actions/github-action/src/functions/issueComments/getIssueCommentsFunction.ts new file mode 100644 index 0000000..8c0781a --- /dev/null +++ b/actions/github-action/src/functions/issueComments/getIssueCommentsFunction.ts @@ -0,0 +1,32 @@ +import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" +import { GitHubIssueComment, GitHubIssueCommentSchema } from "../../data_types/issueComments/githubIssueComment.js" +import { createGitHubClient, handleGitHubError } from "../../helpers.js" + +@Identifier("getIssueComments") +@Signature("(owner: string, repository: string, issueNumber: number, page?: number, perPage?: number): GITHUB_ISSUE_COMMENT[]") +@Name({ code: "en-US", content: "Get issue comments" }) +@DisplayMessage({ code: "en-US", content: "Get GitHub issue comments" }) +@Documentation({ code: "en-US", content: "Returns comments for an issue or pull request conversation." }) +@Description({ code: "en-US", content: "Returns GitHub issue comments." }) +@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }] }) +@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }] }) +@Parameter({ runtimeName: "issueNumber", name: [{ code: "en-US", content: "Issue number" }] }) +export class GetIssueCommentsFunction { + async run(context: FunctionContext, owner: string, repository: string, issueNumber: number, page = 1, perPage = 30): Promise { + if (!Number.isInteger(issueNumber) || issueNumber < 1) throw new RuntimeError("GITHUB_INVALID_ISSUE_NUMBER", "Issue number must be a positive integer.") + if (!Number.isInteger(page) || page < 1) throw new RuntimeError("GITHUB_INVALID_PAGE", "Page must be a positive integer.") + if (!Number.isInteger(perPage) || perPage < 1 || perPage > 100) + throw new RuntimeError("GITHUB_INVALID_PER_PAGE", "Results per page must be an integer from 1 to 100.") + + try { + const client = createGitHubClient(context) + const response = await client.get(`/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repository)}/issues/${issueNumber}/comments`, { + params: { page, per_page: perPage }, + }) + + return GitHubIssueCommentSchema.array().parse(response.data) + } catch (error) { + return handleGitHubError(error) + } + } +} diff --git a/actions/github-action/src/functions/issueComments/updateIssueCommentFunction.ts b/actions/github-action/src/functions/issueComments/updateIssueCommentFunction.ts new file mode 100644 index 0000000..a00cc6e --- /dev/null +++ b/actions/github-action/src/functions/issueComments/updateIssueCommentFunction.ts @@ -0,0 +1,35 @@ +import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" +import { GitHubIssueComment, GitHubIssueCommentSchema } from "../../data_types/issueComments/githubIssueComment.js" +import { GitHubUpdateIssueCommentRequest } from "../../data_types/issueComments/githubIssueCommentRequests.js" +import { createGitHubClient, handleGitHubError } from "../../helpers.js" + +@Identifier("updateIssueComment") +@Signature("(owner: string, repository: string, commentId: number, data: GITHUB_UPDATE_ISSUE_COMMENT_REQUEST): GITHUB_ISSUE_COMMENT") +@Name({ code: "en-US", content: "Update issue comment" }) +@DisplayMessage({ code: "en-US", content: "Update GitHub issue comment" }) +@Documentation({ code: "en-US", content: "Updates an issue comment." }) +@Description({ code: "en-US", content: "Updates a GitHub issue comment." }) +@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }] }) +@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }] }) +@Parameter({ runtimeName: "commentId", name: [{ code: "en-US", content: "Comment ID" }] }) +@Parameter({ runtimeName: "data", name: [{ code: "en-US", content: "Comment updates" }] }) +export class UpdateIssueCommentFunction { + async run( + context: FunctionContext, + owner: string, + repository: string, + commentId: number, + data: GitHubUpdateIssueCommentRequest + ): Promise { + if (!Number.isInteger(commentId) || commentId < 1) throw new RuntimeError("GITHUB_INVALID_COMMENT_ID", "Comment ID must be a positive integer.") + + try { + const client = createGitHubClient(context) + const response = await client.patch(`/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repository)}/issues/comments/${commentId}`, data) + + return GitHubIssueCommentSchema.parse(response.data) + } catch (error) { + return handleGitHubError(error) + } + } +} diff --git a/actions/github-action/src/functions/issues/addAssigneeToIssueFunction.ts b/actions/github-action/src/functions/issues/addAssigneeToIssueFunction.ts new file mode 100644 index 0000000..9c145e0 --- /dev/null +++ b/actions/github-action/src/functions/issues/addAssigneeToIssueFunction.ts @@ -0,0 +1,30 @@ +import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" +import { GitHubIssue, GitHubIssueSchema } from "../../data_types/issues/githubIssue.js" +import { createGitHubClient, handleGitHubError } from "../../helpers.js" + +@Identifier("addAssigneeToIssue") +@Signature("(owner: string, repository: string, issueNumber: number, assignee: string): GITHUB_ISSUE") +@Name({ code: "en-US", content: "Add assignee to issue" }) +@DisplayMessage({ code: "en-US", content: "Add GitHub issue assignee" }) +@Documentation({ code: "en-US", content: "Adds one assignee to a GitHub issue." }) +@Description({ code: "en-US", content: "Adds one assignee to a GitHub issue." }) +@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }] }) +@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }] }) +@Parameter({ runtimeName: "issueNumber", name: [{ code: "en-US", content: "Issue number" }] }) +@Parameter({ runtimeName: "assignee", name: [{ code: "en-US", content: "Assignee" }] }) +export class AddAssigneeToIssueFunction { + async run(context: FunctionContext, owner: string, repository: string, issueNumber: number, assignee: string): Promise { + if (!Number.isInteger(issueNumber) || issueNumber < 1) throw new RuntimeError("GITHUB_INVALID_ISSUE_NUMBER", "Issue number must be a positive integer.") + + try { + const client = createGitHubClient(context) + const response = await client.post(`/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repository)}/issues/${issueNumber}/assignees`, { + assignees: [assignee], + }) + + return GitHubIssueSchema.parse(response.data) + } catch (error) { + return handleGitHubError(error) + } + } +} diff --git a/actions/github-action/src/functions/issues/addAssigneesToIssueFunction.ts b/actions/github-action/src/functions/issues/addAssigneesToIssueFunction.ts new file mode 100644 index 0000000..b4a484d --- /dev/null +++ b/actions/github-action/src/functions/issues/addAssigneesToIssueFunction.ts @@ -0,0 +1,27 @@ +import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" +import { GitHubIssue, GitHubIssueSchema } from "../../data_types/issues/githubIssue.js" +import { GitHubAddAssigneesRequest } from "../../data_types/issues/githubAssigneesRequest.js" +import { createGitHubClient, handleGitHubError } from "../../helpers.js" + +@Identifier("addAssigneesToIssue") +@Signature("(owner: string, repository: string, issueNumber: number, data: GITHUB_ADD_ASSIGNEES_REQUEST): GITHUB_ISSUE") +@Name({ code: "en-US", content: "Add assignees to issue" }) +@DisplayMessage({ code: "en-US", content: "Add GitHub issue assignees" }) +@Documentation({ code: "en-US", content: "Adds assignees to a GitHub issue." }) +@Description({ code: "en-US", content: "Adds assignees to a GitHub issue." }) +@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }] }) +@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }] }) +@Parameter({ runtimeName: "issueNumber", name: [{ code: "en-US", content: "Issue number" }] }) +@Parameter({ runtimeName: "data", name: [{ code: "en-US", content: "Assignees" }] }) +export class AddAssigneesToIssueFunction { + async run(context: FunctionContext, owner: string, repository: string, issueNumber: number, data: GitHubAddAssigneesRequest): Promise { + if (!Number.isInteger(issueNumber) || issueNumber < 1) throw new RuntimeError("GITHUB_INVALID_ISSUE_NUMBER", "Issue number must be a positive integer.") + try { + const client = createGitHubClient(context) + const response = await client.post(`/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repository)}/issues/${issueNumber}/assignees`, data) + return GitHubIssueSchema.parse(response.data) + } catch (error) { + return handleGitHubError(error) + } + } +} diff --git a/actions/github-action/src/functions/issues/closeIssueFunction.ts b/actions/github-action/src/functions/issues/closeIssueFunction.ts new file mode 100644 index 0000000..f750bf7 --- /dev/null +++ b/actions/github-action/src/functions/issues/closeIssueFunction.ts @@ -0,0 +1,28 @@ +import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" +import { GitHubIssue, GitHubIssueSchema } from "../../data_types/issues/githubIssue.js" +import { createGitHubClient, handleGitHubError } from "../../helpers.js" + +@Identifier("closeIssue") +@Signature("(owner: string, repository: string, issueNumber: number): GITHUB_ISSUE") +@Name({ code: "en-US", content: "Close issue" }) +@DisplayMessage({ code: "en-US", content: "Close GitHub issue" }) +@Documentation({ code: "en-US", content: "Closes a GitHub issue." }) +@Description({ code: "en-US", content: "Closes a GitHub issue." }) +@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }] }) +@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }] }) +@Parameter({ runtimeName: "issueNumber", name: [{ code: "en-US", content: "Issue number" }] }) +export class CloseIssueFunction { + async run(context: FunctionContext, owner: string, repository: string, issueNumber: number): Promise { + if (!Number.isInteger(issueNumber) || issueNumber < 1) throw new RuntimeError("GITHUB_INVALID_ISSUE_NUMBER", "Issue number must be a positive integer.") + + try { + const client = createGitHubClient(context) + const response = await client.patch(`/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repository)}/issues/${issueNumber}`, { + state: "closed", + }) + return GitHubIssueSchema.parse(response.data) + } catch (error) { + return handleGitHubError(error) + } + } +} diff --git a/actions/github-action/src/functions/issues/createIssueFunction.ts b/actions/github-action/src/functions/issues/createIssueFunction.ts index 8472117..6e96dfb 100644 --- a/actions/github-action/src/functions/issues/createIssueFunction.ts +++ b/actions/github-action/src/functions/issues/createIssueFunction.ts @@ -1,6 +1,6 @@ import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, Signature } from "@code0-tech/hercules" -import { GitHubIssue, GitHubIssueSchema } from "../../data_types/githubIssue.js" -import { GitHubCreateIssueRequest } from "../../data_types/githubIssueRequests.js" +import { GitHubIssue, GitHubIssueSchema } from "../../data_types/issues/githubIssue.js" +import { GitHubCreateIssueRequest } from "../../data_types/issues/githubIssueRequests.js" import { createGitHubClient, handleGitHubError } from "../../helpers.js" @Identifier("createIssue") diff --git a/actions/github-action/src/functions/issues/getIssueFunction.ts b/actions/github-action/src/functions/issues/getIssueFunction.ts index e8e4654..ec06394 100644 --- a/actions/github-action/src/functions/issues/getIssueFunction.ts +++ b/actions/github-action/src/functions/issues/getIssueFunction.ts @@ -1,5 +1,5 @@ import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" -import { GitHubIssue, GitHubIssueSchema } from "../../data_types/githubIssue.js" +import { GitHubIssue, GitHubIssueSchema } from "../../data_types/issues/githubIssue.js" import { createGitHubClient, handleGitHubError } from "../../helpers.js" @Identifier("getIssue") diff --git a/actions/github-action/src/functions/issues/getIssuesFunction.ts b/actions/github-action/src/functions/issues/getIssuesFunction.ts index beb497a..b8f0b16 100644 --- a/actions/github-action/src/functions/issues/getIssuesFunction.ts +++ b/actions/github-action/src/functions/issues/getIssuesFunction.ts @@ -1,5 +1,5 @@ import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" -import { GitHubIssue, GitHubIssueSchema } from "../../data_types/githubIssue.js" +import { GitHubIssue, GitHubIssueSchema } from "../../data_types/issues/githubIssue.js" import { createGitHubClient, handleGitHubError } from "../../helpers.js" type GitHubIssueState = "open" | "closed" | "all" diff --git a/actions/github-action/src/functions/issues/removeAssigneeFromIssueFunction.ts b/actions/github-action/src/functions/issues/removeAssigneeFromIssueFunction.ts new file mode 100644 index 0000000..e8ed112 --- /dev/null +++ b/actions/github-action/src/functions/issues/removeAssigneeFromIssueFunction.ts @@ -0,0 +1,28 @@ +import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" +import { GitHubIssue, GitHubIssueSchema } from "../../data_types/issues/githubIssue.js" +import { createGitHubClient, handleGitHubError } from "../../helpers.js" + +@Identifier("removeAssigneeFromIssue") +@Signature("(owner: string, repository: string, issueNumber: number, assignee: string): GITHUB_ISSUE") +@Name({ code: "en-US", content: "Remove assignee from issue" }) +@DisplayMessage({ code: "en-US", content: "Remove GitHub issue assignee" }) +@Documentation({ code: "en-US", content: "Removes one assignee from a GitHub issue." }) +@Description({ code: "en-US", content: "Removes one assignee from a GitHub issue." }) +@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }] }) +@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }] }) +@Parameter({ runtimeName: "issueNumber", name: [{ code: "en-US", content: "Issue number" }] }) +@Parameter({ runtimeName: "assignee", name: [{ code: "en-US", content: "Assignee" }] }) +export class RemoveAssigneeFromIssueFunction { + async run(context: FunctionContext, owner: string, repository: string, issueNumber: number, assignee: string): Promise { + if (!Number.isInteger(issueNumber) || issueNumber < 1) throw new RuntimeError("GITHUB_INVALID_ISSUE_NUMBER", "Issue number must be a positive integer.") + try { + const client = createGitHubClient(context) + const response = await client.delete(`/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repository)}/issues/${issueNumber}/assignees`, { + data: { assignees: [assignee] }, + }) + return GitHubIssueSchema.parse(response.data) + } catch (error) { + return handleGitHubError(error) + } + } +} diff --git a/actions/github-action/src/functions/issues/removeAssigneesFromIssueFunction.ts b/actions/github-action/src/functions/issues/removeAssigneesFromIssueFunction.ts new file mode 100644 index 0000000..538b0b7 --- /dev/null +++ b/actions/github-action/src/functions/issues/removeAssigneesFromIssueFunction.ts @@ -0,0 +1,29 @@ +import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" +import { GitHubIssue, GitHubIssueSchema } from "../../data_types/issues/githubIssue.js" +import { GitHubAddAssigneesRequest } from "../../data_types/issues/githubAssigneesRequest.js" +import { createGitHubClient, handleGitHubError } from "../../helpers.js" + +@Identifier("removeAssigneesFromIssue") +@Signature("(owner: string, repository: string, issueNumber: number, data: GITHUB_ADD_ASSIGNEES_REQUEST): GITHUB_ISSUE") +@Name({ code: "en-US", content: "Remove assignees from issue" }) +@DisplayMessage({ code: "en-US", content: "Remove GitHub issue assignees" }) +@Documentation({ code: "en-US", content: "Removes assignees from a GitHub issue." }) +@Description({ code: "en-US", content: "Removes assignees from a GitHub issue." }) +@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }] }) +@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }] }) +@Parameter({ runtimeName: "issueNumber", name: [{ code: "en-US", content: "Issue number" }] }) +@Parameter({ runtimeName: "data", name: [{ code: "en-US", content: "Assignees" }] }) +export class RemoveAssigneesFromIssueFunction { + async run(context: FunctionContext, owner: string, repository: string, issueNumber: number, data: GitHubAddAssigneesRequest): Promise { + if (!Number.isInteger(issueNumber) || issueNumber < 1) throw new RuntimeError("GITHUB_INVALID_ISSUE_NUMBER", "Issue number must be a positive integer.") + try { + const client = createGitHubClient(context) + const response = await client.delete(`/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repository)}/issues/${issueNumber}/assignees`, { + data, + }) + return GitHubIssueSchema.parse(response.data) + } catch (error) { + return handleGitHubError(error) + } + } +} diff --git a/actions/github-action/src/functions/issues/reopenIssueFunction.ts b/actions/github-action/src/functions/issues/reopenIssueFunction.ts new file mode 100644 index 0000000..880486b --- /dev/null +++ b/actions/github-action/src/functions/issues/reopenIssueFunction.ts @@ -0,0 +1,28 @@ +import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" +import { GitHubIssue, GitHubIssueSchema } from "../../data_types/issues/githubIssue.js" +import { createGitHubClient, handleGitHubError } from "../../helpers.js" + +@Identifier("reopenIssue") +@Signature("(owner: string, repository: string, issueNumber: number): GITHUB_ISSUE") +@Name({ code: "en-US", content: "Reopen issue" }) +@DisplayMessage({ code: "en-US", content: "Reopen GitHub issue" }) +@Documentation({ code: "en-US", content: "Reopens a GitHub issue." }) +@Description({ code: "en-US", content: "Reopens a GitHub issue." }) +@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }] }) +@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }] }) +@Parameter({ runtimeName: "issueNumber", name: [{ code: "en-US", content: "Issue number" }] }) +export class ReopenIssueFunction { + async run(context: FunctionContext, owner: string, repository: string, issueNumber: number): Promise { + if (!Number.isInteger(issueNumber) || issueNumber < 1) throw new RuntimeError("GITHUB_INVALID_ISSUE_NUMBER", "Issue number must be a positive integer.") + + try { + const client = createGitHubClient(context) + const response = await client.patch(`/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repository)}/issues/${issueNumber}`, { + state: "open", + }) + return GitHubIssueSchema.parse(response.data) + } catch (error) { + return handleGitHubError(error) + } + } +} diff --git a/actions/github-action/src/functions/issues/updateIssueFunction.ts b/actions/github-action/src/functions/issues/updateIssueFunction.ts index c97f664..430c27b 100644 --- a/actions/github-action/src/functions/issues/updateIssueFunction.ts +++ b/actions/github-action/src/functions/issues/updateIssueFunction.ts @@ -1,6 +1,6 @@ import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" -import { GitHubIssue, GitHubIssueSchema } from "../../data_types/githubIssue.js" -import { GitHubUpdateIssueRequest } from "../../data_types/githubIssueRequests.js" +import { GitHubIssue, GitHubIssueSchema } from "../../data_types/issues/githubIssue.js" +import { GitHubUpdateIssueRequest } from "../../data_types/issues/githubIssueRequests.js" import { createGitHubClient, handleGitHubError } from "../../helpers.js" @Identifier("updateIssue") diff --git a/actions/github-action/src/functions/labels/addLabelsToIssueFunction.ts b/actions/github-action/src/functions/labels/addLabelsToIssueFunction.ts new file mode 100644 index 0000000..b3ff15c --- /dev/null +++ b/actions/github-action/src/functions/labels/addLabelsToIssueFunction.ts @@ -0,0 +1,27 @@ +import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" +import { GitHubLabel, GitHubLabelSchema } from "../../data_types/labels/githubLabel.js" +import { GitHubIssueLabelsRequest } from "../../data_types/labels/githubLabelRequests.js" +import { createGitHubClient, handleGitHubError } from "../../helpers.js" + +@Identifier("addLabelsToIssue") +@Signature("(owner: string, repository: string, issueNumber: number, data: GITHUB_ISSUE_LABELS_REQUEST): GITHUB_LABEL[]") +@Name({ code: "en-US", content: "Add labels to issue" }) +@DisplayMessage({ code: "en-US", content: "Add GitHub issue labels" }) +@Documentation({ code: "en-US", content: "Adds labels to a GitHub issue or pull request." }) +@Description({ code: "en-US", content: "Adds GitHub issue labels." }) +@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }] }) +@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }] }) +@Parameter({ runtimeName: "issueNumber", name: [{ code: "en-US", content: "Issue number" }] }) +@Parameter({ runtimeName: "data", name: [{ code: "en-US", content: "Labels" }] }) +export class AddLabelsToIssueFunction { + async run(context: FunctionContext, owner: string, repository: string, issueNumber: number, data: GitHubIssueLabelsRequest): Promise { + if (!Number.isInteger(issueNumber) || issueNumber < 1) throw new RuntimeError("GITHUB_INVALID_ISSUE_NUMBER", "Issue number must be a positive integer.") + try { + const client = createGitHubClient(context) + const response = await client.post(`/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repository)}/issues/${issueNumber}/labels`, data) + return GitHubLabelSchema.array().parse(response.data) + } catch (error) { + return handleGitHubError(error) + } + } +} diff --git a/actions/github-action/src/functions/labels/getIssueLabelsFunction.ts b/actions/github-action/src/functions/labels/getIssueLabelsFunction.ts new file mode 100644 index 0000000..a2e4bcb --- /dev/null +++ b/actions/github-action/src/functions/labels/getIssueLabelsFunction.ts @@ -0,0 +1,25 @@ +import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" +import { GitHubLabel, GitHubLabelSchema } from "../../data_types/labels/githubLabel.js" +import { createGitHubClient, handleGitHubError } from "../../helpers.js" + +@Identifier("getIssueLabels") +@Signature("(owner: string, repository: string, issueNumber: number): GITHUB_LABEL[]") +@Name({ code: "en-US", content: "Get issue labels" }) +@DisplayMessage({ code: "en-US", content: "Get GitHub issue labels" }) +@Documentation({ code: "en-US", content: "Returns labels for a GitHub issue or pull request." }) +@Description({ code: "en-US", content: "Returns GitHub issue labels." }) +@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }] }) +@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }] }) +@Parameter({ runtimeName: "issueNumber", name: [{ code: "en-US", content: "Issue number" }] }) +export class GetIssueLabelsFunction { + async run(context: FunctionContext, owner: string, repository: string, issueNumber: number): Promise { + if (!Number.isInteger(issueNumber) || issueNumber < 1) throw new RuntimeError("GITHUB_INVALID_ISSUE_NUMBER", "Issue number must be a positive integer.") + try { + const client = createGitHubClient(context) + const response = await client.get(`/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repository)}/issues/${issueNumber}/labels`) + return GitHubLabelSchema.array().parse(response.data) + } catch (error) { + return handleGitHubError(error) + } + } +} diff --git a/actions/github-action/src/functions/labels/getLabelsFunction.ts b/actions/github-action/src/functions/labels/getLabelsFunction.ts new file mode 100644 index 0000000..2c30fce --- /dev/null +++ b/actions/github-action/src/functions/labels/getLabelsFunction.ts @@ -0,0 +1,28 @@ +import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" +import { GitHubLabel, GitHubLabelSchema } from "../../data_types/labels/githubLabel.js" +import { createGitHubClient, handleGitHubError } from "../../helpers.js" + +@Identifier("getLabels") +@Signature("(owner: string, repository: string, page?: number, perPage?: number): GITHUB_LABEL[]") +@Name({ code: "en-US", content: "Get labels" }) +@DisplayMessage({ code: "en-US", content: "Get GitHub labels" }) +@Documentation({ code: "en-US", content: "Returns labels from a GitHub repository." }) +@Description({ code: "en-US", content: "Returns GitHub labels." }) +@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }] }) +@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }] }) +export class GetLabelsFunction { + async run(context: FunctionContext, owner: string, repository: string, page = 1, perPage = 30): Promise { + if (!Number.isInteger(page) || page < 1) throw new RuntimeError("GITHUB_INVALID_PAGE", "Page must be a positive integer.") + if (!Number.isInteger(perPage) || perPage < 1 || perPage > 100) + throw new RuntimeError("GITHUB_INVALID_PER_PAGE", "Results per page must be an integer from 1 to 100.") + try { + const client = createGitHubClient(context) + const response = await client.get(`/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repository)}/labels`, { + params: { page, per_page: perPage }, + }) + return GitHubLabelSchema.array().parse(response.data) + } catch (error) { + return handleGitHubError(error) + } + } +} diff --git a/actions/github-action/src/functions/labels/removeAllLabelsFromIssueFunction.ts b/actions/github-action/src/functions/labels/removeAllLabelsFromIssueFunction.ts new file mode 100644 index 0000000..a89664d --- /dev/null +++ b/actions/github-action/src/functions/labels/removeAllLabelsFromIssueFunction.ts @@ -0,0 +1,23 @@ +import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" +import { createGitHubClient, handleGitHubError } from "../../helpers.js" + +@Identifier("removeAllLabelsFromIssue") +@Signature("(owner: string, repository: string, issueNumber: number): void") +@Name({ code: "en-US", content: "Remove all labels from issue" }) +@DisplayMessage({ code: "en-US", content: "Remove all GitHub issue labels" }) +@Documentation({ code: "en-US", content: "Removes all labels from a GitHub issue or pull request." }) +@Description({ code: "en-US", content: "Removes all GitHub issue labels." }) +@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }] }) +@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }] }) +@Parameter({ runtimeName: "issueNumber", name: [{ code: "en-US", content: "Issue number" }] }) +export class RemoveAllLabelsFromIssueFunction { + async run(context: FunctionContext, owner: string, repository: string, issueNumber: number): Promise { + if (!Number.isInteger(issueNumber) || issueNumber < 1) throw new RuntimeError("GITHUB_INVALID_ISSUE_NUMBER", "Issue number must be a positive integer.") + try { + const client = createGitHubClient(context) + await client.delete(`/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repository)}/issues/${issueNumber}/labels`) + } catch (error) { + return handleGitHubError(error) + } + } +} diff --git a/actions/github-action/src/functions/labels/removeLabelFromIssueFunction.ts b/actions/github-action/src/functions/labels/removeLabelFromIssueFunction.ts new file mode 100644 index 0000000..0fc5580 --- /dev/null +++ b/actions/github-action/src/functions/labels/removeLabelFromIssueFunction.ts @@ -0,0 +1,28 @@ +import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" +import { GitHubLabel, GitHubLabelSchema } from "../../data_types/labels/githubLabel.js" +import { createGitHubClient, handleGitHubError } from "../../helpers.js" + +@Identifier("removeLabelFromIssue") +@Signature("(owner: string, repository: string, issueNumber: number, label: string): GITHUB_LABEL[]") +@Name({ code: "en-US", content: "Remove label from issue" }) +@DisplayMessage({ code: "en-US", content: "Remove GitHub issue label" }) +@Documentation({ code: "en-US", content: "Removes a label from a GitHub issue or pull request." }) +@Description({ code: "en-US", content: "Removes a GitHub issue label." }) +@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }] }) +@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }] }) +@Parameter({ runtimeName: "issueNumber", name: [{ code: "en-US", content: "Issue number" }] }) +@Parameter({ runtimeName: "label", name: [{ code: "en-US", content: "Label" }] }) +export class RemoveLabelFromIssueFunction { + async run(context: FunctionContext, owner: string, repository: string, issueNumber: number, label: string): Promise { + if (!Number.isInteger(issueNumber) || issueNumber < 1) throw new RuntimeError("GITHUB_INVALID_ISSUE_NUMBER", "Issue number must be a positive integer.") + try { + const client = createGitHubClient(context) + const response = await client.delete( + `/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repository)}/issues/${issueNumber}/labels/${encodeURIComponent(label)}` + ) + return GitHubLabelSchema.array().parse(response.data) + } catch (error) { + return handleGitHubError(error) + } + } +} diff --git a/actions/github-action/src/functions/labels/setLabelsForIssueFunction.ts b/actions/github-action/src/functions/labels/setLabelsForIssueFunction.ts new file mode 100644 index 0000000..e159f31 --- /dev/null +++ b/actions/github-action/src/functions/labels/setLabelsForIssueFunction.ts @@ -0,0 +1,27 @@ +import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" +import { GitHubLabel, GitHubLabelSchema } from "../../data_types/labels/githubLabel.js" +import { GitHubIssueLabelsRequest } from "../../data_types/labels/githubLabelRequests.js" +import { createGitHubClient, handleGitHubError } from "../../helpers.js" + +@Identifier("setLabelsForIssue") +@Signature("(owner: string, repository: string, issueNumber: number, data: GITHUB_ISSUE_LABELS_REQUEST): GITHUB_LABEL[]") +@Name({ code: "en-US", content: "Set labels for issue" }) +@DisplayMessage({ code: "en-US", content: "Set GitHub issue labels" }) +@Documentation({ code: "en-US", content: "Replaces all labels for a GitHub issue or pull request." }) +@Description({ code: "en-US", content: "Sets GitHub issue labels." }) +@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }] }) +@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }] }) +@Parameter({ runtimeName: "issueNumber", name: [{ code: "en-US", content: "Issue number" }] }) +@Parameter({ runtimeName: "data", name: [{ code: "en-US", content: "Labels" }] }) +export class SetLabelsForIssueFunction { + async run(context: FunctionContext, owner: string, repository: string, issueNumber: number, data: GitHubIssueLabelsRequest): Promise { + if (!Number.isInteger(issueNumber) || issueNumber < 1) throw new RuntimeError("GITHUB_INVALID_ISSUE_NUMBER", "Issue number must be a positive integer.") + try { + const client = createGitHubClient(context) + const response = await client.put(`/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repository)}/issues/${issueNumber}/labels`, data) + return GitHubLabelSchema.array().parse(response.data) + } catch (error) { + return handleGitHubError(error) + } + } +} diff --git a/actions/github-action/src/functions/milestones/createMilestoneFunction.ts b/actions/github-action/src/functions/milestones/createMilestoneFunction.ts new file mode 100644 index 0000000..2732dc0 --- /dev/null +++ b/actions/github-action/src/functions/milestones/createMilestoneFunction.ts @@ -0,0 +1,25 @@ +import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, Signature } from "@code0-tech/hercules" +import { GitHubMilestone, GitHubMilestoneSchema } from "../../data_types/milestones/githubMilestone.js" +import { GitHubCreateMilestoneRequest } from "../../data_types/milestones/githubMilestoneRequests.js" +import { createGitHubClient, handleGitHubError } from "../../helpers.js" + +@Identifier("createMilestone") +@Signature("(owner: string, repository: string, data: GITHUB_CREATE_MILESTONE_REQUEST): GITHUB_MILESTONE") +@Name({ code: "en-US", content: "Create milestone" }) +@DisplayMessage({ code: "en-US", content: "Create GitHub milestone" }) +@Documentation({ code: "en-US", content: "Creates a GitHub milestone." }) +@Description({ code: "en-US", content: "Creates a GitHub milestone." }) +@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }] }) +@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }] }) +@Parameter({ runtimeName: "data", name: [{ code: "en-US", content: "Milestone" }] }) +export class CreateMilestoneFunction { + async run(context: FunctionContext, owner: string, repository: string, data: GitHubCreateMilestoneRequest): Promise { + try { + const client = createGitHubClient(context) + const response = await client.post(`/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repository)}/milestones`, data) + return GitHubMilestoneSchema.parse(response.data) + } catch (error) { + return handleGitHubError(error) + } + } +} diff --git a/actions/github-action/src/functions/milestones/deleteMilestoneFunction.ts b/actions/github-action/src/functions/milestones/deleteMilestoneFunction.ts new file mode 100644 index 0000000..17462b5 --- /dev/null +++ b/actions/github-action/src/functions/milestones/deleteMilestoneFunction.ts @@ -0,0 +1,24 @@ +import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" +import { createGitHubClient, handleGitHubError } from "../../helpers.js" + +@Identifier("deleteMilestone") +@Signature("(owner: string, repository: string, milestoneNumber: number): void") +@Name({ code: "en-US", content: "Delete milestone" }) +@DisplayMessage({ code: "en-US", content: "Delete GitHub milestone" }) +@Documentation({ code: "en-US", content: "Deletes a GitHub milestone." }) +@Description({ code: "en-US", content: "Deletes a GitHub milestone." }) +@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }] }) +@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }] }) +@Parameter({ runtimeName: "milestoneNumber", name: [{ code: "en-US", content: "Milestone number" }] }) +export class DeleteMilestoneFunction { + async run(context: FunctionContext, owner: string, repository: string, milestoneNumber: number): Promise { + if (!Number.isInteger(milestoneNumber) || milestoneNumber < 1) + throw new RuntimeError("GITHUB_INVALID_MILESTONE_NUMBER", "Milestone number must be a positive integer.") + try { + const client = createGitHubClient(context) + await client.delete(`/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repository)}/milestones/${milestoneNumber}`) + } catch (error) { + return handleGitHubError(error) + } + } +} diff --git a/actions/github-action/src/functions/milestones/getMilestoneFunction.ts b/actions/github-action/src/functions/milestones/getMilestoneFunction.ts new file mode 100644 index 0000000..df4ff99 --- /dev/null +++ b/actions/github-action/src/functions/milestones/getMilestoneFunction.ts @@ -0,0 +1,26 @@ +import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" +import { GitHubMilestone, GitHubMilestoneSchema } from "../../data_types/milestones/githubMilestone.js" +import { createGitHubClient, handleGitHubError } from "../../helpers.js" + +@Identifier("getMilestone") +@Signature("(owner: string, repository: string, milestoneNumber: number): GITHUB_MILESTONE") +@Name({ code: "en-US", content: "Get milestone" }) +@DisplayMessage({ code: "en-US", content: "Get GitHub milestone" }) +@Documentation({ code: "en-US", content: "Returns a GitHub milestone." }) +@Description({ code: "en-US", content: "Returns a GitHub milestone." }) +@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }] }) +@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }] }) +@Parameter({ runtimeName: "milestoneNumber", name: [{ code: "en-US", content: "Milestone number" }] }) +export class GetMilestoneFunction { + async run(context: FunctionContext, owner: string, repository: string, milestoneNumber: number): Promise { + if (!Number.isInteger(milestoneNumber) || milestoneNumber < 1) + throw new RuntimeError("GITHUB_INVALID_MILESTONE_NUMBER", "Milestone number must be a positive integer.") + try { + const client = createGitHubClient(context) + const response = await client.get(`/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repository)}/milestones/${milestoneNumber}`) + return GitHubMilestoneSchema.parse(response.data) + } catch (error) { + return handleGitHubError(error) + } + } +} diff --git a/actions/github-action/src/functions/milestones/getMilestonesFunction.ts b/actions/github-action/src/functions/milestones/getMilestonesFunction.ts new file mode 100644 index 0000000..157d3dd --- /dev/null +++ b/actions/github-action/src/functions/milestones/getMilestonesFunction.ts @@ -0,0 +1,35 @@ +import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" +import { GitHubMilestone, GitHubMilestoneSchema } from "../../data_types/milestones/githubMilestone.js" +import { createGitHubClient, handleGitHubError } from "../../helpers.js" + +@Identifier("getMilestones") +@Signature('(owner: string, repository: string, state?: "open"|"closed"|"all", page?: number, perPage?: number): GITHUB_MILESTONE[]') +@Name({ code: "en-US", content: "Get milestones" }) +@DisplayMessage({ code: "en-US", content: "Get GitHub milestones" }) +@Documentation({ code: "en-US", content: "Returns milestones from a GitHub repository." }) +@Description({ code: "en-US", content: "Returns GitHub milestones." }) +@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }] }) +@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }] }) +export class GetMilestonesFunction { + async run( + context: FunctionContext, + owner: string, + repository: string, + state: "open" | "closed" | "all" = "open", + page = 1, + perPage = 30 + ): Promise { + if (!Number.isInteger(page) || page < 1) throw new RuntimeError("GITHUB_INVALID_PAGE", "Page must be a positive integer.") + if (!Number.isInteger(perPage) || perPage < 1 || perPage > 100) + throw new RuntimeError("GITHUB_INVALID_PER_PAGE", "Results per page must be an integer from 1 to 100.") + try { + const client = createGitHubClient(context) + const response = await client.get(`/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repository)}/milestones`, { + params: { state, page, per_page: perPage }, + }) + return GitHubMilestoneSchema.array().parse(response.data) + } catch (error) { + return handleGitHubError(error) + } + } +} diff --git a/actions/github-action/src/functions/milestones/updateMilestoneFunction.ts b/actions/github-action/src/functions/milestones/updateMilestoneFunction.ts new file mode 100644 index 0000000..ff47c81 --- /dev/null +++ b/actions/github-action/src/functions/milestones/updateMilestoneFunction.ts @@ -0,0 +1,34 @@ +import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" +import { GitHubMilestone, GitHubMilestoneSchema } from "../../data_types/milestones/githubMilestone.js" +import { GitHubUpdateMilestoneRequest } from "../../data_types/milestones/githubMilestoneRequests.js" +import { createGitHubClient, handleGitHubError } from "../../helpers.js" + +@Identifier("updateMilestone") +@Signature("(owner: string, repository: string, milestoneNumber: number, data: GITHUB_UPDATE_MILESTONE_REQUEST): GITHUB_MILESTONE") +@Name({ code: "en-US", content: "Update milestone" }) +@DisplayMessage({ code: "en-US", content: "Update GitHub milestone" }) +@Documentation({ code: "en-US", content: "Updates a GitHub milestone." }) +@Description({ code: "en-US", content: "Updates a GitHub milestone." }) +@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }] }) +@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }] }) +@Parameter({ runtimeName: "milestoneNumber", name: [{ code: "en-US", content: "Milestone number" }] }) +@Parameter({ runtimeName: "data", name: [{ code: "en-US", content: "Milestone updates" }] }) +export class UpdateMilestoneFunction { + async run( + context: FunctionContext, + owner: string, + repository: string, + milestoneNumber: number, + data: GitHubUpdateMilestoneRequest + ): Promise { + if (!Number.isInteger(milestoneNumber) || milestoneNumber < 1) + throw new RuntimeError("GITHUB_INVALID_MILESTONE_NUMBER", "Milestone number must be a positive integer.") + try { + const client = createGitHubClient(context) + const response = await client.patch(`/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repository)}/milestones/${milestoneNumber}`, data) + return GitHubMilestoneSchema.parse(response.data) + } catch (error) { + return handleGitHubError(error) + } + } +} diff --git a/actions/github-action/src/functions/pullRequestReviewComments/createPullRequestReviewCommentFunction.ts b/actions/github-action/src/functions/pullRequestReviewComments/createPullRequestReviewCommentFunction.ts new file mode 100644 index 0000000..83c159d --- /dev/null +++ b/actions/github-action/src/functions/pullRequestReviewComments/createPullRequestReviewCommentFunction.ts @@ -0,0 +1,39 @@ +import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" +import { GitHubPullRequestReviewComment, GitHubPullRequestReviewCommentSchema } from "../../data_types/pullRequestReviewComments/githubPullRequestReviewComment.js" +import { GitHubCreatePullRequestReviewCommentRequest } from "../../data_types/pullRequestReviewComments/githubPullRequestReviewCommentRequests.js" +import { createGitHubClient, handleGitHubError } from "../../helpers.js" + +@Identifier("createPullRequestReviewComment") +@Signature( + "(owner: string, repository: string, pullRequestNumber: number, data: GITHUB_CREATE_PULL_REQUEST_REVIEW_COMMENT_REQUEST): GITHUB_PULL_REQUEST_REVIEW_COMMENT" +) +@Name({ code: "en-US", content: "Create pull request review comment" }) +@DisplayMessage({ code: "en-US", content: "Create GitHub pull request review comment" }) +@Documentation({ code: "en-US", content: "Creates a pull request review comment." }) +@Description({ code: "en-US", content: "Creates a GitHub pull request review comment." }) +@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }] }) +@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }] }) +@Parameter({ runtimeName: "pullRequestNumber", name: [{ code: "en-US", content: "Pull request number" }] }) +@Parameter({ runtimeName: "data", name: [{ code: "en-US", content: "Review comment" }] }) +export class CreatePullRequestReviewCommentFunction { + async run( + context: FunctionContext, + owner: string, + repository: string, + pullRequestNumber: number, + data: GitHubCreatePullRequestReviewCommentRequest + ): Promise { + if (!Number.isInteger(pullRequestNumber) || pullRequestNumber < 1) + throw new RuntimeError("GITHUB_INVALID_PULL_REQUEST_NUMBER", "Pull request number must be a positive integer.") + try { + const client = createGitHubClient(context) + const response = await client.post( + `/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repository)}/pulls/${pullRequestNumber}/comments`, + data + ) + return GitHubPullRequestReviewCommentSchema.parse(response.data) + } catch (error) { + return handleGitHubError(error) + } + } +} diff --git a/actions/github-action/src/functions/pullRequestReviewComments/deletePullRequestReviewCommentFunction.ts b/actions/github-action/src/functions/pullRequestReviewComments/deletePullRequestReviewCommentFunction.ts new file mode 100644 index 0000000..7699af7 --- /dev/null +++ b/actions/github-action/src/functions/pullRequestReviewComments/deletePullRequestReviewCommentFunction.ts @@ -0,0 +1,23 @@ +import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" +import { createGitHubClient, handleGitHubError } from "../../helpers.js" + +@Identifier("deletePullRequestReviewComment") +@Signature("(owner: string, repository: string, commentId: number): void") +@Name({ code: "en-US", content: "Delete pull request review comment" }) +@DisplayMessage({ code: "en-US", content: "Delete GitHub pull request review comment" }) +@Documentation({ code: "en-US", content: "Deletes a pull request review comment." }) +@Description({ code: "en-US", content: "Deletes a GitHub pull request review comment." }) +@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }] }) +@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }] }) +@Parameter({ runtimeName: "commentId", name: [{ code: "en-US", content: "Comment ID" }] }) +export class DeletePullRequestReviewCommentFunction { + async run(context: FunctionContext, owner: string, repository: string, commentId: number): Promise { + if (!Number.isInteger(commentId) || commentId < 1) throw new RuntimeError("GITHUB_INVALID_COMMENT_ID", "Comment ID must be a positive integer.") + try { + const client = createGitHubClient(context) + await client.delete(`/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repository)}/pulls/comments/${commentId}`) + } catch (error) { + return handleGitHubError(error) + } + } +} diff --git a/actions/github-action/src/functions/pullRequestReviewComments/getPullRequestReviewCommentsFunction.ts b/actions/github-action/src/functions/pullRequestReviewComments/getPullRequestReviewCommentsFunction.ts new file mode 100644 index 0000000..7d797e2 --- /dev/null +++ b/actions/github-action/src/functions/pullRequestReviewComments/getPullRequestReviewCommentsFunction.ts @@ -0,0 +1,38 @@ +import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" +import { GitHubPullRequestReviewComment, GitHubPullRequestReviewCommentSchema } from "../../data_types/pullRequestReviewComments/githubPullRequestReviewComment.js" +import { createGitHubClient, handleGitHubError } from "../../helpers.js" + +@Identifier("getPullRequestReviewComments") +@Signature("(owner: string, repository: string, pullRequestNumber: number, page?: number, perPage?: number): GITHUB_PULL_REQUEST_REVIEW_COMMENT[]") +@Name({ code: "en-US", content: "Get pull request review comments" }) +@DisplayMessage({ code: "en-US", content: "Get GitHub pull request review comments" }) +@Documentation({ code: "en-US", content: "Returns review comments for a pull request." }) +@Description({ code: "en-US", content: "Returns GitHub pull request review comments." }) +@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }] }) +@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }] }) +@Parameter({ runtimeName: "pullRequestNumber", name: [{ code: "en-US", content: "Pull request number" }] }) +export class GetPullRequestReviewCommentsFunction { + async run( + context: FunctionContext, + owner: string, + repository: string, + pullRequestNumber: number, + page = 1, + perPage = 30 + ): Promise { + if (!Number.isInteger(pullRequestNumber) || pullRequestNumber < 1) + throw new RuntimeError("GITHUB_INVALID_PULL_REQUEST_NUMBER", "Pull request number must be a positive integer.") + if (!Number.isInteger(page) || page < 1) throw new RuntimeError("GITHUB_INVALID_PAGE", "Page must be a positive integer.") + if (!Number.isInteger(perPage) || perPage < 1 || perPage > 100) + throw new RuntimeError("GITHUB_INVALID_PER_PAGE", "Results per page must be an integer from 1 to 100.") + try { + const client = createGitHubClient(context) + const response = await client.get(`/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repository)}/pulls/${pullRequestNumber}/comments`, { + params: { page, per_page: perPage }, + }) + return GitHubPullRequestReviewCommentSchema.array().parse(response.data) + } catch (error) { + return handleGitHubError(error) + } + } +} diff --git a/actions/github-action/src/functions/pullRequestReviewComments/updatePullRequestReviewCommentFunction.ts b/actions/github-action/src/functions/pullRequestReviewComments/updatePullRequestReviewCommentFunction.ts new file mode 100644 index 0000000..bd0a892 --- /dev/null +++ b/actions/github-action/src/functions/pullRequestReviewComments/updatePullRequestReviewCommentFunction.ts @@ -0,0 +1,35 @@ +import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" +import { GitHubPullRequestReviewComment, GitHubPullRequestReviewCommentSchema } from "../../data_types/pullRequestReviewComments/githubPullRequestReviewComment.js" +import { GitHubUpdatePullRequestReviewCommentRequest } from "../../data_types/pullRequestReviewComments/githubPullRequestReviewCommentRequests.js" +import { createGitHubClient, handleGitHubError } from "../../helpers.js" + +@Identifier("updatePullRequestReviewComment") +@Signature( + "(owner: string, repository: string, commentId: number, data: GITHUB_UPDATE_PULL_REQUEST_REVIEW_COMMENT_REQUEST): GITHUB_PULL_REQUEST_REVIEW_COMMENT" +) +@Name({ code: "en-US", content: "Update pull request review comment" }) +@DisplayMessage({ code: "en-US", content: "Update GitHub pull request review comment" }) +@Documentation({ code: "en-US", content: "Updates a pull request review comment." }) +@Description({ code: "en-US", content: "Updates a GitHub pull request review comment." }) +@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }] }) +@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }] }) +@Parameter({ runtimeName: "commentId", name: [{ code: "en-US", content: "Comment ID" }] }) +@Parameter({ runtimeName: "data", name: [{ code: "en-US", content: "Review comment updates" }] }) +export class UpdatePullRequestReviewCommentFunction { + async run( + context: FunctionContext, + owner: string, + repository: string, + commentId: number, + data: GitHubUpdatePullRequestReviewCommentRequest + ): Promise { + if (!Number.isInteger(commentId) || commentId < 1) throw new RuntimeError("GITHUB_INVALID_COMMENT_ID", "Comment ID must be a positive integer.") + try { + const client = createGitHubClient(context) + const response = await client.patch(`/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repository)}/pulls/comments/${commentId}`, data) + return GitHubPullRequestReviewCommentSchema.parse(response.data) + } catch (error) { + return handleGitHubError(error) + } + } +} diff --git a/actions/github-action/src/functions/pullRequestReviews/createPullRequestReviewFunction.ts b/actions/github-action/src/functions/pullRequestReviews/createPullRequestReviewFunction.ts new file mode 100644 index 0000000..1c1d3d9 --- /dev/null +++ b/actions/github-action/src/functions/pullRequestReviews/createPullRequestReviewFunction.ts @@ -0,0 +1,35 @@ +import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" +import { GitHubPullRequestReview, GitHubPullRequestReviewSchema } from "../../data_types/pullRequestReviews/githubPullRequestReview.js" +import { GitHubCreatePullRequestReviewRequest } from "../../data_types/pullRequestReviews/githubPullRequestReviewRequests.js" +import { createGitHubClient, handleGitHubError } from "../../helpers.js" + +@Identifier("createPullRequestReview") +@Signature("(owner: string, repository: string, pullRequestNumber: number, data: GITHUB_CREATE_PULL_REQUEST_REVIEW_REQUEST): GITHUB_PULL_REQUEST_REVIEW") +@Name({ code: "en-US", content: "Create pull request review" }) +@DisplayMessage({ code: "en-US", content: "Create GitHub pull request review" }) +@Documentation({ code: "en-US", content: "Creates a pull request review." }) +@Description({ code: "en-US", content: "Creates a GitHub pull request review." }) +@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }] }) +@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }] }) +@Parameter({ runtimeName: "pullRequestNumber", name: [{ code: "en-US", content: "Pull request number" }] }) +@Parameter({ runtimeName: "data", name: [{ code: "en-US", content: "Review" }] }) +export class CreatePullRequestReviewFunction { + async run( + context: FunctionContext, + owner: string, + repository: string, + pullRequestNumber: number, + data: GitHubCreatePullRequestReviewRequest + ): Promise { + if (!Number.isInteger(pullRequestNumber) || pullRequestNumber < 1) + throw new RuntimeError("GITHUB_INVALID_PULL_REQUEST_NUMBER", "Pull request number must be a positive integer.") + + try { + const client = createGitHubClient(context) + const response = await client.post(`/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repository)}/pulls/${pullRequestNumber}/reviews`, data) + return GitHubPullRequestReviewSchema.parse(response.data) + } catch (error) { + return handleGitHubError(error) + } + } +} diff --git a/actions/github-action/src/functions/pullRequestReviews/dismissPullRequestReviewFunction.ts b/actions/github-action/src/functions/pullRequestReviews/dismissPullRequestReviewFunction.ts new file mode 100644 index 0000000..986573a --- /dev/null +++ b/actions/github-action/src/functions/pullRequestReviews/dismissPullRequestReviewFunction.ts @@ -0,0 +1,43 @@ +import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" +import { GitHubPullRequestReview, GitHubPullRequestReviewSchema } from "../../data_types/pullRequestReviews/githubPullRequestReview.js" +import { GitHubDismissPullRequestReviewRequest } from "../../data_types/pullRequestReviews/githubPullRequestReviewRequests.js" +import { createGitHubClient, handleGitHubError } from "../../helpers.js" + +@Identifier("dismissPullRequestReview") +@Signature( + "(owner: string, repository: string, pullRequestNumber: number, reviewId: number, data: GITHUB_DISMISS_PULL_REQUEST_REVIEW_REQUEST): GITHUB_PULL_REQUEST_REVIEW" +) +@Name({ code: "en-US", content: "Dismiss pull request review" }) +@DisplayMessage({ code: "en-US", content: "Dismiss GitHub pull request review" }) +@Documentation({ code: "en-US", content: "Dismisses a pull request review." }) +@Description({ code: "en-US", content: "Dismisses a GitHub pull request review." }) +@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }] }) +@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }] }) +@Parameter({ runtimeName: "pullRequestNumber", name: [{ code: "en-US", content: "Pull request number" }] }) +@Parameter({ runtimeName: "reviewId", name: [{ code: "en-US", content: "Review ID" }] }) +@Parameter({ runtimeName: "data", name: [{ code: "en-US", content: "Review dismissal" }] }) +export class DismissPullRequestReviewFunction { + async run( + context: FunctionContext, + owner: string, + repository: string, + pullRequestNumber: number, + reviewId: number, + data: GitHubDismissPullRequestReviewRequest + ): Promise { + if (!Number.isInteger(pullRequestNumber) || pullRequestNumber < 1) + throw new RuntimeError("GITHUB_INVALID_PULL_REQUEST_NUMBER", "Pull request number must be a positive integer.") + if (!Number.isInteger(reviewId) || reviewId < 1) throw new RuntimeError("GITHUB_INVALID_REVIEW_ID", "Review ID must be a positive integer.") + + try { + const client = createGitHubClient(context) + const response = await client.put( + `/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repository)}/pulls/${pullRequestNumber}/reviews/${reviewId}/dismissals`, + data + ) + return GitHubPullRequestReviewSchema.parse(response.data) + } catch (error) { + return handleGitHubError(error) + } + } +} diff --git a/actions/github-action/src/functions/pullRequestReviews/getPullRequestReviewsFunction.ts b/actions/github-action/src/functions/pullRequestReviews/getPullRequestReviewsFunction.ts new file mode 100644 index 0000000..20e13c8 --- /dev/null +++ b/actions/github-action/src/functions/pullRequestReviews/getPullRequestReviewsFunction.ts @@ -0,0 +1,39 @@ +import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" +import { GitHubPullRequestReview, GitHubPullRequestReviewSchema } from "../../data_types/pullRequestReviews/githubPullRequestReview.js" +import { createGitHubClient, handleGitHubError } from "../../helpers.js" + +@Identifier("getPullRequestReviews") +@Signature("(owner: string, repository: string, pullRequestNumber: number, page?: number, perPage?: number): GITHUB_PULL_REQUEST_REVIEW[]") +@Name({ code: "en-US", content: "Get pull request reviews" }) +@DisplayMessage({ code: "en-US", content: "Get GitHub pull request reviews" }) +@Documentation({ code: "en-US", content: "Returns reviews for a pull request." }) +@Description({ code: "en-US", content: "Returns GitHub pull request reviews." }) +@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }] }) +@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }] }) +@Parameter({ runtimeName: "pullRequestNumber", name: [{ code: "en-US", content: "Pull request number" }] }) +export class GetPullRequestReviewsFunction { + async run( + context: FunctionContext, + owner: string, + repository: string, + pullRequestNumber: number, + page = 1, + perPage = 30 + ): Promise { + if (!Number.isInteger(pullRequestNumber) || pullRequestNumber < 1) + throw new RuntimeError("GITHUB_INVALID_PULL_REQUEST_NUMBER", "Pull request number must be a positive integer.") + if (!Number.isInteger(page) || page < 1) throw new RuntimeError("GITHUB_INVALID_PAGE", "Page must be a positive integer.") + if (!Number.isInteger(perPage) || perPage < 1 || perPage > 100) + throw new RuntimeError("GITHUB_INVALID_PER_PAGE", "Results per page must be an integer from 1 to 100.") + + try { + const client = createGitHubClient(context) + const response = await client.get(`/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repository)}/pulls/${pullRequestNumber}/reviews`, { + params: { page, per_page: perPage }, + }) + return GitHubPullRequestReviewSchema.array().parse(response.data) + } catch (error) { + return handleGitHubError(error) + } + } +} diff --git a/actions/github-action/src/functions/pullRequestReviews/submitPullRequestReviewFunction.ts b/actions/github-action/src/functions/pullRequestReviews/submitPullRequestReviewFunction.ts new file mode 100644 index 0000000..a8e53e6 --- /dev/null +++ b/actions/github-action/src/functions/pullRequestReviews/submitPullRequestReviewFunction.ts @@ -0,0 +1,43 @@ +import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" +import { GitHubPullRequestReview, GitHubPullRequestReviewSchema } from "../../data_types/pullRequestReviews/githubPullRequestReview.js" +import { GitHubSubmitPullRequestReviewRequest } from "../../data_types/pullRequestReviews/githubPullRequestReviewRequests.js" +import { createGitHubClient, handleGitHubError } from "../../helpers.js" + +@Identifier("submitPullRequestReview") +@Signature( + "(owner: string, repository: string, pullRequestNumber: number, reviewId: number, data: GITHUB_SUBMIT_PULL_REQUEST_REVIEW_REQUEST): GITHUB_PULL_REQUEST_REVIEW" +) +@Name({ code: "en-US", content: "Submit pull request review" }) +@DisplayMessage({ code: "en-US", content: "Submit GitHub pull request review" }) +@Documentation({ code: "en-US", content: "Submits a pending pull request review." }) +@Description({ code: "en-US", content: "Submits a GitHub pull request review." }) +@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }] }) +@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }] }) +@Parameter({ runtimeName: "pullRequestNumber", name: [{ code: "en-US", content: "Pull request number" }] }) +@Parameter({ runtimeName: "reviewId", name: [{ code: "en-US", content: "Review ID" }] }) +@Parameter({ runtimeName: "data", name: [{ code: "en-US", content: "Review submission" }] }) +export class SubmitPullRequestReviewFunction { + async run( + context: FunctionContext, + owner: string, + repository: string, + pullRequestNumber: number, + reviewId: number, + data: GitHubSubmitPullRequestReviewRequest + ): Promise { + if (!Number.isInteger(pullRequestNumber) || pullRequestNumber < 1) + throw new RuntimeError("GITHUB_INVALID_PULL_REQUEST_NUMBER", "Pull request number must be a positive integer.") + if (!Number.isInteger(reviewId) || reviewId < 1) throw new RuntimeError("GITHUB_INVALID_REVIEW_ID", "Review ID must be a positive integer.") + + try { + const client = createGitHubClient(context) + const response = await client.post( + `/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repository)}/pulls/${pullRequestNumber}/reviews/${reviewId}/events`, + data + ) + return GitHubPullRequestReviewSchema.parse(response.data) + } catch (error) { + return handleGitHubError(error) + } + } +} diff --git a/actions/github-action/src/functions/pullRequests/closePullRequestFunction.ts b/actions/github-action/src/functions/pullRequests/closePullRequestFunction.ts new file mode 100644 index 0000000..5567843 --- /dev/null +++ b/actions/github-action/src/functions/pullRequests/closePullRequestFunction.ts @@ -0,0 +1,29 @@ +import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" +import { GitHubPullRequest, GitHubPullRequestSchema } from "../../data_types/pullRequests/githubPullRequest.js" +import { createGitHubClient, handleGitHubError } from "../../helpers.js" + +@Identifier("closePullRequest") +@Signature("(owner: string, repository: string, pullRequestNumber: number): GITHUB_PULL_REQUEST") +@Name({ code: "en-US", content: "Close pull request" }) +@DisplayMessage({ code: "en-US", content: "Close GitHub pull request" }) +@Documentation({ code: "en-US", content: "Closes a GitHub pull request." }) +@Description({ code: "en-US", content: "Closes a GitHub pull request." }) +@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }] }) +@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }] }) +@Parameter({ runtimeName: "pullRequestNumber", name: [{ code: "en-US", content: "Pull request number" }] }) +export class ClosePullRequestFunction { + async run(context: FunctionContext, owner: string, repository: string, pullRequestNumber: number): Promise { + if (!Number.isInteger(pullRequestNumber) || pullRequestNumber < 1) + throw new RuntimeError("GITHUB_INVALID_PULL_REQUEST_NUMBER", "Pull request number must be a positive integer.") + + try { + const client = createGitHubClient(context) + const response = await client.patch(`/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repository)}/pulls/${pullRequestNumber}`, { + state: "closed", + }) + return GitHubPullRequestSchema.parse(response.data) + } catch (error) { + return handleGitHubError(error) + } + } +} diff --git a/actions/github-action/src/functions/pullRequests/createPullRequestFunction.ts b/actions/github-action/src/functions/pullRequests/createPullRequestFunction.ts index babc67c..173bd81 100644 --- a/actions/github-action/src/functions/pullRequests/createPullRequestFunction.ts +++ b/actions/github-action/src/functions/pullRequests/createPullRequestFunction.ts @@ -1,6 +1,6 @@ import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, Signature } from "@code0-tech/hercules" -import { GitHubPullRequest, GitHubPullRequestSchema } from "../../data_types/githubPullRequest.js" -import { GitHubCreatePullRequestRequest } from "../../data_types/githubPullRequestRequests.js" +import { GitHubPullRequest, GitHubPullRequestSchema } from "../../data_types/pullRequests/githubPullRequest.js" +import { GitHubCreatePullRequestRequest } from "../../data_types/pullRequests/githubPullRequestRequests.js" import { createGitHubClient, handleGitHubError } from "../../helpers.js" @Identifier("createPullRequest") diff --git a/actions/github-action/src/functions/pullRequests/getPullRequestFunction.ts b/actions/github-action/src/functions/pullRequests/getPullRequestFunction.ts index e2e0d57..9ca8a76 100644 --- a/actions/github-action/src/functions/pullRequests/getPullRequestFunction.ts +++ b/actions/github-action/src/functions/pullRequests/getPullRequestFunction.ts @@ -1,5 +1,5 @@ import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" -import { GitHubPullRequest, GitHubPullRequestSchema } from "../../data_types/githubPullRequest.js" +import { GitHubPullRequest, GitHubPullRequestSchema } from "../../data_types/pullRequests/githubPullRequest.js" import { createGitHubClient, handleGitHubError } from "../../helpers.js" @Identifier("getPullRequest") diff --git a/actions/github-action/src/functions/pullRequests/getPullRequestsFunction.ts b/actions/github-action/src/functions/pullRequests/getPullRequestsFunction.ts index b4363d2..4f6161f 100644 --- a/actions/github-action/src/functions/pullRequests/getPullRequestsFunction.ts +++ b/actions/github-action/src/functions/pullRequests/getPullRequestsFunction.ts @@ -1,5 +1,5 @@ import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" -import { GitHubPullRequest, GitHubPullRequestSchema } from "../../data_types/githubPullRequest.js" +import { GitHubPullRequest, GitHubPullRequestSchema } from "../../data_types/pullRequests/githubPullRequest.js" import { createGitHubClient, handleGitHubError } from "../../helpers.js" type GitHubPullRequestState = "open" | "closed" | "all" diff --git a/actions/github-action/src/functions/pullRequests/mergePullRequestFunction.ts b/actions/github-action/src/functions/pullRequests/mergePullRequestFunction.ts new file mode 100644 index 0000000..946f6fb --- /dev/null +++ b/actions/github-action/src/functions/pullRequests/mergePullRequestFunction.ts @@ -0,0 +1,36 @@ +import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" +import { + GitHubPullRequestMergeRequest, + GitHubPullRequestMergeResult, + GitHubPullRequestMergeResultSchema, +} from "../../data_types/pullRequests/githubPullRequestMergeRequest.js" +import { createGitHubClient, handleGitHubError } from "../../helpers.js" + +@Identifier("mergePullRequest") +@Signature("(owner: string, repository: string, pullRequestNumber: number, data?: GITHUB_PULL_REQUEST_MERGE_REQUEST): GITHUB_PULL_REQUEST_MERGE_RESULT") +@Name({ code: "en-US", content: "Merge pull request" }) +@DisplayMessage({ code: "en-US", content: "Merge GitHub pull request" }) +@Documentation({ code: "en-US", content: "Merges a GitHub pull request." }) +@Description({ code: "en-US", content: "Merges a GitHub pull request." }) +@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }] }) +@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }] }) +@Parameter({ runtimeName: "pullRequestNumber", name: [{ code: "en-US", content: "Pull request number" }] }) +export class MergePullRequestFunction { + async run( + context: FunctionContext, + owner: string, + repository: string, + pullRequestNumber: number, + data: GitHubPullRequestMergeRequest = {} + ): Promise { + if (!Number.isInteger(pullRequestNumber) || pullRequestNumber < 1) + throw new RuntimeError("GITHUB_INVALID_PULL_REQUEST_NUMBER", "Pull request number must be a positive integer.") + try { + const client = createGitHubClient(context) + const response = await client.put(`/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repository)}/pulls/${pullRequestNumber}/merge`, data) + return GitHubPullRequestMergeResultSchema.parse(response.data) + } catch (error) { + return handleGitHubError(error) + } + } +} diff --git a/actions/github-action/src/functions/pullRequests/reopenPullRequestFunction.ts b/actions/github-action/src/functions/pullRequests/reopenPullRequestFunction.ts new file mode 100644 index 0000000..6ae2408 --- /dev/null +++ b/actions/github-action/src/functions/pullRequests/reopenPullRequestFunction.ts @@ -0,0 +1,29 @@ +import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" +import { GitHubPullRequest, GitHubPullRequestSchema } from "../../data_types/pullRequests/githubPullRequest.js" +import { createGitHubClient, handleGitHubError } from "../../helpers.js" + +@Identifier("reopenPullRequest") +@Signature("(owner: string, repository: string, pullRequestNumber: number): GITHUB_PULL_REQUEST") +@Name({ code: "en-US", content: "Reopen pull request" }) +@DisplayMessage({ code: "en-US", content: "Reopen GitHub pull request" }) +@Documentation({ code: "en-US", content: "Reopens a GitHub pull request." }) +@Description({ code: "en-US", content: "Reopens a GitHub pull request." }) +@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }] }) +@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }] }) +@Parameter({ runtimeName: "pullRequestNumber", name: [{ code: "en-US", content: "Pull request number" }] }) +export class ReopenPullRequestFunction { + async run(context: FunctionContext, owner: string, repository: string, pullRequestNumber: number): Promise { + if (!Number.isInteger(pullRequestNumber) || pullRequestNumber < 1) + throw new RuntimeError("GITHUB_INVALID_PULL_REQUEST_NUMBER", "Pull request number must be a positive integer.") + + try { + const client = createGitHubClient(context) + const response = await client.patch(`/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repository)}/pulls/${pullRequestNumber}`, { + state: "open", + }) + return GitHubPullRequestSchema.parse(response.data) + } catch (error) { + return handleGitHubError(error) + } + } +} diff --git a/actions/github-action/src/functions/pullRequests/updatePullRequestFunction.ts b/actions/github-action/src/functions/pullRequests/updatePullRequestFunction.ts index 83bebd1..dd0f422 100644 --- a/actions/github-action/src/functions/pullRequests/updatePullRequestFunction.ts +++ b/actions/github-action/src/functions/pullRequests/updatePullRequestFunction.ts @@ -1,6 +1,6 @@ import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" -import { GitHubPullRequest, GitHubPullRequestSchema } from "../../data_types/githubPullRequest.js" -import { GitHubUpdatePullRequestRequest } from "../../data_types/githubPullRequestRequests.js" +import { GitHubPullRequest, GitHubPullRequestSchema } from "../../data_types/pullRequests/githubPullRequest.js" +import { GitHubUpdatePullRequestRequest } from "../../data_types/pullRequests/githubPullRequestRequests.js" import { createGitHubClient, handleGitHubError } from "../../helpers.js" @Identifier("updatePullRequest") diff --git a/actions/github-action/src/functions/releases/createReleaseFunction.ts b/actions/github-action/src/functions/releases/createReleaseFunction.ts new file mode 100644 index 0000000..d9c0e9e --- /dev/null +++ b/actions/github-action/src/functions/releases/createReleaseFunction.ts @@ -0,0 +1,25 @@ +import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, Signature } from "@code0-tech/hercules" +import { GitHubRelease, GitHubReleaseSchema } from "../../data_types/releases/githubRelease.js" +import { GitHubCreateReleaseRequest } from "../../data_types/releases/githubReleaseRequests.js" +import { createGitHubClient, handleGitHubError } from "../../helpers.js" + +@Identifier("createRelease") +@Signature("(owner: string, repository: string, data: GITHUB_CREATE_RELEASE_REQUEST): GITHUB_RELEASE") +@Name({ code: "en-US", content: "Create release" }) +@DisplayMessage({ code: "en-US", content: "Create GitHub release" }) +@Documentation({ code: "en-US", content: "Creates a GitHub release." }) +@Description({ code: "en-US", content: "Creates a GitHub release." }) +@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }] }) +@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }] }) +@Parameter({ runtimeName: "data", name: [{ code: "en-US", content: "Release" }] }) +export class CreateReleaseFunction { + async run(context: FunctionContext, owner: string, repository: string, data: GitHubCreateReleaseRequest): Promise { + try { + const client = createGitHubClient(context) + const response = await client.post(`/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repository)}/releases`, data) + return GitHubReleaseSchema.parse(response.data) + } catch (error) { + return handleGitHubError(error) + } + } +} diff --git a/actions/github-action/src/functions/releases/deleteReleaseFunction.ts b/actions/github-action/src/functions/releases/deleteReleaseFunction.ts new file mode 100644 index 0000000..d1da4b4 --- /dev/null +++ b/actions/github-action/src/functions/releases/deleteReleaseFunction.ts @@ -0,0 +1,23 @@ +import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" +import { createGitHubClient, handleGitHubError } from "../../helpers.js" + +@Identifier("deleteRelease") +@Signature("(owner: string, repository: string, releaseId: number): void") +@Name({ code: "en-US", content: "Delete release" }) +@DisplayMessage({ code: "en-US", content: "Delete GitHub release" }) +@Documentation({ code: "en-US", content: "Deletes a GitHub release." }) +@Description({ code: "en-US", content: "Deletes a GitHub release." }) +@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }] }) +@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }] }) +@Parameter({ runtimeName: "releaseId", name: [{ code: "en-US", content: "Release ID" }] }) +export class DeleteReleaseFunction { + async run(context: FunctionContext, owner: string, repository: string, releaseId: number): Promise { + if (!Number.isInteger(releaseId) || releaseId < 1) throw new RuntimeError("GITHUB_INVALID_RELEASE_ID", "Release ID must be a positive integer.") + try { + const client = createGitHubClient(context) + await client.delete(`/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repository)}/releases/${releaseId}`) + } catch (error) { + return handleGitHubError(error) + } + } +} diff --git a/actions/github-action/src/functions/releases/getReleaseFunction.ts b/actions/github-action/src/functions/releases/getReleaseFunction.ts new file mode 100644 index 0000000..7b2a2a6 --- /dev/null +++ b/actions/github-action/src/functions/releases/getReleaseFunction.ts @@ -0,0 +1,25 @@ +import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" +import { GitHubRelease, GitHubReleaseSchema } from "../../data_types/releases/githubRelease.js" +import { createGitHubClient, handleGitHubError } from "../../helpers.js" + +@Identifier("getRelease") +@Signature("(owner: string, repository: string, releaseId: number): GITHUB_RELEASE") +@Name({ code: "en-US", content: "Get release" }) +@DisplayMessage({ code: "en-US", content: "Get GitHub release" }) +@Documentation({ code: "en-US", content: "Returns a GitHub release." }) +@Description({ code: "en-US", content: "Returns a GitHub release." }) +@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }] }) +@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }] }) +@Parameter({ runtimeName: "releaseId", name: [{ code: "en-US", content: "Release ID" }] }) +export class GetReleaseFunction { + async run(context: FunctionContext, owner: string, repository: string, releaseId: number): Promise { + if (!Number.isInteger(releaseId) || releaseId < 1) throw new RuntimeError("GITHUB_INVALID_RELEASE_ID", "Release ID must be a positive integer.") + try { + const client = createGitHubClient(context) + const response = await client.get(`/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repository)}/releases/${releaseId}`) + return GitHubReleaseSchema.parse(response.data) + } catch (error) { + return handleGitHubError(error) + } + } +} diff --git a/actions/github-action/src/functions/releases/getReleasesFunction.ts b/actions/github-action/src/functions/releases/getReleasesFunction.ts new file mode 100644 index 0000000..7623e5e --- /dev/null +++ b/actions/github-action/src/functions/releases/getReleasesFunction.ts @@ -0,0 +1,28 @@ +import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" +import { GitHubRelease, GitHubReleaseSchema } from "../../data_types/releases/githubRelease.js" +import { createGitHubClient, handleGitHubError } from "../../helpers.js" + +@Identifier("getReleases") +@Signature("(owner: string, repository: string, page?: number, perPage?: number): GITHUB_RELEASE[]") +@Name({ code: "en-US", content: "Get releases" }) +@DisplayMessage({ code: "en-US", content: "Get GitHub releases" }) +@Documentation({ code: "en-US", content: "Returns releases from a GitHub repository." }) +@Description({ code: "en-US", content: "Returns GitHub releases." }) +@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }] }) +@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }] }) +export class GetReleasesFunction { + async run(context: FunctionContext, owner: string, repository: string, page = 1, perPage = 30): Promise { + if (!Number.isInteger(page) || page < 1) throw new RuntimeError("GITHUB_INVALID_PAGE", "Page must be a positive integer.") + if (!Number.isInteger(perPage) || perPage < 1 || perPage > 100) + throw new RuntimeError("GITHUB_INVALID_PER_PAGE", "Results per page must be an integer from 1 to 100.") + try { + const client = createGitHubClient(context) + const response = await client.get(`/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repository)}/releases`, { + params: { page, per_page: perPage }, + }) + return GitHubReleaseSchema.array().parse(response.data) + } catch (error) { + return handleGitHubError(error) + } + } +} diff --git a/actions/github-action/src/functions/releases/updateReleaseFunction.ts b/actions/github-action/src/functions/releases/updateReleaseFunction.ts new file mode 100644 index 0000000..f978912 --- /dev/null +++ b/actions/github-action/src/functions/releases/updateReleaseFunction.ts @@ -0,0 +1,27 @@ +import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" +import { GitHubRelease, GitHubReleaseSchema } from "../../data_types/releases/githubRelease.js" +import { GitHubUpdateReleaseRequest } from "../../data_types/releases/githubReleaseRequests.js" +import { createGitHubClient, handleGitHubError } from "../../helpers.js" + +@Identifier("updateRelease") +@Signature("(owner: string, repository: string, releaseId: number, data: GITHUB_UPDATE_RELEASE_REQUEST): GITHUB_RELEASE") +@Name({ code: "en-US", content: "Update release" }) +@DisplayMessage({ code: "en-US", content: "Update GitHub release" }) +@Documentation({ code: "en-US", content: "Updates a GitHub release." }) +@Description({ code: "en-US", content: "Updates a GitHub release." }) +@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }] }) +@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }] }) +@Parameter({ runtimeName: "releaseId", name: [{ code: "en-US", content: "Release ID" }] }) +@Parameter({ runtimeName: "data", name: [{ code: "en-US", content: "Release updates" }] }) +export class UpdateReleaseFunction { + async run(context: FunctionContext, owner: string, repository: string, releaseId: number, data: GitHubUpdateReleaseRequest): Promise { + if (!Number.isInteger(releaseId) || releaseId < 1) throw new RuntimeError("GITHUB_INVALID_RELEASE_ID", "Release ID must be a positive integer.") + try { + const client = createGitHubClient(context) + const response = await client.patch(`/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repository)}/releases/${releaseId}`, data) + return GitHubReleaseSchema.parse(response.data) + } catch (error) { + return handleGitHubError(error) + } + } +} diff --git a/actions/github-action/src/functions/repositories/createBranchFunction.ts b/actions/github-action/src/functions/repositories/createBranchFunction.ts new file mode 100644 index 0000000..f668074 --- /dev/null +++ b/actions/github-action/src/functions/repositories/createBranchFunction.ts @@ -0,0 +1,26 @@ +import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, Signature } from "@code0-tech/hercules" +import { GitHubCreateBranchRequest } from "../../data_types/repositories/githubBranchRequests.js" +import { createGitHubClient, handleGitHubError } from "../../helpers.js" + +@Identifier("createBranch") +@Signature("(owner: string, repository: string, data: GITHUB_CREATE_BRANCH_REQUEST): void") +@Name({ code: "en-US", content: "Create branch" }) +@DisplayMessage({ code: "en-US", content: "Create GitHub branch" }) +@Documentation({ code: "en-US", content: "Creates a GitHub branch from a commit SHA." }) +@Description({ code: "en-US", content: "Creates a GitHub branch." }) +@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }] }) +@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }] }) +@Parameter({ runtimeName: "data", name: [{ code: "en-US", content: "Branch" }] }) +export class CreateBranchFunction { + async run(context: FunctionContext, owner: string, repository: string, data: GitHubCreateBranchRequest): Promise { + try { + const client = createGitHubClient(context) + await client.post(`/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repository)}/git/refs`, { + ref: `refs/heads/${data.branch}`, + sha: data.sha, + }) + } catch (error) { + return handleGitHubError(error) + } + } +} diff --git a/actions/github-action/src/functions/repositories/deleteBranchFunction.ts b/actions/github-action/src/functions/repositories/deleteBranchFunction.ts new file mode 100644 index 0000000..fe06420 --- /dev/null +++ b/actions/github-action/src/functions/repositories/deleteBranchFunction.ts @@ -0,0 +1,22 @@ +import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, Signature } from "@code0-tech/hercules" +import { createGitHubClient, handleGitHubError } from "../../helpers.js" + +@Identifier("deleteBranch") +@Signature("(owner: string, repository: string, branch: string): void") +@Name({ code: "en-US", content: "Delete branch" }) +@DisplayMessage({ code: "en-US", content: "Delete GitHub branch" }) +@Documentation({ code: "en-US", content: "Deletes a GitHub branch ref." }) +@Description({ code: "en-US", content: "Deletes a GitHub branch." }) +@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }] }) +@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }] }) +@Parameter({ runtimeName: "branch", name: [{ code: "en-US", content: "Branch" }] }) +export class DeleteBranchFunction { + async run(context: FunctionContext, owner: string, repository: string, branch: string): Promise { + try { + const client = createGitHubClient(context) + await client.delete(`/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repository)}/git/refs/${encodeURIComponent(`heads/${branch}`)}`) + } catch (error) { + return handleGitHubError(error) + } + } +} diff --git a/actions/github-action/src/functions/repositories/getBranchFunction.ts b/actions/github-action/src/functions/repositories/getBranchFunction.ts new file mode 100644 index 0000000..ca0c61a --- /dev/null +++ b/actions/github-action/src/functions/repositories/getBranchFunction.ts @@ -0,0 +1,24 @@ +import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, Signature } from "@code0-tech/hercules" +import { GitHubRepositoryBranch, GitHubRepositoryBranchSchema } from "../../data_types/repositories/githubRepositoryBranch.js" +import { createGitHubClient, handleGitHubError } from "../../helpers.js" + +@Identifier("getBranch") +@Signature("(owner: string, repository: string, branch: string): GITHUB_REPOSITORY_BRANCH") +@Name({ code: "en-US", content: "Get branch" }) +@DisplayMessage({ code: "en-US", content: "Get GitHub branch" }) +@Documentation({ code: "en-US", content: "Returns a branch from a GitHub repository." }) +@Description({ code: "en-US", content: "Returns a GitHub branch." }) +@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }] }) +@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }] }) +@Parameter({ runtimeName: "branch", name: [{ code: "en-US", content: "Branch" }] }) +export class GetBranchFunction { + async run(context: FunctionContext, owner: string, repository: string, branch: string): Promise { + try { + const client = createGitHubClient(context) + const response = await client.get(`/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repository)}/branches/${encodeURIComponent(branch)}`) + return GitHubRepositoryBranchSchema.parse(response.data) + } catch (error) { + return handleGitHubError(error) + } + } +} diff --git a/actions/github-action/src/functions/repositories/getCommitFunction.ts b/actions/github-action/src/functions/repositories/getCommitFunction.ts new file mode 100644 index 0000000..4c0af63 --- /dev/null +++ b/actions/github-action/src/functions/repositories/getCommitFunction.ts @@ -0,0 +1,24 @@ +import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, Signature } from "@code0-tech/hercules" +import { GitHubCommit, GitHubCommitSchema } from "../../data_types/repositories/githubCommit.js" +import { createGitHubClient, handleGitHubError } from "../../helpers.js" + +@Identifier("getCommit") +@Signature("(owner: string, repository: string, ref: string): GITHUB_COMMIT") +@Name({ code: "en-US", content: "Get commit" }) +@DisplayMessage({ code: "en-US", content: "Get GitHub commit" }) +@Documentation({ code: "en-US", content: "Returns a commit by SHA, branch, or tag." }) +@Description({ code: "en-US", content: "Returns a GitHub commit." }) +@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }] }) +@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }] }) +@Parameter({ runtimeName: "ref", name: [{ code: "en-US", content: "Ref" }] }) +export class GetCommitFunction { + async run(context: FunctionContext, owner: string, repository: string, ref: string): Promise { + try { + const client = createGitHubClient(context) + const response = await client.get(`/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repository)}/commits/${encodeURIComponent(ref)}`) + return GitHubCommitSchema.parse(response.data) + } catch (error) { + return handleGitHubError(error) + } + } +} diff --git a/actions/github-action/src/functions/repositories/getCommitsFunction.ts b/actions/github-action/src/functions/repositories/getCommitsFunction.ts new file mode 100644 index 0000000..6631132 --- /dev/null +++ b/actions/github-action/src/functions/repositories/getCommitsFunction.ts @@ -0,0 +1,30 @@ +import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" +import { GitHubCommit, GitHubCommitSchema } from "../../data_types/repositories/githubCommit.js" +import { createGitHubClient, handleGitHubError } from "../../helpers.js" + +@Identifier("getCommits") +@Signature("(owner: string, repository: string, sha?: string, page?: number, perPage?: number): GITHUB_COMMIT[]") +@Name({ code: "en-US", content: "Get commits" }) +@DisplayMessage({ code: "en-US", content: "Get GitHub commits" }) +@Documentation({ code: "en-US", content: "Returns commits from a GitHub repository." }) +@Description({ code: "en-US", content: "Returns GitHub commits." }) +@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }] }) +@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }] }) +@Parameter({ runtimeName: "sha", name: [{ code: "en-US", content: "SHA or branch" }] }) +export class GetCommitsFunction { + async run(context: FunctionContext, owner: string, repository: string, sha?: string, page = 1, perPage = 30): Promise { + if (!Number.isInteger(page) || page < 1) throw new RuntimeError("GITHUB_INVALID_PAGE", "Page must be a positive integer.") + if (!Number.isInteger(perPage) || perPage < 1 || perPage > 100) + throw new RuntimeError("GITHUB_INVALID_PER_PAGE", "Results per page must be an integer from 1 to 100.") + + try { + const client = createGitHubClient(context) + const response = await client.get(`/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repository)}/commits`, { + params: { sha, page, per_page: perPage }, + }) + return GitHubCommitSchema.array().parse(response.data) + } catch (error) { + return handleGitHubError(error) + } + } +} diff --git a/actions/github-action/src/functions/repositories/getRepositoryBranchesFunction.ts b/actions/github-action/src/functions/repositories/getRepositoryBranchesFunction.ts new file mode 100644 index 0000000..395d407 --- /dev/null +++ b/actions/github-action/src/functions/repositories/getRepositoryBranchesFunction.ts @@ -0,0 +1,29 @@ +import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" +import { GitHubRepositoryBranch, GitHubRepositoryBranchSchema } from "../../data_types/repositories/githubRepositoryBranch.js" +import { createGitHubClient, handleGitHubError } from "../../helpers.js" + +@Identifier("getRepositoryBranches") +@Signature("(owner: string, repository: string, page?: number, perPage?: number): GITHUB_REPOSITORY_BRANCH[]") +@Name({ code: "en-US", content: "Get repository branches" }) +@DisplayMessage({ code: "en-US", content: "Get GitHub repository branches" }) +@Documentation({ code: "en-US", content: "Returns branches of a GitHub repository." }) +@Description({ code: "en-US", content: "Returns GitHub repository branches." }) +@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }] }) +@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }] }) +export class GetRepositoryBranchesFunction { + async run(context: FunctionContext, owner: string, repository: string, page = 1, perPage = 30): Promise { + if (!Number.isInteger(page) || page < 1) throw new RuntimeError("GITHUB_INVALID_PAGE", "Page must be a positive integer.") + if (!Number.isInteger(perPage) || perPage < 1 || perPage > 100) + throw new RuntimeError("GITHUB_INVALID_PER_PAGE", "Results per page must be an integer from 1 to 100.") + + try { + const client = createGitHubClient(context) + const response = await client.get(`/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repository)}/branches`, { + params: { page, per_page: perPage }, + }) + return GitHubRepositoryBranchSchema.array().parse(response.data) + } catch (error) { + return handleGitHubError(error) + } + } +} diff --git a/actions/github-action/src/functions/repositories/getRepositoryFunction.ts b/actions/github-action/src/functions/repositories/getRepositoryFunction.ts index 2195411..079eabf 100644 --- a/actions/github-action/src/functions/repositories/getRepositoryFunction.ts +++ b/actions/github-action/src/functions/repositories/getRepositoryFunction.ts @@ -1,5 +1,5 @@ import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, Signature } from "@code0-tech/hercules" -import { GitHubRepository, GitHubRepositorySchema } from "../../data_types/githubRepository.js" +import { GitHubRepository, GitHubRepositorySchema } from "../../data_types/repositories/githubRepository.js" import { createGitHubClient, handleGitHubError } from "../../helpers.js" @Identifier("getRepository") diff --git a/actions/github-action/src/index.ts b/actions/github-action/src/index.ts index bb7d9be..500847b 100644 --- a/actions/github-action/src/index.ts +++ b/actions/github-action/src/index.ts @@ -1,24 +1,110 @@ import "reflect-metadata" import { Action, CodeZeroEvent } from "@code0-tech/hercules" -import { GitHubIssueDataType } from "./data_types/githubIssue.js" -import { GitHubCreateIssueRequestDataType, GitHubUpdateIssueRequestDataType } from "./data_types/githubIssueRequests.js" -import { GitHubPullRequestDataType } from "./data_types/githubPullRequest.js" -// import { GitHubPushWebhookPayloadDataType } from "./data_types/githubPush.js" -import { GitHubCreatePullRequestRequestDataType, GitHubUpdatePullRequestRequestDataType } from "./data_types/githubPullRequestRequests.js" -import { GitHubRepositoryDataType } from "./data_types/githubRepository.js" -// import { GitHubIssueClosedWebhookPayloadDataType } from "./data_types/githubIssueClosedWebhookPayload.js" -// import { GitHubIssueOpenedWebhookPayloadDataType } from "./data_types/githubIssueOpenedWebhookPayload.js" -// import { GitHubPullRequestClosedWebhookPayloadDataType } from "./data_types/githubPullRequestClosedWebhookPayload.js" -// import { GitHubPullRequestOpenedWebhookPayloadDataType } from "./data_types/githubPullRequestOpenedWebhookPayload.js" +import { GitHubIssueDataType } from "./data_types/issues/githubIssue.js" +import { GitHubAddAssigneesRequestDataType } from "./data_types/issues/githubAssigneesRequest.js" +import { GitHubCreateBranchRequestDataType } from "./data_types/repositories/githubBranchRequests.js" +import { GitHubCheckRunDataType, GitHubCommitStatusDataType } from "./data_types/ciAutomation/githubCiAutomation.js" +import { + GitHubCreateCheckRunRequestDataType, + GitHubCreateCommitStatusRequestDataType, + GitHubUpdateCheckRunRequestDataType, +} from "./data_types/ciAutomation/githubCiAutomationRequests.js" +import { GitHubCommitDataType } from "./data_types/repositories/githubCommit.js" +import { GitHubIssueCommentDataType } from "./data_types/issueComments/githubIssueComment.js" +import { GitHubCreateIssueCommentRequestDataType, GitHubUpdateIssueCommentRequestDataType } from "./data_types/issueComments/githubIssueCommentRequests.js" +import { GitHubCreateIssueRequestDataType, GitHubUpdateIssueRequestDataType } from "./data_types/issues/githubIssueRequests.js" +import { GitHubLabelDataType } from "./data_types/labels/githubLabel.js" +import { GitHubIssueLabelsRequestDataType } from "./data_types/labels/githubLabelRequests.js" +import { GitHubMilestoneDataType } from "./data_types/milestones/githubMilestone.js" +import { GitHubCreateMilestoneRequestDataType, GitHubUpdateMilestoneRequestDataType } from "./data_types/milestones/githubMilestoneRequests.js" +import { GitHubPullRequestDataType } from "./data_types/pullRequests/githubPullRequest.js" +import { GitHubPullRequestMergeRequestDataType, GitHubPullRequestMergeResultDataType } from "./data_types/pullRequests/githubPullRequestMergeRequest.js" +import { GitHubPullRequestReviewCommentDataType } from "./data_types/pullRequestReviewComments/githubPullRequestReviewComment.js" +import { + GitHubCreatePullRequestReviewCommentRequestDataType, + GitHubUpdatePullRequestReviewCommentRequestDataType, +} from "./data_types/pullRequestReviewComments/githubPullRequestReviewCommentRequests.js" +import { GitHubPullRequestReviewDataType } from "./data_types/pullRequestReviews/githubPullRequestReview.js" +import { + GitHubCreatePullRequestReviewRequestDataType, + GitHubDismissPullRequestReviewRequestDataType, + GitHubSubmitPullRequestReviewRequestDataType, +} from "./data_types/pullRequestReviews/githubPullRequestReviewRequests.js" +import { GitHubCreatePullRequestRequestDataType, GitHubUpdatePullRequestRequestDataType } from "./data_types/pullRequests/githubPullRequestRequests.js" +import { GitHubReleaseDataType } from "./data_types/releases/githubRelease.js" +import { GitHubCreateReleaseRequestDataType, GitHubUpdateReleaseRequestDataType } from "./data_types/releases/githubReleaseRequests.js" +import { GitHubRepositoryDataType } from "./data_types/repositories/githubRepository.js" +import { GitHubRepositoryBranchDataType } from "./data_types/repositories/githubRepositoryBranch.js" +import { GitHubWorkflowDataType, GitHubWorkflowRunDataType } from "./data_types/ciAutomation/githubWorkflow.js" +import { GitHubDispatchWorkflowRequestDataType } from "./data_types/ciAutomation/githubWorkflowRequests.js" +import { CreateIssueCommentFunction } from "./functions/issueComments/createIssueCommentFunction.js" +import { DeleteIssueCommentFunction } from "./functions/issueComments/deleteIssueCommentFunction.js" +import { GetIssueCommentsFunction } from "./functions/issueComments/getIssueCommentsFunction.js" +import { UpdateIssueCommentFunction } from "./functions/issueComments/updateIssueCommentFunction.js" +import { AddAssigneeToIssueFunction } from "./functions/issues/addAssigneeToIssueFunction.js" +import { AddAssigneesToIssueFunction } from "./functions/issues/addAssigneesToIssueFunction.js" +import { CloseIssueFunction } from "./functions/issues/closeIssueFunction.js" import { CreateIssueFunction } from "./functions/issues/createIssueFunction.js" import { GetIssueFunction } from "./functions/issues/getIssueFunction.js" import { GetIssuesFunction } from "./functions/issues/getIssuesFunction.js" +import { ReopenIssueFunction } from "./functions/issues/reopenIssueFunction.js" +import { RemoveAssigneeFromIssueFunction } from "./functions/issues/removeAssigneeFromIssueFunction.js" +import { RemoveAssigneesFromIssueFunction } from "./functions/issues/removeAssigneesFromIssueFunction.js" import { UpdateIssueFunction } from "./functions/issues/updateIssueFunction.js" +import { ClosePullRequestFunction } from "./functions/pullRequests/closePullRequestFunction.js" import { CreatePullRequestFunction } from "./functions/pullRequests/createPullRequestFunction.js" import { GetPullRequestFunction } from "./functions/pullRequests/getPullRequestFunction.js" import { GetPullRequestsFunction } from "./functions/pullRequests/getPullRequestsFunction.js" +import { MergePullRequestFunction } from "./functions/pullRequests/mergePullRequestFunction.js" +import { ReopenPullRequestFunction } from "./functions/pullRequests/reopenPullRequestFunction.js" import { UpdatePullRequestFunction } from "./functions/pullRequests/updatePullRequestFunction.js" +import { CreatePullRequestReviewFunction } from "./functions/pullRequestReviews/createPullRequestReviewFunction.js" +import { DismissPullRequestReviewFunction } from "./functions/pullRequestReviews/dismissPullRequestReviewFunction.js" +import { GetPullRequestReviewsFunction } from "./functions/pullRequestReviews/getPullRequestReviewsFunction.js" +import { SubmitPullRequestReviewFunction } from "./functions/pullRequestReviews/submitPullRequestReviewFunction.js" +import { CreatePullRequestReviewCommentFunction } from "./functions/pullRequestReviewComments/createPullRequestReviewCommentFunction.js" +import { DeletePullRequestReviewCommentFunction } from "./functions/pullRequestReviewComments/deletePullRequestReviewCommentFunction.js" +import { GetPullRequestReviewCommentsFunction } from "./functions/pullRequestReviewComments/getPullRequestReviewCommentsFunction.js" +import { UpdatePullRequestReviewCommentFunction } from "./functions/pullRequestReviewComments/updatePullRequestReviewCommentFunction.js" +import { CreateReleaseFunction } from "./functions/releases/createReleaseFunction.js" +import { DeleteReleaseFunction } from "./functions/releases/deleteReleaseFunction.js" +import { GetReleaseFunction } from "./functions/releases/getReleaseFunction.js" +import { GetReleasesFunction } from "./functions/releases/getReleasesFunction.js" +import { UpdateReleaseFunction } from "./functions/releases/updateReleaseFunction.js" +import { CreateBranchFunction } from "./functions/repositories/createBranchFunction.js" +import { DeleteBranchFunction } from "./functions/repositories/deleteBranchFunction.js" +import { GetBranchFunction } from "./functions/repositories/getBranchFunction.js" +import { GetCommitFunction } from "./functions/repositories/getCommitFunction.js" +import { GetCommitsFunction } from "./functions/repositories/getCommitsFunction.js" import { GetRepositoryFunction } from "./functions/repositories/getRepositoryFunction.js" +import { GetRepositoryBranchesFunction } from "./functions/repositories/getRepositoryBranchesFunction.js" +import { CreateCheckRunFunction } from "./functions/ciAutomation/createCheckRunFunction.js" +import { CreateCommitStatusFunction } from "./functions/ciAutomation/createCommitStatusFunction.js" +import { CancelWorkflowRunFunction } from "./functions/ciAutomation/cancelWorkflowRunFunction.js" +import { DispatchWorkflowFunction } from "./functions/ciAutomation/dispatchWorkflowFunction.js" +import { GetCommitStatusesFunction } from "./functions/ciAutomation/getCommitStatusesFunction.js" +import { GetWorkflowRunsFunction } from "./functions/ciAutomation/getWorkflowRunsFunction.js" +import { GetWorkflowsFunction } from "./functions/ciAutomation/getWorkflowsFunction.js" +import { RerunWorkflowRunFunction } from "./functions/ciAutomation/rerunWorkflowRunFunction.js" +import { UpdateCheckRunFunction } from "./functions/ciAutomation/updateCheckRunFunction.js" +import { AddLabelsToIssueFunction } from "./functions/labels/addLabelsToIssueFunction.js" +import { GetIssueLabelsFunction } from "./functions/labels/getIssueLabelsFunction.js" +import { GetLabelsFunction } from "./functions/labels/getLabelsFunction.js" +import { RemoveAllLabelsFromIssueFunction } from "./functions/labels/removeAllLabelsFromIssueFunction.js" +import { RemoveLabelFromIssueFunction } from "./functions/labels/removeLabelFromIssueFunction.js" +import { SetLabelsForIssueFunction } from "./functions/labels/setLabelsForIssueFunction.js" +import { CreateMilestoneFunction } from "./functions/milestones/createMilestoneFunction.js" +import { DeleteMilestoneFunction } from "./functions/milestones/deleteMilestoneFunction.js" +import { GetMilestoneFunction } from "./functions/milestones/getMilestoneFunction.js" +import { GetMilestonesFunction } from "./functions/milestones/getMilestonesFunction.js" +import { UpdateMilestoneFunction } from "./functions/milestones/updateMilestoneFunction.js" + +// import { GitHubPushWebhookPayloadDataType } from "./data_types/webhooks/githubPush.js" +// import { GitHubIssueClosedWebhookPayloadDataType } from "./data_types/webhooks/githubIssueClosedWebhookPayload.js" +// import { GitHubIssueOpenedWebhookPayloadDataType } from "./data_types/webhooks/githubIssueOpenedWebhookPayload.js" +// import { GitHubPullRequestClosedWebhookPayloadDataType } from "./data_types/webhooks/githubPullRequestClosedWebhookPayload.js" +// import { GitHubPullRequestOpenedWebhookPayloadDataType } from "./data_types/webhooks/githubPullRequestOpenedWebhookPayload.js" +// // import { GitHubIssueClosedWebhook } from "./events/githubIssueClosedWebhook.js" // import { GitHubIssueOpenedWebhook } from "./events/githubIssueOpenedWebhook.js" // import { GitHubPullRequestClosedWebhook } from "./events/githubPullRequestClosedWebhook.js" @@ -63,27 +149,112 @@ const action = new Action( ) action.registerDataTypeClass(GitHubRepositoryDataType) +action.registerDataTypeClass(GitHubRepositoryBranchDataType) +action.registerDataTypeClass(GitHubCreateBranchRequestDataType) +action.registerDataTypeClass(GitHubCommitDataType) +action.registerDataTypeClass(GitHubReleaseDataType) +action.registerDataTypeClass(GitHubCreateReleaseRequestDataType) +action.registerDataTypeClass(GitHubUpdateReleaseRequestDataType) +action.registerDataTypeClass(GitHubCommitStatusDataType) +action.registerDataTypeClass(GitHubCheckRunDataType) +action.registerDataTypeClass(GitHubCreateCommitStatusRequestDataType) +action.registerDataTypeClass(GitHubCreateCheckRunRequestDataType) +action.registerDataTypeClass(GitHubUpdateCheckRunRequestDataType) +action.registerDataTypeClass(GitHubWorkflowDataType) +action.registerDataTypeClass(GitHubWorkflowRunDataType) +action.registerDataTypeClass(GitHubDispatchWorkflowRequestDataType) action.registerDataTypeClass(GitHubIssueDataType) +action.registerDataTypeClass(GitHubIssueCommentDataType) +action.registerDataTypeClass(GitHubLabelDataType) +action.registerDataTypeClass(GitHubIssueLabelsRequestDataType) +action.registerDataTypeClass(GitHubMilestoneDataType) +action.registerDataTypeClass(GitHubCreateMilestoneRequestDataType) +action.registerDataTypeClass(GitHubUpdateMilestoneRequestDataType) action.registerDataTypeClass(GitHubCreateIssueRequestDataType) action.registerDataTypeClass(GitHubUpdateIssueRequestDataType) +action.registerDataTypeClass(GitHubCreateIssueCommentRequestDataType) +action.registerDataTypeClass(GitHubUpdateIssueCommentRequestDataType) +action.registerDataTypeClass(GitHubAddAssigneesRequestDataType) action.registerDataTypeClass(GitHubPullRequestDataType) -// action.registerDataTypeClass(GitHubPushWebhookPayloadDataType) +action.registerDataTypeClass(GitHubPullRequestMergeResultDataType) +action.registerDataTypeClass(GitHubPullRequestMergeRequestDataType) +action.registerDataTypeClass(GitHubPullRequestReviewDataType) +action.registerDataTypeClass(GitHubPullRequestReviewCommentDataType) +action.registerDataTypeClass(GitHubCreatePullRequestReviewCommentRequestDataType) +action.registerDataTypeClass(GitHubUpdatePullRequestReviewCommentRequestDataType) action.registerDataTypeClass(GitHubCreatePullRequestRequestDataType) action.registerDataTypeClass(GitHubUpdatePullRequestRequestDataType) +action.registerDataTypeClass(GitHubCreatePullRequestReviewRequestDataType) +action.registerDataTypeClass(GitHubSubmitPullRequestReviewRequestDataType) +action.registerDataTypeClass(GitHubDismissPullRequestReviewRequestDataType) + +// action.registerDataTypeClass(GitHubPushWebhookPayloadDataType) // action.registerDataTypeClass(GitHubIssueOpenedWebhookPayloadDataType) // action.registerDataTypeClass(GitHubIssueClosedWebhookPayloadDataType) // action.registerDataTypeClass(GitHubPullRequestOpenedWebhookPayloadDataType) // action.registerDataTypeClass(GitHubPullRequestClosedWebhookPayloadDataType) action.registerRuntimeFunction(GetRepositoryFunction) +action.registerRuntimeFunction(GetRepositoryBranchesFunction) +action.registerRuntimeFunction(GetBranchFunction) +action.registerRuntimeFunction(GetCommitsFunction) +action.registerRuntimeFunction(GetCommitFunction) +action.registerRuntimeFunction(CreateBranchFunction) +action.registerRuntimeFunction(DeleteBranchFunction) +action.registerRuntimeFunction(GetReleasesFunction) +action.registerRuntimeFunction(GetReleaseFunction) +action.registerRuntimeFunction(CreateReleaseFunction) +action.registerRuntimeFunction(UpdateReleaseFunction) +action.registerRuntimeFunction(DeleteReleaseFunction) +action.registerRuntimeFunction(CreateCommitStatusFunction) +action.registerRuntimeFunction(GetCommitStatusesFunction) +action.registerRuntimeFunction(CreateCheckRunFunction) +action.registerRuntimeFunction(UpdateCheckRunFunction) +action.registerRuntimeFunction(GetWorkflowsFunction) +action.registerRuntimeFunction(GetWorkflowRunsFunction) +action.registerRuntimeFunction(RerunWorkflowRunFunction) +action.registerRuntimeFunction(CancelWorkflowRunFunction) +action.registerRuntimeFunction(DispatchWorkflowFunction) action.registerRuntimeFunction(GetIssueFunction) action.registerRuntimeFunction(GetIssuesFunction) +action.registerRuntimeFunction(GetLabelsFunction) +action.registerRuntimeFunction(GetIssueLabelsFunction) +action.registerRuntimeFunction(AddLabelsToIssueFunction) +action.registerRuntimeFunction(SetLabelsForIssueFunction) +action.registerRuntimeFunction(RemoveLabelFromIssueFunction) +action.registerRuntimeFunction(RemoveAllLabelsFromIssueFunction) +action.registerRuntimeFunction(GetMilestonesFunction) +action.registerRuntimeFunction(GetMilestoneFunction) +action.registerRuntimeFunction(CreateMilestoneFunction) +action.registerRuntimeFunction(UpdateMilestoneFunction) +action.registerRuntimeFunction(DeleteMilestoneFunction) +action.registerRuntimeFunction(GetIssueCommentsFunction) +action.registerRuntimeFunction(CreateIssueCommentFunction) +action.registerRuntimeFunction(UpdateIssueCommentFunction) +action.registerRuntimeFunction(DeleteIssueCommentFunction) action.registerRuntimeFunction(GetPullRequestFunction) action.registerRuntimeFunction(GetPullRequestsFunction) +action.registerRuntimeFunction(GetPullRequestReviewsFunction) action.registerRuntimeFunction(CreateIssueFunction) action.registerRuntimeFunction(UpdateIssueFunction) +action.registerRuntimeFunction(CloseIssueFunction) +action.registerRuntimeFunction(ReopenIssueFunction) +action.registerRuntimeFunction(AddAssigneeToIssueFunction) +action.registerRuntimeFunction(AddAssigneesToIssueFunction) +action.registerRuntimeFunction(RemoveAssigneeFromIssueFunction) +action.registerRuntimeFunction(RemoveAssigneesFromIssueFunction) action.registerRuntimeFunction(CreatePullRequestFunction) action.registerRuntimeFunction(UpdatePullRequestFunction) +action.registerRuntimeFunction(ClosePullRequestFunction) +action.registerRuntimeFunction(ReopenPullRequestFunction) +action.registerRuntimeFunction(MergePullRequestFunction) +action.registerRuntimeFunction(CreatePullRequestReviewFunction) +action.registerRuntimeFunction(SubmitPullRequestReviewFunction) +action.registerRuntimeFunction(DismissPullRequestReviewFunction) +action.registerRuntimeFunction(GetPullRequestReviewCommentsFunction) +action.registerRuntimeFunction(CreatePullRequestReviewCommentFunction) +action.registerRuntimeFunction(UpdatePullRequestReviewCommentFunction) +action.registerRuntimeFunction(DeletePullRequestReviewCommentFunction) // action.registerEventClass(GitHubRepositoryPushWebhook) // action.registerEventClass(GitHubPullRequestOpenedWebhook) diff --git a/actions/github-action/vite.config.ts b/actions/github-action/vite.config.ts index dc45894..6cd60b0 100644 --- a/actions/github-action/vite.config.ts +++ b/actions/github-action/vite.config.ts @@ -1,18 +1,12 @@ -import { defineConfig } from 'vite'; -import { resolve } from 'path'; +import { defineConfig } from "vite" +import { resolve } from "path" export default defineConfig({ build: { target: "node18", - ssr: resolve(__dirname, 'src/index.ts'), + ssr: resolve(__dirname, "src/index.ts"), rollupOptions: { - external: (id) => - [ - 'fs', - 'path', - 'typescript', - '@code0-tech/hercules' - ].includes(id) || id.startsWith('node:') - } - } -}); + external: (id) => ["fs", "path", "typescript", "@code0-tech/hercules"].includes(id) || id.startsWith("node:"), + }, + }, +}) From 3e99bb9a75057da3dd9d2a32aca6c4cf4fa876b4 Mon Sep 17 00:00:00 2001 From: Marius Ahsmus Date: Fri, 10 Jul 2026 11:21:40 +0200 Subject: [PATCH 07/19] feat: function tests --- actions/github-action/package-lock.json | 395 +++++++++++++++++- actions/github-action/package.json | 5 +- .../ciAutomationFunctions.test.ts | 87 ++++ .../dispatchWorkflowFunction.test.ts | 19 + .../issueCommentFunctions.test.ts | 59 +++ .../issues/createIssueFunction.test.ts | 21 + .../functions/issues/getIssueFunction.test.ts | 42 ++ .../functions/issues/issueFunctions.test.ts | 91 ++++ .../functions/labels/labelFunctions.test.ts | 73 ++++ .../milestones/milestoneFunctions.test.ts | 64 +++ .../pullRequestReviewCommentFunctions.test.ts | 55 +++ .../pullRequestReviewFunctions.test.ts | 58 +++ .../mergePullRequestFunction.test.ts | 27 ++ .../pullRequests/pullRequestFunctions.test.ts | 67 +++ .../releases/createReleaseFunction.test.ts | 21 + .../releases/releaseFunctions.test.ts | 54 +++ .../repositories/createBranchFunction.test.ts | 24 ++ .../repositories/repositoryFunctions.test.ts | 73 ++++ actions/github-action/src/tests/testUtils.ts | 28 ++ 19 files changed, 1261 insertions(+), 2 deletions(-) create mode 100644 actions/github-action/src/tests/functions/ciAutomation/ciAutomationFunctions.test.ts create mode 100644 actions/github-action/src/tests/functions/ciAutomation/dispatchWorkflowFunction.test.ts create mode 100644 actions/github-action/src/tests/functions/issueComments/issueCommentFunctions.test.ts create mode 100644 actions/github-action/src/tests/functions/issues/createIssueFunction.test.ts create mode 100644 actions/github-action/src/tests/functions/issues/getIssueFunction.test.ts create mode 100644 actions/github-action/src/tests/functions/issues/issueFunctions.test.ts create mode 100644 actions/github-action/src/tests/functions/labels/labelFunctions.test.ts create mode 100644 actions/github-action/src/tests/functions/milestones/milestoneFunctions.test.ts create mode 100644 actions/github-action/src/tests/functions/pullRequestReviewComments/pullRequestReviewCommentFunctions.test.ts create mode 100644 actions/github-action/src/tests/functions/pullRequestReviews/pullRequestReviewFunctions.test.ts create mode 100644 actions/github-action/src/tests/functions/pullRequests/mergePullRequestFunction.test.ts create mode 100644 actions/github-action/src/tests/functions/pullRequests/pullRequestFunctions.test.ts create mode 100644 actions/github-action/src/tests/functions/releases/createReleaseFunction.test.ts create mode 100644 actions/github-action/src/tests/functions/releases/releaseFunctions.test.ts create mode 100644 actions/github-action/src/tests/functions/repositories/createBranchFunction.test.ts create mode 100644 actions/github-action/src/tests/functions/repositories/repositoryFunctions.test.ts create mode 100644 actions/github-action/src/tests/testUtils.ts diff --git a/actions/github-action/package-lock.json b/actions/github-action/package-lock.json index fb5711e..f262417 100644 --- a/actions/github-action/package-lock.json +++ b/actions/github-action/package-lock.json @@ -17,7 +17,8 @@ "@types/node": "^22.0.0", "tsx": "^4.0.0", "typescript": "^5.9.3", - "vite": "^8.0.3" + "vite": "^8.0.3", + "vitest": "^4.1.10" } }, "node_modules/@clack/core": { @@ -578,6 +579,13 @@ "node": ">=6" } }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.5.5", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz", + "integrity": "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==", + "dev": true, + "license": "MIT" + }, "node_modules/@js-sdsl/ordered-map": { "version": "4.4.2", "resolved": "https://registry.npmjs.org/@js-sdsl/ordered-map/-/ordered-map-4.4.2.tgz", @@ -1065,6 +1073,13 @@ "dev": true, "license": "MIT" }, + "node_modules/@standard-schema/spec": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@standard-schema/spec/-/spec-1.1.0.tgz", + "integrity": "sha512-l2aFy5jALhniG5HgqrD6jXLi/rUWrKvqN/qJx6yoJsgKhblVd+iqqU4RCXavm/jPityDo5TCvKMnpjKnOriy0w==", + "dev": true, + "license": "MIT" + }, "node_modules/@ts-morph/common": { "version": "0.29.0", "resolved": "https://registry.npmjs.org/@ts-morph/common/-/common-0.29.0.tgz", @@ -1088,6 +1103,31 @@ "tslib": "^2.4.0" } }, + "node_modules/@types/chai": { + "version": "5.2.3", + "resolved": "https://registry.npmjs.org/@types/chai/-/chai-5.2.3.tgz", + "integrity": "sha512-Mw558oeA9fFbv65/y4mHtXDs9bPnFMZAL/jxdPFUpOHHIXX91mcgEHbS5Lahr+pwZFR8A7GQleRWeI6cGFC2UA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/deep-eql": "*", + "assertion-error": "^2.0.1" + } + }, + "node_modules/@types/deep-eql": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@types/deep-eql/-/deep-eql-4.0.2.tgz", + "integrity": "sha512-c9h9dVVMigMPc4bwTvC5dxqtqJZwQPePsWjPlpSOnojbor6pGqdk541lfA7AqFQr5pB1BRdq0juY9db81BwyFw==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/estree": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.9.tgz", + "integrity": "sha512-GhdPgy1el4/ImP05X05Uw4cw2/M93BCUmnEvWZNStlCzEKME4Fkk+YpoA5OiHNQmoS7Cafb8Xa3Pya8m1Qrzeg==", + "dev": true, + "license": "MIT" + }, "node_modules/@types/node": { "version": "22.20.0", "resolved": "https://registry.npmjs.org/@types/node/-/node-22.20.0.tgz", @@ -1110,6 +1150,119 @@ "typescript": "*" } }, + "node_modules/@vitest/expect": { + "version": "4.1.10", + "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-4.1.10.tgz", + "integrity": "sha512-YsCn+qAk1GWjQOWFEsEcL2gNQ0zmVmQu3T03qP6UyjhtmdtwtbuI+DASn/7iQB3HGTXkdBwGddzxPlmiql5vlA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@standard-schema/spec": "^1.1.0", + "@types/chai": "^5.2.2", + "@vitest/spy": "4.1.10", + "@vitest/utils": "4.1.10", + "chai": "^6.2.2", + "tinyrainbow": "^3.1.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/mocker": { + "version": "4.1.10", + "resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-4.1.10.tgz", + "integrity": "sha512-v0xaezt+DKEmKfaxg133ldzADrwLGd7Ze1MfQQTYfvs8OqZIwbxyxaYURivwV7sWy5fqn3rH5uOrSp07bp44Ow==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/spy": "4.1.10", + "estree-walker": "^3.0.3", + "magic-string": "^0.30.21" + }, + "funding": { + "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "msw": "^2.4.9", + "vite": "^6.0.0 || ^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "msw": { + "optional": true + }, + "vite": { + "optional": true + } + } + }, + "node_modules/@vitest/pretty-format": { + "version": "4.1.10", + "resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-4.1.10.tgz", + "integrity": "sha512-W1HsjSH4MXQ9YfmmhLAoIYf1HRfekQCGngeIgcei6MP5QQGWUe0gkopdZQaVCFO+JDJMrAJGwa5pRpNpvy4P8Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "tinyrainbow": "^3.1.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/runner": { + "version": "4.1.10", + "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-4.1.10.tgz", + "integrity": "sha512-IKI6kpIH+LmpROplyLwBBaCfMgOZOMsygVa6BARD6ahA04VRuJSa6OaVG7kRvSEMD870Vd91rSSw0eegtWyLGg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/utils": "4.1.10", + "pathe": "^2.0.3" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/snapshot": { + "version": "4.1.10", + "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-4.1.10.tgz", + "integrity": "sha512-xRkfOT1qpTAi/Ti4Y1LtfRc3kEuqxGw59eN2jN9pRWMtS/XDevekhcFSqvQqjUNGksfjMJu3Y+oJ+4Ypn2OaJw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/pretty-format": "4.1.10", + "@vitest/utils": "4.1.10", + "magic-string": "^0.30.21", + "pathe": "^2.0.3" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/spy": { + "version": "4.1.10", + "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-4.1.10.tgz", + "integrity": "sha512-PLf/Ugvoq5wO/b4rwYCR1h2PSIdXz7wnkQFMiUpLdtM7l6pqVFcQIBEHyT1+l+cj7mNwAfZHzqXqDyjvOuwbDw==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/utils": { + "version": "4.1.10", + "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-4.1.10.tgz", + "integrity": "sha512-fy9am/HWxbaGt/Sawrp90vt6Y6jQwf1RX77cz3uwoJwJVMli/e1IEwRPnMNJ7vKfPTwo0diXifkpPvwH9v7nGA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/pretty-format": "4.1.10", + "convert-source-map": "^2.0.0", + "tinyrainbow": "^3.1.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, "node_modules/agent-base": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", @@ -1174,6 +1327,16 @@ "node": ">=14" } }, + "node_modules/assertion-error": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-2.0.1.tgz", + "integrity": "sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + } + }, "node_modules/async": { "version": "3.2.6", "resolved": "https://registry.npmjs.org/async/-/async-3.2.6.tgz", @@ -1235,6 +1398,16 @@ "node": ">= 0.4" } }, + "node_modules/chai": { + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/chai/-/chai-6.2.2.tgz", + "integrity": "sha512-NUPRluOfOiTKBKvWPtSD4PhFvWCqOi0BGStNWs57X9js7XGTprSmFoz5F0tWhR4WPjNeR9jXqdC7/UpSJTnlRg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + } + }, "node_modules/chokidar": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.3.tgz", @@ -1414,6 +1587,13 @@ "node": ">= 0.8" } }, + "node_modules/convert-source-map": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", + "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", + "dev": true, + "license": "MIT" + }, "node_modules/debug": { "version": "4.4.3", "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", @@ -1518,6 +1698,13 @@ "node": ">= 0.4" } }, + "node_modules/es-module-lexer": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-2.3.0.tgz", + "integrity": "sha512-KLdwQm2NvGLDkQDCGvmiQrhkd0JbMzXthwQAUgWjQuQdBLFa3eiBP5arXZyA+f8x+x7OXgud6bq2rxjGtHV2tw==", + "dev": true, + "license": "MIT" + }, "node_modules/es-object-atoms": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.2.tgz", @@ -1610,6 +1797,16 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/estree-walker": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz", + "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.0" + } + }, "node_modules/eventemitter3": { "version": "5.0.4", "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.4.tgz", @@ -1617,6 +1814,16 @@ "license": "MIT", "peer": true }, + "node_modules/expect-type": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/expect-type/-/expect-type-1.4.0.tgz", + "integrity": "sha512-KfYbmpRm0VbLjEvVa9yGwCi9GI34xvi7A/HXYWQO65CSD2u3MczUJSuwXKFIxlGsgBQizV9q5J9NHj4VG0n+pA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=12.0.0" + } + }, "node_modules/fdir": { "version": "6.5.0", "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz", @@ -2408,6 +2615,16 @@ "license": "Apache-2.0", "peer": true }, + "node_modules/magic-string": { + "version": "0.30.21", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.21.tgz", + "integrity": "sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.5" + } + }, "node_modules/math-intrinsics": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", @@ -2492,6 +2709,20 @@ "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" } }, + "node_modules/obug": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/obug/-/obug-2.1.3.tgz", + "integrity": "sha512-9miFgM2OFba7hB+pRgvtV84pYTBaoTHohvmIgiRt6dRIzbwEOIaNaP+dIlGs2fNFoB0SeISs0Jz5WFVRid6Xyg==", + "dev": true, + "funding": [ + "https://github.com/sponsors/sxzz", + "https://opencollective.com/debug" + ], + "license": "MIT", + "engines": { + "node": ">=12.20.0" + } + }, "node_modules/onetime": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/onetime/-/onetime-7.0.0.tgz", @@ -2515,6 +2746,13 @@ "license": "MIT", "peer": true }, + "node_modules/pathe": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/pathe/-/pathe-2.0.3.tgz", + "integrity": "sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==", + "dev": true, + "license": "MIT" + }, "node_modules/picocolors": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", @@ -2697,6 +2935,13 @@ "node": ">=10" } }, + "node_modules/siginfo": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/siginfo/-/siginfo-2.0.0.tgz", + "integrity": "sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==", + "dev": true, + "license": "ISC" + }, "node_modules/signal-exit": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", @@ -2757,6 +3002,20 @@ "node": ">=0.10.0" } }, + "node_modules/stackback": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/stackback/-/stackback-0.0.2.tgz", + "integrity": "sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==", + "dev": true, + "license": "MIT" + }, + "node_modules/std-env": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/std-env/-/std-env-4.2.0.tgz", + "integrity": "sha512-oCUKSupKTHX53EyjDtuZQ64pjLJ6yYCtpmEw0goYxtjG9KpbRe8KAsl2tBUGU9DyMcJ0RwJ8GqJAFzMXcXW1Rw==", + "dev": true, + "license": "MIT" + }, "node_modules/string-width": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", @@ -3049,6 +3308,23 @@ "license": "MIT", "peer": true }, + "node_modules/tinybench": { + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.9.0.tgz", + "integrity": "sha512-0+DUvqWMValLmha6lr4kD8iAMK1HzV0/aKnCtWb9v9641TnP/MFb7Pc2bxoxQjTXAErryXVgUOfv2YqNllqGeg==", + "dev": true, + "license": "MIT" + }, + "node_modules/tinyexec": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-1.2.4.tgz", + "integrity": "sha512-SHf/r48b7vOrjve9PxJo3MN5v5yuyjHvdUcrQffT3WXMUfnGmHDVbC4k3sHJaJTgZCwpUplIaAo5ANtMyp3YHg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + } + }, "node_modules/tinyglobby": { "version": "0.2.17", "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.17.tgz", @@ -3065,6 +3341,16 @@ "url": "https://github.com/sponsors/SuperchupuDev" } }, + "node_modules/tinyrainbow": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/tinyrainbow/-/tinyrainbow-3.1.0.tgz", + "integrity": "sha512-Bf+ILmBgretUrdJxzXM0SgXLZ3XfiaUuOj/IKQHuTXip+05Xn+uyEYdVg0kYDipTBcLrCVyUzAPz7QmArb0mmw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14.0.0" + } + }, "node_modules/ts-morph": { "version": "28.0.0", "resolved": "https://registry.npmjs.org/ts-morph/-/ts-morph-28.0.0.tgz", @@ -3257,6 +3543,113 @@ } } }, + "node_modules/vitest": { + "version": "4.1.10", + "resolved": "https://registry.npmjs.org/vitest/-/vitest-4.1.10.tgz", + "integrity": "sha512-R9jUTe5S4Qb0HCd4TNqpC7oGcrMssMRGXLW80ubjWsW9VH5GF8y1Y0SFLY9AbqSk6nt0PnOx4H4WNJYZ13GUPw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/expect": "4.1.10", + "@vitest/mocker": "4.1.10", + "@vitest/pretty-format": "4.1.10", + "@vitest/runner": "4.1.10", + "@vitest/snapshot": "4.1.10", + "@vitest/spy": "4.1.10", + "@vitest/utils": "4.1.10", + "es-module-lexer": "^2.0.0", + "expect-type": "^1.3.0", + "magic-string": "^0.30.21", + "obug": "^2.1.1", + "pathe": "^2.0.3", + "picomatch": "^4.0.3", + "std-env": "^4.0.0-rc.1", + "tinybench": "^2.9.0", + "tinyexec": "^1.0.2", + "tinyglobby": "^0.2.15", + "tinyrainbow": "^3.1.0", + "vite": "^6.0.0 || ^7.0.0 || ^8.0.0", + "why-is-node-running": "^2.3.0" + }, + "bin": { + "vitest": "vitest.mjs" + }, + "engines": { + "node": "^20.0.0 || ^22.0.0 || >=24.0.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "@edge-runtime/vm": "*", + "@opentelemetry/api": "^1.9.0", + "@types/node": "^20.0.0 || ^22.0.0 || >=24.0.0", + "@vitest/browser-playwright": "4.1.10", + "@vitest/browser-preview": "4.1.10", + "@vitest/browser-webdriverio": "4.1.10", + "@vitest/coverage-istanbul": "4.1.10", + "@vitest/coverage-v8": "4.1.10", + "@vitest/ui": "4.1.10", + "happy-dom": "*", + "jsdom": "*", + "vite": "^6.0.0 || ^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "@edge-runtime/vm": { + "optional": true + }, + "@opentelemetry/api": { + "optional": true + }, + "@types/node": { + "optional": true + }, + "@vitest/browser-playwright": { + "optional": true + }, + "@vitest/browser-preview": { + "optional": true + }, + "@vitest/browser-webdriverio": { + "optional": true + }, + "@vitest/coverage-istanbul": { + "optional": true + }, + "@vitest/coverage-v8": { + "optional": true + }, + "@vitest/ui": { + "optional": true + }, + "happy-dom": { + "optional": true + }, + "jsdom": { + "optional": true + }, + "vite": { + "optional": false + } + } + }, + "node_modules/why-is-node-running": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-2.3.0.tgz", + "integrity": "sha512-hUrmaWBdVDcxvYqnyh09zunKzROWjbZTiNy8dBEjkS7ehEDQibXJ7XvlmtbwuTclUiIyN+CyXQD4Vmko8fNm8w==", + "dev": true, + "license": "MIT", + "dependencies": { + "siginfo": "^2.0.0", + "stackback": "0.0.2" + }, + "bin": { + "why-is-node-running": "cli.js" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/widest-line": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/widest-line/-/widest-line-3.1.0.tgz", diff --git a/actions/github-action/package.json b/actions/github-action/package.json index dc24a99..703bf5c 100644 --- a/actions/github-action/package.json +++ b/actions/github-action/package.json @@ -6,6 +6,8 @@ "main": "dist/index.js", "scripts": { "dev": "tsx watch src/index.ts", + "test": "vitest run", + "test:watch": "vitest", "typecheck": "tsc --noEmit", "build": "vite build", "start": "node dist/index.js" @@ -20,6 +22,7 @@ "@types/node": "^22.0.0", "tsx": "^4.0.0", "typescript": "^5.9.3", - "vite": "^8.0.3" + "vite": "^8.0.3", + "vitest": "^4.1.10" } } diff --git a/actions/github-action/src/tests/functions/ciAutomation/ciAutomationFunctions.test.ts b/actions/github-action/src/tests/functions/ciAutomation/ciAutomationFunctions.test.ts new file mode 100644 index 0000000..2231121 --- /dev/null +++ b/actions/github-action/src/tests/functions/ciAutomation/ciAutomationFunctions.test.ts @@ -0,0 +1,87 @@ +import { RuntimeError } from "@code0-tech/hercules" +import axios from "axios" +import { beforeEach, describe, expect, it, vi } from "vitest" +import { createMockContext, mockGitHubClient, resetGitHubClientMock } from "../../testUtils.js" +import { CancelWorkflowRunFunction } from "../../../functions/ciAutomation/cancelWorkflowRunFunction.js" +import { CreateCheckRunFunction } from "../../../functions/ciAutomation/createCheckRunFunction.js" +import { CreateCommitStatusFunction } from "../../../functions/ciAutomation/createCommitStatusFunction.js" +import { GetCommitStatusesFunction } from "../../../functions/ciAutomation/getCommitStatusesFunction.js" +import { GetWorkflowRunsFunction } from "../../../functions/ciAutomation/getWorkflowRunsFunction.js" +import { GetWorkflowsFunction } from "../../../functions/ciAutomation/getWorkflowsFunction.js" +import { RerunWorkflowRunFunction } from "../../../functions/ciAutomation/rerunWorkflowRunFunction.js" +import { UpdateCheckRunFunction } from "../../../functions/ciAutomation/updateCheckRunFunction.js" + +vi.mock("axios") + +describe("CI automation functions", () => { + beforeEach(resetGitHubClientMock) + + it("creates a commit status", async () => { + const data = { state: "success" as const } + mockGitHubClient.post.mockResolvedValueOnce({ data: { id: 1 } }) + + await new CreateCommitStatusFunction().run(createMockContext(), "owner", "repo", "abc", data) + + expect(mockGitHubClient.post).toHaveBeenCalledWith("/repos/owner/repo/statuses/abc", data) + }) + + it("gets commit statuses", async () => { + mockGitHubClient.get.mockResolvedValueOnce({ data: [{ id: 1 }] }) + + await new GetCommitStatusesFunction().run(createMockContext(), "owner", "repo", "main") + + expect(mockGitHubClient.get).toHaveBeenCalledWith("/repos/owner/repo/commits/main/statuses") + }) + + it("creates and updates check runs", async () => { + const createData = { name: "ci", head_sha: "abc" } + const updateData = { status: "completed" as const } + mockGitHubClient.post.mockResolvedValueOnce({ data: { id: 1 } }) + mockGitHubClient.patch.mockResolvedValueOnce({ data: { id: 1 } }) + + await new CreateCheckRunFunction().run(createMockContext(), "owner", "repo", createData) + await new UpdateCheckRunFunction().run(createMockContext(), "owner", "repo", 1, updateData) + + expect(mockGitHubClient.post).toHaveBeenCalledWith("/repos/owner/repo/check-runs", createData) + expect(mockGitHubClient.patch).toHaveBeenCalledWith("/repos/owner/repo/check-runs/1", updateData) + }) + + it("gets workflows", async () => { + mockGitHubClient.get.mockResolvedValueOnce({ data: { workflows: [{ id: 1 }] } }) + + await new GetWorkflowsFunction().run(createMockContext(), "owner", "repo", 2, 10) + + expect(mockGitHubClient.get).toHaveBeenCalledWith("/repos/owner/repo/actions/workflows", { + params: { page: 2, per_page: 10 }, + }) + }) + + it("gets workflow runs for repository and workflow", async () => { + mockGitHubClient.get.mockResolvedValue({ data: { workflow_runs: [{ id: 1 }] } }) + + await new GetWorkflowRunsFunction().run(createMockContext(), "owner", "repo") + await new GetWorkflowRunsFunction().run(createMockContext(), "owner", "repo", "deploy.yml", 2, 10) + + expect(mockGitHubClient.get).toHaveBeenNthCalledWith(1, "/repos/owner/repo/actions/runs", { + params: { page: 1, per_page: 30 }, + }) + expect(mockGitHubClient.get).toHaveBeenNthCalledWith(2, "/repos/owner/repo/actions/workflows/deploy.yml/runs", { + params: { page: 2, per_page: 10 }, + }) + }) + + it("reruns and cancels workflow runs", async () => { + mockGitHubClient.post.mockResolvedValue({ data: {} }) + + await new RerunWorkflowRunFunction().run(createMockContext(), "owner", "repo", 1) + await new CancelWorkflowRunFunction().run(createMockContext(), "owner", "repo", 1) + + expect(mockGitHubClient.post).toHaveBeenNthCalledWith(1, "/repos/owner/repo/actions/runs/1/rerun") + expect(mockGitHubClient.post).toHaveBeenNthCalledWith(2, "/repos/owner/repo/actions/runs/1/cancel") + }) + + it("rejects invalid workflow run ids", async () => { + await expect(new RerunWorkflowRunFunction().run(createMockContext(), "owner", "repo", 0)).rejects.toBeInstanceOf(RuntimeError) + expect(vi.mocked(axios.create)).toBeDefined() + }) +}) diff --git a/actions/github-action/src/tests/functions/ciAutomation/dispatchWorkflowFunction.test.ts b/actions/github-action/src/tests/functions/ciAutomation/dispatchWorkflowFunction.test.ts new file mode 100644 index 0000000..bac2626 --- /dev/null +++ b/actions/github-action/src/tests/functions/ciAutomation/dispatchWorkflowFunction.test.ts @@ -0,0 +1,19 @@ +import axios from "axios" +import { beforeEach, describe, expect, it, vi } from "vitest" +import { createMockContext, mockGitHubClient, resetGitHubClientMock } from "../../testUtils.js" +import { DispatchWorkflowFunction } from "../../../functions/ciAutomation/dispatchWorkflowFunction.js" + +vi.mock("axios") + +describe("DispatchWorkflowFunction", () => { + beforeEach(resetGitHubClientMock) + + it("dispatches a workflow", async () => { + const data = { ref: "main", inputs: { environment: "prod" } } + mockGitHubClient.post.mockResolvedValueOnce({ data: {} }) + + await new DispatchWorkflowFunction().run(createMockContext(), "code0-tech", "centaurus", "deploy.yml", data) + + expect(mockGitHubClient.post).toHaveBeenCalledWith("/repos/code0-tech/centaurus/actions/workflows/deploy.yml/dispatches", data) + }) +}) diff --git a/actions/github-action/src/tests/functions/issueComments/issueCommentFunctions.test.ts b/actions/github-action/src/tests/functions/issueComments/issueCommentFunctions.test.ts new file mode 100644 index 0000000..4c4f02e --- /dev/null +++ b/actions/github-action/src/tests/functions/issueComments/issueCommentFunctions.test.ts @@ -0,0 +1,59 @@ +import { RuntimeError } from "@code0-tech/hercules" +import axios from "axios" +import { beforeEach, describe, expect, it, vi } from "vitest" +import { createMockContext, mockGitHubClient, resetGitHubClientMock } from "../../testUtils.js" +import { CreateIssueCommentFunction } from "../../../functions/issueComments/createIssueCommentFunction.js" +import { DeleteIssueCommentFunction } from "../../../functions/issueComments/deleteIssueCommentFunction.js" +import { GetIssueCommentsFunction } from "../../../functions/issueComments/getIssueCommentsFunction.js" +import { UpdateIssueCommentFunction } from "../../../functions/issueComments/updateIssueCommentFunction.js" + +vi.mock("axios") + +describe("issue comment functions", () => { + beforeEach(resetGitHubClientMock) + + it("gets issue comments", async () => { + mockGitHubClient.get.mockResolvedValueOnce({ data: [{ id: 1 }] }) + + const result = await new GetIssueCommentsFunction().run(createMockContext(), "owner", "repo", 3, 2, 25) + + expect(mockGitHubClient.get).toHaveBeenCalledWith("/repos/owner/repo/issues/3/comments", { + params: { page: 2, per_page: 25 }, + }) + expect(result).toEqual([{ id: 1 }]) + }) + + it("creates an issue comment", async () => { + const data = { body: "hello" } + mockGitHubClient.post.mockResolvedValueOnce({ data: { id: 1, ...data } }) + + await new CreateIssueCommentFunction().run(createMockContext(), "owner", "repo", 3, data) + + expect(mockGitHubClient.post).toHaveBeenCalledWith("/repos/owner/repo/issues/3/comments", data) + }) + + it("updates an issue comment", async () => { + const data = { body: "updated" } + mockGitHubClient.patch.mockResolvedValueOnce({ data: { id: 9, ...data } }) + + await new UpdateIssueCommentFunction().run(createMockContext(), "owner", "repo", 9, data) + + expect(mockGitHubClient.patch).toHaveBeenCalledWith("/repos/owner/repo/issues/comments/9", data) + }) + + it("deletes an issue comment", async () => { + mockGitHubClient.delete.mockResolvedValueOnce({ data: {} }) + + await new DeleteIssueCommentFunction().run(createMockContext(), "owner", "repo", 9) + + expect(mockGitHubClient.delete).toHaveBeenCalledWith("/repos/owner/repo/issues/comments/9") + }) + + it("rejects invalid comment ids", async () => { + await expect(new DeleteIssueCommentFunction().run(createMockContext(), "owner", "repo", 0)).rejects.toBeInstanceOf(RuntimeError) + }) + + it("uses axios mock", () => { + expect(vi.mocked(axios.create)).toBeDefined() + }) +}) diff --git a/actions/github-action/src/tests/functions/issues/createIssueFunction.test.ts b/actions/github-action/src/tests/functions/issues/createIssueFunction.test.ts new file mode 100644 index 0000000..3cfedd2 --- /dev/null +++ b/actions/github-action/src/tests/functions/issues/createIssueFunction.test.ts @@ -0,0 +1,21 @@ +import axios from "axios" +import { beforeEach, describe, expect, it, vi } from "vitest" +import { createMockContext, mockGitHubClient, resetGitHubClientMock } from "../../testUtils.js" +import { CreateIssueFunction } from "../../../functions/issues/createIssueFunction.js" + +vi.mock("axios") + +describe("CreateIssueFunction", () => { + beforeEach(resetGitHubClientMock) + + it("creates an issue with request data", async () => { + const data = { title: "New issue", body: "Details" } + const issue = { id: 1, ...data } + mockGitHubClient.post.mockResolvedValueOnce({ data: issue }) + + const result = await new CreateIssueFunction().run(createMockContext(), "code0-tech", "centaurus", data) + + expect(mockGitHubClient.post).toHaveBeenCalledWith("/repos/code0-tech/centaurus/issues", data) + expect(result).toEqual(issue) + }) +}) diff --git a/actions/github-action/src/tests/functions/issues/getIssueFunction.test.ts b/actions/github-action/src/tests/functions/issues/getIssueFunction.test.ts new file mode 100644 index 0000000..9e335bb --- /dev/null +++ b/actions/github-action/src/tests/functions/issues/getIssueFunction.test.ts @@ -0,0 +1,42 @@ +import { RuntimeError } from "@code0-tech/hercules" +import axios from "axios" +import { beforeEach, describe, expect, it, vi } from "vitest" +import { createMockContext, mockGitHubClient, resetGitHubClientMock } from "../../testUtils.js" +import { GetIssueFunction } from "../../../functions/issues/getIssueFunction.js" + +vi.mock("axios") + +describe("GetIssueFunction", () => { + beforeEach(resetGitHubClientMock) + + it("gets an issue by number", async () => { + const issue = { id: 1, number: 123, title: "Bug" } + mockGitHubClient.get.mockResolvedValueOnce({ data: issue }) + + const result = await new GetIssueFunction().run(createMockContext(), "code0-tech", "centaurus", 123) + + expect(axios.create).toHaveBeenCalledWith({ + baseURL: "https://api.github.test", + headers: { + Authorization: "Bearer test-token", + Accept: "application/vnd.github+json", + "X-GitHub-Api-Version": "2026-03-10", + }, + }) + expect(mockGitHubClient.get).toHaveBeenCalledWith("/repos/code0-tech/centaurus/issues/123") + expect(result).toEqual(issue) + }) + + it("encodes owner and repository", async () => { + mockGitHubClient.get.mockResolvedValueOnce({ data: { id: 1 } }) + + await new GetIssueFunction().run(createMockContext(), "code0 tech", "repo/name", 1) + + expect(mockGitHubClient.get).toHaveBeenCalledWith("/repos/code0%20tech/repo%2Fname/issues/1") + }) + + it("rejects invalid issue numbers", async () => { + await expect(new GetIssueFunction().run(createMockContext(), "code0-tech", "centaurus", 0)).rejects.toBeInstanceOf(RuntimeError) + expect(mockGitHubClient.get).not.toHaveBeenCalled() + }) +}) diff --git a/actions/github-action/src/tests/functions/issues/issueFunctions.test.ts b/actions/github-action/src/tests/functions/issues/issueFunctions.test.ts new file mode 100644 index 0000000..efce21b --- /dev/null +++ b/actions/github-action/src/tests/functions/issues/issueFunctions.test.ts @@ -0,0 +1,91 @@ +import { RuntimeError } from "@code0-tech/hercules" +import axios from "axios" +import { beforeEach, describe, expect, it, vi } from "vitest" +import { createMockContext, mockGitHubClient, resetGitHubClientMock } from "../../testUtils.js" +import { AddAssigneesToIssueFunction } from "../../../functions/issues/addAssigneesToIssueFunction.js" +import { AddAssigneeToIssueFunction } from "../../../functions/issues/addAssigneeToIssueFunction.js" +import { CloseIssueFunction } from "../../../functions/issues/closeIssueFunction.js" +import { GetIssuesFunction } from "../../../functions/issues/getIssuesFunction.js" +import { RemoveAssigneesFromIssueFunction } from "../../../functions/issues/removeAssigneesFromIssueFunction.js" +import { RemoveAssigneeFromIssueFunction } from "../../../functions/issues/removeAssigneeFromIssueFunction.js" +import { ReopenIssueFunction } from "../../../functions/issues/reopenIssueFunction.js" +import { UpdateIssueFunction } from "../../../functions/issues/updateIssueFunction.js" + +vi.mock("axios") + +describe("issue functions", () => { + beforeEach(resetGitHubClientMock) + + it("gets issues and filters pull requests out", async () => { + const issue = { id: 1, number: 1 } + mockGitHubClient.get.mockResolvedValueOnce({ data: [issue, { id: 2, pull_request: {} }] }) + + const result = await new GetIssuesFunction().run(createMockContext(), "owner", "repo", "all", 2, 50) + + expect(mockGitHubClient.get).toHaveBeenCalledWith("/repos/owner/repo/issues", { + params: { state: "all", page: 2, per_page: 50 }, + }) + expect(result).toEqual([issue]) + }) + + it("rejects invalid issues pagination", async () => { + await expect(new GetIssuesFunction().run(createMockContext(), "owner", "repo", "open", 0)).rejects.toBeInstanceOf(RuntimeError) + }) + + it("updates an issue", async () => { + const data = { title: "Updated" } + const issue = { id: 1, title: "Updated" } + mockGitHubClient.patch.mockResolvedValueOnce({ data: issue }) + + const result = await new UpdateIssueFunction().run(createMockContext(), "owner", "repo", 7, data) + + expect(mockGitHubClient.patch).toHaveBeenCalledWith("/repos/owner/repo/issues/7", data) + expect(result).toEqual(issue) + }) + + it("closes and reopens an issue", async () => { + mockGitHubClient.patch.mockResolvedValue({ data: { id: 1 } }) + + await new CloseIssueFunction().run(createMockContext(), "owner", "repo", 7) + await new ReopenIssueFunction().run(createMockContext(), "owner", "repo", 7) + + expect(mockGitHubClient.patch).toHaveBeenNthCalledWith(1, "/repos/owner/repo/issues/7", { state: "closed" }) + expect(mockGitHubClient.patch).toHaveBeenNthCalledWith(2, "/repos/owner/repo/issues/7", { state: "open" }) + }) + + it("adds one assignee to an issue", async () => { + mockGitHubClient.post.mockResolvedValueOnce({ data: { id: 1 } }) + + await new AddAssigneeToIssueFunction().run(createMockContext(), "owner", "repo", 7, "marius") + + expect(mockGitHubClient.post).toHaveBeenCalledWith("/repos/owner/repo/issues/7/assignees", { assignees: ["marius"] }) + }) + + it("adds and removes multiple assignees", async () => { + const data = { assignees: ["a", "b"] } + mockGitHubClient.post.mockResolvedValueOnce({ data: { id: 1 } }) + mockGitHubClient.delete.mockResolvedValueOnce({ data: { id: 1 } }) + + await new AddAssigneesToIssueFunction().run(createMockContext(), "owner", "repo", 7, data) + await new RemoveAssigneesFromIssueFunction().run(createMockContext(), "owner", "repo", 7, data) + + expect(mockGitHubClient.post).toHaveBeenCalledWith("/repos/owner/repo/issues/7/assignees", data) + expect(mockGitHubClient.delete).toHaveBeenCalledWith("/repos/owner/repo/issues/7/assignees", { data }) + }) + + it("removes one assignee from an issue", async () => { + mockGitHubClient.delete.mockResolvedValueOnce({ data: { id: 1 } }) + + await new RemoveAssigneeFromIssueFunction().run(createMockContext(), "owner", "repo", 7, "marius") + + expect(mockGitHubClient.delete).toHaveBeenCalledWith("/repos/owner/repo/issues/7/assignees", { data: { assignees: ["marius"] } }) + }) + + it("creates the configured axios GitHub client", async () => { + mockGitHubClient.patch.mockResolvedValueOnce({ data: { id: 1 } }) + + await new CloseIssueFunction().run(createMockContext(), "owner", "repo", 1) + + expect(axios.create).toHaveBeenCalled() + }) +}) diff --git a/actions/github-action/src/tests/functions/labels/labelFunctions.test.ts b/actions/github-action/src/tests/functions/labels/labelFunctions.test.ts new file mode 100644 index 0000000..9b2c519 --- /dev/null +++ b/actions/github-action/src/tests/functions/labels/labelFunctions.test.ts @@ -0,0 +1,73 @@ +import { RuntimeError } from "@code0-tech/hercules" +import axios from "axios" +import { beforeEach, describe, expect, it, vi } from "vitest" +import { createMockContext, mockGitHubClient, resetGitHubClientMock } from "../../testUtils.js" +import { AddLabelsToIssueFunction } from "../../../functions/labels/addLabelsToIssueFunction.js" +import { GetIssueLabelsFunction } from "../../../functions/labels/getIssueLabelsFunction.js" +import { GetLabelsFunction } from "../../../functions/labels/getLabelsFunction.js" +import { RemoveAllLabelsFromIssueFunction } from "../../../functions/labels/removeAllLabelsFromIssueFunction.js" +import { RemoveLabelFromIssueFunction } from "../../../functions/labels/removeLabelFromIssueFunction.js" +import { SetLabelsForIssueFunction } from "../../../functions/labels/setLabelsForIssueFunction.js" + +vi.mock("axios") + +describe("label functions", () => { + beforeEach(resetGitHubClientMock) + + it("gets repository labels", async () => { + mockGitHubClient.get.mockResolvedValueOnce({ data: [{ name: "bug" }] }) + + await new GetLabelsFunction().run(createMockContext(), "owner", "repo", 2, 10) + + expect(mockGitHubClient.get).toHaveBeenCalledWith("/repos/owner/repo/labels", { + params: { page: 2, per_page: 10 }, + }) + }) + + it("gets issue labels", async () => { + mockGitHubClient.get.mockResolvedValueOnce({ data: [{ name: "bug" }] }) + + await new GetIssueLabelsFunction().run(createMockContext(), "owner", "repo", 3) + + expect(mockGitHubClient.get).toHaveBeenCalledWith("/repos/owner/repo/issues/3/labels") + }) + + it("adds labels to an issue", async () => { + const data = { labels: ["bug"] } + mockGitHubClient.post.mockResolvedValueOnce({ data: [{ name: "bug" }] }) + + await new AddLabelsToIssueFunction().run(createMockContext(), "owner", "repo", 3, data) + + expect(mockGitHubClient.post).toHaveBeenCalledWith("/repos/owner/repo/issues/3/labels", data) + }) + + it("sets labels for an issue", async () => { + const data = { labels: ["bug"] } + mockGitHubClient.put.mockResolvedValueOnce({ data: [{ name: "bug" }] }) + + await new SetLabelsForIssueFunction().run(createMockContext(), "owner", "repo", 3, data) + + expect(mockGitHubClient.put).toHaveBeenCalledWith("/repos/owner/repo/issues/3/labels", data) + }) + + it("removes one label from an issue", async () => { + mockGitHubClient.delete.mockResolvedValueOnce({ data: [] }) + + await new RemoveLabelFromIssueFunction().run(createMockContext(), "owner", "repo", 3, "needs review") + + expect(mockGitHubClient.delete).toHaveBeenCalledWith("/repos/owner/repo/issues/3/labels/needs%20review") + }) + + it("removes all labels from an issue", async () => { + mockGitHubClient.delete.mockResolvedValueOnce({ data: {} }) + + await new RemoveAllLabelsFromIssueFunction().run(createMockContext(), "owner", "repo", 3) + + expect(mockGitHubClient.delete).toHaveBeenCalledWith("/repos/owner/repo/issues/3/labels") + }) + + it("rejects invalid issue numbers", async () => { + await expect(new GetIssueLabelsFunction().run(createMockContext(), "owner", "repo", 0)).rejects.toBeInstanceOf(RuntimeError) + expect(vi.mocked(axios.create)).toBeDefined() + }) +}) diff --git a/actions/github-action/src/tests/functions/milestones/milestoneFunctions.test.ts b/actions/github-action/src/tests/functions/milestones/milestoneFunctions.test.ts new file mode 100644 index 0000000..9054b14 --- /dev/null +++ b/actions/github-action/src/tests/functions/milestones/milestoneFunctions.test.ts @@ -0,0 +1,64 @@ +import { RuntimeError } from "@code0-tech/hercules" +import axios from "axios" +import { beforeEach, describe, expect, it, vi } from "vitest" +import { createMockContext, mockGitHubClient, resetGitHubClientMock } from "../../testUtils.js" +import { CreateMilestoneFunction } from "../../../functions/milestones/createMilestoneFunction.js" +import { DeleteMilestoneFunction } from "../../../functions/milestones/deleteMilestoneFunction.js" +import { GetMilestoneFunction } from "../../../functions/milestones/getMilestoneFunction.js" +import { GetMilestonesFunction } from "../../../functions/milestones/getMilestonesFunction.js" +import { UpdateMilestoneFunction } from "../../../functions/milestones/updateMilestoneFunction.js" + +vi.mock("axios") + +describe("milestone functions", () => { + beforeEach(resetGitHubClientMock) + + it("gets milestones", async () => { + mockGitHubClient.get.mockResolvedValueOnce({ data: [{ number: 1 }] }) + + await new GetMilestonesFunction().run(createMockContext(), "owner", "repo", "all", 2, 10) + + expect(mockGitHubClient.get).toHaveBeenCalledWith("/repos/owner/repo/milestones", { + params: { state: "all", page: 2, per_page: 10 }, + }) + }) + + it("gets one milestone", async () => { + mockGitHubClient.get.mockResolvedValueOnce({ data: { number: 1 } }) + + await new GetMilestoneFunction().run(createMockContext(), "owner", "repo", 1) + + expect(mockGitHubClient.get).toHaveBeenCalledWith("/repos/owner/repo/milestones/1") + }) + + it("creates a milestone", async () => { + const data = { title: "v1" } + mockGitHubClient.post.mockResolvedValueOnce({ data: { number: 1 } }) + + await new CreateMilestoneFunction().run(createMockContext(), "owner", "repo", data) + + expect(mockGitHubClient.post).toHaveBeenCalledWith("/repos/owner/repo/milestones", data) + }) + + it("updates a milestone", async () => { + const data = { title: "v2" } + mockGitHubClient.patch.mockResolvedValueOnce({ data: { number: 1 } }) + + await new UpdateMilestoneFunction().run(createMockContext(), "owner", "repo", 1, data) + + expect(mockGitHubClient.patch).toHaveBeenCalledWith("/repos/owner/repo/milestones/1", data) + }) + + it("deletes a milestone", async () => { + mockGitHubClient.delete.mockResolvedValueOnce({ data: {} }) + + await new DeleteMilestoneFunction().run(createMockContext(), "owner", "repo", 1) + + expect(mockGitHubClient.delete).toHaveBeenCalledWith("/repos/owner/repo/milestones/1") + }) + + it("rejects invalid milestone numbers", async () => { + await expect(new GetMilestoneFunction().run(createMockContext(), "owner", "repo", 0)).rejects.toBeInstanceOf(RuntimeError) + expect(vi.mocked(axios.create)).toBeDefined() + }) +}) diff --git a/actions/github-action/src/tests/functions/pullRequestReviewComments/pullRequestReviewCommentFunctions.test.ts b/actions/github-action/src/tests/functions/pullRequestReviewComments/pullRequestReviewCommentFunctions.test.ts new file mode 100644 index 0000000..df2e3f3 --- /dev/null +++ b/actions/github-action/src/tests/functions/pullRequestReviewComments/pullRequestReviewCommentFunctions.test.ts @@ -0,0 +1,55 @@ +import { RuntimeError } from "@code0-tech/hercules" +import axios from "axios" +import { beforeEach, describe, expect, it, vi } from "vitest" +import { createMockContext, mockGitHubClient, resetGitHubClientMock } from "../../testUtils.js" +import { CreatePullRequestReviewCommentFunction } from "../../../functions/pullRequestReviewComments/createPullRequestReviewCommentFunction.js" +import { DeletePullRequestReviewCommentFunction } from "../../../functions/pullRequestReviewComments/deletePullRequestReviewCommentFunction.js" +import { GetPullRequestReviewCommentsFunction } from "../../../functions/pullRequestReviewComments/getPullRequestReviewCommentsFunction.js" +import { UpdatePullRequestReviewCommentFunction } from "../../../functions/pullRequestReviewComments/updatePullRequestReviewCommentFunction.js" + +vi.mock("axios") + +describe("pull request review comment functions", () => { + beforeEach(resetGitHubClientMock) + + it("gets pull request review comments", async () => { + mockGitHubClient.get.mockResolvedValueOnce({ data: [{ id: 1 }] }) + + await new GetPullRequestReviewCommentsFunction().run(createMockContext(), "owner", "repo", 5, 2, 10) + + expect(mockGitHubClient.get).toHaveBeenCalledWith("/repos/owner/repo/pulls/5/comments", { + params: { page: 2, per_page: 10 }, + }) + }) + + it("creates a pull request review comment", async () => { + const data = { body: "Inline", commit_id: "abc", path: "file.ts", line: 1 } + mockGitHubClient.post.mockResolvedValueOnce({ data: { id: 1 } }) + + await new CreatePullRequestReviewCommentFunction().run(createMockContext(), "owner", "repo", 5, data) + + expect(mockGitHubClient.post).toHaveBeenCalledWith("/repos/owner/repo/pulls/5/comments", data) + }) + + it("updates a pull request review comment", async () => { + const data = { body: "Updated" } + mockGitHubClient.patch.mockResolvedValueOnce({ data: { id: 9 } }) + + await new UpdatePullRequestReviewCommentFunction().run(createMockContext(), "owner", "repo", 9, data) + + expect(mockGitHubClient.patch).toHaveBeenCalledWith("/repos/owner/repo/pulls/comments/9", data) + }) + + it("deletes a pull request review comment", async () => { + mockGitHubClient.delete.mockResolvedValueOnce({ data: {} }) + + await new DeletePullRequestReviewCommentFunction().run(createMockContext(), "owner", "repo", 9) + + expect(mockGitHubClient.delete).toHaveBeenCalledWith("/repos/owner/repo/pulls/comments/9") + }) + + it("rejects invalid comment ids", async () => { + await expect(new DeletePullRequestReviewCommentFunction().run(createMockContext(), "owner", "repo", 0)).rejects.toBeInstanceOf(RuntimeError) + expect(vi.mocked(axios.create)).toBeDefined() + }) +}) diff --git a/actions/github-action/src/tests/functions/pullRequestReviews/pullRequestReviewFunctions.test.ts b/actions/github-action/src/tests/functions/pullRequestReviews/pullRequestReviewFunctions.test.ts new file mode 100644 index 0000000..d710c62 --- /dev/null +++ b/actions/github-action/src/tests/functions/pullRequestReviews/pullRequestReviewFunctions.test.ts @@ -0,0 +1,58 @@ +import { RuntimeError } from "@code0-tech/hercules" +import axios from "axios" +import { beforeEach, describe, expect, it, vi } from "vitest" +import { createMockContext, mockGitHubClient, resetGitHubClientMock } from "../../testUtils.js" +import { CreatePullRequestReviewFunction } from "../../../functions/pullRequestReviews/createPullRequestReviewFunction.js" +import { DismissPullRequestReviewFunction } from "../../../functions/pullRequestReviews/dismissPullRequestReviewFunction.js" +import { GetPullRequestReviewsFunction } from "../../../functions/pullRequestReviews/getPullRequestReviewsFunction.js" +import { SubmitPullRequestReviewFunction } from "../../../functions/pullRequestReviews/submitPullRequestReviewFunction.js" + +vi.mock("axios") + +describe("pull request review functions", () => { + beforeEach(resetGitHubClientMock) + + it("gets pull request reviews", async () => { + mockGitHubClient.get.mockResolvedValueOnce({ data: [{ id: 1 }] }) + + await new GetPullRequestReviewsFunction().run(createMockContext(), "owner", "repo", 5, 2, 20) + + expect(mockGitHubClient.get).toHaveBeenCalledWith("/repos/owner/repo/pulls/5/reviews", { + params: { page: 2, per_page: 20 }, + }) + }) + + it("creates a pull request review", async () => { + const data = { event: "COMMENT" as const, body: "Looks good" } + mockGitHubClient.post.mockResolvedValueOnce({ data: { id: 1 } }) + + await new CreatePullRequestReviewFunction().run(createMockContext(), "owner", "repo", 5, data) + + expect(mockGitHubClient.post).toHaveBeenCalledWith("/repos/owner/repo/pulls/5/reviews", data) + }) + + it("submits a pull request review", async () => { + const data = { event: "APPROVE" as const } + mockGitHubClient.post.mockResolvedValueOnce({ data: { id: 1 } }) + + await new SubmitPullRequestReviewFunction().run(createMockContext(), "owner", "repo", 5, 9, data) + + expect(mockGitHubClient.post).toHaveBeenCalledWith("/repos/owner/repo/pulls/5/reviews/9/events", data) + }) + + it("dismisses a pull request review", async () => { + const data = { message: "Outdated" } + mockGitHubClient.put.mockResolvedValueOnce({ data: { id: 1 } }) + + await new DismissPullRequestReviewFunction().run(createMockContext(), "owner", "repo", 5, 9, data) + + expect(mockGitHubClient.put).toHaveBeenCalledWith("/repos/owner/repo/pulls/5/reviews/9/dismissals", data) + }) + + it("rejects invalid review ids", async () => { + await expect(new SubmitPullRequestReviewFunction().run(createMockContext(), "owner", "repo", 5, 0, { event: "COMMENT" })).rejects.toBeInstanceOf( + RuntimeError + ) + expect(vi.mocked(axios.create)).toBeDefined() + }) +}) diff --git a/actions/github-action/src/tests/functions/pullRequests/mergePullRequestFunction.test.ts b/actions/github-action/src/tests/functions/pullRequests/mergePullRequestFunction.test.ts new file mode 100644 index 0000000..694a215 --- /dev/null +++ b/actions/github-action/src/tests/functions/pullRequests/mergePullRequestFunction.test.ts @@ -0,0 +1,27 @@ +import { RuntimeError } from "@code0-tech/hercules" +import axios from "axios" +import { beforeEach, describe, expect, it, vi } from "vitest" +import { createMockContext, mockGitHubClient, resetGitHubClientMock } from "../../testUtils.js" +import { MergePullRequestFunction } from "../../../functions/pullRequests/mergePullRequestFunction.js" + +vi.mock("axios") + +describe("MergePullRequestFunction", () => { + beforeEach(resetGitHubClientMock) + + it("merges a pull request", async () => { + const data = { merge_method: "squash" as const } + const mergeResult = { merged: true, message: "Merged" } + mockGitHubClient.put.mockResolvedValueOnce({ data: mergeResult }) + + const result = await new MergePullRequestFunction().run(createMockContext(), "code0-tech", "centaurus", 42, data) + + expect(mockGitHubClient.put).toHaveBeenCalledWith("/repos/code0-tech/centaurus/pulls/42/merge", data) + expect(result).toEqual(mergeResult) + }) + + it("rejects invalid pull request numbers", async () => { + await expect(new MergePullRequestFunction().run(createMockContext(), "code0-tech", "centaurus", 0)).rejects.toBeInstanceOf(RuntimeError) + expect(mockGitHubClient.put).not.toHaveBeenCalled() + }) +}) diff --git a/actions/github-action/src/tests/functions/pullRequests/pullRequestFunctions.test.ts b/actions/github-action/src/tests/functions/pullRequests/pullRequestFunctions.test.ts new file mode 100644 index 0000000..9bc1470 --- /dev/null +++ b/actions/github-action/src/tests/functions/pullRequests/pullRequestFunctions.test.ts @@ -0,0 +1,67 @@ +import { RuntimeError } from "@code0-tech/hercules" +import axios from "axios" +import { beforeEach, describe, expect, it, vi } from "vitest" +import { createMockContext, mockGitHubClient, resetGitHubClientMock } from "../../testUtils.js" +import { ClosePullRequestFunction } from "../../../functions/pullRequests/closePullRequestFunction.js" +import { CreatePullRequestFunction } from "../../../functions/pullRequests/createPullRequestFunction.js" +import { GetPullRequestFunction } from "../../../functions/pullRequests/getPullRequestFunction.js" +import { GetPullRequestsFunction } from "../../../functions/pullRequests/getPullRequestsFunction.js" +import { ReopenPullRequestFunction } from "../../../functions/pullRequests/reopenPullRequestFunction.js" +import { UpdatePullRequestFunction } from "../../../functions/pullRequests/updatePullRequestFunction.js" + +vi.mock("axios") + +describe("pull request functions", () => { + beforeEach(resetGitHubClientMock) + + it("gets a pull request", async () => { + mockGitHubClient.get.mockResolvedValueOnce({ data: { id: 1 } }) + + await new GetPullRequestFunction().run(createMockContext(), "owner", "repo", 5) + + expect(mockGitHubClient.get).toHaveBeenCalledWith("/repos/owner/repo/pulls/5") + }) + + it("gets pull requests with pagination", async () => { + mockGitHubClient.get.mockResolvedValueOnce({ data: [{ id: 1 }] }) + + await new GetPullRequestsFunction().run(createMockContext(), "owner", "repo", "closed", 2, 10) + + expect(mockGitHubClient.get).toHaveBeenCalledWith("/repos/owner/repo/pulls", { + params: { state: "closed", page: 2, per_page: 10 }, + }) + }) + + it("creates a pull request", async () => { + const data = { title: "PR", head: "feature", base: "main" } + mockGitHubClient.post.mockResolvedValueOnce({ data: { id: 1 } }) + + await new CreatePullRequestFunction().run(createMockContext(), "owner", "repo", data) + + expect(mockGitHubClient.post).toHaveBeenCalledWith("/repos/owner/repo/pulls", data) + }) + + it("updates a pull request", async () => { + const data = { title: "Updated" } + mockGitHubClient.patch.mockResolvedValueOnce({ data: { id: 1 } }) + + await new UpdatePullRequestFunction().run(createMockContext(), "owner", "repo", 5, data) + + expect(mockGitHubClient.patch).toHaveBeenCalledWith("/repos/owner/repo/pulls/5", data) + }) + + it("closes and reopens a pull request", async () => { + mockGitHubClient.patch.mockResolvedValue({ data: { id: 1 } }) + + await new ClosePullRequestFunction().run(createMockContext(), "owner", "repo", 5) + await new ReopenPullRequestFunction().run(createMockContext(), "owner", "repo", 5) + + expect(mockGitHubClient.patch).toHaveBeenNthCalledWith(1, "/repos/owner/repo/pulls/5", { state: "closed" }) + expect(mockGitHubClient.patch).toHaveBeenNthCalledWith(2, "/repos/owner/repo/pulls/5", { state: "open" }) + }) + + it("rejects invalid pull request numbers", async () => { + await expect(new GetPullRequestFunction().run(createMockContext(), "owner", "repo", 0)).rejects.toBeInstanceOf(RuntimeError) + expect(vi.mocked(axios.create)).toBeDefined() + }) +}) diff --git a/actions/github-action/src/tests/functions/releases/createReleaseFunction.test.ts b/actions/github-action/src/tests/functions/releases/createReleaseFunction.test.ts new file mode 100644 index 0000000..9d1fe12 --- /dev/null +++ b/actions/github-action/src/tests/functions/releases/createReleaseFunction.test.ts @@ -0,0 +1,21 @@ +import axios from "axios" +import { beforeEach, describe, expect, it, vi } from "vitest" +import { createMockContext, mockGitHubClient, resetGitHubClientMock } from "../../testUtils.js" +import { CreateReleaseFunction } from "../../../functions/releases/createReleaseFunction.js" + +vi.mock("axios") + +describe("CreateReleaseFunction", () => { + beforeEach(resetGitHubClientMock) + + it("creates a release", async () => { + const data = { tag_name: "v1.0.0", name: "v1.0.0" } + const release = { id: 1, ...data } + mockGitHubClient.post.mockResolvedValueOnce({ data: release }) + + const result = await new CreateReleaseFunction().run(createMockContext(), "code0-tech", "centaurus", data) + + expect(mockGitHubClient.post).toHaveBeenCalledWith("/repos/code0-tech/centaurus/releases", data) + expect(result).toEqual(release) + }) +}) diff --git a/actions/github-action/src/tests/functions/releases/releaseFunctions.test.ts b/actions/github-action/src/tests/functions/releases/releaseFunctions.test.ts new file mode 100644 index 0000000..3558406 --- /dev/null +++ b/actions/github-action/src/tests/functions/releases/releaseFunctions.test.ts @@ -0,0 +1,54 @@ +import { RuntimeError } from "@code0-tech/hercules" +import axios from "axios" +import { beforeEach, describe, expect, it, vi } from "vitest" +import { createMockContext, mockGitHubClient, resetGitHubClientMock } from "../../testUtils.js" +import { DeleteReleaseFunction } from "../../../functions/releases/deleteReleaseFunction.js" +import { GetReleaseFunction } from "../../../functions/releases/getReleaseFunction.js" +import { GetReleasesFunction } from "../../../functions/releases/getReleasesFunction.js" +import { UpdateReleaseFunction } from "../../../functions/releases/updateReleaseFunction.js" + +vi.mock("axios") + +describe("release functions", () => { + beforeEach(resetGitHubClientMock) + + it("gets releases", async () => { + mockGitHubClient.get.mockResolvedValueOnce({ data: [{ id: 1 }] }) + + await new GetReleasesFunction().run(createMockContext(), "owner", "repo", 2, 10) + + expect(mockGitHubClient.get).toHaveBeenCalledWith("/repos/owner/repo/releases", { + params: { page: 2, per_page: 10 }, + }) + }) + + it("gets a release", async () => { + mockGitHubClient.get.mockResolvedValueOnce({ data: { id: 7 } }) + + await new GetReleaseFunction().run(createMockContext(), "owner", "repo", 7) + + expect(mockGitHubClient.get).toHaveBeenCalledWith("/repos/owner/repo/releases/7") + }) + + it("updates a release", async () => { + const data = { name: "Release" } + mockGitHubClient.patch.mockResolvedValueOnce({ data: { id: 7 } }) + + await new UpdateReleaseFunction().run(createMockContext(), "owner", "repo", 7, data) + + expect(mockGitHubClient.patch).toHaveBeenCalledWith("/repos/owner/repo/releases/7", data) + }) + + it("deletes a release", async () => { + mockGitHubClient.delete.mockResolvedValueOnce({ data: {} }) + + await new DeleteReleaseFunction().run(createMockContext(), "owner", "repo", 7) + + expect(mockGitHubClient.delete).toHaveBeenCalledWith("/repos/owner/repo/releases/7") + }) + + it("rejects invalid release ids", async () => { + await expect(new GetReleaseFunction().run(createMockContext(), "owner", "repo", 0)).rejects.toBeInstanceOf(RuntimeError) + expect(vi.mocked(axios.create)).toBeDefined() + }) +}) diff --git a/actions/github-action/src/tests/functions/repositories/createBranchFunction.test.ts b/actions/github-action/src/tests/functions/repositories/createBranchFunction.test.ts new file mode 100644 index 0000000..d15af83 --- /dev/null +++ b/actions/github-action/src/tests/functions/repositories/createBranchFunction.test.ts @@ -0,0 +1,24 @@ +import axios from "axios" +import { beforeEach, describe, expect, it, vi } from "vitest" +import { createMockContext, mockGitHubClient, resetGitHubClientMock } from "../../testUtils.js" +import { CreateBranchFunction } from "../../../functions/repositories/createBranchFunction.js" + +vi.mock("axios") + +describe("CreateBranchFunction", () => { + beforeEach(resetGitHubClientMock) + + it("creates a branch ref from a SHA", async () => { + mockGitHubClient.post.mockResolvedValueOnce({ data: {} }) + + await new CreateBranchFunction().run(createMockContext(), "code0-tech", "centaurus", { + branch: "feature/test", + sha: "abc123", + }) + + expect(mockGitHubClient.post).toHaveBeenCalledWith("/repos/code0-tech/centaurus/git/refs", { + ref: "refs/heads/feature/test", + sha: "abc123", + }) + }) +}) diff --git a/actions/github-action/src/tests/functions/repositories/repositoryFunctions.test.ts b/actions/github-action/src/tests/functions/repositories/repositoryFunctions.test.ts new file mode 100644 index 0000000..9737d91 --- /dev/null +++ b/actions/github-action/src/tests/functions/repositories/repositoryFunctions.test.ts @@ -0,0 +1,73 @@ +import { RuntimeError } from "@code0-tech/hercules" +import axios from "axios" +import { beforeEach, describe, expect, it, vi } from "vitest" +import { createMockContext, mockGitHubClient, resetGitHubClientMock } from "../../testUtils.js" +import { DeleteBranchFunction } from "../../../functions/repositories/deleteBranchFunction.js" +import { GetBranchFunction } from "../../../functions/repositories/getBranchFunction.js" +import { GetCommitFunction } from "../../../functions/repositories/getCommitFunction.js" +import { GetCommitsFunction } from "../../../functions/repositories/getCommitsFunction.js" +import { GetRepositoryBranchesFunction } from "../../../functions/repositories/getRepositoryBranchesFunction.js" +import { GetRepositoryFunction } from "../../../functions/repositories/getRepositoryFunction.js" + +vi.mock("axios") + +describe("repository functions", () => { + beforeEach(resetGitHubClientMock) + + it("gets a repository", async () => { + mockGitHubClient.get.mockResolvedValueOnce({ data: { id: 1 } }) + + await new GetRepositoryFunction().run(createMockContext(), "owner", "repo") + + expect(mockGitHubClient.get).toHaveBeenCalledWith("/repos/owner/repo") + }) + + it("gets repository branches", async () => { + mockGitHubClient.get.mockResolvedValueOnce({ data: [{ name: "main" }] }) + + await new GetRepositoryBranchesFunction().run(createMockContext(), "owner", "repo", 2, 20) + + expect(mockGitHubClient.get).toHaveBeenCalledWith("/repos/owner/repo/branches", { + params: { page: 2, per_page: 20 }, + }) + }) + + it("gets a branch", async () => { + mockGitHubClient.get.mockResolvedValueOnce({ data: { name: "feature/test" } }) + + await new GetBranchFunction().run(createMockContext(), "owner", "repo", "feature/test") + + expect(mockGitHubClient.get).toHaveBeenCalledWith("/repos/owner/repo/branches/feature%2Ftest") + }) + + it("gets commits", async () => { + mockGitHubClient.get.mockResolvedValueOnce({ data: [{ sha: "abc" }] }) + + await new GetCommitsFunction().run(createMockContext(), "owner", "repo", "main", 2, 10) + + expect(mockGitHubClient.get).toHaveBeenCalledWith("/repos/owner/repo/commits", { + params: { sha: "main", page: 2, per_page: 10 }, + }) + }) + + it("gets a commit", async () => { + mockGitHubClient.get.mockResolvedValueOnce({ data: { sha: "abc" } }) + + await new GetCommitFunction().run(createMockContext(), "owner", "repo", "abc/123") + + expect(mockGitHubClient.get).toHaveBeenCalledWith("/repos/owner/repo/commits/abc%2F123") + }) + + it("deletes a branch", async () => { + mockGitHubClient.delete.mockResolvedValueOnce({ data: {} }) + + await new DeleteBranchFunction().run(createMockContext(), "owner", "repo", "feature/test") + + expect(mockGitHubClient.delete).toHaveBeenCalledWith("/repos/owner/repo/git/refs/heads%2Ffeature%2Ftest") + }) + + it("rejects invalid branch pagination", async () => { + await expect(new GetRepositoryBranchesFunction().run(createMockContext(), "owner", "repo", 0)).rejects.toBeInstanceOf(RuntimeError) + expect(vi.mocked(axios.create)).toBeDefined() + }) +}) diff --git a/actions/github-action/src/tests/testUtils.ts b/actions/github-action/src/tests/testUtils.ts new file mode 100644 index 0000000..432c8c4 --- /dev/null +++ b/actions/github-action/src/tests/testUtils.ts @@ -0,0 +1,28 @@ +import axios from "axios" +import { vi } from "vitest" +import type { FunctionContext } from "@code0-tech/hercules" + +export const mockGitHubClient = { + delete: vi.fn(), + get: vi.fn(), + patch: vi.fn(), + post: vi.fn(), + put: vi.fn(), +} + +export function createMockContext(): FunctionContext { + return { + matchedConfig: { + findConfig: (key: string) => { + if (key === "github_token") return "test-token" + if (key === "github_api_url") return "https://api.github.test" + return undefined + }, + }, + } as unknown as FunctionContext +} + +export function resetGitHubClientMock() { + vi.clearAllMocks() + vi.mocked(axios.create).mockReturnValue(mockGitHubClient as never) +} From 637d5b7c536e5d35ac70fc2e66f8d63a32bfc66a Mon Sep 17 00:00:00 2001 From: Marius Ahsmus Date: Wed, 19 Aug 2026 13:40:34 +0200 Subject: [PATCH 08/19] deps(github-action): update hercules --- actions/github-action/package-lock.json | 19 +++++++++++-------- actions/github-action/package.json | 2 +- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/actions/github-action/package-lock.json b/actions/github-action/package-lock.json index f262417..9ee5c21 100644 --- a/actions/github-action/package-lock.json +++ b/actions/github-action/package-lock.json @@ -8,7 +8,7 @@ "name": "@code0-tech/github-action", "version": "1.0.0", "dependencies": { - "@code0-tech/hercules": "^1.0.3", + "@code0-tech/hercules": "^1.3.0", "axios": "^1.7.7" }, "devDependencies": { @@ -45,12 +45,15 @@ } }, "node_modules/@code0-tech/hercules": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/@code0-tech/hercules/-/hercules-1.0.3.tgz", - "integrity": "sha512-uHQkYv67J9+pKgjPlQ3aCJurzkitN05ZFdGvEWPJo6ayxExks3VCS3b5D1f2tndXLo6zAtwsoT7ETK7FphRNPw==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@code0-tech/hercules/-/hercules-1.3.0.tgz", + "integrity": "sha512-RDucDMkFJjZqktIqw+CcEPjKv8lEwZ9l+cCmkPD/rsFiYc5s2zk2YjOIsq61Oj5VyNjORc7m3ElP17cHig9n8w==", "license": "ISC", + "bin": { + "hercules": "bin/hercules.js" + }, "peerDependencies": { - "@code0-tech/tucana": "0.0.74", + "@code0-tech/tucana": "0.0.82", "@grpc/grpc-js": "^1.14.3", "@protobuf-ts/grpc-backend": "^2.11.1", "@protobuf-ts/grpc-transport": "^2.11.1", @@ -64,9 +67,9 @@ } }, "node_modules/@code0-tech/tucana": { - "version": "0.0.74", - "resolved": "https://registry.npmjs.org/@code0-tech/tucana/-/tucana-0.0.74.tgz", - "integrity": "sha512-AgCl812Sn/MyY1+cRG0pdN0Uj7z93hDa4E9bclaf9hS5wc1PrlQSutDgePvJFR/VBWoeYQczne7MNP7RDu9NRg==", + "version": "0.0.82", + "resolved": "https://registry.npmjs.org/@code0-tech/tucana/-/tucana-0.0.82.tgz", + "integrity": "sha512-9ImPNeGV09BeLT0M8/F08DHDe10MO6UI/VfE7i2aEYtRsB9DS3jIAGrcMEV67RXdmAj5ZWTtvxWVGOkem0CljQ==", "license": "MIT", "peer": true }, diff --git a/actions/github-action/package.json b/actions/github-action/package.json index 703bf5c..dfa9c22 100644 --- a/actions/github-action/package.json +++ b/actions/github-action/package.json @@ -13,7 +13,7 @@ "start": "node dist/index.js" }, "dependencies": { - "@code0-tech/hercules": "^1.0.3", + "@code0-tech/hercules": "^1.3.0", "axios": "^1.7.7" }, "devDependencies": { From 97e8582231f2f73cc511e535dccebab71fefc6aa Mon Sep 17 00:00:00 2001 From: Marius Ahsmus Date: Mon, 14 Sep 2026 18:57:57 +0200 Subject: [PATCH 09/19] fix(github): webhook schema typing --- .../src/events/githubIssueClosedWebhook.ts | 8 +++--- .../src/events/githubIssueOpenedWebhook.ts | 8 +++--- .../events/githubPullRequestClosedWebhook.ts | 8 +++--- .../events/githubPullRequestOpenedWebhook.ts | 8 +++--- .../src/events/githubRepositoryPushWebhook.ts | 8 +++--- actions/github-action/src/index.ts | 25 +++++++++---------- 6 files changed, 37 insertions(+), 28 deletions(-) diff --git a/actions/github-action/src/events/githubIssueClosedWebhook.ts b/actions/github-action/src/events/githubIssueClosedWebhook.ts index b8891b2..070baec 100644 --- a/actions/github-action/src/events/githubIssueClosedWebhook.ts +++ b/actions/github-action/src/events/githubIssueClosedWebhook.ts @@ -5,18 +5,20 @@ import { Description, DisplayIcon, DisplayMessage, EventSetting, Identifier, Nam @Name({ code: "en-US", content: "GitHub issue closed" }) @Description({ code: "en-US", content: "Triggered when a GitHub issue is closed." }) @DisplayMessage({ code: "en-US", content: "GitHub issue closed on ${httpURL}" }) -@Signature("(httpSchema: HTTP_SCHEMA, httpURL: HTTP_URL, httpMethod: HTTP_METHOD, httpAuth: A, httpAuthValue: REST_AUTH_VALUE, input_schema?: GitHubIssueClosedWebhookPayload): REST_ADAPTER_INPUT") +@Signature( + "(httpSchema: HTTP_SCHEMA, httpURL: HTTP_URL, httpMethod: HTTP_METHOD, httpAuth: A, httpAuthValue: REST_AUTH_VALUE, input_schema?: GitHubIssueClosedWebhookPayload): REST_ADAPTER_INPUT" +) @EventSetting({ identifier: "input_schema", hidden: true, }) @EventSetting({ - identifier: "httpMethod", + identifier: "http_method", hidden: true, defaultValue: "POST", }) @EventSetting({ - identifier: "httpSchema", + identifier: "http_schema", hidden: true, defaultValue: "application/json", }) diff --git a/actions/github-action/src/events/githubIssueOpenedWebhook.ts b/actions/github-action/src/events/githubIssueOpenedWebhook.ts index e7c4b53..04f28f1 100644 --- a/actions/github-action/src/events/githubIssueOpenedWebhook.ts +++ b/actions/github-action/src/events/githubIssueOpenedWebhook.ts @@ -5,18 +5,20 @@ import { Description, DisplayIcon, DisplayMessage, EventSetting, Identifier, Nam @Name({ code: "en-US", content: "GitHub issue opened" }) @Description({ code: "en-US", content: "Triggered when a GitHub issue is opened." }) @DisplayMessage({ code: "en-US", content: "GitHub issue opened on ${httpURL}" }) -@Signature("(httpSchema: HTTP_SCHEMA, httpURL: HTTP_URL, httpMethod: HTTP_METHOD, httpAuth: A, httpAuthValue: REST_AUTH_VALUE, input_schema?: GitHubIssueOpenedWebhookPayload): REST_ADAPTER_INPUT") +@Signature( + "(httpSchema: HTTP_SCHEMA, httpURL: HTTP_URL, httpMethod: HTTP_METHOD, httpAuth: A, httpAuthValue: REST_AUTH_VALUE, input_schema?: GitHubIssueOpenedWebhookPayload): REST_ADAPTER_INPUT" +) @EventSetting({ identifier: "input_schema", hidden: true, }) @EventSetting({ - identifier: "httpMethod", + identifier: "http_method", hidden: true, defaultValue: "POST", }) @EventSetting({ - identifier: "httpSchema", + identifier: "http_schema", hidden: true, defaultValue: "application/json", }) diff --git a/actions/github-action/src/events/githubPullRequestClosedWebhook.ts b/actions/github-action/src/events/githubPullRequestClosedWebhook.ts index 39dda4d..d3d6d96 100644 --- a/actions/github-action/src/events/githubPullRequestClosedWebhook.ts +++ b/actions/github-action/src/events/githubPullRequestClosedWebhook.ts @@ -5,18 +5,20 @@ import { Description, DisplayIcon, DisplayMessage, EventSetting, Identifier, Nam @Name({ code: "en-US", content: "GitHub pull request closed" }) @Description({ code: "en-US", content: "Triggered when a GitHub pull request is closed." }) @DisplayMessage({ code: "en-US", content: "GitHub pull request closed on ${httpURL}" }) -@Signature("(httpSchema: HTTP_SCHEMA, httpURL: HTTP_URL, httpMethod: HTTP_METHOD, httpAuth: A, httpAuthValue: REST_AUTH_VALUE, input_schema?: GitHubPullRequestClosedWebhookPayload): REST_ADAPTER_INPUT") +@Signature( + "(httpSchema: HTTP_SCHEMA, httpURL: HTTP_URL, httpMethod: HTTP_METHOD, httpAuth: A, httpAuthValue: REST_AUTH_VALUE, input_schema?: GitHubPullRequestClosedWebhookPayload): REST_ADAPTER_INPUT" +) @EventSetting({ identifier: "input_schema", hidden: true, }) @EventSetting({ - identifier: "httpMethod", + identifier: "http_method", hidden: true, defaultValue: "POST", }) @EventSetting({ - identifier: "httpSchema", + identifier: "http_schema", hidden: true, defaultValue: "application/json", }) diff --git a/actions/github-action/src/events/githubPullRequestOpenedWebhook.ts b/actions/github-action/src/events/githubPullRequestOpenedWebhook.ts index 30f4b1a..117b621 100644 --- a/actions/github-action/src/events/githubPullRequestOpenedWebhook.ts +++ b/actions/github-action/src/events/githubPullRequestOpenedWebhook.ts @@ -5,18 +5,20 @@ import { Description, DisplayIcon, DisplayMessage, EventSetting, Identifier, Nam @Name({ code: "en-US", content: "GitHub pull request opened" }) @Description({ code: "en-US", content: "Triggered when a GitHub pull request is opened." }) @DisplayMessage({ code: "en-US", content: "GitHub pull request opened on ${httpURL}" }) -@Signature("(httpSchema: HTTP_SCHEMA, httpURL: HTTP_URL, httpMethod: HTTP_METHOD, httpAuth: A, httpAuthValue: REST_AUTH_VALUE, input_schema?: GitHubPullRequestOpenedWebhookPayload): REST_ADAPTER_INPUT") +@Signature( + "(httpSchema: HTTP_SCHEMA, httpURL: HTTP_URL, httpMethod: HTTP_METHOD, httpAuth: A, httpAuthValue: REST_AUTH_VALUE, input_schema?: GitHubPullRequestOpenedWebhookPayload): REST_ADAPTER_INPUT" +) @EventSetting({ identifier: "input_schema", hidden: true, }) @EventSetting({ - identifier: "httpMethod", + identifier: "http_method", hidden: true, defaultValue: "POST", }) @EventSetting({ - identifier: "httpSchema", + identifier: "http_schema", hidden: true, defaultValue: "application/json", }) diff --git a/actions/github-action/src/events/githubRepositoryPushWebhook.ts b/actions/github-action/src/events/githubRepositoryPushWebhook.ts index 425520b..5b8b494 100644 --- a/actions/github-action/src/events/githubRepositoryPushWebhook.ts +++ b/actions/github-action/src/events/githubRepositoryPushWebhook.ts @@ -5,18 +5,20 @@ import { Description, DisplayIcon, DisplayMessage, EventSetting, Identifier, Nam @Name({ code: "en-US", content: "GitHub repository push" }) @Description({ code: "en-US", content: "Triggered when commits or tags are pushed to a GitHub repository." }) @DisplayMessage({ code: "en-US", content: "GitHub repository push on ${httpURL}" }) -@Signature("(httpSchema: HTTP_SCHEMA, httpURL: HTTP_URL, httpMethod: HTTP_METHOD, httpAuth: A, httpAuthValue: REST_AUTH_VALUE, input_schema?: GitHubPushWebhookPayload): REST_ADAPTER_INPUT") +@Signature( + "(httpSchema: HTTP_SCHEMA, httpURL: HTTP_URL, httpMethod: HTTP_METHOD, httpAuth: A, httpAuthValue: REST_AUTH_VALUE, input_schema?: GitHubPushWebhookPayload): REST_ADAPTER_INPUT" +) @EventSetting({ identifier: "input_schema", hidden: true, }) @EventSetting({ - identifier: "httpMethod", + identifier: "http_method", hidden: true, defaultValue: "POST", }) @EventSetting({ - identifier: "httpSchema", + identifier: "http_schema", hidden: true, defaultValue: "application/json", }) diff --git a/actions/github-action/src/index.ts b/actions/github-action/src/index.ts index 500847b..097407c 100644 --- a/actions/github-action/src/index.ts +++ b/actions/github-action/src/index.ts @@ -98,18 +98,17 @@ import { DeleteMilestoneFunction } from "./functions/milestones/deleteMilestoneF import { GetMilestoneFunction } from "./functions/milestones/getMilestoneFunction.js" import { GetMilestonesFunction } from "./functions/milestones/getMilestonesFunction.js" import { UpdateMilestoneFunction } from "./functions/milestones/updateMilestoneFunction.js" +import { GitHubRepositoryPushWebhook } from "./events/githubRepositoryPushWebhook.js" +import { GitHubPullRequestOpenedWebhook } from "./events/githubPullRequestOpenedWebhook.js" +import { GitHubPullRequestClosedWebhook } from "./events/githubPullRequestClosedWebhook.js" +import { GitHubIssueOpenedWebhook } from "./events/githubIssueOpenedWebhook.js" +import { GitHubIssueClosedWebhook } from "./events/githubIssueClosedWebhook.js" // import { GitHubPushWebhookPayloadDataType } from "./data_types/webhooks/githubPush.js" // import { GitHubIssueClosedWebhookPayloadDataType } from "./data_types/webhooks/githubIssueClosedWebhookPayload.js" // import { GitHubIssueOpenedWebhookPayloadDataType } from "./data_types/webhooks/githubIssueOpenedWebhookPayload.js" // import { GitHubPullRequestClosedWebhookPayloadDataType } from "./data_types/webhooks/githubPullRequestClosedWebhookPayload.js" // import { GitHubPullRequestOpenedWebhookPayloadDataType } from "./data_types/webhooks/githubPullRequestOpenedWebhookPayload.js" -// -// import { GitHubIssueClosedWebhook } from "./events/githubIssueClosedWebhook.js" -// import { GitHubIssueOpenedWebhook } from "./events/githubIssueOpenedWebhook.js" -// import { GitHubPullRequestClosedWebhook } from "./events/githubPullRequestClosedWebhook.js" -// import { GitHubPullRequestOpenedWebhook } from "./events/githubPullRequestOpenedWebhook.js" -// import { GitHubRepositoryPushWebhook } from "./events/githubRepositoryPushWebhook.js" const action = new Action( process.env.ACTION_ID ?? "github-action", @@ -256,11 +255,11 @@ action.registerRuntimeFunction(CreatePullRequestReviewCommentFunction) action.registerRuntimeFunction(UpdatePullRequestReviewCommentFunction) action.registerRuntimeFunction(DeletePullRequestReviewCommentFunction) -// action.registerEventClass(GitHubRepositoryPushWebhook) -// action.registerEventClass(GitHubPullRequestOpenedWebhook) -// action.registerEventClass(GitHubPullRequestClosedWebhook) -// action.registerEventClass(GitHubIssueOpenedWebhook) -// action.registerEventClass(GitHubIssueClosedWebhook) +action.registerEventClass(GitHubRepositoryPushWebhook) +action.registerEventClass(GitHubPullRequestOpenedWebhook) +action.registerEventClass(GitHubPullRequestClosedWebhook) +action.registerEventClass(GitHubIssueOpenedWebhook) +action.registerEventClass(GitHubIssueClosedWebhook) action.on(CodeZeroEvent.connected, () => { console.log("Connected to Aquila") @@ -271,13 +270,13 @@ action.on(CodeZeroEvent.error, (error: Error) => { console.log("Attempting to reconnect in 5s...") setTimeout(() => { - action.connect(process.env.AUTH_TOKEN ?? "token_abc1234").catch((reconnectError: unknown) => { + action.connect(process.env.AUTH_TOKEN ?? "eioiN3UuNRXTNIcmoT01Gs4hVnsXhnf11NhooosxUx35MNAzUeTb1uMlO6NZaOLu").catch((reconnectError: unknown) => { console.error("Reconnect failed:", reconnectError) }) }, 5000) }) -action.connect(process.env.AUTH_TOKEN ?? "token_abc1234").catch((error: unknown) => { +action.connect(process.env.AUTH_TOKEN ?? "eioiN3UuNRXTNIcmoT01Gs4hVnsXhnf11NhooosxUx35MNAzUeTb1uMlO6NZaOLu").catch((error: unknown) => { console.error("Failed to connect:", error) process.exit(1) }) From 2e91e03143a7b1ff955e55d6d187640c4f3009f2 Mon Sep 17 00:00:00 2001 From: Marius Ahsmus Date: Tue, 15 Sep 2026 18:46:04 +0200 Subject: [PATCH 10/19] fix(github): up hercules version & add datatypes --- actions/github-action/package-lock.json | 8 ++++---- actions/github-action/package.json | 2 +- actions/github-action/src/index.ts | 25 ++++++++++++------------- 3 files changed, 17 insertions(+), 18 deletions(-) diff --git a/actions/github-action/package-lock.json b/actions/github-action/package-lock.json index 9ee5c21..88633b9 100644 --- a/actions/github-action/package-lock.json +++ b/actions/github-action/package-lock.json @@ -8,7 +8,7 @@ "name": "@code0-tech/github-action", "version": "1.0.0", "dependencies": { - "@code0-tech/hercules": "^1.3.0", + "@code0-tech/hercules": "^1.5.0", "axios": "^1.7.7" }, "devDependencies": { @@ -45,9 +45,9 @@ } }, "node_modules/@code0-tech/hercules": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@code0-tech/hercules/-/hercules-1.3.0.tgz", - "integrity": "sha512-RDucDMkFJjZqktIqw+CcEPjKv8lEwZ9l+cCmkPD/rsFiYc5s2zk2YjOIsq61Oj5VyNjORc7m3ElP17cHig9n8w==", + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@code0-tech/hercules/-/hercules-1.5.0.tgz", + "integrity": "sha512-fbOLddG9komz0u8ZR9MiROA16y8e5WOsULk/CdDkLC/TgKIwgezyM9sM5ZFmceQk0baU9Lvz4KcTLKrbJZHUDA==", "license": "ISC", "bin": { "hercules": "bin/hercules.js" diff --git a/actions/github-action/package.json b/actions/github-action/package.json index dfa9c22..56bae7f 100644 --- a/actions/github-action/package.json +++ b/actions/github-action/package.json @@ -13,7 +13,7 @@ "start": "node dist/index.js" }, "dependencies": { - "@code0-tech/hercules": "^1.3.0", + "@code0-tech/hercules": "^1.5.0", "axios": "^1.7.7" }, "devDependencies": { diff --git a/actions/github-action/src/index.ts b/actions/github-action/src/index.ts index 097407c..909a463 100644 --- a/actions/github-action/src/index.ts +++ b/actions/github-action/src/index.ts @@ -104,11 +104,11 @@ import { GitHubPullRequestClosedWebhook } from "./events/githubPullRequestClosed import { GitHubIssueOpenedWebhook } from "./events/githubIssueOpenedWebhook.js" import { GitHubIssueClosedWebhook } from "./events/githubIssueClosedWebhook.js" -// import { GitHubPushWebhookPayloadDataType } from "./data_types/webhooks/githubPush.js" -// import { GitHubIssueClosedWebhookPayloadDataType } from "./data_types/webhooks/githubIssueClosedWebhookPayload.js" -// import { GitHubIssueOpenedWebhookPayloadDataType } from "./data_types/webhooks/githubIssueOpenedWebhookPayload.js" -// import { GitHubPullRequestClosedWebhookPayloadDataType } from "./data_types/webhooks/githubPullRequestClosedWebhookPayload.js" -// import { GitHubPullRequestOpenedWebhookPayloadDataType } from "./data_types/webhooks/githubPullRequestOpenedWebhookPayload.js" +import { GitHubPushWebhookPayloadDataType } from "./data_types/webhooks/githubPush.js" +import { GitHubIssueClosedWebhookPayloadDataType } from "./data_types/webhooks/githubIssueClosedWebhookPayload.js" +import { GitHubIssueOpenedWebhookPayloadDataType } from "./data_types/webhooks/githubIssueOpenedWebhookPayload.js" +import { GitHubPullRequestClosedWebhookPayloadDataType } from "./data_types/webhooks/githubPullRequestClosedWebhookPayload.js" +import { GitHubPullRequestOpenedWebhookPayloadDataType } from "./data_types/webhooks/githubPullRequestOpenedWebhookPayload.js" const action = new Action( process.env.ACTION_ID ?? "github-action", @@ -186,12 +186,11 @@ action.registerDataTypeClass(GitHubUpdatePullRequestRequestDataType) action.registerDataTypeClass(GitHubCreatePullRequestReviewRequestDataType) action.registerDataTypeClass(GitHubSubmitPullRequestReviewRequestDataType) action.registerDataTypeClass(GitHubDismissPullRequestReviewRequestDataType) - -// action.registerDataTypeClass(GitHubPushWebhookPayloadDataType) -// action.registerDataTypeClass(GitHubIssueOpenedWebhookPayloadDataType) -// action.registerDataTypeClass(GitHubIssueClosedWebhookPayloadDataType) -// action.registerDataTypeClass(GitHubPullRequestOpenedWebhookPayloadDataType) -// action.registerDataTypeClass(GitHubPullRequestClosedWebhookPayloadDataType) +action.registerDataTypeClass(GitHubPushWebhookPayloadDataType) +action.registerDataTypeClass(GitHubIssueOpenedWebhookPayloadDataType) +action.registerDataTypeClass(GitHubIssueClosedWebhookPayloadDataType) +action.registerDataTypeClass(GitHubPullRequestOpenedWebhookPayloadDataType) +action.registerDataTypeClass(GitHubPullRequestClosedWebhookPayloadDataType) action.registerRuntimeFunction(GetRepositoryFunction) action.registerRuntimeFunction(GetRepositoryBranchesFunction) @@ -270,13 +269,13 @@ action.on(CodeZeroEvent.error, (error: Error) => { console.log("Attempting to reconnect in 5s...") setTimeout(() => { - action.connect(process.env.AUTH_TOKEN ?? "eioiN3UuNRXTNIcmoT01Gs4hVnsXhnf11NhooosxUx35MNAzUeTb1uMlO6NZaOLu").catch((reconnectError: unknown) => { + action.connect(process.env.AUTH_TOKEN ?? "LbB9OjWWNyug7haCCjP59tOwNRK1FS4Y6wdSYKOhxQddDppRjDX8zCQN1JX1KsUo").catch((reconnectError: unknown) => { console.error("Reconnect failed:", reconnectError) }) }, 5000) }) -action.connect(process.env.AUTH_TOKEN ?? "eioiN3UuNRXTNIcmoT01Gs4hVnsXhnf11NhooosxUx35MNAzUeTb1uMlO6NZaOLu").catch((error: unknown) => { +action.connect(process.env.AUTH_TOKEN ?? "LbB9OjWWNyug7haCCjP59tOwNRK1FS4Y6wdSYKOhxQddDppRjDX8zCQN1JX1KsUo").catch((error: unknown) => { console.error("Failed to connect:", error) process.exit(1) }) From ce39fbe1debae2133984355de96faeccb5c45d2c Mon Sep 17 00:00:00 2001 From: nicosammito Date: Sat, 24 Oct 2026 15:53:08 +0200 Subject: [PATCH 11/19] feat: update package-lock.json to include peer dependencies and version updates --- actions/github-action/package-lock.json | 288 +++++++----------------- actions/github-action/package.json | 2 +- 2 files changed, 77 insertions(+), 213 deletions(-) diff --git a/actions/github-action/package-lock.json b/actions/github-action/package-lock.json index 88633b9..3e28217 100644 --- a/actions/github-action/package-lock.json +++ b/actions/github-action/package-lock.json @@ -8,7 +8,7 @@ "name": "@code0-tech/github-action", "version": "1.0.0", "dependencies": { - "@code0-tech/hercules": "^1.5.0", + "@code0-tech/hercules": "^1.6.0", "axios": "^1.7.7" }, "devDependencies": { @@ -26,7 +26,6 @@ "resolved": "https://registry.npmjs.org/@clack/core/-/core-1.0.0-alpha.4.tgz", "integrity": "sha512-VCtU+vjyKPMSakVrB9q1bOnXN7QW/w4+YQDQCOF59GrzydW+169i0fVx/qzRRXJgt8KGj/pZZ/JxXroFZIDByg==", "license": "MIT", - "peer": true, "dependencies": { "picocolors": "^1.0.0", "sisteransi": "^1.0.5" @@ -37,7 +36,6 @@ "resolved": "https://registry.npmjs.org/@clack/prompts/-/prompts-1.0.0-alpha.4.tgz", "integrity": "sha512-KnmtDF2xQGoI5AlBme9akHtvCRV0RKAARUXHBQO2tMwnY8B08/4zPWigT7uLK25UPrMCEqnyQPkKRjNdhPbf8g==", "license": "MIT", - "peer": true, "dependencies": { "@clack/core": "1.0.0-alpha.4", "picocolors": "^1.0.0", @@ -45,9 +43,9 @@ } }, "node_modules/@code0-tech/hercules": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/@code0-tech/hercules/-/hercules-1.5.0.tgz", - "integrity": "sha512-fbOLddG9komz0u8ZR9MiROA16y8e5WOsULk/CdDkLC/TgKIwgezyM9sM5ZFmceQk0baU9Lvz4KcTLKrbJZHUDA==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@code0-tech/hercules/-/hercules-1.6.0.tgz", + "integrity": "sha512-1Ed4RcLdjFuTLUHuYP5yu3nQpHQDiE8gg0d4ZYFt/gRbKfHTPhmwxZ/V/Rj0Y0BxLLooIdc8bNKa2UgDxK+aqw==", "license": "ISC", "bin": { "hercules": "bin/hercules.js" @@ -73,33 +71,10 @@ "license": "MIT", "peer": true }, - "node_modules/@emnapi/core": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@emnapi/core/-/core-1.11.1.tgz", - "integrity": "sha512-RSvbQmHzdKzNsLYa/wHrbc3KN4sYLKAdPZxqiM2HATqv/SBk2/ENSHpvXGaLOMcsAyz0poEGqkmmKYG3OWiJEQ==", - "dev": true, - "license": "MIT", - "optional": true, - "dependencies": { - "@emnapi/wasi-threads": "1.2.2", - "tslib": "^2.4.0" - } - }, - "node_modules/@emnapi/runtime": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.11.1.tgz", - "integrity": "sha512-vgj7R3y3Wgx24IQaGPA/R6YFXLHVMOZ0uVEyIQPaWs+rd1AzfEMXlAC22FYwO1XkKR6NPsq7mUandH8oIRdZFw==", - "dev": true, - "license": "MIT", - "optional": true, - "dependencies": { - "tslib": "^2.4.0" - } - }, "node_modules/@emnapi/wasi-threads": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/@emnapi/wasi-threads/-/wasi-threads-1.2.2.tgz", - "integrity": "sha512-c95qOXkHdydNKhscBTebqEC1CVAZpyqOfVfBzQ1qgzyl3gfeldUjIggDbIZgDKsHLgnsM+igH7TJ/eAasaVuMA==", + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/@emnapi/wasi-threads/-/wasi-threads-1.2.3.tgz", + "integrity": "sha512-ELEBe8PsLvvJ6QMr0zLt8ffvOHW/dc1m3CEzNMg7aJUv3bMaoDtw2TXyDAwkYBuroxxuHEwhRTLJSe5sya547g==", "dev": true, "license": "MIT", "optional": true, @@ -568,7 +543,6 @@ "resolved": "https://registry.npmjs.org/@grpc/proto-loader/-/proto-loader-0.8.1.tgz", "integrity": "sha512-wtF6h+DY6M3YaDBPAmvuuA6jV8Sif9MjtOI5euKFWRgCDl5PeDpPsHR9u2l6St5ceY8AZgoNDww5+HvEsXFsGg==", "license": "Apache-2.0", - "peer": true, "dependencies": { "lodash.camelcase": "^4.3.0", "long": "^5.0.0", @@ -594,7 +568,6 @@ "resolved": "https://registry.npmjs.org/@js-sdsl/ordered-map/-/ordered-map-4.4.2.tgz", "integrity": "sha512-iUKgm52T8HOE/makSxjqoWhe95ZJA1/G1sYsGev2JDKUSS14KAgg1LHb+Ba+IPow0xflbnSkOsZcO08C7w1gYw==", "license": "MIT", - "peer": true, "funding": { "type": "opencollective", "url": "https://opencollective.com/js-sdsl" @@ -624,7 +597,6 @@ "resolved": "https://registry.npmjs.org/@oclif/core/-/core-4.11.14.tgz", "integrity": "sha512-cZ5Ktd+rT0PO+o7KBH4vRFTgg+xMLf8F41WK39p8MkXEViZA/Qqe+4lzZT6102zgUxMORET1HtF9t5w8CB3tnQ==", "license": "MIT", - "peer": true, "dependencies": { "ansi-escapes": "^4.3.2", "ansis": "^3.17.0", @@ -732,36 +704,31 @@ "version": "1.1.2", "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz", "integrity": "sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ==", - "license": "BSD-3-Clause", - "peer": true + "license": "BSD-3-Clause" }, "node_modules/@protobufjs/base64": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz", "integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==", - "license": "BSD-3-Clause", - "peer": true + "license": "BSD-3-Clause" }, "node_modules/@protobufjs/codegen": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.5.tgz", "integrity": "sha512-zgXFLzW3Ap33e6d0Wlj4MGIm6Ce8O89n/apUaGNB/jx+hw+ruWEp7EwGUshdLKVRCxZW12fp9r40E1mQrf/34g==", - "license": "BSD-3-Clause", - "peer": true + "license": "BSD-3-Clause" }, "node_modules/@protobufjs/eventemitter": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.1.tgz", "integrity": "sha512-vW1GmwMZNnL+gMRaovlh9yZX74kc+TTU3FObkkurpMaRtBfLP3ldjS9KQWlwZgraRE0+dheEEoAxdzcJQ8eXZg==", - "license": "BSD-3-Clause", - "peer": true + "license": "BSD-3-Clause" }, "node_modules/@protobufjs/fetch": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.1.tgz", "integrity": "sha512-GpptLrs57adMSuHi3VNj0mAF8dwh36LMaYF6XyJ6JMWlVsc+t42tm1HSEDmOs3A8fC9yyeisgLhsTVQokOZ0zw==", "license": "BSD-3-Clause", - "peer": true, "dependencies": { "@protobufjs/aspromise": "^1.1.1" } @@ -770,29 +737,25 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz", "integrity": "sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ==", - "license": "BSD-3-Clause", - "peer": true + "license": "BSD-3-Clause" }, "node_modules/@protobufjs/path": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz", "integrity": "sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA==", - "license": "BSD-3-Clause", - "peer": true + "license": "BSD-3-Clause" }, "node_modules/@protobufjs/pool": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz", "integrity": "sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw==", - "license": "BSD-3-Clause", - "peer": true + "license": "BSD-3-Clause" }, "node_modules/@protobufjs/utf8": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.1.tgz", "integrity": "sha512-oOAWABowe8EAbMyWKM0tYDKi8Yaox52D+HWZhAIJqQXbqe0xI/GV7FhLWqlEKreMkfDjshR5FKgi3mnle0h6Eg==", - "license": "BSD-3-Clause", - "peer": true + "license": "BSD-3-Clause" }, "node_modules/@rolldown/binding-android-arm64": { "version": "1.1.4", @@ -887,9 +850,6 @@ "arm64" ], "dev": true, - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -907,9 +867,6 @@ "arm64" ], "dev": true, - "libc": [ - "musl" - ], "license": "MIT", "optional": true, "os": [ @@ -927,9 +884,6 @@ "ppc64" ], "dev": true, - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -947,9 +901,6 @@ "s390x" ], "dev": true, - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -967,9 +918,6 @@ "x64" ], "dev": true, - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -987,9 +935,6 @@ "x64" ], "dev": true, - "libc": [ - "musl" - ], "license": "MIT", "optional": true, "os": [ @@ -1035,6 +980,40 @@ "node": "^20.19.0 || >=22.12.0" } }, + "node_modules/@rolldown/binding-wasm32-wasi/node_modules/@emnapi/core": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@emnapi/core/-/core-1.11.1.tgz", + "integrity": "sha512-RSvbQmHzdKzNsLYa/wHrbc3KN4sYLKAdPZxqiM2HATqv/SBk2/ENSHpvXGaLOMcsAyz0poEGqkmmKYG3OWiJEQ==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "@emnapi/wasi-threads": "1.2.2", + "tslib": "^2.4.0" + } + }, + "node_modules/@rolldown/binding-wasm32-wasi/node_modules/@emnapi/runtime": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.11.1.tgz", + "integrity": "sha512-vgj7R3y3Wgx24IQaGPA/R6YFXLHVMOZ0uVEyIQPaWs+rd1AzfEMXlAC22FYwO1XkKR6NPsq7mUandH8oIRdZFw==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, + "node_modules/@rolldown/binding-wasm32-wasi/node_modules/@emnapi/wasi-threads": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/@emnapi/wasi-threads/-/wasi-threads-1.2.2.tgz", + "integrity": "sha512-c95qOXkHdydNKhscBTebqEC1CVAZpyqOfVfBzQ1qgzyl3gfeldUjIggDbIZgDKsHLgnsM+igH7TJ/eAasaVuMA==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, "node_modules/@rolldown/binding-win32-arm64-msvc": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.1.4.tgz", @@ -1088,7 +1067,6 @@ "resolved": "https://registry.npmjs.org/@ts-morph/common/-/common-0.29.0.tgz", "integrity": "sha512-35oUmphHbJvQ/+UTwFNme/t2p3FoKiGJ5auTjjpNTop2dyREspirjMy82PLSC1pnDJ8ah1GU98hwpVt64YXQsg==", "license": "MIT", - "peer": true, "dependencies": { "minimatch": "^10.0.1", "path-browserify": "^1.0.1", @@ -1145,7 +1123,6 @@ "resolved": "https://registry.npmjs.org/@typescript/vfs/-/vfs-1.6.4.tgz", "integrity": "sha512-PJFXFS4ZJKiJ9Qiuix6Dz/OwEIqHD7Dme1UwZhTK11vR+5dqW2ACbdndWQexBzCx+CPuMe5WBYQWCsFyGlQLlQ==", "license": "MIT", - "peer": true, "dependencies": { "debug": "^4.4.3" }, @@ -1283,7 +1260,6 @@ "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", "license": "MIT", - "peer": true, "dependencies": { "type-fest": "^0.21.3" }, @@ -1299,7 +1275,6 @@ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.2.2.tgz", "integrity": "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==", "license": "MIT", - "peer": true, "engines": { "node": ">=12" }, @@ -1312,7 +1287,6 @@ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.3.tgz", "integrity": "sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg==", "license": "MIT", - "peer": true, "engines": { "node": ">=12" }, @@ -1325,7 +1299,6 @@ "resolved": "https://registry.npmjs.org/ansis/-/ansis-3.17.0.tgz", "integrity": "sha512-0qWUglt9JEqLFr3w1I1pbrChn1grhaiAR2ocX1PP/flRmxgtwTzPFFFnfIlD6aMOLQZgSuCRlidD70lvx8yhzg==", "license": "ISC", - "peer": true, "engines": { "node": ">=14" } @@ -1344,8 +1317,7 @@ "version": "3.2.6", "resolved": "https://registry.npmjs.org/async/-/async-3.2.6.tgz", "integrity": "sha512-htCUDlxyyCLMgaM3xXg0C0LW2xqfuQ6p05pCEIsXuyQ+a1koYKTuBMzRNwmybfLgvJDMd0r1LTn4+E0Ti6C2AA==", - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/asynckit": { "version": "0.4.0", @@ -1370,7 +1342,6 @@ "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz", "integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==", "license": "MIT", - "peer": true, "engines": { "node": "18 || 20 || >=22" } @@ -1380,7 +1351,6 @@ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.7.tgz", "integrity": "sha512-7oFy703dxfY3/NLxC1fh2SUCQ0H9rmAY+5EpDVfXjUTTs+HEwR2nYaqLv+GWcTsumwxPfiz6CzCNkwXwBUwqCA==", "license": "MIT", - "peer": true, "dependencies": { "balanced-match": "^4.0.2" }, @@ -1416,7 +1386,6 @@ "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.3.tgz", "integrity": "sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==", "license": "MIT", - "peer": true, "dependencies": { "readdirp": "^4.0.1" }, @@ -1432,7 +1401,6 @@ "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-3.0.1.tgz", "integrity": "sha512-lR9wNiMRcVQjSB3a7xXGLuz4cr4wJuuXlaAEbRutGowQTmlp7R72/DOgN21e8jdwblMWl9UOJMJXarX94pzKdg==", "license": "MIT", - "peer": true, "dependencies": { "escape-string-regexp": "4.0.0" }, @@ -1448,7 +1416,6 @@ "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-5.0.0.tgz", "integrity": "sha512-aCj4O5wKyszjMmDT4tZj93kxyydN/K5zPWSCe6/0AV/AA1pqe5ZBIw0a2ZfPQV7lL5/yb5HsUreJ6UFAF1tEQw==", "license": "MIT", - "peer": true, "dependencies": { "restore-cursor": "^5.0.0" }, @@ -1464,7 +1431,6 @@ "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.9.2.tgz", "integrity": "sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg==", "license": "MIT", - "peer": true, "engines": { "node": ">=6" }, @@ -1477,7 +1443,6 @@ "resolved": "https://registry.npmjs.org/cli-truncate/-/cli-truncate-5.2.0.tgz", "integrity": "sha512-xRwvIOMGrfOAnM1JYtqQImuaNtDEv9v6oIYAs4LIHwTiKee8uwvIi363igssOC0O5U04i4AlENs79LQLu9tEMw==", "license": "MIT", - "peer": true, "dependencies": { "slice-ansi": "^8.0.0", "string-width": "^8.2.0" @@ -1494,7 +1459,6 @@ "resolved": "https://registry.npmjs.org/string-width/-/string-width-8.2.1.tgz", "integrity": "sha512-IIaP0g3iy9Cyy18w3M9YcaDudujEAVHKt3a3QJg1+sr/oX96TbaGUubG0hJyCjCBThFH+tFpcIyoUHUn1ogaLA==", "license": "MIT", - "peer": true, "dependencies": { "get-east-asian-width": "^1.5.0", "strip-ansi": "^7.1.2" @@ -1511,7 +1475,6 @@ "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", "license": "ISC", - "peer": true, "dependencies": { "string-width": "^4.2.0", "strip-ansi": "^6.0.1", @@ -1526,7 +1489,6 @@ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "license": "MIT", - "peer": true, "engines": { "node": ">=8" } @@ -1536,7 +1498,6 @@ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "license": "MIT", - "peer": true, "dependencies": { "ansi-regex": "^5.0.1" }, @@ -1548,15 +1509,13 @@ "version": "13.0.3", "resolved": "https://registry.npmjs.org/code-block-writer/-/code-block-writer-13.0.3.tgz", "integrity": "sha512-Oofo0pq3IKnsFtuHqSF7TqBfr71aeyZDVJ0HpmqB7FBM2qEigL0iPONSCZSO9pE9dZTAxANe5XHG9Uy0YMv8cg==", - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/color-convert": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "license": "MIT", - "peer": true, "dependencies": { "color-name": "~1.1.4" }, @@ -1568,15 +1527,13 @@ "version": "1.1.4", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/colorette": { "version": "2.0.20", "resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.20.tgz", "integrity": "sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==", - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/combined-stream": { "version": "1.0.8", @@ -1652,7 +1609,6 @@ "resolved": "https://registry.npmjs.org/ejs/-/ejs-3.1.10.tgz", "integrity": "sha512-UeJmFfOrAQS8OJWPZ4qtgHyWExa088/MtK5UEyoJGFH67cDEXkZSviOiKRCZ4Xij0zxI3JECgYs3oKx+AizQBA==", "license": "Apache-2.0", - "peer": true, "dependencies": { "jake": "^10.8.5" }, @@ -1667,15 +1623,13 @@ "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/environment": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/environment/-/environment-1.1.0.tgz", "integrity": "sha512-xUtoPkMggbz0MPyPiIWr1Kp4aeWJjDZ6SMvURhimjdZgsRuDplF5/s9hcgGhyXMhs+6vpnuoiZ2kFiu3FMnS8Q==", "license": "MIT", - "peer": true, "engines": { "node": ">=18" }, @@ -1782,7 +1736,6 @@ "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", "license": "MIT", - "peer": true, "engines": { "node": ">=6" } @@ -1792,7 +1745,6 @@ "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", "license": "MIT", - "peer": true, "engines": { "node": ">=10" }, @@ -1814,8 +1766,7 @@ "version": "5.0.4", "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.4.tgz", "integrity": "sha512-mlsTRyGaPBjPedk6Bvw+aqbsXDtoAyAzm5MO7JgU+yVRyMQ5O8bD4Kcci7BS85f93veegeCPkL8R4GLClnjLFw==", - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/expect-type": { "version": "1.4.0", @@ -1849,7 +1800,6 @@ "resolved": "https://registry.npmjs.org/filelist/-/filelist-1.0.6.tgz", "integrity": "sha512-5giy2PkLYY1cP39p17Ech+2xlpTRL9HLspOfEgm0L6CwBXBTgsK5ou0JtzYuepxkaQ/tvhCFIJ5uXo0OrM2DxA==", "license": "Apache-2.0", - "peer": true, "dependencies": { "minimatch": "^5.0.1" } @@ -1858,15 +1808,13 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/filelist/node_modules/brace-expansion": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.1.1.tgz", "integrity": "sha512-WR1cURNjuvBLMZBMbqM0UoE+WAfdUcEV1ccD8PVBVOI+Z3ND4+SZbN8RsfT2bMuG1qwz5RFvPukSZm5fF2D5eA==", "license": "MIT", - "peer": true, "dependencies": { "balanced-match": "^1.0.0" } @@ -1876,7 +1824,6 @@ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.9.tgz", "integrity": "sha512-7o1wEA2RyMP7Iu7GNba9vc0RWWGACJOCZBJX2GJWip0ikV+wcOsgVuY9uE8CPiyQhkGFSlhuSkZPavN7u1c2Fw==", "license": "ISC", - "peer": true, "dependencies": { "brace-expansion": "^2.0.1" }, @@ -1949,7 +1896,6 @@ "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", "license": "ISC", - "peer": true, "engines": { "node": "6.* || 8.* || >= 10.*" } @@ -1959,7 +1905,6 @@ "resolved": "https://registry.npmjs.org/get-east-asian-width/-/get-east-asian-width-1.6.0.tgz", "integrity": "sha512-QRbvDIbx6YklUe6RxeTeleMR0yv3cYH6PsPZHcnVn7xv7zO1BHN8r0XETu8n6Ye3Q+ahtSarc3WgtNWmehIBfA==", "license": "MIT", - "peer": true, "engines": { "node": ">=18" }, @@ -1996,7 +1941,6 @@ "resolved": "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz", "integrity": "sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==", "license": "MIT", - "peer": true, "engines": { "node": ">=8.0.0" } @@ -2031,7 +1975,6 @@ "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "license": "MIT", - "peer": true, "engines": { "node": ">=8" } @@ -2093,7 +2036,6 @@ "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", "license": "MIT", - "peer": true, "engines": { "node": ">=8" } @@ -2103,7 +2045,6 @@ "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.2.1.tgz", "integrity": "sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==", "license": "MIT", - "peer": true, "bin": { "is-docker": "cli.js" }, @@ -2119,7 +2060,6 @@ "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-5.1.0.tgz", "integrity": "sha512-5XHYaSyiqADb4RnZ1Bdad6cPp8Toise4TzEjcOYDHZkTCbKgiUl7WTUCpNWHuxmDt91wnsZBc9xinNzopv3JMQ==", "license": "MIT", - "peer": true, "dependencies": { "get-east-asian-width": "^1.3.1" }, @@ -2135,7 +2075,6 @@ "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz", "integrity": "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==", "license": "MIT", - "peer": true, "dependencies": { "is-docker": "^2.0.0" }, @@ -2148,7 +2087,6 @@ "resolved": "https://registry.npmjs.org/jake/-/jake-10.9.4.tgz", "integrity": "sha512-wpHYzhxiVQL+IV05BLE2Xn34zW1S223hvjtqk0+gsPrwd/8JNLXJgZZM/iPFsYc1xyphF+6M6EvdE5E9MBGkDA==", "license": "Apache-2.0", - "peer": true, "dependencies": { "async": "^3.2.6", "filelist": "^1.0.4", @@ -2304,9 +2242,6 @@ "arm64" ], "dev": true, - "libc": [ - "glibc" - ], "license": "MPL-2.0", "optional": true, "os": [ @@ -2328,9 +2263,6 @@ "arm64" ], "dev": true, - "libc": [ - "musl" - ], "license": "MPL-2.0", "optional": true, "os": [ @@ -2352,9 +2284,6 @@ "x64" ], "dev": true, - "libc": [ - "glibc" - ], "license": "MPL-2.0", "optional": true, "os": [ @@ -2376,9 +2305,6 @@ "x64" ], "dev": true, - "libc": [ - "musl" - ], "license": "MPL-2.0", "optional": true, "os": [ @@ -2439,7 +2365,6 @@ "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-3.1.3.tgz", "integrity": "sha512-/vlFKAoH5Cgt3Ie+JLhRbwOsCQePABiU3tJ1egGvyQ+33R/vcwM2Zl2QR/LzjsBeItPt3oSVXapn+m4nQDvpzw==", "license": "MIT", - "peer": true, "engines": { "node": ">=14" }, @@ -2452,7 +2377,6 @@ "resolved": "https://registry.npmjs.org/listr2/-/listr2-9.0.5.tgz", "integrity": "sha512-ME4Fb83LgEgwNw96RKNvKV4VTLuXfoKudAmm2lP8Kk87KaMK0/Xrx/aAkMWmT8mDb+3MlFDspfbCs7adjRxA2g==", "license": "MIT", - "peer": true, "dependencies": { "cli-truncate": "^5.0.0", "colorette": "^2.0.20", @@ -2469,15 +2393,13 @@ "version": "10.6.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.6.0.tgz", "integrity": "sha512-toUI84YS5YmxW219erniWD0CIVOo46xGKColeNQRgOzDorgBi1v4D71/OFzgD9GO2UGKIv1C3Sp8DAn0+j5w7A==", - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/listr2/node_modules/string-width": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/string-width/-/string-width-7.2.0.tgz", "integrity": "sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==", "license": "MIT", - "peer": true, "dependencies": { "emoji-regex": "^10.3.0", "get-east-asian-width": "^1.0.0", @@ -2495,7 +2417,6 @@ "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-9.0.2.tgz", "integrity": "sha512-42AtmgqjV+X1VpdOfyTGOYRi0/zsoLqtXQckTmqTeybT+BDIbM/Guxo7x3pE2vtpr1ok6xRqM9OpBe+Jyoqyww==", "license": "MIT", - "peer": true, "dependencies": { "ansi-styles": "^6.2.1", "string-width": "^7.0.0", @@ -2512,15 +2433,13 @@ "version": "4.3.0", "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz", "integrity": "sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==", - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/log-update": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/log-update/-/log-update-6.1.0.tgz", "integrity": "sha512-9ie8ItPR6tjY5uYJh8K/Zrv/RMZ5VOlOWvtZdEHYSTFKZfIBPQa9tOAEeAWhd+AnIneLJ22w5fjOYtoutpWq5w==", "license": "MIT", - "peer": true, "dependencies": { "ansi-escapes": "^7.0.0", "cli-cursor": "^5.0.0", @@ -2540,7 +2459,6 @@ "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-7.3.0.tgz", "integrity": "sha512-BvU8nYgGQBxcmMuEeUEmNTvrMVjJNSH7RgW24vXexN4Ven6qCvy4TntnvlnwnMLTVlcRQQdbRY8NKnaIoeWDNg==", "license": "MIT", - "peer": true, "dependencies": { "environment": "^1.0.0" }, @@ -2555,15 +2473,13 @@ "version": "10.6.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.6.0.tgz", "integrity": "sha512-toUI84YS5YmxW219erniWD0CIVOo46xGKColeNQRgOzDorgBi1v4D71/OFzgD9GO2UGKIv1C3Sp8DAn0+j5w7A==", - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/log-update/node_modules/slice-ansi": { "version": "7.1.2", "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-7.1.2.tgz", "integrity": "sha512-iOBWFgUX7caIZiuutICxVgX1SdxwAVFFKwt1EvMYYec/NWO5meOJ6K5uQxhrYBdQJne4KxiqZc+KptFOWFSI9w==", "license": "MIT", - "peer": true, "dependencies": { "ansi-styles": "^6.2.1", "is-fullwidth-code-point": "^5.0.0" @@ -2580,7 +2496,6 @@ "resolved": "https://registry.npmjs.org/string-width/-/string-width-7.2.0.tgz", "integrity": "sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==", "license": "MIT", - "peer": true, "dependencies": { "emoji-regex": "^10.3.0", "get-east-asian-width": "^1.0.0", @@ -2598,7 +2513,6 @@ "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-9.0.2.tgz", "integrity": "sha512-42AtmgqjV+X1VpdOfyTGOYRi0/zsoLqtXQckTmqTeybT+BDIbM/Guxo7x3pE2vtpr1ok6xRqM9OpBe+Jyoqyww==", "license": "MIT", - "peer": true, "dependencies": { "ansi-styles": "^6.2.1", "string-width": "^7.0.0", @@ -2615,8 +2529,7 @@ "version": "5.3.2", "resolved": "https://registry.npmjs.org/long/-/long-5.3.2.tgz", "integrity": "sha512-mNAgZ1GmyNhD7AuqnTG3/VQ26o760+ZYBPKjPvugO8+nLbYfX6TVpJPseBvopbdY+qpZ/lKUnmEc1LeZYS3QAA==", - "license": "Apache-2.0", - "peer": true + "license": "Apache-2.0" }, "node_modules/magic-string": { "version": "0.30.21", @@ -2663,7 +2576,6 @@ "resolved": "https://registry.npmjs.org/mimic-function/-/mimic-function-5.0.1.tgz", "integrity": "sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA==", "license": "MIT", - "peer": true, "engines": { "node": ">=18" }, @@ -2676,7 +2588,6 @@ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.5.tgz", "integrity": "sha512-MULkVLfKGYDFYejP07QOurDLLQpcjk7Fw+7jXS2R2czRQzR56yHRveU5NDJEOviH+hETZKSkIk5c+T23GjFUMg==", "license": "BlueOak-1.0.0", - "peer": true, "dependencies": { "brace-expansion": "^5.0.5" }, @@ -2731,7 +2642,6 @@ "resolved": "https://registry.npmjs.org/onetime/-/onetime-7.0.0.tgz", "integrity": "sha512-VXJjc87FScF88uafS3JllDgvAm+c/Slfz06lorj2uAY34rlUu0Nt+v8wreiImcrgAjjIHp1rXpTDlLOGw29WwQ==", "license": "MIT", - "peer": true, "dependencies": { "mimic-function": "^5.0.0" }, @@ -2746,8 +2656,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-1.0.1.tgz", "integrity": "sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==", - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/pathe": { "version": "2.0.3", @@ -2767,6 +2676,7 @@ "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.5.tgz", "integrity": "sha512-RvwwcruNjI1ncT5xRakeyS9Lf8lcItv34KD+aif+VH9kduAyfYBipGh12274xtenIPZ119/R9BdTBa8gAwSh0A==", "license": "MIT", + "peer": true, "engines": { "node": ">=12" }, @@ -2809,7 +2719,6 @@ "integrity": "sha512-RJJPTTpvFfHcWLkIa2JFWK4XvtSzS0yEWDmunqHXli1h3JlkbcQZXDZdcWxv+JK3Xsl5/UFDPZ0iGm7DAengYw==", "hasInstallScript": true, "license": "BSD-3-Clause", - "peer": true, "dependencies": { "@protobufjs/aspromise": "^1.1.2", "@protobufjs/base64": "^1.1.2", @@ -2841,7 +2750,6 @@ "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.1.2.tgz", "integrity": "sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==", "license": "MIT", - "peer": true, "engines": { "node": ">= 14.18.0" }, @@ -2862,7 +2770,6 @@ "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", "license": "MIT", - "peer": true, "engines": { "node": ">=0.10.0" } @@ -2872,7 +2779,6 @@ "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-5.1.0.tgz", "integrity": "sha512-oMA2dcrw6u0YfxJQXm342bFKX/E4sG9rbTzO9ptUcR/e8A33cHuvStiYOwH7fszkZlZ1z/ta9AAoPk2F4qIOHA==", "license": "MIT", - "peer": true, "dependencies": { "onetime": "^7.0.0", "signal-exit": "^4.1.0" @@ -2888,8 +2794,7 @@ "version": "1.4.1", "resolved": "https://registry.npmjs.org/rfdc/-/rfdc-1.4.1.tgz", "integrity": "sha512-q1b3N5QkRUWUl7iyylaaj3kOpIT0N2i9MqIEQXP73GVsN9cw3fdx8X63cEmWhJGi2PPCF23Ijp7ktmd39rawIA==", - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/rolldown": { "version": "1.1.4", @@ -2930,7 +2835,6 @@ "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.5.tgz", "integrity": "sha512-Y7/KDsb8LjooZpwaqGyulO6DQlksgCncchHGk+sZIY4SBvUocMBEFH5Ur1fI4dV+Jvl0w6cjvucaIi40puRioA==", "license": "ISC", - "peer": true, "bin": { "semver": "bin/semver.js" }, @@ -2950,7 +2854,6 @@ "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", "license": "ISC", - "peer": true, "engines": { "node": ">=14" }, @@ -2962,15 +2865,13 @@ "version": "1.0.5", "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz", "integrity": "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==", - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/slash": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/slash/-/slash-5.1.0.tgz", "integrity": "sha512-ZA6oR3T/pEyuqwMgAKT0/hAv8oAXckzbkmR0UkUosQ+Mc4RxGoJkRmwHgHufaenlyAgE1Mxgpdcrf75y6XcnDg==", "license": "MIT", - "peer": true, "engines": { "node": ">=14.16" }, @@ -2983,7 +2884,6 @@ "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-8.0.0.tgz", "integrity": "sha512-stxByr12oeeOyY2BlviTNQlYV5xOj47GirPr4yA1hE9JCtxfQN0+tVbkxwCtYDQWhEKWFHsEK48ORg5jrouCAg==", "license": "MIT", - "peer": true, "dependencies": { "ansi-styles": "^6.2.3", "is-fullwidth-code-point": "^5.1.0" @@ -3024,7 +2924,6 @@ "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "license": "MIT", - "peer": true, "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", @@ -3039,7 +2938,6 @@ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "license": "MIT", - "peer": true, "engines": { "node": ">=8" } @@ -3049,7 +2947,6 @@ "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", "license": "MIT", - "peer": true, "engines": { "node": ">=8" } @@ -3059,7 +2956,6 @@ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "license": "MIT", - "peer": true, "dependencies": { "ansi-regex": "^5.0.1" }, @@ -3072,7 +2968,6 @@ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.2.0.tgz", "integrity": "sha512-yDPMNjp4WyfYBkHnjIRLfca1i6KMyGCtsVgoKe/z1+6vukgaENdgGBZt+ZmKPc4gavvEZ5OgHfHdrazhgNyG7w==", "license": "MIT", - "peer": true, "dependencies": { "ansi-regex": "^6.2.2" }, @@ -3088,7 +2983,6 @@ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", "license": "MIT", - "peer": true, "dependencies": { "has-flag": "^4.0.0" }, @@ -3104,7 +2998,6 @@ "resolved": "https://registry.npmjs.org/text-camel-case/-/text-camel-case-1.2.11.tgz", "integrity": "sha512-2ZsM/gOlB1tyza+8lGLvs6gtPuZ9qEYuKPa+gwo38m65wkY4k323SK4hT7ku8r5wIKyspUYIWSk1aB9/Jjxr7A==", "license": "MIT", - "peer": true, "dependencies": { "text-pascal-case": "^1.2.11" } @@ -3114,7 +3007,6 @@ "resolved": "https://registry.npmjs.org/text-capital-case/-/text-capital-case-1.2.11.tgz", "integrity": "sha512-30A7B7+VUvevEmPE0xWK1Z2z0ncl/JTjSUBLfjpoXrkwuPpmNTVbjHShRTN3cX9GIuZn/P3jvR+TO9JiTZcl8A==", "license": "MIT", - "peer": true, "dependencies": { "text-no-case": "^1.2.11", "text-upper-case-first": "^1.2.11" @@ -3125,7 +3017,6 @@ "resolved": "https://registry.npmjs.org/text-case/-/text-case-1.2.11.tgz", "integrity": "sha512-LbdWNQeuXWbfav+pxBxvaefkziffMYeSA53BHp52cgJa9rjiC0dkjum9AKrH8iQWoQJ4InGPSGexLeerGFaZ1Q==", "license": "MIT", - "peer": true, "dependencies": { "text-camel-case": "^1.2.11", "text-capital-case": "^1.2.11", @@ -3154,7 +3045,6 @@ "resolved": "https://registry.npmjs.org/text-constant-case/-/text-constant-case-1.2.11.tgz", "integrity": "sha512-XnTBILsa7UpMWncUCchqIybZlg15FUcrlyNaWIJ8ybPy54qcoN513EXFswueyizuAgyJFXPCwwSFbSji6kw/Uw==", "license": "MIT", - "peer": true, "dependencies": { "text-no-case": "^1.2.11", "text-upper-case": "^1.2.11" @@ -3165,7 +3055,6 @@ "resolved": "https://registry.npmjs.org/text-dot-case/-/text-dot-case-1.2.11.tgz", "integrity": "sha512-7SLKiT45KZO0qad0+p+GvC0+F+6pZ851HJcTcBJiSF88HsK/e1qErlGLtVBT6hkTHIaAj48WfSyQr4lZRv1xJQ==", "license": "MIT", - "peer": true, "dependencies": { "text-no-case": "^1.2.11" } @@ -3175,7 +3064,6 @@ "resolved": "https://registry.npmjs.org/text-header-case/-/text-header-case-1.2.11.tgz", "integrity": "sha512-7OBHd2g7X+aH6rXMC3cANFh6yvhXjXkyumw2NaRwJRIk343pP2e1SQCTCfowPDmmi8wkZVqz1fdWNq5LwvcBOQ==", "license": "MIT", - "peer": true, "dependencies": { "text-capital-case": "^1.2.11" } @@ -3184,22 +3072,19 @@ "version": "1.2.11", "resolved": "https://registry.npmjs.org/text-is-lower-case/-/text-is-lower-case-1.2.11.tgz", "integrity": "sha512-dBqPAkNmX7eTM7ZbS3D/UBCQ5i9EXt5tujF2wIGGbZ1+aN8bY7Qda4mDpxgd6Hbzf/z10uQWRNzupl99wFQ8CQ==", - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/text-is-upper-case": { "version": "1.2.11", "resolved": "https://registry.npmjs.org/text-is-upper-case/-/text-is-upper-case-1.2.11.tgz", "integrity": "sha512-MZeUIYEYfKZ2FSeg0vnHCH4mHXLgGzes+iz2K+4BYnhnkEa2svKA1nNjQAqTUiVNHOPqPCuzmUr1LsyQZ73uyA==", - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/text-kebab-case": { "version": "1.2.11", "resolved": "https://registry.npmjs.org/text-kebab-case/-/text-kebab-case-1.2.11.tgz", "integrity": "sha512-RIg9iN6VwH+JrX9dFdm1nd1efPGR9LjNc0CiQz496sQETeKGkDEzxES/ZzxbkerrAL2DFEMGdLXckzDz1OEDBQ==", "license": "MIT", - "peer": true, "dependencies": { "text-no-case": "^1.2.11" } @@ -3208,22 +3093,19 @@ "version": "1.2.11", "resolved": "https://registry.npmjs.org/text-lower-case/-/text-lower-case-1.2.11.tgz", "integrity": "sha512-txTy6y0y8M23Lhf0mk8WcvXTqlf4OQ3AGnDsRB6o3uMNfIa0CJDol2s1PdKNa63rt5B2277zkZCCn6Xeq//big==", - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/text-lower-case-first": { "version": "1.2.11", "resolved": "https://registry.npmjs.org/text-lower-case-first/-/text-lower-case-first-1.2.11.tgz", "integrity": "sha512-QR483XLyuyIpq8tKu1ds3Q1jfsgfaa/p9rtoQKHe6Rv5ah9ic/SUzTGN0MQ7UIS9APADd8SUPn5TTh1Z2/ACyg==", - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/text-no-case": { "version": "1.2.11", "resolved": "https://registry.npmjs.org/text-no-case/-/text-no-case-1.2.11.tgz", "integrity": "sha512-wazS7FEq0Ct3aJzeE8MEMcSs0eW4+/X/fwdotv/rG66bLS+g1T0pa0gUsbBGjjLFs191AIXVIry+bYE0uaaBBQ==", "license": "MIT", - "peer": true, "dependencies": { "text-lower-case": "^1.2.11" } @@ -3233,7 +3115,6 @@ "resolved": "https://registry.npmjs.org/text-param-case/-/text-param-case-1.2.11.tgz", "integrity": "sha512-3EMMAMLSz/mJXOnATNnrS+dZAvghpq09VhOVYDOkUnbm5zlYc6iU5AZOKVDpiAVVllQ9P1h5IKVZzsEYrdIRGw==", "license": "MIT", - "peer": true, "dependencies": { "text-dot-case": "^1.2.11" } @@ -3243,7 +3124,6 @@ "resolved": "https://registry.npmjs.org/text-pascal-case/-/text-pascal-case-1.2.11.tgz", "integrity": "sha512-BNhQ1O/g/Q4dH5gPyLIJLDLDknl2dipBwV629ScsiZCKJaCLGXYhTXp23rp9Htg3O5OSSsiU3mqDKq+pBmwTSw==", "license": "MIT", - "peer": true, "dependencies": { "text-no-case": "^1.2.11" } @@ -3253,7 +3133,6 @@ "resolved": "https://registry.npmjs.org/text-path-case/-/text-path-case-1.2.11.tgz", "integrity": "sha512-FsJU4BmMdtLtmnBK/XRJPqTwLF8yFiTEClHjxlQjSAG5Xt9R4p6D1WNaM1CI2dG5Lr4rsFM4jiVC620m0AsRbw==", "license": "MIT", - "peer": true, "dependencies": { "text-dot-case": "^1.2.11" } @@ -3263,7 +3142,6 @@ "resolved": "https://registry.npmjs.org/text-sentence-case/-/text-sentence-case-1.2.11.tgz", "integrity": "sha512-ApiVsvdLy+Wb8x7mZRVuoy8VO12jJ22G2djVM3ZZbUhXVIkqGgHxmiXRwdhRPoWGojK9n53m7jviJgBVNdRn+g==", "license": "MIT", - "peer": true, "dependencies": { "text-no-case": "^1.2.11", "text-upper-case-first": "^1.2.11" @@ -3274,7 +3152,6 @@ "resolved": "https://registry.npmjs.org/text-snake-case/-/text-snake-case-1.2.11.tgz", "integrity": "sha512-NOEQvjyyVABB41SS8dUx423Y6hWS+Z4TrAAJg1xzCkOD3q9y0JtdJjCvCA1FWI8oDu+HiIOp/N446uDM8j54XQ==", "license": "MIT", - "peer": true, "dependencies": { "text-dot-case": "^1.2.11" } @@ -3283,15 +3160,13 @@ "version": "1.2.11", "resolved": "https://registry.npmjs.org/text-swap-case/-/text-swap-case-1.2.11.tgz", "integrity": "sha512-PBmC5xvZdDZ4suikydpeXH0s4JV2XHelMj9/OEXEbA3oLpdV2A+B4BspVDWVw7C2Gi5eCareqk/7EE8I1/WwgQ==", - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/text-title-case": { "version": "1.2.11", "resolved": "https://registry.npmjs.org/text-title-case/-/text-title-case-1.2.11.tgz", "integrity": "sha512-V1GZy0XlqdkYUQm0tqm1jqtYlXJqFVMreBCTUReOaz8d/JbozTSpZrcakIeV8+1bN7LsvfhPFhA5zREiax6YIA==", "license": "MIT", - "peer": true, "dependencies": { "text-no-case": "^1.2.11", "text-upper-case-first": "^1.2.11" @@ -3301,15 +3176,13 @@ "version": "1.2.11", "resolved": "https://registry.npmjs.org/text-upper-case/-/text-upper-case-1.2.11.tgz", "integrity": "sha512-BfTL7yB1YIRlVGNdZUvno013hOq2cRs07fDR2ApppOXRDuKrEmsLDEY82xXlDzQHELp0jexqkI+NeyPIl6MtMw==", - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/text-upper-case-first": { "version": "1.2.11", "resolved": "https://registry.npmjs.org/text-upper-case-first/-/text-upper-case-first-1.2.11.tgz", "integrity": "sha512-vgfbwKo8TEJbRsapR9LWWvIJRnv8u9aXVa6cyYOAQQmurCx54Cnt59x5fKdiq+hFaBJ51AbzCgMpbP3p65/pHQ==", - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/tinybench": { "version": "2.9.0", @@ -3399,7 +3272,6 @@ "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", "license": "MIT", - "peer": true, "dependencies": { "tslib": "^1.8.1" }, @@ -3414,8 +3286,7 @@ "version": "1.14.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", - "license": "0BSD", - "peer": true + "license": "0BSD" }, "node_modules/tsx": { "version": "4.22.5", @@ -3423,6 +3294,7 @@ "integrity": "sha512-F7JnSfPl5ASt6LqwWyUQ3T8BwN3q0eQEbFMYa2iRWaVQmmudo0d7fRmwM4O002gsvW1bs0yBYioutsAjqLJMvQ==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "esbuild": "~0.28.0" }, @@ -3441,7 +3313,6 @@ "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", "license": "(MIT OR CC0-1.0)", - "peer": true, "engines": { "node": ">=10" }, @@ -3454,6 +3325,7 @@ "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", "license": "Apache-2.0", + "peer": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -3474,6 +3346,7 @@ "integrity": "sha512-Ds+gBRbj0lwRO2Y5hwnUBdxSwlAve9LeRyU4sNnAr0ewW0gWF0n5bgXgUzbgZ49MV9BVUAQUFYVcDUcilUExMA==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "lightningcss": "^1.32.0", "picomatch": "^4.0.4", @@ -3658,7 +3531,6 @@ "resolved": "https://registry.npmjs.org/widest-line/-/widest-line-3.1.0.tgz", "integrity": "sha512-NsmoXalsWVDMGupxZ5R08ka9flZjjiLvHVAWYOKtiKM8ujtZWr9cRffak+uSE48+Ob8ObalXpwyeUiyDD6QFgg==", "license": "MIT", - "peer": true, "dependencies": { "string-width": "^4.0.0" }, @@ -3670,15 +3542,13 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", "integrity": "sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==", - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/wrap-ansi": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", "license": "MIT", - "peer": true, "dependencies": { "ansi-styles": "^4.0.0", "string-width": "^4.1.0", @@ -3696,7 +3566,6 @@ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "license": "MIT", - "peer": true, "engines": { "node": ">=8" } @@ -3706,7 +3575,6 @@ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "license": "MIT", - "peer": true, "dependencies": { "color-convert": "^2.0.1" }, @@ -3722,7 +3590,6 @@ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "license": "MIT", - "peer": true, "dependencies": { "ansi-regex": "^5.0.1" }, @@ -3735,7 +3602,6 @@ "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", "license": "ISC", - "peer": true, "engines": { "node": ">=10" } @@ -3745,7 +3611,6 @@ "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.3.tgz", "integrity": "sha512-GZtjxm/J/4TSxuL3FNYjCmLktBTnIw/rVmKSIyKeYAZpmJB2ig9VauCC5xsa82GNKVKDAqpOn3KVzNt0zmrU0g==", "license": "MIT", - "peer": true, "dependencies": { "cliui": "^8.0.1", "escalade": "^3.1.1", @@ -3764,7 +3629,6 @@ "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", "license": "ISC", - "peer": true, "engines": { "node": ">=12" } diff --git a/actions/github-action/package.json b/actions/github-action/package.json index 56bae7f..92a1904 100644 --- a/actions/github-action/package.json +++ b/actions/github-action/package.json @@ -13,7 +13,7 @@ "start": "node dist/index.js" }, "dependencies": { - "@code0-tech/hercules": "^1.5.0", + "@code0-tech/hercules": "^1.6.0", "axios": "^1.7.7" }, "devDependencies": { From f323be4e7954b2545f595e0a42f12b64e0da1ce5 Mon Sep 17 00:00:00 2001 From: nicosammito Date: Sun, 25 Oct 2026 16:59:16 +0100 Subject: [PATCH 12/19] refactor: remove obsolete test files for CI and issue functions --- .../ciAutomationFunctions.test.ts | 87 ------------------ .../dispatchWorkflowFunction.test.ts | 19 ---- .../issueCommentFunctions.test.ts | 59 ------------ .../issues/createIssueFunction.test.ts | 21 ----- .../functions/issues/getIssueFunction.test.ts | 42 --------- .../functions/issues/issueFunctions.test.ts | 91 ------------------- .../functions/labels/labelFunctions.test.ts | 73 --------------- .../milestones/milestoneFunctions.test.ts | 64 ------------- .../pullRequestReviewCommentFunctions.test.ts | 55 ----------- .../pullRequestReviewFunctions.test.ts | 58 ------------ .../mergePullRequestFunction.test.ts | 27 ------ .../pullRequests/pullRequestFunctions.test.ts | 67 -------------- .../releases/createReleaseFunction.test.ts | 21 ----- .../releases/releaseFunctions.test.ts | 54 ----------- .../repositories/createBranchFunction.test.ts | 24 ----- .../repositories/repositoryFunctions.test.ts | 73 --------------- actions/github-action/src/tests/testUtils.ts | 28 ------ 17 files changed, 863 deletions(-) delete mode 100644 actions/github-action/src/tests/functions/ciAutomation/ciAutomationFunctions.test.ts delete mode 100644 actions/github-action/src/tests/functions/ciAutomation/dispatchWorkflowFunction.test.ts delete mode 100644 actions/github-action/src/tests/functions/issueComments/issueCommentFunctions.test.ts delete mode 100644 actions/github-action/src/tests/functions/issues/createIssueFunction.test.ts delete mode 100644 actions/github-action/src/tests/functions/issues/getIssueFunction.test.ts delete mode 100644 actions/github-action/src/tests/functions/issues/issueFunctions.test.ts delete mode 100644 actions/github-action/src/tests/functions/labels/labelFunctions.test.ts delete mode 100644 actions/github-action/src/tests/functions/milestones/milestoneFunctions.test.ts delete mode 100644 actions/github-action/src/tests/functions/pullRequestReviewComments/pullRequestReviewCommentFunctions.test.ts delete mode 100644 actions/github-action/src/tests/functions/pullRequestReviews/pullRequestReviewFunctions.test.ts delete mode 100644 actions/github-action/src/tests/functions/pullRequests/mergePullRequestFunction.test.ts delete mode 100644 actions/github-action/src/tests/functions/pullRequests/pullRequestFunctions.test.ts delete mode 100644 actions/github-action/src/tests/functions/releases/createReleaseFunction.test.ts delete mode 100644 actions/github-action/src/tests/functions/releases/releaseFunctions.test.ts delete mode 100644 actions/github-action/src/tests/functions/repositories/createBranchFunction.test.ts delete mode 100644 actions/github-action/src/tests/functions/repositories/repositoryFunctions.test.ts delete mode 100644 actions/github-action/src/tests/testUtils.ts diff --git a/actions/github-action/src/tests/functions/ciAutomation/ciAutomationFunctions.test.ts b/actions/github-action/src/tests/functions/ciAutomation/ciAutomationFunctions.test.ts deleted file mode 100644 index 2231121..0000000 --- a/actions/github-action/src/tests/functions/ciAutomation/ciAutomationFunctions.test.ts +++ /dev/null @@ -1,87 +0,0 @@ -import { RuntimeError } from "@code0-tech/hercules" -import axios from "axios" -import { beforeEach, describe, expect, it, vi } from "vitest" -import { createMockContext, mockGitHubClient, resetGitHubClientMock } from "../../testUtils.js" -import { CancelWorkflowRunFunction } from "../../../functions/ciAutomation/cancelWorkflowRunFunction.js" -import { CreateCheckRunFunction } from "../../../functions/ciAutomation/createCheckRunFunction.js" -import { CreateCommitStatusFunction } from "../../../functions/ciAutomation/createCommitStatusFunction.js" -import { GetCommitStatusesFunction } from "../../../functions/ciAutomation/getCommitStatusesFunction.js" -import { GetWorkflowRunsFunction } from "../../../functions/ciAutomation/getWorkflowRunsFunction.js" -import { GetWorkflowsFunction } from "../../../functions/ciAutomation/getWorkflowsFunction.js" -import { RerunWorkflowRunFunction } from "../../../functions/ciAutomation/rerunWorkflowRunFunction.js" -import { UpdateCheckRunFunction } from "../../../functions/ciAutomation/updateCheckRunFunction.js" - -vi.mock("axios") - -describe("CI automation functions", () => { - beforeEach(resetGitHubClientMock) - - it("creates a commit status", async () => { - const data = { state: "success" as const } - mockGitHubClient.post.mockResolvedValueOnce({ data: { id: 1 } }) - - await new CreateCommitStatusFunction().run(createMockContext(), "owner", "repo", "abc", data) - - expect(mockGitHubClient.post).toHaveBeenCalledWith("/repos/owner/repo/statuses/abc", data) - }) - - it("gets commit statuses", async () => { - mockGitHubClient.get.mockResolvedValueOnce({ data: [{ id: 1 }] }) - - await new GetCommitStatusesFunction().run(createMockContext(), "owner", "repo", "main") - - expect(mockGitHubClient.get).toHaveBeenCalledWith("/repos/owner/repo/commits/main/statuses") - }) - - it("creates and updates check runs", async () => { - const createData = { name: "ci", head_sha: "abc" } - const updateData = { status: "completed" as const } - mockGitHubClient.post.mockResolvedValueOnce({ data: { id: 1 } }) - mockGitHubClient.patch.mockResolvedValueOnce({ data: { id: 1 } }) - - await new CreateCheckRunFunction().run(createMockContext(), "owner", "repo", createData) - await new UpdateCheckRunFunction().run(createMockContext(), "owner", "repo", 1, updateData) - - expect(mockGitHubClient.post).toHaveBeenCalledWith("/repos/owner/repo/check-runs", createData) - expect(mockGitHubClient.patch).toHaveBeenCalledWith("/repos/owner/repo/check-runs/1", updateData) - }) - - it("gets workflows", async () => { - mockGitHubClient.get.mockResolvedValueOnce({ data: { workflows: [{ id: 1 }] } }) - - await new GetWorkflowsFunction().run(createMockContext(), "owner", "repo", 2, 10) - - expect(mockGitHubClient.get).toHaveBeenCalledWith("/repos/owner/repo/actions/workflows", { - params: { page: 2, per_page: 10 }, - }) - }) - - it("gets workflow runs for repository and workflow", async () => { - mockGitHubClient.get.mockResolvedValue({ data: { workflow_runs: [{ id: 1 }] } }) - - await new GetWorkflowRunsFunction().run(createMockContext(), "owner", "repo") - await new GetWorkflowRunsFunction().run(createMockContext(), "owner", "repo", "deploy.yml", 2, 10) - - expect(mockGitHubClient.get).toHaveBeenNthCalledWith(1, "/repos/owner/repo/actions/runs", { - params: { page: 1, per_page: 30 }, - }) - expect(mockGitHubClient.get).toHaveBeenNthCalledWith(2, "/repos/owner/repo/actions/workflows/deploy.yml/runs", { - params: { page: 2, per_page: 10 }, - }) - }) - - it("reruns and cancels workflow runs", async () => { - mockGitHubClient.post.mockResolvedValue({ data: {} }) - - await new RerunWorkflowRunFunction().run(createMockContext(), "owner", "repo", 1) - await new CancelWorkflowRunFunction().run(createMockContext(), "owner", "repo", 1) - - expect(mockGitHubClient.post).toHaveBeenNthCalledWith(1, "/repos/owner/repo/actions/runs/1/rerun") - expect(mockGitHubClient.post).toHaveBeenNthCalledWith(2, "/repos/owner/repo/actions/runs/1/cancel") - }) - - it("rejects invalid workflow run ids", async () => { - await expect(new RerunWorkflowRunFunction().run(createMockContext(), "owner", "repo", 0)).rejects.toBeInstanceOf(RuntimeError) - expect(vi.mocked(axios.create)).toBeDefined() - }) -}) diff --git a/actions/github-action/src/tests/functions/ciAutomation/dispatchWorkflowFunction.test.ts b/actions/github-action/src/tests/functions/ciAutomation/dispatchWorkflowFunction.test.ts deleted file mode 100644 index bac2626..0000000 --- a/actions/github-action/src/tests/functions/ciAutomation/dispatchWorkflowFunction.test.ts +++ /dev/null @@ -1,19 +0,0 @@ -import axios from "axios" -import { beforeEach, describe, expect, it, vi } from "vitest" -import { createMockContext, mockGitHubClient, resetGitHubClientMock } from "../../testUtils.js" -import { DispatchWorkflowFunction } from "../../../functions/ciAutomation/dispatchWorkflowFunction.js" - -vi.mock("axios") - -describe("DispatchWorkflowFunction", () => { - beforeEach(resetGitHubClientMock) - - it("dispatches a workflow", async () => { - const data = { ref: "main", inputs: { environment: "prod" } } - mockGitHubClient.post.mockResolvedValueOnce({ data: {} }) - - await new DispatchWorkflowFunction().run(createMockContext(), "code0-tech", "centaurus", "deploy.yml", data) - - expect(mockGitHubClient.post).toHaveBeenCalledWith("/repos/code0-tech/centaurus/actions/workflows/deploy.yml/dispatches", data) - }) -}) diff --git a/actions/github-action/src/tests/functions/issueComments/issueCommentFunctions.test.ts b/actions/github-action/src/tests/functions/issueComments/issueCommentFunctions.test.ts deleted file mode 100644 index 4c4f02e..0000000 --- a/actions/github-action/src/tests/functions/issueComments/issueCommentFunctions.test.ts +++ /dev/null @@ -1,59 +0,0 @@ -import { RuntimeError } from "@code0-tech/hercules" -import axios from "axios" -import { beforeEach, describe, expect, it, vi } from "vitest" -import { createMockContext, mockGitHubClient, resetGitHubClientMock } from "../../testUtils.js" -import { CreateIssueCommentFunction } from "../../../functions/issueComments/createIssueCommentFunction.js" -import { DeleteIssueCommentFunction } from "../../../functions/issueComments/deleteIssueCommentFunction.js" -import { GetIssueCommentsFunction } from "../../../functions/issueComments/getIssueCommentsFunction.js" -import { UpdateIssueCommentFunction } from "../../../functions/issueComments/updateIssueCommentFunction.js" - -vi.mock("axios") - -describe("issue comment functions", () => { - beforeEach(resetGitHubClientMock) - - it("gets issue comments", async () => { - mockGitHubClient.get.mockResolvedValueOnce({ data: [{ id: 1 }] }) - - const result = await new GetIssueCommentsFunction().run(createMockContext(), "owner", "repo", 3, 2, 25) - - expect(mockGitHubClient.get).toHaveBeenCalledWith("/repos/owner/repo/issues/3/comments", { - params: { page: 2, per_page: 25 }, - }) - expect(result).toEqual([{ id: 1 }]) - }) - - it("creates an issue comment", async () => { - const data = { body: "hello" } - mockGitHubClient.post.mockResolvedValueOnce({ data: { id: 1, ...data } }) - - await new CreateIssueCommentFunction().run(createMockContext(), "owner", "repo", 3, data) - - expect(mockGitHubClient.post).toHaveBeenCalledWith("/repos/owner/repo/issues/3/comments", data) - }) - - it("updates an issue comment", async () => { - const data = { body: "updated" } - mockGitHubClient.patch.mockResolvedValueOnce({ data: { id: 9, ...data } }) - - await new UpdateIssueCommentFunction().run(createMockContext(), "owner", "repo", 9, data) - - expect(mockGitHubClient.patch).toHaveBeenCalledWith("/repos/owner/repo/issues/comments/9", data) - }) - - it("deletes an issue comment", async () => { - mockGitHubClient.delete.mockResolvedValueOnce({ data: {} }) - - await new DeleteIssueCommentFunction().run(createMockContext(), "owner", "repo", 9) - - expect(mockGitHubClient.delete).toHaveBeenCalledWith("/repos/owner/repo/issues/comments/9") - }) - - it("rejects invalid comment ids", async () => { - await expect(new DeleteIssueCommentFunction().run(createMockContext(), "owner", "repo", 0)).rejects.toBeInstanceOf(RuntimeError) - }) - - it("uses axios mock", () => { - expect(vi.mocked(axios.create)).toBeDefined() - }) -}) diff --git a/actions/github-action/src/tests/functions/issues/createIssueFunction.test.ts b/actions/github-action/src/tests/functions/issues/createIssueFunction.test.ts deleted file mode 100644 index 3cfedd2..0000000 --- a/actions/github-action/src/tests/functions/issues/createIssueFunction.test.ts +++ /dev/null @@ -1,21 +0,0 @@ -import axios from "axios" -import { beforeEach, describe, expect, it, vi } from "vitest" -import { createMockContext, mockGitHubClient, resetGitHubClientMock } from "../../testUtils.js" -import { CreateIssueFunction } from "../../../functions/issues/createIssueFunction.js" - -vi.mock("axios") - -describe("CreateIssueFunction", () => { - beforeEach(resetGitHubClientMock) - - it("creates an issue with request data", async () => { - const data = { title: "New issue", body: "Details" } - const issue = { id: 1, ...data } - mockGitHubClient.post.mockResolvedValueOnce({ data: issue }) - - const result = await new CreateIssueFunction().run(createMockContext(), "code0-tech", "centaurus", data) - - expect(mockGitHubClient.post).toHaveBeenCalledWith("/repos/code0-tech/centaurus/issues", data) - expect(result).toEqual(issue) - }) -}) diff --git a/actions/github-action/src/tests/functions/issues/getIssueFunction.test.ts b/actions/github-action/src/tests/functions/issues/getIssueFunction.test.ts deleted file mode 100644 index 9e335bb..0000000 --- a/actions/github-action/src/tests/functions/issues/getIssueFunction.test.ts +++ /dev/null @@ -1,42 +0,0 @@ -import { RuntimeError } from "@code0-tech/hercules" -import axios from "axios" -import { beforeEach, describe, expect, it, vi } from "vitest" -import { createMockContext, mockGitHubClient, resetGitHubClientMock } from "../../testUtils.js" -import { GetIssueFunction } from "../../../functions/issues/getIssueFunction.js" - -vi.mock("axios") - -describe("GetIssueFunction", () => { - beforeEach(resetGitHubClientMock) - - it("gets an issue by number", async () => { - const issue = { id: 1, number: 123, title: "Bug" } - mockGitHubClient.get.mockResolvedValueOnce({ data: issue }) - - const result = await new GetIssueFunction().run(createMockContext(), "code0-tech", "centaurus", 123) - - expect(axios.create).toHaveBeenCalledWith({ - baseURL: "https://api.github.test", - headers: { - Authorization: "Bearer test-token", - Accept: "application/vnd.github+json", - "X-GitHub-Api-Version": "2026-03-10", - }, - }) - expect(mockGitHubClient.get).toHaveBeenCalledWith("/repos/code0-tech/centaurus/issues/123") - expect(result).toEqual(issue) - }) - - it("encodes owner and repository", async () => { - mockGitHubClient.get.mockResolvedValueOnce({ data: { id: 1 } }) - - await new GetIssueFunction().run(createMockContext(), "code0 tech", "repo/name", 1) - - expect(mockGitHubClient.get).toHaveBeenCalledWith("/repos/code0%20tech/repo%2Fname/issues/1") - }) - - it("rejects invalid issue numbers", async () => { - await expect(new GetIssueFunction().run(createMockContext(), "code0-tech", "centaurus", 0)).rejects.toBeInstanceOf(RuntimeError) - expect(mockGitHubClient.get).not.toHaveBeenCalled() - }) -}) diff --git a/actions/github-action/src/tests/functions/issues/issueFunctions.test.ts b/actions/github-action/src/tests/functions/issues/issueFunctions.test.ts deleted file mode 100644 index efce21b..0000000 --- a/actions/github-action/src/tests/functions/issues/issueFunctions.test.ts +++ /dev/null @@ -1,91 +0,0 @@ -import { RuntimeError } from "@code0-tech/hercules" -import axios from "axios" -import { beforeEach, describe, expect, it, vi } from "vitest" -import { createMockContext, mockGitHubClient, resetGitHubClientMock } from "../../testUtils.js" -import { AddAssigneesToIssueFunction } from "../../../functions/issues/addAssigneesToIssueFunction.js" -import { AddAssigneeToIssueFunction } from "../../../functions/issues/addAssigneeToIssueFunction.js" -import { CloseIssueFunction } from "../../../functions/issues/closeIssueFunction.js" -import { GetIssuesFunction } from "../../../functions/issues/getIssuesFunction.js" -import { RemoveAssigneesFromIssueFunction } from "../../../functions/issues/removeAssigneesFromIssueFunction.js" -import { RemoveAssigneeFromIssueFunction } from "../../../functions/issues/removeAssigneeFromIssueFunction.js" -import { ReopenIssueFunction } from "../../../functions/issues/reopenIssueFunction.js" -import { UpdateIssueFunction } from "../../../functions/issues/updateIssueFunction.js" - -vi.mock("axios") - -describe("issue functions", () => { - beforeEach(resetGitHubClientMock) - - it("gets issues and filters pull requests out", async () => { - const issue = { id: 1, number: 1 } - mockGitHubClient.get.mockResolvedValueOnce({ data: [issue, { id: 2, pull_request: {} }] }) - - const result = await new GetIssuesFunction().run(createMockContext(), "owner", "repo", "all", 2, 50) - - expect(mockGitHubClient.get).toHaveBeenCalledWith("/repos/owner/repo/issues", { - params: { state: "all", page: 2, per_page: 50 }, - }) - expect(result).toEqual([issue]) - }) - - it("rejects invalid issues pagination", async () => { - await expect(new GetIssuesFunction().run(createMockContext(), "owner", "repo", "open", 0)).rejects.toBeInstanceOf(RuntimeError) - }) - - it("updates an issue", async () => { - const data = { title: "Updated" } - const issue = { id: 1, title: "Updated" } - mockGitHubClient.patch.mockResolvedValueOnce({ data: issue }) - - const result = await new UpdateIssueFunction().run(createMockContext(), "owner", "repo", 7, data) - - expect(mockGitHubClient.patch).toHaveBeenCalledWith("/repos/owner/repo/issues/7", data) - expect(result).toEqual(issue) - }) - - it("closes and reopens an issue", async () => { - mockGitHubClient.patch.mockResolvedValue({ data: { id: 1 } }) - - await new CloseIssueFunction().run(createMockContext(), "owner", "repo", 7) - await new ReopenIssueFunction().run(createMockContext(), "owner", "repo", 7) - - expect(mockGitHubClient.patch).toHaveBeenNthCalledWith(1, "/repos/owner/repo/issues/7", { state: "closed" }) - expect(mockGitHubClient.patch).toHaveBeenNthCalledWith(2, "/repos/owner/repo/issues/7", { state: "open" }) - }) - - it("adds one assignee to an issue", async () => { - mockGitHubClient.post.mockResolvedValueOnce({ data: { id: 1 } }) - - await new AddAssigneeToIssueFunction().run(createMockContext(), "owner", "repo", 7, "marius") - - expect(mockGitHubClient.post).toHaveBeenCalledWith("/repos/owner/repo/issues/7/assignees", { assignees: ["marius"] }) - }) - - it("adds and removes multiple assignees", async () => { - const data = { assignees: ["a", "b"] } - mockGitHubClient.post.mockResolvedValueOnce({ data: { id: 1 } }) - mockGitHubClient.delete.mockResolvedValueOnce({ data: { id: 1 } }) - - await new AddAssigneesToIssueFunction().run(createMockContext(), "owner", "repo", 7, data) - await new RemoveAssigneesFromIssueFunction().run(createMockContext(), "owner", "repo", 7, data) - - expect(mockGitHubClient.post).toHaveBeenCalledWith("/repos/owner/repo/issues/7/assignees", data) - expect(mockGitHubClient.delete).toHaveBeenCalledWith("/repos/owner/repo/issues/7/assignees", { data }) - }) - - it("removes one assignee from an issue", async () => { - mockGitHubClient.delete.mockResolvedValueOnce({ data: { id: 1 } }) - - await new RemoveAssigneeFromIssueFunction().run(createMockContext(), "owner", "repo", 7, "marius") - - expect(mockGitHubClient.delete).toHaveBeenCalledWith("/repos/owner/repo/issues/7/assignees", { data: { assignees: ["marius"] } }) - }) - - it("creates the configured axios GitHub client", async () => { - mockGitHubClient.patch.mockResolvedValueOnce({ data: { id: 1 } }) - - await new CloseIssueFunction().run(createMockContext(), "owner", "repo", 1) - - expect(axios.create).toHaveBeenCalled() - }) -}) diff --git a/actions/github-action/src/tests/functions/labels/labelFunctions.test.ts b/actions/github-action/src/tests/functions/labels/labelFunctions.test.ts deleted file mode 100644 index 9b2c519..0000000 --- a/actions/github-action/src/tests/functions/labels/labelFunctions.test.ts +++ /dev/null @@ -1,73 +0,0 @@ -import { RuntimeError } from "@code0-tech/hercules" -import axios from "axios" -import { beforeEach, describe, expect, it, vi } from "vitest" -import { createMockContext, mockGitHubClient, resetGitHubClientMock } from "../../testUtils.js" -import { AddLabelsToIssueFunction } from "../../../functions/labels/addLabelsToIssueFunction.js" -import { GetIssueLabelsFunction } from "../../../functions/labels/getIssueLabelsFunction.js" -import { GetLabelsFunction } from "../../../functions/labels/getLabelsFunction.js" -import { RemoveAllLabelsFromIssueFunction } from "../../../functions/labels/removeAllLabelsFromIssueFunction.js" -import { RemoveLabelFromIssueFunction } from "../../../functions/labels/removeLabelFromIssueFunction.js" -import { SetLabelsForIssueFunction } from "../../../functions/labels/setLabelsForIssueFunction.js" - -vi.mock("axios") - -describe("label functions", () => { - beforeEach(resetGitHubClientMock) - - it("gets repository labels", async () => { - mockGitHubClient.get.mockResolvedValueOnce({ data: [{ name: "bug" }] }) - - await new GetLabelsFunction().run(createMockContext(), "owner", "repo", 2, 10) - - expect(mockGitHubClient.get).toHaveBeenCalledWith("/repos/owner/repo/labels", { - params: { page: 2, per_page: 10 }, - }) - }) - - it("gets issue labels", async () => { - mockGitHubClient.get.mockResolvedValueOnce({ data: [{ name: "bug" }] }) - - await new GetIssueLabelsFunction().run(createMockContext(), "owner", "repo", 3) - - expect(mockGitHubClient.get).toHaveBeenCalledWith("/repos/owner/repo/issues/3/labels") - }) - - it("adds labels to an issue", async () => { - const data = { labels: ["bug"] } - mockGitHubClient.post.mockResolvedValueOnce({ data: [{ name: "bug" }] }) - - await new AddLabelsToIssueFunction().run(createMockContext(), "owner", "repo", 3, data) - - expect(mockGitHubClient.post).toHaveBeenCalledWith("/repos/owner/repo/issues/3/labels", data) - }) - - it("sets labels for an issue", async () => { - const data = { labels: ["bug"] } - mockGitHubClient.put.mockResolvedValueOnce({ data: [{ name: "bug" }] }) - - await new SetLabelsForIssueFunction().run(createMockContext(), "owner", "repo", 3, data) - - expect(mockGitHubClient.put).toHaveBeenCalledWith("/repos/owner/repo/issues/3/labels", data) - }) - - it("removes one label from an issue", async () => { - mockGitHubClient.delete.mockResolvedValueOnce({ data: [] }) - - await new RemoveLabelFromIssueFunction().run(createMockContext(), "owner", "repo", 3, "needs review") - - expect(mockGitHubClient.delete).toHaveBeenCalledWith("/repos/owner/repo/issues/3/labels/needs%20review") - }) - - it("removes all labels from an issue", async () => { - mockGitHubClient.delete.mockResolvedValueOnce({ data: {} }) - - await new RemoveAllLabelsFromIssueFunction().run(createMockContext(), "owner", "repo", 3) - - expect(mockGitHubClient.delete).toHaveBeenCalledWith("/repos/owner/repo/issues/3/labels") - }) - - it("rejects invalid issue numbers", async () => { - await expect(new GetIssueLabelsFunction().run(createMockContext(), "owner", "repo", 0)).rejects.toBeInstanceOf(RuntimeError) - expect(vi.mocked(axios.create)).toBeDefined() - }) -}) diff --git a/actions/github-action/src/tests/functions/milestones/milestoneFunctions.test.ts b/actions/github-action/src/tests/functions/milestones/milestoneFunctions.test.ts deleted file mode 100644 index 9054b14..0000000 --- a/actions/github-action/src/tests/functions/milestones/milestoneFunctions.test.ts +++ /dev/null @@ -1,64 +0,0 @@ -import { RuntimeError } from "@code0-tech/hercules" -import axios from "axios" -import { beforeEach, describe, expect, it, vi } from "vitest" -import { createMockContext, mockGitHubClient, resetGitHubClientMock } from "../../testUtils.js" -import { CreateMilestoneFunction } from "../../../functions/milestones/createMilestoneFunction.js" -import { DeleteMilestoneFunction } from "../../../functions/milestones/deleteMilestoneFunction.js" -import { GetMilestoneFunction } from "../../../functions/milestones/getMilestoneFunction.js" -import { GetMilestonesFunction } from "../../../functions/milestones/getMilestonesFunction.js" -import { UpdateMilestoneFunction } from "../../../functions/milestones/updateMilestoneFunction.js" - -vi.mock("axios") - -describe("milestone functions", () => { - beforeEach(resetGitHubClientMock) - - it("gets milestones", async () => { - mockGitHubClient.get.mockResolvedValueOnce({ data: [{ number: 1 }] }) - - await new GetMilestonesFunction().run(createMockContext(), "owner", "repo", "all", 2, 10) - - expect(mockGitHubClient.get).toHaveBeenCalledWith("/repos/owner/repo/milestones", { - params: { state: "all", page: 2, per_page: 10 }, - }) - }) - - it("gets one milestone", async () => { - mockGitHubClient.get.mockResolvedValueOnce({ data: { number: 1 } }) - - await new GetMilestoneFunction().run(createMockContext(), "owner", "repo", 1) - - expect(mockGitHubClient.get).toHaveBeenCalledWith("/repos/owner/repo/milestones/1") - }) - - it("creates a milestone", async () => { - const data = { title: "v1" } - mockGitHubClient.post.mockResolvedValueOnce({ data: { number: 1 } }) - - await new CreateMilestoneFunction().run(createMockContext(), "owner", "repo", data) - - expect(mockGitHubClient.post).toHaveBeenCalledWith("/repos/owner/repo/milestones", data) - }) - - it("updates a milestone", async () => { - const data = { title: "v2" } - mockGitHubClient.patch.mockResolvedValueOnce({ data: { number: 1 } }) - - await new UpdateMilestoneFunction().run(createMockContext(), "owner", "repo", 1, data) - - expect(mockGitHubClient.patch).toHaveBeenCalledWith("/repos/owner/repo/milestones/1", data) - }) - - it("deletes a milestone", async () => { - mockGitHubClient.delete.mockResolvedValueOnce({ data: {} }) - - await new DeleteMilestoneFunction().run(createMockContext(), "owner", "repo", 1) - - expect(mockGitHubClient.delete).toHaveBeenCalledWith("/repos/owner/repo/milestones/1") - }) - - it("rejects invalid milestone numbers", async () => { - await expect(new GetMilestoneFunction().run(createMockContext(), "owner", "repo", 0)).rejects.toBeInstanceOf(RuntimeError) - expect(vi.mocked(axios.create)).toBeDefined() - }) -}) diff --git a/actions/github-action/src/tests/functions/pullRequestReviewComments/pullRequestReviewCommentFunctions.test.ts b/actions/github-action/src/tests/functions/pullRequestReviewComments/pullRequestReviewCommentFunctions.test.ts deleted file mode 100644 index df2e3f3..0000000 --- a/actions/github-action/src/tests/functions/pullRequestReviewComments/pullRequestReviewCommentFunctions.test.ts +++ /dev/null @@ -1,55 +0,0 @@ -import { RuntimeError } from "@code0-tech/hercules" -import axios from "axios" -import { beforeEach, describe, expect, it, vi } from "vitest" -import { createMockContext, mockGitHubClient, resetGitHubClientMock } from "../../testUtils.js" -import { CreatePullRequestReviewCommentFunction } from "../../../functions/pullRequestReviewComments/createPullRequestReviewCommentFunction.js" -import { DeletePullRequestReviewCommentFunction } from "../../../functions/pullRequestReviewComments/deletePullRequestReviewCommentFunction.js" -import { GetPullRequestReviewCommentsFunction } from "../../../functions/pullRequestReviewComments/getPullRequestReviewCommentsFunction.js" -import { UpdatePullRequestReviewCommentFunction } from "../../../functions/pullRequestReviewComments/updatePullRequestReviewCommentFunction.js" - -vi.mock("axios") - -describe("pull request review comment functions", () => { - beforeEach(resetGitHubClientMock) - - it("gets pull request review comments", async () => { - mockGitHubClient.get.mockResolvedValueOnce({ data: [{ id: 1 }] }) - - await new GetPullRequestReviewCommentsFunction().run(createMockContext(), "owner", "repo", 5, 2, 10) - - expect(mockGitHubClient.get).toHaveBeenCalledWith("/repos/owner/repo/pulls/5/comments", { - params: { page: 2, per_page: 10 }, - }) - }) - - it("creates a pull request review comment", async () => { - const data = { body: "Inline", commit_id: "abc", path: "file.ts", line: 1 } - mockGitHubClient.post.mockResolvedValueOnce({ data: { id: 1 } }) - - await new CreatePullRequestReviewCommentFunction().run(createMockContext(), "owner", "repo", 5, data) - - expect(mockGitHubClient.post).toHaveBeenCalledWith("/repos/owner/repo/pulls/5/comments", data) - }) - - it("updates a pull request review comment", async () => { - const data = { body: "Updated" } - mockGitHubClient.patch.mockResolvedValueOnce({ data: { id: 9 } }) - - await new UpdatePullRequestReviewCommentFunction().run(createMockContext(), "owner", "repo", 9, data) - - expect(mockGitHubClient.patch).toHaveBeenCalledWith("/repos/owner/repo/pulls/comments/9", data) - }) - - it("deletes a pull request review comment", async () => { - mockGitHubClient.delete.mockResolvedValueOnce({ data: {} }) - - await new DeletePullRequestReviewCommentFunction().run(createMockContext(), "owner", "repo", 9) - - expect(mockGitHubClient.delete).toHaveBeenCalledWith("/repos/owner/repo/pulls/comments/9") - }) - - it("rejects invalid comment ids", async () => { - await expect(new DeletePullRequestReviewCommentFunction().run(createMockContext(), "owner", "repo", 0)).rejects.toBeInstanceOf(RuntimeError) - expect(vi.mocked(axios.create)).toBeDefined() - }) -}) diff --git a/actions/github-action/src/tests/functions/pullRequestReviews/pullRequestReviewFunctions.test.ts b/actions/github-action/src/tests/functions/pullRequestReviews/pullRequestReviewFunctions.test.ts deleted file mode 100644 index d710c62..0000000 --- a/actions/github-action/src/tests/functions/pullRequestReviews/pullRequestReviewFunctions.test.ts +++ /dev/null @@ -1,58 +0,0 @@ -import { RuntimeError } from "@code0-tech/hercules" -import axios from "axios" -import { beforeEach, describe, expect, it, vi } from "vitest" -import { createMockContext, mockGitHubClient, resetGitHubClientMock } from "../../testUtils.js" -import { CreatePullRequestReviewFunction } from "../../../functions/pullRequestReviews/createPullRequestReviewFunction.js" -import { DismissPullRequestReviewFunction } from "../../../functions/pullRequestReviews/dismissPullRequestReviewFunction.js" -import { GetPullRequestReviewsFunction } from "../../../functions/pullRequestReviews/getPullRequestReviewsFunction.js" -import { SubmitPullRequestReviewFunction } from "../../../functions/pullRequestReviews/submitPullRequestReviewFunction.js" - -vi.mock("axios") - -describe("pull request review functions", () => { - beforeEach(resetGitHubClientMock) - - it("gets pull request reviews", async () => { - mockGitHubClient.get.mockResolvedValueOnce({ data: [{ id: 1 }] }) - - await new GetPullRequestReviewsFunction().run(createMockContext(), "owner", "repo", 5, 2, 20) - - expect(mockGitHubClient.get).toHaveBeenCalledWith("/repos/owner/repo/pulls/5/reviews", { - params: { page: 2, per_page: 20 }, - }) - }) - - it("creates a pull request review", async () => { - const data = { event: "COMMENT" as const, body: "Looks good" } - mockGitHubClient.post.mockResolvedValueOnce({ data: { id: 1 } }) - - await new CreatePullRequestReviewFunction().run(createMockContext(), "owner", "repo", 5, data) - - expect(mockGitHubClient.post).toHaveBeenCalledWith("/repos/owner/repo/pulls/5/reviews", data) - }) - - it("submits a pull request review", async () => { - const data = { event: "APPROVE" as const } - mockGitHubClient.post.mockResolvedValueOnce({ data: { id: 1 } }) - - await new SubmitPullRequestReviewFunction().run(createMockContext(), "owner", "repo", 5, 9, data) - - expect(mockGitHubClient.post).toHaveBeenCalledWith("/repos/owner/repo/pulls/5/reviews/9/events", data) - }) - - it("dismisses a pull request review", async () => { - const data = { message: "Outdated" } - mockGitHubClient.put.mockResolvedValueOnce({ data: { id: 1 } }) - - await new DismissPullRequestReviewFunction().run(createMockContext(), "owner", "repo", 5, 9, data) - - expect(mockGitHubClient.put).toHaveBeenCalledWith("/repos/owner/repo/pulls/5/reviews/9/dismissals", data) - }) - - it("rejects invalid review ids", async () => { - await expect(new SubmitPullRequestReviewFunction().run(createMockContext(), "owner", "repo", 5, 0, { event: "COMMENT" })).rejects.toBeInstanceOf( - RuntimeError - ) - expect(vi.mocked(axios.create)).toBeDefined() - }) -}) diff --git a/actions/github-action/src/tests/functions/pullRequests/mergePullRequestFunction.test.ts b/actions/github-action/src/tests/functions/pullRequests/mergePullRequestFunction.test.ts deleted file mode 100644 index 694a215..0000000 --- a/actions/github-action/src/tests/functions/pullRequests/mergePullRequestFunction.test.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { RuntimeError } from "@code0-tech/hercules" -import axios from "axios" -import { beforeEach, describe, expect, it, vi } from "vitest" -import { createMockContext, mockGitHubClient, resetGitHubClientMock } from "../../testUtils.js" -import { MergePullRequestFunction } from "../../../functions/pullRequests/mergePullRequestFunction.js" - -vi.mock("axios") - -describe("MergePullRequestFunction", () => { - beforeEach(resetGitHubClientMock) - - it("merges a pull request", async () => { - const data = { merge_method: "squash" as const } - const mergeResult = { merged: true, message: "Merged" } - mockGitHubClient.put.mockResolvedValueOnce({ data: mergeResult }) - - const result = await new MergePullRequestFunction().run(createMockContext(), "code0-tech", "centaurus", 42, data) - - expect(mockGitHubClient.put).toHaveBeenCalledWith("/repos/code0-tech/centaurus/pulls/42/merge", data) - expect(result).toEqual(mergeResult) - }) - - it("rejects invalid pull request numbers", async () => { - await expect(new MergePullRequestFunction().run(createMockContext(), "code0-tech", "centaurus", 0)).rejects.toBeInstanceOf(RuntimeError) - expect(mockGitHubClient.put).not.toHaveBeenCalled() - }) -}) diff --git a/actions/github-action/src/tests/functions/pullRequests/pullRequestFunctions.test.ts b/actions/github-action/src/tests/functions/pullRequests/pullRequestFunctions.test.ts deleted file mode 100644 index 9bc1470..0000000 --- a/actions/github-action/src/tests/functions/pullRequests/pullRequestFunctions.test.ts +++ /dev/null @@ -1,67 +0,0 @@ -import { RuntimeError } from "@code0-tech/hercules" -import axios from "axios" -import { beforeEach, describe, expect, it, vi } from "vitest" -import { createMockContext, mockGitHubClient, resetGitHubClientMock } from "../../testUtils.js" -import { ClosePullRequestFunction } from "../../../functions/pullRequests/closePullRequestFunction.js" -import { CreatePullRequestFunction } from "../../../functions/pullRequests/createPullRequestFunction.js" -import { GetPullRequestFunction } from "../../../functions/pullRequests/getPullRequestFunction.js" -import { GetPullRequestsFunction } from "../../../functions/pullRequests/getPullRequestsFunction.js" -import { ReopenPullRequestFunction } from "../../../functions/pullRequests/reopenPullRequestFunction.js" -import { UpdatePullRequestFunction } from "../../../functions/pullRequests/updatePullRequestFunction.js" - -vi.mock("axios") - -describe("pull request functions", () => { - beforeEach(resetGitHubClientMock) - - it("gets a pull request", async () => { - mockGitHubClient.get.mockResolvedValueOnce({ data: { id: 1 } }) - - await new GetPullRequestFunction().run(createMockContext(), "owner", "repo", 5) - - expect(mockGitHubClient.get).toHaveBeenCalledWith("/repos/owner/repo/pulls/5") - }) - - it("gets pull requests with pagination", async () => { - mockGitHubClient.get.mockResolvedValueOnce({ data: [{ id: 1 }] }) - - await new GetPullRequestsFunction().run(createMockContext(), "owner", "repo", "closed", 2, 10) - - expect(mockGitHubClient.get).toHaveBeenCalledWith("/repos/owner/repo/pulls", { - params: { state: "closed", page: 2, per_page: 10 }, - }) - }) - - it("creates a pull request", async () => { - const data = { title: "PR", head: "feature", base: "main" } - mockGitHubClient.post.mockResolvedValueOnce({ data: { id: 1 } }) - - await new CreatePullRequestFunction().run(createMockContext(), "owner", "repo", data) - - expect(mockGitHubClient.post).toHaveBeenCalledWith("/repos/owner/repo/pulls", data) - }) - - it("updates a pull request", async () => { - const data = { title: "Updated" } - mockGitHubClient.patch.mockResolvedValueOnce({ data: { id: 1 } }) - - await new UpdatePullRequestFunction().run(createMockContext(), "owner", "repo", 5, data) - - expect(mockGitHubClient.patch).toHaveBeenCalledWith("/repos/owner/repo/pulls/5", data) - }) - - it("closes and reopens a pull request", async () => { - mockGitHubClient.patch.mockResolvedValue({ data: { id: 1 } }) - - await new ClosePullRequestFunction().run(createMockContext(), "owner", "repo", 5) - await new ReopenPullRequestFunction().run(createMockContext(), "owner", "repo", 5) - - expect(mockGitHubClient.patch).toHaveBeenNthCalledWith(1, "/repos/owner/repo/pulls/5", { state: "closed" }) - expect(mockGitHubClient.patch).toHaveBeenNthCalledWith(2, "/repos/owner/repo/pulls/5", { state: "open" }) - }) - - it("rejects invalid pull request numbers", async () => { - await expect(new GetPullRequestFunction().run(createMockContext(), "owner", "repo", 0)).rejects.toBeInstanceOf(RuntimeError) - expect(vi.mocked(axios.create)).toBeDefined() - }) -}) diff --git a/actions/github-action/src/tests/functions/releases/createReleaseFunction.test.ts b/actions/github-action/src/tests/functions/releases/createReleaseFunction.test.ts deleted file mode 100644 index 9d1fe12..0000000 --- a/actions/github-action/src/tests/functions/releases/createReleaseFunction.test.ts +++ /dev/null @@ -1,21 +0,0 @@ -import axios from "axios" -import { beforeEach, describe, expect, it, vi } from "vitest" -import { createMockContext, mockGitHubClient, resetGitHubClientMock } from "../../testUtils.js" -import { CreateReleaseFunction } from "../../../functions/releases/createReleaseFunction.js" - -vi.mock("axios") - -describe("CreateReleaseFunction", () => { - beforeEach(resetGitHubClientMock) - - it("creates a release", async () => { - const data = { tag_name: "v1.0.0", name: "v1.0.0" } - const release = { id: 1, ...data } - mockGitHubClient.post.mockResolvedValueOnce({ data: release }) - - const result = await new CreateReleaseFunction().run(createMockContext(), "code0-tech", "centaurus", data) - - expect(mockGitHubClient.post).toHaveBeenCalledWith("/repos/code0-tech/centaurus/releases", data) - expect(result).toEqual(release) - }) -}) diff --git a/actions/github-action/src/tests/functions/releases/releaseFunctions.test.ts b/actions/github-action/src/tests/functions/releases/releaseFunctions.test.ts deleted file mode 100644 index 3558406..0000000 --- a/actions/github-action/src/tests/functions/releases/releaseFunctions.test.ts +++ /dev/null @@ -1,54 +0,0 @@ -import { RuntimeError } from "@code0-tech/hercules" -import axios from "axios" -import { beforeEach, describe, expect, it, vi } from "vitest" -import { createMockContext, mockGitHubClient, resetGitHubClientMock } from "../../testUtils.js" -import { DeleteReleaseFunction } from "../../../functions/releases/deleteReleaseFunction.js" -import { GetReleaseFunction } from "../../../functions/releases/getReleaseFunction.js" -import { GetReleasesFunction } from "../../../functions/releases/getReleasesFunction.js" -import { UpdateReleaseFunction } from "../../../functions/releases/updateReleaseFunction.js" - -vi.mock("axios") - -describe("release functions", () => { - beforeEach(resetGitHubClientMock) - - it("gets releases", async () => { - mockGitHubClient.get.mockResolvedValueOnce({ data: [{ id: 1 }] }) - - await new GetReleasesFunction().run(createMockContext(), "owner", "repo", 2, 10) - - expect(mockGitHubClient.get).toHaveBeenCalledWith("/repos/owner/repo/releases", { - params: { page: 2, per_page: 10 }, - }) - }) - - it("gets a release", async () => { - mockGitHubClient.get.mockResolvedValueOnce({ data: { id: 7 } }) - - await new GetReleaseFunction().run(createMockContext(), "owner", "repo", 7) - - expect(mockGitHubClient.get).toHaveBeenCalledWith("/repos/owner/repo/releases/7") - }) - - it("updates a release", async () => { - const data = { name: "Release" } - mockGitHubClient.patch.mockResolvedValueOnce({ data: { id: 7 } }) - - await new UpdateReleaseFunction().run(createMockContext(), "owner", "repo", 7, data) - - expect(mockGitHubClient.patch).toHaveBeenCalledWith("/repos/owner/repo/releases/7", data) - }) - - it("deletes a release", async () => { - mockGitHubClient.delete.mockResolvedValueOnce({ data: {} }) - - await new DeleteReleaseFunction().run(createMockContext(), "owner", "repo", 7) - - expect(mockGitHubClient.delete).toHaveBeenCalledWith("/repos/owner/repo/releases/7") - }) - - it("rejects invalid release ids", async () => { - await expect(new GetReleaseFunction().run(createMockContext(), "owner", "repo", 0)).rejects.toBeInstanceOf(RuntimeError) - expect(vi.mocked(axios.create)).toBeDefined() - }) -}) diff --git a/actions/github-action/src/tests/functions/repositories/createBranchFunction.test.ts b/actions/github-action/src/tests/functions/repositories/createBranchFunction.test.ts deleted file mode 100644 index d15af83..0000000 --- a/actions/github-action/src/tests/functions/repositories/createBranchFunction.test.ts +++ /dev/null @@ -1,24 +0,0 @@ -import axios from "axios" -import { beforeEach, describe, expect, it, vi } from "vitest" -import { createMockContext, mockGitHubClient, resetGitHubClientMock } from "../../testUtils.js" -import { CreateBranchFunction } from "../../../functions/repositories/createBranchFunction.js" - -vi.mock("axios") - -describe("CreateBranchFunction", () => { - beforeEach(resetGitHubClientMock) - - it("creates a branch ref from a SHA", async () => { - mockGitHubClient.post.mockResolvedValueOnce({ data: {} }) - - await new CreateBranchFunction().run(createMockContext(), "code0-tech", "centaurus", { - branch: "feature/test", - sha: "abc123", - }) - - expect(mockGitHubClient.post).toHaveBeenCalledWith("/repos/code0-tech/centaurus/git/refs", { - ref: "refs/heads/feature/test", - sha: "abc123", - }) - }) -}) diff --git a/actions/github-action/src/tests/functions/repositories/repositoryFunctions.test.ts b/actions/github-action/src/tests/functions/repositories/repositoryFunctions.test.ts deleted file mode 100644 index 9737d91..0000000 --- a/actions/github-action/src/tests/functions/repositories/repositoryFunctions.test.ts +++ /dev/null @@ -1,73 +0,0 @@ -import { RuntimeError } from "@code0-tech/hercules" -import axios from "axios" -import { beforeEach, describe, expect, it, vi } from "vitest" -import { createMockContext, mockGitHubClient, resetGitHubClientMock } from "../../testUtils.js" -import { DeleteBranchFunction } from "../../../functions/repositories/deleteBranchFunction.js" -import { GetBranchFunction } from "../../../functions/repositories/getBranchFunction.js" -import { GetCommitFunction } from "../../../functions/repositories/getCommitFunction.js" -import { GetCommitsFunction } from "../../../functions/repositories/getCommitsFunction.js" -import { GetRepositoryBranchesFunction } from "../../../functions/repositories/getRepositoryBranchesFunction.js" -import { GetRepositoryFunction } from "../../../functions/repositories/getRepositoryFunction.js" - -vi.mock("axios") - -describe("repository functions", () => { - beforeEach(resetGitHubClientMock) - - it("gets a repository", async () => { - mockGitHubClient.get.mockResolvedValueOnce({ data: { id: 1 } }) - - await new GetRepositoryFunction().run(createMockContext(), "owner", "repo") - - expect(mockGitHubClient.get).toHaveBeenCalledWith("/repos/owner/repo") - }) - - it("gets repository branches", async () => { - mockGitHubClient.get.mockResolvedValueOnce({ data: [{ name: "main" }] }) - - await new GetRepositoryBranchesFunction().run(createMockContext(), "owner", "repo", 2, 20) - - expect(mockGitHubClient.get).toHaveBeenCalledWith("/repos/owner/repo/branches", { - params: { page: 2, per_page: 20 }, - }) - }) - - it("gets a branch", async () => { - mockGitHubClient.get.mockResolvedValueOnce({ data: { name: "feature/test" } }) - - await new GetBranchFunction().run(createMockContext(), "owner", "repo", "feature/test") - - expect(mockGitHubClient.get).toHaveBeenCalledWith("/repos/owner/repo/branches/feature%2Ftest") - }) - - it("gets commits", async () => { - mockGitHubClient.get.mockResolvedValueOnce({ data: [{ sha: "abc" }] }) - - await new GetCommitsFunction().run(createMockContext(), "owner", "repo", "main", 2, 10) - - expect(mockGitHubClient.get).toHaveBeenCalledWith("/repos/owner/repo/commits", { - params: { sha: "main", page: 2, per_page: 10 }, - }) - }) - - it("gets a commit", async () => { - mockGitHubClient.get.mockResolvedValueOnce({ data: { sha: "abc" } }) - - await new GetCommitFunction().run(createMockContext(), "owner", "repo", "abc/123") - - expect(mockGitHubClient.get).toHaveBeenCalledWith("/repos/owner/repo/commits/abc%2F123") - }) - - it("deletes a branch", async () => { - mockGitHubClient.delete.mockResolvedValueOnce({ data: {} }) - - await new DeleteBranchFunction().run(createMockContext(), "owner", "repo", "feature/test") - - expect(mockGitHubClient.delete).toHaveBeenCalledWith("/repos/owner/repo/git/refs/heads%2Ffeature%2Ftest") - }) - - it("rejects invalid branch pagination", async () => { - await expect(new GetRepositoryBranchesFunction().run(createMockContext(), "owner", "repo", 0)).rejects.toBeInstanceOf(RuntimeError) - expect(vi.mocked(axios.create)).toBeDefined() - }) -}) diff --git a/actions/github-action/src/tests/testUtils.ts b/actions/github-action/src/tests/testUtils.ts deleted file mode 100644 index 432c8c4..0000000 --- a/actions/github-action/src/tests/testUtils.ts +++ /dev/null @@ -1,28 +0,0 @@ -import axios from "axios" -import { vi } from "vitest" -import type { FunctionContext } from "@code0-tech/hercules" - -export const mockGitHubClient = { - delete: vi.fn(), - get: vi.fn(), - patch: vi.fn(), - post: vi.fn(), - put: vi.fn(), -} - -export function createMockContext(): FunctionContext { - return { - matchedConfig: { - findConfig: (key: string) => { - if (key === "github_token") return "test-token" - if (key === "github_api_url") return "https://api.github.test" - return undefined - }, - }, - } as unknown as FunctionContext -} - -export function resetGitHubClientMock() { - vi.clearAllMocks() - vi.mocked(axios.create).mockReturnValue(mockGitHubClient as never) -} From f838c2b5f84da03c11b598baadc4461bec9f64dc Mon Sep 17 00:00:00 2001 From: nicosammito Date: Sun, 25 Oct 2026 20:02:51 +0100 Subject: [PATCH 13/19] refactor: update GitHub schemas and remove obsolete request files --- actions/github-action/.gitignore | 4 + actions/github-action/package-lock.json | 422 +- actions/github-action/package.json | 8 +- .../schemas/github-openapi.filtered.json | 14746 ++++++++++++++++ .../ciAutomation/githubCiAutomation.ts | 6 +- .../githubCiAutomationRequests.ts | 40 - .../data_types/ciAutomation/githubWorkflow.ts | 8 +- .../ciAutomation/githubWorkflowInputs.ts | 12 + .../ciAutomation/githubWorkflowRequests.ts | 15 - .../issueComments/githubIssueComment.ts | 6 +- .../githubIssueCommentRequests.ts | 25 - .../issues/githubAssigneesRequest.ts | 14 - .../src/data_types/issues/githubIssue.ts | 4 +- .../data_types/issues/githubIssueRequests.ts | 35 - .../src/data_types/labels/githubLabel.ts | 4 +- .../data_types/labels/githubLabelRequests.ts | 14 - .../data_types/milestones/githubMilestone.ts | 6 +- .../milestones/githubMilestoneRequests.ts | 31 - .../githubPullRequestReviewComment.ts | 6 +- .../githubPullRequestReviewCommentRequests.ts | 25 - .../githubPullRequestReview.ts | 6 +- .../githubPullRequestReviewRequests.ts | 46 - .../pullRequests/githubPullRequest.ts | 14 +- .../githubPullRequestMergeRequest.ts | 28 - .../githubPullRequestMergeResult.ts | 12 + .../pullRequests/githubPullRequestRequests.ts | 34 - .../src/data_types/releases/githubRelease.ts | 4 +- .../releases/githubReleaseRequests.ts | 37 - .../repositories/githubBranchRequests.ts | 14 - .../data_types/repositories/githubCommit.ts | 4 +- .../repositories/githubRepository.ts | 4 +- .../repositories/githubRepositoryBranch.ts | 17 +- .../githubIssueClosedWebhookPayload.ts | 9 +- .../githubIssueOpenedWebhookPayload.ts | 9 +- .../githubPullRequestClosedWebhookPayload.ts | 9 +- .../githubPullRequestOpenedWebhookPayload.ts | 9 +- .../src/data_types/webhooks/githubPush.ts | 10 +- .../ciAutomation/cancelWorkflowRunFunction.ts | 9 +- .../ciAutomation/createCheckRunFunction.ts | 99 +- .../createCommitStatusFunction.ts | 49 +- .../ciAutomation/dispatchWorkflowFunction.ts | 27 +- .../ciAutomation/getCommitStatusesFunction.ts | 9 +- .../ciAutomation/getWorkflowRunsFunction.ts | 23 +- .../ciAutomation/getWorkflowsFunction.ts | 21 +- .../ciAutomation/rerunWorkflowRunFunction.ts | 9 +- .../ciAutomation/updateCheckRunFunction.ts | 104 +- .../createIssueCommentFunction.ts | 24 +- .../deleteIssueCommentFunction.ts | 9 +- .../issueComments/getIssueCommentsFunction.ts | 23 +- .../updateIssueCommentFunction.ts | 24 +- .../issues/addAssigneeToIssueFunction.ts | 20 +- .../issues/addAssigneesToIssueFunction.ts | 23 +- .../functions/issues/closeIssueFunction.ts | 9 +- .../functions/issues/createIssueFunction.ts | 75 +- .../src/functions/issues/getIssueFunction.ts | 3 +- .../src/functions/issues/getIssuesFunction.ts | 9 +- .../issues/removeAssigneeFromIssueFunction.ts | 20 +- .../removeAssigneesFromIssueFunction.ts | 21 +- .../functions/issues/reopenIssueFunction.ts | 9 +- .../functions/issues/updateIssueFunction.ts | 95 +- .../labels/addLabelsToIssueFunction.ts | 21 +- .../labels/getIssueLabelsFunction.ts | 9 +- .../src/functions/labels/getLabelsFunction.ts | 21 +- .../removeAllLabelsFromIssueFunction.ts | 9 +- .../labels/removeLabelFromIssueFunction.ts | 20 +- .../labels/setLabelsForIssueFunction.ts | 21 +- .../milestones/createMilestoneFunction.ts | 47 +- .../milestones/deleteMilestoneFunction.ts | 9 +- .../milestones/getMilestoneFunction.ts | 9 +- .../milestones/getMilestonesFunction.ts | 28 +- .../milestones/updateMilestoneFunction.ts | 53 +- .../createPullRequestReviewCommentFunction.ts | 61 +- .../deletePullRequestReviewCommentFunction.ts | 9 +- .../getPullRequestReviewCommentsFunction.ts | 23 +- .../updatePullRequestReviewCommentFunction.ts | 26 +- .../createPullRequestReviewFunction.ts | 46 +- .../dismissPullRequestReviewFunction.ts | 22 +- .../getPullRequestReviewsFunction.ts | 23 +- .../submitPullRequestReviewFunction.ts | 33 +- .../pullRequests/closePullRequestFunction.ts | 9 +- .../pullRequests/createPullRequestFunction.ts | 62 +- .../pullRequests/getPullRequestFunction.ts | 3 +- .../pullRequests/getPullRequestsFunction.ts | 17 +- .../pullRequests/mergePullRequestFunction.ts | 55 +- .../pullRequests/reopenPullRequestFunction.ts | 9 +- .../pullRequests/updatePullRequestFunction.ts | 54 +- .../releases/createReleaseFunction.ts | 94 +- .../releases/deleteReleaseFunction.ts | 9 +- .../functions/releases/getReleaseFunction.ts | 9 +- .../functions/releases/getReleasesFunction.ts | 21 +- .../releases/updateReleaseFunction.ts | 96 +- .../repositories/createBranchFunction.ts | 19 +- .../repositories/deleteBranchFunction.ts | 9 +- .../repositories/getBranchFunction.ts | 9 +- .../repositories/getCommitFunction.ts | 9 +- .../repositories/getCommitsFunction.ts | 23 +- .../getRepositoryBranchesFunction.ts | 29 +- .../repositories/getRepositoryFunction.ts | 3 +- .../src/generated/github-schemas.ts | 156 + actions/github-action/src/helpers.ts | 32 + actions/github-action/src/index.ts | 72 +- 101 files changed, 16368 insertions(+), 1332 deletions(-) create mode 100644 actions/github-action/schemas/github-openapi.filtered.json delete mode 100644 actions/github-action/src/data_types/ciAutomation/githubCiAutomationRequests.ts create mode 100644 actions/github-action/src/data_types/ciAutomation/githubWorkflowInputs.ts delete mode 100644 actions/github-action/src/data_types/ciAutomation/githubWorkflowRequests.ts delete mode 100644 actions/github-action/src/data_types/issueComments/githubIssueCommentRequests.ts delete mode 100644 actions/github-action/src/data_types/issues/githubAssigneesRequest.ts delete mode 100644 actions/github-action/src/data_types/issues/githubIssueRequests.ts delete mode 100644 actions/github-action/src/data_types/labels/githubLabelRequests.ts delete mode 100644 actions/github-action/src/data_types/milestones/githubMilestoneRequests.ts delete mode 100644 actions/github-action/src/data_types/pullRequestReviewComments/githubPullRequestReviewCommentRequests.ts delete mode 100644 actions/github-action/src/data_types/pullRequestReviews/githubPullRequestReviewRequests.ts delete mode 100644 actions/github-action/src/data_types/pullRequests/githubPullRequestMergeRequest.ts create mode 100644 actions/github-action/src/data_types/pullRequests/githubPullRequestMergeResult.ts delete mode 100644 actions/github-action/src/data_types/pullRequests/githubPullRequestRequests.ts delete mode 100644 actions/github-action/src/data_types/releases/githubReleaseRequests.ts delete mode 100644 actions/github-action/src/data_types/repositories/githubBranchRequests.ts create mode 100644 actions/github-action/src/generated/github-schemas.ts diff --git a/actions/github-action/.gitignore b/actions/github-action/.gitignore index ddc3c2a..e4a6603 100644 --- a/actions/github-action/.gitignore +++ b/actions/github-action/.gitignore @@ -1,3 +1,7 @@ .env node_modules/ dist/ + +# The upstream spec is re-downloaded by generate:github-schemas. +# Only the filtered subset the action actually uses is committed. +schemas/github-openapi.json diff --git a/actions/github-action/package-lock.json b/actions/github-action/package-lock.json index 3e28217..6f169fe 100644 --- a/actions/github-action/package-lock.json +++ b/actions/github-action/package-lock.json @@ -12,13 +12,10 @@ "axios": "^1.7.7" }, "devDependencies": { - "@octokit/openapi-webhooks-types": "^12.1.0", - "@octokit/types": "^16.0.0", "@types/node": "^22.0.0", "tsx": "^4.0.0", "typescript": "^5.9.3", - "vite": "^8.0.3", - "vitest": "^4.1.10" + "vite": "^8.0.3" } }, "node_modules/@clack/core": { @@ -556,13 +553,6 @@ "node": ">=6" } }, - "node_modules/@jridgewell/sourcemap-codec": { - "version": "1.5.5", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz", - "integrity": "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==", - "dev": true, - "license": "MIT" - }, "node_modules/@js-sdsl/ordered-map": { "version": "4.4.2", "resolved": "https://registry.npmjs.org/@js-sdsl/ordered-map/-/ordered-map-4.4.2.tgz", @@ -621,30 +611,6 @@ "node": ">=18.0.0" } }, - "node_modules/@octokit/openapi-types": { - "version": "27.0.0", - "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-27.0.0.tgz", - "integrity": "sha512-whrdktVs1h6gtR+09+QsNk2+FO+49j6ga1c55YZudfEG+oKJVvJLQi3zkOm5JjiUXAagWK2tI2kTGKJ2Ys7MGA==", - "dev": true, - "license": "MIT" - }, - "node_modules/@octokit/openapi-webhooks-types": { - "version": "12.1.0", - "resolved": "https://registry.npmjs.org/@octokit/openapi-webhooks-types/-/openapi-webhooks-types-12.1.0.tgz", - "integrity": "sha512-WiuzhOsiOvb7W3Pvmhf8d2C6qaLHXrWiLBP4nJ/4kydu+wpagV5Fkz9RfQwV2afYzv3PB+3xYgp4mAdNGjDprA==", - "dev": true, - "license": "MIT" - }, - "node_modules/@octokit/types": { - "version": "16.0.0", - "resolved": "https://registry.npmjs.org/@octokit/types/-/types-16.0.0.tgz", - "integrity": "sha512-sKq+9r1Mm4efXW1FCk7hFSeJo4QKreL/tTbR0rz/qx/r1Oa2VV83LTA/H/MuCOX7uCIJmQVRKBcbmWoySjAnSg==", - "dev": true, - "license": "MIT", - "dependencies": { - "@octokit/openapi-types": "^27.0.0" - } - }, "node_modules/@oxc-project/types": { "version": "0.138.0", "resolved": "https://registry.npmjs.org/@oxc-project/types/-/types-0.138.0.tgz", @@ -1055,13 +1021,6 @@ "dev": true, "license": "MIT" }, - "node_modules/@standard-schema/spec": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@standard-schema/spec/-/spec-1.1.0.tgz", - "integrity": "sha512-l2aFy5jALhniG5HgqrD6jXLi/rUWrKvqN/qJx6yoJsgKhblVd+iqqU4RCXavm/jPityDo5TCvKMnpjKnOriy0w==", - "dev": true, - "license": "MIT" - }, "node_modules/@ts-morph/common": { "version": "0.29.0", "resolved": "https://registry.npmjs.org/@ts-morph/common/-/common-0.29.0.tgz", @@ -1084,31 +1043,6 @@ "tslib": "^2.4.0" } }, - "node_modules/@types/chai": { - "version": "5.2.3", - "resolved": "https://registry.npmjs.org/@types/chai/-/chai-5.2.3.tgz", - "integrity": "sha512-Mw558oeA9fFbv65/y4mHtXDs9bPnFMZAL/jxdPFUpOHHIXX91mcgEHbS5Lahr+pwZFR8A7GQleRWeI6cGFC2UA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/deep-eql": "*", - "assertion-error": "^2.0.1" - } - }, - "node_modules/@types/deep-eql": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/@types/deep-eql/-/deep-eql-4.0.2.tgz", - "integrity": "sha512-c9h9dVVMigMPc4bwTvC5dxqtqJZwQPePsWjPlpSOnojbor6pGqdk541lfA7AqFQr5pB1BRdq0juY9db81BwyFw==", - "dev": true, - "license": "MIT" - }, - "node_modules/@types/estree": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.9.tgz", - "integrity": "sha512-GhdPgy1el4/ImP05X05Uw4cw2/M93BCUmnEvWZNStlCzEKME4Fkk+YpoA5OiHNQmoS7Cafb8Xa3Pya8m1Qrzeg==", - "dev": true, - "license": "MIT" - }, "node_modules/@types/node": { "version": "22.20.0", "resolved": "https://registry.npmjs.org/@types/node/-/node-22.20.0.tgz", @@ -1130,119 +1064,6 @@ "typescript": "*" } }, - "node_modules/@vitest/expect": { - "version": "4.1.10", - "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-4.1.10.tgz", - "integrity": "sha512-YsCn+qAk1GWjQOWFEsEcL2gNQ0zmVmQu3T03qP6UyjhtmdtwtbuI+DASn/7iQB3HGTXkdBwGddzxPlmiql5vlA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@standard-schema/spec": "^1.1.0", - "@types/chai": "^5.2.2", - "@vitest/spy": "4.1.10", - "@vitest/utils": "4.1.10", - "chai": "^6.2.2", - "tinyrainbow": "^3.1.0" - }, - "funding": { - "url": "https://opencollective.com/vitest" - } - }, - "node_modules/@vitest/mocker": { - "version": "4.1.10", - "resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-4.1.10.tgz", - "integrity": "sha512-v0xaezt+DKEmKfaxg133ldzADrwLGd7Ze1MfQQTYfvs8OqZIwbxyxaYURivwV7sWy5fqn3rH5uOrSp07bp44Ow==", - "dev": true, - "license": "MIT", - "dependencies": { - "@vitest/spy": "4.1.10", - "estree-walker": "^3.0.3", - "magic-string": "^0.30.21" - }, - "funding": { - "url": "https://opencollective.com/vitest" - }, - "peerDependencies": { - "msw": "^2.4.9", - "vite": "^6.0.0 || ^7.0.0 || ^8.0.0" - }, - "peerDependenciesMeta": { - "msw": { - "optional": true - }, - "vite": { - "optional": true - } - } - }, - "node_modules/@vitest/pretty-format": { - "version": "4.1.10", - "resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-4.1.10.tgz", - "integrity": "sha512-W1HsjSH4MXQ9YfmmhLAoIYf1HRfekQCGngeIgcei6MP5QQGWUe0gkopdZQaVCFO+JDJMrAJGwa5pRpNpvy4P8Q==", - "dev": true, - "license": "MIT", - "dependencies": { - "tinyrainbow": "^3.1.0" - }, - "funding": { - "url": "https://opencollective.com/vitest" - } - }, - "node_modules/@vitest/runner": { - "version": "4.1.10", - "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-4.1.10.tgz", - "integrity": "sha512-IKI6kpIH+LmpROplyLwBBaCfMgOZOMsygVa6BARD6ahA04VRuJSa6OaVG7kRvSEMD870Vd91rSSw0eegtWyLGg==", - "dev": true, - "license": "MIT", - "dependencies": { - "@vitest/utils": "4.1.10", - "pathe": "^2.0.3" - }, - "funding": { - "url": "https://opencollective.com/vitest" - } - }, - "node_modules/@vitest/snapshot": { - "version": "4.1.10", - "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-4.1.10.tgz", - "integrity": "sha512-xRkfOT1qpTAi/Ti4Y1LtfRc3kEuqxGw59eN2jN9pRWMtS/XDevekhcFSqvQqjUNGksfjMJu3Y+oJ+4Ypn2OaJw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@vitest/pretty-format": "4.1.10", - "@vitest/utils": "4.1.10", - "magic-string": "^0.30.21", - "pathe": "^2.0.3" - }, - "funding": { - "url": "https://opencollective.com/vitest" - } - }, - "node_modules/@vitest/spy": { - "version": "4.1.10", - "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-4.1.10.tgz", - "integrity": "sha512-PLf/Ugvoq5wO/b4rwYCR1h2PSIdXz7wnkQFMiUpLdtM7l6pqVFcQIBEHyT1+l+cj7mNwAfZHzqXqDyjvOuwbDw==", - "dev": true, - "license": "MIT", - "funding": { - "url": "https://opencollective.com/vitest" - } - }, - "node_modules/@vitest/utils": { - "version": "4.1.10", - "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-4.1.10.tgz", - "integrity": "sha512-fy9am/HWxbaGt/Sawrp90vt6Y6jQwf1RX77cz3uwoJwJVMli/e1IEwRPnMNJ7vKfPTwo0diXifkpPvwH9v7nGA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@vitest/pretty-format": "4.1.10", - "convert-source-map": "^2.0.0", - "tinyrainbow": "^3.1.0" - }, - "funding": { - "url": "https://opencollective.com/vitest" - } - }, "node_modules/agent-base": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", @@ -1303,16 +1124,6 @@ "node": ">=14" } }, - "node_modules/assertion-error": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-2.0.1.tgz", - "integrity": "sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12" - } - }, "node_modules/async": { "version": "3.2.6", "resolved": "https://registry.npmjs.org/async/-/async-3.2.6.tgz", @@ -1371,16 +1182,6 @@ "node": ">= 0.4" } }, - "node_modules/chai": { - "version": "6.2.2", - "resolved": "https://registry.npmjs.org/chai/-/chai-6.2.2.tgz", - "integrity": "sha512-NUPRluOfOiTKBKvWPtSD4PhFvWCqOi0BGStNWs57X9js7XGTprSmFoz5F0tWhR4WPjNeR9jXqdC7/UpSJTnlRg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=18" - } - }, "node_modules/chokidar": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.3.tgz", @@ -1547,13 +1348,6 @@ "node": ">= 0.8" } }, - "node_modules/convert-source-map": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", - "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", - "dev": true, - "license": "MIT" - }, "node_modules/debug": { "version": "4.4.3", "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", @@ -1655,13 +1449,6 @@ "node": ">= 0.4" } }, - "node_modules/es-module-lexer": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-2.3.0.tgz", - "integrity": "sha512-KLdwQm2NvGLDkQDCGvmiQrhkd0JbMzXthwQAUgWjQuQdBLFa3eiBP5arXZyA+f8x+x7OXgud6bq2rxjGtHV2tw==", - "dev": true, - "license": "MIT" - }, "node_modules/es-object-atoms": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.2.tgz", @@ -1752,32 +1539,12 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/estree-walker": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz", - "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/estree": "^1.0.0" - } - }, "node_modules/eventemitter3": { "version": "5.0.4", "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.4.tgz", "integrity": "sha512-mlsTRyGaPBjPedk6Bvw+aqbsXDtoAyAzm5MO7JgU+yVRyMQ5O8bD4Kcci7BS85f93veegeCPkL8R4GLClnjLFw==", "license": "MIT" }, - "node_modules/expect-type": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/expect-type/-/expect-type-1.4.0.tgz", - "integrity": "sha512-KfYbmpRm0VbLjEvVa9yGwCi9GI34xvi7A/HXYWQO65CSD2u3MczUJSuwXKFIxlGsgBQizV9q5J9NHj4VG0n+pA==", - "dev": true, - "license": "Apache-2.0", - "engines": { - "node": ">=12.0.0" - } - }, "node_modules/fdir": { "version": "6.5.0", "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz", @@ -2531,16 +2298,6 @@ "integrity": "sha512-mNAgZ1GmyNhD7AuqnTG3/VQ26o760+ZYBPKjPvugO8+nLbYfX6TVpJPseBvopbdY+qpZ/lKUnmEc1LeZYS3QAA==", "license": "Apache-2.0" }, - "node_modules/magic-string": { - "version": "0.30.21", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.21.tgz", - "integrity": "sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@jridgewell/sourcemap-codec": "^1.5.5" - } - }, "node_modules/math-intrinsics": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", @@ -2623,20 +2380,6 @@ "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" } }, - "node_modules/obug": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/obug/-/obug-2.1.3.tgz", - "integrity": "sha512-9miFgM2OFba7hB+pRgvtV84pYTBaoTHohvmIgiRt6dRIzbwEOIaNaP+dIlGs2fNFoB0SeISs0Jz5WFVRid6Xyg==", - "dev": true, - "funding": [ - "https://github.com/sponsors/sxzz", - "https://opencollective.com/debug" - ], - "license": "MIT", - "engines": { - "node": ">=12.20.0" - } - }, "node_modules/onetime": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/onetime/-/onetime-7.0.0.tgz", @@ -2658,13 +2401,6 @@ "integrity": "sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==", "license": "MIT" }, - "node_modules/pathe": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/pathe/-/pathe-2.0.3.tgz", - "integrity": "sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==", - "dev": true, - "license": "MIT" - }, "node_modules/picocolors": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", @@ -2842,13 +2578,6 @@ "node": ">=10" } }, - "node_modules/siginfo": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/siginfo/-/siginfo-2.0.0.tgz", - "integrity": "sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==", - "dev": true, - "license": "ISC" - }, "node_modules/signal-exit": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", @@ -2905,20 +2634,6 @@ "node": ">=0.10.0" } }, - "node_modules/stackback": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/stackback/-/stackback-0.0.2.tgz", - "integrity": "sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==", - "dev": true, - "license": "MIT" - }, - "node_modules/std-env": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/std-env/-/std-env-4.2.0.tgz", - "integrity": "sha512-oCUKSupKTHX53EyjDtuZQ64pjLJ6yYCtpmEw0goYxtjG9KpbRe8KAsl2tBUGU9DyMcJ0RwJ8GqJAFzMXcXW1Rw==", - "dev": true, - "license": "MIT" - }, "node_modules/string-width": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", @@ -3184,23 +2899,6 @@ "integrity": "sha512-vgfbwKo8TEJbRsapR9LWWvIJRnv8u9aXVa6cyYOAQQmurCx54Cnt59x5fKdiq+hFaBJ51AbzCgMpbP3p65/pHQ==", "license": "MIT" }, - "node_modules/tinybench": { - "version": "2.9.0", - "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.9.0.tgz", - "integrity": "sha512-0+DUvqWMValLmha6lr4kD8iAMK1HzV0/aKnCtWb9v9641TnP/MFb7Pc2bxoxQjTXAErryXVgUOfv2YqNllqGeg==", - "dev": true, - "license": "MIT" - }, - "node_modules/tinyexec": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-1.2.4.tgz", - "integrity": "sha512-SHf/r48b7vOrjve9PxJo3MN5v5yuyjHvdUcrQffT3WXMUfnGmHDVbC4k3sHJaJTgZCwpUplIaAo5ANtMyp3YHg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=18" - } - }, "node_modules/tinyglobby": { "version": "0.2.17", "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.17.tgz", @@ -3217,16 +2915,6 @@ "url": "https://github.com/sponsors/SuperchupuDev" } }, - "node_modules/tinyrainbow": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/tinyrainbow/-/tinyrainbow-3.1.0.tgz", - "integrity": "sha512-Bf+ILmBgretUrdJxzXM0SgXLZ3XfiaUuOj/IKQHuTXip+05Xn+uyEYdVg0kYDipTBcLrCVyUzAPz7QmArb0mmw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=14.0.0" - } - }, "node_modules/ts-morph": { "version": "28.0.0", "resolved": "https://registry.npmjs.org/ts-morph/-/ts-morph-28.0.0.tgz", @@ -3346,7 +3034,6 @@ "integrity": "sha512-Ds+gBRbj0lwRO2Y5hwnUBdxSwlAve9LeRyU4sNnAr0ewW0gWF0n5bgXgUzbgZ49MV9BVUAQUFYVcDUcilUExMA==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "lightningcss": "^1.32.0", "picomatch": "^4.0.4", @@ -3419,113 +3106,6 @@ } } }, - "node_modules/vitest": { - "version": "4.1.10", - "resolved": "https://registry.npmjs.org/vitest/-/vitest-4.1.10.tgz", - "integrity": "sha512-R9jUTe5S4Qb0HCd4TNqpC7oGcrMssMRGXLW80ubjWsW9VH5GF8y1Y0SFLY9AbqSk6nt0PnOx4H4WNJYZ13GUPw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@vitest/expect": "4.1.10", - "@vitest/mocker": "4.1.10", - "@vitest/pretty-format": "4.1.10", - "@vitest/runner": "4.1.10", - "@vitest/snapshot": "4.1.10", - "@vitest/spy": "4.1.10", - "@vitest/utils": "4.1.10", - "es-module-lexer": "^2.0.0", - "expect-type": "^1.3.0", - "magic-string": "^0.30.21", - "obug": "^2.1.1", - "pathe": "^2.0.3", - "picomatch": "^4.0.3", - "std-env": "^4.0.0-rc.1", - "tinybench": "^2.9.0", - "tinyexec": "^1.0.2", - "tinyglobby": "^0.2.15", - "tinyrainbow": "^3.1.0", - "vite": "^6.0.0 || ^7.0.0 || ^8.0.0", - "why-is-node-running": "^2.3.0" - }, - "bin": { - "vitest": "vitest.mjs" - }, - "engines": { - "node": "^20.0.0 || ^22.0.0 || >=24.0.0" - }, - "funding": { - "url": "https://opencollective.com/vitest" - }, - "peerDependencies": { - "@edge-runtime/vm": "*", - "@opentelemetry/api": "^1.9.0", - "@types/node": "^20.0.0 || ^22.0.0 || >=24.0.0", - "@vitest/browser-playwright": "4.1.10", - "@vitest/browser-preview": "4.1.10", - "@vitest/browser-webdriverio": "4.1.10", - "@vitest/coverage-istanbul": "4.1.10", - "@vitest/coverage-v8": "4.1.10", - "@vitest/ui": "4.1.10", - "happy-dom": "*", - "jsdom": "*", - "vite": "^6.0.0 || ^7.0.0 || ^8.0.0" - }, - "peerDependenciesMeta": { - "@edge-runtime/vm": { - "optional": true - }, - "@opentelemetry/api": { - "optional": true - }, - "@types/node": { - "optional": true - }, - "@vitest/browser-playwright": { - "optional": true - }, - "@vitest/browser-preview": { - "optional": true - }, - "@vitest/browser-webdriverio": { - "optional": true - }, - "@vitest/coverage-istanbul": { - "optional": true - }, - "@vitest/coverage-v8": { - "optional": true - }, - "@vitest/ui": { - "optional": true - }, - "happy-dom": { - "optional": true - }, - "jsdom": { - "optional": true - }, - "vite": { - "optional": false - } - } - }, - "node_modules/why-is-node-running": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-2.3.0.tgz", - "integrity": "sha512-hUrmaWBdVDcxvYqnyh09zunKzROWjbZTiNy8dBEjkS7ehEDQibXJ7XvlmtbwuTclUiIyN+CyXQD4Vmko8fNm8w==", - "dev": true, - "license": "MIT", - "dependencies": { - "siginfo": "^2.0.0", - "stackback": "0.0.2" - }, - "bin": { - "why-is-node-running": "cli.js" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/widest-line": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/widest-line/-/widest-line-3.1.0.tgz", diff --git a/actions/github-action/package.json b/actions/github-action/package.json index 92a1904..11e664f 100644 --- a/actions/github-action/package.json +++ b/actions/github-action/package.json @@ -6,8 +6,7 @@ "main": "dist/index.js", "scripts": { "dev": "tsx watch src/index.ts", - "test": "vitest run", - "test:watch": "vitest", + "generate:github-schemas": "curl -fsSL --create-dirs -o schemas/github-openapi.json https://raw.githubusercontent.com/github/rest-api-description/main/descriptions/api.github.com/api.github.com.json && node ../../scripts/openapi-filter.mjs schemas/github-openapi.json schemas/github-openapi.filtered.json --roots status,check-run,workflow,workflow-run,issue-comment,issue,label,milestone,pull-request-review-comment,pull-request-review,pull-request,pull-request-simple,pull-request-merge-result,release,commit,full-repository,short-branch,branch-with-protection,git-ref,webhook-issues-closed,webhook-issues-opened,webhook-pull-request-closed,webhook-pull-request-opened,webhook-push && node ../../scripts/openapi-to-zod.mjs schemas/github-openapi.filtered.json src/generated/github-schemas.ts", "typecheck": "tsc --noEmit", "build": "vite build", "start": "node dist/index.js" @@ -17,12 +16,9 @@ "axios": "^1.7.7" }, "devDependencies": { - "@octokit/openapi-webhooks-types": "^12.1.0", - "@octokit/types": "^16.0.0", "@types/node": "^22.0.0", "tsx": "^4.0.0", "typescript": "^5.9.3", - "vite": "^8.0.3", - "vitest": "^4.1.10" + "vite": "^8.0.3" } } diff --git a/actions/github-action/schemas/github-openapi.filtered.json b/actions/github-action/schemas/github-openapi.filtered.json new file mode 100644 index 0000000..354c81a --- /dev/null +++ b/actions/github-action/schemas/github-openapi.filtered.json @@ -0,0 +1,14746 @@ +{ + "openapi": "3.0.3", + "info": { + "version": "1.1.4", + "title": "GitHub v3 REST API", + "description": "GitHub's v3 REST API.", + "license": { + "name": "MIT", + "url": "https://spdx.org/licenses/MIT" + }, + "termsOfService": "https://docs.github.com/articles/github-terms-of-service", + "contact": { + "name": "Support", + "url": "https://support.github.com/contact?tags=dotcom-rest-api" + }, + "x-github-plan": "api.github.com" + }, + "paths": {}, + "components": { + "schemas": { + "author-association": { + "title": "author_association", + "type": "string", + "example": "OWNER", + "description": "How the author is associated with the repository.", + "enum": [ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER" + ] + }, + "auto-merge": { + "title": "Auto merge", + "description": "The status of auto merging a pull request.", + "type": "object", + "properties": { + "enabled_by": { + "$ref": "#/components/schemas/simple-user" + }, + "merge_method": { + "type": "string", + "description": "The merge method to use.", + "enum": [ + "merge", + "squash", + "rebase" + ] + }, + "commit_title": { + "type": "string", + "description": "Title for the merge commit message." + }, + "commit_message": { + "type": "string", + "description": "Commit message for the merge commit." + } + }, + "required": [ + "enabled_by", + "merge_method", + "commit_title", + "commit_message" + ], + "nullable": true + }, + "branch-protection": { + "title": "Branch Protection", + "description": "Branch Protection", + "type": "object", + "properties": { + "url": { + "type": "string" + }, + "enabled": { + "type": "boolean" + }, + "required_status_checks": { + "$ref": "#/components/schemas/protected-branch-required-status-check" + }, + "enforce_admins": { + "$ref": "#/components/schemas/protected-branch-admin-enforced" + }, + "required_pull_request_reviews": { + "$ref": "#/components/schemas/protected-branch-pull-request-review" + }, + "restrictions": { + "$ref": "#/components/schemas/branch-restriction-policy" + }, + "required_linear_history": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean" + } + } + }, + "allow_force_pushes": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean" + } + } + }, + "allow_deletions": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean" + } + } + }, + "block_creations": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean" + } + } + }, + "required_conversation_resolution": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean" + } + } + }, + "name": { + "type": "string", + "example": "\"branch/with/protection\"" + }, + "protection_url": { + "type": "string", + "example": "\"https://api.github.com/repos/owner-79e94e2d36b3fd06a32bb213/AAA_Public_Repo/branches/branch/with/protection/protection\"" + }, + "required_signatures": { + "type": "object", + "properties": { + "url": { + "type": "string", + "format": "uri", + "example": "https://api.github.com/repos/octocat/Hello-World/branches/master/protection/required_signatures" + }, + "enabled": { + "type": "boolean", + "example": true + } + }, + "required": [ + "url", + "enabled" + ] + }, + "lock_branch": { + "type": "object", + "description": "Whether to set the branch as read-only. If this is true, users will not be able to push to the branch.", + "properties": { + "enabled": { + "default": false, + "type": "boolean" + } + } + }, + "allow_fork_syncing": { + "type": "object", + "description": "Whether users can pull changes from upstream when the branch is locked. Set to `true` to allow fork syncing. Set to `false` to prevent fork syncing.", + "properties": { + "enabled": { + "default": false, + "type": "boolean" + } + } + } + } + }, + "branch-restriction-policy": { + "title": "Branch Restriction Policy", + "description": "Branch Restriction Policy", + "type": "object", + "properties": { + "url": { + "type": "string", + "format": "uri" + }, + "users_url": { + "type": "string", + "format": "uri" + }, + "teams_url": { + "type": "string", + "format": "uri" + }, + "apps_url": { + "type": "string", + "format": "uri" + }, + "users": { + "type": "array", + "items": { + "type": "object", + "properties": { + "login": { + "type": "string" + }, + "id": { + "type": "integer", + "format": "int64" + }, + "node_id": { + "type": "string" + }, + "avatar_url": { + "type": "string" + }, + "gravatar_id": { + "type": "string" + }, + "url": { + "type": "string" + }, + "html_url": { + "type": "string" + }, + "followers_url": { + "type": "string" + }, + "following_url": { + "type": "string" + }, + "gists_url": { + "type": "string" + }, + "starred_url": { + "type": "string" + }, + "subscriptions_url": { + "type": "string" + }, + "organizations_url": { + "type": "string" + }, + "repos_url": { + "type": "string" + }, + "events_url": { + "type": "string" + }, + "received_events_url": { + "type": "string" + }, + "type": { + "type": "string" + }, + "site_admin": { + "type": "boolean" + }, + "user_view_type": { + "type": "string" + } + } + } + }, + "teams": { + "type": "array", + "items": { + "$ref": "#/components/schemas/team" + } + }, + "apps": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "slug": { + "type": "string" + }, + "node_id": { + "type": "string" + }, + "owner": { + "type": "object", + "properties": { + "login": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "node_id": { + "type": "string" + }, + "url": { + "type": "string" + }, + "repos_url": { + "type": "string" + }, + "events_url": { + "type": "string" + }, + "hooks_url": { + "type": "string" + }, + "issues_url": { + "type": "string" + }, + "members_url": { + "type": "string" + }, + "public_members_url": { + "type": "string" + }, + "avatar_url": { + "type": "string" + }, + "description": { + "type": "string" + }, + "gravatar_id": { + "type": "string", + "example": "\"\"" + }, + "html_url": { + "type": "string", + "example": "\"https://github.com/testorg-ea8ec76d71c3af4b\"" + }, + "followers_url": { + "type": "string", + "example": "\"https://api.github.com/users/testorg-ea8ec76d71c3af4b/followers\"" + }, + "following_url": { + "type": "string", + "example": "\"https://api.github.com/users/testorg-ea8ec76d71c3af4b/following{/other_user}\"" + }, + "gists_url": { + "type": "string", + "example": "\"https://api.github.com/users/testorg-ea8ec76d71c3af4b/gists{/gist_id}\"" + }, + "starred_url": { + "type": "string", + "example": "\"https://api.github.com/users/testorg-ea8ec76d71c3af4b/starred{/owner}{/repo}\"" + }, + "subscriptions_url": { + "type": "string", + "example": "\"https://api.github.com/users/testorg-ea8ec76d71c3af4b/subscriptions\"" + }, + "organizations_url": { + "type": "string", + "example": "\"https://api.github.com/users/testorg-ea8ec76d71c3af4b/orgs\"" + }, + "received_events_url": { + "type": "string", + "example": "\"https://api.github.com/users/testorg-ea8ec76d71c3af4b/received_events\"" + }, + "type": { + "type": "string", + "example": "\"Organization\"" + }, + "site_admin": { + "type": "boolean", + "example": false + }, + "user_view_type": { + "type": "string", + "example": "public" + } + } + }, + "name": { + "type": "string" + }, + "client_id": { + "type": "string" + }, + "description": { + "type": "string" + }, + "external_url": { + "type": "string" + }, + "html_url": { + "type": "string" + }, + "created_at": { + "type": "string" + }, + "updated_at": { + "type": "string" + }, + "permissions": { + "type": "object", + "properties": { + "metadata": { + "type": "string" + }, + "contents": { + "type": "string" + }, + "issues": { + "type": "string" + }, + "single_file": { + "type": "string" + } + } + }, + "events": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + }, + "required": [ + "url", + "users_url", + "teams_url", + "apps_url", + "users", + "teams", + "apps" + ] + }, + "branch-with-protection": { + "title": "Branch With Protection", + "description": "Branch With Protection", + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "commit": { + "$ref": "#/components/schemas/commit" + }, + "_links": { + "type": "object", + "properties": { + "html": { + "type": "string" + }, + "self": { + "type": "string", + "format": "uri" + } + }, + "required": [ + "html", + "self" + ] + }, + "protected": { + "type": "boolean" + }, + "protection": { + "$ref": "#/components/schemas/branch-protection" + }, + "protection_url": { + "type": "string", + "format": "uri" + }, + "pattern": { + "type": "string", + "example": "\"mas*\"" + }, + "required_approving_review_count": { + "type": "integer", + "example": 1 + } + }, + "required": [ + "name", + "commit", + "_links", + "protection", + "protected", + "protection_url" + ] + }, + "check-run": { + "title": "CheckRun", + "description": "A check performed on the code of a given code change", + "type": "object", + "properties": { + "id": { + "description": "The id of the check.", + "example": 21, + "type": "integer", + "format": "int64" + }, + "head_sha": { + "description": "The SHA of the commit that is being checked.", + "example": "009b8a3a9ccbb128af87f9b1c0f4c62e8a304f6d", + "type": "string" + }, + "node_id": { + "type": "string", + "example": "MDg6Q2hlY2tSdW40" + }, + "external_id": { + "type": "string", + "example": "42", + "nullable": true + }, + "url": { + "type": "string", + "example": "https://api.github.com/repos/github/hello-world/check-runs/4" + }, + "html_url": { + "type": "string", + "example": "https://github.com/github/hello-world/runs/4", + "nullable": true + }, + "details_url": { + "type": "string", + "example": "https://example.com", + "nullable": true + }, + "status": { + "description": "The phase of the lifecycle that the check is currently in. Statuses of waiting, requested, and pending are reserved for GitHub Actions check runs.", + "example": "queued", + "type": "string", + "enum": [ + "queued", + "in_progress", + "completed", + "waiting", + "requested", + "pending" + ] + }, + "conclusion": { + "type": "string", + "example": "neutral", + "enum": [ + "success", + "failure", + "neutral", + "cancelled", + "skipped", + "timed_out", + "action_required" + ], + "nullable": true + }, + "started_at": { + "type": "string", + "format": "date-time", + "example": "2018-05-04T01:14:52Z", + "nullable": true + }, + "completed_at": { + "type": "string", + "format": "date-time", + "example": "2018-05-04T01:14:52Z", + "nullable": true + }, + "output": { + "type": "object", + "properties": { + "title": { + "type": "string", + "nullable": true + }, + "summary": { + "type": "string", + "nullable": true + }, + "text": { + "type": "string", + "nullable": true + }, + "annotations_count": { + "type": "integer" + }, + "annotations_url": { + "type": "string", + "format": "uri" + } + }, + "required": [ + "title", + "summary", + "text", + "annotations_count", + "annotations_url" + ] + }, + "name": { + "description": "The name of the check.", + "example": "test-coverage", + "type": "string" + }, + "check_suite": { + "type": "object", + "properties": { + "id": { + "type": "integer" + } + }, + "required": [ + "id" + ], + "nullable": true + }, + "app": { + "$ref": "#/components/schemas/nullable-integration" + }, + "pull_requests": { + "description": "Pull requests that are open with a `head_sha` or `head_branch` that matches the check. The returned pull requests do not necessarily indicate pull requests that triggered the check.", + "type": "array", + "items": { + "$ref": "#/components/schemas/pull-request-minimal" + } + }, + "deployment": { + "$ref": "#/components/schemas/deployment-simple" + } + }, + "required": [ + "id", + "node_id", + "head_sha", + "name", + "url", + "html_url", + "details_url", + "status", + "conclusion", + "started_at", + "completed_at", + "external_id", + "check_suite", + "output", + "app", + "pull_requests" + ] + }, + "code-of-conduct": { + "title": "Code Of Conduct", + "description": "Code Of Conduct", + "type": "object", + "properties": { + "key": { + "type": "string", + "example": "contributor_covenant" + }, + "name": { + "type": "string", + "example": "Contributor Covenant" + }, + "url": { + "type": "string", + "format": "uri", + "example": "https://api.github.com/codes_of_conduct/contributor_covenant" + }, + "body": { + "type": "string", + "example": "# Contributor Covenant Code of Conduct\n\n## Our Pledge\n\nIn the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.\n\n## Our Standards\n\nExamples of behavior that contributes to creating a positive environment include:\n\n* Using welcoming and inclusive language\n* Being respectful of differing viewpoints and experiences\n* Gracefully accepting constructive criticism\n* Focusing on what is best for the community\n* Showing empathy towards other community members\n\nExamples of unacceptable behavior by participants include:\n\n* The use of sexualized language or imagery and unwelcome sexual attention or advances\n* Trolling, insulting/derogatory comments, and personal or political attacks\n* Public or private harassment\n* Publishing others' private information, such as a physical or electronic address, without explicit permission\n* Other conduct which could reasonably be considered inappropriate in a professional setting\n\n## Our Responsibilities\n\nProject maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response\n to any instances of unacceptable behavior.\n\nProject maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.\n\n## Scope\n\nThis Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address,\n posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.\n\n## Enforcement\n\nInstances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at [EMAIL]. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.\n\nProject maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.\n\n## Attribution\n\nThis Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.4, available at [http://contributor-covenant.org/version/1/4](http://contributor-covenant.org/version/1/4/).\n" + }, + "html_url": { + "type": "string", + "format": "uri", + "nullable": true + } + }, + "required": [ + "url", + "html_url", + "key", + "name" + ] + }, + "code-of-conduct-simple": { + "title": "Code Of Conduct Simple", + "description": "Code of Conduct Simple", + "type": "object", + "properties": { + "url": { + "type": "string", + "format": "uri", + "example": "https://api.github.com/repos/github/docs/community/code_of_conduct" + }, + "key": { + "type": "string", + "example": "citizen_code_of_conduct" + }, + "name": { + "type": "string", + "example": "Citizen Code of Conduct" + }, + "html_url": { + "type": "string", + "nullable": true, + "format": "uri", + "example": "https://github.com/github/docs/blob/main/CODE_OF_CONDUCT.md" + } + }, + "required": [ + "url", + "key", + "name", + "html_url" + ] + }, + "commit": { + "title": "Commit", + "description": "Commit", + "type": "object", + "properties": { + "url": { + "type": "string", + "format": "uri", + "example": "https://api.github.com/repos/octocat/Hello-World/commits/6dcb09b5b57875f334f61aebed695e2e4193db5e" + }, + "sha": { + "type": "string", + "example": "6dcb09b5b57875f334f61aebed695e2e4193db5e" + }, + "node_id": { + "type": "string", + "example": "MDY6Q29tbWl0NmRjYjA5YjViNTc4NzVmMzM0ZjYxYWViZWQ2OTVlMmU0MTkzZGI1ZQ==" + }, + "html_url": { + "type": "string", + "format": "uri", + "example": "https://github.com/octocat/Hello-World/commit/6dcb09b5b57875f334f61aebed695e2e4193db5e" + }, + "comments_url": { + "type": "string", + "format": "uri", + "example": "https://api.github.com/repos/octocat/Hello-World/commits/6dcb09b5b57875f334f61aebed695e2e4193db5e/comments" + }, + "commit": { + "type": "object", + "properties": { + "url": { + "type": "string", + "format": "uri", + "example": "https://api.github.com/repos/octocat/Hello-World/commits/6dcb09b5b57875f334f61aebed695e2e4193db5e" + }, + "author": { + "$ref": "#/components/schemas/nullable-git-user" + }, + "committer": { + "$ref": "#/components/schemas/nullable-git-user" + }, + "message": { + "type": "string", + "example": "Fix all the bugs" + }, + "comment_count": { + "type": "integer", + "example": 0 + }, + "tree": { + "type": "object", + "properties": { + "sha": { + "type": "string", + "example": "827efc6d56897b048c772eb4087f854f46256132" + }, + "url": { + "type": "string", + "format": "uri", + "example": "https://api.github.com/repos/octocat/Hello-World/tree/827efc6d56897b048c772eb4087f854f46256132" + } + }, + "required": [ + "sha", + "url" + ] + }, + "verification": { + "$ref": "#/components/schemas/verification" + } + }, + "required": [ + "author", + "committer", + "comment_count", + "message", + "tree", + "url" + ] + }, + "author": { + "nullable": true, + "oneOf": [ + { + "$ref": "#/components/schemas/simple-user" + }, + { + "$ref": "#/components/schemas/empty-object" + } + ] + }, + "committer": { + "nullable": true, + "oneOf": [ + { + "$ref": "#/components/schemas/simple-user" + }, + { + "$ref": "#/components/schemas/empty-object" + } + ] + }, + "parents": { + "type": "array", + "items": { + "type": "object", + "properties": { + "sha": { + "type": "string", + "example": "7638417db6d59f3c431d3e1f261cc637155684cd" + }, + "url": { + "type": "string", + "format": "uri", + "example": "https://api.github.com/repos/octocat/Hello-World/commits/7638417db6d59f3c431d3e1f261cc637155684cd" + }, + "html_url": { + "type": "string", + "format": "uri", + "example": "https://github.com/octocat/Hello-World/commit/7638417db6d59f3c431d3e1f261cc637155684cd" + } + }, + "required": [ + "sha", + "url" + ] + } + }, + "stats": { + "type": "object", + "properties": { + "additions": { + "type": "integer" + }, + "deletions": { + "type": "integer" + }, + "total": { + "type": "integer" + } + } + }, + "files": { + "type": "array", + "items": { + "$ref": "#/components/schemas/diff-entry" + } + } + }, + "required": [ + "url", + "sha", + "node_id", + "html_url", + "comments_url", + "commit", + "author", + "committer", + "parents" + ] + }, + "deployment-simple": { + "title": "Deployment", + "description": "A deployment created as the result of an Actions check run from a workflow that references an environment", + "type": "object", + "properties": { + "url": { + "type": "string", + "format": "uri", + "example": "https://api.github.com/repos/octocat/example/deployments/1" + }, + "id": { + "description": "Unique identifier of the deployment", + "example": 42, + "type": "integer" + }, + "node_id": { + "type": "string", + "example": "MDEwOkRlcGxveW1lbnQx" + }, + "task": { + "description": "Parameter to specify a task to execute", + "example": "deploy", + "type": "string" + }, + "original_environment": { + "type": "string", + "example": "staging" + }, + "environment": { + "description": "Name for the target deployment environment.", + "example": "production", + "type": "string" + }, + "description": { + "type": "string", + "example": "Deploy request from hubot", + "nullable": true + }, + "created_at": { + "type": "string", + "format": "date-time", + "example": "2012-07-20T01:19:13Z" + }, + "updated_at": { + "type": "string", + "format": "date-time", + "example": "2012-07-20T01:19:13Z" + }, + "statuses_url": { + "type": "string", + "format": "uri", + "example": "https://api.github.com/repos/octocat/example/deployments/1/statuses" + }, + "repository_url": { + "type": "string", + "format": "uri", + "example": "https://api.github.com/repos/octocat/example" + }, + "transient_environment": { + "description": "Specifies if the given environment is will no longer exist at some point in the future. Default: false.", + "example": true, + "type": "boolean" + }, + "production_environment": { + "description": "Specifies if the given environment is one that end-users directly interact with. Default: false.", + "example": true, + "type": "boolean" + }, + "performed_via_github_app": { + "$ref": "#/components/schemas/nullable-integration" + } + }, + "required": [ + "id", + "node_id", + "task", + "environment", + "description", + "statuses_url", + "repository_url", + "url", + "created_at", + "updated_at" + ] + }, + "diff-entry": { + "title": "Diff Entry", + "description": "Diff Entry", + "type": "object", + "properties": { + "sha": { + "type": "string", + "nullable": true, + "example": "bbcd538c8e72b8c175046e27cc8f907076331401" + }, + "filename": { + "type": "string", + "example": "file1.txt" + }, + "status": { + "type": "string", + "enum": [ + "added", + "removed", + "modified", + "renamed", + "copied", + "changed", + "unchanged" + ], + "example": "added" + }, + "additions": { + "type": "integer", + "example": 103 + }, + "deletions": { + "type": "integer", + "example": 21 + }, + "changes": { + "type": "integer", + "example": 124 + }, + "blob_url": { + "type": "string", + "format": "uri", + "example": "https://github.com/octocat/Hello-World/blob/6dcb09b5b57875f334f61aebed695e2e4193db5e/file1.txt" + }, + "raw_url": { + "type": "string", + "format": "uri", + "example": "https://github.com/octocat/Hello-World/raw/6dcb09b5b57875f334f61aebed695e2e4193db5e/file1.txt" + }, + "contents_url": { + "type": "string", + "format": "uri", + "example": "https://api.github.com/repos/octocat/Hello-World/contents/file1.txt?ref=6dcb09b5b57875f334f61aebed695e2e4193db5e" + }, + "patch": { + "type": "string", + "example": "@@ -132,7 +132,7 @@ module Test @@ -1000,7 +1000,7 @@ module Test" + }, + "previous_filename": { + "type": "string", + "example": "file.txt" + } + }, + "required": [ + "additions", + "blob_url", + "changes", + "contents_url", + "deletions", + "filename", + "raw_url", + "sha", + "status" + ] + }, + "empty-object": { + "title": "Empty Object", + "description": "An object without any properties.", + "type": "object", + "properties": {}, + "additionalProperties": false + }, + "enterprise": { + "title": "Enterprise", + "description": "An enterprise on GitHub.", + "type": "object", + "properties": { + "description": { + "description": "A short description of the enterprise.", + "type": "string", + "nullable": true + }, + "html_url": { + "type": "string", + "format": "uri", + "example": "https://github.com/enterprises/octo-business" + }, + "website_url": { + "description": "The enterprise's website URL.", + "type": "string", + "nullable": true, + "format": "uri" + }, + "id": { + "description": "Unique identifier of the enterprise", + "example": 42, + "type": "integer" + }, + "node_id": { + "type": "string", + "example": "MDEwOlJlcG9zaXRvcnkxMjk2MjY5" + }, + "name": { + "description": "The name of the enterprise.", + "type": "string", + "example": "Octo Business" + }, + "slug": { + "description": "The slug url identifier for the enterprise.", + "type": "string", + "example": "octo-business" + }, + "created_at": { + "type": "string", + "nullable": true, + "format": "date-time", + "example": "2019-01-26T19:01:12Z" + }, + "updated_at": { + "type": "string", + "nullable": true, + "format": "date-time", + "example": "2019-01-26T19:14:43Z" + }, + "avatar_url": { + "type": "string", + "format": "uri" + } + }, + "required": [ + "id", + "node_id", + "name", + "slug", + "html_url", + "created_at", + "updated_at", + "avatar_url" + ] + }, + "enterprise-webhooks": { + "title": "Enterprise", + "description": "An enterprise on GitHub. Webhook payloads contain the `enterprise` property when the webhook is configured\non an enterprise account or an organization that's part of an enterprise account. For more information,\nsee \"[About enterprise accounts](https://docs.github.com/admin/overview/about-enterprise-accounts).\"", + "type": "object", + "properties": { + "description": { + "description": "A short description of the enterprise.", + "type": "string", + "nullable": true + }, + "html_url": { + "type": "string", + "format": "uri", + "example": "https://github.com/enterprises/octo-business" + }, + "website_url": { + "description": "The enterprise's website URL.", + "type": "string", + "nullable": true, + "format": "uri" + }, + "id": { + "description": "Unique identifier of the enterprise", + "example": 42, + "type": "integer" + }, + "node_id": { + "type": "string", + "example": "MDEwOlJlcG9zaXRvcnkxMjk2MjY5" + }, + "name": { + "description": "The name of the enterprise.", + "type": "string", + "example": "Octo Business" + }, + "slug": { + "description": "The slug url identifier for the enterprise.", + "type": "string", + "example": "octo-business" + }, + "created_at": { + "type": "string", + "nullable": true, + "format": "date-time", + "example": "2019-01-26T19:01:12Z" + }, + "updated_at": { + "type": "string", + "nullable": true, + "format": "date-time", + "example": "2019-01-26T19:14:43Z" + }, + "avatar_url": { + "type": "string", + "format": "uri" + } + }, + "required": [ + "id", + "node_id", + "name", + "slug", + "html_url", + "created_at", + "updated_at", + "avatar_url" + ] + }, + "full-repository": { + "title": "Full Repository", + "description": "Full Repository", + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64", + "example": 1296269 + }, + "node_id": { + "type": "string", + "example": "MDEwOlJlcG9zaXRvcnkxMjk2MjY5" + }, + "name": { + "type": "string", + "example": "Hello-World" + }, + "full_name": { + "type": "string", + "example": "octocat/Hello-World" + }, + "owner": { + "$ref": "#/components/schemas/simple-user" + }, + "private": { + "type": "boolean" + }, + "html_url": { + "type": "string", + "format": "uri", + "example": "https://github.com/octocat/Hello-World" + }, + "description": { + "type": "string", + "example": "This your first repo!", + "nullable": true + }, + "fork": { + "type": "boolean" + }, + "url": { + "type": "string", + "format": "uri", + "example": "https://api.github.com/repos/octocat/Hello-World" + }, + "archive_url": { + "type": "string", + "example": "http://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}" + }, + "assignees_url": { + "type": "string", + "example": "http://api.github.com/repos/octocat/Hello-World/assignees{/user}" + }, + "blobs_url": { + "type": "string", + "example": "http://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}" + }, + "branches_url": { + "type": "string", + "example": "http://api.github.com/repos/octocat/Hello-World/branches{/branch}" + }, + "collaborators_url": { + "type": "string", + "example": "http://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}" + }, + "comments_url": { + "type": "string", + "example": "http://api.github.com/repos/octocat/Hello-World/comments{/number}" + }, + "commits_url": { + "type": "string", + "example": "http://api.github.com/repos/octocat/Hello-World/commits{/sha}" + }, + "compare_url": { + "type": "string", + "example": "http://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}" + }, + "contents_url": { + "type": "string", + "example": "http://api.github.com/repos/octocat/Hello-World/contents/{+path}" + }, + "contributors_url": { + "type": "string", + "format": "uri", + "example": "http://api.github.com/repos/octocat/Hello-World/contributors" + }, + "deployments_url": { + "type": "string", + "format": "uri", + "example": "http://api.github.com/repos/octocat/Hello-World/deployments" + }, + "downloads_url": { + "type": "string", + "format": "uri", + "example": "http://api.github.com/repos/octocat/Hello-World/downloads" + }, + "events_url": { + "type": "string", + "format": "uri", + "example": "http://api.github.com/repos/octocat/Hello-World/events" + }, + "forks_url": { + "type": "string", + "format": "uri", + "example": "http://api.github.com/repos/octocat/Hello-World/forks" + }, + "git_commits_url": { + "type": "string", + "example": "http://api.github.com/repos/octocat/Hello-World/git/commits{/sha}" + }, + "git_refs_url": { + "type": "string", + "example": "http://api.github.com/repos/octocat/Hello-World/git/refs{/sha}" + }, + "git_tags_url": { + "type": "string", + "example": "http://api.github.com/repos/octocat/Hello-World/git/tags{/sha}" + }, + "git_url": { + "type": "string", + "example": "git:github.com/octocat/Hello-World.git" + }, + "issue_comment_url": { + "type": "string", + "example": "http://api.github.com/repos/octocat/Hello-World/issues/comments{/number}" + }, + "issue_events_url": { + "type": "string", + "example": "http://api.github.com/repos/octocat/Hello-World/issues/events{/number}" + }, + "issues_url": { + "type": "string", + "example": "http://api.github.com/repos/octocat/Hello-World/issues{/number}" + }, + "keys_url": { + "type": "string", + "example": "http://api.github.com/repos/octocat/Hello-World/keys{/key_id}" + }, + "labels_url": { + "type": "string", + "example": "http://api.github.com/repos/octocat/Hello-World/labels{/name}" + }, + "languages_url": { + "type": "string", + "format": "uri", + "example": "http://api.github.com/repos/octocat/Hello-World/languages" + }, + "merges_url": { + "type": "string", + "format": "uri", + "example": "http://api.github.com/repos/octocat/Hello-World/merges" + }, + "milestones_url": { + "type": "string", + "example": "http://api.github.com/repos/octocat/Hello-World/milestones{/number}" + }, + "notifications_url": { + "type": "string", + "example": "http://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}" + }, + "pulls_url": { + "type": "string", + "example": "http://api.github.com/repos/octocat/Hello-World/pulls{/number}" + }, + "releases_url": { + "type": "string", + "example": "http://api.github.com/repos/octocat/Hello-World/releases{/id}" + }, + "ssh_url": { + "type": "string", + "example": "git@github.com:octocat/Hello-World.git" + }, + "stargazers_url": { + "type": "string", + "format": "uri", + "example": "http://api.github.com/repos/octocat/Hello-World/stargazers" + }, + "statuses_url": { + "type": "string", + "example": "http://api.github.com/repos/octocat/Hello-World/statuses/{sha}" + }, + "subscribers_url": { + "type": "string", + "format": "uri", + "example": "http://api.github.com/repos/octocat/Hello-World/subscribers" + }, + "subscription_url": { + "type": "string", + "format": "uri", + "example": "http://api.github.com/repos/octocat/Hello-World/subscription" + }, + "tags_url": { + "type": "string", + "format": "uri", + "example": "http://api.github.com/repos/octocat/Hello-World/tags" + }, + "teams_url": { + "type": "string", + "format": "uri", + "example": "http://api.github.com/repos/octocat/Hello-World/teams" + }, + "trees_url": { + "type": "string", + "example": "http://api.github.com/repos/octocat/Hello-World/git/trees{/sha}" + }, + "clone_url": { + "type": "string", + "example": "https://github.com/octocat/Hello-World.git" + }, + "mirror_url": { + "type": "string", + "format": "uri", + "example": "git:git.example.com/octocat/Hello-World", + "nullable": true + }, + "hooks_url": { + "type": "string", + "format": "uri", + "example": "http://api.github.com/repos/octocat/Hello-World/hooks" + }, + "svn_url": { + "type": "string", + "format": "uri", + "example": "https://svn.github.com/octocat/Hello-World" + }, + "homepage": { + "type": "string", + "format": "uri", + "example": "https://github.com", + "nullable": true + }, + "language": { + "type": "string", + "nullable": true + }, + "forks_count": { + "type": "integer", + "example": 9 + }, + "stargazers_count": { + "type": "integer", + "example": 80 + }, + "watchers_count": { + "type": "integer", + "example": 80 + }, + "size": { + "description": "The size of the repository, in kilobytes. Size is calculated hourly. When a repository is initially created, the size is 0.", + "type": "integer", + "example": 108 + }, + "default_branch": { + "type": "string", + "example": "master" + }, + "open_issues_count": { + "type": "integer", + "example": 0 + }, + "is_template": { + "type": "boolean", + "example": true + }, + "topics": { + "type": "array", + "items": { + "type": "string" + }, + "example": [ + "octocat", + "atom", + "electron", + "API" + ] + }, + "has_issues": { + "type": "boolean", + "example": true + }, + "has_projects": { + "type": "boolean", + "example": true + }, + "has_wiki": { + "type": "boolean", + "example": true + }, + "has_pages": { + "type": "boolean" + }, + "has_downloads": { + "type": "boolean", + "example": true + }, + "has_discussions": { + "type": "boolean", + "example": true + }, + "has_pull_requests": { + "type": "boolean", + "example": true + }, + "pull_request_creation_policy": { + "description": "The policy controlling who can create pull requests: all or collaborators_only.", + "type": "string", + "enum": [ + "all", + "collaborators_only" + ], + "example": "all" + }, + "archived": { + "type": "boolean" + }, + "disabled": { + "type": "boolean", + "description": "Returns whether or not this repository disabled." + }, + "visibility": { + "description": "The repository visibility: public, private, or internal.", + "type": "string", + "example": "public" + }, + "pushed_at": { + "type": "string", + "format": "date-time", + "example": "2011-01-26T19:06:43Z" + }, + "created_at": { + "type": "string", + "format": "date-time", + "example": "2011-01-26T19:01:12Z" + }, + "updated_at": { + "type": "string", + "format": "date-time", + "example": "2011-01-26T19:14:43Z" + }, + "permissions": { + "type": "object", + "properties": { + "admin": { + "type": "boolean" + }, + "maintain": { + "type": "boolean" + }, + "push": { + "type": "boolean" + }, + "triage": { + "type": "boolean" + }, + "pull": { + "type": "boolean" + } + }, + "required": [ + "admin", + "pull", + "push" + ] + }, + "allow_rebase_merge": { + "type": "boolean", + "example": true + }, + "template_repository": { + "$ref": "#/components/schemas/nullable-repository" + }, + "temp_clone_token": { + "type": "string", + "nullable": true + }, + "allow_squash_merge": { + "type": "boolean", + "example": true + }, + "allow_auto_merge": { + "type": "boolean", + "example": false + }, + "delete_branch_on_merge": { + "type": "boolean", + "example": false + }, + "allow_merge_commit": { + "type": "boolean", + "example": true + }, + "allow_update_branch": { + "type": "boolean", + "example": true + }, + "use_squash_pr_title_as_default": { + "type": "boolean", + "example": false + }, + "squash_merge_commit_title": { + "type": "string", + "example": "PR_TITLE", + "enum": [ + "PR_TITLE", + "COMMIT_OR_PR_TITLE" + ], + "description": "The default value for a squash merge commit title:\n\n- `PR_TITLE` - default to the pull request's title.\n- `COMMIT_OR_PR_TITLE` - default to the commit's title (if only one commit) or the pull request's title (when more than one commit)." + }, + "squash_merge_commit_message": { + "type": "string", + "example": "PR_BODY", + "enum": [ + "PR_BODY", + "COMMIT_MESSAGES", + "BLANK" + ], + "description": "The default value for a squash merge commit message:\n\n- `PR_BODY` - default to the pull request's body.\n- `COMMIT_MESSAGES` - default to the branch's commit messages.\n- `BLANK` - default to a blank commit message." + }, + "merge_commit_title": { + "type": "string", + "example": "PR_TITLE", + "enum": [ + "PR_TITLE", + "MERGE_MESSAGE" + ], + "description": "The default value for a merge commit title.\n\n - `PR_TITLE` - default to the pull request's title.\n - `MERGE_MESSAGE` - default to the classic title for a merge message (e.g., Merge pull request #123 from branch-name)." + }, + "merge_commit_message": { + "type": "string", + "example": "PR_BODY", + "enum": [ + "PR_BODY", + "PR_TITLE", + "BLANK" + ], + "description": "The default value for a merge commit message.\n\n- `PR_TITLE` - default to the pull request's title.\n- `PR_BODY` - default to the pull request's body.\n- `BLANK` - default to a blank commit message." + }, + "allow_forking": { + "type": "boolean", + "example": true + }, + "web_commit_signoff_required": { + "type": "boolean", + "example": false + }, + "subscribers_count": { + "type": "integer", + "example": 42 + }, + "network_count": { + "type": "integer", + "example": 0 + }, + "license": { + "$ref": "#/components/schemas/nullable-license-simple" + }, + "organization": { + "$ref": "#/components/schemas/nullable-simple-user" + }, + "parent": { + "$ref": "#/components/schemas/repository" + }, + "source": { + "$ref": "#/components/schemas/repository" + }, + "forks": { + "type": "integer" + }, + "master_branch": { + "type": "string" + }, + "open_issues": { + "type": "integer" + }, + "watchers": { + "type": "integer" + }, + "anonymous_access_enabled": { + "description": "Whether anonymous git access is allowed.", + "default": true, + "type": "boolean" + }, + "code_of_conduct": { + "$ref": "#/components/schemas/code-of-conduct-simple" + }, + "security_and_analysis": { + "$ref": "#/components/schemas/security-and-analysis" + }, + "custom_properties": { + "type": "object", + "description": "The custom properties that were defined for the repository. The keys are the custom property names, and the values are the corresponding custom property values.", + "additionalProperties": true + } + }, + "required": [ + "archive_url", + "assignees_url", + "blobs_url", + "branches_url", + "collaborators_url", + "comments_url", + "commits_url", + "compare_url", + "contents_url", + "contributors_url", + "deployments_url", + "description", + "downloads_url", + "events_url", + "fork", + "forks_url", + "full_name", + "git_commits_url", + "git_refs_url", + "git_tags_url", + "hooks_url", + "html_url", + "id", + "node_id", + "issue_comment_url", + "issue_events_url", + "issues_url", + "keys_url", + "labels_url", + "languages_url", + "merges_url", + "milestones_url", + "name", + "notifications_url", + "owner", + "private", + "pulls_url", + "releases_url", + "stargazers_url", + "statuses_url", + "subscribers_url", + "subscription_url", + "tags_url", + "teams_url", + "trees_url", + "url", + "clone_url", + "default_branch", + "forks", + "forks_count", + "git_url", + "has_issues", + "has_projects", + "has_wiki", + "has_pages", + "has_discussions", + "homepage", + "language", + "archived", + "disabled", + "mirror_url", + "open_issues", + "open_issues_count", + "license", + "pushed_at", + "size", + "ssh_url", + "stargazers_count", + "svn_url", + "watchers", + "watchers_count", + "created_at", + "updated_at", + "network_count", + "subscribers_count" + ], + "x-github-breaking-changes": [ + { + "changeset": "remove_use_squash_pr_title_as_default", + "patch": { + "properties": { + "use_squash_pr_title_as_default": null + } + }, + "version": "2026-03-10" + }, + { + "changeset": "remove_has_downloads", + "patch": { + "properties": { + "has_downloads": null + } + }, + "version": "2026-03-10" + } + ] + }, + "git-ref": { + "title": "Git Reference", + "description": "Git references within a repository", + "type": "object", + "properties": { + "ref": { + "type": "string" + }, + "node_id": { + "type": "string" + }, + "url": { + "type": "string", + "format": "uri" + }, + "object": { + "type": "object", + "properties": { + "type": { + "type": "string" + }, + "sha": { + "description": "SHA for the reference", + "example": "7638417db6d59f3c431d3e1f261cc637155684cd", + "type": "string", + "minLength": 40, + "maxLength": 40 + }, + "url": { + "type": "string", + "format": "uri" + } + }, + "required": [ + "type", + "sha", + "url" + ] + } + }, + "required": [ + "ref", + "node_id", + "url", + "object" + ] + }, + "integration": { + "title": "GitHub app", + "description": "GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub.", + "type": "object", + "nullable": true, + "properties": { + "id": { + "description": "Unique identifier of the GitHub app", + "example": 37, + "type": "integer" + }, + "slug": { + "description": "The slug name of the GitHub app", + "example": "probot-owners", + "type": "string" + }, + "node_id": { + "type": "string", + "example": "MDExOkludGVncmF0aW9uMQ==" + }, + "client_id": { + "type": "string", + "example": "\"Iv1.25b5d1e65ffc4022\"" + }, + "owner": { + "oneOf": [ + { + "$ref": "#/components/schemas/simple-user" + }, + { + "$ref": "#/components/schemas/enterprise" + } + ] + }, + "name": { + "description": "The name of the GitHub app", + "example": "Probot Owners", + "type": "string" + }, + "description": { + "type": "string", + "example": "The description of the app.", + "nullable": true + }, + "external_url": { + "type": "string", + "format": "uri", + "example": "https://example.com" + }, + "html_url": { + "type": "string", + "format": "uri", + "example": "https://github.com/apps/super-ci" + }, + "created_at": { + "type": "string", + "format": "date-time", + "example": "2017-07-08T16:18:44-04:00" + }, + "updated_at": { + "type": "string", + "format": "date-time", + "example": "2017-07-08T16:18:44-04:00" + }, + "permissions": { + "description": "The set of permissions for the GitHub app", + "type": "object", + "properties": { + "issues": { + "type": "string" + }, + "checks": { + "type": "string" + }, + "metadata": { + "type": "string" + }, + "contents": { + "type": "string" + }, + "deployments": { + "type": "string" + } + }, + "additionalProperties": { + "type": "string" + }, + "example": { + "issues": "read", + "deployments": "write" + } + }, + "events": { + "description": "The list of events for the GitHub app. Note that the `installation_target`, `security_advisory`, and `meta` events are not included because they are global events and not specific to an installation.", + "example": [ + "label", + "deployment" + ], + "type": "array", + "items": { + "type": "string" + } + }, + "installations_count": { + "description": "The number of installations associated with the GitHub app. Only returned when the integration is requesting details about itself.", + "example": 5, + "type": "integer" + } + }, + "required": [ + "id", + "node_id", + "owner", + "name", + "description", + "external_url", + "html_url", + "created_at", + "updated_at", + "permissions", + "events" + ] + }, + "issue": { + "title": "Issue", + "description": "Issues are a great way to keep track of tasks, enhancements, and bugs for your projects.", + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "node_id": { + "type": "string" + }, + "url": { + "description": "URL for the issue", + "example": "https://api.github.com/repositories/42/issues/1", + "type": "string", + "format": "uri" + }, + "repository_url": { + "type": "string", + "format": "uri" + }, + "labels_url": { + "type": "string" + }, + "comments_url": { + "type": "string", + "format": "uri" + }, + "events_url": { + "type": "string", + "format": "uri" + }, + "html_url": { + "type": "string", + "format": "uri" + }, + "number": { + "description": "Number uniquely identifying the issue within its repository", + "example": 42, + "type": "integer" + }, + "state": { + "description": "State of the issue; either 'open' or 'closed'", + "example": "open", + "type": "string" + }, + "state_reason": { + "description": "The reason for the current state", + "example": "not_planned", + "type": "string", + "nullable": true, + "enum": [ + "completed", + "reopened", + "not_planned", + "duplicate" + ] + }, + "title": { + "description": "Title of the issue", + "example": "Widget creation fails in Safari on OS X 10.8", + "type": "string" + }, + "body": { + "description": "Contents of the issue", + "example": "It looks like the new widget form is broken on Safari. When I try and create the widget, Safari crashes. This is reproducible on 10.8, but not 10.9. Maybe a browser bug?", + "type": "string", + "nullable": true + }, + "user": { + "$ref": "#/components/schemas/nullable-simple-user" + }, + "labels": { + "description": "Labels to associate with this issue; pass one or more label names to replace the set of labels on this issue; send an empty array to clear all labels from the issue; note that the labels are silently dropped for users without push access to the repository", + "example": [ + "bug", + "registration" + ], + "type": "array", + "items": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "node_id": { + "type": "string" + }, + "url": { + "type": "string", + "format": "uri" + }, + "name": { + "type": "string" + }, + "description": { + "type": "string", + "nullable": true + }, + "color": { + "type": "string", + "nullable": true + }, + "default": { + "type": "boolean" + }, + "archived_by": { + "description": "The user who archived the label, or `null` if it has not been archived.", + "nullable": true, + "allOf": [ + { + "$ref": "#/components/schemas/simple-user" + } + ] + } + } + } + ] + } + }, + "assignee": { + "$ref": "#/components/schemas/nullable-simple-user" + }, + "assignees": { + "type": "array", + "items": { + "$ref": "#/components/schemas/simple-user" + } + }, + "milestone": { + "$ref": "#/components/schemas/nullable-milestone" + }, + "locked": { + "type": "boolean" + }, + "active_lock_reason": { + "type": "string", + "nullable": true + }, + "comments": { + "type": "integer" + }, + "pull_request": { + "type": "object", + "properties": { + "merged_at": { + "type": "string", + "format": "date-time", + "nullable": true + }, + "diff_url": { + "type": "string", + "format": "uri", + "nullable": true + }, + "html_url": { + "type": "string", + "format": "uri", + "nullable": true + }, + "patch_url": { + "type": "string", + "format": "uri", + "nullable": true + }, + "url": { + "type": "string", + "format": "uri", + "nullable": true + } + }, + "required": [ + "diff_url", + "html_url", + "patch_url", + "url" + ] + }, + "closed_at": { + "type": "string", + "format": "date-time", + "nullable": true + }, + "created_at": { + "type": "string", + "format": "date-time" + }, + "updated_at": { + "type": "string", + "format": "date-time" + }, + "draft": { + "type": "boolean" + }, + "closed_by": { + "$ref": "#/components/schemas/nullable-simple-user" + }, + "body_html": { + "type": "string" + }, + "body_text": { + "type": "string" + }, + "timeline_url": { + "type": "string", + "format": "uri" + }, + "type": { + "$ref": "#/components/schemas/issue-type" + }, + "repository": { + "$ref": "#/components/schemas/repository" + }, + "performed_via_github_app": { + "$ref": "#/components/schemas/nullable-integration" + }, + "author_association": { + "$ref": "#/components/schemas/author-association" + }, + "reactions": { + "$ref": "#/components/schemas/reaction-rollup" + }, + "sub_issues_summary": { + "$ref": "#/components/schemas/sub-issues-summary" + }, + "parent_issue_url": { + "description": "URL to get the parent issue of this issue, if it is a sub-issue", + "type": "string", + "format": "uri", + "nullable": true + }, + "pinned_comment": { + "$ref": "#/components/schemas/nullable-issue-comment" + }, + "issue_dependencies_summary": { + "$ref": "#/components/schemas/issue-dependencies-summary" + }, + "issue_field_values": { + "type": "array", + "items": { + "$ref": "#/components/schemas/issue-field-value" + } + } + }, + "required": [ + "assignee", + "closed_at", + "comments", + "comments_url", + "events_url", + "html_url", + "id", + "node_id", + "labels", + "labels_url", + "milestone", + "number", + "repository_url", + "state", + "locked", + "title", + "url", + "user", + "created_at", + "updated_at" + ], + "x-github-breaking-changes": [ + { + "changeset": "deprecate_beta_media_type", + "patch": { + "properties": { + "pull_request": { + "type": "object", + "properties": { + "merged_at": { + "nullable": false + }, + "diff_url": { + "nullable": false + }, + "html_url": { + "nullable": false + }, + "patch_url": { + "nullable": false + }, + "url": { + "nullable": false + } + } + } + } + }, + "version": "2026-03-10" + }, + { + "changeset": "remove_singular_assignee_from_issues_and_pull_requests", + "patch": { + "properties": { + "assignee": null + }, + "required": [ + "closed_at", + "comments", + "comments_url", + "events_url", + "html_url", + "id", + "node_id", + "labels", + "labels_url", + "milestone", + "number", + "repository_url", + "state", + "locked", + "title", + "url", + "user", + "created_at", + "updated_at" + ] + }, + "version": "2026-03-10" + } + ] + }, + "issue-comment": { + "title": "Issue Comment", + "description": "Comments provide a way for people to collaborate on an issue.", + "type": "object", + "properties": { + "id": { + "description": "Unique identifier of the issue comment", + "example": 42, + "type": "integer", + "format": "int64" + }, + "node_id": { + "type": "string" + }, + "url": { + "description": "URL for the issue comment", + "example": "https://api.github.com/repositories/42/issues/comments/1", + "type": "string", + "format": "uri" + }, + "body": { + "description": "Contents of the issue comment", + "example": "What version of Safari were you using when you observed this bug?", + "type": "string" + }, + "body_text": { + "type": "string" + }, + "body_html": { + "type": "string" + }, + "html_url": { + "type": "string", + "format": "uri" + }, + "user": { + "$ref": "#/components/schemas/nullable-simple-user" + }, + "created_at": { + "type": "string", + "format": "date-time", + "example": "2011-04-14T16:00:49Z" + }, + "updated_at": { + "type": "string", + "format": "date-time", + "example": "2011-04-14T16:00:49Z" + }, + "issue_url": { + "type": "string", + "format": "uri" + }, + "author_association": { + "$ref": "#/components/schemas/author-association" + }, + "performed_via_github_app": { + "$ref": "#/components/schemas/nullable-integration" + }, + "reactions": { + "$ref": "#/components/schemas/reaction-rollup" + }, + "pin": { + "$ref": "#/components/schemas/nullable-pinned-issue-comment" + }, + "minimized": { + "$ref": "#/components/schemas/nullable-issue-comment-minimized" + } + }, + "required": [ + "id", + "node_id", + "html_url", + "issue_url", + "user", + "url", + "created_at", + "updated_at" + ] + }, + "issue-dependencies-summary": { + "title": "Issue Dependencies Summary", + "type": "object", + "properties": { + "blocked_by": { + "type": "integer" + }, + "blocking": { + "type": "integer" + }, + "total_blocked_by": { + "type": "integer" + }, + "total_blocking": { + "type": "integer" + } + }, + "required": [ + "blocked_by", + "blocking", + "total_blocked_by", + "total_blocking" + ] + }, + "issue-field-value": { + "title": "Issue Field Value", + "description": "A value assigned to an issue field", + "type": "object", + "properties": { + "issue_field_id": { + "description": "Unique identifier for the issue field.", + "type": "integer", + "format": "int64", + "example": 1 + }, + "issue_field_name": { + "description": "The human-readable name of the issue field.", + "type": "string", + "example": "Priority" + }, + "node_id": { + "type": "string", + "example": "IFT_GDKND" + }, + "data_type": { + "description": "The data type of the issue field", + "type": "string", + "enum": [ + "text", + "single_select", + "multi_select", + "number", + "date" + ], + "example": "text" + }, + "value": { + "description": "The value of the issue field", + "anyOf": [ + { + "type": "string", + "example": "Sample text" + }, + { + "type": "number", + "example": 42.5 + }, + { + "type": "integer", + "example": 1 + } + ], + "nullable": true + }, + "single_select_option": { + "description": "Details about the selected option (only present for single_select fields)", + "type": "object", + "properties": { + "id": { + "description": "Unique identifier for the option.", + "type": "integer", + "format": "int64", + "example": 1 + }, + "name": { + "description": "The name of the option", + "type": "string", + "example": "High" + }, + "color": { + "description": "The color of the option", + "type": "string", + "example": "red" + } + }, + "required": [ + "id", + "name", + "color" + ], + "nullable": true + }, + "multi_select_options": { + "description": "Details about the selected options", + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "description": "Unique identifier for the option.", + "type": "integer", + "format": "int64", + "example": 1 + }, + "name": { + "description": "The name of the option", + "type": "string", + "example": "High" + }, + "color": { + "description": "The color of the option", + "type": "string", + "example": "red" + } + }, + "required": [ + "id", + "name", + "color" + ] + }, + "nullable": true + } + }, + "required": [ + "issue_field_id", + "node_id", + "data_type", + "value" + ] + }, + "issue-type": { + "title": "Issue Type", + "description": "The type assigned to the issue. This is only present for issues in repositories where issue types are supported.", + "type": "object", + "nullable": true, + "properties": { + "id": { + "type": "integer", + "description": "The unique identifier of the issue type." + }, + "node_id": { + "type": "string", + "description": "The node identifier of the issue type." + }, + "name": { + "type": "string", + "description": "The name of the issue type." + }, + "description": { + "type": "string", + "description": "The description of the issue type.", + "nullable": true + }, + "color": { + "type": "string", + "description": "The color of the issue type.", + "enum": [ + "gray", + "blue", + "green", + "yellow", + "orange", + "red", + "pink", + "purple" + ], + "nullable": true + }, + "created_at": { + "type": "string", + "description": "The time the issue type created.", + "format": "date-time" + }, + "updated_at": { + "type": "string", + "description": "The time the issue type last updated.", + "format": "date-time" + }, + "is_enabled": { + "type": "boolean", + "description": "The enabled state of the issue type." + } + }, + "required": [ + "id", + "node_id", + "name", + "description" + ] + }, + "label": { + "title": "Label", + "description": "Color-coded labels help you categorize and filter your issues (just like labels in Gmail).", + "type": "object", + "properties": { + "id": { + "description": "Unique identifier for the label.", + "type": "integer", + "format": "int64", + "example": 208045946 + }, + "node_id": { + "type": "string", + "example": "MDU6TGFiZWwyMDgwNDU5NDY=" + }, + "url": { + "description": "URL for the label", + "example": "https://api.github.com/repositories/42/labels/bug", + "type": "string", + "format": "uri" + }, + "name": { + "description": "The name of the label.", + "example": "bug", + "type": "string" + }, + "description": { + "description": "Optional description of the label, such as its purpose.", + "type": "string", + "example": "Something isn't working", + "nullable": true + }, + "color": { + "description": "6-character hex code, without the leading #, identifying the color", + "example": "FFFFFF", + "type": "string" + }, + "default": { + "description": "Whether this label comes by default in a new repository.", + "type": "boolean", + "example": true + }, + "archived_at": { + "description": "Timestamp indicating when the label was archived, or `null` if it has not been archived.", + "type": "string", + "nullable": true, + "format": "date-time", + "example": "2023-01-01T12:00:00Z" + }, + "archived_by": { + "description": "The user who archived the label, or `null` if it has not been archived.", + "nullable": true, + "allOf": [ + { + "$ref": "#/components/schemas/simple-user" + } + ] + } + }, + "required": [ + "id", + "node_id", + "url", + "name", + "description", + "color", + "default", + "archived_at", + "archived_by" + ] + }, + "link": { + "title": "Link", + "description": "Hypermedia Link", + "type": "object", + "properties": { + "href": { + "type": "string" + } + }, + "required": [ + "href" + ] + }, + "milestone": { + "title": "Milestone", + "description": "A collection of related issues and pull requests.", + "type": "object", + "properties": { + "url": { + "type": "string", + "format": "uri", + "example": "https://api.github.com/repos/octocat/Hello-World/milestones/1" + }, + "html_url": { + "type": "string", + "format": "uri", + "example": "https://github.com/octocat/Hello-World/milestones/v1.0" + }, + "labels_url": { + "type": "string", + "format": "uri", + "example": "https://api.github.com/repos/octocat/Hello-World/milestones/1/labels" + }, + "id": { + "type": "integer", + "example": 1002604 + }, + "node_id": { + "type": "string", + "example": "MDk6TWlsZXN0b25lMTAwMjYwNA==" + }, + "number": { + "description": "The number of the milestone.", + "type": "integer", + "example": 42 + }, + "state": { + "description": "The state of the milestone.", + "example": "open", + "type": "string", + "enum": [ + "open", + "closed" + ], + "default": "open" + }, + "title": { + "description": "The title of the milestone.", + "example": "v1.0", + "type": "string" + }, + "description": { + "type": "string", + "example": "Tracking milestone for version 1.0", + "nullable": true + }, + "creator": { + "$ref": "#/components/schemas/nullable-simple-user" + }, + "open_issues": { + "type": "integer", + "example": 4 + }, + "closed_issues": { + "type": "integer", + "example": 8 + }, + "created_at": { + "type": "string", + "format": "date-time", + "example": "2011-04-10T20:09:31Z" + }, + "updated_at": { + "type": "string", + "format": "date-time", + "example": "2014-03-03T18:58:10Z" + }, + "closed_at": { + "type": "string", + "format": "date-time", + "example": "2013-02-12T13:22:01Z", + "nullable": true + }, + "due_on": { + "type": "string", + "format": "date-time", + "example": "2012-10-09T23:39:01Z", + "nullable": true + } + }, + "required": [ + "closed_issues", + "creator", + "description", + "due_on", + "closed_at", + "id", + "node_id", + "labels_url", + "html_url", + "number", + "open_issues", + "state", + "title", + "url", + "created_at", + "updated_at" + ] + }, + "minimal-repository": { + "title": "Minimal Repository", + "description": "Minimal Repository", + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64", + "example": 1296269 + }, + "node_id": { + "type": "string", + "example": "MDEwOlJlcG9zaXRvcnkxMjk2MjY5" + }, + "name": { + "type": "string", + "example": "Hello-World" + }, + "full_name": { + "type": "string", + "example": "octocat/Hello-World" + }, + "owner": { + "$ref": "#/components/schemas/simple-user" + }, + "private": { + "type": "boolean" + }, + "html_url": { + "type": "string", + "format": "uri", + "example": "https://github.com/octocat/Hello-World" + }, + "description": { + "type": "string", + "example": "This your first repo!", + "nullable": true + }, + "fork": { + "type": "boolean" + }, + "url": { + "type": "string", + "format": "uri", + "example": "https://api.github.com/repos/octocat/Hello-World" + }, + "archive_url": { + "type": "string", + "example": "http://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}" + }, + "assignees_url": { + "type": "string", + "example": "http://api.github.com/repos/octocat/Hello-World/assignees{/user}" + }, + "blobs_url": { + "type": "string", + "example": "http://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}" + }, + "branches_url": { + "type": "string", + "example": "http://api.github.com/repos/octocat/Hello-World/branches{/branch}" + }, + "collaborators_url": { + "type": "string", + "example": "http://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}" + }, + "comments_url": { + "type": "string", + "example": "http://api.github.com/repos/octocat/Hello-World/comments{/number}" + }, + "commits_url": { + "type": "string", + "example": "http://api.github.com/repos/octocat/Hello-World/commits{/sha}" + }, + "compare_url": { + "type": "string", + "example": "http://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}" + }, + "contents_url": { + "type": "string", + "example": "http://api.github.com/repos/octocat/Hello-World/contents/{+path}" + }, + "contributors_url": { + "type": "string", + "format": "uri", + "example": "http://api.github.com/repos/octocat/Hello-World/contributors" + }, + "deployments_url": { + "type": "string", + "format": "uri", + "example": "http://api.github.com/repos/octocat/Hello-World/deployments" + }, + "downloads_url": { + "type": "string", + "format": "uri", + "example": "http://api.github.com/repos/octocat/Hello-World/downloads" + }, + "events_url": { + "type": "string", + "format": "uri", + "example": "http://api.github.com/repos/octocat/Hello-World/events" + }, + "forks_url": { + "type": "string", + "format": "uri", + "example": "http://api.github.com/repos/octocat/Hello-World/forks" + }, + "git_commits_url": { + "type": "string", + "example": "http://api.github.com/repos/octocat/Hello-World/git/commits{/sha}" + }, + "git_refs_url": { + "type": "string", + "example": "http://api.github.com/repos/octocat/Hello-World/git/refs{/sha}" + }, + "git_tags_url": { + "type": "string", + "example": "http://api.github.com/repos/octocat/Hello-World/git/tags{/sha}" + }, + "git_url": { + "type": "string" + }, + "issue_comment_url": { + "type": "string", + "example": "http://api.github.com/repos/octocat/Hello-World/issues/comments{/number}" + }, + "issue_events_url": { + "type": "string", + "example": "http://api.github.com/repos/octocat/Hello-World/issues/events{/number}" + }, + "issues_url": { + "type": "string", + "example": "http://api.github.com/repos/octocat/Hello-World/issues{/number}" + }, + "keys_url": { + "type": "string", + "example": "http://api.github.com/repos/octocat/Hello-World/keys{/key_id}" + }, + "labels_url": { + "type": "string", + "example": "http://api.github.com/repos/octocat/Hello-World/labels{/name}" + }, + "languages_url": { + "type": "string", + "format": "uri", + "example": "http://api.github.com/repos/octocat/Hello-World/languages" + }, + "merges_url": { + "type": "string", + "format": "uri", + "example": "http://api.github.com/repos/octocat/Hello-World/merges" + }, + "milestones_url": { + "type": "string", + "example": "http://api.github.com/repos/octocat/Hello-World/milestones{/number}" + }, + "notifications_url": { + "type": "string", + "example": "http://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}" + }, + "pulls_url": { + "type": "string", + "example": "http://api.github.com/repos/octocat/Hello-World/pulls{/number}" + }, + "releases_url": { + "type": "string", + "example": "http://api.github.com/repos/octocat/Hello-World/releases{/id}" + }, + "ssh_url": { + "type": "string" + }, + "stargazers_url": { + "type": "string", + "format": "uri", + "example": "http://api.github.com/repos/octocat/Hello-World/stargazers" + }, + "statuses_url": { + "type": "string", + "example": "http://api.github.com/repos/octocat/Hello-World/statuses/{sha}" + }, + "subscribers_url": { + "type": "string", + "format": "uri", + "example": "http://api.github.com/repos/octocat/Hello-World/subscribers" + }, + "subscription_url": { + "type": "string", + "format": "uri", + "example": "http://api.github.com/repos/octocat/Hello-World/subscription" + }, + "tags_url": { + "type": "string", + "format": "uri", + "example": "http://api.github.com/repos/octocat/Hello-World/tags" + }, + "teams_url": { + "type": "string", + "format": "uri", + "example": "http://api.github.com/repos/octocat/Hello-World/teams" + }, + "trees_url": { + "type": "string", + "example": "http://api.github.com/repos/octocat/Hello-World/git/trees{/sha}" + }, + "clone_url": { + "type": "string" + }, + "mirror_url": { + "type": "string", + "nullable": true + }, + "hooks_url": { + "type": "string", + "format": "uri", + "example": "http://api.github.com/repos/octocat/Hello-World/hooks" + }, + "svn_url": { + "type": "string" + }, + "homepage": { + "type": "string", + "nullable": true + }, + "language": { + "type": "string", + "nullable": true + }, + "forks_count": { + "type": "integer" + }, + "stargazers_count": { + "type": "integer" + }, + "watchers_count": { + "type": "integer" + }, + "size": { + "description": "The size of the repository, in kilobytes. Size is calculated hourly. When a repository is initially created, the size is 0.", + "type": "integer" + }, + "default_branch": { + "type": "string" + }, + "open_issues_count": { + "type": "integer" + }, + "is_template": { + "type": "boolean" + }, + "topics": { + "type": "array", + "items": { + "type": "string" + } + }, + "has_issues": { + "type": "boolean" + }, + "has_projects": { + "type": "boolean" + }, + "has_wiki": { + "type": "boolean" + }, + "has_pages": { + "type": "boolean" + }, + "has_downloads": { + "type": "boolean" + }, + "has_discussions": { + "type": "boolean" + }, + "has_pull_requests": { + "type": "boolean" + }, + "pull_request_creation_policy": { + "description": "The policy controlling who can create pull requests: all or collaborators_only.", + "type": "string", + "enum": [ + "all", + "collaborators_only" + ] + }, + "archived": { + "type": "boolean" + }, + "disabled": { + "type": "boolean" + }, + "visibility": { + "type": "string" + }, + "pushed_at": { + "type": "string", + "format": "date-time", + "example": "2011-01-26T19:06:43Z", + "nullable": true + }, + "created_at": { + "type": "string", + "format": "date-time", + "example": "2011-01-26T19:01:12Z", + "nullable": true + }, + "updated_at": { + "type": "string", + "format": "date-time", + "example": "2011-01-26T19:14:43Z", + "nullable": true + }, + "permissions": { + "type": "object", + "properties": { + "admin": { + "type": "boolean" + }, + "maintain": { + "type": "boolean" + }, + "push": { + "type": "boolean" + }, + "triage": { + "type": "boolean" + }, + "pull": { + "type": "boolean" + } + } + }, + "role_name": { + "type": "string", + "example": "admin" + }, + "temp_clone_token": { + "type": "string" + }, + "delete_branch_on_merge": { + "type": "boolean" + }, + "subscribers_count": { + "type": "integer" + }, + "network_count": { + "type": "integer" + }, + "code_of_conduct": { + "$ref": "#/components/schemas/code-of-conduct" + }, + "license": { + "type": "object", + "properties": { + "key": { + "type": "string" + }, + "name": { + "type": "string" + }, + "spdx_id": { + "type": "string" + }, + "url": { + "type": "string", + "nullable": true + }, + "node_id": { + "type": "string" + } + }, + "nullable": true + }, + "forks": { + "type": "integer", + "example": 0 + }, + "open_issues": { + "type": "integer", + "example": 0 + }, + "watchers": { + "type": "integer", + "example": 0 + }, + "allow_forking": { + "type": "boolean" + }, + "web_commit_signoff_required": { + "type": "boolean", + "example": false + }, + "security_and_analysis": { + "$ref": "#/components/schemas/security-and-analysis" + }, + "custom_properties": { + "type": "object", + "description": "The custom properties that were defined for the repository. The keys are the custom property names, and the values are the corresponding custom property values.", + "additionalProperties": true + } + }, + "required": [ + "archive_url", + "assignees_url", + "blobs_url", + "branches_url", + "collaborators_url", + "comments_url", + "commits_url", + "compare_url", + "contents_url", + "contributors_url", + "deployments_url", + "description", + "downloads_url", + "events_url", + "fork", + "forks_url", + "full_name", + "git_commits_url", + "git_refs_url", + "git_tags_url", + "hooks_url", + "html_url", + "id", + "node_id", + "issue_comment_url", + "issue_events_url", + "issues_url", + "keys_url", + "labels_url", + "languages_url", + "merges_url", + "milestones_url", + "name", + "notifications_url", + "owner", + "private", + "pulls_url", + "releases_url", + "stargazers_url", + "statuses_url", + "subscribers_url", + "subscription_url", + "tags_url", + "teams_url", + "trees_url", + "url" + ], + "x-github-breaking-changes": [ + { + "changeset": "remove_has_downloads", + "patch": { + "properties": { + "has_downloads": null + } + }, + "version": "2026-03-10" + } + ] + }, + "nullable-git-user": { + "title": "Git User", + "description": "Metaproperties for Git author/committer information.", + "type": "object", + "properties": { + "name": { + "type": "string", + "example": "\"Chris Wanstrath\"" + }, + "email": { + "type": "string", + "example": "\"chris@ozmm.org\"" + }, + "date": { + "type": "string", + "format": "date-time", + "example": "\"2007-10-29T02:42:39.000-07:00\"" + } + }, + "nullable": true + }, + "nullable-integration": { + "title": "GitHub app", + "description": "GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub.", + "type": "object", + "nullable": true, + "properties": { + "id": { + "description": "Unique identifier of the GitHub app", + "example": 37, + "type": "integer" + }, + "slug": { + "description": "The slug name of the GitHub app", + "example": "probot-owners", + "type": "string" + }, + "node_id": { + "type": "string", + "example": "MDExOkludGVncmF0aW9uMQ==" + }, + "client_id": { + "type": "string", + "example": "\"Iv1.25b5d1e65ffc4022\"" + }, + "owner": { + "oneOf": [ + { + "$ref": "#/components/schemas/simple-user" + }, + { + "$ref": "#/components/schemas/enterprise" + } + ] + }, + "name": { + "description": "The name of the GitHub app", + "example": "Probot Owners", + "type": "string" + }, + "description": { + "type": "string", + "example": "The description of the app.", + "nullable": true + }, + "external_url": { + "type": "string", + "format": "uri", + "example": "https://example.com" + }, + "html_url": { + "type": "string", + "format": "uri", + "example": "https://github.com/apps/super-ci" + }, + "created_at": { + "type": "string", + "format": "date-time", + "example": "2017-07-08T16:18:44-04:00" + }, + "updated_at": { + "type": "string", + "format": "date-time", + "example": "2017-07-08T16:18:44-04:00" + }, + "permissions": { + "description": "The set of permissions for the GitHub app", + "type": "object", + "properties": { + "issues": { + "type": "string" + }, + "checks": { + "type": "string" + }, + "metadata": { + "type": "string" + }, + "contents": { + "type": "string" + }, + "deployments": { + "type": "string" + } + }, + "additionalProperties": { + "type": "string" + }, + "example": { + "issues": "read", + "deployments": "write" + } + }, + "events": { + "description": "The list of events for the GitHub app. Note that the `installation_target`, `security_advisory`, and `meta` events are not included because they are global events and not specific to an installation.", + "example": [ + "label", + "deployment" + ], + "type": "array", + "items": { + "type": "string" + } + }, + "installations_count": { + "description": "The number of installations associated with the GitHub app. Only returned when the integration is requesting details about itself.", + "example": 5, + "type": "integer" + } + }, + "required": [ + "id", + "node_id", + "owner", + "name", + "description", + "external_url", + "html_url", + "created_at", + "updated_at", + "permissions", + "events" + ] + }, + "nullable-issue-comment": { + "title": "Issue Comment", + "description": "Comments provide a way for people to collaborate on an issue.", + "type": "object", + "properties": { + "id": { + "description": "Unique identifier of the issue comment", + "example": 42, + "type": "integer", + "format": "int64" + }, + "node_id": { + "type": "string" + }, + "url": { + "description": "URL for the issue comment", + "example": "https://api.github.com/repositories/42/issues/comments/1", + "type": "string", + "format": "uri" + }, + "body": { + "description": "Contents of the issue comment", + "example": "What version of Safari were you using when you observed this bug?", + "type": "string" + }, + "body_text": { + "type": "string" + }, + "body_html": { + "type": "string" + }, + "html_url": { + "type": "string", + "format": "uri" + }, + "user": { + "$ref": "#/components/schemas/nullable-simple-user" + }, + "created_at": { + "type": "string", + "format": "date-time", + "example": "2011-04-14T16:00:49Z" + }, + "updated_at": { + "type": "string", + "format": "date-time", + "example": "2011-04-14T16:00:49Z" + }, + "issue_url": { + "type": "string", + "format": "uri" + }, + "author_association": { + "$ref": "#/components/schemas/author-association" + }, + "performed_via_github_app": { + "$ref": "#/components/schemas/nullable-integration" + }, + "reactions": { + "$ref": "#/components/schemas/reaction-rollup" + }, + "pin": { + "$ref": "#/components/schemas/nullable-pinned-issue-comment" + }, + "minimized": { + "$ref": "#/components/schemas/nullable-issue-comment-minimized" + } + }, + "required": [ + "id", + "node_id", + "html_url", + "issue_url", + "user", + "url", + "created_at", + "updated_at" + ], + "nullable": true + }, + "nullable-issue-comment-minimized": { + "title": "Minimized Issue Comment", + "description": "Details about why an issue comment was minimized.", + "type": "object", + "properties": { + "reason": { + "description": "The reason the comment was minimized.", + "type": "string", + "nullable": true, + "example": "low-quality" + } + }, + "required": [ + "reason" + ], + "nullable": true + }, + "nullable-license-simple": { + "title": "License Simple", + "description": "License Simple", + "type": "object", + "properties": { + "key": { + "type": "string", + "example": "mit" + }, + "name": { + "type": "string", + "example": "MIT License" + }, + "url": { + "type": "string", + "nullable": true, + "format": "uri", + "example": "https://api.github.com/licenses/mit" + }, + "spdx_id": { + "type": "string", + "nullable": true, + "example": "MIT" + }, + "node_id": { + "type": "string", + "example": "MDc6TGljZW5zZW1pdA==" + }, + "html_url": { + "type": "string", + "format": "uri" + } + }, + "required": [ + "key", + "name", + "url", + "spdx_id", + "node_id" + ], + "nullable": true + }, + "nullable-milestone": { + "title": "Milestone", + "description": "A collection of related issues and pull requests.", + "type": "object", + "properties": { + "url": { + "type": "string", + "format": "uri", + "example": "https://api.github.com/repos/octocat/Hello-World/milestones/1" + }, + "html_url": { + "type": "string", + "format": "uri", + "example": "https://github.com/octocat/Hello-World/milestones/v1.0" + }, + "labels_url": { + "type": "string", + "format": "uri", + "example": "https://api.github.com/repos/octocat/Hello-World/milestones/1/labels" + }, + "id": { + "type": "integer", + "example": 1002604 + }, + "node_id": { + "type": "string", + "example": "MDk6TWlsZXN0b25lMTAwMjYwNA==" + }, + "number": { + "description": "The number of the milestone.", + "type": "integer", + "example": 42 + }, + "state": { + "description": "The state of the milestone.", + "example": "open", + "type": "string", + "enum": [ + "open", + "closed" + ], + "default": "open" + }, + "title": { + "description": "The title of the milestone.", + "example": "v1.0", + "type": "string" + }, + "description": { + "type": "string", + "example": "Tracking milestone for version 1.0", + "nullable": true + }, + "creator": { + "$ref": "#/components/schemas/nullable-simple-user" + }, + "open_issues": { + "type": "integer", + "example": 4 + }, + "closed_issues": { + "type": "integer", + "example": 8 + }, + "created_at": { + "type": "string", + "format": "date-time", + "example": "2011-04-10T20:09:31Z" + }, + "updated_at": { + "type": "string", + "format": "date-time", + "example": "2014-03-03T18:58:10Z" + }, + "closed_at": { + "type": "string", + "format": "date-time", + "example": "2013-02-12T13:22:01Z", + "nullable": true + }, + "due_on": { + "type": "string", + "format": "date-time", + "example": "2012-10-09T23:39:01Z", + "nullable": true + } + }, + "required": [ + "closed_issues", + "creator", + "description", + "due_on", + "closed_at", + "id", + "node_id", + "labels_url", + "html_url", + "number", + "open_issues", + "state", + "title", + "url", + "created_at", + "updated_at" + ], + "nullable": true + }, + "nullable-pinned-issue-comment": { + "title": "Pinned Issue Comment", + "description": "Context around who pinned an issue comment and when it was pinned.", + "type": "object", + "properties": { + "pinned_at": { + "type": "string", + "format": "date-time", + "example": "2011-04-14T16:00:49Z" + }, + "pinned_by": { + "$ref": "#/components/schemas/nullable-simple-user" + } + }, + "required": [ + "pinned_at", + "pinned_by" + ], + "nullable": true + }, + "nullable-repository": { + "title": "Repository", + "description": "A repository on GitHub.", + "type": "object", + "properties": { + "id": { + "description": "Unique identifier of the repository", + "example": 42, + "type": "integer", + "format": "int64" + }, + "node_id": { + "type": "string", + "example": "MDEwOlJlcG9zaXRvcnkxMjk2MjY5" + }, + "name": { + "description": "The name of the repository.", + "type": "string", + "example": "Team Environment" + }, + "full_name": { + "type": "string", + "example": "octocat/Hello-World" + }, + "license": { + "$ref": "#/components/schemas/nullable-license-simple" + }, + "forks": { + "type": "integer" + }, + "permissions": { + "type": "object", + "properties": { + "admin": { + "type": "boolean" + }, + "pull": { + "type": "boolean" + }, + "triage": { + "type": "boolean" + }, + "push": { + "type": "boolean" + }, + "maintain": { + "type": "boolean" + } + }, + "required": [ + "admin", + "pull", + "push" + ] + }, + "owner": { + "$ref": "#/components/schemas/simple-user" + }, + "private": { + "description": "Whether the repository is private or public.", + "default": false, + "type": "boolean" + }, + "html_url": { + "type": "string", + "format": "uri", + "example": "https://github.com/octocat/Hello-World" + }, + "description": { + "type": "string", + "example": "This your first repo!", + "nullable": true + }, + "fork": { + "type": "boolean" + }, + "url": { + "type": "string", + "format": "uri", + "example": "https://api.github.com/repos/octocat/Hello-World" + }, + "archive_url": { + "type": "string", + "example": "http://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}" + }, + "assignees_url": { + "type": "string", + "example": "http://api.github.com/repos/octocat/Hello-World/assignees{/user}" + }, + "blobs_url": { + "type": "string", + "example": "http://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}" + }, + "branches_url": { + "type": "string", + "example": "http://api.github.com/repos/octocat/Hello-World/branches{/branch}" + }, + "collaborators_url": { + "type": "string", + "example": "http://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}" + }, + "comments_url": { + "type": "string", + "example": "http://api.github.com/repos/octocat/Hello-World/comments{/number}" + }, + "commits_url": { + "type": "string", + "example": "http://api.github.com/repos/octocat/Hello-World/commits{/sha}" + }, + "compare_url": { + "type": "string", + "example": "http://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}" + }, + "contents_url": { + "type": "string", + "example": "http://api.github.com/repos/octocat/Hello-World/contents/{+path}" + }, + "contributors_url": { + "type": "string", + "format": "uri", + "example": "http://api.github.com/repos/octocat/Hello-World/contributors" + }, + "deployments_url": { + "type": "string", + "format": "uri", + "example": "http://api.github.com/repos/octocat/Hello-World/deployments" + }, + "downloads_url": { + "type": "string", + "format": "uri", + "example": "http://api.github.com/repos/octocat/Hello-World/downloads" + }, + "events_url": { + "type": "string", + "format": "uri", + "example": "http://api.github.com/repos/octocat/Hello-World/events" + }, + "forks_url": { + "type": "string", + "format": "uri", + "example": "http://api.github.com/repos/octocat/Hello-World/forks" + }, + "git_commits_url": { + "type": "string", + "example": "http://api.github.com/repos/octocat/Hello-World/git/commits{/sha}" + }, + "git_refs_url": { + "type": "string", + "example": "http://api.github.com/repos/octocat/Hello-World/git/refs{/sha}" + }, + "git_tags_url": { + "type": "string", + "example": "http://api.github.com/repos/octocat/Hello-World/git/tags{/sha}" + }, + "git_url": { + "type": "string", + "example": "git:github.com/octocat/Hello-World.git" + }, + "issue_comment_url": { + "type": "string", + "example": "http://api.github.com/repos/octocat/Hello-World/issues/comments{/number}" + }, + "issue_events_url": { + "type": "string", + "example": "http://api.github.com/repos/octocat/Hello-World/issues/events{/number}" + }, + "issues_url": { + "type": "string", + "example": "http://api.github.com/repos/octocat/Hello-World/issues{/number}" + }, + "keys_url": { + "type": "string", + "example": "http://api.github.com/repos/octocat/Hello-World/keys{/key_id}" + }, + "labels_url": { + "type": "string", + "example": "http://api.github.com/repos/octocat/Hello-World/labels{/name}" + }, + "languages_url": { + "type": "string", + "format": "uri", + "example": "http://api.github.com/repos/octocat/Hello-World/languages" + }, + "merges_url": { + "type": "string", + "format": "uri", + "example": "http://api.github.com/repos/octocat/Hello-World/merges" + }, + "milestones_url": { + "type": "string", + "example": "http://api.github.com/repos/octocat/Hello-World/milestones{/number}" + }, + "notifications_url": { + "type": "string", + "example": "http://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}" + }, + "pulls_url": { + "type": "string", + "example": "http://api.github.com/repos/octocat/Hello-World/pulls{/number}" + }, + "releases_url": { + "type": "string", + "example": "http://api.github.com/repos/octocat/Hello-World/releases{/id}" + }, + "ssh_url": { + "type": "string", + "example": "git@github.com:octocat/Hello-World.git" + }, + "stargazers_url": { + "type": "string", + "format": "uri", + "example": "http://api.github.com/repos/octocat/Hello-World/stargazers" + }, + "statuses_url": { + "type": "string", + "example": "http://api.github.com/repos/octocat/Hello-World/statuses/{sha}" + }, + "subscribers_url": { + "type": "string", + "format": "uri", + "example": "http://api.github.com/repos/octocat/Hello-World/subscribers" + }, + "subscription_url": { + "type": "string", + "format": "uri", + "example": "http://api.github.com/repos/octocat/Hello-World/subscription" + }, + "tags_url": { + "type": "string", + "format": "uri", + "example": "http://api.github.com/repos/octocat/Hello-World/tags" + }, + "teams_url": { + "type": "string", + "format": "uri", + "example": "http://api.github.com/repos/octocat/Hello-World/teams" + }, + "trees_url": { + "type": "string", + "example": "http://api.github.com/repos/octocat/Hello-World/git/trees{/sha}" + }, + "clone_url": { + "type": "string", + "example": "https://github.com/octocat/Hello-World.git" + }, + "mirror_url": { + "type": "string", + "format": "uri", + "example": "git:git.example.com/octocat/Hello-World", + "nullable": true + }, + "hooks_url": { + "type": "string", + "format": "uri", + "example": "http://api.github.com/repos/octocat/Hello-World/hooks" + }, + "svn_url": { + "type": "string", + "format": "uri", + "example": "https://svn.github.com/octocat/Hello-World" + }, + "homepage": { + "type": "string", + "format": "uri", + "example": "https://github.com", + "nullable": true + }, + "language": { + "type": "string", + "nullable": true + }, + "forks_count": { + "type": "integer", + "example": 9 + }, + "stargazers_count": { + "type": "integer", + "example": 80 + }, + "watchers_count": { + "type": "integer", + "example": 80 + }, + "size": { + "description": "The size of the repository, in kilobytes. Size is calculated hourly. When a repository is initially created, the size is 0.", + "type": "integer", + "example": 108 + }, + "default_branch": { + "description": "The default branch of the repository.", + "type": "string", + "example": "master" + }, + "open_issues_count": { + "type": "integer", + "example": 0 + }, + "is_template": { + "description": "Whether this repository acts as a template that can be used to generate new repositories.", + "default": false, + "type": "boolean", + "example": true + }, + "topics": { + "type": "array", + "items": { + "type": "string" + } + }, + "has_issues": { + "description": "Whether issues are enabled.", + "default": true, + "type": "boolean", + "example": true + }, + "has_projects": { + "description": "Whether projects are enabled.", + "default": true, + "type": "boolean", + "example": true + }, + "has_wiki": { + "description": "Whether the wiki is enabled.", + "default": true, + "type": "boolean", + "example": true + }, + "has_pages": { + "type": "boolean" + }, + "has_downloads": { + "description": "Whether downloads are enabled.", + "default": true, + "type": "boolean", + "example": true, + "deprecated": true + }, + "has_discussions": { + "description": "Whether discussions are enabled.", + "default": false, + "type": "boolean", + "example": true + }, + "has_pull_requests": { + "description": "Whether pull requests are enabled.", + "default": true, + "type": "boolean", + "example": true + }, + "pull_request_creation_policy": { + "description": "The policy controlling who can create pull requests: all or collaborators_only.", + "type": "string", + "enum": [ + "all", + "collaborators_only" + ], + "example": "all" + }, + "archived": { + "description": "Whether the repository is archived.", + "default": false, + "type": "boolean" + }, + "disabled": { + "type": "boolean", + "description": "Returns whether or not this repository disabled." + }, + "visibility": { + "description": "The repository visibility: public, private, or internal.", + "default": "public", + "type": "string" + }, + "pushed_at": { + "type": "string", + "format": "date-time", + "example": "2011-01-26T19:06:43Z", + "nullable": true + }, + "created_at": { + "type": "string", + "format": "date-time", + "example": "2011-01-26T19:01:12Z", + "nullable": true + }, + "updated_at": { + "type": "string", + "format": "date-time", + "example": "2011-01-26T19:14:43Z", + "nullable": true + }, + "allow_rebase_merge": { + "description": "Whether to allow rebase merges for pull requests.", + "default": true, + "type": "boolean", + "example": true + }, + "temp_clone_token": { + "type": "string" + }, + "allow_squash_merge": { + "description": "Whether to allow squash merges for pull requests.", + "default": true, + "type": "boolean", + "example": true + }, + "allow_auto_merge": { + "description": "Whether to allow Auto-merge to be used on pull requests.", + "default": false, + "type": "boolean", + "example": false + }, + "delete_branch_on_merge": { + "description": "Whether to delete head branches when pull requests are merged", + "default": false, + "type": "boolean", + "example": false + }, + "allow_update_branch": { + "description": "Whether or not a pull request head branch that is behind its base branch can always be updated even if it is not required to be up to date before merging.", + "default": false, + "type": "boolean", + "example": false + }, + "use_squash_pr_title_as_default": { + "type": "boolean", + "description": "Whether a squash merge commit can use the pull request title as default. **This property is closing down. Please use `squash_merge_commit_title` instead.", + "default": false, + "deprecated": true + }, + "squash_merge_commit_title": { + "type": "string", + "enum": [ + "PR_TITLE", + "COMMIT_OR_PR_TITLE" + ], + "description": "The default value for a squash merge commit title:\n\n- `PR_TITLE` - default to the pull request's title.\n- `COMMIT_OR_PR_TITLE` - default to the commit's title (if only one commit) or the pull request's title (when more than one commit)." + }, + "squash_merge_commit_message": { + "type": "string", + "enum": [ + "PR_BODY", + "COMMIT_MESSAGES", + "BLANK" + ], + "description": "The default value for a squash merge commit message:\n\n- `PR_BODY` - default to the pull request's body.\n- `COMMIT_MESSAGES` - default to the branch's commit messages.\n- `BLANK` - default to a blank commit message." + }, + "merge_commit_title": { + "type": "string", + "enum": [ + "PR_TITLE", + "MERGE_MESSAGE" + ], + "description": "The default value for a merge commit title.\n\n- `PR_TITLE` - default to the pull request's title.\n- `MERGE_MESSAGE` - default to the classic title for a merge message (e.g., Merge pull request #123 from branch-name)." + }, + "merge_commit_message": { + "type": "string", + "enum": [ + "PR_BODY", + "PR_TITLE", + "BLANK" + ], + "description": "The default value for a merge commit message.\n\n- `PR_TITLE` - default to the pull request's title.\n- `PR_BODY` - default to the pull request's body.\n- `BLANK` - default to a blank commit message." + }, + "allow_merge_commit": { + "description": "Whether to allow merge commits for pull requests.", + "default": true, + "type": "boolean", + "example": true + }, + "allow_forking": { + "description": "Whether to allow forking this repo", + "type": "boolean" + }, + "web_commit_signoff_required": { + "description": "Whether to require contributors to sign off on web-based commits", + "default": false, + "type": "boolean" + }, + "open_issues": { + "type": "integer" + }, + "watchers": { + "type": "integer" + }, + "master_branch": { + "type": "string" + }, + "starred_at": { + "type": "string", + "example": "\"2020-07-09T00:17:42Z\"" + }, + "anonymous_access_enabled": { + "type": "boolean", + "description": "Whether anonymous git access is enabled for this repository" + }, + "code_search_index_status": { + "type": "object", + "description": "The status of the code search index for this repository", + "properties": { + "lexical_search_ok": { + "type": "boolean" + }, + "lexical_commit_sha": { + "type": "string" + } + } + } + }, + "required": [ + "archive_url", + "assignees_url", + "blobs_url", + "branches_url", + "collaborators_url", + "comments_url", + "commits_url", + "compare_url", + "contents_url", + "contributors_url", + "deployments_url", + "description", + "downloads_url", + "events_url", + "fork", + "forks_url", + "full_name", + "git_commits_url", + "git_refs_url", + "git_tags_url", + "hooks_url", + "html_url", + "id", + "node_id", + "issue_comment_url", + "issue_events_url", + "issues_url", + "keys_url", + "labels_url", + "languages_url", + "merges_url", + "milestones_url", + "name", + "notifications_url", + "owner", + "private", + "pulls_url", + "releases_url", + "stargazers_url", + "statuses_url", + "subscribers_url", + "subscription_url", + "tags_url", + "teams_url", + "trees_url", + "url", + "clone_url", + "default_branch", + "forks", + "forks_count", + "git_url", + "has_downloads", + "has_issues", + "has_projects", + "has_wiki", + "has_pages", + "homepage", + "language", + "archived", + "disabled", + "mirror_url", + "open_issues", + "open_issues_count", + "license", + "pushed_at", + "size", + "ssh_url", + "stargazers_count", + "svn_url", + "watchers", + "watchers_count", + "created_at", + "updated_at" + ], + "x-github-breaking-changes": [ + { + "changeset": "remove_use_squash_pr_title_as_default", + "patch": { + "properties": { + "use_squash_pr_title_as_default": null + } + }, + "version": "2026-03-10" + }, + { + "changeset": "deprecate_beta_media_type", + "patch": { + "properties": { + "master_branch": null + } + }, + "version": "2026-03-10" + }, + { + "changeset": "remove_has_downloads", + "patch": { + "properties": { + "has_downloads": null + }, + "required": [ + "archive_url", + "assignees_url", + "blobs_url", + "branches_url", + "collaborators_url", + "comments_url", + "commits_url", + "compare_url", + "contents_url", + "contributors_url", + "deployments_url", + "description", + "downloads_url", + "events_url", + "fork", + "forks_url", + "full_name", + "git_commits_url", + "git_refs_url", + "git_tags_url", + "hooks_url", + "html_url", + "id", + "node_id", + "issue_comment_url", + "issue_events_url", + "issues_url", + "keys_url", + "labels_url", + "languages_url", + "merges_url", + "milestones_url", + "name", + "notifications_url", + "owner", + "private", + "pulls_url", + "releases_url", + "stargazers_url", + "statuses_url", + "subscribers_url", + "subscription_url", + "tags_url", + "teams_url", + "trees_url", + "url", + "clone_url", + "default_branch", + "forks", + "forks_count", + "git_url", + "has_issues", + "has_projects", + "has_wiki", + "has_pages", + "homepage", + "language", + "archived", + "disabled", + "mirror_url", + "open_issues", + "open_issues_count", + "license", + "pushed_at", + "size", + "ssh_url", + "stargazers_count", + "svn_url", + "watchers", + "watchers_count", + "created_at", + "updated_at" + ] + }, + "version": "2026-03-10" + } + ], + "nullable": true + }, + "nullable-simple-commit": { + "title": "Simple Commit", + "description": "A commit.", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "SHA for the commit", + "example": "7638417db6d59f3c431d3e1f261cc637155684cd" + }, + "tree_id": { + "type": "string", + "description": "SHA for the commit's tree" + }, + "message": { + "description": "Message describing the purpose of the commit", + "example": "Fix #42", + "type": "string" + }, + "timestamp": { + "description": "Timestamp of the commit", + "example": "2014-08-09T08:02:04+12:00", + "format": "date-time", + "type": "string" + }, + "author": { + "type": "object", + "description": "Information about the Git author", + "properties": { + "name": { + "description": "Name of the commit's author", + "example": "Monalisa Octocat", + "type": "string" + }, + "email": { + "description": "Git email address of the commit's author", + "example": "monalisa.octocat@example.com", + "type": "string", + "format": "email" + } + }, + "required": [ + "name", + "email" + ], + "nullable": true + }, + "committer": { + "type": "object", + "description": "Information about the Git committer", + "properties": { + "name": { + "description": "Name of the commit's committer", + "example": "Monalisa Octocat", + "type": "string" + }, + "email": { + "description": "Git email address of the commit's committer", + "example": "monalisa.octocat@example.com", + "type": "string", + "format": "email" + } + }, + "required": [ + "name", + "email" + ], + "nullable": true + } + }, + "required": [ + "id", + "tree_id", + "message", + "timestamp", + "author", + "committer" + ], + "nullable": true + }, + "nullable-simple-user": { + "title": "Simple User", + "description": "A GitHub user.", + "type": "object", + "properties": { + "name": { + "nullable": true, + "type": "string" + }, + "email": { + "nullable": true, + "type": "string" + }, + "login": { + "type": "string", + "example": "octocat" + }, + "id": { + "type": "integer", + "format": "int64", + "example": 1 + }, + "node_id": { + "type": "string", + "example": "MDQ6VXNlcjE=" + }, + "avatar_url": { + "type": "string", + "format": "uri", + "example": "https://github.com/images/error/octocat_happy.gif" + }, + "gravatar_id": { + "type": "string", + "example": "41d064eb2195891e12d0413f63227ea7", + "nullable": true + }, + "url": { + "type": "string", + "format": "uri", + "example": "https://api.github.com/users/octocat" + }, + "html_url": { + "type": "string", + "format": "uri", + "example": "https://github.com/octocat" + }, + "followers_url": { + "type": "string", + "format": "uri", + "example": "https://api.github.com/users/octocat/followers" + }, + "following_url": { + "type": "string", + "example": "https://api.github.com/users/octocat/following{/other_user}" + }, + "gists_url": { + "type": "string", + "example": "https://api.github.com/users/octocat/gists{/gist_id}" + }, + "starred_url": { + "type": "string", + "example": "https://api.github.com/users/octocat/starred{/owner}{/repo}" + }, + "subscriptions_url": { + "type": "string", + "format": "uri", + "example": "https://api.github.com/users/octocat/subscriptions" + }, + "organizations_url": { + "type": "string", + "format": "uri", + "example": "https://api.github.com/users/octocat/orgs" + }, + "repos_url": { + "type": "string", + "format": "uri", + "example": "https://api.github.com/users/octocat/repos" + }, + "events_url": { + "type": "string", + "example": "https://api.github.com/users/octocat/events{/privacy}" + }, + "received_events_url": { + "type": "string", + "format": "uri", + "example": "https://api.github.com/users/octocat/received_events" + }, + "type": { + "type": "string", + "example": "User" + }, + "site_admin": { + "type": "boolean" + }, + "starred_at": { + "type": "string", + "example": "\"2020-07-09T00:17:55Z\"" + }, + "user_view_type": { + "type": "string", + "example": "public" + } + }, + "required": [ + "avatar_url", + "events_url", + "followers_url", + "following_url", + "gists_url", + "gravatar_id", + "html_url", + "id", + "node_id", + "login", + "organizations_url", + "received_events_url", + "repos_url", + "site_admin", + "starred_url", + "subscriptions_url", + "type", + "url" + ], + "nullable": true + }, + "nullable-team-simple": { + "title": "Team Simple", + "description": "Groups of organization members that gives permissions on specified repositories.", + "type": "object", + "properties": { + "id": { + "description": "Unique identifier of the team", + "type": "integer", + "example": 1 + }, + "node_id": { + "type": "string", + "example": "MDQ6VGVhbTE=" + }, + "url": { + "description": "URL for the team", + "type": "string", + "format": "uri", + "example": "https://api.github.com/organizations/1/team/1" + }, + "members_url": { + "type": "string", + "example": "https://api.github.com/organizations/1/team/1/members{/member}" + }, + "name": { + "description": "Name of the team", + "type": "string", + "example": "Justice League" + }, + "description": { + "description": "Description of the team", + "type": "string", + "nullable": true, + "example": "A great team." + }, + "permission": { + "description": "Permission that the team will have for its repositories", + "type": "string", + "example": "admin" + }, + "privacy": { + "description": "The level of privacy this team should have", + "type": "string", + "example": "closed" + }, + "notification_setting": { + "description": "The notification setting the team has set", + "type": "string", + "example": "notifications_enabled" + }, + "html_url": { + "type": "string", + "format": "uri", + "example": "https://github.com/orgs/rails/teams/core" + }, + "repositories_url": { + "type": "string", + "format": "uri", + "example": "https://api.github.com/organizations/1/team/1/repos" + }, + "slug": { + "type": "string", + "example": "justice-league" + }, + "ldap_dn": { + "description": "Distinguished Name (DN) that team maps to within LDAP environment", + "example": "uid=example,ou=users,dc=github,dc=com", + "type": "string" + }, + "type": { + "description": "The ownership type of the team", + "type": "string", + "enum": [ + "enterprise", + "organization" + ] + }, + "organization_id": { + "type": "integer", + "description": "Unique identifier of the organization to which this team belongs", + "example": 37 + }, + "enterprise_id": { + "type": "integer", + "description": "Unique identifier of the enterprise to which this team belongs", + "example": 42 + } + }, + "required": [ + "id", + "node_id", + "url", + "members_url", + "name", + "description", + "permission", + "html_url", + "repositories_url", + "slug", + "type" + ], + "nullable": true + }, + "organization-simple-webhooks": { + "title": "Organization Simple", + "description": "A GitHub organization. Webhook payloads contain the `organization` property when the webhook is configured for an\norganization, or when the event occurs from activity in a repository owned by an organization.", + "type": "object", + "properties": { + "login": { + "type": "string", + "example": "github" + }, + "id": { + "type": "integer", + "example": 1 + }, + "node_id": { + "type": "string", + "example": "MDEyOk9yZ2FuaXphdGlvbjE=" + }, + "url": { + "type": "string", + "format": "uri", + "example": "https://api.github.com/orgs/github" + }, + "repos_url": { + "type": "string", + "format": "uri", + "example": "https://api.github.com/orgs/github/repos" + }, + "events_url": { + "type": "string", + "format": "uri", + "example": "https://api.github.com/orgs/github/events" + }, + "hooks_url": { + "type": "string", + "example": "https://api.github.com/orgs/github/hooks" + }, + "issues_url": { + "type": "string", + "example": "https://api.github.com/orgs/github/issues" + }, + "members_url": { + "type": "string", + "example": "https://api.github.com/orgs/github/members{/member}" + }, + "public_members_url": { + "type": "string", + "example": "https://api.github.com/orgs/github/public_members{/member}" + }, + "avatar_url": { + "type": "string", + "example": "https://github.com/images/error/octocat_happy.gif" + }, + "description": { + "type": "string", + "example": "A great organization", + "nullable": true + } + }, + "required": [ + "login", + "url", + "id", + "node_id", + "repos_url", + "events_url", + "hooks_url", + "issues_url", + "members_url", + "public_members_url", + "avatar_url", + "description" + ] + }, + "protected-branch-admin-enforced": { + "title": "Protected Branch Admin Enforced", + "description": "Protected Branch Admin Enforced", + "type": "object", + "properties": { + "url": { + "type": "string", + "format": "uri", + "example": "https://api.github.com/repos/octocat/Hello-World/branches/master/protection/enforce_admins" + }, + "enabled": { + "type": "boolean", + "example": true + } + }, + "required": [ + "url", + "enabled" + ] + }, + "protected-branch-pull-request-review": { + "title": "Protected Branch Pull Request Review", + "description": "Protected Branch Pull Request Review", + "type": "object", + "properties": { + "url": { + "type": "string", + "format": "uri", + "example": "https://api.github.com/repos/octocat/Hello-World/branches/master/protection/dismissal_restrictions" + }, + "dismissal_restrictions": { + "type": "object", + "properties": { + "users": { + "description": "The list of users with review dismissal access.", + "type": "array", + "items": { + "$ref": "#/components/schemas/simple-user" + } + }, + "teams": { + "description": "The list of teams with review dismissal access.", + "type": "array", + "items": { + "$ref": "#/components/schemas/team" + } + }, + "apps": { + "description": "The list of apps with review dismissal access.", + "type": "array", + "items": { + "$ref": "#/components/schemas/integration" + } + }, + "url": { + "type": "string", + "example": "\"https://api.github.com/repos/the-org/an-org-repo/branches/master/protection/dismissal_restrictions\"" + }, + "users_url": { + "type": "string", + "example": "\"https://api.github.com/repos/the-org/an-org-repo/branches/master/protection/dismissal_restrictions/users\"" + }, + "teams_url": { + "type": "string", + "example": "\"https://api.github.com/repos/the-org/an-org-repo/branches/master/protection/dismissal_restrictions/teams\"" + } + } + }, + "bypass_pull_request_allowances": { + "type": "object", + "description": "Allow specific users, teams, or apps to bypass pull request requirements.", + "properties": { + "users": { + "description": "The list of users allowed to bypass pull request requirements.", + "type": "array", + "items": { + "$ref": "#/components/schemas/simple-user" + } + }, + "teams": { + "description": "The list of teams allowed to bypass pull request requirements.", + "type": "array", + "items": { + "$ref": "#/components/schemas/team" + } + }, + "apps": { + "description": "The list of apps allowed to bypass pull request requirements.", + "type": "array", + "items": { + "$ref": "#/components/schemas/integration" + } + } + } + }, + "dismiss_stale_reviews": { + "type": "boolean", + "example": true + }, + "require_code_owner_reviews": { + "type": "boolean", + "example": true + }, + "required_approving_review_count": { + "type": "integer", + "minimum": 0, + "maximum": 6, + "example": 2 + }, + "require_last_push_approval": { + "description": "Whether the most recent push must be approved by someone other than the person who pushed it.", + "type": "boolean", + "example": true, + "default": false + } + }, + "required": [ + "dismiss_stale_reviews", + "require_code_owner_reviews" + ] + }, + "protected-branch-required-status-check": { + "title": "Protected Branch Required Status Check", + "description": "Protected Branch Required Status Check", + "type": "object", + "properties": { + "url": { + "type": "string" + }, + "enforcement_level": { + "type": "string" + }, + "contexts": { + "type": "array", + "items": { + "type": "string" + } + }, + "checks": { + "type": "array", + "items": { + "type": "object", + "properties": { + "context": { + "type": "string" + }, + "app_id": { + "type": "integer", + "nullable": true + } + }, + "required": [ + "context", + "app_id" + ] + } + }, + "contexts_url": { + "type": "string" + }, + "strict": { + "type": "boolean" + } + }, + "required": [ + "contexts", + "checks" + ] + }, + "pull-request": { + "type": "object", + "title": "Pull Request", + "description": "Pull requests let you tell others about changes you've pushed to a repository on GitHub. Once a pull request is sent, interested parties can review the set of changes, discuss potential modifications, and even push follow-up commits if necessary.", + "properties": { + "url": { + "type": "string", + "format": "uri", + "example": "https://api.github.com/repos/octocat/Hello-World/pulls/1347" + }, + "id": { + "type": "integer", + "format": "int64", + "example": 1 + }, + "node_id": { + "type": "string", + "example": "MDExOlB1bGxSZXF1ZXN0MQ==" + }, + "html_url": { + "type": "string", + "format": "uri", + "example": "https://github.com/octocat/Hello-World/pull/1347" + }, + "diff_url": { + "type": "string", + "format": "uri", + "example": "https://github.com/octocat/Hello-World/pull/1347.diff" + }, + "patch_url": { + "type": "string", + "format": "uri", + "example": "https://github.com/octocat/Hello-World/pull/1347.patch" + }, + "issue_url": { + "type": "string", + "format": "uri", + "example": "https://api.github.com/repos/octocat/Hello-World/issues/1347" + }, + "commits_url": { + "type": "string", + "format": "uri", + "example": "https://api.github.com/repos/octocat/Hello-World/pulls/1347/commits" + }, + "review_comments_url": { + "type": "string", + "format": "uri", + "example": "https://api.github.com/repos/octocat/Hello-World/pulls/1347/comments" + }, + "review_comment_url": { + "type": "string", + "example": "https://api.github.com/repos/octocat/Hello-World/pulls/comments{/number}" + }, + "comments_url": { + "type": "string", + "format": "uri", + "example": "https://api.github.com/repos/octocat/Hello-World/issues/1347/comments" + }, + "statuses_url": { + "type": "string", + "format": "uri", + "example": "https://api.github.com/repos/octocat/Hello-World/statuses/6dcb09b5b57875f334f61aebed695e2e4193db5e" + }, + "number": { + "description": "Number uniquely identifying the pull request within its repository.", + "example": 42, + "type": "integer" + }, + "state": { + "description": "State of this Pull Request. Either `open` or `closed`.", + "enum": [ + "open", + "closed" + ], + "example": "open", + "type": "string" + }, + "locked": { + "type": "boolean", + "example": true + }, + "title": { + "description": "The title of the pull request.", + "example": "Amazing new feature", + "type": "string" + }, + "user": { + "$ref": "#/components/schemas/simple-user" + }, + "body": { + "type": "string", + "example": "Please pull these awesome changes", + "nullable": true + }, + "labels": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "node_id": { + "type": "string" + }, + "url": { + "type": "string" + }, + "name": { + "type": "string" + }, + "description": { + "type": "string", + "nullable": true + }, + "color": { + "type": "string" + }, + "default": { + "type": "boolean" + }, + "archived_by": { + "description": "The user who archived the label, or `null` if it has not been archived.", + "nullable": true, + "allOf": [ + { + "$ref": "#/components/schemas/simple-user" + } + ] + } + }, + "required": [ + "id", + "node_id", + "url", + "name", + "description", + "color", + "default", + "archived_at", + "archived_by" + ] + } + }, + "milestone": { + "$ref": "#/components/schemas/nullable-milestone" + }, + "active_lock_reason": { + "type": "string", + "example": "too heated", + "nullable": true + }, + "created_at": { + "type": "string", + "format": "date-time", + "example": "2011-01-26T19:01:12Z" + }, + "updated_at": { + "type": "string", + "format": "date-time", + "example": "2011-01-26T19:01:12Z" + }, + "closed_at": { + "type": "string", + "format": "date-time", + "example": "2011-01-26T19:01:12Z", + "nullable": true + }, + "merged_at": { + "type": "string", + "format": "date-time", + "example": "2011-01-26T19:01:12Z", + "nullable": true + }, + "merge_commit_sha": { + "type": "string", + "example": "e5bd3914e2e596debea16f433f57875b5b90bcd6", + "nullable": true + }, + "assignee": { + "$ref": "#/components/schemas/nullable-simple-user" + }, + "assignees": { + "type": "array", + "items": { + "$ref": "#/components/schemas/simple-user" + } + }, + "requested_reviewers": { + "type": "array", + "items": { + "$ref": "#/components/schemas/simple-user" + } + }, + "requested_teams": { + "type": "array", + "items": { + "$ref": "#/components/schemas/team-simple" + } + }, + "head": { + "type": "object", + "properties": { + "label": { + "type": "string" + }, + "ref": { + "type": "string" + }, + "repo": { + "$ref": "#/components/schemas/repository" + }, + "sha": { + "type": "string" + }, + "user": { + "$ref": "#/components/schemas/simple-user" + } + }, + "required": [ + "label", + "ref", + "repo", + "sha", + "user" + ] + }, + "base": { + "type": "object", + "properties": { + "label": { + "type": "string" + }, + "ref": { + "type": "string" + }, + "repo": { + "$ref": "#/components/schemas/repository" + }, + "sha": { + "type": "string" + }, + "user": { + "$ref": "#/components/schemas/simple-user" + } + }, + "required": [ + "label", + "ref", + "repo", + "sha", + "user" + ] + }, + "_links": { + "type": "object", + "properties": { + "comments": { + "$ref": "#/components/schemas/link" + }, + "commits": { + "$ref": "#/components/schemas/link" + }, + "statuses": { + "$ref": "#/components/schemas/link" + }, + "html": { + "$ref": "#/components/schemas/link" + }, + "issue": { + "$ref": "#/components/schemas/link" + }, + "review_comments": { + "$ref": "#/components/schemas/link" + }, + "review_comment": { + "$ref": "#/components/schemas/link" + }, + "self": { + "$ref": "#/components/schemas/link" + } + }, + "required": [ + "comments", + "commits", + "statuses", + "html", + "issue", + "review_comments", + "review_comment", + "self" + ] + }, + "author_association": { + "$ref": "#/components/schemas/author-association" + }, + "auto_merge": { + "$ref": "#/components/schemas/auto-merge" + }, + "stack": { + "$ref": "#/components/schemas/pull-request-stack" + }, + "draft": { + "description": "Indicates whether or not the pull request is a draft.", + "example": false, + "type": "boolean" + }, + "merged": { + "type": "boolean" + }, + "mergeable": { + "type": "boolean", + "example": true, + "nullable": true + }, + "rebaseable": { + "type": "boolean", + "example": true, + "nullable": true + }, + "mergeable_state": { + "type": "string", + "example": "clean" + }, + "merged_by": { + "$ref": "#/components/schemas/nullable-simple-user" + }, + "comments": { + "type": "integer", + "example": 10 + }, + "review_comments": { + "type": "integer", + "example": 0 + }, + "maintainer_can_modify": { + "description": "Indicates whether maintainers can modify the pull request.", + "example": true, + "type": "boolean" + }, + "commits": { + "type": "integer", + "example": 3 + }, + "additions": { + "type": "integer", + "example": 100 + }, + "deletions": { + "type": "integer", + "example": 3 + }, + "changed_files": { + "type": "integer", + "example": 5 + } + }, + "required": [ + "_links", + "assignee", + "labels", + "base", + "body", + "closed_at", + "comments_url", + "commits_url", + "created_at", + "diff_url", + "head", + "html_url", + "id", + "node_id", + "issue_url", + "merge_commit_sha", + "merged_at", + "milestone", + "number", + "patch_url", + "review_comment_url", + "review_comments_url", + "statuses_url", + "state", + "locked", + "title", + "updated_at", + "url", + "user", + "author_association", + "auto_merge", + "additions", + "changed_files", + "comments", + "commits", + "deletions", + "mergeable", + "mergeable_state", + "merged", + "maintainer_can_modify", + "merged_by", + "review_comments" + ], + "x-github-breaking-changes": [ + { + "changeset": "remove_pull_request_merge_commit_sha", + "patch": { + "properties": { + "merge_commit_sha": null + }, + "required": [ + "_links", + "assignee", + "labels", + "base", + "body", + "closed_at", + "comments_url", + "commits_url", + "created_at", + "diff_url", + "head", + "html_url", + "id", + "node_id", + "issue_url", + "merged_at", + "milestone", + "number", + "patch_url", + "review_comment_url", + "review_comments_url", + "statuses_url", + "state", + "locked", + "title", + "updated_at", + "url", + "user", + "author_association", + "auto_merge", + "additions", + "changed_files", + "comments", + "commits", + "deletions", + "mergeable", + "mergeable_state", + "merged", + "maintainer_can_modify", + "merged_by", + "review_comments" + ] + }, + "version": "2026-03-10" + }, + { + "changeset": "remove_singular_assignee_from_issues_and_pull_requests", + "patch": { + "properties": { + "assignee": null + }, + "required": [ + "_links", + "labels", + "base", + "body", + "closed_at", + "comments_url", + "commits_url", + "created_at", + "diff_url", + "head", + "html_url", + "id", + "node_id", + "issue_url", + "merged_at", + "milestone", + "number", + "patch_url", + "review_comment_url", + "review_comments_url", + "statuses_url", + "state", + "locked", + "title", + "updated_at", + "url", + "user", + "author_association", + "auto_merge", + "additions", + "changed_files", + "comments", + "commits", + "deletions", + "mergeable", + "mergeable_state", + "merged", + "maintainer_can_modify", + "merged_by", + "review_comments" + ] + }, + "version": "2026-03-10" + } + ] + }, + "pull-request-merge-result": { + "title": "Pull Request Merge Result", + "description": "Pull Request Merge Result", + "type": "object", + "properties": { + "sha": { + "type": "string" + }, + "merged": { + "type": "boolean" + }, + "message": { + "type": "string" + } + }, + "required": [ + "merged", + "message", + "sha" + ] + }, + "pull-request-minimal": { + "title": "Pull Request Minimal", + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "number": { + "type": "integer" + }, + "url": { + "type": "string" + }, + "head": { + "type": "object", + "properties": { + "ref": { + "type": "string" + }, + "sha": { + "type": "string" + }, + "repo": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "url": { + "type": "string" + }, + "name": { + "type": "string" + } + }, + "required": [ + "id", + "url", + "name" + ] + } + }, + "required": [ + "ref", + "sha", + "repo" + ] + }, + "base": { + "type": "object", + "properties": { + "ref": { + "type": "string" + }, + "sha": { + "type": "string" + }, + "repo": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "url": { + "type": "string" + }, + "name": { + "type": "string" + } + }, + "required": [ + "id", + "url", + "name" + ] + } + }, + "required": [ + "ref", + "sha", + "repo" + ] + } + }, + "required": [ + "id", + "number", + "url", + "head", + "base" + ] + }, + "pull-request-review": { + "title": "Pull Request Review", + "description": "Pull Request Reviews are reviews on pull requests.", + "type": "object", + "properties": { + "id": { + "description": "Unique identifier of the review", + "example": 42, + "type": "integer", + "format": "int64" + }, + "node_id": { + "type": "string", + "example": "MDE3OlB1bGxSZXF1ZXN0UmV2aWV3ODA=" + }, + "user": { + "$ref": "#/components/schemas/nullable-simple-user" + }, + "body": { + "description": "The text of the review.", + "example": "This looks great.", + "type": "string" + }, + "state": { + "type": "string", + "example": "CHANGES_REQUESTED" + }, + "html_url": { + "type": "string", + "format": "uri", + "example": "https://github.com/octocat/Hello-World/pull/12#pullrequestreview-80" + }, + "pull_request_url": { + "type": "string", + "format": "uri", + "example": "https://api.github.com/repos/octocat/Hello-World/pulls/12" + }, + "_links": { + "type": "object", + "properties": { + "html": { + "type": "object", + "properties": { + "href": { + "type": "string" + } + }, + "required": [ + "href" + ] + }, + "pull_request": { + "type": "object", + "properties": { + "href": { + "type": "string" + } + }, + "required": [ + "href" + ] + } + }, + "required": [ + "html", + "pull_request" + ] + }, + "submitted_at": { + "type": "string", + "format": "date-time" + }, + "commit_id": { + "description": "A commit SHA for the review. If the commit object was garbage collected or forcibly deleted, then it no longer exists in Git and this value will be `null`.", + "example": "54bb654c9e6025347f57900a4a5c2313a96b8035", + "type": "string", + "nullable": true + }, + "body_html": { + "type": "string" + }, + "body_text": { + "type": "string" + }, + "author_association": { + "$ref": "#/components/schemas/author-association" + } + }, + "required": [ + "id", + "node_id", + "user", + "body", + "state", + "commit_id", + "html_url", + "pull_request_url", + "_links", + "author_association" + ] + }, + "pull-request-review-comment": { + "title": "Pull Request Review Comment", + "description": "Pull Request Review Comments are comments on a portion of the Pull Request's diff.", + "type": "object", + "properties": { + "url": { + "description": "URL for the pull request review comment", + "example": "https://api.github.com/repos/octocat/Hello-World/pulls/comments/1", + "type": "string" + }, + "pull_request_review_id": { + "description": "The ID of the pull request review to which the comment belongs.", + "type": "integer", + "format": "int64", + "example": 42, + "nullable": true + }, + "id": { + "description": "The ID of the pull request review comment.", + "type": "integer", + "format": "int64", + "example": 1 + }, + "node_id": { + "description": "The node ID of the pull request review comment.", + "type": "string", + "example": "MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDEw" + }, + "diff_hunk": { + "description": "The diff of the line that the comment refers to.", + "type": "string", + "example": "@@ -16,33 +16,40 @@ public class Connection : IConnection..." + }, + "path": { + "description": "The relative path of the file to which the comment applies.", + "example": "config/database.yaml", + "type": "string" + }, + "position": { + "description": "The line index in the diff to which the comment applies. This field is closing down; use `line` instead.", + "example": 1, + "type": "integer" + }, + "original_position": { + "description": "The index of the original line in the diff to which the comment applies. This field is closing down; use `original_line` instead.", + "example": 4, + "type": "integer" + }, + "commit_id": { + "description": "The SHA of the commit to which the comment applies.", + "example": "6dcb09b5b57875f334f61aebed695e2e4193db5e", + "type": "string" + }, + "original_commit_id": { + "description": "The SHA of the original commit to which the comment applies.", + "example": "9c48853fa3dc5c1c3d6f1f1cd1f2743e72652840", + "type": "string" + }, + "in_reply_to_id": { + "description": "The comment ID to reply to.", + "example": 8, + "type": "integer" + }, + "user": { + "$ref": "#/components/schemas/nullable-simple-user" + }, + "body": { + "description": "The text of the comment.", + "example": "We should probably include a check for null values here.", + "type": "string" + }, + "created_at": { + "type": "string", + "format": "date-time", + "example": "2011-04-14T16:00:49Z" + }, + "updated_at": { + "type": "string", + "format": "date-time", + "example": "2011-04-14T16:00:49Z" + }, + "html_url": { + "description": "HTML URL for the pull request review comment.", + "type": "string", + "format": "uri", + "example": "https://github.com/octocat/Hello-World/pull/1#discussion-diff-1" + }, + "pull_request_url": { + "description": "URL for the pull request that the review comment belongs to.", + "type": "string", + "format": "uri", + "example": "https://api.github.com/repos/octocat/Hello-World/pulls/1" + }, + "author_association": { + "$ref": "#/components/schemas/author-association" + }, + "_links": { + "type": "object", + "properties": { + "self": { + "type": "object", + "properties": { + "href": { + "type": "string", + "format": "uri", + "example": "https://api.github.com/repos/octocat/Hello-World/pulls/comments/1" + } + }, + "required": [ + "href" + ] + }, + "html": { + "type": "object", + "properties": { + "href": { + "type": "string", + "format": "uri", + "example": "https://github.com/octocat/Hello-World/pull/1#discussion-diff-1" + } + }, + "required": [ + "href" + ] + }, + "pull_request": { + "type": "object", + "properties": { + "href": { + "type": "string", + "format": "uri", + "example": "https://api.github.com/repos/octocat/Hello-World/pulls/1" + } + }, + "required": [ + "href" + ] + } + }, + "required": [ + "self", + "html", + "pull_request" + ] + }, + "start_line": { + "type": "integer", + "description": "The first line of the range for a multi-line comment.", + "example": 2, + "nullable": true + }, + "original_start_line": { + "type": "integer", + "description": "The first line of the range for a multi-line comment.", + "example": 2, + "nullable": true + }, + "start_side": { + "type": "string", + "description": "The side of the first line of the range for a multi-line comment.", + "enum": [ + "LEFT", + "RIGHT" + ], + "default": "RIGHT", + "nullable": true + }, + "line": { + "description": "The line of the blob to which the comment applies. The last line of the range for a multi-line comment", + "example": 2, + "type": "integer" + }, + "original_line": { + "description": "The line of the blob to which the comment applies. The last line of the range for a multi-line comment", + "example": 2, + "type": "integer" + }, + "side": { + "description": "The side of the diff to which the comment applies. The side of the last line of the range for a multi-line comment", + "enum": [ + "LEFT", + "RIGHT" + ], + "default": "RIGHT", + "type": "string" + }, + "subject_type": { + "description": "The level at which the comment is targeted, can be a diff line or a file.", + "type": "string", + "enum": [ + "line", + "file" + ] + }, + "reactions": { + "$ref": "#/components/schemas/reaction-rollup" + }, + "body_html": { + "type": "string", + "example": "\"

comment body

\"" + }, + "body_text": { + "type": "string", + "example": "\"comment body\"" + } + }, + "required": [ + "url", + "id", + "node_id", + "pull_request_review_id", + "diff_hunk", + "path", + "commit_id", + "original_commit_id", + "user", + "body", + "created_at", + "updated_at", + "html_url", + "pull_request_url", + "author_association", + "_links" + ] + }, + "pull-request-simple": { + "title": "Pull Request Simple", + "description": "Pull Request Simple", + "type": "object", + "properties": { + "url": { + "type": "string", + "format": "uri", + "example": "https://api.github.com/repos/octocat/Hello-World/pulls/1347" + }, + "id": { + "type": "integer", + "format": "int64", + "example": 1 + }, + "node_id": { + "type": "string", + "example": "MDExOlB1bGxSZXF1ZXN0MQ==" + }, + "html_url": { + "type": "string", + "format": "uri", + "example": "https://github.com/octocat/Hello-World/pull/1347" + }, + "diff_url": { + "type": "string", + "format": "uri", + "example": "https://github.com/octocat/Hello-World/pull/1347.diff" + }, + "patch_url": { + "type": "string", + "format": "uri", + "example": "https://github.com/octocat/Hello-World/pull/1347.patch" + }, + "issue_url": { + "type": "string", + "format": "uri", + "example": "https://api.github.com/repos/octocat/Hello-World/issues/1347" + }, + "commits_url": { + "type": "string", + "format": "uri", + "example": "https://api.github.com/repos/octocat/Hello-World/pulls/1347/commits" + }, + "review_comments_url": { + "type": "string", + "format": "uri", + "example": "https://api.github.com/repos/octocat/Hello-World/pulls/1347/comments" + }, + "review_comment_url": { + "type": "string", + "example": "https://api.github.com/repos/octocat/Hello-World/pulls/comments{/number}" + }, + "comments_url": { + "type": "string", + "format": "uri", + "example": "https://api.github.com/repos/octocat/Hello-World/issues/1347/comments" + }, + "statuses_url": { + "type": "string", + "format": "uri", + "example": "https://api.github.com/repos/octocat/Hello-World/statuses/6dcb09b5b57875f334f61aebed695e2e4193db5e" + }, + "number": { + "type": "integer", + "example": 1347 + }, + "state": { + "type": "string", + "example": "open" + }, + "locked": { + "type": "boolean", + "example": true + }, + "title": { + "type": "string", + "example": "new-feature" + }, + "user": { + "$ref": "#/components/schemas/nullable-simple-user" + }, + "body": { + "type": "string", + "example": "Please pull these awesome changes", + "nullable": true + }, + "labels": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "node_id": { + "type": "string" + }, + "url": { + "type": "string" + }, + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "color": { + "type": "string" + }, + "default": { + "type": "boolean" + }, + "archived_by": { + "description": "The user who archived the label, or `null` if it has not been archived.", + "nullable": true, + "allOf": [ + { + "$ref": "#/components/schemas/simple-user" + } + ] + } + }, + "required": [ + "id", + "node_id", + "url", + "name", + "description", + "color", + "default", + "archived_at", + "archived_by" + ] + } + }, + "milestone": { + "$ref": "#/components/schemas/nullable-milestone" + }, + "active_lock_reason": { + "type": "string", + "example": "too heated", + "nullable": true + }, + "created_at": { + "type": "string", + "format": "date-time", + "example": "2011-01-26T19:01:12Z" + }, + "updated_at": { + "type": "string", + "format": "date-time", + "example": "2011-01-26T19:01:12Z" + }, + "closed_at": { + "type": "string", + "format": "date-time", + "example": "2011-01-26T19:01:12Z", + "nullable": true + }, + "merged_at": { + "type": "string", + "format": "date-time", + "example": "2011-01-26T19:01:12Z", + "nullable": true + }, + "merge_commit_sha": { + "type": "string", + "example": "e5bd3914e2e596debea16f433f57875b5b90bcd6", + "nullable": true + }, + "assignee": { + "$ref": "#/components/schemas/nullable-simple-user" + }, + "assignees": { + "type": "array", + "items": { + "$ref": "#/components/schemas/simple-user" + } + }, + "requested_reviewers": { + "type": "array", + "items": { + "$ref": "#/components/schemas/simple-user" + } + }, + "requested_teams": { + "type": "array", + "items": { + "$ref": "#/components/schemas/team" + } + }, + "head": { + "type": "object", + "properties": { + "label": { + "type": "string" + }, + "ref": { + "type": "string" + }, + "repo": { + "$ref": "#/components/schemas/repository" + }, + "sha": { + "type": "string" + }, + "user": { + "$ref": "#/components/schemas/nullable-simple-user" + } + }, + "required": [ + "label", + "ref", + "repo", + "sha", + "user" + ] + }, + "base": { + "type": "object", + "properties": { + "label": { + "type": "string" + }, + "ref": { + "type": "string" + }, + "repo": { + "$ref": "#/components/schemas/repository" + }, + "sha": { + "type": "string" + }, + "user": { + "$ref": "#/components/schemas/nullable-simple-user" + } + }, + "required": [ + "label", + "ref", + "repo", + "sha", + "user" + ] + }, + "_links": { + "type": "object", + "properties": { + "comments": { + "$ref": "#/components/schemas/link" + }, + "commits": { + "$ref": "#/components/schemas/link" + }, + "statuses": { + "$ref": "#/components/schemas/link" + }, + "html": { + "$ref": "#/components/schemas/link" + }, + "issue": { + "$ref": "#/components/schemas/link" + }, + "review_comments": { + "$ref": "#/components/schemas/link" + }, + "review_comment": { + "$ref": "#/components/schemas/link" + }, + "self": { + "$ref": "#/components/schemas/link" + } + }, + "required": [ + "comments", + "commits", + "statuses", + "html", + "issue", + "review_comments", + "review_comment", + "self" + ] + }, + "author_association": { + "$ref": "#/components/schemas/author-association" + }, + "auto_merge": { + "$ref": "#/components/schemas/auto-merge" + }, + "stack": { + "$ref": "#/components/schemas/pull-request-stack" + }, + "draft": { + "description": "Indicates whether or not the pull request is a draft.", + "example": false, + "type": "boolean" + } + }, + "required": [ + "_links", + "assignee", + "labels", + "base", + "body", + "closed_at", + "comments_url", + "commits_url", + "created_at", + "diff_url", + "head", + "html_url", + "id", + "node_id", + "issue_url", + "merge_commit_sha", + "merged_at", + "milestone", + "number", + "patch_url", + "review_comment_url", + "review_comments_url", + "statuses_url", + "state", + "locked", + "title", + "updated_at", + "url", + "user", + "author_association", + "auto_merge" + ], + "x-github-breaking-changes": [ + { + "changeset": "remove_pull_request_merge_commit_sha", + "patch": { + "properties": { + "merge_commit_sha": null + }, + "required": [ + "_links", + "assignee", + "labels", + "base", + "body", + "closed_at", + "comments_url", + "commits_url", + "created_at", + "diff_url", + "head", + "html_url", + "id", + "node_id", + "issue_url", + "merged_at", + "milestone", + "number", + "patch_url", + "review_comment_url", + "review_comments_url", + "statuses_url", + "state", + "locked", + "title", + "updated_at", + "url", + "user", + "author_association", + "auto_merge" + ] + }, + "version": "2026-03-10" + }, + { + "changeset": "remove_singular_assignee_from_issues_and_pull_requests", + "patch": { + "properties": { + "assignee": null + }, + "required": [ + "_links", + "labels", + "base", + "body", + "closed_at", + "comments_url", + "commits_url", + "created_at", + "diff_url", + "head", + "html_url", + "id", + "node_id", + "issue_url", + "merged_at", + "milestone", + "number", + "patch_url", + "review_comment_url", + "review_comments_url", + "statuses_url", + "state", + "locked", + "title", + "updated_at", + "url", + "user", + "author_association", + "auto_merge" + ] + }, + "version": "2026-03-10" + } + ] + }, + "pull-request-stack": { + "title": "Pull Request Stack", + "description": "The stack information associated with a pull request.", + "type": "object", + "properties": { + "base": { + "type": "object", + "properties": { + "ref": { + "type": "string", + "description": "The base ref of the stack this pull request belongs to." + }, + "sha": { + "type": "string", + "description": "The base SHA of the stack this pull request belongs to." + } + }, + "required": [ + "ref", + "sha" + ] + }, + "size": { + "type": "integer", + "description": "The total number of pull requests in the stack." + }, + "position": { + "type": "integer", + "description": "The one-based position of this pull request within the stack, where 1 is the bottom of the stack." + }, + "id": { + "type": "integer", + "description": "The ID of the stack that this pull request belongs to." + }, + "number": { + "type": "integer", + "description": "The number of the stack that this pull request belongs to." + } + }, + "required": [ + "base" + ], + "nullable": true + }, + "pull-request-webhook": { + "allOf": [ + { + "$ref": "#/components/schemas/pull-request" + }, + { + "type": "object", + "properties": { + "allow_auto_merge": { + "description": "Whether to allow auto-merge for pull requests.", + "type": "boolean", + "default": false + }, + "allow_update_branch": { + "description": "Whether to allow updating the pull request's branch.", + "type": "boolean" + }, + "delete_branch_on_merge": { + "description": "Whether to delete head branches when pull requests are merged.", + "type": "boolean", + "default": false + }, + "merge_commit_message": { + "description": "The default value for a merge commit message.\n- `PR_TITLE` - default to the pull request's title.\n- `PR_BODY` - default to the pull request's body.\n- `BLANK` - default to a blank commit message.", + "type": "string", + "enum": [ + "PR_BODY", + "PR_TITLE", + "BLANK" + ] + }, + "merge_commit_title": { + "description": "The default value for a merge commit title.\n- `PR_TITLE` - default to the pull request's title.\n- `MERGE_MESSAGE` - default to the classic title for a merge message (e.g., \"Merge pull request #123 from branch-name\").", + "type": "string", + "enum": [ + "PR_TITLE", + "MERGE_MESSAGE" + ] + }, + "squash_merge_commit_message": { + "description": "The default value for a squash merge commit message:\n- `PR_BODY` - default to the pull request's body.\n- `COMMIT_MESSAGES` - default to the branch's commit messages.\n- `BLANK` - default to a blank commit message.", + "type": "string", + "enum": [ + "PR_BODY", + "COMMIT_MESSAGES", + "BLANK" + ] + }, + "squash_merge_commit_title": { + "description": "The default value for a squash merge commit title:\n- `PR_TITLE` - default to the pull request's title.\n- `COMMIT_OR_PR_TITLE` - default to the commit's title (if only one commit) or the pull request's title (when more than one commit).", + "type": "string", + "enum": [ + "PR_TITLE", + "COMMIT_OR_PR_TITLE" + ] + }, + "use_squash_pr_title_as_default": { + "description": "Whether a squash merge commit can use the pull request title as default. **This property is closing down. Please use `squash_merge_commit_title` instead.**", + "type": "boolean", + "default": false + } + } + } + ] + }, + "reaction-rollup": { + "title": "Reaction Rollup", + "type": "object", + "properties": { + "url": { + "type": "string", + "format": "uri" + }, + "total_count": { + "type": "integer" + }, + "+1": { + "type": "integer" + }, + "-1": { + "type": "integer" + }, + "laugh": { + "type": "integer" + }, + "confused": { + "type": "integer" + }, + "heart": { + "type": "integer" + }, + "hooray": { + "type": "integer" + }, + "eyes": { + "type": "integer" + }, + "rocket": { + "type": "integer" + } + }, + "required": [ + "url", + "total_count", + "+1", + "-1", + "laugh", + "confused", + "heart", + "hooray", + "eyes", + "rocket" + ] + }, + "referenced-workflow": { + "title": "Referenced workflow", + "description": "A workflow referenced/reused by the initial caller workflow", + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "sha": { + "type": "string" + }, + "ref": { + "type": "string" + } + }, + "required": [ + "path", + "sha" + ] + }, + "release": { + "title": "Release", + "description": "A release.", + "type": "object", + "properties": { + "url": { + "type": "string", + "format": "uri" + }, + "html_url": { + "type": "string", + "format": "uri" + }, + "assets_url": { + "type": "string", + "format": "uri" + }, + "upload_url": { + "type": "string" + }, + "tarball_url": { + "type": "string", + "format": "uri", + "nullable": true + }, + "zipball_url": { + "type": "string", + "format": "uri", + "nullable": true + }, + "id": { + "type": "integer" + }, + "node_id": { + "type": "string" + }, + "tag_name": { + "description": "The name of the tag.", + "example": "v1.0.0", + "type": "string" + }, + "target_commitish": { + "description": "Specifies the commitish value that determines where the Git tag is created from.", + "example": "master", + "type": "string" + }, + "name": { + "type": "string", + "nullable": true + }, + "body": { + "type": "string", + "nullable": true + }, + "draft": { + "description": "true to create a draft (unpublished) release, false to create a published one.", + "example": false, + "type": "boolean" + }, + "prerelease": { + "description": "Whether to identify the release as a prerelease or a full release.", + "example": false, + "type": "boolean" + }, + "immutable": { + "description": "Whether or not the release is immutable.", + "example": false, + "type": "boolean" + }, + "created_at": { + "type": "string", + "format": "date-time" + }, + "published_at": { + "type": "string", + "format": "date-time", + "nullable": true + }, + "updated_at": { + "type": "string", + "nullable": true, + "format": "date-time" + }, + "author": { + "$ref": "#/components/schemas/simple-user" + }, + "assets": { + "type": "array", + "items": { + "$ref": "#/components/schemas/release-asset" + } + }, + "body_html": { + "type": "string" + }, + "body_text": { + "type": "string" + }, + "mentions_count": { + "type": "integer" + }, + "discussion_url": { + "description": "The URL of the release discussion.", + "type": "string", + "format": "uri" + }, + "reactions": { + "$ref": "#/components/schemas/reaction-rollup" + } + }, + "required": [ + "assets_url", + "upload_url", + "tarball_url", + "zipball_url", + "created_at", + "published_at", + "draft", + "id", + "node_id", + "author", + "html_url", + "name", + "prerelease", + "tag_name", + "target_commitish", + "assets", + "url" + ] + }, + "release-asset": { + "title": "Release Asset", + "description": "Data related to a release.", + "type": "object", + "properties": { + "url": { + "type": "string", + "format": "uri" + }, + "browser_download_url": { + "type": "string", + "format": "uri" + }, + "id": { + "type": "integer" + }, + "node_id": { + "type": "string" + }, + "name": { + "description": "The file name of the asset.", + "type": "string", + "example": "Team Environment" + }, + "label": { + "type": "string", + "nullable": true + }, + "state": { + "description": "State of the release asset.", + "type": "string", + "enum": [ + "uploaded", + "open" + ] + }, + "content_type": { + "type": "string" + }, + "size": { + "type": "integer" + }, + "digest": { + "type": "string", + "nullable": true + }, + "download_count": { + "type": "integer" + }, + "created_at": { + "type": "string", + "format": "date-time" + }, + "updated_at": { + "type": "string", + "format": "date-time" + }, + "uploader": { + "$ref": "#/components/schemas/nullable-simple-user" + } + }, + "required": [ + "id", + "name", + "content_type", + "size", + "digest", + "state", + "url", + "node_id", + "download_count", + "label", + "uploader", + "browser_download_url", + "created_at", + "updated_at" + ] + }, + "repository": { + "title": "Repository", + "description": "A repository on GitHub.", + "type": "object", + "properties": { + "id": { + "description": "Unique identifier of the repository", + "example": 42, + "type": "integer", + "format": "int64" + }, + "node_id": { + "type": "string", + "example": "MDEwOlJlcG9zaXRvcnkxMjk2MjY5" + }, + "name": { + "description": "The name of the repository.", + "type": "string", + "example": "Team Environment" + }, + "full_name": { + "type": "string", + "example": "octocat/Hello-World" + }, + "license": { + "$ref": "#/components/schemas/nullable-license-simple" + }, + "forks": { + "type": "integer" + }, + "permissions": { + "type": "object", + "properties": { + "admin": { + "type": "boolean" + }, + "pull": { + "type": "boolean" + }, + "triage": { + "type": "boolean" + }, + "push": { + "type": "boolean" + }, + "maintain": { + "type": "boolean" + } + }, + "required": [ + "admin", + "pull", + "push" + ] + }, + "owner": { + "$ref": "#/components/schemas/simple-user" + }, + "private": { + "description": "Whether the repository is private or public.", + "default": false, + "type": "boolean" + }, + "html_url": { + "type": "string", + "format": "uri", + "example": "https://github.com/octocat/Hello-World" + }, + "description": { + "type": "string", + "example": "This your first repo!", + "nullable": true + }, + "fork": { + "type": "boolean" + }, + "url": { + "type": "string", + "format": "uri", + "example": "https://api.github.com/repos/octocat/Hello-World" + }, + "archive_url": { + "type": "string", + "example": "http://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}" + }, + "assignees_url": { + "type": "string", + "example": "http://api.github.com/repos/octocat/Hello-World/assignees{/user}" + }, + "blobs_url": { + "type": "string", + "example": "http://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}" + }, + "branches_url": { + "type": "string", + "example": "http://api.github.com/repos/octocat/Hello-World/branches{/branch}" + }, + "collaborators_url": { + "type": "string", + "example": "http://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}" + }, + "comments_url": { + "type": "string", + "example": "http://api.github.com/repos/octocat/Hello-World/comments{/number}" + }, + "commits_url": { + "type": "string", + "example": "http://api.github.com/repos/octocat/Hello-World/commits{/sha}" + }, + "compare_url": { + "type": "string", + "example": "http://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}" + }, + "contents_url": { + "type": "string", + "example": "http://api.github.com/repos/octocat/Hello-World/contents/{+path}" + }, + "contributors_url": { + "type": "string", + "format": "uri", + "example": "http://api.github.com/repos/octocat/Hello-World/contributors" + }, + "deployments_url": { + "type": "string", + "format": "uri", + "example": "http://api.github.com/repos/octocat/Hello-World/deployments" + }, + "downloads_url": { + "type": "string", + "format": "uri", + "example": "http://api.github.com/repos/octocat/Hello-World/downloads" + }, + "events_url": { + "type": "string", + "format": "uri", + "example": "http://api.github.com/repos/octocat/Hello-World/events" + }, + "forks_url": { + "type": "string", + "format": "uri", + "example": "http://api.github.com/repos/octocat/Hello-World/forks" + }, + "git_commits_url": { + "type": "string", + "example": "http://api.github.com/repos/octocat/Hello-World/git/commits{/sha}" + }, + "git_refs_url": { + "type": "string", + "example": "http://api.github.com/repos/octocat/Hello-World/git/refs{/sha}" + }, + "git_tags_url": { + "type": "string", + "example": "http://api.github.com/repos/octocat/Hello-World/git/tags{/sha}" + }, + "git_url": { + "type": "string", + "example": "git:github.com/octocat/Hello-World.git" + }, + "issue_comment_url": { + "type": "string", + "example": "http://api.github.com/repos/octocat/Hello-World/issues/comments{/number}" + }, + "issue_events_url": { + "type": "string", + "example": "http://api.github.com/repos/octocat/Hello-World/issues/events{/number}" + }, + "issues_url": { + "type": "string", + "example": "http://api.github.com/repos/octocat/Hello-World/issues{/number}" + }, + "keys_url": { + "type": "string", + "example": "http://api.github.com/repos/octocat/Hello-World/keys{/key_id}" + }, + "labels_url": { + "type": "string", + "example": "http://api.github.com/repos/octocat/Hello-World/labels{/name}" + }, + "languages_url": { + "type": "string", + "format": "uri", + "example": "http://api.github.com/repos/octocat/Hello-World/languages" + }, + "merges_url": { + "type": "string", + "format": "uri", + "example": "http://api.github.com/repos/octocat/Hello-World/merges" + }, + "milestones_url": { + "type": "string", + "example": "http://api.github.com/repos/octocat/Hello-World/milestones{/number}" + }, + "notifications_url": { + "type": "string", + "example": "http://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}" + }, + "pulls_url": { + "type": "string", + "example": "http://api.github.com/repos/octocat/Hello-World/pulls{/number}" + }, + "releases_url": { + "type": "string", + "example": "http://api.github.com/repos/octocat/Hello-World/releases{/id}" + }, + "ssh_url": { + "type": "string", + "example": "git@github.com:octocat/Hello-World.git" + }, + "stargazers_url": { + "type": "string", + "format": "uri", + "example": "http://api.github.com/repos/octocat/Hello-World/stargazers" + }, + "statuses_url": { + "type": "string", + "example": "http://api.github.com/repos/octocat/Hello-World/statuses/{sha}" + }, + "subscribers_url": { + "type": "string", + "format": "uri", + "example": "http://api.github.com/repos/octocat/Hello-World/subscribers" + }, + "subscription_url": { + "type": "string", + "format": "uri", + "example": "http://api.github.com/repos/octocat/Hello-World/subscription" + }, + "tags_url": { + "type": "string", + "format": "uri", + "example": "http://api.github.com/repos/octocat/Hello-World/tags" + }, + "teams_url": { + "type": "string", + "format": "uri", + "example": "http://api.github.com/repos/octocat/Hello-World/teams" + }, + "trees_url": { + "type": "string", + "example": "http://api.github.com/repos/octocat/Hello-World/git/trees{/sha}" + }, + "clone_url": { + "type": "string", + "example": "https://github.com/octocat/Hello-World.git" + }, + "mirror_url": { + "type": "string", + "format": "uri", + "example": "git:git.example.com/octocat/Hello-World", + "nullable": true + }, + "hooks_url": { + "type": "string", + "format": "uri", + "example": "http://api.github.com/repos/octocat/Hello-World/hooks" + }, + "svn_url": { + "type": "string", + "format": "uri", + "example": "https://svn.github.com/octocat/Hello-World" + }, + "homepage": { + "type": "string", + "format": "uri", + "example": "https://github.com", + "nullable": true + }, + "language": { + "type": "string", + "nullable": true + }, + "forks_count": { + "type": "integer", + "example": 9 + }, + "stargazers_count": { + "type": "integer", + "example": 80 + }, + "watchers_count": { + "type": "integer", + "example": 80 + }, + "size": { + "description": "The size of the repository, in kilobytes. Size is calculated hourly. When a repository is initially created, the size is 0.", + "type": "integer", + "example": 108 + }, + "default_branch": { + "description": "The default branch of the repository.", + "type": "string", + "example": "master" + }, + "open_issues_count": { + "type": "integer", + "example": 0 + }, + "is_template": { + "description": "Whether this repository acts as a template that can be used to generate new repositories.", + "default": false, + "type": "boolean", + "example": true + }, + "topics": { + "type": "array", + "items": { + "type": "string" + } + }, + "has_issues": { + "description": "Whether issues are enabled.", + "default": true, + "type": "boolean", + "example": true + }, + "has_projects": { + "description": "Whether projects are enabled.", + "default": true, + "type": "boolean", + "example": true + }, + "has_wiki": { + "description": "Whether the wiki is enabled.", + "default": true, + "type": "boolean", + "example": true + }, + "has_pages": { + "type": "boolean" + }, + "has_downloads": { + "description": "Whether downloads are enabled.", + "default": true, + "type": "boolean", + "example": true, + "deprecated": true + }, + "has_discussions": { + "description": "Whether discussions are enabled.", + "default": false, + "type": "boolean", + "example": true + }, + "has_pull_requests": { + "description": "Whether pull requests are enabled.", + "default": true, + "type": "boolean", + "example": true + }, + "pull_request_creation_policy": { + "description": "The policy controlling who can create pull requests: all or collaborators_only.", + "type": "string", + "enum": [ + "all", + "collaborators_only" + ], + "example": "all" + }, + "archived": { + "description": "Whether the repository is archived.", + "default": false, + "type": "boolean" + }, + "disabled": { + "type": "boolean", + "description": "Returns whether or not this repository disabled." + }, + "visibility": { + "description": "The repository visibility: public, private, or internal.", + "default": "public", + "type": "string" + }, + "pushed_at": { + "type": "string", + "format": "date-time", + "example": "2011-01-26T19:06:43Z", + "nullable": true + }, + "created_at": { + "type": "string", + "format": "date-time", + "example": "2011-01-26T19:01:12Z", + "nullable": true + }, + "updated_at": { + "type": "string", + "format": "date-time", + "example": "2011-01-26T19:14:43Z", + "nullable": true + }, + "allow_rebase_merge": { + "description": "Whether to allow rebase merges for pull requests.", + "default": true, + "type": "boolean", + "example": true + }, + "temp_clone_token": { + "type": "string" + }, + "allow_squash_merge": { + "description": "Whether to allow squash merges for pull requests.", + "default": true, + "type": "boolean", + "example": true + }, + "allow_auto_merge": { + "description": "Whether to allow Auto-merge to be used on pull requests.", + "default": false, + "type": "boolean", + "example": false + }, + "delete_branch_on_merge": { + "description": "Whether to delete head branches when pull requests are merged", + "default": false, + "type": "boolean", + "example": false + }, + "allow_update_branch": { + "description": "Whether or not a pull request head branch that is behind its base branch can always be updated even if it is not required to be up to date before merging.", + "default": false, + "type": "boolean", + "example": false + }, + "use_squash_pr_title_as_default": { + "type": "boolean", + "description": "Whether a squash merge commit can use the pull request title as default. **This property is closing down. Please use `squash_merge_commit_title` instead.", + "default": false, + "deprecated": true + }, + "squash_merge_commit_title": { + "type": "string", + "enum": [ + "PR_TITLE", + "COMMIT_OR_PR_TITLE" + ], + "description": "The default value for a squash merge commit title:\n\n- `PR_TITLE` - default to the pull request's title.\n- `COMMIT_OR_PR_TITLE` - default to the commit's title (if only one commit) or the pull request's title (when more than one commit)." + }, + "squash_merge_commit_message": { + "type": "string", + "enum": [ + "PR_BODY", + "COMMIT_MESSAGES", + "BLANK" + ], + "description": "The default value for a squash merge commit message:\n\n- `PR_BODY` - default to the pull request's body.\n- `COMMIT_MESSAGES` - default to the branch's commit messages.\n- `BLANK` - default to a blank commit message." + }, + "merge_commit_title": { + "type": "string", + "enum": [ + "PR_TITLE", + "MERGE_MESSAGE" + ], + "description": "The default value for a merge commit title.\n\n- `PR_TITLE` - default to the pull request's title.\n- `MERGE_MESSAGE` - default to the classic title for a merge message (e.g., Merge pull request #123 from branch-name)." + }, + "merge_commit_message": { + "type": "string", + "enum": [ + "PR_BODY", + "PR_TITLE", + "BLANK" + ], + "description": "The default value for a merge commit message.\n\n- `PR_TITLE` - default to the pull request's title.\n- `PR_BODY` - default to the pull request's body.\n- `BLANK` - default to a blank commit message." + }, + "allow_merge_commit": { + "description": "Whether to allow merge commits for pull requests.", + "default": true, + "type": "boolean", + "example": true + }, + "allow_forking": { + "description": "Whether to allow forking this repo", + "type": "boolean" + }, + "web_commit_signoff_required": { + "description": "Whether to require contributors to sign off on web-based commits", + "default": false, + "type": "boolean" + }, + "open_issues": { + "type": "integer" + }, + "watchers": { + "type": "integer" + }, + "master_branch": { + "type": "string" + }, + "starred_at": { + "type": "string", + "example": "\"2020-07-09T00:17:42Z\"" + }, + "anonymous_access_enabled": { + "type": "boolean", + "description": "Whether anonymous git access is enabled for this repository" + }, + "code_search_index_status": { + "type": "object", + "description": "The status of the code search index for this repository", + "properties": { + "lexical_search_ok": { + "type": "boolean" + }, + "lexical_commit_sha": { + "type": "string" + } + } + } + }, + "required": [ + "archive_url", + "assignees_url", + "blobs_url", + "branches_url", + "collaborators_url", + "comments_url", + "commits_url", + "compare_url", + "contents_url", + "contributors_url", + "deployments_url", + "description", + "downloads_url", + "events_url", + "fork", + "forks_url", + "full_name", + "git_commits_url", + "git_refs_url", + "git_tags_url", + "hooks_url", + "html_url", + "id", + "node_id", + "issue_comment_url", + "issue_events_url", + "issues_url", + "keys_url", + "labels_url", + "languages_url", + "merges_url", + "milestones_url", + "name", + "notifications_url", + "owner", + "private", + "pulls_url", + "releases_url", + "stargazers_url", + "statuses_url", + "subscribers_url", + "subscription_url", + "tags_url", + "teams_url", + "trees_url", + "url", + "clone_url", + "default_branch", + "forks", + "forks_count", + "git_url", + "has_downloads", + "has_issues", + "has_projects", + "has_wiki", + "has_pages", + "homepage", + "language", + "archived", + "disabled", + "mirror_url", + "open_issues", + "open_issues_count", + "license", + "pushed_at", + "size", + "ssh_url", + "stargazers_count", + "svn_url", + "watchers", + "watchers_count", + "created_at", + "updated_at" + ], + "x-github-breaking-changes": [ + { + "changeset": "remove_use_squash_pr_title_as_default", + "patch": { + "properties": { + "use_squash_pr_title_as_default": null + } + }, + "version": "2026-03-10" + }, + { + "changeset": "deprecate_beta_media_type", + "patch": { + "properties": { + "master_branch": null + } + }, + "version": "2026-03-10" + }, + { + "changeset": "remove_has_downloads", + "patch": { + "properties": { + "has_downloads": null + }, + "required": [ + "archive_url", + "assignees_url", + "blobs_url", + "branches_url", + "collaborators_url", + "comments_url", + "commits_url", + "compare_url", + "contents_url", + "contributors_url", + "deployments_url", + "description", + "downloads_url", + "events_url", + "fork", + "forks_url", + "full_name", + "git_commits_url", + "git_refs_url", + "git_tags_url", + "hooks_url", + "html_url", + "id", + "node_id", + "issue_comment_url", + "issue_events_url", + "issues_url", + "keys_url", + "labels_url", + "languages_url", + "merges_url", + "milestones_url", + "name", + "notifications_url", + "owner", + "private", + "pulls_url", + "releases_url", + "stargazers_url", + "statuses_url", + "subscribers_url", + "subscription_url", + "tags_url", + "teams_url", + "trees_url", + "url", + "clone_url", + "default_branch", + "forks", + "forks_count", + "git_url", + "has_issues", + "has_projects", + "has_wiki", + "has_pages", + "homepage", + "language", + "archived", + "disabled", + "mirror_url", + "open_issues", + "open_issues_count", + "license", + "pushed_at", + "size", + "ssh_url", + "stargazers_count", + "svn_url", + "watchers", + "watchers_count", + "created_at", + "updated_at" + ] + }, + "version": "2026-03-10" + } + ] + }, + "repository-webhooks": { + "title": "Repository", + "description": "The repository on GitHub where the event occurred. Webhook payloads contain the `repository` property\nwhen the event occurs from activity in a repository.", + "type": "object", + "properties": { + "id": { + "description": "Unique identifier of the repository", + "example": 42, + "type": "integer", + "format": "int64" + }, + "node_id": { + "type": "string", + "example": "MDEwOlJlcG9zaXRvcnkxMjk2MjY5" + }, + "name": { + "description": "The name of the repository.", + "type": "string", + "example": "Team Environment" + }, + "full_name": { + "type": "string", + "example": "octocat/Hello-World" + }, + "license": { + "$ref": "#/components/schemas/nullable-license-simple" + }, + "organization": { + "$ref": "#/components/schemas/nullable-simple-user" + }, + "forks": { + "type": "integer" + }, + "permissions": { + "type": "object", + "properties": { + "admin": { + "type": "boolean" + }, + "pull": { + "type": "boolean" + }, + "triage": { + "type": "boolean" + }, + "push": { + "type": "boolean" + }, + "maintain": { + "type": "boolean" + } + }, + "required": [ + "admin", + "pull", + "push" + ] + }, + "owner": { + "$ref": "#/components/schemas/simple-user" + }, + "private": { + "description": "Whether the repository is private or public.", + "default": false, + "type": "boolean" + }, + "html_url": { + "type": "string", + "format": "uri", + "example": "https://github.com/octocat/Hello-World" + }, + "description": { + "type": "string", + "example": "This your first repo!", + "nullable": true + }, + "fork": { + "type": "boolean" + }, + "url": { + "type": "string", + "format": "uri", + "example": "https://api.github.com/repos/octocat/Hello-World" + }, + "archive_url": { + "type": "string", + "example": "http://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}" + }, + "assignees_url": { + "type": "string", + "example": "http://api.github.com/repos/octocat/Hello-World/assignees{/user}" + }, + "blobs_url": { + "type": "string", + "example": "http://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}" + }, + "branches_url": { + "type": "string", + "example": "http://api.github.com/repos/octocat/Hello-World/branches{/branch}" + }, + "collaborators_url": { + "type": "string", + "example": "http://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}" + }, + "comments_url": { + "type": "string", + "example": "http://api.github.com/repos/octocat/Hello-World/comments{/number}" + }, + "commits_url": { + "type": "string", + "example": "http://api.github.com/repos/octocat/Hello-World/commits{/sha}" + }, + "compare_url": { + "type": "string", + "example": "http://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}" + }, + "contents_url": { + "type": "string", + "example": "http://api.github.com/repos/octocat/Hello-World/contents/{+path}" + }, + "contributors_url": { + "type": "string", + "format": "uri", + "example": "http://api.github.com/repos/octocat/Hello-World/contributors" + }, + "deployments_url": { + "type": "string", + "format": "uri", + "example": "http://api.github.com/repos/octocat/Hello-World/deployments" + }, + "downloads_url": { + "type": "string", + "format": "uri", + "example": "http://api.github.com/repos/octocat/Hello-World/downloads" + }, + "events_url": { + "type": "string", + "format": "uri", + "example": "http://api.github.com/repos/octocat/Hello-World/events" + }, + "forks_url": { + "type": "string", + "format": "uri", + "example": "http://api.github.com/repos/octocat/Hello-World/forks" + }, + "git_commits_url": { + "type": "string", + "example": "http://api.github.com/repos/octocat/Hello-World/git/commits{/sha}" + }, + "git_refs_url": { + "type": "string", + "example": "http://api.github.com/repos/octocat/Hello-World/git/refs{/sha}" + }, + "git_tags_url": { + "type": "string", + "example": "http://api.github.com/repos/octocat/Hello-World/git/tags{/sha}" + }, + "git_url": { + "type": "string", + "example": "git:github.com/octocat/Hello-World.git" + }, + "issue_comment_url": { + "type": "string", + "example": "http://api.github.com/repos/octocat/Hello-World/issues/comments{/number}" + }, + "issue_events_url": { + "type": "string", + "example": "http://api.github.com/repos/octocat/Hello-World/issues/events{/number}" + }, + "issues_url": { + "type": "string", + "example": "http://api.github.com/repos/octocat/Hello-World/issues{/number}" + }, + "keys_url": { + "type": "string", + "example": "http://api.github.com/repos/octocat/Hello-World/keys{/key_id}" + }, + "labels_url": { + "type": "string", + "example": "http://api.github.com/repos/octocat/Hello-World/labels{/name}" + }, + "languages_url": { + "type": "string", + "format": "uri", + "example": "http://api.github.com/repos/octocat/Hello-World/languages" + }, + "merges_url": { + "type": "string", + "format": "uri", + "example": "http://api.github.com/repos/octocat/Hello-World/merges" + }, + "milestones_url": { + "type": "string", + "example": "http://api.github.com/repos/octocat/Hello-World/milestones{/number}" + }, + "notifications_url": { + "type": "string", + "example": "http://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}" + }, + "pulls_url": { + "type": "string", + "example": "http://api.github.com/repos/octocat/Hello-World/pulls{/number}" + }, + "releases_url": { + "type": "string", + "example": "http://api.github.com/repos/octocat/Hello-World/releases{/id}" + }, + "ssh_url": { + "type": "string", + "example": "git@github.com:octocat/Hello-World.git" + }, + "stargazers_url": { + "type": "string", + "format": "uri", + "example": "http://api.github.com/repos/octocat/Hello-World/stargazers" + }, + "statuses_url": { + "type": "string", + "example": "http://api.github.com/repos/octocat/Hello-World/statuses/{sha}" + }, + "subscribers_url": { + "type": "string", + "format": "uri", + "example": "http://api.github.com/repos/octocat/Hello-World/subscribers" + }, + "subscription_url": { + "type": "string", + "format": "uri", + "example": "http://api.github.com/repos/octocat/Hello-World/subscription" + }, + "tags_url": { + "type": "string", + "format": "uri", + "example": "http://api.github.com/repos/octocat/Hello-World/tags" + }, + "teams_url": { + "type": "string", + "format": "uri", + "example": "http://api.github.com/repos/octocat/Hello-World/teams" + }, + "trees_url": { + "type": "string", + "example": "http://api.github.com/repos/octocat/Hello-World/git/trees{/sha}" + }, + "clone_url": { + "type": "string", + "example": "https://github.com/octocat/Hello-World.git" + }, + "mirror_url": { + "type": "string", + "format": "uri", + "example": "git:git.example.com/octocat/Hello-World", + "nullable": true + }, + "hooks_url": { + "type": "string", + "format": "uri", + "example": "http://api.github.com/repos/octocat/Hello-World/hooks" + }, + "svn_url": { + "type": "string", + "format": "uri", + "example": "https://svn.github.com/octocat/Hello-World" + }, + "homepage": { + "type": "string", + "format": "uri", + "example": "https://github.com", + "nullable": true + }, + "language": { + "type": "string", + "nullable": true + }, + "forks_count": { + "type": "integer", + "example": 9 + }, + "stargazers_count": { + "type": "integer", + "example": 80 + }, + "watchers_count": { + "type": "integer", + "example": 80 + }, + "size": { + "description": "The size of the repository, in kilobytes. Size is calculated hourly. When a repository is initially created, the size is 0.", + "type": "integer", + "example": 108 + }, + "default_branch": { + "description": "The default branch of the repository.", + "type": "string", + "example": "master" + }, + "open_issues_count": { + "type": "integer", + "example": 0 + }, + "is_template": { + "description": "Whether this repository acts as a template that can be used to generate new repositories.", + "default": false, + "type": "boolean", + "example": true + }, + "topics": { + "type": "array", + "items": { + "type": "string" + } + }, + "custom_properties": { + "type": "object", + "description": "The custom properties that were defined for the repository. The keys are the custom property names, and the values are the corresponding custom property values.", + "additionalProperties": true + }, + "has_issues": { + "description": "Whether issues are enabled.", + "default": true, + "type": "boolean", + "example": true + }, + "has_projects": { + "description": "Whether projects are enabled.", + "default": true, + "type": "boolean", + "example": true + }, + "has_wiki": { + "description": "Whether the wiki is enabled.", + "default": true, + "type": "boolean", + "example": true + }, + "has_pages": { + "type": "boolean" + }, + "has_downloads": { + "description": "Whether downloads are enabled.", + "default": true, + "type": "boolean", + "example": true + }, + "has_discussions": { + "description": "Whether discussions are enabled.", + "default": false, + "type": "boolean", + "example": true + }, + "has_pull_requests": { + "description": "Whether pull requests are enabled.", + "default": true, + "type": "boolean", + "example": true + }, + "pull_request_creation_policy": { + "description": "The policy controlling who can create pull requests: all or collaborators_only.", + "type": "string", + "enum": [ + "all", + "collaborators_only" + ] + }, + "archived": { + "description": "Whether the repository is archived.", + "default": false, + "type": "boolean" + }, + "disabled": { + "type": "boolean", + "description": "Returns whether or not this repository disabled." + }, + "visibility": { + "description": "The repository visibility: public, private, or internal.", + "default": "public", + "type": "string" + }, + "pushed_at": { + "type": "string", + "format": "date-time", + "example": "2011-01-26T19:06:43Z", + "nullable": true + }, + "created_at": { + "type": "string", + "format": "date-time", + "example": "2011-01-26T19:01:12Z", + "nullable": true + }, + "updated_at": { + "type": "string", + "format": "date-time", + "example": "2011-01-26T19:14:43Z", + "nullable": true + }, + "allow_rebase_merge": { + "description": "Whether to allow rebase merges for pull requests.", + "default": true, + "type": "boolean", + "example": true + }, + "template_repository": { + "nullable": true, + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "node_id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "full_name": { + "type": "string" + }, + "owner": { + "type": "object", + "properties": { + "login": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "node_id": { + "type": "string" + }, + "avatar_url": { + "type": "string" + }, + "gravatar_id": { + "type": "string" + }, + "url": { + "type": "string" + }, + "html_url": { + "type": "string" + }, + "followers_url": { + "type": "string" + }, + "following_url": { + "type": "string" + }, + "gists_url": { + "type": "string" + }, + "starred_url": { + "type": "string" + }, + "subscriptions_url": { + "type": "string" + }, + "organizations_url": { + "type": "string" + }, + "repos_url": { + "type": "string" + }, + "events_url": { + "type": "string" + }, + "received_events_url": { + "type": "string" + }, + "type": { + "type": "string" + }, + "site_admin": { + "type": "boolean" + } + } + }, + "private": { + "type": "boolean" + }, + "html_url": { + "type": "string" + }, + "description": { + "type": "string" + }, + "fork": { + "type": "boolean" + }, + "url": { + "type": "string" + }, + "archive_url": { + "type": "string" + }, + "assignees_url": { + "type": "string" + }, + "blobs_url": { + "type": "string" + }, + "branches_url": { + "type": "string" + }, + "collaborators_url": { + "type": "string" + }, + "comments_url": { + "type": "string" + }, + "commits_url": { + "type": "string" + }, + "compare_url": { + "type": "string" + }, + "contents_url": { + "type": "string" + }, + "contributors_url": { + "type": "string" + }, + "deployments_url": { + "type": "string" + }, + "downloads_url": { + "type": "string" + }, + "events_url": { + "type": "string" + }, + "forks_url": { + "type": "string" + }, + "git_commits_url": { + "type": "string" + }, + "git_refs_url": { + "type": "string" + }, + "git_tags_url": { + "type": "string" + }, + "git_url": { + "type": "string" + }, + "issue_comment_url": { + "type": "string" + }, + "issue_events_url": { + "type": "string" + }, + "issues_url": { + "type": "string" + }, + "keys_url": { + "type": "string" + }, + "labels_url": { + "type": "string" + }, + "languages_url": { + "type": "string" + }, + "merges_url": { + "type": "string" + }, + "milestones_url": { + "type": "string" + }, + "notifications_url": { + "type": "string" + }, + "pulls_url": { + "type": "string" + }, + "releases_url": { + "type": "string" + }, + "ssh_url": { + "type": "string" + }, + "stargazers_url": { + "type": "string" + }, + "statuses_url": { + "type": "string" + }, + "subscribers_url": { + "type": "string" + }, + "subscription_url": { + "type": "string" + }, + "tags_url": { + "type": "string" + }, + "teams_url": { + "type": "string" + }, + "trees_url": { + "type": "string" + }, + "clone_url": { + "type": "string" + }, + "mirror_url": { + "type": "string" + }, + "hooks_url": { + "type": "string" + }, + "svn_url": { + "type": "string" + }, + "homepage": { + "type": "string" + }, + "language": { + "type": "string" + }, + "forks_count": { + "type": "integer" + }, + "stargazers_count": { + "type": "integer" + }, + "watchers_count": { + "type": "integer" + }, + "size": { + "type": "integer" + }, + "default_branch": { + "type": "string" + }, + "open_issues_count": { + "type": "integer" + }, + "is_template": { + "type": "boolean" + }, + "topics": { + "type": "array", + "items": { + "type": "string" + } + }, + "has_issues": { + "type": "boolean" + }, + "has_projects": { + "type": "boolean" + }, + "has_wiki": { + "type": "boolean" + }, + "has_pages": { + "type": "boolean" + }, + "has_downloads": { + "type": "boolean" + }, + "archived": { + "type": "boolean" + }, + "disabled": { + "type": "boolean" + }, + "visibility": { + "type": "string" + }, + "pushed_at": { + "type": "string" + }, + "created_at": { + "type": "string" + }, + "updated_at": { + "type": "string" + }, + "permissions": { + "type": "object", + "properties": { + "admin": { + "type": "boolean" + }, + "maintain": { + "type": "boolean" + }, + "push": { + "type": "boolean" + }, + "triage": { + "type": "boolean" + }, + "pull": { + "type": "boolean" + } + } + }, + "allow_rebase_merge": { + "type": "boolean" + }, + "temp_clone_token": { + "type": "string" + }, + "allow_squash_merge": { + "type": "boolean" + }, + "allow_auto_merge": { + "type": "boolean" + }, + "delete_branch_on_merge": { + "type": "boolean" + }, + "allow_update_branch": { + "type": "boolean" + }, + "use_squash_pr_title_as_default": { + "type": "boolean" + }, + "squash_merge_commit_title": { + "type": "string", + "enum": [ + "PR_TITLE", + "COMMIT_OR_PR_TITLE" + ], + "description": "The default value for a squash merge commit title:\n\n- `PR_TITLE` - default to the pull request's title.\n- `COMMIT_OR_PR_TITLE` - default to the commit's title (if only one commit) or the pull request's title (when more than one commit)." + }, + "squash_merge_commit_message": { + "type": "string", + "enum": [ + "PR_BODY", + "COMMIT_MESSAGES", + "BLANK" + ], + "description": "The default value for a squash merge commit message:\n\n- `PR_BODY` - default to the pull request's body.\n- `COMMIT_MESSAGES` - default to the branch's commit messages.\n- `BLANK` - default to a blank commit message." + }, + "merge_commit_title": { + "type": "string", + "enum": [ + "PR_TITLE", + "MERGE_MESSAGE" + ], + "description": "The default value for a merge commit title.\n\n- `PR_TITLE` - default to the pull request's title.\n- `MERGE_MESSAGE` - default to the classic title for a merge message (e.g., Merge pull request #123 from branch-name)." + }, + "merge_commit_message": { + "type": "string", + "enum": [ + "PR_BODY", + "PR_TITLE", + "BLANK" + ], + "description": "The default value for a merge commit message.\n\n- `PR_TITLE` - default to the pull request's title.\n- `PR_BODY` - default to the pull request's body.\n- `BLANK` - default to a blank commit message." + }, + "allow_merge_commit": { + "type": "boolean" + }, + "subscribers_count": { + "type": "integer" + }, + "network_count": { + "type": "integer" + } + } + }, + "temp_clone_token": { + "type": "string" + }, + "allow_squash_merge": { + "description": "Whether to allow squash merges for pull requests.", + "default": true, + "type": "boolean", + "example": true + }, + "allow_auto_merge": { + "description": "Whether to allow Auto-merge to be used on pull requests.", + "default": false, + "type": "boolean", + "example": false + }, + "delete_branch_on_merge": { + "description": "Whether to delete head branches when pull requests are merged", + "default": false, + "type": "boolean", + "example": false + }, + "allow_update_branch": { + "description": "Whether or not a pull request head branch that is behind its base branch can always be updated even if it is not required to be up to date before merging.", + "default": false, + "type": "boolean", + "example": false + }, + "use_squash_pr_title_as_default": { + "type": "boolean", + "description": "Whether a squash merge commit can use the pull request title as default. **This property is closing down. Please use `squash_merge_commit_title` instead.", + "default": false, + "deprecated": true + }, + "squash_merge_commit_title": { + "type": "string", + "enum": [ + "PR_TITLE", + "COMMIT_OR_PR_TITLE" + ], + "description": "The default value for a squash merge commit title:\n\n- `PR_TITLE` - default to the pull request's title.\n- `COMMIT_OR_PR_TITLE` - default to the commit's title (if only one commit) or the pull request's title (when more than one commit)." + }, + "squash_merge_commit_message": { + "type": "string", + "enum": [ + "PR_BODY", + "COMMIT_MESSAGES", + "BLANK" + ], + "description": "The default value for a squash merge commit message:\n\n- `PR_BODY` - default to the pull request's body.\n- `COMMIT_MESSAGES` - default to the branch's commit messages.\n- `BLANK` - default to a blank commit message." + }, + "merge_commit_title": { + "type": "string", + "enum": [ + "PR_TITLE", + "MERGE_MESSAGE" + ], + "description": "The default value for a merge commit title.\n\n- `PR_TITLE` - default to the pull request's title.\n- `MERGE_MESSAGE` - default to the classic title for a merge message (e.g., Merge pull request #123 from branch-name)." + }, + "merge_commit_message": { + "type": "string", + "enum": [ + "PR_BODY", + "PR_TITLE", + "BLANK" + ], + "description": "The default value for a merge commit message.\n\n- `PR_TITLE` - default to the pull request's title.\n- `PR_BODY` - default to the pull request's body.\n- `BLANK` - default to a blank commit message." + }, + "allow_merge_commit": { + "description": "Whether to allow merge commits for pull requests.", + "default": true, + "type": "boolean", + "example": true + }, + "allow_forking": { + "description": "Whether to allow forking this repo", + "type": "boolean" + }, + "web_commit_signoff_required": { + "description": "Whether to require contributors to sign off on web-based commits", + "default": false, + "type": "boolean" + }, + "subscribers_count": { + "type": "integer" + }, + "network_count": { + "type": "integer" + }, + "open_issues": { + "type": "integer" + }, + "watchers": { + "type": "integer" + }, + "master_branch": { + "type": "string" + }, + "starred_at": { + "type": "string", + "example": "\"2020-07-09T00:17:42Z\"" + }, + "anonymous_access_enabled": { + "type": "boolean", + "description": "Whether anonymous git access is enabled for this repository" + } + }, + "required": [ + "archive_url", + "assignees_url", + "blobs_url", + "branches_url", + "collaborators_url", + "comments_url", + "commits_url", + "compare_url", + "contents_url", + "contributors_url", + "deployments_url", + "description", + "downloads_url", + "events_url", + "fork", + "forks_url", + "full_name", + "git_commits_url", + "git_refs_url", + "git_tags_url", + "hooks_url", + "html_url", + "id", + "node_id", + "issue_comment_url", + "issue_events_url", + "issues_url", + "keys_url", + "labels_url", + "languages_url", + "merges_url", + "milestones_url", + "name", + "notifications_url", + "owner", + "private", + "pulls_url", + "releases_url", + "stargazers_url", + "statuses_url", + "subscribers_url", + "subscription_url", + "tags_url", + "teams_url", + "trees_url", + "url", + "clone_url", + "default_branch", + "forks", + "forks_count", + "git_url", + "has_downloads", + "has_issues", + "has_projects", + "has_wiki", + "has_pages", + "homepage", + "language", + "archived", + "disabled", + "mirror_url", + "open_issues", + "open_issues_count", + "license", + "pushed_at", + "size", + "ssh_url", + "stargazers_count", + "svn_url", + "watchers", + "watchers_count", + "created_at", + "updated_at" + ], + "x-github-breaking-changes": [ + { + "changeset": "remove_use_squash_pr_title_as_default", + "patch": { + "properties": { + "use_squash_pr_title_as_default": null, + "template_repository": { + "properties": { + "use_squash_pr_title_as_default": null + } + } + } + }, + "version": "2026-03-10" + }, + { + "changeset": "deprecate_beta_media_type", + "patch": { + "properties": { + "master_branch": null + } + }, + "version": "2026-03-10" + } + ] + }, + "security-and-analysis": { + "nullable": true, + "type": "object", + "properties": { + "advanced_security": { + "description": "Enable or disable GitHub Advanced Security for the repository.\n\nFor standalone Code Scanning or Secret Protection products, this parameter cannot be used.\n", + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "enabled", + "disabled" + ] + } + } + }, + "code_security": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "enabled", + "disabled" + ] + } + } + }, + "dependabot_security_updates": { + "description": "Enable or disable Dependabot security updates for the repository.", + "type": "object", + "properties": { + "status": { + "description": "The enablement status of Dependabot security updates for the repository.", + "type": "string", + "enum": [ + "enabled", + "disabled" + ] + } + } + }, + "secret_scanning": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "enabled", + "disabled" + ] + } + } + }, + "secret_scanning_push_protection": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "enabled", + "disabled" + ] + } + } + }, + "secret_scanning_non_provider_patterns": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "enabled", + "disabled" + ] + } + } + }, + "secret_scanning_ai_detection": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "enabled", + "disabled" + ] + } + } + }, + "secret_scanning_delegated_alert_dismissal": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "enabled", + "disabled" + ] + } + } + }, + "secret_scanning_delegated_bypass": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "enabled", + "disabled" + ] + } + } + }, + "secret_scanning_delegated_bypass_options": { + "type": "object", + "properties": { + "reviewers": { + "type": "array", + "description": "The bypass reviewers for secret scanning delegated bypass", + "items": { + "type": "object", + "required": [ + "reviewer_id", + "reviewer_type" + ], + "properties": { + "reviewer_id": { + "type": "integer", + "description": "The ID of the team or role selected as a bypass reviewer" + }, + "reviewer_type": { + "type": "string", + "description": "The type of the bypass reviewer", + "enum": [ + "TEAM", + "ROLE" + ] + }, + "mode": { + "type": "string", + "description": "The bypass mode for the reviewer", + "enum": [ + "ALWAYS", + "EXEMPT" + ], + "default": "ALWAYS" + } + } + } + } + } + } + } + }, + "short-branch": { + "title": "Short Branch", + "description": "Short Branch", + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "commit": { + "type": "object", + "properties": { + "sha": { + "type": "string" + }, + "url": { + "type": "string", + "format": "uri" + } + }, + "required": [ + "sha", + "url" + ] + }, + "protected": { + "type": "boolean" + }, + "protection": { + "$ref": "#/components/schemas/branch-protection" + }, + "protection_url": { + "type": "string", + "format": "uri" + } + }, + "required": [ + "name", + "commit", + "protected" + ] + }, + "simple-installation": { + "title": "Simple Installation", + "description": "The GitHub App installation. Webhook payloads contain the `installation` property when the event is configured\nfor and sent to a GitHub App. For more information,\nsee \"[Using webhooks with GitHub Apps](https://docs.github.com/apps/creating-github-apps/registering-a-github-app/using-webhooks-with-github-apps).\"", + "type": "object", + "properties": { + "id": { + "description": "The ID of the installation.", + "type": "integer", + "example": 1 + }, + "node_id": { + "description": "The global node ID of the installation.", + "type": "string", + "example": "MDQ6VXNlcjU4MzIzMQ==" + } + }, + "required": [ + "id", + "node_id" + ] + }, + "simple-user": { + "title": "Simple User", + "description": "A GitHub user.", + "type": "object", + "properties": { + "name": { + "nullable": true, + "type": "string" + }, + "email": { + "nullable": true, + "type": "string" + }, + "login": { + "type": "string", + "example": "octocat" + }, + "id": { + "type": "integer", + "format": "int64", + "example": 1 + }, + "node_id": { + "type": "string", + "example": "MDQ6VXNlcjE=" + }, + "avatar_url": { + "type": "string", + "format": "uri", + "example": "https://github.com/images/error/octocat_happy.gif" + }, + "gravatar_id": { + "type": "string", + "example": "41d064eb2195891e12d0413f63227ea7", + "nullable": true + }, + "url": { + "type": "string", + "format": "uri", + "example": "https://api.github.com/users/octocat" + }, + "html_url": { + "type": "string", + "format": "uri", + "example": "https://github.com/octocat" + }, + "followers_url": { + "type": "string", + "format": "uri", + "example": "https://api.github.com/users/octocat/followers" + }, + "following_url": { + "type": "string", + "example": "https://api.github.com/users/octocat/following{/other_user}" + }, + "gists_url": { + "type": "string", + "example": "https://api.github.com/users/octocat/gists{/gist_id}" + }, + "starred_url": { + "type": "string", + "example": "https://api.github.com/users/octocat/starred{/owner}{/repo}" + }, + "subscriptions_url": { + "type": "string", + "format": "uri", + "example": "https://api.github.com/users/octocat/subscriptions" + }, + "organizations_url": { + "type": "string", + "format": "uri", + "example": "https://api.github.com/users/octocat/orgs" + }, + "repos_url": { + "type": "string", + "format": "uri", + "example": "https://api.github.com/users/octocat/repos" + }, + "events_url": { + "type": "string", + "example": "https://api.github.com/users/octocat/events{/privacy}" + }, + "received_events_url": { + "type": "string", + "format": "uri", + "example": "https://api.github.com/users/octocat/received_events" + }, + "type": { + "type": "string", + "example": "User" + }, + "site_admin": { + "type": "boolean" + }, + "starred_at": { + "type": "string", + "example": "\"2020-07-09T00:17:55Z\"" + }, + "user_view_type": { + "type": "string", + "example": "public" + } + }, + "required": [ + "avatar_url", + "events_url", + "followers_url", + "following_url", + "gists_url", + "gravatar_id", + "html_url", + "id", + "node_id", + "login", + "organizations_url", + "received_events_url", + "repos_url", + "site_admin", + "starred_url", + "subscriptions_url", + "type", + "url" + ] + }, + "status": { + "title": "Status", + "description": "The status of a commit.", + "type": "object", + "properties": { + "url": { + "type": "string" + }, + "avatar_url": { + "type": "string", + "nullable": true + }, + "id": { + "type": "integer" + }, + "node_id": { + "type": "string" + }, + "state": { + "type": "string" + }, + "description": { + "type": "string", + "nullable": true + }, + "target_url": { + "type": "string", + "nullable": true + }, + "context": { + "type": "string" + }, + "created_at": { + "type": "string" + }, + "updated_at": { + "type": "string" + }, + "creator": { + "$ref": "#/components/schemas/nullable-simple-user" + } + }, + "required": [ + "url", + "avatar_url", + "id", + "node_id", + "state", + "description", + "target_url", + "context", + "created_at", + "updated_at", + "creator" + ] + }, + "sub-issues-summary": { + "title": "Sub-issues Summary", + "type": "object", + "properties": { + "total": { + "type": "integer" + }, + "completed": { + "type": "integer" + }, + "percent_completed": { + "type": "integer" + } + }, + "required": [ + "total", + "completed", + "percent_completed" + ] + }, + "team": { + "title": "Team", + "description": "Groups of organization members that gives permissions on specified repositories.", + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "node_id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "slug": { + "type": "string" + }, + "description": { + "type": "string", + "nullable": true + }, + "privacy": { + "type": "string" + }, + "notification_setting": { + "type": "string" + }, + "permission": { + "type": "string" + }, + "permissions": { + "type": "object", + "properties": { + "pull": { + "type": "boolean" + }, + "triage": { + "type": "boolean" + }, + "push": { + "type": "boolean" + }, + "maintain": { + "type": "boolean" + }, + "admin": { + "type": "boolean" + } + }, + "required": [ + "pull", + "triage", + "push", + "maintain", + "admin" + ] + }, + "url": { + "type": "string", + "format": "uri" + }, + "html_url": { + "type": "string", + "format": "uri", + "example": "https://github.com/orgs/rails/teams/core" + }, + "members_url": { + "type": "string" + }, + "repositories_url": { + "type": "string", + "format": "uri" + }, + "type": { + "description": "The ownership type of the team", + "type": "string", + "enum": [ + "enterprise", + "organization" + ] + }, + "access_source": { + "description": "How the team's access to the repository was granted. This property is only\npresent when the team is returned in a repository context, such as\n`GET /repos/{owner}/{repo}/teams`.", + "type": "string", + "enum": [ + "direct", + "organization", + "enterprise" + ], + "example": "direct" + }, + "organization_id": { + "type": "integer", + "description": "Unique identifier of the organization to which this team belongs", + "example": 37 + }, + "enterprise_id": { + "type": "integer", + "description": "Unique identifier of the enterprise to which this team belongs", + "example": 42 + }, + "parent": { + "$ref": "#/components/schemas/nullable-team-simple" + } + }, + "required": [ + "id", + "node_id", + "url", + "members_url", + "name", + "description", + "permission", + "html_url", + "repositories_url", + "slug", + "parent", + "type" + ] + }, + "team-simple": { + "title": "Team Simple", + "description": "Groups of organization members that gives permissions on specified repositories.", + "type": "object", + "properties": { + "id": { + "description": "Unique identifier of the team", + "type": "integer", + "example": 1 + }, + "node_id": { + "type": "string", + "example": "MDQ6VGVhbTE=" + }, + "url": { + "description": "URL for the team", + "type": "string", + "format": "uri", + "example": "https://api.github.com/organizations/1/team/1" + }, + "members_url": { + "type": "string", + "example": "https://api.github.com/organizations/1/team/1/members{/member}" + }, + "name": { + "description": "Name of the team", + "type": "string", + "example": "Justice League" + }, + "description": { + "description": "Description of the team", + "type": "string", + "nullable": true, + "example": "A great team." + }, + "permission": { + "description": "Permission that the team will have for its repositories", + "type": "string", + "example": "admin" + }, + "privacy": { + "description": "The level of privacy this team should have", + "type": "string", + "example": "closed" + }, + "notification_setting": { + "description": "The notification setting the team has set", + "type": "string", + "example": "notifications_enabled" + }, + "html_url": { + "type": "string", + "format": "uri", + "example": "https://github.com/orgs/rails/teams/core" + }, + "repositories_url": { + "type": "string", + "format": "uri", + "example": "https://api.github.com/organizations/1/team/1/repos" + }, + "slug": { + "type": "string", + "example": "justice-league" + }, + "ldap_dn": { + "description": "Distinguished Name (DN) that team maps to within LDAP environment", + "example": "uid=example,ou=users,dc=github,dc=com", + "type": "string" + }, + "type": { + "description": "The ownership type of the team", + "type": "string", + "enum": [ + "enterprise", + "organization" + ] + }, + "organization_id": { + "type": "integer", + "description": "Unique identifier of the organization to which this team belongs", + "example": 37 + }, + "enterprise_id": { + "type": "integer", + "description": "Unique identifier of the enterprise to which this team belongs", + "example": 42 + } + }, + "required": [ + "id", + "node_id", + "url", + "members_url", + "name", + "description", + "permission", + "html_url", + "repositories_url", + "slug", + "type" + ] + }, + "verification": { + "title": "Verification", + "type": "object", + "properties": { + "verified": { + "type": "boolean" + }, + "reason": { + "type": "string" + }, + "payload": { + "type": "string", + "nullable": true + }, + "signature": { + "type": "string", + "nullable": true + }, + "verified_at": { + "type": "string", + "nullable": true + } + }, + "required": [ + "verified", + "reason", + "payload", + "signature", + "verified_at" + ] + }, + "webhook-issues-closed": { + "title": "issues closed event", + "type": "object", + "properties": { + "action": { + "description": "The action that was performed.", + "type": "string", + "enum": [ + "closed" + ] + }, + "enterprise": { + "$ref": "#/components/schemas/enterprise-webhooks" + }, + "installation": { + "$ref": "#/components/schemas/simple-installation" + }, + "issue": { + "description": "The [issue](https://docs.github.com/rest/issues/issues#get-an-issue) itself.", + "allOf": [ + { + "title": "Issue", + "description": "The [issue](https://docs.github.com/rest/issues/issues#get-an-issue) itself.", + "type": "object", + "properties": { + "active_lock_reason": { + "type": "string", + "nullable": true, + "enum": [ + "resolved", + "off-topic", + "too heated", + "spam", + null + ] + }, + "assignee": { + "title": "User", + "type": "object", + "nullable": true, + "properties": { + "avatar_url": { + "type": "string", + "format": "uri" + }, + "deleted": { + "type": "boolean" + }, + "email": { + "type": "string", + "nullable": true + }, + "events_url": { + "type": "string", + "format": "uri-template" + }, + "followers_url": { + "type": "string", + "format": "uri" + }, + "following_url": { + "type": "string", + "format": "uri-template" + }, + "gists_url": { + "type": "string", + "format": "uri-template" + }, + "gravatar_id": { + "type": "string" + }, + "html_url": { + "type": "string", + "format": "uri" + }, + "id": { + "type": "integer" + }, + "login": { + "type": "string" + }, + "name": { + "type": "string" + }, + "node_id": { + "type": "string" + }, + "organizations_url": { + "type": "string", + "format": "uri" + }, + "received_events_url": { + "type": "string", + "format": "uri" + }, + "repos_url": { + "type": "string", + "format": "uri" + }, + "site_admin": { + "type": "boolean" + }, + "starred_url": { + "type": "string", + "format": "uri-template" + }, + "subscriptions_url": { + "type": "string", + "format": "uri" + }, + "type": { + "type": "string", + "enum": [ + "Bot", + "User", + "Organization", + "Mannequin" + ] + }, + "url": { + "type": "string", + "format": "uri" + }, + "user_view_type": { + "type": "string" + } + }, + "required": [ + "login", + "id" + ] + }, + "assignees": { + "type": "array", + "items": { + "title": "User", + "type": "object", + "nullable": true, + "properties": { + "avatar_url": { + "type": "string", + "format": "uri" + }, + "deleted": { + "type": "boolean" + }, + "email": { + "type": "string", + "nullable": true + }, + "events_url": { + "type": "string", + "format": "uri-template" + }, + "followers_url": { + "type": "string", + "format": "uri" + }, + "following_url": { + "type": "string", + "format": "uri-template" + }, + "gists_url": { + "type": "string", + "format": "uri-template" + }, + "gravatar_id": { + "type": "string" + }, + "html_url": { + "type": "string", + "format": "uri" + }, + "id": { + "type": "integer" + }, + "login": { + "type": "string" + }, + "name": { + "type": "string" + }, + "node_id": { + "type": "string" + }, + "organizations_url": { + "type": "string", + "format": "uri" + }, + "received_events_url": { + "type": "string", + "format": "uri" + }, + "repos_url": { + "type": "string", + "format": "uri" + }, + "site_admin": { + "type": "boolean" + }, + "starred_url": { + "type": "string", + "format": "uri-template" + }, + "subscriptions_url": { + "type": "string", + "format": "uri" + }, + "type": { + "type": "string", + "enum": [ + "Bot", + "User", + "Organization", + "Mannequin" + ] + }, + "url": { + "type": "string", + "format": "uri" + }, + "user_view_type": { + "type": "string" + } + }, + "required": [ + "login", + "id" + ] + } + }, + "author_association": { + "title": "AuthorAssociation", + "description": "How the author is associated with the repository.", + "type": "string", + "enum": [ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER" + ] + }, + "body": { + "description": "Contents of the issue", + "type": "string", + "nullable": true + }, + "closed_at": { + "type": "string", + "nullable": true, + "format": "date-time" + }, + "comments": { + "type": "integer" + }, + "comments_url": { + "type": "string", + "format": "uri" + }, + "created_at": { + "type": "string", + "format": "date-time" + }, + "draft": { + "type": "boolean" + }, + "events_url": { + "type": "string", + "format": "uri" + }, + "html_url": { + "type": "string", + "format": "uri" + }, + "id": { + "type": "integer", + "format": "int64" + }, + "labels": { + "type": "array", + "items": { + "title": "Label", + "type": "object", + "properties": { + "color": { + "description": "6-character hex code, without the leading #, identifying the color", + "type": "string" + }, + "default": { + "type": "boolean" + }, + "description": { + "type": "string", + "nullable": true + }, + "id": { + "type": "integer" + }, + "name": { + "description": "The name of the label.", + "type": "string" + }, + "node_id": { + "type": "string" + }, + "url": { + "description": "URL for the label", + "type": "string", + "format": "uri" + } + }, + "required": [ + "id", + "node_id", + "url", + "name", + "color", + "default", + "description" + ] + } + }, + "labels_url": { + "type": "string", + "format": "uri-template" + }, + "locked": { + "type": "boolean" + }, + "milestone": { + "title": "Milestone", + "description": "A collection of related issues and pull requests.", + "type": "object", + "nullable": true, + "properties": { + "closed_at": { + "type": "string", + "nullable": true, + "format": "date-time" + }, + "closed_issues": { + "type": "integer" + }, + "created_at": { + "type": "string", + "format": "date-time" + }, + "creator": { + "title": "User", + "type": "object", + "nullable": true, + "properties": { + "avatar_url": { + "type": "string", + "format": "uri" + }, + "deleted": { + "type": "boolean" + }, + "email": { + "type": "string", + "nullable": true + }, + "events_url": { + "type": "string", + "format": "uri-template" + }, + "followers_url": { + "type": "string", + "format": "uri" + }, + "following_url": { + "type": "string", + "format": "uri-template" + }, + "gists_url": { + "type": "string", + "format": "uri-template" + }, + "gravatar_id": { + "type": "string" + }, + "html_url": { + "type": "string", + "format": "uri" + }, + "id": { + "type": "integer" + }, + "login": { + "type": "string" + }, + "name": { + "type": "string" + }, + "node_id": { + "type": "string" + }, + "organizations_url": { + "type": "string", + "format": "uri" + }, + "received_events_url": { + "type": "string", + "format": "uri" + }, + "repos_url": { + "type": "string", + "format": "uri" + }, + "site_admin": { + "type": "boolean" + }, + "starred_url": { + "type": "string", + "format": "uri-template" + }, + "subscriptions_url": { + "type": "string", + "format": "uri" + }, + "type": { + "type": "string", + "enum": [ + "Bot", + "User", + "Organization", + "Mannequin" + ] + }, + "url": { + "type": "string", + "format": "uri" + }, + "user_view_type": { + "type": "string" + } + }, + "required": [ + "login", + "id" + ] + }, + "description": { + "type": "string", + "nullable": true + }, + "due_on": { + "type": "string", + "nullable": true, + "format": "date-time" + }, + "html_url": { + "type": "string", + "format": "uri" + }, + "id": { + "type": "integer" + }, + "labels_url": { + "type": "string", + "format": "uri" + }, + "node_id": { + "type": "string" + }, + "number": { + "description": "The number of the milestone.", + "type": "integer" + }, + "open_issues": { + "type": "integer" + }, + "state": { + "description": "The state of the milestone.", + "type": "string", + "enum": [ + "open", + "closed" + ] + }, + "title": { + "description": "The title of the milestone.", + "type": "string" + }, + "updated_at": { + "type": "string", + "format": "date-time" + }, + "url": { + "type": "string", + "format": "uri" + } + }, + "required": [ + "url", + "html_url", + "labels_url", + "id", + "node_id", + "number", + "title", + "description", + "creator", + "open_issues", + "closed_issues", + "state", + "created_at", + "updated_at", + "due_on", + "closed_at" + ] + }, + "node_id": { + "type": "string" + }, + "number": { + "type": "integer" + }, + "performed_via_github_app": { + "title": "App", + "description": "GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub.", + "type": "object", + "nullable": true, + "properties": { + "created_at": { + "type": "string", + "nullable": true, + "format": "date-time" + }, + "description": { + "type": "string", + "nullable": true + }, + "events": { + "description": "The list of events for the GitHub app", + "type": "array", + "items": { + "type": "string", + "enum": [ + "branch_protection_rule", + "check_run", + "check_suite", + "code_scanning_alert", + "commit_comment", + "content_reference", + "create", + "delete", + "deployment", + "deployment_review", + "deployment_status", + "deploy_key", + "discussion", + "discussion_comment", + "fork", + "gollum", + "issues", + "issue_comment", + "label", + "member", + "membership", + "milestone", + "organization", + "org_block", + "page_build", + "project", + "project_card", + "project_column", + "public", + "pull_request", + "pull_request_review", + "pull_request_review_comment", + "push", + "registry_package", + "release", + "repository", + "repository_dispatch", + "secret_scanning_alert", + "star", + "status", + "team", + "team_add", + "watch", + "workflow_dispatch", + "workflow_run", + "security_and_analysis", + "reminder", + "pull_request_review_thread" + ] + } + }, + "external_url": { + "type": "string", + "nullable": true, + "format": "uri" + }, + "html_url": { + "type": "string", + "format": "uri" + }, + "id": { + "description": "Unique identifier of the GitHub app", + "type": "integer", + "nullable": true + }, + "name": { + "description": "The name of the GitHub app", + "type": "string" + }, + "node_id": { + "type": "string" + }, + "owner": { + "title": "User", + "type": "object", + "nullable": true, + "properties": { + "avatar_url": { + "type": "string", + "format": "uri" + }, + "deleted": { + "type": "boolean" + }, + "email": { + "type": "string", + "nullable": true + }, + "events_url": { + "type": "string", + "format": "uri-template" + }, + "followers_url": { + "type": "string", + "format": "uri" + }, + "following_url": { + "type": "string", + "format": "uri-template" + }, + "gists_url": { + "type": "string", + "format": "uri-template" + }, + "gravatar_id": { + "type": "string" + }, + "html_url": { + "type": "string", + "format": "uri" + }, + "id": { + "type": "integer" + }, + "login": { + "type": "string" + }, + "name": { + "type": "string" + }, + "node_id": { + "type": "string" + }, + "organizations_url": { + "type": "string", + "format": "uri" + }, + "received_events_url": { + "type": "string", + "format": "uri" + }, + "repos_url": { + "type": "string", + "format": "uri" + }, + "site_admin": { + "type": "boolean" + }, + "starred_url": { + "type": "string", + "format": "uri-template" + }, + "subscriptions_url": { + "type": "string", + "format": "uri" + }, + "type": { + "type": "string", + "enum": [ + "Bot", + "User", + "Organization" + ] + }, + "url": { + "type": "string", + "format": "uri" + }, + "user_view_type": { + "type": "string" + } + }, + "required": [ + "login", + "id" + ] + }, + "permissions": { + "description": "The set of permissions for the GitHub app", + "type": "object", + "properties": { + "actions": { + "type": "string", + "enum": [ + "read", + "write" + ] + }, + "administration": { + "type": "string", + "enum": [ + "read", + "write" + ] + }, + "checks": { + "type": "string", + "enum": [ + "read", + "write" + ] + }, + "content_references": { + "type": "string", + "enum": [ + "read", + "write" + ] + }, + "contents": { + "type": "string", + "enum": [ + "read", + "write" + ] + }, + "deployments": { + "type": "string", + "enum": [ + "read", + "write" + ] + }, + "discussions": { + "type": "string", + "enum": [ + "read", + "write" + ] + }, + "emails": { + "type": "string", + "enum": [ + "read", + "write" + ] + }, + "environments": { + "type": "string", + "enum": [ + "read", + "write" + ] + }, + "issues": { + "type": "string", + "enum": [ + "read", + "write" + ] + }, + "keys": { + "type": "string", + "enum": [ + "read", + "write" + ] + }, + "members": { + "type": "string", + "enum": [ + "read", + "write" + ] + }, + "metadata": { + "type": "string", + "enum": [ + "read", + "write" + ] + }, + "organization_administration": { + "type": "string", + "enum": [ + "read", + "write" + ] + }, + "organization_hooks": { + "type": "string", + "enum": [ + "read", + "write" + ] + }, + "organization_packages": { + "type": "string", + "enum": [ + "read", + "write" + ] + }, + "organization_plan": { + "type": "string", + "enum": [ + "read", + "write" + ] + }, + "organization_projects": { + "type": "string", + "enum": [ + "read", + "write", + "admin" + ] + }, + "organization_secrets": { + "type": "string", + "enum": [ + "read", + "write" + ] + }, + "organization_self_hosted_runners": { + "type": "string", + "enum": [ + "read", + "write" + ] + }, + "organization_user_blocking": { + "type": "string", + "enum": [ + "read", + "write" + ] + }, + "packages": { + "type": "string", + "enum": [ + "read", + "write" + ] + }, + "pages": { + "type": "string", + "enum": [ + "read", + "write" + ] + }, + "pull_requests": { + "type": "string", + "enum": [ + "read", + "write" + ] + }, + "repository_hooks": { + "type": "string", + "enum": [ + "read", + "write" + ] + }, + "repository_projects": { + "type": "string", + "enum": [ + "read", + "write" + ] + }, + "secret_scanning_alerts": { + "type": "string", + "enum": [ + "read", + "write" + ] + }, + "secrets": { + "type": "string", + "enum": [ + "read", + "write" + ] + }, + "security_events": { + "type": "string", + "enum": [ + "read", + "write" + ] + }, + "security_scanning_alert": { + "type": "string", + "enum": [ + "read", + "write" + ] + }, + "single_file": { + "type": "string", + "enum": [ + "read", + "write" + ] + }, + "statuses": { + "type": "string", + "enum": [ + "read", + "write" + ] + }, + "vulnerability_alerts": { + "type": "string", + "enum": [ + "read", + "write" + ] + }, + "workflows": { + "type": "string", + "enum": [ + "read", + "write" + ] + } + } + }, + "slug": { + "description": "The slug name of the GitHub app", + "type": "string" + }, + "updated_at": { + "type": "string", + "nullable": true, + "format": "date-time" + } + }, + "required": [ + "id", + "node_id", + "owner", + "name", + "description", + "external_url", + "html_url", + "created_at", + "updated_at" + ] + }, + "pull_request": { + "type": "object", + "properties": { + "diff_url": { + "type": "string", + "format": "uri" + }, + "html_url": { + "type": "string", + "format": "uri" + }, + "merged_at": { + "type": "string", + "nullable": true, + "format": "date-time" + }, + "patch_url": { + "type": "string", + "format": "uri" + }, + "url": { + "type": "string", + "format": "uri" + } + } + }, + "reactions": { + "title": "Reactions", + "type": "object", + "properties": { + "+1": { + "type": "integer" + }, + "-1": { + "type": "integer" + }, + "confused": { + "type": "integer" + }, + "eyes": { + "type": "integer" + }, + "heart": { + "type": "integer" + }, + "hooray": { + "type": "integer" + }, + "laugh": { + "type": "integer" + }, + "rocket": { + "type": "integer" + }, + "total_count": { + "type": "integer" + }, + "url": { + "type": "string", + "format": "uri" + } + }, + "required": [ + "url", + "total_count", + "+1", + "-1", + "laugh", + "confused", + "heart", + "hooray", + "eyes", + "rocket" + ] + }, + "repository_url": { + "type": "string", + "format": "uri" + }, + "pinned_comment": { + "$ref": "#/components/schemas/nullable-issue-comment" + }, + "sub_issues_summary": { + "$ref": "#/components/schemas/sub-issues-summary" + }, + "issue_dependencies_summary": { + "$ref": "#/components/schemas/issue-dependencies-summary" + }, + "issue_field_values": { + "type": "array", + "items": { + "$ref": "#/components/schemas/issue-field-value" + } + }, + "state": { + "description": "State of the issue; either 'open' or 'closed'", + "type": "string", + "enum": [ + "open", + "closed" + ] + }, + "state_reason": { + "type": "string", + "nullable": true + }, + "timeline_url": { + "type": "string", + "format": "uri" + }, + "title": { + "description": "Title of the issue", + "type": "string" + }, + "type": { + "$ref": "#/components/schemas/issue-type" + }, + "updated_at": { + "type": "string", + "format": "date-time" + }, + "url": { + "description": "URL for the issue", + "type": "string", + "format": "uri" + }, + "user": { + "title": "User", + "type": "object", + "nullable": true, + "properties": { + "avatar_url": { + "type": "string", + "format": "uri" + }, + "deleted": { + "type": "boolean" + }, + "email": { + "type": "string", + "nullable": true + }, + "events_url": { + "type": "string", + "format": "uri-template" + }, + "followers_url": { + "type": "string", + "format": "uri" + }, + "following_url": { + "type": "string", + "format": "uri-template" + }, + "gists_url": { + "type": "string", + "format": "uri-template" + }, + "gravatar_id": { + "type": "string" + }, + "html_url": { + "type": "string", + "format": "uri" + }, + "id": { + "type": "integer", + "format": "int64" + }, + "login": { + "type": "string" + }, + "name": { + "type": "string" + }, + "node_id": { + "type": "string" + }, + "organizations_url": { + "type": "string", + "format": "uri" + }, + "received_events_url": { + "type": "string", + "format": "uri" + }, + "repos_url": { + "type": "string", + "format": "uri" + }, + "site_admin": { + "type": "boolean" + }, + "starred_url": { + "type": "string", + "format": "uri-template" + }, + "subscriptions_url": { + "type": "string", + "format": "uri" + }, + "type": { + "type": "string", + "enum": [ + "Bot", + "User", + "Organization", + "Mannequin" + ] + }, + "url": { + "type": "string", + "format": "uri" + }, + "user_view_type": { + "type": "string" + } + }, + "required": [ + "login", + "id" + ] + } + }, + "required": [ + "url", + "repository_url", + "labels_url", + "comments_url", + "events_url", + "html_url", + "id", + "node_id", + "number", + "title", + "user", + "assignees", + "milestone", + "comments", + "created_at", + "updated_at", + "closed_at", + "author_association", + "active_lock_reason", + "body", + "reactions" + ] + }, + { + "type": "object", + "properties": { + "active_lock_reason": { + "type": "string", + "nullable": true + }, + "assignee": { + "type": "object", + "nullable": true + }, + "assignees": { + "type": "array", + "items": { + "type": "object", + "nullable": true + } + }, + "author_association": { + "type": "string" + }, + "body": { + "type": "string", + "nullable": true + }, + "closed_at": { + "type": "string", + "nullable": true + }, + "comments": { + "type": "integer" + }, + "comments_url": { + "type": "string" + }, + "created_at": { + "type": "string" + }, + "events_url": { + "type": "string" + }, + "html_url": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "labels": { + "type": "array", + "items": { + "type": "object", + "nullable": true + } + }, + "labels_url": { + "type": "string" + }, + "locked": { + "type": "boolean" + }, + "milestone": { + "type": "object", + "nullable": true + }, + "node_id": { + "type": "string" + }, + "number": { + "type": "integer" + }, + "performed_via_github_app": { + "type": "object", + "nullable": true + }, + "reactions": { + "type": "object", + "properties": { + "+1": { + "type": "integer" + }, + "-1": { + "type": "integer" + }, + "confused": { + "type": "integer" + }, + "eyes": { + "type": "integer" + }, + "heart": { + "type": "integer" + }, + "hooray": { + "type": "integer" + }, + "laugh": { + "type": "integer" + }, + "rocket": { + "type": "integer" + }, + "total_count": { + "type": "integer" + }, + "url": { + "type": "string" + } + } + }, + "repository_url": { + "type": "string" + }, + "state": { + "type": "string", + "enum": [ + "closed", + "open" + ] + }, + "timeline_url": { + "type": "string" + }, + "title": { + "type": "string" + }, + "updated_at": { + "type": "string" + }, + "url": { + "type": "string" + }, + "user": { + "type": "object", + "properties": { + "avatar_url": { + "type": "string" + }, + "events_url": { + "type": "string" + }, + "followers_url": { + "type": "string" + }, + "following_url": { + "type": "string" + }, + "gists_url": { + "type": "string" + }, + "gravatar_id": { + "type": "string" + }, + "html_url": { + "type": "string" + }, + "id": { + "type": "integer", + "format": "int64" + }, + "login": { + "type": "string" + }, + "node_id": { + "type": "string" + }, + "organizations_url": { + "type": "string" + }, + "received_events_url": { + "type": "string" + }, + "repos_url": { + "type": "string" + }, + "site_admin": { + "type": "boolean" + }, + "starred_url": { + "type": "string" + }, + "subscriptions_url": { + "type": "string" + }, + "type": { + "type": "string" + }, + "url": { + "type": "string" + }, + "user_view_type": { + "type": "string" + } + } + } + }, + "required": [ + "state", + "closed_at" + ] + } + ] + }, + "organization": { + "$ref": "#/components/schemas/organization-simple-webhooks" + }, + "repository": { + "$ref": "#/components/schemas/repository-webhooks" + }, + "sender": { + "$ref": "#/components/schemas/simple-user" + } + }, + "required": [ + "action", + "issue", + "repository", + "sender" + ] + }, + "webhook-issues-opened": { + "title": "issues opened event", + "type": "object", + "properties": { + "action": { + "type": "string", + "enum": [ + "opened" + ] + }, + "changes": { + "type": "object", + "properties": { + "old_issue": { + "title": "Issue", + "description": "The [issue](https://docs.github.com/rest/issues/issues#get-an-issue) itself.", + "type": "object", + "nullable": true, + "properties": { + "active_lock_reason": { + "type": "string", + "nullable": true, + "enum": [ + "resolved", + "off-topic", + "too heated", + "spam", + null + ] + }, + "assignee": { + "title": "User", + "type": "object", + "nullable": true, + "properties": { + "avatar_url": { + "type": "string", + "format": "uri" + }, + "deleted": { + "type": "boolean" + }, + "email": { + "type": "string", + "nullable": true + }, + "events_url": { + "type": "string", + "format": "uri-template" + }, + "followers_url": { + "type": "string", + "format": "uri" + }, + "following_url": { + "type": "string", + "format": "uri-template" + }, + "gists_url": { + "type": "string", + "format": "uri-template" + }, + "gravatar_id": { + "type": "string" + }, + "html_url": { + "type": "string", + "format": "uri" + }, + "id": { + "type": "integer" + }, + "login": { + "type": "string" + }, + "name": { + "type": "string" + }, + "node_id": { + "type": "string" + }, + "organizations_url": { + "type": "string", + "format": "uri" + }, + "received_events_url": { + "type": "string", + "format": "uri" + }, + "repos_url": { + "type": "string", + "format": "uri" + }, + "site_admin": { + "type": "boolean" + }, + "starred_url": { + "type": "string", + "format": "uri-template" + }, + "subscriptions_url": { + "type": "string", + "format": "uri" + }, + "type": { + "type": "string", + "enum": [ + "Bot", + "User", + "Organization" + ] + }, + "url": { + "type": "string", + "format": "uri" + }, + "user_view_type": { + "type": "string" + } + }, + "required": [ + "login", + "id" + ] + }, + "assignees": { + "type": "array", + "items": { + "title": "User", + "type": "object", + "nullable": true, + "properties": { + "avatar_url": { + "type": "string", + "format": "uri" + }, + "deleted": { + "type": "boolean" + }, + "email": { + "type": "string", + "nullable": true + }, + "events_url": { + "type": "string", + "format": "uri-template" + }, + "followers_url": { + "type": "string", + "format": "uri" + }, + "following_url": { + "type": "string", + "format": "uri-template" + }, + "gists_url": { + "type": "string", + "format": "uri-template" + }, + "gravatar_id": { + "type": "string" + }, + "html_url": { + "type": "string", + "format": "uri" + }, + "id": { + "type": "integer" + }, + "login": { + "type": "string" + }, + "name": { + "type": "string" + }, + "node_id": { + "type": "string" + }, + "organizations_url": { + "type": "string", + "format": "uri" + }, + "received_events_url": { + "type": "string", + "format": "uri" + }, + "repos_url": { + "type": "string", + "format": "uri" + }, + "site_admin": { + "type": "boolean" + }, + "starred_url": { + "type": "string", + "format": "uri-template" + }, + "subscriptions_url": { + "type": "string", + "format": "uri" + }, + "type": { + "type": "string", + "enum": [ + "Bot", + "User", + "Organization" + ] + }, + "url": { + "type": "string", + "format": "uri" + }, + "user_view_type": { + "type": "string" + } + }, + "required": [ + "login", + "id" + ] + } + }, + "author_association": { + "title": "AuthorAssociation", + "description": "How the author is associated with the repository.", + "type": "string", + "enum": [ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER" + ] + }, + "body": { + "description": "Contents of the issue", + "type": "string", + "nullable": true + }, + "closed_at": { + "type": "string", + "nullable": true, + "format": "date-time" + }, + "comments": { + "type": "integer" + }, + "comments_url": { + "type": "string", + "format": "uri" + }, + "created_at": { + "type": "string", + "format": "date-time" + }, + "draft": { + "type": "boolean" + }, + "events_url": { + "type": "string", + "format": "uri" + }, + "html_url": { + "type": "string", + "format": "uri" + }, + "id": { + "type": "integer", + "format": "int64" + }, + "labels": { + "type": "array", + "items": { + "title": "Label", + "type": "object", + "properties": { + "color": { + "description": "6-character hex code, without the leading #, identifying the color", + "type": "string" + }, + "default": { + "type": "boolean" + }, + "description": { + "type": "string", + "nullable": true + }, + "id": { + "type": "integer" + }, + "name": { + "description": "The name of the label.", + "type": "string" + }, + "node_id": { + "type": "string" + }, + "url": { + "description": "URL for the label", + "type": "string", + "format": "uri" + } + }, + "required": [ + "id", + "node_id", + "url", + "name", + "color", + "default", + "description" + ] + } + }, + "labels_url": { + "type": "string", + "format": "uri-template" + }, + "locked": { + "type": "boolean" + }, + "milestone": { + "title": "Milestone", + "description": "A collection of related issues and pull requests.", + "type": "object", + "nullable": true, + "properties": { + "closed_at": { + "type": "string", + "nullable": true, + "format": "date-time" + }, + "closed_issues": { + "type": "integer" + }, + "created_at": { + "type": "string", + "format": "date-time" + }, + "creator": { + "title": "User", + "type": "object", + "nullable": true, + "properties": { + "avatar_url": { + "type": "string", + "format": "uri" + }, + "deleted": { + "type": "boolean" + }, + "email": { + "type": "string", + "nullable": true + }, + "events_url": { + "type": "string", + "format": "uri-template" + }, + "followers_url": { + "type": "string", + "format": "uri" + }, + "following_url": { + "type": "string", + "format": "uri-template" + }, + "gists_url": { + "type": "string", + "format": "uri-template" + }, + "gravatar_id": { + "type": "string" + }, + "html_url": { + "type": "string", + "format": "uri" + }, + "id": { + "type": "integer" + }, + "login": { + "type": "string" + }, + "name": { + "type": "string" + }, + "node_id": { + "type": "string" + }, + "organizations_url": { + "type": "string", + "format": "uri" + }, + "received_events_url": { + "type": "string", + "format": "uri" + }, + "repos_url": { + "type": "string", + "format": "uri" + }, + "site_admin": { + "type": "boolean" + }, + "starred_url": { + "type": "string", + "format": "uri-template" + }, + "subscriptions_url": { + "type": "string", + "format": "uri" + }, + "type": { + "type": "string", + "enum": [ + "Bot", + "User", + "Organization" + ] + }, + "url": { + "type": "string", + "format": "uri" + }, + "user_view_type": { + "type": "string" + } + }, + "required": [ + "login", + "id" + ] + }, + "description": { + "type": "string", + "nullable": true + }, + "due_on": { + "type": "string", + "nullable": true, + "format": "date-time" + }, + "html_url": { + "type": "string", + "format": "uri" + }, + "id": { + "type": "integer" + }, + "labels_url": { + "type": "string", + "format": "uri" + }, + "node_id": { + "type": "string" + }, + "number": { + "description": "The number of the milestone.", + "type": "integer" + }, + "open_issues": { + "type": "integer" + }, + "state": { + "description": "The state of the milestone.", + "type": "string", + "enum": [ + "open", + "closed" + ] + }, + "title": { + "description": "The title of the milestone.", + "type": "string" + }, + "updated_at": { + "type": "string", + "format": "date-time" + }, + "url": { + "type": "string", + "format": "uri" + } + }, + "required": [ + "url", + "html_url", + "labels_url", + "id", + "node_id", + "number", + "title", + "description", + "creator", + "open_issues", + "closed_issues", + "state", + "created_at", + "updated_at", + "due_on", + "closed_at" + ] + }, + "node_id": { + "type": "string" + }, + "number": { + "type": "integer" + }, + "performed_via_github_app": { + "title": "App", + "description": "GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub.", + "type": "object", + "nullable": true, + "properties": { + "created_at": { + "type": "string", + "nullable": true, + "format": "date-time" + }, + "description": { + "type": "string", + "nullable": true + }, + "events": { + "description": "The list of events for the GitHub app", + "type": "array", + "items": { + "type": "string", + "enum": [ + "branch_protection_rule", + "check_run", + "check_suite", + "code_scanning_alert", + "commit_comment", + "content_reference", + "create", + "delete", + "deployment", + "deployment_review", + "deployment_status", + "deploy_key", + "discussion", + "discussion_comment", + "fork", + "gollum", + "issues", + "issue_comment", + "label", + "member", + "membership", + "milestone", + "organization", + "org_block", + "page_build", + "project", + "project_card", + "project_column", + "public", + "pull_request", + "pull_request_review", + "pull_request_review_comment", + "push", + "registry_package", + "release", + "repository", + "repository_dispatch", + "secret_scanning_alert", + "star", + "status", + "team", + "team_add", + "watch", + "workflow_dispatch", + "workflow_run" + ] + } + }, + "external_url": { + "type": "string", + "nullable": true, + "format": "uri" + }, + "html_url": { + "type": "string", + "format": "uri" + }, + "id": { + "description": "Unique identifier of the GitHub app", + "type": "integer", + "nullable": true + }, + "name": { + "description": "The name of the GitHub app", + "type": "string" + }, + "node_id": { + "type": "string" + }, + "owner": { + "title": "User", + "type": "object", + "nullable": true, + "properties": { + "avatar_url": { + "type": "string", + "format": "uri" + }, + "deleted": { + "type": "boolean" + }, + "email": { + "type": "string", + "nullable": true + }, + "events_url": { + "type": "string", + "format": "uri-template" + }, + "followers_url": { + "type": "string", + "format": "uri" + }, + "following_url": { + "type": "string", + "format": "uri-template" + }, + "gists_url": { + "type": "string", + "format": "uri-template" + }, + "gravatar_id": { + "type": "string" + }, + "html_url": { + "type": "string", + "format": "uri" + }, + "id": { + "type": "integer" + }, + "login": { + "type": "string" + }, + "name": { + "type": "string" + }, + "node_id": { + "type": "string" + }, + "organizations_url": { + "type": "string", + "format": "uri" + }, + "received_events_url": { + "type": "string", + "format": "uri" + }, + "repos_url": { + "type": "string", + "format": "uri" + }, + "site_admin": { + "type": "boolean" + }, + "starred_url": { + "type": "string", + "format": "uri-template" + }, + "subscriptions_url": { + "type": "string", + "format": "uri" + }, + "type": { + "type": "string", + "enum": [ + "Bot", + "User", + "Organization" + ] + }, + "url": { + "type": "string", + "format": "uri" + }, + "user_view_type": { + "type": "string" + } + }, + "required": [ + "login", + "id" + ] + }, + "permissions": { + "description": "The set of permissions for the GitHub app", + "type": "object", + "properties": { + "actions": { + "type": "string", + "enum": [ + "read", + "write" + ] + }, + "administration": { + "type": "string", + "enum": [ + "read", + "write" + ] + }, + "checks": { + "type": "string", + "enum": [ + "read", + "write" + ] + }, + "content_references": { + "type": "string", + "enum": [ + "read", + "write" + ] + }, + "contents": { + "type": "string", + "enum": [ + "read", + "write" + ] + }, + "deployments": { + "type": "string", + "enum": [ + "read", + "write" + ] + }, + "discussions": { + "type": "string", + "enum": [ + "read", + "write" + ] + }, + "emails": { + "type": "string", + "enum": [ + "read", + "write" + ] + }, + "environments": { + "type": "string", + "enum": [ + "read", + "write" + ] + }, + "issues": { + "type": "string", + "enum": [ + "read", + "write" + ] + }, + "keys": { + "type": "string", + "enum": [ + "read", + "write" + ] + }, + "members": { + "type": "string", + "enum": [ + "read", + "write" + ] + }, + "metadata": { + "type": "string", + "enum": [ + "read", + "write" + ] + }, + "organization_administration": { + "type": "string", + "enum": [ + "read", + "write" + ] + }, + "organization_hooks": { + "type": "string", + "enum": [ + "read", + "write" + ] + }, + "organization_packages": { + "type": "string", + "enum": [ + "read", + "write" + ] + }, + "organization_plan": { + "type": "string", + "enum": [ + "read", + "write" + ] + }, + "organization_projects": { + "type": "string", + "enum": [ + "read", + "write" + ] + }, + "organization_secrets": { + "type": "string", + "enum": [ + "read", + "write" + ] + }, + "organization_self_hosted_runners": { + "type": "string", + "enum": [ + "read", + "write" + ] + }, + "organization_user_blocking": { + "type": "string", + "enum": [ + "read", + "write" + ] + }, + "packages": { + "type": "string", + "enum": [ + "read", + "write" + ] + }, + "pages": { + "type": "string", + "enum": [ + "read", + "write" + ] + }, + "pull_requests": { + "type": "string", + "enum": [ + "read", + "write" + ] + }, + "repository_hooks": { + "type": "string", + "enum": [ + "read", + "write" + ] + }, + "repository_projects": { + "type": "string", + "enum": [ + "read", + "write" + ] + }, + "secret_scanning_alerts": { + "type": "string", + "enum": [ + "read", + "write" + ] + }, + "secrets": { + "type": "string", + "enum": [ + "read", + "write" + ] + }, + "security_events": { + "type": "string", + "enum": [ + "read", + "write" + ] + }, + "security_scanning_alert": { + "type": "string", + "enum": [ + "read", + "write" + ] + }, + "single_file": { + "type": "string", + "enum": [ + "read", + "write" + ] + }, + "statuses": { + "type": "string", + "enum": [ + "read", + "write" + ] + }, + "vulnerability_alerts": { + "type": "string", + "enum": [ + "read", + "write" + ] + }, + "workflows": { + "type": "string", + "enum": [ + "read", + "write" + ] + } + } + }, + "slug": { + "description": "The slug name of the GitHub app", + "type": "string" + }, + "updated_at": { + "type": "string", + "nullable": true, + "format": "date-time" + } + }, + "required": [ + "id", + "node_id", + "owner", + "name", + "description", + "external_url", + "html_url", + "created_at", + "updated_at" + ] + }, + "pull_request": { + "type": "object", + "properties": { + "diff_url": { + "type": "string", + "format": "uri" + }, + "html_url": { + "type": "string", + "format": "uri" + }, + "merged_at": { + "type": "string", + "nullable": true, + "format": "date-time" + }, + "patch_url": { + "type": "string", + "format": "uri" + }, + "url": { + "type": "string", + "format": "uri" + } + } + }, + "reactions": { + "title": "Reactions", + "type": "object", + "properties": { + "+1": { + "type": "integer" + }, + "-1": { + "type": "integer" + }, + "confused": { + "type": "integer" + }, + "eyes": { + "type": "integer" + }, + "heart": { + "type": "integer" + }, + "hooray": { + "type": "integer" + }, + "laugh": { + "type": "integer" + }, + "rocket": { + "type": "integer" + }, + "total_count": { + "type": "integer" + }, + "url": { + "type": "string", + "format": "uri" + } + }, + "required": [ + "url", + "total_count", + "+1", + "-1", + "laugh", + "confused", + "heart", + "hooray", + "eyes", + "rocket" + ] + }, + "repository_url": { + "type": "string", + "format": "uri" + }, + "sub_issues_summary": { + "$ref": "#/components/schemas/sub-issues-summary" + }, + "issue_dependencies_summary": { + "$ref": "#/components/schemas/issue-dependencies-summary" + }, + "issue_field_values": { + "type": "array", + "items": { + "$ref": "#/components/schemas/issue-field-value" + } + }, + "state": { + "description": "State of the issue; either 'open' or 'closed'", + "type": "string", + "enum": [ + "open", + "closed" + ] + }, + "state_reason": { + "type": "string", + "nullable": true + }, + "timeline_url": { + "type": "string", + "format": "uri" + }, + "title": { + "description": "Title of the issue", + "type": "string" + }, + "updated_at": { + "type": "string", + "format": "date-time" + }, + "url": { + "description": "URL for the issue", + "type": "string", + "format": "uri" + }, + "pinned_comment": { + "$ref": "#/components/schemas/nullable-issue-comment" + }, + "user": { + "title": "User", + "type": "object", + "nullable": true, + "properties": { + "avatar_url": { + "type": "string", + "format": "uri" + }, + "deleted": { + "type": "boolean" + }, + "email": { + "type": "string", + "nullable": true + }, + "events_url": { + "type": "string", + "format": "uri-template" + }, + "followers_url": { + "type": "string", + "format": "uri" + }, + "following_url": { + "type": "string", + "format": "uri-template" + }, + "gists_url": { + "type": "string", + "format": "uri-template" + }, + "gravatar_id": { + "type": "string" + }, + "html_url": { + "type": "string", + "format": "uri" + }, + "id": { + "type": "integer", + "format": "int64" + }, + "login": { + "type": "string" + }, + "name": { + "type": "string" + }, + "node_id": { + "type": "string" + }, + "organizations_url": { + "type": "string", + "format": "uri" + }, + "received_events_url": { + "type": "string", + "format": "uri" + }, + "repos_url": { + "type": "string", + "format": "uri" + }, + "site_admin": { + "type": "boolean" + }, + "starred_url": { + "type": "string", + "format": "uri-template" + }, + "subscriptions_url": { + "type": "string", + "format": "uri" + }, + "type": { + "type": "string", + "enum": [ + "Bot", + "User", + "Organization" + ] + }, + "url": { + "type": "string", + "format": "uri" + }, + "user_view_type": { + "type": "string" + } + }, + "required": [ + "login", + "id" + ] + }, + "type": { + "$ref": "#/components/schemas/issue-type" + } + }, + "required": [ + "id", + "number" + ] + }, + "old_repository": { + "title": "Repository", + "description": "A git repository", + "type": "object", + "properties": { + "allow_auto_merge": { + "description": "Whether to allow auto-merge for pull requests.", + "type": "boolean", + "default": false + }, + "allow_forking": { + "description": "Whether to allow private forks", + "type": "boolean" + }, + "allow_merge_commit": { + "description": "Whether to allow merge commits for pull requests.", + "type": "boolean", + "default": true + }, + "allow_rebase_merge": { + "description": "Whether to allow rebase merges for pull requests.", + "type": "boolean", + "default": true + }, + "allow_squash_merge": { + "description": "Whether to allow squash merges for pull requests.", + "type": "boolean", + "default": true + }, + "allow_update_branch": { + "type": "boolean" + }, + "archive_url": { + "type": "string", + "format": "uri-template" + }, + "archived": { + "description": "Whether the repository is archived.", + "type": "boolean", + "default": false + }, + "assignees_url": { + "type": "string", + "format": "uri-template" + }, + "blobs_url": { + "type": "string", + "format": "uri-template" + }, + "branches_url": { + "type": "string", + "format": "uri-template" + }, + "clone_url": { + "type": "string", + "format": "uri" + }, + "collaborators_url": { + "type": "string", + "format": "uri-template" + }, + "comments_url": { + "type": "string", + "format": "uri-template" + }, + "commits_url": { + "type": "string", + "format": "uri-template" + }, + "compare_url": { + "type": "string", + "format": "uri-template" + }, + "contents_url": { + "type": "string", + "format": "uri-template" + }, + "contributors_url": { + "type": "string", + "format": "uri" + }, + "created_at": { + "oneOf": [ + { + "type": "integer" + }, + { + "type": "string", + "format": "date-time" + } + ] + }, + "custom_properties": { + "type": "object", + "description": "The custom properties that were defined for the repository. The keys are the custom property names, and the values are the corresponding custom property values.", + "additionalProperties": true + }, + "default_branch": { + "description": "The default branch of the repository.", + "type": "string" + }, + "delete_branch_on_merge": { + "description": "Whether to delete head branches when pull requests are merged", + "type": "boolean", + "default": false + }, + "deployments_url": { + "type": "string", + "format": "uri" + }, + "description": { + "type": "string", + "nullable": true + }, + "disabled": { + "description": "Returns whether or not this repository is disabled.", + "type": "boolean" + }, + "downloads_url": { + "type": "string", + "format": "uri" + }, + "events_url": { + "type": "string", + "format": "uri" + }, + "fork": { + "type": "boolean" + }, + "forks": { + "type": "integer" + }, + "forks_count": { + "type": "integer" + }, + "forks_url": { + "type": "string", + "format": "uri" + }, + "full_name": { + "type": "string" + }, + "git_commits_url": { + "type": "string", + "format": "uri-template" + }, + "git_refs_url": { + "type": "string", + "format": "uri-template" + }, + "git_tags_url": { + "type": "string", + "format": "uri-template" + }, + "git_url": { + "type": "string", + "format": "uri" + }, + "has_discussions": { + "description": "Whether the repository has discussions enabled.", + "type": "boolean" + }, + "has_pull_requests": { + "description": "Whether pull requests are enabled.", + "type": "boolean", + "default": true + }, + "pull_request_creation_policy": { + "description": "The policy controlling who can create pull requests: all or collaborators_only.", + "type": "string", + "enum": [ + "all", + "collaborators_only" + ] + }, + "has_downloads": { + "description": "Whether downloads are enabled.", + "type": "boolean", + "default": true + }, + "has_issues": { + "description": "Whether issues are enabled.", + "type": "boolean", + "default": true + }, + "has_pages": { + "type": "boolean" + }, + "has_projects": { + "description": "Whether projects are enabled.", + "type": "boolean", + "default": true + }, + "has_wiki": { + "description": "Whether the wiki is enabled.", + "type": "boolean", + "default": true + }, + "homepage": { + "type": "string", + "nullable": true + }, + "hooks_url": { + "type": "string", + "format": "uri" + }, + "html_url": { + "type": "string", + "format": "uri" + }, + "id": { + "description": "Unique identifier of the repository", + "type": "integer", + "format": "int64" + }, + "is_template": { + "type": "boolean" + }, + "issue_comment_url": { + "type": "string", + "format": "uri-template" + }, + "issue_events_url": { + "type": "string", + "format": "uri-template" + }, + "issues_url": { + "type": "string", + "format": "uri-template" + }, + "keys_url": { + "type": "string", + "format": "uri-template" + }, + "labels_url": { + "type": "string", + "format": "uri-template" + }, + "language": { + "type": "string", + "nullable": true + }, + "languages_url": { + "type": "string", + "format": "uri" + }, + "license": { + "title": "License", + "type": "object", + "nullable": true, + "properties": { + "key": { + "type": "string" + }, + "name": { + "type": "string" + }, + "node_id": { + "type": "string" + }, + "spdx_id": { + "type": "string" + }, + "url": { + "type": "string", + "nullable": true, + "format": "uri" + } + }, + "required": [ + "key", + "name", + "spdx_id", + "url", + "node_id" + ] + }, + "master_branch": { + "type": "string" + }, + "merges_url": { + "type": "string", + "format": "uri" + }, + "milestones_url": { + "type": "string", + "format": "uri-template" + }, + "mirror_url": { + "type": "string", + "nullable": true, + "format": "uri" + }, + "name": { + "description": "The name of the repository.", + "type": "string" + }, + "node_id": { + "type": "string" + }, + "notifications_url": { + "type": "string", + "format": "uri-template" + }, + "open_issues": { + "type": "integer" + }, + "open_issues_count": { + "type": "integer" + }, + "organization": { + "type": "string" + }, + "owner": { + "title": "User", + "type": "object", + "nullable": true, + "properties": { + "avatar_url": { + "type": "string", + "format": "uri" + }, + "deleted": { + "type": "boolean" + }, + "email": { + "type": "string", + "nullable": true + }, + "events_url": { + "type": "string", + "format": "uri-template" + }, + "followers_url": { + "type": "string", + "format": "uri" + }, + "following_url": { + "type": "string", + "format": "uri-template" + }, + "gists_url": { + "type": "string", + "format": "uri-template" + }, + "gravatar_id": { + "type": "string" + }, + "html_url": { + "type": "string", + "format": "uri" + }, + "id": { + "type": "integer" + }, + "login": { + "type": "string" + }, + "name": { + "type": "string" + }, + "node_id": { + "type": "string" + }, + "organizations_url": { + "type": "string", + "format": "uri" + }, + "received_events_url": { + "type": "string", + "format": "uri" + }, + "repos_url": { + "type": "string", + "format": "uri" + }, + "site_admin": { + "type": "boolean" + }, + "starred_url": { + "type": "string", + "format": "uri-template" + }, + "subscriptions_url": { + "type": "string", + "format": "uri" + }, + "type": { + "type": "string", + "enum": [ + "Bot", + "User", + "Organization" + ] + }, + "url": { + "type": "string", + "format": "uri" + }, + "user_view_type": { + "type": "string" + } + }, + "required": [ + "login", + "id" + ] + }, + "permissions": { + "type": "object", + "properties": { + "admin": { + "type": "boolean" + }, + "maintain": { + "type": "boolean" + }, + "pull": { + "type": "boolean" + }, + "push": { + "type": "boolean" + }, + "triage": { + "type": "boolean" + } + }, + "required": [ + "pull", + "push", + "admin" + ] + }, + "private": { + "description": "Whether the repository is private or public.", + "type": "boolean" + }, + "public": { + "type": "boolean" + }, + "pulls_url": { + "type": "string", + "format": "uri-template" + }, + "pushed_at": { + "nullable": true, + "oneOf": [ + { + "type": "integer" + }, + { + "type": "string", + "format": "date-time" + } + ] + }, + "releases_url": { + "type": "string", + "format": "uri-template" + }, + "role_name": { + "type": "string", + "nullable": true + }, + "size": { + "type": "integer" + }, + "ssh_url": { + "type": "string" + }, + "stargazers": { + "type": "integer" + }, + "stargazers_count": { + "type": "integer" + }, + "stargazers_url": { + "type": "string", + "format": "uri" + }, + "statuses_url": { + "type": "string", + "format": "uri-template" + }, + "subscribers_url": { + "type": "string", + "format": "uri" + }, + "subscription_url": { + "type": "string", + "format": "uri" + }, + "svn_url": { + "type": "string", + "format": "uri" + }, + "tags_url": { + "type": "string", + "format": "uri" + }, + "teams_url": { + "type": "string", + "format": "uri" + }, + "topics": { + "type": "array", + "items": { + "type": "string" + } + }, + "trees_url": { + "type": "string", + "format": "uri-template" + }, + "updated_at": { + "type": "string", + "format": "date-time" + }, + "url": { + "type": "string", + "format": "uri" + }, + "visibility": { + "type": "string", + "enum": [ + "public", + "private", + "internal" + ] + }, + "watchers": { + "type": "integer" + }, + "watchers_count": { + "type": "integer" + }, + "web_commit_signoff_required": { + "description": "Whether to require commit signoff.", + "type": "boolean" + } + }, + "required": [ + "id", + "node_id", + "name", + "full_name", + "private", + "owner", + "html_url", + "description", + "fork", + "url", + "forks_url", + "keys_url", + "collaborators_url", + "teams_url", + "hooks_url", + "issue_events_url", + "events_url", + "assignees_url", + "branches_url", + "tags_url", + "blobs_url", + "git_tags_url", + "git_refs_url", + "trees_url", + "statuses_url", + "languages_url", + "stargazers_url", + "contributors_url", + "subscribers_url", + "subscription_url", + "commits_url", + "git_commits_url", + "comments_url", + "issue_comment_url", + "contents_url", + "compare_url", + "merges_url", + "archive_url", + "downloads_url", + "issues_url", + "pulls_url", + "milestones_url", + "notifications_url", + "labels_url", + "releases_url", + "deployments_url", + "created_at", + "updated_at", + "pushed_at", + "git_url", + "ssh_url", + "clone_url", + "svn_url", + "homepage", + "size", + "stargazers_count", + "watchers_count", + "language", + "has_issues", + "has_projects", + "has_downloads", + "has_wiki", + "has_pages", + "forks_count", + "mirror_url", + "archived", + "open_issues_count", + "license", + "forks", + "open_issues", + "watchers", + "default_branch", + "topics", + "visibility" + ] + } + }, + "required": [ + "old_issue", + "old_repository" + ] + }, + "enterprise": { + "$ref": "#/components/schemas/enterprise-webhooks" + }, + "installation": { + "$ref": "#/components/schemas/simple-installation" + }, + "issue": { + "title": "Issue", + "description": "The [issue](https://docs.github.com/rest/issues/issues#get-an-issue) itself.", + "type": "object", + "properties": { + "active_lock_reason": { + "type": "string", + "nullable": true, + "enum": [ + "resolved", + "off-topic", + "too heated", + "spam", + null + ] + }, + "assignee": { + "title": "User", + "type": "object", + "nullable": true, + "properties": { + "avatar_url": { + "type": "string", + "format": "uri" + }, + "deleted": { + "type": "boolean" + }, + "email": { + "type": "string", + "nullable": true + }, + "events_url": { + "type": "string", + "format": "uri-template" + }, + "followers_url": { + "type": "string", + "format": "uri" + }, + "following_url": { + "type": "string", + "format": "uri-template" + }, + "gists_url": { + "type": "string", + "format": "uri-template" + }, + "gravatar_id": { + "type": "string" + }, + "html_url": { + "type": "string", + "format": "uri" + }, + "id": { + "type": "integer" + }, + "login": { + "type": "string" + }, + "name": { + "type": "string" + }, + "node_id": { + "type": "string" + }, + "organizations_url": { + "type": "string", + "format": "uri" + }, + "received_events_url": { + "type": "string", + "format": "uri" + }, + "repos_url": { + "type": "string", + "format": "uri" + }, + "site_admin": { + "type": "boolean" + }, + "starred_url": { + "type": "string", + "format": "uri-template" + }, + "subscriptions_url": { + "type": "string", + "format": "uri" + }, + "type": { + "type": "string", + "enum": [ + "Bot", + "User", + "Organization" + ] + }, + "url": { + "type": "string", + "format": "uri" + }, + "user_view_type": { + "type": "string" + } + }, + "required": [ + "login", + "id" + ] + }, + "assignees": { + "type": "array", + "items": { + "title": "User", + "type": "object", + "nullable": true, + "properties": { + "avatar_url": { + "type": "string", + "format": "uri" + }, + "deleted": { + "type": "boolean" + }, + "email": { + "type": "string", + "nullable": true + }, + "events_url": { + "type": "string", + "format": "uri-template" + }, + "followers_url": { + "type": "string", + "format": "uri" + }, + "following_url": { + "type": "string", + "format": "uri-template" + }, + "gists_url": { + "type": "string", + "format": "uri-template" + }, + "gravatar_id": { + "type": "string" + }, + "html_url": { + "type": "string", + "format": "uri" + }, + "id": { + "type": "integer" + }, + "login": { + "type": "string" + }, + "name": { + "type": "string" + }, + "node_id": { + "type": "string" + }, + "organizations_url": { + "type": "string", + "format": "uri" + }, + "received_events_url": { + "type": "string", + "format": "uri" + }, + "repos_url": { + "type": "string", + "format": "uri" + }, + "site_admin": { + "type": "boolean" + }, + "starred_url": { + "type": "string", + "format": "uri-template" + }, + "subscriptions_url": { + "type": "string", + "format": "uri" + }, + "type": { + "type": "string", + "enum": [ + "Bot", + "User", + "Organization" + ] + }, + "url": { + "type": "string", + "format": "uri" + }, + "user_view_type": { + "type": "string" + } + }, + "required": [ + "login", + "id" + ] + } + }, + "author_association": { + "title": "AuthorAssociation", + "description": "How the author is associated with the repository.", + "type": "string", + "enum": [ + "COLLABORATOR", + "CONTRIBUTOR", + "FIRST_TIMER", + "FIRST_TIME_CONTRIBUTOR", + "MANNEQUIN", + "MEMBER", + "NONE", + "OWNER" + ] + }, + "body": { + "description": "Contents of the issue", + "type": "string", + "nullable": true + }, + "closed_at": { + "type": "string", + "nullable": true, + "format": "date-time" + }, + "comments": { + "type": "integer" + }, + "comments_url": { + "type": "string", + "format": "uri" + }, + "created_at": { + "type": "string", + "format": "date-time" + }, + "draft": { + "type": "boolean" + }, + "events_url": { + "type": "string", + "format": "uri" + }, + "html_url": { + "type": "string", + "format": "uri" + }, + "id": { + "type": "integer", + "format": "int64" + }, + "labels": { + "type": "array", + "items": { + "title": "Label", + "type": "object", + "properties": { + "color": { + "description": "6-character hex code, without the leading #, identifying the color", + "type": "string" + }, + "default": { + "type": "boolean" + }, + "description": { + "type": "string", + "nullable": true + }, + "id": { + "type": "integer" + }, + "name": { + "description": "The name of the label.", + "type": "string" + }, + "node_id": { + "type": "string" + }, + "url": { + "description": "URL for the label", + "type": "string", + "format": "uri" + } + }, + "required": [ + "id", + "node_id", + "url", + "name", + "color", + "default", + "description" + ] + } + }, + "labels_url": { + "type": "string", + "format": "uri-template" + }, + "locked": { + "type": "boolean" + }, + "milestone": { + "title": "Milestone", + "description": "A collection of related issues and pull requests.", + "type": "object", + "nullable": true, + "properties": { + "closed_at": { + "type": "string", + "nullable": true, + "format": "date-time" + }, + "closed_issues": { + "type": "integer" + }, + "created_at": { + "type": "string", + "format": "date-time" + }, + "creator": { + "title": "User", + "type": "object", + "nullable": true, + "properties": { + "avatar_url": { + "type": "string", + "format": "uri" + }, + "deleted": { + "type": "boolean" + }, + "email": { + "type": "string", + "nullable": true + }, + "events_url": { + "type": "string", + "format": "uri-template" + }, + "followers_url": { + "type": "string", + "format": "uri" + }, + "following_url": { + "type": "string", + "format": "uri-template" + }, + "gists_url": { + "type": "string", + "format": "uri-template" + }, + "gravatar_id": { + "type": "string" + }, + "html_url": { + "type": "string", + "format": "uri" + }, + "id": { + "type": "integer" + }, + "login": { + "type": "string" + }, + "name": { + "type": "string" + }, + "node_id": { + "type": "string" + }, + "organizations_url": { + "type": "string", + "format": "uri" + }, + "received_events_url": { + "type": "string", + "format": "uri" + }, + "repos_url": { + "type": "string", + "format": "uri" + }, + "site_admin": { + "type": "boolean" + }, + "starred_url": { + "type": "string", + "format": "uri-template" + }, + "subscriptions_url": { + "type": "string", + "format": "uri" + }, + "type": { + "type": "string", + "enum": [ + "Bot", + "User", + "Organization", + "Mannequin" + ] + }, + "url": { + "type": "string", + "format": "uri" + }, + "user_view_type": { + "type": "string" + } + }, + "required": [ + "login", + "id" + ] + }, + "description": { + "type": "string", + "nullable": true + }, + "due_on": { + "type": "string", + "nullable": true, + "format": "date-time" + }, + "html_url": { + "type": "string", + "format": "uri" + }, + "id": { + "type": "integer" + }, + "labels_url": { + "type": "string", + "format": "uri" + }, + "node_id": { + "type": "string" + }, + "number": { + "description": "The number of the milestone.", + "type": "integer" + }, + "open_issues": { + "type": "integer" + }, + "state": { + "description": "The state of the milestone.", + "type": "string", + "enum": [ + "open", + "closed" + ] + }, + "title": { + "description": "The title of the milestone.", + "type": "string" + }, + "updated_at": { + "type": "string", + "format": "date-time" + }, + "url": { + "type": "string", + "format": "uri" + } + }, + "required": [ + "url", + "html_url", + "labels_url", + "id", + "node_id", + "number", + "title", + "description", + "creator", + "open_issues", + "closed_issues", + "state", + "created_at", + "updated_at", + "due_on", + "closed_at" + ] + }, + "node_id": { + "type": "string" + }, + "number": { + "type": "integer" + }, + "performed_via_github_app": { + "title": "App", + "description": "GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub.", + "type": "object", + "nullable": true, + "properties": { + "created_at": { + "type": "string", + "nullable": true, + "format": "date-time" + }, + "description": { + "type": "string", + "nullable": true + }, + "events": { + "description": "The list of events for the GitHub app", + "type": "array", + "items": { + "type": "string", + "enum": [ + "branch_protection_rule", + "check_run", + "check_suite", + "code_scanning_alert", + "commit_comment", + "content_reference", + "create", + "delete", + "deployment", + "deployment_review", + "deployment_status", + "deploy_key", + "discussion", + "discussion_comment", + "fork", + "gollum", + "issues", + "issue_comment", + "label", + "member", + "membership", + "milestone", + "organization", + "org_block", + "page_build", + "project", + "project_card", + "project_column", + "public", + "pull_request", + "pull_request_review", + "pull_request_review_comment", + "push", + "registry_package", + "release", + "repository", + "repository_dispatch", + "secret_scanning_alert", + "star", + "status", + "team", + "team_add", + "watch", + "workflow_dispatch", + "workflow_run", + "security_and_analysis", + "pull_request_review_thread", + "reminder" + ] + } + }, + "external_url": { + "type": "string", + "nullable": true, + "format": "uri" + }, + "html_url": { + "type": "string", + "format": "uri" + }, + "id": { + "description": "Unique identifier of the GitHub app", + "type": "integer", + "nullable": true + }, + "name": { + "description": "The name of the GitHub app", + "type": "string" + }, + "node_id": { + "type": "string" + }, + "owner": { + "title": "User", + "type": "object", + "nullable": true, + "properties": { + "avatar_url": { + "type": "string", + "format": "uri" + }, + "deleted": { + "type": "boolean" + }, + "email": { + "type": "string", + "nullable": true + }, + "events_url": { + "type": "string", + "format": "uri-template" + }, + "followers_url": { + "type": "string", + "format": "uri" + }, + "following_url": { + "type": "string", + "format": "uri-template" + }, + "gists_url": { + "type": "string", + "format": "uri-template" + }, + "gravatar_id": { + "type": "string" + }, + "html_url": { + "type": "string", + "format": "uri" + }, + "id": { + "type": "integer" + }, + "login": { + "type": "string" + }, + "name": { + "type": "string" + }, + "node_id": { + "type": "string" + }, + "organizations_url": { + "type": "string", + "format": "uri" + }, + "received_events_url": { + "type": "string", + "format": "uri" + }, + "repos_url": { + "type": "string", + "format": "uri" + }, + "site_admin": { + "type": "boolean" + }, + "starred_url": { + "type": "string", + "format": "uri-template" + }, + "subscriptions_url": { + "type": "string", + "format": "uri" + }, + "type": { + "type": "string", + "enum": [ + "Bot", + "User", + "Organization" + ] + }, + "url": { + "type": "string", + "format": "uri" + }, + "user_view_type": { + "type": "string" + } + }, + "required": [ + "login", + "id" + ] + }, + "permissions": { + "description": "The set of permissions for the GitHub app", + "type": "object", + "properties": { + "actions": { + "type": "string", + "enum": [ + "read", + "write" + ] + }, + "administration": { + "type": "string", + "enum": [ + "read", + "write" + ] + }, + "checks": { + "type": "string", + "enum": [ + "read", + "write" + ] + }, + "content_references": { + "type": "string", + "enum": [ + "read", + "write" + ] + }, + "contents": { + "type": "string", + "enum": [ + "read", + "write" + ] + }, + "deployments": { + "type": "string", + "enum": [ + "read", + "write" + ] + }, + "discussions": { + "type": "string", + "enum": [ + "read", + "write" + ] + }, + "emails": { + "type": "string", + "enum": [ + "read", + "write" + ] + }, + "environments": { + "type": "string", + "enum": [ + "read", + "write" + ] + }, + "issues": { + "type": "string", + "enum": [ + "read", + "write" + ] + }, + "keys": { + "type": "string", + "enum": [ + "read", + "write" + ] + }, + "members": { + "type": "string", + "enum": [ + "read", + "write" + ] + }, + "metadata": { + "type": "string", + "enum": [ + "read", + "write" + ] + }, + "organization_administration": { + "type": "string", + "enum": [ + "read", + "write" + ] + }, + "organization_hooks": { + "type": "string", + "enum": [ + "read", + "write" + ] + }, + "organization_packages": { + "type": "string", + "enum": [ + "read", + "write" + ] + }, + "organization_plan": { + "type": "string", + "enum": [ + "read", + "write" + ] + }, + "organization_projects": { + "type": "string", + "enum": [ + "read", + "write", + "admin" + ] + }, + "organization_secrets": { + "type": "string", + "enum": [ + "read", + "write" + ] + }, + "organization_self_hosted_runners": { + "type": "string", + "enum": [ + "read", + "write" + ] + }, + "organization_user_blocking": { + "type": "string", + "enum": [ + "read", + "write" + ] + }, + "packages": { + "type": "string", + "enum": [ + "read", + "write" + ] + }, + "pages": { + "type": "string", + "enum": [ + "read", + "write" + ] + }, + "pull_requests": { + "type": "string", + "enum": [ + "read", + "write" + ] + }, + "repository_hooks": { + "type": "string", + "enum": [ + "read", + "write" + ] + }, + "repository_projects": { + "type": "string", + "enum": [ + "read", + "write" + ] + }, + "secret_scanning_alerts": { + "type": "string", + "enum": [ + "read", + "write" + ] + }, + "secrets": { + "type": "string", + "enum": [ + "read", + "write" + ] + }, + "security_events": { + "type": "string", + "enum": [ + "read", + "write" + ] + }, + "security_scanning_alert": { + "type": "string", + "enum": [ + "read", + "write" + ] + }, + "single_file": { + "type": "string", + "enum": [ + "read", + "write" + ] + }, + "statuses": { + "type": "string", + "enum": [ + "read", + "write" + ] + }, + "vulnerability_alerts": { + "type": "string", + "enum": [ + "read", + "write" + ] + }, + "workflows": { + "type": "string", + "enum": [ + "read", + "write" + ] + } + } + }, + "slug": { + "description": "The slug name of the GitHub app", + "type": "string" + }, + "updated_at": { + "type": "string", + "nullable": true, + "format": "date-time" + } + }, + "required": [ + "id", + "node_id", + "owner", + "name", + "description", + "external_url", + "html_url", + "created_at", + "updated_at" + ] + }, + "pull_request": { + "type": "object", + "properties": { + "diff_url": { + "type": "string", + "format": "uri" + }, + "html_url": { + "type": "string", + "format": "uri" + }, + "merged_at": { + "type": "string", + "nullable": true, + "format": "date-time" + }, + "patch_url": { + "type": "string", + "format": "uri" + }, + "url": { + "type": "string", + "format": "uri" + } + } + }, + "reactions": { + "title": "Reactions", + "type": "object", + "properties": { + "+1": { + "type": "integer" + }, + "-1": { + "type": "integer" + }, + "confused": { + "type": "integer" + }, + "eyes": { + "type": "integer" + }, + "heart": { + "type": "integer" + }, + "hooray": { + "type": "integer" + }, + "laugh": { + "type": "integer" + }, + "rocket": { + "type": "integer" + }, + "total_count": { + "type": "integer" + }, + "url": { + "type": "string", + "format": "uri" + } + }, + "required": [ + "url", + "total_count", + "+1", + "-1", + "laugh", + "confused", + "heart", + "hooray", + "eyes", + "rocket" + ] + }, + "repository_url": { + "type": "string", + "format": "uri" + }, + "sub_issues_summary": { + "$ref": "#/components/schemas/sub-issues-summary" + }, + "issue_dependencies_summary": { + "$ref": "#/components/schemas/issue-dependencies-summary" + }, + "issue_field_values": { + "type": "array", + "items": { + "$ref": "#/components/schemas/issue-field-value" + } + }, + "state": { + "description": "State of the issue; either 'open' or 'closed'", + "type": "string", + "enum": [ + "open", + "closed" + ] + }, + "state_reason": { + "type": "string", + "nullable": true + }, + "timeline_url": { + "type": "string", + "format": "uri" + }, + "title": { + "description": "Title of the issue", + "type": "string" + }, + "type": { + "$ref": "#/components/schemas/issue-type" + }, + "updated_at": { + "type": "string", + "format": "date-time" + }, + "url": { + "description": "URL for the issue", + "type": "string", + "format": "uri" + }, + "pinned_comment": { + "$ref": "#/components/schemas/nullable-issue-comment" + }, + "user": { + "title": "User", + "type": "object", + "nullable": true, + "properties": { + "avatar_url": { + "type": "string", + "format": "uri" + }, + "deleted": { + "type": "boolean" + }, + "email": { + "type": "string", + "nullable": true + }, + "events_url": { + "type": "string", + "format": "uri-template" + }, + "followers_url": { + "type": "string", + "format": "uri" + }, + "following_url": { + "type": "string", + "format": "uri-template" + }, + "gists_url": { + "type": "string", + "format": "uri-template" + }, + "gravatar_id": { + "type": "string" + }, + "html_url": { + "type": "string", + "format": "uri" + }, + "id": { + "type": "integer", + "format": "int64" + }, + "login": { + "type": "string" + }, + "name": { + "type": "string" + }, + "node_id": { + "type": "string" + }, + "organizations_url": { + "type": "string", + "format": "uri" + }, + "received_events_url": { + "type": "string", + "format": "uri" + }, + "repos_url": { + "type": "string", + "format": "uri" + }, + "site_admin": { + "type": "boolean" + }, + "starred_url": { + "type": "string", + "format": "uri-template" + }, + "subscriptions_url": { + "type": "string", + "format": "uri" + }, + "type": { + "type": "string", + "enum": [ + "Bot", + "User", + "Organization" + ] + }, + "url": { + "type": "string", + "format": "uri" + }, + "user_view_type": { + "type": "string" + } + }, + "required": [ + "login", + "id" + ] + } + }, + "required": [ + "url", + "repository_url", + "labels_url", + "comments_url", + "events_url", + "html_url", + "id", + "node_id", + "number", + "title", + "user", + "assignees", + "milestone", + "comments", + "created_at", + "updated_at", + "closed_at", + "author_association", + "active_lock_reason", + "body", + "reactions" + ] + }, + "organization": { + "$ref": "#/components/schemas/organization-simple-webhooks" + }, + "repository": { + "$ref": "#/components/schemas/repository-webhooks" + }, + "sender": { + "$ref": "#/components/schemas/simple-user" + } + }, + "required": [ + "action", + "issue", + "repository", + "sender" + ] + }, + "webhook-pull-request-closed": { + "title": "pull_request closed event", + "type": "object", + "properties": { + "action": { + "type": "string", + "enum": [ + "closed" + ] + }, + "enterprise": { + "$ref": "#/components/schemas/enterprise-webhooks" + }, + "installation": { + "$ref": "#/components/schemas/simple-installation" + }, + "number": { + "$ref": "#/components/schemas/webhooks_number" + }, + "organization": { + "$ref": "#/components/schemas/organization-simple-webhooks" + }, + "pull_request": { + "$ref": "#/components/schemas/pull-request-webhook" + }, + "repository": { + "$ref": "#/components/schemas/repository-webhooks" + }, + "sender": { + "$ref": "#/components/schemas/simple-user" + } + }, + "required": [ + "action", + "number", + "pull_request", + "repository", + "sender" + ] + }, + "webhook-pull-request-opened": { + "title": "pull_request opened event", + "type": "object", + "properties": { + "action": { + "type": "string", + "enum": [ + "opened" + ] + }, + "enterprise": { + "$ref": "#/components/schemas/enterprise-webhooks" + }, + "installation": { + "$ref": "#/components/schemas/simple-installation" + }, + "number": { + "$ref": "#/components/schemas/webhooks_number" + }, + "organization": { + "$ref": "#/components/schemas/organization-simple-webhooks" + }, + "pull_request": { + "$ref": "#/components/schemas/pull-request-webhook" + }, + "repository": { + "$ref": "#/components/schemas/repository-webhooks" + }, + "sender": { + "$ref": "#/components/schemas/simple-user" + } + }, + "required": [ + "action", + "number", + "pull_request", + "repository", + "sender" + ] + }, + "webhook-push": { + "title": "push event", + "type": "object", + "properties": { + "after": { + "description": "The SHA of the most recent commit on `ref` after the push.", + "type": "string" + }, + "base_ref": { + "$ref": "#/components/schemas/webhooks_nullable_string" + }, + "before": { + "description": "The SHA of the most recent commit on `ref` before the push.", + "type": "string" + }, + "commits": { + "description": "An array of commit objects describing the pushed commits. (Pushed commits are all commits that are included in the `compare` between the `before` commit and the `after` commit.) The array includes a maximum of 2048 commits. If necessary, you can use the [Commits API](https://docs.github.com/rest/commits) to fetch additional commits.", + "type": "array", + "items": { + "title": "Commit", + "type": "object", + "properties": { + "added": { + "description": "An array of files added in the commit. A maximum of 3000 changed files will be reported per commit.", + "type": "array", + "items": { + "type": "string" + } + }, + "author": { + "title": "Committer", + "description": "Metaproperties for Git author/committer information.", + "type": "object", + "properties": { + "date": { + "type": "string", + "format": "date-time" + }, + "email": { + "type": "string", + "nullable": true, + "format": "email" + }, + "name": { + "description": "The git author's name.", + "type": "string" + }, + "username": { + "type": "string" + } + }, + "required": [ + "email", + "name" + ] + }, + "committer": { + "title": "Committer", + "description": "Metaproperties for Git author/committer information.", + "type": "object", + "properties": { + "date": { + "type": "string", + "format": "date-time" + }, + "email": { + "type": "string", + "nullable": true, + "format": "email" + }, + "name": { + "description": "The git author's name.", + "type": "string" + }, + "username": { + "type": "string" + } + }, + "required": [ + "email", + "name" + ] + }, + "distinct": { + "description": "Whether this commit is distinct from any that have been pushed before.", + "type": "boolean" + }, + "id": { + "type": "string" + }, + "message": { + "description": "The commit message.", + "type": "string" + }, + "modified": { + "description": "An array of files modified by the commit. A maximum of 3000 changed files will be reported per commit.", + "type": "array", + "items": { + "type": "string" + } + }, + "removed": { + "description": "An array of files removed in the commit. A maximum of 3000 changed files will be reported per commit.", + "type": "array", + "items": { + "type": "string" + } + }, + "timestamp": { + "description": "The ISO 8601 timestamp of the commit.", + "type": "string", + "format": "date-time" + }, + "tree_id": { + "type": "string" + }, + "url": { + "description": "URL that points to the commit API resource.", + "type": "string", + "format": "uri" + } + }, + "required": [ + "id", + "tree_id", + "distinct", + "message", + "timestamp", + "url", + "author", + "committer" + ] + } + }, + "compare": { + "description": "URL that shows the changes in this `ref` update, from the `before` commit to the `after` commit. For a newly created `ref` that is directly based on the default branch, this is the comparison between the head of the default branch and the `after` commit. Otherwise, this shows all commits until the `after` commit.", + "type": "string" + }, + "created": { + "description": "Whether this push created the `ref`.", + "type": "boolean" + }, + "deleted": { + "description": "Whether this push deleted the `ref`.", + "type": "boolean" + }, + "enterprise": { + "$ref": "#/components/schemas/enterprise-webhooks" + }, + "forced": { + "description": "Whether this push was a force push of the `ref`.", + "type": "boolean" + }, + "head_commit": { + "title": "Commit", + "type": "object", + "nullable": true, + "properties": { + "added": { + "description": "An array of files added in the commit.", + "type": "array", + "items": { + "type": "string" + } + }, + "author": { + "title": "Committer", + "description": "Metaproperties for Git author/committer information.", + "type": "object", + "properties": { + "date": { + "type": "string", + "format": "date-time" + }, + "email": { + "type": "string", + "nullable": true, + "format": "email" + }, + "name": { + "description": "The git author's name.", + "type": "string" + }, + "username": { + "type": "string" + } + }, + "required": [ + "email", + "name" + ] + }, + "committer": { + "title": "Committer", + "description": "Metaproperties for Git author/committer information.", + "type": "object", + "properties": { + "date": { + "type": "string", + "format": "date-time" + }, + "email": { + "type": "string", + "nullable": true, + "format": "email" + }, + "name": { + "description": "The git author's name.", + "type": "string" + }, + "username": { + "type": "string" + } + }, + "required": [ + "email", + "name" + ] + }, + "distinct": { + "description": "Whether this commit is distinct from any that have been pushed before.", + "type": "boolean" + }, + "id": { + "type": "string" + }, + "message": { + "description": "The commit message.", + "type": "string" + }, + "modified": { + "description": "An array of files modified by the commit.", + "type": "array", + "items": { + "type": "string" + } + }, + "removed": { + "description": "An array of files removed in the commit.", + "type": "array", + "items": { + "type": "string" + } + }, + "timestamp": { + "description": "The ISO 8601 timestamp of the commit.", + "type": "string", + "format": "date-time" + }, + "tree_id": { + "type": "string" + }, + "url": { + "description": "URL that points to the commit API resource.", + "type": "string", + "format": "uri" + } + }, + "required": [ + "id", + "tree_id", + "distinct", + "message", + "timestamp", + "url", + "author", + "committer" + ] + }, + "installation": { + "$ref": "#/components/schemas/simple-installation" + }, + "organization": { + "$ref": "#/components/schemas/organization-simple-webhooks" + }, + "pusher": { + "title": "Committer", + "description": "Metaproperties for Git author/committer information.", + "type": "object", + "properties": { + "date": { + "type": "string", + "format": "date-time" + }, + "email": { + "type": "string", + "nullable": true, + "format": "email" + }, + "name": { + "description": "The git author's name.", + "type": "string" + }, + "username": { + "type": "string" + } + }, + "required": [ + "name" + ] + }, + "ref": { + "description": "The full git ref that was pushed. Example: `refs/heads/main` or `refs/tags/v3.14.1`.", + "type": "string" + }, + "repository": { + "title": "Repository", + "description": "A git repository", + "type": "object", + "properties": { + "allow_auto_merge": { + "description": "Whether to allow auto-merge for pull requests.", + "type": "boolean", + "default": false + }, + "allow_forking": { + "description": "Whether to allow private forks", + "type": "boolean" + }, + "allow_merge_commit": { + "description": "Whether to allow merge commits for pull requests.", + "type": "boolean", + "default": true + }, + "allow_rebase_merge": { + "description": "Whether to allow rebase merges for pull requests.", + "type": "boolean", + "default": true + }, + "allow_squash_merge": { + "description": "Whether to allow squash merges for pull requests.", + "type": "boolean", + "default": true + }, + "allow_update_branch": { + "type": "boolean" + }, + "archive_url": { + "type": "string", + "format": "uri-template" + }, + "archived": { + "description": "Whether the repository is archived.", + "type": "boolean", + "default": false + }, + "assignees_url": { + "type": "string", + "format": "uri-template" + }, + "blobs_url": { + "type": "string", + "format": "uri-template" + }, + "branches_url": { + "type": "string", + "format": "uri-template" + }, + "clone_url": { + "type": "string", + "format": "uri" + }, + "collaborators_url": { + "type": "string", + "format": "uri-template" + }, + "comments_url": { + "type": "string", + "format": "uri-template" + }, + "commits_url": { + "type": "string", + "format": "uri-template" + }, + "compare_url": { + "type": "string", + "format": "uri-template" + }, + "contents_url": { + "type": "string", + "format": "uri-template" + }, + "contributors_url": { + "type": "string", + "format": "uri" + }, + "created_at": { + "oneOf": [ + { + "type": "integer" + }, + { + "type": "string", + "format": "date-time" + } + ] + }, + "custom_properties": { + "type": "object", + "description": "The custom properties that were defined for the repository. The keys are the custom property names, and the values are the corresponding custom property values.", + "additionalProperties": true + }, + "default_branch": { + "description": "The default branch of the repository.", + "type": "string" + }, + "delete_branch_on_merge": { + "description": "Whether to delete head branches when pull requests are merged", + "type": "boolean", + "default": false + }, + "deployments_url": { + "type": "string", + "format": "uri" + }, + "description": { + "type": "string", + "nullable": true + }, + "disabled": { + "description": "Returns whether or not this repository is disabled.", + "type": "boolean" + }, + "downloads_url": { + "type": "string", + "format": "uri" + }, + "events_url": { + "type": "string", + "format": "uri" + }, + "fork": { + "type": "boolean" + }, + "forks": { + "type": "integer" + }, + "forks_count": { + "type": "integer" + }, + "forks_url": { + "type": "string", + "format": "uri" + }, + "full_name": { + "type": "string" + }, + "git_commits_url": { + "type": "string", + "format": "uri-template" + }, + "git_refs_url": { + "type": "string", + "format": "uri-template" + }, + "git_tags_url": { + "type": "string", + "format": "uri-template" + }, + "git_url": { + "type": "string", + "format": "uri" + }, + "has_downloads": { + "description": "Whether downloads are enabled.", + "type": "boolean", + "default": true + }, + "has_issues": { + "description": "Whether issues are enabled.", + "type": "boolean", + "default": true + }, + "has_pages": { + "type": "boolean" + }, + "has_projects": { + "description": "Whether projects are enabled.", + "type": "boolean", + "default": true + }, + "has_wiki": { + "description": "Whether the wiki is enabled.", + "type": "boolean", + "default": true + }, + "has_discussions": { + "description": "Whether discussions are enabled.", + "type": "boolean", + "default": false + }, + "has_pull_requests": { + "description": "Whether pull requests are enabled.", + "type": "boolean", + "default": true + }, + "pull_request_creation_policy": { + "description": "The policy controlling who can create pull requests: all or collaborators_only.", + "type": "string", + "enum": [ + "all", + "collaborators_only" + ] + }, + "homepage": { + "type": "string", + "nullable": true + }, + "hooks_url": { + "type": "string", + "format": "uri" + }, + "html_url": { + "type": "string", + "format": "uri" + }, + "id": { + "description": "Unique identifier of the repository", + "type": "integer", + "format": "int64" + }, + "is_template": { + "type": "boolean" + }, + "issue_comment_url": { + "type": "string", + "format": "uri-template" + }, + "issue_events_url": { + "type": "string", + "format": "uri-template" + }, + "issues_url": { + "type": "string", + "format": "uri-template" + }, + "keys_url": { + "type": "string", + "format": "uri-template" + }, + "labels_url": { + "type": "string", + "format": "uri-template" + }, + "language": { + "type": "string", + "nullable": true + }, + "languages_url": { + "type": "string", + "format": "uri" + }, + "license": { + "title": "License", + "type": "object", + "nullable": true, + "properties": { + "key": { + "type": "string" + }, + "name": { + "type": "string" + }, + "node_id": { + "type": "string" + }, + "spdx_id": { + "type": "string" + }, + "url": { + "type": "string", + "nullable": true, + "format": "uri" + } + }, + "required": [ + "key", + "name", + "spdx_id", + "url", + "node_id" + ] + }, + "master_branch": { + "type": "string" + }, + "merges_url": { + "type": "string", + "format": "uri" + }, + "milestones_url": { + "type": "string", + "format": "uri-template" + }, + "mirror_url": { + "type": "string", + "nullable": true, + "format": "uri" + }, + "name": { + "description": "The name of the repository.", + "type": "string" + }, + "node_id": { + "type": "string" + }, + "notifications_url": { + "type": "string", + "format": "uri-template" + }, + "open_issues": { + "type": "integer" + }, + "open_issues_count": { + "type": "integer" + }, + "organization": { + "type": "string" + }, + "owner": { + "title": "User", + "type": "object", + "nullable": true, + "properties": { + "avatar_url": { + "type": "string", + "format": "uri" + }, + "deleted": { + "type": "boolean" + }, + "email": { + "type": "string", + "nullable": true + }, + "events_url": { + "type": "string", + "format": "uri-template" + }, + "followers_url": { + "type": "string", + "format": "uri" + }, + "following_url": { + "type": "string", + "format": "uri-template" + }, + "gists_url": { + "type": "string", + "format": "uri-template" + }, + "gravatar_id": { + "type": "string" + }, + "html_url": { + "type": "string", + "format": "uri" + }, + "id": { + "type": "integer" + }, + "login": { + "type": "string" + }, + "name": { + "type": "string" + }, + "node_id": { + "type": "string" + }, + "organizations_url": { + "type": "string", + "format": "uri" + }, + "received_events_url": { + "type": "string", + "format": "uri" + }, + "repos_url": { + "type": "string", + "format": "uri" + }, + "site_admin": { + "type": "boolean" + }, + "starred_url": { + "type": "string", + "format": "uri-template" + }, + "subscriptions_url": { + "type": "string", + "format": "uri" + }, + "type": { + "type": "string", + "enum": [ + "Bot", + "User", + "Organization" + ] + }, + "url": { + "type": "string", + "format": "uri" + }, + "user_view_type": { + "type": "string" + } + }, + "required": [ + "login", + "id" + ] + }, + "permissions": { + "type": "object", + "properties": { + "admin": { + "type": "boolean" + }, + "maintain": { + "type": "boolean" + }, + "pull": { + "type": "boolean" + }, + "push": { + "type": "boolean" + }, + "triage": { + "type": "boolean" + } + }, + "required": [ + "pull", + "push", + "admin" + ] + }, + "private": { + "description": "Whether the repository is private or public.", + "type": "boolean" + }, + "public": { + "type": "boolean" + }, + "pulls_url": { + "type": "string", + "format": "uri-template" + }, + "pushed_at": { + "nullable": true, + "oneOf": [ + { + "type": "integer" + }, + { + "type": "string", + "format": "date-time" + } + ] + }, + "releases_url": { + "type": "string", + "format": "uri-template" + }, + "role_name": { + "type": "string", + "nullable": true + }, + "size": { + "type": "integer" + }, + "ssh_url": { + "type": "string" + }, + "stargazers": { + "type": "integer" + }, + "stargazers_count": { + "type": "integer" + }, + "stargazers_url": { + "type": "string", + "format": "uri" + }, + "statuses_url": { + "type": "string", + "format": "uri-template" + }, + "subscribers_url": { + "type": "string", + "format": "uri" + }, + "subscription_url": { + "type": "string", + "format": "uri" + }, + "svn_url": { + "type": "string", + "format": "uri" + }, + "tags_url": { + "type": "string", + "format": "uri" + }, + "teams_url": { + "type": "string", + "format": "uri" + }, + "topics": { + "type": "array", + "items": { + "type": "string" + } + }, + "trees_url": { + "type": "string", + "format": "uri-template" + }, + "updated_at": { + "type": "string", + "format": "date-time" + }, + "url": { + "type": "string", + "format": "uri" + }, + "visibility": { + "type": "string", + "enum": [ + "public", + "private", + "internal" + ] + }, + "watchers": { + "type": "integer" + }, + "watchers_count": { + "type": "integer" + }, + "web_commit_signoff_required": { + "description": "Whether to require contributors to sign off on web-based commits", + "type": "boolean" + } + }, + "required": [ + "id", + "node_id", + "name", + "full_name", + "private", + "owner", + "html_url", + "description", + "fork", + "url", + "forks_url", + "keys_url", + "collaborators_url", + "teams_url", + "hooks_url", + "issue_events_url", + "events_url", + "assignees_url", + "branches_url", + "tags_url", + "blobs_url", + "git_tags_url", + "git_refs_url", + "trees_url", + "statuses_url", + "languages_url", + "stargazers_url", + "contributors_url", + "subscribers_url", + "subscription_url", + "commits_url", + "git_commits_url", + "comments_url", + "issue_comment_url", + "contents_url", + "compare_url", + "merges_url", + "archive_url", + "downloads_url", + "issues_url", + "pulls_url", + "milestones_url", + "notifications_url", + "labels_url", + "releases_url", + "deployments_url", + "created_at", + "updated_at", + "pushed_at", + "git_url", + "ssh_url", + "clone_url", + "svn_url", + "homepage", + "size", + "stargazers_count", + "watchers_count", + "language", + "has_issues", + "has_projects", + "has_downloads", + "has_wiki", + "has_pages", + "has_discussions", + "forks_count", + "mirror_url", + "archived", + "open_issues_count", + "license", + "forks", + "open_issues", + "watchers", + "default_branch", + "topics", + "visibility" + ] + }, + "sender": { + "$ref": "#/components/schemas/simple-user" + } + }, + "required": [ + "ref", + "before", + "after", + "created", + "deleted", + "forced", + "base_ref", + "compare", + "commits", + "head_commit", + "repository", + "pusher" + ] + }, + "webhooks_nullable_string": { + "type": "string", + "nullable": true + }, + "webhooks_number": { + "description": "The pull request number.", + "type": "integer" + }, + "workflow": { + "title": "Workflow", + "description": "A GitHub Actions workflow", + "type": "object", + "properties": { + "id": { + "type": "integer", + "example": 5 + }, + "node_id": { + "type": "string", + "example": "MDg6V29ya2Zsb3cxMg==" + }, + "name": { + "type": "string", + "example": "CI" + }, + "path": { + "type": "string", + "example": "ruby.yaml" + }, + "state": { + "type": "string", + "example": "active", + "enum": [ + "active", + "deleted", + "disabled_fork", + "disabled_inactivity", + "disabled_manually" + ] + }, + "created_at": { + "type": "string", + "format": "date-time", + "example": "2019-12-06T14:20:20.000Z" + }, + "updated_at": { + "type": "string", + "format": "date-time", + "example": "2019-12-06T14:20:20.000Z" + }, + "url": { + "type": "string", + "example": "https://api.github.com/repos/actions/setup-ruby/workflows/5" + }, + "html_url": { + "type": "string", + "example": "https://github.com/actions/setup-ruby/blob/master/.github/workflows/ruby.yaml" + }, + "badge_url": { + "type": "string", + "example": "https://github.com/actions/setup-ruby/workflows/CI/badge.svg" + }, + "deleted_at": { + "type": "string", + "format": "date-time", + "example": "2019-12-06T14:20:20.000Z" + } + }, + "required": [ + "id", + "node_id", + "name", + "path", + "state", + "url", + "html_url", + "badge_url", + "created_at", + "updated_at" + ] + }, + "workflow-run": { + "title": "Workflow Run", + "description": "An invocation of a workflow", + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64", + "description": "The ID of the workflow run.", + "example": 5 + }, + "name": { + "type": "string", + "description": "The name of the workflow run.", + "nullable": true, + "example": "Build" + }, + "node_id": { + "type": "string", + "example": "MDEwOkNoZWNrU3VpdGU1" + }, + "check_suite_id": { + "type": "integer", + "format": "int64", + "description": "The ID of the associated check suite.", + "example": 42 + }, + "check_suite_node_id": { + "type": "string", + "description": "The node ID of the associated check suite.", + "example": "MDEwOkNoZWNrU3VpdGU0Mg==" + }, + "head_branch": { + "type": "string", + "nullable": true, + "example": "master" + }, + "head_sha": { + "description": "The SHA of the head commit that points to the version of the workflow being run.", + "example": "009b8a3a9ccbb128af87f9b1c0f4c62e8a304f6d", + "type": "string" + }, + "path": { + "description": "The full path of the workflow", + "example": "octocat/octo-repo/.github/workflows/ci.yml@main", + "type": "string" + }, + "run_number": { + "type": "integer", + "description": "The auto incrementing run number for the workflow run.", + "example": 106 + }, + "run_attempt": { + "type": "integer", + "description": "Attempt number of the run, 1 for first attempt and higher if the workflow was re-run.", + "example": 1 + }, + "referenced_workflows": { + "type": "array", + "nullable": true, + "items": { + "$ref": "#/components/schemas/referenced-workflow" + } + }, + "event": { + "type": "string", + "example": "push" + }, + "status": { + "type": "string", + "nullable": true, + "example": "completed" + }, + "conclusion": { + "type": "string", + "nullable": true, + "example": "neutral" + }, + "workflow_id": { + "type": "integer", + "description": "The ID of the parent workflow.", + "example": 5 + }, + "url": { + "type": "string", + "description": "The URL to the workflow run.", + "example": "https://api.github.com/repos/github/hello-world/actions/runs/5" + }, + "html_url": { + "type": "string", + "example": "https://github.com/github/hello-world/suites/4" + }, + "pull_requests": { + "description": "Pull requests that are open with a `head_sha` or `head_branch` that matches the workflow run. The returned pull requests do not necessarily indicate pull requests that triggered the run.", + "type": "array", + "nullable": true, + "items": { + "$ref": "#/components/schemas/pull-request-minimal" + } + }, + "created_at": { + "type": "string", + "format": "date-time" + }, + "updated_at": { + "type": "string", + "format": "date-time" + }, + "actor": { + "$ref": "#/components/schemas/simple-user" + }, + "triggering_actor": { + "$ref": "#/components/schemas/simple-user" + }, + "run_started_at": { + "type": "string", + "format": "date-time", + "description": "The start time of the latest run. Resets on re-run." + }, + "jobs_url": { + "description": "The URL to the jobs for the workflow run.", + "type": "string", + "example": "https://api.github.com/repos/github/hello-world/actions/runs/5/jobs" + }, + "logs_url": { + "description": "The URL to download the logs for the workflow run.", + "type": "string", + "example": "https://api.github.com/repos/github/hello-world/actions/runs/5/logs" + }, + "check_suite_url": { + "description": "The URL to the associated check suite.", + "type": "string", + "example": "https://api.github.com/repos/github/hello-world/check-suites/12" + }, + "artifacts_url": { + "description": "The URL to the artifacts for the workflow run.", + "type": "string", + "example": "https://api.github.com/repos/github/hello-world/actions/runs/5/rerun/artifacts" + }, + "cancel_url": { + "description": "The URL to cancel the workflow run.", + "type": "string", + "example": "https://api.github.com/repos/github/hello-world/actions/runs/5/cancel" + }, + "rerun_url": { + "description": "The URL to rerun the workflow run.", + "type": "string", + "example": "https://api.github.com/repos/github/hello-world/actions/runs/5/rerun" + }, + "previous_attempt_url": { + "nullable": true, + "description": "The URL to the previous attempted run of this workflow, if one exists.", + "type": "string", + "example": "https://api.github.com/repos/github/hello-world/actions/runs/5/attempts/3" + }, + "workflow_url": { + "description": "The URL to the workflow.", + "type": "string", + "example": "https://api.github.com/repos/github/hello-world/actions/workflows/main.yaml" + }, + "head_commit": { + "$ref": "#/components/schemas/nullable-simple-commit" + }, + "repository": { + "$ref": "#/components/schemas/minimal-repository" + }, + "head_repository": { + "$ref": "#/components/schemas/minimal-repository" + }, + "head_repository_id": { + "type": "integer", + "example": 5 + }, + "display_title": { + "type": "string", + "example": "Simple Workflow", + "description": "The event-specific title associated with the run or the run-name if set, or the value of `run-name` if it is set in the workflow." + } + }, + "required": [ + "id", + "node_id", + "head_branch", + "run_number", + "display_title", + "event", + "status", + "conclusion", + "head_sha", + "path", + "workflow_id", + "url", + "html_url", + "created_at", + "updated_at", + "head_commit", + "head_repository", + "repository", + "jobs_url", + "logs_url", + "check_suite_url", + "cancel_url", + "rerun_url", + "artifacts_url", + "workflow_url", + "pull_requests" + ] + } + } + } +} \ No newline at end of file diff --git a/actions/github-action/src/data_types/ciAutomation/githubCiAutomation.ts b/actions/github-action/src/data_types/ciAutomation/githubCiAutomation.ts index 3354163..361af90 100644 --- a/actions/github-action/src/data_types/ciAutomation/githubCiAutomation.ts +++ b/actions/github-action/src/data_types/ciAutomation/githubCiAutomation.ts @@ -1,11 +1,11 @@ import { DisplayMessage, Identifier, Name, Schema } from "@code0-tech/hercules" -import type { Endpoints } from "@octokit/types" import { z } from "zod" +import { schemas } from "../../generated/github-schemas.js" -export const GitHubCommitStatusSchema = z.looseObject({}) as unknown as z.ZodType +export const GitHubCommitStatusSchema = schemas["status"] export type GitHubCommitStatus = z.infer -export const GitHubCheckRunSchema = z.looseObject({}) as unknown as z.ZodType +export const GitHubCheckRunSchema = schemas["check-run"] export type GitHubCheckRun = z.infer @Identifier("GITHUB_COMMIT_STATUS") diff --git a/actions/github-action/src/data_types/ciAutomation/githubCiAutomationRequests.ts b/actions/github-action/src/data_types/ciAutomation/githubCiAutomationRequests.ts deleted file mode 100644 index f6e6cee..0000000 --- a/actions/github-action/src/data_types/ciAutomation/githubCiAutomationRequests.ts +++ /dev/null @@ -1,40 +0,0 @@ -import { DisplayMessage, Identifier, Name, Schema } from "@code0-tech/hercules" -import type { Endpoints } from "@octokit/types" -import { z } from "zod" - -export const GitHubCreateCommitStatusRequestSchema = z.object({ - state: z.enum(["error", "failure", "pending", "success"]), - target_url: z.string().optional(), - description: z.string().optional(), - context: z.string().optional(), -}) as unknown as z.ZodType> -export type GitHubCreateCommitStatusRequest = z.infer - -export const GitHubCreateCheckRunRequestSchema = z.looseObject({ - name: z.string().min(1), - head_sha: z.string().min(1), -}) as unknown as z.ZodType> -export type GitHubCreateCheckRunRequest = z.infer - -export const GitHubUpdateCheckRunRequestSchema = z.looseObject({}) as unknown as z.ZodType< - Omit -> -export type GitHubUpdateCheckRunRequest = z.infer - -@Identifier("GITHUB_CREATE_COMMIT_STATUS_REQUEST") -@Name({ code: "en-US", content: "Create GitHub commit status request" }) -@DisplayMessage({ code: "en-US", content: "Create GitHub commit status request" }) -@Schema(GitHubCreateCommitStatusRequestSchema) -export class GitHubCreateCommitStatusRequestDataType {} - -@Identifier("GITHUB_CREATE_CHECK_RUN_REQUEST") -@Name({ code: "en-US", content: "Create GitHub check run request" }) -@DisplayMessage({ code: "en-US", content: "Create GitHub check run request" }) -@Schema(GitHubCreateCheckRunRequestSchema) -export class GitHubCreateCheckRunRequestDataType {} - -@Identifier("GITHUB_UPDATE_CHECK_RUN_REQUEST") -@Name({ code: "en-US", content: "Update GitHub check run request" }) -@DisplayMessage({ code: "en-US", content: "Update GitHub check run request" }) -@Schema(GitHubUpdateCheckRunRequestSchema) -export class GitHubUpdateCheckRunRequestDataType {} diff --git a/actions/github-action/src/data_types/ciAutomation/githubWorkflow.ts b/actions/github-action/src/data_types/ciAutomation/githubWorkflow.ts index 26ed3d9..5eb66b7 100644 --- a/actions/github-action/src/data_types/ciAutomation/githubWorkflow.ts +++ b/actions/github-action/src/data_types/ciAutomation/githubWorkflow.ts @@ -1,13 +1,11 @@ import { DisplayMessage, Identifier, Name, Schema } from "@code0-tech/hercules" -import type { Endpoints } from "@octokit/types" import { z } from "zod" +import { schemas } from "../../generated/github-schemas.js" -export const GitHubWorkflowSchema = z.looseObject({}) as unknown as z.ZodType +export const GitHubWorkflowSchema = schemas["workflow"] export type GitHubWorkflow = z.infer -export const GitHubWorkflowRunSchema = z.looseObject({}) as unknown as z.ZodType< - Endpoints["GET /repos/{owner}/{repo}/actions/runs"]["response"]["data"]["workflow_runs"][number] -> +export const GitHubWorkflowRunSchema = schemas["workflow-run"] export type GitHubWorkflowRun = z.infer @Identifier("GITHUB_WORKFLOW") diff --git a/actions/github-action/src/data_types/ciAutomation/githubWorkflowInputs.ts b/actions/github-action/src/data_types/ciAutomation/githubWorkflowInputs.ts new file mode 100644 index 0000000..db466ec --- /dev/null +++ b/actions/github-action/src/data_types/ciAutomation/githubWorkflowInputs.ts @@ -0,0 +1,12 @@ +import { DisplayMessage, Identifier, Name, Schema } from "@code0-tech/hercules" +import { z } from "zod" + +/** Free-form inputs of a workflow dispatch: the keys are defined by the workflow itself. */ +export const GitHubWorkflowInputsSchema = z.looseObject({}) +export type GitHubWorkflowInputs = z.infer + +@Identifier("GITHUB_WORKFLOW_INPUTS") +@Name({ code: "en-US", content: "GitHub workflow inputs" }) +@DisplayMessage({ code: "en-US", content: "GitHub workflow inputs" }) +@Schema(GitHubWorkflowInputsSchema) +export class GitHubWorkflowInputsDataType {} diff --git a/actions/github-action/src/data_types/ciAutomation/githubWorkflowRequests.ts b/actions/github-action/src/data_types/ciAutomation/githubWorkflowRequests.ts deleted file mode 100644 index 88cdd18..0000000 --- a/actions/github-action/src/data_types/ciAutomation/githubWorkflowRequests.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { DisplayMessage, Identifier, Name, Schema } from "@code0-tech/hercules" -import type { Endpoints } from "@octokit/types" -import { z } from "zod" - -export const GitHubDispatchWorkflowRequestSchema = z.object({ - ref: z.string().min(1), - inputs: z.record(z.string(), z.unknown()).optional(), -}) as unknown as z.ZodType> -export type GitHubDispatchWorkflowRequest = z.infer - -@Identifier("GITHUB_DISPATCH_WORKFLOW_REQUEST") -@Name({ code: "en-US", content: "Dispatch GitHub workflow request" }) -@DisplayMessage({ code: "en-US", content: "Dispatch GitHub workflow request" }) -@Schema(GitHubDispatchWorkflowRequestSchema) -export class GitHubDispatchWorkflowRequestDataType {} diff --git a/actions/github-action/src/data_types/issueComments/githubIssueComment.ts b/actions/github-action/src/data_types/issueComments/githubIssueComment.ts index e2541e5..9f6b59c 100644 --- a/actions/github-action/src/data_types/issueComments/githubIssueComment.ts +++ b/actions/github-action/src/data_types/issueComments/githubIssueComment.ts @@ -1,10 +1,8 @@ import { DisplayMessage, Identifier, Name, Schema } from "@code0-tech/hercules" -import type { Endpoints } from "@octokit/types" import { z } from "zod" +import { schemas } from "../../generated/github-schemas.js" -export const GitHubIssueCommentSchema = z.looseObject({}) as unknown as z.ZodType< - Endpoints["GET /repos/{owner}/{repo}/issues/comments/{comment_id}"]["response"]["data"] -> +export const GitHubIssueCommentSchema = schemas["issue-comment"] export type GitHubIssueComment = z.infer @Identifier("GITHUB_ISSUE_COMMENT") diff --git a/actions/github-action/src/data_types/issueComments/githubIssueCommentRequests.ts b/actions/github-action/src/data_types/issueComments/githubIssueCommentRequests.ts deleted file mode 100644 index 64cb93c..0000000 --- a/actions/github-action/src/data_types/issueComments/githubIssueCommentRequests.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { DisplayMessage, Identifier, Name, Schema } from "@code0-tech/hercules" -import type { Endpoints } from "@octokit/types" -import { z } from "zod" - -export const GitHubCreateIssueCommentRequestSchema = z.object({ - body: z.string().min(1), -}) as unknown as z.ZodType> -export type GitHubCreateIssueCommentRequest = z.infer - -export const GitHubUpdateIssueCommentRequestSchema = z.object({ - body: z.string().min(1), -}) as unknown as z.ZodType> -export type GitHubUpdateIssueCommentRequest = z.infer - -@Identifier("GITHUB_CREATE_ISSUE_COMMENT_REQUEST") -@Name({ code: "en-US", content: "Create GitHub issue comment request" }) -@DisplayMessage({ code: "en-US", content: "Create GitHub issue comment request" }) -@Schema(GitHubCreateIssueCommentRequestSchema) -export class GitHubCreateIssueCommentRequestDataType {} - -@Identifier("GITHUB_UPDATE_ISSUE_COMMENT_REQUEST") -@Name({ code: "en-US", content: "Update GitHub issue comment request" }) -@DisplayMessage({ code: "en-US", content: "Update GitHub issue comment request" }) -@Schema(GitHubUpdateIssueCommentRequestSchema) -export class GitHubUpdateIssueCommentRequestDataType {} diff --git a/actions/github-action/src/data_types/issues/githubAssigneesRequest.ts b/actions/github-action/src/data_types/issues/githubAssigneesRequest.ts deleted file mode 100644 index 979092c..0000000 --- a/actions/github-action/src/data_types/issues/githubAssigneesRequest.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { DisplayMessage, Identifier, Name, Schema } from "@code0-tech/hercules" -import type { Endpoints } from "@octokit/types" -import { z } from "zod" - -export const GitHubAddAssigneesRequestSchema = z.object({ - assignees: z.array(z.string()).min(1), -}) as unknown as z.ZodType> -export type GitHubAddAssigneesRequest = z.infer - -@Identifier("GITHUB_ADD_ASSIGNEES_REQUEST") -@Name({ code: "en-US", content: "Add GitHub assignees request" }) -@DisplayMessage({ code: "en-US", content: "Add GitHub assignees request" }) -@Schema(GitHubAddAssigneesRequestSchema) -export class GitHubAddAssigneesRequestDataType {} diff --git a/actions/github-action/src/data_types/issues/githubIssue.ts b/actions/github-action/src/data_types/issues/githubIssue.ts index b2835cf..1254946 100644 --- a/actions/github-action/src/data_types/issues/githubIssue.ts +++ b/actions/github-action/src/data_types/issues/githubIssue.ts @@ -1,8 +1,8 @@ import { DisplayMessage, Identifier, Name, Schema } from "@code0-tech/hercules" -import type { Endpoints } from "@octokit/types" import { z } from "zod" +import { schemas } from "../../generated/github-schemas.js" -export const GitHubIssueSchema = z.looseObject({}) as unknown as z.ZodType +export const GitHubIssueSchema = schemas["issue"] export type GitHubIssue = z.infer @Identifier("GITHUB_ISSUE") diff --git a/actions/github-action/src/data_types/issues/githubIssueRequests.ts b/actions/github-action/src/data_types/issues/githubIssueRequests.ts deleted file mode 100644 index 0260788..0000000 --- a/actions/github-action/src/data_types/issues/githubIssueRequests.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { DisplayMessage, Identifier, Name, Schema } from "@code0-tech/hercules" -import type { Endpoints } from "@octokit/types" -import { z } from "zod" - -export const GitHubCreateIssueRequestSchema = z.object({ - title: z.string().min(1), - body: z.string().optional(), - labels: z.array(z.string()).optional(), - assignees: z.array(z.string()).optional(), - milestone: z.int().positive().optional(), -}) as unknown as z.ZodType> -export type GitHubCreateIssueRequest = z.infer - -export const GitHubUpdateIssueRequestSchema = z.object({ - title: z.string().min(1).optional(), - body: z.string().nullable().optional(), - state: z.enum(["open", "closed"]).optional(), - state_reason: z.enum(["completed", "not_planned", "reopened"]).optional(), - labels: z.array(z.string()).optional(), - assignees: z.array(z.string()).optional(), - milestone: z.int().positive().nullable().optional(), -}) as unknown as z.ZodType> -export type GitHubUpdateIssueRequest = z.infer - -@Identifier("GITHUB_CREATE_ISSUE_REQUEST") -@Name({ code: "en-US", content: "Create GitHub issue request" }) -@DisplayMessage({ code: "en-US", content: "Create GitHub issue request" }) -@Schema(GitHubCreateIssueRequestSchema) -export class GitHubCreateIssueRequestDataType {} - -@Identifier("GITHUB_UPDATE_ISSUE_REQUEST") -@Name({ code: "en-US", content: "Update GitHub issue request" }) -@DisplayMessage({ code: "en-US", content: "Update GitHub issue request" }) -@Schema(GitHubUpdateIssueRequestSchema) -export class GitHubUpdateIssueRequestDataType {} diff --git a/actions/github-action/src/data_types/labels/githubLabel.ts b/actions/github-action/src/data_types/labels/githubLabel.ts index e4ddb4c..1cba966 100644 --- a/actions/github-action/src/data_types/labels/githubLabel.ts +++ b/actions/github-action/src/data_types/labels/githubLabel.ts @@ -1,8 +1,8 @@ import { DisplayMessage, Identifier, Name, Schema } from "@code0-tech/hercules" -import type { Endpoints } from "@octokit/types" import { z } from "zod" +import { schemas } from "../../generated/github-schemas.js" -export const GitHubLabelSchema = z.looseObject({}) as unknown as z.ZodType +export const GitHubLabelSchema = schemas["label"] export type GitHubLabel = z.infer @Identifier("GITHUB_LABEL") diff --git a/actions/github-action/src/data_types/labels/githubLabelRequests.ts b/actions/github-action/src/data_types/labels/githubLabelRequests.ts deleted file mode 100644 index 8735299..0000000 --- a/actions/github-action/src/data_types/labels/githubLabelRequests.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { DisplayMessage, Identifier, Name, Schema } from "@code0-tech/hercules" -import type { Endpoints } from "@octokit/types" -import { z } from "zod" - -export const GitHubIssueLabelsRequestSchema = z.object({ - labels: z.array(z.string()).min(1), -}) as unknown as z.ZodType> -export type GitHubIssueLabelsRequest = z.infer - -@Identifier("GITHUB_ISSUE_LABELS_REQUEST") -@Name({ code: "en-US", content: "GitHub issue labels request" }) -@DisplayMessage({ code: "en-US", content: "GitHub issue labels request" }) -@Schema(GitHubIssueLabelsRequestSchema) -export class GitHubIssueLabelsRequestDataType {} diff --git a/actions/github-action/src/data_types/milestones/githubMilestone.ts b/actions/github-action/src/data_types/milestones/githubMilestone.ts index bf22c17..5142d1c 100644 --- a/actions/github-action/src/data_types/milestones/githubMilestone.ts +++ b/actions/github-action/src/data_types/milestones/githubMilestone.ts @@ -1,10 +1,8 @@ import { DisplayMessage, Identifier, Name, Schema } from "@code0-tech/hercules" -import type { Endpoints } from "@octokit/types" import { z } from "zod" +import { schemas } from "../../generated/github-schemas.js" -export const GitHubMilestoneSchema = z.looseObject({}) as unknown as z.ZodType< - Endpoints["GET /repos/{owner}/{repo}/milestones/{milestone_number}"]["response"]["data"] -> +export const GitHubMilestoneSchema = schemas["milestone"] export type GitHubMilestone = z.infer @Identifier("GITHUB_MILESTONE") diff --git a/actions/github-action/src/data_types/milestones/githubMilestoneRequests.ts b/actions/github-action/src/data_types/milestones/githubMilestoneRequests.ts deleted file mode 100644 index b5ab0df..0000000 --- a/actions/github-action/src/data_types/milestones/githubMilestoneRequests.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { DisplayMessage, Identifier, Name, Schema } from "@code0-tech/hercules" -import type { Endpoints } from "@octokit/types" -import { z } from "zod" - -export const GitHubCreateMilestoneRequestSchema = z.object({ - title: z.string().min(1), - state: z.enum(["open", "closed"]).optional(), - description: z.string().optional(), - due_on: z.iso.datetime().optional(), -}) as unknown as z.ZodType> -export type GitHubCreateMilestoneRequest = z.infer - -export const GitHubUpdateMilestoneRequestSchema = z.object({ - title: z.string().min(1).optional(), - state: z.enum(["open", "closed"]).optional(), - description: z.string().optional(), - due_on: z.iso.datetime().nullable().optional(), -}) as unknown as z.ZodType> -export type GitHubUpdateMilestoneRequest = z.infer - -@Identifier("GITHUB_CREATE_MILESTONE_REQUEST") -@Name({ code: "en-US", content: "Create GitHub milestone request" }) -@DisplayMessage({ code: "en-US", content: "Create GitHub milestone request" }) -@Schema(GitHubCreateMilestoneRequestSchema) -export class GitHubCreateMilestoneRequestDataType {} - -@Identifier("GITHUB_UPDATE_MILESTONE_REQUEST") -@Name({ code: "en-US", content: "Update GitHub milestone request" }) -@DisplayMessage({ code: "en-US", content: "Update GitHub milestone request" }) -@Schema(GitHubUpdateMilestoneRequestSchema) -export class GitHubUpdateMilestoneRequestDataType {} diff --git a/actions/github-action/src/data_types/pullRequestReviewComments/githubPullRequestReviewComment.ts b/actions/github-action/src/data_types/pullRequestReviewComments/githubPullRequestReviewComment.ts index 9847192..3e2cc89 100644 --- a/actions/github-action/src/data_types/pullRequestReviewComments/githubPullRequestReviewComment.ts +++ b/actions/github-action/src/data_types/pullRequestReviewComments/githubPullRequestReviewComment.ts @@ -1,10 +1,8 @@ import { DisplayMessage, Identifier, Name, Schema } from "@code0-tech/hercules" -import type { Endpoints } from "@octokit/types" import { z } from "zod" +import { schemas } from "../../generated/github-schemas.js" -export const GitHubPullRequestReviewCommentSchema = z.looseObject({}) as unknown as z.ZodType< - Endpoints["GET /repos/{owner}/{repo}/pulls/comments/{comment_id}"]["response"]["data"] -> +export const GitHubPullRequestReviewCommentSchema = schemas["pull-request-review-comment"] export type GitHubPullRequestReviewComment = z.infer @Identifier("GITHUB_PULL_REQUEST_REVIEW_COMMENT") diff --git a/actions/github-action/src/data_types/pullRequestReviewComments/githubPullRequestReviewCommentRequests.ts b/actions/github-action/src/data_types/pullRequestReviewComments/githubPullRequestReviewCommentRequests.ts deleted file mode 100644 index 3c1e076..0000000 --- a/actions/github-action/src/data_types/pullRequestReviewComments/githubPullRequestReviewCommentRequests.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { DisplayMessage, Identifier, Name, Schema } from "@code0-tech/hercules" -import type { Endpoints } from "@octokit/types" -import { z } from "zod" - -export const GitHubCreatePullRequestReviewCommentRequestSchema = z.looseObject({ - body: z.string().min(1), -}) as unknown as z.ZodType> -export type GitHubCreatePullRequestReviewCommentRequest = z.infer - -export const GitHubUpdatePullRequestReviewCommentRequestSchema = z.object({ - body: z.string().min(1), -}) as unknown as z.ZodType> -export type GitHubUpdatePullRequestReviewCommentRequest = z.infer - -@Identifier("GITHUB_CREATE_PULL_REQUEST_REVIEW_COMMENT_REQUEST") -@Name({ code: "en-US", content: "Create GitHub pull request review comment request" }) -@DisplayMessage({ code: "en-US", content: "Create GitHub pull request review comment request" }) -@Schema(GitHubCreatePullRequestReviewCommentRequestSchema) -export class GitHubCreatePullRequestReviewCommentRequestDataType {} - -@Identifier("GITHUB_UPDATE_PULL_REQUEST_REVIEW_COMMENT_REQUEST") -@Name({ code: "en-US", content: "Update GitHub pull request review comment request" }) -@DisplayMessage({ code: "en-US", content: "Update GitHub pull request review comment request" }) -@Schema(GitHubUpdatePullRequestReviewCommentRequestSchema) -export class GitHubUpdatePullRequestReviewCommentRequestDataType {} diff --git a/actions/github-action/src/data_types/pullRequestReviews/githubPullRequestReview.ts b/actions/github-action/src/data_types/pullRequestReviews/githubPullRequestReview.ts index 629e263..aa01ec9 100644 --- a/actions/github-action/src/data_types/pullRequestReviews/githubPullRequestReview.ts +++ b/actions/github-action/src/data_types/pullRequestReviews/githubPullRequestReview.ts @@ -1,10 +1,8 @@ import { DisplayMessage, Identifier, Name, Schema } from "@code0-tech/hercules" -import type { Endpoints } from "@octokit/types" import { z } from "zod" +import { schemas } from "../../generated/github-schemas.js" -export const GitHubPullRequestReviewSchema = z.looseObject({}) as unknown as z.ZodType< - Endpoints["GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews"]["response"]["data"][number] -> +export const GitHubPullRequestReviewSchema = schemas["pull-request-review"] export type GitHubPullRequestReview = z.infer @Identifier("GITHUB_PULL_REQUEST_REVIEW") diff --git a/actions/github-action/src/data_types/pullRequestReviews/githubPullRequestReviewRequests.ts b/actions/github-action/src/data_types/pullRequestReviews/githubPullRequestReviewRequests.ts deleted file mode 100644 index 854c3e4..0000000 --- a/actions/github-action/src/data_types/pullRequestReviews/githubPullRequestReviewRequests.ts +++ /dev/null @@ -1,46 +0,0 @@ -import { DisplayMessage, Identifier, Name, Schema } from "@code0-tech/hercules" -import type { Endpoints } from "@octokit/types" -import { z } from "zod" - -export const GitHubCreatePullRequestReviewRequestSchema = z.object({ - body: z.string().optional(), - event: z.enum(["APPROVE", "REQUEST_CHANGES", "COMMENT"]).optional(), - comments: z.array(z.looseObject({})).optional(), -}) as unknown as z.ZodType> -export type GitHubCreatePullRequestReviewRequest = z.infer - -export const GitHubSubmitPullRequestReviewRequestSchema = z.object({ - body: z.string().optional(), - event: z.enum(["APPROVE", "REQUEST_CHANGES", "COMMENT"]), -}) as unknown as z.ZodType< - Omit -> -export type GitHubSubmitPullRequestReviewRequest = z.infer - -export const GitHubDismissPullRequestReviewRequestSchema = z.object({ - message: z.string().min(1), -}) as unknown as z.ZodType< - Omit< - Endpoints["PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/dismissals"]["parameters"], - "owner" | "repo" | "pull_number" | "review_id" - > -> -export type GitHubDismissPullRequestReviewRequest = z.infer - -@Identifier("GITHUB_CREATE_PULL_REQUEST_REVIEW_REQUEST") -@Name({ code: "en-US", content: "Create GitHub pull request review request" }) -@DisplayMessage({ code: "en-US", content: "Create GitHub pull request review request" }) -@Schema(GitHubCreatePullRequestReviewRequestSchema) -export class GitHubCreatePullRequestReviewRequestDataType {} - -@Identifier("GITHUB_SUBMIT_PULL_REQUEST_REVIEW_REQUEST") -@Name({ code: "en-US", content: "Submit GitHub pull request review request" }) -@DisplayMessage({ code: "en-US", content: "Submit GitHub pull request review request" }) -@Schema(GitHubSubmitPullRequestReviewRequestSchema) -export class GitHubSubmitPullRequestReviewRequestDataType {} - -@Identifier("GITHUB_DISMISS_PULL_REQUEST_REVIEW_REQUEST") -@Name({ code: "en-US", content: "Dismiss GitHub pull request review request" }) -@DisplayMessage({ code: "en-US", content: "Dismiss GitHub pull request review request" }) -@Schema(GitHubDismissPullRequestReviewRequestSchema) -export class GitHubDismissPullRequestReviewRequestDataType {} diff --git a/actions/github-action/src/data_types/pullRequests/githubPullRequest.ts b/actions/github-action/src/data_types/pullRequests/githubPullRequest.ts index e4659c3..9f2e2bf 100644 --- a/actions/github-action/src/data_types/pullRequests/githubPullRequest.ts +++ b/actions/github-action/src/data_types/pullRequests/githubPullRequest.ts @@ -1,8 +1,8 @@ import { DisplayMessage, Identifier, Name, Schema } from "@code0-tech/hercules" -import type { Endpoints } from "@octokit/types" import { z } from "zod" +import { schemas } from "../../generated/github-schemas.js" -export const GitHubPullRequestSchema = z.looseObject({}) as unknown as z.ZodType +export const GitHubPullRequestSchema = schemas["pull-request"] export type GitHubPullRequest = z.infer @Identifier("GITHUB_PULL_REQUEST") @@ -10,3 +10,13 @@ export type GitHubPullRequest = z.infer @DisplayMessage({ code: "en-US", content: "GitHub pull request" }) @Schema(GitHubPullRequestSchema) export class GitHubPullRequestDataType {} + +/** The pull request list endpoint returns fewer fields than the single pull request endpoint. */ +export const GitHubPullRequestSummarySchema = schemas["pull-request-simple"] +export type GitHubPullRequestSummary = z.infer + +@Identifier("GITHUB_PULL_REQUEST_SUMMARY") +@Name({ code: "en-US", content: "GitHub pull request summary" }) +@DisplayMessage({ code: "en-US", content: "GitHub pull request summary" }) +@Schema(GitHubPullRequestSummarySchema) +export class GitHubPullRequestSummaryDataType {} diff --git a/actions/github-action/src/data_types/pullRequests/githubPullRequestMergeRequest.ts b/actions/github-action/src/data_types/pullRequests/githubPullRequestMergeRequest.ts deleted file mode 100644 index 0eab76c..0000000 --- a/actions/github-action/src/data_types/pullRequests/githubPullRequestMergeRequest.ts +++ /dev/null @@ -1,28 +0,0 @@ -import { DisplayMessage, Identifier, Name, Schema } from "@code0-tech/hercules" -import type { Endpoints } from "@octokit/types" -import { z } from "zod" - -export const GitHubPullRequestMergeResultSchema = z.looseObject({}) as unknown as z.ZodType< - Endpoints["PUT /repos/{owner}/{repo}/pulls/{pull_number}/merge"]["response"]["data"] -> -export type GitHubPullRequestMergeResult = z.infer - -export const GitHubPullRequestMergeRequestSchema = z.object({ - commit_title: z.string().optional(), - commit_message: z.string().optional(), - sha: z.string().optional(), - merge_method: z.enum(["merge", "squash", "rebase"]).optional(), -}) as unknown as z.ZodType> -export type GitHubPullRequestMergeRequest = z.infer - -@Identifier("GITHUB_PULL_REQUEST_MERGE_RESULT") -@Name({ code: "en-US", content: "GitHub pull request merge result" }) -@DisplayMessage({ code: "en-US", content: "GitHub pull request merge result" }) -@Schema(GitHubPullRequestMergeResultSchema) -export class GitHubPullRequestMergeResultDataType {} - -@Identifier("GITHUB_PULL_REQUEST_MERGE_REQUEST") -@Name({ code: "en-US", content: "GitHub pull request merge request" }) -@DisplayMessage({ code: "en-US", content: "GitHub pull request merge request" }) -@Schema(GitHubPullRequestMergeRequestSchema) -export class GitHubPullRequestMergeRequestDataType {} diff --git a/actions/github-action/src/data_types/pullRequests/githubPullRequestMergeResult.ts b/actions/github-action/src/data_types/pullRequests/githubPullRequestMergeResult.ts new file mode 100644 index 0000000..f2d5469 --- /dev/null +++ b/actions/github-action/src/data_types/pullRequests/githubPullRequestMergeResult.ts @@ -0,0 +1,12 @@ +import { DisplayMessage, Identifier, Name, Schema } from "@code0-tech/hercules" +import { z } from "zod" +import { schemas } from "../../generated/github-schemas.js" + +export const GitHubPullRequestMergeResultSchema = schemas["pull-request-merge-result"] +export type GitHubPullRequestMergeResult = z.infer + +@Identifier("GITHUB_PULL_REQUEST_MERGE_RESULT") +@Name({ code: "en-US", content: "GitHub pull request merge result" }) +@DisplayMessage({ code: "en-US", content: "GitHub pull request merge result" }) +@Schema(GitHubPullRequestMergeResultSchema) +export class GitHubPullRequestMergeResultDataType {} diff --git a/actions/github-action/src/data_types/pullRequests/githubPullRequestRequests.ts b/actions/github-action/src/data_types/pullRequests/githubPullRequestRequests.ts deleted file mode 100644 index aae1b61..0000000 --- a/actions/github-action/src/data_types/pullRequests/githubPullRequestRequests.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { DisplayMessage, Identifier, Name, Schema } from "@code0-tech/hercules" -import type { Endpoints } from "@octokit/types" -import { z } from "zod" - -export const GitHubCreatePullRequestRequestSchema = z.object({ - title: z.string().min(1), - head: z.string().min(1), - base: z.string().min(1), - body: z.string().optional(), - draft: z.boolean().optional(), - maintainer_can_modify: z.boolean().optional(), -}) as unknown as z.ZodType> -export type GitHubCreatePullRequestRequest = z.infer - -export const GitHubUpdatePullRequestRequestSchema = z.object({ - title: z.string().min(1).optional(), - body: z.string().nullable().optional(), - state: z.enum(["open", "closed"]).optional(), - base: z.string().min(1).optional(), - maintainer_can_modify: z.boolean().optional(), -}) as unknown as z.ZodType> -export type GitHubUpdatePullRequestRequest = z.infer - -@Identifier("GITHUB_CREATE_PULL_REQUEST_REQUEST") -@Name({ code: "en-US", content: "Create GitHub pull request request" }) -@DisplayMessage({ code: "en-US", content: "Create GitHub pull request request" }) -@Schema(GitHubCreatePullRequestRequestSchema) -export class GitHubCreatePullRequestRequestDataType {} - -@Identifier("GITHUB_UPDATE_PULL_REQUEST_REQUEST") -@Name({ code: "en-US", content: "Update GitHub pull request request" }) -@DisplayMessage({ code: "en-US", content: "Update GitHub pull request request" }) -@Schema(GitHubUpdatePullRequestRequestSchema) -export class GitHubUpdatePullRequestRequestDataType {} diff --git a/actions/github-action/src/data_types/releases/githubRelease.ts b/actions/github-action/src/data_types/releases/githubRelease.ts index 5ebefc0..327a36e 100644 --- a/actions/github-action/src/data_types/releases/githubRelease.ts +++ b/actions/github-action/src/data_types/releases/githubRelease.ts @@ -1,8 +1,8 @@ import { DisplayMessage, Identifier, Name, Schema } from "@code0-tech/hercules" -import type { Endpoints } from "@octokit/types" import { z } from "zod" +import { schemas } from "../../generated/github-schemas.js" -export const GitHubReleaseSchema = z.looseObject({}) as unknown as z.ZodType +export const GitHubReleaseSchema = schemas["release"] export type GitHubRelease = z.infer @Identifier("GITHUB_RELEASE") diff --git a/actions/github-action/src/data_types/releases/githubReleaseRequests.ts b/actions/github-action/src/data_types/releases/githubReleaseRequests.ts deleted file mode 100644 index 6a69aad..0000000 --- a/actions/github-action/src/data_types/releases/githubReleaseRequests.ts +++ /dev/null @@ -1,37 +0,0 @@ -import { DisplayMessage, Identifier, Name, Schema } from "@code0-tech/hercules" -import type { Endpoints } from "@octokit/types" -import { z } from "zod" - -export const GitHubCreateReleaseRequestSchema = z.object({ - tag_name: z.string().min(1), - target_commitish: z.string().optional(), - name: z.string().optional(), - body: z.string().optional(), - draft: z.boolean().optional(), - prerelease: z.boolean().optional(), - generate_release_notes: z.boolean().optional(), -}) as unknown as z.ZodType> -export type GitHubCreateReleaseRequest = z.infer - -export const GitHubUpdateReleaseRequestSchema = z.object({ - tag_name: z.string().min(1).optional(), - target_commitish: z.string().optional(), - name: z.string().optional(), - body: z.string().optional(), - draft: z.boolean().optional(), - prerelease: z.boolean().optional(), - make_latest: z.enum(["true", "false", "legacy"]).optional(), -}) as unknown as z.ZodType> -export type GitHubUpdateReleaseRequest = z.infer - -@Identifier("GITHUB_CREATE_RELEASE_REQUEST") -@Name({ code: "en-US", content: "Create GitHub release request" }) -@DisplayMessage({ code: "en-US", content: "Create GitHub release request" }) -@Schema(GitHubCreateReleaseRequestSchema) -export class GitHubCreateReleaseRequestDataType {} - -@Identifier("GITHUB_UPDATE_RELEASE_REQUEST") -@Name({ code: "en-US", content: "Update GitHub release request" }) -@DisplayMessage({ code: "en-US", content: "Update GitHub release request" }) -@Schema(GitHubUpdateReleaseRequestSchema) -export class GitHubUpdateReleaseRequestDataType {} diff --git a/actions/github-action/src/data_types/repositories/githubBranchRequests.ts b/actions/github-action/src/data_types/repositories/githubBranchRequests.ts deleted file mode 100644 index 97dbfee..0000000 --- a/actions/github-action/src/data_types/repositories/githubBranchRequests.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { DisplayMessage, Identifier, Name, Schema } from "@code0-tech/hercules" -import { z } from "zod" - -export const GitHubCreateBranchRequestSchema = z.object({ - branch: z.string().min(1), - sha: z.string().min(1), -}) -export type GitHubCreateBranchRequest = z.infer - -@Identifier("GITHUB_CREATE_BRANCH_REQUEST") -@Name({ code: "en-US", content: "Create GitHub branch request" }) -@DisplayMessage({ code: "en-US", content: "Create GitHub branch request" }) -@Schema(GitHubCreateBranchRequestSchema) -export class GitHubCreateBranchRequestDataType {} diff --git a/actions/github-action/src/data_types/repositories/githubCommit.ts b/actions/github-action/src/data_types/repositories/githubCommit.ts index f63f841..7fe6083 100644 --- a/actions/github-action/src/data_types/repositories/githubCommit.ts +++ b/actions/github-action/src/data_types/repositories/githubCommit.ts @@ -1,8 +1,8 @@ import { DisplayMessage, Identifier, Name, Schema } from "@code0-tech/hercules" -import type { Endpoints } from "@octokit/types" import { z } from "zod" +import { schemas } from "../../generated/github-schemas.js" -export const GitHubCommitSchema = z.looseObject({}) as unknown as z.ZodType +export const GitHubCommitSchema = schemas["commit"] export type GitHubCommit = z.infer @Identifier("GITHUB_COMMIT") diff --git a/actions/github-action/src/data_types/repositories/githubRepository.ts b/actions/github-action/src/data_types/repositories/githubRepository.ts index 90e3653..a29c454 100644 --- a/actions/github-action/src/data_types/repositories/githubRepository.ts +++ b/actions/github-action/src/data_types/repositories/githubRepository.ts @@ -1,8 +1,8 @@ import { DisplayMessage, Identifier, Name, Schema } from "@code0-tech/hercules" -import type { Endpoints } from "@octokit/types" import { z } from "zod" +import { schemas } from "../../generated/github-schemas.js" -export const GitHubRepositorySchema = z.looseObject({}) as unknown as z.ZodType +export const GitHubRepositorySchema = schemas["full-repository"] export type GitHubRepository = z.infer @Identifier("GITHUB_REPOSITORY") diff --git a/actions/github-action/src/data_types/repositories/githubRepositoryBranch.ts b/actions/github-action/src/data_types/repositories/githubRepositoryBranch.ts index 812c332..323e15c 100644 --- a/actions/github-action/src/data_types/repositories/githubRepositoryBranch.ts +++ b/actions/github-action/src/data_types/repositories/githubRepositoryBranch.ts @@ -1,10 +1,9 @@ import { DisplayMessage, Identifier, Name, Schema } from "@code0-tech/hercules" -import type { Endpoints } from "@octokit/types" import { z } from "zod" +import { schemas } from "../../generated/github-schemas.js" +import { GitHubCommitSchema } from "./githubCommit.js" -export const GitHubRepositoryBranchSchema = z.looseObject({}) as unknown as z.ZodType< - Endpoints["GET /repos/{owner}/{repo}/branches/{branch}"]["response"]["data"] -> +export const GitHubRepositoryBranchSchema = schemas["branch-with-protection"] export type GitHubRepositoryBranch = z.infer @Identifier("GITHUB_REPOSITORY_BRANCH") @@ -12,3 +11,13 @@ export type GitHubRepositoryBranch = z.infer + +@Identifier("GITHUB_REPOSITORY_BRANCH_SUMMARY") +@Name({ code: "en-US", content: "GitHub repository branch summary" }) +@DisplayMessage({ code: "en-US", content: "GitHub repository branch summary" }) +@Schema(GitHubRepositoryBranchSummarySchema) +export class GitHubRepositoryBranchSummaryDataType {} diff --git a/actions/github-action/src/data_types/webhooks/githubIssueClosedWebhookPayload.ts b/actions/github-action/src/data_types/webhooks/githubIssueClosedWebhookPayload.ts index d2ee44f..3a5a52b 100644 --- a/actions/github-action/src/data_types/webhooks/githubIssueClosedWebhookPayload.ts +++ b/actions/github-action/src/data_types/webhooks/githubIssueClosedWebhookPayload.ts @@ -1,13 +1,8 @@ import { DisplayMessage, Identifier, Name, Schema } from "@code0-tech/hercules" -import type { components } from "@octokit/openapi-webhooks-types" import { z } from "zod" +import { schemas } from "../../generated/github-schemas.js" -export const GitHubIssueClosedWebhookPayloadSchema = z.looseObject({ - action: z.literal("closed"), - issue: z.looseObject({}), - repository: z.looseObject({}), - sender: z.looseObject({}), -}) as unknown as z.ZodType +export const GitHubIssueClosedWebhookPayloadSchema = schemas["webhook-issues-closed"] @Identifier("GitHubIssueClosedWebhookPayload") @Name({ code: "en-US", content: "GitHub issue closed webhook payload" }) diff --git a/actions/github-action/src/data_types/webhooks/githubIssueOpenedWebhookPayload.ts b/actions/github-action/src/data_types/webhooks/githubIssueOpenedWebhookPayload.ts index 9637292..ce04816 100644 --- a/actions/github-action/src/data_types/webhooks/githubIssueOpenedWebhookPayload.ts +++ b/actions/github-action/src/data_types/webhooks/githubIssueOpenedWebhookPayload.ts @@ -1,13 +1,8 @@ import { DisplayMessage, Identifier, Name, Schema } from "@code0-tech/hercules" -import type { components } from "@octokit/openapi-webhooks-types" import { z } from "zod" +import { schemas } from "../../generated/github-schemas.js" -export const GitHubIssueOpenedWebhookPayloadSchema = z.looseObject({ - action: z.literal("opened"), - issue: z.looseObject({}), - repository: z.looseObject({}), - sender: z.looseObject({}), -}) as unknown as z.ZodType +export const GitHubIssueOpenedWebhookPayloadSchema = schemas["webhook-issues-opened"] @Identifier("GitHubIssueOpenedWebhookPayload") @Name({ code: "en-US", content: "GitHub issue opened webhook payload" }) diff --git a/actions/github-action/src/data_types/webhooks/githubPullRequestClosedWebhookPayload.ts b/actions/github-action/src/data_types/webhooks/githubPullRequestClosedWebhookPayload.ts index 863a35f..37b5594 100644 --- a/actions/github-action/src/data_types/webhooks/githubPullRequestClosedWebhookPayload.ts +++ b/actions/github-action/src/data_types/webhooks/githubPullRequestClosedWebhookPayload.ts @@ -1,13 +1,8 @@ import { DisplayMessage, Identifier, Name, Schema } from "@code0-tech/hercules" -import type { components } from "@octokit/openapi-webhooks-types" import { z } from "zod" +import { schemas } from "../../generated/github-schemas.js" -export const GitHubPullRequestClosedWebhookPayloadSchema = z.looseObject({ - action: z.literal("closed"), - pull_request: z.looseObject({}), - repository: z.looseObject({}), - sender: z.looseObject({}), -}) as unknown as z.ZodType +export const GitHubPullRequestClosedWebhookPayloadSchema = schemas["webhook-pull-request-closed"] @Identifier("GitHubPullRequestClosedWebhookPayload") @Name({ code: "en-US", content: "GitHub pull request closed webhook payload" }) diff --git a/actions/github-action/src/data_types/webhooks/githubPullRequestOpenedWebhookPayload.ts b/actions/github-action/src/data_types/webhooks/githubPullRequestOpenedWebhookPayload.ts index 9b97500..384b00b 100644 --- a/actions/github-action/src/data_types/webhooks/githubPullRequestOpenedWebhookPayload.ts +++ b/actions/github-action/src/data_types/webhooks/githubPullRequestOpenedWebhookPayload.ts @@ -1,13 +1,8 @@ import { DisplayMessage, Identifier, Name, Schema } from "@code0-tech/hercules" -import type { components } from "@octokit/openapi-webhooks-types" import { z } from "zod" +import { schemas } from "../../generated/github-schemas.js" -export const GitHubPullRequestOpenedWebhookPayloadSchema = z.looseObject({ - action: z.literal("opened"), - pull_request: z.looseObject({}), - repository: z.looseObject({}), - sender: z.looseObject({}), -}) as unknown as z.ZodType +export const GitHubPullRequestOpenedWebhookPayloadSchema = schemas["webhook-pull-request-opened"] @Identifier("GitHubPullRequestOpenedWebhookPayload") @Name({ code: "en-US", content: "GitHub pull request opened webhook payload" }) diff --git a/actions/github-action/src/data_types/webhooks/githubPush.ts b/actions/github-action/src/data_types/webhooks/githubPush.ts index 1dc5d37..5b1e908 100644 --- a/actions/github-action/src/data_types/webhooks/githubPush.ts +++ b/actions/github-action/src/data_types/webhooks/githubPush.ts @@ -1,14 +1,8 @@ import { DisplayMessage, Identifier, Name, Schema } from "@code0-tech/hercules" -import type { components } from "@octokit/openapi-webhooks-types" import { z } from "zod" +import { schemas } from "../../generated/github-schemas.js" -export const GitHubPushWebhookPayloadSchema = z.looseObject({ - ref: z.string(), - before: z.string(), - after: z.string(), - repository: z.looseObject({}), - sender: z.looseObject({}), -}) as unknown as z.ZodType +export const GitHubPushWebhookPayloadSchema = schemas["webhook-push"] @Identifier("GitHubPushWebhookPayload") @Name({ code: "en-US", content: "GitHub push webhook payload" }) diff --git a/actions/github-action/src/functions/ciAutomation/cancelWorkflowRunFunction.ts b/actions/github-action/src/functions/ciAutomation/cancelWorkflowRunFunction.ts index 214bccf..84520f6 100644 --- a/actions/github-action/src/functions/ciAutomation/cancelWorkflowRunFunction.ts +++ b/actions/github-action/src/functions/ciAutomation/cancelWorkflowRunFunction.ts @@ -1,15 +1,16 @@ -import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" +import { Description, DisplayIcon, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" import { createGitHubClient, handleGitHubError } from "../../helpers.js" @Identifier("cancelWorkflowRun") @Signature("(owner: string, repository: string, runId: number): void") @Name({ code: "en-US", content: "Cancel workflow run" }) @DisplayMessage({ code: "en-US", content: "Cancel GitHub workflow run" }) +@DisplayIcon("tabler:brand-github") @Documentation({ code: "en-US", content: "Cancels a GitHub Actions workflow run." }) @Description({ code: "en-US", content: "Cancels a GitHub workflow run." }) -@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }] }) -@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }] }) -@Parameter({ runtimeName: "runId", name: [{ code: "en-US", content: "Run ID" }] }) +@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }], description: [{ code: "en-US", content: "Repository owner or organization." }] }) +@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }], description: [{ code: "en-US", content: "Repository name." }] }) +@Parameter({ runtimeName: "runId", name: [{ code: "en-US", content: "Run ID" }], description: [{ code: "en-US", content: "Identifier of the workflow run." }] }) export class CancelWorkflowRunFunction { async run(context: FunctionContext, owner: string, repository: string, runId: number): Promise { if (!Number.isInteger(runId) || runId < 1) throw new RuntimeError("GITHUB_INVALID_WORKFLOW_RUN_ID", "Workflow run ID must be a positive integer.") diff --git a/actions/github-action/src/functions/ciAutomation/createCheckRunFunction.ts b/actions/github-action/src/functions/ciAutomation/createCheckRunFunction.ts index 33bec4e..c805dac 100644 --- a/actions/github-action/src/functions/ciAutomation/createCheckRunFunction.ts +++ b/actions/github-action/src/functions/ciAutomation/createCheckRunFunction.ts @@ -1,22 +1,101 @@ -import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, Signature } from "@code0-tech/hercules" +import { Description, DisplayIcon, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, Signature } from "@code0-tech/hercules" import { GitHubCheckRun, GitHubCheckRunSchema } from "../../data_types/ciAutomation/githubCiAutomation.js" -import { GitHubCreateCheckRunRequest } from "../../data_types/ciAutomation/githubCiAutomationRequests.js" -import { createGitHubClient, handleGitHubError } from "../../helpers.js" +import { createGitHubClient, handleGitHubError, requestBody } from "../../helpers.js" @Identifier("createCheckRun") -@Signature("(owner: string, repository: string, data: GITHUB_CREATE_CHECK_RUN_REQUEST): GITHUB_CHECK_RUN") +@Signature( + '(owner: string, repository: string, name: string, headSha: string, status?: "queued"|"in_progress"|"completed", conclusion?: "success"|"failure"|"neutral"|"cancelled"|"skipped"|"timed_out"|"action_required", detailsUrl?: string, externalId?: string, startedAt?: string, completedAt?: string, summaryTitle?: string, summaryText?: string): GITHUB_CHECK_RUN' +) @Name({ code: "en-US", content: "Create check run" }) @DisplayMessage({ code: "en-US", content: "Create GitHub check run" }) -@Documentation({ code: "en-US", content: "Creates a check run." }) +@DisplayIcon("tabler:brand-github") +@Documentation({ code: "en-US", content: "Creates a check run for a commit." }) @Description({ code: "en-US", content: "Creates a GitHub check run." }) -@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }] }) -@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }] }) -@Parameter({ runtimeName: "data", name: [{ code: "en-US", content: "Check run" }] }) +@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }], description: [{ code: "en-US", content: "Repository owner or organization." }] }) +@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }], description: [{ code: "en-US", content: "Repository name." }] }) +@Parameter({ runtimeName: "name", name: [{ code: "en-US", content: "Name" }], description: [{ code: "en-US", content: "Name of the check run." }] }) +@Parameter({ runtimeName: "headSha", name: [{ code: "en-US", content: "Commit SHA" }], description: [{ code: "en-US", content: "SHA of the commit that is checked." }] }) +@Parameter({ + runtimeName: "status", + name: [{ code: "en-US", content: "Status" }], + description: [{ code: "en-US", content: "How far along the check run is." }], + optional: true, +}) +@Parameter({ + runtimeName: "conclusion", + name: [{ code: "en-US", content: "Conclusion" }], + description: [{ code: "en-US", content: "Result of the check run. Setting it completes the check run." }], + optional: true, +}) +@Parameter({ + runtimeName: "detailsUrl", + name: [{ code: "en-US", content: "Details URL" }], + description: [{ code: "en-US", content: "URL with the full results of the check run." }], + optional: true, +}) +@Parameter({ + runtimeName: "externalId", + name: [{ code: "en-US", content: "External ID" }], + description: [{ code: "en-US", content: "Identifier of the check run in the system that reports it." }], + optional: true, +}) +@Parameter({ + runtimeName: "startedAt", + name: [{ code: "en-US", content: "Started at" }], + description: [{ code: "en-US", content: "When the check run started, as an ISO 8601 timestamp." }], + optional: true, +}) +@Parameter({ + runtimeName: "completedAt", + name: [{ code: "en-US", content: "Completed at" }], + description: [{ code: "en-US", content: "When the check run finished, as an ISO 8601 timestamp." }], + optional: true, +}) +@Parameter({ + runtimeName: "summaryTitle", + name: [{ code: "en-US", content: "Summary title" }], + description: [{ code: "en-US", content: "Title of the result summary shown on the check run." }], + optional: true, +}) +@Parameter({ + runtimeName: "summaryText", + name: [{ code: "en-US", content: "Summary" }], + description: [{ code: "en-US", content: "Result summary shown on the check run. Markdown is supported." }], + optional: true, +}) export class CreateCheckRunFunction { - async run(context: FunctionContext, owner: string, repository: string, data: GitHubCreateCheckRunRequest): Promise { + async run( + context: FunctionContext, + owner: string, + repository: string, + name: string, + headSha: string, + status?: "queued" | "in_progress" | "completed", + conclusion?: "success" | "failure" | "neutral" | "cancelled" | "skipped" | "timed_out" | "action_required", + detailsUrl?: string, + externalId?: string, + startedAt?: string, + completedAt?: string, + summaryTitle?: string, + summaryText?: string + ): Promise { try { const client = createGitHubClient(context) - const response = await client.post(`/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repository)}/check-runs`, data) + const output = requestBody({ title: summaryTitle, summary: summaryText }) + const response = await client.post( + `/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repository)}/check-runs`, + requestBody({ + name, + head_sha: headSha, + status, + conclusion, + details_url: detailsUrl, + external_id: externalId, + started_at: startedAt, + completed_at: completedAt, + output: Object.keys(output).length > 0 ? output : undefined, + }) + ) return GitHubCheckRunSchema.parse(response.data) } catch (error) { return handleGitHubError(error) diff --git a/actions/github-action/src/functions/ciAutomation/createCommitStatusFunction.ts b/actions/github-action/src/functions/ciAutomation/createCommitStatusFunction.ts index b472d38..3aa4fb0 100644 --- a/actions/github-action/src/functions/ciAutomation/createCommitStatusFunction.ts +++ b/actions/github-action/src/functions/ciAutomation/createCommitStatusFunction.ts @@ -1,25 +1,54 @@ -import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, Signature } from "@code0-tech/hercules" +import { Description, DisplayIcon, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, Signature } from "@code0-tech/hercules" import { GitHubCommitStatus, GitHubCommitStatusSchema } from "../../data_types/ciAutomation/githubCiAutomation.js" -import { GitHubCreateCommitStatusRequest } from "../../data_types/ciAutomation/githubCiAutomationRequests.js" -import { createGitHubClient, handleGitHubError } from "../../helpers.js" +import { createGitHubClient, handleGitHubError, requestBody } from "../../helpers.js" @Identifier("createCommitStatus") -@Signature("(owner: string, repository: string, sha: string, data: GITHUB_CREATE_COMMIT_STATUS_REQUEST): GITHUB_COMMIT_STATUS") +@Signature( + '(owner: string, repository: string, sha: string, state: "error"|"failure"|"pending"|"success", description?: string, targetUrl?: string, statusContext?: string): GITHUB_COMMIT_STATUS' +) @Name({ code: "en-US", content: "Create commit status" }) @DisplayMessage({ code: "en-US", content: "Create GitHub commit status" }) +@DisplayIcon("tabler:brand-github") @Documentation({ code: "en-US", content: "Creates a commit status." }) @Description({ code: "en-US", content: "Creates a GitHub commit status." }) -@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }] }) -@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }] }) -@Parameter({ runtimeName: "sha", name: [{ code: "en-US", content: "SHA" }] }) -@Parameter({ runtimeName: "data", name: [{ code: "en-US", content: "Status" }] }) +@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }], description: [{ code: "en-US", content: "Repository owner or organization." }] }) +@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }], description: [{ code: "en-US", content: "Repository name." }] }) +@Parameter({ runtimeName: "sha", name: [{ code: "en-US", content: "SHA" }], description: [{ code: "en-US", content: "Commit SHA the status belongs to." }] }) +@Parameter({ runtimeName: "state", name: [{ code: "en-US", content: "State" }], description: [{ code: "en-US", content: "State of the commit status." }] }) +@Parameter({ + runtimeName: "description", + name: [{ code: "en-US", content: "Description" }], + description: [{ code: "en-US", content: "Short text shown next to the status." }], + optional: true, +}) +@Parameter({ + runtimeName: "targetUrl", + name: [{ code: "en-US", content: "Target URL" }], + description: [{ code: "en-US", content: "URL the status links to." }], + optional: true, +}) +@Parameter({ + runtimeName: "statusContext", + name: [{ code: "en-US", content: "Context" }], + description: [{ code: "en-US", content: "Label that identifies the system sending the status." }], + optional: true, +}) export class CreateCommitStatusFunction { - async run(context: FunctionContext, owner: string, repository: string, sha: string, data: GitHubCreateCommitStatusRequest): Promise { + async run( + context: FunctionContext, + owner: string, + repository: string, + sha: string, + state: "error" | "failure" | "pending" | "success", + description?: string, + targetUrl?: string, + statusContext?: string + ): Promise { try { const client = createGitHubClient(context) const response = await client.post( `/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repository)}/statuses/${encodeURIComponent(sha)}`, - data + requestBody({ state, description, target_url: targetUrl, context: statusContext }) ) return GitHubCommitStatusSchema.parse(response.data) } catch (error) { diff --git a/actions/github-action/src/functions/ciAutomation/dispatchWorkflowFunction.ts b/actions/github-action/src/functions/ciAutomation/dispatchWorkflowFunction.ts index e1f7b73..56e4a24 100644 --- a/actions/github-action/src/functions/ciAutomation/dispatchWorkflowFunction.ts +++ b/actions/github-action/src/functions/ciAutomation/dispatchWorkflowFunction.ts @@ -1,24 +1,31 @@ -import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, Signature } from "@code0-tech/hercules" -import { GitHubDispatchWorkflowRequest } from "../../data_types/ciAutomation/githubWorkflowRequests.js" -import { createGitHubClient, handleGitHubError } from "../../helpers.js" +import { Description, DisplayIcon, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, Signature } from "@code0-tech/hercules" +import { GitHubWorkflowInputs } from "../../data_types/ciAutomation/githubWorkflowInputs.js" +import { createGitHubClient, handleGitHubError, requestBody } from "../../helpers.js" @Identifier("dispatchWorkflow") -@Signature("(owner: string, repository: string, workflowId: string, data: GITHUB_DISPATCH_WORKFLOW_REQUEST): void") +@Signature("(owner: string, repository: string, workflowId: string, ref: string, inputs?: GITHUB_WORKFLOW_INPUTS): void") @Name({ code: "en-US", content: "Dispatch workflow" }) @DisplayMessage({ code: "en-US", content: "Dispatch GitHub workflow" }) +@DisplayIcon("tabler:brand-github") @Documentation({ code: "en-US", content: "Triggers a GitHub Actions workflow dispatch event." }) @Description({ code: "en-US", content: "Dispatches a GitHub workflow." }) -@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }] }) -@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }] }) -@Parameter({ runtimeName: "workflowId", name: [{ code: "en-US", content: "Workflow ID or file name" }] }) -@Parameter({ runtimeName: "data", name: [{ code: "en-US", content: "Dispatch" }] }) +@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }], description: [{ code: "en-US", content: "Repository owner or organization." }] }) +@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }], description: [{ code: "en-US", content: "Repository name." }] }) +@Parameter({ runtimeName: "workflowId", name: [{ code: "en-US", content: "Workflow ID or file name" }], description: [{ code: "en-US", content: "Numeric identifier or file name of the workflow." }] }) +@Parameter({ runtimeName: "ref", name: [{ code: "en-US", content: "Branch or tag" }], description: [{ code: "en-US", content: "Git reference the workflow runs on." }] }) +@Parameter({ + runtimeName: "inputs", + name: [{ code: "en-US", content: "Inputs" }], + description: [{ code: "en-US", content: "Inputs the workflow declares, as key-value pairs." }], + optional: true, +}) export class DispatchWorkflowFunction { - async run(context: FunctionContext, owner: string, repository: string, workflowId: string, data: GitHubDispatchWorkflowRequest): Promise { + async run(context: FunctionContext, owner: string, repository: string, workflowId: string, ref: string, inputs?: GitHubWorkflowInputs): Promise { try { const client = createGitHubClient(context) await client.post( `/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repository)}/actions/workflows/${encodeURIComponent(workflowId)}/dispatches`, - data + requestBody({ ref, inputs }) ) } catch (error) { return handleGitHubError(error) diff --git a/actions/github-action/src/functions/ciAutomation/getCommitStatusesFunction.ts b/actions/github-action/src/functions/ciAutomation/getCommitStatusesFunction.ts index 90e6dfb..4b26b4c 100644 --- a/actions/github-action/src/functions/ciAutomation/getCommitStatusesFunction.ts +++ b/actions/github-action/src/functions/ciAutomation/getCommitStatusesFunction.ts @@ -1,4 +1,4 @@ -import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, Signature } from "@code0-tech/hercules" +import { Description, DisplayIcon, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, Signature } from "@code0-tech/hercules" import { GitHubCommitStatus, GitHubCommitStatusSchema } from "../../data_types/ciAutomation/githubCiAutomation.js" import { createGitHubClient, handleGitHubError } from "../../helpers.js" @@ -6,11 +6,12 @@ import { createGitHubClient, handleGitHubError } from "../../helpers.js" @Signature("(owner: string, repository: string, ref: string): GITHUB_COMMIT_STATUS[]") @Name({ code: "en-US", content: "Get commit statuses" }) @DisplayMessage({ code: "en-US", content: "Get GitHub commit statuses" }) +@DisplayIcon("tabler:brand-github") @Documentation({ code: "en-US", content: "Returns commit statuses for a ref." }) @Description({ code: "en-US", content: "Returns GitHub commit statuses." }) -@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }] }) -@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }] }) -@Parameter({ runtimeName: "ref", name: [{ code: "en-US", content: "Ref" }] }) +@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }], description: [{ code: "en-US", content: "Repository owner or organization." }] }) +@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }], description: [{ code: "en-US", content: "Repository name." }] }) +@Parameter({ runtimeName: "ref", name: [{ code: "en-US", content: "Ref" }], description: [{ code: "en-US", content: "Name of the branch to create." }] }) export class GetCommitStatusesFunction { async run(context: FunctionContext, owner: string, repository: string, ref: string): Promise { try { diff --git a/actions/github-action/src/functions/ciAutomation/getWorkflowRunsFunction.ts b/actions/github-action/src/functions/ciAutomation/getWorkflowRunsFunction.ts index 9120073..bc03941 100644 --- a/actions/github-action/src/functions/ciAutomation/getWorkflowRunsFunction.ts +++ b/actions/github-action/src/functions/ciAutomation/getWorkflowRunsFunction.ts @@ -1,4 +1,4 @@ -import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" +import { Description, DisplayIcon, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" import { GitHubWorkflowRun, GitHubWorkflowRunSchema } from "../../data_types/ciAutomation/githubWorkflow.js" import { createGitHubClient, handleGitHubError } from "../../helpers.js" @@ -6,11 +6,26 @@ import { createGitHubClient, handleGitHubError } from "../../helpers.js" @Signature("(owner: string, repository: string, workflowId?: string, page?: number, perPage?: number): GITHUB_WORKFLOW_RUN[]") @Name({ code: "en-US", content: "Get workflow runs" }) @DisplayMessage({ code: "en-US", content: "Get GitHub workflow runs" }) +@DisplayIcon("tabler:brand-github") @Documentation({ code: "en-US", content: "Returns workflow runs for a repository or a specific workflow." }) @Description({ code: "en-US", content: "Returns GitHub workflow runs." }) -@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }] }) -@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }] }) -@Parameter({ runtimeName: "workflowId", name: [{ code: "en-US", content: "Workflow ID or file name" }] }) +@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }], description: [{ code: "en-US", content: "Repository owner or organization." }] }) +@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }], description: [{ code: "en-US", content: "Repository name." }] }) +@Parameter({ runtimeName: "workflowId", name: [{ code: "en-US", content: "Workflow ID or file name" }], description: [{ code: "en-US", content: "Numeric identifier or file name of the workflow." }], optional: true }) +@Parameter({ + runtimeName: "page", + name: [{ code: "en-US", content: "Page" }], + description: [{ code: "en-US", content: "Page number to return. Defaults to 1." }], + optional: true, + defaultValue: 1, +}) +@Parameter({ + runtimeName: "perPage", + name: [{ code: "en-US", content: "Results per page" }], + description: [{ code: "en-US", content: "Number of results per page, from 1 to 100. Defaults to 30." }], + optional: true, + defaultValue: 30, +}) export class GetWorkflowRunsFunction { async run(context: FunctionContext, owner: string, repository: string, workflowId?: string, page = 1, perPage = 30): Promise { if (!Number.isInteger(page) || page < 1) throw new RuntimeError("GITHUB_INVALID_PAGE", "Page must be a positive integer.") diff --git a/actions/github-action/src/functions/ciAutomation/getWorkflowsFunction.ts b/actions/github-action/src/functions/ciAutomation/getWorkflowsFunction.ts index 8bbc83b..97af1ea 100644 --- a/actions/github-action/src/functions/ciAutomation/getWorkflowsFunction.ts +++ b/actions/github-action/src/functions/ciAutomation/getWorkflowsFunction.ts @@ -1,4 +1,4 @@ -import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" +import { Description, DisplayIcon, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" import { GitHubWorkflow, GitHubWorkflowSchema } from "../../data_types/ciAutomation/githubWorkflow.js" import { createGitHubClient, handleGitHubError } from "../../helpers.js" @@ -6,10 +6,25 @@ import { createGitHubClient, handleGitHubError } from "../../helpers.js" @Signature("(owner: string, repository: string, page?: number, perPage?: number): GITHUB_WORKFLOW[]") @Name({ code: "en-US", content: "Get workflows" }) @DisplayMessage({ code: "en-US", content: "Get GitHub workflows" }) +@DisplayIcon("tabler:brand-github") @Documentation({ code: "en-US", content: "Returns GitHub Actions workflows for a repository." }) @Description({ code: "en-US", content: "Returns GitHub workflows." }) -@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }] }) -@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }] }) +@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }], description: [{ code: "en-US", content: "Repository owner or organization." }] }) +@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }], description: [{ code: "en-US", content: "Repository name." }] }) +@Parameter({ + runtimeName: "page", + name: [{ code: "en-US", content: "Page" }], + description: [{ code: "en-US", content: "Page number to return. Defaults to 1." }], + optional: true, + defaultValue: 1, +}) +@Parameter({ + runtimeName: "perPage", + name: [{ code: "en-US", content: "Results per page" }], + description: [{ code: "en-US", content: "Number of results per page, from 1 to 100. Defaults to 30." }], + optional: true, + defaultValue: 30, +}) export class GetWorkflowsFunction { async run(context: FunctionContext, owner: string, repository: string, page = 1, perPage = 30): Promise { if (!Number.isInteger(page) || page < 1) throw new RuntimeError("GITHUB_INVALID_PAGE", "Page must be a positive integer.") diff --git a/actions/github-action/src/functions/ciAutomation/rerunWorkflowRunFunction.ts b/actions/github-action/src/functions/ciAutomation/rerunWorkflowRunFunction.ts index 3f7957d..103f936 100644 --- a/actions/github-action/src/functions/ciAutomation/rerunWorkflowRunFunction.ts +++ b/actions/github-action/src/functions/ciAutomation/rerunWorkflowRunFunction.ts @@ -1,15 +1,16 @@ -import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" +import { Description, DisplayIcon, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" import { createGitHubClient, handleGitHubError } from "../../helpers.js" @Identifier("rerunWorkflowRun") @Signature("(owner: string, repository: string, runId: number): void") @Name({ code: "en-US", content: "Rerun workflow run" }) @DisplayMessage({ code: "en-US", content: "Rerun GitHub workflow run" }) +@DisplayIcon("tabler:brand-github") @Documentation({ code: "en-US", content: "Reruns a GitHub Actions workflow run." }) @Description({ code: "en-US", content: "Reruns a GitHub workflow run." }) -@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }] }) -@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }] }) -@Parameter({ runtimeName: "runId", name: [{ code: "en-US", content: "Run ID" }] }) +@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }], description: [{ code: "en-US", content: "Repository owner or organization." }] }) +@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }], description: [{ code: "en-US", content: "Repository name." }] }) +@Parameter({ runtimeName: "runId", name: [{ code: "en-US", content: "Run ID" }], description: [{ code: "en-US", content: "Identifier of the workflow run." }] }) export class RerunWorkflowRunFunction { async run(context: FunctionContext, owner: string, repository: string, runId: number): Promise { if (!Number.isInteger(runId) || runId < 1) throw new RuntimeError("GITHUB_INVALID_WORKFLOW_RUN_ID", "Workflow run ID must be a positive integer.") diff --git a/actions/github-action/src/functions/ciAutomation/updateCheckRunFunction.ts b/actions/github-action/src/functions/ciAutomation/updateCheckRunFunction.ts index e51e2a7..c725311 100644 --- a/actions/github-action/src/functions/ciAutomation/updateCheckRunFunction.ts +++ b/actions/github-action/src/functions/ciAutomation/updateCheckRunFunction.ts @@ -1,24 +1,106 @@ -import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" +import { Description, DisplayIcon, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" import { GitHubCheckRun, GitHubCheckRunSchema } from "../../data_types/ciAutomation/githubCiAutomation.js" -import { GitHubUpdateCheckRunRequest } from "../../data_types/ciAutomation/githubCiAutomationRequests.js" -import { createGitHubClient, handleGitHubError } from "../../helpers.js" +import { createGitHubClient, handleGitHubError, requestBody } from "../../helpers.js" @Identifier("updateCheckRun") -@Signature("(owner: string, repository: string, checkRunId: number, data: GITHUB_UPDATE_CHECK_RUN_REQUEST): GITHUB_CHECK_RUN") +@Signature( + '(owner: string, repository: string, checkRunId: number, name?: string, status?: "queued"|"in_progress"|"completed", conclusion?: "success"|"failure"|"neutral"|"cancelled"|"skipped"|"timed_out"|"action_required", detailsUrl?: string, externalId?: string, startedAt?: string, completedAt?: string, summaryTitle?: string, summaryText?: string): GITHUB_CHECK_RUN' +) @Name({ code: "en-US", content: "Update check run" }) @DisplayMessage({ code: "en-US", content: "Update GitHub check run" }) -@Documentation({ code: "en-US", content: "Updates a check run." }) +@DisplayIcon("tabler:brand-github") +@Documentation({ code: "en-US", content: "Updates a check run. Fields that are left empty keep their current value." }) @Description({ code: "en-US", content: "Updates a GitHub check run." }) -@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }] }) -@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }] }) -@Parameter({ runtimeName: "checkRunId", name: [{ code: "en-US", content: "Check run ID" }] }) -@Parameter({ runtimeName: "data", name: [{ code: "en-US", content: "Check run updates" }] }) +@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }], description: [{ code: "en-US", content: "Repository owner or organization." }] }) +@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }], description: [{ code: "en-US", content: "Repository name." }] }) +@Parameter({ runtimeName: "checkRunId", name: [{ code: "en-US", content: "Check run ID" }], description: [{ code: "en-US", content: "Identifier of the check run." }] }) +@Parameter({ + runtimeName: "name", + name: [{ code: "en-US", content: "Name" }], + description: [{ code: "en-US", content: "New name of the check run." }], + optional: true, +}) +@Parameter({ + runtimeName: "status", + name: [{ code: "en-US", content: "Status" }], + description: [{ code: "en-US", content: "How far along the check run is." }], + optional: true, +}) +@Parameter({ + runtimeName: "conclusion", + name: [{ code: "en-US", content: "Conclusion" }], + description: [{ code: "en-US", content: "Result of the check run. Setting it completes the check run." }], + optional: true, +}) +@Parameter({ + runtimeName: "detailsUrl", + name: [{ code: "en-US", content: "Details URL" }], + description: [{ code: "en-US", content: "URL with the full results of the check run." }], + optional: true, +}) +@Parameter({ + runtimeName: "externalId", + name: [{ code: "en-US", content: "External ID" }], + description: [{ code: "en-US", content: "Identifier of the check run in the system that reports it." }], + optional: true, +}) +@Parameter({ + runtimeName: "startedAt", + name: [{ code: "en-US", content: "Started at" }], + description: [{ code: "en-US", content: "When the check run started, as an ISO 8601 timestamp." }], + optional: true, +}) +@Parameter({ + runtimeName: "completedAt", + name: [{ code: "en-US", content: "Completed at" }], + description: [{ code: "en-US", content: "When the check run finished, as an ISO 8601 timestamp." }], + optional: true, +}) +@Parameter({ + runtimeName: "summaryTitle", + name: [{ code: "en-US", content: "Summary title" }], + description: [{ code: "en-US", content: "Title of the result summary shown on the check run." }], + optional: true, +}) +@Parameter({ + runtimeName: "summaryText", + name: [{ code: "en-US", content: "Summary" }], + description: [{ code: "en-US", content: "Result summary shown on the check run. Markdown is supported." }], + optional: true, +}) export class UpdateCheckRunFunction { - async run(context: FunctionContext, owner: string, repository: string, checkRunId: number, data: GitHubUpdateCheckRunRequest): Promise { + async run( + context: FunctionContext, + owner: string, + repository: string, + checkRunId: number, + name?: string, + status?: "queued" | "in_progress" | "completed", + conclusion?: "success" | "failure" | "neutral" | "cancelled" | "skipped" | "timed_out" | "action_required", + detailsUrl?: string, + externalId?: string, + startedAt?: string, + completedAt?: string, + summaryTitle?: string, + summaryText?: string + ): Promise { if (!Number.isInteger(checkRunId) || checkRunId < 1) throw new RuntimeError("GITHUB_INVALID_CHECK_RUN_ID", "Check run ID must be a positive integer.") try { const client = createGitHubClient(context) - const response = await client.patch(`/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repository)}/check-runs/${checkRunId}`, data) + const output = requestBody({ title: summaryTitle, summary: summaryText }) + const response = await client.patch( + `/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repository)}/check-runs/${checkRunId}`, + requestBody({ + name, + status, + conclusion, + details_url: detailsUrl, + external_id: externalId, + started_at: startedAt, + completed_at: completedAt, + output: Object.keys(output).length > 0 ? output : undefined, + }) + ) return GitHubCheckRunSchema.parse(response.data) } catch (error) { return handleGitHubError(error) diff --git a/actions/github-action/src/functions/issueComments/createIssueCommentFunction.ts b/actions/github-action/src/functions/issueComments/createIssueCommentFunction.ts index 6ca440c..8b14f31 100644 --- a/actions/github-action/src/functions/issueComments/createIssueCommentFunction.ts +++ b/actions/github-action/src/functions/issueComments/createIssueCommentFunction.ts @@ -1,31 +1,25 @@ -import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" +import { Description, DisplayIcon, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" import { GitHubIssueComment, GitHubIssueCommentSchema } from "../../data_types/issueComments/githubIssueComment.js" -import { GitHubCreateIssueCommentRequest } from "../../data_types/issueComments/githubIssueCommentRequests.js" import { createGitHubClient, handleGitHubError } from "../../helpers.js" @Identifier("createIssueComment") -@Signature("(owner: string, repository: string, issueNumber: number, data: GITHUB_CREATE_ISSUE_COMMENT_REQUEST): GITHUB_ISSUE_COMMENT") +@Signature("(owner: string, repository: string, issueNumber: number, body: string): GITHUB_ISSUE_COMMENT") @Name({ code: "en-US", content: "Create issue comment" }) @DisplayMessage({ code: "en-US", content: "Create GitHub issue comment" }) +@DisplayIcon("tabler:brand-github") @Documentation({ code: "en-US", content: "Creates a comment on an issue or pull request conversation." }) @Description({ code: "en-US", content: "Creates a GitHub issue comment." }) -@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }] }) -@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }] }) -@Parameter({ runtimeName: "issueNumber", name: [{ code: "en-US", content: "Issue number" }] }) -@Parameter({ runtimeName: "data", name: [{ code: "en-US", content: "Comment" }] }) +@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }], description: [{ code: "en-US", content: "Repository owner or organization." }] }) +@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }], description: [{ code: "en-US", content: "Repository name." }] }) +@Parameter({ runtimeName: "issueNumber", name: [{ code: "en-US", content: "Issue number" }], description: [{ code: "en-US", content: "Number of the issue." }] }) +@Parameter({ runtimeName: "body", name: [{ code: "en-US", content: "Comment" }], description: [{ code: "en-US", content: "Text of the comment." }] }) export class CreateIssueCommentFunction { - async run( - context: FunctionContext, - owner: string, - repository: string, - issueNumber: number, - data: GitHubCreateIssueCommentRequest - ): Promise { + async run(context: FunctionContext, owner: string, repository: string, issueNumber: number, body: string): Promise { if (!Number.isInteger(issueNumber) || issueNumber < 1) throw new RuntimeError("GITHUB_INVALID_ISSUE_NUMBER", "Issue number must be a positive integer.") try { const client = createGitHubClient(context) - const response = await client.post(`/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repository)}/issues/${issueNumber}/comments`, data) + const response = await client.post(`/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repository)}/issues/${issueNumber}/comments`, { body }) return GitHubIssueCommentSchema.parse(response.data) } catch (error) { diff --git a/actions/github-action/src/functions/issueComments/deleteIssueCommentFunction.ts b/actions/github-action/src/functions/issueComments/deleteIssueCommentFunction.ts index 4735199..269ad72 100644 --- a/actions/github-action/src/functions/issueComments/deleteIssueCommentFunction.ts +++ b/actions/github-action/src/functions/issueComments/deleteIssueCommentFunction.ts @@ -1,15 +1,16 @@ -import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" +import { Description, DisplayIcon, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" import { createGitHubClient, handleGitHubError } from "../../helpers.js" @Identifier("deleteIssueComment") @Signature("(owner: string, repository: string, commentId: number): void") @Name({ code: "en-US", content: "Delete issue comment" }) @DisplayMessage({ code: "en-US", content: "Delete GitHub issue comment" }) +@DisplayIcon("tabler:brand-github") @Documentation({ code: "en-US", content: "Deletes an issue comment." }) @Description({ code: "en-US", content: "Deletes a GitHub issue comment." }) -@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }] }) -@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }] }) -@Parameter({ runtimeName: "commentId", name: [{ code: "en-US", content: "Comment ID" }] }) +@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }], description: [{ code: "en-US", content: "Repository owner or organization." }] }) +@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }], description: [{ code: "en-US", content: "Repository name." }] }) +@Parameter({ runtimeName: "commentId", name: [{ code: "en-US", content: "Comment ID" }], description: [{ code: "en-US", content: "Identifier of the comment." }] }) export class DeleteIssueCommentFunction { async run(context: FunctionContext, owner: string, repository: string, commentId: number): Promise { if (!Number.isInteger(commentId) || commentId < 1) throw new RuntimeError("GITHUB_INVALID_COMMENT_ID", "Comment ID must be a positive integer.") diff --git a/actions/github-action/src/functions/issueComments/getIssueCommentsFunction.ts b/actions/github-action/src/functions/issueComments/getIssueCommentsFunction.ts index 8c0781a..ea93972 100644 --- a/actions/github-action/src/functions/issueComments/getIssueCommentsFunction.ts +++ b/actions/github-action/src/functions/issueComments/getIssueCommentsFunction.ts @@ -1,4 +1,4 @@ -import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" +import { Description, DisplayIcon, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" import { GitHubIssueComment, GitHubIssueCommentSchema } from "../../data_types/issueComments/githubIssueComment.js" import { createGitHubClient, handleGitHubError } from "../../helpers.js" @@ -6,11 +6,26 @@ import { createGitHubClient, handleGitHubError } from "../../helpers.js" @Signature("(owner: string, repository: string, issueNumber: number, page?: number, perPage?: number): GITHUB_ISSUE_COMMENT[]") @Name({ code: "en-US", content: "Get issue comments" }) @DisplayMessage({ code: "en-US", content: "Get GitHub issue comments" }) +@DisplayIcon("tabler:brand-github") @Documentation({ code: "en-US", content: "Returns comments for an issue or pull request conversation." }) @Description({ code: "en-US", content: "Returns GitHub issue comments." }) -@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }] }) -@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }] }) -@Parameter({ runtimeName: "issueNumber", name: [{ code: "en-US", content: "Issue number" }] }) +@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }], description: [{ code: "en-US", content: "Repository owner or organization." }] }) +@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }], description: [{ code: "en-US", content: "Repository name." }] }) +@Parameter({ runtimeName: "issueNumber", name: [{ code: "en-US", content: "Issue number" }], description: [{ code: "en-US", content: "Number of the issue." }] }) +@Parameter({ + runtimeName: "page", + name: [{ code: "en-US", content: "Page" }], + description: [{ code: "en-US", content: "Page number to return. Defaults to 1." }], + optional: true, + defaultValue: 1, +}) +@Parameter({ + runtimeName: "perPage", + name: [{ code: "en-US", content: "Results per page" }], + description: [{ code: "en-US", content: "Number of results per page, from 1 to 100. Defaults to 30." }], + optional: true, + defaultValue: 30, +}) export class GetIssueCommentsFunction { async run(context: FunctionContext, owner: string, repository: string, issueNumber: number, page = 1, perPage = 30): Promise { if (!Number.isInteger(issueNumber) || issueNumber < 1) throw new RuntimeError("GITHUB_INVALID_ISSUE_NUMBER", "Issue number must be a positive integer.") diff --git a/actions/github-action/src/functions/issueComments/updateIssueCommentFunction.ts b/actions/github-action/src/functions/issueComments/updateIssueCommentFunction.ts index a00cc6e..1e7e8e6 100644 --- a/actions/github-action/src/functions/issueComments/updateIssueCommentFunction.ts +++ b/actions/github-action/src/functions/issueComments/updateIssueCommentFunction.ts @@ -1,31 +1,25 @@ -import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" +import { Description, DisplayIcon, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" import { GitHubIssueComment, GitHubIssueCommentSchema } from "../../data_types/issueComments/githubIssueComment.js" -import { GitHubUpdateIssueCommentRequest } from "../../data_types/issueComments/githubIssueCommentRequests.js" import { createGitHubClient, handleGitHubError } from "../../helpers.js" @Identifier("updateIssueComment") -@Signature("(owner: string, repository: string, commentId: number, data: GITHUB_UPDATE_ISSUE_COMMENT_REQUEST): GITHUB_ISSUE_COMMENT") +@Signature("(owner: string, repository: string, commentId: number, body: string): GITHUB_ISSUE_COMMENT") @Name({ code: "en-US", content: "Update issue comment" }) @DisplayMessage({ code: "en-US", content: "Update GitHub issue comment" }) +@DisplayIcon("tabler:brand-github") @Documentation({ code: "en-US", content: "Updates an issue comment." }) @Description({ code: "en-US", content: "Updates a GitHub issue comment." }) -@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }] }) -@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }] }) -@Parameter({ runtimeName: "commentId", name: [{ code: "en-US", content: "Comment ID" }] }) -@Parameter({ runtimeName: "data", name: [{ code: "en-US", content: "Comment updates" }] }) +@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }], description: [{ code: "en-US", content: "Repository owner or organization." }] }) +@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }], description: [{ code: "en-US", content: "Repository name." }] }) +@Parameter({ runtimeName: "commentId", name: [{ code: "en-US", content: "Comment ID" }], description: [{ code: "en-US", content: "Identifier of the comment." }] }) +@Parameter({ runtimeName: "body", name: [{ code: "en-US", content: "Comment" }], description: [{ code: "en-US", content: "New text of the comment." }] }) export class UpdateIssueCommentFunction { - async run( - context: FunctionContext, - owner: string, - repository: string, - commentId: number, - data: GitHubUpdateIssueCommentRequest - ): Promise { + async run(context: FunctionContext, owner: string, repository: string, commentId: number, body: string): Promise { if (!Number.isInteger(commentId) || commentId < 1) throw new RuntimeError("GITHUB_INVALID_COMMENT_ID", "Comment ID must be a positive integer.") try { const client = createGitHubClient(context) - const response = await client.patch(`/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repository)}/issues/comments/${commentId}`, data) + const response = await client.patch(`/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repository)}/issues/comments/${commentId}`, { body }) return GitHubIssueCommentSchema.parse(response.data) } catch (error) { diff --git a/actions/github-action/src/functions/issues/addAssigneeToIssueFunction.ts b/actions/github-action/src/functions/issues/addAssigneeToIssueFunction.ts index 9c145e0..5a42b40 100644 --- a/actions/github-action/src/functions/issues/addAssigneeToIssueFunction.ts +++ b/actions/github-action/src/functions/issues/addAssigneeToIssueFunction.ts @@ -1,25 +1,27 @@ -import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" +import { Description, DisplayIcon, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" import { GitHubIssue, GitHubIssueSchema } from "../../data_types/issues/githubIssue.js" -import { createGitHubClient, handleGitHubError } from "../../helpers.js" +import { GitHubUserReference } from "../../data_types/references/githubReferences.js" +import { createGitHubClient, handleGitHubError, userLogin } from "../../helpers.js" @Identifier("addAssigneeToIssue") -@Signature("(owner: string, repository: string, issueNumber: number, assignee: string): GITHUB_ISSUE") +@Signature("(owner: string, repository: string, issueNumber: number, assignee: GITHUB_USER_REFERENCE): GITHUB_ISSUE") @Name({ code: "en-US", content: "Add assignee to issue" }) @DisplayMessage({ code: "en-US", content: "Add GitHub issue assignee" }) +@DisplayIcon("tabler:brand-github") @Documentation({ code: "en-US", content: "Adds one assignee to a GitHub issue." }) @Description({ code: "en-US", content: "Adds one assignee to a GitHub issue." }) -@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }] }) -@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }] }) -@Parameter({ runtimeName: "issueNumber", name: [{ code: "en-US", content: "Issue number" }] }) -@Parameter({ runtimeName: "assignee", name: [{ code: "en-US", content: "Assignee" }] }) +@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }], description: [{ code: "en-US", content: "Repository owner or organization." }] }) +@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }], description: [{ code: "en-US", content: "Repository name." }] }) +@Parameter({ runtimeName: "issueNumber", name: [{ code: "en-US", content: "Issue number" }], description: [{ code: "en-US", content: "Number of the issue." }] }) +@Parameter({ runtimeName: "assignee", name: [{ code: "en-US", content: "Assignee" }], description: [{ code: "en-US", content: "Username of the assignee." }] }) export class AddAssigneeToIssueFunction { - async run(context: FunctionContext, owner: string, repository: string, issueNumber: number, assignee: string): Promise { + async run(context: FunctionContext, owner: string, repository: string, issueNumber: number, assignee: GitHubUserReference): Promise { if (!Number.isInteger(issueNumber) || issueNumber < 1) throw new RuntimeError("GITHUB_INVALID_ISSUE_NUMBER", "Issue number must be a positive integer.") try { const client = createGitHubClient(context) const response = await client.post(`/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repository)}/issues/${issueNumber}/assignees`, { - assignees: [assignee], + assignees: [userLogin(assignee)], }) return GitHubIssueSchema.parse(response.data) diff --git a/actions/github-action/src/functions/issues/addAssigneesToIssueFunction.ts b/actions/github-action/src/functions/issues/addAssigneesToIssueFunction.ts index b4a484d..80553b0 100644 --- a/actions/github-action/src/functions/issues/addAssigneesToIssueFunction.ts +++ b/actions/github-action/src/functions/issues/addAssigneesToIssueFunction.ts @@ -1,24 +1,27 @@ -import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" +import { Description, DisplayIcon, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" import { GitHubIssue, GitHubIssueSchema } from "../../data_types/issues/githubIssue.js" -import { GitHubAddAssigneesRequest } from "../../data_types/issues/githubAssigneesRequest.js" -import { createGitHubClient, handleGitHubError } from "../../helpers.js" +import { GitHubUserReference } from "../../data_types/references/githubReferences.js" +import { createGitHubClient, handleGitHubError, userLogin } from "../../helpers.js" @Identifier("addAssigneesToIssue") -@Signature("(owner: string, repository: string, issueNumber: number, data: GITHUB_ADD_ASSIGNEES_REQUEST): GITHUB_ISSUE") +@Signature("(owner: string, repository: string, issueNumber: number, assignees: GITHUB_USER_REFERENCE[]): GITHUB_ISSUE") @Name({ code: "en-US", content: "Add assignees to issue" }) @DisplayMessage({ code: "en-US", content: "Add GitHub issue assignees" }) +@DisplayIcon("tabler:brand-github") @Documentation({ code: "en-US", content: "Adds assignees to a GitHub issue." }) @Description({ code: "en-US", content: "Adds assignees to a GitHub issue." }) -@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }] }) -@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }] }) -@Parameter({ runtimeName: "issueNumber", name: [{ code: "en-US", content: "Issue number" }] }) -@Parameter({ runtimeName: "data", name: [{ code: "en-US", content: "Assignees" }] }) +@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }], description: [{ code: "en-US", content: "Repository owner or organization." }] }) +@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }], description: [{ code: "en-US", content: "Repository name." }] }) +@Parameter({ runtimeName: "issueNumber", name: [{ code: "en-US", content: "Issue number" }], description: [{ code: "en-US", content: "Number of the issue." }] }) +@Parameter({ runtimeName: "assignees", name: [{ code: "en-US", content: "Assignees" }], description: [{ code: "en-US", content: "Usernames to assign to the issue." }] }) export class AddAssigneesToIssueFunction { - async run(context: FunctionContext, owner: string, repository: string, issueNumber: number, data: GitHubAddAssigneesRequest): Promise { + async run(context: FunctionContext, owner: string, repository: string, issueNumber: number, assignees: GitHubUserReference[]): Promise { if (!Number.isInteger(issueNumber) || issueNumber < 1) throw new RuntimeError("GITHUB_INVALID_ISSUE_NUMBER", "Issue number must be a positive integer.") try { const client = createGitHubClient(context) - const response = await client.post(`/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repository)}/issues/${issueNumber}/assignees`, data) + const response = await client.post(`/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repository)}/issues/${issueNumber}/assignees`, { + assignees: assignees.map(userLogin), + }) return GitHubIssueSchema.parse(response.data) } catch (error) { return handleGitHubError(error) diff --git a/actions/github-action/src/functions/issues/closeIssueFunction.ts b/actions/github-action/src/functions/issues/closeIssueFunction.ts index f750bf7..d065587 100644 --- a/actions/github-action/src/functions/issues/closeIssueFunction.ts +++ b/actions/github-action/src/functions/issues/closeIssueFunction.ts @@ -1,4 +1,4 @@ -import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" +import { Description, DisplayIcon, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" import { GitHubIssue, GitHubIssueSchema } from "../../data_types/issues/githubIssue.js" import { createGitHubClient, handleGitHubError } from "../../helpers.js" @@ -6,11 +6,12 @@ import { createGitHubClient, handleGitHubError } from "../../helpers.js" @Signature("(owner: string, repository: string, issueNumber: number): GITHUB_ISSUE") @Name({ code: "en-US", content: "Close issue" }) @DisplayMessage({ code: "en-US", content: "Close GitHub issue" }) +@DisplayIcon("tabler:brand-github") @Documentation({ code: "en-US", content: "Closes a GitHub issue." }) @Description({ code: "en-US", content: "Closes a GitHub issue." }) -@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }] }) -@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }] }) -@Parameter({ runtimeName: "issueNumber", name: [{ code: "en-US", content: "Issue number" }] }) +@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }], description: [{ code: "en-US", content: "Repository owner or organization." }] }) +@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }], description: [{ code: "en-US", content: "Repository name." }] }) +@Parameter({ runtimeName: "issueNumber", name: [{ code: "en-US", content: "Issue number" }], description: [{ code: "en-US", content: "Number of the issue." }] }) export class CloseIssueFunction { async run(context: FunctionContext, owner: string, repository: string, issueNumber: number): Promise { if (!Number.isInteger(issueNumber) || issueNumber < 1) throw new RuntimeError("GITHUB_INVALID_ISSUE_NUMBER", "Issue number must be a positive integer.") diff --git a/actions/github-action/src/functions/issues/createIssueFunction.ts b/actions/github-action/src/functions/issues/createIssueFunction.ts index 6e96dfb..c72ab22 100644 --- a/actions/github-action/src/functions/issues/createIssueFunction.ts +++ b/actions/github-action/src/functions/issues/createIssueFunction.ts @@ -1,12 +1,19 @@ -import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, Signature } from "@code0-tech/hercules" +import { Description, DisplayIcon, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, Signature } from "@code0-tech/hercules" import { GitHubIssue, GitHubIssueSchema } from "../../data_types/issues/githubIssue.js" -import { GitHubCreateIssueRequest } from "../../data_types/issues/githubIssueRequests.js" -import { createGitHubClient, handleGitHubError } from "../../helpers.js" +import { + GitHubLabelReference, + GitHubMilestoneReference, + GitHubUserReference, +} from "../../data_types/references/githubReferences.js" +import { createGitHubClient, handleGitHubError, labelName, milestoneNumber, requestBody, userLogin } from "../../helpers.js" @Identifier("createIssue") -@Signature("(owner: string, repository: string, data: GITHUB_CREATE_ISSUE_REQUEST): GITHUB_ISSUE") +@Signature( + "(owner: string, repository: string, title: string, body?: string, assignees?: GITHUB_USER_REFERENCE[], labels?: GITHUB_LABEL_REFERENCE[], milestone?: GITHUB_MILESTONE_REFERENCE, issueType?: string): GITHUB_ISSUE" +) @Name({ code: "en-US", content: "Create issue" }) @DisplayMessage({ code: "en-US", content: "Create GitHub issue" }) +@DisplayIcon("tabler:brand-github") @Documentation({ code: "en-US", content: "Creates an issue in a GitHub repository.", @@ -26,15 +33,65 @@ import { createGitHubClient, handleGitHubError } from "../../helpers.js" description: [{ code: "en-US", content: "Repository name." }], }) @Parameter({ - runtimeName: "data", - name: [{ code: "en-US", content: "Issue" }], - description: [{ code: "en-US", content: "Issue fields to create." }], + runtimeName: "title", + name: [{ code: "en-US", content: "Title" }], + description: [{ code: "en-US", content: "Title of the issue." }], +}) +@Parameter({ + runtimeName: "body", + name: [{ code: "en-US", content: "Body" }], + description: [{ code: "en-US", content: "Description of the issue." }], + optional: true, +}) +@Parameter({ + runtimeName: "assignees", + name: [{ code: "en-US", content: "Assignees" }], + description: [{ code: "en-US", content: "Usernames to assign to the issue." }], + optional: true, +}) +@Parameter({ + runtimeName: "labels", + name: [{ code: "en-US", content: "Labels" }], + description: [{ code: "en-US", content: "Names of the labels to put on the issue." }], + optional: true, +}) +@Parameter({ + runtimeName: "milestone", + name: [{ code: "en-US", content: "Milestone" }], + description: [{ code: "en-US", content: "Number of the milestone the issue belongs to." }], + optional: true, +}) +@Parameter({ + runtimeName: "issueType", + name: [{ code: "en-US", content: "Issue type" }], + description: [{ code: "en-US", content: "Name of the issue type, if the repository uses issue types." }], + optional: true, }) export class CreateIssueFunction { - async run(context: FunctionContext, owner: string, repository: string, data: GitHubCreateIssueRequest): Promise { + async run( + context: FunctionContext, + owner: string, + repository: string, + title: string, + body?: string, + assignees?: GitHubUserReference[], + labels?: GitHubLabelReference[], + milestone?: GitHubMilestoneReference, + issueType?: string + ): Promise { try { const client = createGitHubClient(context) - const response = await client.post(`/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repository)}/issues`, data) + const response = await client.post( + `/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repository)}/issues`, + requestBody({ + title, + body, + assignees: assignees?.map(userLogin), + labels: labels?.map(labelName), + milestone: milestoneNumber(milestone), + type: issueType, + }) + ) return GitHubIssueSchema.parse(response.data) } catch (error) { diff --git a/actions/github-action/src/functions/issues/getIssueFunction.ts b/actions/github-action/src/functions/issues/getIssueFunction.ts index ec06394..d3afc2c 100644 --- a/actions/github-action/src/functions/issues/getIssueFunction.ts +++ b/actions/github-action/src/functions/issues/getIssueFunction.ts @@ -1,4 +1,4 @@ -import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" +import { Description, DisplayIcon, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" import { GitHubIssue, GitHubIssueSchema } from "../../data_types/issues/githubIssue.js" import { createGitHubClient, handleGitHubError } from "../../helpers.js" @@ -6,6 +6,7 @@ import { createGitHubClient, handleGitHubError } from "../../helpers.js" @Signature("(owner: string, repository: string, issueNumber: number): GITHUB_ISSUE") @Name({ code: "en-US", content: "Get issue" }) @DisplayMessage({ code: "en-US", content: "Get GitHub issue" }) +@DisplayIcon("tabler:brand-github") @Documentation({ code: "en-US", content: "Returns a single issue from a GitHub repository by its repository-local issue number.", diff --git a/actions/github-action/src/functions/issues/getIssuesFunction.ts b/actions/github-action/src/functions/issues/getIssuesFunction.ts index b8f0b16..a88cd63 100644 --- a/actions/github-action/src/functions/issues/getIssuesFunction.ts +++ b/actions/github-action/src/functions/issues/getIssuesFunction.ts @@ -1,4 +1,4 @@ -import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" +import { Description, DisplayIcon, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" import { GitHubIssue, GitHubIssueSchema } from "../../data_types/issues/githubIssue.js" import { createGitHubClient, handleGitHubError } from "../../helpers.js" @@ -8,6 +8,7 @@ type GitHubIssueState = "open" | "closed" | "all" @Signature('(owner: string, repository: string, state?: "open"|"closed"|"all", page?: number, perPage?: number): GITHUB_ISSUE[]') @Name({ code: "en-US", content: "Get issues" }) @DisplayMessage({ code: "en-US", content: "Get GitHub issues" }) +@DisplayIcon("tabler:brand-github") @Documentation({ code: "en-US", content: "Returns a page of issues from a GitHub repository. Pull requests are excluded from the result.", @@ -30,16 +31,22 @@ type GitHubIssueState = "open" | "closed" | "all" runtimeName: "state", name: [{ code: "en-US", content: "State" }], description: [{ code: "en-US", content: "Filter by open, closed, or all issues. Defaults to open." }], + optional: true, + defaultValue: "open", }) @Parameter({ runtimeName: "page", name: [{ code: "en-US", content: "Page" }], description: [{ code: "en-US", content: "Page number to return. Defaults to 1." }], + optional: true, + defaultValue: 1, }) @Parameter({ runtimeName: "perPage", name: [{ code: "en-US", content: "Results per page" }], description: [{ code: "en-US", content: "Number of results per page, from 1 to 100. Defaults to 30." }], + optional: true, + defaultValue: 30, }) export class GetIssuesFunction { async run(context: FunctionContext, owner: string, repository: string, state: GitHubIssueState = "open", page = 1, perPage = 30): Promise { diff --git a/actions/github-action/src/functions/issues/removeAssigneeFromIssueFunction.ts b/actions/github-action/src/functions/issues/removeAssigneeFromIssueFunction.ts index e8ed112..02ae91a 100644 --- a/actions/github-action/src/functions/issues/removeAssigneeFromIssueFunction.ts +++ b/actions/github-action/src/functions/issues/removeAssigneeFromIssueFunction.ts @@ -1,24 +1,26 @@ -import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" +import { Description, DisplayIcon, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" import { GitHubIssue, GitHubIssueSchema } from "../../data_types/issues/githubIssue.js" -import { createGitHubClient, handleGitHubError } from "../../helpers.js" +import { GitHubUserReference } from "../../data_types/references/githubReferences.js" +import { createGitHubClient, handleGitHubError, userLogin } from "../../helpers.js" @Identifier("removeAssigneeFromIssue") -@Signature("(owner: string, repository: string, issueNumber: number, assignee: string): GITHUB_ISSUE") +@Signature("(owner: string, repository: string, issueNumber: number, assignee: GITHUB_USER_REFERENCE): GITHUB_ISSUE") @Name({ code: "en-US", content: "Remove assignee from issue" }) @DisplayMessage({ code: "en-US", content: "Remove GitHub issue assignee" }) +@DisplayIcon("tabler:brand-github") @Documentation({ code: "en-US", content: "Removes one assignee from a GitHub issue." }) @Description({ code: "en-US", content: "Removes one assignee from a GitHub issue." }) -@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }] }) -@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }] }) -@Parameter({ runtimeName: "issueNumber", name: [{ code: "en-US", content: "Issue number" }] }) -@Parameter({ runtimeName: "assignee", name: [{ code: "en-US", content: "Assignee" }] }) +@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }], description: [{ code: "en-US", content: "Repository owner or organization." }] }) +@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }], description: [{ code: "en-US", content: "Repository name." }] }) +@Parameter({ runtimeName: "issueNumber", name: [{ code: "en-US", content: "Issue number" }], description: [{ code: "en-US", content: "Number of the issue." }] }) +@Parameter({ runtimeName: "assignee", name: [{ code: "en-US", content: "Assignee" }], description: [{ code: "en-US", content: "Username of the assignee." }] }) export class RemoveAssigneeFromIssueFunction { - async run(context: FunctionContext, owner: string, repository: string, issueNumber: number, assignee: string): Promise { + async run(context: FunctionContext, owner: string, repository: string, issueNumber: number, assignee: GitHubUserReference): Promise { if (!Number.isInteger(issueNumber) || issueNumber < 1) throw new RuntimeError("GITHUB_INVALID_ISSUE_NUMBER", "Issue number must be a positive integer.") try { const client = createGitHubClient(context) const response = await client.delete(`/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repository)}/issues/${issueNumber}/assignees`, { - data: { assignees: [assignee] }, + data: { assignees: [userLogin(assignee)] }, }) return GitHubIssueSchema.parse(response.data) } catch (error) { diff --git a/actions/github-action/src/functions/issues/removeAssigneesFromIssueFunction.ts b/actions/github-action/src/functions/issues/removeAssigneesFromIssueFunction.ts index 538b0b7..f420fba 100644 --- a/actions/github-action/src/functions/issues/removeAssigneesFromIssueFunction.ts +++ b/actions/github-action/src/functions/issues/removeAssigneesFromIssueFunction.ts @@ -1,25 +1,26 @@ -import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" +import { Description, DisplayIcon, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" import { GitHubIssue, GitHubIssueSchema } from "../../data_types/issues/githubIssue.js" -import { GitHubAddAssigneesRequest } from "../../data_types/issues/githubAssigneesRequest.js" -import { createGitHubClient, handleGitHubError } from "../../helpers.js" +import { GitHubUserReference } from "../../data_types/references/githubReferences.js" +import { createGitHubClient, handleGitHubError, userLogin } from "../../helpers.js" @Identifier("removeAssigneesFromIssue") -@Signature("(owner: string, repository: string, issueNumber: number, data: GITHUB_ADD_ASSIGNEES_REQUEST): GITHUB_ISSUE") +@Signature("(owner: string, repository: string, issueNumber: number, assignees: GITHUB_USER_REFERENCE[]): GITHUB_ISSUE") @Name({ code: "en-US", content: "Remove assignees from issue" }) @DisplayMessage({ code: "en-US", content: "Remove GitHub issue assignees" }) +@DisplayIcon("tabler:brand-github") @Documentation({ code: "en-US", content: "Removes assignees from a GitHub issue." }) @Description({ code: "en-US", content: "Removes assignees from a GitHub issue." }) -@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }] }) -@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }] }) -@Parameter({ runtimeName: "issueNumber", name: [{ code: "en-US", content: "Issue number" }] }) -@Parameter({ runtimeName: "data", name: [{ code: "en-US", content: "Assignees" }] }) +@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }], description: [{ code: "en-US", content: "Repository owner or organization." }] }) +@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }], description: [{ code: "en-US", content: "Repository name." }] }) +@Parameter({ runtimeName: "issueNumber", name: [{ code: "en-US", content: "Issue number" }], description: [{ code: "en-US", content: "Number of the issue." }] }) +@Parameter({ runtimeName: "assignees", name: [{ code: "en-US", content: "Assignees" }], description: [{ code: "en-US", content: "Usernames to unassign from the issue." }] }) export class RemoveAssigneesFromIssueFunction { - async run(context: FunctionContext, owner: string, repository: string, issueNumber: number, data: GitHubAddAssigneesRequest): Promise { + async run(context: FunctionContext, owner: string, repository: string, issueNumber: number, assignees: GitHubUserReference[]): Promise { if (!Number.isInteger(issueNumber) || issueNumber < 1) throw new RuntimeError("GITHUB_INVALID_ISSUE_NUMBER", "Issue number must be a positive integer.") try { const client = createGitHubClient(context) const response = await client.delete(`/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repository)}/issues/${issueNumber}/assignees`, { - data, + data: { assignees: assignees.map(userLogin) }, }) return GitHubIssueSchema.parse(response.data) } catch (error) { diff --git a/actions/github-action/src/functions/issues/reopenIssueFunction.ts b/actions/github-action/src/functions/issues/reopenIssueFunction.ts index 880486b..2bac521 100644 --- a/actions/github-action/src/functions/issues/reopenIssueFunction.ts +++ b/actions/github-action/src/functions/issues/reopenIssueFunction.ts @@ -1,4 +1,4 @@ -import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" +import { Description, DisplayIcon, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" import { GitHubIssue, GitHubIssueSchema } from "../../data_types/issues/githubIssue.js" import { createGitHubClient, handleGitHubError } from "../../helpers.js" @@ -6,11 +6,12 @@ import { createGitHubClient, handleGitHubError } from "../../helpers.js" @Signature("(owner: string, repository: string, issueNumber: number): GITHUB_ISSUE") @Name({ code: "en-US", content: "Reopen issue" }) @DisplayMessage({ code: "en-US", content: "Reopen GitHub issue" }) +@DisplayIcon("tabler:brand-github") @Documentation({ code: "en-US", content: "Reopens a GitHub issue." }) @Description({ code: "en-US", content: "Reopens a GitHub issue." }) -@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }] }) -@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }] }) -@Parameter({ runtimeName: "issueNumber", name: [{ code: "en-US", content: "Issue number" }] }) +@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }], description: [{ code: "en-US", content: "Repository owner or organization." }] }) +@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }], description: [{ code: "en-US", content: "Repository name." }] }) +@Parameter({ runtimeName: "issueNumber", name: [{ code: "en-US", content: "Issue number" }], description: [{ code: "en-US", content: "Number of the issue." }] }) export class ReopenIssueFunction { async run(context: FunctionContext, owner: string, repository: string, issueNumber: number): Promise { if (!Number.isInteger(issueNumber) || issueNumber < 1) throw new RuntimeError("GITHUB_INVALID_ISSUE_NUMBER", "Issue number must be a positive integer.") diff --git a/actions/github-action/src/functions/issues/updateIssueFunction.ts b/actions/github-action/src/functions/issues/updateIssueFunction.ts index 430c27b..991d570 100644 --- a/actions/github-action/src/functions/issues/updateIssueFunction.ts +++ b/actions/github-action/src/functions/issues/updateIssueFunction.ts @@ -1,15 +1,22 @@ -import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" +import { Description, DisplayIcon, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" import { GitHubIssue, GitHubIssueSchema } from "../../data_types/issues/githubIssue.js" -import { GitHubUpdateIssueRequest } from "../../data_types/issues/githubIssueRequests.js" -import { createGitHubClient, handleGitHubError } from "../../helpers.js" +import { + GitHubLabelReference, + GitHubMilestoneReference, + GitHubUserReference, +} from "../../data_types/references/githubReferences.js" +import { createGitHubClient, handleGitHubError, labelName, milestoneNumber, requestBody, userLogin } from "../../helpers.js" @Identifier("updateIssue") -@Signature("(owner: string, repository: string, issueNumber: number, data: GITHUB_UPDATE_ISSUE_REQUEST): GITHUB_ISSUE") +@Signature( + '(owner: string, repository: string, issueNumber: number, title?: string, body?: string, state?: "open"|"closed", stateReason?: "completed"|"not_planned"|"duplicate"|"reopened", assignees?: GITHUB_USER_REFERENCE[], labels?: GITHUB_LABEL_REFERENCE[], milestone?: GITHUB_MILESTONE_REFERENCE, issueType?: string): GITHUB_ISSUE' +) @Name({ code: "en-US", content: "Update issue" }) @DisplayMessage({ code: "en-US", content: "Update GitHub issue" }) +@DisplayIcon("tabler:brand-github") @Documentation({ code: "en-US", - content: "Updates or closes an issue in a GitHub repository.", + content: "Updates or closes an issue in a GitHub repository. Fields that are left empty keep their current value.", }) @Description({ code: "en-US", @@ -31,19 +38,87 @@ import { createGitHubClient, handleGitHubError } from "../../helpers.js" description: [{ code: "en-US", content: "Repository-local issue number." }], }) @Parameter({ - runtimeName: "data", - name: [{ code: "en-US", content: "Issue updates" }], - description: [{ code: "en-US", content: "Issue fields to update." }], + runtimeName: "title", + name: [{ code: "en-US", content: "Title" }], + description: [{ code: "en-US", content: "New title of the issue." }], + optional: true, +}) +@Parameter({ + runtimeName: "body", + name: [{ code: "en-US", content: "Body" }], + description: [{ code: "en-US", content: "New description of the issue." }], + optional: true, +}) +@Parameter({ + runtimeName: "state", + name: [{ code: "en-US", content: "State" }], + description: [{ code: "en-US", content: "Whether the issue is open or closed." }], + optional: true, +}) +@Parameter({ + runtimeName: "stateReason", + name: [{ code: "en-US", content: "State reason" }], + description: [{ code: "en-US", content: "Why the issue was closed or reopened." }], + optional: true, +}) +@Parameter({ + runtimeName: "assignees", + name: [{ code: "en-US", content: "Assignees" }], + description: [{ code: "en-US", content: "Usernames that replace the current assignees." }], + optional: true, +}) +@Parameter({ + runtimeName: "labels", + name: [{ code: "en-US", content: "Labels" }], + description: [{ code: "en-US", content: "Label names that replace the current labels." }], + optional: true, +}) +@Parameter({ + runtimeName: "milestone", + name: [{ code: "en-US", content: "Milestone" }], + description: [{ code: "en-US", content: "Number of the milestone the issue belongs to." }], + optional: true, +}) +@Parameter({ + runtimeName: "issueType", + name: [{ code: "en-US", content: "Issue type" }], + description: [{ code: "en-US", content: "Name of the issue type, if the repository uses issue types." }], + optional: true, }) export class UpdateIssueFunction { - async run(context: FunctionContext, owner: string, repository: string, issueNumber: number, data: GitHubUpdateIssueRequest): Promise { + async run( + context: FunctionContext, + owner: string, + repository: string, + issueNumber: number, + title?: string, + body?: string, + state?: "open" | "closed", + stateReason?: "completed" | "not_planned" | "duplicate" | "reopened", + assignees?: GitHubUserReference[], + labels?: GitHubLabelReference[], + milestone?: GitHubMilestoneReference, + issueType?: string + ): Promise { if (!Number.isInteger(issueNumber) || issueNumber < 1) { throw new RuntimeError("GITHUB_INVALID_ISSUE_NUMBER", "Issue number must be a positive integer.") } try { const client = createGitHubClient(context) - const response = await client.patch(`/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repository)}/issues/${issueNumber}`, data) + const response = await client.patch( + `/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repository)}/issues/${issueNumber}`, + requestBody({ + title, + body, + state, + state_reason: stateReason, + assignees: assignees?.map(userLogin), + labels: labels?.map(labelName), + milestone: milestoneNumber(milestone), + type: issueType, + }) + ) return GitHubIssueSchema.parse(response.data) } catch (error) { diff --git a/actions/github-action/src/functions/labels/addLabelsToIssueFunction.ts b/actions/github-action/src/functions/labels/addLabelsToIssueFunction.ts index b3ff15c..6b6299f 100644 --- a/actions/github-action/src/functions/labels/addLabelsToIssueFunction.ts +++ b/actions/github-action/src/functions/labels/addLabelsToIssueFunction.ts @@ -1,24 +1,25 @@ -import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" +import { Description, DisplayIcon, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" import { GitHubLabel, GitHubLabelSchema } from "../../data_types/labels/githubLabel.js" -import { GitHubIssueLabelsRequest } from "../../data_types/labels/githubLabelRequests.js" -import { createGitHubClient, handleGitHubError } from "../../helpers.js" +import { GitHubLabelReference } from "../../data_types/references/githubReferences.js" +import { createGitHubClient, handleGitHubError, labelName } from "../../helpers.js" @Identifier("addLabelsToIssue") -@Signature("(owner: string, repository: string, issueNumber: number, data: GITHUB_ISSUE_LABELS_REQUEST): GITHUB_LABEL[]") +@Signature("(owner: string, repository: string, issueNumber: number, labels: GITHUB_LABEL_REFERENCE[]): GITHUB_LABEL[]") @Name({ code: "en-US", content: "Add labels to issue" }) @DisplayMessage({ code: "en-US", content: "Add GitHub issue labels" }) +@DisplayIcon("tabler:brand-github") @Documentation({ code: "en-US", content: "Adds labels to a GitHub issue or pull request." }) @Description({ code: "en-US", content: "Adds GitHub issue labels." }) -@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }] }) -@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }] }) -@Parameter({ runtimeName: "issueNumber", name: [{ code: "en-US", content: "Issue number" }] }) -@Parameter({ runtimeName: "data", name: [{ code: "en-US", content: "Labels" }] }) +@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }], description: [{ code: "en-US", content: "Repository owner or organization." }] }) +@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }], description: [{ code: "en-US", content: "Repository name." }] }) +@Parameter({ runtimeName: "issueNumber", name: [{ code: "en-US", content: "Issue number" }], description: [{ code: "en-US", content: "Number of the issue." }] }) +@Parameter({ runtimeName: "labels", name: [{ code: "en-US", content: "Labels" }], description: [{ code: "en-US", content: "Names of the labels to add to the issue." }] }) export class AddLabelsToIssueFunction { - async run(context: FunctionContext, owner: string, repository: string, issueNumber: number, data: GitHubIssueLabelsRequest): Promise { + async run(context: FunctionContext, owner: string, repository: string, issueNumber: number, labels: GitHubLabelReference[]): Promise { if (!Number.isInteger(issueNumber) || issueNumber < 1) throw new RuntimeError("GITHUB_INVALID_ISSUE_NUMBER", "Issue number must be a positive integer.") try { const client = createGitHubClient(context) - const response = await client.post(`/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repository)}/issues/${issueNumber}/labels`, data) + const response = await client.post(`/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repository)}/issues/${issueNumber}/labels`, { labels: labels.map(labelName) }) return GitHubLabelSchema.array().parse(response.data) } catch (error) { return handleGitHubError(error) diff --git a/actions/github-action/src/functions/labels/getIssueLabelsFunction.ts b/actions/github-action/src/functions/labels/getIssueLabelsFunction.ts index a2e4bcb..757bc75 100644 --- a/actions/github-action/src/functions/labels/getIssueLabelsFunction.ts +++ b/actions/github-action/src/functions/labels/getIssueLabelsFunction.ts @@ -1,4 +1,4 @@ -import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" +import { Description, DisplayIcon, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" import { GitHubLabel, GitHubLabelSchema } from "../../data_types/labels/githubLabel.js" import { createGitHubClient, handleGitHubError } from "../../helpers.js" @@ -6,11 +6,12 @@ import { createGitHubClient, handleGitHubError } from "../../helpers.js" @Signature("(owner: string, repository: string, issueNumber: number): GITHUB_LABEL[]") @Name({ code: "en-US", content: "Get issue labels" }) @DisplayMessage({ code: "en-US", content: "Get GitHub issue labels" }) +@DisplayIcon("tabler:brand-github") @Documentation({ code: "en-US", content: "Returns labels for a GitHub issue or pull request." }) @Description({ code: "en-US", content: "Returns GitHub issue labels." }) -@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }] }) -@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }] }) -@Parameter({ runtimeName: "issueNumber", name: [{ code: "en-US", content: "Issue number" }] }) +@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }], description: [{ code: "en-US", content: "Repository owner or organization." }] }) +@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }], description: [{ code: "en-US", content: "Repository name." }] }) +@Parameter({ runtimeName: "issueNumber", name: [{ code: "en-US", content: "Issue number" }], description: [{ code: "en-US", content: "Number of the issue." }] }) export class GetIssueLabelsFunction { async run(context: FunctionContext, owner: string, repository: string, issueNumber: number): Promise { if (!Number.isInteger(issueNumber) || issueNumber < 1) throw new RuntimeError("GITHUB_INVALID_ISSUE_NUMBER", "Issue number must be a positive integer.") diff --git a/actions/github-action/src/functions/labels/getLabelsFunction.ts b/actions/github-action/src/functions/labels/getLabelsFunction.ts index 2c30fce..4ba9c55 100644 --- a/actions/github-action/src/functions/labels/getLabelsFunction.ts +++ b/actions/github-action/src/functions/labels/getLabelsFunction.ts @@ -1,4 +1,4 @@ -import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" +import { Description, DisplayIcon, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" import { GitHubLabel, GitHubLabelSchema } from "../../data_types/labels/githubLabel.js" import { createGitHubClient, handleGitHubError } from "../../helpers.js" @@ -6,10 +6,25 @@ import { createGitHubClient, handleGitHubError } from "../../helpers.js" @Signature("(owner: string, repository: string, page?: number, perPage?: number): GITHUB_LABEL[]") @Name({ code: "en-US", content: "Get labels" }) @DisplayMessage({ code: "en-US", content: "Get GitHub labels" }) +@DisplayIcon("tabler:brand-github") @Documentation({ code: "en-US", content: "Returns labels from a GitHub repository." }) @Description({ code: "en-US", content: "Returns GitHub labels." }) -@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }] }) -@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }] }) +@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }], description: [{ code: "en-US", content: "Repository owner or organization." }] }) +@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }], description: [{ code: "en-US", content: "Repository name." }] }) +@Parameter({ + runtimeName: "page", + name: [{ code: "en-US", content: "Page" }], + description: [{ code: "en-US", content: "Page number to return. Defaults to 1." }], + optional: true, + defaultValue: 1, +}) +@Parameter({ + runtimeName: "perPage", + name: [{ code: "en-US", content: "Results per page" }], + description: [{ code: "en-US", content: "Number of results per page, from 1 to 100. Defaults to 30." }], + optional: true, + defaultValue: 30, +}) export class GetLabelsFunction { async run(context: FunctionContext, owner: string, repository: string, page = 1, perPage = 30): Promise { if (!Number.isInteger(page) || page < 1) throw new RuntimeError("GITHUB_INVALID_PAGE", "Page must be a positive integer.") diff --git a/actions/github-action/src/functions/labels/removeAllLabelsFromIssueFunction.ts b/actions/github-action/src/functions/labels/removeAllLabelsFromIssueFunction.ts index a89664d..75e62af 100644 --- a/actions/github-action/src/functions/labels/removeAllLabelsFromIssueFunction.ts +++ b/actions/github-action/src/functions/labels/removeAllLabelsFromIssueFunction.ts @@ -1,15 +1,16 @@ -import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" +import { Description, DisplayIcon, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" import { createGitHubClient, handleGitHubError } from "../../helpers.js" @Identifier("removeAllLabelsFromIssue") @Signature("(owner: string, repository: string, issueNumber: number): void") @Name({ code: "en-US", content: "Remove all labels from issue" }) @DisplayMessage({ code: "en-US", content: "Remove all GitHub issue labels" }) +@DisplayIcon("tabler:brand-github") @Documentation({ code: "en-US", content: "Removes all labels from a GitHub issue or pull request." }) @Description({ code: "en-US", content: "Removes all GitHub issue labels." }) -@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }] }) -@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }] }) -@Parameter({ runtimeName: "issueNumber", name: [{ code: "en-US", content: "Issue number" }] }) +@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }], description: [{ code: "en-US", content: "Repository owner or organization." }] }) +@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }], description: [{ code: "en-US", content: "Repository name." }] }) +@Parameter({ runtimeName: "issueNumber", name: [{ code: "en-US", content: "Issue number" }], description: [{ code: "en-US", content: "Number of the issue." }] }) export class RemoveAllLabelsFromIssueFunction { async run(context: FunctionContext, owner: string, repository: string, issueNumber: number): Promise { if (!Number.isInteger(issueNumber) || issueNumber < 1) throw new RuntimeError("GITHUB_INVALID_ISSUE_NUMBER", "Issue number must be a positive integer.") diff --git a/actions/github-action/src/functions/labels/removeLabelFromIssueFunction.ts b/actions/github-action/src/functions/labels/removeLabelFromIssueFunction.ts index 0fc5580..d1cc223 100644 --- a/actions/github-action/src/functions/labels/removeLabelFromIssueFunction.ts +++ b/actions/github-action/src/functions/labels/removeLabelFromIssueFunction.ts @@ -1,24 +1,26 @@ -import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" +import { Description, DisplayIcon, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" import { GitHubLabel, GitHubLabelSchema } from "../../data_types/labels/githubLabel.js" -import { createGitHubClient, handleGitHubError } from "../../helpers.js" +import { GitHubLabelReference } from "../../data_types/references/githubReferences.js" +import { createGitHubClient, handleGitHubError, labelName } from "../../helpers.js" @Identifier("removeLabelFromIssue") -@Signature("(owner: string, repository: string, issueNumber: number, label: string): GITHUB_LABEL[]") +@Signature("(owner: string, repository: string, issueNumber: number, label: GITHUB_LABEL_REFERENCE): GITHUB_LABEL[]") @Name({ code: "en-US", content: "Remove label from issue" }) @DisplayMessage({ code: "en-US", content: "Remove GitHub issue label" }) +@DisplayIcon("tabler:brand-github") @Documentation({ code: "en-US", content: "Removes a label from a GitHub issue or pull request." }) @Description({ code: "en-US", content: "Removes a GitHub issue label." }) -@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }] }) -@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }] }) -@Parameter({ runtimeName: "issueNumber", name: [{ code: "en-US", content: "Issue number" }] }) -@Parameter({ runtimeName: "label", name: [{ code: "en-US", content: "Label" }] }) +@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }], description: [{ code: "en-US", content: "Repository owner or organization." }] }) +@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }], description: [{ code: "en-US", content: "Repository name." }] }) +@Parameter({ runtimeName: "issueNumber", name: [{ code: "en-US", content: "Issue number" }], description: [{ code: "en-US", content: "Number of the issue." }] }) +@Parameter({ runtimeName: "label", name: [{ code: "en-US", content: "Label" }], description: [{ code: "en-US", content: "Name of the label." }] }) export class RemoveLabelFromIssueFunction { - async run(context: FunctionContext, owner: string, repository: string, issueNumber: number, label: string): Promise { + async run(context: FunctionContext, owner: string, repository: string, issueNumber: number, label: GitHubLabelReference): Promise { if (!Number.isInteger(issueNumber) || issueNumber < 1) throw new RuntimeError("GITHUB_INVALID_ISSUE_NUMBER", "Issue number must be a positive integer.") try { const client = createGitHubClient(context) const response = await client.delete( - `/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repository)}/issues/${issueNumber}/labels/${encodeURIComponent(label)}` + `/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repository)}/issues/${issueNumber}/labels/${encodeURIComponent(labelName(label))}` ) return GitHubLabelSchema.array().parse(response.data) } catch (error) { diff --git a/actions/github-action/src/functions/labels/setLabelsForIssueFunction.ts b/actions/github-action/src/functions/labels/setLabelsForIssueFunction.ts index e159f31..b1b2836 100644 --- a/actions/github-action/src/functions/labels/setLabelsForIssueFunction.ts +++ b/actions/github-action/src/functions/labels/setLabelsForIssueFunction.ts @@ -1,24 +1,25 @@ -import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" +import { Description, DisplayIcon, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" import { GitHubLabel, GitHubLabelSchema } from "../../data_types/labels/githubLabel.js" -import { GitHubIssueLabelsRequest } from "../../data_types/labels/githubLabelRequests.js" -import { createGitHubClient, handleGitHubError } from "../../helpers.js" +import { GitHubLabelReference } from "../../data_types/references/githubReferences.js" +import { createGitHubClient, handleGitHubError, labelName } from "../../helpers.js" @Identifier("setLabelsForIssue") -@Signature("(owner: string, repository: string, issueNumber: number, data: GITHUB_ISSUE_LABELS_REQUEST): GITHUB_LABEL[]") +@Signature("(owner: string, repository: string, issueNumber: number, labels: GITHUB_LABEL_REFERENCE[]): GITHUB_LABEL[]") @Name({ code: "en-US", content: "Set labels for issue" }) @DisplayMessage({ code: "en-US", content: "Set GitHub issue labels" }) +@DisplayIcon("tabler:brand-github") @Documentation({ code: "en-US", content: "Replaces all labels for a GitHub issue or pull request." }) @Description({ code: "en-US", content: "Sets GitHub issue labels." }) -@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }] }) -@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }] }) -@Parameter({ runtimeName: "issueNumber", name: [{ code: "en-US", content: "Issue number" }] }) -@Parameter({ runtimeName: "data", name: [{ code: "en-US", content: "Labels" }] }) +@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }], description: [{ code: "en-US", content: "Repository owner or organization." }] }) +@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }], description: [{ code: "en-US", content: "Repository name." }] }) +@Parameter({ runtimeName: "issueNumber", name: [{ code: "en-US", content: "Issue number" }], description: [{ code: "en-US", content: "Number of the issue." }] }) +@Parameter({ runtimeName: "labels", name: [{ code: "en-US", content: "Labels" }], description: [{ code: "en-US", content: "Label names that replace the ones on the issue." }] }) export class SetLabelsForIssueFunction { - async run(context: FunctionContext, owner: string, repository: string, issueNumber: number, data: GitHubIssueLabelsRequest): Promise { + async run(context: FunctionContext, owner: string, repository: string, issueNumber: number, labels: GitHubLabelReference[]): Promise { if (!Number.isInteger(issueNumber) || issueNumber < 1) throw new RuntimeError("GITHUB_INVALID_ISSUE_NUMBER", "Issue number must be a positive integer.") try { const client = createGitHubClient(context) - const response = await client.put(`/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repository)}/issues/${issueNumber}/labels`, data) + const response = await client.put(`/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repository)}/issues/${issueNumber}/labels`, { labels: labels.map(labelName) }) return GitHubLabelSchema.array().parse(response.data) } catch (error) { return handleGitHubError(error) diff --git a/actions/github-action/src/functions/milestones/createMilestoneFunction.ts b/actions/github-action/src/functions/milestones/createMilestoneFunction.ts index 2732dc0..c7f9c04 100644 --- a/actions/github-action/src/functions/milestones/createMilestoneFunction.ts +++ b/actions/github-action/src/functions/milestones/createMilestoneFunction.ts @@ -1,22 +1,51 @@ -import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, Signature } from "@code0-tech/hercules" +import { Description, DisplayIcon, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, Signature } from "@code0-tech/hercules" import { GitHubMilestone, GitHubMilestoneSchema } from "../../data_types/milestones/githubMilestone.js" -import { GitHubCreateMilestoneRequest } from "../../data_types/milestones/githubMilestoneRequests.js" -import { createGitHubClient, handleGitHubError } from "../../helpers.js" +import { createGitHubClient, handleGitHubError, requestBody } from "../../helpers.js" @Identifier("createMilestone") -@Signature("(owner: string, repository: string, data: GITHUB_CREATE_MILESTONE_REQUEST): GITHUB_MILESTONE") +@Signature('(owner: string, repository: string, title: string, description?: string, dueOn?: string, state?: "open"|"closed"): GITHUB_MILESTONE') @Name({ code: "en-US", content: "Create milestone" }) @DisplayMessage({ code: "en-US", content: "Create GitHub milestone" }) +@DisplayIcon("tabler:brand-github") @Documentation({ code: "en-US", content: "Creates a GitHub milestone." }) @Description({ code: "en-US", content: "Creates a GitHub milestone." }) -@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }] }) -@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }] }) -@Parameter({ runtimeName: "data", name: [{ code: "en-US", content: "Milestone" }] }) +@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }], description: [{ code: "en-US", content: "Repository owner or organization." }] }) +@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }], description: [{ code: "en-US", content: "Repository name." }] }) +@Parameter({ runtimeName: "title", name: [{ code: "en-US", content: "Title" }], description: [{ code: "en-US", content: "Title of the milestone." }] }) +@Parameter({ + runtimeName: "description", + name: [{ code: "en-US", content: "Description" }], + description: [{ code: "en-US", content: "Description of the milestone." }], + optional: true, +}) +@Parameter({ + runtimeName: "dueOn", + name: [{ code: "en-US", content: "Due date" }], + description: [{ code: "en-US", content: "Due date of the milestone, as an ISO 8601 timestamp." }], + optional: true, +}) +@Parameter({ + runtimeName: "state", + name: [{ code: "en-US", content: "State" }], + description: [{ code: "en-US", content: "Whether the milestone is open or closed." }], + optional: true, +}) export class CreateMilestoneFunction { - async run(context: FunctionContext, owner: string, repository: string, data: GitHubCreateMilestoneRequest): Promise { + async run( + context: FunctionContext, + owner: string, + repository: string, + title: string, + description?: string, + dueOn?: string, + state?: "open" | "closed" + ): Promise { try { const client = createGitHubClient(context) - const response = await client.post(`/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repository)}/milestones`, data) + const response = await client.post( + `/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repository)}/milestones`, + requestBody({ title, description, due_on: dueOn, state }) + ) return GitHubMilestoneSchema.parse(response.data) } catch (error) { return handleGitHubError(error) diff --git a/actions/github-action/src/functions/milestones/deleteMilestoneFunction.ts b/actions/github-action/src/functions/milestones/deleteMilestoneFunction.ts index 17462b5..39f5bd0 100644 --- a/actions/github-action/src/functions/milestones/deleteMilestoneFunction.ts +++ b/actions/github-action/src/functions/milestones/deleteMilestoneFunction.ts @@ -1,15 +1,16 @@ -import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" +import { Description, DisplayIcon, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" import { createGitHubClient, handleGitHubError } from "../../helpers.js" @Identifier("deleteMilestone") @Signature("(owner: string, repository: string, milestoneNumber: number): void") @Name({ code: "en-US", content: "Delete milestone" }) @DisplayMessage({ code: "en-US", content: "Delete GitHub milestone" }) +@DisplayIcon("tabler:brand-github") @Documentation({ code: "en-US", content: "Deletes a GitHub milestone." }) @Description({ code: "en-US", content: "Deletes a GitHub milestone." }) -@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }] }) -@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }] }) -@Parameter({ runtimeName: "milestoneNumber", name: [{ code: "en-US", content: "Milestone number" }] }) +@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }], description: [{ code: "en-US", content: "Repository owner or organization." }] }) +@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }], description: [{ code: "en-US", content: "Repository name." }] }) +@Parameter({ runtimeName: "milestoneNumber", name: [{ code: "en-US", content: "Milestone number" }], description: [{ code: "en-US", content: "Number of the milestone." }] }) export class DeleteMilestoneFunction { async run(context: FunctionContext, owner: string, repository: string, milestoneNumber: number): Promise { if (!Number.isInteger(milestoneNumber) || milestoneNumber < 1) diff --git a/actions/github-action/src/functions/milestones/getMilestoneFunction.ts b/actions/github-action/src/functions/milestones/getMilestoneFunction.ts index df4ff99..abc4ecb 100644 --- a/actions/github-action/src/functions/milestones/getMilestoneFunction.ts +++ b/actions/github-action/src/functions/milestones/getMilestoneFunction.ts @@ -1,4 +1,4 @@ -import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" +import { Description, DisplayIcon, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" import { GitHubMilestone, GitHubMilestoneSchema } from "../../data_types/milestones/githubMilestone.js" import { createGitHubClient, handleGitHubError } from "../../helpers.js" @@ -6,11 +6,12 @@ import { createGitHubClient, handleGitHubError } from "../../helpers.js" @Signature("(owner: string, repository: string, milestoneNumber: number): GITHUB_MILESTONE") @Name({ code: "en-US", content: "Get milestone" }) @DisplayMessage({ code: "en-US", content: "Get GitHub milestone" }) +@DisplayIcon("tabler:brand-github") @Documentation({ code: "en-US", content: "Returns a GitHub milestone." }) @Description({ code: "en-US", content: "Returns a GitHub milestone." }) -@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }] }) -@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }] }) -@Parameter({ runtimeName: "milestoneNumber", name: [{ code: "en-US", content: "Milestone number" }] }) +@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }], description: [{ code: "en-US", content: "Repository owner or organization." }] }) +@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }], description: [{ code: "en-US", content: "Repository name." }] }) +@Parameter({ runtimeName: "milestoneNumber", name: [{ code: "en-US", content: "Milestone number" }], description: [{ code: "en-US", content: "Number of the milestone." }] }) export class GetMilestoneFunction { async run(context: FunctionContext, owner: string, repository: string, milestoneNumber: number): Promise { if (!Number.isInteger(milestoneNumber) || milestoneNumber < 1) diff --git a/actions/github-action/src/functions/milestones/getMilestonesFunction.ts b/actions/github-action/src/functions/milestones/getMilestonesFunction.ts index 157d3dd..53d181c 100644 --- a/actions/github-action/src/functions/milestones/getMilestonesFunction.ts +++ b/actions/github-action/src/functions/milestones/getMilestonesFunction.ts @@ -1,4 +1,4 @@ -import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" +import { Description, DisplayIcon, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" import { GitHubMilestone, GitHubMilestoneSchema } from "../../data_types/milestones/githubMilestone.js" import { createGitHubClient, handleGitHubError } from "../../helpers.js" @@ -6,10 +6,32 @@ import { createGitHubClient, handleGitHubError } from "../../helpers.js" @Signature('(owner: string, repository: string, state?: "open"|"closed"|"all", page?: number, perPage?: number): GITHUB_MILESTONE[]') @Name({ code: "en-US", content: "Get milestones" }) @DisplayMessage({ code: "en-US", content: "Get GitHub milestones" }) +@DisplayIcon("tabler:brand-github") @Documentation({ code: "en-US", content: "Returns milestones from a GitHub repository." }) @Description({ code: "en-US", content: "Returns GitHub milestones." }) -@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }] }) -@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }] }) +@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }], description: [{ code: "en-US", content: "Repository owner or organization." }] }) +@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }], description: [{ code: "en-US", content: "Repository name." }] }) +@Parameter({ + runtimeName: "state", + name: [{ code: "en-US", content: "State" }], + description: [{ code: "en-US", content: "Filter by open, closed, or all milestones. Defaults to open." }], + optional: true, + defaultValue: "open", +}) +@Parameter({ + runtimeName: "page", + name: [{ code: "en-US", content: "Page" }], + description: [{ code: "en-US", content: "Page number to return. Defaults to 1." }], + optional: true, + defaultValue: 1, +}) +@Parameter({ + runtimeName: "perPage", + name: [{ code: "en-US", content: "Results per page" }], + description: [{ code: "en-US", content: "Number of results per page, from 1 to 100. Defaults to 30." }], + optional: true, + defaultValue: 30, +}) export class GetMilestonesFunction { async run( context: FunctionContext, diff --git a/actions/github-action/src/functions/milestones/updateMilestoneFunction.ts b/actions/github-action/src/functions/milestones/updateMilestoneFunction.ts index ff47c81..0fad77a 100644 --- a/actions/github-action/src/functions/milestones/updateMilestoneFunction.ts +++ b/actions/github-action/src/functions/milestones/updateMilestoneFunction.ts @@ -1,31 +1,62 @@ -import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" +import { Description, DisplayIcon, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" import { GitHubMilestone, GitHubMilestoneSchema } from "../../data_types/milestones/githubMilestone.js" -import { GitHubUpdateMilestoneRequest } from "../../data_types/milestones/githubMilestoneRequests.js" -import { createGitHubClient, handleGitHubError } from "../../helpers.js" +import { createGitHubClient, handleGitHubError, requestBody } from "../../helpers.js" @Identifier("updateMilestone") -@Signature("(owner: string, repository: string, milestoneNumber: number, data: GITHUB_UPDATE_MILESTONE_REQUEST): GITHUB_MILESTONE") +@Signature( + '(owner: string, repository: string, milestoneNumber: number, title?: string, description?: string, dueOn?: string, state?: "open"|"closed"): GITHUB_MILESTONE' +) @Name({ code: "en-US", content: "Update milestone" }) @DisplayMessage({ code: "en-US", content: "Update GitHub milestone" }) -@Documentation({ code: "en-US", content: "Updates a GitHub milestone." }) +@DisplayIcon("tabler:brand-github") +@Documentation({ code: "en-US", content: "Updates a GitHub milestone. Fields that are left empty keep their current value." }) @Description({ code: "en-US", content: "Updates a GitHub milestone." }) -@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }] }) -@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }] }) -@Parameter({ runtimeName: "milestoneNumber", name: [{ code: "en-US", content: "Milestone number" }] }) -@Parameter({ runtimeName: "data", name: [{ code: "en-US", content: "Milestone updates" }] }) +@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }], description: [{ code: "en-US", content: "Repository owner or organization." }] }) +@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }], description: [{ code: "en-US", content: "Repository name." }] }) +@Parameter({ runtimeName: "milestoneNumber", name: [{ code: "en-US", content: "Milestone number" }], description: [{ code: "en-US", content: "Number of the milestone." }] }) +@Parameter({ + runtimeName: "title", + name: [{ code: "en-US", content: "Title" }], + description: [{ code: "en-US", content: "New title of the milestone." }], + optional: true, +}) +@Parameter({ + runtimeName: "description", + name: [{ code: "en-US", content: "Description" }], + description: [{ code: "en-US", content: "New description of the milestone." }], + optional: true, +}) +@Parameter({ + runtimeName: "dueOn", + name: [{ code: "en-US", content: "Due date" }], + description: [{ code: "en-US", content: "Due date of the milestone, as an ISO 8601 timestamp." }], + optional: true, +}) +@Parameter({ + runtimeName: "state", + name: [{ code: "en-US", content: "State" }], + description: [{ code: "en-US", content: "Whether the milestone is open or closed." }], + optional: true, +}) export class UpdateMilestoneFunction { async run( context: FunctionContext, owner: string, repository: string, milestoneNumber: number, - data: GitHubUpdateMilestoneRequest + title?: string, + description?: string, + dueOn?: string, + state?: "open" | "closed" ): Promise { if (!Number.isInteger(milestoneNumber) || milestoneNumber < 1) throw new RuntimeError("GITHUB_INVALID_MILESTONE_NUMBER", "Milestone number must be a positive integer.") try { const client = createGitHubClient(context) - const response = await client.patch(`/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repository)}/milestones/${milestoneNumber}`, data) + const response = await client.patch( + `/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repository)}/milestones/${milestoneNumber}`, + requestBody({ title, description, due_on: dueOn, state }) + ) return GitHubMilestoneSchema.parse(response.data) } catch (error) { return handleGitHubError(error) diff --git a/actions/github-action/src/functions/pullRequestReviewComments/createPullRequestReviewCommentFunction.ts b/actions/github-action/src/functions/pullRequestReviewComments/createPullRequestReviewCommentFunction.ts index 83c159d..bffcce7 100644 --- a/actions/github-action/src/functions/pullRequestReviewComments/createPullRequestReviewCommentFunction.ts +++ b/actions/github-action/src/functions/pullRequestReviewComments/createPullRequestReviewCommentFunction.ts @@ -1,27 +1,66 @@ -import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" +import { Description, DisplayIcon, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" import { GitHubPullRequestReviewComment, GitHubPullRequestReviewCommentSchema } from "../../data_types/pullRequestReviewComments/githubPullRequestReviewComment.js" -import { GitHubCreatePullRequestReviewCommentRequest } from "../../data_types/pullRequestReviewComments/githubPullRequestReviewCommentRequests.js" -import { createGitHubClient, handleGitHubError } from "../../helpers.js" +import { createGitHubClient, handleGitHubError, requestBody } from "../../helpers.js" @Identifier("createPullRequestReviewComment") @Signature( - "(owner: string, repository: string, pullRequestNumber: number, data: GITHUB_CREATE_PULL_REQUEST_REVIEW_COMMENT_REQUEST): GITHUB_PULL_REQUEST_REVIEW_COMMENT" + '(owner: string, repository: string, pullRequestNumber: number, body: string, commitId: string, path: string, line?: number, side?: "LEFT"|"RIGHT", startLine?: number, startSide?: "LEFT"|"RIGHT", inReplyTo?: number): GITHUB_PULL_REQUEST_REVIEW_COMMENT' ) @Name({ code: "en-US", content: "Create pull request review comment" }) @DisplayMessage({ code: "en-US", content: "Create GitHub pull request review comment" }) -@Documentation({ code: "en-US", content: "Creates a pull request review comment." }) +@DisplayIcon("tabler:brand-github") +@Documentation({ code: "en-US", content: "Creates a pull request review comment on a line of a file." }) @Description({ code: "en-US", content: "Creates a GitHub pull request review comment." }) -@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }] }) -@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }] }) -@Parameter({ runtimeName: "pullRequestNumber", name: [{ code: "en-US", content: "Pull request number" }] }) -@Parameter({ runtimeName: "data", name: [{ code: "en-US", content: "Review comment" }] }) +@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }], description: [{ code: "en-US", content: "Repository owner or organization." }] }) +@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }], description: [{ code: "en-US", content: "Repository name." }] }) +@Parameter({ runtimeName: "pullRequestNumber", name: [{ code: "en-US", content: "Pull request number" }], description: [{ code: "en-US", content: "Number of the pull request." }] }) +@Parameter({ runtimeName: "body", name: [{ code: "en-US", content: "Comment" }], description: [{ code: "en-US", content: "Text of the review comment." }] }) +@Parameter({ runtimeName: "commitId", name: [{ code: "en-US", content: "Commit SHA" }], description: [{ code: "en-US", content: "Commit the comment refers to." }] }) +@Parameter({ runtimeName: "path", name: [{ code: "en-US", content: "File path" }], description: [{ code: "en-US", content: "Path of the file the comment refers to." }] }) +@Parameter({ + runtimeName: "line", + name: [{ code: "en-US", content: "Line" }], + description: [{ code: "en-US", content: "Line in the file the comment refers to." }], + optional: true, +}) +@Parameter({ + runtimeName: "side", + name: [{ code: "en-US", content: "Side" }], + description: [{ code: "en-US", content: "Whether the line is on the old (LEFT) or new (RIGHT) version of the file." }], + optional: true, +}) +@Parameter({ + runtimeName: "startLine", + name: [{ code: "en-US", content: "Start line" }], + description: [{ code: "en-US", content: "First line of a multi-line comment." }], + optional: true, +}) +@Parameter({ + runtimeName: "startSide", + name: [{ code: "en-US", content: "Start side" }], + description: [{ code: "en-US", content: "Side of the first line of a multi-line comment." }], + optional: true, +}) +@Parameter({ + runtimeName: "inReplyTo", + name: [{ code: "en-US", content: "In reply to" }], + description: [{ code: "en-US", content: "Identifier of the review comment this one replies to." }], + optional: true, +}) export class CreatePullRequestReviewCommentFunction { async run( context: FunctionContext, owner: string, repository: string, pullRequestNumber: number, - data: GitHubCreatePullRequestReviewCommentRequest + body: string, + commitId: string, + path: string, + line?: number, + side?: "LEFT" | "RIGHT", + startLine?: number, + startSide?: "LEFT" | "RIGHT", + inReplyTo?: number ): Promise { if (!Number.isInteger(pullRequestNumber) || pullRequestNumber < 1) throw new RuntimeError("GITHUB_INVALID_PULL_REQUEST_NUMBER", "Pull request number must be a positive integer.") @@ -29,7 +68,7 @@ export class CreatePullRequestReviewCommentFunction { const client = createGitHubClient(context) const response = await client.post( `/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repository)}/pulls/${pullRequestNumber}/comments`, - data + requestBody({ body, commit_id: commitId, path, line, side, start_line: startLine, start_side: startSide, in_reply_to: inReplyTo }) ) return GitHubPullRequestReviewCommentSchema.parse(response.data) } catch (error) { diff --git a/actions/github-action/src/functions/pullRequestReviewComments/deletePullRequestReviewCommentFunction.ts b/actions/github-action/src/functions/pullRequestReviewComments/deletePullRequestReviewCommentFunction.ts index 7699af7..7225121 100644 --- a/actions/github-action/src/functions/pullRequestReviewComments/deletePullRequestReviewCommentFunction.ts +++ b/actions/github-action/src/functions/pullRequestReviewComments/deletePullRequestReviewCommentFunction.ts @@ -1,15 +1,16 @@ -import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" +import { Description, DisplayIcon, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" import { createGitHubClient, handleGitHubError } from "../../helpers.js" @Identifier("deletePullRequestReviewComment") @Signature("(owner: string, repository: string, commentId: number): void") @Name({ code: "en-US", content: "Delete pull request review comment" }) @DisplayMessage({ code: "en-US", content: "Delete GitHub pull request review comment" }) +@DisplayIcon("tabler:brand-github") @Documentation({ code: "en-US", content: "Deletes a pull request review comment." }) @Description({ code: "en-US", content: "Deletes a GitHub pull request review comment." }) -@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }] }) -@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }] }) -@Parameter({ runtimeName: "commentId", name: [{ code: "en-US", content: "Comment ID" }] }) +@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }], description: [{ code: "en-US", content: "Repository owner or organization." }] }) +@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }], description: [{ code: "en-US", content: "Repository name." }] }) +@Parameter({ runtimeName: "commentId", name: [{ code: "en-US", content: "Comment ID" }], description: [{ code: "en-US", content: "Identifier of the comment." }] }) export class DeletePullRequestReviewCommentFunction { async run(context: FunctionContext, owner: string, repository: string, commentId: number): Promise { if (!Number.isInteger(commentId) || commentId < 1) throw new RuntimeError("GITHUB_INVALID_COMMENT_ID", "Comment ID must be a positive integer.") diff --git a/actions/github-action/src/functions/pullRequestReviewComments/getPullRequestReviewCommentsFunction.ts b/actions/github-action/src/functions/pullRequestReviewComments/getPullRequestReviewCommentsFunction.ts index 7d797e2..a0c6ff2 100644 --- a/actions/github-action/src/functions/pullRequestReviewComments/getPullRequestReviewCommentsFunction.ts +++ b/actions/github-action/src/functions/pullRequestReviewComments/getPullRequestReviewCommentsFunction.ts @@ -1,4 +1,4 @@ -import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" +import { Description, DisplayIcon, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" import { GitHubPullRequestReviewComment, GitHubPullRequestReviewCommentSchema } from "../../data_types/pullRequestReviewComments/githubPullRequestReviewComment.js" import { createGitHubClient, handleGitHubError } from "../../helpers.js" @@ -6,11 +6,26 @@ import { createGitHubClient, handleGitHubError } from "../../helpers.js" @Signature("(owner: string, repository: string, pullRequestNumber: number, page?: number, perPage?: number): GITHUB_PULL_REQUEST_REVIEW_COMMENT[]") @Name({ code: "en-US", content: "Get pull request review comments" }) @DisplayMessage({ code: "en-US", content: "Get GitHub pull request review comments" }) +@DisplayIcon("tabler:brand-github") @Documentation({ code: "en-US", content: "Returns review comments for a pull request." }) @Description({ code: "en-US", content: "Returns GitHub pull request review comments." }) -@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }] }) -@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }] }) -@Parameter({ runtimeName: "pullRequestNumber", name: [{ code: "en-US", content: "Pull request number" }] }) +@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }], description: [{ code: "en-US", content: "Repository owner or organization." }] }) +@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }], description: [{ code: "en-US", content: "Repository name." }] }) +@Parameter({ runtimeName: "pullRequestNumber", name: [{ code: "en-US", content: "Pull request number" }], description: [{ code: "en-US", content: "Number of the pull request." }] }) +@Parameter({ + runtimeName: "page", + name: [{ code: "en-US", content: "Page" }], + description: [{ code: "en-US", content: "Page number to return. Defaults to 1." }], + optional: true, + defaultValue: 1, +}) +@Parameter({ + runtimeName: "perPage", + name: [{ code: "en-US", content: "Results per page" }], + description: [{ code: "en-US", content: "Number of results per page, from 1 to 100. Defaults to 30." }], + optional: true, + defaultValue: 30, +}) export class GetPullRequestReviewCommentsFunction { async run( context: FunctionContext, diff --git a/actions/github-action/src/functions/pullRequestReviewComments/updatePullRequestReviewCommentFunction.ts b/actions/github-action/src/functions/pullRequestReviewComments/updatePullRequestReviewCommentFunction.ts index bd0a892..bea71d4 100644 --- a/actions/github-action/src/functions/pullRequestReviewComments/updatePullRequestReviewCommentFunction.ts +++ b/actions/github-action/src/functions/pullRequestReviewComments/updatePullRequestReviewCommentFunction.ts @@ -1,32 +1,24 @@ -import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" +import { Description, DisplayIcon, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" import { GitHubPullRequestReviewComment, GitHubPullRequestReviewCommentSchema } from "../../data_types/pullRequestReviewComments/githubPullRequestReviewComment.js" -import { GitHubUpdatePullRequestReviewCommentRequest } from "../../data_types/pullRequestReviewComments/githubPullRequestReviewCommentRequests.js" import { createGitHubClient, handleGitHubError } from "../../helpers.js" @Identifier("updatePullRequestReviewComment") -@Signature( - "(owner: string, repository: string, commentId: number, data: GITHUB_UPDATE_PULL_REQUEST_REVIEW_COMMENT_REQUEST): GITHUB_PULL_REQUEST_REVIEW_COMMENT" -) +@Signature("(owner: string, repository: string, commentId: number, body: string): GITHUB_PULL_REQUEST_REVIEW_COMMENT") @Name({ code: "en-US", content: "Update pull request review comment" }) @DisplayMessage({ code: "en-US", content: "Update GitHub pull request review comment" }) +@DisplayIcon("tabler:brand-github") @Documentation({ code: "en-US", content: "Updates a pull request review comment." }) @Description({ code: "en-US", content: "Updates a GitHub pull request review comment." }) -@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }] }) -@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }] }) -@Parameter({ runtimeName: "commentId", name: [{ code: "en-US", content: "Comment ID" }] }) -@Parameter({ runtimeName: "data", name: [{ code: "en-US", content: "Review comment updates" }] }) +@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }], description: [{ code: "en-US", content: "Repository owner or organization." }] }) +@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }], description: [{ code: "en-US", content: "Repository name." }] }) +@Parameter({ runtimeName: "commentId", name: [{ code: "en-US", content: "Comment ID" }], description: [{ code: "en-US", content: "Identifier of the comment." }] }) +@Parameter({ runtimeName: "body", name: [{ code: "en-US", content: "Comment" }], description: [{ code: "en-US", content: "New text of the review comment." }] }) export class UpdatePullRequestReviewCommentFunction { - async run( - context: FunctionContext, - owner: string, - repository: string, - commentId: number, - data: GitHubUpdatePullRequestReviewCommentRequest - ): Promise { + async run(context: FunctionContext, owner: string, repository: string, commentId: number, body: string): Promise { if (!Number.isInteger(commentId) || commentId < 1) throw new RuntimeError("GITHUB_INVALID_COMMENT_ID", "Comment ID must be a positive integer.") try { const client = createGitHubClient(context) - const response = await client.patch(`/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repository)}/pulls/comments/${commentId}`, data) + const response = await client.patch(`/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repository)}/pulls/comments/${commentId}`, { body }) return GitHubPullRequestReviewCommentSchema.parse(response.data) } catch (error) { return handleGitHubError(error) diff --git a/actions/github-action/src/functions/pullRequestReviews/createPullRequestReviewFunction.ts b/actions/github-action/src/functions/pullRequestReviews/createPullRequestReviewFunction.ts index 1c1d3d9..478eb9b 100644 --- a/actions/github-action/src/functions/pullRequestReviews/createPullRequestReviewFunction.ts +++ b/actions/github-action/src/functions/pullRequestReviews/createPullRequestReviewFunction.ts @@ -1,32 +1,56 @@ -import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" +import { Description, DisplayIcon, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" import { GitHubPullRequestReview, GitHubPullRequestReviewSchema } from "../../data_types/pullRequestReviews/githubPullRequestReview.js" -import { GitHubCreatePullRequestReviewRequest } from "../../data_types/pullRequestReviews/githubPullRequestReviewRequests.js" -import { createGitHubClient, handleGitHubError } from "../../helpers.js" +import { createGitHubClient, handleGitHubError, requestBody } from "../../helpers.js" @Identifier("createPullRequestReview") -@Signature("(owner: string, repository: string, pullRequestNumber: number, data: GITHUB_CREATE_PULL_REQUEST_REVIEW_REQUEST): GITHUB_PULL_REQUEST_REVIEW") +@Signature( + '(owner: string, repository: string, pullRequestNumber: number, event?: "APPROVE"|"REQUEST_CHANGES"|"COMMENT", body?: string, commitId?: string): GITHUB_PULL_REQUEST_REVIEW' +) @Name({ code: "en-US", content: "Create pull request review" }) @DisplayMessage({ code: "en-US", content: "Create GitHub pull request review" }) -@Documentation({ code: "en-US", content: "Creates a pull request review." }) +@DisplayIcon("tabler:brand-github") +@Documentation({ code: "en-US", content: "Creates a pull request review. Without an event the review stays pending until it is submitted." }) @Description({ code: "en-US", content: "Creates a GitHub pull request review." }) -@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }] }) -@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }] }) -@Parameter({ runtimeName: "pullRequestNumber", name: [{ code: "en-US", content: "Pull request number" }] }) -@Parameter({ runtimeName: "data", name: [{ code: "en-US", content: "Review" }] }) +@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }], description: [{ code: "en-US", content: "Repository owner or organization." }] }) +@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }], description: [{ code: "en-US", content: "Repository name." }] }) +@Parameter({ runtimeName: "pullRequestNumber", name: [{ code: "en-US", content: "Pull request number" }], description: [{ code: "en-US", content: "Number of the pull request." }] }) +@Parameter({ + runtimeName: "event", + name: [{ code: "en-US", content: "Event" }], + description: [{ code: "en-US", content: "Whether the review approves, requests changes, or only comments." }], + optional: true, +}) +@Parameter({ + runtimeName: "body", + name: [{ code: "en-US", content: "Body" }], + description: [{ code: "en-US", content: "Text of the review." }], + optional: true, +}) +@Parameter({ + runtimeName: "commitId", + name: [{ code: "en-US", content: "Commit SHA" }], + description: [{ code: "en-US", content: "Commit the review refers to. Defaults to the latest commit." }], + optional: true, +}) export class CreatePullRequestReviewFunction { async run( context: FunctionContext, owner: string, repository: string, pullRequestNumber: number, - data: GitHubCreatePullRequestReviewRequest + event?: "APPROVE" | "REQUEST_CHANGES" | "COMMENT", + body?: string, + commitId?: string ): Promise { if (!Number.isInteger(pullRequestNumber) || pullRequestNumber < 1) throw new RuntimeError("GITHUB_INVALID_PULL_REQUEST_NUMBER", "Pull request number must be a positive integer.") try { const client = createGitHubClient(context) - const response = await client.post(`/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repository)}/pulls/${pullRequestNumber}/reviews`, data) + const response = await client.post( + `/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repository)}/pulls/${pullRequestNumber}/reviews`, + requestBody({ event, body, commit_id: commitId }) + ) return GitHubPullRequestReviewSchema.parse(response.data) } catch (error) { return handleGitHubError(error) diff --git a/actions/github-action/src/functions/pullRequestReviews/dismissPullRequestReviewFunction.ts b/actions/github-action/src/functions/pullRequestReviews/dismissPullRequestReviewFunction.ts index 986573a..3ddc1f1 100644 --- a/actions/github-action/src/functions/pullRequestReviews/dismissPullRequestReviewFunction.ts +++ b/actions/github-action/src/functions/pullRequestReviews/dismissPullRequestReviewFunction.ts @@ -1,21 +1,19 @@ -import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" +import { Description, DisplayIcon, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" import { GitHubPullRequestReview, GitHubPullRequestReviewSchema } from "../../data_types/pullRequestReviews/githubPullRequestReview.js" -import { GitHubDismissPullRequestReviewRequest } from "../../data_types/pullRequestReviews/githubPullRequestReviewRequests.js" import { createGitHubClient, handleGitHubError } from "../../helpers.js" @Identifier("dismissPullRequestReview") -@Signature( - "(owner: string, repository: string, pullRequestNumber: number, reviewId: number, data: GITHUB_DISMISS_PULL_REQUEST_REVIEW_REQUEST): GITHUB_PULL_REQUEST_REVIEW" -) +@Signature("(owner: string, repository: string, pullRequestNumber: number, reviewId: number, message: string): GITHUB_PULL_REQUEST_REVIEW") @Name({ code: "en-US", content: "Dismiss pull request review" }) @DisplayMessage({ code: "en-US", content: "Dismiss GitHub pull request review" }) +@DisplayIcon("tabler:brand-github") @Documentation({ code: "en-US", content: "Dismisses a pull request review." }) @Description({ code: "en-US", content: "Dismisses a GitHub pull request review." }) -@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }] }) -@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }] }) -@Parameter({ runtimeName: "pullRequestNumber", name: [{ code: "en-US", content: "Pull request number" }] }) -@Parameter({ runtimeName: "reviewId", name: [{ code: "en-US", content: "Review ID" }] }) -@Parameter({ runtimeName: "data", name: [{ code: "en-US", content: "Review dismissal" }] }) +@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }], description: [{ code: "en-US", content: "Repository owner or organization." }] }) +@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }], description: [{ code: "en-US", content: "Repository name." }] }) +@Parameter({ runtimeName: "pullRequestNumber", name: [{ code: "en-US", content: "Pull request number" }], description: [{ code: "en-US", content: "Number of the pull request." }] }) +@Parameter({ runtimeName: "reviewId", name: [{ code: "en-US", content: "Review ID" }], description: [{ code: "en-US", content: "Identifier of the review." }] }) +@Parameter({ runtimeName: "message", name: [{ code: "en-US", content: "Message" }], description: [{ code: "en-US", content: "Reason the review is dismissed." }] }) export class DismissPullRequestReviewFunction { async run( context: FunctionContext, @@ -23,7 +21,7 @@ export class DismissPullRequestReviewFunction { repository: string, pullRequestNumber: number, reviewId: number, - data: GitHubDismissPullRequestReviewRequest + message: string ): Promise { if (!Number.isInteger(pullRequestNumber) || pullRequestNumber < 1) throw new RuntimeError("GITHUB_INVALID_PULL_REQUEST_NUMBER", "Pull request number must be a positive integer.") @@ -33,7 +31,7 @@ export class DismissPullRequestReviewFunction { const client = createGitHubClient(context) const response = await client.put( `/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repository)}/pulls/${pullRequestNumber}/reviews/${reviewId}/dismissals`, - data + { message, event: "DISMISS" } ) return GitHubPullRequestReviewSchema.parse(response.data) } catch (error) { diff --git a/actions/github-action/src/functions/pullRequestReviews/getPullRequestReviewsFunction.ts b/actions/github-action/src/functions/pullRequestReviews/getPullRequestReviewsFunction.ts index 20e13c8..1fd1460 100644 --- a/actions/github-action/src/functions/pullRequestReviews/getPullRequestReviewsFunction.ts +++ b/actions/github-action/src/functions/pullRequestReviews/getPullRequestReviewsFunction.ts @@ -1,4 +1,4 @@ -import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" +import { Description, DisplayIcon, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" import { GitHubPullRequestReview, GitHubPullRequestReviewSchema } from "../../data_types/pullRequestReviews/githubPullRequestReview.js" import { createGitHubClient, handleGitHubError } from "../../helpers.js" @@ -6,11 +6,26 @@ import { createGitHubClient, handleGitHubError } from "../../helpers.js" @Signature("(owner: string, repository: string, pullRequestNumber: number, page?: number, perPage?: number): GITHUB_PULL_REQUEST_REVIEW[]") @Name({ code: "en-US", content: "Get pull request reviews" }) @DisplayMessage({ code: "en-US", content: "Get GitHub pull request reviews" }) +@DisplayIcon("tabler:brand-github") @Documentation({ code: "en-US", content: "Returns reviews for a pull request." }) @Description({ code: "en-US", content: "Returns GitHub pull request reviews." }) -@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }] }) -@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }] }) -@Parameter({ runtimeName: "pullRequestNumber", name: [{ code: "en-US", content: "Pull request number" }] }) +@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }], description: [{ code: "en-US", content: "Repository owner or organization." }] }) +@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }], description: [{ code: "en-US", content: "Repository name." }] }) +@Parameter({ runtimeName: "pullRequestNumber", name: [{ code: "en-US", content: "Pull request number" }], description: [{ code: "en-US", content: "Number of the pull request." }] }) +@Parameter({ + runtimeName: "page", + name: [{ code: "en-US", content: "Page" }], + description: [{ code: "en-US", content: "Page number to return. Defaults to 1." }], + optional: true, + defaultValue: 1, +}) +@Parameter({ + runtimeName: "perPage", + name: [{ code: "en-US", content: "Results per page" }], + description: [{ code: "en-US", content: "Number of results per page, from 1 to 100. Defaults to 30." }], + optional: true, + defaultValue: 30, +}) export class GetPullRequestReviewsFunction { async run( context: FunctionContext, diff --git a/actions/github-action/src/functions/pullRequestReviews/submitPullRequestReviewFunction.ts b/actions/github-action/src/functions/pullRequestReviews/submitPullRequestReviewFunction.ts index a8e53e6..f331dc4 100644 --- a/actions/github-action/src/functions/pullRequestReviews/submitPullRequestReviewFunction.ts +++ b/actions/github-action/src/functions/pullRequestReviews/submitPullRequestReviewFunction.ts @@ -1,21 +1,31 @@ -import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" +import { Description, DisplayIcon, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" import { GitHubPullRequestReview, GitHubPullRequestReviewSchema } from "../../data_types/pullRequestReviews/githubPullRequestReview.js" -import { GitHubSubmitPullRequestReviewRequest } from "../../data_types/pullRequestReviews/githubPullRequestReviewRequests.js" -import { createGitHubClient, handleGitHubError } from "../../helpers.js" +import { createGitHubClient, handleGitHubError, requestBody } from "../../helpers.js" @Identifier("submitPullRequestReview") @Signature( - "(owner: string, repository: string, pullRequestNumber: number, reviewId: number, data: GITHUB_SUBMIT_PULL_REQUEST_REVIEW_REQUEST): GITHUB_PULL_REQUEST_REVIEW" + '(owner: string, repository: string, pullRequestNumber: number, reviewId: number, event: "APPROVE"|"REQUEST_CHANGES"|"COMMENT", body?: string): GITHUB_PULL_REQUEST_REVIEW' ) @Name({ code: "en-US", content: "Submit pull request review" }) @DisplayMessage({ code: "en-US", content: "Submit GitHub pull request review" }) +@DisplayIcon("tabler:brand-github") @Documentation({ code: "en-US", content: "Submits a pending pull request review." }) @Description({ code: "en-US", content: "Submits a GitHub pull request review." }) -@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }] }) -@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }] }) -@Parameter({ runtimeName: "pullRequestNumber", name: [{ code: "en-US", content: "Pull request number" }] }) -@Parameter({ runtimeName: "reviewId", name: [{ code: "en-US", content: "Review ID" }] }) -@Parameter({ runtimeName: "data", name: [{ code: "en-US", content: "Review submission" }] }) +@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }], description: [{ code: "en-US", content: "Repository owner or organization." }] }) +@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }], description: [{ code: "en-US", content: "Repository name." }] }) +@Parameter({ runtimeName: "pullRequestNumber", name: [{ code: "en-US", content: "Pull request number" }], description: [{ code: "en-US", content: "Number of the pull request." }] }) +@Parameter({ runtimeName: "reviewId", name: [{ code: "en-US", content: "Review ID" }], description: [{ code: "en-US", content: "Identifier of the review." }] }) +@Parameter({ + runtimeName: "event", + name: [{ code: "en-US", content: "Event" }], + description: [{ code: "en-US", content: "Whether the review approves, requests changes, or only comments." }], +}) +@Parameter({ + runtimeName: "body", + name: [{ code: "en-US", content: "Body" }], + description: [{ code: "en-US", content: "Text of the review." }], + optional: true, +}) export class SubmitPullRequestReviewFunction { async run( context: FunctionContext, @@ -23,7 +33,8 @@ export class SubmitPullRequestReviewFunction { repository: string, pullRequestNumber: number, reviewId: number, - data: GitHubSubmitPullRequestReviewRequest + event: "APPROVE" | "REQUEST_CHANGES" | "COMMENT", + body?: string ): Promise { if (!Number.isInteger(pullRequestNumber) || pullRequestNumber < 1) throw new RuntimeError("GITHUB_INVALID_PULL_REQUEST_NUMBER", "Pull request number must be a positive integer.") @@ -33,7 +44,7 @@ export class SubmitPullRequestReviewFunction { const client = createGitHubClient(context) const response = await client.post( `/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repository)}/pulls/${pullRequestNumber}/reviews/${reviewId}/events`, - data + requestBody({ event, body }) ) return GitHubPullRequestReviewSchema.parse(response.data) } catch (error) { diff --git a/actions/github-action/src/functions/pullRequests/closePullRequestFunction.ts b/actions/github-action/src/functions/pullRequests/closePullRequestFunction.ts index 5567843..4e82c74 100644 --- a/actions/github-action/src/functions/pullRequests/closePullRequestFunction.ts +++ b/actions/github-action/src/functions/pullRequests/closePullRequestFunction.ts @@ -1,4 +1,4 @@ -import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" +import { Description, DisplayIcon, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" import { GitHubPullRequest, GitHubPullRequestSchema } from "../../data_types/pullRequests/githubPullRequest.js" import { createGitHubClient, handleGitHubError } from "../../helpers.js" @@ -6,11 +6,12 @@ import { createGitHubClient, handleGitHubError } from "../../helpers.js" @Signature("(owner: string, repository: string, pullRequestNumber: number): GITHUB_PULL_REQUEST") @Name({ code: "en-US", content: "Close pull request" }) @DisplayMessage({ code: "en-US", content: "Close GitHub pull request" }) +@DisplayIcon("tabler:brand-github") @Documentation({ code: "en-US", content: "Closes a GitHub pull request." }) @Description({ code: "en-US", content: "Closes a GitHub pull request." }) -@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }] }) -@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }] }) -@Parameter({ runtimeName: "pullRequestNumber", name: [{ code: "en-US", content: "Pull request number" }] }) +@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }], description: [{ code: "en-US", content: "Repository owner or organization." }] }) +@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }], description: [{ code: "en-US", content: "Repository name." }] }) +@Parameter({ runtimeName: "pullRequestNumber", name: [{ code: "en-US", content: "Pull request number" }], description: [{ code: "en-US", content: "Number of the pull request." }] }) export class ClosePullRequestFunction { async run(context: FunctionContext, owner: string, repository: string, pullRequestNumber: number): Promise { if (!Number.isInteger(pullRequestNumber) || pullRequestNumber < 1) diff --git a/actions/github-action/src/functions/pullRequests/createPullRequestFunction.ts b/actions/github-action/src/functions/pullRequests/createPullRequestFunction.ts index 173bd81..87a4268 100644 --- a/actions/github-action/src/functions/pullRequests/createPullRequestFunction.ts +++ b/actions/github-action/src/functions/pullRequests/createPullRequestFunction.ts @@ -1,12 +1,14 @@ -import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, Signature } from "@code0-tech/hercules" +import { Description, DisplayIcon, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, Signature } from "@code0-tech/hercules" import { GitHubPullRequest, GitHubPullRequestSchema } from "../../data_types/pullRequests/githubPullRequest.js" -import { GitHubCreatePullRequestRequest } from "../../data_types/pullRequests/githubPullRequestRequests.js" -import { createGitHubClient, handleGitHubError } from "../../helpers.js" +import { createGitHubClient, handleGitHubError, requestBody } from "../../helpers.js" @Identifier("createPullRequest") -@Signature("(owner: string, repository: string, data: GITHUB_CREATE_PULL_REQUEST_REQUEST): GITHUB_PULL_REQUEST") +@Signature( + "(owner: string, repository: string, head: string, base: string, title?: string, body?: string, draft?: boolean, maintainerCanModify?: boolean): GITHUB_PULL_REQUEST" +) @Name({ code: "en-US", content: "Create pull request" }) @DisplayMessage({ code: "en-US", content: "Create GitHub pull request" }) +@DisplayIcon("tabler:brand-github") @Documentation({ code: "en-US", content: "Creates a pull request between two existing branches.", @@ -26,15 +28,57 @@ import { createGitHubClient, handleGitHubError } from "../../helpers.js" description: [{ code: "en-US", content: "Repository name." }], }) @Parameter({ - runtimeName: "data", - name: [{ code: "en-US", content: "Pull request" }], - description: [{ code: "en-US", content: "Pull request fields, including the head and base branches." }], + runtimeName: "head", + name: [{ code: "en-US", content: "Source branch" }], + description: [{ code: "en-US", content: "Branch that contains the changes." }], +}) +@Parameter({ + runtimeName: "base", + name: [{ code: "en-US", content: "Target branch" }], + description: [{ code: "en-US", content: "Branch the changes are merged into." }], +}) +@Parameter({ + runtimeName: "title", + name: [{ code: "en-US", content: "Title" }], + description: [{ code: "en-US", content: "Title of the pull request." }], + optional: true, +}) +@Parameter({ + runtimeName: "body", + name: [{ code: "en-US", content: "Body" }], + description: [{ code: "en-US", content: "Description of the pull request." }], + optional: true, +}) +@Parameter({ + runtimeName: "draft", + name: [{ code: "en-US", content: "Draft" }], + description: [{ code: "en-US", content: "Whether the pull request is created as a draft." }], + optional: true, +}) +@Parameter({ + runtimeName: "maintainerCanModify", + name: [{ code: "en-US", content: "Maintainers can modify" }], + description: [{ code: "en-US", content: "Whether maintainers may push to the source branch." }], + optional: true, }) export class CreatePullRequestFunction { - async run(context: FunctionContext, owner: string, repository: string, data: GitHubCreatePullRequestRequest): Promise { + async run( + context: FunctionContext, + owner: string, + repository: string, + head: string, + base: string, + title?: string, + body?: string, + draft?: boolean, + maintainerCanModify?: boolean + ): Promise { try { const client = createGitHubClient(context) - const response = await client.post(`/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repository)}/pulls`, data) + const response = await client.post( + `/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repository)}/pulls`, + requestBody({ head, base, title, body, draft, maintainer_can_modify: maintainerCanModify }) + ) return GitHubPullRequestSchema.parse(response.data) } catch (error) { diff --git a/actions/github-action/src/functions/pullRequests/getPullRequestFunction.ts b/actions/github-action/src/functions/pullRequests/getPullRequestFunction.ts index 9ca8a76..c634d75 100644 --- a/actions/github-action/src/functions/pullRequests/getPullRequestFunction.ts +++ b/actions/github-action/src/functions/pullRequests/getPullRequestFunction.ts @@ -1,4 +1,4 @@ -import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" +import { Description, DisplayIcon, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" import { GitHubPullRequest, GitHubPullRequestSchema } from "../../data_types/pullRequests/githubPullRequest.js" import { createGitHubClient, handleGitHubError } from "../../helpers.js" @@ -6,6 +6,7 @@ import { createGitHubClient, handleGitHubError } from "../../helpers.js" @Signature("(owner: string, repository: string, pullRequestNumber: number): GITHUB_PULL_REQUEST") @Name({ code: "en-US", content: "Get pull request" }) @DisplayMessage({ code: "en-US", content: "Get GitHub pull request" }) +@DisplayIcon("tabler:brand-github") @Documentation({ code: "en-US", content: "Returns a single pull request from a GitHub repository by its repository-local number.", diff --git a/actions/github-action/src/functions/pullRequests/getPullRequestsFunction.ts b/actions/github-action/src/functions/pullRequests/getPullRequestsFunction.ts index 4f6161f..abb318f 100644 --- a/actions/github-action/src/functions/pullRequests/getPullRequestsFunction.ts +++ b/actions/github-action/src/functions/pullRequests/getPullRequestsFunction.ts @@ -1,13 +1,14 @@ -import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" -import { GitHubPullRequest, GitHubPullRequestSchema } from "../../data_types/pullRequests/githubPullRequest.js" +import { Description, DisplayIcon, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" +import { GitHubPullRequestSummary, GitHubPullRequestSummarySchema } from "../../data_types/pullRequests/githubPullRequest.js" import { createGitHubClient, handleGitHubError } from "../../helpers.js" type GitHubPullRequestState = "open" | "closed" | "all" @Identifier("getPullRequests") -@Signature('(owner: string, repository: string, state?: "open"|"closed"|"all", page?: number, perPage?: number): GITHUB_PULL_REQUEST[]') +@Signature('(owner: string, repository: string, state?: "open"|"closed"|"all", page?: number, perPage?: number): GITHUB_PULL_REQUEST_SUMMARY[]') @Name({ code: "en-US", content: "Get pull requests" }) @DisplayMessage({ code: "en-US", content: "Get GitHub pull requests" }) +@DisplayIcon("tabler:brand-github") @Documentation({ code: "en-US", content: "Returns a page of pull requests from a GitHub repository.", @@ -30,16 +31,22 @@ type GitHubPullRequestState = "open" | "closed" | "all" runtimeName: "state", name: [{ code: "en-US", content: "State" }], description: [{ code: "en-US", content: "Filter by open, closed, or all pull requests. Defaults to open." }], + optional: true, + defaultValue: "open", }) @Parameter({ runtimeName: "page", name: [{ code: "en-US", content: "Page" }], description: [{ code: "en-US", content: "Page number to return. Defaults to 1." }], + optional: true, + defaultValue: 1, }) @Parameter({ runtimeName: "perPage", name: [{ code: "en-US", content: "Results per page" }], description: [{ code: "en-US", content: "Number of results per page, from 1 to 100. Defaults to 30." }], + optional: true, + defaultValue: 30, }) export class GetPullRequestsFunction { async run( @@ -49,7 +56,7 @@ export class GetPullRequestsFunction { state: GitHubPullRequestState = "open", page = 1, perPage = 30 - ): Promise { + ): Promise { if (!Number.isInteger(page) || page < 1) { throw new RuntimeError("GITHUB_INVALID_PAGE", "Page must be a positive integer.") } @@ -67,7 +74,7 @@ export class GetPullRequestsFunction { }, }) - return GitHubPullRequestSchema.array().parse(response.data) + return GitHubPullRequestSummarySchema.array().parse(response.data) } catch (error) { return handleGitHubError(error) } diff --git a/actions/github-action/src/functions/pullRequests/mergePullRequestFunction.ts b/actions/github-action/src/functions/pullRequests/mergePullRequestFunction.ts index 946f6fb..9685032 100644 --- a/actions/github-action/src/functions/pullRequests/mergePullRequestFunction.ts +++ b/actions/github-action/src/functions/pullRequests/mergePullRequestFunction.ts @@ -1,33 +1,62 @@ -import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" -import { - GitHubPullRequestMergeRequest, - GitHubPullRequestMergeResult, - GitHubPullRequestMergeResultSchema, -} from "../../data_types/pullRequests/githubPullRequestMergeRequest.js" -import { createGitHubClient, handleGitHubError } from "../../helpers.js" +import { Description, DisplayIcon, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" +import { GitHubPullRequestMergeResult, GitHubPullRequestMergeResultSchema } from "../../data_types/pullRequests/githubPullRequestMergeResult.js" +import { createGitHubClient, handleGitHubError, requestBody } from "../../helpers.js" @Identifier("mergePullRequest") -@Signature("(owner: string, repository: string, pullRequestNumber: number, data?: GITHUB_PULL_REQUEST_MERGE_REQUEST): GITHUB_PULL_REQUEST_MERGE_RESULT") +@Signature( + '(owner: string, repository: string, pullRequestNumber: number, mergeMethod?: "merge"|"squash"|"rebase", commitTitle?: string, commitMessage?: string, sha?: string): GITHUB_PULL_REQUEST_MERGE_RESULT' +) @Name({ code: "en-US", content: "Merge pull request" }) @DisplayMessage({ code: "en-US", content: "Merge GitHub pull request" }) +@DisplayIcon("tabler:brand-github") @Documentation({ code: "en-US", content: "Merges a GitHub pull request." }) @Description({ code: "en-US", content: "Merges a GitHub pull request." }) -@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }] }) -@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }] }) -@Parameter({ runtimeName: "pullRequestNumber", name: [{ code: "en-US", content: "Pull request number" }] }) +@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }], description: [{ code: "en-US", content: "Repository owner or organization." }] }) +@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }], description: [{ code: "en-US", content: "Repository name." }] }) +@Parameter({ runtimeName: "pullRequestNumber", name: [{ code: "en-US", content: "Pull request number" }], description: [{ code: "en-US", content: "Number of the pull request." }] }) +@Parameter({ + runtimeName: "mergeMethod", + name: [{ code: "en-US", content: "Merge method" }], + description: [{ code: "en-US", content: "How the pull request is merged." }], + optional: true, +}) +@Parameter({ + runtimeName: "commitTitle", + name: [{ code: "en-US", content: "Commit title" }], + description: [{ code: "en-US", content: "Title of the merge commit." }], + optional: true, +}) +@Parameter({ + runtimeName: "commitMessage", + name: [{ code: "en-US", content: "Commit message" }], + description: [{ code: "en-US", content: "Message appended to the merge commit." }], + optional: true, +}) +@Parameter({ + runtimeName: "sha", + name: [{ code: "en-US", content: "Expected SHA" }], + description: [{ code: "en-US", content: "SHA the source branch must point at for the merge to run." }], + optional: true, +}) export class MergePullRequestFunction { async run( context: FunctionContext, owner: string, repository: string, pullRequestNumber: number, - data: GitHubPullRequestMergeRequest = {} + mergeMethod?: "merge" | "squash" | "rebase", + commitTitle?: string, + commitMessage?: string, + sha?: string ): Promise { if (!Number.isInteger(pullRequestNumber) || pullRequestNumber < 1) throw new RuntimeError("GITHUB_INVALID_PULL_REQUEST_NUMBER", "Pull request number must be a positive integer.") try { const client = createGitHubClient(context) - const response = await client.put(`/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repository)}/pulls/${pullRequestNumber}/merge`, data) + const response = await client.put( + `/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repository)}/pulls/${pullRequestNumber}/merge`, + requestBody({ merge_method: mergeMethod, commit_title: commitTitle, commit_message: commitMessage, sha }) + ) return GitHubPullRequestMergeResultSchema.parse(response.data) } catch (error) { return handleGitHubError(error) diff --git a/actions/github-action/src/functions/pullRequests/reopenPullRequestFunction.ts b/actions/github-action/src/functions/pullRequests/reopenPullRequestFunction.ts index 6ae2408..a3a75eb 100644 --- a/actions/github-action/src/functions/pullRequests/reopenPullRequestFunction.ts +++ b/actions/github-action/src/functions/pullRequests/reopenPullRequestFunction.ts @@ -1,4 +1,4 @@ -import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" +import { Description, DisplayIcon, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" import { GitHubPullRequest, GitHubPullRequestSchema } from "../../data_types/pullRequests/githubPullRequest.js" import { createGitHubClient, handleGitHubError } from "../../helpers.js" @@ -6,11 +6,12 @@ import { createGitHubClient, handleGitHubError } from "../../helpers.js" @Signature("(owner: string, repository: string, pullRequestNumber: number): GITHUB_PULL_REQUEST") @Name({ code: "en-US", content: "Reopen pull request" }) @DisplayMessage({ code: "en-US", content: "Reopen GitHub pull request" }) +@DisplayIcon("tabler:brand-github") @Documentation({ code: "en-US", content: "Reopens a GitHub pull request." }) @Description({ code: "en-US", content: "Reopens a GitHub pull request." }) -@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }] }) -@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }] }) -@Parameter({ runtimeName: "pullRequestNumber", name: [{ code: "en-US", content: "Pull request number" }] }) +@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }], description: [{ code: "en-US", content: "Repository owner or organization." }] }) +@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }], description: [{ code: "en-US", content: "Repository name." }] }) +@Parameter({ runtimeName: "pullRequestNumber", name: [{ code: "en-US", content: "Pull request number" }], description: [{ code: "en-US", content: "Number of the pull request." }] }) export class ReopenPullRequestFunction { async run(context: FunctionContext, owner: string, repository: string, pullRequestNumber: number): Promise { if (!Number.isInteger(pullRequestNumber) || pullRequestNumber < 1) diff --git a/actions/github-action/src/functions/pullRequests/updatePullRequestFunction.ts b/actions/github-action/src/functions/pullRequests/updatePullRequestFunction.ts index dd0f422..9656367 100644 --- a/actions/github-action/src/functions/pullRequests/updatePullRequestFunction.ts +++ b/actions/github-action/src/functions/pullRequests/updatePullRequestFunction.ts @@ -1,15 +1,17 @@ -import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" +import { Description, DisplayIcon, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" import { GitHubPullRequest, GitHubPullRequestSchema } from "../../data_types/pullRequests/githubPullRequest.js" -import { GitHubUpdatePullRequestRequest } from "../../data_types/pullRequests/githubPullRequestRequests.js" -import { createGitHubClient, handleGitHubError } from "../../helpers.js" +import { createGitHubClient, handleGitHubError, requestBody } from "../../helpers.js" @Identifier("updatePullRequest") -@Signature("(owner: string, repository: string, pullRequestNumber: number, data: GITHUB_UPDATE_PULL_REQUEST_REQUEST): GITHUB_PULL_REQUEST") +@Signature( + '(owner: string, repository: string, pullRequestNumber: number, title?: string, body?: string, state?: "open"|"closed", base?: string, maintainerCanModify?: boolean): GITHUB_PULL_REQUEST' +) @Name({ code: "en-US", content: "Update pull request" }) @DisplayMessage({ code: "en-US", content: "Update GitHub pull request" }) +@DisplayIcon("tabler:brand-github") @Documentation({ code: "en-US", - content: "Updates or closes a pull request in a GitHub repository.", + content: "Updates or closes a pull request in a GitHub repository. Fields that are left empty keep their current value.", }) @Description({ code: "en-US", @@ -31,9 +33,34 @@ import { createGitHubClient, handleGitHubError } from "../../helpers.js" description: [{ code: "en-US", content: "Repository-local pull request number." }], }) @Parameter({ - runtimeName: "data", - name: [{ code: "en-US", content: "Pull request updates" }], - description: [{ code: "en-US", content: "Pull request fields to update." }], + runtimeName: "title", + name: [{ code: "en-US", content: "Title" }], + description: [{ code: "en-US", content: "New title of the pull request." }], + optional: true, +}) +@Parameter({ + runtimeName: "body", + name: [{ code: "en-US", content: "Body" }], + description: [{ code: "en-US", content: "New description of the pull request." }], + optional: true, +}) +@Parameter({ + runtimeName: "state", + name: [{ code: "en-US", content: "State" }], + description: [{ code: "en-US", content: "Whether the pull request is open or closed." }], + optional: true, +}) +@Parameter({ + runtimeName: "base", + name: [{ code: "en-US", content: "Target branch" }], + description: [{ code: "en-US", content: "Branch the changes are merged into." }], + optional: true, +}) +@Parameter({ + runtimeName: "maintainerCanModify", + name: [{ code: "en-US", content: "Maintainers can modify" }], + description: [{ code: "en-US", content: "Whether maintainers may push to the source branch." }], + optional: true, }) export class UpdatePullRequestFunction { async run( @@ -41,7 +68,11 @@ export class UpdatePullRequestFunction { owner: string, repository: string, pullRequestNumber: number, - data: GitHubUpdatePullRequestRequest + title?: string, + body?: string, + state?: "open" | "closed", + base?: string, + maintainerCanModify?: boolean ): Promise { if (!Number.isInteger(pullRequestNumber) || pullRequestNumber < 1) { throw new RuntimeError("GITHUB_INVALID_PULL_REQUEST_NUMBER", "Pull request number must be a positive integer.") @@ -49,7 +80,10 @@ export class UpdatePullRequestFunction { try { const client = createGitHubClient(context) - const response = await client.patch(`/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repository)}/pulls/${pullRequestNumber}`, data) + const response = await client.patch( + `/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repository)}/pulls/${pullRequestNumber}`, + requestBody({ title, body, state, base, maintainer_can_modify: maintainerCanModify }) + ) return GitHubPullRequestSchema.parse(response.data) } catch (error) { diff --git a/actions/github-action/src/functions/releases/createReleaseFunction.ts b/actions/github-action/src/functions/releases/createReleaseFunction.ts index d9c0e9e..0eaf3d2 100644 --- a/actions/github-action/src/functions/releases/createReleaseFunction.ts +++ b/actions/github-action/src/functions/releases/createReleaseFunction.ts @@ -1,22 +1,98 @@ -import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, Signature } from "@code0-tech/hercules" +import { Description, DisplayIcon, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, Signature } from "@code0-tech/hercules" import { GitHubRelease, GitHubReleaseSchema } from "../../data_types/releases/githubRelease.js" -import { GitHubCreateReleaseRequest } from "../../data_types/releases/githubReleaseRequests.js" -import { createGitHubClient, handleGitHubError } from "../../helpers.js" +import { createGitHubClient, handleGitHubError, requestBody } from "../../helpers.js" @Identifier("createRelease") -@Signature("(owner: string, repository: string, data: GITHUB_CREATE_RELEASE_REQUEST): GITHUB_RELEASE") +@Signature( + '(owner: string, repository: string, tagName: string, name?: string, body?: string, targetCommitish?: string, draft?: boolean, prerelease?: boolean, generateReleaseNotes?: boolean, discussionCategoryName?: string, makeLatest?: "true"|"false"|"legacy"): GITHUB_RELEASE' +) @Name({ code: "en-US", content: "Create release" }) @DisplayMessage({ code: "en-US", content: "Create GitHub release" }) +@DisplayIcon("tabler:brand-github") @Documentation({ code: "en-US", content: "Creates a GitHub release." }) @Description({ code: "en-US", content: "Creates a GitHub release." }) -@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }] }) -@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }] }) -@Parameter({ runtimeName: "data", name: [{ code: "en-US", content: "Release" }] }) +@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }], description: [{ code: "en-US", content: "Repository owner or organization." }] }) +@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }], description: [{ code: "en-US", content: "Repository name." }] }) +@Parameter({ runtimeName: "tagName", name: [{ code: "en-US", content: "Tag" }], description: [{ code: "en-US", content: "Name of the tag for the release." }] }) +@Parameter({ + runtimeName: "name", + name: [{ code: "en-US", content: "Name" }], + description: [{ code: "en-US", content: "Title of the release." }], + optional: true, +}) +@Parameter({ + runtimeName: "body", + name: [{ code: "en-US", content: "Body" }], + description: [{ code: "en-US", content: "Release notes." }], + optional: true, +}) +@Parameter({ + runtimeName: "targetCommitish", + name: [{ code: "en-US", content: "Target" }], + description: [{ code: "en-US", content: "Branch or commit the tag is created from. Defaults to the default branch." }], + optional: true, +}) +@Parameter({ + runtimeName: "draft", + name: [{ code: "en-US", content: "Draft" }], + description: [{ code: "en-US", content: "Whether the release is kept as an unpublished draft." }], + optional: true, +}) +@Parameter({ + runtimeName: "prerelease", + name: [{ code: "en-US", content: "Pre-release" }], + description: [{ code: "en-US", content: "Whether the release is marked as a pre-release." }], + optional: true, +}) +@Parameter({ + runtimeName: "generateReleaseNotes", + name: [{ code: "en-US", content: "Generate release notes" }], + description: [{ code: "en-US", content: "Whether GitHub generates the release notes automatically." }], + optional: true, +}) +@Parameter({ + runtimeName: "discussionCategoryName", + name: [{ code: "en-US", content: "Discussion category" }], + description: [{ code: "en-US", content: "Name of the discussion category a release discussion is created in." }], + optional: true, +}) +@Parameter({ + runtimeName: "makeLatest", + name: [{ code: "en-US", content: "Mark as latest" }], + description: [{ code: "en-US", content: "Whether the release is marked as the latest one." }], + optional: true, +}) export class CreateReleaseFunction { - async run(context: FunctionContext, owner: string, repository: string, data: GitHubCreateReleaseRequest): Promise { + async run( + context: FunctionContext, + owner: string, + repository: string, + tagName: string, + name?: string, + body?: string, + targetCommitish?: string, + draft?: boolean, + prerelease?: boolean, + generateReleaseNotes?: boolean, + discussionCategoryName?: string, + makeLatest?: "true" | "false" | "legacy" + ): Promise { try { const client = createGitHubClient(context) - const response = await client.post(`/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repository)}/releases`, data) + const response = await client.post( + `/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repository)}/releases`, + requestBody({ + tag_name: tagName, + name, + body, + target_commitish: targetCommitish, + draft, + prerelease, + generate_release_notes: generateReleaseNotes, + discussion_category_name: discussionCategoryName, + make_latest: makeLatest, + }) + ) return GitHubReleaseSchema.parse(response.data) } catch (error) { return handleGitHubError(error) diff --git a/actions/github-action/src/functions/releases/deleteReleaseFunction.ts b/actions/github-action/src/functions/releases/deleteReleaseFunction.ts index d1da4b4..a4e4013 100644 --- a/actions/github-action/src/functions/releases/deleteReleaseFunction.ts +++ b/actions/github-action/src/functions/releases/deleteReleaseFunction.ts @@ -1,15 +1,16 @@ -import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" +import { Description, DisplayIcon, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" import { createGitHubClient, handleGitHubError } from "../../helpers.js" @Identifier("deleteRelease") @Signature("(owner: string, repository: string, releaseId: number): void") @Name({ code: "en-US", content: "Delete release" }) @DisplayMessage({ code: "en-US", content: "Delete GitHub release" }) +@DisplayIcon("tabler:brand-github") @Documentation({ code: "en-US", content: "Deletes a GitHub release." }) @Description({ code: "en-US", content: "Deletes a GitHub release." }) -@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }] }) -@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }] }) -@Parameter({ runtimeName: "releaseId", name: [{ code: "en-US", content: "Release ID" }] }) +@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }], description: [{ code: "en-US", content: "Repository owner or organization." }] }) +@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }], description: [{ code: "en-US", content: "Repository name." }] }) +@Parameter({ runtimeName: "releaseId", name: [{ code: "en-US", content: "Release ID" }], description: [{ code: "en-US", content: "Identifier of the release." }] }) export class DeleteReleaseFunction { async run(context: FunctionContext, owner: string, repository: string, releaseId: number): Promise { if (!Number.isInteger(releaseId) || releaseId < 1) throw new RuntimeError("GITHUB_INVALID_RELEASE_ID", "Release ID must be a positive integer.") diff --git a/actions/github-action/src/functions/releases/getReleaseFunction.ts b/actions/github-action/src/functions/releases/getReleaseFunction.ts index 7b2a2a6..031409b 100644 --- a/actions/github-action/src/functions/releases/getReleaseFunction.ts +++ b/actions/github-action/src/functions/releases/getReleaseFunction.ts @@ -1,4 +1,4 @@ -import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" +import { Description, DisplayIcon, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" import { GitHubRelease, GitHubReleaseSchema } from "../../data_types/releases/githubRelease.js" import { createGitHubClient, handleGitHubError } from "../../helpers.js" @@ -6,11 +6,12 @@ import { createGitHubClient, handleGitHubError } from "../../helpers.js" @Signature("(owner: string, repository: string, releaseId: number): GITHUB_RELEASE") @Name({ code: "en-US", content: "Get release" }) @DisplayMessage({ code: "en-US", content: "Get GitHub release" }) +@DisplayIcon("tabler:brand-github") @Documentation({ code: "en-US", content: "Returns a GitHub release." }) @Description({ code: "en-US", content: "Returns a GitHub release." }) -@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }] }) -@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }] }) -@Parameter({ runtimeName: "releaseId", name: [{ code: "en-US", content: "Release ID" }] }) +@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }], description: [{ code: "en-US", content: "Repository owner or organization." }] }) +@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }], description: [{ code: "en-US", content: "Repository name." }] }) +@Parameter({ runtimeName: "releaseId", name: [{ code: "en-US", content: "Release ID" }], description: [{ code: "en-US", content: "Identifier of the release." }] }) export class GetReleaseFunction { async run(context: FunctionContext, owner: string, repository: string, releaseId: number): Promise { if (!Number.isInteger(releaseId) || releaseId < 1) throw new RuntimeError("GITHUB_INVALID_RELEASE_ID", "Release ID must be a positive integer.") diff --git a/actions/github-action/src/functions/releases/getReleasesFunction.ts b/actions/github-action/src/functions/releases/getReleasesFunction.ts index 7623e5e..b389e52 100644 --- a/actions/github-action/src/functions/releases/getReleasesFunction.ts +++ b/actions/github-action/src/functions/releases/getReleasesFunction.ts @@ -1,4 +1,4 @@ -import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" +import { Description, DisplayIcon, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" import { GitHubRelease, GitHubReleaseSchema } from "../../data_types/releases/githubRelease.js" import { createGitHubClient, handleGitHubError } from "../../helpers.js" @@ -6,10 +6,25 @@ import { createGitHubClient, handleGitHubError } from "../../helpers.js" @Signature("(owner: string, repository: string, page?: number, perPage?: number): GITHUB_RELEASE[]") @Name({ code: "en-US", content: "Get releases" }) @DisplayMessage({ code: "en-US", content: "Get GitHub releases" }) +@DisplayIcon("tabler:brand-github") @Documentation({ code: "en-US", content: "Returns releases from a GitHub repository." }) @Description({ code: "en-US", content: "Returns GitHub releases." }) -@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }] }) -@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }] }) +@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }], description: [{ code: "en-US", content: "Repository owner or organization." }] }) +@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }], description: [{ code: "en-US", content: "Repository name." }] }) +@Parameter({ + runtimeName: "page", + name: [{ code: "en-US", content: "Page" }], + description: [{ code: "en-US", content: "Page number to return. Defaults to 1." }], + optional: true, + defaultValue: 1, +}) +@Parameter({ + runtimeName: "perPage", + name: [{ code: "en-US", content: "Results per page" }], + description: [{ code: "en-US", content: "Number of results per page, from 1 to 100. Defaults to 30." }], + optional: true, + defaultValue: 30, +}) export class GetReleasesFunction { async run(context: FunctionContext, owner: string, repository: string, page = 1, perPage = 30): Promise { if (!Number.isInteger(page) || page < 1) throw new RuntimeError("GITHUB_INVALID_PAGE", "Page must be a positive integer.") diff --git a/actions/github-action/src/functions/releases/updateReleaseFunction.ts b/actions/github-action/src/functions/releases/updateReleaseFunction.ts index f978912..a8f2a2b 100644 --- a/actions/github-action/src/functions/releases/updateReleaseFunction.ts +++ b/actions/github-action/src/functions/releases/updateReleaseFunction.ts @@ -1,24 +1,98 @@ -import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" +import { Description, DisplayIcon, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" import { GitHubRelease, GitHubReleaseSchema } from "../../data_types/releases/githubRelease.js" -import { GitHubUpdateReleaseRequest } from "../../data_types/releases/githubReleaseRequests.js" -import { createGitHubClient, handleGitHubError } from "../../helpers.js" +import { createGitHubClient, handleGitHubError, requestBody } from "../../helpers.js" @Identifier("updateRelease") -@Signature("(owner: string, repository: string, releaseId: number, data: GITHUB_UPDATE_RELEASE_REQUEST): GITHUB_RELEASE") +@Signature( + '(owner: string, repository: string, releaseId: number, tagName?: string, name?: string, body?: string, targetCommitish?: string, draft?: boolean, prerelease?: boolean, discussionCategoryName?: string, makeLatest?: "true"|"false"|"legacy"): GITHUB_RELEASE' +) @Name({ code: "en-US", content: "Update release" }) @DisplayMessage({ code: "en-US", content: "Update GitHub release" }) -@Documentation({ code: "en-US", content: "Updates a GitHub release." }) +@DisplayIcon("tabler:brand-github") +@Documentation({ code: "en-US", content: "Updates a GitHub release. Fields that are left empty keep their current value." }) @Description({ code: "en-US", content: "Updates a GitHub release." }) -@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }] }) -@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }] }) -@Parameter({ runtimeName: "releaseId", name: [{ code: "en-US", content: "Release ID" }] }) -@Parameter({ runtimeName: "data", name: [{ code: "en-US", content: "Release updates" }] }) +@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }], description: [{ code: "en-US", content: "Repository owner or organization." }] }) +@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }], description: [{ code: "en-US", content: "Repository name." }] }) +@Parameter({ runtimeName: "releaseId", name: [{ code: "en-US", content: "Release ID" }], description: [{ code: "en-US", content: "Identifier of the release." }] }) +@Parameter({ + runtimeName: "tagName", + name: [{ code: "en-US", content: "Tag" }], + description: [{ code: "en-US", content: "Name of the tag for the release." }], + optional: true, +}) +@Parameter({ + runtimeName: "name", + name: [{ code: "en-US", content: "Name" }], + description: [{ code: "en-US", content: "Title of the release." }], + optional: true, +}) +@Parameter({ + runtimeName: "body", + name: [{ code: "en-US", content: "Body" }], + description: [{ code: "en-US", content: "Release notes." }], + optional: true, +}) +@Parameter({ + runtimeName: "targetCommitish", + name: [{ code: "en-US", content: "Target" }], + description: [{ code: "en-US", content: "Branch or commit the tag points at." }], + optional: true, +}) +@Parameter({ + runtimeName: "draft", + name: [{ code: "en-US", content: "Draft" }], + description: [{ code: "en-US", content: "Whether the release is kept as an unpublished draft." }], + optional: true, +}) +@Parameter({ + runtimeName: "prerelease", + name: [{ code: "en-US", content: "Pre-release" }], + description: [{ code: "en-US", content: "Whether the release is marked as a pre-release." }], + optional: true, +}) +@Parameter({ + runtimeName: "discussionCategoryName", + name: [{ code: "en-US", content: "Discussion category" }], + description: [{ code: "en-US", content: "Name of the discussion category a release discussion is created in." }], + optional: true, +}) +@Parameter({ + runtimeName: "makeLatest", + name: [{ code: "en-US", content: "Mark as latest" }], + description: [{ code: "en-US", content: "Whether the release is marked as the latest one." }], + optional: true, +}) export class UpdateReleaseFunction { - async run(context: FunctionContext, owner: string, repository: string, releaseId: number, data: GitHubUpdateReleaseRequest): Promise { + async run( + context: FunctionContext, + owner: string, + repository: string, + releaseId: number, + tagName?: string, + name?: string, + body?: string, + targetCommitish?: string, + draft?: boolean, + prerelease?: boolean, + discussionCategoryName?: string, + makeLatest?: "true" | "false" | "legacy" + ): Promise { if (!Number.isInteger(releaseId) || releaseId < 1) throw new RuntimeError("GITHUB_INVALID_RELEASE_ID", "Release ID must be a positive integer.") try { const client = createGitHubClient(context) - const response = await client.patch(`/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repository)}/releases/${releaseId}`, data) + const response = await client.patch( + `/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repository)}/releases/${releaseId}`, + requestBody({ + tag_name: tagName, + name, + body, + target_commitish: targetCommitish, + draft, + prerelease, + discussion_category_name: discussionCategoryName, + make_latest: makeLatest, + }) + ) return GitHubReleaseSchema.parse(response.data) } catch (error) { return handleGitHubError(error) diff --git a/actions/github-action/src/functions/repositories/createBranchFunction.ts b/actions/github-action/src/functions/repositories/createBranchFunction.ts index f668074..95d93ba 100644 --- a/actions/github-action/src/functions/repositories/createBranchFunction.ts +++ b/actions/github-action/src/functions/repositories/createBranchFunction.ts @@ -1,23 +1,24 @@ -import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, Signature } from "@code0-tech/hercules" -import { GitHubCreateBranchRequest } from "../../data_types/repositories/githubBranchRequests.js" +import { Description, DisplayIcon, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, Signature } from "@code0-tech/hercules" import { createGitHubClient, handleGitHubError } from "../../helpers.js" @Identifier("createBranch") -@Signature("(owner: string, repository: string, data: GITHUB_CREATE_BRANCH_REQUEST): void") +@Signature("(owner: string, repository: string, branch: string, sha: string): void") @Name({ code: "en-US", content: "Create branch" }) @DisplayMessage({ code: "en-US", content: "Create GitHub branch" }) +@DisplayIcon("tabler:brand-github") @Documentation({ code: "en-US", content: "Creates a GitHub branch from a commit SHA." }) @Description({ code: "en-US", content: "Creates a GitHub branch." }) -@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }] }) -@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }] }) -@Parameter({ runtimeName: "data", name: [{ code: "en-US", content: "Branch" }] }) +@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }], description: [{ code: "en-US", content: "Repository owner or organization." }] }) +@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }], description: [{ code: "en-US", content: "Repository name." }] }) +@Parameter({ runtimeName: "branch", name: [{ code: "en-US", content: "Branch" }], description: [{ code: "en-US", content: "Name of the new branch." }] }) +@Parameter({ runtimeName: "sha", name: [{ code: "en-US", content: "SHA" }], description: [{ code: "en-US", content: "Commit SHA the branch starts from." }] }) export class CreateBranchFunction { - async run(context: FunctionContext, owner: string, repository: string, data: GitHubCreateBranchRequest): Promise { + async run(context: FunctionContext, owner: string, repository: string, branch: string, sha: string): Promise { try { const client = createGitHubClient(context) await client.post(`/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repository)}/git/refs`, { - ref: `refs/heads/${data.branch}`, - sha: data.sha, + ref: `refs/heads/${branch}`, + sha, }) } catch (error) { return handleGitHubError(error) diff --git a/actions/github-action/src/functions/repositories/deleteBranchFunction.ts b/actions/github-action/src/functions/repositories/deleteBranchFunction.ts index fe06420..fe3269f 100644 --- a/actions/github-action/src/functions/repositories/deleteBranchFunction.ts +++ b/actions/github-action/src/functions/repositories/deleteBranchFunction.ts @@ -1,15 +1,16 @@ -import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, Signature } from "@code0-tech/hercules" +import { Description, DisplayIcon, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, Signature } from "@code0-tech/hercules" import { createGitHubClient, handleGitHubError } from "../../helpers.js" @Identifier("deleteBranch") @Signature("(owner: string, repository: string, branch: string): void") @Name({ code: "en-US", content: "Delete branch" }) @DisplayMessage({ code: "en-US", content: "Delete GitHub branch" }) +@DisplayIcon("tabler:brand-github") @Documentation({ code: "en-US", content: "Deletes a GitHub branch ref." }) @Description({ code: "en-US", content: "Deletes a GitHub branch." }) -@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }] }) -@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }] }) -@Parameter({ runtimeName: "branch", name: [{ code: "en-US", content: "Branch" }] }) +@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }], description: [{ code: "en-US", content: "Repository owner or organization." }] }) +@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }], description: [{ code: "en-US", content: "Repository name." }] }) +@Parameter({ runtimeName: "branch", name: [{ code: "en-US", content: "Branch" }], description: [{ code: "en-US", content: "Name of the branch." }] }) export class DeleteBranchFunction { async run(context: FunctionContext, owner: string, repository: string, branch: string): Promise { try { diff --git a/actions/github-action/src/functions/repositories/getBranchFunction.ts b/actions/github-action/src/functions/repositories/getBranchFunction.ts index ca0c61a..fb811f3 100644 --- a/actions/github-action/src/functions/repositories/getBranchFunction.ts +++ b/actions/github-action/src/functions/repositories/getBranchFunction.ts @@ -1,4 +1,4 @@ -import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, Signature } from "@code0-tech/hercules" +import { Description, DisplayIcon, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, Signature } from "@code0-tech/hercules" import { GitHubRepositoryBranch, GitHubRepositoryBranchSchema } from "../../data_types/repositories/githubRepositoryBranch.js" import { createGitHubClient, handleGitHubError } from "../../helpers.js" @@ -6,11 +6,12 @@ import { createGitHubClient, handleGitHubError } from "../../helpers.js" @Signature("(owner: string, repository: string, branch: string): GITHUB_REPOSITORY_BRANCH") @Name({ code: "en-US", content: "Get branch" }) @DisplayMessage({ code: "en-US", content: "Get GitHub branch" }) +@DisplayIcon("tabler:brand-github") @Documentation({ code: "en-US", content: "Returns a branch from a GitHub repository." }) @Description({ code: "en-US", content: "Returns a GitHub branch." }) -@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }] }) -@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }] }) -@Parameter({ runtimeName: "branch", name: [{ code: "en-US", content: "Branch" }] }) +@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }], description: [{ code: "en-US", content: "Repository owner or organization." }] }) +@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }], description: [{ code: "en-US", content: "Repository name." }] }) +@Parameter({ runtimeName: "branch", name: [{ code: "en-US", content: "Branch" }], description: [{ code: "en-US", content: "Name of the branch." }] }) export class GetBranchFunction { async run(context: FunctionContext, owner: string, repository: string, branch: string): Promise { try { diff --git a/actions/github-action/src/functions/repositories/getCommitFunction.ts b/actions/github-action/src/functions/repositories/getCommitFunction.ts index 4c0af63..26cb9f7 100644 --- a/actions/github-action/src/functions/repositories/getCommitFunction.ts +++ b/actions/github-action/src/functions/repositories/getCommitFunction.ts @@ -1,4 +1,4 @@ -import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, Signature } from "@code0-tech/hercules" +import { Description, DisplayIcon, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, Signature } from "@code0-tech/hercules" import { GitHubCommit, GitHubCommitSchema } from "../../data_types/repositories/githubCommit.js" import { createGitHubClient, handleGitHubError } from "../../helpers.js" @@ -6,11 +6,12 @@ import { createGitHubClient, handleGitHubError } from "../../helpers.js" @Signature("(owner: string, repository: string, ref: string): GITHUB_COMMIT") @Name({ code: "en-US", content: "Get commit" }) @DisplayMessage({ code: "en-US", content: "Get GitHub commit" }) +@DisplayIcon("tabler:brand-github") @Documentation({ code: "en-US", content: "Returns a commit by SHA, branch, or tag." }) @Description({ code: "en-US", content: "Returns a GitHub commit." }) -@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }] }) -@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }] }) -@Parameter({ runtimeName: "ref", name: [{ code: "en-US", content: "Ref" }] }) +@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }], description: [{ code: "en-US", content: "Repository owner or organization." }] }) +@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }], description: [{ code: "en-US", content: "Repository name." }] }) +@Parameter({ runtimeName: "ref", name: [{ code: "en-US", content: "Ref" }], description: [{ code: "en-US", content: "Name of the branch to create." }] }) export class GetCommitFunction { async run(context: FunctionContext, owner: string, repository: string, ref: string): Promise { try { diff --git a/actions/github-action/src/functions/repositories/getCommitsFunction.ts b/actions/github-action/src/functions/repositories/getCommitsFunction.ts index 6631132..930d720 100644 --- a/actions/github-action/src/functions/repositories/getCommitsFunction.ts +++ b/actions/github-action/src/functions/repositories/getCommitsFunction.ts @@ -1,4 +1,4 @@ -import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" +import { Description, DisplayIcon, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" import { GitHubCommit, GitHubCommitSchema } from "../../data_types/repositories/githubCommit.js" import { createGitHubClient, handleGitHubError } from "../../helpers.js" @@ -6,11 +6,26 @@ import { createGitHubClient, handleGitHubError } from "../../helpers.js" @Signature("(owner: string, repository: string, sha?: string, page?: number, perPage?: number): GITHUB_COMMIT[]") @Name({ code: "en-US", content: "Get commits" }) @DisplayMessage({ code: "en-US", content: "Get GitHub commits" }) +@DisplayIcon("tabler:brand-github") @Documentation({ code: "en-US", content: "Returns commits from a GitHub repository." }) @Description({ code: "en-US", content: "Returns GitHub commits." }) -@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }] }) -@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }] }) -@Parameter({ runtimeName: "sha", name: [{ code: "en-US", content: "SHA or branch" }] }) +@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }], description: [{ code: "en-US", content: "Repository owner or organization." }] }) +@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }], description: [{ code: "en-US", content: "Repository name." }] }) +@Parameter({ runtimeName: "sha", name: [{ code: "en-US", content: "SHA or branch" }], description: [{ code: "en-US", content: "Commit SHA the branch points at." }], optional: true }) +@Parameter({ + runtimeName: "page", + name: [{ code: "en-US", content: "Page" }], + description: [{ code: "en-US", content: "Page number to return. Defaults to 1." }], + optional: true, + defaultValue: 1, +}) +@Parameter({ + runtimeName: "perPage", + name: [{ code: "en-US", content: "Results per page" }], + description: [{ code: "en-US", content: "Number of results per page, from 1 to 100. Defaults to 30." }], + optional: true, + defaultValue: 30, +}) export class GetCommitsFunction { async run(context: FunctionContext, owner: string, repository: string, sha?: string, page = 1, perPage = 30): Promise { if (!Number.isInteger(page) || page < 1) throw new RuntimeError("GITHUB_INVALID_PAGE", "Page must be a positive integer.") diff --git a/actions/github-action/src/functions/repositories/getRepositoryBranchesFunction.ts b/actions/github-action/src/functions/repositories/getRepositoryBranchesFunction.ts index 395d407..b780c07 100644 --- a/actions/github-action/src/functions/repositories/getRepositoryBranchesFunction.ts +++ b/actions/github-action/src/functions/repositories/getRepositoryBranchesFunction.ts @@ -1,17 +1,32 @@ -import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" -import { GitHubRepositoryBranch, GitHubRepositoryBranchSchema } from "../../data_types/repositories/githubRepositoryBranch.js" +import { Description, DisplayIcon, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, RuntimeError, Signature } from "@code0-tech/hercules" +import { GitHubRepositoryBranchSummary, GitHubRepositoryBranchSummarySchema } from "../../data_types/repositories/githubRepositoryBranch.js" import { createGitHubClient, handleGitHubError } from "../../helpers.js" @Identifier("getRepositoryBranches") -@Signature("(owner: string, repository: string, page?: number, perPage?: number): GITHUB_REPOSITORY_BRANCH[]") +@Signature("(owner: string, repository: string, page?: number, perPage?: number): GITHUB_REPOSITORY_BRANCH_SUMMARY[]") @Name({ code: "en-US", content: "Get repository branches" }) @DisplayMessage({ code: "en-US", content: "Get GitHub repository branches" }) +@DisplayIcon("tabler:brand-github") @Documentation({ code: "en-US", content: "Returns branches of a GitHub repository." }) @Description({ code: "en-US", content: "Returns GitHub repository branches." }) -@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }] }) -@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }] }) +@Parameter({ runtimeName: "owner", name: [{ code: "en-US", content: "Owner" }], description: [{ code: "en-US", content: "Repository owner or organization." }] }) +@Parameter({ runtimeName: "repository", name: [{ code: "en-US", content: "Repository" }], description: [{ code: "en-US", content: "Repository name." }] }) +@Parameter({ + runtimeName: "page", + name: [{ code: "en-US", content: "Page" }], + description: [{ code: "en-US", content: "Page number to return. Defaults to 1." }], + optional: true, + defaultValue: 1, +}) +@Parameter({ + runtimeName: "perPage", + name: [{ code: "en-US", content: "Results per page" }], + description: [{ code: "en-US", content: "Number of results per page, from 1 to 100. Defaults to 30." }], + optional: true, + defaultValue: 30, +}) export class GetRepositoryBranchesFunction { - async run(context: FunctionContext, owner: string, repository: string, page = 1, perPage = 30): Promise { + async run(context: FunctionContext, owner: string, repository: string, page = 1, perPage = 30): Promise { if (!Number.isInteger(page) || page < 1) throw new RuntimeError("GITHUB_INVALID_PAGE", "Page must be a positive integer.") if (!Number.isInteger(perPage) || perPage < 1 || perPage > 100) throw new RuntimeError("GITHUB_INVALID_PER_PAGE", "Results per page must be an integer from 1 to 100.") @@ -21,7 +36,7 @@ export class GetRepositoryBranchesFunction { const response = await client.get(`/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repository)}/branches`, { params: { page, per_page: perPage }, }) - return GitHubRepositoryBranchSchema.array().parse(response.data) + return GitHubRepositoryBranchSummarySchema.array().parse(response.data) } catch (error) { return handleGitHubError(error) } diff --git a/actions/github-action/src/functions/repositories/getRepositoryFunction.ts b/actions/github-action/src/functions/repositories/getRepositoryFunction.ts index 079eabf..9be0ad1 100644 --- a/actions/github-action/src/functions/repositories/getRepositoryFunction.ts +++ b/actions/github-action/src/functions/repositories/getRepositoryFunction.ts @@ -1,4 +1,4 @@ -import { Description, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, Signature } from "@code0-tech/hercules" +import { Description, DisplayIcon, DisplayMessage, Documentation, FunctionContext, Identifier, Name, Parameter, Signature } from "@code0-tech/hercules" import { GitHubRepository, GitHubRepositorySchema } from "../../data_types/repositories/githubRepository.js" import { createGitHubClient, handleGitHubError } from "../../helpers.js" @@ -6,6 +6,7 @@ import { createGitHubClient, handleGitHubError } from "../../helpers.js" @Signature("(owner: string, repository: string): GITHUB_REPOSITORY") @Name({ code: "en-US", content: "Get repository" }) @DisplayMessage({ code: "en-US", content: "Get GitHub repository" }) +@DisplayIcon("tabler:brand-github") @Documentation({ code: "en-US", content: "Returns information about a GitHub repository.", diff --git a/actions/github-action/src/generated/github-schemas.ts b/actions/github-action/src/generated/github-schemas.ts new file mode 100644 index 0000000..7b262ca --- /dev/null +++ b/actions/github-action/src/generated/github-schemas.ts @@ -0,0 +1,156 @@ +// AUTO-GENERATED by scripts/openapi-to-zod.mjs. Do not edit by hand. +// Regenerate with the action's `generate:*-schemas` npm script. +import {z} from "zod"; + +const author_association = z.lazy(() => z.enum(["COLLABORATOR", "CONTRIBUTOR", "FIRST_TIMER", "FIRST_TIME_CONTRIBUTOR", "MANNEQUIN", "MEMBER", "NONE", "OWNER"])); +const auto_merge = z.lazy(() => z.object({"enabled_by": simple_user, "merge_method": z.enum(["merge", "squash", "rebase"]), "commit_title": z.string(), "commit_message": z.string()}).nullable()); +const branch_protection = z.lazy(() => z.object({"url": z.string().optional(), "enabled": z.boolean().optional(), "required_status_checks": protected_branch_required_status_check.optional(), "enforce_admins": protected_branch_admin_enforced.optional(), "required_pull_request_reviews": protected_branch_pull_request_review.optional(), "restrictions": branch_restriction_policy.optional(), "required_linear_history": z.object({"enabled": z.boolean().optional()}).optional(), "allow_force_pushes": z.object({"enabled": z.boolean().optional()}).optional(), "allow_deletions": z.object({"enabled": z.boolean().optional()}).optional(), "block_creations": z.object({"enabled": z.boolean().optional()}).optional(), "required_conversation_resolution": z.object({"enabled": z.boolean().optional()}).optional(), "name": z.string().optional(), "protection_url": z.string().optional(), "required_signatures": z.object({"url": z.string(), "enabled": z.boolean()}).optional(), "lock_branch": z.object({"enabled": z.boolean().optional()}).optional(), "allow_fork_syncing": z.object({"enabled": z.boolean().optional()}).optional()})); +const branch_restriction_policy = z.lazy(() => z.object({"url": z.string(), "users_url": z.string(), "teams_url": z.string(), "apps_url": z.string(), "users": z.array(z.object({"login": z.string().optional(), "id": z.number().int().optional(), "node_id": z.string().optional(), "avatar_url": z.string().optional(), "gravatar_id": z.string().optional(), "url": z.string().optional(), "html_url": z.string().optional(), "followers_url": z.string().optional(), "following_url": z.string().optional(), "gists_url": z.string().optional(), "starred_url": z.string().optional(), "subscriptions_url": z.string().optional(), "organizations_url": z.string().optional(), "repos_url": z.string().optional(), "events_url": z.string().optional(), "received_events_url": z.string().optional(), "type": z.string().optional(), "site_admin": z.boolean().optional(), "user_view_type": z.string().optional()})), "teams": z.array(team), "apps": z.array(z.object({"id": z.number().int().optional(), "slug": z.string().optional(), "node_id": z.string().optional(), "owner": z.object({"login": z.string().optional(), "id": z.number().int().optional(), "node_id": z.string().optional(), "url": z.string().optional(), "repos_url": z.string().optional(), "events_url": z.string().optional(), "hooks_url": z.string().optional(), "issues_url": z.string().optional(), "members_url": z.string().optional(), "public_members_url": z.string().optional(), "avatar_url": z.string().optional(), "description": z.string().optional(), "gravatar_id": z.string().optional(), "html_url": z.string().optional(), "followers_url": z.string().optional(), "following_url": z.string().optional(), "gists_url": z.string().optional(), "starred_url": z.string().optional(), "subscriptions_url": z.string().optional(), "organizations_url": z.string().optional(), "received_events_url": z.string().optional(), "type": z.string().optional(), "site_admin": z.boolean().optional(), "user_view_type": z.string().optional()}).optional(), "name": z.string().optional(), "client_id": z.string().optional(), "description": z.string().optional(), "external_url": z.string().optional(), "html_url": z.string().optional(), "created_at": z.string().optional(), "updated_at": z.string().optional(), "permissions": z.object({"metadata": z.string().optional(), "contents": z.string().optional(), "issues": z.string().optional(), "single_file": z.string().optional()}).optional(), "events": z.array(z.string()).optional()}))})); +const branch_with_protection = z.lazy(() => z.object({"name": z.string(), "commit": commit, "_links": z.object({"html": z.string(), "self": z.string()}), "protected": z.boolean(), "protection": branch_protection, "protection_url": z.string(), "pattern": z.string().optional(), "required_approving_review_count": z.number().int().optional()})); +const check_run = z.lazy(() => z.object({"id": z.number().int(), "head_sha": z.string(), "node_id": z.string(), "external_id": z.string().nullable(), "url": z.string(), "html_url": z.string().nullable(), "details_url": z.string().nullable(), "status": z.enum(["queued", "in_progress", "completed", "waiting", "requested", "pending"]), "conclusion": z.enum(["success", "failure", "neutral", "cancelled", "skipped", "timed_out", "action_required"]).nullable(), "started_at": z.string().nullable(), "completed_at": z.string().nullable(), "output": z.object({"title": z.string().nullable(), "summary": z.string().nullable(), "text": z.string().nullable(), "annotations_count": z.number().int(), "annotations_url": z.string()}), "name": z.string(), "check_suite": z.object({"id": z.number().int()}).nullable(), "app": nullable_integration, "pull_requests": z.array(pull_request_minimal), "deployment": deployment_simple.optional()})); +const code_of_conduct = z.lazy(() => z.object({"key": z.string(), "name": z.string(), "url": z.string(), "body": z.string().optional(), "html_url": z.string().nullable()})); +const code_of_conduct_simple = z.lazy(() => z.object({"url": z.string(), "key": z.string(), "name": z.string(), "html_url": z.string().nullable()})); +const commit = z.lazy(() => z.object({"url": z.string(), "sha": z.string(), "node_id": z.string(), "html_url": z.string(), "comments_url": z.string(), "commit": z.object({"url": z.string(), "author": nullable_git_user, "committer": nullable_git_user, "message": z.string(), "comment_count": z.number().int(), "tree": z.object({"sha": z.string(), "url": z.string()}), "verification": verification.optional()}), "author": z.union([simple_user, empty_object]).nullable(), "committer": z.union([simple_user, empty_object]).nullable(), "parents": z.array(z.object({"sha": z.string(), "url": z.string(), "html_url": z.string().optional()})), "stats": z.object({"additions": z.number().int().optional(), "deletions": z.number().int().optional(), "total": z.number().int().optional()}).optional(), "files": z.array(diff_entry).optional()})); +const deployment_simple = z.lazy(() => z.object({"url": z.string(), "id": z.number().int(), "node_id": z.string(), "task": z.string(), "original_environment": z.string().optional(), "environment": z.string(), "description": z.string().nullable(), "created_at": z.string(), "updated_at": z.string(), "statuses_url": z.string(), "repository_url": z.string(), "transient_environment": z.boolean().optional(), "production_environment": z.boolean().optional(), "performed_via_github_app": nullable_integration.optional()})); +const diff_entry = z.lazy(() => z.object({"sha": z.string().nullable(), "filename": z.string(), "status": z.enum(["added", "removed", "modified", "renamed", "copied", "changed", "unchanged"]), "additions": z.number().int(), "deletions": z.number().int(), "changes": z.number().int(), "blob_url": z.string(), "raw_url": z.string(), "contents_url": z.string(), "patch": z.string().optional(), "previous_filename": z.string().optional()})); +const empty_object = z.lazy(() => z.object({}).strict()); +const enterprise = z.lazy(() => z.object({"description": z.string().nullable().optional(), "html_url": z.string(), "website_url": z.string().nullable().optional(), "id": z.number().int(), "node_id": z.string(), "name": z.string(), "slug": z.string(), "created_at": z.string().nullable(), "updated_at": z.string().nullable(), "avatar_url": z.string()})); +const enterprise_webhooks = z.lazy(() => z.object({"description": z.string().nullable().optional(), "html_url": z.string(), "website_url": z.string().nullable().optional(), "id": z.number().int(), "node_id": z.string(), "name": z.string(), "slug": z.string(), "created_at": z.string().nullable(), "updated_at": z.string().nullable(), "avatar_url": z.string()})); +const full_repository = z.lazy(() => z.object({"id": z.number().int(), "node_id": z.string(), "name": z.string(), "full_name": z.string(), "owner": simple_user, "private": z.boolean(), "html_url": z.string(), "description": z.string().nullable(), "fork": z.boolean(), "url": z.string(), "archive_url": z.string(), "assignees_url": z.string(), "blobs_url": z.string(), "branches_url": z.string(), "collaborators_url": z.string(), "comments_url": z.string(), "commits_url": z.string(), "compare_url": z.string(), "contents_url": z.string(), "contributors_url": z.string(), "deployments_url": z.string(), "downloads_url": z.string(), "events_url": z.string(), "forks_url": z.string(), "git_commits_url": z.string(), "git_refs_url": z.string(), "git_tags_url": z.string(), "git_url": z.string(), "issue_comment_url": z.string(), "issue_events_url": z.string(), "issues_url": z.string(), "keys_url": z.string(), "labels_url": z.string(), "languages_url": z.string(), "merges_url": z.string(), "milestones_url": z.string(), "notifications_url": z.string(), "pulls_url": z.string(), "releases_url": z.string(), "ssh_url": z.string(), "stargazers_url": z.string(), "statuses_url": z.string(), "subscribers_url": z.string(), "subscription_url": z.string(), "tags_url": z.string(), "teams_url": z.string(), "trees_url": z.string(), "clone_url": z.string(), "mirror_url": z.string().nullable(), "hooks_url": z.string(), "svn_url": z.string(), "homepage": z.string().nullable(), "language": z.string().nullable(), "forks_count": z.number().int(), "stargazers_count": z.number().int(), "watchers_count": z.number().int(), "size": z.number().int(), "default_branch": z.string(), "open_issues_count": z.number().int(), "is_template": z.boolean().optional(), "topics": z.array(z.string()).optional(), "has_issues": z.boolean(), "has_projects": z.boolean(), "has_wiki": z.boolean(), "has_pages": z.boolean(), "has_downloads": z.boolean().optional(), "has_discussions": z.boolean(), "has_pull_requests": z.boolean().optional(), "pull_request_creation_policy": z.enum(["all", "collaborators_only"]).optional(), "archived": z.boolean(), "disabled": z.boolean(), "visibility": z.string().optional(), "pushed_at": z.string(), "created_at": z.string(), "updated_at": z.string(), "permissions": z.object({"admin": z.boolean(), "maintain": z.boolean().optional(), "push": z.boolean(), "triage": z.boolean().optional(), "pull": z.boolean()}).optional(), "allow_rebase_merge": z.boolean().optional(), "template_repository": nullable_repository.optional(), "temp_clone_token": z.string().nullable().optional(), "allow_squash_merge": z.boolean().optional(), "allow_auto_merge": z.boolean().optional(), "delete_branch_on_merge": z.boolean().optional(), "allow_merge_commit": z.boolean().optional(), "allow_update_branch": z.boolean().optional(), "use_squash_pr_title_as_default": z.boolean().optional(), "squash_merge_commit_title": z.enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]).optional(), "squash_merge_commit_message": z.enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]).optional(), "merge_commit_title": z.enum(["PR_TITLE", "MERGE_MESSAGE"]).optional(), "merge_commit_message": z.enum(["PR_BODY", "PR_TITLE", "BLANK"]).optional(), "allow_forking": z.boolean().optional(), "web_commit_signoff_required": z.boolean().optional(), "subscribers_count": z.number().int(), "network_count": z.number().int(), "license": nullable_license_simple, "organization": nullable_simple_user.optional(), "parent": repository.optional(), "source": repository.optional(), "forks": z.number().int(), "master_branch": z.string().optional(), "open_issues": z.number().int(), "watchers": z.number().int(), "anonymous_access_enabled": z.boolean().optional(), "code_of_conduct": code_of_conduct_simple.optional(), "security_and_analysis": security_and_analysis.optional(), "custom_properties": z.record(z.string(), z.any()).optional()})); +const git_ref = z.lazy(() => z.object({"ref": z.string(), "node_id": z.string(), "url": z.string(), "object": z.object({"type": z.string(), "sha": z.string(), "url": z.string()})})); +const integration = z.lazy(() => z.object({"id": z.number().int(), "slug": z.string().optional(), "node_id": z.string(), "client_id": z.string().optional(), "owner": z.union([simple_user, enterprise]), "name": z.string(), "description": z.string().nullable(), "external_url": z.string(), "html_url": z.string(), "created_at": z.string(), "updated_at": z.string(), "permissions": z.object({"issues": z.string().optional(), "checks": z.string().optional(), "metadata": z.string().optional(), "contents": z.string().optional(), "deployments": z.string().optional()}).catchall(z.string()), "events": z.array(z.string()), "installations_count": z.number().int().optional()}).nullable()); +const issue = z.lazy(() => z.object({"id": z.number().int(), "node_id": z.string(), "url": z.string(), "repository_url": z.string(), "labels_url": z.string(), "comments_url": z.string(), "events_url": z.string(), "html_url": z.string(), "number": z.number().int(), "state": z.string(), "state_reason": z.enum(["completed", "reopened", "not_planned", "duplicate"]).nullable().optional(), "title": z.string(), "body": z.string().nullable().optional(), "user": nullable_simple_user, "labels": z.array(z.union([z.string(), z.object({"id": z.number().int().optional(), "node_id": z.string().optional(), "url": z.string().optional(), "name": z.string().optional(), "description": z.string().nullable().optional(), "color": z.string().nullable().optional(), "default": z.boolean().optional(), "archived_by": simple_user.nullable().optional()})])), "assignee": nullable_simple_user, "assignees": z.array(simple_user).optional(), "milestone": nullable_milestone, "locked": z.boolean(), "active_lock_reason": z.string().nullable().optional(), "comments": z.number().int(), "pull_request": z.object({"merged_at": z.string().nullable().optional(), "diff_url": z.string().nullable(), "html_url": z.string().nullable(), "patch_url": z.string().nullable(), "url": z.string().nullable()}).optional(), "closed_at": z.string().nullable(), "created_at": z.string(), "updated_at": z.string(), "draft": z.boolean().optional(), "closed_by": nullable_simple_user.optional(), "body_html": z.string().optional(), "body_text": z.string().optional(), "timeline_url": z.string().optional(), "type": issue_type.optional(), "repository": repository.optional(), "performed_via_github_app": nullable_integration.optional(), "author_association": author_association.optional(), "reactions": reaction_rollup.optional(), "sub_issues_summary": sub_issues_summary.optional(), "parent_issue_url": z.string().nullable().optional(), "pinned_comment": nullable_issue_comment.optional(), "issue_dependencies_summary": issue_dependencies_summary.optional(), "issue_field_values": z.array(issue_field_value).optional()})); +const issue_comment = z.lazy(() => z.object({"id": z.number().int(), "node_id": z.string(), "url": z.string(), "body": z.string().optional(), "body_text": z.string().optional(), "body_html": z.string().optional(), "html_url": z.string(), "user": nullable_simple_user, "created_at": z.string(), "updated_at": z.string(), "issue_url": z.string(), "author_association": author_association.optional(), "performed_via_github_app": nullable_integration.optional(), "reactions": reaction_rollup.optional(), "pin": nullable_pinned_issue_comment.optional(), "minimized": nullable_issue_comment_minimized.optional()})); +const issue_dependencies_summary = z.lazy(() => z.object({"blocked_by": z.number().int(), "blocking": z.number().int(), "total_blocked_by": z.number().int(), "total_blocking": z.number().int()})); +const issue_field_value = z.lazy(() => z.object({"issue_field_id": z.number().int(), "issue_field_name": z.string().optional(), "node_id": z.string(), "data_type": z.enum(["text", "single_select", "multi_select", "number", "date"]), "value": z.union([z.string(), z.number(), z.number().int()]).nullable(), "single_select_option": z.object({"id": z.number().int(), "name": z.string(), "color": z.string()}).nullable().optional(), "multi_select_options": z.array(z.object({"id": z.number().int(), "name": z.string(), "color": z.string()})).nullable().optional()})); +const issue_type = z.lazy(() => z.object({"id": z.number().int(), "node_id": z.string(), "name": z.string(), "description": z.string().nullable(), "color": z.enum(["gray", "blue", "green", "yellow", "orange", "red", "pink", "purple"]).nullable().optional(), "created_at": z.string().optional(), "updated_at": z.string().optional(), "is_enabled": z.boolean().optional()}).nullable()); +const label = z.lazy(() => z.object({"id": z.number().int(), "node_id": z.string(), "url": z.string(), "name": z.string(), "description": z.string().nullable(), "color": z.string(), "default": z.boolean(), "archived_at": z.string().nullable(), "archived_by": simple_user.nullable()})); +const link = z.lazy(() => z.object({"href": z.string()})); +const milestone = z.lazy(() => z.object({"url": z.string(), "html_url": z.string(), "labels_url": z.string(), "id": z.number().int(), "node_id": z.string(), "number": z.number().int(), "state": z.enum(["open", "closed"]), "title": z.string(), "description": z.string().nullable(), "creator": nullable_simple_user, "open_issues": z.number().int(), "closed_issues": z.number().int(), "created_at": z.string(), "updated_at": z.string(), "closed_at": z.string().nullable(), "due_on": z.string().nullable()})); +const minimal_repository = z.lazy(() => z.object({"id": z.number().int(), "node_id": z.string(), "name": z.string(), "full_name": z.string(), "owner": simple_user, "private": z.boolean(), "html_url": z.string(), "description": z.string().nullable(), "fork": z.boolean(), "url": z.string(), "archive_url": z.string(), "assignees_url": z.string(), "blobs_url": z.string(), "branches_url": z.string(), "collaborators_url": z.string(), "comments_url": z.string(), "commits_url": z.string(), "compare_url": z.string(), "contents_url": z.string(), "contributors_url": z.string(), "deployments_url": z.string(), "downloads_url": z.string(), "events_url": z.string(), "forks_url": z.string(), "git_commits_url": z.string(), "git_refs_url": z.string(), "git_tags_url": z.string(), "git_url": z.string().optional(), "issue_comment_url": z.string(), "issue_events_url": z.string(), "issues_url": z.string(), "keys_url": z.string(), "labels_url": z.string(), "languages_url": z.string(), "merges_url": z.string(), "milestones_url": z.string(), "notifications_url": z.string(), "pulls_url": z.string(), "releases_url": z.string(), "ssh_url": z.string().optional(), "stargazers_url": z.string(), "statuses_url": z.string(), "subscribers_url": z.string(), "subscription_url": z.string(), "tags_url": z.string(), "teams_url": z.string(), "trees_url": z.string(), "clone_url": z.string().optional(), "mirror_url": z.string().nullable().optional(), "hooks_url": z.string(), "svn_url": z.string().optional(), "homepage": z.string().nullable().optional(), "language": z.string().nullable().optional(), "forks_count": z.number().int().optional(), "stargazers_count": z.number().int().optional(), "watchers_count": z.number().int().optional(), "size": z.number().int().optional(), "default_branch": z.string().optional(), "open_issues_count": z.number().int().optional(), "is_template": z.boolean().optional(), "topics": z.array(z.string()).optional(), "has_issues": z.boolean().optional(), "has_projects": z.boolean().optional(), "has_wiki": z.boolean().optional(), "has_pages": z.boolean().optional(), "has_downloads": z.boolean().optional(), "has_discussions": z.boolean().optional(), "has_pull_requests": z.boolean().optional(), "pull_request_creation_policy": z.enum(["all", "collaborators_only"]).optional(), "archived": z.boolean().optional(), "disabled": z.boolean().optional(), "visibility": z.string().optional(), "pushed_at": z.string().nullable().optional(), "created_at": z.string().nullable().optional(), "updated_at": z.string().nullable().optional(), "permissions": z.object({"admin": z.boolean().optional(), "maintain": z.boolean().optional(), "push": z.boolean().optional(), "triage": z.boolean().optional(), "pull": z.boolean().optional()}).optional(), "role_name": z.string().optional(), "temp_clone_token": z.string().optional(), "delete_branch_on_merge": z.boolean().optional(), "subscribers_count": z.number().int().optional(), "network_count": z.number().int().optional(), "code_of_conduct": code_of_conduct.optional(), "license": z.object({"key": z.string().optional(), "name": z.string().optional(), "spdx_id": z.string().optional(), "url": z.string().nullable().optional(), "node_id": z.string().optional()}).nullable().optional(), "forks": z.number().int().optional(), "open_issues": z.number().int().optional(), "watchers": z.number().int().optional(), "allow_forking": z.boolean().optional(), "web_commit_signoff_required": z.boolean().optional(), "security_and_analysis": security_and_analysis.optional(), "custom_properties": z.record(z.string(), z.any()).optional()})); +const nullable_git_user = z.lazy(() => z.object({"name": z.string().optional(), "email": z.string().optional(), "date": z.string().optional()}).nullable()); +const nullable_integration = z.lazy(() => z.object({"id": z.number().int(), "slug": z.string().optional(), "node_id": z.string(), "client_id": z.string().optional(), "owner": z.union([simple_user, enterprise]), "name": z.string(), "description": z.string().nullable(), "external_url": z.string(), "html_url": z.string(), "created_at": z.string(), "updated_at": z.string(), "permissions": z.object({"issues": z.string().optional(), "checks": z.string().optional(), "metadata": z.string().optional(), "contents": z.string().optional(), "deployments": z.string().optional()}).catchall(z.string()), "events": z.array(z.string()), "installations_count": z.number().int().optional()}).nullable()); +const nullable_issue_comment = z.lazy(() => z.object({"id": z.number().int(), "node_id": z.string(), "url": z.string(), "body": z.string().optional(), "body_text": z.string().optional(), "body_html": z.string().optional(), "html_url": z.string(), "user": nullable_simple_user, "created_at": z.string(), "updated_at": z.string(), "issue_url": z.string(), "author_association": author_association.optional(), "performed_via_github_app": nullable_integration.optional(), "reactions": reaction_rollup.optional(), "pin": nullable_pinned_issue_comment.optional(), "minimized": nullable_issue_comment_minimized.optional()}).nullable()); +const nullable_issue_comment_minimized = z.lazy(() => z.object({"reason": z.string().nullable()}).nullable()); +const nullable_license_simple = z.lazy(() => z.object({"key": z.string(), "name": z.string(), "url": z.string().nullable(), "spdx_id": z.string().nullable(), "node_id": z.string(), "html_url": z.string().optional()}).nullable()); +const nullable_milestone = z.lazy(() => z.object({"url": z.string(), "html_url": z.string(), "labels_url": z.string(), "id": z.number().int(), "node_id": z.string(), "number": z.number().int(), "state": z.enum(["open", "closed"]), "title": z.string(), "description": z.string().nullable(), "creator": nullable_simple_user, "open_issues": z.number().int(), "closed_issues": z.number().int(), "created_at": z.string(), "updated_at": z.string(), "closed_at": z.string().nullable(), "due_on": z.string().nullable()}).nullable()); +const nullable_pinned_issue_comment = z.lazy(() => z.object({"pinned_at": z.string(), "pinned_by": nullable_simple_user}).nullable()); +const nullable_repository = z.lazy(() => z.object({"id": z.number().int(), "node_id": z.string(), "name": z.string(), "full_name": z.string(), "license": nullable_license_simple, "forks": z.number().int(), "permissions": z.object({"admin": z.boolean(), "pull": z.boolean(), "triage": z.boolean().optional(), "push": z.boolean(), "maintain": z.boolean().optional()}).optional(), "owner": simple_user, "private": z.boolean(), "html_url": z.string(), "description": z.string().nullable(), "fork": z.boolean(), "url": z.string(), "archive_url": z.string(), "assignees_url": z.string(), "blobs_url": z.string(), "branches_url": z.string(), "collaborators_url": z.string(), "comments_url": z.string(), "commits_url": z.string(), "compare_url": z.string(), "contents_url": z.string(), "contributors_url": z.string(), "deployments_url": z.string(), "downloads_url": z.string(), "events_url": z.string(), "forks_url": z.string(), "git_commits_url": z.string(), "git_refs_url": z.string(), "git_tags_url": z.string(), "git_url": z.string(), "issue_comment_url": z.string(), "issue_events_url": z.string(), "issues_url": z.string(), "keys_url": z.string(), "labels_url": z.string(), "languages_url": z.string(), "merges_url": z.string(), "milestones_url": z.string(), "notifications_url": z.string(), "pulls_url": z.string(), "releases_url": z.string(), "ssh_url": z.string(), "stargazers_url": z.string(), "statuses_url": z.string(), "subscribers_url": z.string(), "subscription_url": z.string(), "tags_url": z.string(), "teams_url": z.string(), "trees_url": z.string(), "clone_url": z.string(), "mirror_url": z.string().nullable(), "hooks_url": z.string(), "svn_url": z.string(), "homepage": z.string().nullable(), "language": z.string().nullable(), "forks_count": z.number().int(), "stargazers_count": z.number().int(), "watchers_count": z.number().int(), "size": z.number().int(), "default_branch": z.string(), "open_issues_count": z.number().int(), "is_template": z.boolean().optional(), "topics": z.array(z.string()).optional(), "has_issues": z.boolean(), "has_projects": z.boolean(), "has_wiki": z.boolean(), "has_pages": z.boolean(), "has_downloads": z.boolean(), "has_discussions": z.boolean().optional(), "has_pull_requests": z.boolean().optional(), "pull_request_creation_policy": z.enum(["all", "collaborators_only"]).optional(), "archived": z.boolean(), "disabled": z.boolean(), "visibility": z.string().optional(), "pushed_at": z.string().nullable(), "created_at": z.string().nullable(), "updated_at": z.string().nullable(), "allow_rebase_merge": z.boolean().optional(), "temp_clone_token": z.string().optional(), "allow_squash_merge": z.boolean().optional(), "allow_auto_merge": z.boolean().optional(), "delete_branch_on_merge": z.boolean().optional(), "allow_update_branch": z.boolean().optional(), "use_squash_pr_title_as_default": z.boolean().optional(), "squash_merge_commit_title": z.enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]).optional(), "squash_merge_commit_message": z.enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]).optional(), "merge_commit_title": z.enum(["PR_TITLE", "MERGE_MESSAGE"]).optional(), "merge_commit_message": z.enum(["PR_BODY", "PR_TITLE", "BLANK"]).optional(), "allow_merge_commit": z.boolean().optional(), "allow_forking": z.boolean().optional(), "web_commit_signoff_required": z.boolean().optional(), "open_issues": z.number().int(), "watchers": z.number().int(), "master_branch": z.string().optional(), "starred_at": z.string().optional(), "anonymous_access_enabled": z.boolean().optional(), "code_search_index_status": z.object({"lexical_search_ok": z.boolean().optional(), "lexical_commit_sha": z.string().optional()}).optional()}).nullable()); +const nullable_simple_commit = z.lazy(() => z.object({"id": z.string(), "tree_id": z.string(), "message": z.string(), "timestamp": z.string(), "author": z.object({"name": z.string(), "email": z.string()}).nullable(), "committer": z.object({"name": z.string(), "email": z.string()}).nullable()}).nullable()); +const nullable_simple_user = z.lazy(() => z.object({"name": z.string().nullable().optional(), "email": z.string().nullable().optional(), "login": z.string(), "id": z.number().int(), "node_id": z.string(), "avatar_url": z.string(), "gravatar_id": z.string().nullable(), "url": z.string(), "html_url": z.string(), "followers_url": z.string(), "following_url": z.string(), "gists_url": z.string(), "starred_url": z.string(), "subscriptions_url": z.string(), "organizations_url": z.string(), "repos_url": z.string(), "events_url": z.string(), "received_events_url": z.string(), "type": z.string(), "site_admin": z.boolean(), "starred_at": z.string().optional(), "user_view_type": z.string().optional()}).nullable()); +const nullable_team_simple = z.lazy(() => z.object({"id": z.number().int(), "node_id": z.string(), "url": z.string(), "members_url": z.string(), "name": z.string(), "description": z.string().nullable(), "permission": z.string(), "privacy": z.string().optional(), "notification_setting": z.string().optional(), "html_url": z.string(), "repositories_url": z.string(), "slug": z.string(), "ldap_dn": z.string().optional(), "type": z.enum(["enterprise", "organization"]), "organization_id": z.number().int().optional(), "enterprise_id": z.number().int().optional()}).nullable()); +const organization_simple_webhooks = z.lazy(() => z.object({"login": z.string(), "id": z.number().int(), "node_id": z.string(), "url": z.string(), "repos_url": z.string(), "events_url": z.string(), "hooks_url": z.string(), "issues_url": z.string(), "members_url": z.string(), "public_members_url": z.string(), "avatar_url": z.string(), "description": z.string().nullable()})); +const protected_branch_admin_enforced = z.lazy(() => z.object({"url": z.string(), "enabled": z.boolean()})); +const protected_branch_pull_request_review = z.lazy(() => z.object({"url": z.string().optional(), "dismissal_restrictions": z.object({"users": z.array(simple_user).optional(), "teams": z.array(team).optional(), "apps": z.array(integration).optional(), "url": z.string().optional(), "users_url": z.string().optional(), "teams_url": z.string().optional()}).optional(), "bypass_pull_request_allowances": z.object({"users": z.array(simple_user).optional(), "teams": z.array(team).optional(), "apps": z.array(integration).optional()}).optional(), "dismiss_stale_reviews": z.boolean(), "require_code_owner_reviews": z.boolean(), "required_approving_review_count": z.number().int().optional(), "require_last_push_approval": z.boolean().optional()})); +const protected_branch_required_status_check = z.lazy(() => z.object({"url": z.string().optional(), "enforcement_level": z.string().optional(), "contexts": z.array(z.string()), "checks": z.array(z.object({"context": z.string(), "app_id": z.number().int().nullable()})), "contexts_url": z.string().optional(), "strict": z.boolean().optional()})); +const pull_request = z.lazy(() => z.object({"url": z.string(), "id": z.number().int(), "node_id": z.string(), "html_url": z.string(), "diff_url": z.string(), "patch_url": z.string(), "issue_url": z.string(), "commits_url": z.string(), "review_comments_url": z.string(), "review_comment_url": z.string(), "comments_url": z.string(), "statuses_url": z.string(), "number": z.number().int(), "state": z.enum(["open", "closed"]), "locked": z.boolean(), "title": z.string(), "user": simple_user, "body": z.string().nullable(), "labels": z.array(z.object({"id": z.number().int(), "node_id": z.string(), "url": z.string(), "name": z.string(), "description": z.string().nullable(), "color": z.string(), "default": z.boolean(), "archived_by": simple_user.nullable()})), "milestone": nullable_milestone, "active_lock_reason": z.string().nullable().optional(), "created_at": z.string(), "updated_at": z.string(), "closed_at": z.string().nullable(), "merged_at": z.string().nullable(), "merge_commit_sha": z.string().nullable(), "assignee": nullable_simple_user, "assignees": z.array(simple_user).optional(), "requested_reviewers": z.array(simple_user).optional(), "requested_teams": z.array(team_simple).optional(), "head": z.object({"label": z.string(), "ref": z.string(), "repo": repository, "sha": z.string(), "user": simple_user}), "base": z.object({"label": z.string(), "ref": z.string(), "repo": repository, "sha": z.string(), "user": simple_user}), "_links": z.object({"comments": link, "commits": link, "statuses": link, "html": link, "issue": link, "review_comments": link, "review_comment": link, "self": link}), "author_association": author_association, "auto_merge": auto_merge, "stack": pull_request_stack.optional(), "draft": z.boolean().optional(), "merged": z.boolean(), "mergeable": z.boolean().nullable(), "rebaseable": z.boolean().nullable().optional(), "mergeable_state": z.string(), "merged_by": nullable_simple_user, "comments": z.number().int(), "review_comments": z.number().int(), "maintainer_can_modify": z.boolean(), "commits": z.number().int(), "additions": z.number().int(), "deletions": z.number().int(), "changed_files": z.number().int()})); +const pull_request_merge_result = z.lazy(() => z.object({"sha": z.string(), "merged": z.boolean(), "message": z.string()})); +const pull_request_minimal = z.lazy(() => z.object({"id": z.number().int(), "number": z.number().int(), "url": z.string(), "head": z.object({"ref": z.string(), "sha": z.string(), "repo": z.object({"id": z.number().int(), "url": z.string(), "name": z.string()})}), "base": z.object({"ref": z.string(), "sha": z.string(), "repo": z.object({"id": z.number().int(), "url": z.string(), "name": z.string()})})})); +const pull_request_review = z.lazy(() => z.object({"id": z.number().int(), "node_id": z.string(), "user": nullable_simple_user, "body": z.string(), "state": z.string(), "html_url": z.string(), "pull_request_url": z.string(), "_links": z.object({"html": z.object({"href": z.string()}), "pull_request": z.object({"href": z.string()})}), "submitted_at": z.string().optional(), "commit_id": z.string().nullable(), "body_html": z.string().optional(), "body_text": z.string().optional(), "author_association": author_association})); +const pull_request_review_comment = z.lazy(() => z.object({"url": z.string(), "pull_request_review_id": z.number().int().nullable(), "id": z.number().int(), "node_id": z.string(), "diff_hunk": z.string(), "path": z.string(), "position": z.number().int().optional(), "original_position": z.number().int().optional(), "commit_id": z.string(), "original_commit_id": z.string(), "in_reply_to_id": z.number().int().optional(), "user": nullable_simple_user, "body": z.string(), "created_at": z.string(), "updated_at": z.string(), "html_url": z.string(), "pull_request_url": z.string(), "author_association": author_association, "_links": z.object({"self": z.object({"href": z.string()}), "html": z.object({"href": z.string()}), "pull_request": z.object({"href": z.string()})}), "start_line": z.number().int().nullable().optional(), "original_start_line": z.number().int().nullable().optional(), "start_side": z.enum(["LEFT", "RIGHT"]).nullable().optional(), "line": z.number().int().optional(), "original_line": z.number().int().optional(), "side": z.enum(["LEFT", "RIGHT"]).optional(), "subject_type": z.enum(["line", "file"]).optional(), "reactions": reaction_rollup.optional(), "body_html": z.string().optional(), "body_text": z.string().optional()})); +const pull_request_simple = z.lazy(() => z.object({"url": z.string(), "id": z.number().int(), "node_id": z.string(), "html_url": z.string(), "diff_url": z.string(), "patch_url": z.string(), "issue_url": z.string(), "commits_url": z.string(), "review_comments_url": z.string(), "review_comment_url": z.string(), "comments_url": z.string(), "statuses_url": z.string(), "number": z.number().int(), "state": z.string(), "locked": z.boolean(), "title": z.string(), "user": nullable_simple_user, "body": z.string().nullable(), "labels": z.array(z.object({"id": z.number().int(), "node_id": z.string(), "url": z.string(), "name": z.string(), "description": z.string(), "color": z.string(), "default": z.boolean(), "archived_by": simple_user.nullable()})), "milestone": nullable_milestone, "active_lock_reason": z.string().nullable().optional(), "created_at": z.string(), "updated_at": z.string(), "closed_at": z.string().nullable(), "merged_at": z.string().nullable(), "merge_commit_sha": z.string().nullable(), "assignee": nullable_simple_user, "assignees": z.array(simple_user).optional(), "requested_reviewers": z.array(simple_user).optional(), "requested_teams": z.array(team).optional(), "head": z.object({"label": z.string(), "ref": z.string(), "repo": repository, "sha": z.string(), "user": nullable_simple_user}), "base": z.object({"label": z.string(), "ref": z.string(), "repo": repository, "sha": z.string(), "user": nullable_simple_user}), "_links": z.object({"comments": link, "commits": link, "statuses": link, "html": link, "issue": link, "review_comments": link, "review_comment": link, "self": link}), "author_association": author_association, "auto_merge": auto_merge, "stack": pull_request_stack.optional(), "draft": z.boolean().optional()})); +const pull_request_stack = z.lazy(() => z.object({"base": z.object({"ref": z.string(), "sha": z.string()}), "size": z.number().int().optional(), "position": z.number().int().optional(), "id": z.number().int().optional(), "number": z.number().int().optional()}).nullable()); +const pull_request_webhook = z.lazy(() => z.intersection(pull_request, z.object({"allow_auto_merge": z.boolean().optional(), "allow_update_branch": z.boolean().optional(), "delete_branch_on_merge": z.boolean().optional(), "merge_commit_message": z.enum(["PR_BODY", "PR_TITLE", "BLANK"]).optional(), "merge_commit_title": z.enum(["PR_TITLE", "MERGE_MESSAGE"]).optional(), "squash_merge_commit_message": z.enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]).optional(), "squash_merge_commit_title": z.enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]).optional(), "use_squash_pr_title_as_default": z.boolean().optional()}))); +const reaction_rollup = z.lazy(() => z.object({"url": z.string(), "total_count": z.number().int(), "+1": z.number().int(), "-1": z.number().int(), "laugh": z.number().int(), "confused": z.number().int(), "heart": z.number().int(), "hooray": z.number().int(), "eyes": z.number().int(), "rocket": z.number().int()})); +const referenced_workflow = z.lazy(() => z.object({"path": z.string(), "sha": z.string(), "ref": z.string().optional()})); +const release = z.lazy(() => z.object({"url": z.string(), "html_url": z.string(), "assets_url": z.string(), "upload_url": z.string(), "tarball_url": z.string().nullable(), "zipball_url": z.string().nullable(), "id": z.number().int(), "node_id": z.string(), "tag_name": z.string(), "target_commitish": z.string(), "name": z.string().nullable(), "body": z.string().nullable().optional(), "draft": z.boolean(), "prerelease": z.boolean(), "immutable": z.boolean().optional(), "created_at": z.string(), "published_at": z.string().nullable(), "updated_at": z.string().nullable().optional(), "author": simple_user, "assets": z.array(release_asset), "body_html": z.string().optional(), "body_text": z.string().optional(), "mentions_count": z.number().int().optional(), "discussion_url": z.string().optional(), "reactions": reaction_rollup.optional()})); +const release_asset = z.lazy(() => z.object({"url": z.string(), "browser_download_url": z.string(), "id": z.number().int(), "node_id": z.string(), "name": z.string(), "label": z.string().nullable(), "state": z.enum(["uploaded", "open"]), "content_type": z.string(), "size": z.number().int(), "digest": z.string().nullable(), "download_count": z.number().int(), "created_at": z.string(), "updated_at": z.string(), "uploader": nullable_simple_user})); +const repository = z.lazy(() => z.object({"id": z.number().int(), "node_id": z.string(), "name": z.string(), "full_name": z.string(), "license": nullable_license_simple, "forks": z.number().int(), "permissions": z.object({"admin": z.boolean(), "pull": z.boolean(), "triage": z.boolean().optional(), "push": z.boolean(), "maintain": z.boolean().optional()}).optional(), "owner": simple_user, "private": z.boolean(), "html_url": z.string(), "description": z.string().nullable(), "fork": z.boolean(), "url": z.string(), "archive_url": z.string(), "assignees_url": z.string(), "blobs_url": z.string(), "branches_url": z.string(), "collaborators_url": z.string(), "comments_url": z.string(), "commits_url": z.string(), "compare_url": z.string(), "contents_url": z.string(), "contributors_url": z.string(), "deployments_url": z.string(), "downloads_url": z.string(), "events_url": z.string(), "forks_url": z.string(), "git_commits_url": z.string(), "git_refs_url": z.string(), "git_tags_url": z.string(), "git_url": z.string(), "issue_comment_url": z.string(), "issue_events_url": z.string(), "issues_url": z.string(), "keys_url": z.string(), "labels_url": z.string(), "languages_url": z.string(), "merges_url": z.string(), "milestones_url": z.string(), "notifications_url": z.string(), "pulls_url": z.string(), "releases_url": z.string(), "ssh_url": z.string(), "stargazers_url": z.string(), "statuses_url": z.string(), "subscribers_url": z.string(), "subscription_url": z.string(), "tags_url": z.string(), "teams_url": z.string(), "trees_url": z.string(), "clone_url": z.string(), "mirror_url": z.string().nullable(), "hooks_url": z.string(), "svn_url": z.string(), "homepage": z.string().nullable(), "language": z.string().nullable(), "forks_count": z.number().int(), "stargazers_count": z.number().int(), "watchers_count": z.number().int(), "size": z.number().int(), "default_branch": z.string(), "open_issues_count": z.number().int(), "is_template": z.boolean().optional(), "topics": z.array(z.string()).optional(), "has_issues": z.boolean(), "has_projects": z.boolean(), "has_wiki": z.boolean(), "has_pages": z.boolean(), "has_downloads": z.boolean(), "has_discussions": z.boolean().optional(), "has_pull_requests": z.boolean().optional(), "pull_request_creation_policy": z.enum(["all", "collaborators_only"]).optional(), "archived": z.boolean(), "disabled": z.boolean(), "visibility": z.string().optional(), "pushed_at": z.string().nullable(), "created_at": z.string().nullable(), "updated_at": z.string().nullable(), "allow_rebase_merge": z.boolean().optional(), "temp_clone_token": z.string().optional(), "allow_squash_merge": z.boolean().optional(), "allow_auto_merge": z.boolean().optional(), "delete_branch_on_merge": z.boolean().optional(), "allow_update_branch": z.boolean().optional(), "use_squash_pr_title_as_default": z.boolean().optional(), "squash_merge_commit_title": z.enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]).optional(), "squash_merge_commit_message": z.enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]).optional(), "merge_commit_title": z.enum(["PR_TITLE", "MERGE_MESSAGE"]).optional(), "merge_commit_message": z.enum(["PR_BODY", "PR_TITLE", "BLANK"]).optional(), "allow_merge_commit": z.boolean().optional(), "allow_forking": z.boolean().optional(), "web_commit_signoff_required": z.boolean().optional(), "open_issues": z.number().int(), "watchers": z.number().int(), "master_branch": z.string().optional(), "starred_at": z.string().optional(), "anonymous_access_enabled": z.boolean().optional(), "code_search_index_status": z.object({"lexical_search_ok": z.boolean().optional(), "lexical_commit_sha": z.string().optional()}).optional()})); +const repository_webhooks = z.lazy(() => z.object({"id": z.number().int(), "node_id": z.string(), "name": z.string(), "full_name": z.string(), "license": nullable_license_simple, "organization": nullable_simple_user.optional(), "forks": z.number().int(), "permissions": z.object({"admin": z.boolean(), "pull": z.boolean(), "triage": z.boolean().optional(), "push": z.boolean(), "maintain": z.boolean().optional()}).optional(), "owner": simple_user, "private": z.boolean(), "html_url": z.string(), "description": z.string().nullable(), "fork": z.boolean(), "url": z.string(), "archive_url": z.string(), "assignees_url": z.string(), "blobs_url": z.string(), "branches_url": z.string(), "collaborators_url": z.string(), "comments_url": z.string(), "commits_url": z.string(), "compare_url": z.string(), "contents_url": z.string(), "contributors_url": z.string(), "deployments_url": z.string(), "downloads_url": z.string(), "events_url": z.string(), "forks_url": z.string(), "git_commits_url": z.string(), "git_refs_url": z.string(), "git_tags_url": z.string(), "git_url": z.string(), "issue_comment_url": z.string(), "issue_events_url": z.string(), "issues_url": z.string(), "keys_url": z.string(), "labels_url": z.string(), "languages_url": z.string(), "merges_url": z.string(), "milestones_url": z.string(), "notifications_url": z.string(), "pulls_url": z.string(), "releases_url": z.string(), "ssh_url": z.string(), "stargazers_url": z.string(), "statuses_url": z.string(), "subscribers_url": z.string(), "subscription_url": z.string(), "tags_url": z.string(), "teams_url": z.string(), "trees_url": z.string(), "clone_url": z.string(), "mirror_url": z.string().nullable(), "hooks_url": z.string(), "svn_url": z.string(), "homepage": z.string().nullable(), "language": z.string().nullable(), "forks_count": z.number().int(), "stargazers_count": z.number().int(), "watchers_count": z.number().int(), "size": z.number().int(), "default_branch": z.string(), "open_issues_count": z.number().int(), "is_template": z.boolean().optional(), "topics": z.array(z.string()).optional(), "custom_properties": z.record(z.string(), z.any()).optional(), "has_issues": z.boolean(), "has_projects": z.boolean(), "has_wiki": z.boolean(), "has_pages": z.boolean(), "has_downloads": z.boolean(), "has_discussions": z.boolean().optional(), "has_pull_requests": z.boolean().optional(), "pull_request_creation_policy": z.enum(["all", "collaborators_only"]).optional(), "archived": z.boolean(), "disabled": z.boolean(), "visibility": z.string().optional(), "pushed_at": z.string().nullable(), "created_at": z.string().nullable(), "updated_at": z.string().nullable(), "allow_rebase_merge": z.boolean().optional(), "template_repository": z.object({"id": z.number().int().optional(), "node_id": z.string().optional(), "name": z.string().optional(), "full_name": z.string().optional(), "owner": z.object({"login": z.string().optional(), "id": z.number().int().optional(), "node_id": z.string().optional(), "avatar_url": z.string().optional(), "gravatar_id": z.string().optional(), "url": z.string().optional(), "html_url": z.string().optional(), "followers_url": z.string().optional(), "following_url": z.string().optional(), "gists_url": z.string().optional(), "starred_url": z.string().optional(), "subscriptions_url": z.string().optional(), "organizations_url": z.string().optional(), "repos_url": z.string().optional(), "events_url": z.string().optional(), "received_events_url": z.string().optional(), "type": z.string().optional(), "site_admin": z.boolean().optional()}).optional(), "private": z.boolean().optional(), "html_url": z.string().optional(), "description": z.string().optional(), "fork": z.boolean().optional(), "url": z.string().optional(), "archive_url": z.string().optional(), "assignees_url": z.string().optional(), "blobs_url": z.string().optional(), "branches_url": z.string().optional(), "collaborators_url": z.string().optional(), "comments_url": z.string().optional(), "commits_url": z.string().optional(), "compare_url": z.string().optional(), "contents_url": z.string().optional(), "contributors_url": z.string().optional(), "deployments_url": z.string().optional(), "downloads_url": z.string().optional(), "events_url": z.string().optional(), "forks_url": z.string().optional(), "git_commits_url": z.string().optional(), "git_refs_url": z.string().optional(), "git_tags_url": z.string().optional(), "git_url": z.string().optional(), "issue_comment_url": z.string().optional(), "issue_events_url": z.string().optional(), "issues_url": z.string().optional(), "keys_url": z.string().optional(), "labels_url": z.string().optional(), "languages_url": z.string().optional(), "merges_url": z.string().optional(), "milestones_url": z.string().optional(), "notifications_url": z.string().optional(), "pulls_url": z.string().optional(), "releases_url": z.string().optional(), "ssh_url": z.string().optional(), "stargazers_url": z.string().optional(), "statuses_url": z.string().optional(), "subscribers_url": z.string().optional(), "subscription_url": z.string().optional(), "tags_url": z.string().optional(), "teams_url": z.string().optional(), "trees_url": z.string().optional(), "clone_url": z.string().optional(), "mirror_url": z.string().optional(), "hooks_url": z.string().optional(), "svn_url": z.string().optional(), "homepage": z.string().optional(), "language": z.string().optional(), "forks_count": z.number().int().optional(), "stargazers_count": z.number().int().optional(), "watchers_count": z.number().int().optional(), "size": z.number().int().optional(), "default_branch": z.string().optional(), "open_issues_count": z.number().int().optional(), "is_template": z.boolean().optional(), "topics": z.array(z.string()).optional(), "has_issues": z.boolean().optional(), "has_projects": z.boolean().optional(), "has_wiki": z.boolean().optional(), "has_pages": z.boolean().optional(), "has_downloads": z.boolean().optional(), "archived": z.boolean().optional(), "disabled": z.boolean().optional(), "visibility": z.string().optional(), "pushed_at": z.string().optional(), "created_at": z.string().optional(), "updated_at": z.string().optional(), "permissions": z.object({"admin": z.boolean().optional(), "maintain": z.boolean().optional(), "push": z.boolean().optional(), "triage": z.boolean().optional(), "pull": z.boolean().optional()}).optional(), "allow_rebase_merge": z.boolean().optional(), "temp_clone_token": z.string().optional(), "allow_squash_merge": z.boolean().optional(), "allow_auto_merge": z.boolean().optional(), "delete_branch_on_merge": z.boolean().optional(), "allow_update_branch": z.boolean().optional(), "use_squash_pr_title_as_default": z.boolean().optional(), "squash_merge_commit_title": z.enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]).optional(), "squash_merge_commit_message": z.enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]).optional(), "merge_commit_title": z.enum(["PR_TITLE", "MERGE_MESSAGE"]).optional(), "merge_commit_message": z.enum(["PR_BODY", "PR_TITLE", "BLANK"]).optional(), "allow_merge_commit": z.boolean().optional(), "subscribers_count": z.number().int().optional(), "network_count": z.number().int().optional()}).nullable().optional(), "temp_clone_token": z.string().optional(), "allow_squash_merge": z.boolean().optional(), "allow_auto_merge": z.boolean().optional(), "delete_branch_on_merge": z.boolean().optional(), "allow_update_branch": z.boolean().optional(), "use_squash_pr_title_as_default": z.boolean().optional(), "squash_merge_commit_title": z.enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]).optional(), "squash_merge_commit_message": z.enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]).optional(), "merge_commit_title": z.enum(["PR_TITLE", "MERGE_MESSAGE"]).optional(), "merge_commit_message": z.enum(["PR_BODY", "PR_TITLE", "BLANK"]).optional(), "allow_merge_commit": z.boolean().optional(), "allow_forking": z.boolean().optional(), "web_commit_signoff_required": z.boolean().optional(), "subscribers_count": z.number().int().optional(), "network_count": z.number().int().optional(), "open_issues": z.number().int(), "watchers": z.number().int(), "master_branch": z.string().optional(), "starred_at": z.string().optional(), "anonymous_access_enabled": z.boolean().optional()})); +const security_and_analysis = z.lazy(() => z.object({"advanced_security": z.object({"status": z.enum(["enabled", "disabled"]).optional()}).optional(), "code_security": z.object({"status": z.enum(["enabled", "disabled"]).optional()}).optional(), "dependabot_security_updates": z.object({"status": z.enum(["enabled", "disabled"]).optional()}).optional(), "secret_scanning": z.object({"status": z.enum(["enabled", "disabled"]).optional()}).optional(), "secret_scanning_push_protection": z.object({"status": z.enum(["enabled", "disabled"]).optional()}).optional(), "secret_scanning_non_provider_patterns": z.object({"status": z.enum(["enabled", "disabled"]).optional()}).optional(), "secret_scanning_ai_detection": z.object({"status": z.enum(["enabled", "disabled"]).optional()}).optional(), "secret_scanning_delegated_alert_dismissal": z.object({"status": z.enum(["enabled", "disabled"]).optional()}).optional(), "secret_scanning_delegated_bypass": z.object({"status": z.enum(["enabled", "disabled"]).optional()}).optional(), "secret_scanning_delegated_bypass_options": z.object({"reviewers": z.array(z.object({"reviewer_id": z.number().int(), "reviewer_type": z.enum(["TEAM", "ROLE"]), "mode": z.enum(["ALWAYS", "EXEMPT"]).optional()})).optional()}).optional()}).nullable()); +const short_branch = z.lazy(() => z.object({"name": z.string(), "commit": z.object({"sha": z.string(), "url": z.string()}), "protected": z.boolean(), "protection": branch_protection.optional(), "protection_url": z.string().optional()})); +const simple_installation = z.lazy(() => z.object({"id": z.number().int(), "node_id": z.string()})); +const simple_user = z.lazy(() => z.object({"name": z.string().nullable().optional(), "email": z.string().nullable().optional(), "login": z.string(), "id": z.number().int(), "node_id": z.string(), "avatar_url": z.string(), "gravatar_id": z.string().nullable(), "url": z.string(), "html_url": z.string(), "followers_url": z.string(), "following_url": z.string(), "gists_url": z.string(), "starred_url": z.string(), "subscriptions_url": z.string(), "organizations_url": z.string(), "repos_url": z.string(), "events_url": z.string(), "received_events_url": z.string(), "type": z.string(), "site_admin": z.boolean(), "starred_at": z.string().optional(), "user_view_type": z.string().optional()})); +const status = z.lazy(() => z.object({"url": z.string(), "avatar_url": z.string().nullable(), "id": z.number().int(), "node_id": z.string(), "state": z.string(), "description": z.string().nullable(), "target_url": z.string().nullable(), "context": z.string(), "created_at": z.string(), "updated_at": z.string(), "creator": nullable_simple_user})); +const sub_issues_summary = z.lazy(() => z.object({"total": z.number().int(), "completed": z.number().int(), "percent_completed": z.number().int()})); +const team = z.lazy(() => z.object({"id": z.number().int(), "node_id": z.string(), "name": z.string(), "slug": z.string(), "description": z.string().nullable(), "privacy": z.string().optional(), "notification_setting": z.string().optional(), "permission": z.string(), "permissions": z.object({"pull": z.boolean(), "triage": z.boolean(), "push": z.boolean(), "maintain": z.boolean(), "admin": z.boolean()}).optional(), "url": z.string(), "html_url": z.string(), "members_url": z.string(), "repositories_url": z.string(), "type": z.enum(["enterprise", "organization"]), "access_source": z.enum(["direct", "organization", "enterprise"]).optional(), "organization_id": z.number().int().optional(), "enterprise_id": z.number().int().optional(), "parent": nullable_team_simple})); +const team_simple = z.lazy(() => z.object({"id": z.number().int(), "node_id": z.string(), "url": z.string(), "members_url": z.string(), "name": z.string(), "description": z.string().nullable(), "permission": z.string(), "privacy": z.string().optional(), "notification_setting": z.string().optional(), "html_url": z.string(), "repositories_url": z.string(), "slug": z.string(), "ldap_dn": z.string().optional(), "type": z.enum(["enterprise", "organization"]), "organization_id": z.number().int().optional(), "enterprise_id": z.number().int().optional()})); +const verification = z.lazy(() => z.object({"verified": z.boolean(), "reason": z.string(), "payload": z.string().nullable(), "signature": z.string().nullable(), "verified_at": z.string().nullable()})); +const webhook_issues_closed = z.lazy(() => z.object({"action": z.literal("closed"), "enterprise": enterprise_webhooks.optional(), "installation": simple_installation.optional(), "issue": z.intersection(z.object({"active_lock_reason": z.enum(["resolved", "off-topic", "too heated", "spam"]).nullable(), "assignee": z.object({"avatar_url": z.string().optional(), "deleted": z.boolean().optional(), "email": z.string().nullable().optional(), "events_url": z.string().optional(), "followers_url": z.string().optional(), "following_url": z.string().optional(), "gists_url": z.string().optional(), "gravatar_id": z.string().optional(), "html_url": z.string().optional(), "id": z.number().int(), "login": z.string(), "name": z.string().optional(), "node_id": z.string().optional(), "organizations_url": z.string().optional(), "received_events_url": z.string().optional(), "repos_url": z.string().optional(), "site_admin": z.boolean().optional(), "starred_url": z.string().optional(), "subscriptions_url": z.string().optional(), "type": z.enum(["Bot", "User", "Organization", "Mannequin"]).optional(), "url": z.string().optional(), "user_view_type": z.string().optional()}).nullable().optional(), "assignees": z.array(z.object({"avatar_url": z.string().optional(), "deleted": z.boolean().optional(), "email": z.string().nullable().optional(), "events_url": z.string().optional(), "followers_url": z.string().optional(), "following_url": z.string().optional(), "gists_url": z.string().optional(), "gravatar_id": z.string().optional(), "html_url": z.string().optional(), "id": z.number().int(), "login": z.string(), "name": z.string().optional(), "node_id": z.string().optional(), "organizations_url": z.string().optional(), "received_events_url": z.string().optional(), "repos_url": z.string().optional(), "site_admin": z.boolean().optional(), "starred_url": z.string().optional(), "subscriptions_url": z.string().optional(), "type": z.enum(["Bot", "User", "Organization", "Mannequin"]).optional(), "url": z.string().optional(), "user_view_type": z.string().optional()}).nullable()), "author_association": z.enum(["COLLABORATOR", "CONTRIBUTOR", "FIRST_TIMER", "FIRST_TIME_CONTRIBUTOR", "MANNEQUIN", "MEMBER", "NONE", "OWNER"]), "body": z.string().nullable(), "closed_at": z.string().nullable(), "comments": z.number().int(), "comments_url": z.string(), "created_at": z.string(), "draft": z.boolean().optional(), "events_url": z.string(), "html_url": z.string(), "id": z.number().int(), "labels": z.array(z.object({"color": z.string(), "default": z.boolean(), "description": z.string().nullable(), "id": z.number().int(), "name": z.string(), "node_id": z.string(), "url": z.string()})).optional(), "labels_url": z.string(), "locked": z.boolean().optional(), "milestone": z.object({"closed_at": z.string().nullable(), "closed_issues": z.number().int(), "created_at": z.string(), "creator": z.object({"avatar_url": z.string().optional(), "deleted": z.boolean().optional(), "email": z.string().nullable().optional(), "events_url": z.string().optional(), "followers_url": z.string().optional(), "following_url": z.string().optional(), "gists_url": z.string().optional(), "gravatar_id": z.string().optional(), "html_url": z.string().optional(), "id": z.number().int(), "login": z.string(), "name": z.string().optional(), "node_id": z.string().optional(), "organizations_url": z.string().optional(), "received_events_url": z.string().optional(), "repos_url": z.string().optional(), "site_admin": z.boolean().optional(), "starred_url": z.string().optional(), "subscriptions_url": z.string().optional(), "type": z.enum(["Bot", "User", "Organization", "Mannequin"]).optional(), "url": z.string().optional(), "user_view_type": z.string().optional()}).nullable(), "description": z.string().nullable(), "due_on": z.string().nullable(), "html_url": z.string(), "id": z.number().int(), "labels_url": z.string(), "node_id": z.string(), "number": z.number().int(), "open_issues": z.number().int(), "state": z.enum(["open", "closed"]), "title": z.string(), "updated_at": z.string(), "url": z.string()}).nullable(), "node_id": z.string(), "number": z.number().int(), "performed_via_github_app": z.object({"created_at": z.string().nullable(), "description": z.string().nullable(), "events": z.array(z.enum(["branch_protection_rule", "check_run", "check_suite", "code_scanning_alert", "commit_comment", "content_reference", "create", "delete", "deployment", "deployment_review", "deployment_status", "deploy_key", "discussion", "discussion_comment", "fork", "gollum", "issues", "issue_comment", "label", "member", "membership", "milestone", "organization", "org_block", "page_build", "project", "project_card", "project_column", "public", "pull_request", "pull_request_review", "pull_request_review_comment", "push", "registry_package", "release", "repository", "repository_dispatch", "secret_scanning_alert", "star", "status", "team", "team_add", "watch", "workflow_dispatch", "workflow_run", "security_and_analysis", "reminder", "pull_request_review_thread"])).optional(), "external_url": z.string().nullable(), "html_url": z.string(), "id": z.number().int().nullable(), "name": z.string(), "node_id": z.string(), "owner": z.object({"avatar_url": z.string().optional(), "deleted": z.boolean().optional(), "email": z.string().nullable().optional(), "events_url": z.string().optional(), "followers_url": z.string().optional(), "following_url": z.string().optional(), "gists_url": z.string().optional(), "gravatar_id": z.string().optional(), "html_url": z.string().optional(), "id": z.number().int(), "login": z.string(), "name": z.string().optional(), "node_id": z.string().optional(), "organizations_url": z.string().optional(), "received_events_url": z.string().optional(), "repos_url": z.string().optional(), "site_admin": z.boolean().optional(), "starred_url": z.string().optional(), "subscriptions_url": z.string().optional(), "type": z.enum(["Bot", "User", "Organization"]).optional(), "url": z.string().optional(), "user_view_type": z.string().optional()}).nullable(), "permissions": z.object({"actions": z.enum(["read", "write"]).optional(), "administration": z.enum(["read", "write"]).optional(), "checks": z.enum(["read", "write"]).optional(), "content_references": z.enum(["read", "write"]).optional(), "contents": z.enum(["read", "write"]).optional(), "deployments": z.enum(["read", "write"]).optional(), "discussions": z.enum(["read", "write"]).optional(), "emails": z.enum(["read", "write"]).optional(), "environments": z.enum(["read", "write"]).optional(), "issues": z.enum(["read", "write"]).optional(), "keys": z.enum(["read", "write"]).optional(), "members": z.enum(["read", "write"]).optional(), "metadata": z.enum(["read", "write"]).optional(), "organization_administration": z.enum(["read", "write"]).optional(), "organization_hooks": z.enum(["read", "write"]).optional(), "organization_packages": z.enum(["read", "write"]).optional(), "organization_plan": z.enum(["read", "write"]).optional(), "organization_projects": z.enum(["read", "write", "admin"]).optional(), "organization_secrets": z.enum(["read", "write"]).optional(), "organization_self_hosted_runners": z.enum(["read", "write"]).optional(), "organization_user_blocking": z.enum(["read", "write"]).optional(), "packages": z.enum(["read", "write"]).optional(), "pages": z.enum(["read", "write"]).optional(), "pull_requests": z.enum(["read", "write"]).optional(), "repository_hooks": z.enum(["read", "write"]).optional(), "repository_projects": z.enum(["read", "write"]).optional(), "secret_scanning_alerts": z.enum(["read", "write"]).optional(), "secrets": z.enum(["read", "write"]).optional(), "security_events": z.enum(["read", "write"]).optional(), "security_scanning_alert": z.enum(["read", "write"]).optional(), "single_file": z.enum(["read", "write"]).optional(), "statuses": z.enum(["read", "write"]).optional(), "vulnerability_alerts": z.enum(["read", "write"]).optional(), "workflows": z.enum(["read", "write"]).optional()}).optional(), "slug": z.string().optional(), "updated_at": z.string().nullable()}).nullable().optional(), "pull_request": z.object({"diff_url": z.string().optional(), "html_url": z.string().optional(), "merged_at": z.string().nullable().optional(), "patch_url": z.string().optional(), "url": z.string().optional()}).optional(), "reactions": z.object({"+1": z.number().int(), "-1": z.number().int(), "confused": z.number().int(), "eyes": z.number().int(), "heart": z.number().int(), "hooray": z.number().int(), "laugh": z.number().int(), "rocket": z.number().int(), "total_count": z.number().int(), "url": z.string()}), "repository_url": z.string(), "pinned_comment": nullable_issue_comment.optional(), "sub_issues_summary": sub_issues_summary.optional(), "issue_dependencies_summary": issue_dependencies_summary.optional(), "issue_field_values": z.array(issue_field_value).optional(), "state": z.enum(["open", "closed"]).optional(), "state_reason": z.string().nullable().optional(), "timeline_url": z.string().optional(), "title": z.string(), "type": issue_type.optional(), "updated_at": z.string(), "url": z.string(), "user": z.object({"avatar_url": z.string().optional(), "deleted": z.boolean().optional(), "email": z.string().nullable().optional(), "events_url": z.string().optional(), "followers_url": z.string().optional(), "following_url": z.string().optional(), "gists_url": z.string().optional(), "gravatar_id": z.string().optional(), "html_url": z.string().optional(), "id": z.number().int(), "login": z.string(), "name": z.string().optional(), "node_id": z.string().optional(), "organizations_url": z.string().optional(), "received_events_url": z.string().optional(), "repos_url": z.string().optional(), "site_admin": z.boolean().optional(), "starred_url": z.string().optional(), "subscriptions_url": z.string().optional(), "type": z.enum(["Bot", "User", "Organization", "Mannequin"]).optional(), "url": z.string().optional(), "user_view_type": z.string().optional()}).nullable()}), z.object({"active_lock_reason": z.string().nullable().optional(), "assignee": z.record(z.string(), z.any()).nullable().optional(), "assignees": z.array(z.record(z.string(), z.any()).nullable()).optional(), "author_association": z.string().optional(), "body": z.string().nullable().optional(), "closed_at": z.string().nullable(), "comments": z.number().int().optional(), "comments_url": z.string().optional(), "created_at": z.string().optional(), "events_url": z.string().optional(), "html_url": z.string().optional(), "id": z.number().int().optional(), "labels": z.array(z.record(z.string(), z.any()).nullable()).optional(), "labels_url": z.string().optional(), "locked": z.boolean().optional(), "milestone": z.record(z.string(), z.any()).nullable().optional(), "node_id": z.string().optional(), "number": z.number().int().optional(), "performed_via_github_app": z.record(z.string(), z.any()).nullable().optional(), "reactions": z.object({"+1": z.number().int().optional(), "-1": z.number().int().optional(), "confused": z.number().int().optional(), "eyes": z.number().int().optional(), "heart": z.number().int().optional(), "hooray": z.number().int().optional(), "laugh": z.number().int().optional(), "rocket": z.number().int().optional(), "total_count": z.number().int().optional(), "url": z.string().optional()}).optional(), "repository_url": z.string().optional(), "state": z.enum(["closed", "open"]), "timeline_url": z.string().optional(), "title": z.string().optional(), "updated_at": z.string().optional(), "url": z.string().optional(), "user": z.object({"avatar_url": z.string().optional(), "events_url": z.string().optional(), "followers_url": z.string().optional(), "following_url": z.string().optional(), "gists_url": z.string().optional(), "gravatar_id": z.string().optional(), "html_url": z.string().optional(), "id": z.number().int().optional(), "login": z.string().optional(), "node_id": z.string().optional(), "organizations_url": z.string().optional(), "received_events_url": z.string().optional(), "repos_url": z.string().optional(), "site_admin": z.boolean().optional(), "starred_url": z.string().optional(), "subscriptions_url": z.string().optional(), "type": z.string().optional(), "url": z.string().optional(), "user_view_type": z.string().optional()}).optional()})), "organization": organization_simple_webhooks.optional(), "repository": repository_webhooks, "sender": simple_user})); +const webhook_issues_opened = z.lazy(() => z.object({"action": z.literal("opened"), "changes": z.object({"old_issue": z.object({"active_lock_reason": z.enum(["resolved", "off-topic", "too heated", "spam"]).nullable().optional(), "assignee": z.object({"avatar_url": z.string().optional(), "deleted": z.boolean().optional(), "email": z.string().nullable().optional(), "events_url": z.string().optional(), "followers_url": z.string().optional(), "following_url": z.string().optional(), "gists_url": z.string().optional(), "gravatar_id": z.string().optional(), "html_url": z.string().optional(), "id": z.number().int(), "login": z.string(), "name": z.string().optional(), "node_id": z.string().optional(), "organizations_url": z.string().optional(), "received_events_url": z.string().optional(), "repos_url": z.string().optional(), "site_admin": z.boolean().optional(), "starred_url": z.string().optional(), "subscriptions_url": z.string().optional(), "type": z.enum(["Bot", "User", "Organization"]).optional(), "url": z.string().optional(), "user_view_type": z.string().optional()}).nullable().optional(), "assignees": z.array(z.object({"avatar_url": z.string().optional(), "deleted": z.boolean().optional(), "email": z.string().nullable().optional(), "events_url": z.string().optional(), "followers_url": z.string().optional(), "following_url": z.string().optional(), "gists_url": z.string().optional(), "gravatar_id": z.string().optional(), "html_url": z.string().optional(), "id": z.number().int(), "login": z.string(), "name": z.string().optional(), "node_id": z.string().optional(), "organizations_url": z.string().optional(), "received_events_url": z.string().optional(), "repos_url": z.string().optional(), "site_admin": z.boolean().optional(), "starred_url": z.string().optional(), "subscriptions_url": z.string().optional(), "type": z.enum(["Bot", "User", "Organization"]).optional(), "url": z.string().optional(), "user_view_type": z.string().optional()}).nullable()).optional(), "author_association": z.enum(["COLLABORATOR", "CONTRIBUTOR", "FIRST_TIMER", "FIRST_TIME_CONTRIBUTOR", "MANNEQUIN", "MEMBER", "NONE", "OWNER"]).optional(), "body": z.string().nullable().optional(), "closed_at": z.string().nullable().optional(), "comments": z.number().int().optional(), "comments_url": z.string().optional(), "created_at": z.string().optional(), "draft": z.boolean().optional(), "events_url": z.string().optional(), "html_url": z.string().optional(), "id": z.number().int(), "labels": z.array(z.object({"color": z.string(), "default": z.boolean(), "description": z.string().nullable(), "id": z.number().int(), "name": z.string(), "node_id": z.string(), "url": z.string()})).optional(), "labels_url": z.string().optional(), "locked": z.boolean().optional(), "milestone": z.object({"closed_at": z.string().nullable(), "closed_issues": z.number().int(), "created_at": z.string(), "creator": z.object({"avatar_url": z.string().optional(), "deleted": z.boolean().optional(), "email": z.string().nullable().optional(), "events_url": z.string().optional(), "followers_url": z.string().optional(), "following_url": z.string().optional(), "gists_url": z.string().optional(), "gravatar_id": z.string().optional(), "html_url": z.string().optional(), "id": z.number().int(), "login": z.string(), "name": z.string().optional(), "node_id": z.string().optional(), "organizations_url": z.string().optional(), "received_events_url": z.string().optional(), "repos_url": z.string().optional(), "site_admin": z.boolean().optional(), "starred_url": z.string().optional(), "subscriptions_url": z.string().optional(), "type": z.enum(["Bot", "User", "Organization"]).optional(), "url": z.string().optional(), "user_view_type": z.string().optional()}).nullable(), "description": z.string().nullable(), "due_on": z.string().nullable(), "html_url": z.string(), "id": z.number().int(), "labels_url": z.string(), "node_id": z.string(), "number": z.number().int(), "open_issues": z.number().int(), "state": z.enum(["open", "closed"]), "title": z.string(), "updated_at": z.string(), "url": z.string()}).nullable().optional(), "node_id": z.string().optional(), "number": z.number().int(), "performed_via_github_app": z.object({"created_at": z.string().nullable(), "description": z.string().nullable(), "events": z.array(z.enum(["branch_protection_rule", "check_run", "check_suite", "code_scanning_alert", "commit_comment", "content_reference", "create", "delete", "deployment", "deployment_review", "deployment_status", "deploy_key", "discussion", "discussion_comment", "fork", "gollum", "issues", "issue_comment", "label", "member", "membership", "milestone", "organization", "org_block", "page_build", "project", "project_card", "project_column", "public", "pull_request", "pull_request_review", "pull_request_review_comment", "push", "registry_package", "release", "repository", "repository_dispatch", "secret_scanning_alert", "star", "status", "team", "team_add", "watch", "workflow_dispatch", "workflow_run"])).optional(), "external_url": z.string().nullable(), "html_url": z.string(), "id": z.number().int().nullable(), "name": z.string(), "node_id": z.string(), "owner": z.object({"avatar_url": z.string().optional(), "deleted": z.boolean().optional(), "email": z.string().nullable().optional(), "events_url": z.string().optional(), "followers_url": z.string().optional(), "following_url": z.string().optional(), "gists_url": z.string().optional(), "gravatar_id": z.string().optional(), "html_url": z.string().optional(), "id": z.number().int(), "login": z.string(), "name": z.string().optional(), "node_id": z.string().optional(), "organizations_url": z.string().optional(), "received_events_url": z.string().optional(), "repos_url": z.string().optional(), "site_admin": z.boolean().optional(), "starred_url": z.string().optional(), "subscriptions_url": z.string().optional(), "type": z.enum(["Bot", "User", "Organization"]).optional(), "url": z.string().optional(), "user_view_type": z.string().optional()}).nullable(), "permissions": z.object({"actions": z.enum(["read", "write"]).optional(), "administration": z.enum(["read", "write"]).optional(), "checks": z.enum(["read", "write"]).optional(), "content_references": z.enum(["read", "write"]).optional(), "contents": z.enum(["read", "write"]).optional(), "deployments": z.enum(["read", "write"]).optional(), "discussions": z.enum(["read", "write"]).optional(), "emails": z.enum(["read", "write"]).optional(), "environments": z.enum(["read", "write"]).optional(), "issues": z.enum(["read", "write"]).optional(), "keys": z.enum(["read", "write"]).optional(), "members": z.enum(["read", "write"]).optional(), "metadata": z.enum(["read", "write"]).optional(), "organization_administration": z.enum(["read", "write"]).optional(), "organization_hooks": z.enum(["read", "write"]).optional(), "organization_packages": z.enum(["read", "write"]).optional(), "organization_plan": z.enum(["read", "write"]).optional(), "organization_projects": z.enum(["read", "write"]).optional(), "organization_secrets": z.enum(["read", "write"]).optional(), "organization_self_hosted_runners": z.enum(["read", "write"]).optional(), "organization_user_blocking": z.enum(["read", "write"]).optional(), "packages": z.enum(["read", "write"]).optional(), "pages": z.enum(["read", "write"]).optional(), "pull_requests": z.enum(["read", "write"]).optional(), "repository_hooks": z.enum(["read", "write"]).optional(), "repository_projects": z.enum(["read", "write"]).optional(), "secret_scanning_alerts": z.enum(["read", "write"]).optional(), "secrets": z.enum(["read", "write"]).optional(), "security_events": z.enum(["read", "write"]).optional(), "security_scanning_alert": z.enum(["read", "write"]).optional(), "single_file": z.enum(["read", "write"]).optional(), "statuses": z.enum(["read", "write"]).optional(), "vulnerability_alerts": z.enum(["read", "write"]).optional(), "workflows": z.enum(["read", "write"]).optional()}).optional(), "slug": z.string().optional(), "updated_at": z.string().nullable()}).nullable().optional(), "pull_request": z.object({"diff_url": z.string().optional(), "html_url": z.string().optional(), "merged_at": z.string().nullable().optional(), "patch_url": z.string().optional(), "url": z.string().optional()}).optional(), "reactions": z.object({"+1": z.number().int(), "-1": z.number().int(), "confused": z.number().int(), "eyes": z.number().int(), "heart": z.number().int(), "hooray": z.number().int(), "laugh": z.number().int(), "rocket": z.number().int(), "total_count": z.number().int(), "url": z.string()}).optional(), "repository_url": z.string().optional(), "sub_issues_summary": sub_issues_summary.optional(), "issue_dependencies_summary": issue_dependencies_summary.optional(), "issue_field_values": z.array(issue_field_value).optional(), "state": z.enum(["open", "closed"]).optional(), "state_reason": z.string().nullable().optional(), "timeline_url": z.string().optional(), "title": z.string().optional(), "updated_at": z.string().optional(), "url": z.string().optional(), "pinned_comment": nullable_issue_comment.optional(), "user": z.object({"avatar_url": z.string().optional(), "deleted": z.boolean().optional(), "email": z.string().nullable().optional(), "events_url": z.string().optional(), "followers_url": z.string().optional(), "following_url": z.string().optional(), "gists_url": z.string().optional(), "gravatar_id": z.string().optional(), "html_url": z.string().optional(), "id": z.number().int(), "login": z.string(), "name": z.string().optional(), "node_id": z.string().optional(), "organizations_url": z.string().optional(), "received_events_url": z.string().optional(), "repos_url": z.string().optional(), "site_admin": z.boolean().optional(), "starred_url": z.string().optional(), "subscriptions_url": z.string().optional(), "type": z.enum(["Bot", "User", "Organization"]).optional(), "url": z.string().optional(), "user_view_type": z.string().optional()}).nullable().optional(), "type": issue_type.optional()}).nullable(), "old_repository": z.object({"allow_auto_merge": z.boolean().optional(), "allow_forking": z.boolean().optional(), "allow_merge_commit": z.boolean().optional(), "allow_rebase_merge": z.boolean().optional(), "allow_squash_merge": z.boolean().optional(), "allow_update_branch": z.boolean().optional(), "archive_url": z.string(), "archived": z.boolean(), "assignees_url": z.string(), "blobs_url": z.string(), "branches_url": z.string(), "clone_url": z.string(), "collaborators_url": z.string(), "comments_url": z.string(), "commits_url": z.string(), "compare_url": z.string(), "contents_url": z.string(), "contributors_url": z.string(), "created_at": z.union([z.number().int(), z.string()]), "custom_properties": z.record(z.string(), z.any()).optional(), "default_branch": z.string(), "delete_branch_on_merge": z.boolean().optional(), "deployments_url": z.string(), "description": z.string().nullable(), "disabled": z.boolean().optional(), "downloads_url": z.string(), "events_url": z.string(), "fork": z.boolean(), "forks": z.number().int(), "forks_count": z.number().int(), "forks_url": z.string(), "full_name": z.string(), "git_commits_url": z.string(), "git_refs_url": z.string(), "git_tags_url": z.string(), "git_url": z.string(), "has_discussions": z.boolean().optional(), "has_pull_requests": z.boolean().optional(), "pull_request_creation_policy": z.enum(["all", "collaborators_only"]).optional(), "has_downloads": z.boolean(), "has_issues": z.boolean(), "has_pages": z.boolean(), "has_projects": z.boolean(), "has_wiki": z.boolean(), "homepage": z.string().nullable(), "hooks_url": z.string(), "html_url": z.string(), "id": z.number().int(), "is_template": z.boolean().optional(), "issue_comment_url": z.string(), "issue_events_url": z.string(), "issues_url": z.string(), "keys_url": z.string(), "labels_url": z.string(), "language": z.string().nullable(), "languages_url": z.string(), "license": z.object({"key": z.string(), "name": z.string(), "node_id": z.string(), "spdx_id": z.string(), "url": z.string().nullable()}).nullable(), "master_branch": z.string().optional(), "merges_url": z.string(), "milestones_url": z.string(), "mirror_url": z.string().nullable(), "name": z.string(), "node_id": z.string(), "notifications_url": z.string(), "open_issues": z.number().int(), "open_issues_count": z.number().int(), "organization": z.string().optional(), "owner": z.object({"avatar_url": z.string().optional(), "deleted": z.boolean().optional(), "email": z.string().nullable().optional(), "events_url": z.string().optional(), "followers_url": z.string().optional(), "following_url": z.string().optional(), "gists_url": z.string().optional(), "gravatar_id": z.string().optional(), "html_url": z.string().optional(), "id": z.number().int(), "login": z.string(), "name": z.string().optional(), "node_id": z.string().optional(), "organizations_url": z.string().optional(), "received_events_url": z.string().optional(), "repos_url": z.string().optional(), "site_admin": z.boolean().optional(), "starred_url": z.string().optional(), "subscriptions_url": z.string().optional(), "type": z.enum(["Bot", "User", "Organization"]).optional(), "url": z.string().optional(), "user_view_type": z.string().optional()}).nullable(), "permissions": z.object({"admin": z.boolean(), "maintain": z.boolean().optional(), "pull": z.boolean(), "push": z.boolean(), "triage": z.boolean().optional()}).optional(), "private": z.boolean(), "public": z.boolean().optional(), "pulls_url": z.string(), "pushed_at": z.union([z.number().int(), z.string()]).nullable(), "releases_url": z.string(), "role_name": z.string().nullable().optional(), "size": z.number().int(), "ssh_url": z.string(), "stargazers": z.number().int().optional(), "stargazers_count": z.number().int(), "stargazers_url": z.string(), "statuses_url": z.string(), "subscribers_url": z.string(), "subscription_url": z.string(), "svn_url": z.string(), "tags_url": z.string(), "teams_url": z.string(), "topics": z.array(z.string()), "trees_url": z.string(), "updated_at": z.string(), "url": z.string(), "visibility": z.enum(["public", "private", "internal"]), "watchers": z.number().int(), "watchers_count": z.number().int(), "web_commit_signoff_required": z.boolean().optional()})}).optional(), "enterprise": enterprise_webhooks.optional(), "installation": simple_installation.optional(), "issue": z.object({"active_lock_reason": z.enum(["resolved", "off-topic", "too heated", "spam"]).nullable(), "assignee": z.object({"avatar_url": z.string().optional(), "deleted": z.boolean().optional(), "email": z.string().nullable().optional(), "events_url": z.string().optional(), "followers_url": z.string().optional(), "following_url": z.string().optional(), "gists_url": z.string().optional(), "gravatar_id": z.string().optional(), "html_url": z.string().optional(), "id": z.number().int(), "login": z.string(), "name": z.string().optional(), "node_id": z.string().optional(), "organizations_url": z.string().optional(), "received_events_url": z.string().optional(), "repos_url": z.string().optional(), "site_admin": z.boolean().optional(), "starred_url": z.string().optional(), "subscriptions_url": z.string().optional(), "type": z.enum(["Bot", "User", "Organization"]).optional(), "url": z.string().optional(), "user_view_type": z.string().optional()}).nullable().optional(), "assignees": z.array(z.object({"avatar_url": z.string().optional(), "deleted": z.boolean().optional(), "email": z.string().nullable().optional(), "events_url": z.string().optional(), "followers_url": z.string().optional(), "following_url": z.string().optional(), "gists_url": z.string().optional(), "gravatar_id": z.string().optional(), "html_url": z.string().optional(), "id": z.number().int(), "login": z.string(), "name": z.string().optional(), "node_id": z.string().optional(), "organizations_url": z.string().optional(), "received_events_url": z.string().optional(), "repos_url": z.string().optional(), "site_admin": z.boolean().optional(), "starred_url": z.string().optional(), "subscriptions_url": z.string().optional(), "type": z.enum(["Bot", "User", "Organization"]).optional(), "url": z.string().optional(), "user_view_type": z.string().optional()}).nullable()), "author_association": z.enum(["COLLABORATOR", "CONTRIBUTOR", "FIRST_TIMER", "FIRST_TIME_CONTRIBUTOR", "MANNEQUIN", "MEMBER", "NONE", "OWNER"]), "body": z.string().nullable(), "closed_at": z.string().nullable(), "comments": z.number().int(), "comments_url": z.string(), "created_at": z.string(), "draft": z.boolean().optional(), "events_url": z.string(), "html_url": z.string(), "id": z.number().int(), "labels": z.array(z.object({"color": z.string(), "default": z.boolean(), "description": z.string().nullable(), "id": z.number().int(), "name": z.string(), "node_id": z.string(), "url": z.string()})).optional(), "labels_url": z.string(), "locked": z.boolean().optional(), "milestone": z.object({"closed_at": z.string().nullable(), "closed_issues": z.number().int(), "created_at": z.string(), "creator": z.object({"avatar_url": z.string().optional(), "deleted": z.boolean().optional(), "email": z.string().nullable().optional(), "events_url": z.string().optional(), "followers_url": z.string().optional(), "following_url": z.string().optional(), "gists_url": z.string().optional(), "gravatar_id": z.string().optional(), "html_url": z.string().optional(), "id": z.number().int(), "login": z.string(), "name": z.string().optional(), "node_id": z.string().optional(), "organizations_url": z.string().optional(), "received_events_url": z.string().optional(), "repos_url": z.string().optional(), "site_admin": z.boolean().optional(), "starred_url": z.string().optional(), "subscriptions_url": z.string().optional(), "type": z.enum(["Bot", "User", "Organization", "Mannequin"]).optional(), "url": z.string().optional(), "user_view_type": z.string().optional()}).nullable(), "description": z.string().nullable(), "due_on": z.string().nullable(), "html_url": z.string(), "id": z.number().int(), "labels_url": z.string(), "node_id": z.string(), "number": z.number().int(), "open_issues": z.number().int(), "state": z.enum(["open", "closed"]), "title": z.string(), "updated_at": z.string(), "url": z.string()}).nullable(), "node_id": z.string(), "number": z.number().int(), "performed_via_github_app": z.object({"created_at": z.string().nullable(), "description": z.string().nullable(), "events": z.array(z.enum(["branch_protection_rule", "check_run", "check_suite", "code_scanning_alert", "commit_comment", "content_reference", "create", "delete", "deployment", "deployment_review", "deployment_status", "deploy_key", "discussion", "discussion_comment", "fork", "gollum", "issues", "issue_comment", "label", "member", "membership", "milestone", "organization", "org_block", "page_build", "project", "project_card", "project_column", "public", "pull_request", "pull_request_review", "pull_request_review_comment", "push", "registry_package", "release", "repository", "repository_dispatch", "secret_scanning_alert", "star", "status", "team", "team_add", "watch", "workflow_dispatch", "workflow_run", "security_and_analysis", "pull_request_review_thread", "reminder"])).optional(), "external_url": z.string().nullable(), "html_url": z.string(), "id": z.number().int().nullable(), "name": z.string(), "node_id": z.string(), "owner": z.object({"avatar_url": z.string().optional(), "deleted": z.boolean().optional(), "email": z.string().nullable().optional(), "events_url": z.string().optional(), "followers_url": z.string().optional(), "following_url": z.string().optional(), "gists_url": z.string().optional(), "gravatar_id": z.string().optional(), "html_url": z.string().optional(), "id": z.number().int(), "login": z.string(), "name": z.string().optional(), "node_id": z.string().optional(), "organizations_url": z.string().optional(), "received_events_url": z.string().optional(), "repos_url": z.string().optional(), "site_admin": z.boolean().optional(), "starred_url": z.string().optional(), "subscriptions_url": z.string().optional(), "type": z.enum(["Bot", "User", "Organization"]).optional(), "url": z.string().optional(), "user_view_type": z.string().optional()}).nullable(), "permissions": z.object({"actions": z.enum(["read", "write"]).optional(), "administration": z.enum(["read", "write"]).optional(), "checks": z.enum(["read", "write"]).optional(), "content_references": z.enum(["read", "write"]).optional(), "contents": z.enum(["read", "write"]).optional(), "deployments": z.enum(["read", "write"]).optional(), "discussions": z.enum(["read", "write"]).optional(), "emails": z.enum(["read", "write"]).optional(), "environments": z.enum(["read", "write"]).optional(), "issues": z.enum(["read", "write"]).optional(), "keys": z.enum(["read", "write"]).optional(), "members": z.enum(["read", "write"]).optional(), "metadata": z.enum(["read", "write"]).optional(), "organization_administration": z.enum(["read", "write"]).optional(), "organization_hooks": z.enum(["read", "write"]).optional(), "organization_packages": z.enum(["read", "write"]).optional(), "organization_plan": z.enum(["read", "write"]).optional(), "organization_projects": z.enum(["read", "write", "admin"]).optional(), "organization_secrets": z.enum(["read", "write"]).optional(), "organization_self_hosted_runners": z.enum(["read", "write"]).optional(), "organization_user_blocking": z.enum(["read", "write"]).optional(), "packages": z.enum(["read", "write"]).optional(), "pages": z.enum(["read", "write"]).optional(), "pull_requests": z.enum(["read", "write"]).optional(), "repository_hooks": z.enum(["read", "write"]).optional(), "repository_projects": z.enum(["read", "write"]).optional(), "secret_scanning_alerts": z.enum(["read", "write"]).optional(), "secrets": z.enum(["read", "write"]).optional(), "security_events": z.enum(["read", "write"]).optional(), "security_scanning_alert": z.enum(["read", "write"]).optional(), "single_file": z.enum(["read", "write"]).optional(), "statuses": z.enum(["read", "write"]).optional(), "vulnerability_alerts": z.enum(["read", "write"]).optional(), "workflows": z.enum(["read", "write"]).optional()}).optional(), "slug": z.string().optional(), "updated_at": z.string().nullable()}).nullable().optional(), "pull_request": z.object({"diff_url": z.string().optional(), "html_url": z.string().optional(), "merged_at": z.string().nullable().optional(), "patch_url": z.string().optional(), "url": z.string().optional()}).optional(), "reactions": z.object({"+1": z.number().int(), "-1": z.number().int(), "confused": z.number().int(), "eyes": z.number().int(), "heart": z.number().int(), "hooray": z.number().int(), "laugh": z.number().int(), "rocket": z.number().int(), "total_count": z.number().int(), "url": z.string()}), "repository_url": z.string(), "sub_issues_summary": sub_issues_summary.optional(), "issue_dependencies_summary": issue_dependencies_summary.optional(), "issue_field_values": z.array(issue_field_value).optional(), "state": z.enum(["open", "closed"]).optional(), "state_reason": z.string().nullable().optional(), "timeline_url": z.string().optional(), "title": z.string(), "type": issue_type.optional(), "updated_at": z.string(), "url": z.string(), "pinned_comment": nullable_issue_comment.optional(), "user": z.object({"avatar_url": z.string().optional(), "deleted": z.boolean().optional(), "email": z.string().nullable().optional(), "events_url": z.string().optional(), "followers_url": z.string().optional(), "following_url": z.string().optional(), "gists_url": z.string().optional(), "gravatar_id": z.string().optional(), "html_url": z.string().optional(), "id": z.number().int(), "login": z.string(), "name": z.string().optional(), "node_id": z.string().optional(), "organizations_url": z.string().optional(), "received_events_url": z.string().optional(), "repos_url": z.string().optional(), "site_admin": z.boolean().optional(), "starred_url": z.string().optional(), "subscriptions_url": z.string().optional(), "type": z.enum(["Bot", "User", "Organization"]).optional(), "url": z.string().optional(), "user_view_type": z.string().optional()}).nullable()}), "organization": organization_simple_webhooks.optional(), "repository": repository_webhooks, "sender": simple_user})); +const webhook_pull_request_closed = z.lazy(() => z.object({"action": z.literal("closed"), "enterprise": enterprise_webhooks.optional(), "installation": simple_installation.optional(), "number": webhooks_number, "organization": organization_simple_webhooks.optional(), "pull_request": pull_request_webhook, "repository": repository_webhooks, "sender": simple_user})); +const webhook_pull_request_opened = z.lazy(() => z.object({"action": z.literal("opened"), "enterprise": enterprise_webhooks.optional(), "installation": simple_installation.optional(), "number": webhooks_number, "organization": organization_simple_webhooks.optional(), "pull_request": pull_request_webhook, "repository": repository_webhooks, "sender": simple_user})); +const webhook_push = z.lazy(() => z.object({"after": z.string(), "base_ref": webhooks_nullable_string, "before": z.string(), "commits": z.array(z.object({"added": z.array(z.string()).optional(), "author": z.object({"date": z.string().optional(), "email": z.string().nullable(), "name": z.string(), "username": z.string().optional()}), "committer": z.object({"date": z.string().optional(), "email": z.string().nullable(), "name": z.string(), "username": z.string().optional()}), "distinct": z.boolean(), "id": z.string(), "message": z.string(), "modified": z.array(z.string()).optional(), "removed": z.array(z.string()).optional(), "timestamp": z.string(), "tree_id": z.string(), "url": z.string()})), "compare": z.string(), "created": z.boolean(), "deleted": z.boolean(), "enterprise": enterprise_webhooks.optional(), "forced": z.boolean(), "head_commit": z.object({"added": z.array(z.string()).optional(), "author": z.object({"date": z.string().optional(), "email": z.string().nullable(), "name": z.string(), "username": z.string().optional()}), "committer": z.object({"date": z.string().optional(), "email": z.string().nullable(), "name": z.string(), "username": z.string().optional()}), "distinct": z.boolean(), "id": z.string(), "message": z.string(), "modified": z.array(z.string()).optional(), "removed": z.array(z.string()).optional(), "timestamp": z.string(), "tree_id": z.string(), "url": z.string()}).nullable(), "installation": simple_installation.optional(), "organization": organization_simple_webhooks.optional(), "pusher": z.object({"date": z.string().optional(), "email": z.string().nullable().optional(), "name": z.string(), "username": z.string().optional()}), "ref": z.string(), "repository": z.object({"allow_auto_merge": z.boolean().optional(), "allow_forking": z.boolean().optional(), "allow_merge_commit": z.boolean().optional(), "allow_rebase_merge": z.boolean().optional(), "allow_squash_merge": z.boolean().optional(), "allow_update_branch": z.boolean().optional(), "archive_url": z.string(), "archived": z.boolean(), "assignees_url": z.string(), "blobs_url": z.string(), "branches_url": z.string(), "clone_url": z.string(), "collaborators_url": z.string(), "comments_url": z.string(), "commits_url": z.string(), "compare_url": z.string(), "contents_url": z.string(), "contributors_url": z.string(), "created_at": z.union([z.number().int(), z.string()]), "custom_properties": z.record(z.string(), z.any()).optional(), "default_branch": z.string(), "delete_branch_on_merge": z.boolean().optional(), "deployments_url": z.string(), "description": z.string().nullable(), "disabled": z.boolean().optional(), "downloads_url": z.string(), "events_url": z.string(), "fork": z.boolean(), "forks": z.number().int(), "forks_count": z.number().int(), "forks_url": z.string(), "full_name": z.string(), "git_commits_url": z.string(), "git_refs_url": z.string(), "git_tags_url": z.string(), "git_url": z.string(), "has_downloads": z.boolean(), "has_issues": z.boolean(), "has_pages": z.boolean(), "has_projects": z.boolean(), "has_wiki": z.boolean(), "has_discussions": z.boolean(), "has_pull_requests": z.boolean().optional(), "pull_request_creation_policy": z.enum(["all", "collaborators_only"]).optional(), "homepage": z.string().nullable(), "hooks_url": z.string(), "html_url": z.string(), "id": z.number().int(), "is_template": z.boolean().optional(), "issue_comment_url": z.string(), "issue_events_url": z.string(), "issues_url": z.string(), "keys_url": z.string(), "labels_url": z.string(), "language": z.string().nullable(), "languages_url": z.string(), "license": z.object({"key": z.string(), "name": z.string(), "node_id": z.string(), "spdx_id": z.string(), "url": z.string().nullable()}).nullable(), "master_branch": z.string().optional(), "merges_url": z.string(), "milestones_url": z.string(), "mirror_url": z.string().nullable(), "name": z.string(), "node_id": z.string(), "notifications_url": z.string(), "open_issues": z.number().int(), "open_issues_count": z.number().int(), "organization": z.string().optional(), "owner": z.object({"avatar_url": z.string().optional(), "deleted": z.boolean().optional(), "email": z.string().nullable().optional(), "events_url": z.string().optional(), "followers_url": z.string().optional(), "following_url": z.string().optional(), "gists_url": z.string().optional(), "gravatar_id": z.string().optional(), "html_url": z.string().optional(), "id": z.number().int(), "login": z.string(), "name": z.string().optional(), "node_id": z.string().optional(), "organizations_url": z.string().optional(), "received_events_url": z.string().optional(), "repos_url": z.string().optional(), "site_admin": z.boolean().optional(), "starred_url": z.string().optional(), "subscriptions_url": z.string().optional(), "type": z.enum(["Bot", "User", "Organization"]).optional(), "url": z.string().optional(), "user_view_type": z.string().optional()}).nullable(), "permissions": z.object({"admin": z.boolean(), "maintain": z.boolean().optional(), "pull": z.boolean(), "push": z.boolean(), "triage": z.boolean().optional()}).optional(), "private": z.boolean(), "public": z.boolean().optional(), "pulls_url": z.string(), "pushed_at": z.union([z.number().int(), z.string()]).nullable(), "releases_url": z.string(), "role_name": z.string().nullable().optional(), "size": z.number().int(), "ssh_url": z.string(), "stargazers": z.number().int().optional(), "stargazers_count": z.number().int(), "stargazers_url": z.string(), "statuses_url": z.string(), "subscribers_url": z.string(), "subscription_url": z.string(), "svn_url": z.string(), "tags_url": z.string(), "teams_url": z.string(), "topics": z.array(z.string()), "trees_url": z.string(), "updated_at": z.string(), "url": z.string(), "visibility": z.enum(["public", "private", "internal"]), "watchers": z.number().int(), "watchers_count": z.number().int(), "web_commit_signoff_required": z.boolean().optional()}), "sender": simple_user.optional()})); +const webhooks_nullable_string = z.lazy(() => z.string().nullable()); +const webhooks_number = z.lazy(() => z.number().int()); +const workflow = z.lazy(() => z.object({"id": z.number().int(), "node_id": z.string(), "name": z.string(), "path": z.string(), "state": z.enum(["active", "deleted", "disabled_fork", "disabled_inactivity", "disabled_manually"]), "created_at": z.string(), "updated_at": z.string(), "url": z.string(), "html_url": z.string(), "badge_url": z.string(), "deleted_at": z.string().optional()})); +const workflow_run = z.lazy(() => z.object({"id": z.number().int(), "name": z.string().nullable().optional(), "node_id": z.string(), "check_suite_id": z.number().int().optional(), "check_suite_node_id": z.string().optional(), "head_branch": z.string().nullable(), "head_sha": z.string(), "path": z.string(), "run_number": z.number().int(), "run_attempt": z.number().int().optional(), "referenced_workflows": z.array(referenced_workflow).nullable().optional(), "event": z.string(), "status": z.string().nullable(), "conclusion": z.string().nullable(), "workflow_id": z.number().int(), "url": z.string(), "html_url": z.string(), "pull_requests": z.array(pull_request_minimal).nullable(), "created_at": z.string(), "updated_at": z.string(), "actor": simple_user.optional(), "triggering_actor": simple_user.optional(), "run_started_at": z.string().optional(), "jobs_url": z.string(), "logs_url": z.string(), "check_suite_url": z.string(), "artifacts_url": z.string(), "cancel_url": z.string(), "rerun_url": z.string(), "previous_attempt_url": z.string().nullable().optional(), "workflow_url": z.string(), "head_commit": nullable_simple_commit, "repository": minimal_repository, "head_repository": minimal_repository, "head_repository_id": z.number().int().optional(), "display_title": z.string()})); + +export const schemas = { + "author-association": author_association, + "auto-merge": auto_merge, + "branch-protection": branch_protection, + "branch-restriction-policy": branch_restriction_policy, + "branch-with-protection": branch_with_protection, + "check-run": check_run, + "code-of-conduct": code_of_conduct, + "code-of-conduct-simple": code_of_conduct_simple, + commit, + "deployment-simple": deployment_simple, + "diff-entry": diff_entry, + "empty-object": empty_object, + enterprise, + "enterprise-webhooks": enterprise_webhooks, + "full-repository": full_repository, + "git-ref": git_ref, + integration, + issue, + "issue-comment": issue_comment, + "issue-dependencies-summary": issue_dependencies_summary, + "issue-field-value": issue_field_value, + "issue-type": issue_type, + label, + link, + milestone, + "minimal-repository": minimal_repository, + "nullable-git-user": nullable_git_user, + "nullable-integration": nullable_integration, + "nullable-issue-comment": nullable_issue_comment, + "nullable-issue-comment-minimized": nullable_issue_comment_minimized, + "nullable-license-simple": nullable_license_simple, + "nullable-milestone": nullable_milestone, + "nullable-pinned-issue-comment": nullable_pinned_issue_comment, + "nullable-repository": nullable_repository, + "nullable-simple-commit": nullable_simple_commit, + "nullable-simple-user": nullable_simple_user, + "nullable-team-simple": nullable_team_simple, + "organization-simple-webhooks": organization_simple_webhooks, + "protected-branch-admin-enforced": protected_branch_admin_enforced, + "protected-branch-pull-request-review": protected_branch_pull_request_review, + "protected-branch-required-status-check": protected_branch_required_status_check, + "pull-request": pull_request, + "pull-request-merge-result": pull_request_merge_result, + "pull-request-minimal": pull_request_minimal, + "pull-request-review": pull_request_review, + "pull-request-review-comment": pull_request_review_comment, + "pull-request-simple": pull_request_simple, + "pull-request-stack": pull_request_stack, + "pull-request-webhook": pull_request_webhook, + "reaction-rollup": reaction_rollup, + "referenced-workflow": referenced_workflow, + release, + "release-asset": release_asset, + repository, + "repository-webhooks": repository_webhooks, + "security-and-analysis": security_and_analysis, + "short-branch": short_branch, + "simple-installation": simple_installation, + "simple-user": simple_user, + status, + "sub-issues-summary": sub_issues_summary, + team, + "team-simple": team_simple, + verification, + "webhook-issues-closed": webhook_issues_closed, + "webhook-issues-opened": webhook_issues_opened, + "webhook-pull-request-closed": webhook_pull_request_closed, + "webhook-pull-request-opened": webhook_pull_request_opened, + "webhook-push": webhook_push, + webhooks_nullable_string, + webhooks_number, + workflow, + "workflow-run": workflow_run, +}; + +export const recursiveSchemaNames = [ +] as const; diff --git a/actions/github-action/src/helpers.ts b/actions/github-action/src/helpers.ts index e69c5ab..ae0cb27 100644 --- a/actions/github-action/src/helpers.ts +++ b/actions/github-action/src/helpers.ts @@ -1,5 +1,10 @@ import axios, { AxiosError } from "axios" import { FunctionContext, RuntimeError } from "@code0-tech/hercules" +import { + GitHubLabelReference, + GitHubMilestoneReference, + GitHubUserReference, +} from "./data_types/references/githubReferences.js" export function createGitHubClient(context: FunctionContext) { const token = context.matchedConfig.findConfig("github_token") as string @@ -38,3 +43,30 @@ export function handleGitHubError(error: unknown): never { throw new RuntimeError("GITHUB_API_ERROR", String(error)) } + +/** Drops the fields the caller left empty so optional parameters are not sent as nulls. */ +export function requestBody(fields: Record): Record { + return Object.fromEntries(Object.entries(fields).filter(([, value]) => value !== undefined && value !== null)) +} + +/** Resolves a label reference to the label name GitHub expects in request bodies. */ +export function labelName(label: GitHubLabelReference): string { + const name = typeof label === "string" ? label : label.name + if (!name) throw new RuntimeError("GITHUB_INVALID_LABEL", "A label needs a name.") + return name +} + +/** Resolves a user reference to the login GitHub expects in request bodies. */ +export function userLogin(user: GitHubUserReference): string { + const login = typeof user === "string" ? user : user?.login + if (!login) throw new RuntimeError("GITHUB_INVALID_ASSIGNEE", "An assignee needs a username.") + return login +} + +/** Resolves a milestone reference to the milestone number GitHub expects in request bodies. */ +export function milestoneNumber(milestone: GitHubMilestoneReference | undefined): number | undefined { + if (milestone === undefined || milestone === null) return undefined + const number = typeof milestone === "number" ? milestone : milestone.number + if (number === undefined) throw new RuntimeError("GITHUB_INVALID_MILESTONE", "A milestone needs a number.") + return number +} diff --git a/actions/github-action/src/index.ts b/actions/github-action/src/index.ts index 909a463..84c4cfc 100644 --- a/actions/github-action/src/index.ts +++ b/actions/github-action/src/index.ts @@ -1,42 +1,25 @@ import "reflect-metadata" import { Action, CodeZeroEvent } from "@code0-tech/hercules" import { GitHubIssueDataType } from "./data_types/issues/githubIssue.js" -import { GitHubAddAssigneesRequestDataType } from "./data_types/issues/githubAssigneesRequest.js" -import { GitHubCreateBranchRequestDataType } from "./data_types/repositories/githubBranchRequests.js" -import { GitHubCheckRunDataType, GitHubCommitStatusDataType } from "./data_types/ciAutomation/githubCiAutomation.js" import { - GitHubCreateCheckRunRequestDataType, - GitHubCreateCommitStatusRequestDataType, - GitHubUpdateCheckRunRequestDataType, -} from "./data_types/ciAutomation/githubCiAutomationRequests.js" + GitHubLabelReferenceDataType, + GitHubMilestoneReferenceDataType, + GitHubUserReferenceDataType, +} from "./data_types/references/githubReferences.js" +import { GitHubCheckRunDataType, GitHubCommitStatusDataType } from "./data_types/ciAutomation/githubCiAutomation.js" import { GitHubCommitDataType } from "./data_types/repositories/githubCommit.js" import { GitHubIssueCommentDataType } from "./data_types/issueComments/githubIssueComment.js" -import { GitHubCreateIssueCommentRequestDataType, GitHubUpdateIssueCommentRequestDataType } from "./data_types/issueComments/githubIssueCommentRequests.js" -import { GitHubCreateIssueRequestDataType, GitHubUpdateIssueRequestDataType } from "./data_types/issues/githubIssueRequests.js" import { GitHubLabelDataType } from "./data_types/labels/githubLabel.js" -import { GitHubIssueLabelsRequestDataType } from "./data_types/labels/githubLabelRequests.js" import { GitHubMilestoneDataType } from "./data_types/milestones/githubMilestone.js" -import { GitHubCreateMilestoneRequestDataType, GitHubUpdateMilestoneRequestDataType } from "./data_types/milestones/githubMilestoneRequests.js" -import { GitHubPullRequestDataType } from "./data_types/pullRequests/githubPullRequest.js" -import { GitHubPullRequestMergeRequestDataType, GitHubPullRequestMergeResultDataType } from "./data_types/pullRequests/githubPullRequestMergeRequest.js" +import { GitHubPullRequestDataType, GitHubPullRequestSummaryDataType } from "./data_types/pullRequests/githubPullRequest.js" +import { GitHubPullRequestMergeResultDataType } from "./data_types/pullRequests/githubPullRequestMergeResult.js" import { GitHubPullRequestReviewCommentDataType } from "./data_types/pullRequestReviewComments/githubPullRequestReviewComment.js" -import { - GitHubCreatePullRequestReviewCommentRequestDataType, - GitHubUpdatePullRequestReviewCommentRequestDataType, -} from "./data_types/pullRequestReviewComments/githubPullRequestReviewCommentRequests.js" import { GitHubPullRequestReviewDataType } from "./data_types/pullRequestReviews/githubPullRequestReview.js" -import { - GitHubCreatePullRequestReviewRequestDataType, - GitHubDismissPullRequestReviewRequestDataType, - GitHubSubmitPullRequestReviewRequestDataType, -} from "./data_types/pullRequestReviews/githubPullRequestReviewRequests.js" -import { GitHubCreatePullRequestRequestDataType, GitHubUpdatePullRequestRequestDataType } from "./data_types/pullRequests/githubPullRequestRequests.js" import { GitHubReleaseDataType } from "./data_types/releases/githubRelease.js" -import { GitHubCreateReleaseRequestDataType, GitHubUpdateReleaseRequestDataType } from "./data_types/releases/githubReleaseRequests.js" import { GitHubRepositoryDataType } from "./data_types/repositories/githubRepository.js" -import { GitHubRepositoryBranchDataType } from "./data_types/repositories/githubRepositoryBranch.js" +import { GitHubRepositoryBranchDataType, GitHubRepositoryBranchSummaryDataType } from "./data_types/repositories/githubRepositoryBranch.js" import { GitHubWorkflowDataType, GitHubWorkflowRunDataType } from "./data_types/ciAutomation/githubWorkflow.js" -import { GitHubDispatchWorkflowRequestDataType } from "./data_types/ciAutomation/githubWorkflowRequests.js" +import { GitHubWorkflowInputsDataType } from "./data_types/ciAutomation/githubWorkflowInputs.js" import { CreateIssueCommentFunction } from "./functions/issueComments/createIssueCommentFunction.js" import { DeleteIssueCommentFunction } from "./functions/issueComments/deleteIssueCommentFunction.js" import { GetIssueCommentsFunction } from "./functions/issueComments/getIssueCommentsFunction.js" @@ -149,49 +132,34 @@ const action = new Action( action.registerDataTypeClass(GitHubRepositoryDataType) action.registerDataTypeClass(GitHubRepositoryBranchDataType) -action.registerDataTypeClass(GitHubCreateBranchRequestDataType) +action.registerDataTypeClass(GitHubRepositoryBranchSummaryDataType) action.registerDataTypeClass(GitHubCommitDataType) action.registerDataTypeClass(GitHubReleaseDataType) -action.registerDataTypeClass(GitHubCreateReleaseRequestDataType) -action.registerDataTypeClass(GitHubUpdateReleaseRequestDataType) action.registerDataTypeClass(GitHubCommitStatusDataType) action.registerDataTypeClass(GitHubCheckRunDataType) -action.registerDataTypeClass(GitHubCreateCommitStatusRequestDataType) -action.registerDataTypeClass(GitHubCreateCheckRunRequestDataType) -action.registerDataTypeClass(GitHubUpdateCheckRunRequestDataType) action.registerDataTypeClass(GitHubWorkflowDataType) action.registerDataTypeClass(GitHubWorkflowRunDataType) -action.registerDataTypeClass(GitHubDispatchWorkflowRequestDataType) +action.registerDataTypeClass(GitHubWorkflowInputsDataType) +action.registerDataTypeClass(GitHubUserReferenceDataType) action.registerDataTypeClass(GitHubIssueDataType) action.registerDataTypeClass(GitHubIssueCommentDataType) action.registerDataTypeClass(GitHubLabelDataType) -action.registerDataTypeClass(GitHubIssueLabelsRequestDataType) +action.registerDataTypeClass(GitHubLabelReferenceDataType) action.registerDataTypeClass(GitHubMilestoneDataType) -action.registerDataTypeClass(GitHubCreateMilestoneRequestDataType) -action.registerDataTypeClass(GitHubUpdateMilestoneRequestDataType) -action.registerDataTypeClass(GitHubCreateIssueRequestDataType) -action.registerDataTypeClass(GitHubUpdateIssueRequestDataType) -action.registerDataTypeClass(GitHubCreateIssueCommentRequestDataType) -action.registerDataTypeClass(GitHubUpdateIssueCommentRequestDataType) -action.registerDataTypeClass(GitHubAddAssigneesRequestDataType) +action.registerDataTypeClass(GitHubMilestoneReferenceDataType) action.registerDataTypeClass(GitHubPullRequestDataType) +action.registerDataTypeClass(GitHubPullRequestSummaryDataType) action.registerDataTypeClass(GitHubPullRequestMergeResultDataType) -action.registerDataTypeClass(GitHubPullRequestMergeRequestDataType) action.registerDataTypeClass(GitHubPullRequestReviewDataType) action.registerDataTypeClass(GitHubPullRequestReviewCommentDataType) -action.registerDataTypeClass(GitHubCreatePullRequestReviewCommentRequestDataType) -action.registerDataTypeClass(GitHubUpdatePullRequestReviewCommentRequestDataType) -action.registerDataTypeClass(GitHubCreatePullRequestRequestDataType) -action.registerDataTypeClass(GitHubUpdatePullRequestRequestDataType) -action.registerDataTypeClass(GitHubCreatePullRequestReviewRequestDataType) -action.registerDataTypeClass(GitHubSubmitPullRequestReviewRequestDataType) -action.registerDataTypeClass(GitHubDismissPullRequestReviewRequestDataType) action.registerDataTypeClass(GitHubPushWebhookPayloadDataType) action.registerDataTypeClass(GitHubIssueOpenedWebhookPayloadDataType) action.registerDataTypeClass(GitHubIssueClosedWebhookPayloadDataType) action.registerDataTypeClass(GitHubPullRequestOpenedWebhookPayloadDataType) action.registerDataTypeClass(GitHubPullRequestClosedWebhookPayloadDataType) +// Data types for the component schemas nested inside the ones above, generated from the description. + action.registerRuntimeFunction(GetRepositoryFunction) action.registerRuntimeFunction(GetRepositoryBranchesFunction) action.registerRuntimeFunction(GetBranchFunction) @@ -260,6 +228,8 @@ action.registerEventClass(GitHubPullRequestClosedWebhook) action.registerEventClass(GitHubIssueOpenedWebhook) action.registerEventClass(GitHubIssueClosedWebhook) +const authToken = process.env.AUTH_TOKEN ?? "" + action.on(CodeZeroEvent.connected, () => { console.log("Connected to Aquila") }) @@ -269,13 +239,13 @@ action.on(CodeZeroEvent.error, (error: Error) => { console.log("Attempting to reconnect in 5s...") setTimeout(() => { - action.connect(process.env.AUTH_TOKEN ?? "LbB9OjWWNyug7haCCjP59tOwNRK1FS4Y6wdSYKOhxQddDppRjDX8zCQN1JX1KsUo").catch((reconnectError: unknown) => { + action.connect(authToken).catch((reconnectError: unknown) => { console.error("Reconnect failed:", reconnectError) }) }, 5000) }) -action.connect(process.env.AUTH_TOKEN ?? "LbB9OjWWNyug7haCCjP59tOwNRK1FS4Y6wdSYKOhxQddDppRjDX8zCQN1JX1KsUo").catch((error: unknown) => { +action.connect(authToken).catch((error: unknown) => { console.error("Failed to connect:", error) process.exit(1) }) From 03dd453d0730e623f795cbcaaf94c165ac8f4686 Mon Sep 17 00:00:00 2001 From: nicosammito Date: Sun, 25 Oct 2026 20:03:01 +0100 Subject: [PATCH 14/19] refactor: update Twilio and WooCommerce schemas to remove passthrough and improve type definitions --- .../src/generated/shopware-schemas.ts | 266 +-- .../src/generated/stripe-schemas.ts | 1542 ++++++++--------- .../src/generated/twilio-schemas.ts | 5 +- .../src/generated/woocommerce-schemas.ts | 23 +- scripts/openapi-to-zod.mjs | 39 +- 5 files changed, 946 insertions(+), 929 deletions(-) diff --git a/actions/shopware-action/src/generated/shopware-schemas.ts b/actions/shopware-action/src/generated/shopware-schemas.ts index 99f9d73..33d5090 100644 --- a/actions/shopware-action/src/generated/shopware-schemas.ts +++ b/actions/shopware-action/src/generated/shopware-schemas.ts @@ -2,139 +2,139 @@ // Regenerate with the action's `generate:*-schemas` npm script. import {z} from "zod"; -const AclRole: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "name": z.string(), "description": z.string().optional(), "privileges": z.array(z.string()).optional(), "deletedAt": z.string().optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "users": z.array(User).optional(), "app": App.optional(), "integrations": z.array(Integration).optional()}).passthrough()); -const App: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "name": z.string(), "path": z.string(), "author": z.string().optional(), "copyright": z.string().optional(), "license": z.string().optional(), "active": z.boolean().optional(), "configurable": z.boolean().optional(), "privacy": z.string().optional(), "version": z.string(), "icon": z.string().optional(), "modules": z.array(z.record(z.string(), z.any())).optional(), "mainModule": z.record(z.string(), z.any()).optional(), "cookies": z.array(z.record(z.string(), z.any())).optional(), "allowDisable": z.boolean().optional(), "baseAppUrl": z.string().optional(), "allowedHosts": z.array(z.string()).optional(), "templateLoadPriority": z.number().int().optional(), "checkoutGatewayUrl": z.string().optional(), "contextGatewayUrl": z.string().optional(), "inAppPurchasesGatewayUrl": z.string().optional(), "sourceType": z.string().optional(), "sourceConfig": z.record(z.string(), z.any()).optional(), "selfManaged": z.boolean().optional(), "requestedPrivileges": z.array(z.string()).optional(), "label": z.string(), "description": z.string().optional(), "privacyPolicyExtensions": z.string().optional(), "customFields": z.record(z.string(), z.any()).optional(), "integrationId": z.string(), "aclRoleId": z.string(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "translated": z.record(z.string(), z.any()).optional(), "integration": Integration.optional(), "aclRole": AclRole.optional(), "customFieldSets": z.array(CustomFieldSet).optional(), "actionButtons": z.array(AppActionButton).optional(), "templates": z.array(AppTemplate).optional(), "webhooks": z.array(Webhook).optional(), "paymentMethods": z.array(AppPaymentMethod).optional(), "taxProviders": z.array(TaxProvider).optional(), "cmsBlocks": z.array(AppCmsBlock).optional(), "flowActions": z.array(AppFlowAction).optional(), "flowEvents": z.array(AppFlowEvent).optional(), "appShippingMethods": z.array(AppShippingMethod).optional(), "mcpTools": z.array(AppMcpTool).optional(), "mcpPrompts": z.array(AppMcpPrompt).optional(), "mcpResources": z.array(AppMcpResource).optional()}).passthrough()); -const AppActionButton: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "entity": z.string(), "view": z.string(), "url": z.string(), "action": z.string(), "label": z.string(), "appId": z.string(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "translated": z.record(z.string(), z.any()).optional(), "app": App.optional()}).passthrough()); -const AppCmsBlock: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "name": z.string(), "block": z.record(z.string(), z.any()), "template": z.string(), "styles": z.string(), "label": z.string(), "appId": z.string(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "translated": z.record(z.string(), z.any()).optional(), "app": App.optional()}).passthrough()); -const AppFlowAction: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "appId": z.string(), "name": z.string(), "badge": z.string().optional(), "parameters": z.record(z.string(), z.any()).optional(), "config": z.record(z.string(), z.any()).optional(), "headers": z.record(z.string(), z.any()).optional(), "requirements": z.array(z.string()).optional(), "iconRaw": z.string().optional(), "icon": z.string().optional(), "swIcon": z.string().optional(), "url": z.string(), "delayable": z.boolean().optional(), "label": z.string(), "description": z.string().optional(), "headline": z.string().optional(), "customFields": z.record(z.string(), z.any()).optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "translated": z.record(z.string(), z.any()).optional(), "app": App.optional(), "flowSequences": z.array(FlowSequence).optional()}).passthrough()); -const AppFlowEvent: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "appId": z.string(), "name": z.string(), "aware": z.array(z.string()), "customFields": z.record(z.string(), z.any()).optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "app": App.optional(), "flows": z.array(Flow).optional()}).passthrough()); -const AppMcpPrompt: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "name": z.string(), "url": z.string(), "appId": z.string(), "label": z.string(), "description": z.string().optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "translated": z.record(z.string(), z.any()).optional(), "app": App.optional()}).passthrough()); -const AppMcpResource: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "name": z.string(), "uri": z.string(), "url": z.string(), "mimeType": z.string().optional(), "appId": z.string(), "label": z.string(), "description": z.string().optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "translated": z.record(z.string(), z.any()).optional(), "app": App.optional()}).passthrough()); -const AppMcpTool: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "name": z.string(), "url": z.string(), "inputSchema": z.record(z.string(), z.any()).optional(), "requiredPrivileges": z.record(z.string(), z.any()).optional(), "appId": z.string(), "label": z.string(), "description": z.string().optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "translated": z.record(z.string(), z.any()).optional(), "app": App.optional()}).passthrough()); -const AppPaymentMethod: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "appName": z.string(), "identifier": z.string(), "payUrl": z.string().optional(), "finalizeUrl": z.string().optional(), "validateUrl": z.string().optional(), "captureUrl": z.string().optional(), "refundUrl": z.string().optional(), "recurringUrl": z.string().optional(), "appId": z.string().optional(), "originalMediaId": z.string().optional(), "paymentMethodId": z.string(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "app": App.optional(), "originalMedia": Media.optional(), "paymentMethod": PaymentMethod.optional()}).passthrough()); -const AppScriptCondition: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "identifier": z.string(), "name": z.string(), "active": z.boolean(), "group": z.string().optional(), "script": z.string().optional(), "config": z.record(z.string(), z.any()).optional(), "appId": z.string(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "translated": z.record(z.string(), z.any()).optional(), "app": App.optional(), "ruleConditions": z.array(RuleCondition).optional()}).passthrough()); -const AppShippingMethod: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "appName": z.string(), "identifier": z.string(), "appId": z.string().optional(), "shippingMethodId": z.string(), "originalMediaId": z.string().optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "app": App.optional(), "shippingMethod": ShippingMethod.optional(), "originalMedia": Media.optional()}).passthrough()); -const AppTemplate: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "template": z.string(), "path": z.string(), "active": z.boolean(), "appId": z.string(), "hash": z.string().optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "app": App.optional()}).passthrough()); -const Category: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "versionId": z.string().optional(), "parentId": z.string().optional(), "parentVersionId": z.string().optional(), "afterCategoryId": z.string().optional(), "afterCategoryVersionId": z.string().optional(), "mediaId": z.string().optional(), "displayNestedProducts": z.boolean().optional(), "autoIncrement": z.number().int().optional(), "breadcrumb": z.array(z.object({}).strict()).optional(), "level": z.number().int().optional(), "path": z.string().optional(), "childCount": z.number().int().optional(), "type": z.enum(["page", "link", "folder"]).optional(), "productAssignmentType": z.string().optional(), "visible": z.boolean().optional(), "active": z.boolean().optional(), "visibleChildCount": z.number().int().optional(), "name": z.string(), "customFields": z.record(z.string(), z.any()).optional(), "slotConfig": z.record(z.string(), z.any()).optional(), "linkType": z.enum(["category", "product", "external", "landing_page"]).optional(), "internalLink": z.string().optional(), "externalLink": z.string().optional(), "linkNewTab": z.boolean().optional(), "description": z.string().optional(), "metaTitle": z.string().optional(), "metaDescription": z.string().optional(), "keywords": z.string().optional(), "cmsPageId": z.string().optional(), "cmsPageVersionId": z.string().optional(), "productStreamId": z.string().optional(), "customEntityTypeId": z.string().optional(), "cmsPageIdSwitched": z.boolean().optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "translated": z.record(z.string(), z.any()).optional(), "parent": Category.optional(), "children": z.array(Category).optional(), "media": Media.optional(), "products": z.array(Product).optional(), "nestedProducts": z.array(Product).optional(), "tags": z.array(Tag).optional(), "cmsPage": CmsPage.optional(), "productStream": ProductStream.optional(), "navigationSalesChannels": z.array(SalesChannel).optional(), "footerSalesChannels": z.array(SalesChannel).optional(), "serviceSalesChannels": z.array(SalesChannel).optional(), "mainCategories": z.array(MainCategory).optional(), "seoUrls": z.array(SeoUrl).optional()}).passthrough()); -const CmsBlock: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "versionId": z.string().optional(), "cmsSectionVersionId": z.string().optional(), "position": z.number().int(), "type": z.string(), "locked": z.boolean().optional(), "name": z.string().optional(), "sectionPosition": z.string().optional(), "marginTop": z.string().optional(), "marginBottom": z.string().optional(), "marginLeft": z.string().optional(), "marginRight": z.string().optional(), "backgroundColor": z.string().optional(), "backgroundMediaId": z.string().optional(), "backgroundMediaMode": z.string().optional(), "cssClass": z.string().optional(), "visibility": z.object({"mobile": z.boolean().optional(), "desktop": z.boolean().optional(), "tablet": z.boolean().optional()}).passthrough().optional(), "sectionId": z.string(), "customFields": z.record(z.string(), z.any()).optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "section": CmsSection.optional(), "backgroundMedia": Media.optional(), "slots": z.array(CmsSlot).optional()}).passthrough()); -const CmsPage: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "versionId": z.string().optional(), "name": z.string().optional(), "type": z.string(), "entity": z.string().optional(), "cssClass": z.string().optional(), "config": z.object({"backgroundColor": z.string().optional()}).passthrough().optional(), "previewMediaId": z.string().optional(), "customFields": z.record(z.string(), z.any()).optional(), "locked": z.boolean().optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "translated": z.record(z.string(), z.any()).optional(), "sections": z.array(CmsSection).optional(), "previewMedia": Media.optional(), "categories": z.array(Category).optional(), "landingPages": z.array(LandingPage).optional(), "homeSalesChannels": z.array(SalesChannel).optional(), "products": z.array(Product).optional()}).passthrough()); -const CmsSection: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "versionId": z.string().optional(), "cmsPageVersionId": z.string().optional(), "position": z.number().int(), "type": z.enum(["default", "sidebar"]), "locked": z.boolean().optional(), "name": z.string().optional(), "sizingMode": z.string().optional(), "mobileBehavior": z.string().optional(), "backgroundColor": z.string().optional(), "backgroundMediaId": z.string().optional(), "backgroundMediaMode": z.string().optional(), "cssClass": z.string().optional(), "pageId": z.string(), "visibility": z.object({"mobile": z.boolean().optional(), "desktop": z.boolean().optional(), "tablet": z.boolean().optional()}).passthrough().optional(), "customFields": z.record(z.string(), z.any()).optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "page": CmsPage.optional(), "backgroundMedia": Media.optional(), "blocks": z.array(CmsBlock).optional()}).passthrough()); -const CmsSlot: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "versionId": z.string().optional(), "cmsBlockVersionId": z.string().optional(), "fieldConfig": z.record(z.string(), z.any()).optional(), "type": z.string(), "slot": z.string(), "locked": z.boolean().optional(), "config": z.record(z.string(), z.any()).optional(), "customFields": z.record(z.string(), z.any()).optional(), "data": z.record(z.string(), z.any()).optional(), "blockId": z.string(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "translated": z.record(z.string(), z.any()).optional(), "block": CmsBlock.optional(), "VersionId": z.any().optional()}).passthrough()); -const Country: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "name": z.string(), "iso": z.string().optional(), "position": z.number().int().optional(), "active": z.boolean().optional(), "shippingAvailable": z.boolean().optional(), "iso3": z.string().optional(), "displayStateInRegistration": z.boolean().optional(), "forceStateInRegistration": z.boolean().optional(), "checkVatIdPattern": z.boolean().optional(), "vatIdRequired": z.boolean().optional(), "vatIdPattern": z.string().optional(), "customFields": z.record(z.string(), z.any()).optional(), "customerTax": z.object({"enabled": z.boolean(), "currencyId": z.string(), "amount": z.number()}).passthrough().optional(), "companyTax": z.object({"enabled": z.boolean(), "currencyId": z.string(), "amount": z.number()}).passthrough().optional(), "postalCodeRequired": z.boolean().optional(), "checkPostalCodePattern": z.boolean().optional(), "checkAdvancedPostalCodePattern": z.boolean().optional(), "advancedPostalCodePattern": z.string().optional(), "addressFormat": z.record(z.string(), z.any()), "defaultPostalCodePattern": z.string().optional(), "isEu": z.boolean().optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "translated": z.record(z.string(), z.any()).optional(), "states": z.array(CountryState).optional(), "customerAddresses": z.array(CustomerAddress).optional(), "orderAddresses": z.array(OrderAddress).optional(), "salesChannelDefaultAssignments": z.array(SalesChannel).optional(), "salesChannels": z.array(SalesChannel).optional(), "taxRules": z.array(TaxRule).optional(), "currencyCountryRoundings": z.array(CurrencyCountryRounding).optional()}).passthrough()); -const CountryState: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "countryId": z.string(), "shortCode": z.string(), "name": z.string(), "position": z.number().int().optional(), "active": z.boolean().optional(), "customFields": z.record(z.string(), z.any()).optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "translated": z.record(z.string(), z.any()).optional(), "country": Country.optional(), "customerAddresses": z.array(CustomerAddress).optional(), "orderAddresses": z.array(OrderAddress).optional()}).passthrough()); -const Currency: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "factor": z.number(), "symbol": z.string(), "isoCode": z.string(), "shortName": z.string(), "name": z.string(), "position": z.number().int().optional(), "isSystemDefault": z.boolean().optional(), "taxFreeFrom": z.number().optional(), "customFields": z.record(z.string(), z.any()).optional(), "itemRounding": z.object({"decimals": z.number().int(), "interval": z.number(), "roundForNet": z.boolean()}).passthrough(), "totalRounding": z.object({"decimals": z.number().int(), "interval": z.number(), "roundForNet": z.boolean()}).passthrough(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "translated": z.record(z.string(), z.any()).optional(), "salesChannelDefaultAssignments": z.array(SalesChannel).optional(), "orders": z.array(Order).optional(), "salesChannels": z.array(SalesChannel).optional(), "salesChannelDomains": z.array(SalesChannelDomain).optional(), "promotionDiscountPrices": z.array(PromotionDiscountPrices).optional(), "productExports": z.array(ProductExport).optional(), "countryRoundings": z.array(CurrencyCountryRounding).optional()}).passthrough()); -const CurrencyCountryRounding: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "currencyId": z.string(), "countryId": z.string(), "itemRounding": z.object({"decimals": z.number().int(), "interval": z.number(), "roundForNet": z.boolean()}).passthrough(), "totalRounding": z.object({"decimals": z.number().int(), "interval": z.number(), "roundForNet": z.boolean()}).passthrough(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "currency": Currency.optional(), "country": Country.optional()}).passthrough()); -const CustomField: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "name": z.string(), "type": z.string(), "config": z.record(z.string(), z.any()).optional(), "active": z.boolean().optional(), "customFieldSetId": z.string().optional(), "allowCustomerWrite": z.boolean().optional(), "allowCartExpose": z.boolean().optional(), "storeApiAware": z.boolean().optional(), "includeInSearch": z.boolean().optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "customFieldSet": CustomFieldSet.optional(), "productSearchConfigFields": z.array(ProductSearchConfigField).optional()}).passthrough()); -const CustomFieldSet: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "name": z.string(), "config": z.record(z.string(), z.any()).optional(), "active": z.boolean().optional(), "global": z.boolean().optional(), "position": z.number().int().optional(), "appId": z.string().optional(), "extensionName": z.string().optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "customFields": z.array(CustomField).optional(), "relations": z.array(CustomFieldSetRelation).optional(), "products": z.array(Product).optional(), "app": App.optional()}).passthrough()); -const CustomFieldSetRelation: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "customFieldSetId": z.string(), "entityName": z.string(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "customFieldSet": CustomFieldSet.optional()}).passthrough()); -const Customer: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "groupId": z.string(), "salesChannelId": z.string(), "languageId": z.string(), "lastPaymentMethodId": z.string().optional(), "defaultBillingAddressId": z.string(), "defaultShippingAddressId": z.string(), "autoIncrement": z.number().int().optional(), "customerNumber": z.string(), "salutationId": z.string().optional(), "firstName": z.string(), "lastName": z.string(), "email": z.string(), "title": z.string().optional(), "affiliateCode": z.string().optional(), "campaignCode": z.string().optional(), "active": z.boolean().optional(), "doubleOptInRegistration": z.boolean().optional(), "doubleOptInEmailSentDate": z.string().optional(), "doubleOptInConfirmDate": z.string().optional(), "hash": z.string().optional(), "guest": z.boolean().optional(), "firstLogin": z.string().optional(), "lastLogin": z.string().optional(), "birthday": z.string().optional(), "lastOrderDate": z.string().optional(), "orderCount": z.number().int().optional(), "orderTotalAmount": z.number().optional(), "reviewCount": z.number().int().optional(), "customFields": z.record(z.string(), z.any()).optional(), "remoteAddress": z.string().optional(), "tagIds": z.array(z.string()).optional(), "requestedGroupId": z.string().optional(), "boundSalesChannelId": z.string().optional(), "createdById": z.string().optional(), "updatedById": z.string().optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "extensions": z.object({"salesChannelTracking": z.object({"links": z.object({"related": z.string().optional()}).passthrough().optional(), "data": z.object({"type": z.string().optional(), "id": z.string().optional()}).passthrough().optional()}).passthrough().optional()}).passthrough().optional(), "group": CustomerGroup.optional(), "salesChannel": SalesChannel.optional(), "language": Language.optional(), "lastPaymentMethod": PaymentMethod.optional(), "defaultBillingAddress": CustomerAddress.optional(), "activeBillingAddress": CustomerAddress.optional(), "defaultShippingAddress": CustomerAddress.optional(), "activeShippingAddress": CustomerAddress.optional(), "salutation": Salutation.optional(), "addresses": z.array(CustomerAddress).optional(), "orderCustomers": z.array(OrderCustomer).optional(), "tags": z.array(Tag).optional(), "promotions": z.array(Promotion).optional(), "productReviews": z.array(ProductReview).optional(), "recoveryCustomer": CustomerRecovery.optional(), "requestedGroup": CustomerGroup.optional(), "boundSalesChannel": SalesChannel.optional(), "wishlists": z.array(CustomerWishlist).optional(), "createdBy": User.optional(), "updatedBy": User.optional(), "defaultPaymentMethodId": z.any().optional(), "company": z.any().optional(), "vatIds": z.any().optional(), "accountType": z.any().optional()}).passthrough()); -const CustomerAddress: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "customerId": z.string(), "countryId": z.string(), "countryStateId": z.string().optional(), "salutationId": z.string().optional(), "firstName": z.string(), "lastName": z.string(), "zipcode": z.string().optional(), "city": z.string(), "company": z.string().optional(), "street": z.string(), "department": z.string().optional(), "title": z.string().optional(), "phoneNumber": z.string().optional(), "additionalAddressLine1": z.string().optional(), "additionalAddressLine2": z.string().optional(), "hash": z.string().optional(), "customFields": z.record(z.string(), z.any()).optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "customer": Customer.optional(), "country": Country.optional(), "countryState": CountryState.optional(), "salutation": Salutation.optional()}).passthrough()); -const CustomerGroup: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "name": z.string(), "displayGross": z.boolean().optional(), "customFields": z.record(z.string(), z.any()).optional(), "registrationActive": z.boolean().optional(), "registrationTitle": z.string().optional(), "registrationIntroduction": z.string().optional(), "registrationOnlyCompanyRegistration": z.boolean().optional(), "registrationSeoMetaDescription": z.string().optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "translated": z.record(z.string(), z.any()).optional(), "customers": z.array(Customer).optional(), "salesChannels": z.array(SalesChannel).optional(), "registrationSalesChannels": z.array(SalesChannel).optional()}).passthrough()); -const CustomerRecovery: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "hash": z.string(), "customerId": z.string(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "customer": Customer.optional()}).passthrough()); -const CustomerWishlist: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "customerId": z.string(), "salesChannelId": z.string(), "customFields": z.record(z.string(), z.any()).optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "products": z.array(CustomerWishlistProduct).optional(), "customer": Customer.optional(), "salesChannel": SalesChannel.optional()}).passthrough()); -const CustomerWishlistProduct: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "productId": z.string(), "productVersionId": z.string().optional(), "wishlistId": z.string(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "wishlist": CustomerWishlist.optional(), "product": Product.optional()}).passthrough()); -const DeliveryTime: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "name": z.string(), "min": z.number().int(), "max": z.number().int(), "unit": z.string(), "customFields": z.record(z.string(), z.any()).optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "translated": z.record(z.string(), z.any()).optional(), "shippingMethods": z.array(ShippingMethod).optional(), "products": z.array(Product).optional()}).passthrough()); -const Document: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "typeName": z.string().optional(), "referencedDocumentId": z.string().optional(), "orderId": z.string(), "documentMediaFileId": z.string().optional(), "documentA11yMediaFileId": z.string().optional(), "orderVersionId": z.string().optional(), "config": z.record(z.string(), z.any()), "sent": z.boolean().optional(), "static": z.boolean().optional(), "deepLinkCode": z.string(), "documentNumber": z.string().optional(), "customFields": z.record(z.string(), z.any()).optional(), "documentTypeId": z.string(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "order": Order.optional(), "referencedDocument": Document.optional(), "dependentDocuments": z.array(Document).optional(), "documentMediaFile": Media.optional(), "documentA11yMediaFile": Media.optional(), "documentFiles": z.array(DocumentFile).optional(), "documentType": DocumentType.optional(), "fileType": z.any().optional()}).passthrough()); -const DocumentBaseConfig: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "typeName": z.string().optional(), "logoId": z.string().optional(), "name": z.string(), "filenamePrefix": z.string().optional(), "filenameSuffix": z.string().optional(), "filenameInfixes": z.record(z.string(), z.any()).optional(), "global": z.boolean().optional(), "documentNumber": z.string().optional(), "pageSize": z.string().optional(), "pageOrientation": z.string().optional(), "itemsPerPage": z.number().int().optional(), "displayHeader": z.boolean().optional(), "displayFooter": z.boolean().optional(), "displayPageCount": z.boolean().optional(), "displayCompanyAddress": z.boolean().optional(), "displayReturnAddress": z.boolean().optional(), "displayCustomerVatId": z.boolean().optional(), "customFields": z.record(z.string(), z.any()).optional(), "createdAt": z.string().optional(), "config": z.record(z.string(), z.any()).optional(), "documentTypeId": z.string(), "updatedAt": z.string().optional(), "logo": Media.optional(), "salesChannels": z.array(DocumentBaseConfigSalesChannel).optional(), "documentType": DocumentType.optional()}).passthrough()); -const DocumentBaseConfigSalesChannel: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "documentBaseConfigId": z.string(), "salesChannelId": z.string().optional(), "typeName": z.string().optional(), "documentTypeId": z.string().optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "documentBaseConfig": DocumentBaseConfig.optional(), "salesChannel": SalesChannel.optional(), "documentType": DocumentType.optional()}).passthrough()); -const DocumentFile: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "documentId": z.string(), "mediaId": z.string(), "documentFormat": z.string(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "document": Document.optional(), "media": Media.optional()}).passthrough()); -const DocumentType: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "name": z.string(), "technicalName": z.string(), "customFields": z.record(z.string(), z.any()).optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "translated": z.record(z.string(), z.any()).optional(), "documents": z.array(Document).optional(), "documentBaseConfigs": z.array(DocumentBaseConfig).optional(), "documentBaseConfigSalesChannels": z.array(DocumentBaseConfigSalesChannel).optional()}).passthrough()); -const Flow: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "name": z.string(), "eventName": z.string(), "priority": z.number().int().optional(), "invalid": z.boolean().optional(), "active": z.boolean().optional(), "description": z.string().optional(), "customFields": z.record(z.string(), z.any()).optional(), "appFlowEventId": z.string().optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "sequences": z.array(FlowSequence).optional(), "appFlowEvent": AppFlowEvent.optional()}).passthrough()); -const FlowSequence: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "flowId": z.string(), "ruleId": z.string().optional(), "actionName": z.string().optional(), "config": z.record(z.string(), z.any()).optional(), "position": z.number().int().optional(), "displayGroup": z.number().int().optional(), "trueCase": z.boolean().optional(), "parentId": z.string().optional(), "customFields": z.record(z.string(), z.any()).optional(), "appFlowActionId": z.string().optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "flow": Flow.optional(), "rule": Rule.optional(), "parent": FlowSequence.optional(), "children": z.array(FlowSequence).optional(), "appFlowAction": AppFlowAction.optional(), "appFlowEventId": z.any().optional()}).passthrough()); -const ImportExportFile: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "originalName": z.string(), "path": z.string(), "expireDate": z.string(), "size": z.number().int().optional(), "accessToken": z.string().optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "log": ImportExportLog.optional()}).passthrough()); -const ImportExportLog: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "activity": z.string(), "state": z.string(), "records": z.number().int(), "userId": z.string().optional(), "profileId": z.string().optional(), "fileId": z.string().optional(), "invalidRecordsLogId": z.string().optional(), "username": z.string().optional(), "profileName": z.string().optional(), "config": z.record(z.string(), z.any()), "result": z.record(z.string(), z.any()).optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "user": User.optional(), "profile": ImportExportProfile.optional(), "file": ImportExportFile.optional(), "invalidRecordsLog": ImportExportLog.optional(), "failedImportLog": ImportExportLog.optional()}).passthrough()); -const ImportExportProfile: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "technicalName": z.string(), "type": z.string().optional(), "systemDefault": z.boolean().optional(), "sourceEntity": z.string(), "fileType": z.string(), "delimiter": z.string(), "enclosure": z.string(), "mapping": z.record(z.string(), z.any()).optional(), "updateBy": z.record(z.string(), z.any()).optional(), "config": z.record(z.string(), z.any()).optional(), "label": z.string(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "translated": z.record(z.string(), z.any()).optional(), "importExportLogs": z.array(ImportExportLog).optional(), "name": z.any().optional()}).passthrough()); -const Integration: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "label": z.string(), "accessKey": z.string(), "secretAccessKey": z.string(), "lastUsageAt": z.string().optional(), "admin": z.boolean().optional(), "mcpAllowlist": z.record(z.string(), z.any()).optional(), "customFields": z.record(z.string(), z.any()).optional(), "deletedAt": z.string().optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "extensions": z.object({"createdNotifications": z.object({"links": z.object({"related": z.string().optional()}).passthrough().optional(), "data": z.array(z.object({"type": z.string().optional(), "id": z.string().optional()}).passthrough()).optional()}).passthrough().optional()}).passthrough().optional(), "app": App.optional(), "stateMachineHistoryEntries": z.array(StateMachineHistory).optional(), "aclRoles": z.array(AclRole).optional(), "writeAccess": z.any().optional(), "integrationId": z.any().optional(), "aclRoleId": z.any().optional()}).passthrough()); -const LandingPage: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "versionId": z.string().optional(), "active": z.boolean().optional(), "name": z.string(), "customFields": z.record(z.string(), z.any()).optional(), "slotConfig": z.record(z.string(), z.any()).optional(), "metaTitle": z.string().optional(), "metaDescription": z.string().optional(), "keywords": z.string().optional(), "url": z.string(), "cmsPageId": z.string().optional(), "cmsPageVersionId": z.string().optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "translated": z.record(z.string(), z.any()).optional(), "tags": z.array(Tag).optional(), "cmsPage": CmsPage.optional(), "salesChannels": z.array(SalesChannel).optional(), "seoUrls": z.array(SeoUrl).optional()}).passthrough()); -const Language: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "parentId": z.string().optional(), "localeId": z.string(), "translationCodeId": z.string().optional(), "name": z.string(), "active": z.boolean().optional(), "translationAutoUpdate": z.boolean().optional(), "customFields": z.record(z.string(), z.any()).optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "parent": Language.optional(), "locale": Locale.optional(), "translationCode": Locale.optional(), "children": z.array(Language).optional(), "salesChannels": z.array(SalesChannel).optional(), "salesChannelDefaultAssignments": z.array(SalesChannel).optional(), "salesChannelDomains": z.array(SalesChannelDomain).optional(), "customers": z.array(Customer).optional(), "newsletterRecipients": z.array(NewsletterRecipient).optional(), "orders": z.array(Order).optional(), "productSearchKeywords": z.array(ProductSearchKeyword).optional(), "productKeywordDictionaries": z.array(ProductKeywordDictionary).optional(), "productReviews": z.array(ProductReview).optional(), "productSearchConfig": ProductSearchConfig.optional()}).passthrough()); -const Locale: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "code": z.string(), "name": z.string(), "territory": z.string(), "customFields": z.record(z.string(), z.any()).optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "translated": z.record(z.string(), z.any()).optional(), "languages": z.array(Language).optional(), "users": z.array(User).optional()}).passthrough()); -const MailHeaderFooter: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "systemDefault": z.boolean().optional(), "name": z.string(), "description": z.string().optional(), "headerHtml": z.string().optional(), "headerPlain": z.string().optional(), "footerHtml": z.string().optional(), "footerPlain": z.string().optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "translated": z.record(z.string(), z.any()).optional(), "salesChannels": z.array(SalesChannel).optional()}).passthrough()); -const MailTemplate: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "mailTemplateTypeId": z.string(), "systemDefault": z.boolean().optional(), "wasModifiedByUser": z.boolean().optional(), "senderName": z.string().optional(), "description": z.string().optional(), "subject": z.string(), "contentHtml": z.string(), "contentPlain": z.string(), "customFields": z.record(z.string(), z.any()).optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "translated": z.record(z.string(), z.any()).optional(), "mailTemplateType": MailTemplateType.optional(), "media": z.array(MailTemplateMedia).optional()}).passthrough()); -const MailTemplateMedia: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "mailTemplateId": z.string(), "languageId": z.string(), "mediaId": z.string(), "position": z.number().int().optional(), "mailTemplate": MailTemplate.optional(), "media": Media.optional()}).passthrough()); -const MailTemplateType: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "name": z.string(), "technicalName": z.string(), "availableEntities": z.record(z.string(), z.any()).optional(), "customFields": z.record(z.string(), z.any()).optional(), "templateData": z.record(z.string(), z.any()).optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "translated": z.record(z.string(), z.any()).optional(), "mailTemplates": z.array(MailTemplate).optional()}).passthrough()); -const MainCategory: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "productId": z.string(), "productVersionId": z.string().optional(), "categoryId": z.string(), "categoryVersionId": z.string().optional(), "salesChannelId": z.string(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "product": Product.optional(), "category": Category.optional(), "salesChannel": SalesChannel.optional()}).passthrough()); -const MeasurementUnits = z.lazy(() => z.object({"system": z.enum(["metric", "imperial"]).optional(), "units": z.object({"length": z.enum(["mm", "cm", "m", "in", "ft"]).optional(), "weight": z.enum(["g", "kg", "oz", "lb"]).optional()}).passthrough().optional()}).passthrough()); -const Media: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "userId": z.string().optional(), "mediaFolderId": z.string().optional(), "mimeType": z.string().optional(), "fileExtension": z.string().optional(), "uploadedAt": z.string().optional(), "fileName": z.string().optional(), "fileSize": z.number().int().optional(), "metaData": z.record(z.string(), z.any()).optional(), "mediaType": z.record(z.string(), z.any()).optional(), "config": z.record(z.string(), z.any()).optional(), "alt": z.string().optional(), "title": z.string().optional(), "url": z.string().optional(), "path": z.string().optional(), "hasFile": z.boolean().optional(), "private": z.boolean().optional(), "customFields": z.record(z.string(), z.any()).optional(), "fileHash": z.string().optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "translated": z.record(z.string(), z.any()).optional(), "extensions": z.object({"themes": z.object({"links": z.object({"related": z.string().optional()}).passthrough().optional(), "data": z.array(z.object({"type": z.string().optional(), "id": z.string().optional()}).passthrough()).optional()}).passthrough().optional(), "themeMedia": z.object({"links": z.object({"related": z.string().optional()}).passthrough().optional(), "data": z.array(z.object({"type": z.string().optional(), "id": z.string().optional()}).passthrough()).optional()}).passthrough().optional()}).passthrough().optional(), "tags": z.array(Tag).optional(), "thumbnails": z.array(MediaThumbnail).optional(), "user": User.optional(), "categories": z.array(Category).optional(), "productManufacturers": z.array(ProductManufacturer).optional(), "productMedia": z.array(ProductMedia).optional(), "productDownloads": z.array(ProductDownload).optional(), "orderLineItemDownloads": z.array(OrderLineItemDownload).optional(), "avatarUsers": z.array(User).optional(), "mediaFolder": MediaFolder.optional(), "propertyGroupOptions": z.array(PropertyGroupOption).optional(), "mailTemplateMedia": z.array(MailTemplateMedia).optional(), "documentBaseConfigs": z.array(DocumentBaseConfig).optional(), "shippingMethods": z.array(ShippingMethod).optional(), "paymentMethods": z.array(PaymentMethod).optional(), "productConfiguratorSettings": z.array(ProductConfiguratorSetting).optional(), "productOpenGraphImages": z.array(Product).optional(), "orderLineItems": z.array(OrderLineItem).optional(), "cmsBlocks": z.array(CmsBlock).optional(), "cmsSections": z.array(CmsSection).optional(), "cmsPages": z.array(CmsPage).optional(), "documents": z.array(Document).optional(), "a11yDocuments": z.array(Document).optional(), "appPaymentMethods": z.array(AppPaymentMethod).optional(), "appShippingMethods": z.array(AppShippingMethod).optional(), "documentFile": DocumentFile.optional()}).passthrough()); -const MediaDefaultFolder: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "entity": z.string(), "customFields": z.record(z.string(), z.any()).optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "folder": MediaFolder.optional()}).passthrough()); -const MediaFolder: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "useParentConfiguration": z.boolean().optional(), "configurationId": z.string(), "defaultFolderId": z.string().optional(), "parentId": z.string().optional(), "childCount": z.number().int().optional(), "path": z.string().optional(), "name": z.string(), "customFields": z.record(z.string(), z.any()).optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "parent": MediaFolder.optional(), "children": z.array(MediaFolder).optional(), "media": z.array(Media).optional(), "defaultFolder": MediaDefaultFolder.optional(), "configuration": MediaFolderConfiguration.optional()}).passthrough()); -const MediaFolderConfiguration: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "createThumbnails": z.boolean().optional(), "keepAspectRatio": z.boolean().optional(), "thumbnailQuality": z.number().int().optional(), "private": z.boolean().optional(), "noAssociation": z.boolean().optional(), "customFields": z.record(z.string(), z.any()).optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "mediaFolders": z.array(MediaFolder).optional(), "mediaThumbnailSizes": z.array(MediaThumbnailSize).optional()}).passthrough()); -const MediaThumbnail: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "mediaId": z.string(), "mediaThumbnailSizeId": z.string().optional(), "width": z.number().int(), "height": z.number().int(), "url": z.string().optional(), "path": z.string().optional(), "customFields": z.record(z.string(), z.any()).optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "media": Media.optional(), "mediaThumbnailSize": MediaThumbnailSize.optional()}).passthrough()); -const MediaThumbnailSize: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "width": z.number().int(), "height": z.number().int(), "customFields": z.record(z.string(), z.any()).optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "mediaFolderConfigurations": z.array(MediaFolderConfiguration).optional(), "mediaThumbnails": z.array(MediaThumbnail).optional()}).passthrough()); -const NewsletterRecipient: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "email": z.string(), "title": z.string().optional(), "firstName": z.string().optional(), "lastName": z.string().optional(), "zipCode": z.string().optional(), "city": z.string().optional(), "street": z.string().optional(), "status": z.enum(["notSet", "optIn", "optOut", "direct"]), "hash": z.string(), "customFields": z.record(z.string(), z.any()).optional(), "confirmedAt": z.string().optional(), "salutationId": z.string().optional(), "languageId": z.string(), "salesChannelId": z.string(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "tags": z.array(Tag).optional(), "salutation": Salutation.optional(), "language": Language.optional(), "salesChannel": SalesChannel.optional()}).passthrough()); -const NumberRange: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "typeId": z.string(), "global": z.boolean(), "name": z.string(), "description": z.string().optional(), "pattern": z.string(), "start": z.number().int(), "customFields": z.record(z.string(), z.any()).optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "translated": z.record(z.string(), z.any()).optional(), "type": NumberRangeType.optional(), "numberRangeSalesChannels": z.array(NumberRangeSalesChannel).optional(), "state": NumberRangeState.optional()}).passthrough()); -const NumberRangeSalesChannel: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "numberRangeId": z.string(), "salesChannelId": z.string(), "numberRangeTypeId": z.string().optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "numberRange": NumberRange.optional(), "salesChannel": SalesChannel.optional(), "numberRangeType": NumberRangeType.optional()}).passthrough()); -const NumberRangeState: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "numberRangeId": z.string(), "lastValue": z.number().int(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "numberRange": NumberRange.optional()}).passthrough()); -const NumberRangeType: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "technicalName": z.string().optional(), "typeName": z.string(), "global": z.boolean(), "customFields": z.record(z.string(), z.any()).optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "translated": z.record(z.string(), z.any()).optional(), "numberRanges": z.array(NumberRange).optional(), "numberRangeSalesChannels": z.array(NumberRangeSalesChannel).optional()}).passthrough()); -const Order: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "versionId": z.string().optional(), "autoIncrement": z.number().int().optional(), "orderNumber": z.string().optional(), "billingAddressId": z.string(), "billingAddressVersionId": z.string().optional(), "primaryOrderDeliveryId": z.string().optional(), "primaryOrderDeliveryVersionId": z.string().optional(), "primaryOrderTransactionId": z.string().optional(), "primaryOrderTransactionVersionId": z.string().optional(), "currencyId": z.string(), "languageId": z.string(), "salesChannelId": z.string(), "orderDateTime": z.string(), "orderDate": z.string().optional(), "price": z.object({"netPrice": z.number(), "totalPrice": z.number(), "calculatedTaxes": z.record(z.string(), z.any()).optional(), "taxRules": z.record(z.string(), z.any()).optional(), "positionPrice": z.number(), "rawTotal": z.number(), "taxStatus": z.string()}).passthrough().optional(), "amountTotal": z.number().optional(), "amountNet": z.number().optional(), "positionPrice": z.number().optional(), "taxStatus": z.string().optional(), "shippingCosts": z.object({"unitPrice": z.number(), "totalPrice": z.number(), "quantity": z.number().int(), "calculatedTaxes": z.record(z.string(), z.any()).optional(), "taxRules": z.record(z.string(), z.any()).optional(), "referencePrice": z.record(z.string(), z.any()).optional(), "listPrice": z.object({"price": z.number().optional(), "discount": z.number().optional(), "percentage": z.number().optional()}).passthrough().optional(), "regulationPrice": z.object({"price": z.number().optional()}).passthrough().optional()}).passthrough().optional(), "shippingTotal": z.number().optional(), "currencyFactor": z.number(), "deepLinkCode": z.string().optional(), "affiliateCode": z.string().optional(), "campaignCode": z.string().optional(), "customerComment": z.string().optional(), "internalComment": z.string().optional(), "source": z.string().optional(), "taxCalculationType": z.string().optional(), "stateId": z.string(), "ruleIds": z.array(z.string()).optional(), "customFields": z.record(z.string(), z.any()).optional(), "createdById": z.string().optional(), "updatedById": z.string().optional(), "itemRounding": z.object({"decimals": z.number().int(), "interval": z.number(), "roundForNet": z.boolean()}).passthrough(), "totalRounding": z.object({"decimals": z.number().int(), "interval": z.number(), "roundForNet": z.boolean()}).passthrough(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "extensions": z.object({"salesChannelTracking": z.object({"links": z.object({"related": z.string().optional()}).passthrough().optional(), "data": z.object({"type": z.string().optional(), "id": z.string().optional()}).passthrough().optional()}).passthrough().optional()}).passthrough().optional(), "stateMachineState": StateMachineState.optional(), "primaryOrderDelivery": OrderDelivery.optional(), "primaryOrderTransaction": OrderTransaction.optional(), "orderCustomer": OrderCustomer.optional(), "currency": Currency.optional(), "language": Language.optional(), "salesChannel": SalesChannel.optional(), "addresses": z.array(OrderAddress).optional(), "billingAddress": OrderAddress.optional(), "deliveries": z.array(OrderDelivery).optional(), "lineItems": z.array(OrderLineItem).optional(), "transactions": z.array(OrderTransaction).optional(), "documents": z.array(Document).optional(), "tags": z.array(Tag).optional(), "createdBy": User.optional(), "updatedBy": User.optional()}).passthrough()); -const OrderAddress: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "versionId": z.string().optional(), "countryId": z.string(), "countryStateId": z.string().optional(), "orderId": z.string(), "orderVersionId": z.string().optional(), "salutationId": z.string().optional(), "firstName": z.string(), "lastName": z.string(), "street": z.string(), "zipcode": z.string().optional(), "city": z.string(), "company": z.string().optional(), "department": z.string().optional(), "title": z.string().optional(), "phoneNumber": z.string().optional(), "additionalAddressLine1": z.string().optional(), "additionalAddressLine2": z.string().optional(), "hash": z.string().optional(), "customFields": z.record(z.string(), z.any()).optional(), "vatId": z.string().optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "country": Country.optional(), "countryState": CountryState.optional(), "order": Order.optional(), "orderDeliveries": z.array(OrderDelivery).optional(), "salutation": Salutation.optional()}).passthrough()); -const OrderCustomer: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "versionId": z.string().optional(), "customerId": z.string().optional(), "orderId": z.string(), "orderVersionId": z.string().optional(), "email": z.string(), "salutationId": z.string().optional(), "firstName": z.string(), "lastName": z.string(), "company": z.string().optional(), "title": z.string().optional(), "vatIds": z.array(z.string()).optional(), "customerNumber": z.string().optional(), "customFields": z.record(z.string(), z.any()).optional(), "remoteAddress": z.string().optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "order": Order.optional(), "customer": Customer.optional(), "salutation": Salutation.optional()}).passthrough()); -const OrderDelivery: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "versionId": z.string().optional(), "orderId": z.string(), "orderVersionId": z.string().optional(), "shippingOrderAddressId": z.string(), "shippingOrderAddressVersionId": z.string().optional(), "shippingMethodId": z.string(), "stateId": z.string(), "trackingCodes": z.array(z.string()).optional(), "shippingDateEarliest": z.string(), "shippingDateLatest": z.string(), "shippingCosts": z.object({"unitPrice": z.number(), "totalPrice": z.number(), "quantity": z.number().int(), "calculatedTaxes": z.record(z.string(), z.any()).optional(), "taxRules": z.record(z.string(), z.any()).optional(), "referencePrice": z.record(z.string(), z.any()).optional(), "listPrice": z.object({"price": z.number().optional(), "discount": z.number().optional(), "percentage": z.number().optional()}).passthrough().optional(), "regulationPrice": z.object({"price": z.number().optional()}).passthrough().optional()}).passthrough().optional(), "customFields": z.record(z.string(), z.any()).optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "stateMachineState": StateMachineState.optional(), "order": Order.optional(), "shippingOrderAddress": OrderAddress.optional(), "shippingMethod": ShippingMethod.optional(), "positions": z.array(OrderDeliveryPosition).optional(), "primaryOrder": Order.optional()}).passthrough()); -const OrderDeliveryPosition: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "versionId": z.string().optional(), "orderDeliveryId": z.string(), "orderDeliveryVersionId": z.string().optional(), "orderLineItemId": z.string(), "orderLineItemVersionId": z.string().optional(), "price": z.object({"unitPrice": z.number(), "totalPrice": z.number(), "quantity": z.number().int(), "calculatedTaxes": z.record(z.string(), z.any()).optional(), "taxRules": z.record(z.string(), z.any()).optional(), "referencePrice": z.record(z.string(), z.any()).optional(), "listPrice": z.object({"price": z.number().optional(), "discount": z.number().optional(), "percentage": z.number().optional()}).passthrough().optional(), "regulationPrice": z.object({"price": z.number().optional()}).passthrough().optional()}).passthrough().optional(), "unitPrice": z.number().optional(), "totalPrice": z.number().optional(), "quantity": z.number().int().optional(), "customFields": z.record(z.string(), z.any()).optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "orderDelivery": OrderDelivery.optional(), "orderLineItem": OrderLineItem.optional()}).passthrough()); -const OrderLineItem: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "versionId": z.string().optional(), "orderId": z.string(), "orderVersionId": z.string().optional(), "productId": z.string().optional(), "productVersionId": z.string().optional(), "promotionId": z.string().optional(), "parentId": z.string().optional(), "parentVersionId": z.string().optional(), "coverId": z.string().optional(), "identifier": z.string(), "referencedId": z.string().optional(), "quantity": z.number().int(), "label": z.string(), "payload": z.record(z.string(), z.any()).optional(), "good": z.boolean().optional(), "removable": z.boolean().optional(), "stackable": z.boolean().optional(), "position": z.number().int().optional(), "price": z.object({"unitPrice": z.number(), "totalPrice": z.number(), "quantity": z.number().int(), "calculatedTaxes": z.record(z.string(), z.any()).optional(), "taxRules": z.record(z.string(), z.any()).optional(), "referencePrice": z.record(z.string(), z.any()).optional(), "listPrice": z.object({"price": z.number().optional(), "discount": z.number().optional(), "percentage": z.number().optional()}).passthrough().optional(), "regulationPrice": z.object({"price": z.number().optional()}).passthrough().optional()}).passthrough(), "priceDefinition": z.record(z.string(), z.any()).optional(), "unitPrice": z.number().optional(), "totalPrice": z.number().optional(), "description": z.string().optional(), "type": z.enum(["product", "credit", "custom", "promotion", "container", "discount", "quantity"]).optional(), "customFields": z.record(z.string(), z.any()).optional(), "states": z.array(z.string()), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "cover": Media.optional(), "order": Order.optional(), "product": Product.optional(), "promotion": Promotion.optional(), "orderDeliveryPositions": z.array(OrderDeliveryPosition).optional(), "orderTransactionCaptureRefundPositions": z.array(OrderTransactionCaptureRefundPosition).optional(), "downloads": z.array(OrderLineItemDownload).optional(), "parent": OrderLineItem.optional(), "children": z.array(OrderLineItem)}).passthrough()); -const OrderLineItemDownload: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "versionId": z.string().optional(), "orderLineItemId": z.string(), "orderLineItemVersionId": z.string().optional(), "mediaId": z.string(), "position": z.number().int(), "accessGranted": z.boolean(), "customFields": z.record(z.string(), z.any()).optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "orderLineItem": OrderLineItem.optional(), "media": Media.optional()}).passthrough()); -const OrderTransaction: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "versionId": z.string().optional(), "orderId": z.string(), "orderVersionId": z.string().optional(), "paymentMethodId": z.string(), "amount": z.object({"unitPrice": z.number(), "totalPrice": z.number(), "quantity": z.number().int(), "calculatedTaxes": z.record(z.string(), z.any()).optional(), "taxRules": z.record(z.string(), z.any()).optional(), "referencePrice": z.record(z.string(), z.any()).optional(), "listPrice": z.object({"price": z.number().optional(), "discount": z.number().optional(), "percentage": z.number().optional()}).passthrough().optional(), "regulationPrice": z.object({"price": z.number().optional()}).passthrough().optional()}).passthrough(), "validationData": z.record(z.string(), z.any()).optional(), "stateId": z.string(), "customFields": z.record(z.string(), z.any()).optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "stateMachineState": StateMachineState.optional(), "order": Order.optional(), "paymentMethod": PaymentMethod.optional(), "captures": z.array(OrderTransactionCapture).optional(), "primaryOrder": Order.optional(), "shippingCosts": z.object({"calculatedTaxes": z.any().optional(), "taxRules": z.any().optional(), "referencePrice": z.any().optional(), "listPrice": z.object({"price": z.any().optional(), "discount": z.any().optional(), "percentage": z.any().optional()}).passthrough().optional(), "regulationPrice": z.object({"price": z.any().optional()}).passthrough().optional()}).passthrough().optional()}).passthrough()); -const OrderTransactionCapture: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "versionId": z.string().optional(), "orderTransactionId": z.string(), "orderTransactionVersionId": z.string().optional(), "stateId": z.string(), "externalReference": z.string().optional(), "amount": z.object({"unitPrice": z.number(), "totalPrice": z.number(), "quantity": z.number().int(), "calculatedTaxes": z.record(z.string(), z.any()).optional(), "taxRules": z.record(z.string(), z.any()).optional(), "referencePrice": z.record(z.string(), z.any()).optional(), "listPrice": z.object({"price": z.number().optional(), "discount": z.number().optional(), "percentage": z.number().optional()}).passthrough().optional(), "regulationPrice": z.object({"price": z.number().optional()}).passthrough().optional()}).passthrough(), "customFields": z.record(z.string(), z.any()).optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "stateMachineState": StateMachineState.optional(), "transaction": OrderTransaction.optional(), "refunds": z.array(OrderTransactionCaptureRefund).optional(), "shippingCosts": z.object({"calculatedTaxes": z.any().optional(), "taxRules": z.any().optional(), "referencePrice": z.any().optional(), "listPrice": z.object({"price": z.any().optional(), "discount": z.any().optional(), "percentage": z.any().optional()}).passthrough().optional(), "regulationPrice": z.object({"price": z.any().optional()}).passthrough().optional()}).passthrough().optional()}).passthrough()); -const OrderTransactionCaptureRefund: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "versionId": z.string().optional(), "captureId": z.string(), "captureVersionId": z.string().optional(), "stateId": z.string(), "externalReference": z.string().optional(), "reason": z.string().optional(), "amount": z.object({"unitPrice": z.number(), "totalPrice": z.number(), "quantity": z.number().int(), "calculatedTaxes": z.record(z.string(), z.any()).optional(), "taxRules": z.record(z.string(), z.any()).optional(), "referencePrice": z.record(z.string(), z.any()).optional(), "listPrice": z.object({"price": z.number().optional(), "discount": z.number().optional(), "percentage": z.number().optional()}).passthrough().optional(), "regulationPrice": z.object({"price": z.number().optional()}).passthrough().optional()}).passthrough(), "customFields": z.record(z.string(), z.any()).optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "stateMachineState": StateMachineState.optional(), "transactionCapture": OrderTransactionCapture.optional(), "positions": z.array(OrderTransactionCaptureRefundPosition).optional(), "shippingCosts": z.object({"calculatedTaxes": z.any().optional(), "taxRules": z.any().optional(), "referencePrice": z.any().optional(), "listPrice": z.object({"price": z.any().optional(), "discount": z.any().optional(), "percentage": z.any().optional()}).passthrough().optional(), "regulationPrice": z.object({"price": z.any().optional()}).passthrough().optional()}).passthrough().optional()}).passthrough()); -const OrderTransactionCaptureRefundPosition: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "versionId": z.string().optional(), "refundId": z.string(), "refundVersionId": z.string().optional(), "orderLineItemId": z.string(), "orderLineItemVersionId": z.string().optional(), "externalReference": z.string().optional(), "reason": z.string().optional(), "quantity": z.number().int().optional(), "amount": z.object({"unitPrice": z.number(), "totalPrice": z.number(), "quantity": z.number().int(), "calculatedTaxes": z.record(z.string(), z.any()).optional(), "taxRules": z.record(z.string(), z.any()).optional(), "referencePrice": z.record(z.string(), z.any()).optional(), "listPrice": z.object({"price": z.number().optional(), "discount": z.number().optional(), "percentage": z.number().optional()}).passthrough().optional(), "regulationPrice": z.object({"price": z.number().optional()}).passthrough().optional()}).passthrough(), "customFields": z.record(z.string(), z.any()).optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "orderLineItem": OrderLineItem.optional(), "orderTransactionCaptureRefund": OrderTransactionCaptureRefund.optional(), "shippingCosts": z.object({"calculatedTaxes": z.any().optional(), "taxRules": z.any().optional(), "referencePrice": z.any().optional(), "listPrice": z.object({"price": z.any().optional(), "discount": z.any().optional(), "percentage": z.any().optional()}).passthrough().optional(), "regulationPrice": z.object({"price": z.any().optional()}).passthrough().optional()}).passthrough().optional()}).passthrough()); -const PaymentMethod: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "pluginId": z.string().optional(), "handlerIdentifier": z.string().optional(), "name": z.string(), "distinguishableName": z.string().optional(), "description": z.string().optional(), "position": z.number().int().optional(), "active": z.boolean().optional(), "afterOrderEnabled": z.boolean().optional(), "customFields": z.record(z.string(), z.any()).optional(), "availabilityRuleId": z.string().optional(), "mediaId": z.string().optional(), "formattedHandlerIdentifier": z.string().optional(), "technicalName": z.string(), "shortName": z.string().optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "translated": z.record(z.string(), z.any()).optional(), "media": Media.optional(), "availabilityRule": Rule.optional(), "salesChannelDefaultAssignments": z.array(SalesChannel).optional(), "plugin": Plugin.optional(), "customers": z.array(Customer).optional(), "orderTransactions": z.array(OrderTransaction).optional(), "salesChannels": z.array(SalesChannel).optional(), "appPaymentMethod": AppPaymentMethod.optional()}).passthrough()); -const Plugin: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "baseClass": z.string(), "name": z.string(), "composerName": z.string().optional(), "autoload": z.record(z.string(), z.any()), "active": z.boolean().optional(), "managedByComposer": z.boolean().optional(), "path": z.string().optional(), "author": z.string().optional(), "copyright": z.string().optional(), "license": z.string().optional(), "version": z.string(), "upgradeVersion": z.string().optional(), "installedAt": z.string().optional(), "upgradedAt": z.string().optional(), "icon": z.string().optional(), "label": z.string(), "description": z.string().optional(), "manufacturerLink": z.string().optional(), "supportLink": z.string().optional(), "customFields": z.record(z.string(), z.any()).optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "translated": z.record(z.string(), z.any()).optional(), "paymentMethods": z.array(PaymentMethod).optional(), "changelog": z.any().optional()}).passthrough()); -const Price = z.lazy(() => z.object({"currencyId": z.string(), "gross": z.number(), "net": z.number(), "linked": z.boolean(), "percentage": z.object({"gross": z.number(), "net": z.number()}).passthrough().nullable().optional(), "listPrice": z.object({"currencyId": z.string().optional(), "gross": z.number(), "net": z.number(), "linked": z.boolean()}).passthrough().optional(), "regulationPrice": z.object({"currencyId": z.string().optional(), "gross": z.number(), "net": z.number(), "linked": z.boolean()}).passthrough().optional()}).passthrough()); -const Product: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "versionId": z.string().optional(), "parentId": z.string().optional(), "parentVersionId": z.string().optional(), "manufacturerId": z.string().optional(), "productManufacturerVersionId": z.string().optional(), "unitId": z.string().optional(), "taxId": z.string(), "coverId": z.string().optional(), "productMediaVersionId": z.string().optional(), "deliveryTimeId": z.string().optional(), "featureSetId": z.string().optional(), "canonicalProductId": z.string().optional(), "canonicalProductVersionId": z.string().optional(), "cmsPageId": z.string().optional(), "cmsPageVersionId": z.string().optional(), "openGraphMediaId": z.string().optional(), "price": z.array(Price), "productNumber": z.string(), "restockTime": z.number().int().optional(), "autoIncrement": z.number().int().optional(), "active": z.boolean().optional(), "available": z.boolean().optional(), "isCloseout": z.boolean().optional(), "availableStock": z.number().int().optional(), "stock": z.number().int(), "variation": z.array(z.string()).optional(), "displayGroup": z.string().optional(), "variantListingConfig": z.record(z.string(), z.any()).optional(), "variantRestrictions": z.record(z.string(), z.any()).optional(), "manufacturerNumber": z.string().optional(), "guaranteeMonths": z.number().int().optional(), "guaranteeConfirmed": z.boolean().optional(), "ean": z.string().optional(), "purchaseSteps": z.number().int().optional(), "maxPurchase": z.number().int().optional(), "minPurchase": z.number().int().optional(), "purchaseUnit": z.number().optional(), "referenceUnit": z.number().optional(), "shippingFree": z.boolean().optional(), "purchasePrices": z.array(Price).optional(), "markAsTopseller": z.boolean().optional(), "weight": z.number().optional(), "width": z.number().optional(), "height": z.number().optional(), "length": z.number().optional(), "releaseDate": z.string().optional(), "ratingAverage": z.number().optional(), "categoryTree": z.array(z.string()).optional(), "propertyIds": z.array(z.string()).optional(), "optionIds": z.array(z.string()).optional(), "streamIds": z.array(z.string()).optional(), "tagIds": z.array(z.string()).optional(), "categoryIds": z.array(z.string()).optional(), "childCount": z.number().int().optional(), "customFieldSetSelectionActive": z.boolean().optional(), "sales": z.number().int().optional(), "metaDescription": z.string().optional(), "name": z.string(), "keywords": z.string().optional(), "description": z.string().optional(), "descriptionTeaser": z.string().optional(), "metaTitle": z.string().optional(), "packUnit": z.string().optional(), "packUnitPlural": z.string().optional(), "customFields": z.record(z.string(), z.any()).optional(), "slotConfig": z.record(z.string(), z.any()).optional(), "customSearchKeywords": z.array(z.object({}).strict()).optional(), "ogTitle": z.string().optional(), "ogDescription": z.string().optional(), "type": z.enum(["physical", "digital"]).optional(), "states": z.array(z.string()).optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "translated": z.record(z.string(), z.any()).optional(), "downloads": z.array(ProductDownload).optional(), "parent": Product.optional(), "children": z.array(Product).optional(), "deliveryTime": DeliveryTime.optional(), "tax": Tax.optional(), "manufacturer": ProductManufacturer.optional(), "unit": Unit.optional(), "cover": ProductMedia.optional(), "openGraphMedia": Media.optional(), "featureSet": ProductFeatureSet.optional(), "cmsPage": CmsPage.optional(), "canonicalProduct": Product.optional(), "prices": z.array(ProductPrice).optional(), "media": z.array(ProductMedia).optional(), "crossSellings": z.array(ProductCrossSelling).optional(), "crossSellingAssignedProducts": z.array(ProductCrossSellingAssignedProducts).optional(), "configuratorSettings": z.array(ProductConfiguratorSetting).optional(), "visibilities": z.array(ProductVisibility).optional(), "searchKeywords": z.array(ProductSearchKeyword).optional(), "productReviews": z.array(ProductReview).optional(), "mainCategories": z.array(MainCategory).optional(), "seoUrls": z.array(SeoUrl).optional(), "orderLineItems": z.array(OrderLineItem).optional(), "wishlists": z.array(CustomerWishlistProduct).optional(), "options": z.array(PropertyGroupOption).optional(), "properties": z.array(PropertyGroupOption).optional(), "categories": z.array(Category).optional(), "streams": z.array(ProductStream).optional(), "categoriesRo": z.array(Category).optional(), "tags": z.array(Tag).optional(), "customFieldSets": z.array(CustomFieldSet).optional()}).passthrough()); -const ProductConfiguratorSetting: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "versionId": z.string().optional(), "productId": z.string(), "productVersionId": z.string().optional(), "mediaId": z.string().optional(), "optionId": z.string(), "price": z.record(z.string(), z.any()).optional(), "position": z.number().int().optional(), "customFields": z.record(z.string(), z.any()).optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "product": Product.optional(), "media": Media.optional(), "option": PropertyGroupOption.optional()}).passthrough()); -const ProductCrossSelling: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "name": z.string(), "position": z.number().int().optional(), "sortBy": z.string().optional(), "sortDirection": z.string().optional(), "type": z.string().optional(), "active": z.boolean().optional(), "limit": z.number().int().optional(), "productId": z.string(), "productVersionId": z.string().optional(), "productStreamId": z.string().optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "translated": z.record(z.string(), z.any()).optional(), "product": Product.optional(), "productStream": ProductStream.optional(), "assignedProducts": z.array(ProductCrossSellingAssignedProducts).optional()}).passthrough()); -const ProductCrossSellingAssignedProducts: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "crossSellingId": z.string(), "productId": z.string(), "productVersionId": z.string().optional(), "position": z.number().int().optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "product": Product.optional(), "crossSelling": ProductCrossSelling.optional()}).passthrough()); -const ProductDownload: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "versionId": z.string().optional(), "productId": z.string(), "productVersionId": z.string().optional(), "mediaId": z.string(), "position": z.number().int().optional(), "customFields": z.record(z.string(), z.any()).optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "product": Product.optional(), "media": Media.optional()}).passthrough()); -const ProductExport: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "productStreamId": z.string(), "storefrontSalesChannelId": z.string(), "salesChannelId": z.string(), "salesChannelDomainId": z.string(), "currencyId": z.string(), "fileName": z.string(), "accessKey": z.string(), "encoding": z.string(), "fileFormat": z.string(), "provider": z.string().optional(), "feedLabel": z.string().optional(), "includeVariants": z.boolean().optional(), "generateByCronjob": z.boolean(), "generatedAt": z.string().optional(), "nextGenerationAt": z.string().optional(), "interval": z.number().int(), "headerTemplate": z.string().optional(), "bodyTemplate": z.string().optional(), "footerTemplate": z.string().optional(), "pausedSchedule": z.boolean().optional(), "isRunning": z.boolean().optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "productStream": ProductStream.optional(), "storefrontSalesChannel": SalesChannel.optional(), "salesChannel": SalesChannel.optional(), "salesChannelDomain": SalesChannelDomain.optional(), "currency": Currency.optional()}).passthrough()); -const ProductFeatureSet: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "name": z.string(), "description": z.string().optional(), "features": z.record(z.string(), z.any()).optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "translated": z.record(z.string(), z.any()).optional(), "products": z.array(Product).optional()}).passthrough()); -const ProductKeywordDictionary: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "languageId": z.string(), "keyword": z.string(), "reversed": z.string().optional(), "language": Language.optional()}).passthrough()); -const ProductManufacturer: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "versionId": z.string().optional(), "mediaId": z.string().optional(), "link": z.string().optional(), "name": z.string(), "description": z.string().optional(), "customFields": z.record(z.string(), z.any()).optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "translated": z.record(z.string(), z.any()).optional(), "media": Media.optional(), "products": z.array(Product).optional()}).passthrough()); -const ProductMedia: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "versionId": z.string().optional(), "productId": z.string(), "productVersionId": z.string().optional(), "mediaId": z.string(), "position": z.number().int().optional(), "customFields": z.record(z.string(), z.any()).optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "product": Product.optional(), "media": Media.optional(), "coverProducts": z.array(Product).optional()}).passthrough()); -const ProductPrice: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "versionId": z.string().optional(), "productId": z.string(), "productVersionId": z.string().optional(), "ruleId": z.string(), "price": z.array(Price), "customFields": z.record(z.string(), z.any()).optional(), "quantityStart": z.number().int(), "quantityEnd": z.number().int().optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "product": Product.optional(), "rule": Rule.optional()}).passthrough()); -const ProductReview: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "productId": z.string(), "productVersionId": z.string().optional(), "customerId": z.string().optional(), "salesChannelId": z.string(), "languageId": z.string(), "externalUser": z.string().optional(), "externalEmail": z.string().optional(), "title": z.string(), "content": z.string(), "points": z.number().optional(), "status": z.boolean().optional(), "comment": z.string().optional(), "customFields": z.record(z.string(), z.any()).optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "product": Product.optional(), "customer": Customer.optional(), "salesChannel": SalesChannel.optional(), "language": Language.optional()}).passthrough()); -const ProductSearchConfig: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "languageId": z.string(), "andLogic": z.boolean().optional(), "minSearchLength": z.number().int().optional(), "excludedTerms": z.array(z.string()).optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "language": Language.optional(), "configFields": z.array(ProductSearchConfigField).optional()}).passthrough()); -const ProductSearchConfigField: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "searchConfigId": z.string(), "customFieldId": z.string().optional(), "field": z.string(), "tokenize": z.boolean().optional(), "searchable": z.boolean().optional(), "useExactSubfield": z.boolean().optional(), "ranking": z.number().int().optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "searchConfig": ProductSearchConfig.optional(), "customField": CustomField.optional()}).passthrough()); -const ProductSearchKeyword: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "versionId": z.string().optional(), "languageId": z.string(), "productId": z.string(), "productVersionId": z.string().optional(), "keyword": z.string(), "ranking": z.number(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "product": Product.optional(), "language": Language.optional()}).passthrough()); -const ProductStream: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "apiFilter": z.record(z.string(), z.any()).optional(), "invalid": z.boolean().optional(), "name": z.string(), "description": z.string().optional(), "customFields": z.record(z.string(), z.any()).optional(), "internal": z.boolean().optional(), "displayAsGroup": z.boolean().optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "translated": z.record(z.string(), z.any()).optional(), "filters": z.array(ProductStreamFilter).optional(), "productCrossSellings": z.array(ProductCrossSelling).optional(), "productExports": z.array(ProductExport).optional(), "categories": z.array(Category).optional(), "products": z.array(Product).optional()}).passthrough()); -const ProductStreamFilter: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "productStreamId": z.string(), "parentId": z.string().optional(), "type": z.string(), "field": z.string().optional(), "operator": z.string().optional(), "value": z.string().optional(), "parameters": z.record(z.string(), z.any()).optional(), "position": z.number().int().optional(), "customFields": z.record(z.string(), z.any()).optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "productStream": ProductStream.optional(), "parent": ProductStreamFilter.optional(), "queries": z.array(ProductStreamFilter).optional()}).passthrough()); -const ProductVisibility: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "productId": z.string(), "productVersionId": z.string().optional(), "salesChannelId": z.string(), "visibility": z.union([z.literal(10), z.literal(20), z.literal(30)]), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "salesChannel": SalesChannel.optional(), "product": Product.optional()}).passthrough()); -const Promotion: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "name": z.string(), "active": z.boolean().optional(), "validFrom": z.string().optional(), "validUntil": z.string().optional(), "maxRedemptionsGlobal": z.number().int().optional(), "maxRedemptionsPerCustomer": z.number().int().optional(), "priority": z.number().int().optional(), "exclusive": z.boolean().optional(), "code": z.string().optional(), "useCodes": z.boolean().optional(), "useIndividualCodes": z.boolean().optional(), "individualCodePattern": z.string().optional(), "useSetGroups": z.boolean().optional(), "customerRestriction": z.boolean().optional(), "preventCombination": z.boolean().optional(), "orderCount": z.number().int().optional(), "ordersPerCustomerCount": z.record(z.string(), z.any()).optional(), "exclusionIds": z.array(z.string()).optional(), "customFields": z.record(z.string(), z.any()).optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "translated": z.record(z.string(), z.any()).optional(), "setgroups": z.array(PromotionSetgroup).optional(), "salesChannels": z.array(PromotionSalesChannel).optional(), "discounts": z.array(PromotionDiscount).optional(), "individualCodes": z.array(PromotionIndividualCode).optional(), "personaRules": z.array(Rule).optional(), "personaCustomers": z.array(Customer).optional(), "orderRules": z.array(Rule).optional(), "cartRules": z.array(Rule).optional(), "orderLineItems": z.array(OrderLineItem).optional()}).passthrough()); -const PromotionDiscount: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "promotionId": z.string(), "scope": z.string(), "type": z.string(), "value": z.number(), "considerAdvancedRules": z.boolean().optional(), "maxValue": z.number().optional(), "sorterKey": z.string().optional(), "applierKey": z.string().optional(), "usageKey": z.string().optional(), "pickerKey": z.string().optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "promotion": Promotion.optional(), "discountRules": z.array(Rule).optional(), "promotionDiscountPrices": z.array(PromotionDiscountPrices).optional()}).passthrough()); -const PromotionDiscountPrices: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "discountId": z.string(), "currencyId": z.string(), "price": z.number(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "promotionDiscount": PromotionDiscount.optional(), "currency": Currency.optional()}).passthrough()); -const PromotionIndividualCode: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "promotionId": z.string(), "code": z.string(), "payload": z.record(z.string(), z.any()).optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "promotion": Promotion.optional()}).passthrough()); -const PromotionSalesChannel: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "promotionId": z.string(), "salesChannelId": z.string(), "priority": z.number().int(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "promotion": Promotion.optional(), "salesChannel": SalesChannel.optional()}).passthrough()); -const PromotionSetgroup: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "promotionId": z.string(), "packagerKey": z.string(), "sorterKey": z.string(), "value": z.number(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "promotion": Promotion.optional(), "setGroupRules": z.array(Rule).optional()}).passthrough()); -const PropertyGroup: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "name": z.string(), "description": z.string().optional(), "displayType": z.string().optional(), "sortingType": z.string().optional(), "filterable": z.boolean().optional(), "visibleOnProductDetailPage": z.boolean().optional(), "position": z.number().int().optional(), "customFields": z.record(z.string(), z.any()).optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "translated": z.record(z.string(), z.any()).optional(), "options": z.array(PropertyGroupOption).optional()}).passthrough()); -const PropertyGroupOption: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "groupId": z.string(), "name": z.string(), "position": z.number().int().optional(), "colorHexCode": z.string().optional(), "mediaId": z.string().optional(), "combinable": z.boolean().optional(), "customFields": z.record(z.string(), z.any()).optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "translated": z.record(z.string(), z.any()).optional(), "media": Media.optional(), "group": PropertyGroup.optional(), "productConfiguratorSettings": z.array(ProductConfiguratorSetting).optional(), "productProperties": z.array(Product).optional(), "productOptions": z.array(Product).optional()}).passthrough()); -const Rule: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "name": z.string(), "priority": z.number().int(), "description": z.string().optional(), "invalid": z.boolean().optional(), "areas": z.array(z.object({}).strict()).optional(), "customFields": z.record(z.string(), z.any()).optional(), "moduleTypes": z.record(z.string(), z.any()).optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "conditions": z.array(RuleCondition).optional(), "productPrices": z.array(ProductPrice).optional(), "shippingMethodPrices": z.array(ShippingMethodPrice).optional(), "shippingMethodPriceCalculations": z.array(ShippingMethodPrice).optional(), "shippingMethods": z.array(ShippingMethod).optional(), "paymentMethods": z.array(PaymentMethod).optional(), "personaPromotions": z.array(Promotion).optional(), "flowSequences": z.array(FlowSequence).optional(), "taxProviders": z.array(TaxProvider).optional(), "tags": z.array(Tag).optional(), "orderPromotions": z.array(Promotion).optional(), "cartPromotions": z.array(Promotion).optional(), "promotionDiscounts": z.array(PromotionDiscount).optional(), "promotionSetGroups": z.array(PromotionSetgroup).optional(), "extensions": z.any().optional()}).passthrough()); -const RuleCondition: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "type": z.string(), "ruleId": z.string(), "scriptId": z.string().optional(), "parentId": z.string().optional(), "value": z.record(z.string(), z.any()).optional(), "position": z.number().int().optional(), "customFields": z.record(z.string(), z.any()).optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "rule": Rule.optional(), "appScriptCondition": AppScriptCondition.optional(), "parent": RuleCondition.optional(), "children": z.array(RuleCondition).optional()}).passthrough()); -const SalesChannel: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "typeId": z.string(), "languageId": z.string(), "customerGroupId": z.string(), "currencyId": z.string(), "paymentMethodId": z.string(), "shippingMethodId": z.string(), "countryId": z.string(), "analyticsId": z.string().optional(), "navigationCategoryId": z.string(), "navigationCategoryVersionId": z.string().optional(), "navigationCategoryDepth": z.number().int().optional(), "footerCategoryId": z.string().optional(), "footerCategoryVersionId": z.string().optional(), "serviceCategoryId": z.string().optional(), "serviceCategoryVersionId": z.string().optional(), "mailHeaderFooterId": z.string().optional(), "hreflangDefaultDomainId": z.string().optional(), "measurementUnits": MeasurementUnits.optional(), "businessTimeZone": z.string().optional(), "name": z.string(), "shortName": z.string().optional(), "taxCalculationType": z.string().optional(), "accessKey": z.string(), "configuration": z.record(z.string(), z.any()).optional(), "active": z.boolean().optional(), "hreflangActive": z.boolean().optional(), "maintenance": z.boolean().optional(), "maintenanceIpAllowlist": z.array(z.string()).optional(), "maintenanceIpWhitelist": z.array(z.string()).optional(), "customFields": z.record(z.string(), z.any()).optional(), "paymentMethodIds": z.array(z.string()).optional(), "homeCmsPageId": z.string().optional(), "homeCmsPageVersionId": z.string().optional(), "homeSlotConfig": z.record(z.string(), z.any()).optional(), "homeEnabled": z.boolean(), "homeName": z.string().optional(), "homeMetaTitle": z.string().optional(), "homeMetaDescription": z.string().optional(), "homeKeywords": z.string().optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "translated": z.record(z.string(), z.any()).optional(), "extensions": z.object({"salesChannelTrackingOrders": z.object({"links": z.object({"related": z.string().optional()}).passthrough().optional(), "data": z.array(z.object({"type": z.string().optional(), "id": z.string().optional()}).passthrough()).optional()}).passthrough().optional(), "salesChannelTrackingCustomers": z.object({"links": z.object({"related": z.string().optional()}).passthrough().optional(), "data": z.array(z.object({"type": z.string().optional(), "id": z.string().optional()}).passthrough()).optional()}).passthrough().optional(), "themes": z.object({"links": z.object({"related": z.string().optional()}).passthrough().optional(), "data": z.array(z.object({"type": z.string().optional(), "id": z.string().optional()}).passthrough()).optional()}).passthrough().optional()}).passthrough().optional(), "currencies": z.array(Currency).optional(), "languages": z.array(Language).optional(), "countries": z.array(Country).optional(), "paymentMethods": z.array(PaymentMethod).optional(), "shippingMethods": z.array(ShippingMethod).optional(), "type": SalesChannelType.optional(), "language": Language.optional(), "customerGroup": CustomerGroup.optional(), "currency": Currency.optional(), "paymentMethod": PaymentMethod.optional(), "shippingMethod": ShippingMethod.optional(), "country": Country.optional(), "orders": z.array(Order).optional(), "customers": z.array(Customer).optional(), "homeCmsPage": CmsPage.optional(), "domains": z.array(SalesChannelDomain).optional(), "systemConfigs": z.array(SystemConfig).optional(), "navigationCategory": Category.optional(), "footerCategory": Category.optional(), "serviceCategory": Category.optional(), "productVisibilities": z.array(ProductVisibility).optional(), "hreflangDefaultDomain": SalesChannelDomain.optional(), "mailHeaderFooter": MailHeaderFooter.optional(), "newsletterRecipients": z.array(NewsletterRecipient).optional(), "numberRangeSalesChannels": z.array(NumberRangeSalesChannel).optional(), "promotionSalesChannels": z.array(PromotionSalesChannel).optional(), "documentBaseConfigSalesChannels": z.array(DocumentBaseConfigSalesChannel).optional(), "productReviews": z.array(ProductReview).optional(), "seoUrls": z.array(SeoUrl).optional(), "seoUrlTemplates": z.array(SeoUrlTemplate).optional(), "mainCategories": z.array(MainCategory).optional(), "productExports": z.array(ProductExport).optional(), "salesChannelFiles": z.array(SalesChannelFile).optional(), "analytics": SalesChannelAnalytics.optional(), "customerGroupsRegistrations": z.array(CustomerGroup).optional(), "landingPages": z.array(LandingPage).optional(), "boundCustomers": z.array(Customer).optional(), "wishlists": z.array(CustomerWishlist).optional()}).passthrough()); -const SalesChannelAnalytics: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "trackingId": z.string().optional(), "active": z.boolean(), "trackOrders": z.boolean(), "anonymizeIp": z.boolean(), "trackOffcanvasCart": z.boolean(), "enhancedConversions": z.boolean().optional(), "createdAt": z.string(), "updatedAt": z.string().nullable().optional(), "salesChannel": SalesChannel.optional()}).passthrough()); -const SalesChannelDomain: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "url": z.string(), "salesChannelId": z.string(), "languageId": z.string(), "currencyId": z.string(), "snippetSetId": z.string(), "measurementUnits": MeasurementUnits.optional(), "hreflangUseOnlyLocale": z.boolean().optional(), "isExternalStorefront": z.boolean().optional(), "customFields": z.record(z.string(), z.any()).optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "salesChannel": SalesChannel.optional(), "language": Language.optional(), "currency": Currency.optional(), "snippetSet": SnippetSet.optional(), "salesChannelDefaultHreflang": SalesChannel.optional(), "productExports": z.array(ProductExport).optional()}).passthrough()); -const SalesChannelFile: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "salesChannelId": z.string(), "fileFamily": z.string(), "fileName": z.string(), "enabled": z.boolean(), "templateOverrides": z.record(z.string(), z.any()).optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "salesChannel": SalesChannel.optional()}).passthrough()); -const SalesChannelType: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "coverUrl": z.string().optional(), "iconName": z.string().optional(), "screenshotUrls": z.array(z.string()).optional(), "name": z.string(), "manufacturer": z.string().optional(), "description": z.string().optional(), "descriptionLong": z.string().optional(), "customFields": z.record(z.string(), z.any()).optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "translated": z.record(z.string(), z.any()).optional(), "salesChannels": z.array(SalesChannel).optional()}).passthrough()); -const Salutation: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "salutationKey": z.string(), "displayName": z.string(), "letterName": z.string(), "customFields": z.record(z.string(), z.any()).optional(), "position": z.number().int().optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "translated": z.record(z.string(), z.any()).optional(), "customers": z.array(Customer).optional(), "customerAddresses": z.array(CustomerAddress).optional(), "orderCustomers": z.array(OrderCustomer).optional(), "orderAddresses": z.array(OrderAddress).optional(), "newsletterRecipients": z.array(NewsletterRecipient).optional()}).passthrough()); -const SeoUrl: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "salesChannelId": z.string().optional(), "languageId": z.string(), "foreignKey": z.string(), "routeName": z.enum(["frontend.detail.page", "frontend.navigation.page", "frontend.landing.page"]), "pathInfo": z.string(), "seoPathInfo": z.string(), "isCanonical": z.boolean().optional(), "isModified": z.boolean().optional(), "isDeleted": z.boolean().optional(), "error": z.string().optional(), "url": z.string().optional(), "customFields": z.record(z.string(), z.any()).optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "language": Language.optional(), "salesChannel": SalesChannel.optional()}).passthrough()); -const SeoUrlTemplate: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "salesChannelId": z.string().optional(), "entityName": z.string(), "routeName": z.string(), "template": z.string().optional(), "isValid": z.boolean().optional(), "isHeadless": z.boolean().optional(), "customFields": z.record(z.string(), z.any()).optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "salesChannel": SalesChannel.optional()}).passthrough()); -const ShippingMethod: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "name": z.string(), "technicalName": z.string(), "active": z.boolean().optional(), "position": z.number().int().optional(), "customFields": z.record(z.string(), z.any()).optional(), "availabilityRuleId": z.string().optional(), "mediaId": z.string().optional(), "deliveryTimeId": z.string(), "taxType": z.string().optional(), "taxId": z.string().optional(), "description": z.string().optional(), "trackingUrl": z.string().optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "translated": z.record(z.string(), z.any()).optional(), "deliveryTime": DeliveryTime.optional(), "availabilityRule": Rule.optional(), "prices": z.array(ShippingMethodPrice).optional(), "media": Media.optional(), "tags": z.array(Tag).optional(), "orderDeliveries": z.array(OrderDelivery).optional(), "salesChannels": z.array(SalesChannel).optional(), "salesChannelDefaultAssignments": z.array(SalesChannel).optional(), "tax": Tax.optional(), "appShippingMethod": AppShippingMethod.optional()}).passthrough()); -const ShippingMethodPrice: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "shippingMethodId": z.string(), "ruleId": z.string().optional(), "calculation": z.number().int().optional(), "calculationRuleId": z.string().optional(), "quantityStart": z.number().optional(), "quantityEnd": z.number().optional(), "currencyPrice": z.array(Price).optional(), "customFields": z.record(z.string(), z.any()).optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "shippingMethod": ShippingMethod.optional(), "rule": Rule.optional(), "calculationRule": Rule.optional()}).passthrough()); -const Snippet: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "setId": z.string(), "translationKey": z.string(), "value": z.string(), "author": z.string(), "customFields": z.record(z.string(), z.any()).optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "set": SnippetSet.optional()}).passthrough()); -const SnippetSet: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "name": z.string(), "baseFile": z.string(), "iso": z.string(), "customFields": z.record(z.string(), z.any()).optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "snippets": z.array(Snippet).optional(), "salesChannelDomains": z.array(SalesChannelDomain).optional()}).passthrough()); -const StateMachine: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "technicalName": z.string(), "name": z.string(), "customFields": z.record(z.string(), z.any()).optional(), "initialStateId": z.string().optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "translated": z.record(z.string(), z.any()).optional(), "states": z.array(StateMachineState).optional(), "transitions": z.array(StateMachineTransition).optional(), "historyEntries": z.array(StateMachineHistory).optional()}).passthrough()); -const StateMachineHistory: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "referencedId": z.string(), "referencedVersionId": z.string(), "stateMachineId": z.string(), "entityName": z.string(), "fromStateId": z.string(), "toStateId": z.string(), "transitionActionName": z.string().optional(), "userId": z.string().optional(), "integrationId": z.string().optional(), "internalComment": z.string().optional(), "sourceType": z.string().optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "stateMachine": StateMachine.optional(), "fromStateMachineState": StateMachineState.optional(), "toStateMachineState": StateMachineState.optional(), "user": User.optional(), "integration": Integration.optional(), "entityId": z.any().optional()}).passthrough()); -const StateMachineState: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "technicalName": z.string(), "name": z.string(), "stateMachineId": z.string(), "customFields": z.record(z.string(), z.any()).optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "translated": z.record(z.string(), z.any()).optional(), "stateMachine": StateMachine.optional(), "fromStateMachineTransitions": z.array(StateMachineTransition).optional(), "toStateMachineTransitions": z.array(StateMachineTransition).optional(), "orderTransactions": z.array(OrderTransaction).optional(), "orderDeliveries": z.array(OrderDelivery).optional(), "orders": z.array(Order).optional(), "orderTransactionCaptures": z.array(OrderTransactionCapture).optional(), "orderTransactionCaptureRefunds": z.array(OrderTransactionCaptureRefund).optional(), "toStateMachineHistoryEntries": z.array(StateMachineHistory).optional(), "fromStateMachineHistoryEntries": z.array(StateMachineHistory).optional()}).passthrough()); -const StateMachineTransition: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "actionName": z.string(), "stateMachineId": z.string(), "fromStateId": z.string(), "toStateId": z.string(), "customFields": z.record(z.string(), z.any()).optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "stateMachine": StateMachine.optional(), "fromStateMachineState": StateMachineState.optional(), "toStateMachineState": StateMachineState.optional()}).passthrough()); -const SystemConfig: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "configurationKey": z.string(), "configurationValue": z.object({"_value": z.record(z.string(), z.any()).optional()}).passthrough(), "salesChannelId": z.string().optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "salesChannel": SalesChannel.optional()}).passthrough()); -const Tag: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "name": z.string(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "products": z.array(Product).optional(), "media": z.array(Media).optional(), "categories": z.array(Category).optional(), "customers": z.array(Customer).optional(), "orders": z.array(Order).optional(), "shippingMethods": z.array(ShippingMethod).optional(), "newsletterRecipients": z.array(NewsletterRecipient).optional(), "landingPages": z.array(LandingPage).optional(), "rules": z.array(Rule).optional()}).passthrough()); -const Tax: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "taxRate": z.number(), "name": z.string(), "position": z.number().int().optional(), "customFields": z.record(z.string(), z.any()).optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "products": z.array(Product).optional(), "rules": z.array(TaxRule).optional(), "shippingMethods": z.array(ShippingMethod).optional()}).passthrough()); -const TaxProvider: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "identifier": z.string(), "active": z.boolean().optional(), "name": z.string(), "priority": z.number().int(), "processUrl": z.string().optional(), "availabilityRuleId": z.string().optional(), "appId": z.string().optional(), "customFields": z.record(z.string(), z.any()).optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "translated": z.record(z.string(), z.any()).optional(), "availabilityRule": Rule.optional(), "app": App.optional()}).passthrough()); -const TaxRule: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "taxRuleTypeId": z.string(), "countryId": z.string(), "taxRate": z.number(), "data": z.object({"states": z.array(z.object({}).strict()).optional(), "zipCode": z.string().optional(), "fromZipCode": z.string().optional(), "toZipCode": z.string().optional()}).passthrough().optional(), "taxId": z.string(), "activeFrom": z.string().optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "type": TaxRuleType.optional(), "country": Country.optional(), "tax": Tax.optional()}).passthrough()); -const TaxRuleType: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "technicalName": z.string(), "position": z.number().int(), "typeName": z.string(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "translated": z.record(z.string(), z.any()).optional(), "rules": z.array(TaxRule).optional()}).passthrough()); -const Unit: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "shortCode": z.string(), "name": z.string(), "customFields": z.record(z.string(), z.any()).optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "translated": z.record(z.string(), z.any()).optional(), "products": z.array(Product).optional()}).passthrough()); -const User: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "localeId": z.string(), "username": z.string(), "firstName": z.string(), "lastName": z.string(), "title": z.string().optional(), "email": z.string(), "active": z.boolean().optional(), "admin": z.boolean().optional(), "mcpAllowlist": z.record(z.string(), z.any()).optional(), "lastUpdatedPasswordAt": z.string().optional(), "timeZone": z.string().optional(), "customFields": z.record(z.string(), z.any()).optional(), "avatarId": z.string().optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "extensions": z.object({"createdNotifications": z.object({"links": z.object({"related": z.string().optional()}).passthrough().optional(), "data": z.array(z.object({"type": z.string().optional(), "id": z.string().optional()}).passthrough()).optional()}).passthrough().optional()}).passthrough().optional(), "locale": Locale.optional(), "avatarMedia": Media.optional(), "media": z.array(Media).optional(), "accessKeys": z.array(UserAccessKey).optional(), "configs": z.array(UserConfig).optional(), "stateMachineHistoryEntries": z.array(StateMachineHistory).optional(), "importExportLogEntries": z.array(ImportExportLog).optional(), "aclRoles": z.array(AclRole).optional(), "recoveryUser": UserRecovery.optional(), "createdOrders": z.array(Order).optional(), "updatedOrders": z.array(Order).optional(), "createdCustomers": z.array(Customer).optional(), "updatedCustomers": z.array(Customer).optional()}).passthrough()); -const UserAccessKey: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "userId": z.string(), "accessKey": z.string(), "secretAccessKey": z.string(), "lastUsageAt": z.string().optional(), "customFields": z.record(z.string(), z.any()).optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "user": User.optional()}).passthrough()); -const UserConfig: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "userId": z.string(), "key": z.string(), "value": z.record(z.string(), z.any()).optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "user": User.optional()}).passthrough()); -const UserRecovery: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "userId": z.string(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "user": User.optional(), "hash": z.any().optional()}).passthrough()); -const Webhook: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "name": z.string(), "eventName": z.string(), "url": z.string(), "onlyLiveVersion": z.boolean().optional(), "errorCount": z.number().int().optional(), "active": z.boolean().optional(), "appId": z.string().optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "app": App.optional()}).passthrough()); +const AclRole: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "name": z.string(), "description": z.string().optional(), "privileges": z.array(z.string()).optional(), "deletedAt": z.string().optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "users": z.array(User).optional(), "app": App.optional(), "integrations": z.array(Integration).optional()})); +const App: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "name": z.string(), "path": z.string(), "author": z.string().optional(), "copyright": z.string().optional(), "license": z.string().optional(), "active": z.boolean().optional(), "configurable": z.boolean().optional(), "privacy": z.string().optional(), "version": z.string(), "icon": z.string().optional(), "modules": z.array(z.record(z.string(), z.any())).optional(), "mainModule": z.record(z.string(), z.any()).optional(), "cookies": z.array(z.record(z.string(), z.any())).optional(), "allowDisable": z.boolean().optional(), "baseAppUrl": z.string().optional(), "allowedHosts": z.array(z.string()).optional(), "templateLoadPriority": z.number().int().optional(), "checkoutGatewayUrl": z.string().optional(), "contextGatewayUrl": z.string().optional(), "inAppPurchasesGatewayUrl": z.string().optional(), "sourceType": z.string().optional(), "sourceConfig": z.record(z.string(), z.any()).optional(), "selfManaged": z.boolean().optional(), "requestedPrivileges": z.array(z.string()).optional(), "label": z.string(), "description": z.string().optional(), "privacyPolicyExtensions": z.string().optional(), "customFields": z.record(z.string(), z.any()).optional(), "integrationId": z.string(), "aclRoleId": z.string(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "translated": z.record(z.string(), z.any()).optional(), "integration": Integration.optional(), "aclRole": AclRole.optional(), "customFieldSets": z.array(CustomFieldSet).optional(), "actionButtons": z.array(AppActionButton).optional(), "templates": z.array(AppTemplate).optional(), "webhooks": z.array(Webhook).optional(), "paymentMethods": z.array(AppPaymentMethod).optional(), "taxProviders": z.array(TaxProvider).optional(), "cmsBlocks": z.array(AppCmsBlock).optional(), "flowActions": z.array(AppFlowAction).optional(), "flowEvents": z.array(AppFlowEvent).optional(), "appShippingMethods": z.array(AppShippingMethod).optional(), "mcpTools": z.array(AppMcpTool).optional(), "mcpPrompts": z.array(AppMcpPrompt).optional(), "mcpResources": z.array(AppMcpResource).optional()})); +const AppActionButton: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "entity": z.string(), "view": z.string(), "url": z.string(), "action": z.string(), "label": z.string(), "appId": z.string(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "translated": z.record(z.string(), z.any()).optional(), "app": App.optional()})); +const AppCmsBlock: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "name": z.string(), "block": z.record(z.string(), z.any()), "template": z.string(), "styles": z.string(), "label": z.string(), "appId": z.string(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "translated": z.record(z.string(), z.any()).optional(), "app": App.optional()})); +const AppFlowAction: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "appId": z.string(), "name": z.string(), "badge": z.string().optional(), "parameters": z.record(z.string(), z.any()).optional(), "config": z.record(z.string(), z.any()).optional(), "headers": z.record(z.string(), z.any()).optional(), "requirements": z.array(z.string()).optional(), "iconRaw": z.string().optional(), "icon": z.string().optional(), "swIcon": z.string().optional(), "url": z.string(), "delayable": z.boolean().optional(), "label": z.string(), "description": z.string().optional(), "headline": z.string().optional(), "customFields": z.record(z.string(), z.any()).optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "translated": z.record(z.string(), z.any()).optional(), "app": App.optional(), "flowSequences": z.array(FlowSequence).optional()})); +const AppFlowEvent: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "appId": z.string(), "name": z.string(), "aware": z.array(z.string()), "customFields": z.record(z.string(), z.any()).optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "app": App.optional(), "flows": z.array(Flow).optional()})); +const AppMcpPrompt: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "name": z.string(), "url": z.string(), "appId": z.string(), "label": z.string(), "description": z.string().optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "translated": z.record(z.string(), z.any()).optional(), "app": App.optional()})); +const AppMcpResource: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "name": z.string(), "uri": z.string(), "url": z.string(), "mimeType": z.string().optional(), "appId": z.string(), "label": z.string(), "description": z.string().optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "translated": z.record(z.string(), z.any()).optional(), "app": App.optional()})); +const AppMcpTool: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "name": z.string(), "url": z.string(), "inputSchema": z.record(z.string(), z.any()).optional(), "requiredPrivileges": z.record(z.string(), z.any()).optional(), "appId": z.string(), "label": z.string(), "description": z.string().optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "translated": z.record(z.string(), z.any()).optional(), "app": App.optional()})); +const AppPaymentMethod: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "appName": z.string(), "identifier": z.string(), "payUrl": z.string().optional(), "finalizeUrl": z.string().optional(), "validateUrl": z.string().optional(), "captureUrl": z.string().optional(), "refundUrl": z.string().optional(), "recurringUrl": z.string().optional(), "appId": z.string().optional(), "originalMediaId": z.string().optional(), "paymentMethodId": z.string(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "app": App.optional(), "originalMedia": Media.optional(), "paymentMethod": PaymentMethod.optional()})); +const AppScriptCondition: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "identifier": z.string(), "name": z.string(), "active": z.boolean(), "group": z.string().optional(), "script": z.string().optional(), "config": z.record(z.string(), z.any()).optional(), "appId": z.string(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "translated": z.record(z.string(), z.any()).optional(), "app": App.optional(), "ruleConditions": z.array(RuleCondition).optional()})); +const AppShippingMethod: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "appName": z.string(), "identifier": z.string(), "appId": z.string().optional(), "shippingMethodId": z.string(), "originalMediaId": z.string().optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "app": App.optional(), "shippingMethod": ShippingMethod.optional(), "originalMedia": Media.optional()})); +const AppTemplate: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "template": z.string(), "path": z.string(), "active": z.boolean(), "appId": z.string(), "hash": z.string().optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "app": App.optional()})); +const Category: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "versionId": z.string().optional(), "parentId": z.string().optional(), "parentVersionId": z.string().optional(), "afterCategoryId": z.string().optional(), "afterCategoryVersionId": z.string().optional(), "mediaId": z.string().optional(), "displayNestedProducts": z.boolean().optional(), "autoIncrement": z.number().int().optional(), "breadcrumb": z.array(z.object({}).strict()).optional(), "level": z.number().int().optional(), "path": z.string().optional(), "childCount": z.number().int().optional(), "type": z.enum(["page", "link", "folder"]).optional(), "productAssignmentType": z.string().optional(), "visible": z.boolean().optional(), "active": z.boolean().optional(), "visibleChildCount": z.number().int().optional(), "name": z.string(), "customFields": z.record(z.string(), z.any()).optional(), "slotConfig": z.record(z.string(), z.any()).optional(), "linkType": z.enum(["category", "product", "external", "landing_page"]).optional(), "internalLink": z.string().optional(), "externalLink": z.string().optional(), "linkNewTab": z.boolean().optional(), "description": z.string().optional(), "metaTitle": z.string().optional(), "metaDescription": z.string().optional(), "keywords": z.string().optional(), "cmsPageId": z.string().optional(), "cmsPageVersionId": z.string().optional(), "productStreamId": z.string().optional(), "customEntityTypeId": z.string().optional(), "cmsPageIdSwitched": z.boolean().optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "translated": z.record(z.string(), z.any()).optional(), "parent": Category.optional(), "children": z.array(Category).optional(), "media": Media.optional(), "products": z.array(Product).optional(), "nestedProducts": z.array(Product).optional(), "tags": z.array(Tag).optional(), "cmsPage": CmsPage.optional(), "productStream": ProductStream.optional(), "navigationSalesChannels": z.array(SalesChannel).optional(), "footerSalesChannels": z.array(SalesChannel).optional(), "serviceSalesChannels": z.array(SalesChannel).optional(), "mainCategories": z.array(MainCategory).optional(), "seoUrls": z.array(SeoUrl).optional()})); +const CmsBlock: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "versionId": z.string().optional(), "cmsSectionVersionId": z.string().optional(), "position": z.number().int(), "type": z.string(), "locked": z.boolean().optional(), "name": z.string().optional(), "sectionPosition": z.string().optional(), "marginTop": z.string().optional(), "marginBottom": z.string().optional(), "marginLeft": z.string().optional(), "marginRight": z.string().optional(), "backgroundColor": z.string().optional(), "backgroundMediaId": z.string().optional(), "backgroundMediaMode": z.string().optional(), "cssClass": z.string().optional(), "visibility": z.object({"mobile": z.boolean().optional(), "desktop": z.boolean().optional(), "tablet": z.boolean().optional()}).optional(), "sectionId": z.string(), "customFields": z.record(z.string(), z.any()).optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "section": CmsSection.optional(), "backgroundMedia": Media.optional(), "slots": z.array(CmsSlot).optional()})); +const CmsPage: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "versionId": z.string().optional(), "name": z.string().optional(), "type": z.string(), "entity": z.string().optional(), "cssClass": z.string().optional(), "config": z.object({"backgroundColor": z.string().optional()}).optional(), "previewMediaId": z.string().optional(), "customFields": z.record(z.string(), z.any()).optional(), "locked": z.boolean().optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "translated": z.record(z.string(), z.any()).optional(), "sections": z.array(CmsSection).optional(), "previewMedia": Media.optional(), "categories": z.array(Category).optional(), "landingPages": z.array(LandingPage).optional(), "homeSalesChannels": z.array(SalesChannel).optional(), "products": z.array(Product).optional()})); +const CmsSection: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "versionId": z.string().optional(), "cmsPageVersionId": z.string().optional(), "position": z.number().int(), "type": z.enum(["default", "sidebar"]), "locked": z.boolean().optional(), "name": z.string().optional(), "sizingMode": z.string().optional(), "mobileBehavior": z.string().optional(), "backgroundColor": z.string().optional(), "backgroundMediaId": z.string().optional(), "backgroundMediaMode": z.string().optional(), "cssClass": z.string().optional(), "pageId": z.string(), "visibility": z.object({"mobile": z.boolean().optional(), "desktop": z.boolean().optional(), "tablet": z.boolean().optional()}).optional(), "customFields": z.record(z.string(), z.any()).optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "page": CmsPage.optional(), "backgroundMedia": Media.optional(), "blocks": z.array(CmsBlock).optional()})); +const CmsSlot: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "versionId": z.string().optional(), "cmsBlockVersionId": z.string().optional(), "fieldConfig": z.record(z.string(), z.any()).optional(), "type": z.string(), "slot": z.string(), "locked": z.boolean().optional(), "config": z.record(z.string(), z.any()).optional(), "customFields": z.record(z.string(), z.any()).optional(), "data": z.record(z.string(), z.any()).optional(), "blockId": z.string(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "translated": z.record(z.string(), z.any()).optional(), "block": CmsBlock.optional(), "VersionId": z.any().optional()})); +const Country: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "name": z.string(), "iso": z.string().optional(), "position": z.number().int().optional(), "active": z.boolean().optional(), "shippingAvailable": z.boolean().optional(), "iso3": z.string().optional(), "displayStateInRegistration": z.boolean().optional(), "forceStateInRegistration": z.boolean().optional(), "checkVatIdPattern": z.boolean().optional(), "vatIdRequired": z.boolean().optional(), "vatIdPattern": z.string().optional(), "customFields": z.record(z.string(), z.any()).optional(), "customerTax": z.object({"enabled": z.boolean(), "currencyId": z.string(), "amount": z.number()}).optional(), "companyTax": z.object({"enabled": z.boolean(), "currencyId": z.string(), "amount": z.number()}).optional(), "postalCodeRequired": z.boolean().optional(), "checkPostalCodePattern": z.boolean().optional(), "checkAdvancedPostalCodePattern": z.boolean().optional(), "advancedPostalCodePattern": z.string().optional(), "addressFormat": z.record(z.string(), z.any()), "defaultPostalCodePattern": z.string().optional(), "isEu": z.boolean().optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "translated": z.record(z.string(), z.any()).optional(), "states": z.array(CountryState).optional(), "customerAddresses": z.array(CustomerAddress).optional(), "orderAddresses": z.array(OrderAddress).optional(), "salesChannelDefaultAssignments": z.array(SalesChannel).optional(), "salesChannels": z.array(SalesChannel).optional(), "taxRules": z.array(TaxRule).optional(), "currencyCountryRoundings": z.array(CurrencyCountryRounding).optional()})); +const CountryState: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "countryId": z.string(), "shortCode": z.string(), "name": z.string(), "position": z.number().int().optional(), "active": z.boolean().optional(), "customFields": z.record(z.string(), z.any()).optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "translated": z.record(z.string(), z.any()).optional(), "country": Country.optional(), "customerAddresses": z.array(CustomerAddress).optional(), "orderAddresses": z.array(OrderAddress).optional()})); +const Currency: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "factor": z.number(), "symbol": z.string(), "isoCode": z.string(), "shortName": z.string(), "name": z.string(), "position": z.number().int().optional(), "isSystemDefault": z.boolean().optional(), "taxFreeFrom": z.number().optional(), "customFields": z.record(z.string(), z.any()).optional(), "itemRounding": z.object({"decimals": z.number().int(), "interval": z.number(), "roundForNet": z.boolean()}), "totalRounding": z.object({"decimals": z.number().int(), "interval": z.number(), "roundForNet": z.boolean()}), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "translated": z.record(z.string(), z.any()).optional(), "salesChannelDefaultAssignments": z.array(SalesChannel).optional(), "orders": z.array(Order).optional(), "salesChannels": z.array(SalesChannel).optional(), "salesChannelDomains": z.array(SalesChannelDomain).optional(), "promotionDiscountPrices": z.array(PromotionDiscountPrices).optional(), "productExports": z.array(ProductExport).optional(), "countryRoundings": z.array(CurrencyCountryRounding).optional()})); +const CurrencyCountryRounding: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "currencyId": z.string(), "countryId": z.string(), "itemRounding": z.object({"decimals": z.number().int(), "interval": z.number(), "roundForNet": z.boolean()}), "totalRounding": z.object({"decimals": z.number().int(), "interval": z.number(), "roundForNet": z.boolean()}), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "currency": Currency.optional(), "country": Country.optional()})); +const CustomField: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "name": z.string(), "type": z.string(), "config": z.record(z.string(), z.any()).optional(), "active": z.boolean().optional(), "customFieldSetId": z.string().optional(), "allowCustomerWrite": z.boolean().optional(), "allowCartExpose": z.boolean().optional(), "storeApiAware": z.boolean().optional(), "includeInSearch": z.boolean().optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "customFieldSet": CustomFieldSet.optional(), "productSearchConfigFields": z.array(ProductSearchConfigField).optional()})); +const CustomFieldSet: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "name": z.string(), "config": z.record(z.string(), z.any()).optional(), "active": z.boolean().optional(), "global": z.boolean().optional(), "position": z.number().int().optional(), "appId": z.string().optional(), "extensionName": z.string().optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "customFields": z.array(CustomField).optional(), "relations": z.array(CustomFieldSetRelation).optional(), "products": z.array(Product).optional(), "app": App.optional()})); +const CustomFieldSetRelation: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "customFieldSetId": z.string(), "entityName": z.string(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "customFieldSet": CustomFieldSet.optional()})); +const Customer: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "groupId": z.string(), "salesChannelId": z.string(), "languageId": z.string(), "lastPaymentMethodId": z.string().optional(), "defaultBillingAddressId": z.string(), "defaultShippingAddressId": z.string(), "autoIncrement": z.number().int().optional(), "customerNumber": z.string(), "salutationId": z.string().optional(), "firstName": z.string(), "lastName": z.string(), "email": z.string(), "title": z.string().optional(), "affiliateCode": z.string().optional(), "campaignCode": z.string().optional(), "active": z.boolean().optional(), "doubleOptInRegistration": z.boolean().optional(), "doubleOptInEmailSentDate": z.string().optional(), "doubleOptInConfirmDate": z.string().optional(), "hash": z.string().optional(), "guest": z.boolean().optional(), "firstLogin": z.string().optional(), "lastLogin": z.string().optional(), "birthday": z.string().optional(), "lastOrderDate": z.string().optional(), "orderCount": z.number().int().optional(), "orderTotalAmount": z.number().optional(), "reviewCount": z.number().int().optional(), "customFields": z.record(z.string(), z.any()).optional(), "remoteAddress": z.string().optional(), "tagIds": z.array(z.string()).optional(), "requestedGroupId": z.string().optional(), "boundSalesChannelId": z.string().optional(), "createdById": z.string().optional(), "updatedById": z.string().optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "extensions": z.object({"salesChannelTracking": z.object({"links": z.object({"related": z.string().optional()}).optional(), "data": z.object({"type": z.string().optional(), "id": z.string().optional()}).optional()}).optional()}).optional(), "group": CustomerGroup.optional(), "salesChannel": SalesChannel.optional(), "language": Language.optional(), "lastPaymentMethod": PaymentMethod.optional(), "defaultBillingAddress": CustomerAddress.optional(), "activeBillingAddress": CustomerAddress.optional(), "defaultShippingAddress": CustomerAddress.optional(), "activeShippingAddress": CustomerAddress.optional(), "salutation": Salutation.optional(), "addresses": z.array(CustomerAddress).optional(), "orderCustomers": z.array(OrderCustomer).optional(), "tags": z.array(Tag).optional(), "promotions": z.array(Promotion).optional(), "productReviews": z.array(ProductReview).optional(), "recoveryCustomer": CustomerRecovery.optional(), "requestedGroup": CustomerGroup.optional(), "boundSalesChannel": SalesChannel.optional(), "wishlists": z.array(CustomerWishlist).optional(), "createdBy": User.optional(), "updatedBy": User.optional(), "defaultPaymentMethodId": z.any().optional(), "company": z.any().optional(), "vatIds": z.any().optional(), "accountType": z.any().optional()})); +const CustomerAddress: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "customerId": z.string(), "countryId": z.string(), "countryStateId": z.string().optional(), "salutationId": z.string().optional(), "firstName": z.string(), "lastName": z.string(), "zipcode": z.string().optional(), "city": z.string(), "company": z.string().optional(), "street": z.string(), "department": z.string().optional(), "title": z.string().optional(), "phoneNumber": z.string().optional(), "additionalAddressLine1": z.string().optional(), "additionalAddressLine2": z.string().optional(), "hash": z.string().optional(), "customFields": z.record(z.string(), z.any()).optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "customer": Customer.optional(), "country": Country.optional(), "countryState": CountryState.optional(), "salutation": Salutation.optional()})); +const CustomerGroup: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "name": z.string(), "displayGross": z.boolean().optional(), "customFields": z.record(z.string(), z.any()).optional(), "registrationActive": z.boolean().optional(), "registrationTitle": z.string().optional(), "registrationIntroduction": z.string().optional(), "registrationOnlyCompanyRegistration": z.boolean().optional(), "registrationSeoMetaDescription": z.string().optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "translated": z.record(z.string(), z.any()).optional(), "customers": z.array(Customer).optional(), "salesChannels": z.array(SalesChannel).optional(), "registrationSalesChannels": z.array(SalesChannel).optional()})); +const CustomerRecovery: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "hash": z.string(), "customerId": z.string(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "customer": Customer.optional()})); +const CustomerWishlist: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "customerId": z.string(), "salesChannelId": z.string(), "customFields": z.record(z.string(), z.any()).optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "products": z.array(CustomerWishlistProduct).optional(), "customer": Customer.optional(), "salesChannel": SalesChannel.optional()})); +const CustomerWishlistProduct: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "productId": z.string(), "productVersionId": z.string().optional(), "wishlistId": z.string(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "wishlist": CustomerWishlist.optional(), "product": Product.optional()})); +const DeliveryTime: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "name": z.string(), "min": z.number().int(), "max": z.number().int(), "unit": z.string(), "customFields": z.record(z.string(), z.any()).optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "translated": z.record(z.string(), z.any()).optional(), "shippingMethods": z.array(ShippingMethod).optional(), "products": z.array(Product).optional()})); +const Document: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "typeName": z.string().optional(), "referencedDocumentId": z.string().optional(), "orderId": z.string(), "documentMediaFileId": z.string().optional(), "documentA11yMediaFileId": z.string().optional(), "orderVersionId": z.string().optional(), "config": z.record(z.string(), z.any()), "sent": z.boolean().optional(), "static": z.boolean().optional(), "deepLinkCode": z.string(), "documentNumber": z.string().optional(), "customFields": z.record(z.string(), z.any()).optional(), "documentTypeId": z.string(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "order": Order.optional(), "referencedDocument": Document.optional(), "dependentDocuments": z.array(Document).optional(), "documentMediaFile": Media.optional(), "documentA11yMediaFile": Media.optional(), "documentFiles": z.array(DocumentFile).optional(), "documentType": DocumentType.optional(), "fileType": z.any().optional()})); +const DocumentBaseConfig: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "typeName": z.string().optional(), "logoId": z.string().optional(), "name": z.string(), "filenamePrefix": z.string().optional(), "filenameSuffix": z.string().optional(), "filenameInfixes": z.record(z.string(), z.any()).optional(), "global": z.boolean().optional(), "documentNumber": z.string().optional(), "pageSize": z.string().optional(), "pageOrientation": z.string().optional(), "itemsPerPage": z.number().int().optional(), "displayHeader": z.boolean().optional(), "displayFooter": z.boolean().optional(), "displayPageCount": z.boolean().optional(), "displayCompanyAddress": z.boolean().optional(), "displayReturnAddress": z.boolean().optional(), "displayCustomerVatId": z.boolean().optional(), "customFields": z.record(z.string(), z.any()).optional(), "createdAt": z.string().optional(), "config": z.record(z.string(), z.any()).optional(), "documentTypeId": z.string(), "updatedAt": z.string().optional(), "logo": Media.optional(), "salesChannels": z.array(DocumentBaseConfigSalesChannel).optional(), "documentType": DocumentType.optional()})); +const DocumentBaseConfigSalesChannel: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "documentBaseConfigId": z.string(), "salesChannelId": z.string().optional(), "typeName": z.string().optional(), "documentTypeId": z.string().optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "documentBaseConfig": DocumentBaseConfig.optional(), "salesChannel": SalesChannel.optional(), "documentType": DocumentType.optional()})); +const DocumentFile: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "documentId": z.string(), "mediaId": z.string(), "documentFormat": z.string(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "document": Document.optional(), "media": Media.optional()})); +const DocumentType: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "name": z.string(), "technicalName": z.string(), "customFields": z.record(z.string(), z.any()).optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "translated": z.record(z.string(), z.any()).optional(), "documents": z.array(Document).optional(), "documentBaseConfigs": z.array(DocumentBaseConfig).optional(), "documentBaseConfigSalesChannels": z.array(DocumentBaseConfigSalesChannel).optional()})); +const Flow: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "name": z.string(), "eventName": z.string(), "priority": z.number().int().optional(), "invalid": z.boolean().optional(), "active": z.boolean().optional(), "description": z.string().optional(), "customFields": z.record(z.string(), z.any()).optional(), "appFlowEventId": z.string().optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "sequences": z.array(FlowSequence).optional(), "appFlowEvent": AppFlowEvent.optional()})); +const FlowSequence: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "flowId": z.string(), "ruleId": z.string().optional(), "actionName": z.string().optional(), "config": z.record(z.string(), z.any()).optional(), "position": z.number().int().optional(), "displayGroup": z.number().int().optional(), "trueCase": z.boolean().optional(), "parentId": z.string().optional(), "customFields": z.record(z.string(), z.any()).optional(), "appFlowActionId": z.string().optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "flow": Flow.optional(), "rule": Rule.optional(), "parent": FlowSequence.optional(), "children": z.array(FlowSequence).optional(), "appFlowAction": AppFlowAction.optional(), "appFlowEventId": z.any().optional()})); +const ImportExportFile: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "originalName": z.string(), "path": z.string(), "expireDate": z.string(), "size": z.number().int().optional(), "accessToken": z.string().optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "log": ImportExportLog.optional()})); +const ImportExportLog: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "activity": z.string(), "state": z.string(), "records": z.number().int(), "userId": z.string().optional(), "profileId": z.string().optional(), "fileId": z.string().optional(), "invalidRecordsLogId": z.string().optional(), "username": z.string().optional(), "profileName": z.string().optional(), "config": z.record(z.string(), z.any()), "result": z.record(z.string(), z.any()).optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "user": User.optional(), "profile": ImportExportProfile.optional(), "file": ImportExportFile.optional(), "invalidRecordsLog": ImportExportLog.optional(), "failedImportLog": ImportExportLog.optional()})); +const ImportExportProfile: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "technicalName": z.string(), "type": z.string().optional(), "systemDefault": z.boolean().optional(), "sourceEntity": z.string(), "fileType": z.string(), "delimiter": z.string(), "enclosure": z.string(), "mapping": z.record(z.string(), z.any()).optional(), "updateBy": z.record(z.string(), z.any()).optional(), "config": z.record(z.string(), z.any()).optional(), "label": z.string(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "translated": z.record(z.string(), z.any()).optional(), "importExportLogs": z.array(ImportExportLog).optional(), "name": z.any().optional()})); +const Integration: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "label": z.string(), "accessKey": z.string(), "secretAccessKey": z.string(), "lastUsageAt": z.string().optional(), "admin": z.boolean().optional(), "mcpAllowlist": z.record(z.string(), z.any()).optional(), "customFields": z.record(z.string(), z.any()).optional(), "deletedAt": z.string().optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "extensions": z.object({"createdNotifications": z.object({"links": z.object({"related": z.string().optional()}).optional(), "data": z.array(z.object({"type": z.string().optional(), "id": z.string().optional()})).optional()}).optional()}).optional(), "app": App.optional(), "stateMachineHistoryEntries": z.array(StateMachineHistory).optional(), "aclRoles": z.array(AclRole).optional(), "writeAccess": z.any().optional(), "integrationId": z.any().optional(), "aclRoleId": z.any().optional()})); +const LandingPage: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "versionId": z.string().optional(), "active": z.boolean().optional(), "name": z.string(), "customFields": z.record(z.string(), z.any()).optional(), "slotConfig": z.record(z.string(), z.any()).optional(), "metaTitle": z.string().optional(), "metaDescription": z.string().optional(), "keywords": z.string().optional(), "url": z.string(), "cmsPageId": z.string().optional(), "cmsPageVersionId": z.string().optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "translated": z.record(z.string(), z.any()).optional(), "tags": z.array(Tag).optional(), "cmsPage": CmsPage.optional(), "salesChannels": z.array(SalesChannel).optional(), "seoUrls": z.array(SeoUrl).optional()})); +const Language: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "parentId": z.string().optional(), "localeId": z.string(), "translationCodeId": z.string().optional(), "name": z.string(), "active": z.boolean().optional(), "translationAutoUpdate": z.boolean().optional(), "customFields": z.record(z.string(), z.any()).optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "parent": Language.optional(), "locale": Locale.optional(), "translationCode": Locale.optional(), "children": z.array(Language).optional(), "salesChannels": z.array(SalesChannel).optional(), "salesChannelDefaultAssignments": z.array(SalesChannel).optional(), "salesChannelDomains": z.array(SalesChannelDomain).optional(), "customers": z.array(Customer).optional(), "newsletterRecipients": z.array(NewsletterRecipient).optional(), "orders": z.array(Order).optional(), "productSearchKeywords": z.array(ProductSearchKeyword).optional(), "productKeywordDictionaries": z.array(ProductKeywordDictionary).optional(), "productReviews": z.array(ProductReview).optional(), "productSearchConfig": ProductSearchConfig.optional()})); +const Locale: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "code": z.string(), "name": z.string(), "territory": z.string(), "customFields": z.record(z.string(), z.any()).optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "translated": z.record(z.string(), z.any()).optional(), "languages": z.array(Language).optional(), "users": z.array(User).optional()})); +const MailHeaderFooter: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "systemDefault": z.boolean().optional(), "name": z.string(), "description": z.string().optional(), "headerHtml": z.string().optional(), "headerPlain": z.string().optional(), "footerHtml": z.string().optional(), "footerPlain": z.string().optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "translated": z.record(z.string(), z.any()).optional(), "salesChannels": z.array(SalesChannel).optional()})); +const MailTemplate: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "mailTemplateTypeId": z.string(), "systemDefault": z.boolean().optional(), "wasModifiedByUser": z.boolean().optional(), "senderName": z.string().optional(), "description": z.string().optional(), "subject": z.string(), "contentHtml": z.string(), "contentPlain": z.string(), "customFields": z.record(z.string(), z.any()).optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "translated": z.record(z.string(), z.any()).optional(), "mailTemplateType": MailTemplateType.optional(), "media": z.array(MailTemplateMedia).optional()})); +const MailTemplateMedia: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "mailTemplateId": z.string(), "languageId": z.string(), "mediaId": z.string(), "position": z.number().int().optional(), "mailTemplate": MailTemplate.optional(), "media": Media.optional()})); +const MailTemplateType: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "name": z.string(), "technicalName": z.string(), "availableEntities": z.record(z.string(), z.any()).optional(), "customFields": z.record(z.string(), z.any()).optional(), "templateData": z.record(z.string(), z.any()).optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "translated": z.record(z.string(), z.any()).optional(), "mailTemplates": z.array(MailTemplate).optional()})); +const MainCategory: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "productId": z.string(), "productVersionId": z.string().optional(), "categoryId": z.string(), "categoryVersionId": z.string().optional(), "salesChannelId": z.string(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "product": Product.optional(), "category": Category.optional(), "salesChannel": SalesChannel.optional()})); +const MeasurementUnits = z.lazy(() => z.object({"system": z.enum(["metric", "imperial"]).optional(), "units": z.object({"length": z.enum(["mm", "cm", "m", "in", "ft"]).optional(), "weight": z.enum(["g", "kg", "oz", "lb"]).optional()}).optional()})); +const Media: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "userId": z.string().optional(), "mediaFolderId": z.string().optional(), "mimeType": z.string().optional(), "fileExtension": z.string().optional(), "uploadedAt": z.string().optional(), "fileName": z.string().optional(), "fileSize": z.number().int().optional(), "metaData": z.record(z.string(), z.any()).optional(), "mediaType": z.record(z.string(), z.any()).optional(), "config": z.record(z.string(), z.any()).optional(), "alt": z.string().optional(), "title": z.string().optional(), "url": z.string().optional(), "path": z.string().optional(), "hasFile": z.boolean().optional(), "private": z.boolean().optional(), "customFields": z.record(z.string(), z.any()).optional(), "fileHash": z.string().optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "translated": z.record(z.string(), z.any()).optional(), "extensions": z.object({"themes": z.object({"links": z.object({"related": z.string().optional()}).optional(), "data": z.array(z.object({"type": z.string().optional(), "id": z.string().optional()})).optional()}).optional(), "themeMedia": z.object({"links": z.object({"related": z.string().optional()}).optional(), "data": z.array(z.object({"type": z.string().optional(), "id": z.string().optional()})).optional()}).optional()}).optional(), "tags": z.array(Tag).optional(), "thumbnails": z.array(MediaThumbnail).optional(), "user": User.optional(), "categories": z.array(Category).optional(), "productManufacturers": z.array(ProductManufacturer).optional(), "productMedia": z.array(ProductMedia).optional(), "productDownloads": z.array(ProductDownload).optional(), "orderLineItemDownloads": z.array(OrderLineItemDownload).optional(), "avatarUsers": z.array(User).optional(), "mediaFolder": MediaFolder.optional(), "propertyGroupOptions": z.array(PropertyGroupOption).optional(), "mailTemplateMedia": z.array(MailTemplateMedia).optional(), "documentBaseConfigs": z.array(DocumentBaseConfig).optional(), "shippingMethods": z.array(ShippingMethod).optional(), "paymentMethods": z.array(PaymentMethod).optional(), "productConfiguratorSettings": z.array(ProductConfiguratorSetting).optional(), "productOpenGraphImages": z.array(Product).optional(), "orderLineItems": z.array(OrderLineItem).optional(), "cmsBlocks": z.array(CmsBlock).optional(), "cmsSections": z.array(CmsSection).optional(), "cmsPages": z.array(CmsPage).optional(), "documents": z.array(Document).optional(), "a11yDocuments": z.array(Document).optional(), "appPaymentMethods": z.array(AppPaymentMethod).optional(), "appShippingMethods": z.array(AppShippingMethod).optional(), "documentFile": DocumentFile.optional()})); +const MediaDefaultFolder: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "entity": z.string(), "customFields": z.record(z.string(), z.any()).optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "folder": MediaFolder.optional()})); +const MediaFolder: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "useParentConfiguration": z.boolean().optional(), "configurationId": z.string(), "defaultFolderId": z.string().optional(), "parentId": z.string().optional(), "childCount": z.number().int().optional(), "path": z.string().optional(), "name": z.string(), "customFields": z.record(z.string(), z.any()).optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "parent": MediaFolder.optional(), "children": z.array(MediaFolder).optional(), "media": z.array(Media).optional(), "defaultFolder": MediaDefaultFolder.optional(), "configuration": MediaFolderConfiguration.optional()})); +const MediaFolderConfiguration: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "createThumbnails": z.boolean().optional(), "keepAspectRatio": z.boolean().optional(), "thumbnailQuality": z.number().int().optional(), "private": z.boolean().optional(), "noAssociation": z.boolean().optional(), "customFields": z.record(z.string(), z.any()).optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "mediaFolders": z.array(MediaFolder).optional(), "mediaThumbnailSizes": z.array(MediaThumbnailSize).optional()})); +const MediaThumbnail: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "mediaId": z.string(), "mediaThumbnailSizeId": z.string().optional(), "width": z.number().int(), "height": z.number().int(), "url": z.string().optional(), "path": z.string().optional(), "customFields": z.record(z.string(), z.any()).optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "media": Media.optional(), "mediaThumbnailSize": MediaThumbnailSize.optional()})); +const MediaThumbnailSize: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "width": z.number().int(), "height": z.number().int(), "customFields": z.record(z.string(), z.any()).optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "mediaFolderConfigurations": z.array(MediaFolderConfiguration).optional(), "mediaThumbnails": z.array(MediaThumbnail).optional()})); +const NewsletterRecipient: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "email": z.string(), "title": z.string().optional(), "firstName": z.string().optional(), "lastName": z.string().optional(), "zipCode": z.string().optional(), "city": z.string().optional(), "street": z.string().optional(), "status": z.enum(["notSet", "optIn", "optOut", "direct"]), "hash": z.string(), "customFields": z.record(z.string(), z.any()).optional(), "confirmedAt": z.string().optional(), "salutationId": z.string().optional(), "languageId": z.string(), "salesChannelId": z.string(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "tags": z.array(Tag).optional(), "salutation": Salutation.optional(), "language": Language.optional(), "salesChannel": SalesChannel.optional()})); +const NumberRange: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "typeId": z.string(), "global": z.boolean(), "name": z.string(), "description": z.string().optional(), "pattern": z.string(), "start": z.number().int(), "customFields": z.record(z.string(), z.any()).optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "translated": z.record(z.string(), z.any()).optional(), "type": NumberRangeType.optional(), "numberRangeSalesChannels": z.array(NumberRangeSalesChannel).optional(), "state": NumberRangeState.optional()})); +const NumberRangeSalesChannel: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "numberRangeId": z.string(), "salesChannelId": z.string(), "numberRangeTypeId": z.string().optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "numberRange": NumberRange.optional(), "salesChannel": SalesChannel.optional(), "numberRangeType": NumberRangeType.optional()})); +const NumberRangeState: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "numberRangeId": z.string(), "lastValue": z.number().int(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "numberRange": NumberRange.optional()})); +const NumberRangeType: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "technicalName": z.string().optional(), "typeName": z.string(), "global": z.boolean(), "customFields": z.record(z.string(), z.any()).optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "translated": z.record(z.string(), z.any()).optional(), "numberRanges": z.array(NumberRange).optional(), "numberRangeSalesChannels": z.array(NumberRangeSalesChannel).optional()})); +const Order: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "versionId": z.string().optional(), "autoIncrement": z.number().int().optional(), "orderNumber": z.string().optional(), "billingAddressId": z.string(), "billingAddressVersionId": z.string().optional(), "primaryOrderDeliveryId": z.string().optional(), "primaryOrderDeliveryVersionId": z.string().optional(), "primaryOrderTransactionId": z.string().optional(), "primaryOrderTransactionVersionId": z.string().optional(), "currencyId": z.string(), "languageId": z.string(), "salesChannelId": z.string(), "orderDateTime": z.string(), "orderDate": z.string().optional(), "price": z.object({"netPrice": z.number(), "totalPrice": z.number(), "calculatedTaxes": z.record(z.string(), z.any()).optional(), "taxRules": z.record(z.string(), z.any()).optional(), "positionPrice": z.number(), "rawTotal": z.number(), "taxStatus": z.string()}).optional(), "amountTotal": z.number().optional(), "amountNet": z.number().optional(), "positionPrice": z.number().optional(), "taxStatus": z.string().optional(), "shippingCosts": z.object({"unitPrice": z.number(), "totalPrice": z.number(), "quantity": z.number().int(), "calculatedTaxes": z.record(z.string(), z.any()).optional(), "taxRules": z.record(z.string(), z.any()).optional(), "referencePrice": z.record(z.string(), z.any()).optional(), "listPrice": z.object({"price": z.number().optional(), "discount": z.number().optional(), "percentage": z.number().optional()}).optional(), "regulationPrice": z.object({"price": z.number().optional()}).optional()}).optional(), "shippingTotal": z.number().optional(), "currencyFactor": z.number(), "deepLinkCode": z.string().optional(), "affiliateCode": z.string().optional(), "campaignCode": z.string().optional(), "customerComment": z.string().optional(), "internalComment": z.string().optional(), "source": z.string().optional(), "taxCalculationType": z.string().optional(), "stateId": z.string(), "ruleIds": z.array(z.string()).optional(), "customFields": z.record(z.string(), z.any()).optional(), "createdById": z.string().optional(), "updatedById": z.string().optional(), "itemRounding": z.object({"decimals": z.number().int(), "interval": z.number(), "roundForNet": z.boolean()}), "totalRounding": z.object({"decimals": z.number().int(), "interval": z.number(), "roundForNet": z.boolean()}), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "extensions": z.object({"salesChannelTracking": z.object({"links": z.object({"related": z.string().optional()}).optional(), "data": z.object({"type": z.string().optional(), "id": z.string().optional()}).optional()}).optional()}).optional(), "stateMachineState": StateMachineState.optional(), "primaryOrderDelivery": OrderDelivery.optional(), "primaryOrderTransaction": OrderTransaction.optional(), "orderCustomer": OrderCustomer.optional(), "currency": Currency.optional(), "language": Language.optional(), "salesChannel": SalesChannel.optional(), "addresses": z.array(OrderAddress).optional(), "billingAddress": OrderAddress.optional(), "deliveries": z.array(OrderDelivery).optional(), "lineItems": z.array(OrderLineItem).optional(), "transactions": z.array(OrderTransaction).optional(), "documents": z.array(Document).optional(), "tags": z.array(Tag).optional(), "createdBy": User.optional(), "updatedBy": User.optional()})); +const OrderAddress: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "versionId": z.string().optional(), "countryId": z.string(), "countryStateId": z.string().optional(), "orderId": z.string(), "orderVersionId": z.string().optional(), "salutationId": z.string().optional(), "firstName": z.string(), "lastName": z.string(), "street": z.string(), "zipcode": z.string().optional(), "city": z.string(), "company": z.string().optional(), "department": z.string().optional(), "title": z.string().optional(), "phoneNumber": z.string().optional(), "additionalAddressLine1": z.string().optional(), "additionalAddressLine2": z.string().optional(), "hash": z.string().optional(), "customFields": z.record(z.string(), z.any()).optional(), "vatId": z.string().optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "country": Country.optional(), "countryState": CountryState.optional(), "order": Order.optional(), "orderDeliveries": z.array(OrderDelivery).optional(), "salutation": Salutation.optional()})); +const OrderCustomer: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "versionId": z.string().optional(), "customerId": z.string().optional(), "orderId": z.string(), "orderVersionId": z.string().optional(), "email": z.string(), "salutationId": z.string().optional(), "firstName": z.string(), "lastName": z.string(), "company": z.string().optional(), "title": z.string().optional(), "vatIds": z.array(z.string()).optional(), "customerNumber": z.string().optional(), "customFields": z.record(z.string(), z.any()).optional(), "remoteAddress": z.string().optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "order": Order.optional(), "customer": Customer.optional(), "salutation": Salutation.optional()})); +const OrderDelivery: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "versionId": z.string().optional(), "orderId": z.string(), "orderVersionId": z.string().optional(), "shippingOrderAddressId": z.string(), "shippingOrderAddressVersionId": z.string().optional(), "shippingMethodId": z.string(), "stateId": z.string(), "trackingCodes": z.array(z.string()).optional(), "shippingDateEarliest": z.string(), "shippingDateLatest": z.string(), "shippingCosts": z.object({"unitPrice": z.number(), "totalPrice": z.number(), "quantity": z.number().int(), "calculatedTaxes": z.record(z.string(), z.any()).optional(), "taxRules": z.record(z.string(), z.any()).optional(), "referencePrice": z.record(z.string(), z.any()).optional(), "listPrice": z.object({"price": z.number().optional(), "discount": z.number().optional(), "percentage": z.number().optional()}).optional(), "regulationPrice": z.object({"price": z.number().optional()}).optional()}).optional(), "customFields": z.record(z.string(), z.any()).optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "stateMachineState": StateMachineState.optional(), "order": Order.optional(), "shippingOrderAddress": OrderAddress.optional(), "shippingMethod": ShippingMethod.optional(), "positions": z.array(OrderDeliveryPosition).optional(), "primaryOrder": Order.optional()})); +const OrderDeliveryPosition: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "versionId": z.string().optional(), "orderDeliveryId": z.string(), "orderDeliveryVersionId": z.string().optional(), "orderLineItemId": z.string(), "orderLineItemVersionId": z.string().optional(), "price": z.object({"unitPrice": z.number(), "totalPrice": z.number(), "quantity": z.number().int(), "calculatedTaxes": z.record(z.string(), z.any()).optional(), "taxRules": z.record(z.string(), z.any()).optional(), "referencePrice": z.record(z.string(), z.any()).optional(), "listPrice": z.object({"price": z.number().optional(), "discount": z.number().optional(), "percentage": z.number().optional()}).optional(), "regulationPrice": z.object({"price": z.number().optional()}).optional()}).optional(), "unitPrice": z.number().optional(), "totalPrice": z.number().optional(), "quantity": z.number().int().optional(), "customFields": z.record(z.string(), z.any()).optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "orderDelivery": OrderDelivery.optional(), "orderLineItem": OrderLineItem.optional()})); +const OrderLineItem: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "versionId": z.string().optional(), "orderId": z.string(), "orderVersionId": z.string().optional(), "productId": z.string().optional(), "productVersionId": z.string().optional(), "promotionId": z.string().optional(), "parentId": z.string().optional(), "parentVersionId": z.string().optional(), "coverId": z.string().optional(), "identifier": z.string(), "referencedId": z.string().optional(), "quantity": z.number().int(), "label": z.string(), "payload": z.record(z.string(), z.any()).optional(), "good": z.boolean().optional(), "removable": z.boolean().optional(), "stackable": z.boolean().optional(), "position": z.number().int().optional(), "price": z.object({"unitPrice": z.number(), "totalPrice": z.number(), "quantity": z.number().int(), "calculatedTaxes": z.record(z.string(), z.any()).optional(), "taxRules": z.record(z.string(), z.any()).optional(), "referencePrice": z.record(z.string(), z.any()).optional(), "listPrice": z.object({"price": z.number().optional(), "discount": z.number().optional(), "percentage": z.number().optional()}).optional(), "regulationPrice": z.object({"price": z.number().optional()}).optional()}), "priceDefinition": z.record(z.string(), z.any()).optional(), "unitPrice": z.number().optional(), "totalPrice": z.number().optional(), "description": z.string().optional(), "type": z.enum(["product", "credit", "custom", "promotion", "container", "discount", "quantity"]).optional(), "customFields": z.record(z.string(), z.any()).optional(), "states": z.array(z.string()), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "cover": Media.optional(), "order": Order.optional(), "product": Product.optional(), "promotion": Promotion.optional(), "orderDeliveryPositions": z.array(OrderDeliveryPosition).optional(), "orderTransactionCaptureRefundPositions": z.array(OrderTransactionCaptureRefundPosition).optional(), "downloads": z.array(OrderLineItemDownload).optional(), "parent": OrderLineItem.optional(), "children": z.array(OrderLineItem)})); +const OrderLineItemDownload: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "versionId": z.string().optional(), "orderLineItemId": z.string(), "orderLineItemVersionId": z.string().optional(), "mediaId": z.string(), "position": z.number().int(), "accessGranted": z.boolean(), "customFields": z.record(z.string(), z.any()).optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "orderLineItem": OrderLineItem.optional(), "media": Media.optional()})); +const OrderTransaction: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "versionId": z.string().optional(), "orderId": z.string(), "orderVersionId": z.string().optional(), "paymentMethodId": z.string(), "amount": z.object({"unitPrice": z.number(), "totalPrice": z.number(), "quantity": z.number().int(), "calculatedTaxes": z.record(z.string(), z.any()).optional(), "taxRules": z.record(z.string(), z.any()).optional(), "referencePrice": z.record(z.string(), z.any()).optional(), "listPrice": z.object({"price": z.number().optional(), "discount": z.number().optional(), "percentage": z.number().optional()}).optional(), "regulationPrice": z.object({"price": z.number().optional()}).optional()}), "validationData": z.record(z.string(), z.any()).optional(), "stateId": z.string(), "customFields": z.record(z.string(), z.any()).optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "stateMachineState": StateMachineState.optional(), "order": Order.optional(), "paymentMethod": PaymentMethod.optional(), "captures": z.array(OrderTransactionCapture).optional(), "primaryOrder": Order.optional(), "shippingCosts": z.object({"calculatedTaxes": z.any().optional(), "taxRules": z.any().optional(), "referencePrice": z.any().optional(), "listPrice": z.object({"price": z.any().optional(), "discount": z.any().optional(), "percentage": z.any().optional()}).optional(), "regulationPrice": z.object({"price": z.any().optional()}).optional()}).optional()})); +const OrderTransactionCapture: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "versionId": z.string().optional(), "orderTransactionId": z.string(), "orderTransactionVersionId": z.string().optional(), "stateId": z.string(), "externalReference": z.string().optional(), "amount": z.object({"unitPrice": z.number(), "totalPrice": z.number(), "quantity": z.number().int(), "calculatedTaxes": z.record(z.string(), z.any()).optional(), "taxRules": z.record(z.string(), z.any()).optional(), "referencePrice": z.record(z.string(), z.any()).optional(), "listPrice": z.object({"price": z.number().optional(), "discount": z.number().optional(), "percentage": z.number().optional()}).optional(), "regulationPrice": z.object({"price": z.number().optional()}).optional()}), "customFields": z.record(z.string(), z.any()).optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "stateMachineState": StateMachineState.optional(), "transaction": OrderTransaction.optional(), "refunds": z.array(OrderTransactionCaptureRefund).optional(), "shippingCosts": z.object({"calculatedTaxes": z.any().optional(), "taxRules": z.any().optional(), "referencePrice": z.any().optional(), "listPrice": z.object({"price": z.any().optional(), "discount": z.any().optional(), "percentage": z.any().optional()}).optional(), "regulationPrice": z.object({"price": z.any().optional()}).optional()}).optional()})); +const OrderTransactionCaptureRefund: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "versionId": z.string().optional(), "captureId": z.string(), "captureVersionId": z.string().optional(), "stateId": z.string(), "externalReference": z.string().optional(), "reason": z.string().optional(), "amount": z.object({"unitPrice": z.number(), "totalPrice": z.number(), "quantity": z.number().int(), "calculatedTaxes": z.record(z.string(), z.any()).optional(), "taxRules": z.record(z.string(), z.any()).optional(), "referencePrice": z.record(z.string(), z.any()).optional(), "listPrice": z.object({"price": z.number().optional(), "discount": z.number().optional(), "percentage": z.number().optional()}).optional(), "regulationPrice": z.object({"price": z.number().optional()}).optional()}), "customFields": z.record(z.string(), z.any()).optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "stateMachineState": StateMachineState.optional(), "transactionCapture": OrderTransactionCapture.optional(), "positions": z.array(OrderTransactionCaptureRefundPosition).optional(), "shippingCosts": z.object({"calculatedTaxes": z.any().optional(), "taxRules": z.any().optional(), "referencePrice": z.any().optional(), "listPrice": z.object({"price": z.any().optional(), "discount": z.any().optional(), "percentage": z.any().optional()}).optional(), "regulationPrice": z.object({"price": z.any().optional()}).optional()}).optional()})); +const OrderTransactionCaptureRefundPosition: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "versionId": z.string().optional(), "refundId": z.string(), "refundVersionId": z.string().optional(), "orderLineItemId": z.string(), "orderLineItemVersionId": z.string().optional(), "externalReference": z.string().optional(), "reason": z.string().optional(), "quantity": z.number().int().optional(), "amount": z.object({"unitPrice": z.number(), "totalPrice": z.number(), "quantity": z.number().int(), "calculatedTaxes": z.record(z.string(), z.any()).optional(), "taxRules": z.record(z.string(), z.any()).optional(), "referencePrice": z.record(z.string(), z.any()).optional(), "listPrice": z.object({"price": z.number().optional(), "discount": z.number().optional(), "percentage": z.number().optional()}).optional(), "regulationPrice": z.object({"price": z.number().optional()}).optional()}), "customFields": z.record(z.string(), z.any()).optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "orderLineItem": OrderLineItem.optional(), "orderTransactionCaptureRefund": OrderTransactionCaptureRefund.optional(), "shippingCosts": z.object({"calculatedTaxes": z.any().optional(), "taxRules": z.any().optional(), "referencePrice": z.any().optional(), "listPrice": z.object({"price": z.any().optional(), "discount": z.any().optional(), "percentage": z.any().optional()}).optional(), "regulationPrice": z.object({"price": z.any().optional()}).optional()}).optional()})); +const PaymentMethod: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "pluginId": z.string().optional(), "handlerIdentifier": z.string().optional(), "name": z.string(), "distinguishableName": z.string().optional(), "description": z.string().optional(), "position": z.number().int().optional(), "active": z.boolean().optional(), "afterOrderEnabled": z.boolean().optional(), "customFields": z.record(z.string(), z.any()).optional(), "availabilityRuleId": z.string().optional(), "mediaId": z.string().optional(), "formattedHandlerIdentifier": z.string().optional(), "technicalName": z.string(), "shortName": z.string().optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "translated": z.record(z.string(), z.any()).optional(), "media": Media.optional(), "availabilityRule": Rule.optional(), "salesChannelDefaultAssignments": z.array(SalesChannel).optional(), "plugin": Plugin.optional(), "customers": z.array(Customer).optional(), "orderTransactions": z.array(OrderTransaction).optional(), "salesChannels": z.array(SalesChannel).optional(), "appPaymentMethod": AppPaymentMethod.optional()})); +const Plugin: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "baseClass": z.string(), "name": z.string(), "composerName": z.string().optional(), "autoload": z.record(z.string(), z.any()), "active": z.boolean().optional(), "managedByComposer": z.boolean().optional(), "path": z.string().optional(), "author": z.string().optional(), "copyright": z.string().optional(), "license": z.string().optional(), "version": z.string(), "upgradeVersion": z.string().optional(), "installedAt": z.string().optional(), "upgradedAt": z.string().optional(), "icon": z.string().optional(), "label": z.string(), "description": z.string().optional(), "manufacturerLink": z.string().optional(), "supportLink": z.string().optional(), "customFields": z.record(z.string(), z.any()).optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "translated": z.record(z.string(), z.any()).optional(), "paymentMethods": z.array(PaymentMethod).optional(), "changelog": z.any().optional()})); +const Price = z.lazy(() => z.object({"currencyId": z.string(), "gross": z.number(), "net": z.number(), "linked": z.boolean(), "percentage": z.object({"gross": z.number(), "net": z.number()}).nullable().optional(), "listPrice": z.object({"currencyId": z.string().optional(), "gross": z.number(), "net": z.number(), "linked": z.boolean()}).optional(), "regulationPrice": z.object({"currencyId": z.string().optional(), "gross": z.number(), "net": z.number(), "linked": z.boolean()}).optional()})); +const Product: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "versionId": z.string().optional(), "parentId": z.string().optional(), "parentVersionId": z.string().optional(), "manufacturerId": z.string().optional(), "productManufacturerVersionId": z.string().optional(), "unitId": z.string().optional(), "taxId": z.string(), "coverId": z.string().optional(), "productMediaVersionId": z.string().optional(), "deliveryTimeId": z.string().optional(), "featureSetId": z.string().optional(), "canonicalProductId": z.string().optional(), "canonicalProductVersionId": z.string().optional(), "cmsPageId": z.string().optional(), "cmsPageVersionId": z.string().optional(), "openGraphMediaId": z.string().optional(), "price": z.array(Price), "productNumber": z.string(), "restockTime": z.number().int().optional(), "autoIncrement": z.number().int().optional(), "active": z.boolean().optional(), "available": z.boolean().optional(), "isCloseout": z.boolean().optional(), "availableStock": z.number().int().optional(), "stock": z.number().int(), "variation": z.array(z.string()).optional(), "displayGroup": z.string().optional(), "variantListingConfig": z.record(z.string(), z.any()).optional(), "variantRestrictions": z.record(z.string(), z.any()).optional(), "manufacturerNumber": z.string().optional(), "guaranteeMonths": z.number().int().optional(), "guaranteeConfirmed": z.boolean().optional(), "ean": z.string().optional(), "purchaseSteps": z.number().int().optional(), "maxPurchase": z.number().int().optional(), "minPurchase": z.number().int().optional(), "purchaseUnit": z.number().optional(), "referenceUnit": z.number().optional(), "shippingFree": z.boolean().optional(), "purchasePrices": z.array(Price).optional(), "markAsTopseller": z.boolean().optional(), "weight": z.number().optional(), "width": z.number().optional(), "height": z.number().optional(), "length": z.number().optional(), "releaseDate": z.string().optional(), "ratingAverage": z.number().optional(), "categoryTree": z.array(z.string()).optional(), "propertyIds": z.array(z.string()).optional(), "optionIds": z.array(z.string()).optional(), "streamIds": z.array(z.string()).optional(), "tagIds": z.array(z.string()).optional(), "categoryIds": z.array(z.string()).optional(), "childCount": z.number().int().optional(), "customFieldSetSelectionActive": z.boolean().optional(), "sales": z.number().int().optional(), "metaDescription": z.string().optional(), "name": z.string(), "keywords": z.string().optional(), "description": z.string().optional(), "descriptionTeaser": z.string().optional(), "metaTitle": z.string().optional(), "packUnit": z.string().optional(), "packUnitPlural": z.string().optional(), "customFields": z.record(z.string(), z.any()).optional(), "slotConfig": z.record(z.string(), z.any()).optional(), "customSearchKeywords": z.array(z.object({}).strict()).optional(), "ogTitle": z.string().optional(), "ogDescription": z.string().optional(), "type": z.enum(["physical", "digital"]).optional(), "states": z.array(z.string()).optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "translated": z.record(z.string(), z.any()).optional(), "downloads": z.array(ProductDownload).optional(), "parent": Product.optional(), "children": z.array(Product).optional(), "deliveryTime": DeliveryTime.optional(), "tax": Tax.optional(), "manufacturer": ProductManufacturer.optional(), "unit": Unit.optional(), "cover": ProductMedia.optional(), "openGraphMedia": Media.optional(), "featureSet": ProductFeatureSet.optional(), "cmsPage": CmsPage.optional(), "canonicalProduct": Product.optional(), "prices": z.array(ProductPrice).optional(), "media": z.array(ProductMedia).optional(), "crossSellings": z.array(ProductCrossSelling).optional(), "crossSellingAssignedProducts": z.array(ProductCrossSellingAssignedProducts).optional(), "configuratorSettings": z.array(ProductConfiguratorSetting).optional(), "visibilities": z.array(ProductVisibility).optional(), "searchKeywords": z.array(ProductSearchKeyword).optional(), "productReviews": z.array(ProductReview).optional(), "mainCategories": z.array(MainCategory).optional(), "seoUrls": z.array(SeoUrl).optional(), "orderLineItems": z.array(OrderLineItem).optional(), "wishlists": z.array(CustomerWishlistProduct).optional(), "options": z.array(PropertyGroupOption).optional(), "properties": z.array(PropertyGroupOption).optional(), "categories": z.array(Category).optional(), "streams": z.array(ProductStream).optional(), "categoriesRo": z.array(Category).optional(), "tags": z.array(Tag).optional(), "customFieldSets": z.array(CustomFieldSet).optional()})); +const ProductConfiguratorSetting: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "versionId": z.string().optional(), "productId": z.string(), "productVersionId": z.string().optional(), "mediaId": z.string().optional(), "optionId": z.string(), "price": z.record(z.string(), z.any()).optional(), "position": z.number().int().optional(), "customFields": z.record(z.string(), z.any()).optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "product": Product.optional(), "media": Media.optional(), "option": PropertyGroupOption.optional()})); +const ProductCrossSelling: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "name": z.string(), "position": z.number().int().optional(), "sortBy": z.string().optional(), "sortDirection": z.string().optional(), "type": z.string().optional(), "active": z.boolean().optional(), "limit": z.number().int().optional(), "productId": z.string(), "productVersionId": z.string().optional(), "productStreamId": z.string().optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "translated": z.record(z.string(), z.any()).optional(), "product": Product.optional(), "productStream": ProductStream.optional(), "assignedProducts": z.array(ProductCrossSellingAssignedProducts).optional()})); +const ProductCrossSellingAssignedProducts: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "crossSellingId": z.string(), "productId": z.string(), "productVersionId": z.string().optional(), "position": z.number().int().optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "product": Product.optional(), "crossSelling": ProductCrossSelling.optional()})); +const ProductDownload: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "versionId": z.string().optional(), "productId": z.string(), "productVersionId": z.string().optional(), "mediaId": z.string(), "position": z.number().int().optional(), "customFields": z.record(z.string(), z.any()).optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "product": Product.optional(), "media": Media.optional()})); +const ProductExport: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "productStreamId": z.string(), "storefrontSalesChannelId": z.string(), "salesChannelId": z.string(), "salesChannelDomainId": z.string(), "currencyId": z.string(), "fileName": z.string(), "accessKey": z.string(), "encoding": z.string(), "fileFormat": z.string(), "provider": z.string().optional(), "feedLabel": z.string().optional(), "includeVariants": z.boolean().optional(), "generateByCronjob": z.boolean(), "generatedAt": z.string().optional(), "nextGenerationAt": z.string().optional(), "interval": z.number().int(), "headerTemplate": z.string().optional(), "bodyTemplate": z.string().optional(), "footerTemplate": z.string().optional(), "pausedSchedule": z.boolean().optional(), "isRunning": z.boolean().optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "productStream": ProductStream.optional(), "storefrontSalesChannel": SalesChannel.optional(), "salesChannel": SalesChannel.optional(), "salesChannelDomain": SalesChannelDomain.optional(), "currency": Currency.optional()})); +const ProductFeatureSet: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "name": z.string(), "description": z.string().optional(), "features": z.record(z.string(), z.any()).optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "translated": z.record(z.string(), z.any()).optional(), "products": z.array(Product).optional()})); +const ProductKeywordDictionary: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "languageId": z.string(), "keyword": z.string(), "reversed": z.string().optional(), "language": Language.optional()})); +const ProductManufacturer: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "versionId": z.string().optional(), "mediaId": z.string().optional(), "link": z.string().optional(), "name": z.string(), "description": z.string().optional(), "customFields": z.record(z.string(), z.any()).optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "translated": z.record(z.string(), z.any()).optional(), "media": Media.optional(), "products": z.array(Product).optional()})); +const ProductMedia: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "versionId": z.string().optional(), "productId": z.string(), "productVersionId": z.string().optional(), "mediaId": z.string(), "position": z.number().int().optional(), "customFields": z.record(z.string(), z.any()).optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "product": Product.optional(), "media": Media.optional(), "coverProducts": z.array(Product).optional()})); +const ProductPrice: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "versionId": z.string().optional(), "productId": z.string(), "productVersionId": z.string().optional(), "ruleId": z.string(), "price": z.array(Price), "customFields": z.record(z.string(), z.any()).optional(), "quantityStart": z.number().int(), "quantityEnd": z.number().int().optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "product": Product.optional(), "rule": Rule.optional()})); +const ProductReview: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "productId": z.string(), "productVersionId": z.string().optional(), "customerId": z.string().optional(), "salesChannelId": z.string(), "languageId": z.string(), "externalUser": z.string().optional(), "externalEmail": z.string().optional(), "title": z.string(), "content": z.string(), "points": z.number().optional(), "status": z.boolean().optional(), "comment": z.string().optional(), "customFields": z.record(z.string(), z.any()).optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "product": Product.optional(), "customer": Customer.optional(), "salesChannel": SalesChannel.optional(), "language": Language.optional()})); +const ProductSearchConfig: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "languageId": z.string(), "andLogic": z.boolean().optional(), "minSearchLength": z.number().int().optional(), "excludedTerms": z.array(z.string()).optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "language": Language.optional(), "configFields": z.array(ProductSearchConfigField).optional()})); +const ProductSearchConfigField: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "searchConfigId": z.string(), "customFieldId": z.string().optional(), "field": z.string(), "tokenize": z.boolean().optional(), "searchable": z.boolean().optional(), "useExactSubfield": z.boolean().optional(), "ranking": z.number().int().optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "searchConfig": ProductSearchConfig.optional(), "customField": CustomField.optional()})); +const ProductSearchKeyword: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "versionId": z.string().optional(), "languageId": z.string(), "productId": z.string(), "productVersionId": z.string().optional(), "keyword": z.string(), "ranking": z.number(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "product": Product.optional(), "language": Language.optional()})); +const ProductStream: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "apiFilter": z.record(z.string(), z.any()).optional(), "invalid": z.boolean().optional(), "name": z.string(), "description": z.string().optional(), "customFields": z.record(z.string(), z.any()).optional(), "internal": z.boolean().optional(), "displayAsGroup": z.boolean().optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "translated": z.record(z.string(), z.any()).optional(), "filters": z.array(ProductStreamFilter).optional(), "productCrossSellings": z.array(ProductCrossSelling).optional(), "productExports": z.array(ProductExport).optional(), "categories": z.array(Category).optional(), "products": z.array(Product).optional()})); +const ProductStreamFilter: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "productStreamId": z.string(), "parentId": z.string().optional(), "type": z.string(), "field": z.string().optional(), "operator": z.string().optional(), "value": z.string().optional(), "parameters": z.record(z.string(), z.any()).optional(), "position": z.number().int().optional(), "customFields": z.record(z.string(), z.any()).optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "productStream": ProductStream.optional(), "parent": ProductStreamFilter.optional(), "queries": z.array(ProductStreamFilter).optional()})); +const ProductVisibility: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "productId": z.string(), "productVersionId": z.string().optional(), "salesChannelId": z.string(), "visibility": z.union([z.literal(10), z.literal(20), z.literal(30)]), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "salesChannel": SalesChannel.optional(), "product": Product.optional()})); +const Promotion: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "name": z.string(), "active": z.boolean().optional(), "validFrom": z.string().optional(), "validUntil": z.string().optional(), "maxRedemptionsGlobal": z.number().int().optional(), "maxRedemptionsPerCustomer": z.number().int().optional(), "priority": z.number().int().optional(), "exclusive": z.boolean().optional(), "code": z.string().optional(), "useCodes": z.boolean().optional(), "useIndividualCodes": z.boolean().optional(), "individualCodePattern": z.string().optional(), "useSetGroups": z.boolean().optional(), "customerRestriction": z.boolean().optional(), "preventCombination": z.boolean().optional(), "orderCount": z.number().int().optional(), "ordersPerCustomerCount": z.record(z.string(), z.any()).optional(), "exclusionIds": z.array(z.string()).optional(), "customFields": z.record(z.string(), z.any()).optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "translated": z.record(z.string(), z.any()).optional(), "setgroups": z.array(PromotionSetgroup).optional(), "salesChannels": z.array(PromotionSalesChannel).optional(), "discounts": z.array(PromotionDiscount).optional(), "individualCodes": z.array(PromotionIndividualCode).optional(), "personaRules": z.array(Rule).optional(), "personaCustomers": z.array(Customer).optional(), "orderRules": z.array(Rule).optional(), "cartRules": z.array(Rule).optional(), "orderLineItems": z.array(OrderLineItem).optional()})); +const PromotionDiscount: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "promotionId": z.string(), "scope": z.string(), "type": z.string(), "value": z.number(), "considerAdvancedRules": z.boolean().optional(), "maxValue": z.number().optional(), "sorterKey": z.string().optional(), "applierKey": z.string().optional(), "usageKey": z.string().optional(), "pickerKey": z.string().optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "promotion": Promotion.optional(), "discountRules": z.array(Rule).optional(), "promotionDiscountPrices": z.array(PromotionDiscountPrices).optional()})); +const PromotionDiscountPrices: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "discountId": z.string(), "currencyId": z.string(), "price": z.number(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "promotionDiscount": PromotionDiscount.optional(), "currency": Currency.optional()})); +const PromotionIndividualCode: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "promotionId": z.string(), "code": z.string(), "payload": z.record(z.string(), z.any()).optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "promotion": Promotion.optional()})); +const PromotionSalesChannel: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "promotionId": z.string(), "salesChannelId": z.string(), "priority": z.number().int(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "promotion": Promotion.optional(), "salesChannel": SalesChannel.optional()})); +const PromotionSetgroup: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "promotionId": z.string(), "packagerKey": z.string(), "sorterKey": z.string(), "value": z.number(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "promotion": Promotion.optional(), "setGroupRules": z.array(Rule).optional()})); +const PropertyGroup: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "name": z.string(), "description": z.string().optional(), "displayType": z.string().optional(), "sortingType": z.string().optional(), "filterable": z.boolean().optional(), "visibleOnProductDetailPage": z.boolean().optional(), "position": z.number().int().optional(), "customFields": z.record(z.string(), z.any()).optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "translated": z.record(z.string(), z.any()).optional(), "options": z.array(PropertyGroupOption).optional()})); +const PropertyGroupOption: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "groupId": z.string(), "name": z.string(), "position": z.number().int().optional(), "colorHexCode": z.string().optional(), "mediaId": z.string().optional(), "combinable": z.boolean().optional(), "customFields": z.record(z.string(), z.any()).optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "translated": z.record(z.string(), z.any()).optional(), "media": Media.optional(), "group": PropertyGroup.optional(), "productConfiguratorSettings": z.array(ProductConfiguratorSetting).optional(), "productProperties": z.array(Product).optional(), "productOptions": z.array(Product).optional()})); +const Rule: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "name": z.string(), "priority": z.number().int(), "description": z.string().optional(), "invalid": z.boolean().optional(), "areas": z.array(z.object({}).strict()).optional(), "customFields": z.record(z.string(), z.any()).optional(), "moduleTypes": z.record(z.string(), z.any()).optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "conditions": z.array(RuleCondition).optional(), "productPrices": z.array(ProductPrice).optional(), "shippingMethodPrices": z.array(ShippingMethodPrice).optional(), "shippingMethodPriceCalculations": z.array(ShippingMethodPrice).optional(), "shippingMethods": z.array(ShippingMethod).optional(), "paymentMethods": z.array(PaymentMethod).optional(), "personaPromotions": z.array(Promotion).optional(), "flowSequences": z.array(FlowSequence).optional(), "taxProviders": z.array(TaxProvider).optional(), "tags": z.array(Tag).optional(), "orderPromotions": z.array(Promotion).optional(), "cartPromotions": z.array(Promotion).optional(), "promotionDiscounts": z.array(PromotionDiscount).optional(), "promotionSetGroups": z.array(PromotionSetgroup).optional(), "extensions": z.any().optional()})); +const RuleCondition: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "type": z.string(), "ruleId": z.string(), "scriptId": z.string().optional(), "parentId": z.string().optional(), "value": z.record(z.string(), z.any()).optional(), "position": z.number().int().optional(), "customFields": z.record(z.string(), z.any()).optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "rule": Rule.optional(), "appScriptCondition": AppScriptCondition.optional(), "parent": RuleCondition.optional(), "children": z.array(RuleCondition).optional()})); +const SalesChannel: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "typeId": z.string(), "languageId": z.string(), "customerGroupId": z.string(), "currencyId": z.string(), "paymentMethodId": z.string(), "shippingMethodId": z.string(), "countryId": z.string(), "analyticsId": z.string().optional(), "navigationCategoryId": z.string(), "navigationCategoryVersionId": z.string().optional(), "navigationCategoryDepth": z.number().int().optional(), "footerCategoryId": z.string().optional(), "footerCategoryVersionId": z.string().optional(), "serviceCategoryId": z.string().optional(), "serviceCategoryVersionId": z.string().optional(), "mailHeaderFooterId": z.string().optional(), "hreflangDefaultDomainId": z.string().optional(), "measurementUnits": MeasurementUnits.optional(), "businessTimeZone": z.string().optional(), "name": z.string(), "shortName": z.string().optional(), "taxCalculationType": z.string().optional(), "accessKey": z.string(), "configuration": z.record(z.string(), z.any()).optional(), "active": z.boolean().optional(), "hreflangActive": z.boolean().optional(), "maintenance": z.boolean().optional(), "maintenanceIpAllowlist": z.array(z.string()).optional(), "maintenanceIpWhitelist": z.array(z.string()).optional(), "customFields": z.record(z.string(), z.any()).optional(), "paymentMethodIds": z.array(z.string()).optional(), "homeCmsPageId": z.string().optional(), "homeCmsPageVersionId": z.string().optional(), "homeSlotConfig": z.record(z.string(), z.any()).optional(), "homeEnabled": z.boolean(), "homeName": z.string().optional(), "homeMetaTitle": z.string().optional(), "homeMetaDescription": z.string().optional(), "homeKeywords": z.string().optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "translated": z.record(z.string(), z.any()).optional(), "extensions": z.object({"salesChannelTrackingOrders": z.object({"links": z.object({"related": z.string().optional()}).optional(), "data": z.array(z.object({"type": z.string().optional(), "id": z.string().optional()})).optional()}).optional(), "salesChannelTrackingCustomers": z.object({"links": z.object({"related": z.string().optional()}).optional(), "data": z.array(z.object({"type": z.string().optional(), "id": z.string().optional()})).optional()}).optional(), "themes": z.object({"links": z.object({"related": z.string().optional()}).optional(), "data": z.array(z.object({"type": z.string().optional(), "id": z.string().optional()})).optional()}).optional()}).optional(), "currencies": z.array(Currency).optional(), "languages": z.array(Language).optional(), "countries": z.array(Country).optional(), "paymentMethods": z.array(PaymentMethod).optional(), "shippingMethods": z.array(ShippingMethod).optional(), "type": SalesChannelType.optional(), "language": Language.optional(), "customerGroup": CustomerGroup.optional(), "currency": Currency.optional(), "paymentMethod": PaymentMethod.optional(), "shippingMethod": ShippingMethod.optional(), "country": Country.optional(), "orders": z.array(Order).optional(), "customers": z.array(Customer).optional(), "homeCmsPage": CmsPage.optional(), "domains": z.array(SalesChannelDomain).optional(), "systemConfigs": z.array(SystemConfig).optional(), "navigationCategory": Category.optional(), "footerCategory": Category.optional(), "serviceCategory": Category.optional(), "productVisibilities": z.array(ProductVisibility).optional(), "hreflangDefaultDomain": SalesChannelDomain.optional(), "mailHeaderFooter": MailHeaderFooter.optional(), "newsletterRecipients": z.array(NewsletterRecipient).optional(), "numberRangeSalesChannels": z.array(NumberRangeSalesChannel).optional(), "promotionSalesChannels": z.array(PromotionSalesChannel).optional(), "documentBaseConfigSalesChannels": z.array(DocumentBaseConfigSalesChannel).optional(), "productReviews": z.array(ProductReview).optional(), "seoUrls": z.array(SeoUrl).optional(), "seoUrlTemplates": z.array(SeoUrlTemplate).optional(), "mainCategories": z.array(MainCategory).optional(), "productExports": z.array(ProductExport).optional(), "salesChannelFiles": z.array(SalesChannelFile).optional(), "analytics": SalesChannelAnalytics.optional(), "customerGroupsRegistrations": z.array(CustomerGroup).optional(), "landingPages": z.array(LandingPage).optional(), "boundCustomers": z.array(Customer).optional(), "wishlists": z.array(CustomerWishlist).optional()})); +const SalesChannelAnalytics: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "trackingId": z.string().optional(), "active": z.boolean(), "trackOrders": z.boolean(), "anonymizeIp": z.boolean(), "trackOffcanvasCart": z.boolean(), "enhancedConversions": z.boolean().optional(), "createdAt": z.string(), "updatedAt": z.string().nullable().optional(), "salesChannel": SalesChannel.optional()})); +const SalesChannelDomain: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "url": z.string(), "salesChannelId": z.string(), "languageId": z.string(), "currencyId": z.string(), "snippetSetId": z.string(), "measurementUnits": MeasurementUnits.optional(), "hreflangUseOnlyLocale": z.boolean().optional(), "isExternalStorefront": z.boolean().optional(), "customFields": z.record(z.string(), z.any()).optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "salesChannel": SalesChannel.optional(), "language": Language.optional(), "currency": Currency.optional(), "snippetSet": SnippetSet.optional(), "salesChannelDefaultHreflang": SalesChannel.optional(), "productExports": z.array(ProductExport).optional()})); +const SalesChannelFile: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "salesChannelId": z.string(), "fileFamily": z.string(), "fileName": z.string(), "enabled": z.boolean(), "templateOverrides": z.record(z.string(), z.any()).optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "salesChannel": SalesChannel.optional()})); +const SalesChannelType: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "coverUrl": z.string().optional(), "iconName": z.string().optional(), "screenshotUrls": z.array(z.string()).optional(), "name": z.string(), "manufacturer": z.string().optional(), "description": z.string().optional(), "descriptionLong": z.string().optional(), "customFields": z.record(z.string(), z.any()).optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "translated": z.record(z.string(), z.any()).optional(), "salesChannels": z.array(SalesChannel).optional()})); +const Salutation: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "salutationKey": z.string(), "displayName": z.string(), "letterName": z.string(), "customFields": z.record(z.string(), z.any()).optional(), "position": z.number().int().optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "translated": z.record(z.string(), z.any()).optional(), "customers": z.array(Customer).optional(), "customerAddresses": z.array(CustomerAddress).optional(), "orderCustomers": z.array(OrderCustomer).optional(), "orderAddresses": z.array(OrderAddress).optional(), "newsletterRecipients": z.array(NewsletterRecipient).optional()})); +const SeoUrl: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "salesChannelId": z.string().optional(), "languageId": z.string(), "foreignKey": z.string(), "routeName": z.enum(["frontend.detail.page", "frontend.navigation.page", "frontend.landing.page"]), "pathInfo": z.string(), "seoPathInfo": z.string(), "isCanonical": z.boolean().optional(), "isModified": z.boolean().optional(), "isDeleted": z.boolean().optional(), "error": z.string().optional(), "url": z.string().optional(), "customFields": z.record(z.string(), z.any()).optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "language": Language.optional(), "salesChannel": SalesChannel.optional()})); +const SeoUrlTemplate: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "salesChannelId": z.string().optional(), "entityName": z.string(), "routeName": z.string(), "template": z.string().optional(), "isValid": z.boolean().optional(), "isHeadless": z.boolean().optional(), "customFields": z.record(z.string(), z.any()).optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "salesChannel": SalesChannel.optional()})); +const ShippingMethod: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "name": z.string(), "technicalName": z.string(), "active": z.boolean().optional(), "position": z.number().int().optional(), "customFields": z.record(z.string(), z.any()).optional(), "availabilityRuleId": z.string().optional(), "mediaId": z.string().optional(), "deliveryTimeId": z.string(), "taxType": z.string().optional(), "taxId": z.string().optional(), "description": z.string().optional(), "trackingUrl": z.string().optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "translated": z.record(z.string(), z.any()).optional(), "deliveryTime": DeliveryTime.optional(), "availabilityRule": Rule.optional(), "prices": z.array(ShippingMethodPrice).optional(), "media": Media.optional(), "tags": z.array(Tag).optional(), "orderDeliveries": z.array(OrderDelivery).optional(), "salesChannels": z.array(SalesChannel).optional(), "salesChannelDefaultAssignments": z.array(SalesChannel).optional(), "tax": Tax.optional(), "appShippingMethod": AppShippingMethod.optional()})); +const ShippingMethodPrice: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "shippingMethodId": z.string(), "ruleId": z.string().optional(), "calculation": z.number().int().optional(), "calculationRuleId": z.string().optional(), "quantityStart": z.number().optional(), "quantityEnd": z.number().optional(), "currencyPrice": z.array(Price).optional(), "customFields": z.record(z.string(), z.any()).optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "shippingMethod": ShippingMethod.optional(), "rule": Rule.optional(), "calculationRule": Rule.optional()})); +const Snippet: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "setId": z.string(), "translationKey": z.string(), "value": z.string(), "author": z.string(), "customFields": z.record(z.string(), z.any()).optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "set": SnippetSet.optional()})); +const SnippetSet: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "name": z.string(), "baseFile": z.string(), "iso": z.string(), "customFields": z.record(z.string(), z.any()).optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "snippets": z.array(Snippet).optional(), "salesChannelDomains": z.array(SalesChannelDomain).optional()})); +const StateMachine: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "technicalName": z.string(), "name": z.string(), "customFields": z.record(z.string(), z.any()).optional(), "initialStateId": z.string().optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "translated": z.record(z.string(), z.any()).optional(), "states": z.array(StateMachineState).optional(), "transitions": z.array(StateMachineTransition).optional(), "historyEntries": z.array(StateMachineHistory).optional()})); +const StateMachineHistory: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "referencedId": z.string(), "referencedVersionId": z.string(), "stateMachineId": z.string(), "entityName": z.string(), "fromStateId": z.string(), "toStateId": z.string(), "transitionActionName": z.string().optional(), "userId": z.string().optional(), "integrationId": z.string().optional(), "internalComment": z.string().optional(), "sourceType": z.string().optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "stateMachine": StateMachine.optional(), "fromStateMachineState": StateMachineState.optional(), "toStateMachineState": StateMachineState.optional(), "user": User.optional(), "integration": Integration.optional(), "entityId": z.any().optional()})); +const StateMachineState: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "technicalName": z.string(), "name": z.string(), "stateMachineId": z.string(), "customFields": z.record(z.string(), z.any()).optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "translated": z.record(z.string(), z.any()).optional(), "stateMachine": StateMachine.optional(), "fromStateMachineTransitions": z.array(StateMachineTransition).optional(), "toStateMachineTransitions": z.array(StateMachineTransition).optional(), "orderTransactions": z.array(OrderTransaction).optional(), "orderDeliveries": z.array(OrderDelivery).optional(), "orders": z.array(Order).optional(), "orderTransactionCaptures": z.array(OrderTransactionCapture).optional(), "orderTransactionCaptureRefunds": z.array(OrderTransactionCaptureRefund).optional(), "toStateMachineHistoryEntries": z.array(StateMachineHistory).optional(), "fromStateMachineHistoryEntries": z.array(StateMachineHistory).optional()})); +const StateMachineTransition: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "actionName": z.string(), "stateMachineId": z.string(), "fromStateId": z.string(), "toStateId": z.string(), "customFields": z.record(z.string(), z.any()).optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "stateMachine": StateMachine.optional(), "fromStateMachineState": StateMachineState.optional(), "toStateMachineState": StateMachineState.optional()})); +const SystemConfig: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "configurationKey": z.string(), "configurationValue": z.object({"_value": z.record(z.string(), z.any()).optional()}), "salesChannelId": z.string().optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "salesChannel": SalesChannel.optional()})); +const Tag: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "name": z.string(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "products": z.array(Product).optional(), "media": z.array(Media).optional(), "categories": z.array(Category).optional(), "customers": z.array(Customer).optional(), "orders": z.array(Order).optional(), "shippingMethods": z.array(ShippingMethod).optional(), "newsletterRecipients": z.array(NewsletterRecipient).optional(), "landingPages": z.array(LandingPage).optional(), "rules": z.array(Rule).optional()})); +const Tax: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "taxRate": z.number(), "name": z.string(), "position": z.number().int().optional(), "customFields": z.record(z.string(), z.any()).optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "products": z.array(Product).optional(), "rules": z.array(TaxRule).optional(), "shippingMethods": z.array(ShippingMethod).optional()})); +const TaxProvider: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "identifier": z.string(), "active": z.boolean().optional(), "name": z.string(), "priority": z.number().int(), "processUrl": z.string().optional(), "availabilityRuleId": z.string().optional(), "appId": z.string().optional(), "customFields": z.record(z.string(), z.any()).optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "translated": z.record(z.string(), z.any()).optional(), "availabilityRule": Rule.optional(), "app": App.optional()})); +const TaxRule: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "taxRuleTypeId": z.string(), "countryId": z.string(), "taxRate": z.number(), "data": z.object({"states": z.array(z.object({}).strict()).optional(), "zipCode": z.string().optional(), "fromZipCode": z.string().optional(), "toZipCode": z.string().optional()}).optional(), "taxId": z.string(), "activeFrom": z.string().optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "type": TaxRuleType.optional(), "country": Country.optional(), "tax": Tax.optional()})); +const TaxRuleType: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "technicalName": z.string(), "position": z.number().int(), "typeName": z.string(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "translated": z.record(z.string(), z.any()).optional(), "rules": z.array(TaxRule).optional()})); +const Unit: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "shortCode": z.string(), "name": z.string(), "customFields": z.record(z.string(), z.any()).optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "translated": z.record(z.string(), z.any()).optional(), "products": z.array(Product).optional()})); +const User: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "localeId": z.string(), "username": z.string(), "firstName": z.string(), "lastName": z.string(), "title": z.string().optional(), "email": z.string(), "active": z.boolean().optional(), "admin": z.boolean().optional(), "mcpAllowlist": z.record(z.string(), z.any()).optional(), "lastUpdatedPasswordAt": z.string().optional(), "timeZone": z.string().optional(), "customFields": z.record(z.string(), z.any()).optional(), "avatarId": z.string().optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "extensions": z.object({"createdNotifications": z.object({"links": z.object({"related": z.string().optional()}).optional(), "data": z.array(z.object({"type": z.string().optional(), "id": z.string().optional()})).optional()}).optional()}).optional(), "locale": Locale.optional(), "avatarMedia": Media.optional(), "media": z.array(Media).optional(), "accessKeys": z.array(UserAccessKey).optional(), "configs": z.array(UserConfig).optional(), "stateMachineHistoryEntries": z.array(StateMachineHistory).optional(), "importExportLogEntries": z.array(ImportExportLog).optional(), "aclRoles": z.array(AclRole).optional(), "recoveryUser": UserRecovery.optional(), "createdOrders": z.array(Order).optional(), "updatedOrders": z.array(Order).optional(), "createdCustomers": z.array(Customer).optional(), "updatedCustomers": z.array(Customer).optional()})); +const UserAccessKey: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "userId": z.string(), "accessKey": z.string(), "secretAccessKey": z.string(), "lastUsageAt": z.string().optional(), "customFields": z.record(z.string(), z.any()).optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "user": User.optional()})); +const UserConfig: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "userId": z.string(), "key": z.string(), "value": z.record(z.string(), z.any()).optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "user": User.optional()})); +const UserRecovery: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "userId": z.string(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "user": User.optional(), "hash": z.any().optional()})); +const Webhook: z.ZodTypeAny = z.lazy(() => z.object({"id": z.string(), "name": z.string(), "eventName": z.string(), "url": z.string(), "onlyLiveVersion": z.boolean().optional(), "errorCount": z.number().int().optional(), "active": z.boolean().optional(), "appId": z.string().optional(), "createdAt": z.string().optional(), "updatedAt": z.string().optional(), "app": App.optional()})); export const schemas = { AclRole, diff --git a/actions/stripe-action/src/generated/stripe-schemas.ts b/actions/stripe-action/src/generated/stripe-schemas.ts index d5a0931..e17c792 100644 --- a/actions/stripe-action/src/generated/stripe-schemas.ts +++ b/actions/stripe-action/src/generated/stripe-schemas.ts @@ -2,873 +2,873 @@ // Regenerate with the action's `generate:*-schemas` npm script. import {z} from "zod"; -const account: z.ZodTypeAny = z.lazy(() => z.object({"business_profile": account_business_profile.nullable().optional(), "business_type": z.enum(["company", "government_entity", "individual", "non_profit"]).nullable().optional(), "capabilities": account_capabilities.optional(), "charges_enabled": z.boolean().optional(), "company": legal_entity_company.optional(), "controller": account_unification_account_controller.optional(), "country": z.string().optional(), "created": z.number().int().optional(), "default_currency": z.string().optional(), "details_submitted": z.boolean().optional(), "email": z.string().nullable().optional(), "external_accounts": z.object({"data": z.array(external_account), "has_more": z.boolean(), "object": z.literal("list"), "url": z.string()}).passthrough().optional(), "future_requirements": account_future_requirements.optional(), "groups": account_group_membership.nullable().optional(), "id": z.string(), "individual": person.optional(), "metadata": z.record(z.string(), z.string()).optional(), "object": z.literal("account"), "payouts_enabled": z.boolean().optional(), "requirements": account_requirements.optional(), "settings": account_settings.nullable().optional(), "tos_acceptance": account_tos_acceptance.optional(), "type": z.enum(["custom", "express", "none", "standard"]).optional()}).passthrough()); -const account_annual_revenue = z.lazy(() => z.object({"amount": z.number().int().nullable(), "currency": z.string().nullable(), "fiscal_year_end": z.string().nullable()}).passthrough()); -const account_bacs_debit_payments_settings = z.lazy(() => z.object({"display_name": z.string().nullable(), "service_user_number": z.string().nullable()}).passthrough()); -const account_branding_settings = z.lazy(() => z.object({"icon": z.union([z.string(), file]).nullable(), "logo": z.union([z.string(), file]).nullable(), "primary_color": z.string().nullable(), "secondary_color": z.string().nullable()}).passthrough()); -const account_business_profile = z.lazy(() => z.object({"annual_revenue": account_annual_revenue.nullable().optional(), "estimated_worker_count": z.number().int().nullable().optional(), "mcc": z.string().nullable(), "minority_owned_business_designation": z.array(z.enum(["lgbtqi_owned_business", "minority_owned_business", "none_of_these_apply", "prefer_not_to_answer", "women_owned_business"])).nullable(), "monthly_estimated_revenue": account_monthly_estimated_revenue.optional(), "name": z.string().nullable(), "product_description": z.string().nullable().optional(), "support_address": address.nullable(), "support_email": z.string().nullable(), "support_phone": z.string().nullable(), "support_url": z.string().nullable(), "url": z.string().nullable()}).passthrough()); -const account_capabilities = z.lazy(() => z.object({"acss_debit_payments": z.enum(["active", "inactive", "pending"]).optional(), "affirm_payments": z.enum(["active", "inactive", "pending"]).optional(), "afterpay_clearpay_payments": z.enum(["active", "inactive", "pending"]).optional(), "alma_payments": z.enum(["active", "inactive", "pending"]).optional(), "amazon_pay_payments": z.enum(["active", "inactive", "pending"]).optional(), "app_distribution": z.enum(["active", "inactive", "pending"]).optional(), "au_becs_debit_payments": z.enum(["active", "inactive", "pending"]).optional(), "bacs_debit_payments": z.enum(["active", "inactive", "pending"]).optional(), "bancontact_payments": z.enum(["active", "inactive", "pending"]).optional(), "bank_transfer_payments": z.enum(["active", "inactive", "pending"]).optional(), "billie_payments": z.enum(["active", "inactive", "pending"]).optional(), "bizum_payments": z.enum(["active", "inactive", "pending"]).optional(), "blik_payments": z.enum(["active", "inactive", "pending"]).optional(), "boleto_payments": z.enum(["active", "inactive", "pending"]).optional(), "card_issuing": z.enum(["active", "inactive", "pending"]).optional(), "card_payments": z.enum(["active", "inactive", "pending"]).optional(), "cartes_bancaires_payments": z.enum(["active", "inactive", "pending"]).optional(), "cashapp_payments": z.enum(["active", "inactive", "pending"]).optional(), "crypto_payments": z.enum(["active", "inactive", "pending"]).optional(), "eps_payments": z.enum(["active", "inactive", "pending"]).optional(), "fpx_payments": z.enum(["active", "inactive", "pending"]).optional(), "gb_bank_transfer_payments": z.enum(["active", "inactive", "pending"]).optional(), "giropay_payments": z.enum(["active", "inactive", "pending"]).optional(), "grabpay_payments": z.enum(["active", "inactive", "pending"]).optional(), "ideal_payments": z.enum(["active", "inactive", "pending"]).optional(), "india_international_payments": z.enum(["active", "inactive", "pending"]).optional(), "jcb_payments": z.enum(["active", "inactive", "pending"]).optional(), "jp_bank_transfer_payments": z.enum(["active", "inactive", "pending"]).optional(), "kakao_pay_payments": z.enum(["active", "inactive", "pending"]).optional(), "klarna_payments": z.enum(["active", "inactive", "pending"]).optional(), "konbini_payments": z.enum(["active", "inactive", "pending"]).optional(), "kr_card_payments": z.enum(["active", "inactive", "pending"]).optional(), "legacy_payments": z.enum(["active", "inactive", "pending"]).optional(), "link_payments": z.enum(["active", "inactive", "pending"]).optional(), "mb_way_payments": z.enum(["active", "inactive", "pending"]).optional(), "mobilepay_payments": z.enum(["active", "inactive", "pending"]).optional(), "multibanco_payments": z.enum(["active", "inactive", "pending"]).optional(), "mx_bank_transfer_payments": z.enum(["active", "inactive", "pending"]).optional(), "naver_pay_payments": z.enum(["active", "inactive", "pending"]).optional(), "nz_bank_account_becs_debit_payments": z.enum(["active", "inactive", "pending"]).optional(), "oxxo_payments": z.enum(["active", "inactive", "pending"]).optional(), "p24_payments": z.enum(["active", "inactive", "pending"]).optional(), "pay_by_bank_payments": z.enum(["active", "inactive", "pending"]).optional(), "payco_payments": z.enum(["active", "inactive", "pending"]).optional(), "paynow_payments": z.enum(["active", "inactive", "pending"]).optional(), "payto_payments": z.enum(["active", "inactive", "pending"]).optional(), "pix_payments": z.enum(["active", "inactive", "pending"]).optional(), "promptpay_payments": z.enum(["active", "inactive", "pending"]).optional(), "revolut_pay_payments": z.enum(["active", "inactive", "pending"]).optional(), "samsung_pay_payments": z.enum(["active", "inactive", "pending"]).optional(), "satispay_payments": z.enum(["active", "inactive", "pending"]).optional(), "scalapay_payments": z.enum(["active", "inactive", "pending"]).optional(), "sepa_bank_transfer_payments": z.enum(["active", "inactive", "pending"]).optional(), "sepa_debit_payments": z.enum(["active", "inactive", "pending"]).optional(), "sofort_payments": z.enum(["active", "inactive", "pending"]).optional(), "sunbit_payments": z.enum(["active", "inactive", "pending"]).optional(), "swish_payments": z.enum(["active", "inactive", "pending"]).optional(), "tax_reporting_us_1099_k": z.enum(["active", "inactive", "pending"]).optional(), "tax_reporting_us_1099_misc": z.enum(["active", "inactive", "pending"]).optional(), "transfers": z.enum(["active", "inactive", "pending"]).optional(), "treasury": z.enum(["active", "inactive", "pending"]).optional(), "twint_payments": z.enum(["active", "inactive", "pending"]).optional(), "upi_payments": z.enum(["active", "inactive", "pending"]).optional(), "us_bank_account_ach_payments": z.enum(["active", "inactive", "pending"]).optional(), "us_bank_transfer_payments": z.enum(["active", "inactive", "pending"]).optional(), "zip_payments": z.enum(["active", "inactive", "pending"]).optional()}).passthrough()); -const account_card_issuing_settings = z.lazy(() => z.object({"tos_acceptance": card_issuing_account_terms_of_service.optional()}).passthrough()); -const account_card_payments_settings = z.lazy(() => z.object({"decline_on": account_decline_charge_on.optional(), "statement_descriptor_prefix": z.string().nullable(), "statement_descriptor_prefix_kana": z.string().nullable(), "statement_descriptor_prefix_kanji": z.string().nullable()}).passthrough()); -const account_dashboard_settings = z.lazy(() => z.object({"display_name": z.string().nullable(), "timezone": z.string().nullable()}).passthrough()); -const account_decline_charge_on = z.lazy(() => z.object({"avs_failure": z.boolean(), "cvc_failure": z.boolean()}).passthrough()); -const account_future_requirements = z.lazy(() => z.object({"alternatives": z.array(account_requirements_alternative).nullable(), "current_deadline": z.number().int().nullable(), "currently_due": z.array(z.string()).nullable(), "disabled_reason": z.enum(["action_required.requested_capabilities", "listed", "other", "platform_paused", "rejected.fraud", "rejected.incomplete_verification", "rejected.listed", "rejected.other", "rejected.platform_fraud", "rejected.platform_other", "rejected.platform_terms_of_service", "rejected.terms_of_service", "requirements.past_due", "requirements.pending_verification", "under_review"]).nullable(), "errors": z.array(account_requirements_error).nullable(), "eventually_due": z.array(z.string()).nullable(), "past_due": z.array(z.string()).nullable(), "pending_verification": z.array(z.string()).nullable()}).passthrough()); -const account_group_membership = z.lazy(() => z.object({"payments_pricing": z.string().nullable()}).passthrough()); -const account_invoices_settings: z.ZodTypeAny = z.lazy(() => z.object({"default_account_tax_ids": z.array(z.union([z.string(), tax_id])).nullable(), "hosted_payment_method_save": z.enum(["always", "never", "offer"]).nullable()}).passthrough()); -const account_monthly_estimated_revenue = z.lazy(() => z.object({"amount": z.number().int(), "currency": z.string()}).passthrough()); -const account_payments_settings = z.lazy(() => z.object({"statement_descriptor": z.string().nullable(), "statement_descriptor_kana": z.string().nullable(), "statement_descriptor_kanji": z.string().nullable(), "statement_descriptor_prefix_kana": z.string().nullable(), "statement_descriptor_prefix_kanji": z.string().nullable()}).passthrough()); -const account_payout_settings = z.lazy(() => z.object({"debit_negative_balances": z.boolean(), "schedule": transfer_schedule, "statement_descriptor": z.string().nullable()}).passthrough()); -const account_requirements = z.lazy(() => z.object({"alternatives": z.array(account_requirements_alternative).nullable(), "current_deadline": z.number().int().nullable(), "currently_due": z.array(z.string()).nullable(), "disabled_reason": z.enum(["action_required.requested_capabilities", "listed", "other", "platform_paused", "rejected.fraud", "rejected.incomplete_verification", "rejected.listed", "rejected.other", "rejected.platform_fraud", "rejected.platform_other", "rejected.platform_terms_of_service", "rejected.terms_of_service", "requirements.past_due", "requirements.pending_verification", "under_review"]).nullable(), "errors": z.array(account_requirements_error).nullable(), "eventually_due": z.array(z.string()).nullable(), "past_due": z.array(z.string()).nullable(), "pending_verification": z.array(z.string()).nullable()}).passthrough()); -const account_requirements_alternative = z.lazy(() => z.object({"alternative_fields_due": z.array(z.string()), "original_fields_due": z.array(z.string())}).passthrough()); -const account_requirements_error = z.lazy(() => z.object({"code": z.enum(["external_request", "information_missing", "invalid_address_city_state_postal_code", "invalid_address_highway_contract_box", "invalid_address_private_mailbox", "invalid_business_profile_name", "invalid_business_profile_name_denylisted", "invalid_company_name_denylisted", "invalid_dob_age_over_maximum", "invalid_dob_age_under_18", "invalid_dob_age_under_minimum", "invalid_product_description_length", "invalid_product_description_url_match", "invalid_representative_country", "invalid_signator", "invalid_statement_descriptor_business_mismatch", "invalid_statement_descriptor_denylisted", "invalid_statement_descriptor_length", "invalid_statement_descriptor_prefix_denylisted", "invalid_statement_descriptor_prefix_mismatch", "invalid_street_address", "invalid_tax_id", "invalid_tax_id_format", "invalid_tos_acceptance", "invalid_url_denylisted", "invalid_url_format", "invalid_url_length", "invalid_url_web_presence_detected", "invalid_url_website_business_information_mismatch", "invalid_url_website_empty", "invalid_url_website_inaccessible", "invalid_url_website_inaccessible_geoblocked", "invalid_url_website_inaccessible_password_protected", "invalid_url_website_incomplete", "invalid_url_website_incomplete_cancellation_policy", "invalid_url_website_incomplete_customer_service_details", "invalid_url_website_incomplete_legal_restrictions", "invalid_url_website_incomplete_refund_policy", "invalid_url_website_incomplete_return_policy", "invalid_url_website_incomplete_terms_and_conditions", "invalid_url_website_incomplete_under_construction", "invalid_url_website_other", "invalid_value_other", "unsupported_business_type", "verification_directors_mismatch", "verification_document_address_mismatch", "verification_document_address_missing", "verification_document_corrupt", "verification_document_country_not_supported", "verification_document_directors_mismatch", "verification_document_dob_mismatch", "verification_document_duplicate_type", "verification_document_expired", "verification_document_failed_copy", "verification_document_failed_greyscale", "verification_document_failed_other", "verification_document_failed_test_mode", "verification_document_fraudulent", "verification_document_id_number_mismatch", "verification_document_id_number_missing", "verification_document_incomplete", "verification_document_invalid", "verification_document_issue_or_expiry_date_missing", "verification_document_manipulated", "verification_document_missing_back", "verification_document_missing_front", "verification_document_name_mismatch", "verification_document_name_missing", "verification_document_nationality_mismatch", "verification_document_not_readable", "verification_document_not_signed", "verification_document_not_uploaded", "verification_document_photo_mismatch", "verification_document_too_large", "verification_document_type_not_supported", "verification_extraneous_directors", "verification_failed_address_match", "verification_failed_authorizer_authority", "verification_failed_business_iec_number", "verification_failed_document_match", "verification_failed_id_number_match", "verification_failed_keyed_identity", "verification_failed_keyed_match", "verification_failed_name_match", "verification_failed_other", "verification_failed_representative_authority", "verification_failed_residential_address", "verification_failed_tax_id_match", "verification_failed_tax_id_not_issued", "verification_legal_entity_structure_mismatch", "verification_missing_directors", "verification_missing_executives", "verification_missing_owners", "verification_rejected_ownership_exemption_reason", "verification_requires_additional_memorandum_of_associations", "verification_requires_additional_proof_of_registration", "verification_supportability"]), "reason": z.string(), "requirement": z.string()}).passthrough()); -const account_sepa_debit_payments_settings = z.lazy(() => z.object({"creditor_id": z.string().optional()}).passthrough()); -const account_settings: z.ZodTypeAny = z.lazy(() => z.object({"bacs_debit_payments": account_bacs_debit_payments_settings.optional(), "branding": account_branding_settings, "card_issuing": account_card_issuing_settings.optional(), "card_payments": account_card_payments_settings, "dashboard": account_dashboard_settings, "invoices": account_invoices_settings.optional(), "payments": account_payments_settings, "payouts": account_payout_settings.optional(), "sepa_debit_payments": account_sepa_debit_payments_settings.optional(), "treasury": account_treasury_settings.optional()}).passthrough()); -const account_terms_of_service = z.lazy(() => z.object({"date": z.number().int().nullable(), "ip": z.string().nullable(), "user_agent": z.string().optional()}).passthrough()); -const account_tos_acceptance = z.lazy(() => z.object({"date": z.number().int().nullable().optional(), "ip": z.string().nullable().optional(), "service_agreement": z.string().optional(), "user_agent": z.string().nullable().optional()}).passthrough()); -const account_treasury_settings = z.lazy(() => z.object({"tos_acceptance": account_terms_of_service.optional()}).passthrough()); -const account_unification_account_controller = z.lazy(() => z.object({"fees": account_unification_account_controller_fees.optional(), "is_controller": z.boolean().optional(), "losses": account_unification_account_controller_losses.optional(), "requirement_collection": z.enum(["application", "stripe"]).optional(), "stripe_dashboard": account_unification_account_controller_stripe_dashboard.optional(), "type": z.enum(["account", "application"])}).passthrough()); -const account_unification_account_controller_fees = z.lazy(() => z.object({"payer": z.enum(["account", "application", "application_custom", "application_express"])}).passthrough()); -const account_unification_account_controller_losses = z.lazy(() => z.object({"payments": z.enum(["application", "stripe"])}).passthrough()); -const account_unification_account_controller_stripe_dashboard = z.lazy(() => z.object({"type": z.enum(["express", "full", "none"])}).passthrough()); -const address = z.lazy(() => z.object({"city": z.string().nullable(), "country": z.string().nullable(), "line1": z.string().nullable(), "line2": z.string().nullable(), "postal_code": z.string().nullable(), "state": z.string().nullable()}).passthrough()); -const alma_installments = z.lazy(() => z.object({"count": z.number().int()}).passthrough()); -const amazon_pay_underlying_payment_method_funding_details = z.lazy(() => z.object({"card": payment_method_details_passthrough_card.optional(), "type": z.literal("card").nullable()}).passthrough()); -const api_errors: z.ZodTypeAny = z.lazy(() => z.object({"advice_code": z.string().optional(), "charge": z.string().optional(), "code": z.enum(["account_closed", "account_country_invalid_address", "account_error_country_change_requires_additional_steps", "account_information_mismatch", "account_invalid", "account_number_invalid", "account_token_required_for_v2_account", "acss_debit_session_incomplete", "action_blocked", "alipay_upgrade_required", "amount_too_large", "amount_too_small", "anomalous_money_movement_request", "api_key_expired", "application_fees_not_allowed", "approval_required", "authentication_required", "balance_insufficient", "balance_invalid_parameter", "bank_account_bad_routing_numbers", "bank_account_declined", "bank_account_exists", "bank_account_restricted", "bank_account_unusable", "bank_account_unverified", "bank_account_verification_failed", "billing_invalid_mandate", "bitcoin_upgrade_required", "capture_charge_authorization_expired", "capture_unauthorized_payment", "card_decline_rate_limit_exceeded", "card_declined", "cardholder_phone_number_required", "charge_already_captured", "charge_already_refunded", "charge_disputed", "charge_exceeds_source_limit", "charge_exceeds_transaction_limit", "charge_expired_for_capture", "charge_invalid_parameter", "charge_not_refundable", "clearing_code_unsupported", "country_code_invalid", "country_unsupported", "coupon_expired", "customer_max_payment_methods", "customer_max_subscriptions", "customer_session_expired", "customer_tax_location_invalid", "debit_not_authorized", "email_invalid", "expired_card", "failed_tax_calculation", "financial_account_balance_does_not_support_currency", "financial_account_capability_not_enabled", "financial_account_capability_restricted", "financial_connections_account_inactive", "financial_connections_account_pending_account_numbers", "financial_connections_account_unavailable_account_numbers", "financial_connections_no_successful_transaction_refresh", "forwarding_api_inactive", "forwarding_api_invalid_parameter", "forwarding_api_retryable_upstream_error", "forwarding_api_upstream_connection_error", "forwarding_api_upstream_connection_timeout", "forwarding_api_upstream_error", "idempotency_key_in_use", "incorrect_address", "incorrect_cvc", "incorrect_number", "incorrect_zip", "india_recurring_payment_mandate_canceled", "instant_payouts_config_disabled", "instant_payouts_currency_disabled", "instant_payouts_limit_exceeded", "instant_payouts_unsupported", "insufficient_funds", "intent_invalid_state", "intent_verification_method_missing", "invalid_card_type", "invalid_characters", "invalid_charge_amount", "invalid_cvc", "invalid_expiry_month", "invalid_expiry_year", "invalid_mandate_reference_prefix_format", "invalid_number", "invalid_source_usage", "invalid_tax_location", "invoice_no_customer_line_items", "invoice_no_payment_method_types", "invoice_no_subscription_line_items", "invoice_not_editable", "invoice_on_behalf_of_not_editable", "invoice_payment_intent_requires_action", "invoice_upcoming_none", "livemode_mismatch", "lock_timeout", "missing", "no_account", "not_allowed_on_standard_account", "out_of_inventory", "ownership_declaration_not_allowed", "parameter_invalid_empty", "parameter_invalid_integer", "parameter_invalid_string_blank", "parameter_invalid_string_empty", "parameter_missing", "parameter_unknown", "parameters_exclusive", "payment_intent_action_required", "payment_intent_authentication_failure", "payment_intent_incompatible_payment_method", "payment_intent_invalid_parameter", "payment_intent_konbini_rejected_confirmation_number", "payment_intent_mandate_invalid", "payment_intent_payment_attempt_expired", "payment_intent_payment_attempt_failed", "payment_intent_rate_limit_exceeded", "payment_intent_unexpected_state", "payment_method_bank_account_already_verified", "payment_method_bank_account_blocked", "payment_method_billing_details_address_missing", "payment_method_configuration_failures", "payment_method_currency_mismatch", "payment_method_customer_decline", "payment_method_invalid_parameter", "payment_method_invalid_parameter_testmode", "payment_method_microdeposit_failed", "payment_method_microdeposit_processing_error", "payment_method_microdeposit_verification_amounts_invalid", "payment_method_microdeposit_verification_amounts_mismatch", "payment_method_microdeposit_verification_attempts_exceeded", "payment_method_microdeposit_verification_descriptor_code_mismatch", "payment_method_microdeposit_verification_timeout", "payment_method_not_available", "payment_method_provider_decline", "payment_method_provider_timeout", "payment_method_unactivated", "payment_method_unexpected_state", "payment_method_unsupported_type", "payout_reconciliation_not_ready", "payouts_limit_exceeded", "payouts_not_allowed", "platform_account_required", "platform_api_key_expired", "postal_code_invalid", "processing_error", "product_inactive", "progressive_onboarding_limit_exceeded", "rate_limit", "refer_to_customer", "refund_disputed_payment", "request_blocked", "resource_already_exists", "resource_missing", "return_intent_already_processed", "routing_number_invalid", "secret_key_required", "sepa_unsupported_account", "service_period_coupon_with_metered_tiered_item_unsupported", "setup_attempt_failed", "setup_intent_authentication_failure", "setup_intent_invalid_parameter", "setup_intent_mandate_invalid", "setup_intent_mobile_wallet_unsupported", "setup_intent_setup_attempt_expired", "setup_intent_unexpected_state", "shipping_address_invalid", "shipping_calculation_failed", "siret_invalid", "sku_inactive", "state_unsupported", "status_transition_invalid", "storer_capability_missing", "storer_capability_not_active", "stripe_tax_inactive", "tax_id_invalid", "tax_id_prohibited", "taxes_calculation_failed", "terminal_location_country_unsupported", "terminal_reader_busy", "terminal_reader_hardware_fault", "terminal_reader_invalid_location_for_activation", "terminal_reader_invalid_location_for_payment", "terminal_reader_offline", "terminal_reader_timeout", "testmode_charges_only", "tls_version_unsupported", "token_already_used", "token_card_network_invalid", "token_in_use", "transfer_source_balance_parameters_mismatch", "transfers_not_allowed", "url_invalid"]).optional(), "decline_code": z.string().optional(), "doc_url": z.string().optional(), "message": z.string().optional(), "network_advice_code": z.string().optional(), "network_decline_code": z.string().optional(), "param": z.string().optional(), "payment_intent": payment_intent.optional(), "payment_method": payment_method.optional(), "payment_method_type": z.string().optional(), "request_log_url": z.string().optional(), "setup_intent": setup_intent.optional(), "source": payment_source.optional(), "type": z.enum(["api_error", "card_error", "idempotency_error", "invalid_request_error"])}).passthrough()); -const application = z.lazy(() => z.object({"id": z.string(), "name": z.string().nullable(), "object": z.literal("application")}).passthrough()); -const application_fee: z.ZodTypeAny = z.lazy(() => z.object({"account": z.union([z.string(), account]), "amount": z.number().int(), "amount_refunded": z.number().int(), "application": z.union([z.string(), application]), "balance_transaction": z.union([z.string(), balance_transaction]).nullable(), "charge": z.union([z.string(), charge]), "created": z.number().int(), "currency": z.string(), "fee_source": platform_earning_fee_source.nullable(), "id": z.string(), "livemode": z.boolean(), "object": z.literal("application_fee"), "originating_transaction": z.union([z.string(), charge]).nullable(), "refunded": z.boolean(), "refunds": z.object({"data": z.array(fee_refund), "has_more": z.boolean(), "object": z.literal("list"), "url": z.string()}).passthrough()}).passthrough()); -const automatic_tax: z.ZodTypeAny = z.lazy(() => z.object({"disabled_reason": z.enum(["finalization_requires_location_inputs", "finalization_system_error"]).nullable(), "enabled": z.boolean(), "liability": connect_account_reference.nullable(), "provider": z.string().nullable(), "status": z.enum(["complete", "failed", "requires_location_inputs"]).nullable()}).passthrough()); -const balance_transaction: z.ZodTypeAny = z.lazy(() => z.object({"amount": z.number().int(), "available_on": z.number().int(), "balance_type": z.enum(["issuing", "payments", "refund_and_dispute_prefunding", "risk_reserved"]), "created": z.number().int(), "currency": z.string(), "description": z.string().nullable(), "exchange_rate": z.number().nullable(), "fee": z.number().int(), "fee_details": z.array(fee), "id": z.string(), "net": z.number().int(), "object": z.literal("balance_transaction"), "reporting_category": z.string(), "source": z.union([z.string(), balance_transaction_source]).nullable(), "status": z.string(), "type": z.enum(["adjustment", "advance", "advance_funding", "anticipation_repayment", "application_fee", "application_fee_refund", "charge", "climate_order_purchase", "climate_order_refund", "connect_collection_transfer", "contribution", "fee_credit_funding", "inbound_transfer", "inbound_transfer_reversal", "issuing_authorization_hold", "issuing_authorization_release", "issuing_dispute", "issuing_transaction", "obligation_outbound", "obligation_reversal_inbound", "payment", "payment_failure_refund", "payment_network_reserve_hold", "payment_network_reserve_release", "payment_refund", "payment_reversal", "payment_unreconciled", "payout", "payout_cancel", "payout_failure", "payout_minimum_balance_hold", "payout_minimum_balance_release", "refund", "refund_failure", "reserve_hold", "reserve_release", "reserve_transaction", "reserved_funds", "stripe_balance_payment_debit", "stripe_balance_payment_debit_reversal", "stripe_fee", "stripe_fx_fee", "tax_fee", "tax_fund", "topup", "topup_reversal", "transfer", "transfer_cancel", "transfer_failure", "transfer_refund"])}).passthrough()); +const account: z.ZodTypeAny = z.lazy(() => z.object({"business_profile": account_business_profile.nullable().optional(), "business_type": z.enum(["company", "government_entity", "individual", "non_profit"]).nullable().optional(), "capabilities": account_capabilities.optional(), "charges_enabled": z.boolean().optional(), "company": legal_entity_company.optional(), "controller": account_unification_account_controller.optional(), "country": z.string().optional(), "created": z.number().int().optional(), "default_currency": z.string().optional(), "details_submitted": z.boolean().optional(), "email": z.string().nullable().optional(), "external_accounts": z.object({"data": z.array(external_account), "has_more": z.boolean(), "object": z.literal("list"), "url": z.string()}).optional(), "future_requirements": account_future_requirements.optional(), "groups": account_group_membership.nullable().optional(), "id": z.string(), "individual": person.optional(), "metadata": z.record(z.string(), z.string()).optional(), "object": z.literal("account"), "payouts_enabled": z.boolean().optional(), "requirements": account_requirements.optional(), "settings": account_settings.nullable().optional(), "tos_acceptance": account_tos_acceptance.optional(), "type": z.enum(["custom", "express", "none", "standard"]).optional()})); +const account_annual_revenue = z.lazy(() => z.object({"amount": z.number().int().nullable(), "currency": z.string().nullable(), "fiscal_year_end": z.string().nullable()})); +const account_bacs_debit_payments_settings = z.lazy(() => z.object({"display_name": z.string().nullable(), "service_user_number": z.string().nullable()})); +const account_branding_settings = z.lazy(() => z.object({"icon": z.union([z.string(), file]).nullable(), "logo": z.union([z.string(), file]).nullable(), "primary_color": z.string().nullable(), "secondary_color": z.string().nullable()})); +const account_business_profile = z.lazy(() => z.object({"annual_revenue": account_annual_revenue.nullable().optional(), "estimated_worker_count": z.number().int().nullable().optional(), "mcc": z.string().nullable(), "minority_owned_business_designation": z.array(z.enum(["lgbtqi_owned_business", "minority_owned_business", "none_of_these_apply", "prefer_not_to_answer", "women_owned_business"])).nullable(), "monthly_estimated_revenue": account_monthly_estimated_revenue.optional(), "name": z.string().nullable(), "product_description": z.string().nullable().optional(), "support_address": address.nullable(), "support_email": z.string().nullable(), "support_phone": z.string().nullable(), "support_url": z.string().nullable(), "url": z.string().nullable()})); +const account_capabilities = z.lazy(() => z.object({"acss_debit_payments": z.enum(["active", "inactive", "pending"]).optional(), "affirm_payments": z.enum(["active", "inactive", "pending"]).optional(), "afterpay_clearpay_payments": z.enum(["active", "inactive", "pending"]).optional(), "alma_payments": z.enum(["active", "inactive", "pending"]).optional(), "amazon_pay_payments": z.enum(["active", "inactive", "pending"]).optional(), "app_distribution": z.enum(["active", "inactive", "pending"]).optional(), "au_becs_debit_payments": z.enum(["active", "inactive", "pending"]).optional(), "bacs_debit_payments": z.enum(["active", "inactive", "pending"]).optional(), "bancontact_payments": z.enum(["active", "inactive", "pending"]).optional(), "bank_transfer_payments": z.enum(["active", "inactive", "pending"]).optional(), "billie_payments": z.enum(["active", "inactive", "pending"]).optional(), "bizum_payments": z.enum(["active", "inactive", "pending"]).optional(), "blik_payments": z.enum(["active", "inactive", "pending"]).optional(), "boleto_payments": z.enum(["active", "inactive", "pending"]).optional(), "card_issuing": z.enum(["active", "inactive", "pending"]).optional(), "card_payments": z.enum(["active", "inactive", "pending"]).optional(), "cartes_bancaires_payments": z.enum(["active", "inactive", "pending"]).optional(), "cashapp_payments": z.enum(["active", "inactive", "pending"]).optional(), "crypto_payments": z.enum(["active", "inactive", "pending"]).optional(), "eps_payments": z.enum(["active", "inactive", "pending"]).optional(), "fpx_payments": z.enum(["active", "inactive", "pending"]).optional(), "gb_bank_transfer_payments": z.enum(["active", "inactive", "pending"]).optional(), "giropay_payments": z.enum(["active", "inactive", "pending"]).optional(), "grabpay_payments": z.enum(["active", "inactive", "pending"]).optional(), "ideal_payments": z.enum(["active", "inactive", "pending"]).optional(), "india_international_payments": z.enum(["active", "inactive", "pending"]).optional(), "jcb_payments": z.enum(["active", "inactive", "pending"]).optional(), "jp_bank_transfer_payments": z.enum(["active", "inactive", "pending"]).optional(), "kakao_pay_payments": z.enum(["active", "inactive", "pending"]).optional(), "klarna_payments": z.enum(["active", "inactive", "pending"]).optional(), "konbini_payments": z.enum(["active", "inactive", "pending"]).optional(), "kr_card_payments": z.enum(["active", "inactive", "pending"]).optional(), "legacy_payments": z.enum(["active", "inactive", "pending"]).optional(), "link_payments": z.enum(["active", "inactive", "pending"]).optional(), "mb_way_payments": z.enum(["active", "inactive", "pending"]).optional(), "mobilepay_payments": z.enum(["active", "inactive", "pending"]).optional(), "multibanco_payments": z.enum(["active", "inactive", "pending"]).optional(), "mx_bank_transfer_payments": z.enum(["active", "inactive", "pending"]).optional(), "naver_pay_payments": z.enum(["active", "inactive", "pending"]).optional(), "nz_bank_account_becs_debit_payments": z.enum(["active", "inactive", "pending"]).optional(), "oxxo_payments": z.enum(["active", "inactive", "pending"]).optional(), "p24_payments": z.enum(["active", "inactive", "pending"]).optional(), "pay_by_bank_payments": z.enum(["active", "inactive", "pending"]).optional(), "payco_payments": z.enum(["active", "inactive", "pending"]).optional(), "paynow_payments": z.enum(["active", "inactive", "pending"]).optional(), "payto_payments": z.enum(["active", "inactive", "pending"]).optional(), "pix_payments": z.enum(["active", "inactive", "pending"]).optional(), "promptpay_payments": z.enum(["active", "inactive", "pending"]).optional(), "revolut_pay_payments": z.enum(["active", "inactive", "pending"]).optional(), "samsung_pay_payments": z.enum(["active", "inactive", "pending"]).optional(), "satispay_payments": z.enum(["active", "inactive", "pending"]).optional(), "scalapay_payments": z.enum(["active", "inactive", "pending"]).optional(), "sepa_bank_transfer_payments": z.enum(["active", "inactive", "pending"]).optional(), "sepa_debit_payments": z.enum(["active", "inactive", "pending"]).optional(), "sofort_payments": z.enum(["active", "inactive", "pending"]).optional(), "sunbit_payments": z.enum(["active", "inactive", "pending"]).optional(), "swish_payments": z.enum(["active", "inactive", "pending"]).optional(), "tax_reporting_us_1099_k": z.enum(["active", "inactive", "pending"]).optional(), "tax_reporting_us_1099_misc": z.enum(["active", "inactive", "pending"]).optional(), "transfers": z.enum(["active", "inactive", "pending"]).optional(), "treasury": z.enum(["active", "inactive", "pending"]).optional(), "twint_payments": z.enum(["active", "inactive", "pending"]).optional(), "upi_payments": z.enum(["active", "inactive", "pending"]).optional(), "us_bank_account_ach_payments": z.enum(["active", "inactive", "pending"]).optional(), "us_bank_transfer_payments": z.enum(["active", "inactive", "pending"]).optional(), "zip_payments": z.enum(["active", "inactive", "pending"]).optional()})); +const account_card_issuing_settings = z.lazy(() => z.object({"tos_acceptance": card_issuing_account_terms_of_service.optional()})); +const account_card_payments_settings = z.lazy(() => z.object({"decline_on": account_decline_charge_on.optional(), "statement_descriptor_prefix": z.string().nullable(), "statement_descriptor_prefix_kana": z.string().nullable(), "statement_descriptor_prefix_kanji": z.string().nullable()})); +const account_dashboard_settings = z.lazy(() => z.object({"display_name": z.string().nullable(), "timezone": z.string().nullable()})); +const account_decline_charge_on = z.lazy(() => z.object({"avs_failure": z.boolean(), "cvc_failure": z.boolean()})); +const account_future_requirements = z.lazy(() => z.object({"alternatives": z.array(account_requirements_alternative).nullable(), "current_deadline": z.number().int().nullable(), "currently_due": z.array(z.string()).nullable(), "disabled_reason": z.enum(["action_required.requested_capabilities", "listed", "other", "platform_paused", "rejected.fraud", "rejected.incomplete_verification", "rejected.listed", "rejected.other", "rejected.platform_fraud", "rejected.platform_other", "rejected.platform_terms_of_service", "rejected.terms_of_service", "requirements.past_due", "requirements.pending_verification", "under_review"]).nullable(), "errors": z.array(account_requirements_error).nullable(), "eventually_due": z.array(z.string()).nullable(), "past_due": z.array(z.string()).nullable(), "pending_verification": z.array(z.string()).nullable()})); +const account_group_membership = z.lazy(() => z.object({"payments_pricing": z.string().nullable()})); +const account_invoices_settings: z.ZodTypeAny = z.lazy(() => z.object({"default_account_tax_ids": z.array(z.union([z.string(), tax_id])).nullable(), "hosted_payment_method_save": z.enum(["always", "never", "offer"]).nullable()})); +const account_monthly_estimated_revenue = z.lazy(() => z.object({"amount": z.number().int(), "currency": z.string()})); +const account_payments_settings = z.lazy(() => z.object({"statement_descriptor": z.string().nullable(), "statement_descriptor_kana": z.string().nullable(), "statement_descriptor_kanji": z.string().nullable(), "statement_descriptor_prefix_kana": z.string().nullable(), "statement_descriptor_prefix_kanji": z.string().nullable()})); +const account_payout_settings = z.lazy(() => z.object({"debit_negative_balances": z.boolean(), "schedule": transfer_schedule, "statement_descriptor": z.string().nullable()})); +const account_requirements = z.lazy(() => z.object({"alternatives": z.array(account_requirements_alternative).nullable(), "current_deadline": z.number().int().nullable(), "currently_due": z.array(z.string()).nullable(), "disabled_reason": z.enum(["action_required.requested_capabilities", "listed", "other", "platform_paused", "rejected.fraud", "rejected.incomplete_verification", "rejected.listed", "rejected.other", "rejected.platform_fraud", "rejected.platform_other", "rejected.platform_terms_of_service", "rejected.terms_of_service", "requirements.past_due", "requirements.pending_verification", "under_review"]).nullable(), "errors": z.array(account_requirements_error).nullable(), "eventually_due": z.array(z.string()).nullable(), "past_due": z.array(z.string()).nullable(), "pending_verification": z.array(z.string()).nullable()})); +const account_requirements_alternative = z.lazy(() => z.object({"alternative_fields_due": z.array(z.string()), "original_fields_due": z.array(z.string())})); +const account_requirements_error = z.lazy(() => z.object({"code": z.enum(["external_request", "information_missing", "invalid_address_city_state_postal_code", "invalid_address_highway_contract_box", "invalid_address_private_mailbox", "invalid_business_profile_name", "invalid_business_profile_name_denylisted", "invalid_company_name_denylisted", "invalid_dob_age_over_maximum", "invalid_dob_age_under_18", "invalid_dob_age_under_minimum", "invalid_product_description_length", "invalid_product_description_url_match", "invalid_representative_country", "invalid_signator", "invalid_statement_descriptor_business_mismatch", "invalid_statement_descriptor_denylisted", "invalid_statement_descriptor_length", "invalid_statement_descriptor_prefix_denylisted", "invalid_statement_descriptor_prefix_mismatch", "invalid_street_address", "invalid_tax_id", "invalid_tax_id_format", "invalid_tos_acceptance", "invalid_url_denylisted", "invalid_url_format", "invalid_url_length", "invalid_url_web_presence_detected", "invalid_url_website_business_information_mismatch", "invalid_url_website_empty", "invalid_url_website_inaccessible", "invalid_url_website_inaccessible_geoblocked", "invalid_url_website_inaccessible_password_protected", "invalid_url_website_incomplete", "invalid_url_website_incomplete_cancellation_policy", "invalid_url_website_incomplete_customer_service_details", "invalid_url_website_incomplete_legal_restrictions", "invalid_url_website_incomplete_refund_policy", "invalid_url_website_incomplete_return_policy", "invalid_url_website_incomplete_terms_and_conditions", "invalid_url_website_incomplete_under_construction", "invalid_url_website_other", "invalid_value_other", "unsupported_business_type", "verification_directors_mismatch", "verification_document_address_mismatch", "verification_document_address_missing", "verification_document_corrupt", "verification_document_country_not_supported", "verification_document_directors_mismatch", "verification_document_dob_mismatch", "verification_document_duplicate_type", "verification_document_expired", "verification_document_failed_copy", "verification_document_failed_greyscale", "verification_document_failed_other", "verification_document_failed_test_mode", "verification_document_fraudulent", "verification_document_id_number_mismatch", "verification_document_id_number_missing", "verification_document_incomplete", "verification_document_invalid", "verification_document_issue_or_expiry_date_missing", "verification_document_manipulated", "verification_document_missing_back", "verification_document_missing_front", "verification_document_name_mismatch", "verification_document_name_missing", "verification_document_nationality_mismatch", "verification_document_not_readable", "verification_document_not_signed", "verification_document_not_uploaded", "verification_document_photo_mismatch", "verification_document_too_large", "verification_document_type_not_supported", "verification_extraneous_directors", "verification_failed_address_match", "verification_failed_authorizer_authority", "verification_failed_business_iec_number", "verification_failed_document_match", "verification_failed_id_number_match", "verification_failed_keyed_identity", "verification_failed_keyed_match", "verification_failed_name_match", "verification_failed_other", "verification_failed_representative_authority", "verification_failed_residential_address", "verification_failed_tax_id_match", "verification_failed_tax_id_not_issued", "verification_legal_entity_structure_mismatch", "verification_missing_directors", "verification_missing_executives", "verification_missing_owners", "verification_rejected_ownership_exemption_reason", "verification_requires_additional_memorandum_of_associations", "verification_requires_additional_proof_of_registration", "verification_supportability"]), "reason": z.string(), "requirement": z.string()})); +const account_sepa_debit_payments_settings = z.lazy(() => z.object({"creditor_id": z.string().optional()})); +const account_settings: z.ZodTypeAny = z.lazy(() => z.object({"bacs_debit_payments": account_bacs_debit_payments_settings.optional(), "branding": account_branding_settings, "card_issuing": account_card_issuing_settings.optional(), "card_payments": account_card_payments_settings, "dashboard": account_dashboard_settings, "invoices": account_invoices_settings.optional(), "payments": account_payments_settings, "payouts": account_payout_settings.optional(), "sepa_debit_payments": account_sepa_debit_payments_settings.optional(), "treasury": account_treasury_settings.optional()})); +const account_terms_of_service = z.lazy(() => z.object({"date": z.number().int().nullable(), "ip": z.string().nullable(), "user_agent": z.string().optional()})); +const account_tos_acceptance = z.lazy(() => z.object({"date": z.number().int().nullable().optional(), "ip": z.string().nullable().optional(), "service_agreement": z.string().optional(), "user_agent": z.string().nullable().optional()})); +const account_treasury_settings = z.lazy(() => z.object({"tos_acceptance": account_terms_of_service.optional()})); +const account_unification_account_controller = z.lazy(() => z.object({"fees": account_unification_account_controller_fees.optional(), "is_controller": z.boolean().optional(), "losses": account_unification_account_controller_losses.optional(), "requirement_collection": z.enum(["application", "stripe"]).optional(), "stripe_dashboard": account_unification_account_controller_stripe_dashboard.optional(), "type": z.enum(["account", "application"])})); +const account_unification_account_controller_fees = z.lazy(() => z.object({"payer": z.enum(["account", "application", "application_custom", "application_express"])})); +const account_unification_account_controller_losses = z.lazy(() => z.object({"payments": z.enum(["application", "stripe"])})); +const account_unification_account_controller_stripe_dashboard = z.lazy(() => z.object({"type": z.enum(["express", "full", "none"])})); +const address = z.lazy(() => z.object({"city": z.string().nullable(), "country": z.string().nullable(), "line1": z.string().nullable(), "line2": z.string().nullable(), "postal_code": z.string().nullable(), "state": z.string().nullable()})); +const alma_installments = z.lazy(() => z.object({"count": z.number().int()})); +const amazon_pay_underlying_payment_method_funding_details = z.lazy(() => z.object({"card": payment_method_details_passthrough_card.optional(), "type": z.literal("card").nullable()})); +const api_errors: z.ZodTypeAny = z.lazy(() => z.object({"advice_code": z.string().optional(), "charge": z.string().optional(), "code": z.enum(["account_closed", "account_country_invalid_address", "account_error_country_change_requires_additional_steps", "account_information_mismatch", "account_invalid", "account_number_invalid", "account_token_required_for_v2_account", "acss_debit_session_incomplete", "action_blocked", "alipay_upgrade_required", "amount_too_large", "amount_too_small", "anomalous_money_movement_request", "api_key_expired", "application_fees_not_allowed", "approval_required", "authentication_required", "balance_insufficient", "balance_invalid_parameter", "bank_account_bad_routing_numbers", "bank_account_declined", "bank_account_exists", "bank_account_restricted", "bank_account_unusable", "bank_account_unverified", "bank_account_verification_failed", "billing_invalid_mandate", "bitcoin_upgrade_required", "capture_charge_authorization_expired", "capture_unauthorized_payment", "card_decline_rate_limit_exceeded", "card_declined", "cardholder_phone_number_required", "charge_already_captured", "charge_already_refunded", "charge_disputed", "charge_exceeds_source_limit", "charge_exceeds_transaction_limit", "charge_expired_for_capture", "charge_invalid_parameter", "charge_not_refundable", "clearing_code_unsupported", "country_code_invalid", "country_unsupported", "coupon_expired", "customer_max_payment_methods", "customer_max_subscriptions", "customer_session_expired", "customer_tax_location_invalid", "debit_not_authorized", "email_invalid", "expired_card", "failed_tax_calculation", "financial_account_balance_does_not_support_currency", "financial_account_capability_not_enabled", "financial_account_capability_restricted", "financial_connections_account_inactive", "financial_connections_account_pending_account_numbers", "financial_connections_account_unavailable_account_numbers", "financial_connections_no_successful_transaction_refresh", "forwarding_api_inactive", "forwarding_api_invalid_parameter", "forwarding_api_retryable_upstream_error", "forwarding_api_upstream_connection_error", "forwarding_api_upstream_connection_timeout", "forwarding_api_upstream_error", "idempotency_key_in_use", "incorrect_address", "incorrect_cvc", "incorrect_number", "incorrect_zip", "india_recurring_payment_mandate_canceled", "instant_payouts_config_disabled", "instant_payouts_currency_disabled", "instant_payouts_limit_exceeded", "instant_payouts_unsupported", "insufficient_funds", "intent_invalid_state", "intent_verification_method_missing", "invalid_card_type", "invalid_characters", "invalid_charge_amount", "invalid_cvc", "invalid_expiry_month", "invalid_expiry_year", "invalid_mandate_reference_prefix_format", "invalid_number", "invalid_source_usage", "invalid_tax_location", "invoice_no_customer_line_items", "invoice_no_payment_method_types", "invoice_no_subscription_line_items", "invoice_not_editable", "invoice_on_behalf_of_not_editable", "invoice_payment_intent_requires_action", "invoice_upcoming_none", "livemode_mismatch", "lock_timeout", "missing", "no_account", "not_allowed_on_standard_account", "out_of_inventory", "ownership_declaration_not_allowed", "parameter_invalid_empty", "parameter_invalid_integer", "parameter_invalid_string_blank", "parameter_invalid_string_empty", "parameter_missing", "parameter_unknown", "parameters_exclusive", "payment_intent_action_required", "payment_intent_authentication_failure", "payment_intent_incompatible_payment_method", "payment_intent_invalid_parameter", "payment_intent_konbini_rejected_confirmation_number", "payment_intent_mandate_invalid", "payment_intent_payment_attempt_expired", "payment_intent_payment_attempt_failed", "payment_intent_rate_limit_exceeded", "payment_intent_unexpected_state", "payment_method_bank_account_already_verified", "payment_method_bank_account_blocked", "payment_method_billing_details_address_missing", "payment_method_configuration_failures", "payment_method_currency_mismatch", "payment_method_customer_decline", "payment_method_invalid_parameter", "payment_method_invalid_parameter_testmode", "payment_method_microdeposit_failed", "payment_method_microdeposit_processing_error", "payment_method_microdeposit_verification_amounts_invalid", "payment_method_microdeposit_verification_amounts_mismatch", "payment_method_microdeposit_verification_attempts_exceeded", "payment_method_microdeposit_verification_descriptor_code_mismatch", "payment_method_microdeposit_verification_timeout", "payment_method_not_available", "payment_method_provider_decline", "payment_method_provider_timeout", "payment_method_unactivated", "payment_method_unexpected_state", "payment_method_unsupported_type", "payout_reconciliation_not_ready", "payouts_limit_exceeded", "payouts_not_allowed", "platform_account_required", "platform_api_key_expired", "postal_code_invalid", "processing_error", "product_inactive", "progressive_onboarding_limit_exceeded", "rate_limit", "refer_to_customer", "refund_disputed_payment", "request_blocked", "resource_already_exists", "resource_missing", "return_intent_already_processed", "routing_number_invalid", "secret_key_required", "sepa_unsupported_account", "service_period_coupon_with_metered_tiered_item_unsupported", "setup_attempt_failed", "setup_intent_authentication_failure", "setup_intent_invalid_parameter", "setup_intent_mandate_invalid", "setup_intent_mobile_wallet_unsupported", "setup_intent_setup_attempt_expired", "setup_intent_unexpected_state", "shipping_address_invalid", "shipping_calculation_failed", "siret_invalid", "sku_inactive", "state_unsupported", "status_transition_invalid", "storer_capability_missing", "storer_capability_not_active", "stripe_tax_inactive", "tax_id_invalid", "tax_id_prohibited", "taxes_calculation_failed", "terminal_location_country_unsupported", "terminal_reader_busy", "terminal_reader_hardware_fault", "terminal_reader_invalid_location_for_activation", "terminal_reader_invalid_location_for_payment", "terminal_reader_offline", "terminal_reader_timeout", "testmode_charges_only", "tls_version_unsupported", "token_already_used", "token_card_network_invalid", "token_in_use", "transfer_source_balance_parameters_mismatch", "transfers_not_allowed", "url_invalid"]).optional(), "decline_code": z.string().optional(), "doc_url": z.string().optional(), "message": z.string().optional(), "network_advice_code": z.string().optional(), "network_decline_code": z.string().optional(), "param": z.string().optional(), "payment_intent": payment_intent.optional(), "payment_method": payment_method.optional(), "payment_method_type": z.string().optional(), "request_log_url": z.string().optional(), "setup_intent": setup_intent.optional(), "source": payment_source.optional(), "type": z.enum(["api_error", "card_error", "idempotency_error", "invalid_request_error"])})); +const application = z.lazy(() => z.object({"id": z.string(), "name": z.string().nullable(), "object": z.literal("application")})); +const application_fee: z.ZodTypeAny = z.lazy(() => z.object({"account": z.union([z.string(), account]), "amount": z.number().int(), "amount_refunded": z.number().int(), "application": z.union([z.string(), application]), "balance_transaction": z.union([z.string(), balance_transaction]).nullable(), "charge": z.union([z.string(), charge]), "created": z.number().int(), "currency": z.string(), "fee_source": platform_earning_fee_source.nullable(), "id": z.string(), "livemode": z.boolean(), "object": z.literal("application_fee"), "originating_transaction": z.union([z.string(), charge]).nullable(), "refunded": z.boolean(), "refunds": z.object({"data": z.array(fee_refund), "has_more": z.boolean(), "object": z.literal("list"), "url": z.string()})})); +const automatic_tax: z.ZodTypeAny = z.lazy(() => z.object({"disabled_reason": z.enum(["finalization_requires_location_inputs", "finalization_system_error"]).nullable(), "enabled": z.boolean(), "liability": connect_account_reference.nullable(), "provider": z.string().nullable(), "status": z.enum(["complete", "failed", "requires_location_inputs"]).nullable()})); +const balance_transaction: z.ZodTypeAny = z.lazy(() => z.object({"amount": z.number().int(), "available_on": z.number().int(), "balance_type": z.enum(["issuing", "payments", "refund_and_dispute_prefunding", "risk_reserved"]), "created": z.number().int(), "currency": z.string(), "description": z.string().nullable(), "exchange_rate": z.number().nullable(), "fee": z.number().int(), "fee_details": z.array(fee), "id": z.string(), "net": z.number().int(), "object": z.literal("balance_transaction"), "reporting_category": z.string(), "source": z.union([z.string(), balance_transaction_source]).nullable(), "status": z.string(), "type": z.enum(["adjustment", "advance", "advance_funding", "anticipation_repayment", "application_fee", "application_fee_refund", "charge", "climate_order_purchase", "climate_order_refund", "connect_collection_transfer", "contribution", "fee_credit_funding", "inbound_transfer", "inbound_transfer_reversal", "issuing_authorization_hold", "issuing_authorization_release", "issuing_dispute", "issuing_transaction", "obligation_outbound", "obligation_reversal_inbound", "payment", "payment_failure_refund", "payment_network_reserve_hold", "payment_network_reserve_release", "payment_refund", "payment_reversal", "payment_unreconciled", "payout", "payout_cancel", "payout_failure", "payout_minimum_balance_hold", "payout_minimum_balance_release", "refund", "refund_failure", "reserve_hold", "reserve_release", "reserve_transaction", "reserved_funds", "stripe_balance_payment_debit", "stripe_balance_payment_debit_reversal", "stripe_fee", "stripe_fx_fee", "tax_fee", "tax_fund", "topup", "topup_reversal", "transfer", "transfer_cancel", "transfer_failure", "transfer_refund"])})); const balance_transaction_source: z.ZodTypeAny = z.lazy(() => z.union([application_fee, charge, connect_collection_transfer, customer_cash_balance_transaction, dispute, fee_refund, issuing_authorization, issuing_dispute, issuing_transaction, payout, refund, reserve_transaction, tax_deducted_at_source, topup, transfer, transfer_reversal])); -const bank_account: z.ZodTypeAny = z.lazy(() => z.object({"account": z.union([z.string(), account]).nullable().optional(), "account_holder_name": z.string().nullable(), "account_holder_type": z.string().nullable(), "account_type": z.string().nullable(), "available_payout_methods": z.array(z.enum(["instant", "standard"])).nullable().optional(), "bank_name": z.string().nullable(), "country": z.string(), "currency": z.string(), "customer": z.union([z.string(), customer, deleted_customer]).nullable().optional(), "default_for_currency": z.boolean().nullable().optional(), "fingerprint": z.string().nullable(), "future_requirements": external_account_requirements.nullable().optional(), "id": z.string(), "last4": z.string(), "metadata": z.record(z.string(), z.string()).nullable().optional(), "object": z.literal("bank_account"), "requirements": external_account_requirements.nullable().optional(), "routing_number": z.string().nullable(), "status": z.string()}).passthrough()); -const billing_credit_balance_transaction: z.ZodTypeAny = z.lazy(() => z.object({"created": z.number().int(), "credit": billing_credit_grants_resource_balance_credit.nullable(), "credit_grant": z.union([z.string(), billing_credit_grant]), "debit": billing_credit_grants_resource_balance_debit.nullable(), "effective_at": z.number().int(), "id": z.string(), "livemode": z.boolean(), "object": z.literal("billing.credit_balance_transaction"), "test_clock": z.union([z.string(), test_helpers_test_clock]).nullable(), "type": z.enum(["credit", "debit"]).nullable()}).passthrough()); -const billing_credit_grant: z.ZodTypeAny = z.lazy(() => z.object({"amount": billing_credit_grants_resource_amount, "applicability_config": billing_credit_grants_resource_applicability_config, "category": z.enum(["paid", "promotional"]), "created": z.number().int(), "customer": z.union([z.string(), customer, deleted_customer]), "customer_account": z.string().nullable(), "effective_at": z.number().int().nullable(), "expires_at": z.number().int().nullable(), "id": z.string(), "livemode": z.boolean(), "metadata": z.record(z.string(), z.string()), "name": z.string().nullable(), "object": z.literal("billing.credit_grant"), "priority": z.number().int().nullable(), "test_clock": z.union([z.string(), test_helpers_test_clock]).nullable(), "updated": z.number().int(), "voided_at": z.number().int().nullable()}).passthrough()); -const billing_bill_resource_invoicing_lines_common_credited_items = z.lazy(() => z.object({"invoice": z.string(), "invoice_line_items": z.array(z.string())}).passthrough()); -const billing_bill_resource_invoicing_lines_common_proration_details = z.lazy(() => z.object({"credited_items": billing_bill_resource_invoicing_lines_common_credited_items.nullable()}).passthrough()); -const billing_bill_resource_invoicing_lines_parents_invoice_line_item_invoice_item_parent = z.lazy(() => z.object({"invoice_item": z.string(), "proration": z.boolean(), "proration_details": billing_bill_resource_invoicing_lines_common_proration_details.nullable(), "subscription": z.string().nullable()}).passthrough()); -const billing_bill_resource_invoicing_lines_parents_invoice_line_item_parent = z.lazy(() => z.object({"invoice_item_details": billing_bill_resource_invoicing_lines_parents_invoice_line_item_invoice_item_parent.nullable(), "subscription_item_details": billing_bill_resource_invoicing_lines_parents_invoice_line_item_subscription_item_parent.nullable(), "type": z.enum(["invoice_item_details", "subscription_item_details"])}).passthrough()); -const billing_bill_resource_invoicing_lines_parents_invoice_line_item_subscription_item_parent = z.lazy(() => z.object({"invoice_item": z.string().nullable(), "proration": z.boolean(), "proration_details": billing_bill_resource_invoicing_lines_common_proration_details.nullable(), "subscription": z.string().nullable(), "subscription_item": z.string()}).passthrough()); -const billing_bill_resource_invoicing_parents_invoice_parent: z.ZodTypeAny = z.lazy(() => z.object({"quote_details": billing_bill_resource_invoicing_parents_invoice_quote_parent.nullable(), "subscription_details": billing_bill_resource_invoicing_parents_invoice_subscription_parent.nullable(), "type": z.enum(["quote_details", "subscription_details"])}).passthrough()); -const billing_bill_resource_invoicing_parents_invoice_quote_parent = z.lazy(() => z.object({"quote": z.string()}).passthrough()); -const billing_bill_resource_invoicing_parents_invoice_subscription_parent: z.ZodTypeAny = z.lazy(() => z.object({"metadata": z.record(z.string(), z.string()).nullable(), "subscription": z.union([z.string(), subscription]), "subscription_proration_date": z.number().int().optional()}).passthrough()); -const billing_bill_resource_invoicing_pricing_pricing = z.lazy(() => z.object({"price_details": billing_bill_resource_invoicing_pricing_pricing_price_details.optional(), "type": z.literal("price_details"), "unit_amount_decimal": z.string().nullable()}).passthrough()); -const billing_bill_resource_invoicing_pricing_pricing_price_details = z.lazy(() => z.object({"price": z.union([z.string(), price]), "product": z.string()}).passthrough()); -const billing_bill_resource_invoicing_taxes_tax = z.lazy(() => z.object({"amount": z.number().int(), "tax_behavior": z.enum(["exclusive", "inclusive"]), "tax_rate_details": billing_bill_resource_invoicing_taxes_tax_rate_details.nullable(), "taxability_reason": z.enum(["customer_exempt", "not_available", "not_collecting", "not_subject_to_tax", "not_supported", "portion_product_exempt", "portion_reduced_rated", "portion_standard_rated", "product_exempt", "product_exempt_holiday", "proportionally_rated", "reduced_rated", "reverse_charge", "standard_rated", "taxable_basis_reduced", "zero_rated"]), "taxable_amount": z.number().int().nullable(), "type": z.literal("tax_rate_details")}).passthrough()); -const billing_bill_resource_invoicing_taxes_tax_rate_details = z.lazy(() => z.object({"tax_rate": z.union([z.string(), tax_rate])}).passthrough()); -const billing_clocks_resource_status_details_advancing_status_details = z.lazy(() => z.object({"target_frozen_time": z.number().int()}).passthrough()); -const billing_clocks_resource_status_details_status_details = z.lazy(() => z.object({"advancing": billing_clocks_resource_status_details_advancing_status_details.optional()}).passthrough()); -const billing_credit_grants_resource_amount = z.lazy(() => z.object({"monetary": billing_credit_grants_resource_monetary_amount.nullable(), "type": z.literal("monetary")}).passthrough()); -const billing_credit_grants_resource_applicability_config = z.lazy(() => z.object({"scope": billing_credit_grants_resource_scope}).passthrough()); -const billing_credit_grants_resource_applicable_price = z.lazy(() => z.object({"id": z.string().nullable()}).passthrough()); -const billing_credit_grants_resource_balance_credit: z.ZodTypeAny = z.lazy(() => z.object({"amount": billing_credit_grants_resource_amount, "credits_application_invoice_voided": billing_credit_grants_resource_balance_credits_application_invoice_voided.nullable(), "type": z.enum(["credits_application_invoice_voided", "credits_granted"])}).passthrough()); -const billing_credit_grants_resource_balance_credits_application_invoice_voided: z.ZodTypeAny = z.lazy(() => z.object({"invoice": z.union([z.string(), invoice]), "invoice_line_item": z.string()}).passthrough()); -const billing_credit_grants_resource_balance_credits_applied: z.ZodTypeAny = z.lazy(() => z.object({"invoice": z.union([z.string(), invoice]), "invoice_line_item": z.string()}).passthrough()); -const billing_credit_grants_resource_balance_debit: z.ZodTypeAny = z.lazy(() => z.object({"amount": billing_credit_grants_resource_amount, "credits_applied": billing_credit_grants_resource_balance_credits_applied.nullable(), "type": z.enum(["credits_applied", "credits_expired", "credits_voided"])}).passthrough()); -const billing_credit_grants_resource_monetary_amount = z.lazy(() => z.object({"currency": z.string(), "value": z.number().int()}).passthrough()); -const billing_credit_grants_resource_scope = z.lazy(() => z.object({"price_type": z.literal("metered").optional(), "prices": z.array(billing_credit_grants_resource_applicable_price).optional()}).passthrough()); -const billing_details = z.lazy(() => z.object({"address": address.nullable(), "email": z.string().nullable(), "name": z.string().nullable(), "phone": z.string().nullable(), "tax_id": z.string().nullable()}).passthrough()); -const cancellation_details = z.lazy(() => z.object({"comment": z.string().nullable(), "feedback": z.enum(["customer_service", "low_quality", "missing_features", "other", "switched_service", "too_complex", "too_expensive", "unused"]).nullable(), "reason": z.enum(["canceled_by_retention_policy", "cancellation_requested", "payment_disputed", "payment_failed"]).nullable()}).passthrough()); -const card: z.ZodTypeAny = z.lazy(() => z.object({"account": z.union([z.string(), account]).nullable().optional(), "address_city": z.string().nullable(), "address_country": z.string().nullable(), "address_line1": z.string().nullable(), "address_line1_check": z.string().nullable(), "address_line2": z.string().nullable(), "address_state": z.string().nullable(), "address_zip": z.string().nullable(), "address_zip_check": z.string().nullable(), "allow_redisplay": z.enum(["always", "limited", "unspecified"]).nullable().optional(), "available_payout_methods": z.array(z.enum(["instant", "standard"])).nullable().optional(), "brand": z.string(), "country": z.string().nullable(), "currency": z.string().nullable().optional(), "customer": z.union([z.string(), customer, deleted_customer]).nullable().optional(), "cvc_check": z.string().nullable(), "default_for_currency": z.boolean().nullable().optional(), "description": z.string().optional(), "dynamic_last4": z.string().nullable(), "exp_month": z.number().int(), "exp_year": z.number().int(), "fingerprint": z.string().nullable().optional(), "funding": z.string(), "id": z.string(), "iin": z.string().optional(), "issuer": z.string().optional(), "last4": z.string(), "metadata": z.record(z.string(), z.string()).nullable(), "name": z.string().nullable(), "networks": token_card_networks.optional(), "object": z.literal("card"), "regulated_status": z.enum(["regulated", "unregulated"]).nullable(), "status": z.string().nullable().optional(), "tokenization_method": z.string().nullable()}).passthrough()); -const card_generated_from_payment_method_details = z.lazy(() => z.object({"card_present": payment_method_details_card_present.optional(), "type": z.string()}).passthrough()); -const card_issuing_account_terms_of_service = z.lazy(() => z.object({"date": z.number().int().nullable(), "ip": z.string().nullable(), "user_agent": z.string().optional()}).passthrough()); +const bank_account: z.ZodTypeAny = z.lazy(() => z.object({"account": z.union([z.string(), account]).nullable().optional(), "account_holder_name": z.string().nullable(), "account_holder_type": z.string().nullable(), "account_type": z.string().nullable(), "available_payout_methods": z.array(z.enum(["instant", "standard"])).nullable().optional(), "bank_name": z.string().nullable(), "country": z.string(), "currency": z.string(), "customer": z.union([z.string(), customer, deleted_customer]).nullable().optional(), "default_for_currency": z.boolean().nullable().optional(), "fingerprint": z.string().nullable(), "future_requirements": external_account_requirements.nullable().optional(), "id": z.string(), "last4": z.string(), "metadata": z.record(z.string(), z.string()).nullable().optional(), "object": z.literal("bank_account"), "requirements": external_account_requirements.nullable().optional(), "routing_number": z.string().nullable(), "status": z.string()})); +const billing_credit_balance_transaction: z.ZodTypeAny = z.lazy(() => z.object({"created": z.number().int(), "credit": billing_credit_grants_resource_balance_credit.nullable(), "credit_grant": z.union([z.string(), billing_credit_grant]), "debit": billing_credit_grants_resource_balance_debit.nullable(), "effective_at": z.number().int(), "id": z.string(), "livemode": z.boolean(), "object": z.literal("billing.credit_balance_transaction"), "test_clock": z.union([z.string(), test_helpers_test_clock]).nullable(), "type": z.enum(["credit", "debit"]).nullable()})); +const billing_credit_grant: z.ZodTypeAny = z.lazy(() => z.object({"amount": billing_credit_grants_resource_amount, "applicability_config": billing_credit_grants_resource_applicability_config, "category": z.enum(["paid", "promotional"]), "created": z.number().int(), "customer": z.union([z.string(), customer, deleted_customer]), "customer_account": z.string().nullable(), "effective_at": z.number().int().nullable(), "expires_at": z.number().int().nullable(), "id": z.string(), "livemode": z.boolean(), "metadata": z.record(z.string(), z.string()), "name": z.string().nullable(), "object": z.literal("billing.credit_grant"), "priority": z.number().int().nullable(), "test_clock": z.union([z.string(), test_helpers_test_clock]).nullable(), "updated": z.number().int(), "voided_at": z.number().int().nullable()})); +const billing_bill_resource_invoicing_lines_common_credited_items = z.lazy(() => z.object({"invoice": z.string(), "invoice_line_items": z.array(z.string())})); +const billing_bill_resource_invoicing_lines_common_proration_details = z.lazy(() => z.object({"credited_items": billing_bill_resource_invoicing_lines_common_credited_items.nullable()})); +const billing_bill_resource_invoicing_lines_parents_invoice_line_item_invoice_item_parent = z.lazy(() => z.object({"invoice_item": z.string(), "proration": z.boolean(), "proration_details": billing_bill_resource_invoicing_lines_common_proration_details.nullable(), "subscription": z.string().nullable()})); +const billing_bill_resource_invoicing_lines_parents_invoice_line_item_parent = z.lazy(() => z.object({"invoice_item_details": billing_bill_resource_invoicing_lines_parents_invoice_line_item_invoice_item_parent.nullable(), "subscription_item_details": billing_bill_resource_invoicing_lines_parents_invoice_line_item_subscription_item_parent.nullable(), "type": z.enum(["invoice_item_details", "subscription_item_details"])})); +const billing_bill_resource_invoicing_lines_parents_invoice_line_item_subscription_item_parent = z.lazy(() => z.object({"invoice_item": z.string().nullable(), "proration": z.boolean(), "proration_details": billing_bill_resource_invoicing_lines_common_proration_details.nullable(), "subscription": z.string().nullable(), "subscription_item": z.string()})); +const billing_bill_resource_invoicing_parents_invoice_parent: z.ZodTypeAny = z.lazy(() => z.object({"quote_details": billing_bill_resource_invoicing_parents_invoice_quote_parent.nullable(), "subscription_details": billing_bill_resource_invoicing_parents_invoice_subscription_parent.nullable(), "type": z.enum(["quote_details", "subscription_details"])})); +const billing_bill_resource_invoicing_parents_invoice_quote_parent = z.lazy(() => z.object({"quote": z.string()})); +const billing_bill_resource_invoicing_parents_invoice_subscription_parent: z.ZodTypeAny = z.lazy(() => z.object({"metadata": z.record(z.string(), z.string()).nullable(), "subscription": z.union([z.string(), subscription]), "subscription_proration_date": z.number().int().optional()})); +const billing_bill_resource_invoicing_pricing_pricing = z.lazy(() => z.object({"price_details": billing_bill_resource_invoicing_pricing_pricing_price_details.optional(), "type": z.literal("price_details"), "unit_amount_decimal": z.string().nullable()})); +const billing_bill_resource_invoicing_pricing_pricing_price_details = z.lazy(() => z.object({"price": z.union([z.string(), price]), "product": z.string()})); +const billing_bill_resource_invoicing_taxes_tax = z.lazy(() => z.object({"amount": z.number().int(), "tax_behavior": z.enum(["exclusive", "inclusive"]), "tax_rate_details": billing_bill_resource_invoicing_taxes_tax_rate_details.nullable(), "taxability_reason": z.enum(["customer_exempt", "not_available", "not_collecting", "not_subject_to_tax", "not_supported", "portion_product_exempt", "portion_reduced_rated", "portion_standard_rated", "product_exempt", "product_exempt_holiday", "proportionally_rated", "reduced_rated", "reverse_charge", "standard_rated", "taxable_basis_reduced", "zero_rated"]), "taxable_amount": z.number().int().nullable(), "type": z.literal("tax_rate_details")})); +const billing_bill_resource_invoicing_taxes_tax_rate_details = z.lazy(() => z.object({"tax_rate": z.union([z.string(), tax_rate])})); +const billing_clocks_resource_status_details_advancing_status_details = z.lazy(() => z.object({"target_frozen_time": z.number().int()})); +const billing_clocks_resource_status_details_status_details = z.lazy(() => z.object({"advancing": billing_clocks_resource_status_details_advancing_status_details.optional()})); +const billing_credit_grants_resource_amount = z.lazy(() => z.object({"monetary": billing_credit_grants_resource_monetary_amount.nullable(), "type": z.literal("monetary")})); +const billing_credit_grants_resource_applicability_config = z.lazy(() => z.object({"scope": billing_credit_grants_resource_scope})); +const billing_credit_grants_resource_applicable_price = z.lazy(() => z.object({"id": z.string().nullable()})); +const billing_credit_grants_resource_balance_credit: z.ZodTypeAny = z.lazy(() => z.object({"amount": billing_credit_grants_resource_amount, "credits_application_invoice_voided": billing_credit_grants_resource_balance_credits_application_invoice_voided.nullable(), "type": z.enum(["credits_application_invoice_voided", "credits_granted"])})); +const billing_credit_grants_resource_balance_credits_application_invoice_voided: z.ZodTypeAny = z.lazy(() => z.object({"invoice": z.union([z.string(), invoice]), "invoice_line_item": z.string()})); +const billing_credit_grants_resource_balance_credits_applied: z.ZodTypeAny = z.lazy(() => z.object({"invoice": z.union([z.string(), invoice]), "invoice_line_item": z.string()})); +const billing_credit_grants_resource_balance_debit: z.ZodTypeAny = z.lazy(() => z.object({"amount": billing_credit_grants_resource_amount, "credits_applied": billing_credit_grants_resource_balance_credits_applied.nullable(), "type": z.enum(["credits_applied", "credits_expired", "credits_voided"])})); +const billing_credit_grants_resource_monetary_amount = z.lazy(() => z.object({"currency": z.string(), "value": z.number().int()})); +const billing_credit_grants_resource_scope = z.lazy(() => z.object({"price_type": z.literal("metered").optional(), "prices": z.array(billing_credit_grants_resource_applicable_price).optional()})); +const billing_details = z.lazy(() => z.object({"address": address.nullable(), "email": z.string().nullable(), "name": z.string().nullable(), "phone": z.string().nullable(), "tax_id": z.string().nullable()})); +const cancellation_details = z.lazy(() => z.object({"comment": z.string().nullable(), "feedback": z.enum(["customer_service", "low_quality", "missing_features", "other", "switched_service", "too_complex", "too_expensive", "unused"]).nullable(), "reason": z.enum(["canceled_by_retention_policy", "cancellation_requested", "payment_disputed", "payment_failed"]).nullable()})); +const card: z.ZodTypeAny = z.lazy(() => z.object({"account": z.union([z.string(), account]).nullable().optional(), "address_city": z.string().nullable(), "address_country": z.string().nullable(), "address_line1": z.string().nullable(), "address_line1_check": z.string().nullable(), "address_line2": z.string().nullable(), "address_state": z.string().nullable(), "address_zip": z.string().nullable(), "address_zip_check": z.string().nullable(), "allow_redisplay": z.enum(["always", "limited", "unspecified"]).nullable().optional(), "available_payout_methods": z.array(z.enum(["instant", "standard"])).nullable().optional(), "brand": z.string(), "country": z.string().nullable(), "currency": z.string().nullable().optional(), "customer": z.union([z.string(), customer, deleted_customer]).nullable().optional(), "cvc_check": z.string().nullable(), "default_for_currency": z.boolean().nullable().optional(), "description": z.string().optional(), "dynamic_last4": z.string().nullable(), "exp_month": z.number().int(), "exp_year": z.number().int(), "fingerprint": z.string().nullable().optional(), "funding": z.string(), "id": z.string(), "iin": z.string().optional(), "issuer": z.string().optional(), "last4": z.string(), "metadata": z.record(z.string(), z.string()).nullable(), "name": z.string().nullable(), "networks": token_card_networks.optional(), "object": z.literal("card"), "regulated_status": z.enum(["regulated", "unregulated"]).nullable(), "status": z.string().nullable().optional(), "tokenization_method": z.string().nullable()})); +const card_generated_from_payment_method_details = z.lazy(() => z.object({"card_present": payment_method_details_card_present.optional(), "type": z.string()})); +const card_issuing_account_terms_of_service = z.lazy(() => z.object({"date": z.number().int().nullable(), "ip": z.string().nullable(), "user_agent": z.string().optional()})); const card_mandate_payment_method_details = z.lazy(() => z.record(z.string(), z.any())); -const cash_balance = z.lazy(() => z.object({"available": z.record(z.string(), z.number().int()).nullable(), "customer": z.string(), "customer_account": z.string().nullable(), "livemode": z.boolean(), "object": z.literal("cash_balance"), "settings": customer_balance_customer_balance_settings}).passthrough()); -const charge: z.ZodTypeAny = z.lazy(() => z.object({"amount": z.number().int(), "amount_captured": z.number().int(), "amount_refunded": z.number().int(), "application": z.union([z.string(), application]).nullable(), "application_fee": z.union([z.string(), application_fee]).nullable(), "application_fee_amount": z.number().int().nullable(), "authorization_code": z.string().optional(), "balance_transaction": z.union([z.string(), balance_transaction]).nullable(), "billing_details": billing_details, "calculated_statement_descriptor": z.string().nullable(), "captured": z.boolean(), "created": z.number().int(), "currency": z.string(), "customer": z.union([z.string(), customer, deleted_customer]).nullable(), "description": z.string().nullable(), "disputed": z.boolean(), "failure_balance_transaction": z.union([z.string(), balance_transaction]).nullable(), "failure_code": z.string().nullable(), "failure_message": z.string().nullable(), "fraud_details": charge_fraud_details.nullable(), "id": z.string(), "level3": level3.optional(), "livemode": z.boolean(), "metadata": z.record(z.string(), z.string()), "object": z.literal("charge"), "on_behalf_of": z.union([z.string(), account]).nullable(), "outcome": charge_outcome.nullable(), "paid": z.boolean(), "payment_intent": z.union([z.string(), payment_intent]).nullable(), "payment_method": z.string().nullable(), "payment_method_details": payment_method_details.nullable(), "presentment_details": payment_flows_payment_intent_presentment_details.optional(), "radar_options": radar_radar_options.optional(), "receipt_email": z.string().nullable(), "receipt_number": z.string().nullable(), "receipt_url": z.string().nullable(), "refunded": z.boolean(), "refunds": z.object({"data": z.array(refund), "has_more": z.boolean(), "object": z.literal("list"), "url": z.string()}).passthrough().nullable().optional(), "review": z.union([z.string(), review]).nullable(), "shipping": shipping.nullable(), "source": payment_source.nullable(), "source_transfer": z.union([z.string(), transfer]).nullable(), "statement_descriptor": z.string().nullable(), "statement_descriptor_suffix": z.string().nullable(), "status": z.enum(["failed", "pending", "succeeded"]), "transfer": z.union([z.string(), transfer]).optional(), "transfer_data": charge_transfer_data.nullable(), "transfer_group": z.string().nullable()}).passthrough()); -const charge_fraud_details = z.lazy(() => z.object({"stripe_report": z.string().optional(), "user_report": z.string().optional()}).passthrough()); -const charge_outcome = z.lazy(() => z.object({"advice_code": z.enum(["confirm_card_data", "do_not_try_again", "try_again_later"]).nullable(), "network_advice_code": z.string().nullable(), "network_decline_code": z.string().nullable(), "network_status": z.string().nullable(), "reason": z.string().nullable(), "risk_level": z.string().optional(), "risk_score": z.number().int().optional(), "rule": z.union([z.string(), rule]).optional(), "seller_message": z.string().nullable(), "type": z.string()}).passthrough()); -const charge_transfer_data: z.ZodTypeAny = z.lazy(() => z.object({"amount": z.number().int().nullable(), "destination": z.union([z.string(), account])}).passthrough()); -const connect_account_reference: z.ZodTypeAny = z.lazy(() => z.object({"account": z.union([z.string(), account]).optional(), "type": z.enum(["account", "self"])}).passthrough()); -const connect_collection_transfer: z.ZodTypeAny = z.lazy(() => z.object({"amount": z.number().int(), "currency": z.string(), "destination": z.union([z.string(), account]), "id": z.string(), "livemode": z.boolean(), "object": z.literal("connect_collection_transfer")}).passthrough()); -const coupon = z.lazy(() => z.object({"amount_off": z.number().int().nullable(), "applies_to": coupon_applies_to.optional(), "created": z.number().int(), "currency": z.string().nullable(), "currency_options": z.record(z.string(), coupon_currency_option).optional(), "duration": z.enum(["forever", "once", "repeating"]), "duration_in_months": z.number().int().nullable(), "id": z.string(), "livemode": z.boolean(), "max_redemptions": z.number().int().nullable(), "metadata": z.record(z.string(), z.string()).nullable(), "name": z.string().nullable(), "object": z.literal("coupon"), "percent_off": z.number().nullable(), "redeem_by": z.number().int().nullable(), "times_redeemed": z.number().int(), "valid": z.boolean()}).passthrough()); -const coupon_applies_to = z.lazy(() => z.object({"products": z.array(z.string())}).passthrough()); -const coupon_currency_option = z.lazy(() => z.object({"amount_off": z.number().int()}).passthrough()); -const currency_option = z.lazy(() => z.object({"custom_unit_amount": custom_unit_amount.nullable(), "tax_behavior": z.enum(["exclusive", "inclusive", "unspecified"]).nullable(), "tiers": z.array(price_tier).optional(), "unit_amount": z.number().int().nullable(), "unit_amount_decimal": z.string().nullable()}).passthrough()); -const custom_logo = z.lazy(() => z.object({"content_type": z.string().nullable(), "url": z.string()}).passthrough()); -const custom_unit_amount = z.lazy(() => z.object({"maximum": z.number().int().nullable(), "minimum": z.number().int().nullable(), "preset": z.number().int().nullable()}).passthrough()); -const customer: z.ZodTypeAny = z.lazy(() => z.object({"address": address.nullable().optional(), "balance": z.number().int().optional(), "business_name": z.string().optional(), "cash_balance": cash_balance.nullable().optional(), "created": z.number().int(), "currency": z.string().nullable().optional(), "customer_account": z.string().nullable().optional(), "default_source": z.union([z.string(), payment_source]).nullable(), "delinquent": z.boolean().nullable().optional(), "description": z.string().nullable(), "discount": discount.nullable().optional(), "email": z.string().nullable(), "id": z.string(), "individual_name": z.string().optional(), "invoice_credit_balance": z.record(z.string(), z.number().int()).optional(), "invoice_prefix": z.string().nullable().optional(), "invoice_settings": invoice_setting_customer_setting.optional(), "livemode": z.boolean(), "metadata": z.record(z.string(), z.string()).optional(), "name": z.string().nullable().optional(), "next_invoice_sequence": z.number().int().optional(), "object": z.literal("customer"), "phone": z.string().nullable().optional(), "preferred_locales": z.array(z.string()).nullable().optional(), "shipping": shipping.nullable(), "sources": z.object({"data": z.array(payment_source), "has_more": z.boolean(), "object": z.literal("list"), "url": z.string()}).passthrough().optional(), "subscriptions": z.object({"data": z.array(subscription), "has_more": z.boolean(), "object": z.literal("list"), "url": z.string()}).passthrough().optional(), "tax": customer_tax.optional(), "tax_exempt": z.enum(["exempt", "none", "reverse"]).nullable().optional(), "tax_ids": z.object({"data": z.array(tax_id), "has_more": z.boolean(), "object": z.literal("list"), "url": z.string()}).passthrough().optional(), "test_clock": z.union([z.string(), test_helpers_test_clock]).nullable().optional()}).passthrough()); -const customer_acceptance = z.lazy(() => z.object({"accepted_at": z.number().int().nullable(), "offline": offline_acceptance.optional(), "online": online_acceptance.optional(), "type": z.enum(["offline", "online"])}).passthrough()); -const customer_balance_customer_balance_settings = z.lazy(() => z.object({"reconciliation_mode": z.enum(["automatic", "manual"]), "using_merchant_default": z.boolean()}).passthrough()); -const customer_balance_resource_cash_balance_transaction_resource_adjusted_for_overdraft: z.ZodTypeAny = z.lazy(() => z.object({"balance_transaction": z.union([z.string(), balance_transaction]), "linked_transaction": z.union([z.string(), customer_cash_balance_transaction])}).passthrough()); -const customer_balance_resource_cash_balance_transaction_resource_applied_to_payment_transaction: z.ZodTypeAny = z.lazy(() => z.object({"payment_intent": z.union([z.string(), payment_intent])}).passthrough()); -const customer_balance_resource_cash_balance_transaction_resource_funded_transaction = z.lazy(() => z.object({"bank_transfer": customer_balance_resource_cash_balance_transaction_resource_funded_transaction_resource_bank_transfer}).passthrough()); -const customer_balance_resource_cash_balance_transaction_resource_funded_transaction_resource_bank_transfer = z.lazy(() => z.object({"eu_bank_transfer": customer_balance_resource_cash_balance_transaction_resource_funded_transaction_resource_bank_transfer_resource_eu_bank_transfer.optional(), "gb_bank_transfer": customer_balance_resource_cash_balance_transaction_resource_funded_transaction_resource_bank_transfer_resource_gb_bank_transfer.optional(), "jp_bank_transfer": customer_balance_resource_cash_balance_transaction_resource_funded_transaction_resource_bank_transfer_resource_jp_bank_transfer.optional(), "reference": z.string().nullable(), "type": z.enum(["eu_bank_transfer", "gb_bank_transfer", "jp_bank_transfer", "mx_bank_transfer", "us_bank_transfer"]), "us_bank_transfer": customer_balance_resource_cash_balance_transaction_resource_funded_transaction_resource_bank_transfer_resource_us_bank_transfer.optional()}).passthrough()); -const customer_balance_resource_cash_balance_transaction_resource_funded_transaction_resource_bank_transfer_resource_eu_bank_transfer = z.lazy(() => z.object({"bic": z.string().nullable(), "iban_last4": z.string().nullable(), "sender_name": z.string().nullable()}).passthrough()); -const customer_balance_resource_cash_balance_transaction_resource_funded_transaction_resource_bank_transfer_resource_gb_bank_transfer = z.lazy(() => z.object({"account_number_last4": z.string().nullable(), "sender_name": z.string().nullable(), "sort_code": z.string().nullable()}).passthrough()); -const customer_balance_resource_cash_balance_transaction_resource_funded_transaction_resource_bank_transfer_resource_jp_bank_transfer = z.lazy(() => z.object({"sender_bank": z.string().nullable(), "sender_branch": z.string().nullable(), "sender_name": z.string().nullable()}).passthrough()); -const customer_balance_resource_cash_balance_transaction_resource_funded_transaction_resource_bank_transfer_resource_us_bank_transfer = z.lazy(() => z.object({"network": z.enum(["ach", "domestic_wire_us", "swift"]).optional(), "sender_name": z.string().nullable()}).passthrough()); -const customer_balance_resource_cash_balance_transaction_resource_refunded_from_payment_transaction: z.ZodTypeAny = z.lazy(() => z.object({"refund": z.union([z.string(), refund])}).passthrough()); -const customer_balance_resource_cash_balance_transaction_resource_transferred_to_balance: z.ZodTypeAny = z.lazy(() => z.object({"balance_transaction": z.union([z.string(), balance_transaction])}).passthrough()); -const customer_balance_resource_cash_balance_transaction_resource_unapplied_from_payment_transaction: z.ZodTypeAny = z.lazy(() => z.object({"payment_intent": z.union([z.string(), payment_intent])}).passthrough()); -const customer_cash_balance_transaction: z.ZodTypeAny = z.lazy(() => z.object({"adjusted_for_overdraft": customer_balance_resource_cash_balance_transaction_resource_adjusted_for_overdraft.optional(), "applied_to_payment": customer_balance_resource_cash_balance_transaction_resource_applied_to_payment_transaction.optional(), "created": z.number().int(), "currency": z.string(), "customer": z.union([z.string(), customer]), "customer_account": z.string().nullable(), "ending_balance": z.number().int(), "funded": customer_balance_resource_cash_balance_transaction_resource_funded_transaction.optional(), "id": z.string(), "livemode": z.boolean(), "net_amount": z.number().int(), "object": z.literal("customer_cash_balance_transaction"), "refunded_from_payment": customer_balance_resource_cash_balance_transaction_resource_refunded_from_payment_transaction.optional(), "transferred_to_balance": customer_balance_resource_cash_balance_transaction_resource_transferred_to_balance.optional(), "type": z.enum(["adjusted_for_overdraft", "applied_to_payment", "funded", "funding_reversed", "refunded_from_payment", "return_canceled", "return_initiated", "transferred_to_balance", "unapplied_from_payment"]), "unapplied_from_payment": customer_balance_resource_cash_balance_transaction_resource_unapplied_from_payment_transaction.optional()}).passthrough()); -const customer_tax = z.lazy(() => z.object({"automatic_tax": z.enum(["failed", "not_collecting", "supported", "unrecognized_location"]), "ip_address": z.string().nullable(), "location": customer_tax_location.nullable(), "provider": z.enum(["anrok", "avalara", "sphere", "stripe"])}).passthrough()); -const customer_tax_location = z.lazy(() => z.object({"country": z.string(), "source": z.enum(["billing_address", "ip_address", "payment_method", "shipping_destination"]), "state": z.string().nullable()}).passthrough()); -const deleted_application = z.lazy(() => z.object({"deleted": z.literal(true), "id": z.string(), "name": z.string().nullable(), "object": z.literal("application")}).passthrough()); -const deleted_bank_account = z.lazy(() => z.object({"currency": z.string().nullable().optional(), "deleted": z.literal(true), "id": z.string(), "object": z.literal("bank_account")}).passthrough()); -const deleted_card = z.lazy(() => z.object({"currency": z.string().nullable().optional(), "deleted": z.literal(true), "id": z.string(), "object": z.literal("card")}).passthrough()); -const deleted_customer = z.lazy(() => z.object({"deleted": z.literal(true), "id": z.string(), "object": z.literal("customer")}).passthrough()); -const deleted_discount: z.ZodTypeAny = z.lazy(() => z.object({"checkout_session": z.string().nullable(), "customer": z.union([z.string(), customer, deleted_customer]).nullable(), "customer_account": z.string().nullable(), "deleted": z.literal(true), "id": z.string(), "invoice": z.string().nullable(), "invoice_item": z.string().nullable(), "object": z.literal("discount"), "promotion_code": z.union([z.string(), promotion_code]).nullable(), "source": discount_source, "start": z.number().int(), "subscription": z.string().nullable(), "subscription_item": z.string().nullable()}).passthrough()); +const cash_balance = z.lazy(() => z.object({"available": z.record(z.string(), z.number().int()).nullable(), "customer": z.string(), "customer_account": z.string().nullable(), "livemode": z.boolean(), "object": z.literal("cash_balance"), "settings": customer_balance_customer_balance_settings})); +const charge: z.ZodTypeAny = z.lazy(() => z.object({"amount": z.number().int(), "amount_captured": z.number().int(), "amount_refunded": z.number().int(), "application": z.union([z.string(), application]).nullable(), "application_fee": z.union([z.string(), application_fee]).nullable(), "application_fee_amount": z.number().int().nullable(), "authorization_code": z.string().optional(), "balance_transaction": z.union([z.string(), balance_transaction]).nullable(), "billing_details": billing_details, "calculated_statement_descriptor": z.string().nullable(), "captured": z.boolean(), "created": z.number().int(), "currency": z.string(), "customer": z.union([z.string(), customer, deleted_customer]).nullable(), "description": z.string().nullable(), "disputed": z.boolean(), "failure_balance_transaction": z.union([z.string(), balance_transaction]).nullable(), "failure_code": z.string().nullable(), "failure_message": z.string().nullable(), "fraud_details": charge_fraud_details.nullable(), "id": z.string(), "level3": level3.optional(), "livemode": z.boolean(), "metadata": z.record(z.string(), z.string()), "object": z.literal("charge"), "on_behalf_of": z.union([z.string(), account]).nullable(), "outcome": charge_outcome.nullable(), "paid": z.boolean(), "payment_intent": z.union([z.string(), payment_intent]).nullable(), "payment_method": z.string().nullable(), "payment_method_details": payment_method_details.nullable(), "presentment_details": payment_flows_payment_intent_presentment_details.optional(), "radar_options": radar_radar_options.optional(), "receipt_email": z.string().nullable(), "receipt_number": z.string().nullable(), "receipt_url": z.string().nullable(), "refunded": z.boolean(), "refunds": z.object({"data": z.array(refund), "has_more": z.boolean(), "object": z.literal("list"), "url": z.string()}).nullable().optional(), "review": z.union([z.string(), review]).nullable(), "shipping": shipping.nullable(), "source": payment_source.nullable(), "source_transfer": z.union([z.string(), transfer]).nullable(), "statement_descriptor": z.string().nullable(), "statement_descriptor_suffix": z.string().nullable(), "status": z.enum(["failed", "pending", "succeeded"]), "transfer": z.union([z.string(), transfer]).optional(), "transfer_data": charge_transfer_data.nullable(), "transfer_group": z.string().nullable()})); +const charge_fraud_details = z.lazy(() => z.object({"stripe_report": z.string().optional(), "user_report": z.string().optional()})); +const charge_outcome = z.lazy(() => z.object({"advice_code": z.enum(["confirm_card_data", "do_not_try_again", "try_again_later"]).nullable(), "network_advice_code": z.string().nullable(), "network_decline_code": z.string().nullable(), "network_status": z.string().nullable(), "reason": z.string().nullable(), "risk_level": z.string().optional(), "risk_score": z.number().int().optional(), "rule": z.union([z.string(), rule]).optional(), "seller_message": z.string().nullable(), "type": z.string()})); +const charge_transfer_data: z.ZodTypeAny = z.lazy(() => z.object({"amount": z.number().int().nullable(), "destination": z.union([z.string(), account])})); +const connect_account_reference: z.ZodTypeAny = z.lazy(() => z.object({"account": z.union([z.string(), account]).optional(), "type": z.enum(["account", "self"])})); +const connect_collection_transfer: z.ZodTypeAny = z.lazy(() => z.object({"amount": z.number().int(), "currency": z.string(), "destination": z.union([z.string(), account]), "id": z.string(), "livemode": z.boolean(), "object": z.literal("connect_collection_transfer")})); +const coupon = z.lazy(() => z.object({"amount_off": z.number().int().nullable(), "applies_to": coupon_applies_to.optional(), "created": z.number().int(), "currency": z.string().nullable(), "currency_options": z.record(z.string(), coupon_currency_option).optional(), "duration": z.enum(["forever", "once", "repeating"]), "duration_in_months": z.number().int().nullable(), "id": z.string(), "livemode": z.boolean(), "max_redemptions": z.number().int().nullable(), "metadata": z.record(z.string(), z.string()).nullable(), "name": z.string().nullable(), "object": z.literal("coupon"), "percent_off": z.number().nullable(), "redeem_by": z.number().int().nullable(), "times_redeemed": z.number().int(), "valid": z.boolean()})); +const coupon_applies_to = z.lazy(() => z.object({"products": z.array(z.string())})); +const coupon_currency_option = z.lazy(() => z.object({"amount_off": z.number().int()})); +const currency_option = z.lazy(() => z.object({"custom_unit_amount": custom_unit_amount.nullable(), "tax_behavior": z.enum(["exclusive", "inclusive", "unspecified"]).nullable(), "tiers": z.array(price_tier).optional(), "unit_amount": z.number().int().nullable(), "unit_amount_decimal": z.string().nullable()})); +const custom_logo = z.lazy(() => z.object({"content_type": z.string().nullable(), "url": z.string()})); +const custom_unit_amount = z.lazy(() => z.object({"maximum": z.number().int().nullable(), "minimum": z.number().int().nullable(), "preset": z.number().int().nullable()})); +const customer: z.ZodTypeAny = z.lazy(() => z.object({"address": address.nullable().optional(), "balance": z.number().int().optional(), "business_name": z.string().optional(), "cash_balance": cash_balance.nullable().optional(), "created": z.number().int(), "currency": z.string().nullable().optional(), "customer_account": z.string().nullable().optional(), "default_source": z.union([z.string(), payment_source]).nullable(), "delinquent": z.boolean().nullable().optional(), "description": z.string().nullable(), "discount": discount.nullable().optional(), "email": z.string().nullable(), "id": z.string(), "individual_name": z.string().optional(), "invoice_credit_balance": z.record(z.string(), z.number().int()).optional(), "invoice_prefix": z.string().nullable().optional(), "invoice_settings": invoice_setting_customer_setting.optional(), "livemode": z.boolean(), "metadata": z.record(z.string(), z.string()).optional(), "name": z.string().nullable().optional(), "next_invoice_sequence": z.number().int().optional(), "object": z.literal("customer"), "phone": z.string().nullable().optional(), "preferred_locales": z.array(z.string()).nullable().optional(), "shipping": shipping.nullable(), "sources": z.object({"data": z.array(payment_source), "has_more": z.boolean(), "object": z.literal("list"), "url": z.string()}).optional(), "subscriptions": z.object({"data": z.array(subscription), "has_more": z.boolean(), "object": z.literal("list"), "url": z.string()}).optional(), "tax": customer_tax.optional(), "tax_exempt": z.enum(["exempt", "none", "reverse"]).nullable().optional(), "tax_ids": z.object({"data": z.array(tax_id), "has_more": z.boolean(), "object": z.literal("list"), "url": z.string()}).optional(), "test_clock": z.union([z.string(), test_helpers_test_clock]).nullable().optional()})); +const customer_acceptance = z.lazy(() => z.object({"accepted_at": z.number().int().nullable(), "offline": offline_acceptance.optional(), "online": online_acceptance.optional(), "type": z.enum(["offline", "online"])})); +const customer_balance_customer_balance_settings = z.lazy(() => z.object({"reconciliation_mode": z.enum(["automatic", "manual"]), "using_merchant_default": z.boolean()})); +const customer_balance_resource_cash_balance_transaction_resource_adjusted_for_overdraft: z.ZodTypeAny = z.lazy(() => z.object({"balance_transaction": z.union([z.string(), balance_transaction]), "linked_transaction": z.union([z.string(), customer_cash_balance_transaction])})); +const customer_balance_resource_cash_balance_transaction_resource_applied_to_payment_transaction: z.ZodTypeAny = z.lazy(() => z.object({"payment_intent": z.union([z.string(), payment_intent])})); +const customer_balance_resource_cash_balance_transaction_resource_funded_transaction = z.lazy(() => z.object({"bank_transfer": customer_balance_resource_cash_balance_transaction_resource_funded_transaction_resource_bank_transfer})); +const customer_balance_resource_cash_balance_transaction_resource_funded_transaction_resource_bank_transfer = z.lazy(() => z.object({"eu_bank_transfer": customer_balance_resource_cash_balance_transaction_resource_funded_transaction_resource_bank_transfer_resource_eu_bank_transfer.optional(), "gb_bank_transfer": customer_balance_resource_cash_balance_transaction_resource_funded_transaction_resource_bank_transfer_resource_gb_bank_transfer.optional(), "jp_bank_transfer": customer_balance_resource_cash_balance_transaction_resource_funded_transaction_resource_bank_transfer_resource_jp_bank_transfer.optional(), "reference": z.string().nullable(), "type": z.enum(["eu_bank_transfer", "gb_bank_transfer", "jp_bank_transfer", "mx_bank_transfer", "us_bank_transfer"]), "us_bank_transfer": customer_balance_resource_cash_balance_transaction_resource_funded_transaction_resource_bank_transfer_resource_us_bank_transfer.optional()})); +const customer_balance_resource_cash_balance_transaction_resource_funded_transaction_resource_bank_transfer_resource_eu_bank_transfer = z.lazy(() => z.object({"bic": z.string().nullable(), "iban_last4": z.string().nullable(), "sender_name": z.string().nullable()})); +const customer_balance_resource_cash_balance_transaction_resource_funded_transaction_resource_bank_transfer_resource_gb_bank_transfer = z.lazy(() => z.object({"account_number_last4": z.string().nullable(), "sender_name": z.string().nullable(), "sort_code": z.string().nullable()})); +const customer_balance_resource_cash_balance_transaction_resource_funded_transaction_resource_bank_transfer_resource_jp_bank_transfer = z.lazy(() => z.object({"sender_bank": z.string().nullable(), "sender_branch": z.string().nullable(), "sender_name": z.string().nullable()})); +const customer_balance_resource_cash_balance_transaction_resource_funded_transaction_resource_bank_transfer_resource_us_bank_transfer = z.lazy(() => z.object({"network": z.enum(["ach", "domestic_wire_us", "swift"]).optional(), "sender_name": z.string().nullable()})); +const customer_balance_resource_cash_balance_transaction_resource_refunded_from_payment_transaction: z.ZodTypeAny = z.lazy(() => z.object({"refund": z.union([z.string(), refund])})); +const customer_balance_resource_cash_balance_transaction_resource_transferred_to_balance: z.ZodTypeAny = z.lazy(() => z.object({"balance_transaction": z.union([z.string(), balance_transaction])})); +const customer_balance_resource_cash_balance_transaction_resource_unapplied_from_payment_transaction: z.ZodTypeAny = z.lazy(() => z.object({"payment_intent": z.union([z.string(), payment_intent])})); +const customer_cash_balance_transaction: z.ZodTypeAny = z.lazy(() => z.object({"adjusted_for_overdraft": customer_balance_resource_cash_balance_transaction_resource_adjusted_for_overdraft.optional(), "applied_to_payment": customer_balance_resource_cash_balance_transaction_resource_applied_to_payment_transaction.optional(), "created": z.number().int(), "currency": z.string(), "customer": z.union([z.string(), customer]), "customer_account": z.string().nullable(), "ending_balance": z.number().int(), "funded": customer_balance_resource_cash_balance_transaction_resource_funded_transaction.optional(), "id": z.string(), "livemode": z.boolean(), "net_amount": z.number().int(), "object": z.literal("customer_cash_balance_transaction"), "refunded_from_payment": customer_balance_resource_cash_balance_transaction_resource_refunded_from_payment_transaction.optional(), "transferred_to_balance": customer_balance_resource_cash_balance_transaction_resource_transferred_to_balance.optional(), "type": z.enum(["adjusted_for_overdraft", "applied_to_payment", "funded", "funding_reversed", "refunded_from_payment", "return_canceled", "return_initiated", "transferred_to_balance", "unapplied_from_payment"]), "unapplied_from_payment": customer_balance_resource_cash_balance_transaction_resource_unapplied_from_payment_transaction.optional()})); +const customer_tax = z.lazy(() => z.object({"automatic_tax": z.enum(["failed", "not_collecting", "supported", "unrecognized_location"]), "ip_address": z.string().nullable(), "location": customer_tax_location.nullable(), "provider": z.enum(["anrok", "avalara", "sphere", "stripe"])})); +const customer_tax_location = z.lazy(() => z.object({"country": z.string(), "source": z.enum(["billing_address", "ip_address", "payment_method", "shipping_destination"]), "state": z.string().nullable()})); +const deleted_application = z.lazy(() => z.object({"deleted": z.literal(true), "id": z.string(), "name": z.string().nullable(), "object": z.literal("application")})); +const deleted_bank_account = z.lazy(() => z.object({"currency": z.string().nullable().optional(), "deleted": z.literal(true), "id": z.string(), "object": z.literal("bank_account")})); +const deleted_card = z.lazy(() => z.object({"currency": z.string().nullable().optional(), "deleted": z.literal(true), "id": z.string(), "object": z.literal("card")})); +const deleted_customer = z.lazy(() => z.object({"deleted": z.literal(true), "id": z.string(), "object": z.literal("customer")})); +const deleted_discount: z.ZodTypeAny = z.lazy(() => z.object({"checkout_session": z.string().nullable(), "customer": z.union([z.string(), customer, deleted_customer]).nullable(), "customer_account": z.string().nullable(), "deleted": z.literal(true), "id": z.string(), "invoice": z.string().nullable(), "invoice_item": z.string().nullable(), "object": z.literal("discount"), "promotion_code": z.union([z.string(), promotion_code]).nullable(), "source": discount_source, "start": z.number().int(), "subscription": z.string().nullable(), "subscription_item": z.string().nullable()})); const deleted_external_account = z.lazy(() => z.union([deleted_bank_account, deleted_card])); -const deleted_invoice = z.lazy(() => z.object({"deleted": z.literal(true), "id": z.string(), "object": z.literal("invoice")}).passthrough()); +const deleted_invoice = z.lazy(() => z.object({"deleted": z.literal(true), "id": z.string(), "object": z.literal("invoice")})); const deleted_payment_source = z.lazy(() => z.union([deleted_bank_account, deleted_card])); -const deleted_plan = z.lazy(() => z.object({"deleted": z.literal(true), "id": z.string(), "object": z.literal("plan")}).passthrough()); -const deleted_price = z.lazy(() => z.object({"deleted": z.literal(true), "id": z.string(), "object": z.literal("price")}).passthrough()); -const deleted_product = z.lazy(() => z.object({"deleted": z.literal(true), "id": z.string(), "object": z.literal("product")}).passthrough()); -const deleted_tax_id = z.lazy(() => z.object({"deleted": z.literal(true), "id": z.string(), "object": z.literal("tax_id")}).passthrough()); +const deleted_plan = z.lazy(() => z.object({"deleted": z.literal(true), "id": z.string(), "object": z.literal("plan")})); +const deleted_price = z.lazy(() => z.object({"deleted": z.literal(true), "id": z.string(), "object": z.literal("price")})); +const deleted_product = z.lazy(() => z.object({"deleted": z.literal(true), "id": z.string(), "object": z.literal("product")})); +const deleted_tax_id = z.lazy(() => z.object({"deleted": z.literal(true), "id": z.string(), "object": z.literal("tax_id")})); const destination_details_unimplemented = z.lazy(() => z.record(z.string(), z.any())); -const discount: z.ZodTypeAny = z.lazy(() => z.object({"checkout_session": z.string().nullable(), "customer": z.union([z.string(), customer, deleted_customer]).nullable(), "customer_account": z.string().nullable(), "end": z.number().int().nullable(), "id": z.string(), "invoice": z.string().nullable(), "invoice_item": z.string().nullable(), "object": z.literal("discount"), "promotion_code": z.union([z.string(), promotion_code]).nullable(), "source": discount_source, "start": z.number().int(), "subscription": z.string().nullable(), "subscription_item": z.string().nullable()}).passthrough()); -const discount_source = z.lazy(() => z.object({"coupon": z.union([z.string(), coupon]).nullable(), "type": z.literal("coupon")}).passthrough()); -const discounts_resource_discount_amount: z.ZodTypeAny = z.lazy(() => z.object({"amount": z.number().int(), "discount": z.union([z.string(), discount, deleted_discount])}).passthrough()); -const discounts_resource_stackable_discount_with_discount_end: z.ZodTypeAny = z.lazy(() => z.object({"coupon": z.union([z.string(), coupon]).nullable(), "discount": z.union([z.string(), discount]).nullable(), "promotion_code": z.union([z.string(), promotion_code]).nullable()}).passthrough()); -const dispute: z.ZodTypeAny = z.lazy(() => z.object({"amount": z.number().int(), "balance_transactions": z.array(balance_transaction), "charge": z.union([z.string(), charge]), "created": z.number().int(), "currency": z.string(), "enhanced_eligibility_types": z.array(z.enum(["mastercard_compliance", "visa_compelling_evidence_3", "visa_compliance"])), "evidence": dispute_evidence, "evidence_details": dispute_evidence_details, "id": z.string(), "is_charge_refundable": z.boolean(), "livemode": z.boolean(), "metadata": z.record(z.string(), z.string()), "network_reason_code": z.string().nullable().optional(), "object": z.literal("dispute"), "payment_intent": z.union([z.string(), payment_intent]).nullable(), "payment_method_details": dispute_payment_method_details.optional(), "reason": z.string(), "status": z.enum(["lost", "needs_response", "prevented", "under_review", "warning_closed", "warning_needs_response", "warning_under_review", "won"])}).passthrough()); -const dispute_enhanced_eligibility = z.lazy(() => z.object({"mastercard_compliance": dispute_enhanced_eligibility_mastercard_compliance.optional(), "visa_compelling_evidence_3": dispute_enhanced_eligibility_visa_compelling_evidence3.optional(), "visa_compliance": dispute_enhanced_eligibility_visa_compliance.optional()}).passthrough()); -const dispute_enhanced_eligibility_mastercard_compliance = z.lazy(() => z.object({"status": z.enum(["fee_acknowledged", "requires_fee_acknowledgement"])}).passthrough()); -const dispute_enhanced_eligibility_visa_compelling_evidence3 = z.lazy(() => z.object({"required_actions": z.array(z.enum(["missing_customer_identifiers", "missing_disputed_transaction_description", "missing_merchandise_or_services", "missing_prior_undisputed_transaction_description", "missing_prior_undisputed_transactions"])), "status": z.enum(["not_qualified", "qualified", "requires_action"])}).passthrough()); -const dispute_enhanced_eligibility_visa_compliance = z.lazy(() => z.object({"status": z.enum(["fee_acknowledged", "requires_fee_acknowledgement"])}).passthrough()); -const dispute_enhanced_evidence = z.lazy(() => z.object({"mastercard_compliance": dispute_enhanced_evidence_mastercard_compliance.optional(), "visa_compelling_evidence_3": dispute_enhanced_evidence_visa_compelling_evidence3.optional(), "visa_compliance": dispute_enhanced_evidence_visa_compliance.optional()}).passthrough()); -const dispute_enhanced_evidence_mastercard_compliance = z.lazy(() => z.object({"fee_acknowledged": z.boolean()}).passthrough()); -const dispute_enhanced_evidence_visa_compelling_evidence3 = z.lazy(() => z.object({"disputed_transaction": dispute_visa_compelling_evidence3_disputed_transaction.nullable(), "prior_undisputed_transactions": z.array(dispute_visa_compelling_evidence3_prior_undisputed_transaction)}).passthrough()); -const dispute_enhanced_evidence_visa_compliance = z.lazy(() => z.object({"fee_acknowledged": z.boolean()}).passthrough()); -const dispute_evidence = z.lazy(() => z.object({"access_activity_log": z.string().nullable(), "billing_address": z.string().nullable(), "cancellation_policy": z.union([z.string(), file]).nullable(), "cancellation_policy_disclosure": z.string().nullable(), "cancellation_rebuttal": z.string().nullable(), "customer_communication": z.union([z.string(), file]).nullable(), "customer_email_address": z.string().nullable(), "customer_name": z.string().nullable(), "customer_purchase_ip": z.string().nullable(), "customer_signature": z.union([z.string(), file]).nullable(), "duplicate_charge_documentation": z.union([z.string(), file]).nullable(), "duplicate_charge_explanation": z.string().nullable(), "duplicate_charge_id": z.string().nullable(), "enhanced_evidence": dispute_enhanced_evidence, "product_description": z.string().nullable(), "receipt": z.union([z.string(), file]).nullable(), "refund_policy": z.union([z.string(), file]).nullable(), "refund_policy_disclosure": z.string().nullable(), "refund_refusal_explanation": z.string().nullable(), "service_date": z.string().nullable(), "service_documentation": z.union([z.string(), file]).nullable(), "shipping_address": z.string().nullable(), "shipping_carrier": z.string().nullable(), "shipping_date": z.string().nullable(), "shipping_documentation": z.union([z.string(), file]).nullable(), "shipping_tracking_number": z.string().nullable(), "uncategorized_file": z.union([z.string(), file]).nullable(), "uncategorized_text": z.string().nullable()}).passthrough()); -const dispute_evidence_details = z.lazy(() => z.object({"due_by": z.number().int().nullable(), "enhanced_eligibility": dispute_enhanced_eligibility, "has_evidence": z.boolean(), "past_due": z.boolean(), "submission_count": z.number().int()}).passthrough()); -const dispute_payment_method_details = z.lazy(() => z.object({"amazon_pay": dispute_payment_method_details_amazon_pay.optional(), "card": dispute_payment_method_details_card.optional(), "klarna": dispute_payment_method_details_klarna.optional(), "paypal": dispute_payment_method_details_paypal.optional(), "type": z.enum(["amazon_pay", "card", "klarna", "paypal"])}).passthrough()); -const dispute_payment_method_details_amazon_pay = z.lazy(() => z.object({"dispute_type": z.enum(["chargeback", "claim"]).nullable()}).passthrough()); -const dispute_payment_method_details_card = z.lazy(() => z.object({"brand": z.string(), "case_type": z.enum(["block", "chargeback", "compliance", "inquiry", "resolution"]), "network_reason_code": z.string().nullable()}).passthrough()); -const dispute_payment_method_details_klarna = z.lazy(() => z.object({"chargeback_loss_reason_code": z.string().optional(), "reason_code": z.string().nullable()}).passthrough()); -const dispute_payment_method_details_paypal = z.lazy(() => z.object({"case_id": z.string().nullable(), "reason_code": z.string().nullable()}).passthrough()); -const dispute_transaction_shipping_address = z.lazy(() => z.object({"city": z.string().nullable(), "country": z.string().nullable(), "line1": z.string().nullable(), "line2": z.string().nullable(), "postal_code": z.string().nullable(), "state": z.string().nullable()}).passthrough()); -const dispute_visa_compelling_evidence3_disputed_transaction = z.lazy(() => z.object({"customer_account_id": z.string().nullable(), "customer_device_fingerprint": z.string().nullable(), "customer_device_id": z.string().nullable(), "customer_email_address": z.string().nullable(), "customer_purchase_ip": z.string().nullable(), "merchandise_or_services": z.enum(["merchandise", "services"]).nullable(), "product_description": z.string().nullable(), "shipping_address": dispute_transaction_shipping_address.nullable()}).passthrough()); -const dispute_visa_compelling_evidence3_prior_undisputed_transaction = z.lazy(() => z.object({"charge": z.string(), "customer_account_id": z.string().nullable(), "customer_device_fingerprint": z.string().nullable(), "customer_device_id": z.string().nullable(), "customer_email_address": z.string().nullable(), "customer_purchase_ip": z.string().nullable(), "product_description": z.string().nullable(), "shipping_address": dispute_transaction_shipping_address.nullable()}).passthrough()); -const email_sent = z.lazy(() => z.object({"email_sent_at": z.number().int(), "email_sent_to": z.string()}).passthrough()); +const discount: z.ZodTypeAny = z.lazy(() => z.object({"checkout_session": z.string().nullable(), "customer": z.union([z.string(), customer, deleted_customer]).nullable(), "customer_account": z.string().nullable(), "end": z.number().int().nullable(), "id": z.string(), "invoice": z.string().nullable(), "invoice_item": z.string().nullable(), "object": z.literal("discount"), "promotion_code": z.union([z.string(), promotion_code]).nullable(), "source": discount_source, "start": z.number().int(), "subscription": z.string().nullable(), "subscription_item": z.string().nullable()})); +const discount_source = z.lazy(() => z.object({"coupon": z.union([z.string(), coupon]).nullable(), "type": z.literal("coupon")})); +const discounts_resource_discount_amount: z.ZodTypeAny = z.lazy(() => z.object({"amount": z.number().int(), "discount": z.union([z.string(), discount, deleted_discount])})); +const discounts_resource_stackable_discount_with_discount_end: z.ZodTypeAny = z.lazy(() => z.object({"coupon": z.union([z.string(), coupon]).nullable(), "discount": z.union([z.string(), discount]).nullable(), "promotion_code": z.union([z.string(), promotion_code]).nullable()})); +const dispute: z.ZodTypeAny = z.lazy(() => z.object({"amount": z.number().int(), "balance_transactions": z.array(balance_transaction), "charge": z.union([z.string(), charge]), "created": z.number().int(), "currency": z.string(), "enhanced_eligibility_types": z.array(z.enum(["mastercard_compliance", "visa_compelling_evidence_3", "visa_compliance"])), "evidence": dispute_evidence, "evidence_details": dispute_evidence_details, "id": z.string(), "is_charge_refundable": z.boolean(), "livemode": z.boolean(), "metadata": z.record(z.string(), z.string()), "network_reason_code": z.string().nullable().optional(), "object": z.literal("dispute"), "payment_intent": z.union([z.string(), payment_intent]).nullable(), "payment_method_details": dispute_payment_method_details.optional(), "reason": z.string(), "status": z.enum(["lost", "needs_response", "prevented", "under_review", "warning_closed", "warning_needs_response", "warning_under_review", "won"])})); +const dispute_enhanced_eligibility = z.lazy(() => z.object({"mastercard_compliance": dispute_enhanced_eligibility_mastercard_compliance.optional(), "visa_compelling_evidence_3": dispute_enhanced_eligibility_visa_compelling_evidence3.optional(), "visa_compliance": dispute_enhanced_eligibility_visa_compliance.optional()})); +const dispute_enhanced_eligibility_mastercard_compliance = z.lazy(() => z.object({"status": z.enum(["fee_acknowledged", "requires_fee_acknowledgement"])})); +const dispute_enhanced_eligibility_visa_compelling_evidence3 = z.lazy(() => z.object({"required_actions": z.array(z.enum(["missing_customer_identifiers", "missing_disputed_transaction_description", "missing_merchandise_or_services", "missing_prior_undisputed_transaction_description", "missing_prior_undisputed_transactions"])), "status": z.enum(["not_qualified", "qualified", "requires_action"])})); +const dispute_enhanced_eligibility_visa_compliance = z.lazy(() => z.object({"status": z.enum(["fee_acknowledged", "requires_fee_acknowledgement"])})); +const dispute_enhanced_evidence = z.lazy(() => z.object({"mastercard_compliance": dispute_enhanced_evidence_mastercard_compliance.optional(), "visa_compelling_evidence_3": dispute_enhanced_evidence_visa_compelling_evidence3.optional(), "visa_compliance": dispute_enhanced_evidence_visa_compliance.optional()})); +const dispute_enhanced_evidence_mastercard_compliance = z.lazy(() => z.object({"fee_acknowledged": z.boolean()})); +const dispute_enhanced_evidence_visa_compelling_evidence3 = z.lazy(() => z.object({"disputed_transaction": dispute_visa_compelling_evidence3_disputed_transaction.nullable(), "prior_undisputed_transactions": z.array(dispute_visa_compelling_evidence3_prior_undisputed_transaction)})); +const dispute_enhanced_evidence_visa_compliance = z.lazy(() => z.object({"fee_acknowledged": z.boolean()})); +const dispute_evidence = z.lazy(() => z.object({"access_activity_log": z.string().nullable(), "billing_address": z.string().nullable(), "cancellation_policy": z.union([z.string(), file]).nullable(), "cancellation_policy_disclosure": z.string().nullable(), "cancellation_rebuttal": z.string().nullable(), "customer_communication": z.union([z.string(), file]).nullable(), "customer_email_address": z.string().nullable(), "customer_name": z.string().nullable(), "customer_purchase_ip": z.string().nullable(), "customer_signature": z.union([z.string(), file]).nullable(), "duplicate_charge_documentation": z.union([z.string(), file]).nullable(), "duplicate_charge_explanation": z.string().nullable(), "duplicate_charge_id": z.string().nullable(), "enhanced_evidence": dispute_enhanced_evidence, "product_description": z.string().nullable(), "receipt": z.union([z.string(), file]).nullable(), "refund_policy": z.union([z.string(), file]).nullable(), "refund_policy_disclosure": z.string().nullable(), "refund_refusal_explanation": z.string().nullable(), "service_date": z.string().nullable(), "service_documentation": z.union([z.string(), file]).nullable(), "shipping_address": z.string().nullable(), "shipping_carrier": z.string().nullable(), "shipping_date": z.string().nullable(), "shipping_documentation": z.union([z.string(), file]).nullable(), "shipping_tracking_number": z.string().nullable(), "uncategorized_file": z.union([z.string(), file]).nullable(), "uncategorized_text": z.string().nullable()})); +const dispute_evidence_details = z.lazy(() => z.object({"due_by": z.number().int().nullable(), "enhanced_eligibility": dispute_enhanced_eligibility, "has_evidence": z.boolean(), "past_due": z.boolean(), "submission_count": z.number().int()})); +const dispute_payment_method_details = z.lazy(() => z.object({"amazon_pay": dispute_payment_method_details_amazon_pay.optional(), "card": dispute_payment_method_details_card.optional(), "klarna": dispute_payment_method_details_klarna.optional(), "paypal": dispute_payment_method_details_paypal.optional(), "type": z.enum(["amazon_pay", "card", "klarna", "paypal"])})); +const dispute_payment_method_details_amazon_pay = z.lazy(() => z.object({"dispute_type": z.enum(["chargeback", "claim"]).nullable()})); +const dispute_payment_method_details_card = z.lazy(() => z.object({"brand": z.string(), "case_type": z.enum(["block", "chargeback", "compliance", "inquiry", "resolution"]), "network_reason_code": z.string().nullable()})); +const dispute_payment_method_details_klarna = z.lazy(() => z.object({"chargeback_loss_reason_code": z.string().optional(), "reason_code": z.string().nullable()})); +const dispute_payment_method_details_paypal = z.lazy(() => z.object({"case_id": z.string().nullable(), "reason_code": z.string().nullable()})); +const dispute_transaction_shipping_address = z.lazy(() => z.object({"city": z.string().nullable(), "country": z.string().nullable(), "line1": z.string().nullable(), "line2": z.string().nullable(), "postal_code": z.string().nullable(), "state": z.string().nullable()})); +const dispute_visa_compelling_evidence3_disputed_transaction = z.lazy(() => z.object({"customer_account_id": z.string().nullable(), "customer_device_fingerprint": z.string().nullable(), "customer_device_id": z.string().nullable(), "customer_email_address": z.string().nullable(), "customer_purchase_ip": z.string().nullable(), "merchandise_or_services": z.enum(["merchandise", "services"]).nullable(), "product_description": z.string().nullable(), "shipping_address": dispute_transaction_shipping_address.nullable()})); +const dispute_visa_compelling_evidence3_prior_undisputed_transaction = z.lazy(() => z.object({"charge": z.string(), "customer_account_id": z.string().nullable(), "customer_device_fingerprint": z.string().nullable(), "customer_device_id": z.string().nullable(), "customer_email_address": z.string().nullable(), "customer_purchase_ip": z.string().nullable(), "product_description": z.string().nullable(), "shipping_address": dispute_transaction_shipping_address.nullable()})); +const email_sent = z.lazy(() => z.object({"email_sent_at": z.number().int(), "email_sent_to": z.string()})); const external_account: z.ZodTypeAny = z.lazy(() => z.union([bank_account, card])); -const external_account_requirements = z.lazy(() => z.object({"currently_due": z.array(z.string()).nullable(), "errors": z.array(account_requirements_error).nullable(), "past_due": z.array(z.string()).nullable(), "pending_verification": z.array(z.string()).nullable()}).passthrough()); -const fee = z.lazy(() => z.object({"amount": z.number().int(), "application": z.string().nullable(), "currency": z.string(), "description": z.string().nullable(), "type": z.string()}).passthrough()); -const fee_refund: z.ZodTypeAny = z.lazy(() => z.object({"amount": z.number().int(), "balance_transaction": z.union([z.string(), balance_transaction]).nullable(), "created": z.number().int(), "currency": z.string(), "fee": z.union([z.string(), application_fee]), "id": z.string(), "metadata": z.record(z.string(), z.string()).nullable(), "object": z.literal("fee_refund")}).passthrough()); -const file: z.ZodTypeAny = z.lazy(() => z.object({"created": z.number().int(), "expires_at": z.number().int().nullable(), "filename": z.string().nullable(), "id": z.string(), "links": z.object({"data": z.array(file_link), "has_more": z.boolean(), "object": z.literal("list"), "url": z.string()}).passthrough().nullable().optional(), "object": z.literal("file"), "purpose": z.enum(["account_requirement", "additional_verification", "business_icon", "business_logo", "customer_signature", "dispute_evidence", "document_provider_identity_document", "finance_report_run", "financial_account_statement", "identity_document", "identity_document_downloadable", "issuing_regulatory_reporting", "pci_document", "platform_terms_of_service", "selfie", "sigma_scheduled_query", "tax_document_user_upload", "terminal_android_apk", "terminal_reader_splashscreen", "terminal_wifi_certificate", "terminal_wifi_private_key"]), "size": z.number().int(), "title": z.string().nullable(), "type": z.string().nullable(), "url": z.string().nullable()}).passthrough()); -const file_link: z.ZodTypeAny = z.lazy(() => z.object({"created": z.number().int(), "expired": z.boolean(), "expires_at": z.number().int().nullable(), "file": z.union([z.string(), file]), "id": z.string(), "livemode": z.boolean(), "metadata": z.record(z.string(), z.string()), "object": z.literal("file_link"), "url": z.string().nullable()}).passthrough()); -const funding_instructions_bank_transfer_aba_record = z.lazy(() => z.object({"account_holder_address": address, "account_holder_name": z.string(), "account_number": z.string(), "account_type": z.string(), "bank_address": address, "bank_name": z.string(), "routing_number": z.string()}).passthrough()); -const funding_instructions_bank_transfer_financial_address = z.lazy(() => z.object({"aba": funding_instructions_bank_transfer_aba_record.optional(), "iban": funding_instructions_bank_transfer_iban_record.optional(), "sort_code": funding_instructions_bank_transfer_sort_code_record.optional(), "spei": funding_instructions_bank_transfer_spei_record.optional(), "supported_networks": z.array(z.enum(["ach", "bacs", "domestic_wire_us", "fps", "sepa", "spei", "swift", "zengin"])).optional(), "swift": funding_instructions_bank_transfer_swift_record.optional(), "type": z.enum(["aba", "iban", "sort_code", "spei", "swift", "zengin"]), "zengin": funding_instructions_bank_transfer_zengin_record.optional()}).passthrough()); -const funding_instructions_bank_transfer_iban_record = z.lazy(() => z.object({"account_holder_address": address, "account_holder_name": z.string(), "bank_address": address, "bic": z.string(), "country": z.string(), "iban": z.string()}).passthrough()); -const funding_instructions_bank_transfer_sort_code_record = z.lazy(() => z.object({"account_holder_address": address, "account_holder_name": z.string(), "account_number": z.string(), "bank_address": address, "sort_code": z.string()}).passthrough()); -const funding_instructions_bank_transfer_spei_record = z.lazy(() => z.object({"account_holder_address": address, "account_holder_name": z.string(), "bank_address": address, "bank_code": z.string(), "bank_name": z.string(), "clabe": z.string()}).passthrough()); -const funding_instructions_bank_transfer_swift_record = z.lazy(() => z.object({"account_holder_address": address, "account_holder_name": z.string(), "account_number": z.string(), "account_type": z.string(), "bank_address": address, "bank_name": z.string(), "swift_code": z.string()}).passthrough()); -const funding_instructions_bank_transfer_zengin_record = z.lazy(() => z.object({"account_holder_address": address, "account_holder_name": z.string().nullable(), "account_number": z.string().nullable(), "account_type": z.string().nullable(), "bank_address": address, "bank_code": z.string().nullable(), "bank_name": z.string().nullable(), "branch_code": z.string().nullable(), "branch_name": z.string().nullable()}).passthrough()); -const internal_card = z.lazy(() => z.object({"brand": z.string().nullable(), "country": z.string().nullable(), "exp_month": z.number().int().nullable(), "exp_year": z.number().int().nullable(), "last4": z.string().nullable()}).passthrough()); -const invoice: z.ZodTypeAny = z.lazy(() => z.object({"account_country": z.string().nullable(), "account_name": z.string().nullable(), "account_tax_ids": z.array(z.union([z.string(), tax_id, deleted_tax_id])).nullable(), "amount_due": z.number().int(), "amount_overpaid": z.number().int(), "amount_paid": z.number().int(), "amount_paid_off_stripe": z.number().int().optional(), "amount_remaining": z.number().int(), "amount_shipping": z.number().int(), "application": z.union([z.string(), application, deleted_application]).nullable(), "attempt_count": z.number().int(), "attempted": z.boolean(), "auto_advance": z.boolean().optional(), "automatic_tax": automatic_tax, "automatically_finalizes_at": z.number().int().nullable(), "billing_reason": z.enum(["automatic_pending_invoice_item_invoice", "manual", "quote_accept", "subscription", "subscription_create", "subscription_cycle", "subscription_threshold", "subscription_update", "upcoming"]).nullable(), "collection_method": z.enum(["charge_automatically", "send_invoice"]), "confirmation_secret": invoices_resource_confirmation_secret.nullable().optional(), "created": z.number().int(), "currency": z.string(), "custom_fields": z.array(invoice_setting_custom_field).nullable(), "customer": z.union([z.string(), customer, deleted_customer]).nullable(), "customer_account": z.string().nullable(), "customer_address": address.nullable(), "customer_email": z.string().nullable(), "customer_name": z.string().nullable(), "customer_phone": z.string().nullable(), "customer_shipping": shipping.nullable(), "customer_tax_exempt": z.enum(["exempt", "none", "reverse"]).nullable(), "customer_tax_ids": z.array(invoices_resource_invoice_tax_id).nullable().optional(), "default_payment_method": z.union([z.string(), payment_method]).nullable(), "default_source": z.union([z.string(), payment_source]).nullable(), "default_tax_rates": z.array(tax_rate), "description": z.string().nullable(), "discounts": z.array(z.union([z.string(), discount, deleted_discount])), "due_date": z.number().int().nullable(), "effective_at": z.number().int().nullable(), "ending_balance": z.number().int().nullable(), "footer": z.string().nullable(), "from_invoice": invoices_resource_from_invoice.nullable(), "hosted_invoice_url": z.string().nullable().optional(), "id": z.string().optional(), "invoice_pdf": z.string().nullable().optional(), "issuer": connect_account_reference, "last_finalization_error": api_errors.nullable(), "latest_revision": z.union([z.string(), invoice]).nullable(), "lines": z.object({"data": z.array(line_item), "has_more": z.boolean(), "object": z.literal("list"), "url": z.string()}).passthrough(), "livemode": z.boolean(), "metadata": z.record(z.string(), z.string()).nullable(), "next_payment_attempt": z.number().int().nullable(), "number": z.string().nullable(), "object": z.literal("invoice"), "on_behalf_of": z.union([z.string(), account]).nullable(), "parent": billing_bill_resource_invoicing_parents_invoice_parent.nullable(), "payment_settings": invoices_payment_settings, "payments": z.object({"data": z.array(invoice_payment), "has_more": z.boolean(), "object": z.literal("list"), "url": z.string()}).passthrough().optional(), "period_end": z.number().int(), "period_start": z.number().int(), "post_payment_credit_notes_amount": z.number().int(), "pre_payment_credit_notes_amount": z.number().int(), "receipt_number": z.string().nullable(), "rendering": invoices_resource_invoice_rendering.nullable(), "shipping_cost": invoices_resource_shipping_cost.nullable(), "shipping_details": shipping.nullable(), "starting_balance": z.number().int(), "statement_descriptor": z.string().nullable(), "status": z.enum(["draft", "open", "paid", "uncollectible", "void"]).nullable(), "status_transitions": invoices_resource_status_transitions, "subscription": z.union([z.string(), subscription]).nullable().optional(), "subtotal": z.number().int(), "subtotal_excluding_tax": z.number().int().nullable(), "test_clock": z.union([z.string(), test_helpers_test_clock]).nullable(), "threshold_reason": invoice_threshold_reason.optional(), "total": z.number().int(), "total_discount_amounts": z.array(discounts_resource_discount_amount).nullable(), "total_excluding_tax": z.number().int().nullable(), "total_pretax_credit_amounts": z.array(invoices_resource_pretax_credit_amount).nullable(), "total_taxes": z.array(billing_bill_resource_invoicing_taxes_tax).nullable(), "webhooks_delivered_at": z.number().int().nullable()}).passthrough()); -const invoice_installments_card = z.lazy(() => z.object({"enabled": z.boolean().nullable()}).passthrough()); -const invoice_item_threshold_reason = z.lazy(() => z.object({"line_item_ids": z.array(z.string()), "usage_gte": z.number().int()}).passthrough()); -const invoice_line_item_period = z.lazy(() => z.object({"end": z.number().int(), "start": z.number().int()}).passthrough()); -const invoice_mandate_options_card = z.lazy(() => z.object({"amount": z.number().int().nullable(), "amount_type": z.enum(["fixed", "maximum"]).nullable(), "description": z.string().nullable()}).passthrough()); -const invoice_mandate_options_payto = z.lazy(() => z.object({"amount": z.number().int().nullable(), "amount_type": z.enum(["fixed", "maximum"]).nullable(), "purpose": z.enum(["dependant_support", "government", "loan", "mortgage", "other", "pension", "personal", "retail", "salary", "tax", "utility"]).nullable()}).passthrough()); -const invoice_payment: z.ZodTypeAny = z.lazy(() => z.object({"amount_paid": z.number().int().nullable(), "amount_requested": z.number().int(), "created": z.number().int(), "currency": z.string(), "id": z.string(), "invoice": z.union([z.string(), invoice, deleted_invoice]), "is_default": z.boolean(), "livemode": z.boolean(), "object": z.literal("invoice_payment"), "payment": invoices_payments_invoice_payment_associated_payment, "status": z.string(), "status_transitions": invoices_payments_invoice_payment_status_transitions}).passthrough()); -const invoice_payment_method_options_acss_debit = z.lazy(() => z.object({"mandate_options": invoice_payment_method_options_acss_debit_mandate_options.optional(), "verification_method": z.enum(["automatic", "instant", "microdeposits"]).optional()}).passthrough()); -const invoice_payment_method_options_acss_debit_mandate_options = z.lazy(() => z.object({"transaction_type": z.enum(["business", "personal"]).nullable()}).passthrough()); -const invoice_payment_method_options_bancontact = z.lazy(() => z.object({"preferred_language": z.enum(["de", "en", "fr", "nl"])}).passthrough()); -const invoice_payment_method_options_card = z.lazy(() => z.object({"installments": invoice_installments_card.optional(), "request_three_d_secure": z.enum(["any", "automatic", "challenge"]).nullable()}).passthrough()); -const invoice_payment_method_options_customer_balance = z.lazy(() => z.object({"bank_transfer": invoice_payment_method_options_customer_balance_bank_transfer.optional(), "funding_type": z.literal("bank_transfer").nullable()}).passthrough()); -const invoice_payment_method_options_customer_balance_bank_transfer = z.lazy(() => z.object({"eu_bank_transfer": invoice_payment_method_options_customer_balance_bank_transfer_eu_bank_transfer.optional(), "type": z.string().nullable()}).passthrough()); -const invoice_payment_method_options_customer_balance_bank_transfer_eu_bank_transfer = z.lazy(() => z.object({"country": z.enum(["BE", "DE", "ES", "FR", "IE", "NL"])}).passthrough()); +const external_account_requirements = z.lazy(() => z.object({"currently_due": z.array(z.string()).nullable(), "errors": z.array(account_requirements_error).nullable(), "past_due": z.array(z.string()).nullable(), "pending_verification": z.array(z.string()).nullable()})); +const fee = z.lazy(() => z.object({"amount": z.number().int(), "application": z.string().nullable(), "currency": z.string(), "description": z.string().nullable(), "type": z.string()})); +const fee_refund: z.ZodTypeAny = z.lazy(() => z.object({"amount": z.number().int(), "balance_transaction": z.union([z.string(), balance_transaction]).nullable(), "created": z.number().int(), "currency": z.string(), "fee": z.union([z.string(), application_fee]), "id": z.string(), "metadata": z.record(z.string(), z.string()).nullable(), "object": z.literal("fee_refund")})); +const file: z.ZodTypeAny = z.lazy(() => z.object({"created": z.number().int(), "expires_at": z.number().int().nullable(), "filename": z.string().nullable(), "id": z.string(), "links": z.object({"data": z.array(file_link), "has_more": z.boolean(), "object": z.literal("list"), "url": z.string()}).nullable().optional(), "object": z.literal("file"), "purpose": z.enum(["account_requirement", "additional_verification", "business_icon", "business_logo", "customer_signature", "dispute_evidence", "document_provider_identity_document", "finance_report_run", "financial_account_statement", "identity_document", "identity_document_downloadable", "issuing_regulatory_reporting", "pci_document", "platform_terms_of_service", "selfie", "sigma_scheduled_query", "tax_document_user_upload", "terminal_android_apk", "terminal_reader_splashscreen", "terminal_wifi_certificate", "terminal_wifi_private_key"]), "size": z.number().int(), "title": z.string().nullable(), "type": z.string().nullable(), "url": z.string().nullable()})); +const file_link: z.ZodTypeAny = z.lazy(() => z.object({"created": z.number().int(), "expired": z.boolean(), "expires_at": z.number().int().nullable(), "file": z.union([z.string(), file]), "id": z.string(), "livemode": z.boolean(), "metadata": z.record(z.string(), z.string()), "object": z.literal("file_link"), "url": z.string().nullable()})); +const funding_instructions_bank_transfer_aba_record = z.lazy(() => z.object({"account_holder_address": address, "account_holder_name": z.string(), "account_number": z.string(), "account_type": z.string(), "bank_address": address, "bank_name": z.string(), "routing_number": z.string()})); +const funding_instructions_bank_transfer_financial_address = z.lazy(() => z.object({"aba": funding_instructions_bank_transfer_aba_record.optional(), "iban": funding_instructions_bank_transfer_iban_record.optional(), "sort_code": funding_instructions_bank_transfer_sort_code_record.optional(), "spei": funding_instructions_bank_transfer_spei_record.optional(), "supported_networks": z.array(z.enum(["ach", "bacs", "domestic_wire_us", "fps", "sepa", "spei", "swift", "zengin"])).optional(), "swift": funding_instructions_bank_transfer_swift_record.optional(), "type": z.enum(["aba", "iban", "sort_code", "spei", "swift", "zengin"]), "zengin": funding_instructions_bank_transfer_zengin_record.optional()})); +const funding_instructions_bank_transfer_iban_record = z.lazy(() => z.object({"account_holder_address": address, "account_holder_name": z.string(), "bank_address": address, "bic": z.string(), "country": z.string(), "iban": z.string()})); +const funding_instructions_bank_transfer_sort_code_record = z.lazy(() => z.object({"account_holder_address": address, "account_holder_name": z.string(), "account_number": z.string(), "bank_address": address, "sort_code": z.string()})); +const funding_instructions_bank_transfer_spei_record = z.lazy(() => z.object({"account_holder_address": address, "account_holder_name": z.string(), "bank_address": address, "bank_code": z.string(), "bank_name": z.string(), "clabe": z.string()})); +const funding_instructions_bank_transfer_swift_record = z.lazy(() => z.object({"account_holder_address": address, "account_holder_name": z.string(), "account_number": z.string(), "account_type": z.string(), "bank_address": address, "bank_name": z.string(), "swift_code": z.string()})); +const funding_instructions_bank_transfer_zengin_record = z.lazy(() => z.object({"account_holder_address": address, "account_holder_name": z.string().nullable(), "account_number": z.string().nullable(), "account_type": z.string().nullable(), "bank_address": address, "bank_code": z.string().nullable(), "bank_name": z.string().nullable(), "branch_code": z.string().nullable(), "branch_name": z.string().nullable()})); +const internal_card = z.lazy(() => z.object({"brand": z.string().nullable(), "country": z.string().nullable(), "exp_month": z.number().int().nullable(), "exp_year": z.number().int().nullable(), "last4": z.string().nullable()})); +const invoice: z.ZodTypeAny = z.lazy(() => z.object({"account_country": z.string().nullable(), "account_name": z.string().nullable(), "account_tax_ids": z.array(z.union([z.string(), tax_id, deleted_tax_id])).nullable(), "amount_due": z.number().int(), "amount_overpaid": z.number().int(), "amount_paid": z.number().int(), "amount_paid_off_stripe": z.number().int().optional(), "amount_remaining": z.number().int(), "amount_shipping": z.number().int(), "application": z.union([z.string(), application, deleted_application]).nullable(), "attempt_count": z.number().int(), "attempted": z.boolean(), "auto_advance": z.boolean().optional(), "automatic_tax": automatic_tax, "automatically_finalizes_at": z.number().int().nullable(), "billing_reason": z.enum(["automatic_pending_invoice_item_invoice", "manual", "quote_accept", "subscription", "subscription_create", "subscription_cycle", "subscription_threshold", "subscription_update", "upcoming"]).nullable(), "collection_method": z.enum(["charge_automatically", "send_invoice"]), "confirmation_secret": invoices_resource_confirmation_secret.nullable().optional(), "created": z.number().int(), "currency": z.string(), "custom_fields": z.array(invoice_setting_custom_field).nullable(), "customer": z.union([z.string(), customer, deleted_customer]).nullable(), "customer_account": z.string().nullable(), "customer_address": address.nullable(), "customer_email": z.string().nullable(), "customer_name": z.string().nullable(), "customer_phone": z.string().nullable(), "customer_shipping": shipping.nullable(), "customer_tax_exempt": z.enum(["exempt", "none", "reverse"]).nullable(), "customer_tax_ids": z.array(invoices_resource_invoice_tax_id).nullable().optional(), "default_payment_method": z.union([z.string(), payment_method]).nullable(), "default_source": z.union([z.string(), payment_source]).nullable(), "default_tax_rates": z.array(tax_rate), "description": z.string().nullable(), "discounts": z.array(z.union([z.string(), discount, deleted_discount])), "due_date": z.number().int().nullable(), "effective_at": z.number().int().nullable(), "ending_balance": z.number().int().nullable(), "footer": z.string().nullable(), "from_invoice": invoices_resource_from_invoice.nullable(), "hosted_invoice_url": z.string().nullable().optional(), "id": z.string().optional(), "invoice_pdf": z.string().nullable().optional(), "issuer": connect_account_reference, "last_finalization_error": api_errors.nullable(), "latest_revision": z.union([z.string(), invoice]).nullable(), "lines": z.object({"data": z.array(line_item), "has_more": z.boolean(), "object": z.literal("list"), "url": z.string()}), "livemode": z.boolean(), "metadata": z.record(z.string(), z.string()).nullable(), "next_payment_attempt": z.number().int().nullable(), "number": z.string().nullable(), "object": z.literal("invoice"), "on_behalf_of": z.union([z.string(), account]).nullable(), "parent": billing_bill_resource_invoicing_parents_invoice_parent.nullable(), "payment_settings": invoices_payment_settings, "payments": z.object({"data": z.array(invoice_payment), "has_more": z.boolean(), "object": z.literal("list"), "url": z.string()}).optional(), "period_end": z.number().int(), "period_start": z.number().int(), "post_payment_credit_notes_amount": z.number().int(), "pre_payment_credit_notes_amount": z.number().int(), "receipt_number": z.string().nullable(), "rendering": invoices_resource_invoice_rendering.nullable(), "shipping_cost": invoices_resource_shipping_cost.nullable(), "shipping_details": shipping.nullable(), "starting_balance": z.number().int(), "statement_descriptor": z.string().nullable(), "status": z.enum(["draft", "open", "paid", "uncollectible", "void"]).nullable(), "status_transitions": invoices_resource_status_transitions, "subscription": z.union([z.string(), subscription]).nullable().optional(), "subtotal": z.number().int(), "subtotal_excluding_tax": z.number().int().nullable(), "test_clock": z.union([z.string(), test_helpers_test_clock]).nullable(), "threshold_reason": invoice_threshold_reason.optional(), "total": z.number().int(), "total_discount_amounts": z.array(discounts_resource_discount_amount).nullable(), "total_excluding_tax": z.number().int().nullable(), "total_pretax_credit_amounts": z.array(invoices_resource_pretax_credit_amount).nullable(), "total_taxes": z.array(billing_bill_resource_invoicing_taxes_tax).nullable(), "webhooks_delivered_at": z.number().int().nullable()})); +const invoice_installments_card = z.lazy(() => z.object({"enabled": z.boolean().nullable()})); +const invoice_item_threshold_reason = z.lazy(() => z.object({"line_item_ids": z.array(z.string()), "usage_gte": z.number().int()})); +const invoice_line_item_period = z.lazy(() => z.object({"end": z.number().int(), "start": z.number().int()})); +const invoice_mandate_options_card = z.lazy(() => z.object({"amount": z.number().int().nullable(), "amount_type": z.enum(["fixed", "maximum"]).nullable(), "description": z.string().nullable()})); +const invoice_mandate_options_payto = z.lazy(() => z.object({"amount": z.number().int().nullable(), "amount_type": z.enum(["fixed", "maximum"]).nullable(), "purpose": z.enum(["dependant_support", "government", "loan", "mortgage", "other", "pension", "personal", "retail", "salary", "tax", "utility"]).nullable()})); +const invoice_payment: z.ZodTypeAny = z.lazy(() => z.object({"amount_paid": z.number().int().nullable(), "amount_requested": z.number().int(), "created": z.number().int(), "currency": z.string(), "id": z.string(), "invoice": z.union([z.string(), invoice, deleted_invoice]), "is_default": z.boolean(), "livemode": z.boolean(), "object": z.literal("invoice_payment"), "payment": invoices_payments_invoice_payment_associated_payment, "status": z.string(), "status_transitions": invoices_payments_invoice_payment_status_transitions})); +const invoice_payment_method_options_acss_debit = z.lazy(() => z.object({"mandate_options": invoice_payment_method_options_acss_debit_mandate_options.optional(), "verification_method": z.enum(["automatic", "instant", "microdeposits"]).optional()})); +const invoice_payment_method_options_acss_debit_mandate_options = z.lazy(() => z.object({"transaction_type": z.enum(["business", "personal"]).nullable()})); +const invoice_payment_method_options_bancontact = z.lazy(() => z.object({"preferred_language": z.enum(["de", "en", "fr", "nl"])})); +const invoice_payment_method_options_card = z.lazy(() => z.object({"installments": invoice_installments_card.optional(), "request_three_d_secure": z.enum(["any", "automatic", "challenge"]).nullable()})); +const invoice_payment_method_options_customer_balance = z.lazy(() => z.object({"bank_transfer": invoice_payment_method_options_customer_balance_bank_transfer.optional(), "funding_type": z.literal("bank_transfer").nullable()})); +const invoice_payment_method_options_customer_balance_bank_transfer = z.lazy(() => z.object({"eu_bank_transfer": invoice_payment_method_options_customer_balance_bank_transfer_eu_bank_transfer.optional(), "type": z.string().nullable()})); +const invoice_payment_method_options_customer_balance_bank_transfer_eu_bank_transfer = z.lazy(() => z.object({"country": z.enum(["BE", "DE", "ES", "FR", "IE", "NL"])})); const invoice_payment_method_options_konbini = z.lazy(() => z.record(z.string(), z.any())); -const invoice_payment_method_options_mandate_options_upi = z.lazy(() => z.object({"amount": z.number().int().nullable(), "amount_type": z.enum(["fixed", "maximum"]).nullable(), "description": z.string().nullable(), "end_date": z.number().int().nullable()}).passthrough()); -const invoice_payment_method_options_payto = z.lazy(() => z.object({"mandate_options": invoice_mandate_options_payto.optional()}).passthrough()); -const invoice_payment_method_options_pix = z.lazy(() => z.object({"amount_includes_iof": z.enum(["always", "never"]).nullable(), "expires_after_seconds": z.number().int().optional()}).passthrough()); +const invoice_payment_method_options_mandate_options_upi = z.lazy(() => z.object({"amount": z.number().int().nullable(), "amount_type": z.enum(["fixed", "maximum"]).nullable(), "description": z.string().nullable(), "end_date": z.number().int().nullable()})); +const invoice_payment_method_options_payto = z.lazy(() => z.object({"mandate_options": invoice_mandate_options_payto.optional()})); +const invoice_payment_method_options_pix = z.lazy(() => z.object({"amount_includes_iof": z.enum(["always", "never"]).nullable(), "expires_after_seconds": z.number().int().optional()})); const invoice_payment_method_options_sepa_debit = z.lazy(() => z.record(z.string(), z.any())); -const invoice_payment_method_options_upi = z.lazy(() => z.object({"mandate_options": invoice_payment_method_options_mandate_options_upi.optional()}).passthrough()); -const invoice_payment_method_options_us_bank_account = z.lazy(() => z.object({"financial_connections": invoice_payment_method_options_us_bank_account_linked_account_options.optional(), "verification_method": z.enum(["automatic", "instant", "microdeposits"]).optional()}).passthrough()); -const invoice_payment_method_options_us_bank_account_linked_account_options = z.lazy(() => z.object({"filters": invoice_payment_method_options_us_bank_account_linked_account_options_filters.optional(), "permissions": z.array(z.enum(["balances", "ownership", "payment_method", "transactions"])).optional(), "prefetch": z.array(z.enum(["balances", "ownership", "transactions"])).nullable()}).passthrough()); -const invoice_payment_method_options_us_bank_account_linked_account_options_filters = z.lazy(() => z.object({"account_subcategories": z.array(z.enum(["checking", "savings"])).optional()}).passthrough()); -const invoice_rendering_pdf = z.lazy(() => z.object({"page_size": z.enum(["a4", "auto", "letter"]).nullable()}).passthrough()); -const invoice_setting_custom_field = z.lazy(() => z.object({"name": z.string(), "value": z.string()}).passthrough()); -const invoice_setting_customer_rendering_options = z.lazy(() => z.object({"amount_tax_display": z.string().nullable(), "template": z.string().nullable()}).passthrough()); -const invoice_setting_customer_setting: z.ZodTypeAny = z.lazy(() => z.object({"custom_fields": z.array(invoice_setting_custom_field).nullable(), "default_payment_method": z.union([z.string(), payment_method]).nullable(), "footer": z.string().nullable(), "rendering_options": invoice_setting_customer_rendering_options.nullable()}).passthrough()); -const invoice_setting_subscription_schedule_phase_setting: z.ZodTypeAny = z.lazy(() => z.object({"account_tax_ids": z.array(z.union([z.string(), tax_id, deleted_tax_id])).nullable(), "days_until_due": z.number().int().nullable(), "issuer": connect_account_reference.nullable()}).passthrough()); -const invoice_setting_subscription_schedule_setting: z.ZodTypeAny = z.lazy(() => z.object({"account_tax_ids": z.array(z.union([z.string(), tax_id, deleted_tax_id])).nullable(), "days_until_due": z.number().int().nullable(), "issuer": connect_account_reference}).passthrough()); -const invoice_threshold_reason = z.lazy(() => z.object({"amount_gte": z.number().int().nullable(), "item_reasons": z.array(invoice_item_threshold_reason)}).passthrough()); -const invoices_payment_method_options = z.lazy(() => z.object({"acss_debit": invoice_payment_method_options_acss_debit.nullable(), "bancontact": invoice_payment_method_options_bancontact.nullable(), "card": invoice_payment_method_options_card.nullable(), "customer_balance": invoice_payment_method_options_customer_balance.nullable(), "konbini": invoice_payment_method_options_konbini.nullable(), "payto": invoice_payment_method_options_payto.nullable(), "pix": invoice_payment_method_options_pix.nullable(), "sepa_debit": invoice_payment_method_options_sepa_debit.nullable(), "upi": invoice_payment_method_options_upi.nullable(), "us_bank_account": invoice_payment_method_options_us_bank_account.nullable()}).passthrough()); -const invoices_payment_settings = z.lazy(() => z.object({"default_mandate": z.string().nullable(), "payment_method_options": invoices_payment_method_options.nullable(), "payment_method_types": z.array(z.enum(["ach_credit_transfer", "ach_debit", "acss_debit", "affirm", "amazon_pay", "au_becs_debit", "bacs_debit", "bancontact", "boleto", "card", "cashapp", "crypto", "custom", "customer_balance", "eps", "fpx", "giropay", "grabpay", "ideal", "jp_credit_transfer", "kakao_pay", "klarna", "konbini", "kr_card", "link", "multibanco", "naver_pay", "nz_bank_account", "p24", "pay_by_bank", "payco", "paynow", "paypal", "payto", "pix", "promptpay", "revolut_pay", "satispay", "sepa_credit_transfer", "sepa_debit", "sofort", "swish", "twint", "upi", "us_bank_account", "wechat_pay"])).nullable()}).passthrough()); -const invoices_payments_invoice_payment_associated_payment: z.ZodTypeAny = z.lazy(() => z.object({"charge": z.union([z.string(), charge]).optional(), "payment_intent": z.union([z.string(), payment_intent]).optional(), "payment_record": z.union([z.string(), payment_record]).optional(), "type": z.enum(["charge", "payment_intent", "payment_record"])}).passthrough()); -const invoices_payments_invoice_payment_status_transitions = z.lazy(() => z.object({"canceled_at": z.number().int().nullable(), "paid_at": z.number().int().nullable()}).passthrough()); -const invoices_resource_confirmation_secret = z.lazy(() => z.object({"client_secret": z.string(), "type": z.string()}).passthrough()); -const invoices_resource_from_invoice: z.ZodTypeAny = z.lazy(() => z.object({"action": z.string(), "invoice": z.union([z.string(), invoice])}).passthrough()); -const invoices_resource_invoice_rendering = z.lazy(() => z.object({"amount_tax_display": z.string().nullable(), "pdf": invoice_rendering_pdf.nullable(), "template": z.string().nullable(), "template_version": z.number().int().nullable()}).passthrough()); -const invoices_resource_invoice_tax_id = z.lazy(() => z.object({"type": z.enum(["ad_nrt", "ae_trn", "al_tin", "am_tin", "ao_tin", "ar_cuit", "au_abn", "au_arn", "aw_tin", "az_tin", "ba_tin", "bb_tin", "bd_bin", "bf_ifu", "bg_uic", "bh_vat", "bj_ifu", "bo_tin", "br_cnpj", "br_cpf", "bs_tin", "by_tin", "ca_bn", "ca_gst_hst", "ca_pst_bc", "ca_pst_mb", "ca_pst_sk", "ca_qst", "cd_nif", "ch_uid", "ch_vat", "cl_tin", "cm_niu", "cn_tin", "co_nit", "cr_tin", "cv_nif", "de_stn", "do_rcn", "ec_ruc", "eg_tin", "es_cif", "et_tin", "eu_oss_vat", "eu_vat", "fo_vat", "gb_vat", "ge_vat", "gi_tin", "gn_nif", "hk_br", "hr_oib", "hu_tin", "id_npwp", "il_vat", "in_gst", "is_vat", "it_cf", "jp_cn", "jp_rn", "jp_trn", "ke_pin", "kg_tin", "kh_tin", "kr_brn", "kz_bin", "la_tin", "li_uid", "li_vat", "lk_vat", "ma_vat", "md_vat", "me_pib", "mk_vat", "mr_nif", "mx_rfc", "my_frp", "my_itn", "my_sst", "ng_tin", "no_vat", "no_voec", "np_pan", "nz_gst", "om_vat", "pe_ruc", "ph_tin", "pl_nip", "py_ruc", "ro_tin", "rs_pib", "ru_inn", "ru_kpp", "sa_vat", "sg_gst", "sg_uen", "si_tin", "sn_ninea", "sr_fin", "sv_nit", "th_vat", "tj_tin", "tr_tin", "tw_vat", "tz_vat", "ua_vat", "ug_tin", "unknown", "us_ein", "uy_ruc", "uz_tin", "uz_vat", "ve_rif", "vn_tin", "za_vat", "zm_tin", "zw_tin"]), "value": z.string().nullable()}).passthrough()); -const invoices_resource_pretax_credit_amount: z.ZodTypeAny = z.lazy(() => z.object({"amount": z.number().int(), "credit_balance_transaction": z.union([z.string(), billing_credit_balance_transaction]).nullable().optional(), "discount": z.union([z.string(), discount, deleted_discount]).optional(), "type": z.enum(["credit_balance_transaction", "discount"])}).passthrough()); -const invoices_resource_shipping_cost = z.lazy(() => z.object({"amount_subtotal": z.number().int(), "amount_tax": z.number().int(), "amount_total": z.number().int(), "shipping_rate": z.union([z.string(), shipping_rate]).nullable(), "taxes": z.array(line_items_tax_amount).optional()}).passthrough()); -const invoices_resource_status_transitions = z.lazy(() => z.object({"finalized_at": z.number().int().nullable(), "marked_uncollectible_at": z.number().int().nullable(), "paid_at": z.number().int().nullable(), "voided_at": z.number().int().nullable()}).passthrough()); -const issuing_authorization: z.ZodTypeAny = z.lazy(() => z.object({"amount": z.number().int(), "amount_details": issuing_authorization_amount_details.nullable(), "approved": z.boolean(), "authorization_method": z.enum(["chip", "contactless", "keyed_in", "online", "swipe"]), "balance_transactions": z.array(balance_transaction), "card": issuing_card, "card_presence": z.enum(["not_present", "present"]).nullable(), "cardholder": z.union([z.string(), issuing_cardholder]).nullable(), "created": z.number().int(), "currency": z.string(), "fleet": issuing_authorization_fleet_data.nullable(), "fraud_challenges": z.array(issuing_authorization_fraud_challenge).nullable().optional(), "fuel": issuing_authorization_fuel_data.nullable(), "id": z.string(), "livemode": z.boolean(), "merchant_amount": z.number().int(), "merchant_currency": z.string(), "merchant_data": issuing_authorization_merchant_data, "metadata": z.record(z.string(), z.string()), "network_data": issuing_authorization_network_data.nullable(), "object": z.literal("issuing.authorization"), "pending_request": issuing_authorization_pending_request.nullable(), "request_history": z.array(issuing_authorization_request), "status": z.enum(["closed", "expired", "pending", "reversed"]), "token": z.union([z.string(), issuing_token]).nullable().optional(), "transactions": z.array(issuing_transaction), "treasury": issuing_authorization_treasury.nullable().optional(), "verification_data": issuing_authorization_verification_data, "verified_by_fraud_challenge": z.boolean().nullable(), "wallet": z.string().nullable()}).passthrough()); -const issuing_card: z.ZodTypeAny = z.lazy(() => z.object({"brand": z.string(), "cancellation_reason": z.enum(["design_rejected", "fulfillment_error", "lost", "stolen"]).nullable(), "cardholder": issuing_cardholder, "created": z.number().int(), "currency": z.string(), "cvc": z.string().optional(), "exp_month": z.number().int(), "exp_year": z.number().int(), "financial_account": z.string().nullable().optional(), "id": z.string(), "last4": z.string(), "latest_fraud_warning": issuing_card_fraud_warning.nullable(), "lifecycle_controls": issuing_card_lifecycle_controls.nullable(), "livemode": z.boolean(), "metadata": z.record(z.string(), z.string()), "number": z.string().optional(), "object": z.literal("issuing.card"), "personalization_design": z.union([z.string(), issuing_personalization_design]).nullable(), "replaced_by": z.union([z.string(), issuing_card]).nullable(), "replacement_for": z.union([z.string(), issuing_card]).nullable(), "replacement_reason": z.enum(["damaged", "expired", "fulfillment_error", "lost", "stolen"]).nullable(), "second_line": z.string().nullable(), "shipping": issuing_card_shipping.nullable(), "spending_controls": issuing_card_authorization_controls, "status": z.enum(["active", "canceled", "inactive"]), "type": z.enum(["physical", "virtual"]), "wallets": issuing_card_wallets.nullable()}).passthrough()); -const issuing_cardholder = z.lazy(() => z.object({"billing": issuing_cardholder_address, "company": issuing_cardholder_company.nullable(), "created": z.number().int(), "email": z.string().nullable(), "id": z.string(), "individual": issuing_cardholder_individual.nullable(), "livemode": z.boolean(), "metadata": z.record(z.string(), z.string()), "name": z.string(), "object": z.literal("issuing.cardholder"), "phone_number": z.string().nullable(), "preferred_locales": z.array(z.enum(["de", "en", "es", "fr", "it"])).nullable(), "requirements": issuing_cardholder_requirements, "spending_controls": issuing_cardholder_authorization_controls.nullable(), "status": z.enum(["active", "blocked", "inactive"]), "type": z.enum(["company", "individual"])}).passthrough()); -const issuing_dispute: z.ZodTypeAny = z.lazy(() => z.object({"amount": z.number().int(), "balance_transactions": z.array(balance_transaction).nullable().optional(), "created": z.number().int(), "currency": z.string(), "evidence": issuing_dispute_evidence, "id": z.string(), "livemode": z.boolean(), "loss_reason": z.enum(["cardholder_authentication_issuer_liability", "eci5_token_transaction_with_tavv", "excess_disputes_in_timeframe", "has_not_met_the_minimum_dispute_amount_requirements", "invalid_duplicate_dispute", "invalid_incorrect_amount_dispute", "invalid_no_authorization", "invalid_use_of_disputes", "merchandise_delivered_or_shipped", "merchandise_or_service_as_described", "not_cancelled", "other", "refund_issued", "submitted_beyond_allowable_time_limit", "transaction_3ds_required", "transaction_approved_after_prior_fraud_dispute", "transaction_authorized", "transaction_electronically_read", "transaction_qualifies_for_visa_easy_payment_service", "transaction_unattended"]).optional(), "metadata": z.record(z.string(), z.string()), "object": z.literal("issuing.dispute"), "status": z.enum(["expired", "lost", "submitted", "unsubmitted", "won"]), "transaction": z.union([z.string(), issuing_transaction]), "treasury": issuing_dispute_treasury.nullable().optional()}).passthrough()); -const issuing_personalization_design = z.lazy(() => z.object({"card_logo": z.union([z.string(), file]).nullable(), "carrier_text": issuing_personalization_design_carrier_text.nullable(), "created": z.number().int(), "id": z.string(), "livemode": z.boolean(), "lookup_key": z.string().nullable(), "metadata": z.record(z.string(), z.string()), "name": z.string().nullable(), "object": z.literal("issuing.personalization_design"), "physical_bundle": z.union([z.string(), issuing_physical_bundle]), "preferences": issuing_personalization_design_preferences, "rejection_reasons": issuing_personalization_design_rejection_reasons, "status": z.enum(["active", "inactive", "rejected", "review"])}).passthrough()); -const issuing_physical_bundle = z.lazy(() => z.object({"features": issuing_physical_bundle_features, "id": z.string(), "livemode": z.boolean(), "name": z.string(), "object": z.literal("issuing.physical_bundle"), "status": z.enum(["active", "inactive", "review"]), "type": z.enum(["custom", "standard"])}).passthrough()); -const issuing_token = z.lazy(() => z.object({"card": z.union([z.string(), issuing_card]), "created": z.number().int(), "device_fingerprint": z.string().nullable(), "id": z.string(), "last4": z.string().optional(), "livemode": z.boolean(), "network": z.enum(["mastercard", "visa"]), "network_data": issuing_network_token_network_data.optional(), "network_updated_at": z.number().int(), "object": z.literal("issuing.token"), "status": z.enum(["active", "deleted", "requested", "suspended"]), "wallet_provider": z.enum(["apple_pay", "google_pay", "samsung_pay"]).optional()}).passthrough()); -const issuing_transaction: z.ZodTypeAny = z.lazy(() => z.object({"amount": z.number().int(), "amount_details": issuing_transaction_amount_details.nullable(), "authorization": z.union([z.string(), issuing_authorization]).nullable(), "balance_transaction": z.union([z.string(), balance_transaction]).nullable(), "card": z.union([z.string(), issuing_card]), "cardholder": z.union([z.string(), issuing_cardholder]).nullable(), "created": z.number().int(), "currency": z.string(), "dispute": z.union([z.string(), issuing_dispute]).nullable(), "id": z.string(), "livemode": z.boolean(), "merchant_amount": z.number().int(), "merchant_currency": z.string(), "merchant_data": issuing_authorization_merchant_data, "metadata": z.record(z.string(), z.string()), "network_data": issuing_transaction_network_data.nullable(), "object": z.literal("issuing.transaction"), "purchase_details": issuing_transaction_purchase_details.nullable().optional(), "token": z.union([z.string(), issuing_token]).nullable().optional(), "treasury": issuing_transaction_treasury.nullable().optional(), "type": z.enum(["capture", "refund"]), "wallet": z.enum(["apple_pay", "google_pay", "samsung_pay"]).nullable()}).passthrough()); -const issuing_authorization_amount_details = z.lazy(() => z.object({"atm_fee": z.number().int().nullable(), "cashback_amount": z.number().int().nullable()}).passthrough()); -const issuing_authorization_authentication_exemption = z.lazy(() => z.object({"claimed_by": z.enum(["acquirer", "issuer"]), "type": z.enum(["low_value_transaction", "transaction_risk_analysis", "unknown"])}).passthrough()); -const issuing_authorization_fleet_cardholder_prompt_data = z.lazy(() => z.object({"alphanumeric_id": z.string().nullable(), "driver_id": z.string().nullable(), "odometer": z.number().int().nullable(), "unspecified_id": z.string().nullable(), "user_id": z.string().nullable(), "vehicle_number": z.string().nullable()}).passthrough()); -const issuing_authorization_fleet_data = z.lazy(() => z.object({"cardholder_prompt_data": issuing_authorization_fleet_cardholder_prompt_data.nullable(), "purchase_type": z.enum(["fuel_and_non_fuel_purchase", "fuel_purchase", "non_fuel_purchase"]).nullable(), "reported_breakdown": issuing_authorization_fleet_reported_breakdown.nullable(), "service_type": z.enum(["full_service", "non_fuel_transaction", "self_service"]).nullable()}).passthrough()); -const issuing_authorization_fleet_fuel_price_data = z.lazy(() => z.object({"gross_amount_decimal": z.string().nullable()}).passthrough()); -const issuing_authorization_fleet_non_fuel_price_data = z.lazy(() => z.object({"gross_amount_decimal": z.string().nullable()}).passthrough()); -const issuing_authorization_fleet_reported_breakdown = z.lazy(() => z.object({"fuel": issuing_authorization_fleet_fuel_price_data.nullable(), "non_fuel": issuing_authorization_fleet_non_fuel_price_data.nullable(), "tax": issuing_authorization_fleet_tax_data.nullable()}).passthrough()); -const issuing_authorization_fleet_tax_data = z.lazy(() => z.object({"local_amount_decimal": z.string().nullable(), "national_amount_decimal": z.string().nullable()}).passthrough()); -const issuing_authorization_fraud_challenge = z.lazy(() => z.object({"channel": z.literal("sms"), "status": z.enum(["expired", "pending", "rejected", "undeliverable", "verified"]), "undeliverable_reason": z.enum(["no_phone_number", "unsupported_phone_number"]).nullable()}).passthrough()); -const issuing_authorization_fuel_data = z.lazy(() => z.object({"industry_product_code": z.string().nullable(), "quantity_decimal": z.string().nullable(), "type": z.enum(["diesel", "other", "unleaded_plus", "unleaded_regular", "unleaded_super"]).nullable(), "unit": z.enum(["charging_minute", "imperial_gallon", "kilogram", "kilowatt_hour", "liter", "other", "pound", "us_gallon"]).nullable(), "unit_cost_decimal": z.string().nullable()}).passthrough()); -const issuing_authorization_merchant_data = z.lazy(() => z.object({"category": z.string(), "category_code": z.string(), "city": z.string().nullable(), "country": z.string().nullable(), "name": z.string().nullable(), "network_id": z.string(), "postal_code": z.string().nullable(), "state": z.string().nullable(), "tax_id": z.string().nullable(), "terminal_id": z.string().nullable(), "url": z.string().nullable()}).passthrough()); -const issuing_authorization_network_data = z.lazy(() => z.object({"acquiring_institution_id": z.string().nullable(), "system_trace_audit_number": z.string().nullable(), "transaction_id": z.string().nullable()}).passthrough()); -const issuing_authorization_pending_request = z.lazy(() => z.object({"amount": z.number().int(), "amount_details": issuing_authorization_amount_details.nullable(), "currency": z.string(), "is_amount_controllable": z.boolean(), "merchant_amount": z.number().int(), "merchant_currency": z.string(), "network_risk_score": z.number().int().nullable()}).passthrough()); -const issuing_authorization_request = z.lazy(() => z.object({"amount": z.number().int(), "amount_details": issuing_authorization_amount_details.nullable(), "approved": z.boolean(), "authorization_code": z.string().nullable(), "created": z.number().int(), "currency": z.string(), "merchant_amount": z.number().int(), "merchant_currency": z.string(), "network_risk_score": z.number().int().nullable(), "reason": z.enum(["account_disabled", "card_active", "card_canceled", "card_expired", "card_inactive", "cardholder_blocked", "cardholder_inactive", "cardholder_verification_required", "insecure_authorization_method", "insufficient_funds", "network_fallback", "not_allowed", "pin_blocked", "spending_controls", "suspected_fraud", "verification_failed", "webhook_approved", "webhook_declined", "webhook_error", "webhook_timeout"]), "reason_message": z.string().nullable(), "requested_at": z.number().int().nullable()}).passthrough()); -const issuing_authorization_three_d_secure = z.lazy(() => z.object({"result": z.enum(["attempt_acknowledged", "authenticated", "failed", "required"])}).passthrough()); -const issuing_authorization_treasury = z.lazy(() => z.object({"received_credits": z.array(z.string()), "received_debits": z.array(z.string()), "transaction": z.string().nullable()}).passthrough()); -const issuing_authorization_verification_data = z.lazy(() => z.object({"address_line1_check": z.enum(["match", "mismatch", "not_provided"]), "address_postal_code_check": z.enum(["match", "mismatch", "not_provided"]), "authentication_exemption": issuing_authorization_authentication_exemption.nullable(), "cvc_check": z.enum(["match", "mismatch", "not_provided"]), "expiry_check": z.enum(["match", "mismatch", "not_provided"]), "postal_code": z.string().nullable(), "three_d_secure": issuing_authorization_three_d_secure.nullable()}).passthrough()); -const issuing_card_apple_pay = z.lazy(() => z.object({"eligible": z.boolean(), "ineligible_reason": z.enum(["missing_agreement", "missing_cardholder_contact", "unsupported_region"]).nullable()}).passthrough()); -const issuing_card_authorization_controls = z.lazy(() => z.object({"allowed_card_presences": z.array(z.enum(["not_present", "present"])).nullable(), "allowed_categories": z.array(z.enum(["ac_refrigeration_repair", "accounting_bookkeeping_services", "advertising_services", "agricultural_cooperative", "airlines_air_carriers", "airports_flying_fields", "ambulance_services", "amusement_parks_carnivals", "antique_reproductions", "antique_shops", "aquariums", "architectural_surveying_services", "art_dealers_and_galleries", "artists_supply_and_craft_shops", "auto_and_home_supply_stores", "auto_body_repair_shops", "auto_paint_shops", "auto_service_shops", "automated_cash_disburse", "automated_fuel_dispensers", "automobile_associations", "automotive_parts_and_accessories_stores", "automotive_tire_stores", "bail_and_bond_payments", "bakeries", "bands_orchestras", "barber_and_beauty_shops", "betting_casino_gambling", "bicycle_shops", "billiard_pool_establishments", "boat_dealers", "boat_rentals_and_leases", "book_stores", "books_periodicals_and_newspapers", "bowling_alleys", "bus_lines", "business_secretarial_schools", "buying_shopping_services", "cable_satellite_and_other_pay_television_and_radio", "camera_and_photographic_supply_stores", "candy_nut_and_confectionery_stores", "car_and_truck_dealers_new_used", "car_and_truck_dealers_used_only", "car_rental_agencies", "car_washes", "carpentry_services", "carpet_upholstery_cleaning", "caterers", "charitable_and_social_service_organizations_fundraising", "chemicals_and_allied_products", "child_care_services", "childrens_and_infants_wear_stores", "chiropodists_podiatrists", "chiropractors", "cigar_stores_and_stands", "civic_social_fraternal_associations", "cleaning_and_maintenance", "clothing_rental", "colleges_universities", "commercial_equipment", "commercial_footwear", "commercial_photography_art_and_graphics", "commuter_transport_and_ferries", "computer_network_services", "computer_programming", "computer_repair", "computer_software_stores", "computers_peripherals_and_software", "concrete_work_services", "construction_materials", "consulting_public_relations", "correspondence_schools", "cosmetic_stores", "counseling_services", "country_clubs", "courier_services", "court_costs", "credit_reporting_agencies", "cruise_lines", "dairy_products_stores", "dance_hall_studios_schools", "dating_escort_services", "dentists_orthodontists", "department_stores", "detective_agencies", "digital_goods_applications", "digital_goods_games", "digital_goods_large_volume", "digital_goods_media", "direct_marketing_catalog_merchant", "direct_marketing_combination_catalog_and_retail_merchant", "direct_marketing_inbound_telemarketing", "direct_marketing_insurance_services", "direct_marketing_other", "direct_marketing_outbound_telemarketing", "direct_marketing_subscription", "direct_marketing_travel", "discount_stores", "doctors", "door_to_door_sales", "drapery_window_covering_and_upholstery_stores", "drinking_places", "drug_stores_and_pharmacies", "drugs_drug_proprietaries_and_druggist_sundries", "dry_cleaners", "durable_goods", "duty_free_stores", "eating_places_restaurants", "educational_services", "electric_razor_stores", "electric_vehicle_charging", "electrical_parts_and_equipment", "electrical_services", "electronics_repair_shops", "electronics_stores", "elementary_secondary_schools", "emergency_services_gcas_visa_use_only", "employment_temp_agencies", "equipment_rental", "exterminating_services", "family_clothing_stores", "fast_food_restaurants", "financial_institutions", "fines_government_administrative_entities", "fireplace_fireplace_screens_and_accessories_stores", "floor_covering_stores", "florists", "florists_supplies_nursery_stock_and_flowers", "freezer_and_locker_meat_provisioners", "fuel_dealers_non_automotive", "funeral_services_crematories", "furniture_home_furnishings_and_equipment_stores_except_appliances", "furniture_repair_refinishing", "furriers_and_fur_shops", "general_services", "gift_card_novelty_and_souvenir_shops", "glass_paint_and_wallpaper_stores", "glassware_crystal_stores", "golf_courses_public", "government_licensed_horse_dog_racing_us_region_only", "government_licensed_online_casions_online_gambling_us_region_only", "government_owned_lotteries_non_us_region", "government_owned_lotteries_us_region_only", "government_services", "grocery_stores_supermarkets", "hardware_equipment_and_supplies", "hardware_stores", "health_and_beauty_spas", "hearing_aids_sales_and_supplies", "heating_plumbing_a_c", "hobby_toy_and_game_shops", "home_supply_warehouse_stores", "hospitals", "hotels_motels_and_resorts", "household_appliance_stores", "industrial_supplies", "information_retrieval_services", "insurance_default", "insurance_underwriting_premiums", "intra_company_purchases", "jewelry_stores_watches_clocks_and_silverware_stores", "landscaping_services", "laundries", "laundry_cleaning_services", "legal_services_attorneys", "luggage_and_leather_goods_stores", "lumber_building_materials_stores", "manual_cash_disburse", "marinas_service_and_supplies", "marketplaces", "masonry_stonework_and_plaster", "massage_parlors", "medical_and_dental_labs", "medical_dental_ophthalmic_and_hospital_equipment_and_supplies", "medical_services", "membership_organizations", "mens_and_boys_clothing_and_accessories_stores", "mens_womens_clothing_stores", "metal_service_centers", "miscellaneous", "miscellaneous_apparel_and_accessory_shops", "miscellaneous_auto_dealers", "miscellaneous_business_services", "miscellaneous_food_stores", "miscellaneous_general_merchandise", "miscellaneous_general_services", "miscellaneous_home_furnishing_specialty_stores", "miscellaneous_publishing_and_printing", "miscellaneous_recreation_services", "miscellaneous_repair_shops", "miscellaneous_specialty_retail", "mobile_home_dealers", "motion_picture_theaters", "motor_freight_carriers_and_trucking", "motor_homes_dealers", "motor_vehicle_supplies_and_new_parts", "motorcycle_shops_and_dealers", "motorcycle_shops_dealers", "music_stores_musical_instruments_pianos_and_sheet_music", "news_dealers_and_newsstands", "non_fi_money_orders", "non_fi_stored_value_card_purchase_load", "nondurable_goods", "nurseries_lawn_and_garden_supply_stores", "nursing_personal_care", "office_and_commercial_furniture", "opticians_eyeglasses", "optometrists_ophthalmologist", "orthopedic_goods_prosthetic_devices", "osteopaths", "package_stores_beer_wine_and_liquor", "paints_varnishes_and_supplies", "parking_lots_garages", "passenger_railways", "pawn_shops", "pet_shops_pet_food_and_supplies", "petroleum_and_petroleum_products", "photo_developing", "photographic_photocopy_microfilm_equipment_and_supplies", "photographic_studios", "picture_video_production", "piece_goods_notions_and_other_dry_goods", "plumbing_heating_equipment_and_supplies", "political_organizations", "postal_services_government_only", "precious_stones_and_metals_watches_and_jewelry", "professional_services", "public_warehousing_and_storage", "quick_copy_repro_and_blueprint", "railroads", "real_estate_agents_and_managers_rentals", "record_stores", "recreational_vehicle_rentals", "religious_goods_stores", "religious_organizations", "roofing_siding_sheet_metal", "secretarial_support_services", "security_brokers_dealers", "service_stations", "sewing_needlework_fabric_and_piece_goods_stores", "shoe_repair_hat_cleaning", "shoe_stores", "small_appliance_repair", "snowmobile_dealers", "special_trade_services", "specialty_cleaning", "sporting_goods_stores", "sporting_recreation_camps", "sports_and_riding_apparel_stores", "sports_clubs_fields", "stamp_and_coin_stores", "stationary_office_supplies_printing_and_writing_paper", "stationery_stores_office_and_school_supply_stores", "swimming_pools_sales", "t_ui_travel_germany", "tailors_alterations", "tax_payments_government_agencies", "tax_preparation_services", "taxicabs_limousines", "telecommunication_equipment_and_telephone_sales", "telecommunication_services", "telegraph_services", "tent_and_awning_shops", "testing_laboratories", "theatrical_ticket_agencies", "timeshares", "tire_retreading_and_repair", "tolls_bridge_fees", "tourist_attractions_and_exhibits", "towing_services", "trailer_parks_campgrounds", "transportation_services", "travel_agencies_tour_operators", "truck_stop_iteration", "truck_utility_trailer_rentals", "typesetting_plate_making_and_related_services", "typewriter_stores", "u_s_federal_government_agencies_or_departments", "uniforms_commercial_clothing", "used_merchandise_and_secondhand_stores", "utilities", "variety_stores", "veterinary_services", "video_amusement_game_supplies", "video_game_arcades", "video_tape_rental_stores", "vocational_trade_schools", "watch_jewelry_repair", "welding_repair", "wholesale_clubs", "wig_and_toupee_stores", "wires_money_orders", "womens_accessory_and_specialty_shops", "womens_ready_to_wear_stores", "wrecking_and_salvage_yards"])).nullable(), "allowed_merchant_countries": z.array(z.string()).nullable(), "blocked_card_presences": z.array(z.enum(["not_present", "present"])).nullable(), "blocked_categories": z.array(z.enum(["ac_refrigeration_repair", "accounting_bookkeeping_services", "advertising_services", "agricultural_cooperative", "airlines_air_carriers", "airports_flying_fields", "ambulance_services", "amusement_parks_carnivals", "antique_reproductions", "antique_shops", "aquariums", "architectural_surveying_services", "art_dealers_and_galleries", "artists_supply_and_craft_shops", "auto_and_home_supply_stores", "auto_body_repair_shops", "auto_paint_shops", "auto_service_shops", "automated_cash_disburse", "automated_fuel_dispensers", "automobile_associations", "automotive_parts_and_accessories_stores", "automotive_tire_stores", "bail_and_bond_payments", "bakeries", "bands_orchestras", "barber_and_beauty_shops", "betting_casino_gambling", "bicycle_shops", "billiard_pool_establishments", "boat_dealers", "boat_rentals_and_leases", "book_stores", "books_periodicals_and_newspapers", "bowling_alleys", "bus_lines", "business_secretarial_schools", "buying_shopping_services", "cable_satellite_and_other_pay_television_and_radio", "camera_and_photographic_supply_stores", "candy_nut_and_confectionery_stores", "car_and_truck_dealers_new_used", "car_and_truck_dealers_used_only", "car_rental_agencies", "car_washes", "carpentry_services", "carpet_upholstery_cleaning", "caterers", "charitable_and_social_service_organizations_fundraising", "chemicals_and_allied_products", "child_care_services", "childrens_and_infants_wear_stores", "chiropodists_podiatrists", "chiropractors", "cigar_stores_and_stands", "civic_social_fraternal_associations", "cleaning_and_maintenance", "clothing_rental", "colleges_universities", "commercial_equipment", "commercial_footwear", "commercial_photography_art_and_graphics", "commuter_transport_and_ferries", "computer_network_services", "computer_programming", "computer_repair", "computer_software_stores", "computers_peripherals_and_software", "concrete_work_services", "construction_materials", "consulting_public_relations", "correspondence_schools", "cosmetic_stores", "counseling_services", "country_clubs", "courier_services", "court_costs", "credit_reporting_agencies", "cruise_lines", "dairy_products_stores", "dance_hall_studios_schools", "dating_escort_services", "dentists_orthodontists", "department_stores", "detective_agencies", "digital_goods_applications", "digital_goods_games", "digital_goods_large_volume", "digital_goods_media", "direct_marketing_catalog_merchant", "direct_marketing_combination_catalog_and_retail_merchant", "direct_marketing_inbound_telemarketing", "direct_marketing_insurance_services", "direct_marketing_other", "direct_marketing_outbound_telemarketing", "direct_marketing_subscription", "direct_marketing_travel", "discount_stores", "doctors", "door_to_door_sales", "drapery_window_covering_and_upholstery_stores", "drinking_places", "drug_stores_and_pharmacies", "drugs_drug_proprietaries_and_druggist_sundries", "dry_cleaners", "durable_goods", "duty_free_stores", "eating_places_restaurants", "educational_services", "electric_razor_stores", "electric_vehicle_charging", "electrical_parts_and_equipment", "electrical_services", "electronics_repair_shops", "electronics_stores", "elementary_secondary_schools", "emergency_services_gcas_visa_use_only", "employment_temp_agencies", "equipment_rental", "exterminating_services", "family_clothing_stores", "fast_food_restaurants", "financial_institutions", "fines_government_administrative_entities", "fireplace_fireplace_screens_and_accessories_stores", "floor_covering_stores", "florists", "florists_supplies_nursery_stock_and_flowers", "freezer_and_locker_meat_provisioners", "fuel_dealers_non_automotive", "funeral_services_crematories", "furniture_home_furnishings_and_equipment_stores_except_appliances", "furniture_repair_refinishing", "furriers_and_fur_shops", "general_services", "gift_card_novelty_and_souvenir_shops", "glass_paint_and_wallpaper_stores", "glassware_crystal_stores", "golf_courses_public", "government_licensed_horse_dog_racing_us_region_only", "government_licensed_online_casions_online_gambling_us_region_only", "government_owned_lotteries_non_us_region", "government_owned_lotteries_us_region_only", "government_services", "grocery_stores_supermarkets", "hardware_equipment_and_supplies", "hardware_stores", "health_and_beauty_spas", "hearing_aids_sales_and_supplies", "heating_plumbing_a_c", "hobby_toy_and_game_shops", "home_supply_warehouse_stores", "hospitals", "hotels_motels_and_resorts", "household_appliance_stores", "industrial_supplies", "information_retrieval_services", "insurance_default", "insurance_underwriting_premiums", "intra_company_purchases", "jewelry_stores_watches_clocks_and_silverware_stores", "landscaping_services", "laundries", "laundry_cleaning_services", "legal_services_attorneys", "luggage_and_leather_goods_stores", "lumber_building_materials_stores", "manual_cash_disburse", "marinas_service_and_supplies", "marketplaces", "masonry_stonework_and_plaster", "massage_parlors", "medical_and_dental_labs", "medical_dental_ophthalmic_and_hospital_equipment_and_supplies", "medical_services", "membership_organizations", "mens_and_boys_clothing_and_accessories_stores", "mens_womens_clothing_stores", "metal_service_centers", "miscellaneous", "miscellaneous_apparel_and_accessory_shops", "miscellaneous_auto_dealers", "miscellaneous_business_services", "miscellaneous_food_stores", "miscellaneous_general_merchandise", "miscellaneous_general_services", "miscellaneous_home_furnishing_specialty_stores", "miscellaneous_publishing_and_printing", "miscellaneous_recreation_services", "miscellaneous_repair_shops", "miscellaneous_specialty_retail", "mobile_home_dealers", "motion_picture_theaters", "motor_freight_carriers_and_trucking", "motor_homes_dealers", "motor_vehicle_supplies_and_new_parts", "motorcycle_shops_and_dealers", "motorcycle_shops_dealers", "music_stores_musical_instruments_pianos_and_sheet_music", "news_dealers_and_newsstands", "non_fi_money_orders", "non_fi_stored_value_card_purchase_load", "nondurable_goods", "nurseries_lawn_and_garden_supply_stores", "nursing_personal_care", "office_and_commercial_furniture", "opticians_eyeglasses", "optometrists_ophthalmologist", "orthopedic_goods_prosthetic_devices", "osteopaths", "package_stores_beer_wine_and_liquor", "paints_varnishes_and_supplies", "parking_lots_garages", "passenger_railways", "pawn_shops", "pet_shops_pet_food_and_supplies", "petroleum_and_petroleum_products", "photo_developing", "photographic_photocopy_microfilm_equipment_and_supplies", "photographic_studios", "picture_video_production", "piece_goods_notions_and_other_dry_goods", "plumbing_heating_equipment_and_supplies", "political_organizations", "postal_services_government_only", "precious_stones_and_metals_watches_and_jewelry", "professional_services", "public_warehousing_and_storage", "quick_copy_repro_and_blueprint", "railroads", "real_estate_agents_and_managers_rentals", "record_stores", "recreational_vehicle_rentals", "religious_goods_stores", "religious_organizations", "roofing_siding_sheet_metal", "secretarial_support_services", "security_brokers_dealers", "service_stations", "sewing_needlework_fabric_and_piece_goods_stores", "shoe_repair_hat_cleaning", "shoe_stores", "small_appliance_repair", "snowmobile_dealers", "special_trade_services", "specialty_cleaning", "sporting_goods_stores", "sporting_recreation_camps", "sports_and_riding_apparel_stores", "sports_clubs_fields", "stamp_and_coin_stores", "stationary_office_supplies_printing_and_writing_paper", "stationery_stores_office_and_school_supply_stores", "swimming_pools_sales", "t_ui_travel_germany", "tailors_alterations", "tax_payments_government_agencies", "tax_preparation_services", "taxicabs_limousines", "telecommunication_equipment_and_telephone_sales", "telecommunication_services", "telegraph_services", "tent_and_awning_shops", "testing_laboratories", "theatrical_ticket_agencies", "timeshares", "tire_retreading_and_repair", "tolls_bridge_fees", "tourist_attractions_and_exhibits", "towing_services", "trailer_parks_campgrounds", "transportation_services", "travel_agencies_tour_operators", "truck_stop_iteration", "truck_utility_trailer_rentals", "typesetting_plate_making_and_related_services", "typewriter_stores", "u_s_federal_government_agencies_or_departments", "uniforms_commercial_clothing", "used_merchandise_and_secondhand_stores", "utilities", "variety_stores", "veterinary_services", "video_amusement_game_supplies", "video_game_arcades", "video_tape_rental_stores", "vocational_trade_schools", "watch_jewelry_repair", "welding_repair", "wholesale_clubs", "wig_and_toupee_stores", "wires_money_orders", "womens_accessory_and_specialty_shops", "womens_ready_to_wear_stores", "wrecking_and_salvage_yards"])).nullable(), "blocked_merchant_countries": z.array(z.string()).nullable(), "spending_limits": z.array(issuing_card_spending_limit).nullable(), "spending_limits_currency": z.string().nullable()}).passthrough()); -const issuing_card_fraud_warning = z.lazy(() => z.object({"started_at": z.number().int().nullable(), "type": z.enum(["card_testing_exposure", "fraud_dispute_filed", "third_party_reported", "user_indicated_fraud"]).nullable()}).passthrough()); -const issuing_card_google_pay = z.lazy(() => z.object({"eligible": z.boolean(), "ineligible_reason": z.enum(["missing_agreement", "missing_cardholder_contact", "unsupported_region"]).nullable()}).passthrough()); -const issuing_card_lifecycle_conditions = z.lazy(() => z.object({"payment_count": z.number().int()}).passthrough()); -const issuing_card_lifecycle_controls = z.lazy(() => z.object({"cancel_after": issuing_card_lifecycle_conditions}).passthrough()); -const issuing_card_shipping = z.lazy(() => z.object({"address": address, "address_validation": issuing_card_shipping_address_validation.nullable(), "carrier": z.enum(["dhl", "fedex", "royal_mail", "usps"]).nullable(), "customs": issuing_card_shipping_customs.nullable(), "eta": z.number().int().nullable(), "name": z.string(), "phone_number": z.string().nullable(), "require_signature": z.boolean().nullable(), "service": z.enum(["express", "priority", "standard"]), "status": z.enum(["canceled", "delivered", "failure", "pending", "returned", "shipped", "submitted"]).nullable(), "tracking_number": z.string().nullable(), "tracking_url": z.string().nullable(), "type": z.enum(["bulk", "individual"])}).passthrough()); -const issuing_card_shipping_address_validation = z.lazy(() => z.object({"mode": z.enum(["disabled", "normalization_only", "validation_and_normalization"]), "normalized_address": address.nullable(), "result": z.enum(["indeterminate", "likely_deliverable", "likely_undeliverable"]).nullable()}).passthrough()); -const issuing_card_shipping_customs = z.lazy(() => z.object({"eori_number": z.string().nullable()}).passthrough()); -const issuing_card_spending_limit = z.lazy(() => z.object({"amount": z.number().int(), "categories": z.array(z.enum(["ac_refrigeration_repair", "accounting_bookkeeping_services", "advertising_services", "agricultural_cooperative", "airlines_air_carriers", "airports_flying_fields", "ambulance_services", "amusement_parks_carnivals", "antique_reproductions", "antique_shops", "aquariums", "architectural_surveying_services", "art_dealers_and_galleries", "artists_supply_and_craft_shops", "auto_and_home_supply_stores", "auto_body_repair_shops", "auto_paint_shops", "auto_service_shops", "automated_cash_disburse", "automated_fuel_dispensers", "automobile_associations", "automotive_parts_and_accessories_stores", "automotive_tire_stores", "bail_and_bond_payments", "bakeries", "bands_orchestras", "barber_and_beauty_shops", "betting_casino_gambling", "bicycle_shops", "billiard_pool_establishments", "boat_dealers", "boat_rentals_and_leases", "book_stores", "books_periodicals_and_newspapers", "bowling_alleys", "bus_lines", "business_secretarial_schools", "buying_shopping_services", "cable_satellite_and_other_pay_television_and_radio", "camera_and_photographic_supply_stores", "candy_nut_and_confectionery_stores", "car_and_truck_dealers_new_used", "car_and_truck_dealers_used_only", "car_rental_agencies", "car_washes", "carpentry_services", "carpet_upholstery_cleaning", "caterers", "charitable_and_social_service_organizations_fundraising", "chemicals_and_allied_products", "child_care_services", "childrens_and_infants_wear_stores", "chiropodists_podiatrists", "chiropractors", "cigar_stores_and_stands", "civic_social_fraternal_associations", "cleaning_and_maintenance", "clothing_rental", "colleges_universities", "commercial_equipment", "commercial_footwear", "commercial_photography_art_and_graphics", "commuter_transport_and_ferries", "computer_network_services", "computer_programming", "computer_repair", "computer_software_stores", "computers_peripherals_and_software", "concrete_work_services", "construction_materials", "consulting_public_relations", "correspondence_schools", "cosmetic_stores", "counseling_services", "country_clubs", "courier_services", "court_costs", "credit_reporting_agencies", "cruise_lines", "dairy_products_stores", "dance_hall_studios_schools", "dating_escort_services", "dentists_orthodontists", "department_stores", "detective_agencies", "digital_goods_applications", "digital_goods_games", "digital_goods_large_volume", "digital_goods_media", "direct_marketing_catalog_merchant", "direct_marketing_combination_catalog_and_retail_merchant", "direct_marketing_inbound_telemarketing", "direct_marketing_insurance_services", "direct_marketing_other", "direct_marketing_outbound_telemarketing", "direct_marketing_subscription", "direct_marketing_travel", "discount_stores", "doctors", "door_to_door_sales", "drapery_window_covering_and_upholstery_stores", "drinking_places", "drug_stores_and_pharmacies", "drugs_drug_proprietaries_and_druggist_sundries", "dry_cleaners", "durable_goods", "duty_free_stores", "eating_places_restaurants", "educational_services", "electric_razor_stores", "electric_vehicle_charging", "electrical_parts_and_equipment", "electrical_services", "electronics_repair_shops", "electronics_stores", "elementary_secondary_schools", "emergency_services_gcas_visa_use_only", "employment_temp_agencies", "equipment_rental", "exterminating_services", "family_clothing_stores", "fast_food_restaurants", "financial_institutions", "fines_government_administrative_entities", "fireplace_fireplace_screens_and_accessories_stores", "floor_covering_stores", "florists", "florists_supplies_nursery_stock_and_flowers", "freezer_and_locker_meat_provisioners", "fuel_dealers_non_automotive", "funeral_services_crematories", "furniture_home_furnishings_and_equipment_stores_except_appliances", "furniture_repair_refinishing", "furriers_and_fur_shops", "general_services", "gift_card_novelty_and_souvenir_shops", "glass_paint_and_wallpaper_stores", "glassware_crystal_stores", "golf_courses_public", "government_licensed_horse_dog_racing_us_region_only", "government_licensed_online_casions_online_gambling_us_region_only", "government_owned_lotteries_non_us_region", "government_owned_lotteries_us_region_only", "government_services", "grocery_stores_supermarkets", "hardware_equipment_and_supplies", "hardware_stores", "health_and_beauty_spas", "hearing_aids_sales_and_supplies", "heating_plumbing_a_c", "hobby_toy_and_game_shops", "home_supply_warehouse_stores", "hospitals", "hotels_motels_and_resorts", "household_appliance_stores", "industrial_supplies", "information_retrieval_services", "insurance_default", "insurance_underwriting_premiums", "intra_company_purchases", "jewelry_stores_watches_clocks_and_silverware_stores", "landscaping_services", "laundries", "laundry_cleaning_services", "legal_services_attorneys", "luggage_and_leather_goods_stores", "lumber_building_materials_stores", "manual_cash_disburse", "marinas_service_and_supplies", "marketplaces", "masonry_stonework_and_plaster", "massage_parlors", "medical_and_dental_labs", "medical_dental_ophthalmic_and_hospital_equipment_and_supplies", "medical_services", "membership_organizations", "mens_and_boys_clothing_and_accessories_stores", "mens_womens_clothing_stores", "metal_service_centers", "miscellaneous", "miscellaneous_apparel_and_accessory_shops", "miscellaneous_auto_dealers", "miscellaneous_business_services", "miscellaneous_food_stores", "miscellaneous_general_merchandise", "miscellaneous_general_services", "miscellaneous_home_furnishing_specialty_stores", "miscellaneous_publishing_and_printing", "miscellaneous_recreation_services", "miscellaneous_repair_shops", "miscellaneous_specialty_retail", "mobile_home_dealers", "motion_picture_theaters", "motor_freight_carriers_and_trucking", "motor_homes_dealers", "motor_vehicle_supplies_and_new_parts", "motorcycle_shops_and_dealers", "motorcycle_shops_dealers", "music_stores_musical_instruments_pianos_and_sheet_music", "news_dealers_and_newsstands", "non_fi_money_orders", "non_fi_stored_value_card_purchase_load", "nondurable_goods", "nurseries_lawn_and_garden_supply_stores", "nursing_personal_care", "office_and_commercial_furniture", "opticians_eyeglasses", "optometrists_ophthalmologist", "orthopedic_goods_prosthetic_devices", "osteopaths", "package_stores_beer_wine_and_liquor", "paints_varnishes_and_supplies", "parking_lots_garages", "passenger_railways", "pawn_shops", "pet_shops_pet_food_and_supplies", "petroleum_and_petroleum_products", "photo_developing", "photographic_photocopy_microfilm_equipment_and_supplies", "photographic_studios", "picture_video_production", "piece_goods_notions_and_other_dry_goods", "plumbing_heating_equipment_and_supplies", "political_organizations", "postal_services_government_only", "precious_stones_and_metals_watches_and_jewelry", "professional_services", "public_warehousing_and_storage", "quick_copy_repro_and_blueprint", "railroads", "real_estate_agents_and_managers_rentals", "record_stores", "recreational_vehicle_rentals", "religious_goods_stores", "religious_organizations", "roofing_siding_sheet_metal", "secretarial_support_services", "security_brokers_dealers", "service_stations", "sewing_needlework_fabric_and_piece_goods_stores", "shoe_repair_hat_cleaning", "shoe_stores", "small_appliance_repair", "snowmobile_dealers", "special_trade_services", "specialty_cleaning", "sporting_goods_stores", "sporting_recreation_camps", "sports_and_riding_apparel_stores", "sports_clubs_fields", "stamp_and_coin_stores", "stationary_office_supplies_printing_and_writing_paper", "stationery_stores_office_and_school_supply_stores", "swimming_pools_sales", "t_ui_travel_germany", "tailors_alterations", "tax_payments_government_agencies", "tax_preparation_services", "taxicabs_limousines", "telecommunication_equipment_and_telephone_sales", "telecommunication_services", "telegraph_services", "tent_and_awning_shops", "testing_laboratories", "theatrical_ticket_agencies", "timeshares", "tire_retreading_and_repair", "tolls_bridge_fees", "tourist_attractions_and_exhibits", "towing_services", "trailer_parks_campgrounds", "transportation_services", "travel_agencies_tour_operators", "truck_stop_iteration", "truck_utility_trailer_rentals", "typesetting_plate_making_and_related_services", "typewriter_stores", "u_s_federal_government_agencies_or_departments", "uniforms_commercial_clothing", "used_merchandise_and_secondhand_stores", "utilities", "variety_stores", "veterinary_services", "video_amusement_game_supplies", "video_game_arcades", "video_tape_rental_stores", "vocational_trade_schools", "watch_jewelry_repair", "welding_repair", "wholesale_clubs", "wig_and_toupee_stores", "wires_money_orders", "womens_accessory_and_specialty_shops", "womens_ready_to_wear_stores", "wrecking_and_salvage_yards"])).nullable(), "interval": z.enum(["all_time", "daily", "monthly", "per_authorization", "weekly", "yearly"])}).passthrough()); -const issuing_card_wallets = z.lazy(() => z.object({"apple_pay": issuing_card_apple_pay, "google_pay": issuing_card_google_pay, "primary_account_identifier": z.string().nullable()}).passthrough()); -const issuing_cardholder_address = z.lazy(() => z.object({"address": address}).passthrough()); -const issuing_cardholder_authorization_controls = z.lazy(() => z.object({"allowed_card_presences": z.array(z.enum(["not_present", "present"])).nullable(), "allowed_categories": z.array(z.enum(["ac_refrigeration_repair", "accounting_bookkeeping_services", "advertising_services", "agricultural_cooperative", "airlines_air_carriers", "airports_flying_fields", "ambulance_services", "amusement_parks_carnivals", "antique_reproductions", "antique_shops", "aquariums", "architectural_surveying_services", "art_dealers_and_galleries", "artists_supply_and_craft_shops", "auto_and_home_supply_stores", "auto_body_repair_shops", "auto_paint_shops", "auto_service_shops", "automated_cash_disburse", "automated_fuel_dispensers", "automobile_associations", "automotive_parts_and_accessories_stores", "automotive_tire_stores", "bail_and_bond_payments", "bakeries", "bands_orchestras", "barber_and_beauty_shops", "betting_casino_gambling", "bicycle_shops", "billiard_pool_establishments", "boat_dealers", "boat_rentals_and_leases", "book_stores", "books_periodicals_and_newspapers", "bowling_alleys", "bus_lines", "business_secretarial_schools", "buying_shopping_services", "cable_satellite_and_other_pay_television_and_radio", "camera_and_photographic_supply_stores", "candy_nut_and_confectionery_stores", "car_and_truck_dealers_new_used", "car_and_truck_dealers_used_only", "car_rental_agencies", "car_washes", "carpentry_services", "carpet_upholstery_cleaning", "caterers", "charitable_and_social_service_organizations_fundraising", "chemicals_and_allied_products", "child_care_services", "childrens_and_infants_wear_stores", "chiropodists_podiatrists", "chiropractors", "cigar_stores_and_stands", "civic_social_fraternal_associations", "cleaning_and_maintenance", "clothing_rental", "colleges_universities", "commercial_equipment", "commercial_footwear", "commercial_photography_art_and_graphics", "commuter_transport_and_ferries", "computer_network_services", "computer_programming", "computer_repair", "computer_software_stores", "computers_peripherals_and_software", "concrete_work_services", "construction_materials", "consulting_public_relations", "correspondence_schools", "cosmetic_stores", "counseling_services", "country_clubs", "courier_services", "court_costs", "credit_reporting_agencies", "cruise_lines", "dairy_products_stores", "dance_hall_studios_schools", "dating_escort_services", "dentists_orthodontists", "department_stores", "detective_agencies", "digital_goods_applications", "digital_goods_games", "digital_goods_large_volume", "digital_goods_media", "direct_marketing_catalog_merchant", "direct_marketing_combination_catalog_and_retail_merchant", "direct_marketing_inbound_telemarketing", "direct_marketing_insurance_services", "direct_marketing_other", "direct_marketing_outbound_telemarketing", "direct_marketing_subscription", "direct_marketing_travel", "discount_stores", "doctors", "door_to_door_sales", "drapery_window_covering_and_upholstery_stores", "drinking_places", "drug_stores_and_pharmacies", "drugs_drug_proprietaries_and_druggist_sundries", "dry_cleaners", "durable_goods", "duty_free_stores", "eating_places_restaurants", "educational_services", "electric_razor_stores", "electric_vehicle_charging", "electrical_parts_and_equipment", "electrical_services", "electronics_repair_shops", "electronics_stores", "elementary_secondary_schools", "emergency_services_gcas_visa_use_only", "employment_temp_agencies", "equipment_rental", "exterminating_services", "family_clothing_stores", "fast_food_restaurants", "financial_institutions", "fines_government_administrative_entities", "fireplace_fireplace_screens_and_accessories_stores", "floor_covering_stores", "florists", "florists_supplies_nursery_stock_and_flowers", "freezer_and_locker_meat_provisioners", "fuel_dealers_non_automotive", "funeral_services_crematories", "furniture_home_furnishings_and_equipment_stores_except_appliances", "furniture_repair_refinishing", "furriers_and_fur_shops", "general_services", "gift_card_novelty_and_souvenir_shops", "glass_paint_and_wallpaper_stores", "glassware_crystal_stores", "golf_courses_public", "government_licensed_horse_dog_racing_us_region_only", "government_licensed_online_casions_online_gambling_us_region_only", "government_owned_lotteries_non_us_region", "government_owned_lotteries_us_region_only", "government_services", "grocery_stores_supermarkets", "hardware_equipment_and_supplies", "hardware_stores", "health_and_beauty_spas", "hearing_aids_sales_and_supplies", "heating_plumbing_a_c", "hobby_toy_and_game_shops", "home_supply_warehouse_stores", "hospitals", "hotels_motels_and_resorts", "household_appliance_stores", "industrial_supplies", "information_retrieval_services", "insurance_default", "insurance_underwriting_premiums", "intra_company_purchases", "jewelry_stores_watches_clocks_and_silverware_stores", "landscaping_services", "laundries", "laundry_cleaning_services", "legal_services_attorneys", "luggage_and_leather_goods_stores", "lumber_building_materials_stores", "manual_cash_disburse", "marinas_service_and_supplies", "marketplaces", "masonry_stonework_and_plaster", "massage_parlors", "medical_and_dental_labs", "medical_dental_ophthalmic_and_hospital_equipment_and_supplies", "medical_services", "membership_organizations", "mens_and_boys_clothing_and_accessories_stores", "mens_womens_clothing_stores", "metal_service_centers", "miscellaneous", "miscellaneous_apparel_and_accessory_shops", "miscellaneous_auto_dealers", "miscellaneous_business_services", "miscellaneous_food_stores", "miscellaneous_general_merchandise", "miscellaneous_general_services", "miscellaneous_home_furnishing_specialty_stores", "miscellaneous_publishing_and_printing", "miscellaneous_recreation_services", "miscellaneous_repair_shops", "miscellaneous_specialty_retail", "mobile_home_dealers", "motion_picture_theaters", "motor_freight_carriers_and_trucking", "motor_homes_dealers", "motor_vehicle_supplies_and_new_parts", "motorcycle_shops_and_dealers", "motorcycle_shops_dealers", "music_stores_musical_instruments_pianos_and_sheet_music", "news_dealers_and_newsstands", "non_fi_money_orders", "non_fi_stored_value_card_purchase_load", "nondurable_goods", "nurseries_lawn_and_garden_supply_stores", "nursing_personal_care", "office_and_commercial_furniture", "opticians_eyeglasses", "optometrists_ophthalmologist", "orthopedic_goods_prosthetic_devices", "osteopaths", "package_stores_beer_wine_and_liquor", "paints_varnishes_and_supplies", "parking_lots_garages", "passenger_railways", "pawn_shops", "pet_shops_pet_food_and_supplies", "petroleum_and_petroleum_products", "photo_developing", "photographic_photocopy_microfilm_equipment_and_supplies", "photographic_studios", "picture_video_production", "piece_goods_notions_and_other_dry_goods", "plumbing_heating_equipment_and_supplies", "political_organizations", "postal_services_government_only", "precious_stones_and_metals_watches_and_jewelry", "professional_services", "public_warehousing_and_storage", "quick_copy_repro_and_blueprint", "railroads", "real_estate_agents_and_managers_rentals", "record_stores", "recreational_vehicle_rentals", "religious_goods_stores", "religious_organizations", "roofing_siding_sheet_metal", "secretarial_support_services", "security_brokers_dealers", "service_stations", "sewing_needlework_fabric_and_piece_goods_stores", "shoe_repair_hat_cleaning", "shoe_stores", "small_appliance_repair", "snowmobile_dealers", "special_trade_services", "specialty_cleaning", "sporting_goods_stores", "sporting_recreation_camps", "sports_and_riding_apparel_stores", "sports_clubs_fields", "stamp_and_coin_stores", "stationary_office_supplies_printing_and_writing_paper", "stationery_stores_office_and_school_supply_stores", "swimming_pools_sales", "t_ui_travel_germany", "tailors_alterations", "tax_payments_government_agencies", "tax_preparation_services", "taxicabs_limousines", "telecommunication_equipment_and_telephone_sales", "telecommunication_services", "telegraph_services", "tent_and_awning_shops", "testing_laboratories", "theatrical_ticket_agencies", "timeshares", "tire_retreading_and_repair", "tolls_bridge_fees", "tourist_attractions_and_exhibits", "towing_services", "trailer_parks_campgrounds", "transportation_services", "travel_agencies_tour_operators", "truck_stop_iteration", "truck_utility_trailer_rentals", "typesetting_plate_making_and_related_services", "typewriter_stores", "u_s_federal_government_agencies_or_departments", "uniforms_commercial_clothing", "used_merchandise_and_secondhand_stores", "utilities", "variety_stores", "veterinary_services", "video_amusement_game_supplies", "video_game_arcades", "video_tape_rental_stores", "vocational_trade_schools", "watch_jewelry_repair", "welding_repair", "wholesale_clubs", "wig_and_toupee_stores", "wires_money_orders", "womens_accessory_and_specialty_shops", "womens_ready_to_wear_stores", "wrecking_and_salvage_yards"])).nullable(), "allowed_merchant_countries": z.array(z.string()).nullable(), "blocked_card_presences": z.array(z.enum(["not_present", "present"])).nullable(), "blocked_categories": z.array(z.enum(["ac_refrigeration_repair", "accounting_bookkeeping_services", "advertising_services", "agricultural_cooperative", "airlines_air_carriers", "airports_flying_fields", "ambulance_services", "amusement_parks_carnivals", "antique_reproductions", "antique_shops", "aquariums", "architectural_surveying_services", "art_dealers_and_galleries", "artists_supply_and_craft_shops", "auto_and_home_supply_stores", "auto_body_repair_shops", "auto_paint_shops", "auto_service_shops", "automated_cash_disburse", "automated_fuel_dispensers", "automobile_associations", "automotive_parts_and_accessories_stores", "automotive_tire_stores", "bail_and_bond_payments", "bakeries", "bands_orchestras", "barber_and_beauty_shops", "betting_casino_gambling", "bicycle_shops", "billiard_pool_establishments", "boat_dealers", "boat_rentals_and_leases", "book_stores", "books_periodicals_and_newspapers", "bowling_alleys", "bus_lines", "business_secretarial_schools", "buying_shopping_services", "cable_satellite_and_other_pay_television_and_radio", "camera_and_photographic_supply_stores", "candy_nut_and_confectionery_stores", "car_and_truck_dealers_new_used", "car_and_truck_dealers_used_only", "car_rental_agencies", "car_washes", "carpentry_services", "carpet_upholstery_cleaning", "caterers", "charitable_and_social_service_organizations_fundraising", "chemicals_and_allied_products", "child_care_services", "childrens_and_infants_wear_stores", "chiropodists_podiatrists", "chiropractors", "cigar_stores_and_stands", "civic_social_fraternal_associations", "cleaning_and_maintenance", "clothing_rental", "colleges_universities", "commercial_equipment", "commercial_footwear", "commercial_photography_art_and_graphics", "commuter_transport_and_ferries", "computer_network_services", "computer_programming", "computer_repair", "computer_software_stores", "computers_peripherals_and_software", "concrete_work_services", "construction_materials", "consulting_public_relations", "correspondence_schools", "cosmetic_stores", "counseling_services", "country_clubs", "courier_services", "court_costs", "credit_reporting_agencies", "cruise_lines", "dairy_products_stores", "dance_hall_studios_schools", "dating_escort_services", "dentists_orthodontists", "department_stores", "detective_agencies", "digital_goods_applications", "digital_goods_games", "digital_goods_large_volume", "digital_goods_media", "direct_marketing_catalog_merchant", "direct_marketing_combination_catalog_and_retail_merchant", "direct_marketing_inbound_telemarketing", "direct_marketing_insurance_services", "direct_marketing_other", "direct_marketing_outbound_telemarketing", "direct_marketing_subscription", "direct_marketing_travel", "discount_stores", "doctors", "door_to_door_sales", "drapery_window_covering_and_upholstery_stores", "drinking_places", "drug_stores_and_pharmacies", "drugs_drug_proprietaries_and_druggist_sundries", "dry_cleaners", "durable_goods", "duty_free_stores", "eating_places_restaurants", "educational_services", "electric_razor_stores", "electric_vehicle_charging", "electrical_parts_and_equipment", "electrical_services", "electronics_repair_shops", "electronics_stores", "elementary_secondary_schools", "emergency_services_gcas_visa_use_only", "employment_temp_agencies", "equipment_rental", "exterminating_services", "family_clothing_stores", "fast_food_restaurants", "financial_institutions", "fines_government_administrative_entities", "fireplace_fireplace_screens_and_accessories_stores", "floor_covering_stores", "florists", "florists_supplies_nursery_stock_and_flowers", "freezer_and_locker_meat_provisioners", "fuel_dealers_non_automotive", "funeral_services_crematories", "furniture_home_furnishings_and_equipment_stores_except_appliances", "furniture_repair_refinishing", "furriers_and_fur_shops", "general_services", "gift_card_novelty_and_souvenir_shops", "glass_paint_and_wallpaper_stores", "glassware_crystal_stores", "golf_courses_public", "government_licensed_horse_dog_racing_us_region_only", "government_licensed_online_casions_online_gambling_us_region_only", "government_owned_lotteries_non_us_region", "government_owned_lotteries_us_region_only", "government_services", "grocery_stores_supermarkets", "hardware_equipment_and_supplies", "hardware_stores", "health_and_beauty_spas", "hearing_aids_sales_and_supplies", "heating_plumbing_a_c", "hobby_toy_and_game_shops", "home_supply_warehouse_stores", "hospitals", "hotels_motels_and_resorts", "household_appliance_stores", "industrial_supplies", "information_retrieval_services", "insurance_default", "insurance_underwriting_premiums", "intra_company_purchases", "jewelry_stores_watches_clocks_and_silverware_stores", "landscaping_services", "laundries", "laundry_cleaning_services", "legal_services_attorneys", "luggage_and_leather_goods_stores", "lumber_building_materials_stores", "manual_cash_disburse", "marinas_service_and_supplies", "marketplaces", "masonry_stonework_and_plaster", "massage_parlors", "medical_and_dental_labs", "medical_dental_ophthalmic_and_hospital_equipment_and_supplies", "medical_services", "membership_organizations", "mens_and_boys_clothing_and_accessories_stores", "mens_womens_clothing_stores", "metal_service_centers", "miscellaneous", "miscellaneous_apparel_and_accessory_shops", "miscellaneous_auto_dealers", "miscellaneous_business_services", "miscellaneous_food_stores", "miscellaneous_general_merchandise", "miscellaneous_general_services", "miscellaneous_home_furnishing_specialty_stores", "miscellaneous_publishing_and_printing", "miscellaneous_recreation_services", "miscellaneous_repair_shops", "miscellaneous_specialty_retail", "mobile_home_dealers", "motion_picture_theaters", "motor_freight_carriers_and_trucking", "motor_homes_dealers", "motor_vehicle_supplies_and_new_parts", "motorcycle_shops_and_dealers", "motorcycle_shops_dealers", "music_stores_musical_instruments_pianos_and_sheet_music", "news_dealers_and_newsstands", "non_fi_money_orders", "non_fi_stored_value_card_purchase_load", "nondurable_goods", "nurseries_lawn_and_garden_supply_stores", "nursing_personal_care", "office_and_commercial_furniture", "opticians_eyeglasses", "optometrists_ophthalmologist", "orthopedic_goods_prosthetic_devices", "osteopaths", "package_stores_beer_wine_and_liquor", "paints_varnishes_and_supplies", "parking_lots_garages", "passenger_railways", "pawn_shops", "pet_shops_pet_food_and_supplies", "petroleum_and_petroleum_products", "photo_developing", "photographic_photocopy_microfilm_equipment_and_supplies", "photographic_studios", "picture_video_production", "piece_goods_notions_and_other_dry_goods", "plumbing_heating_equipment_and_supplies", "political_organizations", "postal_services_government_only", "precious_stones_and_metals_watches_and_jewelry", "professional_services", "public_warehousing_and_storage", "quick_copy_repro_and_blueprint", "railroads", "real_estate_agents_and_managers_rentals", "record_stores", "recreational_vehicle_rentals", "religious_goods_stores", "religious_organizations", "roofing_siding_sheet_metal", "secretarial_support_services", "security_brokers_dealers", "service_stations", "sewing_needlework_fabric_and_piece_goods_stores", "shoe_repair_hat_cleaning", "shoe_stores", "small_appliance_repair", "snowmobile_dealers", "special_trade_services", "specialty_cleaning", "sporting_goods_stores", "sporting_recreation_camps", "sports_and_riding_apparel_stores", "sports_clubs_fields", "stamp_and_coin_stores", "stationary_office_supplies_printing_and_writing_paper", "stationery_stores_office_and_school_supply_stores", "swimming_pools_sales", "t_ui_travel_germany", "tailors_alterations", "tax_payments_government_agencies", "tax_preparation_services", "taxicabs_limousines", "telecommunication_equipment_and_telephone_sales", "telecommunication_services", "telegraph_services", "tent_and_awning_shops", "testing_laboratories", "theatrical_ticket_agencies", "timeshares", "tire_retreading_and_repair", "tolls_bridge_fees", "tourist_attractions_and_exhibits", "towing_services", "trailer_parks_campgrounds", "transportation_services", "travel_agencies_tour_operators", "truck_stop_iteration", "truck_utility_trailer_rentals", "typesetting_plate_making_and_related_services", "typewriter_stores", "u_s_federal_government_agencies_or_departments", "uniforms_commercial_clothing", "used_merchandise_and_secondhand_stores", "utilities", "variety_stores", "veterinary_services", "video_amusement_game_supplies", "video_game_arcades", "video_tape_rental_stores", "vocational_trade_schools", "watch_jewelry_repair", "welding_repair", "wholesale_clubs", "wig_and_toupee_stores", "wires_money_orders", "womens_accessory_and_specialty_shops", "womens_ready_to_wear_stores", "wrecking_and_salvage_yards"])).nullable(), "blocked_merchant_countries": z.array(z.string()).nullable(), "spending_limits": z.array(issuing_cardholder_spending_limit).nullable(), "spending_limits_currency": z.string().nullable()}).passthrough()); -const issuing_cardholder_card_issuing = z.lazy(() => z.object({"user_terms_acceptance": issuing_cardholder_user_terms_acceptance.nullable()}).passthrough()); -const issuing_cardholder_company = z.lazy(() => z.object({"tax_id_provided": z.boolean()}).passthrough()); -const issuing_cardholder_id_document = z.lazy(() => z.object({"back": z.union([z.string(), file]).nullable(), "front": z.union([z.string(), file]).nullable()}).passthrough()); -const issuing_cardholder_individual = z.lazy(() => z.object({"card_issuing": issuing_cardholder_card_issuing.nullable().optional(), "dob": issuing_cardholder_individual_dob.nullable(), "first_name": z.string().nullable(), "last_name": z.string().nullable(), "verification": issuing_cardholder_verification.nullable()}).passthrough()); -const issuing_cardholder_individual_dob = z.lazy(() => z.object({"day": z.number().int().nullable(), "month": z.number().int().nullable(), "year": z.number().int().nullable()}).passthrough()); -const issuing_cardholder_requirements = z.lazy(() => z.object({"disabled_reason": z.enum(["listed", "rejected.listed", "requirements.past_due", "under_review"]).nullable(), "past_due": z.array(z.enum(["company.tax_id", "individual.card_issuing.user_terms_acceptance.date", "individual.card_issuing.user_terms_acceptance.ip", "individual.dob.day", "individual.dob.month", "individual.dob.year", "individual.first_name", "individual.last_name", "individual.verification.document"])).nullable()}).passthrough()); -const issuing_cardholder_spending_limit = z.lazy(() => z.object({"amount": z.number().int(), "categories": z.array(z.enum(["ac_refrigeration_repair", "accounting_bookkeeping_services", "advertising_services", "agricultural_cooperative", "airlines_air_carriers", "airports_flying_fields", "ambulance_services", "amusement_parks_carnivals", "antique_reproductions", "antique_shops", "aquariums", "architectural_surveying_services", "art_dealers_and_galleries", "artists_supply_and_craft_shops", "auto_and_home_supply_stores", "auto_body_repair_shops", "auto_paint_shops", "auto_service_shops", "automated_cash_disburse", "automated_fuel_dispensers", "automobile_associations", "automotive_parts_and_accessories_stores", "automotive_tire_stores", "bail_and_bond_payments", "bakeries", "bands_orchestras", "barber_and_beauty_shops", "betting_casino_gambling", "bicycle_shops", "billiard_pool_establishments", "boat_dealers", "boat_rentals_and_leases", "book_stores", "books_periodicals_and_newspapers", "bowling_alleys", "bus_lines", "business_secretarial_schools", "buying_shopping_services", "cable_satellite_and_other_pay_television_and_radio", "camera_and_photographic_supply_stores", "candy_nut_and_confectionery_stores", "car_and_truck_dealers_new_used", "car_and_truck_dealers_used_only", "car_rental_agencies", "car_washes", "carpentry_services", "carpet_upholstery_cleaning", "caterers", "charitable_and_social_service_organizations_fundraising", "chemicals_and_allied_products", "child_care_services", "childrens_and_infants_wear_stores", "chiropodists_podiatrists", "chiropractors", "cigar_stores_and_stands", "civic_social_fraternal_associations", "cleaning_and_maintenance", "clothing_rental", "colleges_universities", "commercial_equipment", "commercial_footwear", "commercial_photography_art_and_graphics", "commuter_transport_and_ferries", "computer_network_services", "computer_programming", "computer_repair", "computer_software_stores", "computers_peripherals_and_software", "concrete_work_services", "construction_materials", "consulting_public_relations", "correspondence_schools", "cosmetic_stores", "counseling_services", "country_clubs", "courier_services", "court_costs", "credit_reporting_agencies", "cruise_lines", "dairy_products_stores", "dance_hall_studios_schools", "dating_escort_services", "dentists_orthodontists", "department_stores", "detective_agencies", "digital_goods_applications", "digital_goods_games", "digital_goods_large_volume", "digital_goods_media", "direct_marketing_catalog_merchant", "direct_marketing_combination_catalog_and_retail_merchant", "direct_marketing_inbound_telemarketing", "direct_marketing_insurance_services", "direct_marketing_other", "direct_marketing_outbound_telemarketing", "direct_marketing_subscription", "direct_marketing_travel", "discount_stores", "doctors", "door_to_door_sales", "drapery_window_covering_and_upholstery_stores", "drinking_places", "drug_stores_and_pharmacies", "drugs_drug_proprietaries_and_druggist_sundries", "dry_cleaners", "durable_goods", "duty_free_stores", "eating_places_restaurants", "educational_services", "electric_razor_stores", "electric_vehicle_charging", "electrical_parts_and_equipment", "electrical_services", "electronics_repair_shops", "electronics_stores", "elementary_secondary_schools", "emergency_services_gcas_visa_use_only", "employment_temp_agencies", "equipment_rental", "exterminating_services", "family_clothing_stores", "fast_food_restaurants", "financial_institutions", "fines_government_administrative_entities", "fireplace_fireplace_screens_and_accessories_stores", "floor_covering_stores", "florists", "florists_supplies_nursery_stock_and_flowers", "freezer_and_locker_meat_provisioners", "fuel_dealers_non_automotive", "funeral_services_crematories", "furniture_home_furnishings_and_equipment_stores_except_appliances", "furniture_repair_refinishing", "furriers_and_fur_shops", "general_services", "gift_card_novelty_and_souvenir_shops", "glass_paint_and_wallpaper_stores", "glassware_crystal_stores", "golf_courses_public", "government_licensed_horse_dog_racing_us_region_only", "government_licensed_online_casions_online_gambling_us_region_only", "government_owned_lotteries_non_us_region", "government_owned_lotteries_us_region_only", "government_services", "grocery_stores_supermarkets", "hardware_equipment_and_supplies", "hardware_stores", "health_and_beauty_spas", "hearing_aids_sales_and_supplies", "heating_plumbing_a_c", "hobby_toy_and_game_shops", "home_supply_warehouse_stores", "hospitals", "hotels_motels_and_resorts", "household_appliance_stores", "industrial_supplies", "information_retrieval_services", "insurance_default", "insurance_underwriting_premiums", "intra_company_purchases", "jewelry_stores_watches_clocks_and_silverware_stores", "landscaping_services", "laundries", "laundry_cleaning_services", "legal_services_attorneys", "luggage_and_leather_goods_stores", "lumber_building_materials_stores", "manual_cash_disburse", "marinas_service_and_supplies", "marketplaces", "masonry_stonework_and_plaster", "massage_parlors", "medical_and_dental_labs", "medical_dental_ophthalmic_and_hospital_equipment_and_supplies", "medical_services", "membership_organizations", "mens_and_boys_clothing_and_accessories_stores", "mens_womens_clothing_stores", "metal_service_centers", "miscellaneous", "miscellaneous_apparel_and_accessory_shops", "miscellaneous_auto_dealers", "miscellaneous_business_services", "miscellaneous_food_stores", "miscellaneous_general_merchandise", "miscellaneous_general_services", "miscellaneous_home_furnishing_specialty_stores", "miscellaneous_publishing_and_printing", "miscellaneous_recreation_services", "miscellaneous_repair_shops", "miscellaneous_specialty_retail", "mobile_home_dealers", "motion_picture_theaters", "motor_freight_carriers_and_trucking", "motor_homes_dealers", "motor_vehicle_supplies_and_new_parts", "motorcycle_shops_and_dealers", "motorcycle_shops_dealers", "music_stores_musical_instruments_pianos_and_sheet_music", "news_dealers_and_newsstands", "non_fi_money_orders", "non_fi_stored_value_card_purchase_load", "nondurable_goods", "nurseries_lawn_and_garden_supply_stores", "nursing_personal_care", "office_and_commercial_furniture", "opticians_eyeglasses", "optometrists_ophthalmologist", "orthopedic_goods_prosthetic_devices", "osteopaths", "package_stores_beer_wine_and_liquor", "paints_varnishes_and_supplies", "parking_lots_garages", "passenger_railways", "pawn_shops", "pet_shops_pet_food_and_supplies", "petroleum_and_petroleum_products", "photo_developing", "photographic_photocopy_microfilm_equipment_and_supplies", "photographic_studios", "picture_video_production", "piece_goods_notions_and_other_dry_goods", "plumbing_heating_equipment_and_supplies", "political_organizations", "postal_services_government_only", "precious_stones_and_metals_watches_and_jewelry", "professional_services", "public_warehousing_and_storage", "quick_copy_repro_and_blueprint", "railroads", "real_estate_agents_and_managers_rentals", "record_stores", "recreational_vehicle_rentals", "religious_goods_stores", "religious_organizations", "roofing_siding_sheet_metal", "secretarial_support_services", "security_brokers_dealers", "service_stations", "sewing_needlework_fabric_and_piece_goods_stores", "shoe_repair_hat_cleaning", "shoe_stores", "small_appliance_repair", "snowmobile_dealers", "special_trade_services", "specialty_cleaning", "sporting_goods_stores", "sporting_recreation_camps", "sports_and_riding_apparel_stores", "sports_clubs_fields", "stamp_and_coin_stores", "stationary_office_supplies_printing_and_writing_paper", "stationery_stores_office_and_school_supply_stores", "swimming_pools_sales", "t_ui_travel_germany", "tailors_alterations", "tax_payments_government_agencies", "tax_preparation_services", "taxicabs_limousines", "telecommunication_equipment_and_telephone_sales", "telecommunication_services", "telegraph_services", "tent_and_awning_shops", "testing_laboratories", "theatrical_ticket_agencies", "timeshares", "tire_retreading_and_repair", "tolls_bridge_fees", "tourist_attractions_and_exhibits", "towing_services", "trailer_parks_campgrounds", "transportation_services", "travel_agencies_tour_operators", "truck_stop_iteration", "truck_utility_trailer_rentals", "typesetting_plate_making_and_related_services", "typewriter_stores", "u_s_federal_government_agencies_or_departments", "uniforms_commercial_clothing", "used_merchandise_and_secondhand_stores", "utilities", "variety_stores", "veterinary_services", "video_amusement_game_supplies", "video_game_arcades", "video_tape_rental_stores", "vocational_trade_schools", "watch_jewelry_repair", "welding_repair", "wholesale_clubs", "wig_and_toupee_stores", "wires_money_orders", "womens_accessory_and_specialty_shops", "womens_ready_to_wear_stores", "wrecking_and_salvage_yards"])).nullable(), "interval": z.enum(["all_time", "daily", "monthly", "per_authorization", "weekly", "yearly"])}).passthrough()); -const issuing_cardholder_user_terms_acceptance = z.lazy(() => z.object({"date": z.number().int().nullable(), "ip": z.string().nullable(), "user_agent": z.string().nullable()}).passthrough()); -const issuing_cardholder_verification = z.lazy(() => z.object({"document": issuing_cardholder_id_document.nullable()}).passthrough()); -const issuing_dispute_canceled_evidence = z.lazy(() => z.object({"additional_documentation": z.union([z.string(), file]).nullable(), "canceled_at": z.number().int().nullable(), "cancellation_policy_provided": z.boolean().nullable(), "cancellation_reason": z.string().nullable(), "expected_at": z.number().int().nullable(), "explanation": z.string().nullable(), "product_description": z.string().nullable(), "product_type": z.enum(["merchandise", "service"]).nullable(), "return_status": z.enum(["merchant_rejected", "successful"]).nullable(), "returned_at": z.number().int().nullable()}).passthrough()); -const issuing_dispute_duplicate_evidence = z.lazy(() => z.object({"additional_documentation": z.union([z.string(), file]).nullable(), "card_statement": z.union([z.string(), file]).nullable(), "cash_receipt": z.union([z.string(), file]).nullable(), "check_image": z.union([z.string(), file]).nullable(), "explanation": z.string().nullable(), "original_transaction": z.string().nullable()}).passthrough()); -const issuing_dispute_evidence = z.lazy(() => z.object({"canceled": issuing_dispute_canceled_evidence.optional(), "duplicate": issuing_dispute_duplicate_evidence.optional(), "fraudulent": issuing_dispute_fraudulent_evidence.optional(), "merchandise_not_as_described": issuing_dispute_merchandise_not_as_described_evidence.optional(), "no_valid_authorization": issuing_dispute_no_valid_authorization_evidence.optional(), "not_received": issuing_dispute_not_received_evidence.optional(), "other": issuing_dispute_other_evidence.optional(), "reason": z.enum(["canceled", "duplicate", "fraudulent", "merchandise_not_as_described", "no_valid_authorization", "not_received", "other", "service_not_as_described"]), "service_not_as_described": issuing_dispute_service_not_as_described_evidence.optional()}).passthrough()); -const issuing_dispute_fraudulent_evidence = z.lazy(() => z.object({"additional_documentation": z.union([z.string(), file]).nullable(), "explanation": z.string().nullable()}).passthrough()); -const issuing_dispute_merchandise_not_as_described_evidence = z.lazy(() => z.object({"additional_documentation": z.union([z.string(), file]).nullable(), "explanation": z.string().nullable(), "received_at": z.number().int().nullable(), "return_description": z.string().nullable(), "return_status": z.enum(["merchant_rejected", "successful"]).nullable(), "returned_at": z.number().int().nullable()}).passthrough()); -const issuing_dispute_no_valid_authorization_evidence = z.lazy(() => z.object({"additional_documentation": z.union([z.string(), file]).nullable(), "explanation": z.string().nullable()}).passthrough()); -const issuing_dispute_not_received_evidence = z.lazy(() => z.object({"additional_documentation": z.union([z.string(), file]).nullable(), "expected_at": z.number().int().nullable(), "explanation": z.string().nullable(), "product_description": z.string().nullable(), "product_type": z.enum(["merchandise", "service"]).nullable()}).passthrough()); -const issuing_dispute_other_evidence = z.lazy(() => z.object({"additional_documentation": z.union([z.string(), file]).nullable(), "explanation": z.string().nullable(), "product_description": z.string().nullable(), "product_type": z.enum(["merchandise", "service"]).nullable()}).passthrough()); -const issuing_dispute_service_not_as_described_evidence = z.lazy(() => z.object({"additional_documentation": z.union([z.string(), file]).nullable(), "canceled_at": z.number().int().nullable(), "cancellation_reason": z.string().nullable(), "explanation": z.string().nullable(), "received_at": z.number().int().nullable()}).passthrough()); -const issuing_dispute_treasury = z.lazy(() => z.object({"debit_reversal": z.string().nullable(), "received_debit": z.string()}).passthrough()); -const issuing_network_token_address = z.lazy(() => z.object({"line1": z.string(), "postal_code": z.string()}).passthrough()); -const issuing_network_token_device = z.lazy(() => z.object({"device_fingerprint": z.string().optional(), "ip_address": z.string().optional(), "location": z.string().optional(), "name": z.string().optional(), "phone_number": z.string().optional(), "type": z.enum(["other", "phone", "watch"]).optional()}).passthrough()); -const issuing_network_token_mastercard = z.lazy(() => z.object({"card_reference_id": z.string().optional(), "token_reference_id": z.string(), "token_requestor_id": z.string(), "token_requestor_name": z.string().optional()}).passthrough()); -const issuing_network_token_network_data = z.lazy(() => z.object({"device": issuing_network_token_device.optional(), "mastercard": issuing_network_token_mastercard.optional(), "type": z.enum(["mastercard", "visa"]), "visa": issuing_network_token_visa.optional(), "wallet_provider": issuing_network_token_wallet_provider.optional()}).passthrough()); -const issuing_network_token_visa = z.lazy(() => z.object({"card_reference_id": z.string().nullable(), "token_reference_id": z.string(), "token_requestor_id": z.string(), "token_risk_score": z.string().optional()}).passthrough()); -const issuing_network_token_wallet_provider = z.lazy(() => z.object({"account_id": z.string().optional(), "account_trust_score": z.number().int().optional(), "card_number_source": z.enum(["app", "manual", "on_file", "other"]).optional(), "cardholder_address": issuing_network_token_address.optional(), "cardholder_name": z.string().optional(), "device_trust_score": z.number().int().optional(), "hashed_account_email_address": z.string().optional(), "reason_codes": z.array(z.enum(["account_card_too_new", "account_recently_changed", "account_too_new", "account_too_new_since_launch", "additional_device", "data_expired", "defer_id_v_decision", "device_recently_lost", "good_activity_history", "has_suspended_tokens", "high_risk", "inactive_account", "long_account_tenure", "low_account_score", "low_device_score", "low_phone_number_score", "network_service_error", "outside_home_territory", "provisioning_cardholder_mismatch", "provisioning_device_and_cardholder_mismatch", "provisioning_device_mismatch", "same_device_no_prior_authentication", "same_device_successful_prior_authentication", "software_update", "suspicious_activity", "too_many_different_cardholders", "too_many_recent_attempts", "too_many_recent_tokens"])).optional(), "suggested_decision": z.enum(["approve", "decline", "require_auth"]).optional(), "suggested_decision_version": z.string().optional()}).passthrough()); -const issuing_personalization_design_carrier_text = z.lazy(() => z.object({"footer_body": z.string().nullable(), "footer_title": z.string().nullable(), "header_body": z.string().nullable(), "header_title": z.string().nullable()}).passthrough()); -const issuing_personalization_design_preferences = z.lazy(() => z.object({"is_default": z.boolean(), "is_platform_default": z.boolean().nullable()}).passthrough()); -const issuing_personalization_design_rejection_reasons = z.lazy(() => z.object({"card_logo": z.array(z.enum(["geographic_location", "inappropriate", "network_name", "non_binary_image", "non_fiat_currency", "other", "other_entity", "promotional_material"])).nullable(), "carrier_text": z.array(z.enum(["geographic_location", "inappropriate", "network_name", "non_fiat_currency", "other", "other_entity", "promotional_material"])).nullable()}).passthrough()); -const issuing_physical_bundle_features = z.lazy(() => z.object({"card_logo": z.enum(["optional", "required", "unsupported"]), "carrier_text": z.enum(["optional", "required", "unsupported"]), "second_line": z.enum(["optional", "required", "unsupported"])}).passthrough()); -const issuing_transaction_amount_details = z.lazy(() => z.object({"atm_fee": z.number().int().nullable(), "cashback_amount": z.number().int().nullable()}).passthrough()); -const issuing_transaction_fleet_cardholder_prompt_data = z.lazy(() => z.object({"driver_id": z.string().nullable(), "odometer": z.number().int().nullable(), "unspecified_id": z.string().nullable(), "user_id": z.string().nullable(), "vehicle_number": z.string().nullable()}).passthrough()); -const issuing_transaction_fleet_data = z.lazy(() => z.object({"cardholder_prompt_data": issuing_transaction_fleet_cardholder_prompt_data.nullable(), "purchase_type": z.string().nullable(), "reported_breakdown": issuing_transaction_fleet_reported_breakdown.nullable(), "service_type": z.string().nullable()}).passthrough()); -const issuing_transaction_fleet_fuel_price_data = z.lazy(() => z.object({"gross_amount_decimal": z.string().nullable()}).passthrough()); -const issuing_transaction_fleet_non_fuel_price_data = z.lazy(() => z.object({"gross_amount_decimal": z.string().nullable()}).passthrough()); -const issuing_transaction_fleet_reported_breakdown = z.lazy(() => z.object({"fuel": issuing_transaction_fleet_fuel_price_data.nullable(), "non_fuel": issuing_transaction_fleet_non_fuel_price_data.nullable(), "tax": issuing_transaction_fleet_tax_data.nullable()}).passthrough()); -const issuing_transaction_fleet_tax_data = z.lazy(() => z.object({"local_amount_decimal": z.string().nullable(), "national_amount_decimal": z.string().nullable()}).passthrough()); -const issuing_transaction_flight_data = z.lazy(() => z.object({"departure_at": z.number().int().nullable(), "passenger_name": z.string().nullable(), "refundable": z.boolean().nullable(), "segments": z.array(issuing_transaction_flight_data_leg).nullable(), "travel_agency": z.string().nullable()}).passthrough()); -const issuing_transaction_flight_data_leg = z.lazy(() => z.object({"arrival_airport_code": z.string().nullable(), "carrier": z.string().nullable(), "departure_airport_code": z.string().nullable(), "flight_number": z.string().nullable(), "service_class": z.string().nullable(), "stopover_allowed": z.boolean().nullable()}).passthrough()); -const issuing_transaction_fuel_data = z.lazy(() => z.object({"industry_product_code": z.string().nullable(), "quantity_decimal": z.string().nullable(), "type": z.string(), "unit": z.string(), "unit_cost_decimal": z.string()}).passthrough()); -const issuing_transaction_lodging_data = z.lazy(() => z.object({"check_in_at": z.number().int().nullable(), "nights": z.number().int().nullable()}).passthrough()); -const issuing_transaction_network_data = z.lazy(() => z.object({"authorization_code": z.string().nullable(), "processing_date": z.string().nullable(), "transaction_id": z.string().nullable()}).passthrough()); -const issuing_transaction_purchase_details = z.lazy(() => z.object({"fleet": issuing_transaction_fleet_data.nullable(), "flight": issuing_transaction_flight_data.nullable(), "fuel": issuing_transaction_fuel_data.nullable(), "lodging": issuing_transaction_lodging_data.nullable(), "receipt": z.array(issuing_transaction_receipt_data).nullable(), "reference": z.string().nullable()}).passthrough()); -const issuing_transaction_receipt_data = z.lazy(() => z.object({"description": z.string().nullable(), "quantity": z.number().nullable(), "total": z.number().int().nullable(), "unit_cost": z.number().int().nullable()}).passthrough()); -const issuing_transaction_treasury = z.lazy(() => z.object({"received_credit": z.string().nullable(), "received_debit": z.string().nullable()}).passthrough()); -const klarna_address = z.lazy(() => z.object({"country": z.string().nullable()}).passthrough()); -const klarna_payer_details = z.lazy(() => z.object({"address": klarna_address.nullable()}).passthrough()); -const legal_entity_company = z.lazy(() => z.object({"address": address.optional(), "address_kana": legal_entity_japan_address.nullable().optional(), "address_kanji": legal_entity_japan_address.nullable().optional(), "directors_provided": z.boolean().optional(), "directorship_declaration": legal_entity_directorship_declaration.nullable().optional(), "executives_provided": z.boolean().optional(), "export_license_id": z.string().optional(), "export_purpose_code": z.string().optional(), "name": z.string().nullable().optional(), "name_kana": z.string().nullable().optional(), "name_kanji": z.string().nullable().optional(), "owners_provided": z.boolean().optional(), "ownership_declaration": legal_entity_ubo_declaration.nullable().optional(), "ownership_exemption_reason": z.enum(["qualified_entity_exceeds_ownership_threshold", "qualifies_as_financial_institution"]).optional(), "phone": z.string().nullable().optional(), "registration_date": legal_entity_registration_date.optional(), "representative_declaration": legal_entity_representative_declaration.nullable().optional(), "structure": z.enum(["free_zone_establishment", "free_zone_llc", "government_instrumentality", "governmental_unit", "incorporated_non_profit", "incorporated_partnership", "limited_liability_partnership", "llc", "multi_member_llc", "private_company", "private_corporation", "private_partnership", "public_company", "public_corporation", "public_partnership", "registered_charity", "single_member_llc", "sole_establishment", "sole_proprietorship", "tax_exempt_government_instrumentality", "unincorporated_association", "unincorporated_non_profit", "unincorporated_partnership"]).optional(), "tax_id_provided": z.boolean().optional(), "tax_id_registrar": z.string().optional(), "vat_id_provided": z.boolean().optional(), "verification": legal_entity_company_verification.nullable().optional()}).passthrough()); -const legal_entity_company_verification = z.lazy(() => z.object({"document": legal_entity_company_verification_document}).passthrough()); -const legal_entity_company_verification_document = z.lazy(() => z.object({"back": z.union([z.string(), file]).nullable(), "details": z.string().nullable(), "details_code": z.string().nullable(), "front": z.union([z.string(), file]).nullable()}).passthrough()); -const legal_entity_directorship_declaration = z.lazy(() => z.object({"date": z.number().int().nullable(), "ip": z.string().nullable(), "user_agent": z.string().nullable()}).passthrough()); -const legal_entity_dob = z.lazy(() => z.object({"day": z.number().int().nullable(), "month": z.number().int().nullable(), "year": z.number().int().nullable()}).passthrough()); -const legal_entity_japan_address = z.lazy(() => z.object({"city": z.string().nullable(), "country": z.string().nullable(), "line1": z.string().nullable(), "line2": z.string().nullable(), "postal_code": z.string().nullable(), "state": z.string().nullable(), "town": z.string().nullable()}).passthrough()); -const legal_entity_person_verification = z.lazy(() => z.object({"additional_document": legal_entity_person_verification_document.nullable().optional(), "details": z.string().nullable().optional(), "details_code": z.string().nullable().optional(), "document": legal_entity_person_verification_document.optional(), "status": z.string()}).passthrough()); -const legal_entity_person_verification_document = z.lazy(() => z.object({"back": z.union([z.string(), file]).nullable(), "details": z.string().nullable(), "details_code": z.string().nullable(), "front": z.union([z.string(), file]).nullable()}).passthrough()); -const legal_entity_registration_date = z.lazy(() => z.object({"day": z.number().int().nullable(), "month": z.number().int().nullable(), "year": z.number().int().nullable()}).passthrough()); -const legal_entity_representative_declaration = z.lazy(() => z.object({"date": z.number().int().nullable(), "ip": z.string().nullable(), "user_agent": z.string().nullable()}).passthrough()); -const legal_entity_ubo_declaration = z.lazy(() => z.object({"date": z.number().int().nullable(), "ip": z.string().nullable(), "user_agent": z.string().nullable()}).passthrough()); -const level3 = z.lazy(() => z.object({"customer_reference": z.string().optional(), "line_items": z.array(level3_line_items), "merchant_reference": z.string(), "shipping_address_zip": z.string().optional(), "shipping_amount": z.number().int().optional(), "shipping_from_zip": z.string().optional()}).passthrough()); -const level3_line_items = z.lazy(() => z.object({"discount_amount": z.number().int().nullable(), "product_code": z.string(), "product_description": z.string(), "quantity": z.number().int().nullable(), "tax_amount": z.number().int().nullable(), "unit_cost": z.number().int().nullable()}).passthrough()); -const line_item: z.ZodTypeAny = z.lazy(() => z.object({"amount": z.number().int(), "currency": z.string(), "description": z.string().nullable(), "discount_amounts": z.array(discounts_resource_discount_amount).nullable(), "discountable": z.boolean(), "discounts": z.array(z.union([z.string(), discount])), "id": z.string(), "invoice": z.string().nullable(), "livemode": z.boolean(), "metadata": z.record(z.string(), z.string()), "object": z.literal("line_item"), "parent": billing_bill_resource_invoicing_lines_parents_invoice_line_item_parent.nullable(), "period": invoice_line_item_period, "pretax_credit_amounts": z.array(invoices_resource_pretax_credit_amount).nullable(), "pricing": billing_bill_resource_invoicing_pricing_pricing.nullable(), "quantity": z.number().int().nullable(), "quantity_decimal": z.string().nullable(), "subscription": z.union([z.string(), subscription]).nullable(), "subtotal": z.number().int(), "taxes": z.array(billing_bill_resource_invoicing_taxes_tax).nullable()}).passthrough()); -const line_items_tax_amount = z.lazy(() => z.object({"amount": z.number().int(), "rate": tax_rate, "taxability_reason": z.enum(["customer_exempt", "not_collecting", "not_subject_to_tax", "not_supported", "portion_product_exempt", "portion_reduced_rated", "portion_standard_rated", "product_exempt", "product_exempt_holiday", "proportionally_rated", "reduced_rated", "reverse_charge", "standard_rated", "taxable_basis_reduced", "zero_rated"]).nullable(), "taxable_amount": z.number().int().nullable()}).passthrough()); -const linked_account_options_common = z.lazy(() => z.object({"filters": payment_flows_private_payment_methods_financial_connections_common_linked_account_options_filters.optional(), "permissions": z.array(z.enum(["balances", "ownership", "payment_method", "transactions"])).optional(), "prefetch": z.array(z.enum(["balances", "ownership", "transactions"])).nullable(), "return_url": z.string().optional()}).passthrough()); -const mandate: z.ZodTypeAny = z.lazy(() => z.object({"customer_acceptance": customer_acceptance, "id": z.string(), "livemode": z.boolean(), "multi_use": mandate_multi_use.optional(), "object": z.literal("mandate"), "on_behalf_of": z.string().optional(), "payment_method": z.union([z.string(), payment_method]), "payment_method_details": mandate_payment_method_details, "single_use": mandate_single_use.optional(), "status": z.enum(["active", "inactive", "pending"]), "type": z.enum(["multi_use", "single_use"])}).passthrough()); -const mandate_acss_debit = z.lazy(() => z.object({"default_for": z.array(z.enum(["invoice", "subscription"])).optional(), "interval_description": z.string().nullable(), "payment_schedule": z.enum(["combined", "interval", "sporadic"]), "transaction_type": z.enum(["business", "personal"])}).passthrough()); +const invoice_payment_method_options_upi = z.lazy(() => z.object({"mandate_options": invoice_payment_method_options_mandate_options_upi.optional()})); +const invoice_payment_method_options_us_bank_account = z.lazy(() => z.object({"financial_connections": invoice_payment_method_options_us_bank_account_linked_account_options.optional(), "verification_method": z.enum(["automatic", "instant", "microdeposits"]).optional()})); +const invoice_payment_method_options_us_bank_account_linked_account_options = z.lazy(() => z.object({"filters": invoice_payment_method_options_us_bank_account_linked_account_options_filters.optional(), "permissions": z.array(z.enum(["balances", "ownership", "payment_method", "transactions"])).optional(), "prefetch": z.array(z.enum(["balances", "ownership", "transactions"])).nullable()})); +const invoice_payment_method_options_us_bank_account_linked_account_options_filters = z.lazy(() => z.object({"account_subcategories": z.array(z.enum(["checking", "savings"])).optional()})); +const invoice_rendering_pdf = z.lazy(() => z.object({"page_size": z.enum(["a4", "auto", "letter"]).nullable()})); +const invoice_setting_custom_field = z.lazy(() => z.object({"name": z.string(), "value": z.string()})); +const invoice_setting_customer_rendering_options = z.lazy(() => z.object({"amount_tax_display": z.string().nullable(), "template": z.string().nullable()})); +const invoice_setting_customer_setting: z.ZodTypeAny = z.lazy(() => z.object({"custom_fields": z.array(invoice_setting_custom_field).nullable(), "default_payment_method": z.union([z.string(), payment_method]).nullable(), "footer": z.string().nullable(), "rendering_options": invoice_setting_customer_rendering_options.nullable()})); +const invoice_setting_subscription_schedule_phase_setting: z.ZodTypeAny = z.lazy(() => z.object({"account_tax_ids": z.array(z.union([z.string(), tax_id, deleted_tax_id])).nullable(), "days_until_due": z.number().int().nullable(), "issuer": connect_account_reference.nullable()})); +const invoice_setting_subscription_schedule_setting: z.ZodTypeAny = z.lazy(() => z.object({"account_tax_ids": z.array(z.union([z.string(), tax_id, deleted_tax_id])).nullable(), "days_until_due": z.number().int().nullable(), "issuer": connect_account_reference})); +const invoice_threshold_reason = z.lazy(() => z.object({"amount_gte": z.number().int().nullable(), "item_reasons": z.array(invoice_item_threshold_reason)})); +const invoices_payment_method_options = z.lazy(() => z.object({"acss_debit": invoice_payment_method_options_acss_debit.nullable(), "bancontact": invoice_payment_method_options_bancontact.nullable(), "card": invoice_payment_method_options_card.nullable(), "customer_balance": invoice_payment_method_options_customer_balance.nullable(), "konbini": invoice_payment_method_options_konbini.nullable(), "payto": invoice_payment_method_options_payto.nullable(), "pix": invoice_payment_method_options_pix.nullable(), "sepa_debit": invoice_payment_method_options_sepa_debit.nullable(), "upi": invoice_payment_method_options_upi.nullable(), "us_bank_account": invoice_payment_method_options_us_bank_account.nullable()})); +const invoices_payment_settings = z.lazy(() => z.object({"default_mandate": z.string().nullable(), "payment_method_options": invoices_payment_method_options.nullable(), "payment_method_types": z.array(z.enum(["ach_credit_transfer", "ach_debit", "acss_debit", "affirm", "amazon_pay", "au_becs_debit", "bacs_debit", "bancontact", "boleto", "card", "cashapp", "crypto", "custom", "customer_balance", "eps", "fpx", "giropay", "grabpay", "ideal", "jp_credit_transfer", "kakao_pay", "klarna", "konbini", "kr_card", "link", "multibanco", "naver_pay", "nz_bank_account", "p24", "pay_by_bank", "payco", "paynow", "paypal", "payto", "pix", "promptpay", "revolut_pay", "satispay", "sepa_credit_transfer", "sepa_debit", "sofort", "swish", "twint", "upi", "us_bank_account", "wechat_pay"])).nullable()})); +const invoices_payments_invoice_payment_associated_payment: z.ZodTypeAny = z.lazy(() => z.object({"charge": z.union([z.string(), charge]).optional(), "payment_intent": z.union([z.string(), payment_intent]).optional(), "payment_record": z.union([z.string(), payment_record]).optional(), "type": z.enum(["charge", "payment_intent", "payment_record"])})); +const invoices_payments_invoice_payment_status_transitions = z.lazy(() => z.object({"canceled_at": z.number().int().nullable(), "paid_at": z.number().int().nullable()})); +const invoices_resource_confirmation_secret = z.lazy(() => z.object({"client_secret": z.string(), "type": z.string()})); +const invoices_resource_from_invoice: z.ZodTypeAny = z.lazy(() => z.object({"action": z.string(), "invoice": z.union([z.string(), invoice])})); +const invoices_resource_invoice_rendering = z.lazy(() => z.object({"amount_tax_display": z.string().nullable(), "pdf": invoice_rendering_pdf.nullable(), "template": z.string().nullable(), "template_version": z.number().int().nullable()})); +const invoices_resource_invoice_tax_id = z.lazy(() => z.object({"type": z.enum(["ad_nrt", "ae_trn", "al_tin", "am_tin", "ao_tin", "ar_cuit", "au_abn", "au_arn", "aw_tin", "az_tin", "ba_tin", "bb_tin", "bd_bin", "bf_ifu", "bg_uic", "bh_vat", "bj_ifu", "bo_tin", "br_cnpj", "br_cpf", "bs_tin", "by_tin", "ca_bn", "ca_gst_hst", "ca_pst_bc", "ca_pst_mb", "ca_pst_sk", "ca_qst", "cd_nif", "ch_uid", "ch_vat", "cl_tin", "cm_niu", "cn_tin", "co_nit", "cr_tin", "cv_nif", "de_stn", "do_rcn", "ec_ruc", "eg_tin", "es_cif", "et_tin", "eu_oss_vat", "eu_vat", "fo_vat", "gb_vat", "ge_vat", "gi_tin", "gn_nif", "hk_br", "hr_oib", "hu_tin", "id_npwp", "il_vat", "in_gst", "is_vat", "it_cf", "jp_cn", "jp_rn", "jp_trn", "ke_pin", "kg_tin", "kh_tin", "kr_brn", "kz_bin", "la_tin", "li_uid", "li_vat", "lk_vat", "ma_vat", "md_vat", "me_pib", "mk_vat", "mr_nif", "mx_rfc", "my_frp", "my_itn", "my_sst", "ng_tin", "no_vat", "no_voec", "np_pan", "nz_gst", "om_vat", "pe_ruc", "ph_tin", "pl_nip", "py_ruc", "ro_tin", "rs_pib", "ru_inn", "ru_kpp", "sa_vat", "sg_gst", "sg_uen", "si_tin", "sn_ninea", "sr_fin", "sv_nit", "th_vat", "tj_tin", "tr_tin", "tw_vat", "tz_vat", "ua_vat", "ug_tin", "unknown", "us_ein", "uy_ruc", "uz_tin", "uz_vat", "ve_rif", "vn_tin", "za_vat", "zm_tin", "zw_tin"]), "value": z.string().nullable()})); +const invoices_resource_pretax_credit_amount: z.ZodTypeAny = z.lazy(() => z.object({"amount": z.number().int(), "credit_balance_transaction": z.union([z.string(), billing_credit_balance_transaction]).nullable().optional(), "discount": z.union([z.string(), discount, deleted_discount]).optional(), "type": z.enum(["credit_balance_transaction", "discount"])})); +const invoices_resource_shipping_cost = z.lazy(() => z.object({"amount_subtotal": z.number().int(), "amount_tax": z.number().int(), "amount_total": z.number().int(), "shipping_rate": z.union([z.string(), shipping_rate]).nullable(), "taxes": z.array(line_items_tax_amount).optional()})); +const invoices_resource_status_transitions = z.lazy(() => z.object({"finalized_at": z.number().int().nullable(), "marked_uncollectible_at": z.number().int().nullable(), "paid_at": z.number().int().nullable(), "voided_at": z.number().int().nullable()})); +const issuing_authorization: z.ZodTypeAny = z.lazy(() => z.object({"amount": z.number().int(), "amount_details": issuing_authorization_amount_details.nullable(), "approved": z.boolean(), "authorization_method": z.enum(["chip", "contactless", "keyed_in", "online", "swipe"]), "balance_transactions": z.array(balance_transaction), "card": issuing_card, "card_presence": z.enum(["not_present", "present"]).nullable(), "cardholder": z.union([z.string(), issuing_cardholder]).nullable(), "created": z.number().int(), "currency": z.string(), "fleet": issuing_authorization_fleet_data.nullable(), "fraud_challenges": z.array(issuing_authorization_fraud_challenge).nullable().optional(), "fuel": issuing_authorization_fuel_data.nullable(), "id": z.string(), "livemode": z.boolean(), "merchant_amount": z.number().int(), "merchant_currency": z.string(), "merchant_data": issuing_authorization_merchant_data, "metadata": z.record(z.string(), z.string()), "network_data": issuing_authorization_network_data.nullable(), "object": z.literal("issuing.authorization"), "pending_request": issuing_authorization_pending_request.nullable(), "request_history": z.array(issuing_authorization_request), "status": z.enum(["closed", "expired", "pending", "reversed"]), "token": z.union([z.string(), issuing_token]).nullable().optional(), "transactions": z.array(issuing_transaction), "treasury": issuing_authorization_treasury.nullable().optional(), "verification_data": issuing_authorization_verification_data, "verified_by_fraud_challenge": z.boolean().nullable(), "wallet": z.string().nullable()})); +const issuing_card: z.ZodTypeAny = z.lazy(() => z.object({"brand": z.string(), "cancellation_reason": z.enum(["design_rejected", "fulfillment_error", "lost", "stolen"]).nullable(), "cardholder": issuing_cardholder, "created": z.number().int(), "currency": z.string(), "cvc": z.string().optional(), "exp_month": z.number().int(), "exp_year": z.number().int(), "financial_account": z.string().nullable().optional(), "id": z.string(), "last4": z.string(), "latest_fraud_warning": issuing_card_fraud_warning.nullable(), "lifecycle_controls": issuing_card_lifecycle_controls.nullable(), "livemode": z.boolean(), "metadata": z.record(z.string(), z.string()), "number": z.string().optional(), "object": z.literal("issuing.card"), "personalization_design": z.union([z.string(), issuing_personalization_design]).nullable(), "replaced_by": z.union([z.string(), issuing_card]).nullable(), "replacement_for": z.union([z.string(), issuing_card]).nullable(), "replacement_reason": z.enum(["damaged", "expired", "fulfillment_error", "lost", "stolen"]).nullable(), "second_line": z.string().nullable(), "shipping": issuing_card_shipping.nullable(), "spending_controls": issuing_card_authorization_controls, "status": z.enum(["active", "canceled", "inactive"]), "type": z.enum(["physical", "virtual"]), "wallets": issuing_card_wallets.nullable()})); +const issuing_cardholder = z.lazy(() => z.object({"billing": issuing_cardholder_address, "company": issuing_cardholder_company.nullable(), "created": z.number().int(), "email": z.string().nullable(), "id": z.string(), "individual": issuing_cardholder_individual.nullable(), "livemode": z.boolean(), "metadata": z.record(z.string(), z.string()), "name": z.string(), "object": z.literal("issuing.cardholder"), "phone_number": z.string().nullable(), "preferred_locales": z.array(z.enum(["de", "en", "es", "fr", "it"])).nullable(), "requirements": issuing_cardholder_requirements, "spending_controls": issuing_cardholder_authorization_controls.nullable(), "status": z.enum(["active", "blocked", "inactive"]), "type": z.enum(["company", "individual"])})); +const issuing_dispute: z.ZodTypeAny = z.lazy(() => z.object({"amount": z.number().int(), "balance_transactions": z.array(balance_transaction).nullable().optional(), "created": z.number().int(), "currency": z.string(), "evidence": issuing_dispute_evidence, "id": z.string(), "livemode": z.boolean(), "loss_reason": z.enum(["cardholder_authentication_issuer_liability", "eci5_token_transaction_with_tavv", "excess_disputes_in_timeframe", "has_not_met_the_minimum_dispute_amount_requirements", "invalid_duplicate_dispute", "invalid_incorrect_amount_dispute", "invalid_no_authorization", "invalid_use_of_disputes", "merchandise_delivered_or_shipped", "merchandise_or_service_as_described", "not_cancelled", "other", "refund_issued", "submitted_beyond_allowable_time_limit", "transaction_3ds_required", "transaction_approved_after_prior_fraud_dispute", "transaction_authorized", "transaction_electronically_read", "transaction_qualifies_for_visa_easy_payment_service", "transaction_unattended"]).optional(), "metadata": z.record(z.string(), z.string()), "object": z.literal("issuing.dispute"), "status": z.enum(["expired", "lost", "submitted", "unsubmitted", "won"]), "transaction": z.union([z.string(), issuing_transaction]), "treasury": issuing_dispute_treasury.nullable().optional()})); +const issuing_personalization_design = z.lazy(() => z.object({"card_logo": z.union([z.string(), file]).nullable(), "carrier_text": issuing_personalization_design_carrier_text.nullable(), "created": z.number().int(), "id": z.string(), "livemode": z.boolean(), "lookup_key": z.string().nullable(), "metadata": z.record(z.string(), z.string()), "name": z.string().nullable(), "object": z.literal("issuing.personalization_design"), "physical_bundle": z.union([z.string(), issuing_physical_bundle]), "preferences": issuing_personalization_design_preferences, "rejection_reasons": issuing_personalization_design_rejection_reasons, "status": z.enum(["active", "inactive", "rejected", "review"])})); +const issuing_physical_bundle = z.lazy(() => z.object({"features": issuing_physical_bundle_features, "id": z.string(), "livemode": z.boolean(), "name": z.string(), "object": z.literal("issuing.physical_bundle"), "status": z.enum(["active", "inactive", "review"]), "type": z.enum(["custom", "standard"])})); +const issuing_token = z.lazy(() => z.object({"card": z.union([z.string(), issuing_card]), "created": z.number().int(), "device_fingerprint": z.string().nullable(), "id": z.string(), "last4": z.string().optional(), "livemode": z.boolean(), "network": z.enum(["mastercard", "visa"]), "network_data": issuing_network_token_network_data.optional(), "network_updated_at": z.number().int(), "object": z.literal("issuing.token"), "status": z.enum(["active", "deleted", "requested", "suspended"]), "wallet_provider": z.enum(["apple_pay", "google_pay", "samsung_pay"]).optional()})); +const issuing_transaction: z.ZodTypeAny = z.lazy(() => z.object({"amount": z.number().int(), "amount_details": issuing_transaction_amount_details.nullable(), "authorization": z.union([z.string(), issuing_authorization]).nullable(), "balance_transaction": z.union([z.string(), balance_transaction]).nullable(), "card": z.union([z.string(), issuing_card]), "cardholder": z.union([z.string(), issuing_cardholder]).nullable(), "created": z.number().int(), "currency": z.string(), "dispute": z.union([z.string(), issuing_dispute]).nullable(), "id": z.string(), "livemode": z.boolean(), "merchant_amount": z.number().int(), "merchant_currency": z.string(), "merchant_data": issuing_authorization_merchant_data, "metadata": z.record(z.string(), z.string()), "network_data": issuing_transaction_network_data.nullable(), "object": z.literal("issuing.transaction"), "purchase_details": issuing_transaction_purchase_details.nullable().optional(), "token": z.union([z.string(), issuing_token]).nullable().optional(), "treasury": issuing_transaction_treasury.nullable().optional(), "type": z.enum(["capture", "refund"]), "wallet": z.enum(["apple_pay", "google_pay", "samsung_pay"]).nullable()})); +const issuing_authorization_amount_details = z.lazy(() => z.object({"atm_fee": z.number().int().nullable(), "cashback_amount": z.number().int().nullable()})); +const issuing_authorization_authentication_exemption = z.lazy(() => z.object({"claimed_by": z.enum(["acquirer", "issuer"]), "type": z.enum(["low_value_transaction", "transaction_risk_analysis", "unknown"])})); +const issuing_authorization_fleet_cardholder_prompt_data = z.lazy(() => z.object({"alphanumeric_id": z.string().nullable(), "driver_id": z.string().nullable(), "odometer": z.number().int().nullable(), "unspecified_id": z.string().nullable(), "user_id": z.string().nullable(), "vehicle_number": z.string().nullable()})); +const issuing_authorization_fleet_data = z.lazy(() => z.object({"cardholder_prompt_data": issuing_authorization_fleet_cardholder_prompt_data.nullable(), "purchase_type": z.enum(["fuel_and_non_fuel_purchase", "fuel_purchase", "non_fuel_purchase"]).nullable(), "reported_breakdown": issuing_authorization_fleet_reported_breakdown.nullable(), "service_type": z.enum(["full_service", "non_fuel_transaction", "self_service"]).nullable()})); +const issuing_authorization_fleet_fuel_price_data = z.lazy(() => z.object({"gross_amount_decimal": z.string().nullable()})); +const issuing_authorization_fleet_non_fuel_price_data = z.lazy(() => z.object({"gross_amount_decimal": z.string().nullable()})); +const issuing_authorization_fleet_reported_breakdown = z.lazy(() => z.object({"fuel": issuing_authorization_fleet_fuel_price_data.nullable(), "non_fuel": issuing_authorization_fleet_non_fuel_price_data.nullable(), "tax": issuing_authorization_fleet_tax_data.nullable()})); +const issuing_authorization_fleet_tax_data = z.lazy(() => z.object({"local_amount_decimal": z.string().nullable(), "national_amount_decimal": z.string().nullable()})); +const issuing_authorization_fraud_challenge = z.lazy(() => z.object({"channel": z.literal("sms"), "status": z.enum(["expired", "pending", "rejected", "undeliverable", "verified"]), "undeliverable_reason": z.enum(["no_phone_number", "unsupported_phone_number"]).nullable()})); +const issuing_authorization_fuel_data = z.lazy(() => z.object({"industry_product_code": z.string().nullable(), "quantity_decimal": z.string().nullable(), "type": z.enum(["diesel", "other", "unleaded_plus", "unleaded_regular", "unleaded_super"]).nullable(), "unit": z.enum(["charging_minute", "imperial_gallon", "kilogram", "kilowatt_hour", "liter", "other", "pound", "us_gallon"]).nullable(), "unit_cost_decimal": z.string().nullable()})); +const issuing_authorization_merchant_data = z.lazy(() => z.object({"category": z.string(), "category_code": z.string(), "city": z.string().nullable(), "country": z.string().nullable(), "name": z.string().nullable(), "network_id": z.string(), "postal_code": z.string().nullable(), "state": z.string().nullable(), "tax_id": z.string().nullable(), "terminal_id": z.string().nullable(), "url": z.string().nullable()})); +const issuing_authorization_network_data = z.lazy(() => z.object({"acquiring_institution_id": z.string().nullable(), "system_trace_audit_number": z.string().nullable(), "transaction_id": z.string().nullable()})); +const issuing_authorization_pending_request = z.lazy(() => z.object({"amount": z.number().int(), "amount_details": issuing_authorization_amount_details.nullable(), "currency": z.string(), "is_amount_controllable": z.boolean(), "merchant_amount": z.number().int(), "merchant_currency": z.string(), "network_risk_score": z.number().int().nullable()})); +const issuing_authorization_request = z.lazy(() => z.object({"amount": z.number().int(), "amount_details": issuing_authorization_amount_details.nullable(), "approved": z.boolean(), "authorization_code": z.string().nullable(), "created": z.number().int(), "currency": z.string(), "merchant_amount": z.number().int(), "merchant_currency": z.string(), "network_risk_score": z.number().int().nullable(), "reason": z.enum(["account_disabled", "card_active", "card_canceled", "card_expired", "card_inactive", "cardholder_blocked", "cardholder_inactive", "cardholder_verification_required", "insecure_authorization_method", "insufficient_funds", "network_fallback", "not_allowed", "pin_blocked", "spending_controls", "suspected_fraud", "verification_failed", "webhook_approved", "webhook_declined", "webhook_error", "webhook_timeout"]), "reason_message": z.string().nullable(), "requested_at": z.number().int().nullable()})); +const issuing_authorization_three_d_secure = z.lazy(() => z.object({"result": z.enum(["attempt_acknowledged", "authenticated", "failed", "required"])})); +const issuing_authorization_treasury = z.lazy(() => z.object({"received_credits": z.array(z.string()), "received_debits": z.array(z.string()), "transaction": z.string().nullable()})); +const issuing_authorization_verification_data = z.lazy(() => z.object({"address_line1_check": z.enum(["match", "mismatch", "not_provided"]), "address_postal_code_check": z.enum(["match", "mismatch", "not_provided"]), "authentication_exemption": issuing_authorization_authentication_exemption.nullable(), "cvc_check": z.enum(["match", "mismatch", "not_provided"]), "expiry_check": z.enum(["match", "mismatch", "not_provided"]), "postal_code": z.string().nullable(), "three_d_secure": issuing_authorization_three_d_secure.nullable()})); +const issuing_card_apple_pay = z.lazy(() => z.object({"eligible": z.boolean(), "ineligible_reason": z.enum(["missing_agreement", "missing_cardholder_contact", "unsupported_region"]).nullable()})); +const issuing_card_authorization_controls = z.lazy(() => z.object({"allowed_card_presences": z.array(z.enum(["not_present", "present"])).nullable(), "allowed_categories": z.array(z.enum(["ac_refrigeration_repair", "accounting_bookkeeping_services", "advertising_services", "agricultural_cooperative", "airlines_air_carriers", "airports_flying_fields", "ambulance_services", "amusement_parks_carnivals", "antique_reproductions", "antique_shops", "aquariums", "architectural_surveying_services", "art_dealers_and_galleries", "artists_supply_and_craft_shops", "auto_and_home_supply_stores", "auto_body_repair_shops", "auto_paint_shops", "auto_service_shops", "automated_cash_disburse", "automated_fuel_dispensers", "automobile_associations", "automotive_parts_and_accessories_stores", "automotive_tire_stores", "bail_and_bond_payments", "bakeries", "bands_orchestras", "barber_and_beauty_shops", "betting_casino_gambling", "bicycle_shops", "billiard_pool_establishments", "boat_dealers", "boat_rentals_and_leases", "book_stores", "books_periodicals_and_newspapers", "bowling_alleys", "bus_lines", "business_secretarial_schools", "buying_shopping_services", "cable_satellite_and_other_pay_television_and_radio", "camera_and_photographic_supply_stores", "candy_nut_and_confectionery_stores", "car_and_truck_dealers_new_used", "car_and_truck_dealers_used_only", "car_rental_agencies", "car_washes", "carpentry_services", "carpet_upholstery_cleaning", "caterers", "charitable_and_social_service_organizations_fundraising", "chemicals_and_allied_products", "child_care_services", "childrens_and_infants_wear_stores", "chiropodists_podiatrists", "chiropractors", "cigar_stores_and_stands", "civic_social_fraternal_associations", "cleaning_and_maintenance", "clothing_rental", "colleges_universities", "commercial_equipment", "commercial_footwear", "commercial_photography_art_and_graphics", "commuter_transport_and_ferries", "computer_network_services", "computer_programming", "computer_repair", "computer_software_stores", "computers_peripherals_and_software", "concrete_work_services", "construction_materials", "consulting_public_relations", "correspondence_schools", "cosmetic_stores", "counseling_services", "country_clubs", "courier_services", "court_costs", "credit_reporting_agencies", "cruise_lines", "dairy_products_stores", "dance_hall_studios_schools", "dating_escort_services", "dentists_orthodontists", "department_stores", "detective_agencies", "digital_goods_applications", "digital_goods_games", "digital_goods_large_volume", "digital_goods_media", "direct_marketing_catalog_merchant", "direct_marketing_combination_catalog_and_retail_merchant", "direct_marketing_inbound_telemarketing", "direct_marketing_insurance_services", "direct_marketing_other", "direct_marketing_outbound_telemarketing", "direct_marketing_subscription", "direct_marketing_travel", "discount_stores", "doctors", "door_to_door_sales", "drapery_window_covering_and_upholstery_stores", "drinking_places", "drug_stores_and_pharmacies", "drugs_drug_proprietaries_and_druggist_sundries", "dry_cleaners", "durable_goods", "duty_free_stores", "eating_places_restaurants", "educational_services", "electric_razor_stores", "electric_vehicle_charging", "electrical_parts_and_equipment", "electrical_services", "electronics_repair_shops", "electronics_stores", "elementary_secondary_schools", "emergency_services_gcas_visa_use_only", "employment_temp_agencies", "equipment_rental", "exterminating_services", "family_clothing_stores", "fast_food_restaurants", "financial_institutions", "fines_government_administrative_entities", "fireplace_fireplace_screens_and_accessories_stores", "floor_covering_stores", "florists", "florists_supplies_nursery_stock_and_flowers", "freezer_and_locker_meat_provisioners", "fuel_dealers_non_automotive", "funeral_services_crematories", "furniture_home_furnishings_and_equipment_stores_except_appliances", "furniture_repair_refinishing", "furriers_and_fur_shops", "general_services", "gift_card_novelty_and_souvenir_shops", "glass_paint_and_wallpaper_stores", "glassware_crystal_stores", "golf_courses_public", "government_licensed_horse_dog_racing_us_region_only", "government_licensed_online_casions_online_gambling_us_region_only", "government_owned_lotteries_non_us_region", "government_owned_lotteries_us_region_only", "government_services", "grocery_stores_supermarkets", "hardware_equipment_and_supplies", "hardware_stores", "health_and_beauty_spas", "hearing_aids_sales_and_supplies", "heating_plumbing_a_c", "hobby_toy_and_game_shops", "home_supply_warehouse_stores", "hospitals", "hotels_motels_and_resorts", "household_appliance_stores", "industrial_supplies", "information_retrieval_services", "insurance_default", "insurance_underwriting_premiums", "intra_company_purchases", "jewelry_stores_watches_clocks_and_silverware_stores", "landscaping_services", "laundries", "laundry_cleaning_services", "legal_services_attorneys", "luggage_and_leather_goods_stores", "lumber_building_materials_stores", "manual_cash_disburse", "marinas_service_and_supplies", "marketplaces", "masonry_stonework_and_plaster", "massage_parlors", "medical_and_dental_labs", "medical_dental_ophthalmic_and_hospital_equipment_and_supplies", "medical_services", "membership_organizations", "mens_and_boys_clothing_and_accessories_stores", "mens_womens_clothing_stores", "metal_service_centers", "miscellaneous", "miscellaneous_apparel_and_accessory_shops", "miscellaneous_auto_dealers", "miscellaneous_business_services", "miscellaneous_food_stores", "miscellaneous_general_merchandise", "miscellaneous_general_services", "miscellaneous_home_furnishing_specialty_stores", "miscellaneous_publishing_and_printing", "miscellaneous_recreation_services", "miscellaneous_repair_shops", "miscellaneous_specialty_retail", "mobile_home_dealers", "motion_picture_theaters", "motor_freight_carriers_and_trucking", "motor_homes_dealers", "motor_vehicle_supplies_and_new_parts", "motorcycle_shops_and_dealers", "motorcycle_shops_dealers", "music_stores_musical_instruments_pianos_and_sheet_music", "news_dealers_and_newsstands", "non_fi_money_orders", "non_fi_stored_value_card_purchase_load", "nondurable_goods", "nurseries_lawn_and_garden_supply_stores", "nursing_personal_care", "office_and_commercial_furniture", "opticians_eyeglasses", "optometrists_ophthalmologist", "orthopedic_goods_prosthetic_devices", "osteopaths", "package_stores_beer_wine_and_liquor", "paints_varnishes_and_supplies", "parking_lots_garages", "passenger_railways", "pawn_shops", "pet_shops_pet_food_and_supplies", "petroleum_and_petroleum_products", "photo_developing", "photographic_photocopy_microfilm_equipment_and_supplies", "photographic_studios", "picture_video_production", "piece_goods_notions_and_other_dry_goods", "plumbing_heating_equipment_and_supplies", "political_organizations", "postal_services_government_only", "precious_stones_and_metals_watches_and_jewelry", "professional_services", "public_warehousing_and_storage", "quick_copy_repro_and_blueprint", "railroads", "real_estate_agents_and_managers_rentals", "record_stores", "recreational_vehicle_rentals", "religious_goods_stores", "religious_organizations", "roofing_siding_sheet_metal", "secretarial_support_services", "security_brokers_dealers", "service_stations", "sewing_needlework_fabric_and_piece_goods_stores", "shoe_repair_hat_cleaning", "shoe_stores", "small_appliance_repair", "snowmobile_dealers", "special_trade_services", "specialty_cleaning", "sporting_goods_stores", "sporting_recreation_camps", "sports_and_riding_apparel_stores", "sports_clubs_fields", "stamp_and_coin_stores", "stationary_office_supplies_printing_and_writing_paper", "stationery_stores_office_and_school_supply_stores", "swimming_pools_sales", "t_ui_travel_germany", "tailors_alterations", "tax_payments_government_agencies", "tax_preparation_services", "taxicabs_limousines", "telecommunication_equipment_and_telephone_sales", "telecommunication_services", "telegraph_services", "tent_and_awning_shops", "testing_laboratories", "theatrical_ticket_agencies", "timeshares", "tire_retreading_and_repair", "tolls_bridge_fees", "tourist_attractions_and_exhibits", "towing_services", "trailer_parks_campgrounds", "transportation_services", "travel_agencies_tour_operators", "truck_stop_iteration", "truck_utility_trailer_rentals", "typesetting_plate_making_and_related_services", "typewriter_stores", "u_s_federal_government_agencies_or_departments", "uniforms_commercial_clothing", "used_merchandise_and_secondhand_stores", "utilities", "variety_stores", "veterinary_services", "video_amusement_game_supplies", "video_game_arcades", "video_tape_rental_stores", "vocational_trade_schools", "watch_jewelry_repair", "welding_repair", "wholesale_clubs", "wig_and_toupee_stores", "wires_money_orders", "womens_accessory_and_specialty_shops", "womens_ready_to_wear_stores", "wrecking_and_salvage_yards"])).nullable(), "allowed_merchant_countries": z.array(z.string()).nullable(), "blocked_card_presences": z.array(z.enum(["not_present", "present"])).nullable(), "blocked_categories": z.array(z.enum(["ac_refrigeration_repair", "accounting_bookkeeping_services", "advertising_services", "agricultural_cooperative", "airlines_air_carriers", "airports_flying_fields", "ambulance_services", "amusement_parks_carnivals", "antique_reproductions", "antique_shops", "aquariums", "architectural_surveying_services", "art_dealers_and_galleries", "artists_supply_and_craft_shops", "auto_and_home_supply_stores", "auto_body_repair_shops", "auto_paint_shops", "auto_service_shops", "automated_cash_disburse", "automated_fuel_dispensers", "automobile_associations", "automotive_parts_and_accessories_stores", "automotive_tire_stores", "bail_and_bond_payments", "bakeries", "bands_orchestras", "barber_and_beauty_shops", "betting_casino_gambling", "bicycle_shops", "billiard_pool_establishments", "boat_dealers", "boat_rentals_and_leases", "book_stores", "books_periodicals_and_newspapers", "bowling_alleys", "bus_lines", "business_secretarial_schools", "buying_shopping_services", "cable_satellite_and_other_pay_television_and_radio", "camera_and_photographic_supply_stores", "candy_nut_and_confectionery_stores", "car_and_truck_dealers_new_used", "car_and_truck_dealers_used_only", "car_rental_agencies", "car_washes", "carpentry_services", "carpet_upholstery_cleaning", "caterers", "charitable_and_social_service_organizations_fundraising", "chemicals_and_allied_products", "child_care_services", "childrens_and_infants_wear_stores", "chiropodists_podiatrists", "chiropractors", "cigar_stores_and_stands", "civic_social_fraternal_associations", "cleaning_and_maintenance", "clothing_rental", "colleges_universities", "commercial_equipment", "commercial_footwear", "commercial_photography_art_and_graphics", "commuter_transport_and_ferries", "computer_network_services", "computer_programming", "computer_repair", "computer_software_stores", "computers_peripherals_and_software", "concrete_work_services", "construction_materials", "consulting_public_relations", "correspondence_schools", "cosmetic_stores", "counseling_services", "country_clubs", "courier_services", "court_costs", "credit_reporting_agencies", "cruise_lines", "dairy_products_stores", "dance_hall_studios_schools", "dating_escort_services", "dentists_orthodontists", "department_stores", "detective_agencies", "digital_goods_applications", "digital_goods_games", "digital_goods_large_volume", "digital_goods_media", "direct_marketing_catalog_merchant", "direct_marketing_combination_catalog_and_retail_merchant", "direct_marketing_inbound_telemarketing", "direct_marketing_insurance_services", "direct_marketing_other", "direct_marketing_outbound_telemarketing", "direct_marketing_subscription", "direct_marketing_travel", "discount_stores", "doctors", "door_to_door_sales", "drapery_window_covering_and_upholstery_stores", "drinking_places", "drug_stores_and_pharmacies", "drugs_drug_proprietaries_and_druggist_sundries", "dry_cleaners", "durable_goods", "duty_free_stores", "eating_places_restaurants", "educational_services", "electric_razor_stores", "electric_vehicle_charging", "electrical_parts_and_equipment", "electrical_services", "electronics_repair_shops", "electronics_stores", "elementary_secondary_schools", "emergency_services_gcas_visa_use_only", "employment_temp_agencies", "equipment_rental", "exterminating_services", "family_clothing_stores", "fast_food_restaurants", "financial_institutions", "fines_government_administrative_entities", "fireplace_fireplace_screens_and_accessories_stores", "floor_covering_stores", "florists", "florists_supplies_nursery_stock_and_flowers", "freezer_and_locker_meat_provisioners", "fuel_dealers_non_automotive", "funeral_services_crematories", "furniture_home_furnishings_and_equipment_stores_except_appliances", "furniture_repair_refinishing", "furriers_and_fur_shops", "general_services", "gift_card_novelty_and_souvenir_shops", "glass_paint_and_wallpaper_stores", "glassware_crystal_stores", "golf_courses_public", "government_licensed_horse_dog_racing_us_region_only", "government_licensed_online_casions_online_gambling_us_region_only", "government_owned_lotteries_non_us_region", "government_owned_lotteries_us_region_only", "government_services", "grocery_stores_supermarkets", "hardware_equipment_and_supplies", "hardware_stores", "health_and_beauty_spas", "hearing_aids_sales_and_supplies", "heating_plumbing_a_c", "hobby_toy_and_game_shops", "home_supply_warehouse_stores", "hospitals", "hotels_motels_and_resorts", "household_appliance_stores", "industrial_supplies", "information_retrieval_services", "insurance_default", "insurance_underwriting_premiums", "intra_company_purchases", "jewelry_stores_watches_clocks_and_silverware_stores", "landscaping_services", "laundries", "laundry_cleaning_services", "legal_services_attorneys", "luggage_and_leather_goods_stores", "lumber_building_materials_stores", "manual_cash_disburse", "marinas_service_and_supplies", "marketplaces", "masonry_stonework_and_plaster", "massage_parlors", "medical_and_dental_labs", "medical_dental_ophthalmic_and_hospital_equipment_and_supplies", "medical_services", "membership_organizations", "mens_and_boys_clothing_and_accessories_stores", "mens_womens_clothing_stores", "metal_service_centers", "miscellaneous", "miscellaneous_apparel_and_accessory_shops", "miscellaneous_auto_dealers", "miscellaneous_business_services", "miscellaneous_food_stores", "miscellaneous_general_merchandise", "miscellaneous_general_services", "miscellaneous_home_furnishing_specialty_stores", "miscellaneous_publishing_and_printing", "miscellaneous_recreation_services", "miscellaneous_repair_shops", "miscellaneous_specialty_retail", "mobile_home_dealers", "motion_picture_theaters", "motor_freight_carriers_and_trucking", "motor_homes_dealers", "motor_vehicle_supplies_and_new_parts", "motorcycle_shops_and_dealers", "motorcycle_shops_dealers", "music_stores_musical_instruments_pianos_and_sheet_music", "news_dealers_and_newsstands", "non_fi_money_orders", "non_fi_stored_value_card_purchase_load", "nondurable_goods", "nurseries_lawn_and_garden_supply_stores", "nursing_personal_care", "office_and_commercial_furniture", "opticians_eyeglasses", "optometrists_ophthalmologist", "orthopedic_goods_prosthetic_devices", "osteopaths", "package_stores_beer_wine_and_liquor", "paints_varnishes_and_supplies", "parking_lots_garages", "passenger_railways", "pawn_shops", "pet_shops_pet_food_and_supplies", "petroleum_and_petroleum_products", "photo_developing", "photographic_photocopy_microfilm_equipment_and_supplies", "photographic_studios", "picture_video_production", "piece_goods_notions_and_other_dry_goods", "plumbing_heating_equipment_and_supplies", "political_organizations", "postal_services_government_only", "precious_stones_and_metals_watches_and_jewelry", "professional_services", "public_warehousing_and_storage", "quick_copy_repro_and_blueprint", "railroads", "real_estate_agents_and_managers_rentals", "record_stores", "recreational_vehicle_rentals", "religious_goods_stores", "religious_organizations", "roofing_siding_sheet_metal", "secretarial_support_services", "security_brokers_dealers", "service_stations", "sewing_needlework_fabric_and_piece_goods_stores", "shoe_repair_hat_cleaning", "shoe_stores", "small_appliance_repair", "snowmobile_dealers", "special_trade_services", "specialty_cleaning", "sporting_goods_stores", "sporting_recreation_camps", "sports_and_riding_apparel_stores", "sports_clubs_fields", "stamp_and_coin_stores", "stationary_office_supplies_printing_and_writing_paper", "stationery_stores_office_and_school_supply_stores", "swimming_pools_sales", "t_ui_travel_germany", "tailors_alterations", "tax_payments_government_agencies", "tax_preparation_services", "taxicabs_limousines", "telecommunication_equipment_and_telephone_sales", "telecommunication_services", "telegraph_services", "tent_and_awning_shops", "testing_laboratories", "theatrical_ticket_agencies", "timeshares", "tire_retreading_and_repair", "tolls_bridge_fees", "tourist_attractions_and_exhibits", "towing_services", "trailer_parks_campgrounds", "transportation_services", "travel_agencies_tour_operators", "truck_stop_iteration", "truck_utility_trailer_rentals", "typesetting_plate_making_and_related_services", "typewriter_stores", "u_s_federal_government_agencies_or_departments", "uniforms_commercial_clothing", "used_merchandise_and_secondhand_stores", "utilities", "variety_stores", "veterinary_services", "video_amusement_game_supplies", "video_game_arcades", "video_tape_rental_stores", "vocational_trade_schools", "watch_jewelry_repair", "welding_repair", "wholesale_clubs", "wig_and_toupee_stores", "wires_money_orders", "womens_accessory_and_specialty_shops", "womens_ready_to_wear_stores", "wrecking_and_salvage_yards"])).nullable(), "blocked_merchant_countries": z.array(z.string()).nullable(), "spending_limits": z.array(issuing_card_spending_limit).nullable(), "spending_limits_currency": z.string().nullable()})); +const issuing_card_fraud_warning = z.lazy(() => z.object({"started_at": z.number().int().nullable(), "type": z.enum(["card_testing_exposure", "fraud_dispute_filed", "third_party_reported", "user_indicated_fraud"]).nullable()})); +const issuing_card_google_pay = z.lazy(() => z.object({"eligible": z.boolean(), "ineligible_reason": z.enum(["missing_agreement", "missing_cardholder_contact", "unsupported_region"]).nullable()})); +const issuing_card_lifecycle_conditions = z.lazy(() => z.object({"payment_count": z.number().int()})); +const issuing_card_lifecycle_controls = z.lazy(() => z.object({"cancel_after": issuing_card_lifecycle_conditions})); +const issuing_card_shipping = z.lazy(() => z.object({"address": address, "address_validation": issuing_card_shipping_address_validation.nullable(), "carrier": z.enum(["dhl", "fedex", "royal_mail", "usps"]).nullable(), "customs": issuing_card_shipping_customs.nullable(), "eta": z.number().int().nullable(), "name": z.string(), "phone_number": z.string().nullable(), "require_signature": z.boolean().nullable(), "service": z.enum(["express", "priority", "standard"]), "status": z.enum(["canceled", "delivered", "failure", "pending", "returned", "shipped", "submitted"]).nullable(), "tracking_number": z.string().nullable(), "tracking_url": z.string().nullable(), "type": z.enum(["bulk", "individual"])})); +const issuing_card_shipping_address_validation = z.lazy(() => z.object({"mode": z.enum(["disabled", "normalization_only", "validation_and_normalization"]), "normalized_address": address.nullable(), "result": z.enum(["indeterminate", "likely_deliverable", "likely_undeliverable"]).nullable()})); +const issuing_card_shipping_customs = z.lazy(() => z.object({"eori_number": z.string().nullable()})); +const issuing_card_spending_limit = z.lazy(() => z.object({"amount": z.number().int(), "categories": z.array(z.enum(["ac_refrigeration_repair", "accounting_bookkeeping_services", "advertising_services", "agricultural_cooperative", "airlines_air_carriers", "airports_flying_fields", "ambulance_services", "amusement_parks_carnivals", "antique_reproductions", "antique_shops", "aquariums", "architectural_surveying_services", "art_dealers_and_galleries", "artists_supply_and_craft_shops", "auto_and_home_supply_stores", "auto_body_repair_shops", "auto_paint_shops", "auto_service_shops", "automated_cash_disburse", "automated_fuel_dispensers", "automobile_associations", "automotive_parts_and_accessories_stores", "automotive_tire_stores", "bail_and_bond_payments", "bakeries", "bands_orchestras", "barber_and_beauty_shops", "betting_casino_gambling", "bicycle_shops", "billiard_pool_establishments", "boat_dealers", "boat_rentals_and_leases", "book_stores", "books_periodicals_and_newspapers", "bowling_alleys", "bus_lines", "business_secretarial_schools", "buying_shopping_services", "cable_satellite_and_other_pay_television_and_radio", "camera_and_photographic_supply_stores", "candy_nut_and_confectionery_stores", "car_and_truck_dealers_new_used", "car_and_truck_dealers_used_only", "car_rental_agencies", "car_washes", "carpentry_services", "carpet_upholstery_cleaning", "caterers", "charitable_and_social_service_organizations_fundraising", "chemicals_and_allied_products", "child_care_services", "childrens_and_infants_wear_stores", "chiropodists_podiatrists", "chiropractors", "cigar_stores_and_stands", "civic_social_fraternal_associations", "cleaning_and_maintenance", "clothing_rental", "colleges_universities", "commercial_equipment", "commercial_footwear", "commercial_photography_art_and_graphics", "commuter_transport_and_ferries", "computer_network_services", "computer_programming", "computer_repair", "computer_software_stores", "computers_peripherals_and_software", "concrete_work_services", "construction_materials", "consulting_public_relations", "correspondence_schools", "cosmetic_stores", "counseling_services", "country_clubs", "courier_services", "court_costs", "credit_reporting_agencies", "cruise_lines", "dairy_products_stores", "dance_hall_studios_schools", "dating_escort_services", "dentists_orthodontists", "department_stores", "detective_agencies", "digital_goods_applications", "digital_goods_games", "digital_goods_large_volume", "digital_goods_media", "direct_marketing_catalog_merchant", "direct_marketing_combination_catalog_and_retail_merchant", "direct_marketing_inbound_telemarketing", "direct_marketing_insurance_services", "direct_marketing_other", "direct_marketing_outbound_telemarketing", "direct_marketing_subscription", "direct_marketing_travel", "discount_stores", "doctors", "door_to_door_sales", "drapery_window_covering_and_upholstery_stores", "drinking_places", "drug_stores_and_pharmacies", "drugs_drug_proprietaries_and_druggist_sundries", "dry_cleaners", "durable_goods", "duty_free_stores", "eating_places_restaurants", "educational_services", "electric_razor_stores", "electric_vehicle_charging", "electrical_parts_and_equipment", "electrical_services", "electronics_repair_shops", "electronics_stores", "elementary_secondary_schools", "emergency_services_gcas_visa_use_only", "employment_temp_agencies", "equipment_rental", "exterminating_services", "family_clothing_stores", "fast_food_restaurants", "financial_institutions", "fines_government_administrative_entities", "fireplace_fireplace_screens_and_accessories_stores", "floor_covering_stores", "florists", "florists_supplies_nursery_stock_and_flowers", "freezer_and_locker_meat_provisioners", "fuel_dealers_non_automotive", "funeral_services_crematories", "furniture_home_furnishings_and_equipment_stores_except_appliances", "furniture_repair_refinishing", "furriers_and_fur_shops", "general_services", "gift_card_novelty_and_souvenir_shops", "glass_paint_and_wallpaper_stores", "glassware_crystal_stores", "golf_courses_public", "government_licensed_horse_dog_racing_us_region_only", "government_licensed_online_casions_online_gambling_us_region_only", "government_owned_lotteries_non_us_region", "government_owned_lotteries_us_region_only", "government_services", "grocery_stores_supermarkets", "hardware_equipment_and_supplies", "hardware_stores", "health_and_beauty_spas", "hearing_aids_sales_and_supplies", "heating_plumbing_a_c", "hobby_toy_and_game_shops", "home_supply_warehouse_stores", "hospitals", "hotels_motels_and_resorts", "household_appliance_stores", "industrial_supplies", "information_retrieval_services", "insurance_default", "insurance_underwriting_premiums", "intra_company_purchases", "jewelry_stores_watches_clocks_and_silverware_stores", "landscaping_services", "laundries", "laundry_cleaning_services", "legal_services_attorneys", "luggage_and_leather_goods_stores", "lumber_building_materials_stores", "manual_cash_disburse", "marinas_service_and_supplies", "marketplaces", "masonry_stonework_and_plaster", "massage_parlors", "medical_and_dental_labs", "medical_dental_ophthalmic_and_hospital_equipment_and_supplies", "medical_services", "membership_organizations", "mens_and_boys_clothing_and_accessories_stores", "mens_womens_clothing_stores", "metal_service_centers", "miscellaneous", "miscellaneous_apparel_and_accessory_shops", "miscellaneous_auto_dealers", "miscellaneous_business_services", "miscellaneous_food_stores", "miscellaneous_general_merchandise", "miscellaneous_general_services", "miscellaneous_home_furnishing_specialty_stores", "miscellaneous_publishing_and_printing", "miscellaneous_recreation_services", "miscellaneous_repair_shops", "miscellaneous_specialty_retail", "mobile_home_dealers", "motion_picture_theaters", "motor_freight_carriers_and_trucking", "motor_homes_dealers", "motor_vehicle_supplies_and_new_parts", "motorcycle_shops_and_dealers", "motorcycle_shops_dealers", "music_stores_musical_instruments_pianos_and_sheet_music", "news_dealers_and_newsstands", "non_fi_money_orders", "non_fi_stored_value_card_purchase_load", "nondurable_goods", "nurseries_lawn_and_garden_supply_stores", "nursing_personal_care", "office_and_commercial_furniture", "opticians_eyeglasses", "optometrists_ophthalmologist", "orthopedic_goods_prosthetic_devices", "osteopaths", "package_stores_beer_wine_and_liquor", "paints_varnishes_and_supplies", "parking_lots_garages", "passenger_railways", "pawn_shops", "pet_shops_pet_food_and_supplies", "petroleum_and_petroleum_products", "photo_developing", "photographic_photocopy_microfilm_equipment_and_supplies", "photographic_studios", "picture_video_production", "piece_goods_notions_and_other_dry_goods", "plumbing_heating_equipment_and_supplies", "political_organizations", "postal_services_government_only", "precious_stones_and_metals_watches_and_jewelry", "professional_services", "public_warehousing_and_storage", "quick_copy_repro_and_blueprint", "railroads", "real_estate_agents_and_managers_rentals", "record_stores", "recreational_vehicle_rentals", "religious_goods_stores", "religious_organizations", "roofing_siding_sheet_metal", "secretarial_support_services", "security_brokers_dealers", "service_stations", "sewing_needlework_fabric_and_piece_goods_stores", "shoe_repair_hat_cleaning", "shoe_stores", "small_appliance_repair", "snowmobile_dealers", "special_trade_services", "specialty_cleaning", "sporting_goods_stores", "sporting_recreation_camps", "sports_and_riding_apparel_stores", "sports_clubs_fields", "stamp_and_coin_stores", "stationary_office_supplies_printing_and_writing_paper", "stationery_stores_office_and_school_supply_stores", "swimming_pools_sales", "t_ui_travel_germany", "tailors_alterations", "tax_payments_government_agencies", "tax_preparation_services", "taxicabs_limousines", "telecommunication_equipment_and_telephone_sales", "telecommunication_services", "telegraph_services", "tent_and_awning_shops", "testing_laboratories", "theatrical_ticket_agencies", "timeshares", "tire_retreading_and_repair", "tolls_bridge_fees", "tourist_attractions_and_exhibits", "towing_services", "trailer_parks_campgrounds", "transportation_services", "travel_agencies_tour_operators", "truck_stop_iteration", "truck_utility_trailer_rentals", "typesetting_plate_making_and_related_services", "typewriter_stores", "u_s_federal_government_agencies_or_departments", "uniforms_commercial_clothing", "used_merchandise_and_secondhand_stores", "utilities", "variety_stores", "veterinary_services", "video_amusement_game_supplies", "video_game_arcades", "video_tape_rental_stores", "vocational_trade_schools", "watch_jewelry_repair", "welding_repair", "wholesale_clubs", "wig_and_toupee_stores", "wires_money_orders", "womens_accessory_and_specialty_shops", "womens_ready_to_wear_stores", "wrecking_and_salvage_yards"])).nullable(), "interval": z.enum(["all_time", "daily", "monthly", "per_authorization", "weekly", "yearly"])})); +const issuing_card_wallets = z.lazy(() => z.object({"apple_pay": issuing_card_apple_pay, "google_pay": issuing_card_google_pay, "primary_account_identifier": z.string().nullable()})); +const issuing_cardholder_address = z.lazy(() => z.object({"address": address})); +const issuing_cardholder_authorization_controls = z.lazy(() => z.object({"allowed_card_presences": z.array(z.enum(["not_present", "present"])).nullable(), "allowed_categories": z.array(z.enum(["ac_refrigeration_repair", "accounting_bookkeeping_services", "advertising_services", "agricultural_cooperative", "airlines_air_carriers", "airports_flying_fields", "ambulance_services", "amusement_parks_carnivals", "antique_reproductions", "antique_shops", "aquariums", "architectural_surveying_services", "art_dealers_and_galleries", "artists_supply_and_craft_shops", "auto_and_home_supply_stores", "auto_body_repair_shops", "auto_paint_shops", "auto_service_shops", "automated_cash_disburse", "automated_fuel_dispensers", "automobile_associations", "automotive_parts_and_accessories_stores", "automotive_tire_stores", "bail_and_bond_payments", "bakeries", "bands_orchestras", "barber_and_beauty_shops", "betting_casino_gambling", "bicycle_shops", "billiard_pool_establishments", "boat_dealers", "boat_rentals_and_leases", "book_stores", "books_periodicals_and_newspapers", "bowling_alleys", "bus_lines", "business_secretarial_schools", "buying_shopping_services", "cable_satellite_and_other_pay_television_and_radio", "camera_and_photographic_supply_stores", "candy_nut_and_confectionery_stores", "car_and_truck_dealers_new_used", "car_and_truck_dealers_used_only", "car_rental_agencies", "car_washes", "carpentry_services", "carpet_upholstery_cleaning", "caterers", "charitable_and_social_service_organizations_fundraising", "chemicals_and_allied_products", "child_care_services", "childrens_and_infants_wear_stores", "chiropodists_podiatrists", "chiropractors", "cigar_stores_and_stands", "civic_social_fraternal_associations", "cleaning_and_maintenance", "clothing_rental", "colleges_universities", "commercial_equipment", "commercial_footwear", "commercial_photography_art_and_graphics", "commuter_transport_and_ferries", "computer_network_services", "computer_programming", "computer_repair", "computer_software_stores", "computers_peripherals_and_software", "concrete_work_services", "construction_materials", "consulting_public_relations", "correspondence_schools", "cosmetic_stores", "counseling_services", "country_clubs", "courier_services", "court_costs", "credit_reporting_agencies", "cruise_lines", "dairy_products_stores", "dance_hall_studios_schools", "dating_escort_services", "dentists_orthodontists", "department_stores", "detective_agencies", "digital_goods_applications", "digital_goods_games", "digital_goods_large_volume", "digital_goods_media", "direct_marketing_catalog_merchant", "direct_marketing_combination_catalog_and_retail_merchant", "direct_marketing_inbound_telemarketing", "direct_marketing_insurance_services", "direct_marketing_other", "direct_marketing_outbound_telemarketing", "direct_marketing_subscription", "direct_marketing_travel", "discount_stores", "doctors", "door_to_door_sales", "drapery_window_covering_and_upholstery_stores", "drinking_places", "drug_stores_and_pharmacies", "drugs_drug_proprietaries_and_druggist_sundries", "dry_cleaners", "durable_goods", "duty_free_stores", "eating_places_restaurants", "educational_services", "electric_razor_stores", "electric_vehicle_charging", "electrical_parts_and_equipment", "electrical_services", "electronics_repair_shops", "electronics_stores", "elementary_secondary_schools", "emergency_services_gcas_visa_use_only", "employment_temp_agencies", "equipment_rental", "exterminating_services", "family_clothing_stores", "fast_food_restaurants", "financial_institutions", "fines_government_administrative_entities", "fireplace_fireplace_screens_and_accessories_stores", "floor_covering_stores", "florists", "florists_supplies_nursery_stock_and_flowers", "freezer_and_locker_meat_provisioners", "fuel_dealers_non_automotive", "funeral_services_crematories", "furniture_home_furnishings_and_equipment_stores_except_appliances", "furniture_repair_refinishing", "furriers_and_fur_shops", "general_services", "gift_card_novelty_and_souvenir_shops", "glass_paint_and_wallpaper_stores", "glassware_crystal_stores", "golf_courses_public", "government_licensed_horse_dog_racing_us_region_only", "government_licensed_online_casions_online_gambling_us_region_only", "government_owned_lotteries_non_us_region", "government_owned_lotteries_us_region_only", "government_services", "grocery_stores_supermarkets", "hardware_equipment_and_supplies", "hardware_stores", "health_and_beauty_spas", "hearing_aids_sales_and_supplies", "heating_plumbing_a_c", "hobby_toy_and_game_shops", "home_supply_warehouse_stores", "hospitals", "hotels_motels_and_resorts", "household_appliance_stores", "industrial_supplies", "information_retrieval_services", "insurance_default", "insurance_underwriting_premiums", "intra_company_purchases", "jewelry_stores_watches_clocks_and_silverware_stores", "landscaping_services", "laundries", "laundry_cleaning_services", "legal_services_attorneys", "luggage_and_leather_goods_stores", "lumber_building_materials_stores", "manual_cash_disburse", "marinas_service_and_supplies", "marketplaces", "masonry_stonework_and_plaster", "massage_parlors", "medical_and_dental_labs", "medical_dental_ophthalmic_and_hospital_equipment_and_supplies", "medical_services", "membership_organizations", "mens_and_boys_clothing_and_accessories_stores", "mens_womens_clothing_stores", "metal_service_centers", "miscellaneous", "miscellaneous_apparel_and_accessory_shops", "miscellaneous_auto_dealers", "miscellaneous_business_services", "miscellaneous_food_stores", "miscellaneous_general_merchandise", "miscellaneous_general_services", "miscellaneous_home_furnishing_specialty_stores", "miscellaneous_publishing_and_printing", "miscellaneous_recreation_services", "miscellaneous_repair_shops", "miscellaneous_specialty_retail", "mobile_home_dealers", "motion_picture_theaters", "motor_freight_carriers_and_trucking", "motor_homes_dealers", "motor_vehicle_supplies_and_new_parts", "motorcycle_shops_and_dealers", "motorcycle_shops_dealers", "music_stores_musical_instruments_pianos_and_sheet_music", "news_dealers_and_newsstands", "non_fi_money_orders", "non_fi_stored_value_card_purchase_load", "nondurable_goods", "nurseries_lawn_and_garden_supply_stores", "nursing_personal_care", "office_and_commercial_furniture", "opticians_eyeglasses", "optometrists_ophthalmologist", "orthopedic_goods_prosthetic_devices", "osteopaths", "package_stores_beer_wine_and_liquor", "paints_varnishes_and_supplies", "parking_lots_garages", "passenger_railways", "pawn_shops", "pet_shops_pet_food_and_supplies", "petroleum_and_petroleum_products", "photo_developing", "photographic_photocopy_microfilm_equipment_and_supplies", "photographic_studios", "picture_video_production", "piece_goods_notions_and_other_dry_goods", "plumbing_heating_equipment_and_supplies", "political_organizations", "postal_services_government_only", "precious_stones_and_metals_watches_and_jewelry", "professional_services", "public_warehousing_and_storage", "quick_copy_repro_and_blueprint", "railroads", "real_estate_agents_and_managers_rentals", "record_stores", "recreational_vehicle_rentals", "religious_goods_stores", "religious_organizations", "roofing_siding_sheet_metal", "secretarial_support_services", "security_brokers_dealers", "service_stations", "sewing_needlework_fabric_and_piece_goods_stores", "shoe_repair_hat_cleaning", "shoe_stores", "small_appliance_repair", "snowmobile_dealers", "special_trade_services", "specialty_cleaning", "sporting_goods_stores", "sporting_recreation_camps", "sports_and_riding_apparel_stores", "sports_clubs_fields", "stamp_and_coin_stores", "stationary_office_supplies_printing_and_writing_paper", "stationery_stores_office_and_school_supply_stores", "swimming_pools_sales", "t_ui_travel_germany", "tailors_alterations", "tax_payments_government_agencies", "tax_preparation_services", "taxicabs_limousines", "telecommunication_equipment_and_telephone_sales", "telecommunication_services", "telegraph_services", "tent_and_awning_shops", "testing_laboratories", "theatrical_ticket_agencies", "timeshares", "tire_retreading_and_repair", "tolls_bridge_fees", "tourist_attractions_and_exhibits", "towing_services", "trailer_parks_campgrounds", "transportation_services", "travel_agencies_tour_operators", "truck_stop_iteration", "truck_utility_trailer_rentals", "typesetting_plate_making_and_related_services", "typewriter_stores", "u_s_federal_government_agencies_or_departments", "uniforms_commercial_clothing", "used_merchandise_and_secondhand_stores", "utilities", "variety_stores", "veterinary_services", "video_amusement_game_supplies", "video_game_arcades", "video_tape_rental_stores", "vocational_trade_schools", "watch_jewelry_repair", "welding_repair", "wholesale_clubs", "wig_and_toupee_stores", "wires_money_orders", "womens_accessory_and_specialty_shops", "womens_ready_to_wear_stores", "wrecking_and_salvage_yards"])).nullable(), "allowed_merchant_countries": z.array(z.string()).nullable(), "blocked_card_presences": z.array(z.enum(["not_present", "present"])).nullable(), "blocked_categories": z.array(z.enum(["ac_refrigeration_repair", "accounting_bookkeeping_services", "advertising_services", "agricultural_cooperative", "airlines_air_carriers", "airports_flying_fields", "ambulance_services", "amusement_parks_carnivals", "antique_reproductions", "antique_shops", "aquariums", "architectural_surveying_services", "art_dealers_and_galleries", "artists_supply_and_craft_shops", "auto_and_home_supply_stores", "auto_body_repair_shops", "auto_paint_shops", "auto_service_shops", "automated_cash_disburse", "automated_fuel_dispensers", "automobile_associations", "automotive_parts_and_accessories_stores", "automotive_tire_stores", "bail_and_bond_payments", "bakeries", "bands_orchestras", "barber_and_beauty_shops", "betting_casino_gambling", "bicycle_shops", "billiard_pool_establishments", "boat_dealers", "boat_rentals_and_leases", "book_stores", "books_periodicals_and_newspapers", "bowling_alleys", "bus_lines", "business_secretarial_schools", "buying_shopping_services", "cable_satellite_and_other_pay_television_and_radio", "camera_and_photographic_supply_stores", "candy_nut_and_confectionery_stores", "car_and_truck_dealers_new_used", "car_and_truck_dealers_used_only", "car_rental_agencies", "car_washes", "carpentry_services", "carpet_upholstery_cleaning", "caterers", "charitable_and_social_service_organizations_fundraising", "chemicals_and_allied_products", "child_care_services", "childrens_and_infants_wear_stores", "chiropodists_podiatrists", "chiropractors", "cigar_stores_and_stands", "civic_social_fraternal_associations", "cleaning_and_maintenance", "clothing_rental", "colleges_universities", "commercial_equipment", "commercial_footwear", "commercial_photography_art_and_graphics", "commuter_transport_and_ferries", "computer_network_services", "computer_programming", "computer_repair", "computer_software_stores", "computers_peripherals_and_software", "concrete_work_services", "construction_materials", "consulting_public_relations", "correspondence_schools", "cosmetic_stores", "counseling_services", "country_clubs", "courier_services", "court_costs", "credit_reporting_agencies", "cruise_lines", "dairy_products_stores", "dance_hall_studios_schools", "dating_escort_services", "dentists_orthodontists", "department_stores", "detective_agencies", "digital_goods_applications", "digital_goods_games", "digital_goods_large_volume", "digital_goods_media", "direct_marketing_catalog_merchant", "direct_marketing_combination_catalog_and_retail_merchant", "direct_marketing_inbound_telemarketing", "direct_marketing_insurance_services", "direct_marketing_other", "direct_marketing_outbound_telemarketing", "direct_marketing_subscription", "direct_marketing_travel", "discount_stores", "doctors", "door_to_door_sales", "drapery_window_covering_and_upholstery_stores", "drinking_places", "drug_stores_and_pharmacies", "drugs_drug_proprietaries_and_druggist_sundries", "dry_cleaners", "durable_goods", "duty_free_stores", "eating_places_restaurants", "educational_services", "electric_razor_stores", "electric_vehicle_charging", "electrical_parts_and_equipment", "electrical_services", "electronics_repair_shops", "electronics_stores", "elementary_secondary_schools", "emergency_services_gcas_visa_use_only", "employment_temp_agencies", "equipment_rental", "exterminating_services", "family_clothing_stores", "fast_food_restaurants", "financial_institutions", "fines_government_administrative_entities", "fireplace_fireplace_screens_and_accessories_stores", "floor_covering_stores", "florists", "florists_supplies_nursery_stock_and_flowers", "freezer_and_locker_meat_provisioners", "fuel_dealers_non_automotive", "funeral_services_crematories", "furniture_home_furnishings_and_equipment_stores_except_appliances", "furniture_repair_refinishing", "furriers_and_fur_shops", "general_services", "gift_card_novelty_and_souvenir_shops", "glass_paint_and_wallpaper_stores", "glassware_crystal_stores", "golf_courses_public", "government_licensed_horse_dog_racing_us_region_only", "government_licensed_online_casions_online_gambling_us_region_only", "government_owned_lotteries_non_us_region", "government_owned_lotteries_us_region_only", "government_services", "grocery_stores_supermarkets", "hardware_equipment_and_supplies", "hardware_stores", "health_and_beauty_spas", "hearing_aids_sales_and_supplies", "heating_plumbing_a_c", "hobby_toy_and_game_shops", "home_supply_warehouse_stores", "hospitals", "hotels_motels_and_resorts", "household_appliance_stores", "industrial_supplies", "information_retrieval_services", "insurance_default", "insurance_underwriting_premiums", "intra_company_purchases", "jewelry_stores_watches_clocks_and_silverware_stores", "landscaping_services", "laundries", "laundry_cleaning_services", "legal_services_attorneys", "luggage_and_leather_goods_stores", "lumber_building_materials_stores", "manual_cash_disburse", "marinas_service_and_supplies", "marketplaces", "masonry_stonework_and_plaster", "massage_parlors", "medical_and_dental_labs", "medical_dental_ophthalmic_and_hospital_equipment_and_supplies", "medical_services", "membership_organizations", "mens_and_boys_clothing_and_accessories_stores", "mens_womens_clothing_stores", "metal_service_centers", "miscellaneous", "miscellaneous_apparel_and_accessory_shops", "miscellaneous_auto_dealers", "miscellaneous_business_services", "miscellaneous_food_stores", "miscellaneous_general_merchandise", "miscellaneous_general_services", "miscellaneous_home_furnishing_specialty_stores", "miscellaneous_publishing_and_printing", "miscellaneous_recreation_services", "miscellaneous_repair_shops", "miscellaneous_specialty_retail", "mobile_home_dealers", "motion_picture_theaters", "motor_freight_carriers_and_trucking", "motor_homes_dealers", "motor_vehicle_supplies_and_new_parts", "motorcycle_shops_and_dealers", "motorcycle_shops_dealers", "music_stores_musical_instruments_pianos_and_sheet_music", "news_dealers_and_newsstands", "non_fi_money_orders", "non_fi_stored_value_card_purchase_load", "nondurable_goods", "nurseries_lawn_and_garden_supply_stores", "nursing_personal_care", "office_and_commercial_furniture", "opticians_eyeglasses", "optometrists_ophthalmologist", "orthopedic_goods_prosthetic_devices", "osteopaths", "package_stores_beer_wine_and_liquor", "paints_varnishes_and_supplies", "parking_lots_garages", "passenger_railways", "pawn_shops", "pet_shops_pet_food_and_supplies", "petroleum_and_petroleum_products", "photo_developing", "photographic_photocopy_microfilm_equipment_and_supplies", "photographic_studios", "picture_video_production", "piece_goods_notions_and_other_dry_goods", "plumbing_heating_equipment_and_supplies", "political_organizations", "postal_services_government_only", "precious_stones_and_metals_watches_and_jewelry", "professional_services", "public_warehousing_and_storage", "quick_copy_repro_and_blueprint", "railroads", "real_estate_agents_and_managers_rentals", "record_stores", "recreational_vehicle_rentals", "religious_goods_stores", "religious_organizations", "roofing_siding_sheet_metal", "secretarial_support_services", "security_brokers_dealers", "service_stations", "sewing_needlework_fabric_and_piece_goods_stores", "shoe_repair_hat_cleaning", "shoe_stores", "small_appliance_repair", "snowmobile_dealers", "special_trade_services", "specialty_cleaning", "sporting_goods_stores", "sporting_recreation_camps", "sports_and_riding_apparel_stores", "sports_clubs_fields", "stamp_and_coin_stores", "stationary_office_supplies_printing_and_writing_paper", "stationery_stores_office_and_school_supply_stores", "swimming_pools_sales", "t_ui_travel_germany", "tailors_alterations", "tax_payments_government_agencies", "tax_preparation_services", "taxicabs_limousines", "telecommunication_equipment_and_telephone_sales", "telecommunication_services", "telegraph_services", "tent_and_awning_shops", "testing_laboratories", "theatrical_ticket_agencies", "timeshares", "tire_retreading_and_repair", "tolls_bridge_fees", "tourist_attractions_and_exhibits", "towing_services", "trailer_parks_campgrounds", "transportation_services", "travel_agencies_tour_operators", "truck_stop_iteration", "truck_utility_trailer_rentals", "typesetting_plate_making_and_related_services", "typewriter_stores", "u_s_federal_government_agencies_or_departments", "uniforms_commercial_clothing", "used_merchandise_and_secondhand_stores", "utilities", "variety_stores", "veterinary_services", "video_amusement_game_supplies", "video_game_arcades", "video_tape_rental_stores", "vocational_trade_schools", "watch_jewelry_repair", "welding_repair", "wholesale_clubs", "wig_and_toupee_stores", "wires_money_orders", "womens_accessory_and_specialty_shops", "womens_ready_to_wear_stores", "wrecking_and_salvage_yards"])).nullable(), "blocked_merchant_countries": z.array(z.string()).nullable(), "spending_limits": z.array(issuing_cardholder_spending_limit).nullable(), "spending_limits_currency": z.string().nullable()})); +const issuing_cardholder_card_issuing = z.lazy(() => z.object({"user_terms_acceptance": issuing_cardholder_user_terms_acceptance.nullable()})); +const issuing_cardholder_company = z.lazy(() => z.object({"tax_id_provided": z.boolean()})); +const issuing_cardholder_id_document = z.lazy(() => z.object({"back": z.union([z.string(), file]).nullable(), "front": z.union([z.string(), file]).nullable()})); +const issuing_cardholder_individual = z.lazy(() => z.object({"card_issuing": issuing_cardholder_card_issuing.nullable().optional(), "dob": issuing_cardholder_individual_dob.nullable(), "first_name": z.string().nullable(), "last_name": z.string().nullable(), "verification": issuing_cardholder_verification.nullable()})); +const issuing_cardholder_individual_dob = z.lazy(() => z.object({"day": z.number().int().nullable(), "month": z.number().int().nullable(), "year": z.number().int().nullable()})); +const issuing_cardholder_requirements = z.lazy(() => z.object({"disabled_reason": z.enum(["listed", "rejected.listed", "requirements.past_due", "under_review"]).nullable(), "past_due": z.array(z.enum(["company.tax_id", "individual.card_issuing.user_terms_acceptance.date", "individual.card_issuing.user_terms_acceptance.ip", "individual.dob.day", "individual.dob.month", "individual.dob.year", "individual.first_name", "individual.last_name", "individual.verification.document"])).nullable()})); +const issuing_cardholder_spending_limit = z.lazy(() => z.object({"amount": z.number().int(), "categories": z.array(z.enum(["ac_refrigeration_repair", "accounting_bookkeeping_services", "advertising_services", "agricultural_cooperative", "airlines_air_carriers", "airports_flying_fields", "ambulance_services", "amusement_parks_carnivals", "antique_reproductions", "antique_shops", "aquariums", "architectural_surveying_services", "art_dealers_and_galleries", "artists_supply_and_craft_shops", "auto_and_home_supply_stores", "auto_body_repair_shops", "auto_paint_shops", "auto_service_shops", "automated_cash_disburse", "automated_fuel_dispensers", "automobile_associations", "automotive_parts_and_accessories_stores", "automotive_tire_stores", "bail_and_bond_payments", "bakeries", "bands_orchestras", "barber_and_beauty_shops", "betting_casino_gambling", "bicycle_shops", "billiard_pool_establishments", "boat_dealers", "boat_rentals_and_leases", "book_stores", "books_periodicals_and_newspapers", "bowling_alleys", "bus_lines", "business_secretarial_schools", "buying_shopping_services", "cable_satellite_and_other_pay_television_and_radio", "camera_and_photographic_supply_stores", "candy_nut_and_confectionery_stores", "car_and_truck_dealers_new_used", "car_and_truck_dealers_used_only", "car_rental_agencies", "car_washes", "carpentry_services", "carpet_upholstery_cleaning", "caterers", "charitable_and_social_service_organizations_fundraising", "chemicals_and_allied_products", "child_care_services", "childrens_and_infants_wear_stores", "chiropodists_podiatrists", "chiropractors", "cigar_stores_and_stands", "civic_social_fraternal_associations", "cleaning_and_maintenance", "clothing_rental", "colleges_universities", "commercial_equipment", "commercial_footwear", "commercial_photography_art_and_graphics", "commuter_transport_and_ferries", "computer_network_services", "computer_programming", "computer_repair", "computer_software_stores", "computers_peripherals_and_software", "concrete_work_services", "construction_materials", "consulting_public_relations", "correspondence_schools", "cosmetic_stores", "counseling_services", "country_clubs", "courier_services", "court_costs", "credit_reporting_agencies", "cruise_lines", "dairy_products_stores", "dance_hall_studios_schools", "dating_escort_services", "dentists_orthodontists", "department_stores", "detective_agencies", "digital_goods_applications", "digital_goods_games", "digital_goods_large_volume", "digital_goods_media", "direct_marketing_catalog_merchant", "direct_marketing_combination_catalog_and_retail_merchant", "direct_marketing_inbound_telemarketing", "direct_marketing_insurance_services", "direct_marketing_other", "direct_marketing_outbound_telemarketing", "direct_marketing_subscription", "direct_marketing_travel", "discount_stores", "doctors", "door_to_door_sales", "drapery_window_covering_and_upholstery_stores", "drinking_places", "drug_stores_and_pharmacies", "drugs_drug_proprietaries_and_druggist_sundries", "dry_cleaners", "durable_goods", "duty_free_stores", "eating_places_restaurants", "educational_services", "electric_razor_stores", "electric_vehicle_charging", "electrical_parts_and_equipment", "electrical_services", "electronics_repair_shops", "electronics_stores", "elementary_secondary_schools", "emergency_services_gcas_visa_use_only", "employment_temp_agencies", "equipment_rental", "exterminating_services", "family_clothing_stores", "fast_food_restaurants", "financial_institutions", "fines_government_administrative_entities", "fireplace_fireplace_screens_and_accessories_stores", "floor_covering_stores", "florists", "florists_supplies_nursery_stock_and_flowers", "freezer_and_locker_meat_provisioners", "fuel_dealers_non_automotive", "funeral_services_crematories", "furniture_home_furnishings_and_equipment_stores_except_appliances", "furniture_repair_refinishing", "furriers_and_fur_shops", "general_services", "gift_card_novelty_and_souvenir_shops", "glass_paint_and_wallpaper_stores", "glassware_crystal_stores", "golf_courses_public", "government_licensed_horse_dog_racing_us_region_only", "government_licensed_online_casions_online_gambling_us_region_only", "government_owned_lotteries_non_us_region", "government_owned_lotteries_us_region_only", "government_services", "grocery_stores_supermarkets", "hardware_equipment_and_supplies", "hardware_stores", "health_and_beauty_spas", "hearing_aids_sales_and_supplies", "heating_plumbing_a_c", "hobby_toy_and_game_shops", "home_supply_warehouse_stores", "hospitals", "hotels_motels_and_resorts", "household_appliance_stores", "industrial_supplies", "information_retrieval_services", "insurance_default", "insurance_underwriting_premiums", "intra_company_purchases", "jewelry_stores_watches_clocks_and_silverware_stores", "landscaping_services", "laundries", "laundry_cleaning_services", "legal_services_attorneys", "luggage_and_leather_goods_stores", "lumber_building_materials_stores", "manual_cash_disburse", "marinas_service_and_supplies", "marketplaces", "masonry_stonework_and_plaster", "massage_parlors", "medical_and_dental_labs", "medical_dental_ophthalmic_and_hospital_equipment_and_supplies", "medical_services", "membership_organizations", "mens_and_boys_clothing_and_accessories_stores", "mens_womens_clothing_stores", "metal_service_centers", "miscellaneous", "miscellaneous_apparel_and_accessory_shops", "miscellaneous_auto_dealers", "miscellaneous_business_services", "miscellaneous_food_stores", "miscellaneous_general_merchandise", "miscellaneous_general_services", "miscellaneous_home_furnishing_specialty_stores", "miscellaneous_publishing_and_printing", "miscellaneous_recreation_services", "miscellaneous_repair_shops", "miscellaneous_specialty_retail", "mobile_home_dealers", "motion_picture_theaters", "motor_freight_carriers_and_trucking", "motor_homes_dealers", "motor_vehicle_supplies_and_new_parts", "motorcycle_shops_and_dealers", "motorcycle_shops_dealers", "music_stores_musical_instruments_pianos_and_sheet_music", "news_dealers_and_newsstands", "non_fi_money_orders", "non_fi_stored_value_card_purchase_load", "nondurable_goods", "nurseries_lawn_and_garden_supply_stores", "nursing_personal_care", "office_and_commercial_furniture", "opticians_eyeglasses", "optometrists_ophthalmologist", "orthopedic_goods_prosthetic_devices", "osteopaths", "package_stores_beer_wine_and_liquor", "paints_varnishes_and_supplies", "parking_lots_garages", "passenger_railways", "pawn_shops", "pet_shops_pet_food_and_supplies", "petroleum_and_petroleum_products", "photo_developing", "photographic_photocopy_microfilm_equipment_and_supplies", "photographic_studios", "picture_video_production", "piece_goods_notions_and_other_dry_goods", "plumbing_heating_equipment_and_supplies", "political_organizations", "postal_services_government_only", "precious_stones_and_metals_watches_and_jewelry", "professional_services", "public_warehousing_and_storage", "quick_copy_repro_and_blueprint", "railroads", "real_estate_agents_and_managers_rentals", "record_stores", "recreational_vehicle_rentals", "religious_goods_stores", "religious_organizations", "roofing_siding_sheet_metal", "secretarial_support_services", "security_brokers_dealers", "service_stations", "sewing_needlework_fabric_and_piece_goods_stores", "shoe_repair_hat_cleaning", "shoe_stores", "small_appliance_repair", "snowmobile_dealers", "special_trade_services", "specialty_cleaning", "sporting_goods_stores", "sporting_recreation_camps", "sports_and_riding_apparel_stores", "sports_clubs_fields", "stamp_and_coin_stores", "stationary_office_supplies_printing_and_writing_paper", "stationery_stores_office_and_school_supply_stores", "swimming_pools_sales", "t_ui_travel_germany", "tailors_alterations", "tax_payments_government_agencies", "tax_preparation_services", "taxicabs_limousines", "telecommunication_equipment_and_telephone_sales", "telecommunication_services", "telegraph_services", "tent_and_awning_shops", "testing_laboratories", "theatrical_ticket_agencies", "timeshares", "tire_retreading_and_repair", "tolls_bridge_fees", "tourist_attractions_and_exhibits", "towing_services", "trailer_parks_campgrounds", "transportation_services", "travel_agencies_tour_operators", "truck_stop_iteration", "truck_utility_trailer_rentals", "typesetting_plate_making_and_related_services", "typewriter_stores", "u_s_federal_government_agencies_or_departments", "uniforms_commercial_clothing", "used_merchandise_and_secondhand_stores", "utilities", "variety_stores", "veterinary_services", "video_amusement_game_supplies", "video_game_arcades", "video_tape_rental_stores", "vocational_trade_schools", "watch_jewelry_repair", "welding_repair", "wholesale_clubs", "wig_and_toupee_stores", "wires_money_orders", "womens_accessory_and_specialty_shops", "womens_ready_to_wear_stores", "wrecking_and_salvage_yards"])).nullable(), "interval": z.enum(["all_time", "daily", "monthly", "per_authorization", "weekly", "yearly"])})); +const issuing_cardholder_user_terms_acceptance = z.lazy(() => z.object({"date": z.number().int().nullable(), "ip": z.string().nullable(), "user_agent": z.string().nullable()})); +const issuing_cardholder_verification = z.lazy(() => z.object({"document": issuing_cardholder_id_document.nullable()})); +const issuing_dispute_canceled_evidence = z.lazy(() => z.object({"additional_documentation": z.union([z.string(), file]).nullable(), "canceled_at": z.number().int().nullable(), "cancellation_policy_provided": z.boolean().nullable(), "cancellation_reason": z.string().nullable(), "expected_at": z.number().int().nullable(), "explanation": z.string().nullable(), "product_description": z.string().nullable(), "product_type": z.enum(["merchandise", "service"]).nullable(), "return_status": z.enum(["merchant_rejected", "successful"]).nullable(), "returned_at": z.number().int().nullable()})); +const issuing_dispute_duplicate_evidence = z.lazy(() => z.object({"additional_documentation": z.union([z.string(), file]).nullable(), "card_statement": z.union([z.string(), file]).nullable(), "cash_receipt": z.union([z.string(), file]).nullable(), "check_image": z.union([z.string(), file]).nullable(), "explanation": z.string().nullable(), "original_transaction": z.string().nullable()})); +const issuing_dispute_evidence = z.lazy(() => z.object({"canceled": issuing_dispute_canceled_evidence.optional(), "duplicate": issuing_dispute_duplicate_evidence.optional(), "fraudulent": issuing_dispute_fraudulent_evidence.optional(), "merchandise_not_as_described": issuing_dispute_merchandise_not_as_described_evidence.optional(), "no_valid_authorization": issuing_dispute_no_valid_authorization_evidence.optional(), "not_received": issuing_dispute_not_received_evidence.optional(), "other": issuing_dispute_other_evidence.optional(), "reason": z.enum(["canceled", "duplicate", "fraudulent", "merchandise_not_as_described", "no_valid_authorization", "not_received", "other", "service_not_as_described"]), "service_not_as_described": issuing_dispute_service_not_as_described_evidence.optional()})); +const issuing_dispute_fraudulent_evidence = z.lazy(() => z.object({"additional_documentation": z.union([z.string(), file]).nullable(), "explanation": z.string().nullable()})); +const issuing_dispute_merchandise_not_as_described_evidence = z.lazy(() => z.object({"additional_documentation": z.union([z.string(), file]).nullable(), "explanation": z.string().nullable(), "received_at": z.number().int().nullable(), "return_description": z.string().nullable(), "return_status": z.enum(["merchant_rejected", "successful"]).nullable(), "returned_at": z.number().int().nullable()})); +const issuing_dispute_no_valid_authorization_evidence = z.lazy(() => z.object({"additional_documentation": z.union([z.string(), file]).nullable(), "explanation": z.string().nullable()})); +const issuing_dispute_not_received_evidence = z.lazy(() => z.object({"additional_documentation": z.union([z.string(), file]).nullable(), "expected_at": z.number().int().nullable(), "explanation": z.string().nullable(), "product_description": z.string().nullable(), "product_type": z.enum(["merchandise", "service"]).nullable()})); +const issuing_dispute_other_evidence = z.lazy(() => z.object({"additional_documentation": z.union([z.string(), file]).nullable(), "explanation": z.string().nullable(), "product_description": z.string().nullable(), "product_type": z.enum(["merchandise", "service"]).nullable()})); +const issuing_dispute_service_not_as_described_evidence = z.lazy(() => z.object({"additional_documentation": z.union([z.string(), file]).nullable(), "canceled_at": z.number().int().nullable(), "cancellation_reason": z.string().nullable(), "explanation": z.string().nullable(), "received_at": z.number().int().nullable()})); +const issuing_dispute_treasury = z.lazy(() => z.object({"debit_reversal": z.string().nullable(), "received_debit": z.string()})); +const issuing_network_token_address = z.lazy(() => z.object({"line1": z.string(), "postal_code": z.string()})); +const issuing_network_token_device = z.lazy(() => z.object({"device_fingerprint": z.string().optional(), "ip_address": z.string().optional(), "location": z.string().optional(), "name": z.string().optional(), "phone_number": z.string().optional(), "type": z.enum(["other", "phone", "watch"]).optional()})); +const issuing_network_token_mastercard = z.lazy(() => z.object({"card_reference_id": z.string().optional(), "token_reference_id": z.string(), "token_requestor_id": z.string(), "token_requestor_name": z.string().optional()})); +const issuing_network_token_network_data = z.lazy(() => z.object({"device": issuing_network_token_device.optional(), "mastercard": issuing_network_token_mastercard.optional(), "type": z.enum(["mastercard", "visa"]), "visa": issuing_network_token_visa.optional(), "wallet_provider": issuing_network_token_wallet_provider.optional()})); +const issuing_network_token_visa = z.lazy(() => z.object({"card_reference_id": z.string().nullable(), "token_reference_id": z.string(), "token_requestor_id": z.string(), "token_risk_score": z.string().optional()})); +const issuing_network_token_wallet_provider = z.lazy(() => z.object({"account_id": z.string().optional(), "account_trust_score": z.number().int().optional(), "card_number_source": z.enum(["app", "manual", "on_file", "other"]).optional(), "cardholder_address": issuing_network_token_address.optional(), "cardholder_name": z.string().optional(), "device_trust_score": z.number().int().optional(), "hashed_account_email_address": z.string().optional(), "reason_codes": z.array(z.enum(["account_card_too_new", "account_recently_changed", "account_too_new", "account_too_new_since_launch", "additional_device", "data_expired", "defer_id_v_decision", "device_recently_lost", "good_activity_history", "has_suspended_tokens", "high_risk", "inactive_account", "long_account_tenure", "low_account_score", "low_device_score", "low_phone_number_score", "network_service_error", "outside_home_territory", "provisioning_cardholder_mismatch", "provisioning_device_and_cardholder_mismatch", "provisioning_device_mismatch", "same_device_no_prior_authentication", "same_device_successful_prior_authentication", "software_update", "suspicious_activity", "too_many_different_cardholders", "too_many_recent_attempts", "too_many_recent_tokens"])).optional(), "suggested_decision": z.enum(["approve", "decline", "require_auth"]).optional(), "suggested_decision_version": z.string().optional()})); +const issuing_personalization_design_carrier_text = z.lazy(() => z.object({"footer_body": z.string().nullable(), "footer_title": z.string().nullable(), "header_body": z.string().nullable(), "header_title": z.string().nullable()})); +const issuing_personalization_design_preferences = z.lazy(() => z.object({"is_default": z.boolean(), "is_platform_default": z.boolean().nullable()})); +const issuing_personalization_design_rejection_reasons = z.lazy(() => z.object({"card_logo": z.array(z.enum(["geographic_location", "inappropriate", "network_name", "non_binary_image", "non_fiat_currency", "other", "other_entity", "promotional_material"])).nullable(), "carrier_text": z.array(z.enum(["geographic_location", "inappropriate", "network_name", "non_fiat_currency", "other", "other_entity", "promotional_material"])).nullable()})); +const issuing_physical_bundle_features = z.lazy(() => z.object({"card_logo": z.enum(["optional", "required", "unsupported"]), "carrier_text": z.enum(["optional", "required", "unsupported"]), "second_line": z.enum(["optional", "required", "unsupported"])})); +const issuing_transaction_amount_details = z.lazy(() => z.object({"atm_fee": z.number().int().nullable(), "cashback_amount": z.number().int().nullable()})); +const issuing_transaction_fleet_cardholder_prompt_data = z.lazy(() => z.object({"driver_id": z.string().nullable(), "odometer": z.number().int().nullable(), "unspecified_id": z.string().nullable(), "user_id": z.string().nullable(), "vehicle_number": z.string().nullable()})); +const issuing_transaction_fleet_data = z.lazy(() => z.object({"cardholder_prompt_data": issuing_transaction_fleet_cardholder_prompt_data.nullable(), "purchase_type": z.string().nullable(), "reported_breakdown": issuing_transaction_fleet_reported_breakdown.nullable(), "service_type": z.string().nullable()})); +const issuing_transaction_fleet_fuel_price_data = z.lazy(() => z.object({"gross_amount_decimal": z.string().nullable()})); +const issuing_transaction_fleet_non_fuel_price_data = z.lazy(() => z.object({"gross_amount_decimal": z.string().nullable()})); +const issuing_transaction_fleet_reported_breakdown = z.lazy(() => z.object({"fuel": issuing_transaction_fleet_fuel_price_data.nullable(), "non_fuel": issuing_transaction_fleet_non_fuel_price_data.nullable(), "tax": issuing_transaction_fleet_tax_data.nullable()})); +const issuing_transaction_fleet_tax_data = z.lazy(() => z.object({"local_amount_decimal": z.string().nullable(), "national_amount_decimal": z.string().nullable()})); +const issuing_transaction_flight_data = z.lazy(() => z.object({"departure_at": z.number().int().nullable(), "passenger_name": z.string().nullable(), "refundable": z.boolean().nullable(), "segments": z.array(issuing_transaction_flight_data_leg).nullable(), "travel_agency": z.string().nullable()})); +const issuing_transaction_flight_data_leg = z.lazy(() => z.object({"arrival_airport_code": z.string().nullable(), "carrier": z.string().nullable(), "departure_airport_code": z.string().nullable(), "flight_number": z.string().nullable(), "service_class": z.string().nullable(), "stopover_allowed": z.boolean().nullable()})); +const issuing_transaction_fuel_data = z.lazy(() => z.object({"industry_product_code": z.string().nullable(), "quantity_decimal": z.string().nullable(), "type": z.string(), "unit": z.string(), "unit_cost_decimal": z.string()})); +const issuing_transaction_lodging_data = z.lazy(() => z.object({"check_in_at": z.number().int().nullable(), "nights": z.number().int().nullable()})); +const issuing_transaction_network_data = z.lazy(() => z.object({"authorization_code": z.string().nullable(), "processing_date": z.string().nullable(), "transaction_id": z.string().nullable()})); +const issuing_transaction_purchase_details = z.lazy(() => z.object({"fleet": issuing_transaction_fleet_data.nullable(), "flight": issuing_transaction_flight_data.nullable(), "fuel": issuing_transaction_fuel_data.nullable(), "lodging": issuing_transaction_lodging_data.nullable(), "receipt": z.array(issuing_transaction_receipt_data).nullable(), "reference": z.string().nullable()})); +const issuing_transaction_receipt_data = z.lazy(() => z.object({"description": z.string().nullable(), "quantity": z.number().nullable(), "total": z.number().int().nullable(), "unit_cost": z.number().int().nullable()})); +const issuing_transaction_treasury = z.lazy(() => z.object({"received_credit": z.string().nullable(), "received_debit": z.string().nullable()})); +const klarna_address = z.lazy(() => z.object({"country": z.string().nullable()})); +const klarna_payer_details = z.lazy(() => z.object({"address": klarna_address.nullable()})); +const legal_entity_company = z.lazy(() => z.object({"address": address.optional(), "address_kana": legal_entity_japan_address.nullable().optional(), "address_kanji": legal_entity_japan_address.nullable().optional(), "directors_provided": z.boolean().optional(), "directorship_declaration": legal_entity_directorship_declaration.nullable().optional(), "executives_provided": z.boolean().optional(), "export_license_id": z.string().optional(), "export_purpose_code": z.string().optional(), "name": z.string().nullable().optional(), "name_kana": z.string().nullable().optional(), "name_kanji": z.string().nullable().optional(), "owners_provided": z.boolean().optional(), "ownership_declaration": legal_entity_ubo_declaration.nullable().optional(), "ownership_exemption_reason": z.enum(["qualified_entity_exceeds_ownership_threshold", "qualifies_as_financial_institution"]).optional(), "phone": z.string().nullable().optional(), "registration_date": legal_entity_registration_date.optional(), "representative_declaration": legal_entity_representative_declaration.nullable().optional(), "structure": z.enum(["free_zone_establishment", "free_zone_llc", "government_instrumentality", "governmental_unit", "incorporated_non_profit", "incorporated_partnership", "limited_liability_partnership", "llc", "multi_member_llc", "private_company", "private_corporation", "private_partnership", "public_company", "public_corporation", "public_partnership", "registered_charity", "single_member_llc", "sole_establishment", "sole_proprietorship", "tax_exempt_government_instrumentality", "unincorporated_association", "unincorporated_non_profit", "unincorporated_partnership"]).optional(), "tax_id_provided": z.boolean().optional(), "tax_id_registrar": z.string().optional(), "vat_id_provided": z.boolean().optional(), "verification": legal_entity_company_verification.nullable().optional()})); +const legal_entity_company_verification = z.lazy(() => z.object({"document": legal_entity_company_verification_document})); +const legal_entity_company_verification_document = z.lazy(() => z.object({"back": z.union([z.string(), file]).nullable(), "details": z.string().nullable(), "details_code": z.string().nullable(), "front": z.union([z.string(), file]).nullable()})); +const legal_entity_directorship_declaration = z.lazy(() => z.object({"date": z.number().int().nullable(), "ip": z.string().nullable(), "user_agent": z.string().nullable()})); +const legal_entity_dob = z.lazy(() => z.object({"day": z.number().int().nullable(), "month": z.number().int().nullable(), "year": z.number().int().nullable()})); +const legal_entity_japan_address = z.lazy(() => z.object({"city": z.string().nullable(), "country": z.string().nullable(), "line1": z.string().nullable(), "line2": z.string().nullable(), "postal_code": z.string().nullable(), "state": z.string().nullable(), "town": z.string().nullable()})); +const legal_entity_person_verification = z.lazy(() => z.object({"additional_document": legal_entity_person_verification_document.nullable().optional(), "details": z.string().nullable().optional(), "details_code": z.string().nullable().optional(), "document": legal_entity_person_verification_document.optional(), "status": z.string()})); +const legal_entity_person_verification_document = z.lazy(() => z.object({"back": z.union([z.string(), file]).nullable(), "details": z.string().nullable(), "details_code": z.string().nullable(), "front": z.union([z.string(), file]).nullable()})); +const legal_entity_registration_date = z.lazy(() => z.object({"day": z.number().int().nullable(), "month": z.number().int().nullable(), "year": z.number().int().nullable()})); +const legal_entity_representative_declaration = z.lazy(() => z.object({"date": z.number().int().nullable(), "ip": z.string().nullable(), "user_agent": z.string().nullable()})); +const legal_entity_ubo_declaration = z.lazy(() => z.object({"date": z.number().int().nullable(), "ip": z.string().nullable(), "user_agent": z.string().nullable()})); +const level3 = z.lazy(() => z.object({"customer_reference": z.string().optional(), "line_items": z.array(level3_line_items), "merchant_reference": z.string(), "shipping_address_zip": z.string().optional(), "shipping_amount": z.number().int().optional(), "shipping_from_zip": z.string().optional()})); +const level3_line_items = z.lazy(() => z.object({"discount_amount": z.number().int().nullable(), "product_code": z.string(), "product_description": z.string(), "quantity": z.number().int().nullable(), "tax_amount": z.number().int().nullable(), "unit_cost": z.number().int().nullable()})); +const line_item: z.ZodTypeAny = z.lazy(() => z.object({"amount": z.number().int(), "currency": z.string(), "description": z.string().nullable(), "discount_amounts": z.array(discounts_resource_discount_amount).nullable(), "discountable": z.boolean(), "discounts": z.array(z.union([z.string(), discount])), "id": z.string(), "invoice": z.string().nullable(), "livemode": z.boolean(), "metadata": z.record(z.string(), z.string()), "object": z.literal("line_item"), "parent": billing_bill_resource_invoicing_lines_parents_invoice_line_item_parent.nullable(), "period": invoice_line_item_period, "pretax_credit_amounts": z.array(invoices_resource_pretax_credit_amount).nullable(), "pricing": billing_bill_resource_invoicing_pricing_pricing.nullable(), "quantity": z.number().int().nullable(), "quantity_decimal": z.string().nullable(), "subscription": z.union([z.string(), subscription]).nullable(), "subtotal": z.number().int(), "taxes": z.array(billing_bill_resource_invoicing_taxes_tax).nullable()})); +const line_items_tax_amount = z.lazy(() => z.object({"amount": z.number().int(), "rate": tax_rate, "taxability_reason": z.enum(["customer_exempt", "not_collecting", "not_subject_to_tax", "not_supported", "portion_product_exempt", "portion_reduced_rated", "portion_standard_rated", "product_exempt", "product_exempt_holiday", "proportionally_rated", "reduced_rated", "reverse_charge", "standard_rated", "taxable_basis_reduced", "zero_rated"]).nullable(), "taxable_amount": z.number().int().nullable()})); +const linked_account_options_common = z.lazy(() => z.object({"filters": payment_flows_private_payment_methods_financial_connections_common_linked_account_options_filters.optional(), "permissions": z.array(z.enum(["balances", "ownership", "payment_method", "transactions"])).optional(), "prefetch": z.array(z.enum(["balances", "ownership", "transactions"])).nullable(), "return_url": z.string().optional()})); +const mandate: z.ZodTypeAny = z.lazy(() => z.object({"customer_acceptance": customer_acceptance, "id": z.string(), "livemode": z.boolean(), "multi_use": mandate_multi_use.optional(), "object": z.literal("mandate"), "on_behalf_of": z.string().optional(), "payment_method": z.union([z.string(), payment_method]), "payment_method_details": mandate_payment_method_details, "single_use": mandate_single_use.optional(), "status": z.enum(["active", "inactive", "pending"]), "type": z.enum(["multi_use", "single_use"])})); +const mandate_acss_debit = z.lazy(() => z.object({"default_for": z.array(z.enum(["invoice", "subscription"])).optional(), "interval_description": z.string().nullable(), "payment_schedule": z.enum(["combined", "interval", "sporadic"]), "transaction_type": z.enum(["business", "personal"])})); const mandate_amazon_pay = z.lazy(() => z.record(z.string(), z.any())); -const mandate_au_becs_debit = z.lazy(() => z.object({"url": z.string()}).passthrough()); -const mandate_bacs_debit = z.lazy(() => z.object({"display_name": z.string().nullable(), "network_status": z.enum(["accepted", "pending", "refused", "revoked"]), "reference": z.string(), "revocation_reason": z.enum(["account_closed", "bank_account_restricted", "bank_ownership_changed", "could_not_process", "debit_not_authorized"]).nullable(), "service_user_number": z.string().nullable(), "url": z.string()}).passthrough()); +const mandate_au_becs_debit = z.lazy(() => z.object({"url": z.string()})); +const mandate_bacs_debit = z.lazy(() => z.object({"display_name": z.string().nullable(), "network_status": z.enum(["accepted", "pending", "refused", "revoked"]), "reference": z.string(), "revocation_reason": z.enum(["account_closed", "bank_account_restricted", "bank_ownership_changed", "could_not_process", "debit_not_authorized"]).nullable(), "service_user_number": z.string().nullable(), "url": z.string()})); const mandate_cashapp = z.lazy(() => z.record(z.string(), z.any())); const mandate_kakao_pay = z.lazy(() => z.record(z.string(), z.any())); const mandate_klarna = z.lazy(() => z.record(z.string(), z.any())); const mandate_kr_card = z.lazy(() => z.record(z.string(), z.any())); const mandate_link = z.lazy(() => z.record(z.string(), z.any())); -const mandate_multi_use = z.lazy(() => z.object({"amount": z.number().int().optional(), "currency": z.string().optional()}).passthrough()); +const mandate_multi_use = z.lazy(() => z.object({"amount": z.number().int().optional(), "currency": z.string().optional()})); const mandate_naver_pay = z.lazy(() => z.record(z.string(), z.any())); const mandate_nz_bank_account = z.lazy(() => z.record(z.string(), z.any())); -const mandate_payment_method_details = z.lazy(() => z.object({"acss_debit": mandate_acss_debit.optional(), "amazon_pay": mandate_amazon_pay.optional(), "au_becs_debit": mandate_au_becs_debit.optional(), "bacs_debit": mandate_bacs_debit.optional(), "card": card_mandate_payment_method_details.optional(), "cashapp": mandate_cashapp.optional(), "kakao_pay": mandate_kakao_pay.optional(), "klarna": mandate_klarna.optional(), "kr_card": mandate_kr_card.optional(), "link": mandate_link.optional(), "naver_pay": mandate_naver_pay.optional(), "nz_bank_account": mandate_nz_bank_account.optional(), "paypal": mandate_paypal.optional(), "payto": mandate_payto.optional(), "pix": mandate_pix.optional(), "revolut_pay": mandate_revolut_pay.optional(), "sepa_debit": mandate_sepa_debit.optional(), "twint": mandate_twint.optional(), "type": z.string(), "upi": mandate_upi.optional(), "us_bank_account": mandate_us_bank_account.optional()}).passthrough()); -const mandate_paypal = z.lazy(() => z.object({"billing_agreement_id": z.string().nullable(), "payer_id": z.string().nullable()}).passthrough()); -const mandate_payto = z.lazy(() => z.object({"amount": z.number().int().nullable(), "amount_type": z.enum(["fixed", "maximum"]), "end_date": z.string().nullable(), "payment_schedule": z.enum(["adhoc", "annual", "daily", "fortnightly", "monthly", "quarterly", "semi_annual", "weekly"]), "payments_per_period": z.number().int().nullable(), "purpose": z.enum(["dependant_support", "government", "loan", "mortgage", "other", "pension", "personal", "retail", "salary", "tax", "utility"]).nullable(), "start_date": z.string().nullable()}).passthrough()); -const mandate_pix = z.lazy(() => z.object({"amount_includes_iof": z.enum(["always", "never"]).optional(), "amount_type": z.enum(["fixed", "maximum"]).optional(), "end_date": z.string().optional(), "payment_schedule": z.enum(["halfyearly", "monthly", "quarterly", "weekly", "yearly"]).optional(), "reference": z.string().optional(), "start_date": z.string().optional()}).passthrough()); +const mandate_payment_method_details = z.lazy(() => z.object({"acss_debit": mandate_acss_debit.optional(), "amazon_pay": mandate_amazon_pay.optional(), "au_becs_debit": mandate_au_becs_debit.optional(), "bacs_debit": mandate_bacs_debit.optional(), "card": card_mandate_payment_method_details.optional(), "cashapp": mandate_cashapp.optional(), "kakao_pay": mandate_kakao_pay.optional(), "klarna": mandate_klarna.optional(), "kr_card": mandate_kr_card.optional(), "link": mandate_link.optional(), "naver_pay": mandate_naver_pay.optional(), "nz_bank_account": mandate_nz_bank_account.optional(), "paypal": mandate_paypal.optional(), "payto": mandate_payto.optional(), "pix": mandate_pix.optional(), "revolut_pay": mandate_revolut_pay.optional(), "sepa_debit": mandate_sepa_debit.optional(), "twint": mandate_twint.optional(), "type": z.string(), "upi": mandate_upi.optional(), "us_bank_account": mandate_us_bank_account.optional()})); +const mandate_paypal = z.lazy(() => z.object({"billing_agreement_id": z.string().nullable(), "payer_id": z.string().nullable()})); +const mandate_payto = z.lazy(() => z.object({"amount": z.number().int().nullable(), "amount_type": z.enum(["fixed", "maximum"]), "end_date": z.string().nullable(), "payment_schedule": z.enum(["adhoc", "annual", "daily", "fortnightly", "monthly", "quarterly", "semi_annual", "weekly"]), "payments_per_period": z.number().int().nullable(), "purpose": z.enum(["dependant_support", "government", "loan", "mortgage", "other", "pension", "personal", "retail", "salary", "tax", "utility"]).nullable(), "start_date": z.string().nullable()})); +const mandate_pix = z.lazy(() => z.object({"amount_includes_iof": z.enum(["always", "never"]).optional(), "amount_type": z.enum(["fixed", "maximum"]).optional(), "end_date": z.string().optional(), "payment_schedule": z.enum(["halfyearly", "monthly", "quarterly", "weekly", "yearly"]).optional(), "reference": z.string().optional(), "start_date": z.string().optional()})); const mandate_revolut_pay = z.lazy(() => z.record(z.string(), z.any())); -const mandate_sepa_debit = z.lazy(() => z.object({"reference": z.string(), "url": z.string()}).passthrough()); -const mandate_single_use = z.lazy(() => z.object({"amount": z.number().int(), "currency": z.string()}).passthrough()); +const mandate_sepa_debit = z.lazy(() => z.object({"reference": z.string(), "url": z.string()})); +const mandate_single_use = z.lazy(() => z.object({"amount": z.number().int(), "currency": z.string()})); const mandate_twint = z.lazy(() => z.record(z.string(), z.any())); -const mandate_upi = z.lazy(() => z.object({"amount": z.number().int().nullable(), "amount_type": z.enum(["fixed", "maximum"]).nullable(), "description": z.string().nullable(), "end_date": z.number().int().nullable()}).passthrough()); -const mandate_us_bank_account = z.lazy(() => z.object({"collection_method": z.literal("paper").optional()}).passthrough()); -const networks = z.lazy(() => z.object({"available": z.array(z.string()), "preferred": z.string().nullable()}).passthrough()); +const mandate_upi = z.lazy(() => z.object({"amount": z.number().int().nullable(), "amount_type": z.enum(["fixed", "maximum"]).nullable(), "description": z.string().nullable(), "end_date": z.number().int().nullable()})); +const mandate_us_bank_account = z.lazy(() => z.object({"collection_method": z.literal("paper").optional()})); +const networks = z.lazy(() => z.object({"available": z.array(z.string()), "preferred": z.string().nullable()})); const offline_acceptance = z.lazy(() => z.record(z.string(), z.any())); -const online_acceptance = z.lazy(() => z.object({"ip_address": z.string().nullable(), "user_agent": z.string().nullable()}).passthrough()); -const package_dimensions = z.lazy(() => z.object({"height": z.number(), "length": z.number(), "weight": z.number(), "width": z.number()}).passthrough()); -const payment_data = z.lazy(() => z.object({"description": z.string().optional(), "metadata": z.record(z.string(), z.string()).optional()}).passthrough()); -const payment_flows_amount_details = z.lazy(() => z.object({"discount_amount": z.number().int().optional(), "error": payment_flows_amount_details_resource_error.optional(), "line_items": z.object({"data": z.array(payment_intent_amount_details_line_item), "has_more": z.boolean(), "object": z.literal("list"), "url": z.string()}).passthrough().optional(), "shipping": payment_flows_amount_details_resource_shipping.optional(), "tax": payment_flows_amount_details_resource_tax.optional(), "tip": payment_flows_amount_details_client_resource_tip.optional()}).passthrough()); -const payment_flows_amount_details_client_resource_tip = z.lazy(() => z.object({"amount": z.number().int().optional()}).passthrough()); -const payment_flows_amount_details_resource_error = z.lazy(() => z.object({"code": z.enum(["amount_details_amount_mismatch", "amount_details_tax_shipping_discount_greater_than_amount"]).nullable(), "message": z.string().nullable()}).passthrough()); -const payment_flows_amount_details_resource_line_items_list_resource_line_item_resource_payment_method_options = z.lazy(() => z.object({"card": payment_flows_private_payment_methods_card_payment_intent_amount_details_line_item_payment_method_options.optional(), "card_present": payment_flows_private_payment_methods_card_present_amount_details_line_item_payment_method_options.optional(), "klarna": payment_flows_private_payment_methods_klarna_payment_intent_amount_details_line_item_payment_method_options.optional(), "paypal": payment_flows_private_payment_methods_paypal_amount_details_line_item_payment_method_options.optional()}).passthrough()); -const payment_flows_amount_details_resource_line_items_list_resource_line_item_resource_tax = z.lazy(() => z.object({"total_tax_amount": z.number().int()}).passthrough()); -const payment_flows_amount_details_resource_shipping = z.lazy(() => z.object({"amount": z.number().int().nullable(), "from_postal_code": z.string().nullable(), "to_postal_code": z.string().nullable()}).passthrough()); -const payment_flows_amount_details_resource_tax = z.lazy(() => z.object({"total_tax_amount": z.number().int().nullable()}).passthrough()); -const payment_flows_automatic_payment_methods_payment_intent = z.lazy(() => z.object({"allow_redirects": z.enum(["always", "never"]).optional(), "enabled": z.boolean()}).passthrough()); -const payment_flows_automatic_payment_methods_setup_intent = z.lazy(() => z.object({"allow_redirects": z.enum(["always", "never"]).optional(), "enabled": z.boolean().nullable()}).passthrough()); -const payment_flows_payment_details = z.lazy(() => z.object({"customer_reference": z.string().nullable(), "order_reference": z.string().nullable()}).passthrough()); -const payment_flows_payment_intent_async_workflows = z.lazy(() => z.object({"inputs": payment_flows_payment_intent_async_workflows_resource_inputs.optional()}).passthrough()); -const payment_flows_payment_intent_async_workflows_resource_inputs = z.lazy(() => z.object({"tax": payment_flows_payment_intent_async_workflows_resource_inputs_resource_tax.optional()}).passthrough()); -const payment_flows_payment_intent_async_workflows_resource_inputs_resource_tax = z.lazy(() => z.object({"calculation": z.string()}).passthrough()); -const payment_flows_payment_intent_presentment_details = z.lazy(() => z.object({"presentment_amount": z.number().int(), "presentment_currency": z.string()}).passthrough()); +const online_acceptance = z.lazy(() => z.object({"ip_address": z.string().nullable(), "user_agent": z.string().nullable()})); +const package_dimensions = z.lazy(() => z.object({"height": z.number(), "length": z.number(), "weight": z.number(), "width": z.number()})); +const payment_data = z.lazy(() => z.object({"description": z.string().optional(), "metadata": z.record(z.string(), z.string()).optional()})); +const payment_flows_amount_details = z.lazy(() => z.object({"discount_amount": z.number().int().optional(), "error": payment_flows_amount_details_resource_error.optional(), "line_items": z.object({"data": z.array(payment_intent_amount_details_line_item), "has_more": z.boolean(), "object": z.literal("list"), "url": z.string()}).optional(), "shipping": payment_flows_amount_details_resource_shipping.optional(), "tax": payment_flows_amount_details_resource_tax.optional(), "tip": payment_flows_amount_details_client_resource_tip.optional()})); +const payment_flows_amount_details_client_resource_tip = z.lazy(() => z.object({"amount": z.number().int().optional()})); +const payment_flows_amount_details_resource_error = z.lazy(() => z.object({"code": z.enum(["amount_details_amount_mismatch", "amount_details_tax_shipping_discount_greater_than_amount"]).nullable(), "message": z.string().nullable()})); +const payment_flows_amount_details_resource_line_items_list_resource_line_item_resource_payment_method_options = z.lazy(() => z.object({"card": payment_flows_private_payment_methods_card_payment_intent_amount_details_line_item_payment_method_options.optional(), "card_present": payment_flows_private_payment_methods_card_present_amount_details_line_item_payment_method_options.optional(), "klarna": payment_flows_private_payment_methods_klarna_payment_intent_amount_details_line_item_payment_method_options.optional(), "paypal": payment_flows_private_payment_methods_paypal_amount_details_line_item_payment_method_options.optional()})); +const payment_flows_amount_details_resource_line_items_list_resource_line_item_resource_tax = z.lazy(() => z.object({"total_tax_amount": z.number().int()})); +const payment_flows_amount_details_resource_shipping = z.lazy(() => z.object({"amount": z.number().int().nullable(), "from_postal_code": z.string().nullable(), "to_postal_code": z.string().nullable()})); +const payment_flows_amount_details_resource_tax = z.lazy(() => z.object({"total_tax_amount": z.number().int().nullable()})); +const payment_flows_automatic_payment_methods_payment_intent = z.lazy(() => z.object({"allow_redirects": z.enum(["always", "never"]).optional(), "enabled": z.boolean()})); +const payment_flows_automatic_payment_methods_setup_intent = z.lazy(() => z.object({"allow_redirects": z.enum(["always", "never"]).optional(), "enabled": z.boolean().nullable()})); +const payment_flows_payment_details = z.lazy(() => z.object({"customer_reference": z.string().nullable(), "order_reference": z.string().nullable()})); +const payment_flows_payment_intent_async_workflows = z.lazy(() => z.object({"inputs": payment_flows_payment_intent_async_workflows_resource_inputs.optional()})); +const payment_flows_payment_intent_async_workflows_resource_inputs = z.lazy(() => z.object({"tax": payment_flows_payment_intent_async_workflows_resource_inputs_resource_tax.optional()})); +const payment_flows_payment_intent_async_workflows_resource_inputs_resource_tax = z.lazy(() => z.object({"calculation": z.string()})); +const payment_flows_payment_intent_presentment_details = z.lazy(() => z.object({"presentment_amount": z.number().int(), "presentment_currency": z.string()})); const payment_flows_private_payment_methods_alipay = z.lazy(() => z.record(z.string(), z.any())); -const payment_flows_private_payment_methods_alipay_details = z.lazy(() => z.object({"buyer_id": z.string().optional(), "fingerprint": z.string().nullable(), "transaction_id": z.string().nullable()}).passthrough()); -const payment_flows_private_payment_methods_card_details_api_resource_enterprise_features_extended_authorization_extended_authorization = z.lazy(() => z.object({"status": z.enum(["disabled", "enabled"])}).passthrough()); -const payment_flows_private_payment_methods_card_details_api_resource_enterprise_features_incremental_authorization_incremental_authorization = z.lazy(() => z.object({"status": z.enum(["available", "unavailable"])}).passthrough()); -const payment_flows_private_payment_methods_card_details_api_resource_enterprise_features_overcapture_overcapture = z.lazy(() => z.object({"maximum_amount_capturable": z.number().int(), "status": z.enum(["available", "unavailable"])}).passthrough()); -const payment_flows_private_payment_methods_card_details_api_resource_multicapture = z.lazy(() => z.object({"status": z.enum(["available", "unavailable"])}).passthrough()); -const payment_flows_private_payment_methods_card_payment_intent_amount_details_line_item_payment_method_options = z.lazy(() => z.object({"commodity_code": z.string().nullable()}).passthrough()); -const payment_flows_private_payment_methods_card_present_amount_details_line_item_payment_method_options = z.lazy(() => z.object({"commodity_code": z.string().nullable()}).passthrough()); -const payment_flows_private_payment_methods_card_present_common_wallet = z.lazy(() => z.object({"type": z.enum(["apple_pay", "google_pay", "samsung_pay", "unknown"])}).passthrough()); -const payment_flows_private_payment_methods_financial_connections_common_linked_account_options_filters = z.lazy(() => z.object({"account_subcategories": z.array(z.enum(["checking", "savings"])).optional()}).passthrough()); -const payment_flows_private_payment_methods_kakao_pay_payment_method_options = z.lazy(() => z.object({"capture_method": z.literal("manual").optional(), "setup_future_usage": z.enum(["none", "off_session"]).optional()}).passthrough()); -const payment_flows_private_payment_methods_klarna_dob = z.lazy(() => z.object({"day": z.number().int().nullable(), "month": z.number().int().nullable(), "year": z.number().int().nullable()}).passthrough()); -const payment_flows_private_payment_methods_klarna_payment_intent_amount_details_line_item_payment_method_options = z.lazy(() => z.object({"image_url": z.string().nullable(), "product_url": z.string().nullable(), "reference": z.string().nullable(), "subscription_reference": z.string().nullable()}).passthrough()); -const payment_flows_private_payment_methods_naver_pay_payment_method_options = z.lazy(() => z.object({"capture_method": z.literal("manual").optional(), "setup_future_usage": z.enum(["none", "off_session"]).optional()}).passthrough()); -const payment_flows_private_payment_methods_payco_payment_method_options = z.lazy(() => z.object({"capture_method": z.literal("manual").optional()}).passthrough()); -const payment_flows_private_payment_methods_paypal_amount_details_line_item_payment_method_options = z.lazy(() => z.object({"category": z.enum(["digital_goods", "donation", "physical_goods"]).optional(), "description": z.string().optional(), "sold_by": z.string().optional()}).passthrough()); -const payment_flows_private_payment_methods_samsung_pay_payment_method_options = z.lazy(() => z.object({"capture_method": z.literal("manual").optional()}).passthrough()); +const payment_flows_private_payment_methods_alipay_details = z.lazy(() => z.object({"buyer_id": z.string().optional(), "fingerprint": z.string().nullable(), "transaction_id": z.string().nullable()})); +const payment_flows_private_payment_methods_card_details_api_resource_enterprise_features_extended_authorization_extended_authorization = z.lazy(() => z.object({"status": z.enum(["disabled", "enabled"])})); +const payment_flows_private_payment_methods_card_details_api_resource_enterprise_features_incremental_authorization_incremental_authorization = z.lazy(() => z.object({"status": z.enum(["available", "unavailable"])})); +const payment_flows_private_payment_methods_card_details_api_resource_enterprise_features_overcapture_overcapture = z.lazy(() => z.object({"maximum_amount_capturable": z.number().int(), "status": z.enum(["available", "unavailable"])})); +const payment_flows_private_payment_methods_card_details_api_resource_multicapture = z.lazy(() => z.object({"status": z.enum(["available", "unavailable"])})); +const payment_flows_private_payment_methods_card_payment_intent_amount_details_line_item_payment_method_options = z.lazy(() => z.object({"commodity_code": z.string().nullable()})); +const payment_flows_private_payment_methods_card_present_amount_details_line_item_payment_method_options = z.lazy(() => z.object({"commodity_code": z.string().nullable()})); +const payment_flows_private_payment_methods_card_present_common_wallet = z.lazy(() => z.object({"type": z.enum(["apple_pay", "google_pay", "samsung_pay", "unknown"])})); +const payment_flows_private_payment_methods_financial_connections_common_linked_account_options_filters = z.lazy(() => z.object({"account_subcategories": z.array(z.enum(["checking", "savings"])).optional()})); +const payment_flows_private_payment_methods_kakao_pay_payment_method_options = z.lazy(() => z.object({"capture_method": z.literal("manual").optional(), "setup_future_usage": z.enum(["none", "off_session"]).optional()})); +const payment_flows_private_payment_methods_klarna_dob = z.lazy(() => z.object({"day": z.number().int().nullable(), "month": z.number().int().nullable(), "year": z.number().int().nullable()})); +const payment_flows_private_payment_methods_klarna_payment_intent_amount_details_line_item_payment_method_options = z.lazy(() => z.object({"image_url": z.string().nullable(), "product_url": z.string().nullable(), "reference": z.string().nullable(), "subscription_reference": z.string().nullable()})); +const payment_flows_private_payment_methods_naver_pay_payment_method_options = z.lazy(() => z.object({"capture_method": z.literal("manual").optional(), "setup_future_usage": z.enum(["none", "off_session"]).optional()})); +const payment_flows_private_payment_methods_payco_payment_method_options = z.lazy(() => z.object({"capture_method": z.literal("manual").optional()})); +const payment_flows_private_payment_methods_paypal_amount_details_line_item_payment_method_options = z.lazy(() => z.object({"category": z.enum(["digital_goods", "donation", "physical_goods"]).optional(), "description": z.string().optional(), "sold_by": z.string().optional()})); +const payment_flows_private_payment_methods_samsung_pay_payment_method_options = z.lazy(() => z.object({"capture_method": z.literal("manual").optional()})); const payment_flows_private_payment_methods_satispay_setup_attempt_details = z.lazy(() => z.record(z.string(), z.any())); -const payment_intent: z.ZodTypeAny = z.lazy(() => z.object({"amount": z.number().int(), "amount_capturable": z.number().int(), "amount_details": payment_flows_amount_details.optional(), "amount_received": z.number().int(), "application": z.union([z.string(), application]).nullable(), "application_fee_amount": z.number().int().nullable(), "automatic_payment_methods": payment_flows_automatic_payment_methods_payment_intent.nullable(), "canceled_at": z.number().int().nullable(), "cancellation_reason": z.enum(["abandoned", "automatic", "duplicate", "expired", "failed_invoice", "fraudulent", "requested_by_customer", "void_invoice"]).nullable(), "capture_method": z.enum(["automatic", "automatic_async", "manual"]), "client_secret": z.string().nullable(), "confirmation_method": z.enum(["automatic", "manual"]), "created": z.number().int(), "currency": z.string(), "customer": z.union([z.string(), customer, deleted_customer]).nullable(), "customer_account": z.string().nullable(), "description": z.string().nullable(), "excluded_payment_method_types": z.array(z.enum(["acss_debit", "affirm", "afterpay_clearpay", "alipay", "alma", "amazon_pay", "au_becs_debit", "bacs_debit", "bancontact", "billie", "bizum", "blik", "boleto", "card", "cashapp", "crypto", "customer_balance", "eps", "fpx", "giropay", "grabpay", "ideal", "kakao_pay", "klarna", "konbini", "kr_card", "mb_way", "mobilepay", "multibanco", "naver_pay", "nz_bank_account", "oxxo", "p24", "pay_by_bank", "payco", "paynow", "paypal", "payto", "pix", "promptpay", "revolut_pay", "samsung_pay", "satispay", "scalapay", "sepa_debit", "sofort", "sunbit", "swish", "twint", "upi", "us_bank_account", "wechat_pay", "zip"])).nullable(), "hooks": payment_flows_payment_intent_async_workflows.optional(), "id": z.string(), "last_payment_error": api_errors.nullable(), "latest_charge": z.union([z.string(), charge]).nullable(), "livemode": z.boolean(), "managed_payments": smor_resource_managed_payments.nullable(), "metadata": z.record(z.string(), z.string()), "next_action": payment_intent_next_action.nullable(), "object": z.literal("payment_intent"), "on_behalf_of": z.union([z.string(), account]).nullable(), "payment_details": payment_flows_payment_details.optional(), "payment_method": z.union([z.string(), payment_method]).nullable(), "payment_method_configuration_details": payment_method_config_biz_payment_method_configuration_details.nullable(), "payment_method_options": payment_intent_payment_method_options.nullable(), "payment_method_types": z.array(z.string()), "presentment_details": payment_flows_payment_intent_presentment_details.optional(), "processing": payment_intent_processing.nullable(), "receipt_email": z.string().nullable(), "review": z.union([z.string(), review]).nullable(), "setup_future_usage": z.enum(["off_session", "on_session"]).nullable(), "shipping": shipping.nullable(), "source": z.union([z.string(), payment_source, deleted_payment_source]).nullable(), "statement_descriptor": z.string().nullable(), "statement_descriptor_suffix": z.string().nullable(), "status": z.enum(["canceled", "processing", "requires_action", "requires_capture", "requires_confirmation", "requires_payment_method", "succeeded"]), "transfer_data": transfer_data.nullable().optional(), "transfer_group": z.string().nullable()}).passthrough()); -const payment_intent_amount_details_line_item = z.lazy(() => z.object({"discount_amount": z.number().int().nullable(), "id": z.string(), "object": z.literal("payment_intent_amount_details_line_item"), "payment_method_options": payment_flows_amount_details_resource_line_items_list_resource_line_item_resource_payment_method_options.nullable(), "product_code": z.string().nullable(), "product_name": z.string(), "quantity": z.number().int(), "tax": payment_flows_amount_details_resource_line_items_list_resource_line_item_resource_tax.nullable(), "unit_cost": z.number().int(), "unit_of_measure": z.string().nullable()}).passthrough()); -const payment_intent_card_processing = z.lazy(() => z.object({"customer_notification": payment_intent_processing_customer_notification.optional()}).passthrough()); -const payment_intent_next_action = z.lazy(() => z.object({"alipay_handle_redirect": payment_intent_next_action_alipay_handle_redirect.optional(), "blik_authorize": payment_intent_next_action_blik_authorize.optional(), "boleto_display_details": payment_intent_next_action_boleto.optional(), "card_await_notification": payment_intent_next_action_card_await_notification.optional(), "cashapp_handle_redirect_or_display_qr_code": payment_intent_next_action_cashapp_handle_redirect_or_display_qr_code.optional(), "display_bank_transfer_instructions": payment_intent_next_action_display_bank_transfer_instructions.optional(), "klarna_display_qr_code": payment_intent_next_action_klarna_display_qr_code.optional(), "konbini_display_details": payment_intent_next_action_konbini.optional(), "multibanco_display_details": payment_intent_next_action_display_multibanco_details.optional(), "oxxo_display_details": payment_intent_next_action_display_oxxo_details.optional(), "paynow_display_qr_code": payment_intent_next_action_paynow_display_qr_code.optional(), "pix_display_qr_code": payment_intent_next_action_pix_display_qr_code.optional(), "promptpay_display_qr_code": payment_intent_next_action_promptpay_display_qr_code.optional(), "redirect_to_url": payment_intent_next_action_redirect_to_url.optional(), "swish_handle_redirect_or_display_qr_code": payment_intent_next_action_swish_handle_redirect_or_display_qr_code.optional(), "type": z.string(), "upi_handle_redirect_or_display_qr_code": payment_intent_next_action_upi_handle_redirect_or_display_qr_code.optional(), "use_stripe_sdk": z.record(z.string(), z.any()).optional(), "verify_with_microdeposits": payment_intent_next_action_verify_with_microdeposits.optional(), "wechat_pay_display_qr_code": payment_intent_next_action_wechat_pay_display_qr_code.optional(), "wechat_pay_redirect_to_android_app": payment_intent_next_action_wechat_pay_redirect_to_android_app.optional(), "wechat_pay_redirect_to_ios_app": payment_intent_next_action_wechat_pay_redirect_to_ios_app.optional()}).passthrough()); -const payment_intent_next_action_alipay_handle_redirect = z.lazy(() => z.object({"native_data": z.string().nullable(), "native_url": z.string().nullable(), "return_url": z.string().nullable(), "url": z.string().nullable()}).passthrough()); +const payment_intent: z.ZodTypeAny = z.lazy(() => z.object({"amount": z.number().int(), "amount_capturable": z.number().int(), "amount_details": payment_flows_amount_details.optional(), "amount_received": z.number().int(), "application": z.union([z.string(), application]).nullable(), "application_fee_amount": z.number().int().nullable(), "automatic_payment_methods": payment_flows_automatic_payment_methods_payment_intent.nullable(), "canceled_at": z.number().int().nullable(), "cancellation_reason": z.enum(["abandoned", "automatic", "duplicate", "expired", "failed_invoice", "fraudulent", "requested_by_customer", "void_invoice"]).nullable(), "capture_method": z.enum(["automatic", "automatic_async", "manual"]), "client_secret": z.string().nullable(), "confirmation_method": z.enum(["automatic", "manual"]), "created": z.number().int(), "currency": z.string(), "customer": z.union([z.string(), customer, deleted_customer]).nullable(), "customer_account": z.string().nullable(), "description": z.string().nullable(), "excluded_payment_method_types": z.array(z.enum(["acss_debit", "affirm", "afterpay_clearpay", "alipay", "alma", "amazon_pay", "au_becs_debit", "bacs_debit", "bancontact", "billie", "bizum", "blik", "boleto", "card", "cashapp", "crypto", "customer_balance", "eps", "fpx", "giropay", "grabpay", "ideal", "kakao_pay", "klarna", "konbini", "kr_card", "mb_way", "mobilepay", "multibanco", "naver_pay", "nz_bank_account", "oxxo", "p24", "pay_by_bank", "payco", "paynow", "paypal", "payto", "pix", "promptpay", "revolut_pay", "samsung_pay", "satispay", "scalapay", "sepa_debit", "sofort", "sunbit", "swish", "twint", "upi", "us_bank_account", "wechat_pay", "zip"])).nullable(), "hooks": payment_flows_payment_intent_async_workflows.optional(), "id": z.string(), "last_payment_error": api_errors.nullable(), "latest_charge": z.union([z.string(), charge]).nullable(), "livemode": z.boolean(), "managed_payments": smor_resource_managed_payments.nullable(), "metadata": z.record(z.string(), z.string()), "next_action": payment_intent_next_action.nullable(), "object": z.literal("payment_intent"), "on_behalf_of": z.union([z.string(), account]).nullable(), "payment_details": payment_flows_payment_details.optional(), "payment_method": z.union([z.string(), payment_method]).nullable(), "payment_method_configuration_details": payment_method_config_biz_payment_method_configuration_details.nullable(), "payment_method_options": payment_intent_payment_method_options.nullable(), "payment_method_types": z.array(z.string()), "presentment_details": payment_flows_payment_intent_presentment_details.optional(), "processing": payment_intent_processing.nullable(), "receipt_email": z.string().nullable(), "review": z.union([z.string(), review]).nullable(), "setup_future_usage": z.enum(["off_session", "on_session"]).nullable(), "shipping": shipping.nullable(), "source": z.union([z.string(), payment_source, deleted_payment_source]).nullable(), "statement_descriptor": z.string().nullable(), "statement_descriptor_suffix": z.string().nullable(), "status": z.enum(["canceled", "processing", "requires_action", "requires_capture", "requires_confirmation", "requires_payment_method", "succeeded"]), "transfer_data": transfer_data.nullable().optional(), "transfer_group": z.string().nullable()})); +const payment_intent_amount_details_line_item = z.lazy(() => z.object({"discount_amount": z.number().int().nullable(), "id": z.string(), "object": z.literal("payment_intent_amount_details_line_item"), "payment_method_options": payment_flows_amount_details_resource_line_items_list_resource_line_item_resource_payment_method_options.nullable(), "product_code": z.string().nullable(), "product_name": z.string(), "quantity": z.number().int(), "tax": payment_flows_amount_details_resource_line_items_list_resource_line_item_resource_tax.nullable(), "unit_cost": z.number().int(), "unit_of_measure": z.string().nullable()})); +const payment_intent_card_processing = z.lazy(() => z.object({"customer_notification": payment_intent_processing_customer_notification.optional()})); +const payment_intent_next_action = z.lazy(() => z.object({"alipay_handle_redirect": payment_intent_next_action_alipay_handle_redirect.optional(), "blik_authorize": payment_intent_next_action_blik_authorize.optional(), "boleto_display_details": payment_intent_next_action_boleto.optional(), "card_await_notification": payment_intent_next_action_card_await_notification.optional(), "cashapp_handle_redirect_or_display_qr_code": payment_intent_next_action_cashapp_handle_redirect_or_display_qr_code.optional(), "display_bank_transfer_instructions": payment_intent_next_action_display_bank_transfer_instructions.optional(), "klarna_display_qr_code": payment_intent_next_action_klarna_display_qr_code.optional(), "konbini_display_details": payment_intent_next_action_konbini.optional(), "multibanco_display_details": payment_intent_next_action_display_multibanco_details.optional(), "oxxo_display_details": payment_intent_next_action_display_oxxo_details.optional(), "paynow_display_qr_code": payment_intent_next_action_paynow_display_qr_code.optional(), "pix_display_qr_code": payment_intent_next_action_pix_display_qr_code.optional(), "promptpay_display_qr_code": payment_intent_next_action_promptpay_display_qr_code.optional(), "redirect_to_url": payment_intent_next_action_redirect_to_url.optional(), "swish_handle_redirect_or_display_qr_code": payment_intent_next_action_swish_handle_redirect_or_display_qr_code.optional(), "type": z.string(), "upi_handle_redirect_or_display_qr_code": payment_intent_next_action_upi_handle_redirect_or_display_qr_code.optional(), "use_stripe_sdk": z.record(z.string(), z.any()).optional(), "verify_with_microdeposits": payment_intent_next_action_verify_with_microdeposits.optional(), "wechat_pay_display_qr_code": payment_intent_next_action_wechat_pay_display_qr_code.optional(), "wechat_pay_redirect_to_android_app": payment_intent_next_action_wechat_pay_redirect_to_android_app.optional(), "wechat_pay_redirect_to_ios_app": payment_intent_next_action_wechat_pay_redirect_to_ios_app.optional()})); +const payment_intent_next_action_alipay_handle_redirect = z.lazy(() => z.object({"native_data": z.string().nullable(), "native_url": z.string().nullable(), "return_url": z.string().nullable(), "url": z.string().nullable()})); const payment_intent_next_action_blik_authorize = z.lazy(() => z.record(z.string(), z.any())); -const payment_intent_next_action_boleto = z.lazy(() => z.object({"expires_at": z.number().int().nullable(), "hosted_voucher_url": z.string().nullable(), "number": z.string().nullable(), "pdf": z.string().nullable()}).passthrough()); -const payment_intent_next_action_card_await_notification = z.lazy(() => z.object({"charge_attempt_at": z.number().int().nullable(), "customer_approval_required": z.boolean().nullable()}).passthrough()); -const payment_intent_next_action_cashapp_handle_redirect_or_display_qr_code = z.lazy(() => z.object({"hosted_instructions_url": z.string(), "mobile_auth_url": z.string(), "qr_code": payment_intent_next_action_cashapp_qr_code}).passthrough()); -const payment_intent_next_action_cashapp_qr_code = z.lazy(() => z.object({"expires_at": z.number().int(), "image_url_png": z.string(), "image_url_svg": z.string()}).passthrough()); -const payment_intent_next_action_display_bank_transfer_instructions = z.lazy(() => z.object({"amount_remaining": z.number().int().nullable(), "currency": z.string().nullable(), "financial_addresses": z.array(funding_instructions_bank_transfer_financial_address).optional(), "hosted_instructions_url": z.string().nullable(), "reference": z.string().nullable(), "type": z.enum(["eu_bank_transfer", "gb_bank_transfer", "jp_bank_transfer", "mx_bank_transfer", "us_bank_transfer"])}).passthrough()); -const payment_intent_next_action_display_multibanco_details = z.lazy(() => z.object({"entity": z.string().nullable(), "expires_at": z.number().int().nullable(), "hosted_voucher_url": z.string().nullable(), "reference": z.string().nullable()}).passthrough()); -const payment_intent_next_action_display_oxxo_details = z.lazy(() => z.object({"expires_after": z.number().int().nullable(), "hosted_voucher_url": z.string().nullable(), "number": z.string().nullable()}).passthrough()); -const payment_intent_next_action_klarna_display_qr_code = z.lazy(() => z.object({"data": z.string(), "expires_at": z.number().int().nullable(), "image_url_png": z.string(), "image_url_svg": z.string()}).passthrough()); -const payment_intent_next_action_konbini = z.lazy(() => z.object({"expires_at": z.number().int(), "hosted_voucher_url": z.string().nullable(), "stores": payment_intent_next_action_konbini_stores}).passthrough()); -const payment_intent_next_action_konbini_familymart = z.lazy(() => z.object({"confirmation_number": z.string().optional(), "payment_code": z.string()}).passthrough()); -const payment_intent_next_action_konbini_lawson = z.lazy(() => z.object({"confirmation_number": z.string().optional(), "payment_code": z.string()}).passthrough()); -const payment_intent_next_action_konbini_ministop = z.lazy(() => z.object({"confirmation_number": z.string().optional(), "payment_code": z.string()}).passthrough()); -const payment_intent_next_action_konbini_seicomart = z.lazy(() => z.object({"confirmation_number": z.string().optional(), "payment_code": z.string()}).passthrough()); -const payment_intent_next_action_konbini_stores = z.lazy(() => z.object({"familymart": payment_intent_next_action_konbini_familymart.nullable(), "lawson": payment_intent_next_action_konbini_lawson.nullable(), "ministop": payment_intent_next_action_konbini_ministop.nullable(), "seicomart": payment_intent_next_action_konbini_seicomart.nullable()}).passthrough()); -const payment_intent_next_action_paynow_display_qr_code = z.lazy(() => z.object({"data": z.string(), "hosted_instructions_url": z.string().nullable(), "image_url_png": z.string(), "image_url_svg": z.string()}).passthrough()); -const payment_intent_next_action_pix_display_qr_code = z.lazy(() => z.object({"data": z.string().optional(), "expires_at": z.number().int().optional(), "hosted_instructions_url": z.string().optional(), "image_url_png": z.string().optional(), "image_url_svg": z.string().optional()}).passthrough()); -const payment_intent_next_action_promptpay_display_qr_code = z.lazy(() => z.object({"data": z.string(), "hosted_instructions_url": z.string(), "image_url_png": z.string(), "image_url_svg": z.string()}).passthrough()); -const payment_intent_next_action_redirect_to_url = z.lazy(() => z.object({"return_url": z.string().nullable(), "url": z.string().nullable()}).passthrough()); -const payment_intent_next_action_swish_handle_redirect_or_display_qr_code = z.lazy(() => z.object({"hosted_instructions_url": z.string(), "mobile_auth_url": z.string(), "qr_code": payment_intent_next_action_swish_qr_code}).passthrough()); -const payment_intent_next_action_swish_qr_code = z.lazy(() => z.object({"data": z.string(), "image_url_png": z.string(), "image_url_svg": z.string()}).passthrough()); -const payment_intent_next_action_upi_handle_redirect_or_display_qr_code = z.lazy(() => z.object({"hosted_instructions_url": z.string(), "qr_code": payment_intent_next_action_upiqr_code}).passthrough()); -const payment_intent_next_action_upiqr_code = z.lazy(() => z.object({"expires_at": z.number().int(), "image_url_png": z.string(), "image_url_svg": z.string()}).passthrough()); -const payment_intent_next_action_verify_with_microdeposits = z.lazy(() => z.object({"arrival_date": z.number().int(), "hosted_verification_url": z.string(), "microdeposit_type": z.enum(["amounts", "descriptor_code"]).nullable()}).passthrough()); -const payment_intent_next_action_wechat_pay_display_qr_code = z.lazy(() => z.object({"data": z.string(), "hosted_instructions_url": z.string(), "image_data_url": z.string(), "image_url_png": z.string(), "image_url_svg": z.string()}).passthrough()); -const payment_intent_next_action_wechat_pay_redirect_to_android_app = z.lazy(() => z.object({"app_id": z.string(), "nonce_str": z.string(), "package": z.string(), "partner_id": z.string(), "prepay_id": z.string(), "sign": z.string(), "timestamp": z.string()}).passthrough()); -const payment_intent_next_action_wechat_pay_redirect_to_ios_app = z.lazy(() => z.object({"native_url": z.string()}).passthrough()); -const payment_intent_payment_method_options = z.lazy(() => z.object({"acss_debit": payment_intent_payment_method_options_acss_debit.optional(), "affirm": payment_method_options_affirm.optional(), "afterpay_clearpay": payment_method_options_afterpay_clearpay.optional(), "alipay": payment_method_options_alipay.optional(), "alma": payment_method_options_alma.optional(), "amazon_pay": payment_method_options_amazon_pay.optional(), "au_becs_debit": payment_intent_payment_method_options_au_becs_debit.optional(), "bacs_debit": payment_intent_payment_method_options_bacs_debit.optional(), "bancontact": payment_method_options_bancontact.optional(), "billie": payment_method_options_billie.optional(), "bizum": payment_method_options_bizum.optional(), "blik": payment_intent_payment_method_options_blik.optional(), "boleto": payment_method_options_boleto.optional(), "card": payment_intent_payment_method_options_card.optional(), "card_present": payment_method_options_card_present.optional(), "cashapp": payment_method_options_cashapp.optional(), "crypto": payment_method_options_crypto.optional(), "customer_balance": payment_method_options_customer_balance.optional(), "eps": payment_intent_payment_method_options_eps.optional(), "fpx": payment_method_options_fpx.optional(), "giropay": payment_method_options_giropay.optional(), "grabpay": payment_method_options_grabpay.optional(), "ideal": payment_method_options_ideal.optional(), "interac_present": payment_method_options_interac_present.optional(), "kakao_pay": payment_flows_private_payment_methods_kakao_pay_payment_method_options.optional(), "klarna": payment_method_options_klarna.optional(), "konbini": payment_method_options_konbini.optional(), "kr_card": payment_method_options_kr_card.optional(), "link": payment_intent_payment_method_options_link.optional(), "mb_way": payment_method_options_mb_way.optional(), "mobilepay": payment_intent_payment_method_options_mobilepay.optional(), "multibanco": payment_method_options_multibanco.optional(), "naver_pay": payment_flows_private_payment_methods_naver_pay_payment_method_options.optional(), "nz_bank_account": payment_intent_payment_method_options_nz_bank_account.optional(), "oxxo": payment_method_options_oxxo.optional(), "p24": payment_method_options_p24.optional(), "pay_by_bank": payment_method_options_pay_by_bank.optional(), "payco": payment_flows_private_payment_methods_payco_payment_method_options.optional(), "paynow": payment_method_options_paynow.optional(), "paypal": payment_method_options_paypal.optional(), "payto": payment_intent_payment_method_options_payto.optional(), "pix": payment_method_options_pix.optional(), "promptpay": payment_method_options_promptpay.optional(), "revolut_pay": payment_method_options_revolut_pay.optional(), "samsung_pay": payment_flows_private_payment_methods_samsung_pay_payment_method_options.optional(), "satispay": payment_method_options_satispay.optional(), "scalapay": payment_method_options_scalapay.optional(), "sepa_debit": payment_intent_payment_method_options_sepa_debit.optional(), "sofort": payment_method_options_sofort.optional(), "sunbit": payment_method_options_sunbit.optional(), "swish": payment_intent_payment_method_options_swish.optional(), "twint": payment_method_options_twint.optional(), "upi": payment_method_options_upi.optional(), "us_bank_account": payment_intent_payment_method_options_us_bank_account.optional(), "wechat_pay": payment_method_options_wechat_pay.optional(), "zip": payment_method_options_zip.optional()}).passthrough()); -const payment_intent_payment_method_options_acss_debit = z.lazy(() => z.object({"mandate_options": payment_intent_payment_method_options_mandate_options_acss_debit.optional(), "setup_future_usage": z.enum(["none", "off_session", "on_session"]).optional(), "target_date": z.string().optional(), "verification_method": z.enum(["automatic", "instant", "microdeposits"]).optional()}).passthrough()); -const payment_intent_payment_method_options_au_becs_debit = z.lazy(() => z.object({"setup_future_usage": z.enum(["none", "off_session", "on_session"]).optional(), "target_date": z.string().optional()}).passthrough()); -const payment_intent_payment_method_options_bacs_debit = z.lazy(() => z.object({"mandate_options": payment_intent_payment_method_options_mandate_options_bacs_debit.optional(), "setup_future_usage": z.enum(["none", "off_session", "on_session"]).optional(), "target_date": z.string().optional()}).passthrough()); -const payment_intent_payment_method_options_blik = z.lazy(() => z.object({"setup_future_usage": z.literal("none").optional()}).passthrough()); -const payment_intent_payment_method_options_card = z.lazy(() => z.object({"capture_method": z.literal("manual").optional(), "installments": payment_method_options_card_installments.nullable(), "mandate_options": payment_method_options_card_mandate_options.nullable(), "network": z.enum(["amex", "cartes_bancaires", "diners", "discover", "eftpos_au", "girocard", "interac", "jcb", "link", "mastercard", "unionpay", "unknown", "visa"]).nullable(), "request_extended_authorization": z.enum(["if_available", "never"]).optional(), "request_incremental_authorization": z.enum(["if_available", "never"]).optional(), "request_multicapture": z.enum(["if_available", "never"]).optional(), "request_overcapture": z.enum(["if_available", "never"]).optional(), "request_three_d_secure": z.enum(["any", "automatic", "challenge"]).nullable(), "require_cvc_recollection": z.boolean().optional(), "setup_future_usage": z.enum(["none", "off_session", "on_session"]).optional(), "statement_descriptor_suffix_kana": z.string().optional(), "statement_descriptor_suffix_kanji": z.string().optional()}).passthrough()); -const payment_intent_payment_method_options_eps = z.lazy(() => z.object({"setup_future_usage": z.literal("none").optional()}).passthrough()); -const payment_intent_payment_method_options_link = z.lazy(() => z.object({"capture_method": z.literal("manual").optional(), "persistent_token": z.string().nullable(), "setup_future_usage": z.enum(["none", "off_session"]).optional()}).passthrough()); -const payment_intent_payment_method_options_mandate_options_acss_debit = z.lazy(() => z.object({"custom_mandate_url": z.string().optional(), "interval_description": z.string().nullable(), "payment_schedule": z.enum(["combined", "interval", "sporadic"]).nullable(), "transaction_type": z.enum(["business", "personal"]).nullable()}).passthrough()); -const payment_intent_payment_method_options_mandate_options_bacs_debit = z.lazy(() => z.object({"reference_prefix": z.string().optional()}).passthrough()); -const payment_intent_payment_method_options_mandate_options_payto = z.lazy(() => z.object({"amount": z.number().int().nullable(), "amount_type": z.enum(["fixed", "maximum"]).nullable(), "end_date": z.string().nullable(), "payment_schedule": z.enum(["adhoc", "annual", "daily", "fortnightly", "monthly", "quarterly", "semi_annual", "weekly"]).nullable(), "payments_per_period": z.number().int().nullable(), "purpose": z.enum(["dependant_support", "government", "loan", "mortgage", "other", "pension", "personal", "retail", "salary", "tax", "utility"]).nullable()}).passthrough()); -const payment_intent_payment_method_options_mandate_options_sepa_debit = z.lazy(() => z.object({"reference_prefix": z.string().optional()}).passthrough()); -const payment_intent_payment_method_options_mobilepay = z.lazy(() => z.object({"capture_method": z.literal("manual").optional(), "setup_future_usage": z.literal("none").optional()}).passthrough()); -const payment_intent_payment_method_options_nz_bank_account = z.lazy(() => z.object({"setup_future_usage": z.enum(["none", "off_session", "on_session"]).optional(), "target_date": z.string().optional()}).passthrough()); -const payment_intent_payment_method_options_payto = z.lazy(() => z.object({"mandate_options": payment_intent_payment_method_options_mandate_options_payto.optional(), "setup_future_usage": z.enum(["none", "off_session"]).optional()}).passthrough()); -const payment_intent_payment_method_options_sepa_debit = z.lazy(() => z.object({"mandate_options": payment_intent_payment_method_options_mandate_options_sepa_debit.optional(), "setup_future_usage": z.enum(["none", "off_session", "on_session"]).optional(), "target_date": z.string().optional()}).passthrough()); -const payment_intent_payment_method_options_swish = z.lazy(() => z.object({"reference": z.string().nullable(), "setup_future_usage": z.literal("none").optional()}).passthrough()); -const payment_intent_payment_method_options_us_bank_account = z.lazy(() => z.object({"financial_connections": linked_account_options_common.optional(), "mandate_options": payment_method_options_us_bank_account_mandate_options.optional(), "setup_future_usage": z.enum(["none", "off_session", "on_session"]).optional(), "target_date": z.string().optional(), "transaction_purpose": z.enum(["goods", "other", "services", "unspecified"]).optional(), "verification_method": z.enum(["automatic", "instant", "microdeposits"]).optional()}).passthrough()); -const payment_intent_processing = z.lazy(() => z.object({"card": payment_intent_card_processing.optional(), "type": z.literal("card")}).passthrough()); -const payment_intent_processing_customer_notification = z.lazy(() => z.object({"approval_requested": z.boolean().nullable(), "completes_at": z.number().int().nullable()}).passthrough()); -const payment_method: z.ZodTypeAny = z.lazy(() => z.object({"acss_debit": payment_method_acss_debit.optional(), "affirm": payment_method_affirm.optional(), "afterpay_clearpay": payment_method_afterpay_clearpay.optional(), "alipay": payment_flows_private_payment_methods_alipay.optional(), "allow_redisplay": z.enum(["always", "limited", "unspecified"]).optional(), "alma": payment_method_alma.optional(), "amazon_pay": payment_method_amazon_pay.optional(), "au_becs_debit": payment_method_au_becs_debit.optional(), "bacs_debit": payment_method_bacs_debit.optional(), "bancontact": payment_method_bancontact.optional(), "billie": payment_method_billie.optional(), "billing_details": billing_details, "bizum": payment_method_bizum.optional(), "blik": payment_method_blik.optional(), "boleto": payment_method_boleto.optional(), "card": payment_method_card.optional(), "card_present": payment_method_card_present.optional(), "cashapp": payment_method_cashapp.optional(), "created": z.number().int(), "crypto": payment_method_crypto.optional(), "custom": payment_method_custom.optional(), "customer": z.union([z.string(), customer]).nullable(), "customer_account": z.string().nullable(), "customer_balance": payment_method_customer_balance.optional(), "eps": payment_method_eps.optional(), "fpx": payment_method_fpx.optional(), "giropay": payment_method_giropay.optional(), "grabpay": payment_method_grabpay.optional(), "id": z.string(), "ideal": payment_method_ideal.optional(), "interac_present": payment_method_interac_present.optional(), "kakao_pay": payment_method_kakao_pay.optional(), "klarna": payment_method_klarna.optional(), "konbini": payment_method_konbini.optional(), "kr_card": payment_method_kr_card.optional(), "link": payment_method_link.optional(), "livemode": z.boolean(), "mb_way": payment_method_mb_way.optional(), "metadata": z.record(z.string(), z.string()).nullable(), "mobilepay": payment_method_mobilepay.optional(), "multibanco": payment_method_multibanco.optional(), "naver_pay": payment_method_naver_pay.optional(), "nz_bank_account": payment_method_nz_bank_account.optional(), "object": z.literal("payment_method"), "oxxo": payment_method_oxxo.optional(), "p24": payment_method_p24.optional(), "pay_by_bank": payment_method_pay_by_bank.optional(), "payco": payment_method_payco.optional(), "paynow": payment_method_paynow.optional(), "paypal": payment_method_paypal.optional(), "payto": payment_method_payto.optional(), "pix": payment_method_pix.optional(), "promptpay": payment_method_promptpay.optional(), "radar_options": radar_radar_options.optional(), "revolut_pay": payment_method_revolut_pay.optional(), "samsung_pay": payment_method_samsung_pay.optional(), "satispay": payment_method_satispay.optional(), "scalapay": payment_method_scalapay.optional(), "sepa_debit": payment_method_sepa_debit.optional(), "sofort": payment_method_sofort.optional(), "sunbit": payment_method_sunbit.optional(), "swish": payment_method_swish.optional(), "twint": payment_method_twint.optional(), "type": z.enum(["acss_debit", "affirm", "afterpay_clearpay", "alipay", "alma", "amazon_pay", "au_becs_debit", "bacs_debit", "bancontact", "billie", "bizum", "blik", "boleto", "card", "card_present", "cashapp", "crypto", "custom", "customer_balance", "eps", "fpx", "giropay", "grabpay", "ideal", "interac_present", "kakao_pay", "klarna", "konbini", "kr_card", "link", "mb_way", "mobilepay", "multibanco", "naver_pay", "nz_bank_account", "oxxo", "p24", "pay_by_bank", "payco", "paynow", "paypal", "payto", "pix", "promptpay", "revolut_pay", "samsung_pay", "satispay", "scalapay", "sepa_debit", "sofort", "sunbit", "swish", "twint", "upi", "us_bank_account", "wechat_pay", "zip"]), "upi": payment_method_upi.optional(), "us_bank_account": payment_method_us_bank_account.optional(), "wechat_pay": payment_method_wechat_pay.optional(), "zip": payment_method_zip.optional()}).passthrough()); -const payment_method_acss_debit = z.lazy(() => z.object({"bank_name": z.string().nullable(), "fingerprint": z.string().nullable(), "institution_number": z.string().nullable(), "last4": z.string().nullable(), "transit_number": z.string().nullable()}).passthrough()); +const payment_intent_next_action_boleto = z.lazy(() => z.object({"expires_at": z.number().int().nullable(), "hosted_voucher_url": z.string().nullable(), "number": z.string().nullable(), "pdf": z.string().nullable()})); +const payment_intent_next_action_card_await_notification = z.lazy(() => z.object({"charge_attempt_at": z.number().int().nullable(), "customer_approval_required": z.boolean().nullable()})); +const payment_intent_next_action_cashapp_handle_redirect_or_display_qr_code = z.lazy(() => z.object({"hosted_instructions_url": z.string(), "mobile_auth_url": z.string(), "qr_code": payment_intent_next_action_cashapp_qr_code})); +const payment_intent_next_action_cashapp_qr_code = z.lazy(() => z.object({"expires_at": z.number().int(), "image_url_png": z.string(), "image_url_svg": z.string()})); +const payment_intent_next_action_display_bank_transfer_instructions = z.lazy(() => z.object({"amount_remaining": z.number().int().nullable(), "currency": z.string().nullable(), "financial_addresses": z.array(funding_instructions_bank_transfer_financial_address).optional(), "hosted_instructions_url": z.string().nullable(), "reference": z.string().nullable(), "type": z.enum(["eu_bank_transfer", "gb_bank_transfer", "jp_bank_transfer", "mx_bank_transfer", "us_bank_transfer"])})); +const payment_intent_next_action_display_multibanco_details = z.lazy(() => z.object({"entity": z.string().nullable(), "expires_at": z.number().int().nullable(), "hosted_voucher_url": z.string().nullable(), "reference": z.string().nullable()})); +const payment_intent_next_action_display_oxxo_details = z.lazy(() => z.object({"expires_after": z.number().int().nullable(), "hosted_voucher_url": z.string().nullable(), "number": z.string().nullable()})); +const payment_intent_next_action_klarna_display_qr_code = z.lazy(() => z.object({"data": z.string(), "expires_at": z.number().int().nullable(), "image_url_png": z.string(), "image_url_svg": z.string()})); +const payment_intent_next_action_konbini = z.lazy(() => z.object({"expires_at": z.number().int(), "hosted_voucher_url": z.string().nullable(), "stores": payment_intent_next_action_konbini_stores})); +const payment_intent_next_action_konbini_familymart = z.lazy(() => z.object({"confirmation_number": z.string().optional(), "payment_code": z.string()})); +const payment_intent_next_action_konbini_lawson = z.lazy(() => z.object({"confirmation_number": z.string().optional(), "payment_code": z.string()})); +const payment_intent_next_action_konbini_ministop = z.lazy(() => z.object({"confirmation_number": z.string().optional(), "payment_code": z.string()})); +const payment_intent_next_action_konbini_seicomart = z.lazy(() => z.object({"confirmation_number": z.string().optional(), "payment_code": z.string()})); +const payment_intent_next_action_konbini_stores = z.lazy(() => z.object({"familymart": payment_intent_next_action_konbini_familymart.nullable(), "lawson": payment_intent_next_action_konbini_lawson.nullable(), "ministop": payment_intent_next_action_konbini_ministop.nullable(), "seicomart": payment_intent_next_action_konbini_seicomart.nullable()})); +const payment_intent_next_action_paynow_display_qr_code = z.lazy(() => z.object({"data": z.string(), "hosted_instructions_url": z.string().nullable(), "image_url_png": z.string(), "image_url_svg": z.string()})); +const payment_intent_next_action_pix_display_qr_code = z.lazy(() => z.object({"data": z.string().optional(), "expires_at": z.number().int().optional(), "hosted_instructions_url": z.string().optional(), "image_url_png": z.string().optional(), "image_url_svg": z.string().optional()})); +const payment_intent_next_action_promptpay_display_qr_code = z.lazy(() => z.object({"data": z.string(), "hosted_instructions_url": z.string(), "image_url_png": z.string(), "image_url_svg": z.string()})); +const payment_intent_next_action_redirect_to_url = z.lazy(() => z.object({"return_url": z.string().nullable(), "url": z.string().nullable()})); +const payment_intent_next_action_swish_handle_redirect_or_display_qr_code = z.lazy(() => z.object({"hosted_instructions_url": z.string(), "mobile_auth_url": z.string(), "qr_code": payment_intent_next_action_swish_qr_code})); +const payment_intent_next_action_swish_qr_code = z.lazy(() => z.object({"data": z.string(), "image_url_png": z.string(), "image_url_svg": z.string()})); +const payment_intent_next_action_upi_handle_redirect_or_display_qr_code = z.lazy(() => z.object({"hosted_instructions_url": z.string(), "qr_code": payment_intent_next_action_upiqr_code})); +const payment_intent_next_action_upiqr_code = z.lazy(() => z.object({"expires_at": z.number().int(), "image_url_png": z.string(), "image_url_svg": z.string()})); +const payment_intent_next_action_verify_with_microdeposits = z.lazy(() => z.object({"arrival_date": z.number().int(), "hosted_verification_url": z.string(), "microdeposit_type": z.enum(["amounts", "descriptor_code"]).nullable()})); +const payment_intent_next_action_wechat_pay_display_qr_code = z.lazy(() => z.object({"data": z.string(), "hosted_instructions_url": z.string(), "image_data_url": z.string(), "image_url_png": z.string(), "image_url_svg": z.string()})); +const payment_intent_next_action_wechat_pay_redirect_to_android_app = z.lazy(() => z.object({"app_id": z.string(), "nonce_str": z.string(), "package": z.string(), "partner_id": z.string(), "prepay_id": z.string(), "sign": z.string(), "timestamp": z.string()})); +const payment_intent_next_action_wechat_pay_redirect_to_ios_app = z.lazy(() => z.object({"native_url": z.string()})); +const payment_intent_payment_method_options = z.lazy(() => z.object({"acss_debit": payment_intent_payment_method_options_acss_debit.optional(), "affirm": payment_method_options_affirm.optional(), "afterpay_clearpay": payment_method_options_afterpay_clearpay.optional(), "alipay": payment_method_options_alipay.optional(), "alma": payment_method_options_alma.optional(), "amazon_pay": payment_method_options_amazon_pay.optional(), "au_becs_debit": payment_intent_payment_method_options_au_becs_debit.optional(), "bacs_debit": payment_intent_payment_method_options_bacs_debit.optional(), "bancontact": payment_method_options_bancontact.optional(), "billie": payment_method_options_billie.optional(), "bizum": payment_method_options_bizum.optional(), "blik": payment_intent_payment_method_options_blik.optional(), "boleto": payment_method_options_boleto.optional(), "card": payment_intent_payment_method_options_card.optional(), "card_present": payment_method_options_card_present.optional(), "cashapp": payment_method_options_cashapp.optional(), "crypto": payment_method_options_crypto.optional(), "customer_balance": payment_method_options_customer_balance.optional(), "eps": payment_intent_payment_method_options_eps.optional(), "fpx": payment_method_options_fpx.optional(), "giropay": payment_method_options_giropay.optional(), "grabpay": payment_method_options_grabpay.optional(), "ideal": payment_method_options_ideal.optional(), "interac_present": payment_method_options_interac_present.optional(), "kakao_pay": payment_flows_private_payment_methods_kakao_pay_payment_method_options.optional(), "klarna": payment_method_options_klarna.optional(), "konbini": payment_method_options_konbini.optional(), "kr_card": payment_method_options_kr_card.optional(), "link": payment_intent_payment_method_options_link.optional(), "mb_way": payment_method_options_mb_way.optional(), "mobilepay": payment_intent_payment_method_options_mobilepay.optional(), "multibanco": payment_method_options_multibanco.optional(), "naver_pay": payment_flows_private_payment_methods_naver_pay_payment_method_options.optional(), "nz_bank_account": payment_intent_payment_method_options_nz_bank_account.optional(), "oxxo": payment_method_options_oxxo.optional(), "p24": payment_method_options_p24.optional(), "pay_by_bank": payment_method_options_pay_by_bank.optional(), "payco": payment_flows_private_payment_methods_payco_payment_method_options.optional(), "paynow": payment_method_options_paynow.optional(), "paypal": payment_method_options_paypal.optional(), "payto": payment_intent_payment_method_options_payto.optional(), "pix": payment_method_options_pix.optional(), "promptpay": payment_method_options_promptpay.optional(), "revolut_pay": payment_method_options_revolut_pay.optional(), "samsung_pay": payment_flows_private_payment_methods_samsung_pay_payment_method_options.optional(), "satispay": payment_method_options_satispay.optional(), "scalapay": payment_method_options_scalapay.optional(), "sepa_debit": payment_intent_payment_method_options_sepa_debit.optional(), "sofort": payment_method_options_sofort.optional(), "sunbit": payment_method_options_sunbit.optional(), "swish": payment_intent_payment_method_options_swish.optional(), "twint": payment_method_options_twint.optional(), "upi": payment_method_options_upi.optional(), "us_bank_account": payment_intent_payment_method_options_us_bank_account.optional(), "wechat_pay": payment_method_options_wechat_pay.optional(), "zip": payment_method_options_zip.optional()})); +const payment_intent_payment_method_options_acss_debit = z.lazy(() => z.object({"mandate_options": payment_intent_payment_method_options_mandate_options_acss_debit.optional(), "setup_future_usage": z.enum(["none", "off_session", "on_session"]).optional(), "target_date": z.string().optional(), "verification_method": z.enum(["automatic", "instant", "microdeposits"]).optional()})); +const payment_intent_payment_method_options_au_becs_debit = z.lazy(() => z.object({"setup_future_usage": z.enum(["none", "off_session", "on_session"]).optional(), "target_date": z.string().optional()})); +const payment_intent_payment_method_options_bacs_debit = z.lazy(() => z.object({"mandate_options": payment_intent_payment_method_options_mandate_options_bacs_debit.optional(), "setup_future_usage": z.enum(["none", "off_session", "on_session"]).optional(), "target_date": z.string().optional()})); +const payment_intent_payment_method_options_blik = z.lazy(() => z.object({"setup_future_usage": z.literal("none").optional()})); +const payment_intent_payment_method_options_card = z.lazy(() => z.object({"capture_method": z.literal("manual").optional(), "installments": payment_method_options_card_installments.nullable(), "mandate_options": payment_method_options_card_mandate_options.nullable(), "network": z.enum(["amex", "cartes_bancaires", "diners", "discover", "eftpos_au", "girocard", "interac", "jcb", "link", "mastercard", "unionpay", "unknown", "visa"]).nullable(), "request_extended_authorization": z.enum(["if_available", "never"]).optional(), "request_incremental_authorization": z.enum(["if_available", "never"]).optional(), "request_multicapture": z.enum(["if_available", "never"]).optional(), "request_overcapture": z.enum(["if_available", "never"]).optional(), "request_three_d_secure": z.enum(["any", "automatic", "challenge"]).nullable(), "require_cvc_recollection": z.boolean().optional(), "setup_future_usage": z.enum(["none", "off_session", "on_session"]).optional(), "statement_descriptor_suffix_kana": z.string().optional(), "statement_descriptor_suffix_kanji": z.string().optional()})); +const payment_intent_payment_method_options_eps = z.lazy(() => z.object({"setup_future_usage": z.literal("none").optional()})); +const payment_intent_payment_method_options_link = z.lazy(() => z.object({"capture_method": z.literal("manual").optional(), "persistent_token": z.string().nullable(), "setup_future_usage": z.enum(["none", "off_session"]).optional()})); +const payment_intent_payment_method_options_mandate_options_acss_debit = z.lazy(() => z.object({"custom_mandate_url": z.string().optional(), "interval_description": z.string().nullable(), "payment_schedule": z.enum(["combined", "interval", "sporadic"]).nullable(), "transaction_type": z.enum(["business", "personal"]).nullable()})); +const payment_intent_payment_method_options_mandate_options_bacs_debit = z.lazy(() => z.object({"reference_prefix": z.string().optional()})); +const payment_intent_payment_method_options_mandate_options_payto = z.lazy(() => z.object({"amount": z.number().int().nullable(), "amount_type": z.enum(["fixed", "maximum"]).nullable(), "end_date": z.string().nullable(), "payment_schedule": z.enum(["adhoc", "annual", "daily", "fortnightly", "monthly", "quarterly", "semi_annual", "weekly"]).nullable(), "payments_per_period": z.number().int().nullable(), "purpose": z.enum(["dependant_support", "government", "loan", "mortgage", "other", "pension", "personal", "retail", "salary", "tax", "utility"]).nullable()})); +const payment_intent_payment_method_options_mandate_options_sepa_debit = z.lazy(() => z.object({"reference_prefix": z.string().optional()})); +const payment_intent_payment_method_options_mobilepay = z.lazy(() => z.object({"capture_method": z.literal("manual").optional(), "setup_future_usage": z.literal("none").optional()})); +const payment_intent_payment_method_options_nz_bank_account = z.lazy(() => z.object({"setup_future_usage": z.enum(["none", "off_session", "on_session"]).optional(), "target_date": z.string().optional()})); +const payment_intent_payment_method_options_payto = z.lazy(() => z.object({"mandate_options": payment_intent_payment_method_options_mandate_options_payto.optional(), "setup_future_usage": z.enum(["none", "off_session"]).optional()})); +const payment_intent_payment_method_options_sepa_debit = z.lazy(() => z.object({"mandate_options": payment_intent_payment_method_options_mandate_options_sepa_debit.optional(), "setup_future_usage": z.enum(["none", "off_session", "on_session"]).optional(), "target_date": z.string().optional()})); +const payment_intent_payment_method_options_swish = z.lazy(() => z.object({"reference": z.string().nullable(), "setup_future_usage": z.literal("none").optional()})); +const payment_intent_payment_method_options_us_bank_account = z.lazy(() => z.object({"financial_connections": linked_account_options_common.optional(), "mandate_options": payment_method_options_us_bank_account_mandate_options.optional(), "setup_future_usage": z.enum(["none", "off_session", "on_session"]).optional(), "target_date": z.string().optional(), "transaction_purpose": z.enum(["goods", "other", "services", "unspecified"]).optional(), "verification_method": z.enum(["automatic", "instant", "microdeposits"]).optional()})); +const payment_intent_processing = z.lazy(() => z.object({"card": payment_intent_card_processing.optional(), "type": z.literal("card")})); +const payment_intent_processing_customer_notification = z.lazy(() => z.object({"approval_requested": z.boolean().nullable(), "completes_at": z.number().int().nullable()})); +const payment_method: z.ZodTypeAny = z.lazy(() => z.object({"acss_debit": payment_method_acss_debit.optional(), "affirm": payment_method_affirm.optional(), "afterpay_clearpay": payment_method_afterpay_clearpay.optional(), "alipay": payment_flows_private_payment_methods_alipay.optional(), "allow_redisplay": z.enum(["always", "limited", "unspecified"]).optional(), "alma": payment_method_alma.optional(), "amazon_pay": payment_method_amazon_pay.optional(), "au_becs_debit": payment_method_au_becs_debit.optional(), "bacs_debit": payment_method_bacs_debit.optional(), "bancontact": payment_method_bancontact.optional(), "billie": payment_method_billie.optional(), "billing_details": billing_details, "bizum": payment_method_bizum.optional(), "blik": payment_method_blik.optional(), "boleto": payment_method_boleto.optional(), "card": payment_method_card.optional(), "card_present": payment_method_card_present.optional(), "cashapp": payment_method_cashapp.optional(), "created": z.number().int(), "crypto": payment_method_crypto.optional(), "custom": payment_method_custom.optional(), "customer": z.union([z.string(), customer]).nullable(), "customer_account": z.string().nullable(), "customer_balance": payment_method_customer_balance.optional(), "eps": payment_method_eps.optional(), "fpx": payment_method_fpx.optional(), "giropay": payment_method_giropay.optional(), "grabpay": payment_method_grabpay.optional(), "id": z.string(), "ideal": payment_method_ideal.optional(), "interac_present": payment_method_interac_present.optional(), "kakao_pay": payment_method_kakao_pay.optional(), "klarna": payment_method_klarna.optional(), "konbini": payment_method_konbini.optional(), "kr_card": payment_method_kr_card.optional(), "link": payment_method_link.optional(), "livemode": z.boolean(), "mb_way": payment_method_mb_way.optional(), "metadata": z.record(z.string(), z.string()).nullable(), "mobilepay": payment_method_mobilepay.optional(), "multibanco": payment_method_multibanco.optional(), "naver_pay": payment_method_naver_pay.optional(), "nz_bank_account": payment_method_nz_bank_account.optional(), "object": z.literal("payment_method"), "oxxo": payment_method_oxxo.optional(), "p24": payment_method_p24.optional(), "pay_by_bank": payment_method_pay_by_bank.optional(), "payco": payment_method_payco.optional(), "paynow": payment_method_paynow.optional(), "paypal": payment_method_paypal.optional(), "payto": payment_method_payto.optional(), "pix": payment_method_pix.optional(), "promptpay": payment_method_promptpay.optional(), "radar_options": radar_radar_options.optional(), "revolut_pay": payment_method_revolut_pay.optional(), "samsung_pay": payment_method_samsung_pay.optional(), "satispay": payment_method_satispay.optional(), "scalapay": payment_method_scalapay.optional(), "sepa_debit": payment_method_sepa_debit.optional(), "sofort": payment_method_sofort.optional(), "sunbit": payment_method_sunbit.optional(), "swish": payment_method_swish.optional(), "twint": payment_method_twint.optional(), "type": z.enum(["acss_debit", "affirm", "afterpay_clearpay", "alipay", "alma", "amazon_pay", "au_becs_debit", "bacs_debit", "bancontact", "billie", "bizum", "blik", "boleto", "card", "card_present", "cashapp", "crypto", "custom", "customer_balance", "eps", "fpx", "giropay", "grabpay", "ideal", "interac_present", "kakao_pay", "klarna", "konbini", "kr_card", "link", "mb_way", "mobilepay", "multibanco", "naver_pay", "nz_bank_account", "oxxo", "p24", "pay_by_bank", "payco", "paynow", "paypal", "payto", "pix", "promptpay", "revolut_pay", "samsung_pay", "satispay", "scalapay", "sepa_debit", "sofort", "sunbit", "swish", "twint", "upi", "us_bank_account", "wechat_pay", "zip"]), "upi": payment_method_upi.optional(), "us_bank_account": payment_method_us_bank_account.optional(), "wechat_pay": payment_method_wechat_pay.optional(), "zip": payment_method_zip.optional()})); +const payment_method_acss_debit = z.lazy(() => z.object({"bank_name": z.string().nullable(), "fingerprint": z.string().nullable(), "institution_number": z.string().nullable(), "last4": z.string().nullable(), "transit_number": z.string().nullable()})); const payment_method_affirm = z.lazy(() => z.record(z.string(), z.any())); const payment_method_afterpay_clearpay = z.lazy(() => z.record(z.string(), z.any())); const payment_method_alma = z.lazy(() => z.record(z.string(), z.any())); const payment_method_amazon_pay = z.lazy(() => z.record(z.string(), z.any())); -const payment_method_au_becs_debit = z.lazy(() => z.object({"bsb_number": z.string().nullable(), "fingerprint": z.string().nullable(), "last4": z.string().nullable()}).passthrough()); -const payment_method_bacs_debit = z.lazy(() => z.object({"fingerprint": z.string().nullable(), "last4": z.string().nullable(), "sort_code": z.string().nullable()}).passthrough()); +const payment_method_au_becs_debit = z.lazy(() => z.object({"bsb_number": z.string().nullable(), "fingerprint": z.string().nullable(), "last4": z.string().nullable()})); +const payment_method_bacs_debit = z.lazy(() => z.object({"fingerprint": z.string().nullable(), "last4": z.string().nullable(), "sort_code": z.string().nullable()})); const payment_method_bancontact = z.lazy(() => z.record(z.string(), z.any())); const payment_method_billie = z.lazy(() => z.record(z.string(), z.any())); -const payment_method_bizum = z.lazy(() => z.object({"buyer_id": z.string().nullable().optional()}).passthrough()); -const payment_method_blik = z.lazy(() => z.object({"buyer_id": z.string().nullable().optional()}).passthrough()); -const payment_method_boleto = z.lazy(() => z.object({"tax_id": z.string()}).passthrough()); -const payment_method_card: z.ZodTypeAny = z.lazy(() => z.object({"brand": z.string(), "checks": payment_method_card_checks.nullable(), "country": z.string().nullable(), "description": z.string().nullable().optional(), "display_brand": z.string().nullable(), "exp_month": z.number().int(), "exp_year": z.number().int(), "fingerprint": z.string().nullable().optional(), "funding": z.string(), "generated_from": payment_method_card_generated_card.nullable(), "iin": z.string().nullable().optional(), "issuer": z.string().nullable().optional(), "last4": z.string(), "networks": networks.nullable(), "regulated_status": z.enum(["regulated", "unregulated"]).nullable(), "three_d_secure_usage": three_d_secure_usage.nullable(), "wallet": payment_method_card_wallet.nullable()}).passthrough()); -const payment_method_card_checks = z.lazy(() => z.object({"address_line1_check": z.string().nullable(), "address_postal_code_check": z.string().nullable(), "cvc_check": z.string().nullable()}).passthrough()); -const payment_method_card_generated_card: z.ZodTypeAny = z.lazy(() => z.object({"charge": z.string().nullable(), "payment_method_details": card_generated_from_payment_method_details.nullable(), "setup_attempt": z.union([z.string(), setup_attempt]).nullable()}).passthrough()); -const payment_method_card_present = z.lazy(() => z.object({"brand": z.string().nullable(), "brand_product": z.string().nullable(), "cardholder_name": z.string().nullable(), "country": z.string().nullable(), "description": z.string().nullable().optional(), "exp_month": z.number().int(), "exp_year": z.number().int(), "fingerprint": z.string().nullable(), "funding": z.string().nullable(), "iin": z.string().nullable().optional(), "issuer": z.string().nullable().optional(), "last4": z.string().nullable(), "networks": payment_method_card_present_networks.nullable(), "offline": payment_method_details_card_present_offline.nullable(), "preferred_locales": z.array(z.string()).nullable(), "read_method": z.enum(["contact_emv", "contactless_emv", "contactless_magstripe_mode", "magnetic_stripe_fallback", "magnetic_stripe_track2"]).nullable(), "wallet": payment_flows_private_payment_methods_card_present_common_wallet.optional()}).passthrough()); -const payment_method_card_present_networks = z.lazy(() => z.object({"available": z.array(z.string()), "preferred": z.string().nullable()}).passthrough()); -const payment_method_card_wallet = z.lazy(() => z.object({"amex_express_checkout": payment_method_card_wallet_amex_express_checkout.optional(), "apple_pay": payment_method_card_wallet_apple_pay.optional(), "dynamic_last4": z.string().nullable(), "google_pay": payment_method_card_wallet_google_pay.optional(), "link": payment_method_card_wallet_link.optional(), "masterpass": payment_method_card_wallet_masterpass.optional(), "samsung_pay": payment_method_card_wallet_samsung_pay.optional(), "type": z.enum(["amex_express_checkout", "apple_pay", "google_pay", "link", "masterpass", "samsung_pay", "visa_checkout"]), "visa_checkout": payment_method_card_wallet_visa_checkout.optional()}).passthrough()); +const payment_method_bizum = z.lazy(() => z.object({"buyer_id": z.string().nullable().optional()})); +const payment_method_blik = z.lazy(() => z.object({"buyer_id": z.string().nullable().optional()})); +const payment_method_boleto = z.lazy(() => z.object({"tax_id": z.string()})); +const payment_method_card: z.ZodTypeAny = z.lazy(() => z.object({"brand": z.string(), "checks": payment_method_card_checks.nullable(), "country": z.string().nullable(), "description": z.string().nullable().optional(), "display_brand": z.string().nullable(), "exp_month": z.number().int(), "exp_year": z.number().int(), "fingerprint": z.string().nullable().optional(), "funding": z.string(), "generated_from": payment_method_card_generated_card.nullable(), "iin": z.string().nullable().optional(), "issuer": z.string().nullable().optional(), "last4": z.string(), "networks": networks.nullable(), "regulated_status": z.enum(["regulated", "unregulated"]).nullable(), "three_d_secure_usage": three_d_secure_usage.nullable(), "wallet": payment_method_card_wallet.nullable()})); +const payment_method_card_checks = z.lazy(() => z.object({"address_line1_check": z.string().nullable(), "address_postal_code_check": z.string().nullable(), "cvc_check": z.string().nullable()})); +const payment_method_card_generated_card: z.ZodTypeAny = z.lazy(() => z.object({"charge": z.string().nullable(), "payment_method_details": card_generated_from_payment_method_details.nullable(), "setup_attempt": z.union([z.string(), setup_attempt]).nullable()})); +const payment_method_card_present = z.lazy(() => z.object({"brand": z.string().nullable(), "brand_product": z.string().nullable(), "cardholder_name": z.string().nullable(), "country": z.string().nullable(), "description": z.string().nullable().optional(), "exp_month": z.number().int(), "exp_year": z.number().int(), "fingerprint": z.string().nullable(), "funding": z.string().nullable(), "iin": z.string().nullable().optional(), "issuer": z.string().nullable().optional(), "last4": z.string().nullable(), "networks": payment_method_card_present_networks.nullable(), "offline": payment_method_details_card_present_offline.nullable(), "preferred_locales": z.array(z.string()).nullable(), "read_method": z.enum(["contact_emv", "contactless_emv", "contactless_magstripe_mode", "magnetic_stripe_fallback", "magnetic_stripe_track2"]).nullable(), "wallet": payment_flows_private_payment_methods_card_present_common_wallet.optional()})); +const payment_method_card_present_networks = z.lazy(() => z.object({"available": z.array(z.string()), "preferred": z.string().nullable()})); +const payment_method_card_wallet = z.lazy(() => z.object({"amex_express_checkout": payment_method_card_wallet_amex_express_checkout.optional(), "apple_pay": payment_method_card_wallet_apple_pay.optional(), "dynamic_last4": z.string().nullable(), "google_pay": payment_method_card_wallet_google_pay.optional(), "link": payment_method_card_wallet_link.optional(), "masterpass": payment_method_card_wallet_masterpass.optional(), "samsung_pay": payment_method_card_wallet_samsung_pay.optional(), "type": z.enum(["amex_express_checkout", "apple_pay", "google_pay", "link", "masterpass", "samsung_pay", "visa_checkout"]), "visa_checkout": payment_method_card_wallet_visa_checkout.optional()})); const payment_method_card_wallet_amex_express_checkout = z.lazy(() => z.record(z.string(), z.any())); const payment_method_card_wallet_apple_pay = z.lazy(() => z.record(z.string(), z.any())); const payment_method_card_wallet_google_pay = z.lazy(() => z.record(z.string(), z.any())); const payment_method_card_wallet_link = z.lazy(() => z.record(z.string(), z.any())); -const payment_method_card_wallet_masterpass = z.lazy(() => z.object({"billing_address": address.nullable(), "email": z.string().nullable(), "name": z.string().nullable(), "shipping_address": address.nullable()}).passthrough()); +const payment_method_card_wallet_masterpass = z.lazy(() => z.object({"billing_address": address.nullable(), "email": z.string().nullable(), "name": z.string().nullable(), "shipping_address": address.nullable()})); const payment_method_card_wallet_samsung_pay = z.lazy(() => z.record(z.string(), z.any())); -const payment_method_card_wallet_visa_checkout = z.lazy(() => z.object({"billing_address": address.nullable(), "email": z.string().nullable(), "name": z.string().nullable(), "shipping_address": address.nullable()}).passthrough()); -const payment_method_cashapp = z.lazy(() => z.object({"buyer_id": z.string().nullable(), "cashtag": z.string().nullable()}).passthrough()); -const payment_method_config_biz_payment_method_configuration_details = z.lazy(() => z.object({"id": z.string(), "parent": z.string().nullable()}).passthrough()); +const payment_method_card_wallet_visa_checkout = z.lazy(() => z.object({"billing_address": address.nullable(), "email": z.string().nullable(), "name": z.string().nullable(), "shipping_address": address.nullable()})); +const payment_method_cashapp = z.lazy(() => z.object({"buyer_id": z.string().nullable(), "cashtag": z.string().nullable()})); +const payment_method_config_biz_payment_method_configuration_details = z.lazy(() => z.object({"id": z.string(), "parent": z.string().nullable()})); const payment_method_crypto = z.lazy(() => z.record(z.string(), z.any())); -const payment_method_custom = z.lazy(() => z.object({"display_name": z.string().nullable(), "logo": custom_logo.nullable(), "type": z.string()}).passthrough()); +const payment_method_custom = z.lazy(() => z.object({"display_name": z.string().nullable(), "logo": custom_logo.nullable(), "type": z.string()})); const payment_method_customer_balance = z.lazy(() => z.record(z.string(), z.any())); -const payment_method_details: z.ZodTypeAny = z.lazy(() => z.object({"ach_credit_transfer": payment_method_details_ach_credit_transfer.optional(), "ach_debit": payment_method_details_ach_debit.optional(), "acss_debit": payment_method_details_acss_debit.optional(), "affirm": payment_method_details_affirm.optional(), "afterpay_clearpay": payment_method_details_afterpay_clearpay.optional(), "alipay": payment_flows_private_payment_methods_alipay_details.optional(), "alma": payment_method_details_alma.optional(), "amazon_pay": payment_method_details_amazon_pay.optional(), "au_becs_debit": payment_method_details_au_becs_debit.optional(), "bacs_debit": payment_method_details_bacs_debit.optional(), "bancontact": payment_method_details_bancontact.optional(), "billie": payment_method_details_billie.optional(), "bizum": payment_method_details_bizum.optional(), "blik": payment_method_details_blik.optional(), "boleto": payment_method_details_boleto.optional(), "card": payment_method_details_card.optional(), "card_present": payment_method_details_card_present.optional(), "cashapp": payment_method_details_cashapp.optional(), "crypto": payment_method_details_crypto.optional(), "customer_balance": payment_method_details_customer_balance.optional(), "eps": payment_method_details_eps.optional(), "fpx": payment_method_details_fpx.optional(), "giropay": payment_method_details_giropay.optional(), "grabpay": payment_method_details_grabpay.optional(), "ideal": payment_method_details_ideal.optional(), "interac_present": payment_method_details_interac_present.optional(), "kakao_pay": payment_method_details_kakao_pay.optional(), "klarna": payment_method_details_klarna.optional(), "konbini": payment_method_details_konbini.optional(), "kr_card": payment_method_details_kr_card.optional(), "link": payment_method_details_link.optional(), "mb_way": payment_method_details_mb_way.optional(), "mobilepay": payment_method_details_mobilepay.optional(), "multibanco": payment_method_details_multibanco.optional(), "naver_pay": payment_method_details_naver_pay.optional(), "nz_bank_account": payment_method_details_nz_bank_account.optional(), "oxxo": payment_method_details_oxxo.optional(), "p24": payment_method_details_p24.optional(), "pay_by_bank": payment_method_details_pay_by_bank.optional(), "payco": payment_method_details_payco.optional(), "paynow": payment_method_details_paynow.optional(), "paypal": payment_method_details_paypal.optional(), "payto": payment_method_details_payto.optional(), "pix": payment_method_details_pix.optional(), "promptpay": payment_method_details_promptpay.optional(), "revolut_pay": payment_method_details_revolut_pay.optional(), "samsung_pay": payment_method_details_samsung_pay.optional(), "satispay": payment_method_details_satispay.optional(), "scalapay": payment_method_details_scalapay.optional(), "sepa_credit_transfer": payment_method_details_sepa_credit_transfer.optional(), "sepa_debit": payment_method_details_sepa_debit.optional(), "sofort": payment_method_details_sofort.optional(), "stripe_account": payment_method_details_stripe_account.optional(), "sunbit": payment_method_details_sunbit.optional(), "swish": payment_method_details_swish.optional(), "twint": payment_method_details_twint.optional(), "type": z.string(), "upi": payment_method_details_upi.optional(), "us_bank_account": payment_method_details_us_bank_account.optional(), "wechat": payment_method_details_wechat.optional(), "wechat_pay": payment_method_details_wechat_pay.optional(), "zip": payment_method_details_zip.optional()}).passthrough()); -const payment_method_details_ach_credit_transfer = z.lazy(() => z.object({"account_number": z.string().nullable(), "bank_name": z.string().nullable(), "routing_number": z.string().nullable(), "swift_code": z.string().nullable()}).passthrough()); -const payment_method_details_ach_debit = z.lazy(() => z.object({"account_holder_type": z.enum(["company", "individual"]).nullable(), "bank_name": z.string().nullable(), "country": z.string().nullable(), "fingerprint": z.string().nullable(), "last4": z.string().nullable(), "routing_number": z.string().nullable()}).passthrough()); -const payment_method_details_acss_debit = z.lazy(() => z.object({"bank_name": z.string().nullable(), "expected_debit_date": z.string().optional(), "fingerprint": z.string().nullable(), "institution_number": z.string().nullable(), "last4": z.string().nullable(), "mandate": z.string().optional(), "transit_number": z.string().nullable()}).passthrough()); -const payment_method_details_affirm = z.lazy(() => z.object({"location": z.string().optional(), "reader": z.string().optional(), "transaction_id": z.string().nullable()}).passthrough()); -const payment_method_details_afterpay_clearpay = z.lazy(() => z.object({"order_id": z.string().nullable(), "reference": z.string().nullable()}).passthrough()); -const payment_method_details_alma = z.lazy(() => z.object({"installments": alma_installments.optional(), "transaction_id": z.string().nullable()}).passthrough()); -const payment_method_details_amazon_pay = z.lazy(() => z.object({"funding": amazon_pay_underlying_payment_method_funding_details.optional(), "transaction_id": z.string().nullable()}).passthrough()); -const payment_method_details_au_becs_debit = z.lazy(() => z.object({"bsb_number": z.string().nullable(), "expected_debit_date": z.string().optional(), "fingerprint": z.string().nullable(), "last4": z.string().nullable(), "mandate": z.string().optional()}).passthrough()); -const payment_method_details_bacs_debit = z.lazy(() => z.object({"expected_debit_date": z.string().optional(), "fingerprint": z.string().nullable(), "last4": z.string().nullable(), "mandate": z.string().nullable(), "sort_code": z.string().nullable()}).passthrough()); -const payment_method_details_bancontact: z.ZodTypeAny = z.lazy(() => z.object({"bank_code": z.string().nullable(), "bank_name": z.string().nullable(), "bic": z.string().nullable(), "generated_sepa_debit": z.union([z.string(), payment_method]).nullable(), "generated_sepa_debit_mandate": z.union([z.string(), mandate]).nullable(), "iban_last4": z.string().nullable(), "preferred_language": z.enum(["de", "en", "fr", "nl"]).nullable(), "verified_name": z.string().nullable()}).passthrough()); -const payment_method_details_billie = z.lazy(() => z.object({"transaction_id": z.string().nullable()}).passthrough()); -const payment_method_details_bizum = z.lazy(() => z.object({"buyer_id": z.string().nullable(), "transaction_id": z.string().nullable()}).passthrough()); -const payment_method_details_blik = z.lazy(() => z.object({"buyer_id": z.string().nullable()}).passthrough()); -const payment_method_details_boleto = z.lazy(() => z.object({"tax_id": z.string()}).passthrough()); -const payment_method_details_card = z.lazy(() => z.object({"amount_authorized": z.number().int().nullable(), "authorization_code": z.string().nullable(), "brand": z.string().nullable(), "capture_before": z.number().int().optional(), "checks": payment_method_details_card_checks.nullable(), "country": z.string().nullable(), "description": z.string().nullable().optional(), "exp_month": z.number().int(), "exp_year": z.number().int(), "extended_authorization": payment_flows_private_payment_methods_card_details_api_resource_enterprise_features_extended_authorization_extended_authorization.optional(), "fingerprint": z.string().nullable().optional(), "funding": z.string().nullable(), "iin": z.string().nullable().optional(), "incremental_authorization": payment_flows_private_payment_methods_card_details_api_resource_enterprise_features_incremental_authorization_incremental_authorization.optional(), "installments": payment_method_details_card_installments.nullable(), "issuer": z.string().nullable().optional(), "last4": z.string().nullable(), "mandate": z.string().nullable(), "moto": z.boolean().nullable().optional(), "multicapture": payment_flows_private_payment_methods_card_details_api_resource_multicapture.optional(), "network": z.string().nullable(), "network_token": payment_method_details_card_network_token.nullable().optional(), "network_transaction_id": z.string().nullable(), "overcapture": payment_flows_private_payment_methods_card_details_api_resource_enterprise_features_overcapture_overcapture.optional(), "regulated_status": z.enum(["regulated", "unregulated"]).nullable(), "three_d_secure": three_d_secure_details_charge.nullable(), "transaction_link_id": z.string().nullable(), "wallet": payment_method_details_card_wallet.nullable()}).passthrough()); -const payment_method_details_card_checks = z.lazy(() => z.object({"address_line1_check": z.string().nullable(), "address_postal_code_check": z.string().nullable(), "cvc_check": z.string().nullable()}).passthrough()); -const payment_method_details_card_installments = z.lazy(() => z.object({"plan": payment_method_details_card_installments_plan.nullable()}).passthrough()); -const payment_method_details_card_installments_plan = z.lazy(() => z.object({"count": z.number().int().nullable(), "interval": z.literal("month").nullable(), "type": z.enum(["bonus", "fixed_count", "revolving"])}).passthrough()); -const payment_method_details_card_network_token = z.lazy(() => z.object({"used": z.boolean()}).passthrough()); -const payment_method_details_card_present = z.lazy(() => z.object({"amount_authorized": z.number().int().nullable(), "brand": z.string().nullable(), "brand_product": z.string().nullable(), "capture_before": z.number().int().optional(), "cardholder_name": z.string().nullable(), "country": z.string().nullable(), "description": z.string().nullable().optional(), "emv_auth_data": z.string().nullable(), "exp_month": z.number().int(), "exp_year": z.number().int(), "fingerprint": z.string().nullable(), "funding": z.string().nullable(), "generated_card": z.string().nullable(), "iin": z.string().nullable().optional(), "incremental_authorization_supported": z.boolean(), "issuer": z.string().nullable().optional(), "last4": z.string().nullable(), "location": z.string().optional(), "network": z.string().nullable(), "network_transaction_id": z.string().nullable(), "offline": payment_method_details_card_present_offline.nullable(), "overcapture_supported": z.boolean(), "preferred_locales": z.array(z.string()).nullable(), "read_method": z.enum(["contact_emv", "contactless_emv", "contactless_magstripe_mode", "magnetic_stripe_fallback", "magnetic_stripe_track2"]).nullable(), "reader": z.string().optional(), "receipt": payment_method_details_card_present_receipt.nullable(), "wallet": payment_flows_private_payment_methods_card_present_common_wallet.optional()}).passthrough()); -const payment_method_details_card_present_offline = z.lazy(() => z.object({"stored_at": z.number().int().nullable(), "type": z.literal("deferred").nullable()}).passthrough()); -const payment_method_details_card_present_receipt = z.lazy(() => z.object({"account_type": z.enum(["checking", "credit", "prepaid", "unknown"]).optional(), "application_cryptogram": z.string().nullable(), "application_preferred_name": z.string().nullable(), "authorization_code": z.string().nullable(), "authorization_response_code": z.string().nullable(), "cardholder_verification_method": z.string().nullable(), "dedicated_file_name": z.string().nullable(), "terminal_verification_results": z.string().nullable(), "transaction_status_information": z.string().nullable()}).passthrough()); -const payment_method_details_card_wallet = z.lazy(() => z.object({"amex_express_checkout": payment_method_details_card_wallet_amex_express_checkout.optional(), "apple_pay": payment_method_details_card_wallet_apple_pay.optional(), "dynamic_last4": z.string().nullable(), "google_pay": payment_method_details_card_wallet_google_pay.optional(), "link": payment_method_details_card_wallet_link.optional(), "masterpass": payment_method_details_card_wallet_masterpass.optional(), "samsung_pay": payment_method_details_card_wallet_samsung_pay.optional(), "type": z.enum(["amex_express_checkout", "apple_pay", "google_pay", "link", "masterpass", "samsung_pay", "visa_checkout"]), "visa_checkout": payment_method_details_card_wallet_visa_checkout.optional()}).passthrough()); +const payment_method_details: z.ZodTypeAny = z.lazy(() => z.object({"ach_credit_transfer": payment_method_details_ach_credit_transfer.optional(), "ach_debit": payment_method_details_ach_debit.optional(), "acss_debit": payment_method_details_acss_debit.optional(), "affirm": payment_method_details_affirm.optional(), "afterpay_clearpay": payment_method_details_afterpay_clearpay.optional(), "alipay": payment_flows_private_payment_methods_alipay_details.optional(), "alma": payment_method_details_alma.optional(), "amazon_pay": payment_method_details_amazon_pay.optional(), "au_becs_debit": payment_method_details_au_becs_debit.optional(), "bacs_debit": payment_method_details_bacs_debit.optional(), "bancontact": payment_method_details_bancontact.optional(), "billie": payment_method_details_billie.optional(), "bizum": payment_method_details_bizum.optional(), "blik": payment_method_details_blik.optional(), "boleto": payment_method_details_boleto.optional(), "card": payment_method_details_card.optional(), "card_present": payment_method_details_card_present.optional(), "cashapp": payment_method_details_cashapp.optional(), "crypto": payment_method_details_crypto.optional(), "customer_balance": payment_method_details_customer_balance.optional(), "eps": payment_method_details_eps.optional(), "fpx": payment_method_details_fpx.optional(), "giropay": payment_method_details_giropay.optional(), "grabpay": payment_method_details_grabpay.optional(), "ideal": payment_method_details_ideal.optional(), "interac_present": payment_method_details_interac_present.optional(), "kakao_pay": payment_method_details_kakao_pay.optional(), "klarna": payment_method_details_klarna.optional(), "konbini": payment_method_details_konbini.optional(), "kr_card": payment_method_details_kr_card.optional(), "link": payment_method_details_link.optional(), "mb_way": payment_method_details_mb_way.optional(), "mobilepay": payment_method_details_mobilepay.optional(), "multibanco": payment_method_details_multibanco.optional(), "naver_pay": payment_method_details_naver_pay.optional(), "nz_bank_account": payment_method_details_nz_bank_account.optional(), "oxxo": payment_method_details_oxxo.optional(), "p24": payment_method_details_p24.optional(), "pay_by_bank": payment_method_details_pay_by_bank.optional(), "payco": payment_method_details_payco.optional(), "paynow": payment_method_details_paynow.optional(), "paypal": payment_method_details_paypal.optional(), "payto": payment_method_details_payto.optional(), "pix": payment_method_details_pix.optional(), "promptpay": payment_method_details_promptpay.optional(), "revolut_pay": payment_method_details_revolut_pay.optional(), "samsung_pay": payment_method_details_samsung_pay.optional(), "satispay": payment_method_details_satispay.optional(), "scalapay": payment_method_details_scalapay.optional(), "sepa_credit_transfer": payment_method_details_sepa_credit_transfer.optional(), "sepa_debit": payment_method_details_sepa_debit.optional(), "sofort": payment_method_details_sofort.optional(), "stripe_account": payment_method_details_stripe_account.optional(), "sunbit": payment_method_details_sunbit.optional(), "swish": payment_method_details_swish.optional(), "twint": payment_method_details_twint.optional(), "type": z.string(), "upi": payment_method_details_upi.optional(), "us_bank_account": payment_method_details_us_bank_account.optional(), "wechat": payment_method_details_wechat.optional(), "wechat_pay": payment_method_details_wechat_pay.optional(), "zip": payment_method_details_zip.optional()})); +const payment_method_details_ach_credit_transfer = z.lazy(() => z.object({"account_number": z.string().nullable(), "bank_name": z.string().nullable(), "routing_number": z.string().nullable(), "swift_code": z.string().nullable()})); +const payment_method_details_ach_debit = z.lazy(() => z.object({"account_holder_type": z.enum(["company", "individual"]).nullable(), "bank_name": z.string().nullable(), "country": z.string().nullable(), "fingerprint": z.string().nullable(), "last4": z.string().nullable(), "routing_number": z.string().nullable()})); +const payment_method_details_acss_debit = z.lazy(() => z.object({"bank_name": z.string().nullable(), "expected_debit_date": z.string().optional(), "fingerprint": z.string().nullable(), "institution_number": z.string().nullable(), "last4": z.string().nullable(), "mandate": z.string().optional(), "transit_number": z.string().nullable()})); +const payment_method_details_affirm = z.lazy(() => z.object({"location": z.string().optional(), "reader": z.string().optional(), "transaction_id": z.string().nullable()})); +const payment_method_details_afterpay_clearpay = z.lazy(() => z.object({"order_id": z.string().nullable(), "reference": z.string().nullable()})); +const payment_method_details_alma = z.lazy(() => z.object({"installments": alma_installments.optional(), "transaction_id": z.string().nullable()})); +const payment_method_details_amazon_pay = z.lazy(() => z.object({"funding": amazon_pay_underlying_payment_method_funding_details.optional(), "transaction_id": z.string().nullable()})); +const payment_method_details_au_becs_debit = z.lazy(() => z.object({"bsb_number": z.string().nullable(), "expected_debit_date": z.string().optional(), "fingerprint": z.string().nullable(), "last4": z.string().nullable(), "mandate": z.string().optional()})); +const payment_method_details_bacs_debit = z.lazy(() => z.object({"expected_debit_date": z.string().optional(), "fingerprint": z.string().nullable(), "last4": z.string().nullable(), "mandate": z.string().nullable(), "sort_code": z.string().nullable()})); +const payment_method_details_bancontact: z.ZodTypeAny = z.lazy(() => z.object({"bank_code": z.string().nullable(), "bank_name": z.string().nullable(), "bic": z.string().nullable(), "generated_sepa_debit": z.union([z.string(), payment_method]).nullable(), "generated_sepa_debit_mandate": z.union([z.string(), mandate]).nullable(), "iban_last4": z.string().nullable(), "preferred_language": z.enum(["de", "en", "fr", "nl"]).nullable(), "verified_name": z.string().nullable()})); +const payment_method_details_billie = z.lazy(() => z.object({"transaction_id": z.string().nullable()})); +const payment_method_details_bizum = z.lazy(() => z.object({"buyer_id": z.string().nullable(), "transaction_id": z.string().nullable()})); +const payment_method_details_blik = z.lazy(() => z.object({"buyer_id": z.string().nullable()})); +const payment_method_details_boleto = z.lazy(() => z.object({"tax_id": z.string()})); +const payment_method_details_card = z.lazy(() => z.object({"amount_authorized": z.number().int().nullable(), "authorization_code": z.string().nullable(), "brand": z.string().nullable(), "capture_before": z.number().int().optional(), "checks": payment_method_details_card_checks.nullable(), "country": z.string().nullable(), "description": z.string().nullable().optional(), "exp_month": z.number().int(), "exp_year": z.number().int(), "extended_authorization": payment_flows_private_payment_methods_card_details_api_resource_enterprise_features_extended_authorization_extended_authorization.optional(), "fingerprint": z.string().nullable().optional(), "funding": z.string().nullable(), "iin": z.string().nullable().optional(), "incremental_authorization": payment_flows_private_payment_methods_card_details_api_resource_enterprise_features_incremental_authorization_incremental_authorization.optional(), "installments": payment_method_details_card_installments.nullable(), "issuer": z.string().nullable().optional(), "last4": z.string().nullable(), "mandate": z.string().nullable(), "moto": z.boolean().nullable().optional(), "multicapture": payment_flows_private_payment_methods_card_details_api_resource_multicapture.optional(), "network": z.string().nullable(), "network_token": payment_method_details_card_network_token.nullable().optional(), "network_transaction_id": z.string().nullable(), "overcapture": payment_flows_private_payment_methods_card_details_api_resource_enterprise_features_overcapture_overcapture.optional(), "regulated_status": z.enum(["regulated", "unregulated"]).nullable(), "three_d_secure": three_d_secure_details_charge.nullable(), "transaction_link_id": z.string().nullable(), "wallet": payment_method_details_card_wallet.nullable()})); +const payment_method_details_card_checks = z.lazy(() => z.object({"address_line1_check": z.string().nullable(), "address_postal_code_check": z.string().nullable(), "cvc_check": z.string().nullable()})); +const payment_method_details_card_installments = z.lazy(() => z.object({"plan": payment_method_details_card_installments_plan.nullable()})); +const payment_method_details_card_installments_plan = z.lazy(() => z.object({"count": z.number().int().nullable(), "interval": z.literal("month").nullable(), "type": z.enum(["bonus", "fixed_count", "revolving"])})); +const payment_method_details_card_network_token = z.lazy(() => z.object({"used": z.boolean()})); +const payment_method_details_card_present = z.lazy(() => z.object({"amount_authorized": z.number().int().nullable(), "brand": z.string().nullable(), "brand_product": z.string().nullable(), "capture_before": z.number().int().optional(), "cardholder_name": z.string().nullable(), "country": z.string().nullable(), "description": z.string().nullable().optional(), "emv_auth_data": z.string().nullable(), "exp_month": z.number().int(), "exp_year": z.number().int(), "fingerprint": z.string().nullable(), "funding": z.string().nullable(), "generated_card": z.string().nullable(), "iin": z.string().nullable().optional(), "incremental_authorization_supported": z.boolean(), "issuer": z.string().nullable().optional(), "last4": z.string().nullable(), "location": z.string().optional(), "network": z.string().nullable(), "network_transaction_id": z.string().nullable(), "offline": payment_method_details_card_present_offline.nullable(), "overcapture_supported": z.boolean(), "preferred_locales": z.array(z.string()).nullable(), "read_method": z.enum(["contact_emv", "contactless_emv", "contactless_magstripe_mode", "magnetic_stripe_fallback", "magnetic_stripe_track2"]).nullable(), "reader": z.string().optional(), "receipt": payment_method_details_card_present_receipt.nullable(), "wallet": payment_flows_private_payment_methods_card_present_common_wallet.optional()})); +const payment_method_details_card_present_offline = z.lazy(() => z.object({"stored_at": z.number().int().nullable(), "type": z.literal("deferred").nullable()})); +const payment_method_details_card_present_receipt = z.lazy(() => z.object({"account_type": z.enum(["checking", "credit", "prepaid", "unknown"]).optional(), "application_cryptogram": z.string().nullable(), "application_preferred_name": z.string().nullable(), "authorization_code": z.string().nullable(), "authorization_response_code": z.string().nullable(), "cardholder_verification_method": z.string().nullable(), "dedicated_file_name": z.string().nullable(), "terminal_verification_results": z.string().nullable(), "transaction_status_information": z.string().nullable()})); +const payment_method_details_card_wallet = z.lazy(() => z.object({"amex_express_checkout": payment_method_details_card_wallet_amex_express_checkout.optional(), "apple_pay": payment_method_details_card_wallet_apple_pay.optional(), "dynamic_last4": z.string().nullable(), "google_pay": payment_method_details_card_wallet_google_pay.optional(), "link": payment_method_details_card_wallet_link.optional(), "masterpass": payment_method_details_card_wallet_masterpass.optional(), "samsung_pay": payment_method_details_card_wallet_samsung_pay.optional(), "type": z.enum(["amex_express_checkout", "apple_pay", "google_pay", "link", "masterpass", "samsung_pay", "visa_checkout"]), "visa_checkout": payment_method_details_card_wallet_visa_checkout.optional()})); const payment_method_details_card_wallet_amex_express_checkout = z.lazy(() => z.record(z.string(), z.any())); const payment_method_details_card_wallet_apple_pay = z.lazy(() => z.record(z.string(), z.any())); const payment_method_details_card_wallet_google_pay = z.lazy(() => z.record(z.string(), z.any())); const payment_method_details_card_wallet_link = z.lazy(() => z.record(z.string(), z.any())); -const payment_method_details_card_wallet_masterpass = z.lazy(() => z.object({"billing_address": address.nullable(), "email": z.string().nullable(), "name": z.string().nullable(), "shipping_address": address.nullable()}).passthrough()); +const payment_method_details_card_wallet_masterpass = z.lazy(() => z.object({"billing_address": address.nullable(), "email": z.string().nullable(), "name": z.string().nullable(), "shipping_address": address.nullable()})); const payment_method_details_card_wallet_samsung_pay = z.lazy(() => z.record(z.string(), z.any())); -const payment_method_details_card_wallet_visa_checkout = z.lazy(() => z.object({"billing_address": address.nullable(), "email": z.string().nullable(), "name": z.string().nullable(), "shipping_address": address.nullable()}).passthrough()); -const payment_method_details_cashapp = z.lazy(() => z.object({"buyer_id": z.string().nullable(), "cashtag": z.string().nullable(), "transaction_id": z.string().nullable()}).passthrough()); -const payment_method_details_crypto = z.lazy(() => z.object({"buyer_address": z.string().optional(), "network": z.enum(["base", "ethereum", "polygon", "solana", "sui", "tempo"]).optional(), "token_currency": z.enum(["phantom_cash", "usdc", "usdg", "usdp", "usdsui", "usdt"]).optional(), "transaction_hash": z.string().optional()}).passthrough()); +const payment_method_details_card_wallet_visa_checkout = z.lazy(() => z.object({"billing_address": address.nullable(), "email": z.string().nullable(), "name": z.string().nullable(), "shipping_address": address.nullable()})); +const payment_method_details_cashapp = z.lazy(() => z.object({"buyer_id": z.string().nullable(), "cashtag": z.string().nullable(), "transaction_id": z.string().nullable()})); +const payment_method_details_crypto = z.lazy(() => z.object({"buyer_address": z.string().optional(), "network": z.enum(["base", "ethereum", "polygon", "solana", "sui", "tempo"]).optional(), "token_currency": z.enum(["phantom_cash", "usdc", "usdg", "usdp", "usdsui", "usdt"]).optional(), "transaction_hash": z.string().optional()})); const payment_method_details_customer_balance = z.lazy(() => z.record(z.string(), z.any())); -const payment_method_details_eps = z.lazy(() => z.object({"bank": z.enum(["arzte_und_apotheker_bank", "austrian_anadi_bank_ag", "bank_austria", "bankhaus_carl_spangler", "bankhaus_schelhammer_und_schattera_ag", "bawag_psk_ag", "bks_bank_ag", "brull_kallmus_bank_ag", "btv_vier_lander_bank", "capital_bank_grawe_gruppe_ag", "deutsche_bank_ag", "dolomitenbank", "easybank_ag", "erste_bank_und_sparkassen", "hypo_alpeadriabank_international_ag", "hypo_bank_burgenland_aktiengesellschaft", "hypo_noe_lb_fur_niederosterreich_u_wien", "hypo_oberosterreich_salzburg_steiermark", "hypo_tirol_bank_ag", "hypo_vorarlberg_bank_ag", "marchfelder_bank", "oberbank_ag", "raiffeisen_bankengruppe_osterreich", "schoellerbank_ag", "sparda_bank_wien", "volksbank_gruppe", "volkskreditbank_ag", "vr_bank_braunau"]).nullable(), "verified_name": z.string().nullable()}).passthrough()); -const payment_method_details_fpx = z.lazy(() => z.object({"account_holder_type": z.enum(["company", "individual"]).nullable(), "bank": z.enum(["affin_bank", "agrobank", "alliance_bank", "ambank", "bank_islam", "bank_muamalat", "bank_of_china", "bank_rakyat", "bsn", "cimb", "deutsche_bank", "hong_leong_bank", "hsbc", "kfh", "maybank2e", "maybank2u", "ocbc", "pb_enterprise", "public_bank", "rhb", "standard_chartered", "uob"]), "transaction_id": z.string().nullable()}).passthrough()); -const payment_method_details_giropay = z.lazy(() => z.object({"bank_code": z.string().nullable(), "bank_name": z.string().nullable(), "bic": z.string().nullable(), "verified_name": z.string().nullable()}).passthrough()); -const payment_method_details_grabpay = z.lazy(() => z.object({"transaction_id": z.string().nullable()}).passthrough()); -const payment_method_details_ideal: z.ZodTypeAny = z.lazy(() => z.object({"bank": z.enum(["abn_amro", "adyen", "asn_bank", "bunq", "buut", "finom", "handelsbanken", "ing", "knab", "mollie", "moneyou", "n26", "nn", "rabobank", "regiobank", "revolut", "sns_bank", "triodos_bank", "van_lanschot", "yoursafe"]).nullable(), "bic": z.enum(["ABNANL2A", "ADYBNL2A", "ASNBNL21", "BITSNL2A", "BUNQNL2A", "BUUTNL2A", "FNOMNL22", "FVLBNL22", "HANDNL2A", "INGBNL2A", "KNABNL2H", "MLLENL2A", "MOYONL21", "NNBANL2G", "NTSBDEB1", "RABONL2U", "RBRBNL21", "REVOIE23", "REVOLT21", "SNSBNL2A", "TRIONL2U"]).nullable(), "generated_sepa_debit": z.union([z.string(), payment_method]).nullable(), "generated_sepa_debit_mandate": z.union([z.string(), mandate]).nullable(), "iban_last4": z.string().nullable(), "transaction_id": z.string().nullable(), "verified_name": z.string().nullable()}).passthrough()); -const payment_method_details_interac_present = z.lazy(() => z.object({"brand": z.string().nullable(), "cardholder_name": z.string().nullable(), "country": z.string().nullable(), "description": z.string().nullable().optional(), "emv_auth_data": z.string().nullable(), "exp_month": z.number().int(), "exp_year": z.number().int(), "fingerprint": z.string().nullable(), "funding": z.string().nullable(), "generated_card": z.string().nullable(), "iin": z.string().nullable().optional(), "issuer": z.string().nullable().optional(), "last4": z.string().nullable(), "location": z.string().optional(), "network": z.string().nullable(), "network_transaction_id": z.string().nullable(), "preferred_locales": z.array(z.string()).nullable(), "read_method": z.enum(["contact_emv", "contactless_emv", "contactless_magstripe_mode", "magnetic_stripe_fallback", "magnetic_stripe_track2"]).nullable(), "reader": z.string().optional(), "receipt": payment_method_details_interac_present_receipt.nullable()}).passthrough()); -const payment_method_details_interac_present_receipt = z.lazy(() => z.object({"account_type": z.enum(["checking", "savings", "unknown"]).optional(), "application_cryptogram": z.string().nullable(), "application_preferred_name": z.string().nullable(), "authorization_code": z.string().nullable(), "authorization_response_code": z.string().nullable(), "cardholder_verification_method": z.string().nullable(), "dedicated_file_name": z.string().nullable(), "terminal_verification_results": z.string().nullable(), "transaction_status_information": z.string().nullable()}).passthrough()); -const payment_method_details_kakao_pay = z.lazy(() => z.object({"buyer_id": z.string().nullable(), "transaction_id": z.string().nullable()}).passthrough()); -const payment_method_details_klarna = z.lazy(() => z.object({"location": z.string().optional(), "payer_details": klarna_payer_details.nullable(), "payment_method_category": z.string().nullable(), "preferred_locale": z.string().nullable(), "reader": z.string().optional()}).passthrough()); -const payment_method_details_konbini = z.lazy(() => z.object({"store": payment_method_details_konbini_store.nullable()}).passthrough()); -const payment_method_details_konbini_store = z.lazy(() => z.object({"chain": z.enum(["familymart", "lawson", "ministop", "seicomart"]).nullable()}).passthrough()); -const payment_method_details_kr_card = z.lazy(() => z.object({"brand": z.enum(["bc", "citi", "hana", "hyundai", "jeju", "jeonbuk", "kakaobank", "kbank", "kdbbank", "kookmin", "kwangju", "lotte", "mg", "nh", "post", "samsung", "savingsbank", "shinhan", "shinhyup", "suhyup", "tossbank", "woori"]).nullable(), "buyer_id": z.string().nullable(), "last4": z.string().nullable(), "transaction_id": z.string().nullable()}).passthrough()); -const payment_method_details_link = z.lazy(() => z.object({"country": z.string().nullable()}).passthrough()); +const payment_method_details_eps = z.lazy(() => z.object({"bank": z.enum(["arzte_und_apotheker_bank", "austrian_anadi_bank_ag", "bank_austria", "bankhaus_carl_spangler", "bankhaus_schelhammer_und_schattera_ag", "bawag_psk_ag", "bks_bank_ag", "brull_kallmus_bank_ag", "btv_vier_lander_bank", "capital_bank_grawe_gruppe_ag", "deutsche_bank_ag", "dolomitenbank", "easybank_ag", "erste_bank_und_sparkassen", "hypo_alpeadriabank_international_ag", "hypo_bank_burgenland_aktiengesellschaft", "hypo_noe_lb_fur_niederosterreich_u_wien", "hypo_oberosterreich_salzburg_steiermark", "hypo_tirol_bank_ag", "hypo_vorarlberg_bank_ag", "marchfelder_bank", "oberbank_ag", "raiffeisen_bankengruppe_osterreich", "schoellerbank_ag", "sparda_bank_wien", "volksbank_gruppe", "volkskreditbank_ag", "vr_bank_braunau"]).nullable(), "verified_name": z.string().nullable()})); +const payment_method_details_fpx = z.lazy(() => z.object({"account_holder_type": z.enum(["company", "individual"]).nullable(), "bank": z.enum(["affin_bank", "agrobank", "alliance_bank", "ambank", "bank_islam", "bank_muamalat", "bank_of_china", "bank_rakyat", "bsn", "cimb", "deutsche_bank", "hong_leong_bank", "hsbc", "kfh", "maybank2e", "maybank2u", "ocbc", "pb_enterprise", "public_bank", "rhb", "standard_chartered", "uob"]), "transaction_id": z.string().nullable()})); +const payment_method_details_giropay = z.lazy(() => z.object({"bank_code": z.string().nullable(), "bank_name": z.string().nullable(), "bic": z.string().nullable(), "verified_name": z.string().nullable()})); +const payment_method_details_grabpay = z.lazy(() => z.object({"transaction_id": z.string().nullable()})); +const payment_method_details_ideal: z.ZodTypeAny = z.lazy(() => z.object({"bank": z.enum(["abn_amro", "adyen", "asn_bank", "bunq", "buut", "finom", "handelsbanken", "ing", "knab", "mollie", "moneyou", "n26", "nn", "rabobank", "regiobank", "revolut", "sns_bank", "triodos_bank", "van_lanschot", "yoursafe"]).nullable(), "bic": z.enum(["ABNANL2A", "ADYBNL2A", "ASNBNL21", "BITSNL2A", "BUNQNL2A", "BUUTNL2A", "FNOMNL22", "FVLBNL22", "HANDNL2A", "INGBNL2A", "KNABNL2H", "MLLENL2A", "MOYONL21", "NNBANL2G", "NTSBDEB1", "RABONL2U", "RBRBNL21", "REVOIE23", "REVOLT21", "SNSBNL2A", "TRIONL2U"]).nullable(), "generated_sepa_debit": z.union([z.string(), payment_method]).nullable(), "generated_sepa_debit_mandate": z.union([z.string(), mandate]).nullable(), "iban_last4": z.string().nullable(), "transaction_id": z.string().nullable(), "verified_name": z.string().nullable()})); +const payment_method_details_interac_present = z.lazy(() => z.object({"brand": z.string().nullable(), "cardholder_name": z.string().nullable(), "country": z.string().nullable(), "description": z.string().nullable().optional(), "emv_auth_data": z.string().nullable(), "exp_month": z.number().int(), "exp_year": z.number().int(), "fingerprint": z.string().nullable(), "funding": z.string().nullable(), "generated_card": z.string().nullable(), "iin": z.string().nullable().optional(), "issuer": z.string().nullable().optional(), "last4": z.string().nullable(), "location": z.string().optional(), "network": z.string().nullable(), "network_transaction_id": z.string().nullable(), "preferred_locales": z.array(z.string()).nullable(), "read_method": z.enum(["contact_emv", "contactless_emv", "contactless_magstripe_mode", "magnetic_stripe_fallback", "magnetic_stripe_track2"]).nullable(), "reader": z.string().optional(), "receipt": payment_method_details_interac_present_receipt.nullable()})); +const payment_method_details_interac_present_receipt = z.lazy(() => z.object({"account_type": z.enum(["checking", "savings", "unknown"]).optional(), "application_cryptogram": z.string().nullable(), "application_preferred_name": z.string().nullable(), "authorization_code": z.string().nullable(), "authorization_response_code": z.string().nullable(), "cardholder_verification_method": z.string().nullable(), "dedicated_file_name": z.string().nullable(), "terminal_verification_results": z.string().nullable(), "transaction_status_information": z.string().nullable()})); +const payment_method_details_kakao_pay = z.lazy(() => z.object({"buyer_id": z.string().nullable(), "transaction_id": z.string().nullable()})); +const payment_method_details_klarna = z.lazy(() => z.object({"location": z.string().optional(), "payer_details": klarna_payer_details.nullable(), "payment_method_category": z.string().nullable(), "preferred_locale": z.string().nullable(), "reader": z.string().optional()})); +const payment_method_details_konbini = z.lazy(() => z.object({"store": payment_method_details_konbini_store.nullable()})); +const payment_method_details_konbini_store = z.lazy(() => z.object({"chain": z.enum(["familymart", "lawson", "ministop", "seicomart"]).nullable()})); +const payment_method_details_kr_card = z.lazy(() => z.object({"brand": z.enum(["bc", "citi", "hana", "hyundai", "jeju", "jeonbuk", "kakaobank", "kbank", "kdbbank", "kookmin", "kwangju", "lotte", "mg", "nh", "post", "samsung", "savingsbank", "shinhan", "shinhyup", "suhyup", "tossbank", "woori"]).nullable(), "buyer_id": z.string().nullable(), "last4": z.string().nullable(), "transaction_id": z.string().nullable()})); +const payment_method_details_link = z.lazy(() => z.object({"country": z.string().nullable()})); const payment_method_details_mb_way = z.lazy(() => z.record(z.string(), z.any())); -const payment_method_details_mobilepay = z.lazy(() => z.object({"card": internal_card.nullable()}).passthrough()); -const payment_method_details_multibanco = z.lazy(() => z.object({"entity": z.string().nullable(), "reference": z.string().nullable()}).passthrough()); -const payment_method_details_naver_pay = z.lazy(() => z.object({"buyer_id": z.string().nullable(), "transaction_id": z.string().nullable()}).passthrough()); -const payment_method_details_nz_bank_account = z.lazy(() => z.object({"account_holder_name": z.string().nullable(), "bank_code": z.string(), "bank_name": z.string(), "branch_code": z.string(), "expected_debit_date": z.string().optional(), "last4": z.string(), "suffix": z.string().nullable()}).passthrough()); -const payment_method_details_oxxo = z.lazy(() => z.object({"number": z.string().nullable()}).passthrough()); -const payment_method_details_p24 = z.lazy(() => z.object({"bank": z.enum(["alior_bank", "bank_millennium", "bank_nowy_bfg_sa", "bank_pekao_sa", "banki_spbdzielcze", "blik", "bnp_paribas", "boz", "citi_handlowy", "credit_agricole", "envelobank", "etransfer_pocztowy24", "getin_bank", "ideabank", "ing", "inteligo", "mbank_mtransfer", "nest_przelew", "noble_pay", "pbac_z_ipko", "plus_bank", "santander_przelew24", "tmobile_usbugi_bankowe", "toyota_bank", "velobank", "volkswagen_bank"]).nullable(), "reference": z.string().nullable(), "verified_name": z.string().nullable()}).passthrough()); -const payment_method_details_passthrough_card = z.lazy(() => z.object({"brand": z.string().nullable(), "country": z.string().nullable(), "exp_month": z.number().int().nullable(), "exp_year": z.number().int().nullable(), "funding": z.string().nullable(), "last4": z.string().nullable()}).passthrough()); +const payment_method_details_mobilepay = z.lazy(() => z.object({"card": internal_card.nullable()})); +const payment_method_details_multibanco = z.lazy(() => z.object({"entity": z.string().nullable(), "reference": z.string().nullable()})); +const payment_method_details_naver_pay = z.lazy(() => z.object({"buyer_id": z.string().nullable(), "transaction_id": z.string().nullable()})); +const payment_method_details_nz_bank_account = z.lazy(() => z.object({"account_holder_name": z.string().nullable(), "bank_code": z.string(), "bank_name": z.string(), "branch_code": z.string(), "expected_debit_date": z.string().optional(), "last4": z.string(), "suffix": z.string().nullable()})); +const payment_method_details_oxxo = z.lazy(() => z.object({"number": z.string().nullable()})); +const payment_method_details_p24 = z.lazy(() => z.object({"bank": z.enum(["alior_bank", "bank_millennium", "bank_nowy_bfg_sa", "bank_pekao_sa", "banki_spbdzielcze", "blik", "bnp_paribas", "boz", "citi_handlowy", "credit_agricole", "envelobank", "etransfer_pocztowy24", "getin_bank", "ideabank", "ing", "inteligo", "mbank_mtransfer", "nest_przelew", "noble_pay", "pbac_z_ipko", "plus_bank", "santander_przelew24", "tmobile_usbugi_bankowe", "toyota_bank", "velobank", "volkswagen_bank"]).nullable(), "reference": z.string().nullable(), "verified_name": z.string().nullable()})); +const payment_method_details_passthrough_card = z.lazy(() => z.object({"brand": z.string().nullable(), "country": z.string().nullable(), "exp_month": z.number().int().nullable(), "exp_year": z.number().int().nullable(), "funding": z.string().nullable(), "last4": z.string().nullable()})); const payment_method_details_pay_by_bank = z.lazy(() => z.record(z.string(), z.any())); -const payment_method_details_payco = z.lazy(() => z.object({"buyer_id": z.string().nullable(), "transaction_id": z.string().nullable()}).passthrough()); -const payment_method_details_payment_record_acss_debit = z.lazy(() => z.object({"bank_name": z.string().nullable(), "expected_debit_date": z.string().optional(), "fingerprint": z.string().nullable(), "institution_number": z.string().nullable(), "last4": z.string().nullable(), "mandate": z.string().optional(), "transit_number": z.string().nullable()}).passthrough()); -const payment_method_details_payment_record_affirm = z.lazy(() => z.object({"location": z.string().optional(), "reader": z.string().optional(), "transaction_id": z.string().nullable()}).passthrough()); -const payment_method_details_payment_record_afterpay_clearpay = z.lazy(() => z.object({"order_id": z.string().nullable(), "reference": z.string().nullable()}).passthrough()); -const payment_method_details_payment_record_alma = z.lazy(() => z.object({"installments": payments_primitives_payment_records_resource_payment_method_alma_details_resource_installments.optional(), "transaction_id": z.string().nullable()}).passthrough()); -const payment_method_details_payment_record_amazon_pay = z.lazy(() => z.object({"funding": payments_primitives_payment_records_resource_payment_method_amazon_pay_details_resource_funding.optional(), "transaction_id": z.string().nullable()}).passthrough()); -const payment_method_details_payment_record_bancontact: z.ZodTypeAny = z.lazy(() => z.object({"bank_code": z.string().nullable(), "bank_name": z.string().nullable(), "bic": z.string().nullable(), "generated_sepa_debit": z.union([z.string(), payment_method]).nullable(), "generated_sepa_debit_mandate": z.union([z.string(), mandate]).nullable(), "iban_last4": z.string().nullable(), "preferred_language": z.enum(["de", "en", "fr", "nl"]).nullable(), "verified_name": z.string().nullable()}).passthrough()); -const payment_method_details_payment_record_billie = z.lazy(() => z.object({"transaction_id": z.string().nullable()}).passthrough()); -const payment_method_details_payment_record_bizum = z.lazy(() => z.object({"buyer_id": z.string().nullable(), "transaction_id": z.string().nullable()}).passthrough()); -const payment_method_details_payment_record_blik = z.lazy(() => z.object({"buyer_id": z.string().nullable()}).passthrough()); -const payment_method_details_payment_record_boleto = z.lazy(() => z.object({"tax_id": z.string().nullable()}).passthrough()); -const payment_method_details_payment_record_cashapp = z.lazy(() => z.object({"buyer_id": z.string().nullable(), "cashtag": z.string().nullable(), "transaction_id": z.string().nullable()}).passthrough()); -const payment_method_details_payment_record_eps = z.lazy(() => z.object({"bank": z.enum(["arzte_und_apotheker_bank", "austrian_anadi_bank_ag", "bank_austria", "bankhaus_carl_spangler", "bankhaus_schelhammer_und_schattera_ag", "bawag_psk_ag", "bks_bank_ag", "brull_kallmus_bank_ag", "btv_vier_lander_bank", "capital_bank_grawe_gruppe_ag", "deutsche_bank_ag", "dolomitenbank", "easybank_ag", "erste_bank_und_sparkassen", "hypo_alpeadriabank_international_ag", "hypo_bank_burgenland_aktiengesellschaft", "hypo_noe_lb_fur_niederosterreich_u_wien", "hypo_oberosterreich_salzburg_steiermark", "hypo_tirol_bank_ag", "hypo_vorarlberg_bank_ag", "marchfelder_bank", "oberbank_ag", "raiffeisen_bankengruppe_osterreich", "schoellerbank_ag", "sparda_bank_wien", "volksbank_gruppe", "volkskreditbank_ag", "vr_bank_braunau"]).nullable(), "verified_name": z.string().nullable()}).passthrough()); -const payment_method_details_payment_record_giropay = z.lazy(() => z.object({"bank_code": z.string().nullable(), "bank_name": z.string().nullable(), "bic": z.string().nullable(), "verified_name": z.string().nullable()}).passthrough()); -const payment_method_details_payment_record_ideal: z.ZodTypeAny = z.lazy(() => z.object({"bank": z.enum(["abn_amro", "adyen", "asn_bank", "bunq", "buut", "finom", "handelsbanken", "ing", "knab", "mollie", "moneyou", "n26", "nn", "rabobank", "regiobank", "revolut", "sns_bank", "triodos_bank", "van_lanschot", "yoursafe"]).nullable(), "bic": z.enum(["ABNANL2A", "ADYBNL2A", "ASNBNL21", "BITSNL2A", "BUNQNL2A", "BUUTNL2A", "FNOMNL22", "FVLBNL22", "HANDNL2A", "INGBNL2A", "KNABNL2H", "MLLENL2A", "MOYONL21", "NNBANL2G", "NTSBDEB1", "RABONL2U", "RBRBNL21", "REVOIE23", "REVOLT21", "SNSBNL2A", "TRIONL2U"]).nullable(), "generated_sepa_debit": z.union([z.string(), payment_method]).nullable(), "generated_sepa_debit_mandate": z.union([z.string(), mandate]).nullable(), "iban_last4": z.string().nullable(), "transaction_id": z.string().nullable(), "verified_name": z.string().nullable()}).passthrough()); -const payment_method_details_payment_record_kakao_pay = z.lazy(() => z.object({"buyer_id": z.string().nullable(), "transaction_id": z.string().nullable()}).passthrough()); -const payment_method_details_payment_record_klarna = z.lazy(() => z.object({"location": z.string().optional(), "payer_details": payments_primitives_payment_records_resource_payment_method_klarna_details_resource_payer_details.nullable(), "payment_method_category": z.string().nullable(), "preferred_locale": z.string().nullable(), "reader": z.string().optional()}).passthrough()); -const payment_method_details_payment_record_konbini = z.lazy(() => z.object({"store": payments_primitives_payment_records_resource_payment_method_konbini_details_resource_store.nullable()}).passthrough()); -const payment_method_details_payment_record_link = z.lazy(() => z.object({"country": z.string().nullable()}).passthrough()); +const payment_method_details_payco = z.lazy(() => z.object({"buyer_id": z.string().nullable(), "transaction_id": z.string().nullable()})); +const payment_method_details_payment_record_acss_debit = z.lazy(() => z.object({"bank_name": z.string().nullable(), "expected_debit_date": z.string().optional(), "fingerprint": z.string().nullable(), "institution_number": z.string().nullable(), "last4": z.string().nullable(), "mandate": z.string().optional(), "transit_number": z.string().nullable()})); +const payment_method_details_payment_record_affirm = z.lazy(() => z.object({"location": z.string().optional(), "reader": z.string().optional(), "transaction_id": z.string().nullable()})); +const payment_method_details_payment_record_afterpay_clearpay = z.lazy(() => z.object({"order_id": z.string().nullable(), "reference": z.string().nullable()})); +const payment_method_details_payment_record_alma = z.lazy(() => z.object({"installments": payments_primitives_payment_records_resource_payment_method_alma_details_resource_installments.optional(), "transaction_id": z.string().nullable()})); +const payment_method_details_payment_record_amazon_pay = z.lazy(() => z.object({"funding": payments_primitives_payment_records_resource_payment_method_amazon_pay_details_resource_funding.optional(), "transaction_id": z.string().nullable()})); +const payment_method_details_payment_record_bancontact: z.ZodTypeAny = z.lazy(() => z.object({"bank_code": z.string().nullable(), "bank_name": z.string().nullable(), "bic": z.string().nullable(), "generated_sepa_debit": z.union([z.string(), payment_method]).nullable(), "generated_sepa_debit_mandate": z.union([z.string(), mandate]).nullable(), "iban_last4": z.string().nullable(), "preferred_language": z.enum(["de", "en", "fr", "nl"]).nullable(), "verified_name": z.string().nullable()})); +const payment_method_details_payment_record_billie = z.lazy(() => z.object({"transaction_id": z.string().nullable()})); +const payment_method_details_payment_record_bizum = z.lazy(() => z.object({"buyer_id": z.string().nullable(), "transaction_id": z.string().nullable()})); +const payment_method_details_payment_record_blik = z.lazy(() => z.object({"buyer_id": z.string().nullable()})); +const payment_method_details_payment_record_boleto = z.lazy(() => z.object({"tax_id": z.string().nullable()})); +const payment_method_details_payment_record_cashapp = z.lazy(() => z.object({"buyer_id": z.string().nullable(), "cashtag": z.string().nullable(), "transaction_id": z.string().nullable()})); +const payment_method_details_payment_record_eps = z.lazy(() => z.object({"bank": z.enum(["arzte_und_apotheker_bank", "austrian_anadi_bank_ag", "bank_austria", "bankhaus_carl_spangler", "bankhaus_schelhammer_und_schattera_ag", "bawag_psk_ag", "bks_bank_ag", "brull_kallmus_bank_ag", "btv_vier_lander_bank", "capital_bank_grawe_gruppe_ag", "deutsche_bank_ag", "dolomitenbank", "easybank_ag", "erste_bank_und_sparkassen", "hypo_alpeadriabank_international_ag", "hypo_bank_burgenland_aktiengesellschaft", "hypo_noe_lb_fur_niederosterreich_u_wien", "hypo_oberosterreich_salzburg_steiermark", "hypo_tirol_bank_ag", "hypo_vorarlberg_bank_ag", "marchfelder_bank", "oberbank_ag", "raiffeisen_bankengruppe_osterreich", "schoellerbank_ag", "sparda_bank_wien", "volksbank_gruppe", "volkskreditbank_ag", "vr_bank_braunau"]).nullable(), "verified_name": z.string().nullable()})); +const payment_method_details_payment_record_giropay = z.lazy(() => z.object({"bank_code": z.string().nullable(), "bank_name": z.string().nullable(), "bic": z.string().nullable(), "verified_name": z.string().nullable()})); +const payment_method_details_payment_record_ideal: z.ZodTypeAny = z.lazy(() => z.object({"bank": z.enum(["abn_amro", "adyen", "asn_bank", "bunq", "buut", "finom", "handelsbanken", "ing", "knab", "mollie", "moneyou", "n26", "nn", "rabobank", "regiobank", "revolut", "sns_bank", "triodos_bank", "van_lanschot", "yoursafe"]).nullable(), "bic": z.enum(["ABNANL2A", "ADYBNL2A", "ASNBNL21", "BITSNL2A", "BUNQNL2A", "BUUTNL2A", "FNOMNL22", "FVLBNL22", "HANDNL2A", "INGBNL2A", "KNABNL2H", "MLLENL2A", "MOYONL21", "NNBANL2G", "NTSBDEB1", "RABONL2U", "RBRBNL21", "REVOIE23", "REVOLT21", "SNSBNL2A", "TRIONL2U"]).nullable(), "generated_sepa_debit": z.union([z.string(), payment_method]).nullable(), "generated_sepa_debit_mandate": z.union([z.string(), mandate]).nullable(), "iban_last4": z.string().nullable(), "transaction_id": z.string().nullable(), "verified_name": z.string().nullable()})); +const payment_method_details_payment_record_kakao_pay = z.lazy(() => z.object({"buyer_id": z.string().nullable(), "transaction_id": z.string().nullable()})); +const payment_method_details_payment_record_klarna = z.lazy(() => z.object({"location": z.string().optional(), "payer_details": payments_primitives_payment_records_resource_payment_method_klarna_details_resource_payer_details.nullable(), "payment_method_category": z.string().nullable(), "preferred_locale": z.string().nullable(), "reader": z.string().optional()})); +const payment_method_details_payment_record_konbini = z.lazy(() => z.object({"store": payments_primitives_payment_records_resource_payment_method_konbini_details_resource_store.nullable()})); +const payment_method_details_payment_record_link = z.lazy(() => z.object({"country": z.string().nullable()})); const payment_method_details_payment_record_mb_way = z.lazy(() => z.record(z.string(), z.any())); -const payment_method_details_payment_record_mobilepay = z.lazy(() => z.object({"card": payments_primitives_payment_records_resource_payment_method_mobilepay_details_resource_card.nullable()}).passthrough()); -const payment_method_details_payment_record_multibanco = z.lazy(() => z.object({"entity": z.string().nullable(), "reference": z.string().nullable()}).passthrough()); -const payment_method_details_payment_record_naver_pay = z.lazy(() => z.object({"buyer_id": z.string().nullable(), "transaction_id": z.string().nullable()}).passthrough()); -const payment_method_details_payment_record_oxxo = z.lazy(() => z.object({"number": z.string().nullable()}).passthrough()); -const payment_method_details_payment_record_p24 = z.lazy(() => z.object({"bank": z.enum(["alior_bank", "bank_millennium", "bank_nowy_bfg_sa", "bank_pekao_sa", "banki_spbdzielcze", "blik", "bnp_paribas", "boz", "citi_handlowy", "credit_agricole", "envelobank", "etransfer_pocztowy24", "getin_bank", "ideabank", "ing", "inteligo", "mbank_mtransfer", "nest_przelew", "noble_pay", "pbac_z_ipko", "plus_bank", "santander_przelew24", "tmobile_usbugi_bankowe", "toyota_bank", "velobank", "volkswagen_bank"]).nullable(), "reference": z.string().nullable(), "verified_name": z.string().nullable()}).passthrough()); +const payment_method_details_payment_record_mobilepay = z.lazy(() => z.object({"card": payments_primitives_payment_records_resource_payment_method_mobilepay_details_resource_card.nullable()})); +const payment_method_details_payment_record_multibanco = z.lazy(() => z.object({"entity": z.string().nullable(), "reference": z.string().nullable()})); +const payment_method_details_payment_record_naver_pay = z.lazy(() => z.object({"buyer_id": z.string().nullable(), "transaction_id": z.string().nullable()})); +const payment_method_details_payment_record_oxxo = z.lazy(() => z.object({"number": z.string().nullable()})); +const payment_method_details_payment_record_p24 = z.lazy(() => z.object({"bank": z.enum(["alior_bank", "bank_millennium", "bank_nowy_bfg_sa", "bank_pekao_sa", "banki_spbdzielcze", "blik", "bnp_paribas", "boz", "citi_handlowy", "credit_agricole", "envelobank", "etransfer_pocztowy24", "getin_bank", "ideabank", "ing", "inteligo", "mbank_mtransfer", "nest_przelew", "noble_pay", "pbac_z_ipko", "plus_bank", "santander_przelew24", "tmobile_usbugi_bankowe", "toyota_bank", "velobank", "volkswagen_bank"]).nullable(), "reference": z.string().nullable(), "verified_name": z.string().nullable()})); const payment_method_details_payment_record_pay_by_bank = z.lazy(() => z.record(z.string(), z.any())); -const payment_method_details_payment_record_payco = z.lazy(() => z.object({"buyer_id": z.string().nullable(), "transaction_id": z.string().nullable()}).passthrough()); -const payment_method_details_payment_record_paynow = z.lazy(() => z.object({"location": z.string().optional(), "reader": z.string().optional(), "reference": z.string().nullable()}).passthrough()); -const payment_method_details_payment_record_payto = z.lazy(() => z.object({"bsb_number": z.string().nullable(), "last4": z.string().nullable(), "mandate": z.string().optional(), "pay_id": z.string().nullable()}).passthrough()); -const payment_method_details_payment_record_pix = z.lazy(() => z.object({"bank_transaction_id": z.string().nullable().optional(), "mandate": z.string().optional()}).passthrough()); -const payment_method_details_payment_record_promptpay = z.lazy(() => z.object({"reference": z.string().nullable()}).passthrough()); -const payment_method_details_payment_record_revolut_pay = z.lazy(() => z.object({"funding": payments_primitives_payment_records_resource_payment_method_revolut_pay_details_resource_funding.optional(), "transaction_id": z.string().nullable()}).passthrough()); -const payment_method_details_payment_record_samsung_pay = z.lazy(() => z.object({"buyer_id": z.string().nullable(), "transaction_id": z.string().nullable()}).passthrough()); -const payment_method_details_payment_record_satispay = z.lazy(() => z.object({"transaction_id": z.string().nullable()}).passthrough()); -const payment_method_details_payment_record_scalapay = z.lazy(() => z.object({"transaction_id": z.string().nullable()}).passthrough()); -const payment_method_details_payment_record_sepa_debit = z.lazy(() => z.object({"bank_code": z.string().nullable(), "branch_code": z.string().nullable(), "country": z.string().nullable(), "expected_debit_date": z.string().optional(), "fingerprint": z.string().nullable(), "last4": z.string().nullable(), "mandate": z.string().nullable()}).passthrough()); -const payment_method_details_payment_record_sofort: z.ZodTypeAny = z.lazy(() => z.object({"bank_code": z.string().nullable(), "bank_name": z.string().nullable(), "bic": z.string().nullable(), "country": z.string().nullable(), "generated_sepa_debit": z.union([z.string(), payment_method]).nullable(), "generated_sepa_debit_mandate": z.union([z.string(), mandate]).nullable(), "iban_last4": z.string().nullable(), "preferred_language": z.enum(["de", "en", "es", "fr", "it", "nl", "pl"]).nullable(), "verified_name": z.string().nullable()}).passthrough()); -const payment_method_details_payment_record_sunbit = z.lazy(() => z.object({"transaction_id": z.string().nullable()}).passthrough()); -const payment_method_details_payment_record_swish = z.lazy(() => z.object({"fingerprint": z.string().nullable(), "payment_reference": z.string().nullable(), "verified_phone_last4": z.string().nullable()}).passthrough()); -const payment_method_details_payment_record_twint = z.lazy(() => z.object({"mandate": z.string().optional()}).passthrough()); -const payment_method_details_payment_record_upi = z.lazy(() => z.object({"vpa": z.string().nullable()}).passthrough()); -const payment_method_details_payment_record_us_bank_account: z.ZodTypeAny = z.lazy(() => z.object({"account_holder_type": z.enum(["company", "individual"]).nullable(), "account_type": z.enum(["checking", "savings"]).nullable(), "bank_name": z.string().nullable(), "expected_debit_date": z.string().optional(), "fingerprint": z.string().nullable(), "last4": z.string().nullable(), "mandate": z.union([z.string(), mandate]).optional(), "payment_reference": z.string().nullable(), "routing_number": z.string().nullable()}).passthrough()); -const payment_method_details_payment_record_wechat_pay = z.lazy(() => z.object({"fingerprint": z.string().nullable(), "location": z.string().optional(), "reader": z.string().optional(), "transaction_id": z.string().nullable()}).passthrough()); +const payment_method_details_payment_record_payco = z.lazy(() => z.object({"buyer_id": z.string().nullable(), "transaction_id": z.string().nullable()})); +const payment_method_details_payment_record_paynow = z.lazy(() => z.object({"location": z.string().optional(), "reader": z.string().optional(), "reference": z.string().nullable()})); +const payment_method_details_payment_record_payto = z.lazy(() => z.object({"bsb_number": z.string().nullable(), "last4": z.string().nullable(), "mandate": z.string().optional(), "pay_id": z.string().nullable()})); +const payment_method_details_payment_record_pix = z.lazy(() => z.object({"bank_transaction_id": z.string().nullable().optional(), "mandate": z.string().optional()})); +const payment_method_details_payment_record_promptpay = z.lazy(() => z.object({"reference": z.string().nullable()})); +const payment_method_details_payment_record_revolut_pay = z.lazy(() => z.object({"funding": payments_primitives_payment_records_resource_payment_method_revolut_pay_details_resource_funding.optional(), "transaction_id": z.string().nullable()})); +const payment_method_details_payment_record_samsung_pay = z.lazy(() => z.object({"buyer_id": z.string().nullable(), "transaction_id": z.string().nullable()})); +const payment_method_details_payment_record_satispay = z.lazy(() => z.object({"transaction_id": z.string().nullable()})); +const payment_method_details_payment_record_scalapay = z.lazy(() => z.object({"transaction_id": z.string().nullable()})); +const payment_method_details_payment_record_sepa_debit = z.lazy(() => z.object({"bank_code": z.string().nullable(), "branch_code": z.string().nullable(), "country": z.string().nullable(), "expected_debit_date": z.string().optional(), "fingerprint": z.string().nullable(), "last4": z.string().nullable(), "mandate": z.string().nullable()})); +const payment_method_details_payment_record_sofort: z.ZodTypeAny = z.lazy(() => z.object({"bank_code": z.string().nullable(), "bank_name": z.string().nullable(), "bic": z.string().nullable(), "country": z.string().nullable(), "generated_sepa_debit": z.union([z.string(), payment_method]).nullable(), "generated_sepa_debit_mandate": z.union([z.string(), mandate]).nullable(), "iban_last4": z.string().nullable(), "preferred_language": z.enum(["de", "en", "es", "fr", "it", "nl", "pl"]).nullable(), "verified_name": z.string().nullable()})); +const payment_method_details_payment_record_sunbit = z.lazy(() => z.object({"transaction_id": z.string().nullable()})); +const payment_method_details_payment_record_swish = z.lazy(() => z.object({"fingerprint": z.string().nullable(), "payment_reference": z.string().nullable(), "verified_phone_last4": z.string().nullable()})); +const payment_method_details_payment_record_twint = z.lazy(() => z.object({"mandate": z.string().optional()})); +const payment_method_details_payment_record_upi = z.lazy(() => z.object({"vpa": z.string().nullable()})); +const payment_method_details_payment_record_us_bank_account: z.ZodTypeAny = z.lazy(() => z.object({"account_holder_type": z.enum(["company", "individual"]).nullable(), "account_type": z.enum(["checking", "savings"]).nullable(), "bank_name": z.string().nullable(), "expected_debit_date": z.string().optional(), "fingerprint": z.string().nullable(), "last4": z.string().nullable(), "mandate": z.union([z.string(), mandate]).optional(), "payment_reference": z.string().nullable(), "routing_number": z.string().nullable()})); +const payment_method_details_payment_record_wechat_pay = z.lazy(() => z.object({"fingerprint": z.string().nullable(), "location": z.string().optional(), "reader": z.string().optional(), "transaction_id": z.string().nullable()})); const payment_method_details_payment_record_zip = z.lazy(() => z.record(z.string(), z.any())); -const payment_method_details_paynow = z.lazy(() => z.object({"location": z.string().optional(), "reader": z.string().optional(), "reference": z.string().nullable()}).passthrough()); -const payment_method_details_paypal = z.lazy(() => z.object({"country": z.string().nullable(), "payer_email": z.string().nullable(), "payer_id": z.string().nullable(), "payer_name": z.string().nullable(), "seller_protection": paypal_seller_protection.nullable(), "transaction_id": z.string().nullable()}).passthrough()); -const payment_method_details_payto = z.lazy(() => z.object({"bsb_number": z.string().nullable(), "last4": z.string().nullable(), "mandate": z.string().optional(), "pay_id": z.string().nullable()}).passthrough()); -const payment_method_details_pix = z.lazy(() => z.object({"bank_transaction_id": z.string().nullable().optional(), "fingerprint": z.string().nullable().optional(), "mandate": z.string().optional()}).passthrough()); -const payment_method_details_promptpay = z.lazy(() => z.object({"reference": z.string().nullable()}).passthrough()); -const payment_method_details_revolut_pay = z.lazy(() => z.object({"funding": revolut_pay_underlying_payment_method_funding_details.optional(), "transaction_id": z.string().nullable()}).passthrough()); -const payment_method_details_samsung_pay = z.lazy(() => z.object({"buyer_id": z.string().nullable(), "transaction_id": z.string().nullable()}).passthrough()); -const payment_method_details_satispay = z.lazy(() => z.object({"transaction_id": z.string().nullable()}).passthrough()); -const payment_method_details_scalapay = z.lazy(() => z.object({"transaction_id": z.string().nullable()}).passthrough()); -const payment_method_details_sepa_credit_transfer = z.lazy(() => z.object({"bank_name": z.string().nullable(), "bic": z.string().nullable(), "iban": z.string().nullable()}).passthrough()); -const payment_method_details_sepa_debit = z.lazy(() => z.object({"bank_code": z.string().nullable(), "branch_code": z.string().nullable(), "country": z.string().nullable(), "expected_debit_date": z.string().optional(), "fingerprint": z.string().nullable(), "last4": z.string().nullable(), "mandate": z.string().nullable()}).passthrough()); -const payment_method_details_sofort: z.ZodTypeAny = z.lazy(() => z.object({"bank_code": z.string().nullable(), "bank_name": z.string().nullable(), "bic": z.string().nullable(), "country": z.string().nullable(), "generated_sepa_debit": z.union([z.string(), payment_method]).nullable(), "generated_sepa_debit_mandate": z.union([z.string(), mandate]).nullable(), "iban_last4": z.string().nullable(), "preferred_language": z.enum(["de", "en", "es", "fr", "it", "nl", "pl"]).nullable(), "verified_name": z.string().nullable()}).passthrough()); +const payment_method_details_paynow = z.lazy(() => z.object({"location": z.string().optional(), "reader": z.string().optional(), "reference": z.string().nullable()})); +const payment_method_details_paypal = z.lazy(() => z.object({"country": z.string().nullable(), "payer_email": z.string().nullable(), "payer_id": z.string().nullable(), "payer_name": z.string().nullable(), "seller_protection": paypal_seller_protection.nullable(), "transaction_id": z.string().nullable()})); +const payment_method_details_payto = z.lazy(() => z.object({"bsb_number": z.string().nullable(), "last4": z.string().nullable(), "mandate": z.string().optional(), "pay_id": z.string().nullable()})); +const payment_method_details_pix = z.lazy(() => z.object({"bank_transaction_id": z.string().nullable().optional(), "fingerprint": z.string().nullable().optional(), "mandate": z.string().optional()})); +const payment_method_details_promptpay = z.lazy(() => z.object({"reference": z.string().nullable()})); +const payment_method_details_revolut_pay = z.lazy(() => z.object({"funding": revolut_pay_underlying_payment_method_funding_details.optional(), "transaction_id": z.string().nullable()})); +const payment_method_details_samsung_pay = z.lazy(() => z.object({"buyer_id": z.string().nullable(), "transaction_id": z.string().nullable()})); +const payment_method_details_satispay = z.lazy(() => z.object({"transaction_id": z.string().nullable()})); +const payment_method_details_scalapay = z.lazy(() => z.object({"transaction_id": z.string().nullable()})); +const payment_method_details_sepa_credit_transfer = z.lazy(() => z.object({"bank_name": z.string().nullable(), "bic": z.string().nullable(), "iban": z.string().nullable()})); +const payment_method_details_sepa_debit = z.lazy(() => z.object({"bank_code": z.string().nullable(), "branch_code": z.string().nullable(), "country": z.string().nullable(), "expected_debit_date": z.string().optional(), "fingerprint": z.string().nullable(), "last4": z.string().nullable(), "mandate": z.string().nullable()})); +const payment_method_details_sofort: z.ZodTypeAny = z.lazy(() => z.object({"bank_code": z.string().nullable(), "bank_name": z.string().nullable(), "bic": z.string().nullable(), "country": z.string().nullable(), "generated_sepa_debit": z.union([z.string(), payment_method]).nullable(), "generated_sepa_debit_mandate": z.union([z.string(), mandate]).nullable(), "iban_last4": z.string().nullable(), "preferred_language": z.enum(["de", "en", "es", "fr", "it", "nl", "pl"]).nullable(), "verified_name": z.string().nullable()})); const payment_method_details_stripe_account = z.lazy(() => z.record(z.string(), z.any())); -const payment_method_details_sunbit = z.lazy(() => z.object({"transaction_id": z.string().nullable()}).passthrough()); -const payment_method_details_swish = z.lazy(() => z.object({"fingerprint": z.string().nullable(), "payment_reference": z.string().nullable(), "verified_phone_last4": z.string().nullable()}).passthrough()); -const payment_method_details_twint = z.lazy(() => z.object({"mandate": z.string().optional()}).passthrough()); -const payment_method_details_upi = z.lazy(() => z.object({"vpa": z.string().nullable()}).passthrough()); -const payment_method_details_us_bank_account: z.ZodTypeAny = z.lazy(() => z.object({"account_holder_type": z.enum(["company", "individual"]).nullable(), "account_type": z.enum(["checking", "savings"]).nullable(), "bank_name": z.string().nullable(), "expected_debit_date": z.string().optional(), "fingerprint": z.string().nullable(), "last4": z.string().nullable(), "mandate": z.union([z.string(), mandate]).optional(), "payment_reference": z.string().nullable(), "routing_number": z.string().nullable()}).passthrough()); +const payment_method_details_sunbit = z.lazy(() => z.object({"transaction_id": z.string().nullable()})); +const payment_method_details_swish = z.lazy(() => z.object({"fingerprint": z.string().nullable(), "payment_reference": z.string().nullable(), "verified_phone_last4": z.string().nullable()})); +const payment_method_details_twint = z.lazy(() => z.object({"mandate": z.string().optional()})); +const payment_method_details_upi = z.lazy(() => z.object({"vpa": z.string().nullable()})); +const payment_method_details_us_bank_account: z.ZodTypeAny = z.lazy(() => z.object({"account_holder_type": z.enum(["company", "individual"]).nullable(), "account_type": z.enum(["checking", "savings"]).nullable(), "bank_name": z.string().nullable(), "expected_debit_date": z.string().optional(), "fingerprint": z.string().nullable(), "last4": z.string().nullable(), "mandate": z.union([z.string(), mandate]).optional(), "payment_reference": z.string().nullable(), "routing_number": z.string().nullable()})); const payment_method_details_wechat = z.lazy(() => z.record(z.string(), z.any())); -const payment_method_details_wechat_pay = z.lazy(() => z.object({"fingerprint": z.string().nullable(), "location": z.string().optional(), "reader": z.string().optional(), "transaction_id": z.string().nullable()}).passthrough()); +const payment_method_details_wechat_pay = z.lazy(() => z.object({"fingerprint": z.string().nullable(), "location": z.string().optional(), "reader": z.string().optional(), "transaction_id": z.string().nullable()})); const payment_method_details_zip = z.lazy(() => z.record(z.string(), z.any())); -const payment_method_eps = z.lazy(() => z.object({"bank": z.enum(["arzte_und_apotheker_bank", "austrian_anadi_bank_ag", "bank_austria", "bankhaus_carl_spangler", "bankhaus_schelhammer_und_schattera_ag", "bawag_psk_ag", "bks_bank_ag", "brull_kallmus_bank_ag", "btv_vier_lander_bank", "capital_bank_grawe_gruppe_ag", "deutsche_bank_ag", "dolomitenbank", "easybank_ag", "erste_bank_und_sparkassen", "hypo_alpeadriabank_international_ag", "hypo_bank_burgenland_aktiengesellschaft", "hypo_noe_lb_fur_niederosterreich_u_wien", "hypo_oberosterreich_salzburg_steiermark", "hypo_tirol_bank_ag", "hypo_vorarlberg_bank_ag", "marchfelder_bank", "oberbank_ag", "raiffeisen_bankengruppe_osterreich", "schoellerbank_ag", "sparda_bank_wien", "volksbank_gruppe", "volkskreditbank_ag", "vr_bank_braunau"]).nullable()}).passthrough()); -const payment_method_fpx = z.lazy(() => z.object({"account_holder_type": z.enum(["company", "individual"]).nullable(), "bank": z.enum(["affin_bank", "agrobank", "alliance_bank", "ambank", "bank_islam", "bank_muamalat", "bank_of_china", "bank_rakyat", "bsn", "cimb", "deutsche_bank", "hong_leong_bank", "hsbc", "kfh", "maybank2e", "maybank2u", "ocbc", "pb_enterprise", "public_bank", "rhb", "standard_chartered", "uob"])}).passthrough()); +const payment_method_eps = z.lazy(() => z.object({"bank": z.enum(["arzte_und_apotheker_bank", "austrian_anadi_bank_ag", "bank_austria", "bankhaus_carl_spangler", "bankhaus_schelhammer_und_schattera_ag", "bawag_psk_ag", "bks_bank_ag", "brull_kallmus_bank_ag", "btv_vier_lander_bank", "capital_bank_grawe_gruppe_ag", "deutsche_bank_ag", "dolomitenbank", "easybank_ag", "erste_bank_und_sparkassen", "hypo_alpeadriabank_international_ag", "hypo_bank_burgenland_aktiengesellschaft", "hypo_noe_lb_fur_niederosterreich_u_wien", "hypo_oberosterreich_salzburg_steiermark", "hypo_tirol_bank_ag", "hypo_vorarlberg_bank_ag", "marchfelder_bank", "oberbank_ag", "raiffeisen_bankengruppe_osterreich", "schoellerbank_ag", "sparda_bank_wien", "volksbank_gruppe", "volkskreditbank_ag", "vr_bank_braunau"]).nullable()})); +const payment_method_fpx = z.lazy(() => z.object({"account_holder_type": z.enum(["company", "individual"]).nullable(), "bank": z.enum(["affin_bank", "agrobank", "alliance_bank", "ambank", "bank_islam", "bank_muamalat", "bank_of_china", "bank_rakyat", "bsn", "cimb", "deutsche_bank", "hong_leong_bank", "hsbc", "kfh", "maybank2e", "maybank2u", "ocbc", "pb_enterprise", "public_bank", "rhb", "standard_chartered", "uob"])})); const payment_method_giropay = z.lazy(() => z.record(z.string(), z.any())); const payment_method_grabpay = z.lazy(() => z.record(z.string(), z.any())); -const payment_method_ideal = z.lazy(() => z.object({"bank": z.enum(["abn_amro", "adyen", "asn_bank", "bunq", "buut", "finom", "handelsbanken", "ing", "knab", "mollie", "moneyou", "n26", "nn", "rabobank", "regiobank", "revolut", "sns_bank", "triodos_bank", "van_lanschot", "yoursafe"]).nullable(), "bic": z.enum(["ABNANL2A", "ADYBNL2A", "ASNBNL21", "BITSNL2A", "BUNQNL2A", "BUUTNL2A", "FNOMNL22", "FVLBNL22", "HANDNL2A", "INGBNL2A", "KNABNL2H", "MLLENL2A", "MOYONL21", "NNBANL2G", "NTSBDEB1", "RABONL2U", "RBRBNL21", "REVOIE23", "REVOLT21", "SNSBNL2A", "TRIONL2U"]).nullable()}).passthrough()); -const payment_method_interac_present = z.lazy(() => z.object({"brand": z.string().nullable(), "cardholder_name": z.string().nullable(), "country": z.string().nullable(), "description": z.string().nullable().optional(), "exp_month": z.number().int(), "exp_year": z.number().int(), "fingerprint": z.string().nullable(), "funding": z.string().nullable(), "iin": z.string().nullable().optional(), "issuer": z.string().nullable().optional(), "last4": z.string().nullable(), "networks": payment_method_card_present_networks.nullable(), "preferred_locales": z.array(z.string()).nullable(), "read_method": z.enum(["contact_emv", "contactless_emv", "contactless_magstripe_mode", "magnetic_stripe_fallback", "magnetic_stripe_track2"]).nullable()}).passthrough()); +const payment_method_ideal = z.lazy(() => z.object({"bank": z.enum(["abn_amro", "adyen", "asn_bank", "bunq", "buut", "finom", "handelsbanken", "ing", "knab", "mollie", "moneyou", "n26", "nn", "rabobank", "regiobank", "revolut", "sns_bank", "triodos_bank", "van_lanschot", "yoursafe"]).nullable(), "bic": z.enum(["ABNANL2A", "ADYBNL2A", "ASNBNL21", "BITSNL2A", "BUNQNL2A", "BUUTNL2A", "FNOMNL22", "FVLBNL22", "HANDNL2A", "INGBNL2A", "KNABNL2H", "MLLENL2A", "MOYONL21", "NNBANL2G", "NTSBDEB1", "RABONL2U", "RBRBNL21", "REVOIE23", "REVOLT21", "SNSBNL2A", "TRIONL2U"]).nullable()})); +const payment_method_interac_present = z.lazy(() => z.object({"brand": z.string().nullable(), "cardholder_name": z.string().nullable(), "country": z.string().nullable(), "description": z.string().nullable().optional(), "exp_month": z.number().int(), "exp_year": z.number().int(), "fingerprint": z.string().nullable(), "funding": z.string().nullable(), "iin": z.string().nullable().optional(), "issuer": z.string().nullable().optional(), "last4": z.string().nullable(), "networks": payment_method_card_present_networks.nullable(), "preferred_locales": z.array(z.string()).nullable(), "read_method": z.enum(["contact_emv", "contactless_emv", "contactless_magstripe_mode", "magnetic_stripe_fallback", "magnetic_stripe_track2"]).nullable()})); const payment_method_kakao_pay = z.lazy(() => z.record(z.string(), z.any())); -const payment_method_klarna = z.lazy(() => z.object({"dob": payment_flows_private_payment_methods_klarna_dob.nullable().optional()}).passthrough()); +const payment_method_klarna = z.lazy(() => z.object({"dob": payment_flows_private_payment_methods_klarna_dob.nullable().optional()})); const payment_method_konbini = z.lazy(() => z.record(z.string(), z.any())); -const payment_method_kr_card = z.lazy(() => z.object({"brand": z.enum(["bc", "citi", "hana", "hyundai", "jeju", "jeonbuk", "kakaobank", "kbank", "kdbbank", "kookmin", "kwangju", "lotte", "mg", "nh", "post", "samsung", "savingsbank", "shinhan", "shinhyup", "suhyup", "tossbank", "woori"]).nullable(), "last4": z.string().nullable()}).passthrough()); -const payment_method_link = z.lazy(() => z.object({"email": z.string().nullable(), "persistent_token": z.string().optional()}).passthrough()); +const payment_method_kr_card = z.lazy(() => z.object({"brand": z.enum(["bc", "citi", "hana", "hyundai", "jeju", "jeonbuk", "kakaobank", "kbank", "kdbbank", "kookmin", "kwangju", "lotte", "mg", "nh", "post", "samsung", "savingsbank", "shinhan", "shinhyup", "suhyup", "tossbank", "woori"]).nullable(), "last4": z.string().nullable()})); +const payment_method_link = z.lazy(() => z.object({"email": z.string().nullable(), "persistent_token": z.string().optional()})); const payment_method_mb_way = z.lazy(() => z.record(z.string(), z.any())); const payment_method_mobilepay = z.lazy(() => z.record(z.string(), z.any())); const payment_method_multibanco = z.lazy(() => z.record(z.string(), z.any())); -const payment_method_naver_pay = z.lazy(() => z.object({"buyer_id": z.string().nullable(), "funding": z.enum(["card", "points"])}).passthrough()); -const payment_method_nz_bank_account = z.lazy(() => z.object({"account_holder_name": z.string().nullable(), "bank_code": z.string(), "bank_name": z.string(), "branch_code": z.string(), "last4": z.string(), "suffix": z.string().nullable()}).passthrough()); -const payment_method_options_affirm = z.lazy(() => z.object({"capture_method": z.literal("manual").optional(), "preferred_locale": z.string().optional(), "setup_future_usage": z.literal("none").optional()}).passthrough()); -const payment_method_options_afterpay_clearpay = z.lazy(() => z.object({"capture_method": z.literal("manual").optional(), "reference": z.string().nullable(), "setup_future_usage": z.literal("none").optional()}).passthrough()); -const payment_method_options_alipay = z.lazy(() => z.object({"setup_future_usage": z.enum(["none", "off_session"]).optional()}).passthrough()); -const payment_method_options_alma = z.lazy(() => z.object({"capture_method": z.literal("manual").optional()}).passthrough()); -const payment_method_options_amazon_pay = z.lazy(() => z.object({"capture_method": z.literal("manual").optional(), "setup_future_usage": z.enum(["none", "off_session"]).optional()}).passthrough()); -const payment_method_options_bancontact = z.lazy(() => z.object({"preferred_language": z.enum(["de", "en", "fr", "nl"]), "setup_future_usage": z.enum(["none", "off_session"]).optional()}).passthrough()); -const payment_method_options_billie = z.lazy(() => z.object({"capture_method": z.literal("manual").optional()}).passthrough()); +const payment_method_naver_pay = z.lazy(() => z.object({"buyer_id": z.string().nullable(), "funding": z.enum(["card", "points"])})); +const payment_method_nz_bank_account = z.lazy(() => z.object({"account_holder_name": z.string().nullable(), "bank_code": z.string(), "bank_name": z.string(), "branch_code": z.string(), "last4": z.string(), "suffix": z.string().nullable()})); +const payment_method_options_affirm = z.lazy(() => z.object({"capture_method": z.literal("manual").optional(), "preferred_locale": z.string().optional(), "setup_future_usage": z.literal("none").optional()})); +const payment_method_options_afterpay_clearpay = z.lazy(() => z.object({"capture_method": z.literal("manual").optional(), "reference": z.string().nullable(), "setup_future_usage": z.literal("none").optional()})); +const payment_method_options_alipay = z.lazy(() => z.object({"setup_future_usage": z.enum(["none", "off_session"]).optional()})); +const payment_method_options_alma = z.lazy(() => z.object({"capture_method": z.literal("manual").optional()})); +const payment_method_options_amazon_pay = z.lazy(() => z.object({"capture_method": z.literal("manual").optional(), "setup_future_usage": z.enum(["none", "off_session"]).optional()})); +const payment_method_options_bancontact = z.lazy(() => z.object({"preferred_language": z.enum(["de", "en", "fr", "nl"]), "setup_future_usage": z.enum(["none", "off_session"]).optional()})); +const payment_method_options_billie = z.lazy(() => z.object({"capture_method": z.literal("manual").optional()})); const payment_method_options_bizum = z.lazy(() => z.record(z.string(), z.any())); -const payment_method_options_boleto = z.lazy(() => z.object({"expires_after_days": z.number().int(), "setup_future_usage": z.enum(["none", "off_session", "on_session"]).optional()}).passthrough()); -const payment_method_options_card_installments = z.lazy(() => z.object({"available_plans": z.array(payment_method_details_card_installments_plan).nullable(), "enabled": z.boolean(), "plan": payment_method_details_card_installments_plan.nullable()}).passthrough()); -const payment_method_options_card_mandate_options = z.lazy(() => z.object({"amount": z.number().int(), "amount_type": z.enum(["fixed", "maximum"]), "description": z.string().nullable(), "end_date": z.number().int().nullable(), "interval": z.enum(["day", "month", "sporadic", "week", "year"]), "interval_count": z.number().int().nullable(), "reference": z.string(), "start_date": z.number().int(), "supported_types": z.array(z.literal("india")).nullable()}).passthrough()); -const payment_method_options_card_present = z.lazy(() => z.object({"capture_method": z.enum(["manual", "manual_preferred"]).optional(), "request_extended_authorization": z.boolean().nullable(), "request_incremental_authorization_support": z.boolean().nullable(), "routing": payment_method_options_card_present_routing.optional()}).passthrough()); -const payment_method_options_card_present_routing = z.lazy(() => z.object({"requested_priority": z.enum(["domestic", "international"]).nullable()}).passthrough()); -const payment_method_options_cashapp = z.lazy(() => z.object({"capture_method": z.literal("manual").optional(), "setup_future_usage": z.enum(["none", "off_session", "on_session"]).optional()}).passthrough()); -const payment_method_options_crypto = z.lazy(() => z.object({"setup_future_usage": z.literal("none").optional()}).passthrough()); -const payment_method_options_customer_balance = z.lazy(() => z.object({"bank_transfer": payment_method_options_customer_balance_bank_transfer.optional(), "funding_type": z.literal("bank_transfer").nullable(), "setup_future_usage": z.literal("none").optional()}).passthrough()); -const payment_method_options_customer_balance_bank_transfer = z.lazy(() => z.object({"eu_bank_transfer": payment_method_options_customer_balance_eu_bank_account.optional(), "requested_address_types": z.array(z.enum(["aba", "iban", "sepa", "sort_code", "spei", "swift", "zengin"])).optional(), "type": z.enum(["eu_bank_transfer", "gb_bank_transfer", "jp_bank_transfer", "mx_bank_transfer", "us_bank_transfer"]).nullable()}).passthrough()); -const payment_method_options_customer_balance_eu_bank_account = z.lazy(() => z.object({"country": z.enum(["BE", "DE", "ES", "FR", "IE", "NL"])}).passthrough()); -const payment_method_options_fpx = z.lazy(() => z.object({"setup_future_usage": z.literal("none").optional()}).passthrough()); -const payment_method_options_giropay = z.lazy(() => z.object({"setup_future_usage": z.literal("none").optional()}).passthrough()); -const payment_method_options_grabpay = z.lazy(() => z.object({"setup_future_usage": z.literal("none").optional()}).passthrough()); -const payment_method_options_ideal = z.lazy(() => z.object({"setup_future_usage": z.enum(["none", "off_session"]).optional()}).passthrough()); +const payment_method_options_boleto = z.lazy(() => z.object({"expires_after_days": z.number().int(), "setup_future_usage": z.enum(["none", "off_session", "on_session"]).optional()})); +const payment_method_options_card_installments = z.lazy(() => z.object({"available_plans": z.array(payment_method_details_card_installments_plan).nullable(), "enabled": z.boolean(), "plan": payment_method_details_card_installments_plan.nullable()})); +const payment_method_options_card_mandate_options = z.lazy(() => z.object({"amount": z.number().int(), "amount_type": z.enum(["fixed", "maximum"]), "description": z.string().nullable(), "end_date": z.number().int().nullable(), "interval": z.enum(["day", "month", "sporadic", "week", "year"]), "interval_count": z.number().int().nullable(), "reference": z.string(), "start_date": z.number().int(), "supported_types": z.array(z.literal("india")).nullable()})); +const payment_method_options_card_present = z.lazy(() => z.object({"capture_method": z.enum(["manual", "manual_preferred"]).optional(), "request_extended_authorization": z.boolean().nullable(), "request_incremental_authorization_support": z.boolean().nullable(), "routing": payment_method_options_card_present_routing.optional()})); +const payment_method_options_card_present_routing = z.lazy(() => z.object({"requested_priority": z.enum(["domestic", "international"]).nullable()})); +const payment_method_options_cashapp = z.lazy(() => z.object({"capture_method": z.literal("manual").optional(), "setup_future_usage": z.enum(["none", "off_session", "on_session"]).optional()})); +const payment_method_options_crypto = z.lazy(() => z.object({"setup_future_usage": z.literal("none").optional()})); +const payment_method_options_customer_balance = z.lazy(() => z.object({"bank_transfer": payment_method_options_customer_balance_bank_transfer.optional(), "funding_type": z.literal("bank_transfer").nullable(), "setup_future_usage": z.literal("none").optional()})); +const payment_method_options_customer_balance_bank_transfer = z.lazy(() => z.object({"eu_bank_transfer": payment_method_options_customer_balance_eu_bank_account.optional(), "requested_address_types": z.array(z.enum(["aba", "iban", "sepa", "sort_code", "spei", "swift", "zengin"])).optional(), "type": z.enum(["eu_bank_transfer", "gb_bank_transfer", "jp_bank_transfer", "mx_bank_transfer", "us_bank_transfer"]).nullable()})); +const payment_method_options_customer_balance_eu_bank_account = z.lazy(() => z.object({"country": z.enum(["BE", "DE", "ES", "FR", "IE", "NL"])})); +const payment_method_options_fpx = z.lazy(() => z.object({"setup_future_usage": z.literal("none").optional()})); +const payment_method_options_giropay = z.lazy(() => z.object({"setup_future_usage": z.literal("none").optional()})); +const payment_method_options_grabpay = z.lazy(() => z.object({"setup_future_usage": z.literal("none").optional()})); +const payment_method_options_ideal = z.lazy(() => z.object({"setup_future_usage": z.enum(["none", "off_session"]).optional()})); const payment_method_options_interac_present = z.lazy(() => z.record(z.string(), z.any())); -const payment_method_options_klarna = z.lazy(() => z.object({"capture_method": z.literal("manual").optional(), "preferred_locale": z.string().nullable(), "setup_future_usage": z.enum(["none", "off_session", "on_session"]).optional()}).passthrough()); -const payment_method_options_konbini = z.lazy(() => z.object({"confirmation_number": z.string().nullable(), "expires_after_days": z.number().int().nullable(), "expires_at": z.number().int().nullable(), "product_description": z.string().nullable(), "setup_future_usage": z.literal("none").optional()}).passthrough()); -const payment_method_options_kr_card = z.lazy(() => z.object({"capture_method": z.literal("manual").optional(), "setup_future_usage": z.enum(["none", "off_session"]).optional()}).passthrough()); -const payment_method_options_mandate_options_pix = z.lazy(() => z.object({"amount": z.number().int().optional(), "amount_includes_iof": z.enum(["always", "never"]).optional(), "amount_type": z.enum(["fixed", "maximum"]).optional(), "currency": z.string().optional(), "end_date": z.string().optional(), "payment_schedule": z.enum(["halfyearly", "monthly", "quarterly", "weekly", "yearly"]).optional(), "reference": z.string().optional(), "start_date": z.string().optional()}).passthrough()); -const payment_method_options_mandate_options_upi = z.lazy(() => z.object({"amount": z.number().int().nullable(), "amount_type": z.enum(["fixed", "maximum"]).nullable(), "description": z.string().nullable(), "end_date": z.number().int().nullable()}).passthrough()); -const payment_method_options_mb_way = z.lazy(() => z.object({"setup_future_usage": z.literal("none").optional()}).passthrough()); -const payment_method_options_multibanco = z.lazy(() => z.object({"setup_future_usage": z.literal("none").optional()}).passthrough()); -const payment_method_options_oxxo = z.lazy(() => z.object({"expires_after_days": z.number().int(), "setup_future_usage": z.literal("none").optional()}).passthrough()); -const payment_method_options_p24 = z.lazy(() => z.object({"setup_future_usage": z.literal("none").optional()}).passthrough()); +const payment_method_options_klarna = z.lazy(() => z.object({"capture_method": z.literal("manual").optional(), "preferred_locale": z.string().nullable(), "setup_future_usage": z.enum(["none", "off_session", "on_session"]).optional()})); +const payment_method_options_konbini = z.lazy(() => z.object({"confirmation_number": z.string().nullable(), "expires_after_days": z.number().int().nullable(), "expires_at": z.number().int().nullable(), "product_description": z.string().nullable(), "setup_future_usage": z.literal("none").optional()})); +const payment_method_options_kr_card = z.lazy(() => z.object({"capture_method": z.literal("manual").optional(), "setup_future_usage": z.enum(["none", "off_session"]).optional()})); +const payment_method_options_mandate_options_pix = z.lazy(() => z.object({"amount": z.number().int().optional(), "amount_includes_iof": z.enum(["always", "never"]).optional(), "amount_type": z.enum(["fixed", "maximum"]).optional(), "currency": z.string().optional(), "end_date": z.string().optional(), "payment_schedule": z.enum(["halfyearly", "monthly", "quarterly", "weekly", "yearly"]).optional(), "reference": z.string().optional(), "start_date": z.string().optional()})); +const payment_method_options_mandate_options_upi = z.lazy(() => z.object({"amount": z.number().int().nullable(), "amount_type": z.enum(["fixed", "maximum"]).nullable(), "description": z.string().nullable(), "end_date": z.number().int().nullable()})); +const payment_method_options_mb_way = z.lazy(() => z.object({"setup_future_usage": z.literal("none").optional()})); +const payment_method_options_multibanco = z.lazy(() => z.object({"setup_future_usage": z.literal("none").optional()})); +const payment_method_options_oxxo = z.lazy(() => z.object({"expires_after_days": z.number().int(), "setup_future_usage": z.literal("none").optional()})); +const payment_method_options_p24 = z.lazy(() => z.object({"setup_future_usage": z.literal("none").optional()})); const payment_method_options_pay_by_bank = z.lazy(() => z.record(z.string(), z.any())); -const payment_method_options_paynow = z.lazy(() => z.object({"setup_future_usage": z.literal("none").optional()}).passthrough()); -const payment_method_options_paypal = z.lazy(() => z.object({"capture_method": z.literal("manual").optional(), "preferred_locale": z.string().nullable(), "reference": z.string().nullable(), "setup_future_usage": z.enum(["none", "off_session"]).optional()}).passthrough()); -const payment_method_options_pix = z.lazy(() => z.object({"amount_includes_iof": z.enum(["always", "never"]).optional(), "expires_after_seconds": z.number().int().nullable(), "expires_at": z.number().int().nullable(), "mandate_options": payment_method_options_mandate_options_pix.optional(), "setup_future_usage": z.enum(["none", "off_session"]).optional()}).passthrough()); -const payment_method_options_promptpay = z.lazy(() => z.object({"setup_future_usage": z.literal("none").optional()}).passthrough()); -const payment_method_options_revolut_pay = z.lazy(() => z.object({"capture_method": z.literal("manual").optional(), "setup_future_usage": z.enum(["none", "off_session"]).optional()}).passthrough()); -const payment_method_options_satispay = z.lazy(() => z.object({"capture_method": z.literal("manual").optional(), "setup_future_usage": z.enum(["none", "off_session", "on_session"]).optional()}).passthrough()); -const payment_method_options_scalapay = z.lazy(() => z.object({"capture_method": z.literal("manual").optional()}).passthrough()); -const payment_method_options_sofort = z.lazy(() => z.object({"preferred_language": z.enum(["de", "en", "es", "fr", "it", "nl", "pl"]).nullable(), "setup_future_usage": z.enum(["none", "off_session"]).optional()}).passthrough()); -const payment_method_options_sunbit = z.lazy(() => z.object({"capture_method": z.literal("manual").optional(), "setup_future_usage": z.literal("none").optional()}).passthrough()); -const payment_method_options_twint = z.lazy(() => z.object({"setup_future_usage": z.enum(["none", "off_session"]).optional()}).passthrough()); -const payment_method_options_upi = z.lazy(() => z.object({"setup_future_usage": z.enum(["off_session", "on_session"]).optional()}).passthrough()); -const payment_method_options_us_bank_account_mandate_options = z.lazy(() => z.object({"collection_method": z.literal("paper").optional()}).passthrough()); -const payment_method_options_wechat_pay = z.lazy(() => z.object({"app_id": z.string().nullable(), "client": z.enum(["android", "ios", "web"]).nullable(), "setup_future_usage": z.literal("none").optional()}).passthrough()); -const payment_method_options_zip = z.lazy(() => z.object({"setup_future_usage": z.literal("none").optional()}).passthrough()); +const payment_method_options_paynow = z.lazy(() => z.object({"setup_future_usage": z.literal("none").optional()})); +const payment_method_options_paypal = z.lazy(() => z.object({"capture_method": z.literal("manual").optional(), "preferred_locale": z.string().nullable(), "reference": z.string().nullable(), "setup_future_usage": z.enum(["none", "off_session"]).optional()})); +const payment_method_options_pix = z.lazy(() => z.object({"amount_includes_iof": z.enum(["always", "never"]).optional(), "expires_after_seconds": z.number().int().nullable(), "expires_at": z.number().int().nullable(), "mandate_options": payment_method_options_mandate_options_pix.optional(), "setup_future_usage": z.enum(["none", "off_session"]).optional()})); +const payment_method_options_promptpay = z.lazy(() => z.object({"setup_future_usage": z.literal("none").optional()})); +const payment_method_options_revolut_pay = z.lazy(() => z.object({"capture_method": z.literal("manual").optional(), "setup_future_usage": z.enum(["none", "off_session"]).optional()})); +const payment_method_options_satispay = z.lazy(() => z.object({"capture_method": z.literal("manual").optional(), "setup_future_usage": z.enum(["none", "off_session", "on_session"]).optional()})); +const payment_method_options_scalapay = z.lazy(() => z.object({"capture_method": z.literal("manual").optional()})); +const payment_method_options_sofort = z.lazy(() => z.object({"preferred_language": z.enum(["de", "en", "es", "fr", "it", "nl", "pl"]).nullable(), "setup_future_usage": z.enum(["none", "off_session"]).optional()})); +const payment_method_options_sunbit = z.lazy(() => z.object({"capture_method": z.literal("manual").optional(), "setup_future_usage": z.literal("none").optional()})); +const payment_method_options_twint = z.lazy(() => z.object({"setup_future_usage": z.enum(["none", "off_session"]).optional()})); +const payment_method_options_upi = z.lazy(() => z.object({"setup_future_usage": z.enum(["off_session", "on_session"]).optional()})); +const payment_method_options_us_bank_account_mandate_options = z.lazy(() => z.object({"collection_method": z.literal("paper").optional()})); +const payment_method_options_wechat_pay = z.lazy(() => z.object({"app_id": z.string().nullable(), "client": z.enum(["android", "ios", "web"]).nullable(), "setup_future_usage": z.literal("none").optional()})); +const payment_method_options_zip = z.lazy(() => z.object({"setup_future_usage": z.literal("none").optional()})); const payment_method_oxxo = z.lazy(() => z.record(z.string(), z.any())); -const payment_method_p24 = z.lazy(() => z.object({"bank": z.enum(["alior_bank", "bank_millennium", "bank_nowy_bfg_sa", "bank_pekao_sa", "banki_spbdzielcze", "blik", "bnp_paribas", "boz", "citi_handlowy", "credit_agricole", "envelobank", "etransfer_pocztowy24", "getin_bank", "ideabank", "ing", "inteligo", "mbank_mtransfer", "nest_przelew", "noble_pay", "pbac_z_ipko", "plus_bank", "santander_przelew24", "tmobile_usbugi_bankowe", "toyota_bank", "velobank", "volkswagen_bank"]).nullable()}).passthrough()); +const payment_method_p24 = z.lazy(() => z.object({"bank": z.enum(["alior_bank", "bank_millennium", "bank_nowy_bfg_sa", "bank_pekao_sa", "banki_spbdzielcze", "blik", "bnp_paribas", "boz", "citi_handlowy", "credit_agricole", "envelobank", "etransfer_pocztowy24", "getin_bank", "ideabank", "ing", "inteligo", "mbank_mtransfer", "nest_przelew", "noble_pay", "pbac_z_ipko", "plus_bank", "santander_przelew24", "tmobile_usbugi_bankowe", "toyota_bank", "velobank", "volkswagen_bank"]).nullable()})); const payment_method_pay_by_bank = z.lazy(() => z.record(z.string(), z.any())); const payment_method_payco = z.lazy(() => z.record(z.string(), z.any())); const payment_method_paynow = z.lazy(() => z.record(z.string(), z.any())); -const payment_method_paypal = z.lazy(() => z.object({"country": z.string().nullable(), "payer_email": z.string().nullable(), "payer_id": z.string().nullable()}).passthrough()); -const payment_method_payto = z.lazy(() => z.object({"bsb_number": z.string().nullable(), "last4": z.string().nullable(), "pay_id": z.string().nullable()}).passthrough()); -const payment_method_pix = z.lazy(() => z.object({"fingerprint": z.string().nullable().optional()}).passthrough()); +const payment_method_paypal = z.lazy(() => z.object({"country": z.string().nullable(), "payer_email": z.string().nullable(), "payer_id": z.string().nullable()})); +const payment_method_payto = z.lazy(() => z.object({"bsb_number": z.string().nullable(), "last4": z.string().nullable(), "pay_id": z.string().nullable()})); +const payment_method_pix = z.lazy(() => z.object({"fingerprint": z.string().nullable().optional()})); const payment_method_promptpay = z.lazy(() => z.record(z.string(), z.any())); const payment_method_revolut_pay = z.lazy(() => z.record(z.string(), z.any())); const payment_method_samsung_pay = z.lazy(() => z.record(z.string(), z.any())); const payment_method_satispay = z.lazy(() => z.record(z.string(), z.any())); const payment_method_scalapay = z.lazy(() => z.record(z.string(), z.any())); -const payment_method_sepa_debit: z.ZodTypeAny = z.lazy(() => z.object({"bank_code": z.string().nullable(), "branch_code": z.string().nullable(), "country": z.string().nullable(), "fingerprint": z.string().nullable(), "generated_from": sepa_debit_generated_from.nullable(), "last4": z.string().nullable()}).passthrough()); -const payment_method_sofort = z.lazy(() => z.object({"country": z.string().nullable()}).passthrough()); +const payment_method_sepa_debit: z.ZodTypeAny = z.lazy(() => z.object({"bank_code": z.string().nullable(), "branch_code": z.string().nullable(), "country": z.string().nullable(), "fingerprint": z.string().nullable(), "generated_from": sepa_debit_generated_from.nullable(), "last4": z.string().nullable()})); +const payment_method_sofort = z.lazy(() => z.object({"country": z.string().nullable()})); const payment_method_sunbit = z.lazy(() => z.record(z.string(), z.any())); const payment_method_swish = z.lazy(() => z.record(z.string(), z.any())); const payment_method_twint = z.lazy(() => z.record(z.string(), z.any())); -const payment_method_upi = z.lazy(() => z.object({"vpa": z.string().nullable()}).passthrough()); -const payment_method_us_bank_account = z.lazy(() => z.object({"account_holder_type": z.enum(["company", "individual"]).nullable(), "account_type": z.enum(["checking", "savings"]).nullable(), "bank_name": z.string().nullable(), "financial_connections_account": z.string().nullable(), "fingerprint": z.string().nullable(), "last4": z.string().nullable(), "networks": us_bank_account_networks.nullable(), "routing_number": z.string().nullable(), "status_details": payment_method_us_bank_account_status_details.nullable()}).passthrough()); -const payment_method_us_bank_account_blocked = z.lazy(() => z.object({"network_code": z.enum(["R02", "R03", "R04", "R05", "R07", "R08", "R10", "R11", "R16", "R20", "R29", "R31"]).nullable(), "reason": z.enum(["bank_account_closed", "bank_account_frozen", "bank_account_invalid_details", "bank_account_restricted", "bank_account_unusable", "debit_not_authorized", "tokenized_account_number_deactivated"]).nullable()}).passthrough()); -const payment_method_us_bank_account_status_details = z.lazy(() => z.object({"blocked": payment_method_us_bank_account_blocked.optional()}).passthrough()); +const payment_method_upi = z.lazy(() => z.object({"vpa": z.string().nullable()})); +const payment_method_us_bank_account = z.lazy(() => z.object({"account_holder_type": z.enum(["company", "individual"]).nullable(), "account_type": z.enum(["checking", "savings"]).nullable(), "bank_name": z.string().nullable(), "financial_connections_account": z.string().nullable(), "fingerprint": z.string().nullable(), "last4": z.string().nullable(), "networks": us_bank_account_networks.nullable(), "routing_number": z.string().nullable(), "status_details": payment_method_us_bank_account_status_details.nullable()})); +const payment_method_us_bank_account_blocked = z.lazy(() => z.object({"network_code": z.enum(["R02", "R03", "R04", "R05", "R07", "R08", "R10", "R11", "R16", "R20", "R29", "R31"]).nullable(), "reason": z.enum(["bank_account_closed", "bank_account_frozen", "bank_account_invalid_details", "bank_account_restricted", "bank_account_unusable", "debit_not_authorized", "tokenized_account_number_deactivated"]).nullable()})); +const payment_method_us_bank_account_status_details = z.lazy(() => z.object({"blocked": payment_method_us_bank_account_blocked.optional()})); const payment_method_wechat_pay = z.lazy(() => z.record(z.string(), z.any())); const payment_method_zip = z.lazy(() => z.record(z.string(), z.any())); -const payment_record: z.ZodTypeAny = z.lazy(() => z.object({"amount": payments_primitives_payment_records_resource_amount, "amount_authorized": payments_primitives_payment_records_resource_amount, "amount_canceled": payments_primitives_payment_records_resource_amount, "amount_failed": payments_primitives_payment_records_resource_amount, "amount_guaranteed": payments_primitives_payment_records_resource_amount, "amount_refunded": payments_primitives_payment_records_resource_amount, "amount_requested": payments_primitives_payment_records_resource_amount, "application": z.string().nullable(), "created": z.number().int(), "customer_details": payments_primitives_payment_records_resource_customer_details.nullable(), "customer_presence": z.enum(["off_session", "on_session"]).nullable(), "description": z.string().nullable(), "id": z.string(), "latest_payment_attempt_record": z.string().nullable(), "livemode": z.boolean(), "metadata": z.record(z.string(), z.string()), "object": z.literal("payment_record"), "payment_method_details": payments_primitives_payment_records_resource_payment_method_details.nullable(), "processor_details": payments_primitives_payment_records_resource_processor_details, "reported_by": z.enum(["self", "stripe"]), "shipping_details": payments_primitives_payment_records_resource_shipping_details.nullable()}).passthrough()); +const payment_record: z.ZodTypeAny = z.lazy(() => z.object({"amount": payments_primitives_payment_records_resource_amount, "amount_authorized": payments_primitives_payment_records_resource_amount, "amount_canceled": payments_primitives_payment_records_resource_amount, "amount_failed": payments_primitives_payment_records_resource_amount, "amount_guaranteed": payments_primitives_payment_records_resource_amount, "amount_refunded": payments_primitives_payment_records_resource_amount, "amount_requested": payments_primitives_payment_records_resource_amount, "application": z.string().nullable(), "created": z.number().int(), "customer_details": payments_primitives_payment_records_resource_customer_details.nullable(), "customer_presence": z.enum(["off_session", "on_session"]).nullable(), "description": z.string().nullable(), "id": z.string(), "latest_payment_attempt_record": z.string().nullable(), "livemode": z.boolean(), "metadata": z.record(z.string(), z.string()), "object": z.literal("payment_record"), "payment_method_details": payments_primitives_payment_records_resource_payment_method_details.nullable(), "processor_details": payments_primitives_payment_records_resource_processor_details, "reported_by": z.enum(["self", "stripe"]), "shipping_details": payments_primitives_payment_records_resource_shipping_details.nullable()})); const payment_source: z.ZodTypeAny = z.lazy(() => z.union([account, bank_account, card, source])); -const payments_primitives_payment_records_resource_address = z.lazy(() => z.object({"city": z.string().nullable(), "country": z.string().nullable(), "line1": z.string().nullable(), "line2": z.string().nullable(), "postal_code": z.string().nullable(), "state": z.string().nullable()}).passthrough()); -const payments_primitives_payment_records_resource_amount = z.lazy(() => z.object({"currency": z.string(), "value": z.number().int()}).passthrough()); -const payments_primitives_payment_records_resource_billing_details = z.lazy(() => z.object({"address": payments_primitives_payment_records_resource_address, "email": z.string().nullable(), "name": z.string().nullable(), "phone": z.string().nullable()}).passthrough()); -const payments_primitives_payment_records_resource_customer_details = z.lazy(() => z.object({"customer": z.string().nullable(), "email": z.string().nullable(), "name": z.string().nullable(), "phone": z.string().nullable()}).passthrough()); -const payments_primitives_payment_records_resource_payment_method_alma_details_resource_installments = z.lazy(() => z.object({"count": z.number().int()}).passthrough()); -const payments_primitives_payment_records_resource_payment_method_amazon_pay_details_resource_funding = z.lazy(() => z.object({"card": payments_primitives_payment_records_resource_payment_method_amazon_pay_details_resource_funding_resource_funding_card.optional(), "type": z.literal("card").nullable()}).passthrough()); -const payments_primitives_payment_records_resource_payment_method_amazon_pay_details_resource_funding_resource_funding_card = z.lazy(() => z.object({"brand": z.string().nullable(), "country": z.string().nullable(), "exp_month": z.number().int().nullable(), "exp_year": z.number().int().nullable(), "funding": z.string().nullable(), "last4": z.string().nullable()}).passthrough()); -const payments_primitives_payment_records_resource_payment_method_card_details = z.lazy(() => z.object({"authorization_code": z.string().nullable(), "brand": z.enum(["amex", "cartes_bancaires", "diners", "discover", "eftpos_au", "interac", "jcb", "link", "mastercard", "unionpay", "unknown", "visa"]).nullable(), "capture_before": z.number().int().optional(), "checks": payments_primitives_payment_records_resource_payment_method_card_details_resource_checks.nullable(), "country": z.string().nullable(), "description": z.string().nullable().optional(), "exp_month": z.number().int().nullable(), "exp_year": z.number().int().nullable(), "fingerprint": z.string().nullable().optional(), "funding": z.enum(["credit", "debit", "prepaid", "unknown"]).nullable(), "iin": z.string().nullable().optional(), "installments": payments_primitives_payment_records_resource_payment_method_card_details_resource_installments.nullable(), "issuer": z.string().nullable().optional(), "last4": z.string().nullable(), "moto": z.boolean().nullable().optional(), "network": z.enum(["amex", "cartes_bancaires", "diners", "discover", "eftpos_au", "interac", "jcb", "link", "mastercard", "unionpay", "unknown", "visa"]).nullable(), "network_advice_code": z.string().nullable(), "network_decline_code": z.string().nullable(), "network_token": payments_primitives_payment_records_resource_payment_method_card_details_resource_network_token.nullable().optional(), "network_transaction_id": z.string().nullable(), "three_d_secure": payments_primitives_payment_records_resource_payment_method_card_details_resource_three_d_secure.nullable(), "wallet": payments_primitives_payment_records_resource_payment_method_card_details_resource_wallet.nullable()}).passthrough()); -const payments_primitives_payment_records_resource_payment_method_card_details_resource_checks = z.lazy(() => z.object({"address_line1_check": z.enum(["fail", "pass", "unavailable", "unchecked"]).nullable(), "address_postal_code_check": z.enum(["fail", "pass", "unavailable", "unchecked"]).nullable(), "cvc_check": z.enum(["fail", "pass", "unavailable", "unchecked"]).nullable()}).passthrough()); -const payments_primitives_payment_records_resource_payment_method_card_details_resource_installment_plan = z.lazy(() => z.object({"count": z.number().int().nullable(), "interval": z.literal("month").nullable(), "type": z.enum(["bonus", "fixed_count", "revolving"])}).passthrough()); -const payments_primitives_payment_records_resource_payment_method_card_details_resource_installments = z.lazy(() => z.object({"plan": payments_primitives_payment_records_resource_payment_method_card_details_resource_installment_plan.nullable()}).passthrough()); -const payments_primitives_payment_records_resource_payment_method_card_details_resource_network_token = z.lazy(() => z.object({"used": z.boolean()}).passthrough()); -const payments_primitives_payment_records_resource_payment_method_card_details_resource_three_d_secure = z.lazy(() => z.object({"authentication_flow": z.enum(["challenge", "frictionless"]).nullable(), "cryptogram": z.string().nullable(), "electronic_commerce_indicator": z.enum(["01", "02", "03", "04", "05", "06", "07"]).nullable(), "exemption_indicator": z.enum(["low_risk", "none"]).nullable(), "exemption_indicator_applied": z.boolean().nullable(), "result": z.enum(["attempt_acknowledged", "authenticated", "exempted", "failed", "not_supported", "processing_error"]).nullable(), "result_reason": z.enum(["abandoned", "bypassed", "canceled", "card_not_enrolled", "network_not_supported", "protocol_error", "rejected"]).nullable(), "version": z.enum(["1.0.2", "2.1.0", "2.2.0"]).nullable()}).passthrough()); -const payments_primitives_payment_records_resource_payment_method_card_details_resource_wallet = z.lazy(() => z.object({"apple_pay": payments_primitives_payment_records_resource_payment_method_card_details_resource_wallet_resource_apple_pay.optional(), "dynamic_last4": z.string().optional(), "google_pay": payments_primitives_payment_records_resource_payment_method_card_details_resource_wallet_resource_google_pay.optional(), "type": z.string()}).passthrough()); -const payments_primitives_payment_records_resource_payment_method_card_details_resource_wallet_resource_apple_pay = z.lazy(() => z.object({"type": z.string()}).passthrough()); +const payments_primitives_payment_records_resource_address = z.lazy(() => z.object({"city": z.string().nullable(), "country": z.string().nullable(), "line1": z.string().nullable(), "line2": z.string().nullable(), "postal_code": z.string().nullable(), "state": z.string().nullable()})); +const payments_primitives_payment_records_resource_amount = z.lazy(() => z.object({"currency": z.string(), "value": z.number().int()})); +const payments_primitives_payment_records_resource_billing_details = z.lazy(() => z.object({"address": payments_primitives_payment_records_resource_address, "email": z.string().nullable(), "name": z.string().nullable(), "phone": z.string().nullable()})); +const payments_primitives_payment_records_resource_customer_details = z.lazy(() => z.object({"customer": z.string().nullable(), "email": z.string().nullable(), "name": z.string().nullable(), "phone": z.string().nullable()})); +const payments_primitives_payment_records_resource_payment_method_alma_details_resource_installments = z.lazy(() => z.object({"count": z.number().int()})); +const payments_primitives_payment_records_resource_payment_method_amazon_pay_details_resource_funding = z.lazy(() => z.object({"card": payments_primitives_payment_records_resource_payment_method_amazon_pay_details_resource_funding_resource_funding_card.optional(), "type": z.literal("card").nullable()})); +const payments_primitives_payment_records_resource_payment_method_amazon_pay_details_resource_funding_resource_funding_card = z.lazy(() => z.object({"brand": z.string().nullable(), "country": z.string().nullable(), "exp_month": z.number().int().nullable(), "exp_year": z.number().int().nullable(), "funding": z.string().nullable(), "last4": z.string().nullable()})); +const payments_primitives_payment_records_resource_payment_method_card_details = z.lazy(() => z.object({"authorization_code": z.string().nullable(), "brand": z.enum(["amex", "cartes_bancaires", "diners", "discover", "eftpos_au", "interac", "jcb", "link", "mastercard", "unionpay", "unknown", "visa"]).nullable(), "capture_before": z.number().int().optional(), "checks": payments_primitives_payment_records_resource_payment_method_card_details_resource_checks.nullable(), "country": z.string().nullable(), "description": z.string().nullable().optional(), "exp_month": z.number().int().nullable(), "exp_year": z.number().int().nullable(), "fingerprint": z.string().nullable().optional(), "funding": z.enum(["credit", "debit", "prepaid", "unknown"]).nullable(), "iin": z.string().nullable().optional(), "installments": payments_primitives_payment_records_resource_payment_method_card_details_resource_installments.nullable(), "issuer": z.string().nullable().optional(), "last4": z.string().nullable(), "moto": z.boolean().nullable().optional(), "network": z.enum(["amex", "cartes_bancaires", "diners", "discover", "eftpos_au", "interac", "jcb", "link", "mastercard", "unionpay", "unknown", "visa"]).nullable(), "network_advice_code": z.string().nullable(), "network_decline_code": z.string().nullable(), "network_token": payments_primitives_payment_records_resource_payment_method_card_details_resource_network_token.nullable().optional(), "network_transaction_id": z.string().nullable(), "three_d_secure": payments_primitives_payment_records_resource_payment_method_card_details_resource_three_d_secure.nullable(), "wallet": payments_primitives_payment_records_resource_payment_method_card_details_resource_wallet.nullable()})); +const payments_primitives_payment_records_resource_payment_method_card_details_resource_checks = z.lazy(() => z.object({"address_line1_check": z.enum(["fail", "pass", "unavailable", "unchecked"]).nullable(), "address_postal_code_check": z.enum(["fail", "pass", "unavailable", "unchecked"]).nullable(), "cvc_check": z.enum(["fail", "pass", "unavailable", "unchecked"]).nullable()})); +const payments_primitives_payment_records_resource_payment_method_card_details_resource_installment_plan = z.lazy(() => z.object({"count": z.number().int().nullable(), "interval": z.literal("month").nullable(), "type": z.enum(["bonus", "fixed_count", "revolving"])})); +const payments_primitives_payment_records_resource_payment_method_card_details_resource_installments = z.lazy(() => z.object({"plan": payments_primitives_payment_records_resource_payment_method_card_details_resource_installment_plan.nullable()})); +const payments_primitives_payment_records_resource_payment_method_card_details_resource_network_token = z.lazy(() => z.object({"used": z.boolean()})); +const payments_primitives_payment_records_resource_payment_method_card_details_resource_three_d_secure = z.lazy(() => z.object({"authentication_flow": z.enum(["challenge", "frictionless"]).nullable(), "cryptogram": z.string().nullable(), "electronic_commerce_indicator": z.enum(["01", "02", "03", "04", "05", "06", "07"]).nullable(), "exemption_indicator": z.enum(["low_risk", "none"]).nullable(), "exemption_indicator_applied": z.boolean().nullable(), "result": z.enum(["attempt_acknowledged", "authenticated", "exempted", "failed", "not_supported", "processing_error"]).nullable(), "result_reason": z.enum(["abandoned", "bypassed", "canceled", "card_not_enrolled", "network_not_supported", "protocol_error", "rejected"]).nullable(), "version": z.enum(["1.0.2", "2.1.0", "2.2.0"]).nullable()})); +const payments_primitives_payment_records_resource_payment_method_card_details_resource_wallet = z.lazy(() => z.object({"apple_pay": payments_primitives_payment_records_resource_payment_method_card_details_resource_wallet_resource_apple_pay.optional(), "dynamic_last4": z.string().optional(), "google_pay": payments_primitives_payment_records_resource_payment_method_card_details_resource_wallet_resource_google_pay.optional(), "type": z.string()})); +const payments_primitives_payment_records_resource_payment_method_card_details_resource_wallet_resource_apple_pay = z.lazy(() => z.object({"type": z.string()})); const payments_primitives_payment_records_resource_payment_method_card_details_resource_wallet_resource_google_pay = z.lazy(() => z.record(z.string(), z.any())); -const payments_primitives_payment_records_resource_payment_method_custom_details = z.lazy(() => z.object({"display_name": z.string(), "type": z.string().nullable()}).passthrough()); -const payments_primitives_payment_records_resource_payment_method_details: z.ZodTypeAny = z.lazy(() => z.object({"ach_credit_transfer": payment_method_details_ach_credit_transfer.optional(), "ach_debit": payment_method_details_ach_debit.optional(), "acss_debit": payment_method_details_payment_record_acss_debit.optional(), "affirm": payment_method_details_payment_record_affirm.optional(), "afterpay_clearpay": payment_method_details_payment_record_afterpay_clearpay.optional(), "alipay": payment_flows_private_payment_methods_alipay_details.optional(), "alma": payment_method_details_payment_record_alma.optional(), "amazon_pay": payment_method_details_payment_record_amazon_pay.optional(), "au_becs_debit": payment_method_details_au_becs_debit.optional(), "bacs_debit": payment_method_details_bacs_debit.optional(), "bancontact": payment_method_details_payment_record_bancontact.optional(), "billie": payment_method_details_payment_record_billie.optional(), "billing_details": payments_primitives_payment_records_resource_billing_details.nullable(), "bizum": payment_method_details_payment_record_bizum.optional(), "blik": payment_method_details_payment_record_blik.optional(), "boleto": payment_method_details_payment_record_boleto.optional(), "card": payments_primitives_payment_records_resource_payment_method_card_details.optional(), "card_present": payment_method_details_card_present.optional(), "cashapp": payment_method_details_payment_record_cashapp.optional(), "crypto": payment_method_details_crypto.optional(), "custom": payments_primitives_payment_records_resource_payment_method_custom_details.optional(), "customer_balance": payment_method_details_customer_balance.optional(), "eps": payment_method_details_payment_record_eps.optional(), "fpx": payment_method_details_fpx.optional(), "giropay": payment_method_details_payment_record_giropay.optional(), "grabpay": payment_method_details_grabpay.optional(), "ideal": payment_method_details_payment_record_ideal.optional(), "interac_present": payment_method_details_interac_present.optional(), "kakao_pay": payment_method_details_payment_record_kakao_pay.optional(), "klarna": payment_method_details_payment_record_klarna.optional(), "konbini": payment_method_details_payment_record_konbini.optional(), "kr_card": payment_method_details_kr_card.optional(), "link": payment_method_details_payment_record_link.optional(), "mb_way": payment_method_details_payment_record_mb_way.optional(), "mobilepay": payment_method_details_payment_record_mobilepay.optional(), "multibanco": payment_method_details_payment_record_multibanco.optional(), "naver_pay": payment_method_details_payment_record_naver_pay.optional(), "nz_bank_account": payment_method_details_nz_bank_account.optional(), "oxxo": payment_method_details_payment_record_oxxo.optional(), "p24": payment_method_details_payment_record_p24.optional(), "pay_by_bank": payment_method_details_payment_record_pay_by_bank.optional(), "payco": payment_method_details_payment_record_payco.optional(), "payment_method": z.string().nullable(), "paynow": payment_method_details_payment_record_paynow.optional(), "paypal": payment_method_details_paypal.optional(), "payto": payment_method_details_payment_record_payto.optional(), "pix": payment_method_details_payment_record_pix.optional(), "promptpay": payment_method_details_payment_record_promptpay.optional(), "revolut_pay": payment_method_details_payment_record_revolut_pay.optional(), "samsung_pay": payment_method_details_payment_record_samsung_pay.optional(), "satispay": payment_method_details_payment_record_satispay.optional(), "scalapay": payment_method_details_payment_record_scalapay.optional(), "sepa_credit_transfer": payment_method_details_sepa_credit_transfer.optional(), "sepa_debit": payment_method_details_payment_record_sepa_debit.optional(), "sofort": payment_method_details_payment_record_sofort.optional(), "stripe_account": payment_method_details_stripe_account.optional(), "sunbit": payment_method_details_payment_record_sunbit.optional(), "swish": payment_method_details_payment_record_swish.optional(), "twint": payment_method_details_payment_record_twint.optional(), "type": z.string(), "upi": payment_method_details_payment_record_upi.optional(), "us_bank_account": payment_method_details_payment_record_us_bank_account.optional(), "wechat": payment_method_details_wechat.optional(), "wechat_pay": payment_method_details_payment_record_wechat_pay.optional(), "zip": payment_method_details_payment_record_zip.optional()}).passthrough()); -const payments_primitives_payment_records_resource_payment_method_klarna_details_resource_payer_details = z.lazy(() => z.object({"address": payments_primitives_payment_records_resource_payment_method_klarna_details_resource_payer_details_resource_payer_details_address.nullable()}).passthrough()); -const payments_primitives_payment_records_resource_payment_method_klarna_details_resource_payer_details_resource_payer_details_address = z.lazy(() => z.object({"country": z.string().nullable()}).passthrough()); -const payments_primitives_payment_records_resource_payment_method_konbini_details_resource_store = z.lazy(() => z.object({"chain": z.enum(["familymart", "lawson", "ministop", "seicomart"]).nullable()}).passthrough()); -const payments_primitives_payment_records_resource_payment_method_mobilepay_details_resource_card = z.lazy(() => z.object({"brand": z.string().nullable(), "country": z.string().nullable(), "exp_month": z.number().int().nullable(), "exp_year": z.number().int().nullable(), "last4": z.string().nullable()}).passthrough()); -const payments_primitives_payment_records_resource_payment_method_revolut_pay_details_resource_funding = z.lazy(() => z.object({"card": payments_primitives_payment_records_resource_payment_method_revolut_pay_details_resource_funding_resource_funding_card.optional(), "type": z.literal("card").nullable()}).passthrough()); -const payments_primitives_payment_records_resource_payment_method_revolut_pay_details_resource_funding_resource_funding_card = z.lazy(() => z.object({"brand": z.string().nullable(), "country": z.string().nullable(), "exp_month": z.number().int().nullable(), "exp_year": z.number().int().nullable(), "funding": z.string().nullable(), "last4": z.string().nullable()}).passthrough()); -const payments_primitives_payment_records_resource_processor_details = z.lazy(() => z.object({"custom": payments_primitives_payment_records_resource_processor_details_resource_custom_details.optional(), "type": z.literal("custom")}).passthrough()); -const payments_primitives_payment_records_resource_processor_details_resource_custom_details = z.lazy(() => z.object({"payment_reference": z.string().nullable()}).passthrough()); -const payments_primitives_payment_records_resource_shipping_details = z.lazy(() => z.object({"address": payments_primitives_payment_records_resource_address, "name": z.string().nullable(), "phone": z.string().nullable()}).passthrough()); -const payout: z.ZodTypeAny = z.lazy(() => z.object({"amount": z.number().int(), "application_fee": z.union([z.string(), application_fee]).nullable(), "application_fee_amount": z.number().int().nullable(), "arrival_date": z.number().int(), "automatic": z.boolean(), "balance_transaction": z.union([z.string(), balance_transaction]).nullable(), "created": z.number().int(), "currency": z.string(), "description": z.string().nullable(), "destination": z.union([z.string(), external_account, deleted_external_account]).nullable(), "failure_balance_transaction": z.union([z.string(), balance_transaction]).nullable(), "failure_code": z.string().nullable(), "failure_message": z.string().nullable(), "id": z.string(), "livemode": z.boolean(), "metadata": z.record(z.string(), z.string()).nullable(), "method": z.string(), "object": z.literal("payout"), "original_payout": z.union([z.string(), payout]).nullable(), "payout_method": z.string().nullable(), "reconciliation_status": z.enum(["completed", "in_progress", "not_applicable"]), "reversed_by": z.union([z.string(), payout]).nullable(), "source_type": z.string(), "statement_descriptor": z.string().nullable(), "status": z.string(), "trace_id": payouts_trace_id.nullable(), "type": z.enum(["bank_account", "card"])}).passthrough()); -const payouts_trace_id = z.lazy(() => z.object({"status": z.string(), "value": z.string().nullable()}).passthrough()); -const paypal_seller_protection = z.lazy(() => z.object({"dispute_categories": z.array(z.enum(["fraudulent", "product_not_received"])).nullable(), "status": z.enum(["eligible", "not_eligible", "partially_eligible"])}).passthrough()); -const person = z.lazy(() => z.object({"account": z.string().optional(), "additional_tos_acceptances": person_additional_tos_acceptances.optional(), "address": address.optional(), "address_kana": legal_entity_japan_address.nullable().optional(), "address_kanji": legal_entity_japan_address.nullable().optional(), "created": z.number().int(), "dob": legal_entity_dob.optional(), "email": z.string().nullable().optional(), "first_name": z.string().nullable().optional(), "first_name_kana": z.string().nullable().optional(), "first_name_kanji": z.string().nullable().optional(), "full_name_aliases": z.array(z.string()).optional(), "future_requirements": person_future_requirements.nullable().optional(), "gender": z.string().nullable().optional(), "id": z.string(), "id_number_provided": z.boolean().optional(), "id_number_secondary_provided": z.boolean().optional(), "last_name": z.string().nullable().optional(), "last_name_kana": z.string().nullable().optional(), "last_name_kanji": z.string().nullable().optional(), "maiden_name": z.string().nullable().optional(), "metadata": z.record(z.string(), z.string()).optional(), "nationality": z.string().nullable().optional(), "object": z.literal("person"), "phone": z.string().nullable().optional(), "political_exposure": z.enum(["existing", "none"]).optional(), "registered_address": address.optional(), "relationship": person_relationship.optional(), "requirements": person_requirements.nullable().optional(), "ssn_last_4_provided": z.boolean().optional(), "us_cfpb_data": person_us_cfpb_data.nullable().optional(), "verification": legal_entity_person_verification.optional()}).passthrough()); -const person_additional_tos_acceptance = z.lazy(() => z.object({"date": z.number().int().nullable(), "ip": z.string().nullable(), "user_agent": z.string().nullable()}).passthrough()); -const person_additional_tos_acceptances = z.lazy(() => z.object({"account": person_additional_tos_acceptance.nullable()}).passthrough()); -const person_ethnicity_details = z.lazy(() => z.object({"ethnicity": z.array(z.enum(["cuban", "hispanic_or_latino", "mexican", "not_hispanic_or_latino", "other_hispanic_or_latino", "prefer_not_to_answer", "puerto_rican"])).nullable(), "ethnicity_other": z.string().nullable()}).passthrough()); -const person_future_requirements = z.lazy(() => z.object({"alternatives": z.array(account_requirements_alternative).nullable(), "currently_due": z.array(z.string()), "errors": z.array(account_requirements_error), "eventually_due": z.array(z.string()), "past_due": z.array(z.string()), "pending_verification": z.array(z.string())}).passthrough()); -const person_race_details = z.lazy(() => z.object({"race": z.array(z.enum(["african_american", "american_indian_or_alaska_native", "asian", "asian_indian", "black_or_african_american", "chinese", "ethiopian", "filipino", "guamanian_or_chamorro", "haitian", "jamaican", "japanese", "korean", "native_hawaiian", "native_hawaiian_or_other_pacific_islander", "nigerian", "other_asian", "other_black_or_african_american", "other_pacific_islander", "prefer_not_to_answer", "samoan", "somali", "vietnamese", "white"])).nullable(), "race_other": z.string().nullable()}).passthrough()); -const person_relationship = z.lazy(() => z.object({"authorizer": z.boolean().nullable(), "director": z.boolean().nullable(), "executive": z.boolean().nullable(), "legal_guardian": z.boolean().nullable(), "owner": z.boolean().nullable(), "percent_ownership": z.number().nullable(), "representative": z.boolean().nullable(), "title": z.string().nullable()}).passthrough()); -const person_requirements = z.lazy(() => z.object({"alternatives": z.array(account_requirements_alternative).nullable(), "currently_due": z.array(z.string()), "errors": z.array(account_requirements_error), "eventually_due": z.array(z.string()), "past_due": z.array(z.string()), "pending_verification": z.array(z.string())}).passthrough()); -const person_us_cfpb_data = z.lazy(() => z.object({"ethnicity_details": person_ethnicity_details.nullable(), "race_details": person_race_details.nullable(), "self_identified_gender": z.string().nullable()}).passthrough()); -const plan = z.lazy(() => z.object({"active": z.boolean(), "amount": z.number().int().nullable(), "amount_decimal": z.string().nullable(), "billing_scheme": z.enum(["per_unit", "tiered"]), "created": z.number().int(), "currency": z.string(), "id": z.string(), "interval": z.enum(["day", "month", "week", "year"]), "interval_count": z.number().int(), "livemode": z.boolean(), "metadata": z.record(z.string(), z.string()).nullable(), "meter": z.string().nullable(), "nickname": z.string().nullable(), "object": z.literal("plan"), "product": z.union([z.string(), product, deleted_product]).nullable(), "tiers": z.array(plan_tier).optional(), "tiers_mode": z.enum(["graduated", "volume"]).nullable(), "transform_usage": transform_usage.nullable(), "trial_period_days": z.number().int().nullable(), "usage_type": z.enum(["licensed", "metered"])}).passthrough()); -const plan_tier = z.lazy(() => z.object({"flat_amount": z.number().int().nullable(), "flat_amount_decimal": z.string().nullable(), "unit_amount": z.number().int().nullable(), "unit_amount_decimal": z.string().nullable(), "up_to": z.number().int().nullable()}).passthrough()); -const platform_earning_fee_source = z.lazy(() => z.object({"charge": z.string().optional(), "payout": z.string().optional(), "type": z.enum(["charge", "payout"])}).passthrough()); -const price: z.ZodTypeAny = z.lazy(() => z.object({"active": z.boolean(), "billing_scheme": z.enum(["per_unit", "tiered"]), "created": z.number().int(), "currency": z.string(), "currency_options": z.record(z.string(), currency_option).optional(), "custom_unit_amount": custom_unit_amount.nullable(), "id": z.string(), "livemode": z.boolean(), "lookup_key": z.string().nullable(), "metadata": z.record(z.string(), z.string()), "nickname": z.string().nullable(), "object": z.literal("price"), "product": z.union([z.string(), product, deleted_product]), "recurring": recurring.nullable(), "tax_behavior": z.enum(["exclusive", "inclusive", "unspecified"]).nullable(), "tiers": z.array(price_tier).optional(), "tiers_mode": z.enum(["graduated", "volume"]).nullable(), "transform_quantity": transform_quantity.nullable(), "type": z.enum(["one_time", "recurring"]), "unit_amount": z.number().int().nullable(), "unit_amount_decimal": z.string().nullable()}).passthrough()); -const price_tier = z.lazy(() => z.object({"flat_amount": z.number().int().nullable(), "flat_amount_decimal": z.string().nullable(), "unit_amount": z.number().int().nullable(), "unit_amount_decimal": z.string().nullable(), "up_to": z.number().int().nullable()}).passthrough()); -const product: z.ZodTypeAny = z.lazy(() => z.object({"active": z.boolean(), "created": z.number().int(), "default_price": z.union([z.string(), price]).nullable().optional(), "description": z.string().nullable(), "id": z.string(), "images": z.array(z.string()), "livemode": z.boolean(), "marketing_features": z.array(product_marketing_feature), "metadata": z.record(z.string(), z.string()), "name": z.string(), "object": z.literal("product"), "package_dimensions": package_dimensions.nullable(), "shippable": z.boolean().nullable(), "statement_descriptor": z.string().nullable().optional(), "tax_code": z.union([z.string(), tax_code]).nullable().optional(), "type": z.enum(["good", "service"]), "unit_label": z.string().nullable().optional(), "updated": z.number().int(), "url": z.string().nullable()}).passthrough()); -const product_marketing_feature = z.lazy(() => z.object({"name": z.string().optional()}).passthrough()); -const promotion_code: z.ZodTypeAny = z.lazy(() => z.object({"active": z.boolean(), "code": z.string(), "created": z.number().int(), "customer": z.union([z.string(), customer, deleted_customer]).nullable(), "customer_account": z.string().nullable(), "expires_at": z.number().int().nullable(), "id": z.string(), "livemode": z.boolean(), "max_redemptions": z.number().int().nullable(), "metadata": z.record(z.string(), z.string()).nullable(), "object": z.literal("promotion_code"), "promotion": promotion_codes_resource_promotion, "restrictions": promotion_codes_resource_restrictions, "times_redeemed": z.number().int()}).passthrough()); -const promotion_code_currency_option = z.lazy(() => z.object({"minimum_amount": z.number().int()}).passthrough()); -const promotion_codes_resource_promotion = z.lazy(() => z.object({"coupon": z.union([z.string(), coupon]).nullable(), "type": z.literal("coupon")}).passthrough()); -const promotion_codes_resource_restrictions = z.lazy(() => z.object({"currency_options": z.record(z.string(), promotion_code_currency_option).optional(), "first_time_transaction": z.boolean(), "minimum_amount": z.number().int().nullable(), "minimum_amount_currency": z.string().nullable()}).passthrough()); -const radar_radar_options = z.lazy(() => z.object({"session": z.string().optional()}).passthrough()); -const radar_review_resource_location = z.lazy(() => z.object({"city": z.string().nullable(), "country": z.string().nullable(), "latitude": z.number().nullable(), "longitude": z.number().nullable(), "region": z.string().nullable()}).passthrough()); -const radar_review_resource_session = z.lazy(() => z.object({"browser": z.string().nullable(), "device": z.string().nullable(), "platform": z.string().nullable(), "version": z.string().nullable()}).passthrough()); -const recurring = z.lazy(() => z.object({"interval": z.enum(["day", "month", "week", "year"]), "interval_count": z.number().int(), "meter": z.string().nullable(), "trial_period_days": z.number().int().nullable(), "usage_type": z.enum(["licensed", "metered"])}).passthrough()); -const refund: z.ZodTypeAny = z.lazy(() => z.object({"amount": z.number().int(), "balance_transaction": z.union([z.string(), balance_transaction]).nullable(), "charge": z.union([z.string(), charge]).nullable(), "created": z.number().int(), "currency": z.string(), "description": z.string().optional(), "destination_details": refund_destination_details.optional(), "failure_balance_transaction": z.union([z.string(), balance_transaction]).optional(), "failure_reason": z.string().optional(), "id": z.string(), "instructions_email": z.string().optional(), "metadata": z.record(z.string(), z.string()).nullable(), "next_action": refund_next_action.optional(), "object": z.literal("refund"), "payment_intent": z.union([z.string(), payment_intent]).nullable(), "pending_reason": z.enum(["charge_pending", "insufficient_funds", "processing"]).optional(), "presentment_details": payment_flows_payment_intent_presentment_details.optional(), "reason": z.enum(["duplicate", "expired_uncaptured_charge", "fraudulent", "requested_by_customer"]).nullable(), "receipt_number": z.string().nullable(), "source_transfer_reversal": z.union([z.string(), transfer_reversal]).nullable(), "status": z.string().nullable(), "transfer_reversal": z.union([z.string(), transfer_reversal]).nullable()}).passthrough()); -const refund_destination_details = z.lazy(() => z.object({"affirm": destination_details_unimplemented.optional(), "afterpay_clearpay": destination_details_unimplemented.optional(), "alipay": destination_details_unimplemented.optional(), "alma": destination_details_unimplemented.optional(), "amazon_pay": destination_details_unimplemented.optional(), "au_bank_transfer": destination_details_unimplemented.optional(), "blik": refund_destination_details_blik.optional(), "br_bank_transfer": refund_destination_details_br_bank_transfer.optional(), "card": refund_destination_details_card.optional(), "cashapp": destination_details_unimplemented.optional(), "crypto": refund_destination_details_crypto.optional(), "customer_cash_balance": destination_details_unimplemented.optional(), "eps": destination_details_unimplemented.optional(), "eu_bank_transfer": refund_destination_details_eu_bank_transfer.optional(), "gb_bank_transfer": refund_destination_details_gb_bank_transfer.optional(), "giropay": destination_details_unimplemented.optional(), "grabpay": destination_details_unimplemented.optional(), "jp_bank_transfer": refund_destination_details_jp_bank_transfer.optional(), "klarna": destination_details_unimplemented.optional(), "mb_way": refund_destination_details_mb_way.optional(), "multibanco": refund_destination_details_multibanco.optional(), "mx_bank_transfer": refund_destination_details_mx_bank_transfer.optional(), "nz_bank_transfer": destination_details_unimplemented.optional(), "p24": refund_destination_details_p24.optional(), "paynow": destination_details_unimplemented.optional(), "paypal": refund_destination_details_paypal.optional(), "pix": destination_details_unimplemented.optional(), "revolut": destination_details_unimplemented.optional(), "scalapay": destination_details_unimplemented.optional(), "sofort": destination_details_unimplemented.optional(), "swish": refund_destination_details_swish.optional(), "th_bank_transfer": refund_destination_details_th_bank_transfer.optional(), "twint": destination_details_unimplemented.optional(), "type": z.string(), "us_bank_transfer": refund_destination_details_us_bank_transfer.optional(), "wechat_pay": destination_details_unimplemented.optional(), "zip": destination_details_unimplemented.optional()}).passthrough()); -const refund_destination_details_blik = z.lazy(() => z.object({"network_decline_code": z.string().nullable(), "reference": z.string().nullable(), "reference_status": z.string().nullable()}).passthrough()); -const refund_destination_details_br_bank_transfer = z.lazy(() => z.object({"reference": z.string().nullable(), "reference_status": z.string().nullable()}).passthrough()); -const refund_destination_details_card = z.lazy(() => z.object({"reference": z.string().optional(), "reference_status": z.string().optional(), "reference_type": z.string().optional(), "type": z.enum(["pending", "refund", "reversal"])}).passthrough()); -const refund_destination_details_crypto = z.lazy(() => z.object({"reference": z.string().nullable()}).passthrough()); -const refund_destination_details_eu_bank_transfer = z.lazy(() => z.object({"reference": z.string().nullable(), "reference_status": z.string().nullable()}).passthrough()); -const refund_destination_details_gb_bank_transfer = z.lazy(() => z.object({"reference": z.string().nullable(), "reference_status": z.string().nullable()}).passthrough()); -const refund_destination_details_jp_bank_transfer = z.lazy(() => z.object({"reference": z.string().nullable(), "reference_status": z.string().nullable()}).passthrough()); -const refund_destination_details_mb_way = z.lazy(() => z.object({"reference": z.string().nullable(), "reference_status": z.string().nullable()}).passthrough()); -const refund_destination_details_multibanco = z.lazy(() => z.object({"reference": z.string().nullable(), "reference_status": z.string().nullable()}).passthrough()); -const refund_destination_details_mx_bank_transfer = z.lazy(() => z.object({"reference": z.string().nullable(), "reference_status": z.string().nullable()}).passthrough()); -const refund_destination_details_p24 = z.lazy(() => z.object({"reference": z.string().nullable(), "reference_status": z.string().nullable()}).passthrough()); -const refund_destination_details_paypal = z.lazy(() => z.object({"network_decline_code": z.string().nullable()}).passthrough()); -const refund_destination_details_swish = z.lazy(() => z.object({"network_decline_code": z.string().nullable(), "reference": z.string().nullable(), "reference_status": z.string().nullable()}).passthrough()); -const refund_destination_details_th_bank_transfer = z.lazy(() => z.object({"reference": z.string().nullable(), "reference_status": z.string().nullable()}).passthrough()); -const refund_destination_details_us_bank_transfer = z.lazy(() => z.object({"reference": z.string().nullable(), "reference_status": z.string().nullable()}).passthrough()); -const refund_next_action = z.lazy(() => z.object({"display_details": refund_next_action_display_details.optional(), "type": z.string()}).passthrough()); -const refund_next_action_display_details = z.lazy(() => z.object({"email_sent": email_sent, "expires_at": z.number().int()}).passthrough()); -const reserve_transaction = z.lazy(() => z.object({"amount": z.number().int(), "currency": z.string(), "description": z.string().nullable(), "id": z.string(), "object": z.literal("reserve_transaction")}).passthrough()); -const review: z.ZodTypeAny = z.lazy(() => z.object({"billing_zip": z.string().nullable(), "charge": z.union([z.string(), charge]).nullable(), "closed_reason": z.enum(["acknowledged", "approved", "canceled", "disputed", "payment_never_settled", "redacted", "refunded", "refunded_as_fraud"]).nullable(), "created": z.number().int(), "id": z.string(), "ip_address": z.string().nullable(), "ip_address_location": radar_review_resource_location.nullable(), "livemode": z.boolean(), "object": z.literal("review"), "open": z.boolean(), "opened_reason": z.enum(["manual", "rule"]), "payment_intent": z.union([z.string(), payment_intent]).optional(), "reason": z.string(), "session": radar_review_resource_session.nullable()}).passthrough()); -const revolut_pay_underlying_payment_method_funding_details = z.lazy(() => z.object({"card": payment_method_details_passthrough_card.optional(), "type": z.literal("card").nullable()}).passthrough()); -const rule = z.lazy(() => z.object({"action": z.string(), "id": z.string(), "predicate": z.string()}).passthrough()); -const schedules_phase_automatic_tax: z.ZodTypeAny = z.lazy(() => z.object({"disabled_reason": z.literal("requires_location_inputs").nullable(), "enabled": z.boolean(), "liability": connect_account_reference.nullable()}).passthrough()); -const sepa_debit_generated_from: z.ZodTypeAny = z.lazy(() => z.object({"charge": z.union([z.string(), charge]).nullable(), "setup_attempt": z.union([z.string(), setup_attempt]).nullable()}).passthrough()); -const setup_attempt: z.ZodTypeAny = z.lazy(() => z.object({"application": z.union([z.string(), application]).nullable(), "attach_to_self": z.boolean().optional(), "created": z.number().int(), "customer": z.union([z.string(), customer, deleted_customer]).nullable(), "customer_account": z.string().nullable(), "flow_directions": z.array(z.enum(["inbound", "outbound"])).nullable(), "id": z.string(), "livemode": z.boolean(), "object": z.literal("setup_attempt"), "on_behalf_of": z.union([z.string(), account]).nullable(), "payment_method": z.union([z.string(), payment_method]), "payment_method_details": setup_attempt_payment_method_details, "setup_error": api_errors.nullable(), "setup_intent": z.union([z.string(), setup_intent]), "status": z.string(), "usage": z.string()}).passthrough()); -const setup_attempt_payment_method_details: z.ZodTypeAny = z.lazy(() => z.object({"acss_debit": setup_attempt_payment_method_details_acss_debit.optional(), "amazon_pay": setup_attempt_payment_method_details_amazon_pay.optional(), "au_becs_debit": setup_attempt_payment_method_details_au_becs_debit.optional(), "bacs_debit": setup_attempt_payment_method_details_bacs_debit.optional(), "bancontact": setup_attempt_payment_method_details_bancontact.optional(), "boleto": setup_attempt_payment_method_details_boleto.optional(), "card": setup_attempt_payment_method_details_card.optional(), "card_present": setup_attempt_payment_method_details_card_present.optional(), "cashapp": setup_attempt_payment_method_details_cashapp.optional(), "ideal": setup_attempt_payment_method_details_ideal.optional(), "kakao_pay": setup_attempt_payment_method_details_kakao_pay.optional(), "klarna": setup_attempt_payment_method_details_klarna.optional(), "kr_card": setup_attempt_payment_method_details_kr_card.optional(), "link": setup_attempt_payment_method_details_link.optional(), "naver_pay": setup_attempt_payment_method_details_naver_pay.optional(), "nz_bank_account": setup_attempt_payment_method_details_nz_bank_account.optional(), "paypal": setup_attempt_payment_method_details_paypal.optional(), "payto": setup_attempt_payment_method_details_payto.optional(), "pix": setup_attempt_payment_method_details_pix.optional(), "revolut_pay": setup_attempt_payment_method_details_revolut_pay.optional(), "satispay": payment_flows_private_payment_methods_satispay_setup_attempt_details.optional(), "sepa_debit": setup_attempt_payment_method_details_sepa_debit.optional(), "sofort": setup_attempt_payment_method_details_sofort.optional(), "twint": setup_attempt_payment_method_details_twint.optional(), "type": z.string(), "upi": setup_attempt_payment_method_details_upi.optional(), "us_bank_account": setup_attempt_payment_method_details_us_bank_account.optional()}).passthrough()); +const payments_primitives_payment_records_resource_payment_method_custom_details = z.lazy(() => z.object({"display_name": z.string(), "type": z.string().nullable()})); +const payments_primitives_payment_records_resource_payment_method_details: z.ZodTypeAny = z.lazy(() => z.object({"ach_credit_transfer": payment_method_details_ach_credit_transfer.optional(), "ach_debit": payment_method_details_ach_debit.optional(), "acss_debit": payment_method_details_payment_record_acss_debit.optional(), "affirm": payment_method_details_payment_record_affirm.optional(), "afterpay_clearpay": payment_method_details_payment_record_afterpay_clearpay.optional(), "alipay": payment_flows_private_payment_methods_alipay_details.optional(), "alma": payment_method_details_payment_record_alma.optional(), "amazon_pay": payment_method_details_payment_record_amazon_pay.optional(), "au_becs_debit": payment_method_details_au_becs_debit.optional(), "bacs_debit": payment_method_details_bacs_debit.optional(), "bancontact": payment_method_details_payment_record_bancontact.optional(), "billie": payment_method_details_payment_record_billie.optional(), "billing_details": payments_primitives_payment_records_resource_billing_details.nullable(), "bizum": payment_method_details_payment_record_bizum.optional(), "blik": payment_method_details_payment_record_blik.optional(), "boleto": payment_method_details_payment_record_boleto.optional(), "card": payments_primitives_payment_records_resource_payment_method_card_details.optional(), "card_present": payment_method_details_card_present.optional(), "cashapp": payment_method_details_payment_record_cashapp.optional(), "crypto": payment_method_details_crypto.optional(), "custom": payments_primitives_payment_records_resource_payment_method_custom_details.optional(), "customer_balance": payment_method_details_customer_balance.optional(), "eps": payment_method_details_payment_record_eps.optional(), "fpx": payment_method_details_fpx.optional(), "giropay": payment_method_details_payment_record_giropay.optional(), "grabpay": payment_method_details_grabpay.optional(), "ideal": payment_method_details_payment_record_ideal.optional(), "interac_present": payment_method_details_interac_present.optional(), "kakao_pay": payment_method_details_payment_record_kakao_pay.optional(), "klarna": payment_method_details_payment_record_klarna.optional(), "konbini": payment_method_details_payment_record_konbini.optional(), "kr_card": payment_method_details_kr_card.optional(), "link": payment_method_details_payment_record_link.optional(), "mb_way": payment_method_details_payment_record_mb_way.optional(), "mobilepay": payment_method_details_payment_record_mobilepay.optional(), "multibanco": payment_method_details_payment_record_multibanco.optional(), "naver_pay": payment_method_details_payment_record_naver_pay.optional(), "nz_bank_account": payment_method_details_nz_bank_account.optional(), "oxxo": payment_method_details_payment_record_oxxo.optional(), "p24": payment_method_details_payment_record_p24.optional(), "pay_by_bank": payment_method_details_payment_record_pay_by_bank.optional(), "payco": payment_method_details_payment_record_payco.optional(), "payment_method": z.string().nullable(), "paynow": payment_method_details_payment_record_paynow.optional(), "paypal": payment_method_details_paypal.optional(), "payto": payment_method_details_payment_record_payto.optional(), "pix": payment_method_details_payment_record_pix.optional(), "promptpay": payment_method_details_payment_record_promptpay.optional(), "revolut_pay": payment_method_details_payment_record_revolut_pay.optional(), "samsung_pay": payment_method_details_payment_record_samsung_pay.optional(), "satispay": payment_method_details_payment_record_satispay.optional(), "scalapay": payment_method_details_payment_record_scalapay.optional(), "sepa_credit_transfer": payment_method_details_sepa_credit_transfer.optional(), "sepa_debit": payment_method_details_payment_record_sepa_debit.optional(), "sofort": payment_method_details_payment_record_sofort.optional(), "stripe_account": payment_method_details_stripe_account.optional(), "sunbit": payment_method_details_payment_record_sunbit.optional(), "swish": payment_method_details_payment_record_swish.optional(), "twint": payment_method_details_payment_record_twint.optional(), "type": z.string(), "upi": payment_method_details_payment_record_upi.optional(), "us_bank_account": payment_method_details_payment_record_us_bank_account.optional(), "wechat": payment_method_details_wechat.optional(), "wechat_pay": payment_method_details_payment_record_wechat_pay.optional(), "zip": payment_method_details_payment_record_zip.optional()})); +const payments_primitives_payment_records_resource_payment_method_klarna_details_resource_payer_details = z.lazy(() => z.object({"address": payments_primitives_payment_records_resource_payment_method_klarna_details_resource_payer_details_resource_payer_details_address.nullable()})); +const payments_primitives_payment_records_resource_payment_method_klarna_details_resource_payer_details_resource_payer_details_address = z.lazy(() => z.object({"country": z.string().nullable()})); +const payments_primitives_payment_records_resource_payment_method_konbini_details_resource_store = z.lazy(() => z.object({"chain": z.enum(["familymart", "lawson", "ministop", "seicomart"]).nullable()})); +const payments_primitives_payment_records_resource_payment_method_mobilepay_details_resource_card = z.lazy(() => z.object({"brand": z.string().nullable(), "country": z.string().nullable(), "exp_month": z.number().int().nullable(), "exp_year": z.number().int().nullable(), "last4": z.string().nullable()})); +const payments_primitives_payment_records_resource_payment_method_revolut_pay_details_resource_funding = z.lazy(() => z.object({"card": payments_primitives_payment_records_resource_payment_method_revolut_pay_details_resource_funding_resource_funding_card.optional(), "type": z.literal("card").nullable()})); +const payments_primitives_payment_records_resource_payment_method_revolut_pay_details_resource_funding_resource_funding_card = z.lazy(() => z.object({"brand": z.string().nullable(), "country": z.string().nullable(), "exp_month": z.number().int().nullable(), "exp_year": z.number().int().nullable(), "funding": z.string().nullable(), "last4": z.string().nullable()})); +const payments_primitives_payment_records_resource_processor_details = z.lazy(() => z.object({"custom": payments_primitives_payment_records_resource_processor_details_resource_custom_details.optional(), "type": z.literal("custom")})); +const payments_primitives_payment_records_resource_processor_details_resource_custom_details = z.lazy(() => z.object({"payment_reference": z.string().nullable()})); +const payments_primitives_payment_records_resource_shipping_details = z.lazy(() => z.object({"address": payments_primitives_payment_records_resource_address, "name": z.string().nullable(), "phone": z.string().nullable()})); +const payout: z.ZodTypeAny = z.lazy(() => z.object({"amount": z.number().int(), "application_fee": z.union([z.string(), application_fee]).nullable(), "application_fee_amount": z.number().int().nullable(), "arrival_date": z.number().int(), "automatic": z.boolean(), "balance_transaction": z.union([z.string(), balance_transaction]).nullable(), "created": z.number().int(), "currency": z.string(), "description": z.string().nullable(), "destination": z.union([z.string(), external_account, deleted_external_account]).nullable(), "failure_balance_transaction": z.union([z.string(), balance_transaction]).nullable(), "failure_code": z.string().nullable(), "failure_message": z.string().nullable(), "id": z.string(), "livemode": z.boolean(), "metadata": z.record(z.string(), z.string()).nullable(), "method": z.string(), "object": z.literal("payout"), "original_payout": z.union([z.string(), payout]).nullable(), "payout_method": z.string().nullable(), "reconciliation_status": z.enum(["completed", "in_progress", "not_applicable"]), "reversed_by": z.union([z.string(), payout]).nullable(), "source_type": z.string(), "statement_descriptor": z.string().nullable(), "status": z.string(), "trace_id": payouts_trace_id.nullable(), "type": z.enum(["bank_account", "card"])})); +const payouts_trace_id = z.lazy(() => z.object({"status": z.string(), "value": z.string().nullable()})); +const paypal_seller_protection = z.lazy(() => z.object({"dispute_categories": z.array(z.enum(["fraudulent", "product_not_received"])).nullable(), "status": z.enum(["eligible", "not_eligible", "partially_eligible"])})); +const person = z.lazy(() => z.object({"account": z.string().optional(), "additional_tos_acceptances": person_additional_tos_acceptances.optional(), "address": address.optional(), "address_kana": legal_entity_japan_address.nullable().optional(), "address_kanji": legal_entity_japan_address.nullable().optional(), "created": z.number().int(), "dob": legal_entity_dob.optional(), "email": z.string().nullable().optional(), "first_name": z.string().nullable().optional(), "first_name_kana": z.string().nullable().optional(), "first_name_kanji": z.string().nullable().optional(), "full_name_aliases": z.array(z.string()).optional(), "future_requirements": person_future_requirements.nullable().optional(), "gender": z.string().nullable().optional(), "id": z.string(), "id_number_provided": z.boolean().optional(), "id_number_secondary_provided": z.boolean().optional(), "last_name": z.string().nullable().optional(), "last_name_kana": z.string().nullable().optional(), "last_name_kanji": z.string().nullable().optional(), "maiden_name": z.string().nullable().optional(), "metadata": z.record(z.string(), z.string()).optional(), "nationality": z.string().nullable().optional(), "object": z.literal("person"), "phone": z.string().nullable().optional(), "political_exposure": z.enum(["existing", "none"]).optional(), "registered_address": address.optional(), "relationship": person_relationship.optional(), "requirements": person_requirements.nullable().optional(), "ssn_last_4_provided": z.boolean().optional(), "us_cfpb_data": person_us_cfpb_data.nullable().optional(), "verification": legal_entity_person_verification.optional()})); +const person_additional_tos_acceptance = z.lazy(() => z.object({"date": z.number().int().nullable(), "ip": z.string().nullable(), "user_agent": z.string().nullable()})); +const person_additional_tos_acceptances = z.lazy(() => z.object({"account": person_additional_tos_acceptance.nullable()})); +const person_ethnicity_details = z.lazy(() => z.object({"ethnicity": z.array(z.enum(["cuban", "hispanic_or_latino", "mexican", "not_hispanic_or_latino", "other_hispanic_or_latino", "prefer_not_to_answer", "puerto_rican"])).nullable(), "ethnicity_other": z.string().nullable()})); +const person_future_requirements = z.lazy(() => z.object({"alternatives": z.array(account_requirements_alternative).nullable(), "currently_due": z.array(z.string()), "errors": z.array(account_requirements_error), "eventually_due": z.array(z.string()), "past_due": z.array(z.string()), "pending_verification": z.array(z.string())})); +const person_race_details = z.lazy(() => z.object({"race": z.array(z.enum(["african_american", "american_indian_or_alaska_native", "asian", "asian_indian", "black_or_african_american", "chinese", "ethiopian", "filipino", "guamanian_or_chamorro", "haitian", "jamaican", "japanese", "korean", "native_hawaiian", "native_hawaiian_or_other_pacific_islander", "nigerian", "other_asian", "other_black_or_african_american", "other_pacific_islander", "prefer_not_to_answer", "samoan", "somali", "vietnamese", "white"])).nullable(), "race_other": z.string().nullable()})); +const person_relationship = z.lazy(() => z.object({"authorizer": z.boolean().nullable(), "director": z.boolean().nullable(), "executive": z.boolean().nullable(), "legal_guardian": z.boolean().nullable(), "owner": z.boolean().nullable(), "percent_ownership": z.number().nullable(), "representative": z.boolean().nullable(), "title": z.string().nullable()})); +const person_requirements = z.lazy(() => z.object({"alternatives": z.array(account_requirements_alternative).nullable(), "currently_due": z.array(z.string()), "errors": z.array(account_requirements_error), "eventually_due": z.array(z.string()), "past_due": z.array(z.string()), "pending_verification": z.array(z.string())})); +const person_us_cfpb_data = z.lazy(() => z.object({"ethnicity_details": person_ethnicity_details.nullable(), "race_details": person_race_details.nullable(), "self_identified_gender": z.string().nullable()})); +const plan = z.lazy(() => z.object({"active": z.boolean(), "amount": z.number().int().nullable(), "amount_decimal": z.string().nullable(), "billing_scheme": z.enum(["per_unit", "tiered"]), "created": z.number().int(), "currency": z.string(), "id": z.string(), "interval": z.enum(["day", "month", "week", "year"]), "interval_count": z.number().int(), "livemode": z.boolean(), "metadata": z.record(z.string(), z.string()).nullable(), "meter": z.string().nullable(), "nickname": z.string().nullable(), "object": z.literal("plan"), "product": z.union([z.string(), product, deleted_product]).nullable(), "tiers": z.array(plan_tier).optional(), "tiers_mode": z.enum(["graduated", "volume"]).nullable(), "transform_usage": transform_usage.nullable(), "trial_period_days": z.number().int().nullable(), "usage_type": z.enum(["licensed", "metered"])})); +const plan_tier = z.lazy(() => z.object({"flat_amount": z.number().int().nullable(), "flat_amount_decimal": z.string().nullable(), "unit_amount": z.number().int().nullable(), "unit_amount_decimal": z.string().nullable(), "up_to": z.number().int().nullable()})); +const platform_earning_fee_source = z.lazy(() => z.object({"charge": z.string().optional(), "payout": z.string().optional(), "type": z.enum(["charge", "payout"])})); +const price: z.ZodTypeAny = z.lazy(() => z.object({"active": z.boolean(), "billing_scheme": z.enum(["per_unit", "tiered"]), "created": z.number().int(), "currency": z.string(), "currency_options": z.record(z.string(), currency_option).optional(), "custom_unit_amount": custom_unit_amount.nullable(), "id": z.string(), "livemode": z.boolean(), "lookup_key": z.string().nullable(), "metadata": z.record(z.string(), z.string()), "nickname": z.string().nullable(), "object": z.literal("price"), "product": z.union([z.string(), product, deleted_product]), "recurring": recurring.nullable(), "tax_behavior": z.enum(["exclusive", "inclusive", "unspecified"]).nullable(), "tiers": z.array(price_tier).optional(), "tiers_mode": z.enum(["graduated", "volume"]).nullable(), "transform_quantity": transform_quantity.nullable(), "type": z.enum(["one_time", "recurring"]), "unit_amount": z.number().int().nullable(), "unit_amount_decimal": z.string().nullable()})); +const price_tier = z.lazy(() => z.object({"flat_amount": z.number().int().nullable(), "flat_amount_decimal": z.string().nullable(), "unit_amount": z.number().int().nullable(), "unit_amount_decimal": z.string().nullable(), "up_to": z.number().int().nullable()})); +const product: z.ZodTypeAny = z.lazy(() => z.object({"active": z.boolean(), "created": z.number().int(), "default_price": z.union([z.string(), price]).nullable().optional(), "description": z.string().nullable(), "id": z.string(), "images": z.array(z.string()), "livemode": z.boolean(), "marketing_features": z.array(product_marketing_feature), "metadata": z.record(z.string(), z.string()), "name": z.string(), "object": z.literal("product"), "package_dimensions": package_dimensions.nullable(), "shippable": z.boolean().nullable(), "statement_descriptor": z.string().nullable().optional(), "tax_code": z.union([z.string(), tax_code]).nullable().optional(), "type": z.enum(["good", "service"]), "unit_label": z.string().nullable().optional(), "updated": z.number().int(), "url": z.string().nullable()})); +const product_marketing_feature = z.lazy(() => z.object({"name": z.string().optional()})); +const promotion_code: z.ZodTypeAny = z.lazy(() => z.object({"active": z.boolean(), "code": z.string(), "created": z.number().int(), "customer": z.union([z.string(), customer, deleted_customer]).nullable(), "customer_account": z.string().nullable(), "expires_at": z.number().int().nullable(), "id": z.string(), "livemode": z.boolean(), "max_redemptions": z.number().int().nullable(), "metadata": z.record(z.string(), z.string()).nullable(), "object": z.literal("promotion_code"), "promotion": promotion_codes_resource_promotion, "restrictions": promotion_codes_resource_restrictions, "times_redeemed": z.number().int()})); +const promotion_code_currency_option = z.lazy(() => z.object({"minimum_amount": z.number().int()})); +const promotion_codes_resource_promotion = z.lazy(() => z.object({"coupon": z.union([z.string(), coupon]).nullable(), "type": z.literal("coupon")})); +const promotion_codes_resource_restrictions = z.lazy(() => z.object({"currency_options": z.record(z.string(), promotion_code_currency_option).optional(), "first_time_transaction": z.boolean(), "minimum_amount": z.number().int().nullable(), "minimum_amount_currency": z.string().nullable()})); +const radar_radar_options = z.lazy(() => z.object({"session": z.string().optional()})); +const radar_review_resource_location = z.lazy(() => z.object({"city": z.string().nullable(), "country": z.string().nullable(), "latitude": z.number().nullable(), "longitude": z.number().nullable(), "region": z.string().nullable()})); +const radar_review_resource_session = z.lazy(() => z.object({"browser": z.string().nullable(), "device": z.string().nullable(), "platform": z.string().nullable(), "version": z.string().nullable()})); +const recurring = z.lazy(() => z.object({"interval": z.enum(["day", "month", "week", "year"]), "interval_count": z.number().int(), "meter": z.string().nullable(), "trial_period_days": z.number().int().nullable(), "usage_type": z.enum(["licensed", "metered"])})); +const refund: z.ZodTypeAny = z.lazy(() => z.object({"amount": z.number().int(), "balance_transaction": z.union([z.string(), balance_transaction]).nullable(), "charge": z.union([z.string(), charge]).nullable(), "created": z.number().int(), "currency": z.string(), "description": z.string().optional(), "destination_details": refund_destination_details.optional(), "failure_balance_transaction": z.union([z.string(), balance_transaction]).optional(), "failure_reason": z.string().optional(), "id": z.string(), "instructions_email": z.string().optional(), "metadata": z.record(z.string(), z.string()).nullable(), "next_action": refund_next_action.optional(), "object": z.literal("refund"), "payment_intent": z.union([z.string(), payment_intent]).nullable(), "pending_reason": z.enum(["charge_pending", "insufficient_funds", "processing"]).optional(), "presentment_details": payment_flows_payment_intent_presentment_details.optional(), "reason": z.enum(["duplicate", "expired_uncaptured_charge", "fraudulent", "requested_by_customer"]).nullable(), "receipt_number": z.string().nullable(), "source_transfer_reversal": z.union([z.string(), transfer_reversal]).nullable(), "status": z.string().nullable(), "transfer_reversal": z.union([z.string(), transfer_reversal]).nullable()})); +const refund_destination_details = z.lazy(() => z.object({"affirm": destination_details_unimplemented.optional(), "afterpay_clearpay": destination_details_unimplemented.optional(), "alipay": destination_details_unimplemented.optional(), "alma": destination_details_unimplemented.optional(), "amazon_pay": destination_details_unimplemented.optional(), "au_bank_transfer": destination_details_unimplemented.optional(), "blik": refund_destination_details_blik.optional(), "br_bank_transfer": refund_destination_details_br_bank_transfer.optional(), "card": refund_destination_details_card.optional(), "cashapp": destination_details_unimplemented.optional(), "crypto": refund_destination_details_crypto.optional(), "customer_cash_balance": destination_details_unimplemented.optional(), "eps": destination_details_unimplemented.optional(), "eu_bank_transfer": refund_destination_details_eu_bank_transfer.optional(), "gb_bank_transfer": refund_destination_details_gb_bank_transfer.optional(), "giropay": destination_details_unimplemented.optional(), "grabpay": destination_details_unimplemented.optional(), "jp_bank_transfer": refund_destination_details_jp_bank_transfer.optional(), "klarna": destination_details_unimplemented.optional(), "mb_way": refund_destination_details_mb_way.optional(), "multibanco": refund_destination_details_multibanco.optional(), "mx_bank_transfer": refund_destination_details_mx_bank_transfer.optional(), "nz_bank_transfer": destination_details_unimplemented.optional(), "p24": refund_destination_details_p24.optional(), "paynow": destination_details_unimplemented.optional(), "paypal": refund_destination_details_paypal.optional(), "pix": destination_details_unimplemented.optional(), "revolut": destination_details_unimplemented.optional(), "scalapay": destination_details_unimplemented.optional(), "sofort": destination_details_unimplemented.optional(), "swish": refund_destination_details_swish.optional(), "th_bank_transfer": refund_destination_details_th_bank_transfer.optional(), "twint": destination_details_unimplemented.optional(), "type": z.string(), "us_bank_transfer": refund_destination_details_us_bank_transfer.optional(), "wechat_pay": destination_details_unimplemented.optional(), "zip": destination_details_unimplemented.optional()})); +const refund_destination_details_blik = z.lazy(() => z.object({"network_decline_code": z.string().nullable(), "reference": z.string().nullable(), "reference_status": z.string().nullable()})); +const refund_destination_details_br_bank_transfer = z.lazy(() => z.object({"reference": z.string().nullable(), "reference_status": z.string().nullable()})); +const refund_destination_details_card = z.lazy(() => z.object({"reference": z.string().optional(), "reference_status": z.string().optional(), "reference_type": z.string().optional(), "type": z.enum(["pending", "refund", "reversal"])})); +const refund_destination_details_crypto = z.lazy(() => z.object({"reference": z.string().nullable()})); +const refund_destination_details_eu_bank_transfer = z.lazy(() => z.object({"reference": z.string().nullable(), "reference_status": z.string().nullable()})); +const refund_destination_details_gb_bank_transfer = z.lazy(() => z.object({"reference": z.string().nullable(), "reference_status": z.string().nullable()})); +const refund_destination_details_jp_bank_transfer = z.lazy(() => z.object({"reference": z.string().nullable(), "reference_status": z.string().nullable()})); +const refund_destination_details_mb_way = z.lazy(() => z.object({"reference": z.string().nullable(), "reference_status": z.string().nullable()})); +const refund_destination_details_multibanco = z.lazy(() => z.object({"reference": z.string().nullable(), "reference_status": z.string().nullable()})); +const refund_destination_details_mx_bank_transfer = z.lazy(() => z.object({"reference": z.string().nullable(), "reference_status": z.string().nullable()})); +const refund_destination_details_p24 = z.lazy(() => z.object({"reference": z.string().nullable(), "reference_status": z.string().nullable()})); +const refund_destination_details_paypal = z.lazy(() => z.object({"network_decline_code": z.string().nullable()})); +const refund_destination_details_swish = z.lazy(() => z.object({"network_decline_code": z.string().nullable(), "reference": z.string().nullable(), "reference_status": z.string().nullable()})); +const refund_destination_details_th_bank_transfer = z.lazy(() => z.object({"reference": z.string().nullable(), "reference_status": z.string().nullable()})); +const refund_destination_details_us_bank_transfer = z.lazy(() => z.object({"reference": z.string().nullable(), "reference_status": z.string().nullable()})); +const refund_next_action = z.lazy(() => z.object({"display_details": refund_next_action_display_details.optional(), "type": z.string()})); +const refund_next_action_display_details = z.lazy(() => z.object({"email_sent": email_sent, "expires_at": z.number().int()})); +const reserve_transaction = z.lazy(() => z.object({"amount": z.number().int(), "currency": z.string(), "description": z.string().nullable(), "id": z.string(), "object": z.literal("reserve_transaction")})); +const review: z.ZodTypeAny = z.lazy(() => z.object({"billing_zip": z.string().nullable(), "charge": z.union([z.string(), charge]).nullable(), "closed_reason": z.enum(["acknowledged", "approved", "canceled", "disputed", "payment_never_settled", "redacted", "refunded", "refunded_as_fraud"]).nullable(), "created": z.number().int(), "id": z.string(), "ip_address": z.string().nullable(), "ip_address_location": radar_review_resource_location.nullable(), "livemode": z.boolean(), "object": z.literal("review"), "open": z.boolean(), "opened_reason": z.enum(["manual", "rule"]), "payment_intent": z.union([z.string(), payment_intent]).optional(), "reason": z.string(), "session": radar_review_resource_session.nullable()})); +const revolut_pay_underlying_payment_method_funding_details = z.lazy(() => z.object({"card": payment_method_details_passthrough_card.optional(), "type": z.literal("card").nullable()})); +const rule = z.lazy(() => z.object({"action": z.string(), "id": z.string(), "predicate": z.string()})); +const schedules_phase_automatic_tax: z.ZodTypeAny = z.lazy(() => z.object({"disabled_reason": z.literal("requires_location_inputs").nullable(), "enabled": z.boolean(), "liability": connect_account_reference.nullable()})); +const sepa_debit_generated_from: z.ZodTypeAny = z.lazy(() => z.object({"charge": z.union([z.string(), charge]).nullable(), "setup_attempt": z.union([z.string(), setup_attempt]).nullable()})); +const setup_attempt: z.ZodTypeAny = z.lazy(() => z.object({"application": z.union([z.string(), application]).nullable(), "attach_to_self": z.boolean().optional(), "created": z.number().int(), "customer": z.union([z.string(), customer, deleted_customer]).nullable(), "customer_account": z.string().nullable(), "flow_directions": z.array(z.enum(["inbound", "outbound"])).nullable(), "id": z.string(), "livemode": z.boolean(), "object": z.literal("setup_attempt"), "on_behalf_of": z.union([z.string(), account]).nullable(), "payment_method": z.union([z.string(), payment_method]), "payment_method_details": setup_attempt_payment_method_details, "setup_error": api_errors.nullable(), "setup_intent": z.union([z.string(), setup_intent]), "status": z.string(), "usage": z.string()})); +const setup_attempt_payment_method_details: z.ZodTypeAny = z.lazy(() => z.object({"acss_debit": setup_attempt_payment_method_details_acss_debit.optional(), "amazon_pay": setup_attempt_payment_method_details_amazon_pay.optional(), "au_becs_debit": setup_attempt_payment_method_details_au_becs_debit.optional(), "bacs_debit": setup_attempt_payment_method_details_bacs_debit.optional(), "bancontact": setup_attempt_payment_method_details_bancontact.optional(), "boleto": setup_attempt_payment_method_details_boleto.optional(), "card": setup_attempt_payment_method_details_card.optional(), "card_present": setup_attempt_payment_method_details_card_present.optional(), "cashapp": setup_attempt_payment_method_details_cashapp.optional(), "ideal": setup_attempt_payment_method_details_ideal.optional(), "kakao_pay": setup_attempt_payment_method_details_kakao_pay.optional(), "klarna": setup_attempt_payment_method_details_klarna.optional(), "kr_card": setup_attempt_payment_method_details_kr_card.optional(), "link": setup_attempt_payment_method_details_link.optional(), "naver_pay": setup_attempt_payment_method_details_naver_pay.optional(), "nz_bank_account": setup_attempt_payment_method_details_nz_bank_account.optional(), "paypal": setup_attempt_payment_method_details_paypal.optional(), "payto": setup_attempt_payment_method_details_payto.optional(), "pix": setup_attempt_payment_method_details_pix.optional(), "revolut_pay": setup_attempt_payment_method_details_revolut_pay.optional(), "satispay": payment_flows_private_payment_methods_satispay_setup_attempt_details.optional(), "sepa_debit": setup_attempt_payment_method_details_sepa_debit.optional(), "sofort": setup_attempt_payment_method_details_sofort.optional(), "twint": setup_attempt_payment_method_details_twint.optional(), "type": z.string(), "upi": setup_attempt_payment_method_details_upi.optional(), "us_bank_account": setup_attempt_payment_method_details_us_bank_account.optional()})); const setup_attempt_payment_method_details_acss_debit = z.lazy(() => z.record(z.string(), z.any())); const setup_attempt_payment_method_details_amazon_pay = z.lazy(() => z.record(z.string(), z.any())); const setup_attempt_payment_method_details_au_becs_debit = z.lazy(() => z.record(z.string(), z.any())); const setup_attempt_payment_method_details_bacs_debit = z.lazy(() => z.record(z.string(), z.any())); -const setup_attempt_payment_method_details_bancontact: z.ZodTypeAny = z.lazy(() => z.object({"bank_code": z.string().nullable(), "bank_name": z.string().nullable(), "bic": z.string().nullable(), "generated_sepa_debit": z.union([z.string(), payment_method]).nullable(), "generated_sepa_debit_mandate": z.union([z.string(), mandate]).nullable(), "iban_last4": z.string().nullable(), "preferred_language": z.enum(["de", "en", "fr", "nl"]).nullable(), "verified_name": z.string().nullable()}).passthrough()); +const setup_attempt_payment_method_details_bancontact: z.ZodTypeAny = z.lazy(() => z.object({"bank_code": z.string().nullable(), "bank_name": z.string().nullable(), "bic": z.string().nullable(), "generated_sepa_debit": z.union([z.string(), payment_method]).nullable(), "generated_sepa_debit_mandate": z.union([z.string(), mandate]).nullable(), "iban_last4": z.string().nullable(), "preferred_language": z.enum(["de", "en", "fr", "nl"]).nullable(), "verified_name": z.string().nullable()})); const setup_attempt_payment_method_details_boleto = z.lazy(() => z.record(z.string(), z.any())); -const setup_attempt_payment_method_details_card = z.lazy(() => z.object({"brand": z.string().nullable(), "checks": setup_attempt_payment_method_details_card_checks.nullable(), "country": z.string().nullable(), "description": z.string().nullable().optional(), "exp_month": z.number().int().nullable(), "exp_year": z.number().int().nullable(), "fingerprint": z.string().nullable().optional(), "funding": z.string().nullable(), "iin": z.string().nullable().optional(), "issuer": z.string().nullable().optional(), "last4": z.string().nullable(), "moto": z.boolean().optional(), "network": z.string().nullable(), "three_d_secure": three_d_secure_details.nullable(), "wallet": setup_attempt_payment_method_details_card_wallet.nullable()}).passthrough()); -const setup_attempt_payment_method_details_card_checks = z.lazy(() => z.object({"address_line1_check": z.string().nullable(), "address_postal_code_check": z.string().nullable(), "cvc_check": z.string().nullable()}).passthrough()); -const setup_attempt_payment_method_details_card_present: z.ZodTypeAny = z.lazy(() => z.object({"generated_card": z.union([z.string(), payment_method]).nullable(), "offline": payment_method_details_card_present_offline.nullable()}).passthrough()); -const setup_attempt_payment_method_details_card_wallet = z.lazy(() => z.object({"apple_pay": payment_method_details_card_wallet_apple_pay.optional(), "google_pay": payment_method_details_card_wallet_google_pay.optional(), "type": z.enum(["apple_pay", "google_pay", "link"])}).passthrough()); +const setup_attempt_payment_method_details_card = z.lazy(() => z.object({"brand": z.string().nullable(), "checks": setup_attempt_payment_method_details_card_checks.nullable(), "country": z.string().nullable(), "description": z.string().nullable().optional(), "exp_month": z.number().int().nullable(), "exp_year": z.number().int().nullable(), "fingerprint": z.string().nullable().optional(), "funding": z.string().nullable(), "iin": z.string().nullable().optional(), "issuer": z.string().nullable().optional(), "last4": z.string().nullable(), "moto": z.boolean().optional(), "network": z.string().nullable(), "three_d_secure": three_d_secure_details.nullable(), "wallet": setup_attempt_payment_method_details_card_wallet.nullable()})); +const setup_attempt_payment_method_details_card_checks = z.lazy(() => z.object({"address_line1_check": z.string().nullable(), "address_postal_code_check": z.string().nullable(), "cvc_check": z.string().nullable()})); +const setup_attempt_payment_method_details_card_present: z.ZodTypeAny = z.lazy(() => z.object({"generated_card": z.union([z.string(), payment_method]).nullable(), "offline": payment_method_details_card_present_offline.nullable()})); +const setup_attempt_payment_method_details_card_wallet = z.lazy(() => z.object({"apple_pay": payment_method_details_card_wallet_apple_pay.optional(), "google_pay": payment_method_details_card_wallet_google_pay.optional(), "type": z.enum(["apple_pay", "google_pay", "link"])})); const setup_attempt_payment_method_details_cashapp = z.lazy(() => z.record(z.string(), z.any())); -const setup_attempt_payment_method_details_ideal: z.ZodTypeAny = z.lazy(() => z.object({"bank": z.enum(["abn_amro", "adyen", "asn_bank", "bunq", "buut", "finom", "handelsbanken", "ing", "knab", "mollie", "moneyou", "n26", "nn", "rabobank", "regiobank", "revolut", "sns_bank", "triodos_bank", "van_lanschot", "yoursafe"]).nullable(), "bic": z.enum(["ABNANL2A", "ADYBNL2A", "ASNBNL21", "BITSNL2A", "BUNQNL2A", "BUUTNL2A", "FNOMNL22", "FVLBNL22", "HANDNL2A", "INGBNL2A", "KNABNL2H", "MLLENL2A", "MOYONL21", "NNBANL2G", "NTSBDEB1", "RABONL2U", "RBRBNL21", "REVOIE23", "REVOLT21", "SNSBNL2A", "TRIONL2U"]).nullable(), "generated_sepa_debit": z.union([z.string(), payment_method]).nullable(), "generated_sepa_debit_mandate": z.union([z.string(), mandate]).nullable(), "iban_last4": z.string().nullable(), "verified_name": z.string().nullable()}).passthrough()); +const setup_attempt_payment_method_details_ideal: z.ZodTypeAny = z.lazy(() => z.object({"bank": z.enum(["abn_amro", "adyen", "asn_bank", "bunq", "buut", "finom", "handelsbanken", "ing", "knab", "mollie", "moneyou", "n26", "nn", "rabobank", "regiobank", "revolut", "sns_bank", "triodos_bank", "van_lanschot", "yoursafe"]).nullable(), "bic": z.enum(["ABNANL2A", "ADYBNL2A", "ASNBNL21", "BITSNL2A", "BUNQNL2A", "BUUTNL2A", "FNOMNL22", "FVLBNL22", "HANDNL2A", "INGBNL2A", "KNABNL2H", "MLLENL2A", "MOYONL21", "NNBANL2G", "NTSBDEB1", "RABONL2U", "RBRBNL21", "REVOIE23", "REVOLT21", "SNSBNL2A", "TRIONL2U"]).nullable(), "generated_sepa_debit": z.union([z.string(), payment_method]).nullable(), "generated_sepa_debit_mandate": z.union([z.string(), mandate]).nullable(), "iban_last4": z.string().nullable(), "verified_name": z.string().nullable()})); const setup_attempt_payment_method_details_kakao_pay = z.lazy(() => z.record(z.string(), z.any())); const setup_attempt_payment_method_details_klarna = z.lazy(() => z.record(z.string(), z.any())); const setup_attempt_payment_method_details_kr_card = z.lazy(() => z.record(z.string(), z.any())); const setup_attempt_payment_method_details_link = z.lazy(() => z.record(z.string(), z.any())); -const setup_attempt_payment_method_details_naver_pay = z.lazy(() => z.object({"buyer_id": z.string().optional()}).passthrough()); +const setup_attempt_payment_method_details_naver_pay = z.lazy(() => z.object({"buyer_id": z.string().optional()})); const setup_attempt_payment_method_details_nz_bank_account = z.lazy(() => z.record(z.string(), z.any())); const setup_attempt_payment_method_details_paypal = z.lazy(() => z.record(z.string(), z.any())); const setup_attempt_payment_method_details_payto = z.lazy(() => z.record(z.string(), z.any())); -const setup_attempt_payment_method_details_pix = z.lazy(() => z.object({"fingerprint": z.string().nullable().optional()}).passthrough()); +const setup_attempt_payment_method_details_pix = z.lazy(() => z.object({"fingerprint": z.string().nullable().optional()})); const setup_attempt_payment_method_details_revolut_pay = z.lazy(() => z.record(z.string(), z.any())); const setup_attempt_payment_method_details_sepa_debit = z.lazy(() => z.record(z.string(), z.any())); -const setup_attempt_payment_method_details_sofort: z.ZodTypeAny = z.lazy(() => z.object({"bank_code": z.string().nullable(), "bank_name": z.string().nullable(), "bic": z.string().nullable(), "generated_sepa_debit": z.union([z.string(), payment_method]).nullable(), "generated_sepa_debit_mandate": z.union([z.string(), mandate]).nullable(), "iban_last4": z.string().nullable(), "preferred_language": z.enum(["de", "en", "fr", "nl"]).nullable(), "verified_name": z.string().nullable()}).passthrough()); +const setup_attempt_payment_method_details_sofort: z.ZodTypeAny = z.lazy(() => z.object({"bank_code": z.string().nullable(), "bank_name": z.string().nullable(), "bic": z.string().nullable(), "generated_sepa_debit": z.union([z.string(), payment_method]).nullable(), "generated_sepa_debit_mandate": z.union([z.string(), mandate]).nullable(), "iban_last4": z.string().nullable(), "preferred_language": z.enum(["de", "en", "fr", "nl"]).nullable(), "verified_name": z.string().nullable()})); const setup_attempt_payment_method_details_twint = z.lazy(() => z.record(z.string(), z.any())); const setup_attempt_payment_method_details_upi = z.lazy(() => z.record(z.string(), z.any())); const setup_attempt_payment_method_details_us_bank_account = z.lazy(() => z.record(z.string(), z.any())); -const setup_intent: z.ZodTypeAny = z.lazy(() => z.object({"application": z.union([z.string(), application]).nullable(), "attach_to_self": z.boolean().optional(), "automatic_payment_methods": payment_flows_automatic_payment_methods_setup_intent.nullable(), "cancellation_reason": z.enum(["abandoned", "duplicate", "requested_by_customer"]).nullable(), "client_secret": z.string().nullable(), "created": z.number().int(), "customer": z.union([z.string(), customer, deleted_customer]).nullable(), "customer_account": z.string().nullable().optional(), "description": z.string().nullable(), "excluded_payment_method_types": z.array(z.enum(["acss_debit", "affirm", "afterpay_clearpay", "alipay", "alma", "amazon_pay", "au_becs_debit", "bacs_debit", "bancontact", "billie", "bizum", "blik", "boleto", "card", "cashapp", "crypto", "customer_balance", "eps", "fpx", "giropay", "grabpay", "ideal", "kakao_pay", "klarna", "konbini", "kr_card", "mb_way", "mobilepay", "multibanco", "naver_pay", "nz_bank_account", "oxxo", "p24", "pay_by_bank", "payco", "paynow", "paypal", "payto", "pix", "promptpay", "revolut_pay", "samsung_pay", "satispay", "scalapay", "sepa_debit", "sofort", "sunbit", "swish", "twint", "upi", "us_bank_account", "wechat_pay", "zip"])).nullable(), "flow_directions": z.array(z.enum(["inbound", "outbound"])).nullable().optional(), "id": z.string(), "last_setup_error": api_errors.nullable(), "latest_attempt": z.union([z.string(), setup_attempt]).nullable(), "livemode": z.boolean(), "managed_payments": smor_resource_managed_payments.nullable().optional(), "mandate": z.union([z.string(), mandate]).nullable(), "metadata": z.record(z.string(), z.string()).nullable(), "next_action": setup_intent_next_action.nullable(), "object": z.literal("setup_intent"), "on_behalf_of": z.union([z.string(), account]).nullable(), "payment_method": z.union([z.string(), payment_method]).nullable(), "payment_method_configuration_details": payment_method_config_biz_payment_method_configuration_details.nullable(), "payment_method_options": setup_intent_payment_method_options.nullable(), "payment_method_types": z.array(z.string()), "single_use_mandate": z.union([z.string(), mandate]).nullable(), "status": z.enum(["canceled", "processing", "requires_action", "requires_confirmation", "requires_payment_method", "succeeded"]), "usage": z.string()}).passthrough()); -const setup_intent_next_action = z.lazy(() => z.object({"blik_authorize": payment_intent_next_action_blik_authorize.optional(), "cashapp_handle_redirect_or_display_qr_code": payment_intent_next_action_cashapp_handle_redirect_or_display_qr_code.optional(), "pix_display_qr_code": setup_intent_next_action_pix_display_qr_code.optional(), "redirect_to_url": setup_intent_next_action_redirect_to_url.optional(), "type": z.string(), "upi_handle_redirect_or_display_qr_code": payment_intent_next_action_upi_handle_redirect_or_display_qr_code.optional(), "use_stripe_sdk": z.record(z.string(), z.any()).optional(), "verify_with_microdeposits": setup_intent_next_action_verify_with_microdeposits.optional()}).passthrough()); -const setup_intent_next_action_pix_display_qr_code = z.lazy(() => z.object({"data": z.string(), "expires_at": z.number().int(), "hosted_instructions_url": z.string(), "image_url_png": z.string(), "image_url_svg": z.string()}).passthrough()); -const setup_intent_next_action_redirect_to_url = z.lazy(() => z.object({"return_url": z.string().nullable(), "url": z.string().nullable()}).passthrough()); -const setup_intent_next_action_verify_with_microdeposits = z.lazy(() => z.object({"arrival_date": z.number().int(), "hosted_verification_url": z.string(), "microdeposit_type": z.enum(["amounts", "descriptor_code"]).nullable()}).passthrough()); -const setup_intent_payment_method_options = z.lazy(() => z.object({"acss_debit": setup_intent_payment_method_options_acss_debit.optional(), "amazon_pay": setup_intent_payment_method_options_amazon_pay.optional(), "bacs_debit": setup_intent_payment_method_options_bacs_debit.optional(), "bizum": setup_intent_payment_method_options_bizum.optional(), "card": setup_intent_payment_method_options_card.optional(), "card_present": setup_intent_payment_method_options_card_present.optional(), "klarna": setup_intent_payment_method_options_klarna.optional(), "link": setup_intent_payment_method_options_link.optional(), "paypal": setup_intent_payment_method_options_paypal.optional(), "payto": setup_intent_payment_method_options_payto.optional(), "pix": setup_intent_payment_method_options_pix.optional(), "sepa_debit": setup_intent_payment_method_options_sepa_debit.optional(), "upi": setup_intent_payment_method_options_upi.optional(), "us_bank_account": setup_intent_payment_method_options_us_bank_account.optional()}).passthrough()); -const setup_intent_payment_method_options_acss_debit = z.lazy(() => z.object({"currency": z.enum(["cad", "usd"]).nullable(), "mandate_options": setup_intent_payment_method_options_mandate_options_acss_debit.optional(), "verification_method": z.enum(["automatic", "instant", "microdeposits"]).optional()}).passthrough()); +const setup_intent: z.ZodTypeAny = z.lazy(() => z.object({"application": z.union([z.string(), application]).nullable(), "attach_to_self": z.boolean().optional(), "automatic_payment_methods": payment_flows_automatic_payment_methods_setup_intent.nullable(), "cancellation_reason": z.enum(["abandoned", "duplicate", "requested_by_customer"]).nullable(), "client_secret": z.string().nullable(), "created": z.number().int(), "customer": z.union([z.string(), customer, deleted_customer]).nullable(), "customer_account": z.string().nullable().optional(), "description": z.string().nullable(), "excluded_payment_method_types": z.array(z.enum(["acss_debit", "affirm", "afterpay_clearpay", "alipay", "alma", "amazon_pay", "au_becs_debit", "bacs_debit", "bancontact", "billie", "bizum", "blik", "boleto", "card", "cashapp", "crypto", "customer_balance", "eps", "fpx", "giropay", "grabpay", "ideal", "kakao_pay", "klarna", "konbini", "kr_card", "mb_way", "mobilepay", "multibanco", "naver_pay", "nz_bank_account", "oxxo", "p24", "pay_by_bank", "payco", "paynow", "paypal", "payto", "pix", "promptpay", "revolut_pay", "samsung_pay", "satispay", "scalapay", "sepa_debit", "sofort", "sunbit", "swish", "twint", "upi", "us_bank_account", "wechat_pay", "zip"])).nullable(), "flow_directions": z.array(z.enum(["inbound", "outbound"])).nullable().optional(), "id": z.string(), "last_setup_error": api_errors.nullable(), "latest_attempt": z.union([z.string(), setup_attempt]).nullable(), "livemode": z.boolean(), "managed_payments": smor_resource_managed_payments.nullable().optional(), "mandate": z.union([z.string(), mandate]).nullable(), "metadata": z.record(z.string(), z.string()).nullable(), "next_action": setup_intent_next_action.nullable(), "object": z.literal("setup_intent"), "on_behalf_of": z.union([z.string(), account]).nullable(), "payment_method": z.union([z.string(), payment_method]).nullable(), "payment_method_configuration_details": payment_method_config_biz_payment_method_configuration_details.nullable(), "payment_method_options": setup_intent_payment_method_options.nullable(), "payment_method_types": z.array(z.string()), "single_use_mandate": z.union([z.string(), mandate]).nullable(), "status": z.enum(["canceled", "processing", "requires_action", "requires_confirmation", "requires_payment_method", "succeeded"]), "usage": z.string()})); +const setup_intent_next_action = z.lazy(() => z.object({"blik_authorize": payment_intent_next_action_blik_authorize.optional(), "cashapp_handle_redirect_or_display_qr_code": payment_intent_next_action_cashapp_handle_redirect_or_display_qr_code.optional(), "pix_display_qr_code": setup_intent_next_action_pix_display_qr_code.optional(), "redirect_to_url": setup_intent_next_action_redirect_to_url.optional(), "type": z.string(), "upi_handle_redirect_or_display_qr_code": payment_intent_next_action_upi_handle_redirect_or_display_qr_code.optional(), "use_stripe_sdk": z.record(z.string(), z.any()).optional(), "verify_with_microdeposits": setup_intent_next_action_verify_with_microdeposits.optional()})); +const setup_intent_next_action_pix_display_qr_code = z.lazy(() => z.object({"data": z.string(), "expires_at": z.number().int(), "hosted_instructions_url": z.string(), "image_url_png": z.string(), "image_url_svg": z.string()})); +const setup_intent_next_action_redirect_to_url = z.lazy(() => z.object({"return_url": z.string().nullable(), "url": z.string().nullable()})); +const setup_intent_next_action_verify_with_microdeposits = z.lazy(() => z.object({"arrival_date": z.number().int(), "hosted_verification_url": z.string(), "microdeposit_type": z.enum(["amounts", "descriptor_code"]).nullable()})); +const setup_intent_payment_method_options = z.lazy(() => z.object({"acss_debit": setup_intent_payment_method_options_acss_debit.optional(), "amazon_pay": setup_intent_payment_method_options_amazon_pay.optional(), "bacs_debit": setup_intent_payment_method_options_bacs_debit.optional(), "bizum": setup_intent_payment_method_options_bizum.optional(), "card": setup_intent_payment_method_options_card.optional(), "card_present": setup_intent_payment_method_options_card_present.optional(), "klarna": setup_intent_payment_method_options_klarna.optional(), "link": setup_intent_payment_method_options_link.optional(), "paypal": setup_intent_payment_method_options_paypal.optional(), "payto": setup_intent_payment_method_options_payto.optional(), "pix": setup_intent_payment_method_options_pix.optional(), "sepa_debit": setup_intent_payment_method_options_sepa_debit.optional(), "upi": setup_intent_payment_method_options_upi.optional(), "us_bank_account": setup_intent_payment_method_options_us_bank_account.optional()})); +const setup_intent_payment_method_options_acss_debit = z.lazy(() => z.object({"currency": z.enum(["cad", "usd"]).nullable(), "mandate_options": setup_intent_payment_method_options_mandate_options_acss_debit.optional(), "verification_method": z.enum(["automatic", "instant", "microdeposits"]).optional()})); const setup_intent_payment_method_options_amazon_pay = z.lazy(() => z.record(z.string(), z.any())); -const setup_intent_payment_method_options_bacs_debit = z.lazy(() => z.object({"mandate_options": setup_intent_payment_method_options_mandate_options_bacs_debit.optional()}).passthrough()); +const setup_intent_payment_method_options_bacs_debit = z.lazy(() => z.object({"mandate_options": setup_intent_payment_method_options_mandate_options_bacs_debit.optional()})); const setup_intent_payment_method_options_bizum = z.lazy(() => z.record(z.string(), z.any())); -const setup_intent_payment_method_options_card = z.lazy(() => z.object({"mandate_options": setup_intent_payment_method_options_card_mandate_options.nullable(), "network": z.enum(["amex", "cartes_bancaires", "diners", "discover", "eftpos_au", "girocard", "interac", "jcb", "link", "mastercard", "unionpay", "unknown", "visa"]).nullable(), "request_three_d_secure": z.enum(["any", "automatic", "challenge"]).nullable()}).passthrough()); -const setup_intent_payment_method_options_card_mandate_options = z.lazy(() => z.object({"amount": z.number().int(), "amount_type": z.enum(["fixed", "maximum"]), "currency": z.string(), "description": z.string().nullable(), "end_date": z.number().int().nullable(), "interval": z.enum(["day", "month", "sporadic", "week", "year"]), "interval_count": z.number().int().nullable(), "reference": z.string(), "start_date": z.number().int(), "supported_types": z.array(z.literal("india")).nullable()}).passthrough()); +const setup_intent_payment_method_options_card = z.lazy(() => z.object({"mandate_options": setup_intent_payment_method_options_card_mandate_options.nullable(), "network": z.enum(["amex", "cartes_bancaires", "diners", "discover", "eftpos_au", "girocard", "interac", "jcb", "link", "mastercard", "unionpay", "unknown", "visa"]).nullable(), "request_three_d_secure": z.enum(["any", "automatic", "challenge"]).nullable()})); +const setup_intent_payment_method_options_card_mandate_options = z.lazy(() => z.object({"amount": z.number().int(), "amount_type": z.enum(["fixed", "maximum"]), "currency": z.string(), "description": z.string().nullable(), "end_date": z.number().int().nullable(), "interval": z.enum(["day", "month", "sporadic", "week", "year"]), "interval_count": z.number().int().nullable(), "reference": z.string(), "start_date": z.number().int(), "supported_types": z.array(z.literal("india")).nullable()})); const setup_intent_payment_method_options_card_present = z.lazy(() => z.record(z.string(), z.any())); -const setup_intent_payment_method_options_klarna = z.lazy(() => z.object({"currency": z.string().nullable(), "preferred_locale": z.string().nullable()}).passthrough()); -const setup_intent_payment_method_options_link = z.lazy(() => z.object({"persistent_token": z.string().nullable()}).passthrough()); -const setup_intent_payment_method_options_mandate_options_acss_debit = z.lazy(() => z.object({"custom_mandate_url": z.string().optional(), "default_for": z.array(z.enum(["invoice", "subscription"])).optional(), "interval_description": z.string().nullable(), "payment_schedule": z.enum(["combined", "interval", "sporadic"]).nullable(), "transaction_type": z.enum(["business", "personal"]).nullable()}).passthrough()); -const setup_intent_payment_method_options_mandate_options_bacs_debit = z.lazy(() => z.object({"reference_prefix": z.string().optional()}).passthrough()); -const setup_intent_payment_method_options_mandate_options_payto = z.lazy(() => z.object({"amount": z.number().int().nullable(), "amount_type": z.enum(["fixed", "maximum"]).nullable(), "end_date": z.string().nullable(), "payment_schedule": z.enum(["adhoc", "annual", "daily", "fortnightly", "monthly", "quarterly", "semi_annual", "weekly"]).nullable(), "payments_per_period": z.number().int().nullable(), "purpose": z.enum(["dependant_support", "government", "loan", "mortgage", "other", "pension", "personal", "retail", "salary", "tax", "utility"]).nullable(), "start_date": z.string().nullable()}).passthrough()); -const setup_intent_payment_method_options_mandate_options_sepa_debit = z.lazy(() => z.object({"reference_prefix": z.string().optional()}).passthrough()); -const setup_intent_payment_method_options_paypal = z.lazy(() => z.object({"billing_agreement_id": z.string().nullable()}).passthrough()); -const setup_intent_payment_method_options_payto = z.lazy(() => z.object({"mandate_options": setup_intent_payment_method_options_mandate_options_payto.optional()}).passthrough()); -const setup_intent_payment_method_options_pix = z.lazy(() => z.object({"mandate_options": payment_method_options_mandate_options_pix.optional()}).passthrough()); -const setup_intent_payment_method_options_sepa_debit = z.lazy(() => z.object({"mandate_options": setup_intent_payment_method_options_mandate_options_sepa_debit.optional()}).passthrough()); -const setup_intent_payment_method_options_upi = z.lazy(() => z.object({"mandate_options": payment_method_options_mandate_options_upi.optional()}).passthrough()); -const setup_intent_payment_method_options_us_bank_account = z.lazy(() => z.object({"financial_connections": linked_account_options_common.optional(), "mandate_options": payment_method_options_us_bank_account_mandate_options.optional(), "verification_method": z.enum(["automatic", "instant", "microdeposits"]).optional()}).passthrough()); -const shipping = z.lazy(() => z.object({"address": address.optional(), "carrier": z.string().nullable().optional(), "name": z.string().optional(), "phone": z.string().nullable().optional(), "tracking_number": z.string().nullable().optional()}).passthrough()); -const shipping_rate = z.lazy(() => z.object({"active": z.boolean(), "created": z.number().int(), "delivery_estimate": shipping_rate_delivery_estimate.nullable(), "display_name": z.string().nullable(), "fixed_amount": shipping_rate_fixed_amount.optional(), "id": z.string(), "livemode": z.boolean(), "metadata": z.record(z.string(), z.string()), "object": z.literal("shipping_rate"), "tax_behavior": z.enum(["exclusive", "inclusive", "unspecified"]).nullable(), "tax_code": z.union([z.string(), tax_code]).nullable(), "type": z.literal("fixed_amount")}).passthrough()); -const shipping_rate_currency_option = z.lazy(() => z.object({"amount": z.number().int(), "tax_behavior": z.enum(["exclusive", "inclusive", "unspecified"])}).passthrough()); -const shipping_rate_delivery_estimate = z.lazy(() => z.object({"maximum": shipping_rate_delivery_estimate_bound.nullable(), "minimum": shipping_rate_delivery_estimate_bound.nullable()}).passthrough()); -const shipping_rate_delivery_estimate_bound = z.lazy(() => z.object({"unit": z.enum(["business_day", "day", "hour", "month", "week"]), "value": z.number().int()}).passthrough()); -const shipping_rate_fixed_amount = z.lazy(() => z.object({"amount": z.number().int(), "currency": z.string(), "currency_options": z.record(z.string(), shipping_rate_currency_option).optional()}).passthrough()); -const smor_resource_managed_payments = z.lazy(() => z.object({"enabled": z.boolean()}).passthrough()); -const source = z.lazy(() => z.object({"ach_credit_transfer": source_type_ach_credit_transfer.optional(), "ach_debit": source_type_ach_debit.optional(), "acss_debit": source_type_acss_debit.optional(), "alipay": source_type_alipay.optional(), "allow_redisplay": z.enum(["always", "limited", "unspecified"]).nullable(), "amount": z.number().int().nullable(), "au_becs_debit": source_type_au_becs_debit.optional(), "bancontact": source_type_bancontact.optional(), "card": source_type_card.optional(), "card_present": source_type_card_present.optional(), "client_secret": z.string(), "code_verification": source_code_verification_flow.optional(), "created": z.number().int(), "currency": z.string().nullable(), "customer": z.string().optional(), "eps": source_type_eps.optional(), "flow": z.string(), "giropay": source_type_giropay.optional(), "id": z.string(), "ideal": source_type_ideal.optional(), "klarna": source_type_klarna.optional(), "livemode": z.boolean(), "metadata": z.record(z.string(), z.string()).nullable(), "multibanco": source_type_multibanco.optional(), "object": z.literal("source"), "owner": source_owner.nullable(), "p24": source_type_p24.optional(), "receiver": source_receiver_flow.optional(), "redirect": source_redirect_flow.optional(), "sepa_credit_transfer": source_type_sepa_credit_transfer.optional(), "sepa_debit": source_type_sepa_debit.optional(), "sofort": source_type_sofort.optional(), "source_order": source_order.optional(), "statement_descriptor": z.string().nullable(), "status": z.string(), "three_d_secure": source_type_three_d_secure.optional(), "type": z.enum(["ach_credit_transfer", "ach_debit", "acss_debit", "alipay", "au_becs_debit", "bancontact", "card", "card_present", "eps", "giropay", "ideal", "klarna", "multibanco", "p24", "sepa_credit_transfer", "sepa_debit", "sofort", "three_d_secure", "wechat"]), "usage": z.string().nullable(), "wechat": source_type_wechat.optional()}).passthrough()); -const source_code_verification_flow = z.lazy(() => z.object({"attempts_remaining": z.number().int(), "status": z.string()}).passthrough()); -const source_order = z.lazy(() => z.object({"amount": z.number().int(), "currency": z.string(), "email": z.string().optional(), "items": z.array(source_order_item).nullable(), "shipping": shipping.optional()}).passthrough()); -const source_order_item = z.lazy(() => z.object({"amount": z.number().int().nullable(), "currency": z.string().nullable(), "description": z.string().nullable(), "parent": z.string().nullable(), "quantity": z.number().int().optional(), "type": z.string().nullable()}).passthrough()); -const source_owner = z.lazy(() => z.object({"address": address.nullable(), "email": z.string().nullable(), "name": z.string().nullable(), "phone": z.string().nullable(), "verified_address": address.nullable(), "verified_email": z.string().nullable(), "verified_name": z.string().nullable(), "verified_phone": z.string().nullable()}).passthrough()); -const source_receiver_flow = z.lazy(() => z.object({"address": z.string().nullable(), "amount_charged": z.number().int(), "amount_received": z.number().int(), "amount_returned": z.number().int(), "refund_attributes_method": z.string(), "refund_attributes_status": z.string()}).passthrough()); -const source_redirect_flow = z.lazy(() => z.object({"failure_reason": z.string().nullable(), "return_url": z.string(), "status": z.string(), "url": z.string()}).passthrough()); -const source_type_ach_credit_transfer = z.lazy(() => z.object({"account_number": z.string().nullable().optional(), "bank_name": z.string().nullable().optional(), "fingerprint": z.string().nullable().optional(), "refund_account_holder_name": z.string().nullable().optional(), "refund_account_holder_type": z.string().nullable().optional(), "refund_routing_number": z.string().nullable().optional(), "routing_number": z.string().nullable().optional(), "swift_code": z.string().nullable().optional()}).passthrough()); -const source_type_ach_debit = z.lazy(() => z.object({"bank_name": z.string().nullable().optional(), "country": z.string().nullable().optional(), "fingerprint": z.string().nullable().optional(), "last4": z.string().nullable().optional(), "routing_number": z.string().nullable().optional(), "type": z.string().nullable().optional()}).passthrough()); -const source_type_acss_debit = z.lazy(() => z.object({"bank_address_city": z.string().nullable().optional(), "bank_address_line_1": z.string().nullable().optional(), "bank_address_line_2": z.string().nullable().optional(), "bank_address_postal_code": z.string().nullable().optional(), "bank_name": z.string().nullable().optional(), "category": z.string().nullable().optional(), "country": z.string().nullable().optional(), "fingerprint": z.string().nullable().optional(), "last4": z.string().nullable().optional(), "routing_number": z.string().nullable().optional()}).passthrough()); -const source_type_alipay = z.lazy(() => z.object({"data_string": z.string().nullable().optional(), "native_url": z.string().nullable().optional(), "statement_descriptor": z.string().nullable().optional()}).passthrough()); -const source_type_au_becs_debit = z.lazy(() => z.object({"bsb_number": z.string().nullable().optional(), "fingerprint": z.string().nullable().optional(), "last4": z.string().nullable().optional()}).passthrough()); -const source_type_bancontact = z.lazy(() => z.object({"bank_code": z.string().nullable().optional(), "bank_name": z.string().nullable().optional(), "bic": z.string().nullable().optional(), "iban_last4": z.string().nullable().optional(), "preferred_language": z.string().nullable().optional(), "statement_descriptor": z.string().nullable().optional()}).passthrough()); -const source_type_card = z.lazy(() => z.object({"address_line1_check": z.string().nullable().optional(), "address_zip_check": z.string().nullable().optional(), "brand": z.string().nullable().optional(), "country": z.string().nullable().optional(), "cvc_check": z.string().nullable().optional(), "description": z.string().optional(), "dynamic_last4": z.string().nullable().optional(), "exp_month": z.number().int().nullable().optional(), "exp_year": z.number().int().nullable().optional(), "fingerprint": z.string().optional(), "funding": z.string().nullable().optional(), "iin": z.string().optional(), "issuer": z.string().optional(), "last4": z.string().nullable().optional(), "name": z.string().nullable().optional(), "three_d_secure": z.string().optional(), "tokenization_method": z.string().nullable().optional()}).passthrough()); -const source_type_card_present = z.lazy(() => z.object({"application_cryptogram": z.string().optional(), "application_preferred_name": z.string().optional(), "authorization_code": z.string().nullable().optional(), "authorization_response_code": z.string().optional(), "brand": z.string().nullable().optional(), "country": z.string().nullable().optional(), "cvm_type": z.string().optional(), "data_type": z.string().nullable().optional(), "dedicated_file_name": z.string().optional(), "description": z.string().optional(), "emv_auth_data": z.string().optional(), "evidence_customer_signature": z.string().nullable().optional(), "evidence_transaction_certificate": z.string().nullable().optional(), "exp_month": z.number().int().nullable().optional(), "exp_year": z.number().int().nullable().optional(), "fingerprint": z.string().optional(), "funding": z.string().nullable().optional(), "iin": z.string().optional(), "issuer": z.string().optional(), "last4": z.string().nullable().optional(), "pos_device_id": z.string().nullable().optional(), "pos_entry_mode": z.string().optional(), "read_method": z.string().nullable().optional(), "reader": z.string().nullable().optional(), "terminal_verification_results": z.string().optional(), "transaction_status_information": z.string().optional()}).passthrough()); -const source_type_eps = z.lazy(() => z.object({"reference": z.string().nullable().optional(), "statement_descriptor": z.string().nullable().optional()}).passthrough()); -const source_type_giropay = z.lazy(() => z.object({"bank_code": z.string().nullable().optional(), "bank_name": z.string().nullable().optional(), "bic": z.string().nullable().optional(), "statement_descriptor": z.string().nullable().optional()}).passthrough()); -const source_type_ideal = z.lazy(() => z.object({"bank": z.string().nullable().optional(), "bic": z.string().nullable().optional(), "iban_last4": z.string().nullable().optional(), "statement_descriptor": z.string().nullable().optional()}).passthrough()); -const source_type_klarna = z.lazy(() => z.object({"background_image_url": z.string().optional(), "client_token": z.string().nullable().optional(), "first_name": z.string().optional(), "last_name": z.string().optional(), "locale": z.string().optional(), "logo_url": z.string().optional(), "page_title": z.string().optional(), "pay_later_asset_urls_descriptive": z.string().optional(), "pay_later_asset_urls_standard": z.string().optional(), "pay_later_name": z.string().optional(), "pay_later_redirect_url": z.string().optional(), "pay_now_asset_urls_descriptive": z.string().optional(), "pay_now_asset_urls_standard": z.string().optional(), "pay_now_name": z.string().optional(), "pay_now_redirect_url": z.string().optional(), "pay_over_time_asset_urls_descriptive": z.string().optional(), "pay_over_time_asset_urls_standard": z.string().optional(), "pay_over_time_name": z.string().optional(), "pay_over_time_redirect_url": z.string().optional(), "payment_method_categories": z.string().optional(), "purchase_country": z.string().optional(), "purchase_type": z.string().optional(), "redirect_url": z.string().optional(), "shipping_delay": z.number().int().optional(), "shipping_first_name": z.string().optional(), "shipping_last_name": z.string().optional()}).passthrough()); -const source_type_multibanco = z.lazy(() => z.object({"entity": z.string().nullable().optional(), "reference": z.string().nullable().optional(), "refund_account_holder_address_city": z.string().nullable().optional(), "refund_account_holder_address_country": z.string().nullable().optional(), "refund_account_holder_address_line1": z.string().nullable().optional(), "refund_account_holder_address_line2": z.string().nullable().optional(), "refund_account_holder_address_postal_code": z.string().nullable().optional(), "refund_account_holder_address_state": z.string().nullable().optional(), "refund_account_holder_name": z.string().nullable().optional(), "refund_iban": z.string().nullable().optional()}).passthrough()); -const source_type_p24 = z.lazy(() => z.object({"reference": z.string().nullable().optional()}).passthrough()); -const source_type_sepa_credit_transfer = z.lazy(() => z.object({"bank_name": z.string().nullable().optional(), "bic": z.string().nullable().optional(), "iban": z.string().nullable().optional(), "refund_account_holder_address_city": z.string().nullable().optional(), "refund_account_holder_address_country": z.string().nullable().optional(), "refund_account_holder_address_line1": z.string().nullable().optional(), "refund_account_holder_address_line2": z.string().nullable().optional(), "refund_account_holder_address_postal_code": z.string().nullable().optional(), "refund_account_holder_address_state": z.string().nullable().optional(), "refund_account_holder_name": z.string().nullable().optional(), "refund_iban": z.string().nullable().optional()}).passthrough()); -const source_type_sepa_debit = z.lazy(() => z.object({"bank_code": z.string().nullable().optional(), "branch_code": z.string().nullable().optional(), "country": z.string().nullable().optional(), "fingerprint": z.string().nullable().optional(), "last4": z.string().nullable().optional(), "mandate_reference": z.string().nullable().optional(), "mandate_url": z.string().nullable().optional()}).passthrough()); -const source_type_sofort = z.lazy(() => z.object({"bank_code": z.string().nullable().optional(), "bank_name": z.string().nullable().optional(), "bic": z.string().nullable().optional(), "country": z.string().nullable().optional(), "iban_last4": z.string().nullable().optional(), "preferred_language": z.string().nullable().optional(), "statement_descriptor": z.string().nullable().optional()}).passthrough()); -const source_type_three_d_secure = z.lazy(() => z.object({"address_line1_check": z.string().nullable().optional(), "address_zip_check": z.string().nullable().optional(), "authenticated": z.boolean().nullable().optional(), "brand": z.string().nullable().optional(), "card": z.string().nullable().optional(), "country": z.string().nullable().optional(), "customer": z.string().nullable().optional(), "cvc_check": z.string().nullable().optional(), "description": z.string().optional(), "dynamic_last4": z.string().nullable().optional(), "exp_month": z.number().int().nullable().optional(), "exp_year": z.number().int().nullable().optional(), "fingerprint": z.string().optional(), "funding": z.string().nullable().optional(), "iin": z.string().optional(), "issuer": z.string().optional(), "last4": z.string().nullable().optional(), "name": z.string().nullable().optional(), "three_d_secure": z.string().optional(), "tokenization_method": z.string().nullable().optional()}).passthrough()); -const source_type_wechat = z.lazy(() => z.object({"prepay_id": z.string().optional(), "qr_code_url": z.string().nullable().optional(), "statement_descriptor": z.string().optional()}).passthrough()); -const stackable_discount_with_discount_settings: z.ZodTypeAny = z.lazy(() => z.object({"coupon": z.union([z.string(), coupon]).nullable(), "discount": z.union([z.string(), discount]).nullable(), "promotion_code": z.union([z.string(), promotion_code]).nullable()}).passthrough()); -const stackable_discount_with_discount_settings_and_discount_end: z.ZodTypeAny = z.lazy(() => z.object({"coupon": z.union([z.string(), coupon]).nullable(), "discount": z.union([z.string(), discount]).nullable(), "promotion_code": z.union([z.string(), promotion_code]).nullable()}).passthrough()); -const subscription: z.ZodTypeAny = z.lazy(() => z.object({"application": z.union([z.string(), application, deleted_application]).nullable(), "application_fee_percent": z.number().nullable(), "automatic_tax": subscription_automatic_tax, "billing_cycle_anchor": z.number().int(), "billing_cycle_anchor_config": subscriptions_resource_billing_cycle_anchor_config.nullable(), "billing_mode": subscriptions_resource_billing_mode, "billing_schedules": z.array(subscriptions_resource_billing_schedules), "billing_thresholds": subscription_billing_thresholds.nullable(), "cancel_at": z.number().int().nullable(), "cancel_at_period_end": z.boolean(), "canceled_at": z.number().int().nullable(), "cancellation_details": cancellation_details.nullable(), "collection_method": z.enum(["charge_automatically", "send_invoice"]), "created": z.number().int(), "currency": z.string(), "customer": z.union([z.string(), customer, deleted_customer]), "customer_account": z.string().nullable(), "days_until_due": z.number().int().nullable(), "default_payment_method": z.union([z.string(), payment_method]).nullable(), "default_source": z.union([z.string(), payment_source]).nullable(), "default_tax_rates": z.array(tax_rate).nullable().optional(), "description": z.string().nullable(), "discounts": z.array(z.union([z.string(), discount])), "ended_at": z.number().int().nullable(), "id": z.string(), "invoice_settings": subscriptions_resource_subscription_invoice_settings, "items": z.object({"data": z.array(subscription_item), "has_more": z.boolean(), "object": z.literal("list"), "url": z.string()}).passthrough(), "latest_invoice": z.union([z.string(), invoice]).nullable(), "livemode": z.boolean(), "managed_payments": smor_resource_managed_payments.nullable(), "metadata": z.record(z.string(), z.string()), "next_pending_invoice_item_invoice": z.number().int().nullable(), "object": z.literal("subscription"), "on_behalf_of": z.union([z.string(), account]).nullable(), "pause_collection": subscriptions_resource_pause_collection.nullable(), "payment_settings": subscriptions_resource_payment_settings.nullable(), "pending_invoice_item_interval": subscription_pending_invoice_item_interval.nullable(), "pending_setup_intent": z.union([z.string(), setup_intent]).nullable(), "pending_update": subscriptions_resource_pending_update.nullable(), "presentment_details": subscriptions_resource_subscription_presentment_details.optional(), "schedule": z.union([z.string(), subscription_schedule]).nullable(), "start_date": z.number().int(), "status": z.enum(["active", "canceled", "incomplete", "incomplete_expired", "past_due", "paused", "trialing", "unpaid"]), "test_clock": z.union([z.string(), test_helpers_test_clock]).nullable(), "transfer_data": subscription_transfer_data.nullable(), "trial_end": z.number().int().nullable(), "trial_settings": subscriptions_resource_trial_settings_trial_settings.nullable(), "trial_start": z.number().int().nullable()}).passthrough()); -const subscription_automatic_tax: z.ZodTypeAny = z.lazy(() => z.object({"disabled_reason": z.literal("requires_location_inputs").nullable(), "enabled": z.boolean(), "liability": connect_account_reference.nullable()}).passthrough()); -const subscription_billing_thresholds = z.lazy(() => z.object({"amount_gte": z.number().int().nullable(), "reset_billing_cycle_anchor": z.boolean().nullable()}).passthrough()); -const subscription_item: z.ZodTypeAny = z.lazy(() => z.object({"billed_until": z.number().int().optional(), "billing_thresholds": subscription_item_billing_thresholds.nullable(), "created": z.number().int(), "current_period_end": z.number().int(), "current_period_start": z.number().int(), "discounts": z.array(z.union([z.string(), discount])), "id": z.string(), "metadata": z.record(z.string(), z.string()), "object": z.literal("subscription_item"), "plan": plan, "price": price, "quantity": z.number().int().optional(), "subscription": z.string(), "tax_rates": z.array(tax_rate).nullable()}).passthrough()); -const subscription_item_billing_thresholds = z.lazy(() => z.object({"usage_gte": z.number().int().nullable()}).passthrough()); -const subscription_payment_method_options_card = z.lazy(() => z.object({"mandate_options": invoice_mandate_options_card.optional(), "network": z.enum(["amex", "cartes_bancaires", "diners", "discover", "eftpos_au", "girocard", "interac", "jcb", "link", "mastercard", "unionpay", "unknown", "visa"]).nullable(), "request_three_d_secure": z.enum(["any", "automatic", "challenge"]).nullable()}).passthrough()); -const subscription_payment_method_options_mandate_options_pix = z.lazy(() => z.object({"amount": z.number().int().nullable(), "amount_includes_iof": z.enum(["always", "never"]).nullable(), "end_date": z.string().nullable(), "payment_schedule": z.enum(["halfyearly", "monthly", "quarterly", "weekly", "yearly"]).nullable()}).passthrough()); -const subscription_payment_method_options_pix = z.lazy(() => z.object({"expires_after_seconds": z.number().int().optional(), "mandate_options": subscription_payment_method_options_mandate_options_pix.optional()}).passthrough()); -const subscription_pending_invoice_item_interval = z.lazy(() => z.object({"interval": z.enum(["day", "month", "week", "year"]), "interval_count": z.number().int()}).passthrough()); -const subscription_schedule: z.ZodTypeAny = z.lazy(() => z.object({"application": z.union([z.string(), application, deleted_application]).nullable(), "billing_mode": subscriptions_resource_billing_mode, "canceled_at": z.number().int().nullable(), "completed_at": z.number().int().nullable(), "created": z.number().int(), "current_phase": subscription_schedule_current_phase.nullable(), "customer": z.union([z.string(), customer, deleted_customer]), "customer_account": z.string().nullable(), "default_settings": subscription_schedules_resource_default_settings, "end_behavior": z.enum(["cancel", "none", "release", "renew"]), "id": z.string(), "livemode": z.boolean(), "metadata": z.record(z.string(), z.string()).nullable(), "object": z.literal("subscription_schedule"), "phases": z.array(subscription_schedule_phase_configuration), "released_at": z.number().int().nullable(), "released_subscription": z.string().nullable(), "status": z.enum(["active", "canceled", "completed", "not_started", "released"]), "subscription": z.union([z.string(), subscription]).nullable(), "test_clock": z.union([z.string(), test_helpers_test_clock]).nullable()}).passthrough()); -const subscription_schedule_add_invoice_item: z.ZodTypeAny = z.lazy(() => z.object({"discountable": z.boolean().nullable(), "discounts": z.array(discounts_resource_stackable_discount_with_discount_end), "metadata": z.record(z.string(), z.string()).nullable(), "period": subscription_schedule_add_invoice_item_period, "price": z.union([z.string(), price, deleted_price]), "quantity": z.number().int().nullable(), "tax_rates": z.array(tax_rate).nullable().optional()}).passthrough()); -const subscription_schedule_add_invoice_item_period = z.lazy(() => z.object({"end": subscription_schedules_resource_invoice_item_period_resource_period_end, "start": subscription_schedules_resource_invoice_item_period_resource_period_start}).passthrough()); -const subscription_schedule_configuration_item: z.ZodTypeAny = z.lazy(() => z.object({"billing_thresholds": subscription_item_billing_thresholds.nullable(), "discounts": z.array(stackable_discount_with_discount_settings), "metadata": z.record(z.string(), z.string()).nullable(), "plan": z.union([z.string(), plan, deleted_plan]), "price": z.union([z.string(), price, deleted_price]), "quantity": z.number().int().optional(), "tax_rates": z.array(tax_rate).nullable().optional()}).passthrough()); -const subscription_schedule_current_phase = z.lazy(() => z.object({"end_date": z.number().int(), "start_date": z.number().int()}).passthrough()); -const subscription_schedule_phase_configuration: z.ZodTypeAny = z.lazy(() => z.object({"add_invoice_items": z.array(subscription_schedule_add_invoice_item), "application_fee_percent": z.number().nullable(), "automatic_tax": schedules_phase_automatic_tax.optional(), "billing_cycle_anchor": z.enum(["automatic", "phase_start"]).nullable(), "billing_thresholds": subscription_billing_thresholds.nullable(), "collection_method": z.enum(["charge_automatically", "send_invoice"]).nullable(), "currency": z.string(), "default_payment_method": z.union([z.string(), payment_method]).nullable(), "default_tax_rates": z.array(tax_rate).nullable().optional(), "description": z.string().nullable(), "discounts": z.array(stackable_discount_with_discount_settings_and_discount_end), "end_date": z.number().int(), "invoice_settings": invoice_setting_subscription_schedule_phase_setting.nullable(), "items": z.array(subscription_schedule_configuration_item), "metadata": z.record(z.string(), z.string()).nullable(), "on_behalf_of": z.union([z.string(), account]).nullable(), "proration_behavior": z.enum(["always_invoice", "create_prorations", "none"]), "start_date": z.number().int(), "transfer_data": subscription_transfer_data.nullable(), "trial_end": z.number().int().nullable()}).passthrough()); -const subscription_schedules_resource_default_settings: z.ZodTypeAny = z.lazy(() => z.object({"application_fee_percent": z.number().nullable(), "automatic_tax": subscription_schedules_resource_default_settings_automatic_tax.optional(), "billing_cycle_anchor": z.enum(["automatic", "phase_start"]), "billing_thresholds": subscription_billing_thresholds.nullable(), "collection_method": z.enum(["charge_automatically", "send_invoice"]).nullable(), "default_payment_method": z.union([z.string(), payment_method]).nullable(), "description": z.string().nullable(), "invoice_settings": invoice_setting_subscription_schedule_setting, "on_behalf_of": z.union([z.string(), account]).nullable(), "transfer_data": subscription_transfer_data.nullable()}).passthrough()); -const subscription_schedules_resource_default_settings_automatic_tax: z.ZodTypeAny = z.lazy(() => z.object({"disabled_reason": z.literal("requires_location_inputs").nullable(), "enabled": z.boolean(), "liability": connect_account_reference.nullable()}).passthrough()); -const subscription_schedules_resource_invoice_item_period_resource_period_end = z.lazy(() => z.object({"timestamp": z.number().int().optional(), "type": z.enum(["min_item_period_end", "phase_end", "timestamp"])}).passthrough()); -const subscription_schedules_resource_invoice_item_period_resource_period_start = z.lazy(() => z.object({"timestamp": z.number().int().optional(), "type": z.enum(["max_item_period_start", "phase_start", "timestamp"])}).passthrough()); -const subscription_transfer_data: z.ZodTypeAny = z.lazy(() => z.object({"amount_percent": z.number().nullable(), "destination": z.union([z.string(), account])}).passthrough()); -const subscriptions_resource_billing_cycle_anchor_config = z.lazy(() => z.object({"day_of_month": z.number().int(), "hour": z.number().int().nullable(), "minute": z.number().int().nullable(), "month": z.number().int().nullable(), "second": z.number().int().nullable()}).passthrough()); -const subscriptions_resource_billing_mode = z.lazy(() => z.object({"flexible": subscriptions_resource_billing_mode_flexible.nullable(), "type": z.enum(["classic", "flexible"]), "updated_at": z.number().int().optional()}).passthrough()); -const subscriptions_resource_billing_mode_flexible = z.lazy(() => z.object({"proration_discounts": z.enum(["included", "itemized"]).optional()}).passthrough()); -const subscriptions_resource_billing_schedules = z.lazy(() => z.object({"applies_to": z.array(subscriptions_resource_billing_schedules_applies_to).nullable(), "bill_until": subscriptions_resource_billing_schedules_bill_until, "key": z.string()}).passthrough()); -const subscriptions_resource_billing_schedules_applies_to = z.lazy(() => z.object({"price": z.union([z.string(), price]).nullable(), "type": z.literal("price")}).passthrough()); -const subscriptions_resource_billing_schedules_bill_until = z.lazy(() => z.object({"computed_timestamp": z.number().int(), "duration": subscriptions_resource_billing_schedules_bill_until_duration.nullable(), "timestamp": z.number().int().nullable(), "type": z.enum(["duration", "timestamp"])}).passthrough()); -const subscriptions_resource_billing_schedules_bill_until_duration = z.lazy(() => z.object({"interval": z.enum(["day", "month", "week", "year"]), "interval_count": z.number().int().nullable()}).passthrough()); -const subscriptions_resource_pause_collection = z.lazy(() => z.object({"behavior": z.enum(["keep_as_draft", "mark_uncollectible", "void"]), "resumes_at": z.number().int().nullable()}).passthrough()); -const subscriptions_resource_payment_method_options = z.lazy(() => z.object({"acss_debit": invoice_payment_method_options_acss_debit.nullable(), "bancontact": invoice_payment_method_options_bancontact.nullable(), "card": subscription_payment_method_options_card.nullable(), "customer_balance": invoice_payment_method_options_customer_balance.nullable(), "konbini": invoice_payment_method_options_konbini.nullable(), "payto": invoice_payment_method_options_payto.nullable(), "pix": subscription_payment_method_options_pix.nullable(), "sepa_debit": invoice_payment_method_options_sepa_debit.nullable(), "upi": invoice_payment_method_options_upi.nullable(), "us_bank_account": invoice_payment_method_options_us_bank_account.nullable()}).passthrough()); -const subscriptions_resource_payment_settings = z.lazy(() => z.object({"payment_method_options": subscriptions_resource_payment_method_options.nullable(), "payment_method_types": z.array(z.enum(["ach_credit_transfer", "ach_debit", "acss_debit", "affirm", "amazon_pay", "au_becs_debit", "bacs_debit", "bancontact", "boleto", "card", "cashapp", "crypto", "custom", "customer_balance", "eps", "fpx", "giropay", "grabpay", "ideal", "jp_credit_transfer", "kakao_pay", "klarna", "konbini", "kr_card", "link", "multibanco", "naver_pay", "nz_bank_account", "p24", "pay_by_bank", "payco", "paynow", "paypal", "payto", "pix", "promptpay", "revolut_pay", "satispay", "sepa_credit_transfer", "sepa_debit", "sofort", "swish", "twint", "upi", "us_bank_account", "wechat_pay"])).nullable(), "save_default_payment_method": z.enum(["off", "on_subscription"]).nullable()}).passthrough()); -const subscriptions_resource_pending_update: z.ZodTypeAny = z.lazy(() => z.object({"billing_cycle_anchor": z.number().int().nullable(), "discount": discount.nullable(), "discounts": z.array(z.union([z.string(), discount])).nullable(), "expires_at": z.number().int(), "metadata": z.record(z.string(), z.string()).nullable(), "subscription_items": z.array(subscription_item).nullable(), "trial_end": z.number().int().nullable(), "trial_from_plan": z.boolean().nullable()}).passthrough()); -const subscriptions_resource_subscription_invoice_settings: z.ZodTypeAny = z.lazy(() => z.object({"account_tax_ids": z.array(z.union([z.string(), tax_id, deleted_tax_id])).nullable(), "custom_fields": z.array(invoice_setting_custom_field).nullable(), "description": z.string().nullable(), "footer": z.string().nullable(), "issuer": connect_account_reference}).passthrough()); -const subscriptions_resource_subscription_presentment_details = z.lazy(() => z.object({"presentment_currency": z.string()}).passthrough()); -const subscriptions_resource_trial_settings_end_behavior = z.lazy(() => z.object({"missing_payment_method": z.enum(["cancel", "create_invoice", "pause"])}).passthrough()); -const subscriptions_resource_trial_settings_trial_settings = z.lazy(() => z.object({"end_behavior": subscriptions_resource_trial_settings_end_behavior}).passthrough()); -const tax_code = z.lazy(() => z.object({"description": z.string(), "id": z.string(), "name": z.string(), "object": z.literal("tax_code")}).passthrough()); -const tax_deducted_at_source = z.lazy(() => z.object({"id": z.string(), "object": z.literal("tax_deducted_at_source"), "period_end": z.number().int(), "period_start": z.number().int(), "tax_deduction_account_number": z.string()}).passthrough()); -const tax_i_ds_owner: z.ZodTypeAny = z.lazy(() => z.object({"account": z.union([z.string(), account]).optional(), "application": z.union([z.string(), application]).optional(), "customer": z.union([z.string(), customer]).optional(), "customer_account": z.string().nullable(), "type": z.enum(["account", "application", "customer", "self"])}).passthrough()); -const tax_id: z.ZodTypeAny = z.lazy(() => z.object({"country": z.string().nullable(), "created": z.number().int(), "customer": z.union([z.string(), customer]).nullable(), "customer_account": z.string().nullable(), "id": z.string(), "livemode": z.boolean(), "object": z.literal("tax_id"), "owner": tax_i_ds_owner.nullable(), "type": z.enum(["ad_nrt", "ae_trn", "al_tin", "am_tin", "ao_tin", "ar_cuit", "au_abn", "au_arn", "aw_tin", "az_tin", "ba_tin", "bb_tin", "bd_bin", "bf_ifu", "bg_uic", "bh_vat", "bj_ifu", "bo_tin", "br_cnpj", "br_cpf", "bs_tin", "by_tin", "ca_bn", "ca_gst_hst", "ca_pst_bc", "ca_pst_mb", "ca_pst_sk", "ca_qst", "cd_nif", "ch_uid", "ch_vat", "cl_tin", "cm_niu", "cn_tin", "co_nit", "cr_tin", "cv_nif", "de_stn", "do_rcn", "ec_ruc", "eg_tin", "es_cif", "et_tin", "eu_oss_vat", "eu_vat", "fo_vat", "gb_vat", "ge_vat", "gi_tin", "gn_nif", "hk_br", "hr_oib", "hu_tin", "id_npwp", "il_vat", "in_gst", "is_vat", "it_cf", "jp_cn", "jp_rn", "jp_trn", "ke_pin", "kg_tin", "kh_tin", "kr_brn", "kz_bin", "la_tin", "li_uid", "li_vat", "lk_vat", "ma_vat", "md_vat", "me_pib", "mk_vat", "mr_nif", "mx_rfc", "my_frp", "my_itn", "my_sst", "ng_tin", "no_vat", "no_voec", "np_pan", "nz_gst", "om_vat", "pe_ruc", "ph_tin", "pl_nip", "py_ruc", "ro_tin", "rs_pib", "ru_inn", "ru_kpp", "sa_vat", "sg_gst", "sg_uen", "si_tin", "sn_ninea", "sr_fin", "sv_nit", "th_vat", "tj_tin", "tr_tin", "tw_vat", "tz_vat", "ua_vat", "ug_tin", "unknown", "us_ein", "uy_ruc", "uz_tin", "uz_vat", "ve_rif", "vn_tin", "za_vat", "zm_tin", "zw_tin"]), "value": z.string(), "verification": tax_id_verification.nullable()}).passthrough()); -const tax_id_verification = z.lazy(() => z.object({"status": z.enum(["pending", "unavailable", "unverified", "verified"]), "verified_address": z.string().nullable(), "verified_name": z.string().nullable()}).passthrough()); -const tax_rate = z.lazy(() => z.object({"active": z.boolean(), "country": z.string().nullable(), "created": z.number().int(), "description": z.string().nullable(), "display_name": z.string(), "effective_percentage": z.number().nullable(), "flat_amount": tax_rate_flat_amount.nullable(), "id": z.string(), "inclusive": z.boolean(), "jurisdiction": z.string().nullable(), "jurisdiction_level": z.enum(["city", "country", "county", "district", "multiple", "state"]).nullable(), "livemode": z.boolean(), "metadata": z.record(z.string(), z.string()).nullable(), "object": z.literal("tax_rate"), "percentage": z.number(), "rate_type": z.enum(["flat_amount", "percentage"]).nullable(), "state": z.string().nullable(), "tax_type": z.enum(["amusement_tax", "communications_tax", "gst", "hst", "igst", "jct", "lease_tax", "pst", "qst", "retail_delivery_fee", "rst", "sales_tax", "service_tax", "vat"]).nullable()}).passthrough()); -const tax_rate_flat_amount = z.lazy(() => z.object({"amount": z.number().int(), "currency": z.string()}).passthrough()); -const test_helpers_test_clock = z.lazy(() => z.object({"created": z.number().int(), "deletes_after": z.number().int(), "frozen_time": z.number().int(), "id": z.string(), "livemode": z.boolean(), "name": z.string().nullable(), "object": z.literal("test_helpers.test_clock"), "status": z.enum(["advancing", "internal_failure", "ready"]), "status_details": billing_clocks_resource_status_details_status_details}).passthrough()); -const three_d_secure_details = z.lazy(() => z.object({"authentication_flow": z.enum(["challenge", "frictionless"]).nullable(), "electronic_commerce_indicator": z.enum(["01", "02", "05", "06", "07"]).nullable(), "result": z.enum(["attempt_acknowledged", "authenticated", "exempted", "failed", "not_supported", "processing_error"]).nullable(), "result_reason": z.enum(["abandoned", "bypassed", "canceled", "card_not_enrolled", "network_not_supported", "protocol_error", "rejected"]).nullable(), "transaction_id": z.string().nullable(), "version": z.enum(["1.0.2", "2.1.0", "2.2.0", "2.3.0", "2.3.1"]).nullable()}).passthrough()); -const three_d_secure_details_charge = z.lazy(() => z.object({"authentication_flow": z.enum(["challenge", "frictionless"]).nullable(), "electronic_commerce_indicator": z.enum(["01", "02", "05", "06", "07"]).nullable(), "exemption_indicator": z.enum(["low_risk", "none"]).nullable(), "exemption_indicator_applied": z.boolean().optional(), "result": z.enum(["attempt_acknowledged", "authenticated", "exempted", "failed", "not_supported", "processing_error"]).nullable(), "result_reason": z.enum(["abandoned", "bypassed", "canceled", "card_not_enrolled", "network_not_supported", "protocol_error", "rejected"]).nullable(), "transaction_id": z.string().nullable(), "version": z.enum(["1.0.2", "2.1.0", "2.2.0", "2.3.0", "2.3.1"]).nullable()}).passthrough()); -const three_d_secure_usage = z.lazy(() => z.object({"supported": z.boolean()}).passthrough()); -const token_card_networks = z.lazy(() => z.object({"preferred": z.string().nullable()}).passthrough()); -const topup: z.ZodTypeAny = z.lazy(() => z.object({"amount": z.number().int(), "balance_transaction": z.union([z.string(), balance_transaction]).nullable(), "created": z.number().int(), "currency": z.string(), "description": z.string().nullable(), "expected_availability_date": z.number().int().nullable(), "failure_code": z.string().nullable(), "failure_message": z.string().nullable(), "id": z.string(), "livemode": z.boolean(), "metadata": z.record(z.string(), z.string()), "object": z.literal("topup"), "source": source.nullable(), "statement_descriptor": z.string().nullable(), "status": z.enum(["canceled", "failed", "pending", "reversed", "succeeded"]), "transfer_group": z.string().nullable()}).passthrough()); -const transfer: z.ZodTypeAny = z.lazy(() => z.object({"amount": z.number().int(), "amount_reversed": z.number().int(), "balance_transaction": z.union([z.string(), balance_transaction]).nullable(), "created": z.number().int(), "currency": z.string(), "description": z.string().nullable(), "destination": z.union([z.string(), account]).nullable(), "destination_payment": z.union([z.string(), charge]).optional(), "id": z.string(), "livemode": z.boolean(), "metadata": z.record(z.string(), z.string()), "object": z.literal("transfer"), "reversals": z.object({"data": z.array(transfer_reversal), "has_more": z.boolean(), "object": z.literal("list"), "url": z.string()}).passthrough(), "reversed": z.boolean(), "source_transaction": z.union([z.string(), charge]).nullable(), "source_type": z.string().optional(), "transfer_group": z.string().nullable()}).passthrough()); -const transfer_data: z.ZodTypeAny = z.lazy(() => z.object({"amount": z.number().int().optional(), "description": z.string().optional(), "destination": z.union([z.string(), account]), "metadata": z.record(z.string(), z.string()).optional(), "payment_data": payment_data.optional()}).passthrough()); -const transfer_reversal: z.ZodTypeAny = z.lazy(() => z.object({"amount": z.number().int(), "balance_transaction": z.union([z.string(), balance_transaction]).nullable(), "created": z.number().int(), "currency": z.string(), "destination_payment_refund": z.union([z.string(), refund]).nullable(), "id": z.string(), "metadata": z.record(z.string(), z.string()).nullable(), "object": z.literal("transfer_reversal"), "source_refund": z.union([z.string(), refund]).nullable(), "transfer": z.union([z.string(), transfer])}).passthrough()); -const transfer_schedule = z.lazy(() => z.object({"delay_days": z.number().int(), "interval": z.string(), "monthly_anchor": z.number().int().optional(), "monthly_payout_days": z.array(z.number().int()).optional(), "weekly_anchor": z.string().optional(), "weekly_payout_days": z.array(z.enum(["friday", "monday", "thursday", "tuesday", "wednesday"])).optional()}).passthrough()); -const transform_quantity = z.lazy(() => z.object({"divide_by": z.number().int(), "round": z.enum(["down", "up"])}).passthrough()); -const transform_usage = z.lazy(() => z.object({"divide_by": z.number().int(), "round": z.enum(["down", "up"])}).passthrough()); -const us_bank_account_networks = z.lazy(() => z.object({"preferred": z.string().nullable(), "supported": z.array(z.enum(["ach", "us_domestic_wire"]))}).passthrough()); +const setup_intent_payment_method_options_klarna = z.lazy(() => z.object({"currency": z.string().nullable(), "preferred_locale": z.string().nullable()})); +const setup_intent_payment_method_options_link = z.lazy(() => z.object({"persistent_token": z.string().nullable()})); +const setup_intent_payment_method_options_mandate_options_acss_debit = z.lazy(() => z.object({"custom_mandate_url": z.string().optional(), "default_for": z.array(z.enum(["invoice", "subscription"])).optional(), "interval_description": z.string().nullable(), "payment_schedule": z.enum(["combined", "interval", "sporadic"]).nullable(), "transaction_type": z.enum(["business", "personal"]).nullable()})); +const setup_intent_payment_method_options_mandate_options_bacs_debit = z.lazy(() => z.object({"reference_prefix": z.string().optional()})); +const setup_intent_payment_method_options_mandate_options_payto = z.lazy(() => z.object({"amount": z.number().int().nullable(), "amount_type": z.enum(["fixed", "maximum"]).nullable(), "end_date": z.string().nullable(), "payment_schedule": z.enum(["adhoc", "annual", "daily", "fortnightly", "monthly", "quarterly", "semi_annual", "weekly"]).nullable(), "payments_per_period": z.number().int().nullable(), "purpose": z.enum(["dependant_support", "government", "loan", "mortgage", "other", "pension", "personal", "retail", "salary", "tax", "utility"]).nullable(), "start_date": z.string().nullable()})); +const setup_intent_payment_method_options_mandate_options_sepa_debit = z.lazy(() => z.object({"reference_prefix": z.string().optional()})); +const setup_intent_payment_method_options_paypal = z.lazy(() => z.object({"billing_agreement_id": z.string().nullable()})); +const setup_intent_payment_method_options_payto = z.lazy(() => z.object({"mandate_options": setup_intent_payment_method_options_mandate_options_payto.optional()})); +const setup_intent_payment_method_options_pix = z.lazy(() => z.object({"mandate_options": payment_method_options_mandate_options_pix.optional()})); +const setup_intent_payment_method_options_sepa_debit = z.lazy(() => z.object({"mandate_options": setup_intent_payment_method_options_mandate_options_sepa_debit.optional()})); +const setup_intent_payment_method_options_upi = z.lazy(() => z.object({"mandate_options": payment_method_options_mandate_options_upi.optional()})); +const setup_intent_payment_method_options_us_bank_account = z.lazy(() => z.object({"financial_connections": linked_account_options_common.optional(), "mandate_options": payment_method_options_us_bank_account_mandate_options.optional(), "verification_method": z.enum(["automatic", "instant", "microdeposits"]).optional()})); +const shipping = z.lazy(() => z.object({"address": address.optional(), "carrier": z.string().nullable().optional(), "name": z.string().optional(), "phone": z.string().nullable().optional(), "tracking_number": z.string().nullable().optional()})); +const shipping_rate = z.lazy(() => z.object({"active": z.boolean(), "created": z.number().int(), "delivery_estimate": shipping_rate_delivery_estimate.nullable(), "display_name": z.string().nullable(), "fixed_amount": shipping_rate_fixed_amount.optional(), "id": z.string(), "livemode": z.boolean(), "metadata": z.record(z.string(), z.string()), "object": z.literal("shipping_rate"), "tax_behavior": z.enum(["exclusive", "inclusive", "unspecified"]).nullable(), "tax_code": z.union([z.string(), tax_code]).nullable(), "type": z.literal("fixed_amount")})); +const shipping_rate_currency_option = z.lazy(() => z.object({"amount": z.number().int(), "tax_behavior": z.enum(["exclusive", "inclusive", "unspecified"])})); +const shipping_rate_delivery_estimate = z.lazy(() => z.object({"maximum": shipping_rate_delivery_estimate_bound.nullable(), "minimum": shipping_rate_delivery_estimate_bound.nullable()})); +const shipping_rate_delivery_estimate_bound = z.lazy(() => z.object({"unit": z.enum(["business_day", "day", "hour", "month", "week"]), "value": z.number().int()})); +const shipping_rate_fixed_amount = z.lazy(() => z.object({"amount": z.number().int(), "currency": z.string(), "currency_options": z.record(z.string(), shipping_rate_currency_option).optional()})); +const smor_resource_managed_payments = z.lazy(() => z.object({"enabled": z.boolean()})); +const source = z.lazy(() => z.object({"ach_credit_transfer": source_type_ach_credit_transfer.optional(), "ach_debit": source_type_ach_debit.optional(), "acss_debit": source_type_acss_debit.optional(), "alipay": source_type_alipay.optional(), "allow_redisplay": z.enum(["always", "limited", "unspecified"]).nullable(), "amount": z.number().int().nullable(), "au_becs_debit": source_type_au_becs_debit.optional(), "bancontact": source_type_bancontact.optional(), "card": source_type_card.optional(), "card_present": source_type_card_present.optional(), "client_secret": z.string(), "code_verification": source_code_verification_flow.optional(), "created": z.number().int(), "currency": z.string().nullable(), "customer": z.string().optional(), "eps": source_type_eps.optional(), "flow": z.string(), "giropay": source_type_giropay.optional(), "id": z.string(), "ideal": source_type_ideal.optional(), "klarna": source_type_klarna.optional(), "livemode": z.boolean(), "metadata": z.record(z.string(), z.string()).nullable(), "multibanco": source_type_multibanco.optional(), "object": z.literal("source"), "owner": source_owner.nullable(), "p24": source_type_p24.optional(), "receiver": source_receiver_flow.optional(), "redirect": source_redirect_flow.optional(), "sepa_credit_transfer": source_type_sepa_credit_transfer.optional(), "sepa_debit": source_type_sepa_debit.optional(), "sofort": source_type_sofort.optional(), "source_order": source_order.optional(), "statement_descriptor": z.string().nullable(), "status": z.string(), "three_d_secure": source_type_three_d_secure.optional(), "type": z.enum(["ach_credit_transfer", "ach_debit", "acss_debit", "alipay", "au_becs_debit", "bancontact", "card", "card_present", "eps", "giropay", "ideal", "klarna", "multibanco", "p24", "sepa_credit_transfer", "sepa_debit", "sofort", "three_d_secure", "wechat"]), "usage": z.string().nullable(), "wechat": source_type_wechat.optional()})); +const source_code_verification_flow = z.lazy(() => z.object({"attempts_remaining": z.number().int(), "status": z.string()})); +const source_order = z.lazy(() => z.object({"amount": z.number().int(), "currency": z.string(), "email": z.string().optional(), "items": z.array(source_order_item).nullable(), "shipping": shipping.optional()})); +const source_order_item = z.lazy(() => z.object({"amount": z.number().int().nullable(), "currency": z.string().nullable(), "description": z.string().nullable(), "parent": z.string().nullable(), "quantity": z.number().int().optional(), "type": z.string().nullable()})); +const source_owner = z.lazy(() => z.object({"address": address.nullable(), "email": z.string().nullable(), "name": z.string().nullable(), "phone": z.string().nullable(), "verified_address": address.nullable(), "verified_email": z.string().nullable(), "verified_name": z.string().nullable(), "verified_phone": z.string().nullable()})); +const source_receiver_flow = z.lazy(() => z.object({"address": z.string().nullable(), "amount_charged": z.number().int(), "amount_received": z.number().int(), "amount_returned": z.number().int(), "refund_attributes_method": z.string(), "refund_attributes_status": z.string()})); +const source_redirect_flow = z.lazy(() => z.object({"failure_reason": z.string().nullable(), "return_url": z.string(), "status": z.string(), "url": z.string()})); +const source_type_ach_credit_transfer = z.lazy(() => z.object({"account_number": z.string().nullable().optional(), "bank_name": z.string().nullable().optional(), "fingerprint": z.string().nullable().optional(), "refund_account_holder_name": z.string().nullable().optional(), "refund_account_holder_type": z.string().nullable().optional(), "refund_routing_number": z.string().nullable().optional(), "routing_number": z.string().nullable().optional(), "swift_code": z.string().nullable().optional()})); +const source_type_ach_debit = z.lazy(() => z.object({"bank_name": z.string().nullable().optional(), "country": z.string().nullable().optional(), "fingerprint": z.string().nullable().optional(), "last4": z.string().nullable().optional(), "routing_number": z.string().nullable().optional(), "type": z.string().nullable().optional()})); +const source_type_acss_debit = z.lazy(() => z.object({"bank_address_city": z.string().nullable().optional(), "bank_address_line_1": z.string().nullable().optional(), "bank_address_line_2": z.string().nullable().optional(), "bank_address_postal_code": z.string().nullable().optional(), "bank_name": z.string().nullable().optional(), "category": z.string().nullable().optional(), "country": z.string().nullable().optional(), "fingerprint": z.string().nullable().optional(), "last4": z.string().nullable().optional(), "routing_number": z.string().nullable().optional()})); +const source_type_alipay = z.lazy(() => z.object({"data_string": z.string().nullable().optional(), "native_url": z.string().nullable().optional(), "statement_descriptor": z.string().nullable().optional()})); +const source_type_au_becs_debit = z.lazy(() => z.object({"bsb_number": z.string().nullable().optional(), "fingerprint": z.string().nullable().optional(), "last4": z.string().nullable().optional()})); +const source_type_bancontact = z.lazy(() => z.object({"bank_code": z.string().nullable().optional(), "bank_name": z.string().nullable().optional(), "bic": z.string().nullable().optional(), "iban_last4": z.string().nullable().optional(), "preferred_language": z.string().nullable().optional(), "statement_descriptor": z.string().nullable().optional()})); +const source_type_card = z.lazy(() => z.object({"address_line1_check": z.string().nullable().optional(), "address_zip_check": z.string().nullable().optional(), "brand": z.string().nullable().optional(), "country": z.string().nullable().optional(), "cvc_check": z.string().nullable().optional(), "description": z.string().optional(), "dynamic_last4": z.string().nullable().optional(), "exp_month": z.number().int().nullable().optional(), "exp_year": z.number().int().nullable().optional(), "fingerprint": z.string().optional(), "funding": z.string().nullable().optional(), "iin": z.string().optional(), "issuer": z.string().optional(), "last4": z.string().nullable().optional(), "name": z.string().nullable().optional(), "three_d_secure": z.string().optional(), "tokenization_method": z.string().nullable().optional()})); +const source_type_card_present = z.lazy(() => z.object({"application_cryptogram": z.string().optional(), "application_preferred_name": z.string().optional(), "authorization_code": z.string().nullable().optional(), "authorization_response_code": z.string().optional(), "brand": z.string().nullable().optional(), "country": z.string().nullable().optional(), "cvm_type": z.string().optional(), "data_type": z.string().nullable().optional(), "dedicated_file_name": z.string().optional(), "description": z.string().optional(), "emv_auth_data": z.string().optional(), "evidence_customer_signature": z.string().nullable().optional(), "evidence_transaction_certificate": z.string().nullable().optional(), "exp_month": z.number().int().nullable().optional(), "exp_year": z.number().int().nullable().optional(), "fingerprint": z.string().optional(), "funding": z.string().nullable().optional(), "iin": z.string().optional(), "issuer": z.string().optional(), "last4": z.string().nullable().optional(), "pos_device_id": z.string().nullable().optional(), "pos_entry_mode": z.string().optional(), "read_method": z.string().nullable().optional(), "reader": z.string().nullable().optional(), "terminal_verification_results": z.string().optional(), "transaction_status_information": z.string().optional()})); +const source_type_eps = z.lazy(() => z.object({"reference": z.string().nullable().optional(), "statement_descriptor": z.string().nullable().optional()})); +const source_type_giropay = z.lazy(() => z.object({"bank_code": z.string().nullable().optional(), "bank_name": z.string().nullable().optional(), "bic": z.string().nullable().optional(), "statement_descriptor": z.string().nullable().optional()})); +const source_type_ideal = z.lazy(() => z.object({"bank": z.string().nullable().optional(), "bic": z.string().nullable().optional(), "iban_last4": z.string().nullable().optional(), "statement_descriptor": z.string().nullable().optional()})); +const source_type_klarna = z.lazy(() => z.object({"background_image_url": z.string().optional(), "client_token": z.string().nullable().optional(), "first_name": z.string().optional(), "last_name": z.string().optional(), "locale": z.string().optional(), "logo_url": z.string().optional(), "page_title": z.string().optional(), "pay_later_asset_urls_descriptive": z.string().optional(), "pay_later_asset_urls_standard": z.string().optional(), "pay_later_name": z.string().optional(), "pay_later_redirect_url": z.string().optional(), "pay_now_asset_urls_descriptive": z.string().optional(), "pay_now_asset_urls_standard": z.string().optional(), "pay_now_name": z.string().optional(), "pay_now_redirect_url": z.string().optional(), "pay_over_time_asset_urls_descriptive": z.string().optional(), "pay_over_time_asset_urls_standard": z.string().optional(), "pay_over_time_name": z.string().optional(), "pay_over_time_redirect_url": z.string().optional(), "payment_method_categories": z.string().optional(), "purchase_country": z.string().optional(), "purchase_type": z.string().optional(), "redirect_url": z.string().optional(), "shipping_delay": z.number().int().optional(), "shipping_first_name": z.string().optional(), "shipping_last_name": z.string().optional()})); +const source_type_multibanco = z.lazy(() => z.object({"entity": z.string().nullable().optional(), "reference": z.string().nullable().optional(), "refund_account_holder_address_city": z.string().nullable().optional(), "refund_account_holder_address_country": z.string().nullable().optional(), "refund_account_holder_address_line1": z.string().nullable().optional(), "refund_account_holder_address_line2": z.string().nullable().optional(), "refund_account_holder_address_postal_code": z.string().nullable().optional(), "refund_account_holder_address_state": z.string().nullable().optional(), "refund_account_holder_name": z.string().nullable().optional(), "refund_iban": z.string().nullable().optional()})); +const source_type_p24 = z.lazy(() => z.object({"reference": z.string().nullable().optional()})); +const source_type_sepa_credit_transfer = z.lazy(() => z.object({"bank_name": z.string().nullable().optional(), "bic": z.string().nullable().optional(), "iban": z.string().nullable().optional(), "refund_account_holder_address_city": z.string().nullable().optional(), "refund_account_holder_address_country": z.string().nullable().optional(), "refund_account_holder_address_line1": z.string().nullable().optional(), "refund_account_holder_address_line2": z.string().nullable().optional(), "refund_account_holder_address_postal_code": z.string().nullable().optional(), "refund_account_holder_address_state": z.string().nullable().optional(), "refund_account_holder_name": z.string().nullable().optional(), "refund_iban": z.string().nullable().optional()})); +const source_type_sepa_debit = z.lazy(() => z.object({"bank_code": z.string().nullable().optional(), "branch_code": z.string().nullable().optional(), "country": z.string().nullable().optional(), "fingerprint": z.string().nullable().optional(), "last4": z.string().nullable().optional(), "mandate_reference": z.string().nullable().optional(), "mandate_url": z.string().nullable().optional()})); +const source_type_sofort = z.lazy(() => z.object({"bank_code": z.string().nullable().optional(), "bank_name": z.string().nullable().optional(), "bic": z.string().nullable().optional(), "country": z.string().nullable().optional(), "iban_last4": z.string().nullable().optional(), "preferred_language": z.string().nullable().optional(), "statement_descriptor": z.string().nullable().optional()})); +const source_type_three_d_secure = z.lazy(() => z.object({"address_line1_check": z.string().nullable().optional(), "address_zip_check": z.string().nullable().optional(), "authenticated": z.boolean().nullable().optional(), "brand": z.string().nullable().optional(), "card": z.string().nullable().optional(), "country": z.string().nullable().optional(), "customer": z.string().nullable().optional(), "cvc_check": z.string().nullable().optional(), "description": z.string().optional(), "dynamic_last4": z.string().nullable().optional(), "exp_month": z.number().int().nullable().optional(), "exp_year": z.number().int().nullable().optional(), "fingerprint": z.string().optional(), "funding": z.string().nullable().optional(), "iin": z.string().optional(), "issuer": z.string().optional(), "last4": z.string().nullable().optional(), "name": z.string().nullable().optional(), "three_d_secure": z.string().optional(), "tokenization_method": z.string().nullable().optional()})); +const source_type_wechat = z.lazy(() => z.object({"prepay_id": z.string().optional(), "qr_code_url": z.string().nullable().optional(), "statement_descriptor": z.string().optional()})); +const stackable_discount_with_discount_settings: z.ZodTypeAny = z.lazy(() => z.object({"coupon": z.union([z.string(), coupon]).nullable(), "discount": z.union([z.string(), discount]).nullable(), "promotion_code": z.union([z.string(), promotion_code]).nullable()})); +const stackable_discount_with_discount_settings_and_discount_end: z.ZodTypeAny = z.lazy(() => z.object({"coupon": z.union([z.string(), coupon]).nullable(), "discount": z.union([z.string(), discount]).nullable(), "promotion_code": z.union([z.string(), promotion_code]).nullable()})); +const subscription: z.ZodTypeAny = z.lazy(() => z.object({"application": z.union([z.string(), application, deleted_application]).nullable(), "application_fee_percent": z.number().nullable(), "automatic_tax": subscription_automatic_tax, "billing_cycle_anchor": z.number().int(), "billing_cycle_anchor_config": subscriptions_resource_billing_cycle_anchor_config.nullable(), "billing_mode": subscriptions_resource_billing_mode, "billing_schedules": z.array(subscriptions_resource_billing_schedules), "billing_thresholds": subscription_billing_thresholds.nullable(), "cancel_at": z.number().int().nullable(), "cancel_at_period_end": z.boolean(), "canceled_at": z.number().int().nullable(), "cancellation_details": cancellation_details.nullable(), "collection_method": z.enum(["charge_automatically", "send_invoice"]), "created": z.number().int(), "currency": z.string(), "customer": z.union([z.string(), customer, deleted_customer]), "customer_account": z.string().nullable(), "days_until_due": z.number().int().nullable(), "default_payment_method": z.union([z.string(), payment_method]).nullable(), "default_source": z.union([z.string(), payment_source]).nullable(), "default_tax_rates": z.array(tax_rate).nullable().optional(), "description": z.string().nullable(), "discounts": z.array(z.union([z.string(), discount])), "ended_at": z.number().int().nullable(), "id": z.string(), "invoice_settings": subscriptions_resource_subscription_invoice_settings, "items": z.object({"data": z.array(subscription_item), "has_more": z.boolean(), "object": z.literal("list"), "url": z.string()}), "latest_invoice": z.union([z.string(), invoice]).nullable(), "livemode": z.boolean(), "managed_payments": smor_resource_managed_payments.nullable(), "metadata": z.record(z.string(), z.string()), "next_pending_invoice_item_invoice": z.number().int().nullable(), "object": z.literal("subscription"), "on_behalf_of": z.union([z.string(), account]).nullable(), "pause_collection": subscriptions_resource_pause_collection.nullable(), "payment_settings": subscriptions_resource_payment_settings.nullable(), "pending_invoice_item_interval": subscription_pending_invoice_item_interval.nullable(), "pending_setup_intent": z.union([z.string(), setup_intent]).nullable(), "pending_update": subscriptions_resource_pending_update.nullable(), "presentment_details": subscriptions_resource_subscription_presentment_details.optional(), "schedule": z.union([z.string(), subscription_schedule]).nullable(), "start_date": z.number().int(), "status": z.enum(["active", "canceled", "incomplete", "incomplete_expired", "past_due", "paused", "trialing", "unpaid"]), "test_clock": z.union([z.string(), test_helpers_test_clock]).nullable(), "transfer_data": subscription_transfer_data.nullable(), "trial_end": z.number().int().nullable(), "trial_settings": subscriptions_resource_trial_settings_trial_settings.nullable(), "trial_start": z.number().int().nullable()})); +const subscription_automatic_tax: z.ZodTypeAny = z.lazy(() => z.object({"disabled_reason": z.literal("requires_location_inputs").nullable(), "enabled": z.boolean(), "liability": connect_account_reference.nullable()})); +const subscription_billing_thresholds = z.lazy(() => z.object({"amount_gte": z.number().int().nullable(), "reset_billing_cycle_anchor": z.boolean().nullable()})); +const subscription_item: z.ZodTypeAny = z.lazy(() => z.object({"billed_until": z.number().int().optional(), "billing_thresholds": subscription_item_billing_thresholds.nullable(), "created": z.number().int(), "current_period_end": z.number().int(), "current_period_start": z.number().int(), "discounts": z.array(z.union([z.string(), discount])), "id": z.string(), "metadata": z.record(z.string(), z.string()), "object": z.literal("subscription_item"), "plan": plan, "price": price, "quantity": z.number().int().optional(), "subscription": z.string(), "tax_rates": z.array(tax_rate).nullable()})); +const subscription_item_billing_thresholds = z.lazy(() => z.object({"usage_gte": z.number().int().nullable()})); +const subscription_payment_method_options_card = z.lazy(() => z.object({"mandate_options": invoice_mandate_options_card.optional(), "network": z.enum(["amex", "cartes_bancaires", "diners", "discover", "eftpos_au", "girocard", "interac", "jcb", "link", "mastercard", "unionpay", "unknown", "visa"]).nullable(), "request_three_d_secure": z.enum(["any", "automatic", "challenge"]).nullable()})); +const subscription_payment_method_options_mandate_options_pix = z.lazy(() => z.object({"amount": z.number().int().nullable(), "amount_includes_iof": z.enum(["always", "never"]).nullable(), "end_date": z.string().nullable(), "payment_schedule": z.enum(["halfyearly", "monthly", "quarterly", "weekly", "yearly"]).nullable()})); +const subscription_payment_method_options_pix = z.lazy(() => z.object({"expires_after_seconds": z.number().int().optional(), "mandate_options": subscription_payment_method_options_mandate_options_pix.optional()})); +const subscription_pending_invoice_item_interval = z.lazy(() => z.object({"interval": z.enum(["day", "month", "week", "year"]), "interval_count": z.number().int()})); +const subscription_schedule: z.ZodTypeAny = z.lazy(() => z.object({"application": z.union([z.string(), application, deleted_application]).nullable(), "billing_mode": subscriptions_resource_billing_mode, "canceled_at": z.number().int().nullable(), "completed_at": z.number().int().nullable(), "created": z.number().int(), "current_phase": subscription_schedule_current_phase.nullable(), "customer": z.union([z.string(), customer, deleted_customer]), "customer_account": z.string().nullable(), "default_settings": subscription_schedules_resource_default_settings, "end_behavior": z.enum(["cancel", "none", "release", "renew"]), "id": z.string(), "livemode": z.boolean(), "metadata": z.record(z.string(), z.string()).nullable(), "object": z.literal("subscription_schedule"), "phases": z.array(subscription_schedule_phase_configuration), "released_at": z.number().int().nullable(), "released_subscription": z.string().nullable(), "status": z.enum(["active", "canceled", "completed", "not_started", "released"]), "subscription": z.union([z.string(), subscription]).nullable(), "test_clock": z.union([z.string(), test_helpers_test_clock]).nullable()})); +const subscription_schedule_add_invoice_item: z.ZodTypeAny = z.lazy(() => z.object({"discountable": z.boolean().nullable(), "discounts": z.array(discounts_resource_stackable_discount_with_discount_end), "metadata": z.record(z.string(), z.string()).nullable(), "period": subscription_schedule_add_invoice_item_period, "price": z.union([z.string(), price, deleted_price]), "quantity": z.number().int().nullable(), "tax_rates": z.array(tax_rate).nullable().optional()})); +const subscription_schedule_add_invoice_item_period = z.lazy(() => z.object({"end": subscription_schedules_resource_invoice_item_period_resource_period_end, "start": subscription_schedules_resource_invoice_item_period_resource_period_start})); +const subscription_schedule_configuration_item: z.ZodTypeAny = z.lazy(() => z.object({"billing_thresholds": subscription_item_billing_thresholds.nullable(), "discounts": z.array(stackable_discount_with_discount_settings), "metadata": z.record(z.string(), z.string()).nullable(), "plan": z.union([z.string(), plan, deleted_plan]), "price": z.union([z.string(), price, deleted_price]), "quantity": z.number().int().optional(), "tax_rates": z.array(tax_rate).nullable().optional()})); +const subscription_schedule_current_phase = z.lazy(() => z.object({"end_date": z.number().int(), "start_date": z.number().int()})); +const subscription_schedule_phase_configuration: z.ZodTypeAny = z.lazy(() => z.object({"add_invoice_items": z.array(subscription_schedule_add_invoice_item), "application_fee_percent": z.number().nullable(), "automatic_tax": schedules_phase_automatic_tax.optional(), "billing_cycle_anchor": z.enum(["automatic", "phase_start"]).nullable(), "billing_thresholds": subscription_billing_thresholds.nullable(), "collection_method": z.enum(["charge_automatically", "send_invoice"]).nullable(), "currency": z.string(), "default_payment_method": z.union([z.string(), payment_method]).nullable(), "default_tax_rates": z.array(tax_rate).nullable().optional(), "description": z.string().nullable(), "discounts": z.array(stackable_discount_with_discount_settings_and_discount_end), "end_date": z.number().int(), "invoice_settings": invoice_setting_subscription_schedule_phase_setting.nullable(), "items": z.array(subscription_schedule_configuration_item), "metadata": z.record(z.string(), z.string()).nullable(), "on_behalf_of": z.union([z.string(), account]).nullable(), "proration_behavior": z.enum(["always_invoice", "create_prorations", "none"]), "start_date": z.number().int(), "transfer_data": subscription_transfer_data.nullable(), "trial_end": z.number().int().nullable()})); +const subscription_schedules_resource_default_settings: z.ZodTypeAny = z.lazy(() => z.object({"application_fee_percent": z.number().nullable(), "automatic_tax": subscription_schedules_resource_default_settings_automatic_tax.optional(), "billing_cycle_anchor": z.enum(["automatic", "phase_start"]), "billing_thresholds": subscription_billing_thresholds.nullable(), "collection_method": z.enum(["charge_automatically", "send_invoice"]).nullable(), "default_payment_method": z.union([z.string(), payment_method]).nullable(), "description": z.string().nullable(), "invoice_settings": invoice_setting_subscription_schedule_setting, "on_behalf_of": z.union([z.string(), account]).nullable(), "transfer_data": subscription_transfer_data.nullable()})); +const subscription_schedules_resource_default_settings_automatic_tax: z.ZodTypeAny = z.lazy(() => z.object({"disabled_reason": z.literal("requires_location_inputs").nullable(), "enabled": z.boolean(), "liability": connect_account_reference.nullable()})); +const subscription_schedules_resource_invoice_item_period_resource_period_end = z.lazy(() => z.object({"timestamp": z.number().int().optional(), "type": z.enum(["min_item_period_end", "phase_end", "timestamp"])})); +const subscription_schedules_resource_invoice_item_period_resource_period_start = z.lazy(() => z.object({"timestamp": z.number().int().optional(), "type": z.enum(["max_item_period_start", "phase_start", "timestamp"])})); +const subscription_transfer_data: z.ZodTypeAny = z.lazy(() => z.object({"amount_percent": z.number().nullable(), "destination": z.union([z.string(), account])})); +const subscriptions_resource_billing_cycle_anchor_config = z.lazy(() => z.object({"day_of_month": z.number().int(), "hour": z.number().int().nullable(), "minute": z.number().int().nullable(), "month": z.number().int().nullable(), "second": z.number().int().nullable()})); +const subscriptions_resource_billing_mode = z.lazy(() => z.object({"flexible": subscriptions_resource_billing_mode_flexible.nullable(), "type": z.enum(["classic", "flexible"]), "updated_at": z.number().int().optional()})); +const subscriptions_resource_billing_mode_flexible = z.lazy(() => z.object({"proration_discounts": z.enum(["included", "itemized"]).optional()})); +const subscriptions_resource_billing_schedules = z.lazy(() => z.object({"applies_to": z.array(subscriptions_resource_billing_schedules_applies_to).nullable(), "bill_until": subscriptions_resource_billing_schedules_bill_until, "key": z.string()})); +const subscriptions_resource_billing_schedules_applies_to = z.lazy(() => z.object({"price": z.union([z.string(), price]).nullable(), "type": z.literal("price")})); +const subscriptions_resource_billing_schedules_bill_until = z.lazy(() => z.object({"computed_timestamp": z.number().int(), "duration": subscriptions_resource_billing_schedules_bill_until_duration.nullable(), "timestamp": z.number().int().nullable(), "type": z.enum(["duration", "timestamp"])})); +const subscriptions_resource_billing_schedules_bill_until_duration = z.lazy(() => z.object({"interval": z.enum(["day", "month", "week", "year"]), "interval_count": z.number().int().nullable()})); +const subscriptions_resource_pause_collection = z.lazy(() => z.object({"behavior": z.enum(["keep_as_draft", "mark_uncollectible", "void"]), "resumes_at": z.number().int().nullable()})); +const subscriptions_resource_payment_method_options = z.lazy(() => z.object({"acss_debit": invoice_payment_method_options_acss_debit.nullable(), "bancontact": invoice_payment_method_options_bancontact.nullable(), "card": subscription_payment_method_options_card.nullable(), "customer_balance": invoice_payment_method_options_customer_balance.nullable(), "konbini": invoice_payment_method_options_konbini.nullable(), "payto": invoice_payment_method_options_payto.nullable(), "pix": subscription_payment_method_options_pix.nullable(), "sepa_debit": invoice_payment_method_options_sepa_debit.nullable(), "upi": invoice_payment_method_options_upi.nullable(), "us_bank_account": invoice_payment_method_options_us_bank_account.nullable()})); +const subscriptions_resource_payment_settings = z.lazy(() => z.object({"payment_method_options": subscriptions_resource_payment_method_options.nullable(), "payment_method_types": z.array(z.enum(["ach_credit_transfer", "ach_debit", "acss_debit", "affirm", "amazon_pay", "au_becs_debit", "bacs_debit", "bancontact", "boleto", "card", "cashapp", "crypto", "custom", "customer_balance", "eps", "fpx", "giropay", "grabpay", "ideal", "jp_credit_transfer", "kakao_pay", "klarna", "konbini", "kr_card", "link", "multibanco", "naver_pay", "nz_bank_account", "p24", "pay_by_bank", "payco", "paynow", "paypal", "payto", "pix", "promptpay", "revolut_pay", "satispay", "sepa_credit_transfer", "sepa_debit", "sofort", "swish", "twint", "upi", "us_bank_account", "wechat_pay"])).nullable(), "save_default_payment_method": z.enum(["off", "on_subscription"]).nullable()})); +const subscriptions_resource_pending_update: z.ZodTypeAny = z.lazy(() => z.object({"billing_cycle_anchor": z.number().int().nullable(), "discount": discount.nullable(), "discounts": z.array(z.union([z.string(), discount])).nullable(), "expires_at": z.number().int(), "metadata": z.record(z.string(), z.string()).nullable(), "subscription_items": z.array(subscription_item).nullable(), "trial_end": z.number().int().nullable(), "trial_from_plan": z.boolean().nullable()})); +const subscriptions_resource_subscription_invoice_settings: z.ZodTypeAny = z.lazy(() => z.object({"account_tax_ids": z.array(z.union([z.string(), tax_id, deleted_tax_id])).nullable(), "custom_fields": z.array(invoice_setting_custom_field).nullable(), "description": z.string().nullable(), "footer": z.string().nullable(), "issuer": connect_account_reference})); +const subscriptions_resource_subscription_presentment_details = z.lazy(() => z.object({"presentment_currency": z.string()})); +const subscriptions_resource_trial_settings_end_behavior = z.lazy(() => z.object({"missing_payment_method": z.enum(["cancel", "create_invoice", "pause"])})); +const subscriptions_resource_trial_settings_trial_settings = z.lazy(() => z.object({"end_behavior": subscriptions_resource_trial_settings_end_behavior})); +const tax_code = z.lazy(() => z.object({"description": z.string(), "id": z.string(), "name": z.string(), "object": z.literal("tax_code")})); +const tax_deducted_at_source = z.lazy(() => z.object({"id": z.string(), "object": z.literal("tax_deducted_at_source"), "period_end": z.number().int(), "period_start": z.number().int(), "tax_deduction_account_number": z.string()})); +const tax_i_ds_owner: z.ZodTypeAny = z.lazy(() => z.object({"account": z.union([z.string(), account]).optional(), "application": z.union([z.string(), application]).optional(), "customer": z.union([z.string(), customer]).optional(), "customer_account": z.string().nullable(), "type": z.enum(["account", "application", "customer", "self"])})); +const tax_id: z.ZodTypeAny = z.lazy(() => z.object({"country": z.string().nullable(), "created": z.number().int(), "customer": z.union([z.string(), customer]).nullable(), "customer_account": z.string().nullable(), "id": z.string(), "livemode": z.boolean(), "object": z.literal("tax_id"), "owner": tax_i_ds_owner.nullable(), "type": z.enum(["ad_nrt", "ae_trn", "al_tin", "am_tin", "ao_tin", "ar_cuit", "au_abn", "au_arn", "aw_tin", "az_tin", "ba_tin", "bb_tin", "bd_bin", "bf_ifu", "bg_uic", "bh_vat", "bj_ifu", "bo_tin", "br_cnpj", "br_cpf", "bs_tin", "by_tin", "ca_bn", "ca_gst_hst", "ca_pst_bc", "ca_pst_mb", "ca_pst_sk", "ca_qst", "cd_nif", "ch_uid", "ch_vat", "cl_tin", "cm_niu", "cn_tin", "co_nit", "cr_tin", "cv_nif", "de_stn", "do_rcn", "ec_ruc", "eg_tin", "es_cif", "et_tin", "eu_oss_vat", "eu_vat", "fo_vat", "gb_vat", "ge_vat", "gi_tin", "gn_nif", "hk_br", "hr_oib", "hu_tin", "id_npwp", "il_vat", "in_gst", "is_vat", "it_cf", "jp_cn", "jp_rn", "jp_trn", "ke_pin", "kg_tin", "kh_tin", "kr_brn", "kz_bin", "la_tin", "li_uid", "li_vat", "lk_vat", "ma_vat", "md_vat", "me_pib", "mk_vat", "mr_nif", "mx_rfc", "my_frp", "my_itn", "my_sst", "ng_tin", "no_vat", "no_voec", "np_pan", "nz_gst", "om_vat", "pe_ruc", "ph_tin", "pl_nip", "py_ruc", "ro_tin", "rs_pib", "ru_inn", "ru_kpp", "sa_vat", "sg_gst", "sg_uen", "si_tin", "sn_ninea", "sr_fin", "sv_nit", "th_vat", "tj_tin", "tr_tin", "tw_vat", "tz_vat", "ua_vat", "ug_tin", "unknown", "us_ein", "uy_ruc", "uz_tin", "uz_vat", "ve_rif", "vn_tin", "za_vat", "zm_tin", "zw_tin"]), "value": z.string(), "verification": tax_id_verification.nullable()})); +const tax_id_verification = z.lazy(() => z.object({"status": z.enum(["pending", "unavailable", "unverified", "verified"]), "verified_address": z.string().nullable(), "verified_name": z.string().nullable()})); +const tax_rate = z.lazy(() => z.object({"active": z.boolean(), "country": z.string().nullable(), "created": z.number().int(), "description": z.string().nullable(), "display_name": z.string(), "effective_percentage": z.number().nullable(), "flat_amount": tax_rate_flat_amount.nullable(), "id": z.string(), "inclusive": z.boolean(), "jurisdiction": z.string().nullable(), "jurisdiction_level": z.enum(["city", "country", "county", "district", "multiple", "state"]).nullable(), "livemode": z.boolean(), "metadata": z.record(z.string(), z.string()).nullable(), "object": z.literal("tax_rate"), "percentage": z.number(), "rate_type": z.enum(["flat_amount", "percentage"]).nullable(), "state": z.string().nullable(), "tax_type": z.enum(["amusement_tax", "communications_tax", "gst", "hst", "igst", "jct", "lease_tax", "pst", "qst", "retail_delivery_fee", "rst", "sales_tax", "service_tax", "vat"]).nullable()})); +const tax_rate_flat_amount = z.lazy(() => z.object({"amount": z.number().int(), "currency": z.string()})); +const test_helpers_test_clock = z.lazy(() => z.object({"created": z.number().int(), "deletes_after": z.number().int(), "frozen_time": z.number().int(), "id": z.string(), "livemode": z.boolean(), "name": z.string().nullable(), "object": z.literal("test_helpers.test_clock"), "status": z.enum(["advancing", "internal_failure", "ready"]), "status_details": billing_clocks_resource_status_details_status_details})); +const three_d_secure_details = z.lazy(() => z.object({"authentication_flow": z.enum(["challenge", "frictionless"]).nullable(), "electronic_commerce_indicator": z.enum(["01", "02", "05", "06", "07"]).nullable(), "result": z.enum(["attempt_acknowledged", "authenticated", "exempted", "failed", "not_supported", "processing_error"]).nullable(), "result_reason": z.enum(["abandoned", "bypassed", "canceled", "card_not_enrolled", "network_not_supported", "protocol_error", "rejected"]).nullable(), "transaction_id": z.string().nullable(), "version": z.enum(["1.0.2", "2.1.0", "2.2.0", "2.3.0", "2.3.1"]).nullable()})); +const three_d_secure_details_charge = z.lazy(() => z.object({"authentication_flow": z.enum(["challenge", "frictionless"]).nullable(), "electronic_commerce_indicator": z.enum(["01", "02", "05", "06", "07"]).nullable(), "exemption_indicator": z.enum(["low_risk", "none"]).nullable(), "exemption_indicator_applied": z.boolean().optional(), "result": z.enum(["attempt_acknowledged", "authenticated", "exempted", "failed", "not_supported", "processing_error"]).nullable(), "result_reason": z.enum(["abandoned", "bypassed", "canceled", "card_not_enrolled", "network_not_supported", "protocol_error", "rejected"]).nullable(), "transaction_id": z.string().nullable(), "version": z.enum(["1.0.2", "2.1.0", "2.2.0", "2.3.0", "2.3.1"]).nullable()})); +const three_d_secure_usage = z.lazy(() => z.object({"supported": z.boolean()})); +const token_card_networks = z.lazy(() => z.object({"preferred": z.string().nullable()})); +const topup: z.ZodTypeAny = z.lazy(() => z.object({"amount": z.number().int(), "balance_transaction": z.union([z.string(), balance_transaction]).nullable(), "created": z.number().int(), "currency": z.string(), "description": z.string().nullable(), "expected_availability_date": z.number().int().nullable(), "failure_code": z.string().nullable(), "failure_message": z.string().nullable(), "id": z.string(), "livemode": z.boolean(), "metadata": z.record(z.string(), z.string()), "object": z.literal("topup"), "source": source.nullable(), "statement_descriptor": z.string().nullable(), "status": z.enum(["canceled", "failed", "pending", "reversed", "succeeded"]), "transfer_group": z.string().nullable()})); +const transfer: z.ZodTypeAny = z.lazy(() => z.object({"amount": z.number().int(), "amount_reversed": z.number().int(), "balance_transaction": z.union([z.string(), balance_transaction]).nullable(), "created": z.number().int(), "currency": z.string(), "description": z.string().nullable(), "destination": z.union([z.string(), account]).nullable(), "destination_payment": z.union([z.string(), charge]).optional(), "id": z.string(), "livemode": z.boolean(), "metadata": z.record(z.string(), z.string()), "object": z.literal("transfer"), "reversals": z.object({"data": z.array(transfer_reversal), "has_more": z.boolean(), "object": z.literal("list"), "url": z.string()}), "reversed": z.boolean(), "source_transaction": z.union([z.string(), charge]).nullable(), "source_type": z.string().optional(), "transfer_group": z.string().nullable()})); +const transfer_data: z.ZodTypeAny = z.lazy(() => z.object({"amount": z.number().int().optional(), "description": z.string().optional(), "destination": z.union([z.string(), account]), "metadata": z.record(z.string(), z.string()).optional(), "payment_data": payment_data.optional()})); +const transfer_reversal: z.ZodTypeAny = z.lazy(() => z.object({"amount": z.number().int(), "balance_transaction": z.union([z.string(), balance_transaction]).nullable(), "created": z.number().int(), "currency": z.string(), "destination_payment_refund": z.union([z.string(), refund]).nullable(), "id": z.string(), "metadata": z.record(z.string(), z.string()).nullable(), "object": z.literal("transfer_reversal"), "source_refund": z.union([z.string(), refund]).nullable(), "transfer": z.union([z.string(), transfer])})); +const transfer_schedule = z.lazy(() => z.object({"delay_days": z.number().int(), "interval": z.string(), "monthly_anchor": z.number().int().optional(), "monthly_payout_days": z.array(z.number().int()).optional(), "weekly_anchor": z.string().optional(), "weekly_payout_days": z.array(z.enum(["friday", "monday", "thursday", "tuesday", "wednesday"])).optional()})); +const transform_quantity = z.lazy(() => z.object({"divide_by": z.number().int(), "round": z.enum(["down", "up"])})); +const transform_usage = z.lazy(() => z.object({"divide_by": z.number().int(), "round": z.enum(["down", "up"])})); +const us_bank_account_networks = z.lazy(() => z.object({"preferred": z.string().nullable(), "supported": z.array(z.enum(["ach", "us_domestic_wire"]))})); export const schemas = { account, diff --git a/actions/twilio-action/src/generated/twilio-schemas.ts b/actions/twilio-action/src/generated/twilio-schemas.ts index 99df62e..278cf1d 100644 --- a/actions/twilio-action/src/generated/twilio-schemas.ts +++ b/actions/twilio-action/src/generated/twilio-schemas.ts @@ -2,7 +2,7 @@ // Regenerate with the action's `generate:*-schemas` npm script. import {z} from "zod"; -const TwilioMessage = z.lazy(() => z.object({"body": z.string().nullable().optional(), "num_segments": z.string().nullable().optional(), "direction": message_enum_direction.optional(), "from": z.string().nullable().optional(), "to": z.string().nullable().optional(), "date_updated": z.string().nullable().optional(), "price": z.string().nullable().optional(), "error_message": z.string().nullable().optional(), "uri": z.string().nullable().optional(), "account_sid": z.string().nullable().optional(), "num_media": z.string().nullable().optional(), "status": message_enum_status.optional(), "messaging_service_sid": z.string().nullable().optional(), "sid": z.string().nullable().optional(), "date_sent": z.string().nullable().optional(), "date_created": z.string().nullable().optional(), "error_code": z.number().int().nullable().optional(), "price_unit": z.string().nullable().optional(), "api_version": z.string().nullable().optional(), "subresource_uris": z.record(z.string(), z.any()).nullable().optional()}).passthrough()); +const TwilioMessage = z.lazy(() => z.object({"body": z.string().nullable().optional(), "num_segments": z.string().nullable().optional(), "direction": message_enum_direction.optional(), "from": z.string().nullable().optional(), "to": z.string().nullable().optional(), "date_updated": z.string().nullable().optional(), "price": z.string().nullable().optional(), "error_message": z.string().nullable().optional(), "uri": z.string().nullable().optional(), "account_sid": z.string().nullable().optional(), "num_media": z.string().nullable().optional(), "status": message_enum_status.optional(), "messaging_service_sid": z.string().nullable().optional(), "sid": z.string().nullable().optional(), "date_sent": z.string().nullable().optional(), "date_created": z.string().nullable().optional(), "error_code": z.number().int().nullable().optional(), "price_unit": z.string().nullable().optional(), "api_version": z.string().nullable().optional(), "subresource_uris": z.record(z.string(), z.any()).nullable().optional()})); const message_enum_direction = z.lazy(() => z.enum(["inbound", "outbound-api", "outbound-call", "outbound-reply"])); const message_enum_status = z.lazy(() => z.enum(["queued", "sending", "sent", "failed", "delivered", "undelivered", "receiving", "received", "accepted", "scheduled", "read", "partially_delivered", "canceled"])); @@ -11,3 +11,6 @@ export const schemas = { message_enum_direction, message_enum_status, }; + +export const recursiveSchemaNames = [ +] as const; diff --git a/actions/woocommerce-action/src/generated/woocommerce-schemas.ts b/actions/woocommerce-action/src/generated/woocommerce-schemas.ts index 823afaa..749430a 100644 --- a/actions/woocommerce-action/src/generated/woocommerce-schemas.ts +++ b/actions/woocommerce-action/src/generated/woocommerce-schemas.ts @@ -2,16 +2,16 @@ // Regenerate with the action's `generate:*-schemas` npm script. import {z} from "zod"; -const Billing = z.lazy(() => z.object({"first_name": z.string().optional(), "last_name": z.string().optional(), "company": z.string().optional(), "address_1": z.string().optional(), "address_2": z.string().optional(), "city": z.string().optional(), "state": z.string().optional(), "postcode": z.string().optional(), "country": z.string().optional(), "email": z.string().optional(), "phone": z.string().optional()}).passthrough()); -const MetaData = z.lazy(() => z.object({"id": z.number().int().optional(), "key": z.string().optional(), "value": z.record(z.string(), z.any()).optional(), "display_key": z.string().optional(), "display_value": z.record(z.string(), z.any()).optional()}).passthrough()); -const Order = z.lazy(() => z.object({"id": z.number().int().optional(), "parent_id": z.number().int().optional(), "number": z.string().optional(), "order_key": z.string().optional(), "created_via": z.string().optional(), "version": z.string().optional(), "status": z.string().optional(), "currency": z.enum(["AED", "AFN", "ALL", "AMD", "ANG", "AOA", "ARS", "AUD", "AWG", "AZN", "BAM", "BBD", "BDT", "BGN", "BHD", "BIF", "BMD", "BND", "BOB", "BRL", "BSD", "BTC", "BTN", "BWP", "BYR", "BYN", "BZD", "CAD", "CDF", "CHF", "CLP", "CNY", "COP", "CRC", "CUC", "CUP", "CVE", "CZK", "DJF", "DKK", "DOP", "DZD", "EGP", "ERN", "ETB", "EUR", "FJD", "FKP", "GBP", "GEL", "GGP", "GHS", "GIP", "GMD", "GNF", "GTQ", "GYD", "HKD", "HNL", "HRK", "HTG", "HUF", "IDR", "ILS", "IMP", "INR", "IQD", "IRR", "IRT", "ISK", "JEP", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LYD", "MAD", "MDL", "MGA", "MKD", "MMK", "MNT", "MOP", "MRU", "MUR", "MVR", "MWK", "MXN", "MYR", "MZN", "NAD", "NGN", "NIO", "NOK", "NPR", "NZD", "OMR", "PAB", "PEN", "PGK", "PHP", "PKR", "PLN", "PRB", "PYG", "QAR", "RON", "RSD", "RUB", "RWF", "SAR", "SBD", "SCR", "SDG", "SEK", "SGD", "SHP", "SLL", "SOS", "SRD", "SSP", "STN", "SYP", "SZL", "THB", "TJS", "TMT", "TND", "TOP", "TRY", "TTD", "TWD", "TZS", "UAH", "UGX", "USD", "UYU", "UZS", "VEF", "VES", "VND", "VUV", "WST", "XAF", "XCD", "XOF", "XPF", "YER", "ZAR", "ZMW"]).optional(), "date_created": z.string().optional(), "date_created_gmt": z.string().optional(), "date_modified": z.string().optional(), "date_modified_gmt": z.string().optional(), "discount_total": z.string().optional(), "discount_tax": z.string().optional(), "shipping_total": z.string().optional(), "shipping_tax": z.string().optional(), "cart_tax": z.string().optional(), "total": z.string().optional(), "total_tax": z.string().optional(), "prices_include_tax": z.boolean().optional(), "customer_id": z.number().int().optional(), "customer_ip_address": z.string().optional(), "customer_user_agent": z.string().optional(), "customer_note": z.string().optional(), "billing": Billing.optional(), "shipping": Shipping.optional(), "payment_method": z.string().optional(), "payment_method_title": z.string().optional(), "transaction_id": z.string().optional(), "date_paid": z.string().optional(), "date_paid_gmt": z.string().optional(), "date_completed": z.string().optional(), "date_completed_gmt": z.string().optional(), "cart_hash": z.string().optional(), "meta_data": z.array(MetaData).optional(), "line_items": z.array(OrderLineItem).optional(), "tax_lines": z.array(OrderTaxLine).optional(), "shipping_lines": z.array(OrderShippingLine).optional(), "fee_lines": z.array(OrderFeeLine).optional(), "coupon_lines": z.array(OrderCouponLine).optional(), "refunds": z.array(OrderRefund).optional(), "set_paid": z.boolean().optional()}).passthrough()); -const OrderCouponLine = z.lazy(() => z.object({"id": z.number().int().optional(), "code": z.string().optional(), "discount": z.string().optional(), "discount_tax": z.string().optional(), "meta_data": z.array(MetaData).optional()}).passthrough()); -const OrderFeeLine = z.lazy(() => z.object({"id": z.number().int().optional(), "name": z.string().optional(), "tax_class": z.string().optional(), "tax_status": z.string().optional(), "total": z.string().optional(), "total_tax": z.string().optional(), "taxes": z.array(OrderTaxLine).optional(), "meta_data": z.array(MetaData).optional()}).passthrough()); -const OrderLineItem = z.lazy(() => z.object({"id": z.number().int().optional(), "name": z.string().optional(), "parent_name": z.string().optional(), "product_id": z.number().int().optional(), "variation_id": z.number().int().optional(), "quantity": z.number().int().optional(), "tax_class": z.string().optional(), "subtotal": z.string().optional(), "subtotal_tax": z.string().optional(), "total": z.string().optional(), "total_tax": z.string().optional(), "taxes": z.array(OrderTaxLine).optional(), "meta_data": z.array(MetaData).optional(), "sku": z.string().optional(), "price": z.number().optional()}).passthrough()); -const OrderRefund = z.lazy(() => z.object({"id": z.number().int().optional(), "reason": z.string().optional(), "total": z.string().optional(), "date_created": z.string().optional(), "date_created_gmt": z.string().optional(), "amount": z.string().optional(), "api_refund": z.boolean().optional(), "line_items": z.array(z.object({"id": z.number().int().optional(), "name": z.string().optional(), "product_id": z.number().int().optional(), "variation_id": z.number().int().optional(), "quantity": z.number().int().optional(), "tax_class": z.string().optional(), "subtotal": z.string().optional(), "subtotal_tax": z.string().optional(), "total": z.string().optional(), "total_tax": z.string().optional(), "taxes": z.array(z.object({"id": z.number().int().optional(), "total": z.string().optional(), "subtotal": z.string().optional()}).passthrough()).optional(), "meta_data": z.array(MetaData).optional(), "sku": z.string().optional(), "price": z.number().optional()}).passthrough()).optional(), "refunded_by": z.number().int().optional(), "refunded_payment": z.boolean().optional(), "meta_data": z.array(MetaData).optional()}).passthrough()); -const OrderShippingLine = z.lazy(() => z.object({"id": z.number().int().optional(), "method_title": z.string().optional(), "method_id": z.string().optional(), "instance_id": z.string().optional(), "total": z.string().optional(), "total_tax": z.string().optional(), "taxes": z.array(OrderTaxLine).optional(), "meta_data": z.array(MetaData).optional()}).passthrough()); -const OrderTaxLine = z.lazy(() => z.object({"id": z.number().int().optional(), "rate_code": z.string().optional(), "rate_id": z.string().optional(), "label": z.string().optional(), "compound": z.boolean().optional(), "tax_total": z.string().optional(), "shipping_tax_total": z.string().optional(), "meta_data": z.array(MetaData).optional()}).passthrough()); -const Shipping = z.lazy(() => z.object({"first_name": z.string().optional(), "last_name": z.string().optional(), "company": z.string().optional(), "address_1": z.string().optional(), "address_2": z.string().optional(), "city": z.string().optional(), "state": z.string().optional(), "postcode": z.string().optional(), "country": z.string().optional(), "phone": z.string().optional()}).passthrough()); +const Billing = z.lazy(() => z.object({"first_name": z.string().optional(), "last_name": z.string().optional(), "company": z.string().optional(), "address_1": z.string().optional(), "address_2": z.string().optional(), "city": z.string().optional(), "state": z.string().optional(), "postcode": z.string().optional(), "country": z.string().optional(), "email": z.string().optional(), "phone": z.string().optional()})); +const MetaData = z.lazy(() => z.object({"id": z.number().int().optional(), "key": z.string().optional(), "value": z.record(z.string(), z.any()).optional(), "display_key": z.string().optional(), "display_value": z.record(z.string(), z.any()).optional()})); +const Order = z.lazy(() => z.object({"id": z.number().int().optional(), "parent_id": z.number().int().optional(), "number": z.string().optional(), "order_key": z.string().optional(), "created_via": z.string().optional(), "version": z.string().optional(), "status": z.string().optional(), "currency": z.enum(["AED", "AFN", "ALL", "AMD", "ANG", "AOA", "ARS", "AUD", "AWG", "AZN", "BAM", "BBD", "BDT", "BGN", "BHD", "BIF", "BMD", "BND", "BOB", "BRL", "BSD", "BTC", "BTN", "BWP", "BYR", "BYN", "BZD", "CAD", "CDF", "CHF", "CLP", "CNY", "COP", "CRC", "CUC", "CUP", "CVE", "CZK", "DJF", "DKK", "DOP", "DZD", "EGP", "ERN", "ETB", "EUR", "FJD", "FKP", "GBP", "GEL", "GGP", "GHS", "GIP", "GMD", "GNF", "GTQ", "GYD", "HKD", "HNL", "HRK", "HTG", "HUF", "IDR", "ILS", "IMP", "INR", "IQD", "IRR", "IRT", "ISK", "JEP", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LYD", "MAD", "MDL", "MGA", "MKD", "MMK", "MNT", "MOP", "MRU", "MUR", "MVR", "MWK", "MXN", "MYR", "MZN", "NAD", "NGN", "NIO", "NOK", "NPR", "NZD", "OMR", "PAB", "PEN", "PGK", "PHP", "PKR", "PLN", "PRB", "PYG", "QAR", "RON", "RSD", "RUB", "RWF", "SAR", "SBD", "SCR", "SDG", "SEK", "SGD", "SHP", "SLL", "SOS", "SRD", "SSP", "STN", "SYP", "SZL", "THB", "TJS", "TMT", "TND", "TOP", "TRY", "TTD", "TWD", "TZS", "UAH", "UGX", "USD", "UYU", "UZS", "VEF", "VES", "VND", "VUV", "WST", "XAF", "XCD", "XOF", "XPF", "YER", "ZAR", "ZMW"]).optional(), "date_created": z.string().optional(), "date_created_gmt": z.string().optional(), "date_modified": z.string().optional(), "date_modified_gmt": z.string().optional(), "discount_total": z.string().optional(), "discount_tax": z.string().optional(), "shipping_total": z.string().optional(), "shipping_tax": z.string().optional(), "cart_tax": z.string().optional(), "total": z.string().optional(), "total_tax": z.string().optional(), "prices_include_tax": z.boolean().optional(), "customer_id": z.number().int().optional(), "customer_ip_address": z.string().optional(), "customer_user_agent": z.string().optional(), "customer_note": z.string().optional(), "billing": Billing.optional(), "shipping": Shipping.optional(), "payment_method": z.string().optional(), "payment_method_title": z.string().optional(), "transaction_id": z.string().optional(), "date_paid": z.string().optional(), "date_paid_gmt": z.string().optional(), "date_completed": z.string().optional(), "date_completed_gmt": z.string().optional(), "cart_hash": z.string().optional(), "meta_data": z.array(MetaData).optional(), "line_items": z.array(OrderLineItem).optional(), "tax_lines": z.array(OrderTaxLine).optional(), "shipping_lines": z.array(OrderShippingLine).optional(), "fee_lines": z.array(OrderFeeLine).optional(), "coupon_lines": z.array(OrderCouponLine).optional(), "refunds": z.array(OrderRefund).optional(), "set_paid": z.boolean().optional()})); +const OrderCouponLine = z.lazy(() => z.object({"id": z.number().int().optional(), "code": z.string().optional(), "discount": z.string().optional(), "discount_tax": z.string().optional(), "meta_data": z.array(MetaData).optional()})); +const OrderFeeLine = z.lazy(() => z.object({"id": z.number().int().optional(), "name": z.string().optional(), "tax_class": z.string().optional(), "tax_status": z.string().optional(), "total": z.string().optional(), "total_tax": z.string().optional(), "taxes": z.array(OrderTaxLine).optional(), "meta_data": z.array(MetaData).optional()})); +const OrderLineItem = z.lazy(() => z.object({"id": z.number().int().optional(), "name": z.string().optional(), "parent_name": z.string().optional(), "product_id": z.number().int().optional(), "variation_id": z.number().int().optional(), "quantity": z.number().int().optional(), "tax_class": z.string().optional(), "subtotal": z.string().optional(), "subtotal_tax": z.string().optional(), "total": z.string().optional(), "total_tax": z.string().optional(), "taxes": z.array(OrderTaxLine).optional(), "meta_data": z.array(MetaData).optional(), "sku": z.string().optional(), "price": z.number().optional()})); +const OrderRefund = z.lazy(() => z.object({"id": z.number().int().optional(), "reason": z.string().optional(), "total": z.string().optional(), "date_created": z.string().optional(), "date_created_gmt": z.string().optional(), "amount": z.string().optional(), "api_refund": z.boolean().optional(), "line_items": z.array(z.object({"id": z.number().int().optional(), "name": z.string().optional(), "product_id": z.number().int().optional(), "variation_id": z.number().int().optional(), "quantity": z.number().int().optional(), "tax_class": z.string().optional(), "subtotal": z.string().optional(), "subtotal_tax": z.string().optional(), "total": z.string().optional(), "total_tax": z.string().optional(), "taxes": z.array(z.object({"id": z.number().int().optional(), "total": z.string().optional(), "subtotal": z.string().optional()})).optional(), "meta_data": z.array(MetaData).optional(), "sku": z.string().optional(), "price": z.number().optional()})).optional(), "refunded_by": z.number().int().optional(), "refunded_payment": z.boolean().optional(), "meta_data": z.array(MetaData).optional()})); +const OrderShippingLine = z.lazy(() => z.object({"id": z.number().int().optional(), "method_title": z.string().optional(), "method_id": z.string().optional(), "instance_id": z.string().optional(), "total": z.string().optional(), "total_tax": z.string().optional(), "taxes": z.array(OrderTaxLine).optional(), "meta_data": z.array(MetaData).optional()})); +const OrderTaxLine = z.lazy(() => z.object({"id": z.number().int().optional(), "rate_code": z.string().optional(), "rate_id": z.string().optional(), "label": z.string().optional(), "compound": z.boolean().optional(), "tax_total": z.string().optional(), "shipping_tax_total": z.string().optional(), "meta_data": z.array(MetaData).optional()})); +const Shipping = z.lazy(() => z.object({"first_name": z.string().optional(), "last_name": z.string().optional(), "company": z.string().optional(), "address_1": z.string().optional(), "address_2": z.string().optional(), "city": z.string().optional(), "state": z.string().optional(), "postcode": z.string().optional(), "country": z.string().optional(), "phone": z.string().optional()})); export const schemas = { Billing, @@ -25,3 +25,6 @@ export const schemas = { OrderTaxLine, Shipping, }; + +export const recursiveSchemaNames = [ +] as const; diff --git a/scripts/openapi-to-zod.mjs b/scripts/openapi-to-zod.mjs index 72b0303..6f4b30c 100644 --- a/scripts/openapi-to-zod.mjs +++ b/scripts/openapi-to-zod.mjs @@ -14,10 +14,12 @@ // run out of heap on large specs such as Stripe's. // // Nested objects therefore become real typed structures rather than untyped -// passthrough objects. The only remaining "open" values are fields the spec -// itself leaves shapeless (an object with no declared properties); those become -// `z.record(z.string(), z.any())` — a typed arbitrary object, never an empty -// `z.object({}).passthrough()`. +// passthrough objects. An object that declares properties stays closed, so the +// emitted type carries exactly the fields the spec names - the platform +// suggests fields from that type, and an index signature would both hide the +// real shape and offer nothing to suggest. The only remaining "open" values are +// fields the spec itself leaves shapeless (an object with no declared +// properties); those become `z.record(z.string(), z.any())`. // // The generator aims to handle every type-affecting construct of the OpenAPI // 3.0 / 3.1 Schema Object: $ref, type (incl. "null" and type arrays), enum, @@ -178,7 +180,11 @@ const objectExpr = (node) => { if ((additional && typeof additional === "object") || pattern) { return `${object}.catchall(${openValue()})`; } - return `${object}.passthrough()`; // allow unknown extra keys + // A declared shape stays closed even where the spec would allow extra + // keys: the platform suggests fields from the type, so an index + // signature offers nothing to suggest and hides the real shape. Unknown + // keys are dropped on parse rather than carried along untyped. + return object; } // No declared properties: a typed map or a shapeless open object. @@ -221,24 +227,29 @@ const localTypeExpr = (node) => { return "z.any()"; }; +// Whether a node carries constraints of its own next to a combinator. Those +// apply on top of the composed schemas, so they must not be dropped. +const hasLocalShape = (node) => + node.properties || node.items || node.additionalProperties !== undefined || + (node.type && node.type !== "object" && node.type !== "array"); + // Core expression for a node, before nullability is applied. const coreExpr = (node) => { if (node.allOf) { const members = node.allOf.map(toZod); // allOf may also carry local constraints alongside the composed schemas. - const hasLocalShape = - node.properties || node.items || node.additionalProperties !== undefined || - (node.type && node.type !== "object" && node.type !== "array"); - if (hasLocalShape) { + if (hasLocalShape(node)) { members.push(localTypeExpr(node)); } return intersection(members); } - if (node.anyOf) { - return union(node.anyOf.map(toZod)); - } - if (node.oneOf) { - return union(node.oneOf.map(toZod)); + // A node may list its properties and additionally require one of several + // variants (GitHub's check run bodies do). The value has to satisfy both, + // so the local shape intersects the union instead of being replaced by it. + const branches = node.anyOf ?? node.oneOf; + if (branches) { + const composed = union(branches.map(toZod)); + return hasLocalShape(node) ? intersection([localTypeExpr(node), composed]) : composed; } if (typeof node.$ref === "string") { return refName(node.$ref); From b616dcec6846347a0ff45e5f9d88483aa8309e4b Mon Sep 17 00:00:00 2001 From: nicosammito Date: Mon, 26 Oct 2026 16:16:37 +0100 Subject: [PATCH 15/19] feat: add GitHub reference data types for labels, users, and milestones --- .../data_types/references/githubReferences.ts | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 actions/github-action/src/data_types/references/githubReferences.ts diff --git a/actions/github-action/src/data_types/references/githubReferences.ts b/actions/github-action/src/data_types/references/githubReferences.ts new file mode 100644 index 0000000..e7bd065 --- /dev/null +++ b/actions/github-action/src/data_types/references/githubReferences.ts @@ -0,0 +1,39 @@ +import { DisplayMessage, Identifier, Name, Schema } from "@code0-tech/hercules" +import { z } from "zod" + +/* + * Reference types for values that a workflow either types out by hand or takes from an earlier + * function. GitHub wants a label name, a user login, and a milestone number in request bodies, + * but the functions in this action return whole label, user, and milestone objects. Accepting + * both shapes keeps those outputs referenceable as variables without reshaping any response. + */ + +/** A label, either by name or as any label object returned by another function. */ +export const GitHubLabelReferenceSchema = z.union([z.string(), z.object({ name: z.string() })]) +export type GitHubLabelReference = z.infer + +@Identifier("GITHUB_LABEL_REFERENCE") +@Name({ code: "en-US", content: "GitHub label reference" }) +@DisplayMessage({ code: "en-US", content: "Label name or label object" }) +@Schema(GitHubLabelReferenceSchema) +export class GitHubLabelReferenceDataType {} + +/** A user, either by login or as any user object returned by another function. */ +export const GitHubUserReferenceSchema = z.union([z.string(), z.object({ login: z.string() })]) +export type GitHubUserReference = z.infer + +@Identifier("GITHUB_USER_REFERENCE") +@Name({ code: "en-US", content: "GitHub user reference" }) +@DisplayMessage({ code: "en-US", content: "Username or user object" }) +@Schema(GitHubUserReferenceSchema) +export class GitHubUserReferenceDataType {} + +/** A milestone, either by number or as any milestone object returned by another function. */ +export const GitHubMilestoneReferenceSchema = z.union([z.number(), z.object({ number: z.number() })]) +export type GitHubMilestoneReference = z.infer + +@Identifier("GITHUB_MILESTONE_REFERENCE") +@Name({ code: "en-US", content: "GitHub milestone reference" }) +@DisplayMessage({ code: "en-US", content: "Milestone number or milestone object" }) +@Schema(GitHubMilestoneReferenceSchema) +export class GitHubMilestoneReferenceDataType {} From 8897c7ea934935899f2c015643cf67291072f7dc Mon Sep 17 00:00:00 2001 From: nicosammito Date: Tue, 27 Oct 2026 19:29:02 +0100 Subject: [PATCH 16/19] feat: update Dockerfile to use specific Node.js version and switch to npm ci --- .gitlab-ci.yml | 1 + actions/github-action/Dockerfile | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f8f37c1..e9953a6 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -28,6 +28,7 @@ include: - twilio-action - stripe-action - smtp-action + - github-action .rust-actions: - cron-action diff --git a/actions/github-action/Dockerfile b/actions/github-action/Dockerfile index cbca323..8d9f6c7 100644 --- a/actions/github-action/Dockerfile +++ b/actions/github-action/Dockerfile @@ -1,10 +1,10 @@ -FROM node:24-alpine +FROM node:24.10.0-alpine WORKDIR /app COPY package.json package-lock.json* ./ -RUN npm install +RUN npm ci COPY . . From 729b24186182c47e2e613070db856dc6486adaca Mon Sep 17 00:00:00 2001 From: nicosammito Date: Tue, 27 Oct 2026 19:29:07 +0100 Subject: [PATCH 17/19] feat: switch from npm install to npm ci in Dockerfile for consistent builds --- actions/smtp-action/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/actions/smtp-action/Dockerfile b/actions/smtp-action/Dockerfile index 5871953..8d9f6c7 100644 --- a/actions/smtp-action/Dockerfile +++ b/actions/smtp-action/Dockerfile @@ -4,7 +4,7 @@ WORKDIR /app COPY package.json package-lock.json* ./ -RUN npm install +RUN npm ci COPY . . From 3c13d35d2d26384fc12ff6dade85abb533812664 Mon Sep 17 00:00:00 2001 From: nicosammito Date: Tue, 27 Oct 2026 20:43:31 +0100 Subject: [PATCH 18/19] feat: enhance GitHub error handling and improve nullable schema detection --- .../src/generated/github-schemas.ts | 92 +++++++++---------- actions/github-action/src/helpers.ts | 16 ++++ scripts/openapi-to-zod.mjs | 46 ++++++++-- 3 files changed, 101 insertions(+), 53 deletions(-) diff --git a/actions/github-action/src/generated/github-schemas.ts b/actions/github-action/src/generated/github-schemas.ts index 7b262ca..c2446d3 100644 --- a/actions/github-action/src/generated/github-schemas.ts +++ b/actions/github-action/src/generated/github-schemas.ts @@ -7,74 +7,74 @@ const auto_merge = z.lazy(() => z.object({"enabled_by": simple_user, "merge_meth const branch_protection = z.lazy(() => z.object({"url": z.string().optional(), "enabled": z.boolean().optional(), "required_status_checks": protected_branch_required_status_check.optional(), "enforce_admins": protected_branch_admin_enforced.optional(), "required_pull_request_reviews": protected_branch_pull_request_review.optional(), "restrictions": branch_restriction_policy.optional(), "required_linear_history": z.object({"enabled": z.boolean().optional()}).optional(), "allow_force_pushes": z.object({"enabled": z.boolean().optional()}).optional(), "allow_deletions": z.object({"enabled": z.boolean().optional()}).optional(), "block_creations": z.object({"enabled": z.boolean().optional()}).optional(), "required_conversation_resolution": z.object({"enabled": z.boolean().optional()}).optional(), "name": z.string().optional(), "protection_url": z.string().optional(), "required_signatures": z.object({"url": z.string(), "enabled": z.boolean()}).optional(), "lock_branch": z.object({"enabled": z.boolean().optional()}).optional(), "allow_fork_syncing": z.object({"enabled": z.boolean().optional()}).optional()})); const branch_restriction_policy = z.lazy(() => z.object({"url": z.string(), "users_url": z.string(), "teams_url": z.string(), "apps_url": z.string(), "users": z.array(z.object({"login": z.string().optional(), "id": z.number().int().optional(), "node_id": z.string().optional(), "avatar_url": z.string().optional(), "gravatar_id": z.string().optional(), "url": z.string().optional(), "html_url": z.string().optional(), "followers_url": z.string().optional(), "following_url": z.string().optional(), "gists_url": z.string().optional(), "starred_url": z.string().optional(), "subscriptions_url": z.string().optional(), "organizations_url": z.string().optional(), "repos_url": z.string().optional(), "events_url": z.string().optional(), "received_events_url": z.string().optional(), "type": z.string().optional(), "site_admin": z.boolean().optional(), "user_view_type": z.string().optional()})), "teams": z.array(team), "apps": z.array(z.object({"id": z.number().int().optional(), "slug": z.string().optional(), "node_id": z.string().optional(), "owner": z.object({"login": z.string().optional(), "id": z.number().int().optional(), "node_id": z.string().optional(), "url": z.string().optional(), "repos_url": z.string().optional(), "events_url": z.string().optional(), "hooks_url": z.string().optional(), "issues_url": z.string().optional(), "members_url": z.string().optional(), "public_members_url": z.string().optional(), "avatar_url": z.string().optional(), "description": z.string().optional(), "gravatar_id": z.string().optional(), "html_url": z.string().optional(), "followers_url": z.string().optional(), "following_url": z.string().optional(), "gists_url": z.string().optional(), "starred_url": z.string().optional(), "subscriptions_url": z.string().optional(), "organizations_url": z.string().optional(), "received_events_url": z.string().optional(), "type": z.string().optional(), "site_admin": z.boolean().optional(), "user_view_type": z.string().optional()}).optional(), "name": z.string().optional(), "client_id": z.string().optional(), "description": z.string().optional(), "external_url": z.string().optional(), "html_url": z.string().optional(), "created_at": z.string().optional(), "updated_at": z.string().optional(), "permissions": z.object({"metadata": z.string().optional(), "contents": z.string().optional(), "issues": z.string().optional(), "single_file": z.string().optional()}).optional(), "events": z.array(z.string()).optional()}))})); const branch_with_protection = z.lazy(() => z.object({"name": z.string(), "commit": commit, "_links": z.object({"html": z.string(), "self": z.string()}), "protected": z.boolean(), "protection": branch_protection, "protection_url": z.string(), "pattern": z.string().optional(), "required_approving_review_count": z.number().int().optional()})); -const check_run = z.lazy(() => z.object({"id": z.number().int(), "head_sha": z.string(), "node_id": z.string(), "external_id": z.string().nullable(), "url": z.string(), "html_url": z.string().nullable(), "details_url": z.string().nullable(), "status": z.enum(["queued", "in_progress", "completed", "waiting", "requested", "pending"]), "conclusion": z.enum(["success", "failure", "neutral", "cancelled", "skipped", "timed_out", "action_required"]).nullable(), "started_at": z.string().nullable(), "completed_at": z.string().nullable(), "output": z.object({"title": z.string().nullable(), "summary": z.string().nullable(), "text": z.string().nullable(), "annotations_count": z.number().int(), "annotations_url": z.string()}), "name": z.string(), "check_suite": z.object({"id": z.number().int()}).nullable(), "app": nullable_integration, "pull_requests": z.array(pull_request_minimal), "deployment": deployment_simple.optional()})); -const code_of_conduct = z.lazy(() => z.object({"key": z.string(), "name": z.string(), "url": z.string(), "body": z.string().optional(), "html_url": z.string().nullable()})); -const code_of_conduct_simple = z.lazy(() => z.object({"url": z.string(), "key": z.string(), "name": z.string(), "html_url": z.string().nullable()})); -const commit = z.lazy(() => z.object({"url": z.string(), "sha": z.string(), "node_id": z.string(), "html_url": z.string(), "comments_url": z.string(), "commit": z.object({"url": z.string(), "author": nullable_git_user, "committer": nullable_git_user, "message": z.string(), "comment_count": z.number().int(), "tree": z.object({"sha": z.string(), "url": z.string()}), "verification": verification.optional()}), "author": z.union([simple_user, empty_object]).nullable(), "committer": z.union([simple_user, empty_object]).nullable(), "parents": z.array(z.object({"sha": z.string(), "url": z.string(), "html_url": z.string().optional()})), "stats": z.object({"additions": z.number().int().optional(), "deletions": z.number().int().optional(), "total": z.number().int().optional()}).optional(), "files": z.array(diff_entry).optional()})); -const deployment_simple = z.lazy(() => z.object({"url": z.string(), "id": z.number().int(), "node_id": z.string(), "task": z.string(), "original_environment": z.string().optional(), "environment": z.string(), "description": z.string().nullable(), "created_at": z.string(), "updated_at": z.string(), "statuses_url": z.string(), "repository_url": z.string(), "transient_environment": z.boolean().optional(), "production_environment": z.boolean().optional(), "performed_via_github_app": nullable_integration.optional()})); -const diff_entry = z.lazy(() => z.object({"sha": z.string().nullable(), "filename": z.string(), "status": z.enum(["added", "removed", "modified", "renamed", "copied", "changed", "unchanged"]), "additions": z.number().int(), "deletions": z.number().int(), "changes": z.number().int(), "blob_url": z.string(), "raw_url": z.string(), "contents_url": z.string(), "patch": z.string().optional(), "previous_filename": z.string().optional()})); +const check_run = z.lazy(() => z.object({"id": z.number().int(), "head_sha": z.string(), "node_id": z.string(), "external_id": z.string().nullable().optional(), "url": z.string(), "html_url": z.string().nullable().optional(), "details_url": z.string().nullable().optional(), "status": z.enum(["queued", "in_progress", "completed", "waiting", "requested", "pending"]), "conclusion": z.enum(["success", "failure", "neutral", "cancelled", "skipped", "timed_out", "action_required"]).nullable().optional(), "started_at": z.string().nullable().optional(), "completed_at": z.string().nullable().optional(), "output": z.object({"title": z.string().nullable().optional(), "summary": z.string().nullable().optional(), "text": z.string().nullable().optional(), "annotations_count": z.number().int(), "annotations_url": z.string()}), "name": z.string(), "check_suite": z.object({"id": z.number().int()}).nullable().optional(), "app": nullable_integration.optional(), "pull_requests": z.array(pull_request_minimal), "deployment": deployment_simple.optional()})); +const code_of_conduct = z.lazy(() => z.object({"key": z.string(), "name": z.string(), "url": z.string(), "body": z.string().optional(), "html_url": z.string().nullable().optional()})); +const code_of_conduct_simple = z.lazy(() => z.object({"url": z.string(), "key": z.string(), "name": z.string(), "html_url": z.string().nullable().optional()})); +const commit = z.lazy(() => z.object({"url": z.string(), "sha": z.string(), "node_id": z.string(), "html_url": z.string(), "comments_url": z.string(), "commit": z.object({"url": z.string(), "author": nullable_git_user.optional(), "committer": nullable_git_user.optional(), "message": z.string(), "comment_count": z.number().int(), "tree": z.object({"sha": z.string(), "url": z.string()}), "verification": verification.optional()}), "author": z.union([simple_user, empty_object]).nullable().optional(), "committer": z.union([simple_user, empty_object]).nullable().optional(), "parents": z.array(z.object({"sha": z.string(), "url": z.string(), "html_url": z.string().optional()})), "stats": z.object({"additions": z.number().int().optional(), "deletions": z.number().int().optional(), "total": z.number().int().optional()}).optional(), "files": z.array(diff_entry).optional()})); +const deployment_simple = z.lazy(() => z.object({"url": z.string(), "id": z.number().int(), "node_id": z.string(), "task": z.string(), "original_environment": z.string().optional(), "environment": z.string(), "description": z.string().nullable().optional(), "created_at": z.string(), "updated_at": z.string(), "statuses_url": z.string(), "repository_url": z.string(), "transient_environment": z.boolean().optional(), "production_environment": z.boolean().optional(), "performed_via_github_app": nullable_integration.optional()})); +const diff_entry = z.lazy(() => z.object({"sha": z.string().nullable().optional(), "filename": z.string(), "status": z.enum(["added", "removed", "modified", "renamed", "copied", "changed", "unchanged"]), "additions": z.number().int(), "deletions": z.number().int(), "changes": z.number().int(), "blob_url": z.string(), "raw_url": z.string(), "contents_url": z.string(), "patch": z.string().optional(), "previous_filename": z.string().optional()})); const empty_object = z.lazy(() => z.object({}).strict()); -const enterprise = z.lazy(() => z.object({"description": z.string().nullable().optional(), "html_url": z.string(), "website_url": z.string().nullable().optional(), "id": z.number().int(), "node_id": z.string(), "name": z.string(), "slug": z.string(), "created_at": z.string().nullable(), "updated_at": z.string().nullable(), "avatar_url": z.string()})); -const enterprise_webhooks = z.lazy(() => z.object({"description": z.string().nullable().optional(), "html_url": z.string(), "website_url": z.string().nullable().optional(), "id": z.number().int(), "node_id": z.string(), "name": z.string(), "slug": z.string(), "created_at": z.string().nullable(), "updated_at": z.string().nullable(), "avatar_url": z.string()})); -const full_repository = z.lazy(() => z.object({"id": z.number().int(), "node_id": z.string(), "name": z.string(), "full_name": z.string(), "owner": simple_user, "private": z.boolean(), "html_url": z.string(), "description": z.string().nullable(), "fork": z.boolean(), "url": z.string(), "archive_url": z.string(), "assignees_url": z.string(), "blobs_url": z.string(), "branches_url": z.string(), "collaborators_url": z.string(), "comments_url": z.string(), "commits_url": z.string(), "compare_url": z.string(), "contents_url": z.string(), "contributors_url": z.string(), "deployments_url": z.string(), "downloads_url": z.string(), "events_url": z.string(), "forks_url": z.string(), "git_commits_url": z.string(), "git_refs_url": z.string(), "git_tags_url": z.string(), "git_url": z.string(), "issue_comment_url": z.string(), "issue_events_url": z.string(), "issues_url": z.string(), "keys_url": z.string(), "labels_url": z.string(), "languages_url": z.string(), "merges_url": z.string(), "milestones_url": z.string(), "notifications_url": z.string(), "pulls_url": z.string(), "releases_url": z.string(), "ssh_url": z.string(), "stargazers_url": z.string(), "statuses_url": z.string(), "subscribers_url": z.string(), "subscription_url": z.string(), "tags_url": z.string(), "teams_url": z.string(), "trees_url": z.string(), "clone_url": z.string(), "mirror_url": z.string().nullable(), "hooks_url": z.string(), "svn_url": z.string(), "homepage": z.string().nullable(), "language": z.string().nullable(), "forks_count": z.number().int(), "stargazers_count": z.number().int(), "watchers_count": z.number().int(), "size": z.number().int(), "default_branch": z.string(), "open_issues_count": z.number().int(), "is_template": z.boolean().optional(), "topics": z.array(z.string()).optional(), "has_issues": z.boolean(), "has_projects": z.boolean(), "has_wiki": z.boolean(), "has_pages": z.boolean(), "has_downloads": z.boolean().optional(), "has_discussions": z.boolean(), "has_pull_requests": z.boolean().optional(), "pull_request_creation_policy": z.enum(["all", "collaborators_only"]).optional(), "archived": z.boolean(), "disabled": z.boolean(), "visibility": z.string().optional(), "pushed_at": z.string(), "created_at": z.string(), "updated_at": z.string(), "permissions": z.object({"admin": z.boolean(), "maintain": z.boolean().optional(), "push": z.boolean(), "triage": z.boolean().optional(), "pull": z.boolean()}).optional(), "allow_rebase_merge": z.boolean().optional(), "template_repository": nullable_repository.optional(), "temp_clone_token": z.string().nullable().optional(), "allow_squash_merge": z.boolean().optional(), "allow_auto_merge": z.boolean().optional(), "delete_branch_on_merge": z.boolean().optional(), "allow_merge_commit": z.boolean().optional(), "allow_update_branch": z.boolean().optional(), "use_squash_pr_title_as_default": z.boolean().optional(), "squash_merge_commit_title": z.enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]).optional(), "squash_merge_commit_message": z.enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]).optional(), "merge_commit_title": z.enum(["PR_TITLE", "MERGE_MESSAGE"]).optional(), "merge_commit_message": z.enum(["PR_BODY", "PR_TITLE", "BLANK"]).optional(), "allow_forking": z.boolean().optional(), "web_commit_signoff_required": z.boolean().optional(), "subscribers_count": z.number().int(), "network_count": z.number().int(), "license": nullable_license_simple, "organization": nullable_simple_user.optional(), "parent": repository.optional(), "source": repository.optional(), "forks": z.number().int(), "master_branch": z.string().optional(), "open_issues": z.number().int(), "watchers": z.number().int(), "anonymous_access_enabled": z.boolean().optional(), "code_of_conduct": code_of_conduct_simple.optional(), "security_and_analysis": security_and_analysis.optional(), "custom_properties": z.record(z.string(), z.any()).optional()})); +const enterprise = z.lazy(() => z.object({"description": z.string().nullable().optional(), "html_url": z.string(), "website_url": z.string().nullable().optional(), "id": z.number().int(), "node_id": z.string(), "name": z.string(), "slug": z.string(), "created_at": z.string().nullable().optional(), "updated_at": z.string().nullable().optional(), "avatar_url": z.string()})); +const enterprise_webhooks = z.lazy(() => z.object({"description": z.string().nullable().optional(), "html_url": z.string(), "website_url": z.string().nullable().optional(), "id": z.number().int(), "node_id": z.string(), "name": z.string(), "slug": z.string(), "created_at": z.string().nullable().optional(), "updated_at": z.string().nullable().optional(), "avatar_url": z.string()})); +const full_repository = z.lazy(() => z.object({"id": z.number().int(), "node_id": z.string(), "name": z.string(), "full_name": z.string(), "owner": simple_user, "private": z.boolean(), "html_url": z.string(), "description": z.string().nullable().optional(), "fork": z.boolean(), "url": z.string(), "archive_url": z.string(), "assignees_url": z.string(), "blobs_url": z.string(), "branches_url": z.string(), "collaborators_url": z.string(), "comments_url": z.string(), "commits_url": z.string(), "compare_url": z.string(), "contents_url": z.string(), "contributors_url": z.string(), "deployments_url": z.string(), "downloads_url": z.string(), "events_url": z.string(), "forks_url": z.string(), "git_commits_url": z.string(), "git_refs_url": z.string(), "git_tags_url": z.string(), "git_url": z.string(), "issue_comment_url": z.string(), "issue_events_url": z.string(), "issues_url": z.string(), "keys_url": z.string(), "labels_url": z.string(), "languages_url": z.string(), "merges_url": z.string(), "milestones_url": z.string(), "notifications_url": z.string(), "pulls_url": z.string(), "releases_url": z.string(), "ssh_url": z.string(), "stargazers_url": z.string(), "statuses_url": z.string(), "subscribers_url": z.string(), "subscription_url": z.string(), "tags_url": z.string(), "teams_url": z.string(), "trees_url": z.string(), "clone_url": z.string(), "mirror_url": z.string().nullable().optional(), "hooks_url": z.string(), "svn_url": z.string(), "homepage": z.string().nullable().optional(), "language": z.string().nullable().optional(), "forks_count": z.number().int(), "stargazers_count": z.number().int(), "watchers_count": z.number().int(), "size": z.number().int(), "default_branch": z.string(), "open_issues_count": z.number().int(), "is_template": z.boolean().optional(), "topics": z.array(z.string()).optional(), "has_issues": z.boolean(), "has_projects": z.boolean(), "has_wiki": z.boolean(), "has_pages": z.boolean(), "has_downloads": z.boolean().optional(), "has_discussions": z.boolean(), "has_pull_requests": z.boolean().optional(), "pull_request_creation_policy": z.enum(["all", "collaborators_only"]).optional(), "archived": z.boolean(), "disabled": z.boolean(), "visibility": z.string().optional(), "pushed_at": z.string(), "created_at": z.string(), "updated_at": z.string(), "permissions": z.object({"admin": z.boolean(), "maintain": z.boolean().optional(), "push": z.boolean(), "triage": z.boolean().optional(), "pull": z.boolean()}).optional(), "allow_rebase_merge": z.boolean().optional(), "template_repository": nullable_repository.optional(), "temp_clone_token": z.string().nullable().optional(), "allow_squash_merge": z.boolean().optional(), "allow_auto_merge": z.boolean().optional(), "delete_branch_on_merge": z.boolean().optional(), "allow_merge_commit": z.boolean().optional(), "allow_update_branch": z.boolean().optional(), "use_squash_pr_title_as_default": z.boolean().optional(), "squash_merge_commit_title": z.enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]).optional(), "squash_merge_commit_message": z.enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]).optional(), "merge_commit_title": z.enum(["PR_TITLE", "MERGE_MESSAGE"]).optional(), "merge_commit_message": z.enum(["PR_BODY", "PR_TITLE", "BLANK"]).optional(), "allow_forking": z.boolean().optional(), "web_commit_signoff_required": z.boolean().optional(), "subscribers_count": z.number().int(), "network_count": z.number().int(), "license": nullable_license_simple.optional(), "organization": nullable_simple_user.optional(), "parent": repository.optional(), "source": repository.optional(), "forks": z.number().int(), "master_branch": z.string().optional(), "open_issues": z.number().int(), "watchers": z.number().int(), "anonymous_access_enabled": z.boolean().optional(), "code_of_conduct": code_of_conduct_simple.optional(), "security_and_analysis": security_and_analysis.optional(), "custom_properties": z.record(z.string(), z.any()).optional()})); const git_ref = z.lazy(() => z.object({"ref": z.string(), "node_id": z.string(), "url": z.string(), "object": z.object({"type": z.string(), "sha": z.string(), "url": z.string()})})); -const integration = z.lazy(() => z.object({"id": z.number().int(), "slug": z.string().optional(), "node_id": z.string(), "client_id": z.string().optional(), "owner": z.union([simple_user, enterprise]), "name": z.string(), "description": z.string().nullable(), "external_url": z.string(), "html_url": z.string(), "created_at": z.string(), "updated_at": z.string(), "permissions": z.object({"issues": z.string().optional(), "checks": z.string().optional(), "metadata": z.string().optional(), "contents": z.string().optional(), "deployments": z.string().optional()}).catchall(z.string()), "events": z.array(z.string()), "installations_count": z.number().int().optional()}).nullable()); -const issue = z.lazy(() => z.object({"id": z.number().int(), "node_id": z.string(), "url": z.string(), "repository_url": z.string(), "labels_url": z.string(), "comments_url": z.string(), "events_url": z.string(), "html_url": z.string(), "number": z.number().int(), "state": z.string(), "state_reason": z.enum(["completed", "reopened", "not_planned", "duplicate"]).nullable().optional(), "title": z.string(), "body": z.string().nullable().optional(), "user": nullable_simple_user, "labels": z.array(z.union([z.string(), z.object({"id": z.number().int().optional(), "node_id": z.string().optional(), "url": z.string().optional(), "name": z.string().optional(), "description": z.string().nullable().optional(), "color": z.string().nullable().optional(), "default": z.boolean().optional(), "archived_by": simple_user.nullable().optional()})])), "assignee": nullable_simple_user, "assignees": z.array(simple_user).optional(), "milestone": nullable_milestone, "locked": z.boolean(), "active_lock_reason": z.string().nullable().optional(), "comments": z.number().int(), "pull_request": z.object({"merged_at": z.string().nullable().optional(), "diff_url": z.string().nullable(), "html_url": z.string().nullable(), "patch_url": z.string().nullable(), "url": z.string().nullable()}).optional(), "closed_at": z.string().nullable(), "created_at": z.string(), "updated_at": z.string(), "draft": z.boolean().optional(), "closed_by": nullable_simple_user.optional(), "body_html": z.string().optional(), "body_text": z.string().optional(), "timeline_url": z.string().optional(), "type": issue_type.optional(), "repository": repository.optional(), "performed_via_github_app": nullable_integration.optional(), "author_association": author_association.optional(), "reactions": reaction_rollup.optional(), "sub_issues_summary": sub_issues_summary.optional(), "parent_issue_url": z.string().nullable().optional(), "pinned_comment": nullable_issue_comment.optional(), "issue_dependencies_summary": issue_dependencies_summary.optional(), "issue_field_values": z.array(issue_field_value).optional()})); -const issue_comment = z.lazy(() => z.object({"id": z.number().int(), "node_id": z.string(), "url": z.string(), "body": z.string().optional(), "body_text": z.string().optional(), "body_html": z.string().optional(), "html_url": z.string(), "user": nullable_simple_user, "created_at": z.string(), "updated_at": z.string(), "issue_url": z.string(), "author_association": author_association.optional(), "performed_via_github_app": nullable_integration.optional(), "reactions": reaction_rollup.optional(), "pin": nullable_pinned_issue_comment.optional(), "minimized": nullable_issue_comment_minimized.optional()})); +const integration = z.lazy(() => z.object({"id": z.number().int(), "slug": z.string().optional(), "node_id": z.string(), "client_id": z.string().optional(), "owner": z.union([simple_user, enterprise]), "name": z.string(), "description": z.string().nullable().optional(), "external_url": z.string(), "html_url": z.string(), "created_at": z.string(), "updated_at": z.string(), "permissions": z.object({"issues": z.string().optional(), "checks": z.string().optional(), "metadata": z.string().optional(), "contents": z.string().optional(), "deployments": z.string().optional()}), "events": z.array(z.string()), "installations_count": z.number().int().optional()}).nullable()); +const issue = z.lazy(() => z.object({"id": z.number().int(), "node_id": z.string(), "url": z.string(), "repository_url": z.string(), "labels_url": z.string(), "comments_url": z.string(), "events_url": z.string(), "html_url": z.string(), "number": z.number().int(), "state": z.string(), "state_reason": z.enum(["completed", "reopened", "not_planned", "duplicate"]).nullable().optional(), "title": z.string(), "body": z.string().nullable().optional(), "user": nullable_simple_user.optional(), "labels": z.array(z.union([z.string(), z.object({"id": z.number().int().optional(), "node_id": z.string().optional(), "url": z.string().optional(), "name": z.string().optional(), "description": z.string().nullable().optional(), "color": z.string().nullable().optional(), "default": z.boolean().optional(), "archived_by": simple_user.nullable().optional()})])), "assignee": nullable_simple_user.optional(), "assignees": z.array(simple_user).optional(), "milestone": nullable_milestone.optional(), "locked": z.boolean(), "active_lock_reason": z.string().nullable().optional(), "comments": z.number().int(), "pull_request": z.object({"merged_at": z.string().nullable().optional(), "diff_url": z.string().nullable().optional(), "html_url": z.string().nullable().optional(), "patch_url": z.string().nullable().optional(), "url": z.string().nullable().optional()}).optional(), "closed_at": z.string().nullable().optional(), "created_at": z.string(), "updated_at": z.string(), "draft": z.boolean().optional(), "closed_by": nullable_simple_user.optional(), "body_html": z.string().optional(), "body_text": z.string().optional(), "timeline_url": z.string().optional(), "type": issue_type.optional(), "repository": repository.optional(), "performed_via_github_app": nullable_integration.optional(), "author_association": author_association.optional(), "reactions": reaction_rollup.optional(), "sub_issues_summary": sub_issues_summary.optional(), "parent_issue_url": z.string().nullable().optional(), "pinned_comment": nullable_issue_comment.optional(), "issue_dependencies_summary": issue_dependencies_summary.optional(), "issue_field_values": z.array(issue_field_value).optional()})); +const issue_comment = z.lazy(() => z.object({"id": z.number().int(), "node_id": z.string(), "url": z.string(), "body": z.string().optional(), "body_text": z.string().optional(), "body_html": z.string().optional(), "html_url": z.string(), "user": nullable_simple_user.optional(), "created_at": z.string(), "updated_at": z.string(), "issue_url": z.string(), "author_association": author_association.optional(), "performed_via_github_app": nullable_integration.optional(), "reactions": reaction_rollup.optional(), "pin": nullable_pinned_issue_comment.optional(), "minimized": nullable_issue_comment_minimized.optional()})); const issue_dependencies_summary = z.lazy(() => z.object({"blocked_by": z.number().int(), "blocking": z.number().int(), "total_blocked_by": z.number().int(), "total_blocking": z.number().int()})); -const issue_field_value = z.lazy(() => z.object({"issue_field_id": z.number().int(), "issue_field_name": z.string().optional(), "node_id": z.string(), "data_type": z.enum(["text", "single_select", "multi_select", "number", "date"]), "value": z.union([z.string(), z.number(), z.number().int()]).nullable(), "single_select_option": z.object({"id": z.number().int(), "name": z.string(), "color": z.string()}).nullable().optional(), "multi_select_options": z.array(z.object({"id": z.number().int(), "name": z.string(), "color": z.string()})).nullable().optional()})); -const issue_type = z.lazy(() => z.object({"id": z.number().int(), "node_id": z.string(), "name": z.string(), "description": z.string().nullable(), "color": z.enum(["gray", "blue", "green", "yellow", "orange", "red", "pink", "purple"]).nullable().optional(), "created_at": z.string().optional(), "updated_at": z.string().optional(), "is_enabled": z.boolean().optional()}).nullable()); -const label = z.lazy(() => z.object({"id": z.number().int(), "node_id": z.string(), "url": z.string(), "name": z.string(), "description": z.string().nullable(), "color": z.string(), "default": z.boolean(), "archived_at": z.string().nullable(), "archived_by": simple_user.nullable()})); +const issue_field_value = z.lazy(() => z.object({"issue_field_id": z.number().int(), "issue_field_name": z.string().optional(), "node_id": z.string(), "data_type": z.enum(["text", "single_select", "multi_select", "number", "date"]), "value": z.union([z.string(), z.number(), z.number().int()]).nullable().optional(), "single_select_option": z.object({"id": z.number().int(), "name": z.string(), "color": z.string()}).nullable().optional(), "multi_select_options": z.array(z.object({"id": z.number().int(), "name": z.string(), "color": z.string()})).nullable().optional()})); +const issue_type = z.lazy(() => z.object({"id": z.number().int(), "node_id": z.string(), "name": z.string(), "description": z.string().nullable().optional(), "color": z.enum(["gray", "blue", "green", "yellow", "orange", "red", "pink", "purple"]).nullable().optional(), "created_at": z.string().optional(), "updated_at": z.string().optional(), "is_enabled": z.boolean().optional()}).nullable()); +const label = z.lazy(() => z.object({"id": z.number().int(), "node_id": z.string(), "url": z.string(), "name": z.string(), "description": z.string().nullable().optional(), "color": z.string(), "default": z.boolean(), "archived_at": z.string().nullable().optional(), "archived_by": simple_user.nullable().optional()})); const link = z.lazy(() => z.object({"href": z.string()})); -const milestone = z.lazy(() => z.object({"url": z.string(), "html_url": z.string(), "labels_url": z.string(), "id": z.number().int(), "node_id": z.string(), "number": z.number().int(), "state": z.enum(["open", "closed"]), "title": z.string(), "description": z.string().nullable(), "creator": nullable_simple_user, "open_issues": z.number().int(), "closed_issues": z.number().int(), "created_at": z.string(), "updated_at": z.string(), "closed_at": z.string().nullable(), "due_on": z.string().nullable()})); -const minimal_repository = z.lazy(() => z.object({"id": z.number().int(), "node_id": z.string(), "name": z.string(), "full_name": z.string(), "owner": simple_user, "private": z.boolean(), "html_url": z.string(), "description": z.string().nullable(), "fork": z.boolean(), "url": z.string(), "archive_url": z.string(), "assignees_url": z.string(), "blobs_url": z.string(), "branches_url": z.string(), "collaborators_url": z.string(), "comments_url": z.string(), "commits_url": z.string(), "compare_url": z.string(), "contents_url": z.string(), "contributors_url": z.string(), "deployments_url": z.string(), "downloads_url": z.string(), "events_url": z.string(), "forks_url": z.string(), "git_commits_url": z.string(), "git_refs_url": z.string(), "git_tags_url": z.string(), "git_url": z.string().optional(), "issue_comment_url": z.string(), "issue_events_url": z.string(), "issues_url": z.string(), "keys_url": z.string(), "labels_url": z.string(), "languages_url": z.string(), "merges_url": z.string(), "milestones_url": z.string(), "notifications_url": z.string(), "pulls_url": z.string(), "releases_url": z.string(), "ssh_url": z.string().optional(), "stargazers_url": z.string(), "statuses_url": z.string(), "subscribers_url": z.string(), "subscription_url": z.string(), "tags_url": z.string(), "teams_url": z.string(), "trees_url": z.string(), "clone_url": z.string().optional(), "mirror_url": z.string().nullable().optional(), "hooks_url": z.string(), "svn_url": z.string().optional(), "homepage": z.string().nullable().optional(), "language": z.string().nullable().optional(), "forks_count": z.number().int().optional(), "stargazers_count": z.number().int().optional(), "watchers_count": z.number().int().optional(), "size": z.number().int().optional(), "default_branch": z.string().optional(), "open_issues_count": z.number().int().optional(), "is_template": z.boolean().optional(), "topics": z.array(z.string()).optional(), "has_issues": z.boolean().optional(), "has_projects": z.boolean().optional(), "has_wiki": z.boolean().optional(), "has_pages": z.boolean().optional(), "has_downloads": z.boolean().optional(), "has_discussions": z.boolean().optional(), "has_pull_requests": z.boolean().optional(), "pull_request_creation_policy": z.enum(["all", "collaborators_only"]).optional(), "archived": z.boolean().optional(), "disabled": z.boolean().optional(), "visibility": z.string().optional(), "pushed_at": z.string().nullable().optional(), "created_at": z.string().nullable().optional(), "updated_at": z.string().nullable().optional(), "permissions": z.object({"admin": z.boolean().optional(), "maintain": z.boolean().optional(), "push": z.boolean().optional(), "triage": z.boolean().optional(), "pull": z.boolean().optional()}).optional(), "role_name": z.string().optional(), "temp_clone_token": z.string().optional(), "delete_branch_on_merge": z.boolean().optional(), "subscribers_count": z.number().int().optional(), "network_count": z.number().int().optional(), "code_of_conduct": code_of_conduct.optional(), "license": z.object({"key": z.string().optional(), "name": z.string().optional(), "spdx_id": z.string().optional(), "url": z.string().nullable().optional(), "node_id": z.string().optional()}).nullable().optional(), "forks": z.number().int().optional(), "open_issues": z.number().int().optional(), "watchers": z.number().int().optional(), "allow_forking": z.boolean().optional(), "web_commit_signoff_required": z.boolean().optional(), "security_and_analysis": security_and_analysis.optional(), "custom_properties": z.record(z.string(), z.any()).optional()})); +const milestone = z.lazy(() => z.object({"url": z.string(), "html_url": z.string(), "labels_url": z.string(), "id": z.number().int(), "node_id": z.string(), "number": z.number().int(), "state": z.enum(["open", "closed"]), "title": z.string(), "description": z.string().nullable().optional(), "creator": nullable_simple_user.optional(), "open_issues": z.number().int(), "closed_issues": z.number().int(), "created_at": z.string(), "updated_at": z.string(), "closed_at": z.string().nullable().optional(), "due_on": z.string().nullable().optional()})); +const minimal_repository = z.lazy(() => z.object({"id": z.number().int(), "node_id": z.string(), "name": z.string(), "full_name": z.string(), "owner": simple_user, "private": z.boolean(), "html_url": z.string(), "description": z.string().nullable().optional(), "fork": z.boolean(), "url": z.string(), "archive_url": z.string(), "assignees_url": z.string(), "blobs_url": z.string(), "branches_url": z.string(), "collaborators_url": z.string(), "comments_url": z.string(), "commits_url": z.string(), "compare_url": z.string(), "contents_url": z.string(), "contributors_url": z.string(), "deployments_url": z.string(), "downloads_url": z.string(), "events_url": z.string(), "forks_url": z.string(), "git_commits_url": z.string(), "git_refs_url": z.string(), "git_tags_url": z.string(), "git_url": z.string().optional(), "issue_comment_url": z.string(), "issue_events_url": z.string(), "issues_url": z.string(), "keys_url": z.string(), "labels_url": z.string(), "languages_url": z.string(), "merges_url": z.string(), "milestones_url": z.string(), "notifications_url": z.string(), "pulls_url": z.string(), "releases_url": z.string(), "ssh_url": z.string().optional(), "stargazers_url": z.string(), "statuses_url": z.string(), "subscribers_url": z.string(), "subscription_url": z.string(), "tags_url": z.string(), "teams_url": z.string(), "trees_url": z.string(), "clone_url": z.string().optional(), "mirror_url": z.string().nullable().optional(), "hooks_url": z.string(), "svn_url": z.string().optional(), "homepage": z.string().nullable().optional(), "language": z.string().nullable().optional(), "forks_count": z.number().int().optional(), "stargazers_count": z.number().int().optional(), "watchers_count": z.number().int().optional(), "size": z.number().int().optional(), "default_branch": z.string().optional(), "open_issues_count": z.number().int().optional(), "is_template": z.boolean().optional(), "topics": z.array(z.string()).optional(), "has_issues": z.boolean().optional(), "has_projects": z.boolean().optional(), "has_wiki": z.boolean().optional(), "has_pages": z.boolean().optional(), "has_downloads": z.boolean().optional(), "has_discussions": z.boolean().optional(), "has_pull_requests": z.boolean().optional(), "pull_request_creation_policy": z.enum(["all", "collaborators_only"]).optional(), "archived": z.boolean().optional(), "disabled": z.boolean().optional(), "visibility": z.string().optional(), "pushed_at": z.string().nullable().optional(), "created_at": z.string().nullable().optional(), "updated_at": z.string().nullable().optional(), "permissions": z.object({"admin": z.boolean().optional(), "maintain": z.boolean().optional(), "push": z.boolean().optional(), "triage": z.boolean().optional(), "pull": z.boolean().optional()}).optional(), "role_name": z.string().optional(), "temp_clone_token": z.string().optional(), "delete_branch_on_merge": z.boolean().optional(), "subscribers_count": z.number().int().optional(), "network_count": z.number().int().optional(), "code_of_conduct": code_of_conduct.optional(), "license": z.object({"key": z.string().optional(), "name": z.string().optional(), "spdx_id": z.string().optional(), "url": z.string().nullable().optional(), "node_id": z.string().optional()}).nullable().optional(), "forks": z.number().int().optional(), "open_issues": z.number().int().optional(), "watchers": z.number().int().optional(), "allow_forking": z.boolean().optional(), "web_commit_signoff_required": z.boolean().optional(), "security_and_analysis": security_and_analysis.optional(), "custom_properties": z.record(z.string(), z.any()).optional()})); const nullable_git_user = z.lazy(() => z.object({"name": z.string().optional(), "email": z.string().optional(), "date": z.string().optional()}).nullable()); -const nullable_integration = z.lazy(() => z.object({"id": z.number().int(), "slug": z.string().optional(), "node_id": z.string(), "client_id": z.string().optional(), "owner": z.union([simple_user, enterprise]), "name": z.string(), "description": z.string().nullable(), "external_url": z.string(), "html_url": z.string(), "created_at": z.string(), "updated_at": z.string(), "permissions": z.object({"issues": z.string().optional(), "checks": z.string().optional(), "metadata": z.string().optional(), "contents": z.string().optional(), "deployments": z.string().optional()}).catchall(z.string()), "events": z.array(z.string()), "installations_count": z.number().int().optional()}).nullable()); -const nullable_issue_comment = z.lazy(() => z.object({"id": z.number().int(), "node_id": z.string(), "url": z.string(), "body": z.string().optional(), "body_text": z.string().optional(), "body_html": z.string().optional(), "html_url": z.string(), "user": nullable_simple_user, "created_at": z.string(), "updated_at": z.string(), "issue_url": z.string(), "author_association": author_association.optional(), "performed_via_github_app": nullable_integration.optional(), "reactions": reaction_rollup.optional(), "pin": nullable_pinned_issue_comment.optional(), "minimized": nullable_issue_comment_minimized.optional()}).nullable()); -const nullable_issue_comment_minimized = z.lazy(() => z.object({"reason": z.string().nullable()}).nullable()); -const nullable_license_simple = z.lazy(() => z.object({"key": z.string(), "name": z.string(), "url": z.string().nullable(), "spdx_id": z.string().nullable(), "node_id": z.string(), "html_url": z.string().optional()}).nullable()); -const nullable_milestone = z.lazy(() => z.object({"url": z.string(), "html_url": z.string(), "labels_url": z.string(), "id": z.number().int(), "node_id": z.string(), "number": z.number().int(), "state": z.enum(["open", "closed"]), "title": z.string(), "description": z.string().nullable(), "creator": nullable_simple_user, "open_issues": z.number().int(), "closed_issues": z.number().int(), "created_at": z.string(), "updated_at": z.string(), "closed_at": z.string().nullable(), "due_on": z.string().nullable()}).nullable()); -const nullable_pinned_issue_comment = z.lazy(() => z.object({"pinned_at": z.string(), "pinned_by": nullable_simple_user}).nullable()); -const nullable_repository = z.lazy(() => z.object({"id": z.number().int(), "node_id": z.string(), "name": z.string(), "full_name": z.string(), "license": nullable_license_simple, "forks": z.number().int(), "permissions": z.object({"admin": z.boolean(), "pull": z.boolean(), "triage": z.boolean().optional(), "push": z.boolean(), "maintain": z.boolean().optional()}).optional(), "owner": simple_user, "private": z.boolean(), "html_url": z.string(), "description": z.string().nullable(), "fork": z.boolean(), "url": z.string(), "archive_url": z.string(), "assignees_url": z.string(), "blobs_url": z.string(), "branches_url": z.string(), "collaborators_url": z.string(), "comments_url": z.string(), "commits_url": z.string(), "compare_url": z.string(), "contents_url": z.string(), "contributors_url": z.string(), "deployments_url": z.string(), "downloads_url": z.string(), "events_url": z.string(), "forks_url": z.string(), "git_commits_url": z.string(), "git_refs_url": z.string(), "git_tags_url": z.string(), "git_url": z.string(), "issue_comment_url": z.string(), "issue_events_url": z.string(), "issues_url": z.string(), "keys_url": z.string(), "labels_url": z.string(), "languages_url": z.string(), "merges_url": z.string(), "milestones_url": z.string(), "notifications_url": z.string(), "pulls_url": z.string(), "releases_url": z.string(), "ssh_url": z.string(), "stargazers_url": z.string(), "statuses_url": z.string(), "subscribers_url": z.string(), "subscription_url": z.string(), "tags_url": z.string(), "teams_url": z.string(), "trees_url": z.string(), "clone_url": z.string(), "mirror_url": z.string().nullable(), "hooks_url": z.string(), "svn_url": z.string(), "homepage": z.string().nullable(), "language": z.string().nullable(), "forks_count": z.number().int(), "stargazers_count": z.number().int(), "watchers_count": z.number().int(), "size": z.number().int(), "default_branch": z.string(), "open_issues_count": z.number().int(), "is_template": z.boolean().optional(), "topics": z.array(z.string()).optional(), "has_issues": z.boolean(), "has_projects": z.boolean(), "has_wiki": z.boolean(), "has_pages": z.boolean(), "has_downloads": z.boolean(), "has_discussions": z.boolean().optional(), "has_pull_requests": z.boolean().optional(), "pull_request_creation_policy": z.enum(["all", "collaborators_only"]).optional(), "archived": z.boolean(), "disabled": z.boolean(), "visibility": z.string().optional(), "pushed_at": z.string().nullable(), "created_at": z.string().nullable(), "updated_at": z.string().nullable(), "allow_rebase_merge": z.boolean().optional(), "temp_clone_token": z.string().optional(), "allow_squash_merge": z.boolean().optional(), "allow_auto_merge": z.boolean().optional(), "delete_branch_on_merge": z.boolean().optional(), "allow_update_branch": z.boolean().optional(), "use_squash_pr_title_as_default": z.boolean().optional(), "squash_merge_commit_title": z.enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]).optional(), "squash_merge_commit_message": z.enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]).optional(), "merge_commit_title": z.enum(["PR_TITLE", "MERGE_MESSAGE"]).optional(), "merge_commit_message": z.enum(["PR_BODY", "PR_TITLE", "BLANK"]).optional(), "allow_merge_commit": z.boolean().optional(), "allow_forking": z.boolean().optional(), "web_commit_signoff_required": z.boolean().optional(), "open_issues": z.number().int(), "watchers": z.number().int(), "master_branch": z.string().optional(), "starred_at": z.string().optional(), "anonymous_access_enabled": z.boolean().optional(), "code_search_index_status": z.object({"lexical_search_ok": z.boolean().optional(), "lexical_commit_sha": z.string().optional()}).optional()}).nullable()); -const nullable_simple_commit = z.lazy(() => z.object({"id": z.string(), "tree_id": z.string(), "message": z.string(), "timestamp": z.string(), "author": z.object({"name": z.string(), "email": z.string()}).nullable(), "committer": z.object({"name": z.string(), "email": z.string()}).nullable()}).nullable()); -const nullable_simple_user = z.lazy(() => z.object({"name": z.string().nullable().optional(), "email": z.string().nullable().optional(), "login": z.string(), "id": z.number().int(), "node_id": z.string(), "avatar_url": z.string(), "gravatar_id": z.string().nullable(), "url": z.string(), "html_url": z.string(), "followers_url": z.string(), "following_url": z.string(), "gists_url": z.string(), "starred_url": z.string(), "subscriptions_url": z.string(), "organizations_url": z.string(), "repos_url": z.string(), "events_url": z.string(), "received_events_url": z.string(), "type": z.string(), "site_admin": z.boolean(), "starred_at": z.string().optional(), "user_view_type": z.string().optional()}).nullable()); -const nullable_team_simple = z.lazy(() => z.object({"id": z.number().int(), "node_id": z.string(), "url": z.string(), "members_url": z.string(), "name": z.string(), "description": z.string().nullable(), "permission": z.string(), "privacy": z.string().optional(), "notification_setting": z.string().optional(), "html_url": z.string(), "repositories_url": z.string(), "slug": z.string(), "ldap_dn": z.string().optional(), "type": z.enum(["enterprise", "organization"]), "organization_id": z.number().int().optional(), "enterprise_id": z.number().int().optional()}).nullable()); -const organization_simple_webhooks = z.lazy(() => z.object({"login": z.string(), "id": z.number().int(), "node_id": z.string(), "url": z.string(), "repos_url": z.string(), "events_url": z.string(), "hooks_url": z.string(), "issues_url": z.string(), "members_url": z.string(), "public_members_url": z.string(), "avatar_url": z.string(), "description": z.string().nullable()})); +const nullable_integration = z.lazy(() => z.object({"id": z.number().int(), "slug": z.string().optional(), "node_id": z.string(), "client_id": z.string().optional(), "owner": z.union([simple_user, enterprise]), "name": z.string(), "description": z.string().nullable().optional(), "external_url": z.string(), "html_url": z.string(), "created_at": z.string(), "updated_at": z.string(), "permissions": z.object({"issues": z.string().optional(), "checks": z.string().optional(), "metadata": z.string().optional(), "contents": z.string().optional(), "deployments": z.string().optional()}), "events": z.array(z.string()), "installations_count": z.number().int().optional()}).nullable()); +const nullable_issue_comment = z.lazy(() => z.object({"id": z.number().int(), "node_id": z.string(), "url": z.string(), "body": z.string().optional(), "body_text": z.string().optional(), "body_html": z.string().optional(), "html_url": z.string(), "user": nullable_simple_user.optional(), "created_at": z.string(), "updated_at": z.string(), "issue_url": z.string(), "author_association": author_association.optional(), "performed_via_github_app": nullable_integration.optional(), "reactions": reaction_rollup.optional(), "pin": nullable_pinned_issue_comment.optional(), "minimized": nullable_issue_comment_minimized.optional()}).nullable()); +const nullable_issue_comment_minimized = z.lazy(() => z.object({"reason": z.string().nullable().optional()}).nullable()); +const nullable_license_simple = z.lazy(() => z.object({"key": z.string(), "name": z.string(), "url": z.string().nullable().optional(), "spdx_id": z.string().nullable().optional(), "node_id": z.string(), "html_url": z.string().optional()}).nullable()); +const nullable_milestone = z.lazy(() => z.object({"url": z.string(), "html_url": z.string(), "labels_url": z.string(), "id": z.number().int(), "node_id": z.string(), "number": z.number().int(), "state": z.enum(["open", "closed"]), "title": z.string(), "description": z.string().nullable().optional(), "creator": nullable_simple_user.optional(), "open_issues": z.number().int(), "closed_issues": z.number().int(), "created_at": z.string(), "updated_at": z.string(), "closed_at": z.string().nullable().optional(), "due_on": z.string().nullable().optional()}).nullable()); +const nullable_pinned_issue_comment = z.lazy(() => z.object({"pinned_at": z.string(), "pinned_by": nullable_simple_user.optional()}).nullable()); +const nullable_repository = z.lazy(() => z.object({"id": z.number().int(), "node_id": z.string(), "name": z.string(), "full_name": z.string(), "license": nullable_license_simple.optional(), "forks": z.number().int(), "permissions": z.object({"admin": z.boolean(), "pull": z.boolean(), "triage": z.boolean().optional(), "push": z.boolean(), "maintain": z.boolean().optional()}).optional(), "owner": simple_user, "private": z.boolean(), "html_url": z.string(), "description": z.string().nullable().optional(), "fork": z.boolean(), "url": z.string(), "archive_url": z.string(), "assignees_url": z.string(), "blobs_url": z.string(), "branches_url": z.string(), "collaborators_url": z.string(), "comments_url": z.string(), "commits_url": z.string(), "compare_url": z.string(), "contents_url": z.string(), "contributors_url": z.string(), "deployments_url": z.string(), "downloads_url": z.string(), "events_url": z.string(), "forks_url": z.string(), "git_commits_url": z.string(), "git_refs_url": z.string(), "git_tags_url": z.string(), "git_url": z.string(), "issue_comment_url": z.string(), "issue_events_url": z.string(), "issues_url": z.string(), "keys_url": z.string(), "labels_url": z.string(), "languages_url": z.string(), "merges_url": z.string(), "milestones_url": z.string(), "notifications_url": z.string(), "pulls_url": z.string(), "releases_url": z.string(), "ssh_url": z.string(), "stargazers_url": z.string(), "statuses_url": z.string(), "subscribers_url": z.string(), "subscription_url": z.string(), "tags_url": z.string(), "teams_url": z.string(), "trees_url": z.string(), "clone_url": z.string(), "mirror_url": z.string().nullable().optional(), "hooks_url": z.string(), "svn_url": z.string(), "homepage": z.string().nullable().optional(), "language": z.string().nullable().optional(), "forks_count": z.number().int(), "stargazers_count": z.number().int(), "watchers_count": z.number().int(), "size": z.number().int(), "default_branch": z.string(), "open_issues_count": z.number().int(), "is_template": z.boolean().optional(), "topics": z.array(z.string()).optional(), "has_issues": z.boolean(), "has_projects": z.boolean(), "has_wiki": z.boolean(), "has_pages": z.boolean(), "has_downloads": z.boolean(), "has_discussions": z.boolean().optional(), "has_pull_requests": z.boolean().optional(), "pull_request_creation_policy": z.enum(["all", "collaborators_only"]).optional(), "archived": z.boolean(), "disabled": z.boolean(), "visibility": z.string().optional(), "pushed_at": z.string().nullable().optional(), "created_at": z.string().nullable().optional(), "updated_at": z.string().nullable().optional(), "allow_rebase_merge": z.boolean().optional(), "temp_clone_token": z.string().optional(), "allow_squash_merge": z.boolean().optional(), "allow_auto_merge": z.boolean().optional(), "delete_branch_on_merge": z.boolean().optional(), "allow_update_branch": z.boolean().optional(), "use_squash_pr_title_as_default": z.boolean().optional(), "squash_merge_commit_title": z.enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]).optional(), "squash_merge_commit_message": z.enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]).optional(), "merge_commit_title": z.enum(["PR_TITLE", "MERGE_MESSAGE"]).optional(), "merge_commit_message": z.enum(["PR_BODY", "PR_TITLE", "BLANK"]).optional(), "allow_merge_commit": z.boolean().optional(), "allow_forking": z.boolean().optional(), "web_commit_signoff_required": z.boolean().optional(), "open_issues": z.number().int(), "watchers": z.number().int(), "master_branch": z.string().optional(), "starred_at": z.string().optional(), "anonymous_access_enabled": z.boolean().optional(), "code_search_index_status": z.object({"lexical_search_ok": z.boolean().optional(), "lexical_commit_sha": z.string().optional()}).optional()}).nullable()); +const nullable_simple_commit = z.lazy(() => z.object({"id": z.string(), "tree_id": z.string(), "message": z.string(), "timestamp": z.string(), "author": z.object({"name": z.string(), "email": z.string()}).nullable().optional(), "committer": z.object({"name": z.string(), "email": z.string()}).nullable().optional()}).nullable()); +const nullable_simple_user = z.lazy(() => z.object({"name": z.string().nullable().optional(), "email": z.string().nullable().optional(), "login": z.string(), "id": z.number().int(), "node_id": z.string(), "avatar_url": z.string(), "gravatar_id": z.string().nullable().optional(), "url": z.string(), "html_url": z.string(), "followers_url": z.string(), "following_url": z.string(), "gists_url": z.string(), "starred_url": z.string(), "subscriptions_url": z.string(), "organizations_url": z.string(), "repos_url": z.string(), "events_url": z.string(), "received_events_url": z.string(), "type": z.string(), "site_admin": z.boolean(), "starred_at": z.string().optional(), "user_view_type": z.string().optional()}).nullable()); +const nullable_team_simple = z.lazy(() => z.object({"id": z.number().int(), "node_id": z.string(), "url": z.string(), "members_url": z.string(), "name": z.string(), "description": z.string().nullable().optional(), "permission": z.string(), "privacy": z.string().optional(), "notification_setting": z.string().optional(), "html_url": z.string(), "repositories_url": z.string(), "slug": z.string(), "ldap_dn": z.string().optional(), "type": z.enum(["enterprise", "organization"]), "organization_id": z.number().int().optional(), "enterprise_id": z.number().int().optional()}).nullable()); +const organization_simple_webhooks = z.lazy(() => z.object({"login": z.string(), "id": z.number().int(), "node_id": z.string(), "url": z.string(), "repos_url": z.string(), "events_url": z.string(), "hooks_url": z.string(), "issues_url": z.string(), "members_url": z.string(), "public_members_url": z.string(), "avatar_url": z.string(), "description": z.string().nullable().optional()})); const protected_branch_admin_enforced = z.lazy(() => z.object({"url": z.string(), "enabled": z.boolean()})); const protected_branch_pull_request_review = z.lazy(() => z.object({"url": z.string().optional(), "dismissal_restrictions": z.object({"users": z.array(simple_user).optional(), "teams": z.array(team).optional(), "apps": z.array(integration).optional(), "url": z.string().optional(), "users_url": z.string().optional(), "teams_url": z.string().optional()}).optional(), "bypass_pull_request_allowances": z.object({"users": z.array(simple_user).optional(), "teams": z.array(team).optional(), "apps": z.array(integration).optional()}).optional(), "dismiss_stale_reviews": z.boolean(), "require_code_owner_reviews": z.boolean(), "required_approving_review_count": z.number().int().optional(), "require_last_push_approval": z.boolean().optional()})); -const protected_branch_required_status_check = z.lazy(() => z.object({"url": z.string().optional(), "enforcement_level": z.string().optional(), "contexts": z.array(z.string()), "checks": z.array(z.object({"context": z.string(), "app_id": z.number().int().nullable()})), "contexts_url": z.string().optional(), "strict": z.boolean().optional()})); -const pull_request = z.lazy(() => z.object({"url": z.string(), "id": z.number().int(), "node_id": z.string(), "html_url": z.string(), "diff_url": z.string(), "patch_url": z.string(), "issue_url": z.string(), "commits_url": z.string(), "review_comments_url": z.string(), "review_comment_url": z.string(), "comments_url": z.string(), "statuses_url": z.string(), "number": z.number().int(), "state": z.enum(["open", "closed"]), "locked": z.boolean(), "title": z.string(), "user": simple_user, "body": z.string().nullable(), "labels": z.array(z.object({"id": z.number().int(), "node_id": z.string(), "url": z.string(), "name": z.string(), "description": z.string().nullable(), "color": z.string(), "default": z.boolean(), "archived_by": simple_user.nullable()})), "milestone": nullable_milestone, "active_lock_reason": z.string().nullable().optional(), "created_at": z.string(), "updated_at": z.string(), "closed_at": z.string().nullable(), "merged_at": z.string().nullable(), "merge_commit_sha": z.string().nullable(), "assignee": nullable_simple_user, "assignees": z.array(simple_user).optional(), "requested_reviewers": z.array(simple_user).optional(), "requested_teams": z.array(team_simple).optional(), "head": z.object({"label": z.string(), "ref": z.string(), "repo": repository, "sha": z.string(), "user": simple_user}), "base": z.object({"label": z.string(), "ref": z.string(), "repo": repository, "sha": z.string(), "user": simple_user}), "_links": z.object({"comments": link, "commits": link, "statuses": link, "html": link, "issue": link, "review_comments": link, "review_comment": link, "self": link}), "author_association": author_association, "auto_merge": auto_merge, "stack": pull_request_stack.optional(), "draft": z.boolean().optional(), "merged": z.boolean(), "mergeable": z.boolean().nullable(), "rebaseable": z.boolean().nullable().optional(), "mergeable_state": z.string(), "merged_by": nullable_simple_user, "comments": z.number().int(), "review_comments": z.number().int(), "maintainer_can_modify": z.boolean(), "commits": z.number().int(), "additions": z.number().int(), "deletions": z.number().int(), "changed_files": z.number().int()})); +const protected_branch_required_status_check = z.lazy(() => z.object({"url": z.string().optional(), "enforcement_level": z.string().optional(), "contexts": z.array(z.string()), "checks": z.array(z.object({"context": z.string(), "app_id": z.number().int().nullable().optional()})), "contexts_url": z.string().optional(), "strict": z.boolean().optional()})); +const pull_request = z.lazy(() => z.object({"url": z.string(), "id": z.number().int(), "node_id": z.string(), "html_url": z.string(), "diff_url": z.string(), "patch_url": z.string(), "issue_url": z.string(), "commits_url": z.string(), "review_comments_url": z.string(), "review_comment_url": z.string(), "comments_url": z.string(), "statuses_url": z.string(), "number": z.number().int(), "state": z.enum(["open", "closed"]), "locked": z.boolean(), "title": z.string(), "user": simple_user, "body": z.string().nullable().optional(), "labels": z.array(z.object({"id": z.number().int(), "node_id": z.string(), "url": z.string(), "name": z.string(), "description": z.string().nullable().optional(), "color": z.string(), "default": z.boolean(), "archived_by": simple_user.nullable().optional()})), "milestone": nullable_milestone.optional(), "active_lock_reason": z.string().nullable().optional(), "created_at": z.string(), "updated_at": z.string(), "closed_at": z.string().nullable().optional(), "merged_at": z.string().nullable().optional(), "merge_commit_sha": z.string().nullable().optional(), "assignee": nullable_simple_user.optional(), "assignees": z.array(simple_user).optional(), "requested_reviewers": z.array(simple_user).optional(), "requested_teams": z.array(team_simple).optional(), "head": z.object({"label": z.string(), "ref": z.string(), "repo": repository, "sha": z.string(), "user": simple_user}), "base": z.object({"label": z.string(), "ref": z.string(), "repo": repository, "sha": z.string(), "user": simple_user}), "_links": z.object({"comments": link, "commits": link, "statuses": link, "html": link, "issue": link, "review_comments": link, "review_comment": link, "self": link}), "author_association": author_association, "auto_merge": auto_merge.optional(), "stack": pull_request_stack.optional(), "draft": z.boolean().optional(), "merged": z.boolean(), "mergeable": z.boolean().nullable().optional(), "rebaseable": z.boolean().nullable().optional(), "mergeable_state": z.string(), "merged_by": nullable_simple_user.optional(), "comments": z.number().int(), "review_comments": z.number().int(), "maintainer_can_modify": z.boolean(), "commits": z.number().int(), "additions": z.number().int(), "deletions": z.number().int(), "changed_files": z.number().int()})); const pull_request_merge_result = z.lazy(() => z.object({"sha": z.string(), "merged": z.boolean(), "message": z.string()})); const pull_request_minimal = z.lazy(() => z.object({"id": z.number().int(), "number": z.number().int(), "url": z.string(), "head": z.object({"ref": z.string(), "sha": z.string(), "repo": z.object({"id": z.number().int(), "url": z.string(), "name": z.string()})}), "base": z.object({"ref": z.string(), "sha": z.string(), "repo": z.object({"id": z.number().int(), "url": z.string(), "name": z.string()})})})); -const pull_request_review = z.lazy(() => z.object({"id": z.number().int(), "node_id": z.string(), "user": nullable_simple_user, "body": z.string(), "state": z.string(), "html_url": z.string(), "pull_request_url": z.string(), "_links": z.object({"html": z.object({"href": z.string()}), "pull_request": z.object({"href": z.string()})}), "submitted_at": z.string().optional(), "commit_id": z.string().nullable(), "body_html": z.string().optional(), "body_text": z.string().optional(), "author_association": author_association})); -const pull_request_review_comment = z.lazy(() => z.object({"url": z.string(), "pull_request_review_id": z.number().int().nullable(), "id": z.number().int(), "node_id": z.string(), "diff_hunk": z.string(), "path": z.string(), "position": z.number().int().optional(), "original_position": z.number().int().optional(), "commit_id": z.string(), "original_commit_id": z.string(), "in_reply_to_id": z.number().int().optional(), "user": nullable_simple_user, "body": z.string(), "created_at": z.string(), "updated_at": z.string(), "html_url": z.string(), "pull_request_url": z.string(), "author_association": author_association, "_links": z.object({"self": z.object({"href": z.string()}), "html": z.object({"href": z.string()}), "pull_request": z.object({"href": z.string()})}), "start_line": z.number().int().nullable().optional(), "original_start_line": z.number().int().nullable().optional(), "start_side": z.enum(["LEFT", "RIGHT"]).nullable().optional(), "line": z.number().int().optional(), "original_line": z.number().int().optional(), "side": z.enum(["LEFT", "RIGHT"]).optional(), "subject_type": z.enum(["line", "file"]).optional(), "reactions": reaction_rollup.optional(), "body_html": z.string().optional(), "body_text": z.string().optional()})); -const pull_request_simple = z.lazy(() => z.object({"url": z.string(), "id": z.number().int(), "node_id": z.string(), "html_url": z.string(), "diff_url": z.string(), "patch_url": z.string(), "issue_url": z.string(), "commits_url": z.string(), "review_comments_url": z.string(), "review_comment_url": z.string(), "comments_url": z.string(), "statuses_url": z.string(), "number": z.number().int(), "state": z.string(), "locked": z.boolean(), "title": z.string(), "user": nullable_simple_user, "body": z.string().nullable(), "labels": z.array(z.object({"id": z.number().int(), "node_id": z.string(), "url": z.string(), "name": z.string(), "description": z.string(), "color": z.string(), "default": z.boolean(), "archived_by": simple_user.nullable()})), "milestone": nullable_milestone, "active_lock_reason": z.string().nullable().optional(), "created_at": z.string(), "updated_at": z.string(), "closed_at": z.string().nullable(), "merged_at": z.string().nullable(), "merge_commit_sha": z.string().nullable(), "assignee": nullable_simple_user, "assignees": z.array(simple_user).optional(), "requested_reviewers": z.array(simple_user).optional(), "requested_teams": z.array(team).optional(), "head": z.object({"label": z.string(), "ref": z.string(), "repo": repository, "sha": z.string(), "user": nullable_simple_user}), "base": z.object({"label": z.string(), "ref": z.string(), "repo": repository, "sha": z.string(), "user": nullable_simple_user}), "_links": z.object({"comments": link, "commits": link, "statuses": link, "html": link, "issue": link, "review_comments": link, "review_comment": link, "self": link}), "author_association": author_association, "auto_merge": auto_merge, "stack": pull_request_stack.optional(), "draft": z.boolean().optional()})); +const pull_request_review = z.lazy(() => z.object({"id": z.number().int(), "node_id": z.string(), "user": nullable_simple_user.optional(), "body": z.string(), "state": z.string(), "html_url": z.string(), "pull_request_url": z.string(), "_links": z.object({"html": z.object({"href": z.string()}), "pull_request": z.object({"href": z.string()})}), "submitted_at": z.string().optional(), "commit_id": z.string().nullable().optional(), "body_html": z.string().optional(), "body_text": z.string().optional(), "author_association": author_association})); +const pull_request_review_comment = z.lazy(() => z.object({"url": z.string(), "pull_request_review_id": z.number().int().nullable().optional(), "id": z.number().int(), "node_id": z.string(), "diff_hunk": z.string(), "path": z.string(), "position": z.number().int().optional(), "original_position": z.number().int().optional(), "commit_id": z.string(), "original_commit_id": z.string(), "in_reply_to_id": z.number().int().optional(), "user": nullable_simple_user.optional(), "body": z.string(), "created_at": z.string(), "updated_at": z.string(), "html_url": z.string(), "pull_request_url": z.string(), "author_association": author_association, "_links": z.object({"self": z.object({"href": z.string()}), "html": z.object({"href": z.string()}), "pull_request": z.object({"href": z.string()})}), "start_line": z.number().int().nullable().optional(), "original_start_line": z.number().int().nullable().optional(), "start_side": z.enum(["LEFT", "RIGHT"]).nullable().optional(), "line": z.number().int().optional(), "original_line": z.number().int().optional(), "side": z.enum(["LEFT", "RIGHT"]).optional(), "subject_type": z.enum(["line", "file"]).optional(), "reactions": reaction_rollup.optional(), "body_html": z.string().optional(), "body_text": z.string().optional()})); +const pull_request_simple = z.lazy(() => z.object({"url": z.string(), "id": z.number().int(), "node_id": z.string(), "html_url": z.string(), "diff_url": z.string(), "patch_url": z.string(), "issue_url": z.string(), "commits_url": z.string(), "review_comments_url": z.string(), "review_comment_url": z.string(), "comments_url": z.string(), "statuses_url": z.string(), "number": z.number().int(), "state": z.string(), "locked": z.boolean(), "title": z.string(), "user": nullable_simple_user.optional(), "body": z.string().nullable().optional(), "labels": z.array(z.object({"id": z.number().int(), "node_id": z.string(), "url": z.string(), "name": z.string(), "description": z.string(), "color": z.string(), "default": z.boolean(), "archived_by": simple_user.nullable().optional()})), "milestone": nullable_milestone.optional(), "active_lock_reason": z.string().nullable().optional(), "created_at": z.string(), "updated_at": z.string(), "closed_at": z.string().nullable().optional(), "merged_at": z.string().nullable().optional(), "merge_commit_sha": z.string().nullable().optional(), "assignee": nullable_simple_user.optional(), "assignees": z.array(simple_user).optional(), "requested_reviewers": z.array(simple_user).optional(), "requested_teams": z.array(team).optional(), "head": z.object({"label": z.string(), "ref": z.string(), "repo": repository, "sha": z.string(), "user": nullable_simple_user.optional()}), "base": z.object({"label": z.string(), "ref": z.string(), "repo": repository, "sha": z.string(), "user": nullable_simple_user.optional()}), "_links": z.object({"comments": link, "commits": link, "statuses": link, "html": link, "issue": link, "review_comments": link, "review_comment": link, "self": link}), "author_association": author_association, "auto_merge": auto_merge.optional(), "stack": pull_request_stack.optional(), "draft": z.boolean().optional()})); const pull_request_stack = z.lazy(() => z.object({"base": z.object({"ref": z.string(), "sha": z.string()}), "size": z.number().int().optional(), "position": z.number().int().optional(), "id": z.number().int().optional(), "number": z.number().int().optional()}).nullable()); const pull_request_webhook = z.lazy(() => z.intersection(pull_request, z.object({"allow_auto_merge": z.boolean().optional(), "allow_update_branch": z.boolean().optional(), "delete_branch_on_merge": z.boolean().optional(), "merge_commit_message": z.enum(["PR_BODY", "PR_TITLE", "BLANK"]).optional(), "merge_commit_title": z.enum(["PR_TITLE", "MERGE_MESSAGE"]).optional(), "squash_merge_commit_message": z.enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]).optional(), "squash_merge_commit_title": z.enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]).optional(), "use_squash_pr_title_as_default": z.boolean().optional()}))); const reaction_rollup = z.lazy(() => z.object({"url": z.string(), "total_count": z.number().int(), "+1": z.number().int(), "-1": z.number().int(), "laugh": z.number().int(), "confused": z.number().int(), "heart": z.number().int(), "hooray": z.number().int(), "eyes": z.number().int(), "rocket": z.number().int()})); const referenced_workflow = z.lazy(() => z.object({"path": z.string(), "sha": z.string(), "ref": z.string().optional()})); -const release = z.lazy(() => z.object({"url": z.string(), "html_url": z.string(), "assets_url": z.string(), "upload_url": z.string(), "tarball_url": z.string().nullable(), "zipball_url": z.string().nullable(), "id": z.number().int(), "node_id": z.string(), "tag_name": z.string(), "target_commitish": z.string(), "name": z.string().nullable(), "body": z.string().nullable().optional(), "draft": z.boolean(), "prerelease": z.boolean(), "immutable": z.boolean().optional(), "created_at": z.string(), "published_at": z.string().nullable(), "updated_at": z.string().nullable().optional(), "author": simple_user, "assets": z.array(release_asset), "body_html": z.string().optional(), "body_text": z.string().optional(), "mentions_count": z.number().int().optional(), "discussion_url": z.string().optional(), "reactions": reaction_rollup.optional()})); -const release_asset = z.lazy(() => z.object({"url": z.string(), "browser_download_url": z.string(), "id": z.number().int(), "node_id": z.string(), "name": z.string(), "label": z.string().nullable(), "state": z.enum(["uploaded", "open"]), "content_type": z.string(), "size": z.number().int(), "digest": z.string().nullable(), "download_count": z.number().int(), "created_at": z.string(), "updated_at": z.string(), "uploader": nullable_simple_user})); -const repository = z.lazy(() => z.object({"id": z.number().int(), "node_id": z.string(), "name": z.string(), "full_name": z.string(), "license": nullable_license_simple, "forks": z.number().int(), "permissions": z.object({"admin": z.boolean(), "pull": z.boolean(), "triage": z.boolean().optional(), "push": z.boolean(), "maintain": z.boolean().optional()}).optional(), "owner": simple_user, "private": z.boolean(), "html_url": z.string(), "description": z.string().nullable(), "fork": z.boolean(), "url": z.string(), "archive_url": z.string(), "assignees_url": z.string(), "blobs_url": z.string(), "branches_url": z.string(), "collaborators_url": z.string(), "comments_url": z.string(), "commits_url": z.string(), "compare_url": z.string(), "contents_url": z.string(), "contributors_url": z.string(), "deployments_url": z.string(), "downloads_url": z.string(), "events_url": z.string(), "forks_url": z.string(), "git_commits_url": z.string(), "git_refs_url": z.string(), "git_tags_url": z.string(), "git_url": z.string(), "issue_comment_url": z.string(), "issue_events_url": z.string(), "issues_url": z.string(), "keys_url": z.string(), "labels_url": z.string(), "languages_url": z.string(), "merges_url": z.string(), "milestones_url": z.string(), "notifications_url": z.string(), "pulls_url": z.string(), "releases_url": z.string(), "ssh_url": z.string(), "stargazers_url": z.string(), "statuses_url": z.string(), "subscribers_url": z.string(), "subscription_url": z.string(), "tags_url": z.string(), "teams_url": z.string(), "trees_url": z.string(), "clone_url": z.string(), "mirror_url": z.string().nullable(), "hooks_url": z.string(), "svn_url": z.string(), "homepage": z.string().nullable(), "language": z.string().nullable(), "forks_count": z.number().int(), "stargazers_count": z.number().int(), "watchers_count": z.number().int(), "size": z.number().int(), "default_branch": z.string(), "open_issues_count": z.number().int(), "is_template": z.boolean().optional(), "topics": z.array(z.string()).optional(), "has_issues": z.boolean(), "has_projects": z.boolean(), "has_wiki": z.boolean(), "has_pages": z.boolean(), "has_downloads": z.boolean(), "has_discussions": z.boolean().optional(), "has_pull_requests": z.boolean().optional(), "pull_request_creation_policy": z.enum(["all", "collaborators_only"]).optional(), "archived": z.boolean(), "disabled": z.boolean(), "visibility": z.string().optional(), "pushed_at": z.string().nullable(), "created_at": z.string().nullable(), "updated_at": z.string().nullable(), "allow_rebase_merge": z.boolean().optional(), "temp_clone_token": z.string().optional(), "allow_squash_merge": z.boolean().optional(), "allow_auto_merge": z.boolean().optional(), "delete_branch_on_merge": z.boolean().optional(), "allow_update_branch": z.boolean().optional(), "use_squash_pr_title_as_default": z.boolean().optional(), "squash_merge_commit_title": z.enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]).optional(), "squash_merge_commit_message": z.enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]).optional(), "merge_commit_title": z.enum(["PR_TITLE", "MERGE_MESSAGE"]).optional(), "merge_commit_message": z.enum(["PR_BODY", "PR_TITLE", "BLANK"]).optional(), "allow_merge_commit": z.boolean().optional(), "allow_forking": z.boolean().optional(), "web_commit_signoff_required": z.boolean().optional(), "open_issues": z.number().int(), "watchers": z.number().int(), "master_branch": z.string().optional(), "starred_at": z.string().optional(), "anonymous_access_enabled": z.boolean().optional(), "code_search_index_status": z.object({"lexical_search_ok": z.boolean().optional(), "lexical_commit_sha": z.string().optional()}).optional()})); -const repository_webhooks = z.lazy(() => z.object({"id": z.number().int(), "node_id": z.string(), "name": z.string(), "full_name": z.string(), "license": nullable_license_simple, "organization": nullable_simple_user.optional(), "forks": z.number().int(), "permissions": z.object({"admin": z.boolean(), "pull": z.boolean(), "triage": z.boolean().optional(), "push": z.boolean(), "maintain": z.boolean().optional()}).optional(), "owner": simple_user, "private": z.boolean(), "html_url": z.string(), "description": z.string().nullable(), "fork": z.boolean(), "url": z.string(), "archive_url": z.string(), "assignees_url": z.string(), "blobs_url": z.string(), "branches_url": z.string(), "collaborators_url": z.string(), "comments_url": z.string(), "commits_url": z.string(), "compare_url": z.string(), "contents_url": z.string(), "contributors_url": z.string(), "deployments_url": z.string(), "downloads_url": z.string(), "events_url": z.string(), "forks_url": z.string(), "git_commits_url": z.string(), "git_refs_url": z.string(), "git_tags_url": z.string(), "git_url": z.string(), "issue_comment_url": z.string(), "issue_events_url": z.string(), "issues_url": z.string(), "keys_url": z.string(), "labels_url": z.string(), "languages_url": z.string(), "merges_url": z.string(), "milestones_url": z.string(), "notifications_url": z.string(), "pulls_url": z.string(), "releases_url": z.string(), "ssh_url": z.string(), "stargazers_url": z.string(), "statuses_url": z.string(), "subscribers_url": z.string(), "subscription_url": z.string(), "tags_url": z.string(), "teams_url": z.string(), "trees_url": z.string(), "clone_url": z.string(), "mirror_url": z.string().nullable(), "hooks_url": z.string(), "svn_url": z.string(), "homepage": z.string().nullable(), "language": z.string().nullable(), "forks_count": z.number().int(), "stargazers_count": z.number().int(), "watchers_count": z.number().int(), "size": z.number().int(), "default_branch": z.string(), "open_issues_count": z.number().int(), "is_template": z.boolean().optional(), "topics": z.array(z.string()).optional(), "custom_properties": z.record(z.string(), z.any()).optional(), "has_issues": z.boolean(), "has_projects": z.boolean(), "has_wiki": z.boolean(), "has_pages": z.boolean(), "has_downloads": z.boolean(), "has_discussions": z.boolean().optional(), "has_pull_requests": z.boolean().optional(), "pull_request_creation_policy": z.enum(["all", "collaborators_only"]).optional(), "archived": z.boolean(), "disabled": z.boolean(), "visibility": z.string().optional(), "pushed_at": z.string().nullable(), "created_at": z.string().nullable(), "updated_at": z.string().nullable(), "allow_rebase_merge": z.boolean().optional(), "template_repository": z.object({"id": z.number().int().optional(), "node_id": z.string().optional(), "name": z.string().optional(), "full_name": z.string().optional(), "owner": z.object({"login": z.string().optional(), "id": z.number().int().optional(), "node_id": z.string().optional(), "avatar_url": z.string().optional(), "gravatar_id": z.string().optional(), "url": z.string().optional(), "html_url": z.string().optional(), "followers_url": z.string().optional(), "following_url": z.string().optional(), "gists_url": z.string().optional(), "starred_url": z.string().optional(), "subscriptions_url": z.string().optional(), "organizations_url": z.string().optional(), "repos_url": z.string().optional(), "events_url": z.string().optional(), "received_events_url": z.string().optional(), "type": z.string().optional(), "site_admin": z.boolean().optional()}).optional(), "private": z.boolean().optional(), "html_url": z.string().optional(), "description": z.string().optional(), "fork": z.boolean().optional(), "url": z.string().optional(), "archive_url": z.string().optional(), "assignees_url": z.string().optional(), "blobs_url": z.string().optional(), "branches_url": z.string().optional(), "collaborators_url": z.string().optional(), "comments_url": z.string().optional(), "commits_url": z.string().optional(), "compare_url": z.string().optional(), "contents_url": z.string().optional(), "contributors_url": z.string().optional(), "deployments_url": z.string().optional(), "downloads_url": z.string().optional(), "events_url": z.string().optional(), "forks_url": z.string().optional(), "git_commits_url": z.string().optional(), "git_refs_url": z.string().optional(), "git_tags_url": z.string().optional(), "git_url": z.string().optional(), "issue_comment_url": z.string().optional(), "issue_events_url": z.string().optional(), "issues_url": z.string().optional(), "keys_url": z.string().optional(), "labels_url": z.string().optional(), "languages_url": z.string().optional(), "merges_url": z.string().optional(), "milestones_url": z.string().optional(), "notifications_url": z.string().optional(), "pulls_url": z.string().optional(), "releases_url": z.string().optional(), "ssh_url": z.string().optional(), "stargazers_url": z.string().optional(), "statuses_url": z.string().optional(), "subscribers_url": z.string().optional(), "subscription_url": z.string().optional(), "tags_url": z.string().optional(), "teams_url": z.string().optional(), "trees_url": z.string().optional(), "clone_url": z.string().optional(), "mirror_url": z.string().optional(), "hooks_url": z.string().optional(), "svn_url": z.string().optional(), "homepage": z.string().optional(), "language": z.string().optional(), "forks_count": z.number().int().optional(), "stargazers_count": z.number().int().optional(), "watchers_count": z.number().int().optional(), "size": z.number().int().optional(), "default_branch": z.string().optional(), "open_issues_count": z.number().int().optional(), "is_template": z.boolean().optional(), "topics": z.array(z.string()).optional(), "has_issues": z.boolean().optional(), "has_projects": z.boolean().optional(), "has_wiki": z.boolean().optional(), "has_pages": z.boolean().optional(), "has_downloads": z.boolean().optional(), "archived": z.boolean().optional(), "disabled": z.boolean().optional(), "visibility": z.string().optional(), "pushed_at": z.string().optional(), "created_at": z.string().optional(), "updated_at": z.string().optional(), "permissions": z.object({"admin": z.boolean().optional(), "maintain": z.boolean().optional(), "push": z.boolean().optional(), "triage": z.boolean().optional(), "pull": z.boolean().optional()}).optional(), "allow_rebase_merge": z.boolean().optional(), "temp_clone_token": z.string().optional(), "allow_squash_merge": z.boolean().optional(), "allow_auto_merge": z.boolean().optional(), "delete_branch_on_merge": z.boolean().optional(), "allow_update_branch": z.boolean().optional(), "use_squash_pr_title_as_default": z.boolean().optional(), "squash_merge_commit_title": z.enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]).optional(), "squash_merge_commit_message": z.enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]).optional(), "merge_commit_title": z.enum(["PR_TITLE", "MERGE_MESSAGE"]).optional(), "merge_commit_message": z.enum(["PR_BODY", "PR_TITLE", "BLANK"]).optional(), "allow_merge_commit": z.boolean().optional(), "subscribers_count": z.number().int().optional(), "network_count": z.number().int().optional()}).nullable().optional(), "temp_clone_token": z.string().optional(), "allow_squash_merge": z.boolean().optional(), "allow_auto_merge": z.boolean().optional(), "delete_branch_on_merge": z.boolean().optional(), "allow_update_branch": z.boolean().optional(), "use_squash_pr_title_as_default": z.boolean().optional(), "squash_merge_commit_title": z.enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]).optional(), "squash_merge_commit_message": z.enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]).optional(), "merge_commit_title": z.enum(["PR_TITLE", "MERGE_MESSAGE"]).optional(), "merge_commit_message": z.enum(["PR_BODY", "PR_TITLE", "BLANK"]).optional(), "allow_merge_commit": z.boolean().optional(), "allow_forking": z.boolean().optional(), "web_commit_signoff_required": z.boolean().optional(), "subscribers_count": z.number().int().optional(), "network_count": z.number().int().optional(), "open_issues": z.number().int(), "watchers": z.number().int(), "master_branch": z.string().optional(), "starred_at": z.string().optional(), "anonymous_access_enabled": z.boolean().optional()})); +const release = z.lazy(() => z.object({"url": z.string(), "html_url": z.string(), "assets_url": z.string(), "upload_url": z.string(), "tarball_url": z.string().nullable().optional(), "zipball_url": z.string().nullable().optional(), "id": z.number().int(), "node_id": z.string(), "tag_name": z.string(), "target_commitish": z.string(), "name": z.string().nullable().optional(), "body": z.string().nullable().optional(), "draft": z.boolean(), "prerelease": z.boolean(), "immutable": z.boolean().optional(), "created_at": z.string(), "published_at": z.string().nullable().optional(), "updated_at": z.string().nullable().optional(), "author": simple_user, "assets": z.array(release_asset), "body_html": z.string().optional(), "body_text": z.string().optional(), "mentions_count": z.number().int().optional(), "discussion_url": z.string().optional(), "reactions": reaction_rollup.optional()})); +const release_asset = z.lazy(() => z.object({"url": z.string(), "browser_download_url": z.string(), "id": z.number().int(), "node_id": z.string(), "name": z.string(), "label": z.string().nullable().optional(), "state": z.enum(["uploaded", "open"]), "content_type": z.string(), "size": z.number().int(), "digest": z.string().nullable().optional(), "download_count": z.number().int(), "created_at": z.string(), "updated_at": z.string(), "uploader": nullable_simple_user.optional()})); +const repository = z.lazy(() => z.object({"id": z.number().int(), "node_id": z.string(), "name": z.string(), "full_name": z.string(), "license": nullable_license_simple.optional(), "forks": z.number().int(), "permissions": z.object({"admin": z.boolean(), "pull": z.boolean(), "triage": z.boolean().optional(), "push": z.boolean(), "maintain": z.boolean().optional()}).optional(), "owner": simple_user, "private": z.boolean(), "html_url": z.string(), "description": z.string().nullable().optional(), "fork": z.boolean(), "url": z.string(), "archive_url": z.string(), "assignees_url": z.string(), "blobs_url": z.string(), "branches_url": z.string(), "collaborators_url": z.string(), "comments_url": z.string(), "commits_url": z.string(), "compare_url": z.string(), "contents_url": z.string(), "contributors_url": z.string(), "deployments_url": z.string(), "downloads_url": z.string(), "events_url": z.string(), "forks_url": z.string(), "git_commits_url": z.string(), "git_refs_url": z.string(), "git_tags_url": z.string(), "git_url": z.string(), "issue_comment_url": z.string(), "issue_events_url": z.string(), "issues_url": z.string(), "keys_url": z.string(), "labels_url": z.string(), "languages_url": z.string(), "merges_url": z.string(), "milestones_url": z.string(), "notifications_url": z.string(), "pulls_url": z.string(), "releases_url": z.string(), "ssh_url": z.string(), "stargazers_url": z.string(), "statuses_url": z.string(), "subscribers_url": z.string(), "subscription_url": z.string(), "tags_url": z.string(), "teams_url": z.string(), "trees_url": z.string(), "clone_url": z.string(), "mirror_url": z.string().nullable().optional(), "hooks_url": z.string(), "svn_url": z.string(), "homepage": z.string().nullable().optional(), "language": z.string().nullable().optional(), "forks_count": z.number().int(), "stargazers_count": z.number().int(), "watchers_count": z.number().int(), "size": z.number().int(), "default_branch": z.string(), "open_issues_count": z.number().int(), "is_template": z.boolean().optional(), "topics": z.array(z.string()).optional(), "has_issues": z.boolean(), "has_projects": z.boolean(), "has_wiki": z.boolean(), "has_pages": z.boolean(), "has_downloads": z.boolean(), "has_discussions": z.boolean().optional(), "has_pull_requests": z.boolean().optional(), "pull_request_creation_policy": z.enum(["all", "collaborators_only"]).optional(), "archived": z.boolean(), "disabled": z.boolean(), "visibility": z.string().optional(), "pushed_at": z.string().nullable().optional(), "created_at": z.string().nullable().optional(), "updated_at": z.string().nullable().optional(), "allow_rebase_merge": z.boolean().optional(), "temp_clone_token": z.string().optional(), "allow_squash_merge": z.boolean().optional(), "allow_auto_merge": z.boolean().optional(), "delete_branch_on_merge": z.boolean().optional(), "allow_update_branch": z.boolean().optional(), "use_squash_pr_title_as_default": z.boolean().optional(), "squash_merge_commit_title": z.enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]).optional(), "squash_merge_commit_message": z.enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]).optional(), "merge_commit_title": z.enum(["PR_TITLE", "MERGE_MESSAGE"]).optional(), "merge_commit_message": z.enum(["PR_BODY", "PR_TITLE", "BLANK"]).optional(), "allow_merge_commit": z.boolean().optional(), "allow_forking": z.boolean().optional(), "web_commit_signoff_required": z.boolean().optional(), "open_issues": z.number().int(), "watchers": z.number().int(), "master_branch": z.string().optional(), "starred_at": z.string().optional(), "anonymous_access_enabled": z.boolean().optional(), "code_search_index_status": z.object({"lexical_search_ok": z.boolean().optional(), "lexical_commit_sha": z.string().optional()}).optional()})); +const repository_webhooks = z.lazy(() => z.object({"id": z.number().int(), "node_id": z.string(), "name": z.string(), "full_name": z.string(), "license": nullable_license_simple.optional(), "organization": nullable_simple_user.optional(), "forks": z.number().int(), "permissions": z.object({"admin": z.boolean(), "pull": z.boolean(), "triage": z.boolean().optional(), "push": z.boolean(), "maintain": z.boolean().optional()}).optional(), "owner": simple_user, "private": z.boolean(), "html_url": z.string(), "description": z.string().nullable().optional(), "fork": z.boolean(), "url": z.string(), "archive_url": z.string(), "assignees_url": z.string(), "blobs_url": z.string(), "branches_url": z.string(), "collaborators_url": z.string(), "comments_url": z.string(), "commits_url": z.string(), "compare_url": z.string(), "contents_url": z.string(), "contributors_url": z.string(), "deployments_url": z.string(), "downloads_url": z.string(), "events_url": z.string(), "forks_url": z.string(), "git_commits_url": z.string(), "git_refs_url": z.string(), "git_tags_url": z.string(), "git_url": z.string(), "issue_comment_url": z.string(), "issue_events_url": z.string(), "issues_url": z.string(), "keys_url": z.string(), "labels_url": z.string(), "languages_url": z.string(), "merges_url": z.string(), "milestones_url": z.string(), "notifications_url": z.string(), "pulls_url": z.string(), "releases_url": z.string(), "ssh_url": z.string(), "stargazers_url": z.string(), "statuses_url": z.string(), "subscribers_url": z.string(), "subscription_url": z.string(), "tags_url": z.string(), "teams_url": z.string(), "trees_url": z.string(), "clone_url": z.string(), "mirror_url": z.string().nullable().optional(), "hooks_url": z.string(), "svn_url": z.string(), "homepage": z.string().nullable().optional(), "language": z.string().nullable().optional(), "forks_count": z.number().int(), "stargazers_count": z.number().int(), "watchers_count": z.number().int(), "size": z.number().int(), "default_branch": z.string(), "open_issues_count": z.number().int(), "is_template": z.boolean().optional(), "topics": z.array(z.string()).optional(), "custom_properties": z.record(z.string(), z.any()).optional(), "has_issues": z.boolean(), "has_projects": z.boolean(), "has_wiki": z.boolean(), "has_pages": z.boolean(), "has_downloads": z.boolean(), "has_discussions": z.boolean().optional(), "has_pull_requests": z.boolean().optional(), "pull_request_creation_policy": z.enum(["all", "collaborators_only"]).optional(), "archived": z.boolean(), "disabled": z.boolean(), "visibility": z.string().optional(), "pushed_at": z.string().nullable().optional(), "created_at": z.string().nullable().optional(), "updated_at": z.string().nullable().optional(), "allow_rebase_merge": z.boolean().optional(), "template_repository": z.object({"id": z.number().int().optional(), "node_id": z.string().optional(), "name": z.string().optional(), "full_name": z.string().optional(), "owner": z.object({"login": z.string().optional(), "id": z.number().int().optional(), "node_id": z.string().optional(), "avatar_url": z.string().optional(), "gravatar_id": z.string().optional(), "url": z.string().optional(), "html_url": z.string().optional(), "followers_url": z.string().optional(), "following_url": z.string().optional(), "gists_url": z.string().optional(), "starred_url": z.string().optional(), "subscriptions_url": z.string().optional(), "organizations_url": z.string().optional(), "repos_url": z.string().optional(), "events_url": z.string().optional(), "received_events_url": z.string().optional(), "type": z.string().optional(), "site_admin": z.boolean().optional()}).optional(), "private": z.boolean().optional(), "html_url": z.string().optional(), "description": z.string().optional(), "fork": z.boolean().optional(), "url": z.string().optional(), "archive_url": z.string().optional(), "assignees_url": z.string().optional(), "blobs_url": z.string().optional(), "branches_url": z.string().optional(), "collaborators_url": z.string().optional(), "comments_url": z.string().optional(), "commits_url": z.string().optional(), "compare_url": z.string().optional(), "contents_url": z.string().optional(), "contributors_url": z.string().optional(), "deployments_url": z.string().optional(), "downloads_url": z.string().optional(), "events_url": z.string().optional(), "forks_url": z.string().optional(), "git_commits_url": z.string().optional(), "git_refs_url": z.string().optional(), "git_tags_url": z.string().optional(), "git_url": z.string().optional(), "issue_comment_url": z.string().optional(), "issue_events_url": z.string().optional(), "issues_url": z.string().optional(), "keys_url": z.string().optional(), "labels_url": z.string().optional(), "languages_url": z.string().optional(), "merges_url": z.string().optional(), "milestones_url": z.string().optional(), "notifications_url": z.string().optional(), "pulls_url": z.string().optional(), "releases_url": z.string().optional(), "ssh_url": z.string().optional(), "stargazers_url": z.string().optional(), "statuses_url": z.string().optional(), "subscribers_url": z.string().optional(), "subscription_url": z.string().optional(), "tags_url": z.string().optional(), "teams_url": z.string().optional(), "trees_url": z.string().optional(), "clone_url": z.string().optional(), "mirror_url": z.string().optional(), "hooks_url": z.string().optional(), "svn_url": z.string().optional(), "homepage": z.string().optional(), "language": z.string().optional(), "forks_count": z.number().int().optional(), "stargazers_count": z.number().int().optional(), "watchers_count": z.number().int().optional(), "size": z.number().int().optional(), "default_branch": z.string().optional(), "open_issues_count": z.number().int().optional(), "is_template": z.boolean().optional(), "topics": z.array(z.string()).optional(), "has_issues": z.boolean().optional(), "has_projects": z.boolean().optional(), "has_wiki": z.boolean().optional(), "has_pages": z.boolean().optional(), "has_downloads": z.boolean().optional(), "archived": z.boolean().optional(), "disabled": z.boolean().optional(), "visibility": z.string().optional(), "pushed_at": z.string().optional(), "created_at": z.string().optional(), "updated_at": z.string().optional(), "permissions": z.object({"admin": z.boolean().optional(), "maintain": z.boolean().optional(), "push": z.boolean().optional(), "triage": z.boolean().optional(), "pull": z.boolean().optional()}).optional(), "allow_rebase_merge": z.boolean().optional(), "temp_clone_token": z.string().optional(), "allow_squash_merge": z.boolean().optional(), "allow_auto_merge": z.boolean().optional(), "delete_branch_on_merge": z.boolean().optional(), "allow_update_branch": z.boolean().optional(), "use_squash_pr_title_as_default": z.boolean().optional(), "squash_merge_commit_title": z.enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]).optional(), "squash_merge_commit_message": z.enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]).optional(), "merge_commit_title": z.enum(["PR_TITLE", "MERGE_MESSAGE"]).optional(), "merge_commit_message": z.enum(["PR_BODY", "PR_TITLE", "BLANK"]).optional(), "allow_merge_commit": z.boolean().optional(), "subscribers_count": z.number().int().optional(), "network_count": z.number().int().optional()}).nullable().optional(), "temp_clone_token": z.string().optional(), "allow_squash_merge": z.boolean().optional(), "allow_auto_merge": z.boolean().optional(), "delete_branch_on_merge": z.boolean().optional(), "allow_update_branch": z.boolean().optional(), "use_squash_pr_title_as_default": z.boolean().optional(), "squash_merge_commit_title": z.enum(["PR_TITLE", "COMMIT_OR_PR_TITLE"]).optional(), "squash_merge_commit_message": z.enum(["PR_BODY", "COMMIT_MESSAGES", "BLANK"]).optional(), "merge_commit_title": z.enum(["PR_TITLE", "MERGE_MESSAGE"]).optional(), "merge_commit_message": z.enum(["PR_BODY", "PR_TITLE", "BLANK"]).optional(), "allow_merge_commit": z.boolean().optional(), "allow_forking": z.boolean().optional(), "web_commit_signoff_required": z.boolean().optional(), "subscribers_count": z.number().int().optional(), "network_count": z.number().int().optional(), "open_issues": z.number().int(), "watchers": z.number().int(), "master_branch": z.string().optional(), "starred_at": z.string().optional(), "anonymous_access_enabled": z.boolean().optional()})); const security_and_analysis = z.lazy(() => z.object({"advanced_security": z.object({"status": z.enum(["enabled", "disabled"]).optional()}).optional(), "code_security": z.object({"status": z.enum(["enabled", "disabled"]).optional()}).optional(), "dependabot_security_updates": z.object({"status": z.enum(["enabled", "disabled"]).optional()}).optional(), "secret_scanning": z.object({"status": z.enum(["enabled", "disabled"]).optional()}).optional(), "secret_scanning_push_protection": z.object({"status": z.enum(["enabled", "disabled"]).optional()}).optional(), "secret_scanning_non_provider_patterns": z.object({"status": z.enum(["enabled", "disabled"]).optional()}).optional(), "secret_scanning_ai_detection": z.object({"status": z.enum(["enabled", "disabled"]).optional()}).optional(), "secret_scanning_delegated_alert_dismissal": z.object({"status": z.enum(["enabled", "disabled"]).optional()}).optional(), "secret_scanning_delegated_bypass": z.object({"status": z.enum(["enabled", "disabled"]).optional()}).optional(), "secret_scanning_delegated_bypass_options": z.object({"reviewers": z.array(z.object({"reviewer_id": z.number().int(), "reviewer_type": z.enum(["TEAM", "ROLE"]), "mode": z.enum(["ALWAYS", "EXEMPT"]).optional()})).optional()}).optional()}).nullable()); const short_branch = z.lazy(() => z.object({"name": z.string(), "commit": z.object({"sha": z.string(), "url": z.string()}), "protected": z.boolean(), "protection": branch_protection.optional(), "protection_url": z.string().optional()})); const simple_installation = z.lazy(() => z.object({"id": z.number().int(), "node_id": z.string()})); -const simple_user = z.lazy(() => z.object({"name": z.string().nullable().optional(), "email": z.string().nullable().optional(), "login": z.string(), "id": z.number().int(), "node_id": z.string(), "avatar_url": z.string(), "gravatar_id": z.string().nullable(), "url": z.string(), "html_url": z.string(), "followers_url": z.string(), "following_url": z.string(), "gists_url": z.string(), "starred_url": z.string(), "subscriptions_url": z.string(), "organizations_url": z.string(), "repos_url": z.string(), "events_url": z.string(), "received_events_url": z.string(), "type": z.string(), "site_admin": z.boolean(), "starred_at": z.string().optional(), "user_view_type": z.string().optional()})); -const status = z.lazy(() => z.object({"url": z.string(), "avatar_url": z.string().nullable(), "id": z.number().int(), "node_id": z.string(), "state": z.string(), "description": z.string().nullable(), "target_url": z.string().nullable(), "context": z.string(), "created_at": z.string(), "updated_at": z.string(), "creator": nullable_simple_user})); +const simple_user = z.lazy(() => z.object({"name": z.string().nullable().optional(), "email": z.string().nullable().optional(), "login": z.string(), "id": z.number().int(), "node_id": z.string(), "avatar_url": z.string(), "gravatar_id": z.string().nullable().optional(), "url": z.string(), "html_url": z.string(), "followers_url": z.string(), "following_url": z.string(), "gists_url": z.string(), "starred_url": z.string(), "subscriptions_url": z.string(), "organizations_url": z.string(), "repos_url": z.string(), "events_url": z.string(), "received_events_url": z.string(), "type": z.string(), "site_admin": z.boolean(), "starred_at": z.string().optional(), "user_view_type": z.string().optional()})); +const status = z.lazy(() => z.object({"url": z.string(), "avatar_url": z.string().nullable().optional(), "id": z.number().int(), "node_id": z.string(), "state": z.string(), "description": z.string().nullable().optional(), "target_url": z.string().nullable().optional(), "context": z.string(), "created_at": z.string(), "updated_at": z.string(), "creator": nullable_simple_user.optional()})); const sub_issues_summary = z.lazy(() => z.object({"total": z.number().int(), "completed": z.number().int(), "percent_completed": z.number().int()})); -const team = z.lazy(() => z.object({"id": z.number().int(), "node_id": z.string(), "name": z.string(), "slug": z.string(), "description": z.string().nullable(), "privacy": z.string().optional(), "notification_setting": z.string().optional(), "permission": z.string(), "permissions": z.object({"pull": z.boolean(), "triage": z.boolean(), "push": z.boolean(), "maintain": z.boolean(), "admin": z.boolean()}).optional(), "url": z.string(), "html_url": z.string(), "members_url": z.string(), "repositories_url": z.string(), "type": z.enum(["enterprise", "organization"]), "access_source": z.enum(["direct", "organization", "enterprise"]).optional(), "organization_id": z.number().int().optional(), "enterprise_id": z.number().int().optional(), "parent": nullable_team_simple})); -const team_simple = z.lazy(() => z.object({"id": z.number().int(), "node_id": z.string(), "url": z.string(), "members_url": z.string(), "name": z.string(), "description": z.string().nullable(), "permission": z.string(), "privacy": z.string().optional(), "notification_setting": z.string().optional(), "html_url": z.string(), "repositories_url": z.string(), "slug": z.string(), "ldap_dn": z.string().optional(), "type": z.enum(["enterprise", "organization"]), "organization_id": z.number().int().optional(), "enterprise_id": z.number().int().optional()})); -const verification = z.lazy(() => z.object({"verified": z.boolean(), "reason": z.string(), "payload": z.string().nullable(), "signature": z.string().nullable(), "verified_at": z.string().nullable()})); -const webhook_issues_closed = z.lazy(() => z.object({"action": z.literal("closed"), "enterprise": enterprise_webhooks.optional(), "installation": simple_installation.optional(), "issue": z.intersection(z.object({"active_lock_reason": z.enum(["resolved", "off-topic", "too heated", "spam"]).nullable(), "assignee": z.object({"avatar_url": z.string().optional(), "deleted": z.boolean().optional(), "email": z.string().nullable().optional(), "events_url": z.string().optional(), "followers_url": z.string().optional(), "following_url": z.string().optional(), "gists_url": z.string().optional(), "gravatar_id": z.string().optional(), "html_url": z.string().optional(), "id": z.number().int(), "login": z.string(), "name": z.string().optional(), "node_id": z.string().optional(), "organizations_url": z.string().optional(), "received_events_url": z.string().optional(), "repos_url": z.string().optional(), "site_admin": z.boolean().optional(), "starred_url": z.string().optional(), "subscriptions_url": z.string().optional(), "type": z.enum(["Bot", "User", "Organization", "Mannequin"]).optional(), "url": z.string().optional(), "user_view_type": z.string().optional()}).nullable().optional(), "assignees": z.array(z.object({"avatar_url": z.string().optional(), "deleted": z.boolean().optional(), "email": z.string().nullable().optional(), "events_url": z.string().optional(), "followers_url": z.string().optional(), "following_url": z.string().optional(), "gists_url": z.string().optional(), "gravatar_id": z.string().optional(), "html_url": z.string().optional(), "id": z.number().int(), "login": z.string(), "name": z.string().optional(), "node_id": z.string().optional(), "organizations_url": z.string().optional(), "received_events_url": z.string().optional(), "repos_url": z.string().optional(), "site_admin": z.boolean().optional(), "starred_url": z.string().optional(), "subscriptions_url": z.string().optional(), "type": z.enum(["Bot", "User", "Organization", "Mannequin"]).optional(), "url": z.string().optional(), "user_view_type": z.string().optional()}).nullable()), "author_association": z.enum(["COLLABORATOR", "CONTRIBUTOR", "FIRST_TIMER", "FIRST_TIME_CONTRIBUTOR", "MANNEQUIN", "MEMBER", "NONE", "OWNER"]), "body": z.string().nullable(), "closed_at": z.string().nullable(), "comments": z.number().int(), "comments_url": z.string(), "created_at": z.string(), "draft": z.boolean().optional(), "events_url": z.string(), "html_url": z.string(), "id": z.number().int(), "labels": z.array(z.object({"color": z.string(), "default": z.boolean(), "description": z.string().nullable(), "id": z.number().int(), "name": z.string(), "node_id": z.string(), "url": z.string()})).optional(), "labels_url": z.string(), "locked": z.boolean().optional(), "milestone": z.object({"closed_at": z.string().nullable(), "closed_issues": z.number().int(), "created_at": z.string(), "creator": z.object({"avatar_url": z.string().optional(), "deleted": z.boolean().optional(), "email": z.string().nullable().optional(), "events_url": z.string().optional(), "followers_url": z.string().optional(), "following_url": z.string().optional(), "gists_url": z.string().optional(), "gravatar_id": z.string().optional(), "html_url": z.string().optional(), "id": z.number().int(), "login": z.string(), "name": z.string().optional(), "node_id": z.string().optional(), "organizations_url": z.string().optional(), "received_events_url": z.string().optional(), "repos_url": z.string().optional(), "site_admin": z.boolean().optional(), "starred_url": z.string().optional(), "subscriptions_url": z.string().optional(), "type": z.enum(["Bot", "User", "Organization", "Mannequin"]).optional(), "url": z.string().optional(), "user_view_type": z.string().optional()}).nullable(), "description": z.string().nullable(), "due_on": z.string().nullable(), "html_url": z.string(), "id": z.number().int(), "labels_url": z.string(), "node_id": z.string(), "number": z.number().int(), "open_issues": z.number().int(), "state": z.enum(["open", "closed"]), "title": z.string(), "updated_at": z.string(), "url": z.string()}).nullable(), "node_id": z.string(), "number": z.number().int(), "performed_via_github_app": z.object({"created_at": z.string().nullable(), "description": z.string().nullable(), "events": z.array(z.enum(["branch_protection_rule", "check_run", "check_suite", "code_scanning_alert", "commit_comment", "content_reference", "create", "delete", "deployment", "deployment_review", "deployment_status", "deploy_key", "discussion", "discussion_comment", "fork", "gollum", "issues", "issue_comment", "label", "member", "membership", "milestone", "organization", "org_block", "page_build", "project", "project_card", "project_column", "public", "pull_request", "pull_request_review", "pull_request_review_comment", "push", "registry_package", "release", "repository", "repository_dispatch", "secret_scanning_alert", "star", "status", "team", "team_add", "watch", "workflow_dispatch", "workflow_run", "security_and_analysis", "reminder", "pull_request_review_thread"])).optional(), "external_url": z.string().nullable(), "html_url": z.string(), "id": z.number().int().nullable(), "name": z.string(), "node_id": z.string(), "owner": z.object({"avatar_url": z.string().optional(), "deleted": z.boolean().optional(), "email": z.string().nullable().optional(), "events_url": z.string().optional(), "followers_url": z.string().optional(), "following_url": z.string().optional(), "gists_url": z.string().optional(), "gravatar_id": z.string().optional(), "html_url": z.string().optional(), "id": z.number().int(), "login": z.string(), "name": z.string().optional(), "node_id": z.string().optional(), "organizations_url": z.string().optional(), "received_events_url": z.string().optional(), "repos_url": z.string().optional(), "site_admin": z.boolean().optional(), "starred_url": z.string().optional(), "subscriptions_url": z.string().optional(), "type": z.enum(["Bot", "User", "Organization"]).optional(), "url": z.string().optional(), "user_view_type": z.string().optional()}).nullable(), "permissions": z.object({"actions": z.enum(["read", "write"]).optional(), "administration": z.enum(["read", "write"]).optional(), "checks": z.enum(["read", "write"]).optional(), "content_references": z.enum(["read", "write"]).optional(), "contents": z.enum(["read", "write"]).optional(), "deployments": z.enum(["read", "write"]).optional(), "discussions": z.enum(["read", "write"]).optional(), "emails": z.enum(["read", "write"]).optional(), "environments": z.enum(["read", "write"]).optional(), "issues": z.enum(["read", "write"]).optional(), "keys": z.enum(["read", "write"]).optional(), "members": z.enum(["read", "write"]).optional(), "metadata": z.enum(["read", "write"]).optional(), "organization_administration": z.enum(["read", "write"]).optional(), "organization_hooks": z.enum(["read", "write"]).optional(), "organization_packages": z.enum(["read", "write"]).optional(), "organization_plan": z.enum(["read", "write"]).optional(), "organization_projects": z.enum(["read", "write", "admin"]).optional(), "organization_secrets": z.enum(["read", "write"]).optional(), "organization_self_hosted_runners": z.enum(["read", "write"]).optional(), "organization_user_blocking": z.enum(["read", "write"]).optional(), "packages": z.enum(["read", "write"]).optional(), "pages": z.enum(["read", "write"]).optional(), "pull_requests": z.enum(["read", "write"]).optional(), "repository_hooks": z.enum(["read", "write"]).optional(), "repository_projects": z.enum(["read", "write"]).optional(), "secret_scanning_alerts": z.enum(["read", "write"]).optional(), "secrets": z.enum(["read", "write"]).optional(), "security_events": z.enum(["read", "write"]).optional(), "security_scanning_alert": z.enum(["read", "write"]).optional(), "single_file": z.enum(["read", "write"]).optional(), "statuses": z.enum(["read", "write"]).optional(), "vulnerability_alerts": z.enum(["read", "write"]).optional(), "workflows": z.enum(["read", "write"]).optional()}).optional(), "slug": z.string().optional(), "updated_at": z.string().nullable()}).nullable().optional(), "pull_request": z.object({"diff_url": z.string().optional(), "html_url": z.string().optional(), "merged_at": z.string().nullable().optional(), "patch_url": z.string().optional(), "url": z.string().optional()}).optional(), "reactions": z.object({"+1": z.number().int(), "-1": z.number().int(), "confused": z.number().int(), "eyes": z.number().int(), "heart": z.number().int(), "hooray": z.number().int(), "laugh": z.number().int(), "rocket": z.number().int(), "total_count": z.number().int(), "url": z.string()}), "repository_url": z.string(), "pinned_comment": nullable_issue_comment.optional(), "sub_issues_summary": sub_issues_summary.optional(), "issue_dependencies_summary": issue_dependencies_summary.optional(), "issue_field_values": z.array(issue_field_value).optional(), "state": z.enum(["open", "closed"]).optional(), "state_reason": z.string().nullable().optional(), "timeline_url": z.string().optional(), "title": z.string(), "type": issue_type.optional(), "updated_at": z.string(), "url": z.string(), "user": z.object({"avatar_url": z.string().optional(), "deleted": z.boolean().optional(), "email": z.string().nullable().optional(), "events_url": z.string().optional(), "followers_url": z.string().optional(), "following_url": z.string().optional(), "gists_url": z.string().optional(), "gravatar_id": z.string().optional(), "html_url": z.string().optional(), "id": z.number().int(), "login": z.string(), "name": z.string().optional(), "node_id": z.string().optional(), "organizations_url": z.string().optional(), "received_events_url": z.string().optional(), "repos_url": z.string().optional(), "site_admin": z.boolean().optional(), "starred_url": z.string().optional(), "subscriptions_url": z.string().optional(), "type": z.enum(["Bot", "User", "Organization", "Mannequin"]).optional(), "url": z.string().optional(), "user_view_type": z.string().optional()}).nullable()}), z.object({"active_lock_reason": z.string().nullable().optional(), "assignee": z.record(z.string(), z.any()).nullable().optional(), "assignees": z.array(z.record(z.string(), z.any()).nullable()).optional(), "author_association": z.string().optional(), "body": z.string().nullable().optional(), "closed_at": z.string().nullable(), "comments": z.number().int().optional(), "comments_url": z.string().optional(), "created_at": z.string().optional(), "events_url": z.string().optional(), "html_url": z.string().optional(), "id": z.number().int().optional(), "labels": z.array(z.record(z.string(), z.any()).nullable()).optional(), "labels_url": z.string().optional(), "locked": z.boolean().optional(), "milestone": z.record(z.string(), z.any()).nullable().optional(), "node_id": z.string().optional(), "number": z.number().int().optional(), "performed_via_github_app": z.record(z.string(), z.any()).nullable().optional(), "reactions": z.object({"+1": z.number().int().optional(), "-1": z.number().int().optional(), "confused": z.number().int().optional(), "eyes": z.number().int().optional(), "heart": z.number().int().optional(), "hooray": z.number().int().optional(), "laugh": z.number().int().optional(), "rocket": z.number().int().optional(), "total_count": z.number().int().optional(), "url": z.string().optional()}).optional(), "repository_url": z.string().optional(), "state": z.enum(["closed", "open"]), "timeline_url": z.string().optional(), "title": z.string().optional(), "updated_at": z.string().optional(), "url": z.string().optional(), "user": z.object({"avatar_url": z.string().optional(), "events_url": z.string().optional(), "followers_url": z.string().optional(), "following_url": z.string().optional(), "gists_url": z.string().optional(), "gravatar_id": z.string().optional(), "html_url": z.string().optional(), "id": z.number().int().optional(), "login": z.string().optional(), "node_id": z.string().optional(), "organizations_url": z.string().optional(), "received_events_url": z.string().optional(), "repos_url": z.string().optional(), "site_admin": z.boolean().optional(), "starred_url": z.string().optional(), "subscriptions_url": z.string().optional(), "type": z.string().optional(), "url": z.string().optional(), "user_view_type": z.string().optional()}).optional()})), "organization": organization_simple_webhooks.optional(), "repository": repository_webhooks, "sender": simple_user})); -const webhook_issues_opened = z.lazy(() => z.object({"action": z.literal("opened"), "changes": z.object({"old_issue": z.object({"active_lock_reason": z.enum(["resolved", "off-topic", "too heated", "spam"]).nullable().optional(), "assignee": z.object({"avatar_url": z.string().optional(), "deleted": z.boolean().optional(), "email": z.string().nullable().optional(), "events_url": z.string().optional(), "followers_url": z.string().optional(), "following_url": z.string().optional(), "gists_url": z.string().optional(), "gravatar_id": z.string().optional(), "html_url": z.string().optional(), "id": z.number().int(), "login": z.string(), "name": z.string().optional(), "node_id": z.string().optional(), "organizations_url": z.string().optional(), "received_events_url": z.string().optional(), "repos_url": z.string().optional(), "site_admin": z.boolean().optional(), "starred_url": z.string().optional(), "subscriptions_url": z.string().optional(), "type": z.enum(["Bot", "User", "Organization"]).optional(), "url": z.string().optional(), "user_view_type": z.string().optional()}).nullable().optional(), "assignees": z.array(z.object({"avatar_url": z.string().optional(), "deleted": z.boolean().optional(), "email": z.string().nullable().optional(), "events_url": z.string().optional(), "followers_url": z.string().optional(), "following_url": z.string().optional(), "gists_url": z.string().optional(), "gravatar_id": z.string().optional(), "html_url": z.string().optional(), "id": z.number().int(), "login": z.string(), "name": z.string().optional(), "node_id": z.string().optional(), "organizations_url": z.string().optional(), "received_events_url": z.string().optional(), "repos_url": z.string().optional(), "site_admin": z.boolean().optional(), "starred_url": z.string().optional(), "subscriptions_url": z.string().optional(), "type": z.enum(["Bot", "User", "Organization"]).optional(), "url": z.string().optional(), "user_view_type": z.string().optional()}).nullable()).optional(), "author_association": z.enum(["COLLABORATOR", "CONTRIBUTOR", "FIRST_TIMER", "FIRST_TIME_CONTRIBUTOR", "MANNEQUIN", "MEMBER", "NONE", "OWNER"]).optional(), "body": z.string().nullable().optional(), "closed_at": z.string().nullable().optional(), "comments": z.number().int().optional(), "comments_url": z.string().optional(), "created_at": z.string().optional(), "draft": z.boolean().optional(), "events_url": z.string().optional(), "html_url": z.string().optional(), "id": z.number().int(), "labels": z.array(z.object({"color": z.string(), "default": z.boolean(), "description": z.string().nullable(), "id": z.number().int(), "name": z.string(), "node_id": z.string(), "url": z.string()})).optional(), "labels_url": z.string().optional(), "locked": z.boolean().optional(), "milestone": z.object({"closed_at": z.string().nullable(), "closed_issues": z.number().int(), "created_at": z.string(), "creator": z.object({"avatar_url": z.string().optional(), "deleted": z.boolean().optional(), "email": z.string().nullable().optional(), "events_url": z.string().optional(), "followers_url": z.string().optional(), "following_url": z.string().optional(), "gists_url": z.string().optional(), "gravatar_id": z.string().optional(), "html_url": z.string().optional(), "id": z.number().int(), "login": z.string(), "name": z.string().optional(), "node_id": z.string().optional(), "organizations_url": z.string().optional(), "received_events_url": z.string().optional(), "repos_url": z.string().optional(), "site_admin": z.boolean().optional(), "starred_url": z.string().optional(), "subscriptions_url": z.string().optional(), "type": z.enum(["Bot", "User", "Organization"]).optional(), "url": z.string().optional(), "user_view_type": z.string().optional()}).nullable(), "description": z.string().nullable(), "due_on": z.string().nullable(), "html_url": z.string(), "id": z.number().int(), "labels_url": z.string(), "node_id": z.string(), "number": z.number().int(), "open_issues": z.number().int(), "state": z.enum(["open", "closed"]), "title": z.string(), "updated_at": z.string(), "url": z.string()}).nullable().optional(), "node_id": z.string().optional(), "number": z.number().int(), "performed_via_github_app": z.object({"created_at": z.string().nullable(), "description": z.string().nullable(), "events": z.array(z.enum(["branch_protection_rule", "check_run", "check_suite", "code_scanning_alert", "commit_comment", "content_reference", "create", "delete", "deployment", "deployment_review", "deployment_status", "deploy_key", "discussion", "discussion_comment", "fork", "gollum", "issues", "issue_comment", "label", "member", "membership", "milestone", "organization", "org_block", "page_build", "project", "project_card", "project_column", "public", "pull_request", "pull_request_review", "pull_request_review_comment", "push", "registry_package", "release", "repository", "repository_dispatch", "secret_scanning_alert", "star", "status", "team", "team_add", "watch", "workflow_dispatch", "workflow_run"])).optional(), "external_url": z.string().nullable(), "html_url": z.string(), "id": z.number().int().nullable(), "name": z.string(), "node_id": z.string(), "owner": z.object({"avatar_url": z.string().optional(), "deleted": z.boolean().optional(), "email": z.string().nullable().optional(), "events_url": z.string().optional(), "followers_url": z.string().optional(), "following_url": z.string().optional(), "gists_url": z.string().optional(), "gravatar_id": z.string().optional(), "html_url": z.string().optional(), "id": z.number().int(), "login": z.string(), "name": z.string().optional(), "node_id": z.string().optional(), "organizations_url": z.string().optional(), "received_events_url": z.string().optional(), "repos_url": z.string().optional(), "site_admin": z.boolean().optional(), "starred_url": z.string().optional(), "subscriptions_url": z.string().optional(), "type": z.enum(["Bot", "User", "Organization"]).optional(), "url": z.string().optional(), "user_view_type": z.string().optional()}).nullable(), "permissions": z.object({"actions": z.enum(["read", "write"]).optional(), "administration": z.enum(["read", "write"]).optional(), "checks": z.enum(["read", "write"]).optional(), "content_references": z.enum(["read", "write"]).optional(), "contents": z.enum(["read", "write"]).optional(), "deployments": z.enum(["read", "write"]).optional(), "discussions": z.enum(["read", "write"]).optional(), "emails": z.enum(["read", "write"]).optional(), "environments": z.enum(["read", "write"]).optional(), "issues": z.enum(["read", "write"]).optional(), "keys": z.enum(["read", "write"]).optional(), "members": z.enum(["read", "write"]).optional(), "metadata": z.enum(["read", "write"]).optional(), "organization_administration": z.enum(["read", "write"]).optional(), "organization_hooks": z.enum(["read", "write"]).optional(), "organization_packages": z.enum(["read", "write"]).optional(), "organization_plan": z.enum(["read", "write"]).optional(), "organization_projects": z.enum(["read", "write"]).optional(), "organization_secrets": z.enum(["read", "write"]).optional(), "organization_self_hosted_runners": z.enum(["read", "write"]).optional(), "organization_user_blocking": z.enum(["read", "write"]).optional(), "packages": z.enum(["read", "write"]).optional(), "pages": z.enum(["read", "write"]).optional(), "pull_requests": z.enum(["read", "write"]).optional(), "repository_hooks": z.enum(["read", "write"]).optional(), "repository_projects": z.enum(["read", "write"]).optional(), "secret_scanning_alerts": z.enum(["read", "write"]).optional(), "secrets": z.enum(["read", "write"]).optional(), "security_events": z.enum(["read", "write"]).optional(), "security_scanning_alert": z.enum(["read", "write"]).optional(), "single_file": z.enum(["read", "write"]).optional(), "statuses": z.enum(["read", "write"]).optional(), "vulnerability_alerts": z.enum(["read", "write"]).optional(), "workflows": z.enum(["read", "write"]).optional()}).optional(), "slug": z.string().optional(), "updated_at": z.string().nullable()}).nullable().optional(), "pull_request": z.object({"diff_url": z.string().optional(), "html_url": z.string().optional(), "merged_at": z.string().nullable().optional(), "patch_url": z.string().optional(), "url": z.string().optional()}).optional(), "reactions": z.object({"+1": z.number().int(), "-1": z.number().int(), "confused": z.number().int(), "eyes": z.number().int(), "heart": z.number().int(), "hooray": z.number().int(), "laugh": z.number().int(), "rocket": z.number().int(), "total_count": z.number().int(), "url": z.string()}).optional(), "repository_url": z.string().optional(), "sub_issues_summary": sub_issues_summary.optional(), "issue_dependencies_summary": issue_dependencies_summary.optional(), "issue_field_values": z.array(issue_field_value).optional(), "state": z.enum(["open", "closed"]).optional(), "state_reason": z.string().nullable().optional(), "timeline_url": z.string().optional(), "title": z.string().optional(), "updated_at": z.string().optional(), "url": z.string().optional(), "pinned_comment": nullable_issue_comment.optional(), "user": z.object({"avatar_url": z.string().optional(), "deleted": z.boolean().optional(), "email": z.string().nullable().optional(), "events_url": z.string().optional(), "followers_url": z.string().optional(), "following_url": z.string().optional(), "gists_url": z.string().optional(), "gravatar_id": z.string().optional(), "html_url": z.string().optional(), "id": z.number().int(), "login": z.string(), "name": z.string().optional(), "node_id": z.string().optional(), "organizations_url": z.string().optional(), "received_events_url": z.string().optional(), "repos_url": z.string().optional(), "site_admin": z.boolean().optional(), "starred_url": z.string().optional(), "subscriptions_url": z.string().optional(), "type": z.enum(["Bot", "User", "Organization"]).optional(), "url": z.string().optional(), "user_view_type": z.string().optional()}).nullable().optional(), "type": issue_type.optional()}).nullable(), "old_repository": z.object({"allow_auto_merge": z.boolean().optional(), "allow_forking": z.boolean().optional(), "allow_merge_commit": z.boolean().optional(), "allow_rebase_merge": z.boolean().optional(), "allow_squash_merge": z.boolean().optional(), "allow_update_branch": z.boolean().optional(), "archive_url": z.string(), "archived": z.boolean(), "assignees_url": z.string(), "blobs_url": z.string(), "branches_url": z.string(), "clone_url": z.string(), "collaborators_url": z.string(), "comments_url": z.string(), "commits_url": z.string(), "compare_url": z.string(), "contents_url": z.string(), "contributors_url": z.string(), "created_at": z.union([z.number().int(), z.string()]), "custom_properties": z.record(z.string(), z.any()).optional(), "default_branch": z.string(), "delete_branch_on_merge": z.boolean().optional(), "deployments_url": z.string(), "description": z.string().nullable(), "disabled": z.boolean().optional(), "downloads_url": z.string(), "events_url": z.string(), "fork": z.boolean(), "forks": z.number().int(), "forks_count": z.number().int(), "forks_url": z.string(), "full_name": z.string(), "git_commits_url": z.string(), "git_refs_url": z.string(), "git_tags_url": z.string(), "git_url": z.string(), "has_discussions": z.boolean().optional(), "has_pull_requests": z.boolean().optional(), "pull_request_creation_policy": z.enum(["all", "collaborators_only"]).optional(), "has_downloads": z.boolean(), "has_issues": z.boolean(), "has_pages": z.boolean(), "has_projects": z.boolean(), "has_wiki": z.boolean(), "homepage": z.string().nullable(), "hooks_url": z.string(), "html_url": z.string(), "id": z.number().int(), "is_template": z.boolean().optional(), "issue_comment_url": z.string(), "issue_events_url": z.string(), "issues_url": z.string(), "keys_url": z.string(), "labels_url": z.string(), "language": z.string().nullable(), "languages_url": z.string(), "license": z.object({"key": z.string(), "name": z.string(), "node_id": z.string(), "spdx_id": z.string(), "url": z.string().nullable()}).nullable(), "master_branch": z.string().optional(), "merges_url": z.string(), "milestones_url": z.string(), "mirror_url": z.string().nullable(), "name": z.string(), "node_id": z.string(), "notifications_url": z.string(), "open_issues": z.number().int(), "open_issues_count": z.number().int(), "organization": z.string().optional(), "owner": z.object({"avatar_url": z.string().optional(), "deleted": z.boolean().optional(), "email": z.string().nullable().optional(), "events_url": z.string().optional(), "followers_url": z.string().optional(), "following_url": z.string().optional(), "gists_url": z.string().optional(), "gravatar_id": z.string().optional(), "html_url": z.string().optional(), "id": z.number().int(), "login": z.string(), "name": z.string().optional(), "node_id": z.string().optional(), "organizations_url": z.string().optional(), "received_events_url": z.string().optional(), "repos_url": z.string().optional(), "site_admin": z.boolean().optional(), "starred_url": z.string().optional(), "subscriptions_url": z.string().optional(), "type": z.enum(["Bot", "User", "Organization"]).optional(), "url": z.string().optional(), "user_view_type": z.string().optional()}).nullable(), "permissions": z.object({"admin": z.boolean(), "maintain": z.boolean().optional(), "pull": z.boolean(), "push": z.boolean(), "triage": z.boolean().optional()}).optional(), "private": z.boolean(), "public": z.boolean().optional(), "pulls_url": z.string(), "pushed_at": z.union([z.number().int(), z.string()]).nullable(), "releases_url": z.string(), "role_name": z.string().nullable().optional(), "size": z.number().int(), "ssh_url": z.string(), "stargazers": z.number().int().optional(), "stargazers_count": z.number().int(), "stargazers_url": z.string(), "statuses_url": z.string(), "subscribers_url": z.string(), "subscription_url": z.string(), "svn_url": z.string(), "tags_url": z.string(), "teams_url": z.string(), "topics": z.array(z.string()), "trees_url": z.string(), "updated_at": z.string(), "url": z.string(), "visibility": z.enum(["public", "private", "internal"]), "watchers": z.number().int(), "watchers_count": z.number().int(), "web_commit_signoff_required": z.boolean().optional()})}).optional(), "enterprise": enterprise_webhooks.optional(), "installation": simple_installation.optional(), "issue": z.object({"active_lock_reason": z.enum(["resolved", "off-topic", "too heated", "spam"]).nullable(), "assignee": z.object({"avatar_url": z.string().optional(), "deleted": z.boolean().optional(), "email": z.string().nullable().optional(), "events_url": z.string().optional(), "followers_url": z.string().optional(), "following_url": z.string().optional(), "gists_url": z.string().optional(), "gravatar_id": z.string().optional(), "html_url": z.string().optional(), "id": z.number().int(), "login": z.string(), "name": z.string().optional(), "node_id": z.string().optional(), "organizations_url": z.string().optional(), "received_events_url": z.string().optional(), "repos_url": z.string().optional(), "site_admin": z.boolean().optional(), "starred_url": z.string().optional(), "subscriptions_url": z.string().optional(), "type": z.enum(["Bot", "User", "Organization"]).optional(), "url": z.string().optional(), "user_view_type": z.string().optional()}).nullable().optional(), "assignees": z.array(z.object({"avatar_url": z.string().optional(), "deleted": z.boolean().optional(), "email": z.string().nullable().optional(), "events_url": z.string().optional(), "followers_url": z.string().optional(), "following_url": z.string().optional(), "gists_url": z.string().optional(), "gravatar_id": z.string().optional(), "html_url": z.string().optional(), "id": z.number().int(), "login": z.string(), "name": z.string().optional(), "node_id": z.string().optional(), "organizations_url": z.string().optional(), "received_events_url": z.string().optional(), "repos_url": z.string().optional(), "site_admin": z.boolean().optional(), "starred_url": z.string().optional(), "subscriptions_url": z.string().optional(), "type": z.enum(["Bot", "User", "Organization"]).optional(), "url": z.string().optional(), "user_view_type": z.string().optional()}).nullable()), "author_association": z.enum(["COLLABORATOR", "CONTRIBUTOR", "FIRST_TIMER", "FIRST_TIME_CONTRIBUTOR", "MANNEQUIN", "MEMBER", "NONE", "OWNER"]), "body": z.string().nullable(), "closed_at": z.string().nullable(), "comments": z.number().int(), "comments_url": z.string(), "created_at": z.string(), "draft": z.boolean().optional(), "events_url": z.string(), "html_url": z.string(), "id": z.number().int(), "labels": z.array(z.object({"color": z.string(), "default": z.boolean(), "description": z.string().nullable(), "id": z.number().int(), "name": z.string(), "node_id": z.string(), "url": z.string()})).optional(), "labels_url": z.string(), "locked": z.boolean().optional(), "milestone": z.object({"closed_at": z.string().nullable(), "closed_issues": z.number().int(), "created_at": z.string(), "creator": z.object({"avatar_url": z.string().optional(), "deleted": z.boolean().optional(), "email": z.string().nullable().optional(), "events_url": z.string().optional(), "followers_url": z.string().optional(), "following_url": z.string().optional(), "gists_url": z.string().optional(), "gravatar_id": z.string().optional(), "html_url": z.string().optional(), "id": z.number().int(), "login": z.string(), "name": z.string().optional(), "node_id": z.string().optional(), "organizations_url": z.string().optional(), "received_events_url": z.string().optional(), "repos_url": z.string().optional(), "site_admin": z.boolean().optional(), "starred_url": z.string().optional(), "subscriptions_url": z.string().optional(), "type": z.enum(["Bot", "User", "Organization", "Mannequin"]).optional(), "url": z.string().optional(), "user_view_type": z.string().optional()}).nullable(), "description": z.string().nullable(), "due_on": z.string().nullable(), "html_url": z.string(), "id": z.number().int(), "labels_url": z.string(), "node_id": z.string(), "number": z.number().int(), "open_issues": z.number().int(), "state": z.enum(["open", "closed"]), "title": z.string(), "updated_at": z.string(), "url": z.string()}).nullable(), "node_id": z.string(), "number": z.number().int(), "performed_via_github_app": z.object({"created_at": z.string().nullable(), "description": z.string().nullable(), "events": z.array(z.enum(["branch_protection_rule", "check_run", "check_suite", "code_scanning_alert", "commit_comment", "content_reference", "create", "delete", "deployment", "deployment_review", "deployment_status", "deploy_key", "discussion", "discussion_comment", "fork", "gollum", "issues", "issue_comment", "label", "member", "membership", "milestone", "organization", "org_block", "page_build", "project", "project_card", "project_column", "public", "pull_request", "pull_request_review", "pull_request_review_comment", "push", "registry_package", "release", "repository", "repository_dispatch", "secret_scanning_alert", "star", "status", "team", "team_add", "watch", "workflow_dispatch", "workflow_run", "security_and_analysis", "pull_request_review_thread", "reminder"])).optional(), "external_url": z.string().nullable(), "html_url": z.string(), "id": z.number().int().nullable(), "name": z.string(), "node_id": z.string(), "owner": z.object({"avatar_url": z.string().optional(), "deleted": z.boolean().optional(), "email": z.string().nullable().optional(), "events_url": z.string().optional(), "followers_url": z.string().optional(), "following_url": z.string().optional(), "gists_url": z.string().optional(), "gravatar_id": z.string().optional(), "html_url": z.string().optional(), "id": z.number().int(), "login": z.string(), "name": z.string().optional(), "node_id": z.string().optional(), "organizations_url": z.string().optional(), "received_events_url": z.string().optional(), "repos_url": z.string().optional(), "site_admin": z.boolean().optional(), "starred_url": z.string().optional(), "subscriptions_url": z.string().optional(), "type": z.enum(["Bot", "User", "Organization"]).optional(), "url": z.string().optional(), "user_view_type": z.string().optional()}).nullable(), "permissions": z.object({"actions": z.enum(["read", "write"]).optional(), "administration": z.enum(["read", "write"]).optional(), "checks": z.enum(["read", "write"]).optional(), "content_references": z.enum(["read", "write"]).optional(), "contents": z.enum(["read", "write"]).optional(), "deployments": z.enum(["read", "write"]).optional(), "discussions": z.enum(["read", "write"]).optional(), "emails": z.enum(["read", "write"]).optional(), "environments": z.enum(["read", "write"]).optional(), "issues": z.enum(["read", "write"]).optional(), "keys": z.enum(["read", "write"]).optional(), "members": z.enum(["read", "write"]).optional(), "metadata": z.enum(["read", "write"]).optional(), "organization_administration": z.enum(["read", "write"]).optional(), "organization_hooks": z.enum(["read", "write"]).optional(), "organization_packages": z.enum(["read", "write"]).optional(), "organization_plan": z.enum(["read", "write"]).optional(), "organization_projects": z.enum(["read", "write", "admin"]).optional(), "organization_secrets": z.enum(["read", "write"]).optional(), "organization_self_hosted_runners": z.enum(["read", "write"]).optional(), "organization_user_blocking": z.enum(["read", "write"]).optional(), "packages": z.enum(["read", "write"]).optional(), "pages": z.enum(["read", "write"]).optional(), "pull_requests": z.enum(["read", "write"]).optional(), "repository_hooks": z.enum(["read", "write"]).optional(), "repository_projects": z.enum(["read", "write"]).optional(), "secret_scanning_alerts": z.enum(["read", "write"]).optional(), "secrets": z.enum(["read", "write"]).optional(), "security_events": z.enum(["read", "write"]).optional(), "security_scanning_alert": z.enum(["read", "write"]).optional(), "single_file": z.enum(["read", "write"]).optional(), "statuses": z.enum(["read", "write"]).optional(), "vulnerability_alerts": z.enum(["read", "write"]).optional(), "workflows": z.enum(["read", "write"]).optional()}).optional(), "slug": z.string().optional(), "updated_at": z.string().nullable()}).nullable().optional(), "pull_request": z.object({"diff_url": z.string().optional(), "html_url": z.string().optional(), "merged_at": z.string().nullable().optional(), "patch_url": z.string().optional(), "url": z.string().optional()}).optional(), "reactions": z.object({"+1": z.number().int(), "-1": z.number().int(), "confused": z.number().int(), "eyes": z.number().int(), "heart": z.number().int(), "hooray": z.number().int(), "laugh": z.number().int(), "rocket": z.number().int(), "total_count": z.number().int(), "url": z.string()}), "repository_url": z.string(), "sub_issues_summary": sub_issues_summary.optional(), "issue_dependencies_summary": issue_dependencies_summary.optional(), "issue_field_values": z.array(issue_field_value).optional(), "state": z.enum(["open", "closed"]).optional(), "state_reason": z.string().nullable().optional(), "timeline_url": z.string().optional(), "title": z.string(), "type": issue_type.optional(), "updated_at": z.string(), "url": z.string(), "pinned_comment": nullable_issue_comment.optional(), "user": z.object({"avatar_url": z.string().optional(), "deleted": z.boolean().optional(), "email": z.string().nullable().optional(), "events_url": z.string().optional(), "followers_url": z.string().optional(), "following_url": z.string().optional(), "gists_url": z.string().optional(), "gravatar_id": z.string().optional(), "html_url": z.string().optional(), "id": z.number().int(), "login": z.string(), "name": z.string().optional(), "node_id": z.string().optional(), "organizations_url": z.string().optional(), "received_events_url": z.string().optional(), "repos_url": z.string().optional(), "site_admin": z.boolean().optional(), "starred_url": z.string().optional(), "subscriptions_url": z.string().optional(), "type": z.enum(["Bot", "User", "Organization"]).optional(), "url": z.string().optional(), "user_view_type": z.string().optional()}).nullable()}), "organization": organization_simple_webhooks.optional(), "repository": repository_webhooks, "sender": simple_user})); +const team = z.lazy(() => z.object({"id": z.number().int(), "node_id": z.string(), "name": z.string(), "slug": z.string(), "description": z.string().nullable().optional(), "privacy": z.string().optional(), "notification_setting": z.string().optional(), "permission": z.string(), "permissions": z.object({"pull": z.boolean(), "triage": z.boolean(), "push": z.boolean(), "maintain": z.boolean(), "admin": z.boolean()}).optional(), "url": z.string(), "html_url": z.string(), "members_url": z.string(), "repositories_url": z.string(), "type": z.enum(["enterprise", "organization"]), "access_source": z.enum(["direct", "organization", "enterprise"]).optional(), "organization_id": z.number().int().optional(), "enterprise_id": z.number().int().optional(), "parent": nullable_team_simple.optional()})); +const team_simple = z.lazy(() => z.object({"id": z.number().int(), "node_id": z.string(), "url": z.string(), "members_url": z.string(), "name": z.string(), "description": z.string().nullable().optional(), "permission": z.string(), "privacy": z.string().optional(), "notification_setting": z.string().optional(), "html_url": z.string(), "repositories_url": z.string(), "slug": z.string(), "ldap_dn": z.string().optional(), "type": z.enum(["enterprise", "organization"]), "organization_id": z.number().int().optional(), "enterprise_id": z.number().int().optional()})); +const verification = z.lazy(() => z.object({"verified": z.boolean(), "reason": z.string(), "payload": z.string().nullable().optional(), "signature": z.string().nullable().optional(), "verified_at": z.string().nullable().optional()})); +const webhook_issues_closed = z.lazy(() => z.object({"action": z.literal("closed"), "enterprise": enterprise_webhooks.optional(), "installation": simple_installation.optional(), "issue": z.intersection(z.object({"active_lock_reason": z.enum(["resolved", "off-topic", "too heated", "spam"]).nullable().optional(), "assignee": z.object({"avatar_url": z.string().optional(), "deleted": z.boolean().optional(), "email": z.string().nullable().optional(), "events_url": z.string().optional(), "followers_url": z.string().optional(), "following_url": z.string().optional(), "gists_url": z.string().optional(), "gravatar_id": z.string().optional(), "html_url": z.string().optional(), "id": z.number().int(), "login": z.string(), "name": z.string().optional(), "node_id": z.string().optional(), "organizations_url": z.string().optional(), "received_events_url": z.string().optional(), "repos_url": z.string().optional(), "site_admin": z.boolean().optional(), "starred_url": z.string().optional(), "subscriptions_url": z.string().optional(), "type": z.enum(["Bot", "User", "Organization", "Mannequin"]).optional(), "url": z.string().optional(), "user_view_type": z.string().optional()}).nullable().optional(), "assignees": z.array(z.object({"avatar_url": z.string().optional(), "deleted": z.boolean().optional(), "email": z.string().nullable().optional(), "events_url": z.string().optional(), "followers_url": z.string().optional(), "following_url": z.string().optional(), "gists_url": z.string().optional(), "gravatar_id": z.string().optional(), "html_url": z.string().optional(), "id": z.number().int(), "login": z.string(), "name": z.string().optional(), "node_id": z.string().optional(), "organizations_url": z.string().optional(), "received_events_url": z.string().optional(), "repos_url": z.string().optional(), "site_admin": z.boolean().optional(), "starred_url": z.string().optional(), "subscriptions_url": z.string().optional(), "type": z.enum(["Bot", "User", "Organization", "Mannequin"]).optional(), "url": z.string().optional(), "user_view_type": z.string().optional()}).nullable()), "author_association": z.enum(["COLLABORATOR", "CONTRIBUTOR", "FIRST_TIMER", "FIRST_TIME_CONTRIBUTOR", "MANNEQUIN", "MEMBER", "NONE", "OWNER"]), "body": z.string().nullable().optional(), "closed_at": z.string().nullable().optional(), "comments": z.number().int(), "comments_url": z.string(), "created_at": z.string(), "draft": z.boolean().optional(), "events_url": z.string(), "html_url": z.string(), "id": z.number().int(), "labels": z.array(z.object({"color": z.string(), "default": z.boolean(), "description": z.string().nullable().optional(), "id": z.number().int(), "name": z.string(), "node_id": z.string(), "url": z.string()})).optional(), "labels_url": z.string(), "locked": z.boolean().optional(), "milestone": z.object({"closed_at": z.string().nullable().optional(), "closed_issues": z.number().int(), "created_at": z.string(), "creator": z.object({"avatar_url": z.string().optional(), "deleted": z.boolean().optional(), "email": z.string().nullable().optional(), "events_url": z.string().optional(), "followers_url": z.string().optional(), "following_url": z.string().optional(), "gists_url": z.string().optional(), "gravatar_id": z.string().optional(), "html_url": z.string().optional(), "id": z.number().int(), "login": z.string(), "name": z.string().optional(), "node_id": z.string().optional(), "organizations_url": z.string().optional(), "received_events_url": z.string().optional(), "repos_url": z.string().optional(), "site_admin": z.boolean().optional(), "starred_url": z.string().optional(), "subscriptions_url": z.string().optional(), "type": z.enum(["Bot", "User", "Organization", "Mannequin"]).optional(), "url": z.string().optional(), "user_view_type": z.string().optional()}).nullable().optional(), "description": z.string().nullable().optional(), "due_on": z.string().nullable().optional(), "html_url": z.string(), "id": z.number().int(), "labels_url": z.string(), "node_id": z.string(), "number": z.number().int(), "open_issues": z.number().int(), "state": z.enum(["open", "closed"]), "title": z.string(), "updated_at": z.string(), "url": z.string()}).nullable().optional(), "node_id": z.string(), "number": z.number().int(), "performed_via_github_app": z.object({"created_at": z.string().nullable().optional(), "description": z.string().nullable().optional(), "events": z.array(z.enum(["branch_protection_rule", "check_run", "check_suite", "code_scanning_alert", "commit_comment", "content_reference", "create", "delete", "deployment", "deployment_review", "deployment_status", "deploy_key", "discussion", "discussion_comment", "fork", "gollum", "issues", "issue_comment", "label", "member", "membership", "milestone", "organization", "org_block", "page_build", "project", "project_card", "project_column", "public", "pull_request", "pull_request_review", "pull_request_review_comment", "push", "registry_package", "release", "repository", "repository_dispatch", "secret_scanning_alert", "star", "status", "team", "team_add", "watch", "workflow_dispatch", "workflow_run", "security_and_analysis", "reminder", "pull_request_review_thread"])).optional(), "external_url": z.string().nullable().optional(), "html_url": z.string(), "id": z.number().int().nullable().optional(), "name": z.string(), "node_id": z.string(), "owner": z.object({"avatar_url": z.string().optional(), "deleted": z.boolean().optional(), "email": z.string().nullable().optional(), "events_url": z.string().optional(), "followers_url": z.string().optional(), "following_url": z.string().optional(), "gists_url": z.string().optional(), "gravatar_id": z.string().optional(), "html_url": z.string().optional(), "id": z.number().int(), "login": z.string(), "name": z.string().optional(), "node_id": z.string().optional(), "organizations_url": z.string().optional(), "received_events_url": z.string().optional(), "repos_url": z.string().optional(), "site_admin": z.boolean().optional(), "starred_url": z.string().optional(), "subscriptions_url": z.string().optional(), "type": z.enum(["Bot", "User", "Organization"]).optional(), "url": z.string().optional(), "user_view_type": z.string().optional()}).nullable().optional(), "permissions": z.object({"actions": z.enum(["read", "write"]).optional(), "administration": z.enum(["read", "write"]).optional(), "checks": z.enum(["read", "write"]).optional(), "content_references": z.enum(["read", "write"]).optional(), "contents": z.enum(["read", "write"]).optional(), "deployments": z.enum(["read", "write"]).optional(), "discussions": z.enum(["read", "write"]).optional(), "emails": z.enum(["read", "write"]).optional(), "environments": z.enum(["read", "write"]).optional(), "issues": z.enum(["read", "write"]).optional(), "keys": z.enum(["read", "write"]).optional(), "members": z.enum(["read", "write"]).optional(), "metadata": z.enum(["read", "write"]).optional(), "organization_administration": z.enum(["read", "write"]).optional(), "organization_hooks": z.enum(["read", "write"]).optional(), "organization_packages": z.enum(["read", "write"]).optional(), "organization_plan": z.enum(["read", "write"]).optional(), "organization_projects": z.enum(["read", "write", "admin"]).optional(), "organization_secrets": z.enum(["read", "write"]).optional(), "organization_self_hosted_runners": z.enum(["read", "write"]).optional(), "organization_user_blocking": z.enum(["read", "write"]).optional(), "packages": z.enum(["read", "write"]).optional(), "pages": z.enum(["read", "write"]).optional(), "pull_requests": z.enum(["read", "write"]).optional(), "repository_hooks": z.enum(["read", "write"]).optional(), "repository_projects": z.enum(["read", "write"]).optional(), "secret_scanning_alerts": z.enum(["read", "write"]).optional(), "secrets": z.enum(["read", "write"]).optional(), "security_events": z.enum(["read", "write"]).optional(), "security_scanning_alert": z.enum(["read", "write"]).optional(), "single_file": z.enum(["read", "write"]).optional(), "statuses": z.enum(["read", "write"]).optional(), "vulnerability_alerts": z.enum(["read", "write"]).optional(), "workflows": z.enum(["read", "write"]).optional()}).optional(), "slug": z.string().optional(), "updated_at": z.string().nullable().optional()}).nullable().optional(), "pull_request": z.object({"diff_url": z.string().optional(), "html_url": z.string().optional(), "merged_at": z.string().nullable().optional(), "patch_url": z.string().optional(), "url": z.string().optional()}).optional(), "reactions": z.object({"+1": z.number().int(), "-1": z.number().int(), "confused": z.number().int(), "eyes": z.number().int(), "heart": z.number().int(), "hooray": z.number().int(), "laugh": z.number().int(), "rocket": z.number().int(), "total_count": z.number().int(), "url": z.string()}), "repository_url": z.string(), "pinned_comment": nullable_issue_comment.optional(), "sub_issues_summary": sub_issues_summary.optional(), "issue_dependencies_summary": issue_dependencies_summary.optional(), "issue_field_values": z.array(issue_field_value).optional(), "state": z.enum(["open", "closed"]).optional(), "state_reason": z.string().nullable().optional(), "timeline_url": z.string().optional(), "title": z.string(), "type": issue_type.optional(), "updated_at": z.string(), "url": z.string(), "user": z.object({"avatar_url": z.string().optional(), "deleted": z.boolean().optional(), "email": z.string().nullable().optional(), "events_url": z.string().optional(), "followers_url": z.string().optional(), "following_url": z.string().optional(), "gists_url": z.string().optional(), "gravatar_id": z.string().optional(), "html_url": z.string().optional(), "id": z.number().int(), "login": z.string(), "name": z.string().optional(), "node_id": z.string().optional(), "organizations_url": z.string().optional(), "received_events_url": z.string().optional(), "repos_url": z.string().optional(), "site_admin": z.boolean().optional(), "starred_url": z.string().optional(), "subscriptions_url": z.string().optional(), "type": z.enum(["Bot", "User", "Organization", "Mannequin"]).optional(), "url": z.string().optional(), "user_view_type": z.string().optional()}).nullable().optional()}), z.object({"active_lock_reason": z.string().nullable().optional(), "assignee": z.record(z.string(), z.any()).nullable().optional(), "assignees": z.array(z.record(z.string(), z.any()).nullable()).optional(), "author_association": z.string().optional(), "body": z.string().nullable().optional(), "closed_at": z.string().nullable().optional(), "comments": z.number().int().optional(), "comments_url": z.string().optional(), "created_at": z.string().optional(), "events_url": z.string().optional(), "html_url": z.string().optional(), "id": z.number().int().optional(), "labels": z.array(z.record(z.string(), z.any()).nullable()).optional(), "labels_url": z.string().optional(), "locked": z.boolean().optional(), "milestone": z.record(z.string(), z.any()).nullable().optional(), "node_id": z.string().optional(), "number": z.number().int().optional(), "performed_via_github_app": z.record(z.string(), z.any()).nullable().optional(), "reactions": z.object({"+1": z.number().int().optional(), "-1": z.number().int().optional(), "confused": z.number().int().optional(), "eyes": z.number().int().optional(), "heart": z.number().int().optional(), "hooray": z.number().int().optional(), "laugh": z.number().int().optional(), "rocket": z.number().int().optional(), "total_count": z.number().int().optional(), "url": z.string().optional()}).optional(), "repository_url": z.string().optional(), "state": z.enum(["closed", "open"]), "timeline_url": z.string().optional(), "title": z.string().optional(), "updated_at": z.string().optional(), "url": z.string().optional(), "user": z.object({"avatar_url": z.string().optional(), "events_url": z.string().optional(), "followers_url": z.string().optional(), "following_url": z.string().optional(), "gists_url": z.string().optional(), "gravatar_id": z.string().optional(), "html_url": z.string().optional(), "id": z.number().int().optional(), "login": z.string().optional(), "node_id": z.string().optional(), "organizations_url": z.string().optional(), "received_events_url": z.string().optional(), "repos_url": z.string().optional(), "site_admin": z.boolean().optional(), "starred_url": z.string().optional(), "subscriptions_url": z.string().optional(), "type": z.string().optional(), "url": z.string().optional(), "user_view_type": z.string().optional()}).optional()})), "organization": organization_simple_webhooks.optional(), "repository": repository_webhooks, "sender": simple_user})); +const webhook_issues_opened = z.lazy(() => z.object({"action": z.literal("opened"), "changes": z.object({"old_issue": z.object({"active_lock_reason": z.enum(["resolved", "off-topic", "too heated", "spam"]).nullable().optional(), "assignee": z.object({"avatar_url": z.string().optional(), "deleted": z.boolean().optional(), "email": z.string().nullable().optional(), "events_url": z.string().optional(), "followers_url": z.string().optional(), "following_url": z.string().optional(), "gists_url": z.string().optional(), "gravatar_id": z.string().optional(), "html_url": z.string().optional(), "id": z.number().int(), "login": z.string(), "name": z.string().optional(), "node_id": z.string().optional(), "organizations_url": z.string().optional(), "received_events_url": z.string().optional(), "repos_url": z.string().optional(), "site_admin": z.boolean().optional(), "starred_url": z.string().optional(), "subscriptions_url": z.string().optional(), "type": z.enum(["Bot", "User", "Organization"]).optional(), "url": z.string().optional(), "user_view_type": z.string().optional()}).nullable().optional(), "assignees": z.array(z.object({"avatar_url": z.string().optional(), "deleted": z.boolean().optional(), "email": z.string().nullable().optional(), "events_url": z.string().optional(), "followers_url": z.string().optional(), "following_url": z.string().optional(), "gists_url": z.string().optional(), "gravatar_id": z.string().optional(), "html_url": z.string().optional(), "id": z.number().int(), "login": z.string(), "name": z.string().optional(), "node_id": z.string().optional(), "organizations_url": z.string().optional(), "received_events_url": z.string().optional(), "repos_url": z.string().optional(), "site_admin": z.boolean().optional(), "starred_url": z.string().optional(), "subscriptions_url": z.string().optional(), "type": z.enum(["Bot", "User", "Organization"]).optional(), "url": z.string().optional(), "user_view_type": z.string().optional()}).nullable()).optional(), "author_association": z.enum(["COLLABORATOR", "CONTRIBUTOR", "FIRST_TIMER", "FIRST_TIME_CONTRIBUTOR", "MANNEQUIN", "MEMBER", "NONE", "OWNER"]).optional(), "body": z.string().nullable().optional(), "closed_at": z.string().nullable().optional(), "comments": z.number().int().optional(), "comments_url": z.string().optional(), "created_at": z.string().optional(), "draft": z.boolean().optional(), "events_url": z.string().optional(), "html_url": z.string().optional(), "id": z.number().int(), "labels": z.array(z.object({"color": z.string(), "default": z.boolean(), "description": z.string().nullable().optional(), "id": z.number().int(), "name": z.string(), "node_id": z.string(), "url": z.string()})).optional(), "labels_url": z.string().optional(), "locked": z.boolean().optional(), "milestone": z.object({"closed_at": z.string().nullable().optional(), "closed_issues": z.number().int(), "created_at": z.string(), "creator": z.object({"avatar_url": z.string().optional(), "deleted": z.boolean().optional(), "email": z.string().nullable().optional(), "events_url": z.string().optional(), "followers_url": z.string().optional(), "following_url": z.string().optional(), "gists_url": z.string().optional(), "gravatar_id": z.string().optional(), "html_url": z.string().optional(), "id": z.number().int(), "login": z.string(), "name": z.string().optional(), "node_id": z.string().optional(), "organizations_url": z.string().optional(), "received_events_url": z.string().optional(), "repos_url": z.string().optional(), "site_admin": z.boolean().optional(), "starred_url": z.string().optional(), "subscriptions_url": z.string().optional(), "type": z.enum(["Bot", "User", "Organization"]).optional(), "url": z.string().optional(), "user_view_type": z.string().optional()}).nullable().optional(), "description": z.string().nullable().optional(), "due_on": z.string().nullable().optional(), "html_url": z.string(), "id": z.number().int(), "labels_url": z.string(), "node_id": z.string(), "number": z.number().int(), "open_issues": z.number().int(), "state": z.enum(["open", "closed"]), "title": z.string(), "updated_at": z.string(), "url": z.string()}).nullable().optional(), "node_id": z.string().optional(), "number": z.number().int(), "performed_via_github_app": z.object({"created_at": z.string().nullable().optional(), "description": z.string().nullable().optional(), "events": z.array(z.enum(["branch_protection_rule", "check_run", "check_suite", "code_scanning_alert", "commit_comment", "content_reference", "create", "delete", "deployment", "deployment_review", "deployment_status", "deploy_key", "discussion", "discussion_comment", "fork", "gollum", "issues", "issue_comment", "label", "member", "membership", "milestone", "organization", "org_block", "page_build", "project", "project_card", "project_column", "public", "pull_request", "pull_request_review", "pull_request_review_comment", "push", "registry_package", "release", "repository", "repository_dispatch", "secret_scanning_alert", "star", "status", "team", "team_add", "watch", "workflow_dispatch", "workflow_run"])).optional(), "external_url": z.string().nullable().optional(), "html_url": z.string(), "id": z.number().int().nullable().optional(), "name": z.string(), "node_id": z.string(), "owner": z.object({"avatar_url": z.string().optional(), "deleted": z.boolean().optional(), "email": z.string().nullable().optional(), "events_url": z.string().optional(), "followers_url": z.string().optional(), "following_url": z.string().optional(), "gists_url": z.string().optional(), "gravatar_id": z.string().optional(), "html_url": z.string().optional(), "id": z.number().int(), "login": z.string(), "name": z.string().optional(), "node_id": z.string().optional(), "organizations_url": z.string().optional(), "received_events_url": z.string().optional(), "repos_url": z.string().optional(), "site_admin": z.boolean().optional(), "starred_url": z.string().optional(), "subscriptions_url": z.string().optional(), "type": z.enum(["Bot", "User", "Organization"]).optional(), "url": z.string().optional(), "user_view_type": z.string().optional()}).nullable().optional(), "permissions": z.object({"actions": z.enum(["read", "write"]).optional(), "administration": z.enum(["read", "write"]).optional(), "checks": z.enum(["read", "write"]).optional(), "content_references": z.enum(["read", "write"]).optional(), "contents": z.enum(["read", "write"]).optional(), "deployments": z.enum(["read", "write"]).optional(), "discussions": z.enum(["read", "write"]).optional(), "emails": z.enum(["read", "write"]).optional(), "environments": z.enum(["read", "write"]).optional(), "issues": z.enum(["read", "write"]).optional(), "keys": z.enum(["read", "write"]).optional(), "members": z.enum(["read", "write"]).optional(), "metadata": z.enum(["read", "write"]).optional(), "organization_administration": z.enum(["read", "write"]).optional(), "organization_hooks": z.enum(["read", "write"]).optional(), "organization_packages": z.enum(["read", "write"]).optional(), "organization_plan": z.enum(["read", "write"]).optional(), "organization_projects": z.enum(["read", "write"]).optional(), "organization_secrets": z.enum(["read", "write"]).optional(), "organization_self_hosted_runners": z.enum(["read", "write"]).optional(), "organization_user_blocking": z.enum(["read", "write"]).optional(), "packages": z.enum(["read", "write"]).optional(), "pages": z.enum(["read", "write"]).optional(), "pull_requests": z.enum(["read", "write"]).optional(), "repository_hooks": z.enum(["read", "write"]).optional(), "repository_projects": z.enum(["read", "write"]).optional(), "secret_scanning_alerts": z.enum(["read", "write"]).optional(), "secrets": z.enum(["read", "write"]).optional(), "security_events": z.enum(["read", "write"]).optional(), "security_scanning_alert": z.enum(["read", "write"]).optional(), "single_file": z.enum(["read", "write"]).optional(), "statuses": z.enum(["read", "write"]).optional(), "vulnerability_alerts": z.enum(["read", "write"]).optional(), "workflows": z.enum(["read", "write"]).optional()}).optional(), "slug": z.string().optional(), "updated_at": z.string().nullable().optional()}).nullable().optional(), "pull_request": z.object({"diff_url": z.string().optional(), "html_url": z.string().optional(), "merged_at": z.string().nullable().optional(), "patch_url": z.string().optional(), "url": z.string().optional()}).optional(), "reactions": z.object({"+1": z.number().int(), "-1": z.number().int(), "confused": z.number().int(), "eyes": z.number().int(), "heart": z.number().int(), "hooray": z.number().int(), "laugh": z.number().int(), "rocket": z.number().int(), "total_count": z.number().int(), "url": z.string()}).optional(), "repository_url": z.string().optional(), "sub_issues_summary": sub_issues_summary.optional(), "issue_dependencies_summary": issue_dependencies_summary.optional(), "issue_field_values": z.array(issue_field_value).optional(), "state": z.enum(["open", "closed"]).optional(), "state_reason": z.string().nullable().optional(), "timeline_url": z.string().optional(), "title": z.string().optional(), "updated_at": z.string().optional(), "url": z.string().optional(), "pinned_comment": nullable_issue_comment.optional(), "user": z.object({"avatar_url": z.string().optional(), "deleted": z.boolean().optional(), "email": z.string().nullable().optional(), "events_url": z.string().optional(), "followers_url": z.string().optional(), "following_url": z.string().optional(), "gists_url": z.string().optional(), "gravatar_id": z.string().optional(), "html_url": z.string().optional(), "id": z.number().int(), "login": z.string(), "name": z.string().optional(), "node_id": z.string().optional(), "organizations_url": z.string().optional(), "received_events_url": z.string().optional(), "repos_url": z.string().optional(), "site_admin": z.boolean().optional(), "starred_url": z.string().optional(), "subscriptions_url": z.string().optional(), "type": z.enum(["Bot", "User", "Organization"]).optional(), "url": z.string().optional(), "user_view_type": z.string().optional()}).nullable().optional(), "type": issue_type.optional()}).nullable().optional(), "old_repository": z.object({"allow_auto_merge": z.boolean().optional(), "allow_forking": z.boolean().optional(), "allow_merge_commit": z.boolean().optional(), "allow_rebase_merge": z.boolean().optional(), "allow_squash_merge": z.boolean().optional(), "allow_update_branch": z.boolean().optional(), "archive_url": z.string(), "archived": z.boolean(), "assignees_url": z.string(), "blobs_url": z.string(), "branches_url": z.string(), "clone_url": z.string(), "collaborators_url": z.string(), "comments_url": z.string(), "commits_url": z.string(), "compare_url": z.string(), "contents_url": z.string(), "contributors_url": z.string(), "created_at": z.union([z.number().int(), z.string()]), "custom_properties": z.record(z.string(), z.any()).optional(), "default_branch": z.string(), "delete_branch_on_merge": z.boolean().optional(), "deployments_url": z.string(), "description": z.string().nullable().optional(), "disabled": z.boolean().optional(), "downloads_url": z.string(), "events_url": z.string(), "fork": z.boolean(), "forks": z.number().int(), "forks_count": z.number().int(), "forks_url": z.string(), "full_name": z.string(), "git_commits_url": z.string(), "git_refs_url": z.string(), "git_tags_url": z.string(), "git_url": z.string(), "has_discussions": z.boolean().optional(), "has_pull_requests": z.boolean().optional(), "pull_request_creation_policy": z.enum(["all", "collaborators_only"]).optional(), "has_downloads": z.boolean(), "has_issues": z.boolean(), "has_pages": z.boolean(), "has_projects": z.boolean(), "has_wiki": z.boolean(), "homepage": z.string().nullable().optional(), "hooks_url": z.string(), "html_url": z.string(), "id": z.number().int(), "is_template": z.boolean().optional(), "issue_comment_url": z.string(), "issue_events_url": z.string(), "issues_url": z.string(), "keys_url": z.string(), "labels_url": z.string(), "language": z.string().nullable().optional(), "languages_url": z.string(), "license": z.object({"key": z.string(), "name": z.string(), "node_id": z.string(), "spdx_id": z.string(), "url": z.string().nullable().optional()}).nullable().optional(), "master_branch": z.string().optional(), "merges_url": z.string(), "milestones_url": z.string(), "mirror_url": z.string().nullable().optional(), "name": z.string(), "node_id": z.string(), "notifications_url": z.string(), "open_issues": z.number().int(), "open_issues_count": z.number().int(), "organization": z.string().optional(), "owner": z.object({"avatar_url": z.string().optional(), "deleted": z.boolean().optional(), "email": z.string().nullable().optional(), "events_url": z.string().optional(), "followers_url": z.string().optional(), "following_url": z.string().optional(), "gists_url": z.string().optional(), "gravatar_id": z.string().optional(), "html_url": z.string().optional(), "id": z.number().int(), "login": z.string(), "name": z.string().optional(), "node_id": z.string().optional(), "organizations_url": z.string().optional(), "received_events_url": z.string().optional(), "repos_url": z.string().optional(), "site_admin": z.boolean().optional(), "starred_url": z.string().optional(), "subscriptions_url": z.string().optional(), "type": z.enum(["Bot", "User", "Organization"]).optional(), "url": z.string().optional(), "user_view_type": z.string().optional()}).nullable().optional(), "permissions": z.object({"admin": z.boolean(), "maintain": z.boolean().optional(), "pull": z.boolean(), "push": z.boolean(), "triage": z.boolean().optional()}).optional(), "private": z.boolean(), "public": z.boolean().optional(), "pulls_url": z.string(), "pushed_at": z.union([z.number().int(), z.string()]).nullable().optional(), "releases_url": z.string(), "role_name": z.string().nullable().optional(), "size": z.number().int(), "ssh_url": z.string(), "stargazers": z.number().int().optional(), "stargazers_count": z.number().int(), "stargazers_url": z.string(), "statuses_url": z.string(), "subscribers_url": z.string(), "subscription_url": z.string(), "svn_url": z.string(), "tags_url": z.string(), "teams_url": z.string(), "topics": z.array(z.string()), "trees_url": z.string(), "updated_at": z.string(), "url": z.string(), "visibility": z.enum(["public", "private", "internal"]), "watchers": z.number().int(), "watchers_count": z.number().int(), "web_commit_signoff_required": z.boolean().optional()})}).optional(), "enterprise": enterprise_webhooks.optional(), "installation": simple_installation.optional(), "issue": z.object({"active_lock_reason": z.enum(["resolved", "off-topic", "too heated", "spam"]).nullable().optional(), "assignee": z.object({"avatar_url": z.string().optional(), "deleted": z.boolean().optional(), "email": z.string().nullable().optional(), "events_url": z.string().optional(), "followers_url": z.string().optional(), "following_url": z.string().optional(), "gists_url": z.string().optional(), "gravatar_id": z.string().optional(), "html_url": z.string().optional(), "id": z.number().int(), "login": z.string(), "name": z.string().optional(), "node_id": z.string().optional(), "organizations_url": z.string().optional(), "received_events_url": z.string().optional(), "repos_url": z.string().optional(), "site_admin": z.boolean().optional(), "starred_url": z.string().optional(), "subscriptions_url": z.string().optional(), "type": z.enum(["Bot", "User", "Organization"]).optional(), "url": z.string().optional(), "user_view_type": z.string().optional()}).nullable().optional(), "assignees": z.array(z.object({"avatar_url": z.string().optional(), "deleted": z.boolean().optional(), "email": z.string().nullable().optional(), "events_url": z.string().optional(), "followers_url": z.string().optional(), "following_url": z.string().optional(), "gists_url": z.string().optional(), "gravatar_id": z.string().optional(), "html_url": z.string().optional(), "id": z.number().int(), "login": z.string(), "name": z.string().optional(), "node_id": z.string().optional(), "organizations_url": z.string().optional(), "received_events_url": z.string().optional(), "repos_url": z.string().optional(), "site_admin": z.boolean().optional(), "starred_url": z.string().optional(), "subscriptions_url": z.string().optional(), "type": z.enum(["Bot", "User", "Organization"]).optional(), "url": z.string().optional(), "user_view_type": z.string().optional()}).nullable()), "author_association": z.enum(["COLLABORATOR", "CONTRIBUTOR", "FIRST_TIMER", "FIRST_TIME_CONTRIBUTOR", "MANNEQUIN", "MEMBER", "NONE", "OWNER"]), "body": z.string().nullable().optional(), "closed_at": z.string().nullable().optional(), "comments": z.number().int(), "comments_url": z.string(), "created_at": z.string(), "draft": z.boolean().optional(), "events_url": z.string(), "html_url": z.string(), "id": z.number().int(), "labels": z.array(z.object({"color": z.string(), "default": z.boolean(), "description": z.string().nullable().optional(), "id": z.number().int(), "name": z.string(), "node_id": z.string(), "url": z.string()})).optional(), "labels_url": z.string(), "locked": z.boolean().optional(), "milestone": z.object({"closed_at": z.string().nullable().optional(), "closed_issues": z.number().int(), "created_at": z.string(), "creator": z.object({"avatar_url": z.string().optional(), "deleted": z.boolean().optional(), "email": z.string().nullable().optional(), "events_url": z.string().optional(), "followers_url": z.string().optional(), "following_url": z.string().optional(), "gists_url": z.string().optional(), "gravatar_id": z.string().optional(), "html_url": z.string().optional(), "id": z.number().int(), "login": z.string(), "name": z.string().optional(), "node_id": z.string().optional(), "organizations_url": z.string().optional(), "received_events_url": z.string().optional(), "repos_url": z.string().optional(), "site_admin": z.boolean().optional(), "starred_url": z.string().optional(), "subscriptions_url": z.string().optional(), "type": z.enum(["Bot", "User", "Organization", "Mannequin"]).optional(), "url": z.string().optional(), "user_view_type": z.string().optional()}).nullable().optional(), "description": z.string().nullable().optional(), "due_on": z.string().nullable().optional(), "html_url": z.string(), "id": z.number().int(), "labels_url": z.string(), "node_id": z.string(), "number": z.number().int(), "open_issues": z.number().int(), "state": z.enum(["open", "closed"]), "title": z.string(), "updated_at": z.string(), "url": z.string()}).nullable().optional(), "node_id": z.string(), "number": z.number().int(), "performed_via_github_app": z.object({"created_at": z.string().nullable().optional(), "description": z.string().nullable().optional(), "events": z.array(z.enum(["branch_protection_rule", "check_run", "check_suite", "code_scanning_alert", "commit_comment", "content_reference", "create", "delete", "deployment", "deployment_review", "deployment_status", "deploy_key", "discussion", "discussion_comment", "fork", "gollum", "issues", "issue_comment", "label", "member", "membership", "milestone", "organization", "org_block", "page_build", "project", "project_card", "project_column", "public", "pull_request", "pull_request_review", "pull_request_review_comment", "push", "registry_package", "release", "repository", "repository_dispatch", "secret_scanning_alert", "star", "status", "team", "team_add", "watch", "workflow_dispatch", "workflow_run", "security_and_analysis", "pull_request_review_thread", "reminder"])).optional(), "external_url": z.string().nullable().optional(), "html_url": z.string(), "id": z.number().int().nullable().optional(), "name": z.string(), "node_id": z.string(), "owner": z.object({"avatar_url": z.string().optional(), "deleted": z.boolean().optional(), "email": z.string().nullable().optional(), "events_url": z.string().optional(), "followers_url": z.string().optional(), "following_url": z.string().optional(), "gists_url": z.string().optional(), "gravatar_id": z.string().optional(), "html_url": z.string().optional(), "id": z.number().int(), "login": z.string(), "name": z.string().optional(), "node_id": z.string().optional(), "organizations_url": z.string().optional(), "received_events_url": z.string().optional(), "repos_url": z.string().optional(), "site_admin": z.boolean().optional(), "starred_url": z.string().optional(), "subscriptions_url": z.string().optional(), "type": z.enum(["Bot", "User", "Organization"]).optional(), "url": z.string().optional(), "user_view_type": z.string().optional()}).nullable().optional(), "permissions": z.object({"actions": z.enum(["read", "write"]).optional(), "administration": z.enum(["read", "write"]).optional(), "checks": z.enum(["read", "write"]).optional(), "content_references": z.enum(["read", "write"]).optional(), "contents": z.enum(["read", "write"]).optional(), "deployments": z.enum(["read", "write"]).optional(), "discussions": z.enum(["read", "write"]).optional(), "emails": z.enum(["read", "write"]).optional(), "environments": z.enum(["read", "write"]).optional(), "issues": z.enum(["read", "write"]).optional(), "keys": z.enum(["read", "write"]).optional(), "members": z.enum(["read", "write"]).optional(), "metadata": z.enum(["read", "write"]).optional(), "organization_administration": z.enum(["read", "write"]).optional(), "organization_hooks": z.enum(["read", "write"]).optional(), "organization_packages": z.enum(["read", "write"]).optional(), "organization_plan": z.enum(["read", "write"]).optional(), "organization_projects": z.enum(["read", "write", "admin"]).optional(), "organization_secrets": z.enum(["read", "write"]).optional(), "organization_self_hosted_runners": z.enum(["read", "write"]).optional(), "organization_user_blocking": z.enum(["read", "write"]).optional(), "packages": z.enum(["read", "write"]).optional(), "pages": z.enum(["read", "write"]).optional(), "pull_requests": z.enum(["read", "write"]).optional(), "repository_hooks": z.enum(["read", "write"]).optional(), "repository_projects": z.enum(["read", "write"]).optional(), "secret_scanning_alerts": z.enum(["read", "write"]).optional(), "secrets": z.enum(["read", "write"]).optional(), "security_events": z.enum(["read", "write"]).optional(), "security_scanning_alert": z.enum(["read", "write"]).optional(), "single_file": z.enum(["read", "write"]).optional(), "statuses": z.enum(["read", "write"]).optional(), "vulnerability_alerts": z.enum(["read", "write"]).optional(), "workflows": z.enum(["read", "write"]).optional()}).optional(), "slug": z.string().optional(), "updated_at": z.string().nullable().optional()}).nullable().optional(), "pull_request": z.object({"diff_url": z.string().optional(), "html_url": z.string().optional(), "merged_at": z.string().nullable().optional(), "patch_url": z.string().optional(), "url": z.string().optional()}).optional(), "reactions": z.object({"+1": z.number().int(), "-1": z.number().int(), "confused": z.number().int(), "eyes": z.number().int(), "heart": z.number().int(), "hooray": z.number().int(), "laugh": z.number().int(), "rocket": z.number().int(), "total_count": z.number().int(), "url": z.string()}), "repository_url": z.string(), "sub_issues_summary": sub_issues_summary.optional(), "issue_dependencies_summary": issue_dependencies_summary.optional(), "issue_field_values": z.array(issue_field_value).optional(), "state": z.enum(["open", "closed"]).optional(), "state_reason": z.string().nullable().optional(), "timeline_url": z.string().optional(), "title": z.string(), "type": issue_type.optional(), "updated_at": z.string(), "url": z.string(), "pinned_comment": nullable_issue_comment.optional(), "user": z.object({"avatar_url": z.string().optional(), "deleted": z.boolean().optional(), "email": z.string().nullable().optional(), "events_url": z.string().optional(), "followers_url": z.string().optional(), "following_url": z.string().optional(), "gists_url": z.string().optional(), "gravatar_id": z.string().optional(), "html_url": z.string().optional(), "id": z.number().int(), "login": z.string(), "name": z.string().optional(), "node_id": z.string().optional(), "organizations_url": z.string().optional(), "received_events_url": z.string().optional(), "repos_url": z.string().optional(), "site_admin": z.boolean().optional(), "starred_url": z.string().optional(), "subscriptions_url": z.string().optional(), "type": z.enum(["Bot", "User", "Organization"]).optional(), "url": z.string().optional(), "user_view_type": z.string().optional()}).nullable().optional()}), "organization": organization_simple_webhooks.optional(), "repository": repository_webhooks, "sender": simple_user})); const webhook_pull_request_closed = z.lazy(() => z.object({"action": z.literal("closed"), "enterprise": enterprise_webhooks.optional(), "installation": simple_installation.optional(), "number": webhooks_number, "organization": organization_simple_webhooks.optional(), "pull_request": pull_request_webhook, "repository": repository_webhooks, "sender": simple_user})); const webhook_pull_request_opened = z.lazy(() => z.object({"action": z.literal("opened"), "enterprise": enterprise_webhooks.optional(), "installation": simple_installation.optional(), "number": webhooks_number, "organization": organization_simple_webhooks.optional(), "pull_request": pull_request_webhook, "repository": repository_webhooks, "sender": simple_user})); -const webhook_push = z.lazy(() => z.object({"after": z.string(), "base_ref": webhooks_nullable_string, "before": z.string(), "commits": z.array(z.object({"added": z.array(z.string()).optional(), "author": z.object({"date": z.string().optional(), "email": z.string().nullable(), "name": z.string(), "username": z.string().optional()}), "committer": z.object({"date": z.string().optional(), "email": z.string().nullable(), "name": z.string(), "username": z.string().optional()}), "distinct": z.boolean(), "id": z.string(), "message": z.string(), "modified": z.array(z.string()).optional(), "removed": z.array(z.string()).optional(), "timestamp": z.string(), "tree_id": z.string(), "url": z.string()})), "compare": z.string(), "created": z.boolean(), "deleted": z.boolean(), "enterprise": enterprise_webhooks.optional(), "forced": z.boolean(), "head_commit": z.object({"added": z.array(z.string()).optional(), "author": z.object({"date": z.string().optional(), "email": z.string().nullable(), "name": z.string(), "username": z.string().optional()}), "committer": z.object({"date": z.string().optional(), "email": z.string().nullable(), "name": z.string(), "username": z.string().optional()}), "distinct": z.boolean(), "id": z.string(), "message": z.string(), "modified": z.array(z.string()).optional(), "removed": z.array(z.string()).optional(), "timestamp": z.string(), "tree_id": z.string(), "url": z.string()}).nullable(), "installation": simple_installation.optional(), "organization": organization_simple_webhooks.optional(), "pusher": z.object({"date": z.string().optional(), "email": z.string().nullable().optional(), "name": z.string(), "username": z.string().optional()}), "ref": z.string(), "repository": z.object({"allow_auto_merge": z.boolean().optional(), "allow_forking": z.boolean().optional(), "allow_merge_commit": z.boolean().optional(), "allow_rebase_merge": z.boolean().optional(), "allow_squash_merge": z.boolean().optional(), "allow_update_branch": z.boolean().optional(), "archive_url": z.string(), "archived": z.boolean(), "assignees_url": z.string(), "blobs_url": z.string(), "branches_url": z.string(), "clone_url": z.string(), "collaborators_url": z.string(), "comments_url": z.string(), "commits_url": z.string(), "compare_url": z.string(), "contents_url": z.string(), "contributors_url": z.string(), "created_at": z.union([z.number().int(), z.string()]), "custom_properties": z.record(z.string(), z.any()).optional(), "default_branch": z.string(), "delete_branch_on_merge": z.boolean().optional(), "deployments_url": z.string(), "description": z.string().nullable(), "disabled": z.boolean().optional(), "downloads_url": z.string(), "events_url": z.string(), "fork": z.boolean(), "forks": z.number().int(), "forks_count": z.number().int(), "forks_url": z.string(), "full_name": z.string(), "git_commits_url": z.string(), "git_refs_url": z.string(), "git_tags_url": z.string(), "git_url": z.string(), "has_downloads": z.boolean(), "has_issues": z.boolean(), "has_pages": z.boolean(), "has_projects": z.boolean(), "has_wiki": z.boolean(), "has_discussions": z.boolean(), "has_pull_requests": z.boolean().optional(), "pull_request_creation_policy": z.enum(["all", "collaborators_only"]).optional(), "homepage": z.string().nullable(), "hooks_url": z.string(), "html_url": z.string(), "id": z.number().int(), "is_template": z.boolean().optional(), "issue_comment_url": z.string(), "issue_events_url": z.string(), "issues_url": z.string(), "keys_url": z.string(), "labels_url": z.string(), "language": z.string().nullable(), "languages_url": z.string(), "license": z.object({"key": z.string(), "name": z.string(), "node_id": z.string(), "spdx_id": z.string(), "url": z.string().nullable()}).nullable(), "master_branch": z.string().optional(), "merges_url": z.string(), "milestones_url": z.string(), "mirror_url": z.string().nullable(), "name": z.string(), "node_id": z.string(), "notifications_url": z.string(), "open_issues": z.number().int(), "open_issues_count": z.number().int(), "organization": z.string().optional(), "owner": z.object({"avatar_url": z.string().optional(), "deleted": z.boolean().optional(), "email": z.string().nullable().optional(), "events_url": z.string().optional(), "followers_url": z.string().optional(), "following_url": z.string().optional(), "gists_url": z.string().optional(), "gravatar_id": z.string().optional(), "html_url": z.string().optional(), "id": z.number().int(), "login": z.string(), "name": z.string().optional(), "node_id": z.string().optional(), "organizations_url": z.string().optional(), "received_events_url": z.string().optional(), "repos_url": z.string().optional(), "site_admin": z.boolean().optional(), "starred_url": z.string().optional(), "subscriptions_url": z.string().optional(), "type": z.enum(["Bot", "User", "Organization"]).optional(), "url": z.string().optional(), "user_view_type": z.string().optional()}).nullable(), "permissions": z.object({"admin": z.boolean(), "maintain": z.boolean().optional(), "pull": z.boolean(), "push": z.boolean(), "triage": z.boolean().optional()}).optional(), "private": z.boolean(), "public": z.boolean().optional(), "pulls_url": z.string(), "pushed_at": z.union([z.number().int(), z.string()]).nullable(), "releases_url": z.string(), "role_name": z.string().nullable().optional(), "size": z.number().int(), "ssh_url": z.string(), "stargazers": z.number().int().optional(), "stargazers_count": z.number().int(), "stargazers_url": z.string(), "statuses_url": z.string(), "subscribers_url": z.string(), "subscription_url": z.string(), "svn_url": z.string(), "tags_url": z.string(), "teams_url": z.string(), "topics": z.array(z.string()), "trees_url": z.string(), "updated_at": z.string(), "url": z.string(), "visibility": z.enum(["public", "private", "internal"]), "watchers": z.number().int(), "watchers_count": z.number().int(), "web_commit_signoff_required": z.boolean().optional()}), "sender": simple_user.optional()})); +const webhook_push = z.lazy(() => z.object({"after": z.string(), "base_ref": webhooks_nullable_string.optional(), "before": z.string(), "commits": z.array(z.object({"added": z.array(z.string()).optional(), "author": z.object({"date": z.string().optional(), "email": z.string().nullable().optional(), "name": z.string(), "username": z.string().optional()}), "committer": z.object({"date": z.string().optional(), "email": z.string().nullable().optional(), "name": z.string(), "username": z.string().optional()}), "distinct": z.boolean(), "id": z.string(), "message": z.string(), "modified": z.array(z.string()).optional(), "removed": z.array(z.string()).optional(), "timestamp": z.string(), "tree_id": z.string(), "url": z.string()})), "compare": z.string(), "created": z.boolean(), "deleted": z.boolean(), "enterprise": enterprise_webhooks.optional(), "forced": z.boolean(), "head_commit": z.object({"added": z.array(z.string()).optional(), "author": z.object({"date": z.string().optional(), "email": z.string().nullable().optional(), "name": z.string(), "username": z.string().optional()}), "committer": z.object({"date": z.string().optional(), "email": z.string().nullable().optional(), "name": z.string(), "username": z.string().optional()}), "distinct": z.boolean(), "id": z.string(), "message": z.string(), "modified": z.array(z.string()).optional(), "removed": z.array(z.string()).optional(), "timestamp": z.string(), "tree_id": z.string(), "url": z.string()}).nullable().optional(), "installation": simple_installation.optional(), "organization": organization_simple_webhooks.optional(), "pusher": z.object({"date": z.string().optional(), "email": z.string().nullable().optional(), "name": z.string(), "username": z.string().optional()}), "ref": z.string(), "repository": z.object({"allow_auto_merge": z.boolean().optional(), "allow_forking": z.boolean().optional(), "allow_merge_commit": z.boolean().optional(), "allow_rebase_merge": z.boolean().optional(), "allow_squash_merge": z.boolean().optional(), "allow_update_branch": z.boolean().optional(), "archive_url": z.string(), "archived": z.boolean(), "assignees_url": z.string(), "blobs_url": z.string(), "branches_url": z.string(), "clone_url": z.string(), "collaborators_url": z.string(), "comments_url": z.string(), "commits_url": z.string(), "compare_url": z.string(), "contents_url": z.string(), "contributors_url": z.string(), "created_at": z.union([z.number().int(), z.string()]), "custom_properties": z.record(z.string(), z.any()).optional(), "default_branch": z.string(), "delete_branch_on_merge": z.boolean().optional(), "deployments_url": z.string(), "description": z.string().nullable().optional(), "disabled": z.boolean().optional(), "downloads_url": z.string(), "events_url": z.string(), "fork": z.boolean(), "forks": z.number().int(), "forks_count": z.number().int(), "forks_url": z.string(), "full_name": z.string(), "git_commits_url": z.string(), "git_refs_url": z.string(), "git_tags_url": z.string(), "git_url": z.string(), "has_downloads": z.boolean(), "has_issues": z.boolean(), "has_pages": z.boolean(), "has_projects": z.boolean(), "has_wiki": z.boolean(), "has_discussions": z.boolean(), "has_pull_requests": z.boolean().optional(), "pull_request_creation_policy": z.enum(["all", "collaborators_only"]).optional(), "homepage": z.string().nullable().optional(), "hooks_url": z.string(), "html_url": z.string(), "id": z.number().int(), "is_template": z.boolean().optional(), "issue_comment_url": z.string(), "issue_events_url": z.string(), "issues_url": z.string(), "keys_url": z.string(), "labels_url": z.string(), "language": z.string().nullable().optional(), "languages_url": z.string(), "license": z.object({"key": z.string(), "name": z.string(), "node_id": z.string(), "spdx_id": z.string(), "url": z.string().nullable().optional()}).nullable().optional(), "master_branch": z.string().optional(), "merges_url": z.string(), "milestones_url": z.string(), "mirror_url": z.string().nullable().optional(), "name": z.string(), "node_id": z.string(), "notifications_url": z.string(), "open_issues": z.number().int(), "open_issues_count": z.number().int(), "organization": z.string().optional(), "owner": z.object({"avatar_url": z.string().optional(), "deleted": z.boolean().optional(), "email": z.string().nullable().optional(), "events_url": z.string().optional(), "followers_url": z.string().optional(), "following_url": z.string().optional(), "gists_url": z.string().optional(), "gravatar_id": z.string().optional(), "html_url": z.string().optional(), "id": z.number().int(), "login": z.string(), "name": z.string().optional(), "node_id": z.string().optional(), "organizations_url": z.string().optional(), "received_events_url": z.string().optional(), "repos_url": z.string().optional(), "site_admin": z.boolean().optional(), "starred_url": z.string().optional(), "subscriptions_url": z.string().optional(), "type": z.enum(["Bot", "User", "Organization"]).optional(), "url": z.string().optional(), "user_view_type": z.string().optional()}).nullable().optional(), "permissions": z.object({"admin": z.boolean(), "maintain": z.boolean().optional(), "pull": z.boolean(), "push": z.boolean(), "triage": z.boolean().optional()}).optional(), "private": z.boolean(), "public": z.boolean().optional(), "pulls_url": z.string(), "pushed_at": z.union([z.number().int(), z.string()]).nullable().optional(), "releases_url": z.string(), "role_name": z.string().nullable().optional(), "size": z.number().int(), "ssh_url": z.string(), "stargazers": z.number().int().optional(), "stargazers_count": z.number().int(), "stargazers_url": z.string(), "statuses_url": z.string(), "subscribers_url": z.string(), "subscription_url": z.string(), "svn_url": z.string(), "tags_url": z.string(), "teams_url": z.string(), "topics": z.array(z.string()), "trees_url": z.string(), "updated_at": z.string(), "url": z.string(), "visibility": z.enum(["public", "private", "internal"]), "watchers": z.number().int(), "watchers_count": z.number().int(), "web_commit_signoff_required": z.boolean().optional()}), "sender": simple_user.optional()})); const webhooks_nullable_string = z.lazy(() => z.string().nullable()); const webhooks_number = z.lazy(() => z.number().int()); const workflow = z.lazy(() => z.object({"id": z.number().int(), "node_id": z.string(), "name": z.string(), "path": z.string(), "state": z.enum(["active", "deleted", "disabled_fork", "disabled_inactivity", "disabled_manually"]), "created_at": z.string(), "updated_at": z.string(), "url": z.string(), "html_url": z.string(), "badge_url": z.string(), "deleted_at": z.string().optional()})); -const workflow_run = z.lazy(() => z.object({"id": z.number().int(), "name": z.string().nullable().optional(), "node_id": z.string(), "check_suite_id": z.number().int().optional(), "check_suite_node_id": z.string().optional(), "head_branch": z.string().nullable(), "head_sha": z.string(), "path": z.string(), "run_number": z.number().int(), "run_attempt": z.number().int().optional(), "referenced_workflows": z.array(referenced_workflow).nullable().optional(), "event": z.string(), "status": z.string().nullable(), "conclusion": z.string().nullable(), "workflow_id": z.number().int(), "url": z.string(), "html_url": z.string(), "pull_requests": z.array(pull_request_minimal).nullable(), "created_at": z.string(), "updated_at": z.string(), "actor": simple_user.optional(), "triggering_actor": simple_user.optional(), "run_started_at": z.string().optional(), "jobs_url": z.string(), "logs_url": z.string(), "check_suite_url": z.string(), "artifacts_url": z.string(), "cancel_url": z.string(), "rerun_url": z.string(), "previous_attempt_url": z.string().nullable().optional(), "workflow_url": z.string(), "head_commit": nullable_simple_commit, "repository": minimal_repository, "head_repository": minimal_repository, "head_repository_id": z.number().int().optional(), "display_title": z.string()})); +const workflow_run = z.lazy(() => z.object({"id": z.number().int(), "name": z.string().nullable().optional(), "node_id": z.string(), "check_suite_id": z.number().int().optional(), "check_suite_node_id": z.string().optional(), "head_branch": z.string().nullable().optional(), "head_sha": z.string(), "path": z.string(), "run_number": z.number().int(), "run_attempt": z.number().int().optional(), "referenced_workflows": z.array(referenced_workflow).nullable().optional(), "event": z.string(), "status": z.string().nullable().optional(), "conclusion": z.string().nullable().optional(), "workflow_id": z.number().int(), "url": z.string(), "html_url": z.string(), "pull_requests": z.array(pull_request_minimal).nullable().optional(), "created_at": z.string(), "updated_at": z.string(), "actor": simple_user.optional(), "triggering_actor": simple_user.optional(), "run_started_at": z.string().optional(), "jobs_url": z.string(), "logs_url": z.string(), "check_suite_url": z.string(), "artifacts_url": z.string(), "cancel_url": z.string(), "rerun_url": z.string(), "previous_attempt_url": z.string().nullable().optional(), "workflow_url": z.string(), "head_commit": nullable_simple_commit.optional(), "repository": minimal_repository, "head_repository": minimal_repository, "head_repository_id": z.number().int().optional(), "display_title": z.string()})); export const schemas = { "author-association": author_association, diff --git a/actions/github-action/src/helpers.ts b/actions/github-action/src/helpers.ts index ae0cb27..ea10595 100644 --- a/actions/github-action/src/helpers.ts +++ b/actions/github-action/src/helpers.ts @@ -1,4 +1,5 @@ import axios, { AxiosError } from "axios" +import { z } from "zod" import { FunctionContext, RuntimeError } from "@code0-tech/hercules" import { GitHubLabelReference, @@ -21,6 +22,21 @@ export function createGitHubClient(context: FunctionContext) { } export function handleGitHubError(error: unknown): never { + // Errors we raised ourselves already carry the right code (an invalid + // assignee, label or milestone) - keep it instead of relabelling them. + if (error instanceof RuntimeError) { + throw error + } + + // A failed response parse is a schema problem on our side, not an API + // failure - report it as such instead of hiding it behind GITHUB_API_ERROR. + if (error instanceof z.ZodError) { + throw new RuntimeError( + "GITHUB_UNEXPECTED_RESPONSE", + `The GitHub API returned a response that does not match the expected shape: ${error.message}` + ) + } + if (error instanceof AxiosError) { const message = typeof error.response?.data === "object" && error.response?.data !== null && "message" in error.response.data diff --git a/scripts/openapi-to-zod.mjs b/scripts/openapi-to-zod.mjs index 6f4b30c..a6cac29 100644 --- a/scripts/openapi-to-zod.mjs +++ b/scripts/openapi-to-zod.mjs @@ -118,6 +118,32 @@ const isNullable = (node) => (Array.isArray(node.type) && node.type.includes("null")) || (Array.isArray(node.enum) && node.enum.includes(null)); +// Same question, but following `$ref` chains and anyOf/oneOf branches, because +// a property is often just a reference to a schema that carries the +// nullability (GitHub's `assignee` -> `nullable-simple-user`, for instance). +const isNullableDeep = (node, seen = new Set()) => { + if (!node || typeof node !== "object" || Array.isArray(node)) { + return false; + } + if (isNullable(node)) { + return true; + } + if (typeof node.$ref === "string") { + if (seen.has(node.$ref)) { + return false; + } + seen.add(node.$ref); + const match = node.$ref.match(/^#\/components\/schemas\/(.+)$/); + return match ? isNullableDeep(schemas[match[1]], seen) : false; + } + for (const key of ["anyOf", "oneOf"]) { + if (Array.isArray(node[key]) && node[key].some((branch) => isNullableDeep(branch, seen))) { + return true; + } + } + return false; +}; + // Reject unknown keywords so new spec constructs surface at generation time. const assertKnown = (node) => { for (const key of Object.keys(node)) { @@ -171,19 +197,25 @@ const objectExpr = (node) => { if (properties && Object.keys(properties).length > 0) { const entries = Object.entries(properties).map(([key, value]) => { const inner = toZod(value); - return `${lit(key)}: ${required.has(key) ? inner : `${inner}.optional()`}`; + // A field the spec declares nullable is also treated as absent-able: + // specs routinely mark such fields required while the API omits them + // entirely (GitHub's deprecated `assignee` on an issue). Requiring + // the key would reject an otherwise valid payload, and `null` and + // "not there" mean the same thing to a workflow either way. + const optional = !required.has(key) || isNullableDeep(value); + return `${lit(key)}: ${optional ? `${inner}.optional()` : inner}`; }); const object = `z.object({${entries.join(", ")}})`; if (additional === false) { return `${object}.strict()`; } - if ((additional && typeof additional === "object") || pattern) { - return `${object}.catchall(${openValue()})`; - } // A declared shape stays closed even where the spec would allow extra - // keys: the platform suggests fields from the type, so an index - // signature offers nothing to suggest and hides the real shape. Unknown - // keys are dropped on parse rather than carried along untyped. + // keys (`additionalProperties` / `patternProperties`): the platform + // suggests fields from the type, so an index signature offers nothing + // to suggest and hides the real shape. It would also clash with the + // optional members themselves - `string | undefined` is not assignable + // to a `string` index signature (TS2411). Unknown keys are dropped on + // parse rather than carried along untyped. return object; } From 07952ca2d5c23079542978ff9f5227675d1b9b6d Mon Sep 17 00:00:00 2001 From: nicosammito Date: Tue, 27 Oct 2026 21:25:47 +0100 Subject: [PATCH 19/19] feat: add initial Vitest setup with a demo test case --- actions/github-action/package-lock.json | 396 ++++++++++++++++++++++- actions/github-action/package.json | 4 +- actions/github-action/test/index.test.ts | 8 + 3 files changed, 406 insertions(+), 2 deletions(-) create mode 100644 actions/github-action/test/index.test.ts diff --git a/actions/github-action/package-lock.json b/actions/github-action/package-lock.json index 6f169fe..777ba60 100644 --- a/actions/github-action/package-lock.json +++ b/actions/github-action/package-lock.json @@ -15,7 +15,8 @@ "@types/node": "^22.0.0", "tsx": "^4.0.0", "typescript": "^5.9.3", - "vite": "^8.0.3" + "vite": "^8.0.3", + "vitest": "^4.1.10" } }, "node_modules/@clack/core": { @@ -553,6 +554,13 @@ "node": ">=6" } }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.6.0.tgz", + "integrity": "sha512-T7jf+5zgsZHwNJ4lvQ7/aezbyk0nNX+zJVWpmHA7VYsEx7a7qr5Rg5IbtJFqkgze5Y2sruq1RUY8Q837Od7iFw==", + "dev": true, + "license": "MIT" + }, "node_modules/@js-sdsl/ordered-map": { "version": "4.4.2", "resolved": "https://registry.npmjs.org/@js-sdsl/ordered-map/-/ordered-map-4.4.2.tgz", @@ -1021,6 +1029,13 @@ "dev": true, "license": "MIT" }, + "node_modules/@standard-schema/spec": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@standard-schema/spec/-/spec-1.1.0.tgz", + "integrity": "sha512-l2aFy5jALhniG5HgqrD6jXLi/rUWrKvqN/qJx6yoJsgKhblVd+iqqU4RCXavm/jPityDo5TCvKMnpjKnOriy0w==", + "dev": true, + "license": "MIT" + }, "node_modules/@ts-morph/common": { "version": "0.29.0", "resolved": "https://registry.npmjs.org/@ts-morph/common/-/common-0.29.0.tgz", @@ -1043,6 +1058,31 @@ "tslib": "^2.4.0" } }, + "node_modules/@types/chai": { + "version": "5.2.3", + "resolved": "https://registry.npmjs.org/@types/chai/-/chai-5.2.3.tgz", + "integrity": "sha512-Mw558oeA9fFbv65/y4mHtXDs9bPnFMZAL/jxdPFUpOHHIXX91mcgEHbS5Lahr+pwZFR8A7GQleRWeI6cGFC2UA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/deep-eql": "*", + "assertion-error": "^2.0.1" + } + }, + "node_modules/@types/deep-eql": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@types/deep-eql/-/deep-eql-4.0.2.tgz", + "integrity": "sha512-c9h9dVVMigMPc4bwTvC5dxqtqJZwQPePsWjPlpSOnojbor6pGqdk541lfA7AqFQr5pB1BRdq0juY9db81BwyFw==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/estree": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.9.tgz", + "integrity": "sha512-GhdPgy1el4/ImP05X05Uw4cw2/M93BCUmnEvWZNStlCzEKME4Fkk+YpoA5OiHNQmoS7Cafb8Xa3Pya8m1Qrzeg==", + "dev": true, + "license": "MIT" + }, "node_modules/@types/node": { "version": "22.20.0", "resolved": "https://registry.npmjs.org/@types/node/-/node-22.20.0.tgz", @@ -1064,6 +1104,119 @@ "typescript": "*" } }, + "node_modules/@vitest/expect": { + "version": "4.1.12", + "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-4.1.12.tgz", + "integrity": "sha512-vFlTt+YEu9WBpNjdGayNmlMVzrWPi1+sv853/7t2FU7hpO5gAFBKHzQmkCq5Xjpr+evegF2994LQT3hF3mRlqQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@standard-schema/spec": "^1.1.0", + "@types/chai": "^5.2.2", + "@vitest/spy": "4.1.12", + "@vitest/utils": "4.1.12", + "chai": "^6.2.2", + "tinyrainbow": "^3.1.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/mocker": { + "version": "4.1.12", + "resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-4.1.12.tgz", + "integrity": "sha512-fKShNpKZzupWZuY0z7egydvL0sqW4INEZBEExMBMAa6izlENEVHwoXgdaTCaBZ5fwlr4xf2o1wXC83n9RpO+NA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/spy": "4.1.12", + "estree-walker": "^3.0.3", + "magic-string": "^0.30.21" + }, + "funding": { + "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "msw": "^2.4.9", + "vite": "^6.0.0 || ^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "msw": { + "optional": true + }, + "vite": { + "optional": true + } + } + }, + "node_modules/@vitest/pretty-format": { + "version": "4.1.12", + "resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-4.1.12.tgz", + "integrity": "sha512-XW9O8+Mxx4VpCtkYdMJLZQQwsVryP9wk7cPKDxtXFfwSak6yRh5+2fep/Y0XF/ElBvJHq8bcYdi6aeuai0opZA==", + "dev": true, + "license": "MIT", + "dependencies": { + "tinyrainbow": "^3.1.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/runner": { + "version": "4.1.12", + "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-4.1.12.tgz", + "integrity": "sha512-NKlVKCr5QnCe8jijdMnmkpHHU+WTqiLFR6G0pHji9uRjXK9xJl1k1nTw6F3pOOj2PDcsDt2GKQMI7wIsaT491w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/utils": "4.1.12", + "pathe": "^2.0.3" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/snapshot": { + "version": "4.1.12", + "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-4.1.12.tgz", + "integrity": "sha512-ko1y1Qgb/slzQ9mr+b89Cuqud8WG1TKtsPD8r7ZUBdvVOGt85Af2HwCqHujrhwJq95hs/9RM7fcAPg57o1vlzw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/pretty-format": "4.1.12", + "@vitest/utils": "4.1.12", + "magic-string": "^0.30.21", + "pathe": "^2.0.3" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/spy": { + "version": "4.1.12", + "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-4.1.12.tgz", + "integrity": "sha512-RGq9x4JNGNTZHEJxvN0oSiJjeSCExm0n2gZKKJZHY9cX5AVA6M7VJILBT3ZJ/tJ/0J9uWT7fETV9/btoi//vSg==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/utils": { + "version": "4.1.12", + "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-4.1.12.tgz", + "integrity": "sha512-Q3awXrwOfEV+qc3WmO5ONyE0yO7Q1gQ9/oyHxGLZ/pl7N3NO/ZztqQwKLuwMkV+CA1JYSIeO3gkHnRDIo4AVaA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/pretty-format": "4.1.12", + "convert-source-map": "^2.0.0", + "tinyrainbow": "^3.1.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, "node_modules/agent-base": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", @@ -1124,6 +1277,16 @@ "node": ">=14" } }, + "node_modules/assertion-error": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-2.0.1.tgz", + "integrity": "sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + } + }, "node_modules/async": { "version": "3.2.6", "resolved": "https://registry.npmjs.org/async/-/async-3.2.6.tgz", @@ -1182,6 +1345,16 @@ "node": ">= 0.4" } }, + "node_modules/chai": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/chai/-/chai-6.3.0.tgz", + "integrity": "sha512-XWAtwJ6OHO+tj0EKCs0Y2UamnyOxseZWltU4x2U2wh8g4AigdjwvtUjvLP2tqkA/avxHEtzxNaqGq/YGNwckKg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + } + }, "node_modules/chokidar": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.3.tgz", @@ -1348,6 +1521,13 @@ "node": ">= 0.8" } }, + "node_modules/convert-source-map": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", + "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", + "dev": true, + "license": "MIT" + }, "node_modules/debug": { "version": "4.4.3", "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", @@ -1449,6 +1629,13 @@ "node": ">= 0.4" } }, + "node_modules/es-module-lexer": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-2.3.2.tgz", + "integrity": "sha512-poHGpORABojJJucnV9KbOavETW8lBVnphkW77ER5/BQ5Fz7oXSoCNek7IH3vR5nRjdsEz926ibFYX8KtLQmdyw==", + "dev": true, + "license": "MIT" + }, "node_modules/es-object-atoms": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.2.tgz", @@ -1539,12 +1726,32 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/estree-walker": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz", + "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.0" + } + }, "node_modules/eventemitter3": { "version": "5.0.4", "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.4.tgz", "integrity": "sha512-mlsTRyGaPBjPedk6Bvw+aqbsXDtoAyAzm5MO7JgU+yVRyMQ5O8bD4Kcci7BS85f93veegeCPkL8R4GLClnjLFw==", "license": "MIT" }, + "node_modules/expect-type": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/expect-type/-/expect-type-1.4.0.tgz", + "integrity": "sha512-KfYbmpRm0VbLjEvVa9yGwCi9GI34xvi7A/HXYWQO65CSD2u3MczUJSuwXKFIxlGsgBQizV9q5J9NHj4VG0n+pA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=12.0.0" + } + }, "node_modules/fdir": { "version": "6.5.0", "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz", @@ -2298,6 +2505,16 @@ "integrity": "sha512-mNAgZ1GmyNhD7AuqnTG3/VQ26o760+ZYBPKjPvugO8+nLbYfX6TVpJPseBvopbdY+qpZ/lKUnmEc1LeZYS3QAA==", "license": "Apache-2.0" }, + "node_modules/magic-string": { + "version": "0.30.21", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.21.tgz", + "integrity": "sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.5" + } + }, "node_modules/math-intrinsics": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", @@ -2380,6 +2597,20 @@ "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" } }, + "node_modules/obug": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/obug/-/obug-2.2.1.tgz", + "integrity": "sha512-XrsrhT5sybtKI6wakr2SPOlGZWWYbUXZ7a0jT8/QOeAPau+1X/bSegNe5YR75oJmEZQbKningirmGOEJCIk61Q==", + "dev": true, + "funding": [ + "https://github.com/sponsors/sxzz", + "https://opencollective.com/debug" + ], + "license": "MIT", + "engines": { + "node": ">=12.20.0" + } + }, "node_modules/onetime": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/onetime/-/onetime-7.0.0.tgz", @@ -2401,6 +2632,13 @@ "integrity": "sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==", "license": "MIT" }, + "node_modules/pathe": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/pathe/-/pathe-2.0.3.tgz", + "integrity": "sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==", + "dev": true, + "license": "MIT" + }, "node_modules/picocolors": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", @@ -2578,6 +2816,13 @@ "node": ">=10" } }, + "node_modules/siginfo": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/siginfo/-/siginfo-2.0.0.tgz", + "integrity": "sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==", + "dev": true, + "license": "ISC" + }, "node_modules/signal-exit": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", @@ -2634,6 +2879,20 @@ "node": ">=0.10.0" } }, + "node_modules/stackback": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/stackback/-/stackback-0.0.2.tgz", + "integrity": "sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==", + "dev": true, + "license": "MIT" + }, + "node_modules/std-env": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/std-env/-/std-env-4.3.0.tgz", + "integrity": "sha512-OtU/EgQ1kIm5KwqQpBC6ZEMXrZRui11w8zgfTWp8cdO9B8OaPsbA8bTHO2P+HNo1VlUTGMVBwPhydu6poeXiag==", + "dev": true, + "license": "MIT" + }, "node_modules/string-width": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", @@ -2899,6 +3158,23 @@ "integrity": "sha512-vgfbwKo8TEJbRsapR9LWWvIJRnv8u9aXVa6cyYOAQQmurCx54Cnt59x5fKdiq+hFaBJ51AbzCgMpbP3p65/pHQ==", "license": "MIT" }, + "node_modules/tinybench": { + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.9.0.tgz", + "integrity": "sha512-0+DUvqWMValLmha6lr4kD8iAMK1HzV0/aKnCtWb9v9641TnP/MFb7Pc2bxoxQjTXAErryXVgUOfv2YqNllqGeg==", + "dev": true, + "license": "MIT" + }, + "node_modules/tinyexec": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-1.3.1.tgz", + "integrity": "sha512-GCvB3aoys96IuDFBMcTB46JOR6mdMtAToqwiW8JlWhsoh1mhHi/xn9ss/Dg7N555GiJyEt2qzoG/NHCwM6h1EA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + } + }, "node_modules/tinyglobby": { "version": "0.2.17", "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.17.tgz", @@ -2915,6 +3191,16 @@ "url": "https://github.com/sponsors/SuperchupuDev" } }, + "node_modules/tinyrainbow": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/tinyrainbow/-/tinyrainbow-3.2.0.tgz", + "integrity": "sha512-LgO3D9yZJjApUiuUfl9iFAwrtaX4+lok3wJIqttGoKCHlWUqHqbQpnxCf82L8FjgKsh4iGo78hqJwgL8F6To2A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14.0.0" + } + }, "node_modules/ts-morph": { "version": "28.0.0", "resolved": "https://registry.npmjs.org/ts-morph/-/ts-morph-28.0.0.tgz", @@ -3034,6 +3320,7 @@ "integrity": "sha512-Ds+gBRbj0lwRO2Y5hwnUBdxSwlAve9LeRyU4sNnAr0ewW0gWF0n5bgXgUzbgZ49MV9BVUAQUFYVcDUcilUExMA==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "lightningcss": "^1.32.0", "picomatch": "^4.0.4", @@ -3106,6 +3393,113 @@ } } }, + "node_modules/vitest": { + "version": "4.1.12", + "resolved": "https://registry.npmjs.org/vitest/-/vitest-4.1.12.tgz", + "integrity": "sha512-5eWdz2yb3ajxWF3C8C4TjkXl7FGm3n2E/VlazALrQHzK7nYMSGFnCZto0bbPNl77AwkOZVLk0YnBAejUu0NiWA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/expect": "4.1.12", + "@vitest/mocker": "4.1.12", + "@vitest/pretty-format": "4.1.12", + "@vitest/runner": "4.1.12", + "@vitest/snapshot": "4.1.12", + "@vitest/spy": "4.1.12", + "@vitest/utils": "4.1.12", + "es-module-lexer": "^2.0.0", + "expect-type": "^1.3.0", + "magic-string": "^0.30.21", + "obug": "^2.1.1", + "pathe": "^2.0.3", + "picomatch": "^4.0.3", + "std-env": "^4.0.0-rc.1", + "tinybench": "^2.9.0", + "tinyexec": "^1.0.2", + "tinyglobby": "^0.2.15", + "tinyrainbow": "^3.1.0", + "vite": "^6.0.0 || ^7.0.0 || ^8.0.0", + "why-is-node-running": "^2.3.0" + }, + "bin": { + "vitest": "vitest.mjs" + }, + "engines": { + "node": "^20.0.0 || ^22.0.0 || >=24.0.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "@edge-runtime/vm": "*", + "@opentelemetry/api": "^1.9.0", + "@types/node": "^20.0.0 || ^22.0.0 || >=24.0.0", + "@vitest/browser-playwright": "4.1.12", + "@vitest/browser-preview": "4.1.12", + "@vitest/browser-webdriverio": "^4.1.11", + "@vitest/coverage-istanbul": "4.1.12", + "@vitest/coverage-v8": "4.1.12", + "@vitest/ui": "4.1.12", + "happy-dom": "*", + "jsdom": "*", + "vite": "^6.0.0 || ^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "@edge-runtime/vm": { + "optional": true + }, + "@opentelemetry/api": { + "optional": true + }, + "@types/node": { + "optional": true + }, + "@vitest/browser-playwright": { + "optional": true + }, + "@vitest/browser-preview": { + "optional": true + }, + "@vitest/browser-webdriverio": { + "optional": true + }, + "@vitest/coverage-istanbul": { + "optional": true + }, + "@vitest/coverage-v8": { + "optional": true + }, + "@vitest/ui": { + "optional": true + }, + "happy-dom": { + "optional": true + }, + "jsdom": { + "optional": true + }, + "vite": { + "optional": false + } + } + }, + "node_modules/why-is-node-running": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-2.3.0.tgz", + "integrity": "sha512-hUrmaWBdVDcxvYqnyh09zunKzROWjbZTiNy8dBEjkS7ehEDQibXJ7XvlmtbwuTclUiIyN+CyXQD4Vmko8fNm8w==", + "dev": true, + "license": "MIT", + "dependencies": { + "siginfo": "^2.0.0", + "stackback": "0.0.2" + }, + "bin": { + "why-is-node-running": "cli.js" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/widest-line": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/widest-line/-/widest-line-3.1.0.tgz", diff --git a/actions/github-action/package.json b/actions/github-action/package.json index 11e664f..38a9723 100644 --- a/actions/github-action/package.json +++ b/actions/github-action/package.json @@ -9,6 +9,7 @@ "generate:github-schemas": "curl -fsSL --create-dirs -o schemas/github-openapi.json https://raw.githubusercontent.com/github/rest-api-description/main/descriptions/api.github.com/api.github.com.json && node ../../scripts/openapi-filter.mjs schemas/github-openapi.json schemas/github-openapi.filtered.json --roots status,check-run,workflow,workflow-run,issue-comment,issue,label,milestone,pull-request-review-comment,pull-request-review,pull-request,pull-request-simple,pull-request-merge-result,release,commit,full-repository,short-branch,branch-with-protection,git-ref,webhook-issues-closed,webhook-issues-opened,webhook-pull-request-closed,webhook-pull-request-opened,webhook-push && node ../../scripts/openapi-to-zod.mjs schemas/github-openapi.filtered.json src/generated/github-schemas.ts", "typecheck": "tsc --noEmit", "build": "vite build", + "test": "vitest run", "start": "node dist/index.js" }, "dependencies": { @@ -19,6 +20,7 @@ "@types/node": "^22.0.0", "tsx": "^4.0.0", "typescript": "^5.9.3", - "vite": "^8.0.3" + "vite": "^8.0.3", + "vitest": "^4.1.10" } } diff --git a/actions/github-action/test/index.test.ts b/actions/github-action/test/index.test.ts new file mode 100644 index 0000000..628baa4 --- /dev/null +++ b/actions/github-action/test/index.test.ts @@ -0,0 +1,8 @@ +import "reflect-metadata"; +import {describe, expect, it} from "vitest"; + +describe("Demo test", () => { + it("Demo test", () => { + expect(true).toEqual(true) + }); +});