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..f262417 --- /dev/null +++ b/actions/github-action/package-lock.json @@ -0,0 +1,3791 @@ +{ + "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.3", + "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" + } + }, + "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.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", + "@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/@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", + "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/@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", + "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/@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", + "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/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", + "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/@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", + "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/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", + "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/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", + "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/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", + "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-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", + "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/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", + "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", + "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/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", + "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/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", + "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/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", + "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/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", + "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/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", + "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/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", + "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/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", + "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/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", + "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..703bf5c --- /dev/null +++ b/actions/github-action/package.json @@ -0,0 +1,28 @@ +{ + "name": "@code0-tech/github-action", + "version": "1.0.0", + "private": true, + "type": "module", + "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" + }, + "dependencies": { + "@code0-tech/hercules": "^1.0.3", + "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" + } +} 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/issues/githubIssue.ts b/actions/github-action/src/data_types/issues/githubIssue.ts new file mode 100644 index 0000000..b2835cf --- /dev/null +++ b/actions/github-action/src/data_types/issues/githubIssue.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 GitHubIssueSchema = z.looseObject({}) as unknown as z.ZodType +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/issues/githubIssueRequests.ts b/actions/github-action/src/data_types/issues/githubIssueRequests.ts new file mode 100644 index 0000000..0260788 --- /dev/null +++ b/actions/github-action/src/data_types/issues/githubIssueRequests.ts @@ -0,0 +1,35 @@ +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 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/pullRequests/githubPullRequest.ts b/actions/github-action/src/data_types/pullRequests/githubPullRequest.ts new file mode 100644 index 0000000..e4659c3 --- /dev/null +++ b/actions/github-action/src/data_types/pullRequests/githubPullRequest.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 GitHubPullRequestSchema = z.looseObject({}) as unknown as z.ZodType +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/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/pullRequests/githubPullRequestRequests.ts b/actions/github-action/src/data_types/pullRequests/githubPullRequestRequests.ts new file mode 100644 index 0000000..aae1b61 --- /dev/null +++ b/actions/github-action/src/data_types/pullRequests/githubPullRequestRequests.ts @@ -0,0 +1,34 @@ +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 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/repositories/githubRepository.ts b/actions/github-action/src/data_types/repositories/githubRepository.ts new file mode 100644 index 0000000..90e3653 --- /dev/null +++ b/actions/github-action/src/data_types/repositories/githubRepository.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 GitHubRepositorySchema = z.looseObject({}) as unknown as z.ZodType +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/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/webhooks/githubIssueClosedWebhookPayload.ts b/actions/github-action/src/data_types/webhooks/githubIssueClosedWebhookPayload.ts new file mode 100644 index 0000000..d2ee44f --- /dev/null +++ b/actions/github-action/src/data_types/webhooks/githubIssueClosedWebhookPayload.ts @@ -0,0 +1,16 @@ +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.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" }) +@DisplayMessage({ code: "en-US", content: "GitHub issue closed webhook payload" }) +@Schema(GitHubIssueClosedWebhookPayloadSchema) +export class GitHubIssueClosedWebhookPayloadDataType {} diff --git a/actions/github-action/src/data_types/webhooks/githubIssueOpenedWebhookPayload.ts b/actions/github-action/src/data_types/webhooks/githubIssueOpenedWebhookPayload.ts new file mode 100644 index 0000000..9637292 --- /dev/null +++ b/actions/github-action/src/data_types/webhooks/githubIssueOpenedWebhookPayload.ts @@ -0,0 +1,16 @@ +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.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" }) +@DisplayMessage({ code: "en-US", content: "GitHub issue opened webhook payload" }) +@Schema(GitHubIssueOpenedWebhookPayloadSchema) +export class GitHubIssueOpenedWebhookPayloadDataType {} diff --git a/actions/github-action/src/data_types/webhooks/githubPullRequestClosedWebhookPayload.ts b/actions/github-action/src/data_types/webhooks/githubPullRequestClosedWebhookPayload.ts new file mode 100644 index 0000000..863a35f --- /dev/null +++ b/actions/github-action/src/data_types/webhooks/githubPullRequestClosedWebhookPayload.ts @@ -0,0 +1,16 @@ +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.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" }) +@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/webhooks/githubPullRequestOpenedWebhookPayload.ts b/actions/github-action/src/data_types/webhooks/githubPullRequestOpenedWebhookPayload.ts new file mode 100644 index 0000000..9b97500 --- /dev/null +++ b/actions/github-action/src/data_types/webhooks/githubPullRequestOpenedWebhookPayload.ts @@ -0,0 +1,16 @@ +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.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" }) +@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/webhooks/githubPush.ts b/actions/github-action/src/data_types/webhooks/githubPush.ts new file mode 100644 index 0000000..1dc5d37 --- /dev/null +++ b/actions/github-action/src/data_types/webhooks/githubPush.ts @@ -0,0 +1,17 @@ +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.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" }) +@DisplayMessage({ code: "en-US", content: "GitHub push webhook payload" }) +@Schema(GitHubPushWebhookPayloadSchema) +export class GitHubPushWebhookPayloadDataType {} diff --git a/actions/github-action/src/events/githubIssueClosedWebhook.ts b/actions/github-action/src/events/githubIssueClosedWebhook.ts new file mode 100644 index 0000000..b8891b2 --- /dev/null +++ b/actions/github-action/src/events/githubIssueClosedWebhook.ts @@ -0,0 +1,23 @@ +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, 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", +}) +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..e7c4b53 --- /dev/null +++ b/actions/github-action/src/events/githubIssueOpenedWebhook.ts @@ -0,0 +1,23 @@ +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, 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", +}) +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..39dda4d --- /dev/null +++ b/actions/github-action/src/events/githubPullRequestClosedWebhook.ts @@ -0,0 +1,23 @@ +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, 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", +}) +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..30f4b1a --- /dev/null +++ b/actions/github-action/src/events/githubPullRequestOpenedWebhook.ts @@ -0,0 +1,23 @@ +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, 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", +}) +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..425520b --- /dev/null +++ b/actions/github-action/src/events/githubRepositoryPushWebhook.ts @@ -0,0 +1,23 @@ +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, input_schema?: GitHubPushWebhookPayload): REST_ADAPTER_INPUT") +@EventSetting({ + identifier: "input_schema", + hidden: true, +}) +@EventSetting({ + identifier: "httpMethod", + hidden: true, + defaultValue: "POST", +}) +@EventSetting({ + identifier: "httpSchema", + hidden: true, + defaultValue: "application/json", +}) +export class GitHubRepositoryPushWebhook extends Rest {} 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 new file mode 100644 index 0000000..6e96dfb --- /dev/null +++ b/actions/github-action/src/functions/issues/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/issues/githubIssue.js" +import { GitHubCreateIssueRequest } from "../../data_types/issues/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/issues/getIssueFunction.ts b/actions/github-action/src/functions/issues/getIssueFunction.ts new file mode 100644 index 0000000..ec06394 --- /dev/null +++ b/actions/github-action/src/functions/issues/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/issues/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/issues/getIssuesFunction.ts b/actions/github-action/src/functions/issues/getIssuesFunction.ts new file mode 100644 index 0000000..b8f0b16 --- /dev/null +++ b/actions/github-action/src/functions/issues/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/issues/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/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 new file mode 100644 index 0000000..430c27b --- /dev/null +++ b/actions/github-action/src/functions/issues/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/issues/githubIssue.js" +import { GitHubUpdateIssueRequest } from "../../data_types/issues/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/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 new file mode 100644 index 0000000..173bd81 --- /dev/null +++ b/actions/github-action/src/functions/pullRequests/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/pullRequests/githubPullRequest.js" +import { GitHubCreatePullRequestRequest } from "../../data_types/pullRequests/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/pullRequests/getPullRequestFunction.ts b/actions/github-action/src/functions/pullRequests/getPullRequestFunction.ts new file mode 100644 index 0000000..9ca8a76 --- /dev/null +++ b/actions/github-action/src/functions/pullRequests/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/pullRequests/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/pullRequests/getPullRequestsFunction.ts b/actions/github-action/src/functions/pullRequests/getPullRequestsFunction.ts new file mode 100644 index 0000000..4f6161f --- /dev/null +++ b/actions/github-action/src/functions/pullRequests/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/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[]') +@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/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 new file mode 100644 index 0000000..dd0f422 --- /dev/null +++ b/actions/github-action/src/functions/pullRequests/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/pullRequests/githubPullRequest.js" +import { GitHubUpdatePullRequestRequest } from "../../data_types/pullRequests/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/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 new file mode 100644 index 0000000..079eabf --- /dev/null +++ b/actions/github-action/src/functions/repositories/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/repositories/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..500847b --- /dev/null +++ b/actions/github-action/src/index.ts @@ -0,0 +1,290 @@ +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" +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" +// import { GitHubPullRequestOpenedWebhook } from "./events/githubPullRequestOpenedWebhook.js" +// import { GitHubRepositoryPushWebhook } from "./events/githubRepositoryPushWebhook.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(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(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) +// action.registerEventClass(GitHubPullRequestClosedWebhook) +// action.registerEventClass(GitHubIssueOpenedWebhook) +// action.registerEventClass(GitHubIssueClosedWebhook) + +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 ?? "token_abc1234").catch((reconnectError: unknown) => { + console.error("Reconnect failed:", reconnectError) + }) + }, 5000) +}) + +action.connect(process.env.AUTH_TOKEN ?? "token_abc1234").catch((error: unknown) => { + console.error("Failed to connect:", error) + process.exit(1) +}) + +action.on(CodeZeroEvent.moduleUpdated, (message: any) => { + console.dir(message, { depth: null }) + console.dir(action.configs.values(), { depth: null }) +}) + +export { action } 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) +} 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..6cd60b0 --- /dev/null +++ b/actions/github-action/vite.config.ts @@ -0,0 +1,12 @@ +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:"), + }, + }, +})